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

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

REDMINE_ISSUE-12028

See merge request !108
parents faaff510 5e76116b
No related branches found
No related tags found
1 merge request!108REDMINE_ISSUE-12028
......@@ -20,6 +20,24 @@ const feature = {
form: null,
linkedFormset: [],
linked_features: [],
statusChoices: [
{
name: "Brouillon",
value: "draft",
},
{
name: "Publié",
value: "published",
},
{
name: "Archivé",
value: "archived",
},
{
name: "En attente de publication",
value: "pending",
},
],
},
mutations: {
SET_FEATURES(state, features) {
......
......@@ -72,17 +72,11 @@
<td>
<b>
<i
v-if="
field.field_type === 'boolean' && field.value === true
"
class="olive check icon"
></i>
<i
v-else-if="
field.field_type === 'boolean' &&
field.value === false
"
class="red times icon"
v-if="field.field_type === 'boolean'"
:class="[
'icon',
field.value ? 'olive check' : 'grey times',
]"
></i>
<span v-else>
{{ field.value }}
......@@ -98,11 +92,8 @@
<tr>
<td>Statut</td>
<td>
<i
v-if="feature.status"
:class="getIconLabelStatus(feature.status, 'icon')"
></i>
{{ getIconLabelStatus(feature.status, "label") }}
<i v-if="feature.status" :class="['icon', statusIcon]"></i>
{{ statusLabel }}
</td>
</tr>
<tr>
......@@ -144,20 +135,6 @@
<a @click="pushNgo(link)">{{ link.feature_to.title }} </a>
({{ link.feature_to.display_creator }} -
{{ link.feature_to.created_on }})
<!-- <router-link
:key="$route.fullPath"
:to="{
name: 'details-signalement',
params: {
slug_type_signal: link.feature_to.feature_type_slug,
slug_signal: link.feature_to.feature_id,
},
}"
>{{ link.feature_to.title }}</router-link
>
({{ link.feature_to.display_creator }} -
{{ link.feature_to.created_on }})
-->
</td>
</tr>
</tbody>
......@@ -414,7 +391,7 @@ export default {
computed: {
...mapState(["user"]),
...mapGetters(["permissions"]),
...mapState("feature", ["linked_features"]),
...mapState("feature", ["linked_features", "statusChoices"]),
DJANGO_BASE_URL: function () {
return this.$store.state.configuration.VUE_APP_DJANGO_BASE;
},
......@@ -432,6 +409,28 @@ export default {
}
return false;
},
statusIcon() {
switch (this.feature.status) {
case "archived":
return "grey archive";
case "pending":
return "teal hourglass outline";
case "published":
return "olive check";
case "draft":
return "orange pencil alternate";
default:
return "";
}
},
statusLabel() {
const status = this.statusChoices.find(
(el) => el.value === this.feature.status
);
return status ? status.name : "";
},
},
filters: {
......@@ -443,20 +442,6 @@ export default {
},
methods: {
getIconLabelStatus(status, type) {
if (status === "archived")
if (type == "icon") return "grey archive icon";
else return "Archivé";
else if (status === "pending")
if (type == "icon") return "teal hourglass outline icon";
else return "En attente de publication";
else if (status === "published")
if (type == "icon") return "olive check icon";
else return "Publié";
else if (status === "draft")
if (type == "icon") return "orange pencil alternate icon";
else return "Brouillon";
},
pushNgo(link) {
this.$router.push({
name: "details-signalement",
......@@ -469,8 +454,6 @@ export default {
this.getFeatureAttachments();
this.getLinkedFeatures();
this.addFeatureToMap();
//this.initMap();
//this.$router.go();
},
postComment() {
......@@ -490,7 +473,6 @@ export default {
})
.then(() => {
this.confirmComment();
//this.getFeatureAttachments(); //* display new attachment from comment on the page
});
} else {
this.confirmComment();
......@@ -670,9 +652,6 @@ export default {
},
created() {
// if (!this.project) {
// this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug);
// }
this.$store.commit(
"feature_type/SET_CURRENT_FEATURE_TYPE_SLUG",
this.$route.params.slug_type_signal
......
......@@ -304,24 +304,6 @@ export default {
erreurUploadMessage: null,
attachmentDataKey: 0,
linkedDataKey: 0,
statusChoices: [
{
name: "Brouillon",
value: "draft",
},
{
name: "Publié",
value: "published",
},
{
name: "Archivé",
value: "archived",
},
{
name: "En attente de publication",
value: "pending",
},
],
form: {
title: {
errors: [],
......@@ -371,6 +353,7 @@ export default {
"features",
"extra_form",
"linked_features",
"statusChoices"
]),
field_title() {
......
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