Skip to content
Snippets Groups Projects
Commit e8745395 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA :bicyclist:
Browse files

Merge branch 'redmine-issues/11875' into 'develop'

parents 06798fd6 0a9f740c
No related branches found
No related tags found
No related merge requests found
......@@ -386,21 +386,22 @@ export default {
if (this.project) {
const isModerate = this.project.moderation;
const userStatus = this.USER_LEVEL_PROJECTS[this.project.slug];
//* si admin ou modérateur, statuts toujours disponible : Brouillon, Publié, Archivé
const isOwnFeature = this.feature //* prevent undefined feature
? this.feature.creator === this.user.id
: false; //* si le contributeur est l'auteur du signalement
if (
//* si admin ou modérateur, statuts toujours disponible : Brouillon, Publié, Archivé
userStatus === "Modérateur" ||
userStatus === "Administrateur projet"
) {
return this.statusChoices.filter((el) => el.value !== "pending");
} else if (userStatus === "Contributeur") {
//* cas particuliers du contributeur
if (
this.currentRouteName === "editer-signalement" &&
this.project.creator === this.user.id
this.currentRouteName === "ajouter-signalement" ||
!isOwnFeature
) {
//* IF création de project
return this.statusChoices.filter((el) => el.value === "draft");
} else {
//* ELSE édition de projet
//* 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"
......@@ -408,6 +409,15 @@ export default {
: 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"
);
}
}
}
......@@ -529,6 +539,7 @@ export default {
}); // * create an object with the counter in store
this.attachmentDataKey += 1; // * increment counter for key in v-for
},
addAttachment(attachment) {
console.log(attachment);
this.$store.commit("feature/ADD_ATTACHMENT_FORM", {
......@@ -541,6 +552,7 @@ export default {
});
this.attachmentDataKey += 1;
},
addExistingAttachementFormset(attachementFormset) {
for (const attachment of attachementFormset) {
this.addAttachment(attachment);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment