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

show list in feature_list

parent 9a10381b
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,6 @@ export default new Vuex.Store({ ...@@ -31,7 +31,6 @@ export default new Vuex.Store({
map map
}, },
state: { state: {
status_choices: [],
logged: false, logged: false,
user: false, user: false,
project_slug: null, project_slug: null,
......
...@@ -78,16 +78,16 @@ ...@@ -78,16 +78,16 @@
<label>Type</label> <label>Type</label>
<Dropdown <Dropdown
:options="form.type.choices" :options="form.type.choices"
:selected="selected_type" :selected="form.type.value"
:selection.sync="selected_type" :selection.sync="form.type.value"
/> />
</div> </div>
<div class="field wide four column"> <div class="field wide four column">
<label>Statut</label> <label>Statut</label>
<Dropdown <Dropdown
:options="form.status.choices" :options="form.status.choices"
:selected="selected_status" :selected="form.status.value"
:selection.sync="selected_status" :selection.sync="form.status.value"
/> />
</div> </div>
<div class="field wide four column"> <div class="field wide four column">
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<div class="ui icon input"> <div class="ui icon input">
<i class="search icon"></i> <i class="search icon"></i>
<div class="ui action input"> <div class="ui action input">
<input type="text" name="title" :value="request.GET.title" /> <input type="text" name="title" v-model="form.title" />
<button <button
type="button" type="button"
class="ui teal icon button" class="ui teal icon button"
...@@ -106,10 +106,10 @@ ...@@ -106,10 +106,10 @@
</div> </div>
</div> </div>
</div> </div>
<!-- map params, updated on map move --> <!-- map params, updated on map move // todo : brancher sur la carte probablement -->
<input type="hidden" name="zoom" :value="request.GET.zoom || ''" /> <!-- <input type="hidden" name="zoom" :value="request.GET.zoom || ''" />
<input type="hidden" name="lat" :value="request.GET.lat || ''" /> <input type="hidden" name="lat" :value="request.GET.lat || ''" />
<input type="hidden" name="lng" :value="request.GET.lng || ''" /> <input type="hidden" name="lng" :value="request.GET.lng || ''" /> -->
</form> </form>
<div v-show="showMap" class="ui tab active map-container" data-tab="map"> <div v-show="showMap" class="ui tab active map-container" data-tab="map">
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<SidebarLayers /> <SidebarLayers />
</div> </div>
<div v-show="!showMap" class="ui tab" data-tab="list"> <div v-show="!showMap" data-tab="list">
<table id="table-features" class="ui compact table"> <table id="table-features" class="ui compact table">
<thead> <thead>
<tr> <tr>
...@@ -130,9 +130,7 @@ ...@@ -130,9 +130,7 @@
<th>Type</th> <th>Type</th>
<th>Nom</th> <th>Nom</th>
<th>Dernière modification</th> <th>Dernière modification</th>
{% if user.is_authenticated %} <th v-if="user">Auteur</th>
<th>Auteur</th>
{% endif %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -205,16 +203,7 @@ export default { ...@@ -205,16 +203,7 @@ export default {
data() { data() {
return { return {
request: { showMap: false,
// ? D'où ça doit venir ?
GET: {
feature_type: null,
status: null,
title: null,
type: null,
},
},
showMap: true,
showAddSignal: false, showAddSignal: false,
form: { form: {
type: { type: {
...@@ -230,37 +219,16 @@ export default { ...@@ -230,37 +219,16 @@ export default {
"Archivé", "Archivé",
], ],
}, },
title: null,
}, },
}; };
}, },
computed: { computed: {
...mapGetters(["project"]), ...mapGetters(["project"]),
...mapState(["status_choices"]), ...mapState(["user"]),
...mapState("feature", ["features"]), ...mapState("feature", ["features"]),
...mapState("feature_type", ["feature_types"]), ...mapState("feature_type", ["feature_types"]),
selected_type: {
// getter
get() {
return this.form.type.value;
},
// setter
set(newValue) {
this.form.type.value = newValue;
//this.updateStore();
},
},
selected_status: {
// getter
get() {
return this.form.status.value;
},
// setter
set(newValue) {
this.form.status.value = newValue;
//this.updateStore();
},
},
}, },
created() { created() {
...@@ -270,7 +238,7 @@ export default { ...@@ -270,7 +238,7 @@ export default {
}, },
mounted() { mounted() {
this.$store.dispatch("map/INITIATE_MAP"); this.$store.dispatch("map/INITIATE_MAP");
this.form.type.choices = new Set( this.form.type.choices = new Set( //* use Set to eliminate duplicate values
...[this.features.map((el) => el.feature_type.title)] ...[this.features.map((el) => el.feature_type.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