fix CR notes
This commit is contained in:
@@ -140,7 +140,7 @@
|
||||
|
||||
<template #modal-footer="{ cancel }">
|
||||
<b-button size="sm" variant="danger" @click="cancel()">
|
||||
Cancel
|
||||
{{ $t("ID_CLOSE")}}
|
||||
</b-button>
|
||||
</template>
|
||||
</b-modal>
|
||||
@@ -153,6 +153,7 @@ import draggable from "vuedraggable";
|
||||
import CustomSidebarMenuLink from "./CustomSidebarMenuLink";
|
||||
import CustomSidebarMenuIcon from "./CustomSidebarMenuIcon";
|
||||
import CustomTooltip from "./../utils/CustomTooltip.vue";
|
||||
import eventBus from './../../home/EventBus/eventBus'
|
||||
|
||||
export default {
|
||||
name: "CustomSidebarMenuItem",
|
||||
@@ -403,13 +404,15 @@ export default {
|
||||
this.show = false;
|
||||
}
|
||||
},
|
||||
/**
|
||||
/**
|
||||
* Handler to check if the item is moving
|
||||
* @param {object} e
|
||||
*/
|
||||
checkMove: function(e) {
|
||||
let aux = this.item.child.splice(e.newIndex, 1);
|
||||
this.item.child.splice(e.newIndex, 0, aux[0]);
|
||||
this.emitItemUpdate(this.item, this.item);
|
||||
eventBus.$emit('sort-menu', this.item.child);
|
||||
},
|
||||
/**
|
||||
* Click event Handler
|
||||
@@ -482,7 +485,7 @@ export default {
|
||||
if (this.hover) return;
|
||||
if (!this.isCollapsed || !this.isFirstLevel || this.isMobileItem)
|
||||
return;
|
||||
this.$emit("unset-mobile-item", true);
|
||||
this.$parent.$emit("unset-mobile-item", true);
|
||||
setTimeout(() => {
|
||||
if (this.$parent.mobileItem !== this.item) {
|
||||
this.$parent.$emit("set-mobile-item", { item: this.item, itemEl });
|
||||
|
||||
@@ -286,7 +286,7 @@ export default {
|
||||
self.selected.push(component.id);
|
||||
self.itemModel[component.id] = component;
|
||||
self.itemModel[component.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : true;
|
||||
if (!oldVal.length) {
|
||||
if (oldVal && !oldVal.length) {
|
||||
self.updateSearchTag(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,20 +2,16 @@
|
||||
<span
|
||||
:id="`label-${data.id}`"
|
||||
@mouseover="hoverHandler"
|
||||
v-b-tooltip.hover
|
||||
:title="labelTooltip"
|
||||
@mouseleave="unhoverHandler"
|
||||
>
|
||||
{{ data.title }}
|
||||
{{ data.title }}
|
||||
<b-tooltip
|
||||
:target="`label-${data.id}`"
|
||||
triggers="hoverHandler"
|
||||
:show.sync="show"
|
||||
:ref="`tooltip-${data.id}`"
|
||||
>
|
||||
{{ labelTooltip }}
|
||||
</b-tooltip>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -31,11 +27,16 @@ export default {
|
||||
labelTooltip: "",
|
||||
hovering: "",
|
||||
show: false,
|
||||
disabled: true,
|
||||
menuMap: {
|
||||
CASES_INBOX: "inbox",
|
||||
CASES_DRAFT: "draft",
|
||||
CASES_PAUSED: "paused",
|
||||
CASES_SELFSERVICE: "unassigned"
|
||||
CASES_SELFSERVICE: "unassigned",
|
||||
todo: "inbox",
|
||||
draft: "draft",
|
||||
paused: "paused",
|
||||
unassigned: "unassigned"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -44,27 +45,33 @@ export default {
|
||||
* Delay the hover event
|
||||
*/
|
||||
hoverHandler() {
|
||||
this.hovering = setTimeout(() => { this.setTooltip() }, 3000);
|
||||
// this.hovering = setTimeout(() => { this.setTooltip() }, 3000);
|
||||
this.setTooltip();
|
||||
},
|
||||
/**
|
||||
* Reset the delay and hide the tooltip
|
||||
*/
|
||||
unhoverHandler() {
|
||||
let key =`tooltip-${this.data.id}`;
|
||||
this.labelTooltip = "";
|
||||
this.show = false;
|
||||
// this.show = false;
|
||||
this.disabled = true;
|
||||
this.$refs[key].$emit('close');
|
||||
clearTimeout(this.hovering);
|
||||
},
|
||||
/**
|
||||
* Set the label to show in the tooltip
|
||||
*/
|
||||
*/
|
||||
setTooltip() {
|
||||
let that = this;
|
||||
api.menu
|
||||
.getTooltip(that.menuMap[that.data.id])
|
||||
.then((response) => {
|
||||
let key =`tooltip-${that.data.id}`;
|
||||
that.disabled = false;
|
||||
that.labelTooltip = response.data.label;
|
||||
that.show = true;
|
||||
});
|
||||
that.$refs[key].$emit('open');
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
:defaultOption="defaultOption"
|
||||
:settings="config.setting[page]"
|
||||
:filters="filters"
|
||||
@onSubmitFilter="onSubmitFilter"
|
||||
@onSubmitFilter="onSubmitFilter"
|
||||
@onRemoveFilter="onRemoveFilter"
|
||||
@onUpdatePage="onUpdatePage"
|
||||
@onUpdateDataCase="onUpdateDataCase"
|
||||
@@ -34,7 +34,7 @@
|
||||
@onUpdateFilters="onUpdateFilters"
|
||||
@cleanDefaultOption="cleanDefaultOption"
|
||||
@updateUserSettings="updateUserSettings"
|
||||
></component>
|
||||
></component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -55,7 +55,7 @@ import AdvancedSearch from "./AdvancedSearch/AdvancedSearch.vue";
|
||||
import LegacyFrame from "./LegacyFrame";
|
||||
|
||||
import api from "./../api/index";
|
||||
|
||||
import eventBus from './EventBus/eventBus'
|
||||
export default {
|
||||
name: "Home",
|
||||
components: {
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
filters: null,
|
||||
config: {
|
||||
id: window.config.userId || "1",
|
||||
name: "home",
|
||||
name: "userConfig",
|
||||
setting: {}
|
||||
},
|
||||
menuMap: {
|
||||
@@ -109,6 +109,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.onResize();
|
||||
this.getMenu();
|
||||
this.getUserSettings();
|
||||
@@ -117,6 +118,10 @@ export default {
|
||||
this.setCounter,
|
||||
parseInt(window.config.FORMATS.casesListRefreshTime) * 1000
|
||||
);
|
||||
// adding eventBus listener
|
||||
eventBus.$on('sort-menu', (data) => {
|
||||
that.updateUserSettings('customCasesList', data);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -167,10 +172,10 @@ export default {
|
||||
name: this.config.name
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
this.config = response.data;
|
||||
} else {
|
||||
if(response.data && response.data.status === 404) {
|
||||
this.createUserSettings();
|
||||
} else if (response.data) {
|
||||
this.config = response.data;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
@@ -182,10 +187,7 @@ export default {
|
||||
*/
|
||||
createUserSettings() {
|
||||
api.config
|
||||
.post({
|
||||
...this.configParams,
|
||||
...{setting: '{}'}
|
||||
})
|
||||
.post(this.config)
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
this.config = response.data;
|
||||
@@ -265,13 +267,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data[i].id === "todo" || data[i].id === "draft"
|
||||
if (data[i].id === "todo" || data[i].id === "draft"
|
||||
|| data[i].id === "paused" || data[i].id === "unassigned") {
|
||||
data[i]["child"] = data[i].customCasesList;
|
||||
data[i]["child"] = this.sortCustomCasesList(data[i].customCasesList, this.config.setting[this.page] && this.config.setting[this.page].customCasesList ? this.config.setting[this.page].customCasesList: [])
|
||||
data[i]["sortable"] = data[i].customCasesList.length > 1;
|
||||
data[i]["sortIcon"] = "gear-fill";
|
||||
data[i] = {
|
||||
component: CustomSidebarMenuItem,
|
||||
component: CustomSidebarMenuItem,
|
||||
props: {
|
||||
isCollapsed: this.collapsed? true: false,
|
||||
item: data[i]
|
||||
@@ -281,6 +283,31 @@ export default {
|
||||
}
|
||||
return newData;
|
||||
},
|
||||
sortCustomCasesList(list, ref) {
|
||||
let item,
|
||||
newList = [],
|
||||
temp = [];
|
||||
if (ref && ref.length) {
|
||||
ref.forEach(function (menu) {
|
||||
item = list.find(x => x.id === menu.id);
|
||||
if (item) {
|
||||
newList.push(item);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return list;
|
||||
}
|
||||
temp = list.filter(this.comparerById(newList));
|
||||
return [...newList, ...temp];
|
||||
|
||||
},
|
||||
comparerById(otherArray){
|
||||
return function(current){
|
||||
return otherArray.filter(function(other){
|
||||
return other.id == current.id
|
||||
}).length == 0;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Set a default icon if the item doesn't have one
|
||||
*/
|
||||
@@ -312,8 +339,8 @@ export default {
|
||||
this.pageId = null;
|
||||
this.pageUri = item.item.href;
|
||||
this.page = item.item.id || "MyCases";
|
||||
if (this.page === this.lastPage
|
||||
&& this.$refs["component"]
|
||||
if (this.page === this.lastPage
|
||||
&& this.$refs["component"]
|
||||
&& this.$refs["component"].updateView) {
|
||||
this.$refs["component"].updateView();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class UserConfig extends Model
|
||||
$model = new UserConfig();
|
||||
$model->USR_ID = $id;
|
||||
$model->USC_NAME = $name;
|
||||
$model->USC_SETTING = json_encode($setting);
|
||||
$model->USC_SETTING = json_encode($setting, JSON_FORCE_OBJECT);
|
||||
$model->save();
|
||||
$userConfig = UserConfig::getSetting($id, $name);
|
||||
return $userConfig;
|
||||
|
||||
Reference in New Issue
Block a user