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

Merge branch 'ticket/11745v2' into 'develop'

add filter status feature

See merge request geocontrib/geocontrib-frontend!27
parents 5facc0f7 c73af19f
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@
form.status.label
}}</label>
<Dropdown
:options="statusChoices"
:options="statusChoicesFilter"
:selected="selected_status.name"
:selection.sync="selected_status"
/>
......@@ -272,13 +272,24 @@ export default {
erreurUploadMessage: null,
attachmentDataKey: 0,
linkedDataKey: 0,
statusChoicesFilter:[],
statusChoices: [
{
name: "Brouillon",
value: "draft",
},
{ name: "Publié", value: "published" },
{ name: "Archivé", value: "archived" },
{
name: "Publié",
value: "published"
},
{
name: "Archivé",
value: "archived"
},
{
name: "En attente de publication",
value: "pending"
},
],
form: {
title: {
......@@ -317,7 +328,7 @@ export default {
},
computed: {
...mapState(["project"]),
// ...mapState(["project"]),
...mapState("map", ["basemaps"]),
...mapState("feature", [
"attachmentFormset",
......@@ -372,6 +383,20 @@ export default {
},
methods: {
makeStatusChoicesFilter(){
let newStatusChoices = this.statusChoices
if (this.project){
if (!this.project.moderation){
newStatusChoices = []
this.statusChoices.forEach(function(status) {
if (status.value !== 'pending') {
newStatusChoices.push(status)
}
});
}
}
this.statusChoicesFilter = newStatusChoices
},
initForm() {
if (this.currentRouteName === "editer-signalement") {
for (let key in this.feature) {
......@@ -858,6 +883,8 @@ export default {
created() {
if (!this.project) {
this.project = this.$store.state.projects.find((project) => project.slug === this.$store.state.project_slug);
this.makeStatusChoicesFilter();
this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug);
}
this.$store.commit(
......
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