PMCORE-3354: Case List Settings > The change of order is not automatically saved per user

restore props

fix custom cases list
This commit is contained in:
Rodrigo Quelca
2021-09-20 14:30:27 +00:00
parent 7583dc0f26
commit 51b3f208a6
7 changed files with 40 additions and 35 deletions

View File

@@ -673,7 +673,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: that.data.pageParent, page: that.data.pageParent,
type: "custom", type: "custom",
id: that.data.customListId id: that.data.customListId
}); });
@@ -687,7 +687,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.data.pageParent, page: this.data.pageParent,
type: "custom", type: "custom",
id: this.data.customListId id: this.data.customListId
}); });
@@ -1024,7 +1024,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.data.pageParent, page: this.data.pageParent,
type: "custom", type: "custom",
id: this.data.customListId id: this.data.customListId
}); });

View File

@@ -326,7 +326,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: this.page, page: "draft",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -337,7 +337,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.page, page: "draft",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -562,7 +562,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.page, page: "draft",
type: "normal", type: "normal",
id: this.id id: this.id
}); });

View File

@@ -127,13 +127,19 @@ export default {
parseInt(window.config.FORMATS.casesListRefreshTime) * 1000 parseInt(window.config.FORMATS.casesListRefreshTime) * 1000
); );
// adding eventBus listener // adding eventBus listener
eventBus.$on('sort-menu', (data) => { eventBus.$on('sort-menu', (data) => {
let page;
let newData = []; let newData = [];
data.forEach(item => newData.push({id: item.id})); data.forEach(item => {
newData.push({id: item.id});
if (!page) {
page = item.page;
}
});
that.updateSettings({ that.updateSettings({
data: newData, data: newData,
key: "customCaseListOrder", key: "customCaseListOrder",
parent: this.page, page: page,
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -227,21 +233,21 @@ export default {
*/ */
updateSettings (params){ updateSettings (params){
if (params.type === "custom") { if (params.type === "custom") {
if (!this.config.setting[params.parent]) { if (!this.config.setting[params.page]) {
this.config.setting[params.parent] = {}; this.config.setting[params.page] = {};
} }
if (!this.config.setting[params.parent]["customCaseList"]) { if (!this.config.setting[params.page]["customCaseList"]) {
this.config.setting[params.parent]["customCaseList"] = {}; this.config.setting[params.page]["customCaseList"] = {};
} }
if (!this.config.setting[params.parent].customCaseList[params.id]) { if (!this.config.setting[params.page].customCaseList[params.id]) {
this.config.setting[params.parent].customCaseList[params.id] = {} this.config.setting[params.page].customCaseList[params.id] = {}
} }
this.config.setting[params.parent].customCaseList[params.id][params.key] = params.data; this.config.setting[params.page].customCaseList[params.id][params.key] = params.data;
} else { } else {
if (!this.config.setting[this.page]) { if (!this.config.setting[params.page]) {
this.config.setting[this.page] = {}; this.config.setting[params.page] = {};
} }
this.config.setting[this.page][params.key] = params.data; this.config.setting[params.page][params.key] = params.data;
} }
api.config api.config
.put(this.config) .put(this.config)
@@ -308,9 +314,9 @@ export default {
if (data[i].customCasesList) { if (data[i].customCasesList) {
data[i]["child"] = this.sortCustomCasesList( data[i]["child"] = this.sortCustomCasesList(
data[i].customCasesList, data[i].customCasesList,
this.config.setting[this.page] && this.config.setting[data[i]["page"]] &&
this.config.setting[this.page].customCaseListOrder this.config.setting[data[i]["page"]].customCaseListOrder
? this.config.setting[this.page].customCaseListOrder ? this.config.setting[data[i]["page"]].customCaseListOrder
: [] : []
); );
data[i]["sortable"] = data[i].customCasesList.length > 1; data[i]["sortable"] = data[i].customCasesList.length > 1;

View File

@@ -361,7 +361,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: this.page, page: "inbox",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -372,7 +372,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.page, page: "inbox",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -634,7 +634,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.page, page: "inbox",
type: "normal", type: "normal",
id: this.id id: this.id
}); });

View File

@@ -236,7 +236,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: this.page, page: "MyCases",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -247,7 +247,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.page, page: "MyCases",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -674,7 +674,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.page, page: "MyCases",
type: "normal", type: "normal",
id: this.id id: this.id
}); });

View File

@@ -360,7 +360,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: this.page, page: "paused",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -371,7 +371,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.page, page: "paused",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -632,7 +632,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.page, page: "paused",
type: "normal", type: "normal",
id: this.id id: this.id
}); });

View File

@@ -352,8 +352,7 @@ export default {
that.$emit("updateSettings", { that.$emit("updateSettings", {
data: data, data: data,
key: "orderBy", key: "orderBy",
parent: this.page, page: "unassigned",
type: "normal",
id: this.id id: this.id
}); });
}); });
@@ -363,7 +362,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: val, data: val,
key: "columns", key: "columns",
parent: this.page, page: "unassigned",
type: "normal", type: "normal",
id: this.id id: this.id
}); });
@@ -602,7 +601,7 @@ export default {
this.$emit("updateSettings", { this.$emit("updateSettings", {
data: newFilters, data: newFilters,
key: "filters", key: "filters",
parent: this.page, page: "unassigned",
type: "normal", type: "normal",
id: this.id id: this.id
}); });