PMCORE-3252: (custom cases list) columns settings was not saved for a final user

This commit is contained in:
Rodrigo Quelca
2021-08-30 22:48:33 +00:00
parent d6aae5e289
commit e9f32179ae
2 changed files with 78 additions and 11 deletions

View File

@@ -455,20 +455,43 @@ export default {
this.initFilters();
},
mounted() {
debugger;
let that = this;
// force to open case
this.openDefaultCase();
// define sort event
Event.$on("vue-tables.todo.sorted", function(data) {
that.$emit("updateUserSettings", "orderBy", data);
that.$emit("updateSettings", {
data: data,
key: "orderBy",
parent: that.data.pageParent,
type: "custom",
id: that.data.customListId
});
});
},
watch: {
columns: function(val) {
//TODO update settings
if (this.isFistTime) {
this.isFistTime = false;
} else {
this.$emit("updateSettings", {
data: val,
key: "columns",
parent: this.data.pageParent,
type: "custom",
id: this.data.customListId
});
}
},
filters: function(val) {
this.$emit("updateUserSettings", "filters", val);
this.$emit("updateSettings", {
data: val,
key: "filters",
parent: this.data.pageParent,
type: "custom",
id: this.data.customListId
});
},
},
computed: {
@@ -595,9 +618,7 @@ export default {
dt = that.formatDataResponse(response.data.data);
that.cardColumns = columns;
if (that.isFistTime) {
that.columns = that.getTableColumns(columns);
that.isFistTime = false;
that.columns = that.settings && that.settings.columns ? that.settings.columns : that.getTableColumns(columns);
}
resolutionFunc({
data: dt,