Store tagGroups on catalog url
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-09-15 10:48:34 +02:00
parent f94728845e
commit 538c217b59
2 changed files with 18 additions and 13 deletions

View File

@ -55,8 +55,8 @@ class Controller extends Section {
if (this.$params.typeId)
this.typeId = parseInt(this.$params.typeId);
/* if (this.$params.tags)
this.tags = JSON.parse(this.$params.tags); */
if (this.$params.tagGroups)
this.tagGroups = JSON.parse(this.$params.tagGroups);
});
}
@ -288,23 +288,28 @@ class Controller extends Section {
if (this.typeId)
params.typeId = this.typeId;
params.tagGrops = undefined;
if (this.tagGrops.length) {
const tagGrops = [];
for (let tag of this.tagGrops) {
const tagParam = {value: tag.value};
params.tagGroups = undefined;
if (this.tagGroups && this.tagGroups.length) {
const tagGroups = [];
for (let tagGroup of this.tagGroups) {
const tagParam = {values: []};
if (tag.tagSelection) {
tagParam.tagFk = tag.tagFk;
for (let tagValue of tagGroup.values)
tagParam.values.push({value: tagValue.value});
if (tagGroup.tagFk)
tagParam.tagFk = tagGroup.tagFk;
if (tagGroup.tagSelection) {
tagParam.tagSelection = {
name: tag.tagSelection.name
name: tagGroup.tagSelection.name
};
}
tags.push(tagParam);
tagGroups.push(tagParam);
}
params.tags = JSON.stringify(tags);
params.tagGroups = JSON.stringify(tagGroups);
}
this.$state.go(this.$state.current.name, params);

View File

@ -41,7 +41,7 @@
"order": "$ctrl.order"
}
}, {
"url": "/catalog?q&categoryId&typeId&tags",
"url": "/catalog?q&categoryId&typeId&tagGroups",
"state": "order.card.catalog",
"component": "vn-order-catalog",
"description": "Catalog",