From 78bf39579d9e619753d50039224c73b467c90c34 Mon Sep 17 00:00:00 2001 From: Henry Jordan Date: Fri, 10 Sep 2021 22:58:21 +0000 Subject: [PATCH 1/2] PMCORE-3304 --- resources/assets/js/home/Home.vue | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) mode change 100644 => 100755 resources/assets/js/home/Home.vue diff --git a/resources/assets/js/home/Home.vue b/resources/assets/js/home/Home.vue old mode 100644 new mode 100755 index a13a97cad..cd271742e --- a/resources/assets/js/home/Home.vue +++ b/resources/assets/js/home/Home.vue @@ -59,6 +59,7 @@ import CustomCaseList from "./CustomCaseList/CustomCaseList.vue" import api from "./../api/index"; import eventBus from './EventBus/eventBus' +import _ from "lodash"; export default { name: "Home", components: { @@ -158,7 +159,8 @@ export default { eventer(messageEvent, function(e) { if ( e.data === "redirect=todo" || e.message === "redirect=todo"){ - that.page = "inbox"; + console.log("JONN"); + that.OnClickSidebarItem(that.getItemMenuByValue("page","inbox")); } if ( e.data === "update=debugger" || e.message === "update=debugger"){ if(that.$refs["component"].updateView){ @@ -563,6 +565,23 @@ export default { console.error(e); }); } + }, + /** + * Search in menu Items by value, return the item + * @param {string} key - Key for search in object + * @param {string} value - value for search in key + */ + getItemMenuByValue(key, value) { + let obj = _.find(this.menu, function(o) { + if(o.component){ + return o.props.item[key] == value; + } + return o[key] == value; + }); + if(obj.component){ + return obj.props; + } + return obj; } } }; From 3230a875f64d9b51e6319ac393740f78bd528f19 Mon Sep 17 00:00:00 2001 From: Henry Jordan Date: Fri, 10 Sep 2021 23:00:00 +0000 Subject: [PATCH 2/2] PMCORE-3304 update --- resources/assets/js/home/Home.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/assets/js/home/Home.vue b/resources/assets/js/home/Home.vue index cd271742e..55aea4272 100755 --- a/resources/assets/js/home/Home.vue +++ b/resources/assets/js/home/Home.vue @@ -159,8 +159,7 @@ export default { eventer(messageEvent, function(e) { if ( e.data === "redirect=todo" || e.message === "redirect=todo"){ - console.log("JONN"); - that.OnClickSidebarItem(that.getItemMenuByValue("page","inbox")); + that.OnClickSidebarItem(that.getItemMenuByValue("page","inbox")); } if ( e.data === "update=debugger" || e.message === "update=debugger"){ if(that.$refs["component"].updateView){