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:
@@ -673,7 +673,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: that.data.pageParent,
|
||||
page: that.data.pageParent,
|
||||
type: "custom",
|
||||
id: that.data.customListId
|
||||
});
|
||||
@@ -687,7 +687,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.data.pageParent,
|
||||
page: this.data.pageParent,
|
||||
type: "custom",
|
||||
id: this.data.customListId
|
||||
});
|
||||
@@ -1024,7 +1024,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.data.pageParent,
|
||||
page: this.data.pageParent,
|
||||
type: "custom",
|
||||
id: this.data.customListId
|
||||
});
|
||||
|
||||
@@ -326,7 +326,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
page: "draft",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -337,7 +337,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
page: "draft",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -562,7 +562,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
page: "draft",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
|
||||
@@ -127,13 +127,19 @@ export default {
|
||||
parseInt(window.config.FORMATS.casesListRefreshTime) * 1000
|
||||
);
|
||||
// adding eventBus listener
|
||||
eventBus.$on('sort-menu', (data) => {
|
||||
eventBus.$on('sort-menu', (data) => {
|
||||
let page;
|
||||
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({
|
||||
data: newData,
|
||||
key: "customCaseListOrder",
|
||||
parent: this.page,
|
||||
page: page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -227,21 +233,21 @@ export default {
|
||||
*/
|
||||
updateSettings (params){
|
||||
if (params.type === "custom") {
|
||||
if (!this.config.setting[params.parent]) {
|
||||
this.config.setting[params.parent] = {};
|
||||
if (!this.config.setting[params.page]) {
|
||||
this.config.setting[params.page] = {};
|
||||
}
|
||||
if (!this.config.setting[params.parent]["customCaseList"]) {
|
||||
this.config.setting[params.parent]["customCaseList"] = {};
|
||||
if (!this.config.setting[params.page]["customCaseList"]) {
|
||||
this.config.setting[params.page]["customCaseList"] = {};
|
||||
}
|
||||
if (!this.config.setting[params.parent].customCaseList[params.id]) {
|
||||
this.config.setting[params.parent].customCaseList[params.id] = {}
|
||||
if (!this.config.setting[params.page].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 {
|
||||
if (!this.config.setting[this.page]) {
|
||||
this.config.setting[this.page] = {};
|
||||
if (!this.config.setting[params.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
|
||||
.put(this.config)
|
||||
@@ -308,9 +314,9 @@ export default {
|
||||
if (data[i].customCasesList) {
|
||||
data[i]["child"] = this.sortCustomCasesList(
|
||||
data[i].customCasesList,
|
||||
this.config.setting[this.page] &&
|
||||
this.config.setting[this.page].customCaseListOrder
|
||||
? this.config.setting[this.page].customCaseListOrder
|
||||
this.config.setting[data[i]["page"]] &&
|
||||
this.config.setting[data[i]["page"]].customCaseListOrder
|
||||
? this.config.setting[data[i]["page"]].customCaseListOrder
|
||||
: []
|
||||
);
|
||||
data[i]["sortable"] = data[i].customCasesList.length > 1;
|
||||
|
||||
@@ -361,7 +361,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
page: "inbox",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -372,7 +372,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
page: "inbox",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -634,7 +634,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
page: "inbox",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
|
||||
@@ -236,7 +236,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
page: "MyCases",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -247,7 +247,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
page: "MyCases",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -674,7 +674,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
page: "MyCases",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
|
||||
@@ -360,7 +360,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
page: "paused",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -371,7 +371,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
page: "paused",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -632,7 +632,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
page: "paused",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
|
||||
@@ -352,8 +352,7 @@ export default {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
page: "unassigned",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
@@ -363,7 +362,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
page: "unassigned",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
@@ -602,7 +601,7 @@ export default {
|
||||
this.$emit("updateSettings", {
|
||||
data: newFilters,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
page: "unassigned",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user