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

filter last features for feature_type and display numbers of feature_type features

parent 7fd990f0
No related branches found
No related tags found
1 merge request!21filter last features for feature_type and display numbers of feature_type features
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<div class="ui basic segment"> <div class="ui basic segment">
<div class="ui horizontal tiny statistic"> <div class="ui horizontal tiny statistic">
<div class="value"> <div class="value">
{{ features.length }} {{ feature_type_features.length }}
</div> </div>
<div class="label"> <div class="label">
Signalement{{ features.length > 1 ? "s" : "" }} Signalement{{ features.length > 1 ? "s" : "" }}
...@@ -222,8 +222,15 @@ export default { ...@@ -222,8 +222,15 @@ export default {
} }
return null; return null;
}, },
feature_type_features: function () {
return this.features.filter(
(el) => el.feature_type.slug === this.$route.params.feature_type_slug
);
},
lastFeatures: function () { lastFeatures: function () {
return this.features.slice(0, 5); return this.feature_type_features.slice(0, 5);
}, },
}, },
...@@ -250,7 +257,7 @@ export default { ...@@ -250,7 +257,7 @@ export default {
}, },
exportFeatures() { exportFeatures() {
const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`; const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`;
console.log(url) console.log(url);
window.open(url); window.open(url);
}, },
}, },
......
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