Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
03cbc800
Commit
03cbc800
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
modify status edition rights for feature list table
parent
9eb64fbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!295
Version 3.0.0
,
!284
REDMINE_ISSUE-11834
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/feature/FeatureListTable.vue
+2
-2
2 additions, 2 deletions
src/components/feature/FeatureListTable.vue
src/views/feature/Feature_list.vue
+20
-41
20 additions, 41 deletions
src/views/feature/Feature_list.vue
with
22 additions
and
43 deletions
src/components/feature/FeatureListTable.vue
+
2
−
2
View file @
03cbc800
...
...
@@ -412,8 +412,8 @@ export default {
canEditFeature
(
feature
)
{
const
permissions
=
{
'
Administrateur projet
'
:
[
'
draft
'
,
'
published
'
,
'
archived
'
],
Modérateur
:
[
'
pending
'
,
'
published
'
],
'
Administrateur projet
'
:
[
'
draft
'
,
'
pending
'
,
'
published
'
,
'
archived
'
],
Modérateur
:
[
'
draft
'
,
'
pending
'
,
'
published
'
],
'
Super Contributeur
'
:
[
'
draft
'
,
'
pending
'
,
'
published
'
],
Contributeur
:
[
'
draft
'
,
'
pending
'
,
'
published
'
],
};
...
...
This diff is collapsed.
Click to expand it.
src/views/feature/Feature_list.vue
+
20
−
41
View file @
03cbc800
...
...
@@ -346,47 +346,26 @@ export default {
if
(
this
.
project
)
{
const
isModerate
=
this
.
project
.
moderation
;
const
userStatus
=
this
.
USER_LEVEL_PROJECTS
[
this
.
project
.
slug
];
const
isOwnFeature
=
this
.
feature
?
this
.
feature
.
creator
===
this
.
user
.
id
//* prevent undefined feature
:
false
;
//* si le contributeur est l'auteur du signalement
if
(
//* si admin, modérateur ou super contributeur, statuts toujours disponible: Brouillon, Publié, Archivé
userStatus
===
'
Administrateur projet
'
||
(
userStatus
===
'
Super Contributeur
'
&&
!
isModerate
)
)
{
return
this
.
statusChoices
.
filter
((
el
)
=>
el
.
value
!==
'
pending
'
);
}
else
if
(
userStatus
===
'
Super Contributeur
'
&&
isModerate
)
{
return
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
pending
'
);
}
else
if
(
userStatus
===
'
Modérateur
'
)
{
return
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
published
'
);
}
else
if
(
userStatus
===
'
Contributeur
'
)
{
//* cas particuliers du contributeur
if
(
this
.
currentRouteName
===
'
ajouter-signalement
'
||
!
isOwnFeature
)
{
//* même cas à l'ajout d'une feature ou si feature n'a pas été créé par le contributeur
return
isModerate
?
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
pending
'
)
:
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
published
'
);
}
else
{
//* à l'édition d'une feature et si le contributeur est l'auteur de la feature
return
isModerate
?
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
!==
'
published
'
//* toutes sauf "Publié"
)
:
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
!==
'
pending
'
//* toutes sauf "En cours de publication"
);
}
switch
(
userStatus
)
{
case
'
Administrateur projet
'
:
//* ajout de 'pending' si projet modéré
return
isModerate
?
this
.
statusChoices
:
this
.
statusChoices
.
filter
((
el
)
=>
el
.
value
!==
'
pending
'
);
case
'
Modérateur
'
:
console
.
log
(
'
Modérateur
'
,
isModerate
);
return
isModerate
?
this
.
statusChoices
.
filter
((
el
)
=>
el
.
value
!==
'
archived
'
)
:
//* ajout de 'pending' si projet modéré
this
.
statusChoices
.
filter
(
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
published
'
);
case
'
Super Contributeur
'
:
case
'
Contributeur
'
:
return
isModerate
?
this
.
statusChoices
.
filter
((
el
)
=>
el
.
value
===
'
draft
'
)
:
this
.
statusChoices
.
filter
(
//* ajout de 'published' si projet non-modéré
(
el
)
=>
el
.
value
===
'
draft
'
||
el
.
value
===
'
published
'
);
}
}
return
[];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment