PMCORE-3240:UI highlight marker in the menu (inbox, draft, paused and unnassigned)

This commit is contained in:
fabio
2021-08-26 20:29:51 -04:00
parent 86901512ff
commit 531fd71cb5
4 changed files with 91 additions and 12 deletions

View File

@@ -114,7 +114,7 @@ export default {
this.getUserSettings();
this.listenerIframe();
window.setInterval(
this.setCounter,
this.getHighlight,
parseInt(window.config.FORMATS.casesListRefreshTime) * 1000
);
// adding eventBus listener
@@ -155,7 +155,7 @@ export default {
.then((response) => {
this.setDefaultCasesMenu(response.data);
this.menu = this.mappingMenu(this.setDefaultIcon(response.data));
this.setCounter();
this.getHighlight();
})
.catch((e) => {
console.error(e);
@@ -278,6 +278,7 @@ export default {
);
data[i]["sortable"] = data[i].customCasesList.length > 1;
data[i]["sortIcon"] = "gear-fill";
data[i]['highlight'] = false;
data[i] = {
component: CustomSidebarMenuItem,
props: {
@@ -479,6 +480,29 @@ export default {
onUpdateFilters(filters) {
this.filters = filters;
},
getHighlight() {
let that = this;
if (that.menu.length > 0) {
api.menu
.getHighlight()
.then((response) => {
var i,
dataHighlight = [];
for (i = 0; i < response.data.length; i += 1) {
if (response.data[i].highlight) {
dataHighlight.push({
id: that.menuMap[response.data[i].item],
highlight: response.data[i].highlight
});
}
}
eventBus.$emit('highlight', dataHighlight);
})
.catch((e) => {
console.error(e);
});
}
}
}
};
</script>