Merged in bugfix/PMCORE-3342 (pull request #8165)
PMCORE-3342 Approved-by: Fabio Guachalla Approved-by: Rodrigo Quelca
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
abd7a2b749
@@ -4,7 +4,9 @@ export default {
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
typeView: "GRID",
|
||||
typeView: this.data.settings.view && this.data.settings.view.typeView
|
||||
? this.data.settings.view.typeView
|
||||
: "GRID",
|
||||
random: 1,
|
||||
dataCasesList: [],
|
||||
defaultColumns: [
|
||||
@@ -24,6 +26,9 @@ export default {
|
||||
title: "Grid",
|
||||
onClick(action) {
|
||||
that.typeView = "GRID";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-table",
|
||||
},
|
||||
@@ -32,6 +37,9 @@ export default {
|
||||
title: "List",
|
||||
onClick(action) {
|
||||
that.typeView = "LIST";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-list",
|
||||
},
|
||||
@@ -40,6 +48,9 @@ export default {
|
||||
title: "Card",
|
||||
onClick(action) {
|
||||
that.typeView = "CARD";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-th",
|
||||
},
|
||||
@@ -81,36 +92,36 @@ export default {
|
||||
getCases(data) {
|
||||
let that = this,
|
||||
dt,
|
||||
typeList = that.data.pageParent == "inbox"? "todo": that.data.pageParent,
|
||||
typeList = that.data.pageParent == "inbox" ? "todo" : that.data.pageParent,
|
||||
start = 0,
|
||||
paged,
|
||||
limit = data.limit,
|
||||
filters = {},
|
||||
id = this.data.customListId;
|
||||
filters = {
|
||||
paged: paged,
|
||||
limit: limit,
|
||||
offset: start,
|
||||
paged: paged,
|
||||
limit: limit,
|
||||
offset: start,
|
||||
};
|
||||
if (_.isEmpty(that.filters) && this.data.settings) {
|
||||
_.forIn(this.data.settings.filters, function(item, key) {
|
||||
if (filters && item.value) {
|
||||
filters[item.filterVar] = item.value;
|
||||
}
|
||||
});
|
||||
_.forIn(this.data.settings.filters, function (item, key) {
|
||||
if (filters && item.value) {
|
||||
filters[item.filterVar] = item.value;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
_.forIn(this.filters, function(item, key) {
|
||||
if (filters && item.value) {
|
||||
filters[item.filterVar] = item.value;
|
||||
}
|
||||
});
|
||||
_.forIn(this.filters, function (item, key) {
|
||||
if (filters && item.value) {
|
||||
filters[item.filterVar] = item.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
api.custom[that.data.pageParent]
|
||||
({
|
||||
id,
|
||||
filters,
|
||||
})
|
||||
api.custom[that.data.pageParent]
|
||||
({
|
||||
id,
|
||||
filters,
|
||||
})
|
||||
.then((response) => {
|
||||
dt = that.formatDataResponse(response.data.data);
|
||||
resolutionFunc({
|
||||
@@ -129,7 +140,7 @@ export default {
|
||||
getCasesViewMore(data) {
|
||||
let that = this,
|
||||
dt,
|
||||
typeList = that.data.pageParent == "inbox"? "todo": that.data.pageParent,
|
||||
typeList = that.data.pageParent == "inbox" ? "todo" : that.data.pageParent,
|
||||
limit = data.limit,
|
||||
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
||||
filters = {};
|
||||
@@ -213,6 +224,20 @@ export default {
|
||||
}
|
||||
return { value, key: value }
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Update settings for user
|
||||
* @param {string} key
|
||||
* @param {*} data
|
||||
*/
|
||||
updateRootSettings(key, data) {
|
||||
this.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: key,
|
||||
page: this.data.pageParent,
|
||||
type: "custom",
|
||||
id: this.data.customListId
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ export default {
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
typeView: "GRID",
|
||||
typeView: this.settings.view && this.settings.view.typeView
|
||||
? this.settings.view.typeView
|
||||
: "GRID",
|
||||
random: 1,
|
||||
dataMultiviewHeader: {
|
||||
actions: [
|
||||
@@ -12,6 +14,9 @@ export default {
|
||||
title: "Grid",
|
||||
onClick(action) {
|
||||
that.typeView = "GRID";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-table",
|
||||
},
|
||||
@@ -20,6 +25,9 @@ export default {
|
||||
title: "List",
|
||||
onClick(action) {
|
||||
that.typeView = "LIST";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-list",
|
||||
},
|
||||
@@ -28,6 +36,9 @@ export default {
|
||||
title: "Card",
|
||||
onClick(action) {
|
||||
that.typeView = "CARD";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-th",
|
||||
},
|
||||
@@ -35,7 +46,7 @@ export default {
|
||||
},
|
||||
optionsVueView: {
|
||||
limit: 10,
|
||||
dblClick:(event, item, options)=>{
|
||||
dblClick: (event, item, options) => {
|
||||
this.openCase(item);
|
||||
},
|
||||
headings: {
|
||||
@@ -135,11 +146,11 @@ export default {
|
||||
* @param {*} headings
|
||||
* @returns
|
||||
*/
|
||||
formatColumnSettings(headings) {
|
||||
let res=[];
|
||||
_.forEach(headings, function(value, key) {
|
||||
if(key != "actions"){
|
||||
res.push({value,key});
|
||||
formatColumnSettings(headings) {
|
||||
let res = [];
|
||||
_.forEach(headings, function (value, key) {
|
||||
if (key != "actions") {
|
||||
res.push({ value, key });
|
||||
}
|
||||
});
|
||||
return res;
|
||||
@@ -160,11 +171,25 @@ export default {
|
||||
*/
|
||||
onUpdateColumnSettings(columns) {
|
||||
let cols = columns;
|
||||
if(_.findIndex(cols, 'actions') == -1){
|
||||
if (_.findIndex(cols, 'actions') == -1) {
|
||||
cols.push("actions");
|
||||
}
|
||||
this.columns = cols;
|
||||
this.random = _.random(0, 10000000000);
|
||||
},
|
||||
/**
|
||||
* Update settings for user
|
||||
* @param {string} key
|
||||
* @param {*} data
|
||||
*/
|
||||
updateRootSettings(key, data) {
|
||||
this.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: key,
|
||||
page: "draft",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,6 +422,7 @@ export default {
|
||||
this.page = "custom-case-list";
|
||||
if (this.config.setting[item.item.page] && this.config.setting[item.item.page]["customCaseList"]) {
|
||||
this.pageData.settings = this.config.setting[item.item.page]["customCaseList"][item.item.id];
|
||||
this.settings = this.pageData.settings;
|
||||
} else {
|
||||
this.pageData.settings = {};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ export default {
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
typeView: "GRID",
|
||||
typeView: this.settings.view && this.settings.view.typeView
|
||||
? this.settings.view.typeView
|
||||
: "GRID",
|
||||
random: 1,
|
||||
dataMultiviewHeader: {
|
||||
actions: [
|
||||
@@ -13,6 +15,9 @@ export default {
|
||||
title: "Grid",
|
||||
onClick(action) {
|
||||
that.typeView = "GRID";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-table",
|
||||
},
|
||||
@@ -21,6 +26,9 @@ export default {
|
||||
title: "List",
|
||||
onClick(action) {
|
||||
that.typeView = "LIST";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-list",
|
||||
},
|
||||
@@ -29,6 +37,9 @@ export default {
|
||||
title: "Card",
|
||||
onClick(action) {
|
||||
that.typeView = "CARD";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-th",
|
||||
},
|
||||
@@ -167,6 +178,20 @@ export default {
|
||||
}
|
||||
this.columns = cols;
|
||||
this.random = _.random(0, 10000000000);
|
||||
},
|
||||
/**
|
||||
* Update settings for user
|
||||
* @param {string} key
|
||||
* @param {*} data
|
||||
*/
|
||||
updateRootSettings(key, data) {
|
||||
this.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: key,
|
||||
page: "inbox",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ export default {
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
typeView: "GRID",
|
||||
typeView: this.settings.view && this.settings.view.typeView
|
||||
? this.settings.view.typeView
|
||||
: "GRID",
|
||||
random: 1,
|
||||
dataMultiviewHeader: {
|
||||
actions: [
|
||||
@@ -12,6 +14,9 @@ export default {
|
||||
title: "Grid",
|
||||
onClick(action) {
|
||||
that.typeView = "GRID";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-table",
|
||||
},
|
||||
@@ -20,6 +25,9 @@ export default {
|
||||
title: "List",
|
||||
onClick(action) {
|
||||
that.typeView = "LIST";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-list",
|
||||
},
|
||||
@@ -28,6 +36,9 @@ export default {
|
||||
title: "Card",
|
||||
onClick(action) {
|
||||
that.typeView = "CARD";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-th",
|
||||
},
|
||||
@@ -35,7 +46,7 @@ export default {
|
||||
},
|
||||
optionsVueView: {
|
||||
limit: 10,
|
||||
dblClick:(event, item, options)=>{
|
||||
dblClick: (event, item, options) => {
|
||||
this.openCase(item);
|
||||
},
|
||||
headings: {
|
||||
@@ -137,10 +148,10 @@ export default {
|
||||
* @returns
|
||||
*/
|
||||
formatColumnSettings(headings) {
|
||||
let res=[];
|
||||
_.forEach(headings, function(value, key) {
|
||||
if(key != "actions"){
|
||||
res.push({value,key});
|
||||
let res = [];
|
||||
_.forEach(headings, function (value, key) {
|
||||
if (key != "actions") {
|
||||
res.push({ value, key });
|
||||
}
|
||||
});
|
||||
return res;
|
||||
@@ -161,11 +172,25 @@ export default {
|
||||
*/
|
||||
onUpdateColumnSettings(columns) {
|
||||
let cols = columns;
|
||||
if(_.findIndex(cols, 'actions') == -1){
|
||||
if (_.findIndex(cols, 'actions') == -1) {
|
||||
cols.push("actions");
|
||||
}
|
||||
this.columns = cols;
|
||||
this.random = _.random(0, 10000000000);
|
||||
},
|
||||
/**
|
||||
* Update settings for user
|
||||
* @param {string} key
|
||||
* @param {*} data
|
||||
*/
|
||||
updateRootSettings(key, data) {
|
||||
this.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: key,
|
||||
page: "paused",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ export default {
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
typeView: "GRID",
|
||||
typeView: this.settings.view && this.settings.view.typeView
|
||||
? this.settings.view.typeView
|
||||
: "GRID",
|
||||
random: 1,
|
||||
dataMultiviewHeader: {
|
||||
actions: [
|
||||
@@ -12,6 +14,9 @@ export default {
|
||||
title: "Grid",
|
||||
onClick(action) {
|
||||
that.typeView = "GRID";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-table",
|
||||
},
|
||||
@@ -20,6 +25,9 @@ export default {
|
||||
title: "List",
|
||||
onClick(action) {
|
||||
that.typeView = "LIST";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-list",
|
||||
},
|
||||
@@ -28,6 +36,9 @@ export default {
|
||||
title: "Card",
|
||||
onClick(action) {
|
||||
that.typeView = "CARD";
|
||||
that.updateRootSettings("view", {
|
||||
typeView: that.typeView
|
||||
});
|
||||
},
|
||||
icon: "fas fa-th",
|
||||
},
|
||||
@@ -35,7 +46,7 @@ export default {
|
||||
},
|
||||
optionsVueList: {
|
||||
limit: 10,
|
||||
dblClick:(event, item, options)=>{
|
||||
dblClick: (event, item, options) => {
|
||||
this.openCase(item);
|
||||
},
|
||||
headings: {
|
||||
@@ -137,10 +148,10 @@ export default {
|
||||
* @returns
|
||||
*/
|
||||
formatColumnSettings(headings) {
|
||||
let res=[];
|
||||
_.forEach(headings, function(value, key) {
|
||||
if(key != "actions"){
|
||||
res.push({value,key});
|
||||
let res = [];
|
||||
_.forEach(headings, function (value, key) {
|
||||
if (key != "actions") {
|
||||
res.push({ value, key });
|
||||
}
|
||||
});
|
||||
return res;
|
||||
@@ -161,11 +172,25 @@ export default {
|
||||
*/
|
||||
onUpdateColumnSettings(columns) {
|
||||
let cols = columns;
|
||||
if(_.findIndex(cols, 'actions') == -1){
|
||||
if (_.findIndex(cols, 'actions') == -1) {
|
||||
cols.push("actions");
|
||||
}
|
||||
this.columns = cols;
|
||||
this.random = _.random(0, 10000000000);
|
||||
},
|
||||
/**
|
||||
* Update settings for user
|
||||
* @param {string} key
|
||||
* @param {*} data
|
||||
*/
|
||||
updateRootSettings(key, data) {
|
||||
this.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: key,
|
||||
page: "unassigned",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user