Skip to content
Snippets Groups Projects

filter last features for feature_type and display numbers of feature_type features

1 file
+ 10
3
Compare changes
  • Side-by-side
  • Inline
@@ -29,7 +29,7 @@
<div class="ui basic segment">
<div class="ui horizontal tiny statistic">
<div class="value">
{{ features.length }}
{{ feature_type_features.length }}
</div>
<div class="label">
Signalement{{ features.length > 1 ? "s" : "" }}
@@ -222,8 +222,15 @@ export default {
}
return null;
},
feature_type_features: function () {
return this.features.filter(
(el) => el.feature_type.slug === this.$route.params.feature_type_slug
);
},
lastFeatures: function () {
return this.features.slice(0, 5);
return this.feature_type_features.slice(0, 5);
},
},
@@ -250,7 +257,7 @@ export default {
},
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/`;
console.log(url)
console.log(url);
window.open(url);
},
},
Loading