Skip to content
Snippets Groups Projects
Commit c73af19f authored by leandro's avatar leandro
Browse files

add filter status feature

parent 5e03c577
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