Skip to content
Snippets Groups Projects
Commit 1a85f3e4 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA :bicyclist:
Browse files

Merge branch 'REDMINE-ISSUES/12614v2' into 'develop'

parents 28a4f03e ad2b5d23
No related branches found
No related tags found
No related merge requests found
...@@ -253,28 +253,36 @@ export default { ...@@ -253,28 +253,36 @@ export default {
...mapState("feature", ["features", "features_count"]), ...mapState("feature", ["features", "features_count"]),
...mapState("feature_type", ["feature_types", "importFeatureTypeData"]), ...mapState("feature_type", ["feature_types", "importFeatureTypeData"]),
structure: function () { structure: function () {
if (this.feature_types) { if (Object.keys(this.feature_types).length) {
return this.feature_types.find( let st = this.feature_types.find(
(el) => el.slug === this.$route.params.feature_type_slug (el) => el.slug === this.$route.params.feature_type_slug
); );
if (st)
return st
} }
return {}; return {};
}, },
feature_type_features: function () { feature_type_features: function () {
return this.features.filter( if(this.features.length)
(el) => el.feature_type.slug === this.$route.params.feature_type_slug return this.features.filter(
); (el) => el.feature_type.slug === this.$route.params.feature_type_slug
);
return {}
}, },
lastFeatures: function () { lastFeatures: function () {
return this.feature_type_features.slice(0, 5); if (this.feature_type_features.length)
return this.feature_type_features.slice(0, 5);
return []
}, },
orderedCustomFields() { orderedCustomFields() {
return [...this.structure.customfield_set].sort( if (Object.keys(this.structure).length)
(a, b) => a.position - b.position return [...this.structure.customfield_set].sort(
); (a, b) => a.position - b.position
);
return {}
}, },
}, },
...@@ -387,8 +395,7 @@ export default { ...@@ -387,8 +395,7 @@ export default {
ordering: '-created_on', ordering: '-created_on',
limit: '5' limit: '5'
}) })
console.log(response)
if (response){ if (response){
this.featuresLoading = false; this.featuresLoading = false;
} }
...@@ -396,8 +403,7 @@ export default { ...@@ -396,8 +403,7 @@ export default {
}, },
watch:{ watch:{
'structure'(newValue){ 'structure'(newValue){
console.log(newValue) if (newValue.slug){
if (newValue){
this.$store.dispatch("feature_type/GET_IMPORTS", { this.$store.dispatch("feature_type/GET_IMPORTS", {
feature_type: this.structure.slug feature_type: this.structure.slug
}); });
......
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