Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Trèfle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open source
Trèfle
Commits
ba4f1f98
Commit
ba4f1f98
authored
Mar 17, 2020
by
David Foucher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beautify-rules' into 'vue-editor'
Fixing bugs See merge request
!26
parents
5b8924e8
c4e1a73d
Pipeline
#2376
passed with stages
in 9 minutes and 21 seconds
Changes
7
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
42 deletions
+90
-42
backoffice/src/App.vue
backoffice/src/App.vue
+13
-0
backoffice/src/components/Accueil.vue
backoffice/src/components/Accueil.vue
+26
-16
backoffice/src/components/Financements.vue
backoffice/src/components/Financements.vue
+1
-1
backoffice/src/components/Modification.vue
backoffice/src/components/Modification.vue
+2
-1
backoffice/src/components/Referentiel.vue
backoffice/src/components/Referentiel.vue
+4
-4
backoffice/src/components/Rule.vue
backoffice/src/components/Rule.vue
+43
-19
backoffice/vue.config.js
backoffice/vue.config.js
+1
-1
No files found.
backoffice/src/App.vue
View file @
ba4f1f98
...
...
@@ -201,6 +201,19 @@
background-color
:
#384EAA
;
color
:
white
;
}
.main-button
:hover:disabled
{
border
:
1px
solid
#384EAA
;
background-color
:
#BDBADE
;
color
:
black
;
}
.main-button-primary
{
background-color
:
#384EAA
;
color
:
white
;
}
.main-button-primary
:hover
{
background-color
:
#0D0850
;
color
:
white
;
}
.loading-gif
{
padding-top
:
8rem
;
}
...
...
backoffice/src/components/Accueil.vue
View file @
ba4f1f98
...
...
@@ -12,29 +12,36 @@
</div>
</div>
<div
class=
"row mt-3"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4
col-sm-12
"
>
<div
id=
"chart-container"
>
<ModificationChart
@
on-receive=
"update"
:values=
"modification_chart_datas.datasets"
:labels=
"modification_chart_datas.labels"
></ModificationChart>
</div>
</div>
<div
class=
"col-md-8"
>
<div
id=
"modification_list"
>
<div
v-if=
"selected_rule"
>
<h5>
Modification(s) de la règle
{{
selected_rule
}}
(
{{
Object
.
keys
(
selected_modification_list
).
length
}}
)
</h5>
<ul
v-for=
"modification in selected_modification_list"
:key=
"modification.id"
class=
"dash"
>
<li>
<a
:href=
"'referentiel#'+selected_rule+'.rules#modified'"
>
{{
modification
.
title
}}
</a>
</li>
</ul>
</div>
<div
v-else
>
<h5>
Toutes les modifications (
{{
Object
.
keys
(
modification_list
).
length
}}
)
</h5>
<ul
v-for=
"modification in modification_list"
:key=
"modification.id"
class=
"dash"
>
<li>
{{
modification
.
title
}}
</li>
</ul>
<div
v-if=
"!isLoading"
>
<div
class=
"col-md-8 col-sm-12"
>
<div
id=
"modification_list"
>
<div
v-if=
"selected_rule"
>
<h5>
Modification(s) de la règle en cours de validation
{{
selected_rule
}}
(
{{
Object
.
keys
(
selected_modification_list
).
length
}}
)
</h5>
<ul
v-for=
"modification in selected_modification_list"
:key=
"modification.id"
class=
"dash"
>
<li>
<a
:href=
"'referentiel#'+selected_rule+'.rules#modified'"
>
{{
modification
.
title
}}
</a>
</li>
</ul>
</div>
<div
v-else
>
<h5>
Toutes les modifications en cours de validation (
{{
Object
.
keys
(
modification_list
).
length
}}
)
</h5>
<ul
v-for=
"modification in modification_list"
:key=
"modification.id"
class=
"dash"
>
<li>
<a
:href=
"'referentiel#'+modification.file.split('/').pop().split('.')[0]+'.rules#modified'"
>
{{
modification
.
title
}}
- (
{{
modification
.
file
.
split
(
'
/
'
).
pop
().
split
(
'
.
'
)[
0
]
}}
)
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div
v-else
class=
"text-center loading-gif"
>
<img
src=
"./../assets/images/loading.gif"
alt=
"loading..."
>
</div>
</div>
</div>
</div>
...
...
@@ -54,6 +61,7 @@
selected_modification_list
:
{},
selected_rule
:
''
,
test
:
0
,
isLoading
:
true
,
}
},
beforeMount
:
function
()
{
...
...
@@ -65,9 +73,11 @@
.
get
(
'
/source/modified
'
)
.
then
(
response
=>
{
this
.
modification_list
=
response
.
body
;
this
.
isLoading
=
false
;
return
true
;
},
response
=>
{
if
(
response
.
status
==
500
)
this
.
modification_list
=
{};
this
.
isLoading
=
false
;
return
false
;
})
},
...
...
backoffice/src/components/Financements.vue
View file @
ba4f1f98
...
...
@@ -13,7 +13,7 @@
<div
id=
"financement-create-financement"
class=
"col-md-6 col-sm-12 col-xs-12 my-auto"
>
<div
class=
"form-inline pull-right"
>
<div
class=
"form-group mx-sm-3 mb-2"
>
<input
type=
"button"
href=
"#"
class=
"btn
btn-outline-success
form-control"
value=
"Créer un financement"
disabled
/>
<input
type=
"button"
href=
"#"
class=
"btn
main-button
form-control"
value=
"Créer un financement"
disabled
/>
</div>
</div>
</div>
...
...
backoffice/src/components/Modification.vue
View file @
ba4f1f98
...
...
@@ -53,7 +53,8 @@
'
tag-file-renamed
'
:
'
<span class="d2h-tag d2h-moved d2h-moved-tag">RENOMMÉ</span>
'
,
'
tag-file-added
'
:
'
<span class="d2h-tag d2h-added d2h-added-tag">AJOUTÉ</span>
'
,
'
file-summary-wrapper
'
:
'
<div class="d2h-file-list-wrapper"><div class="d2h-file-list-header"><span class="d2h-file-list-title">Fichiers modifiés ({{filesNumber}})</span><a class="d2h-file-switch d2h-hide">cacher</a><a class="d2h-file-switch d2h-show">show</a></div><ol class="d2h-file-list">{{{files}}}</ol></div>
'
,
'
generic-wrapper
'
:
'
<div class="d2h-wrapper">{{{content}}}</div>
'
'
generic-wrapper
'
:
'
<div class="d2h-wrapper">{{{content}}}</div>
'
,
'
file-summary-line
'
:
'
<li class="d2h-file-list-line"><span class="d2h-file-name-wrapper">{{>fileIcon}}<a href="#
'
+
this
.
modification
.
file
.
split
(
'
/
'
).
pop
()
+
'
" class="d2h-file-name">{{fileName}}</a><span class="d2h-file-stats"><span class="d2h-lines-added">{{addedLines}}</span><span class="d2h-lines-deleted">{{deletedLines}}</span></span></span></li>
'
}
});
},
...
...
backoffice/src/components/Referentiel.vue
View file @
ba4f1f98
...
...
@@ -78,14 +78,14 @@
},
printRulePath
:
function
()
{
var
path
=
""
;
var
printpath
=
"
(
"
;
var
printpath
=
""
;
if
(
this
.
windowLocationHash
.
split
(
'
#
'
).
length
-
1
>
1
)
{
for
(
var
i
=
1
;
i
<=
this
.
windowLocationHash
.
split
(
'
#
'
).
length
-
1
;
i
++
)
{
if
(
this
.
windowLocationHash
.
split
(
'
#
'
).
pop
()
==
'
modified
'
)
return
""
;
path
+=
"
#
"
+
this
.
windowLocationHash
.
split
(
'
#
'
)[
i
];
if
(
i
==
this
.
windowLocationHash
.
split
(
'
#
'
).
length
-
1
)
printpath
+=
"
<a href='
"
+
path
+
"
'>
"
+
this
.
windowLocationHash
.
split
(
'
#
'
)[
i
]
+
"
</a>
"
else
printpath
+=
"
<a
href='
"
+
path
+
"
'>
"
+
this
.
windowLocationHash
.
split
(
'
#
'
)[
i
]
+
"
</a>
>
"
;
}
return
printpath
+
"
)
"
;
if
(
i
==
this
.
windowLocationHash
.
split
(
'
#
'
).
length
-
1
)
printpath
+=
"
<a
class='btn main-button'
href='
"
+
path
+
"
'>
"
+
this
.
windowLocationHash
.
split
(
'
#
'
)[
i
]
+
"
</a>
"
else
printpath
+=
"
<a
class='btn main-button' href='
"
+
path
+
"
'>
"
+
this
.
windowLocationHash
.
split
(
'
#
'
)[
i
]
+
"
</a> <b>></b
>
"
;
}
return
printpath
;
}
else
return
""
;
},
rulePath
:
function
()
{
...
...
backoffice/src/components/Rule.vue
View file @
ba4f1f98
...
...
@@ -7,11 +7,16 @@
<h5>
<span
style=
"vertical-align:-30%"
>
{{
displayedName
}}
</span>
</h5>
<a
:href=
"'#'+name+'#modified'"
v-if=
"this.modification_count"
@
click=
"displayModification()"
id=
"modification_link"
>
(
{{
this
.
modification_count
}}
modification
<span
v-if=
"this.modification_count > 1"
>
s
</span>
en cours)
</a>
<div
v-if=
"this.modifiedHashFlag"
>
<a
:href=
"'#'+name"
v-if=
"this.modification_count"
@
click=
"displayList()"
id=
"modification_link"
>
Retour à la liste
</a>
</div>
<div
v-else
>
<a
:href=
"'#'+name+'#modified'"
v-if=
"this.modification_count"
@
click=
"displayModification()"
id=
"modification_link"
>
(
{{
this
.
modification_count
}}
modification
<span
v-if=
"this.modification_count > 1"
>
s
</span>
en cours)
</a>
</div>
</div>
<div
class=
"col-md-6 col-sm-12 col-xs-12"
>
<h4
v-if=
"isEditMode"
class=
"pull-right"
><em>
Modification de la règle
</em></h4>
<input
v-else
v-b-modal.auth-modal
type=
"button"
class=
"main-button btn pull-right"
value=
"Soumettre une modification"
/>
<input
v-else
v-b-modal.auth-modal
type=
"button"
class=
"main-button
-primary
btn pull-right"
value=
"Soumettre une modification"
/>
<!-- TODO: show gitlab link of modification if exists -->
</div>
</div>
...
...
@@ -32,15 +37,15 @@
</ul>
</div>
<div
v-show=
"isEditMode"
>
<div
class=
"row mb-3"
>
<div
class=
"col-md-6 pl-0"
>
<input
@
click=
"closeEdit"
type=
"button"
class=
"btn btn-outline-danger pull-left"
value=
"Annuler"
/>
</div>
<div
class=
"col-md-6 pr-0"
>
<button
v-b-modal.mail-modal
class=
"btn btn-outline-success pull-right"
>
Enregistrer
</button>
</div>
</div>
<div
class=
"container"
>
<div
class=
"row mb-3"
>
<div
class=
"col-md-6 pl-0"
>
<input
@
click=
"closeEdit"
type=
"button"
class=
"btn btn-outline-danger pull-left"
value=
"Annuler"
/>
</div>
<div
class=
"col-md-6 pr-0"
>
<button
v-b-modal.mail-modal
class=
"btn main-button-primary pull-right"
>
Enregistrer
</button>
</div>
</div>
<div
class=
"row mb-3"
>
<label
for=
"content"
><u>
Contenu de la règle
</u></label>
<textarea-autosize
id=
"content"
v-model=
"content"
class=
"rule-modification-text"
:class=
"
{editErrorClass: error_flags.notModified }">
</textarea-autosize>
...
...
@@ -51,7 +56,7 @@
<input
@
click=
"closeEdit"
type=
"button"
class=
"btn btn-outline-danger pull-left"
value=
"Annuler"
/>
</div>
<div
class=
"col-md-6 pr-0"
>
<button
v-b-modal.mail-modal
class=
"btn
btn-outline-success
pull-right"
>
Enregistrer
</button>
<button
v-b-modal.mail-modal
class=
"btn
main-button-primary
pull-right"
>
Enregistrer
</button>
</div>
</div>
</div>
...
...
@@ -65,7 +70,7 @@
<span
v-if=
"error_flags.noPass"
class=
"text-danger font-weight-light"
>
Ce champ est obligatoire
<br></span>
<span
v-if=
"!error_flags.noUser && !error_flags.noPass"
class=
"font-weight-light"
>
* Champs obligatoires
<br></span>
<template
v-slot:modal-footer
>
<input
@
click=
"auth_to_edit"
type=
"button"
class=
"btn
btn-outline-success
pull-right"
value=
"Suivant"
/>
<input
@
click=
"auth_to_edit"
type=
"button"
class=
"btn
main-button-primary
pull-right"
value=
"Suivant"
/>
</
template
>
</b-modal>
...
...
@@ -75,7 +80,7 @@
<span
v-if=
"error_flags.noResume"
class=
"text-danger font-weight-light"
>
Ce champ est obligatoire
</span>
<span
v-if=
"!error_flags.noUser && !error_flags.noResume"
class=
"font-weight-light"
>
* Champ obligatoire
</span>
<
template
v-slot:modal-footer
>
<input
@
click=
"save"
type=
"button"
class=
"btn
btn-outline-success
pull-right"
value=
"Enregistrer"
/>
<input
@
click=
"save"
type=
"button"
class=
"btn
main-button-primary
pull-right"
value=
"Enregistrer"
/>
</
template
>
</b-modal>
...
...
@@ -105,6 +110,8 @@
props
:
[
'
name
'
,
'
data
'
,
'
path
'
,
'
printRulePath
'
,
'
rulePath
'
],
data
:
function
(){
return
{
windowLocationHash
:
''
,
modifiedHashFlag
:
decodeURI
(
window
.
location
.
hash
).
split
(
'
#
'
).
pop
()
==
"
modified
"
,
isLoading
:
true
,
ruleData
:
this
.
data
,
modification_list
:
[],
...
...
@@ -126,11 +133,13 @@
},
}
},
beforeMount
:
function
()
{
created
:
function
()
{
this
.
loadInProgressModification
();
if
(
decodeURI
(
window
.
location
.
hash
).
split
(
'
#
'
).
pop
()
==
"
modified
"
)
{
this
.
displayModification
();
}
this
.
updateLayout
();
window
.
addEventListener
(
'
popstate
'
,
()
=>
{
this
.
updateLayout
();
})
},
computed
:
{
displayedName
:
function
()
{
...
...
@@ -147,6 +156,17 @@
},
},
methods
:
{
updateLayout
:
function
()
{
this
.
windowLocationHash
=
decodeURI
(
window
.
location
.
hash
);
this
.
modifiedHashFlag
=
decodeURI
(
window
.
location
.
hash
).
split
(
'
#
'
).
pop
()
==
"
modified
"
;
if
(
this
.
modifiedHashFlag
)
{
this
.
currentRuleName
=
decodeURI
(
window
.
location
.
hash
).
split
(
'
#
'
)[
1
];
this
.
displayModification
();
}
else
{
this
.
currentRuleName
=
decodeURI
(
window
.
location
.
hash
).
split
(
'
#
'
).
pop
();
this
.
viewModification
=
false
;
}
},
loadInProgressModification
:
function
()
{
this
.
$http
.
get
(
'
/source/modified?branch=
'
+
encodeURIComponent
(
this
.
displayedName
))
...
...
@@ -210,7 +230,6 @@
};
},
save
:
function
()
{
console
.
log
(
'
test
'
);
this
.
ruleData
=
this
.
content
if
(
this
.
comment
==
''
)
{
this
.
error_flags
.
noResume
=
true
;
...
...
@@ -302,7 +321,12 @@
return
root
;
},
displayModification
:
function
()
{
this
.
viewModification
=
!
this
.
viewModification
;
this
.
viewModification
=
true
;
this
.
$parent
.
collapsed
=
true
;
this
.
isEditMode
=
false
;
},
displayList
:
function
()
{
this
.
viewModification
=
false
;
this
.
$parent
.
collapsed
=
true
;
this
.
isEditMode
=
false
;
}
...
...
backoffice/vue.config.js
View file @
ba4f1f98
...
...
@@ -2,6 +2,6 @@ module.exports = {
publicPath
:
"
/0.7/explorer/
"
,
assetsDir
:
"
src/assets/
"
,
devServer
:
{
proxy
:
'
https://trefle.beta.pole-emploi.fr/0.
6
/
'
proxy
:
'
https://trefle.beta.pole-emploi.fr/0.
7
/
'
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment