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

Add function on button export features and some improvements

parent 887cd78c
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,9 @@ const feature = {
commit("SET_USER", false)
}); */
},
EXPORT_FEATURES({state}) {
console.log("Export features", state.features)
}
},
}
......
......@@ -99,7 +99,7 @@ const feature_type = {
console.log("data", data)
axios
.post(`${process.env.VUE_APP_DJANGO_API_BASE}feature_type/`, data)
.post(`${process.env.VUE_APP_DJANGO_API_BASE}feature-types/`, data)
.then((response) => {
const routerHistory = this.$router.options.routerHistory
store.commit("SET_USER", response.data.user);
......
......@@ -191,7 +191,11 @@
{{ feature.display_creator }}
</td>
</tr>
<tr v-if="filteredFeatures.length === 0" class="odd"><td colspan="5" class="dataTables_empty" valign="top">Aucune donnée disponible</td></tr>
<tr v-if="filteredFeatures.length === 0" class="odd">
<td colspan="5" class="dataTables_empty" valign="top">
Aucune donnée disponible
</td>
</tr>
</tbody>
</table>
</div>
......@@ -277,7 +281,8 @@ export default {
created() {
if (!this.project) {
this.$store.dispatch("GET_PROJECT_MESSAGES", this.$route.params.slug);
//this.$store.dispatch("GET_PROJECT_MESSAGES", this.$route.params.slug);
this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug);
}
},
mounted() {
......
......@@ -101,12 +101,9 @@
Vous pouvez télécharger l'ensemble des signalements ayant le
statut publiés pour ce type.
</p>
<a
class="ui fluid teal icon button"
href="{% url 'api:project-export' slug=project.slug feature_type_slug=feature_type.slug %}"
>
<button type="button" class="ui fluid teal icon button" @click="exportFeatures">
<i class="download icon"></i> Exporter
</a>
</button>
// todo gérer export
</div>
</div>
......@@ -134,11 +131,18 @@
<span v-else-if="feature.status == 'draft'" data-tooltip="Brouillon">
<i class="orange pencil alternate icon"></i>
</span>
<a
href="{% url 'geocontrib:feature_detail' slug=project.slug feature_type_slug=feature.feature_type.slug feature_id=feature.feature_id %}"
<router-link
:to="{
name: 'details-signalement',
params: {
slug: project.slug,
slug_type_signal: feature.feature_type.slug,
slug_signal: feature.feature_id,
},
}"
>
{{ feature.title }}
</a>
</router-link>
<div class="sub header">
<div>
{{ feature.description.substring(0, 200) }}
......@@ -218,9 +222,6 @@ export default {
},
methods: {
// forceRerender(key) {
// return key += 1;
// },
onFileChange(e) {
var files = e.target.files || e.dataTransfer.files;
if (!files.length) return;
......@@ -272,6 +273,13 @@ export default {
console.log(err);
});
},
exportFeatures() {
console.log("TEST", this.$store)
this.$store.dispatch(
"feature/EXPORT_FEATURES",
this.$route.params.slug_type_signal
);
},
},
created() {
......
......@@ -65,5 +65,11 @@ export default {
this.$store.dispatch("map/SAVE_BASEMAPS");
},
},
created() {
if (!this.$store.getters.project) {
this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug);
}
},
};
</script>
\ No newline at end of file
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