Skip to content
Snippets Groups Projects
Commit d14a21e8 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Fix undefineddata from api replacing mocks

parent 465ad167
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
<h1>{{ feature_type_slug }}</h1>
{{ feature_type }}
</div> -->
<div class="row">
<div v-if="structure" class="row">
<div class="five wide column">
<div class="ui attached secondary segment">
<h1 class="ui center aligned header">
......@@ -163,7 +163,7 @@
<router-link
:to="{
name: 'ajouter-signalement',
params: { slug_type_signal: structure.title },
params: { slug_type_signal: structure.slug },
}"
class="ui icon button button-hover-green"
>
......@@ -196,6 +196,14 @@ export default {
},
},
watch: {
structure(newVal, oldVal) {
if (newVal !== oldVal) {
this.getImports();
}
},
},
data() {
return {
filenameToImport: {
......@@ -274,7 +282,6 @@ export default {
"feature_type/SET_CURRENT_FEATURE_TYPE_SLUG",
this.$route.params.slug_type_signal
);
this.getImports();
},
};
</script>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<h1>
<span v-if="action === 'edit'"
>Édition du projet "{{ form.title }}"</span
><!-- // todo : [pour UPDATE] récupérer project à éditer -->
>
<span v-else-if="action === 'create'">Création d'un projet</span>
</h1>
......@@ -183,25 +183,24 @@ export default {
"Contributeur",
],
form: {
title: "Vuetification (Copie-23/07/2021 09:19)",
slug: "6-vuetification-copie-23072021-0919",
created_on: "23/07/2021",
updated_on: "29/07/2021",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
moderation: true,
thumbnail: "http://localhost:8000/media/user_1/albinoscom.jpg",
thumbnail_name: "albinoscom", // todo: delete after getting image in jpg or png instead of data64 (require post to django)
creator: 1,
access_level_pub_feature: "Utilisateur anonyme",
access_level_arch_feature: "Utilisateur anonyme",
title: "",
slug: "",
created_on: "",
updated_on: "",
description: "",
moderation: false,
thumbnail: "https://via.placeholder.com/150", // todo : utiliser l'image par défaut
thumbnail_name: "", // todo: delete after getting image in jpg or png instead of data64 (require post to django)
creator: null,
access_level_pub_feature: "",
access_level_arch_feature: "",
archive_feature: 0,
delete_feature: 0,
nb_features: 2,
nb_published_features: 1,
nb_features: 0,
nb_published_features: 0,
nb_comments: 0,
nb_published_features_comments: 0,
nb_contributors: 2,
nb_contributors: 0,
is_project_type: false,
},
};
......@@ -210,7 +209,7 @@ export default {
computed: {
...mapGetters(["project"]),
},
/*
/*
watch: {
project(newValue, oldValue) {
console.log("watch", newValue);
......@@ -272,7 +271,7 @@ export default {
},
created() {
this.definePageType();
if (this.action === "edit") {
if (this.action !== "create") {
if (!this.project) {
this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug);
this.form = this.project;
......
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