From 54a5330cafac54c9442757b95412d0fc07c17bc8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 18 Apr 2019 23:19:30 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 13 ++++++- ayanova/src/api/gzmenu.js | 41 +++++++++++++++------ ayanova/src/api/initialize.js | 5 ++- ayanova/src/views/About.vue | 27 ++++++++++++-- ayanova/src/views/inventory-widget-edit.vue | 8 ++-- 5 files changed, 71 insertions(+), 23 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index f58af244..4385aeca 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -49,10 +49,19 @@ All platforms and browsers - DONE reorganize SAVE, DELETE ETC, put a divider between main form actions and then all the myriad of secondary things - DONE LOCALIZE check all new menu items, some might be not localized (look for ALL CAPS) - DONE WIRE UP logout link to go to login form and logout properly +### THIS NEXT -> - JUST CHANGED the keys to a new system and dropping data property, right in the middle of it actually but it needs to be changed back partially see below + - First of all, put gzmenu on to the vue object in main so can use it for little utilities like click handling, generating unique nav keys etc + - Reason was to ensure key uniqueness (two nav items with same key are erroring) + - HOWEVER as I'm thinking about it now, do we really want all that url stuff being in the key? + - Instead, change back to using data but add a third parameter to make sure that keys are unique somehow + - That way we can put anything into the data key again because in future might need whole objects etc (almost certainly will) + - Move ABOUT item to just above HELP in menu and remove from main NAV and make it navigate properly on click + - Make about contextual and insert a menu item to view log + - TODO navigating through menu doesn't "back" properly when clicking back on browser controls - WIRE up save menu item and add code to disable save on broken rules (and make red, disabled etc) - Wire up delete menu item - api code is stubbed out for delete, need to write that as well - - Move ABOUT item to just above HELP in menu and remove from main NAV and make it navigate properly on click + - DO I need to institute a back button? (in APP MODE?? installed to "desktop" on device will I be able to easily navigate without back and forward buttons) - Navigation guard: navigate away with unsaved changes should warn and prevent but have option to continue anyway @@ -288,6 +297,8 @@ Make all fields work according to specs below - List should remember where the user was when they go to edit and back again - What to do if they edit? Refresh the list but keep the same page location? + - something I just forgot as I went to write it and got stuck reading older shit here + - SCROLL POSITION !! - Very important, must return UI to exact scroll position on navigation backwards, not doing so causes a hellish UI to use. - Same position in window - Same settings in any grids being shown and scrolled to same point in grids diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 70ff69ad..6b63f7d5 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -35,20 +35,29 @@ export default { //global menu items - //Logout + //LOGOUT that.appBar.menuItems.push({ title: that.$gzlocale.get("Logout"), icon: "sign-out-alt", color: "pink", - key: "app:logout" + key: "app||logout" }); - //Insert help item + //divider + that.appBar.menuItems.push({ divider: true, inset: false }); + + //HELP that.appBar.menuItems.push({ title: that.$gzlocale.get("MenuHelp"), icon: "question-circle", - key: "app:help", - data: that.appBar.helpUrl + key: "app||help||" + that.appBar.helpUrl + }); + + //ABOUT + that.appBar.menuItems.push({ + title: that.$gzlocale.get("HelpAboutAyaNova"), + icon: "info-circle", + key: "app||nav||about" }); }, /////////////////////////////// @@ -77,21 +86,29 @@ export default { // Deal with a menu change request // called from App.vue handleClick(that, menuitem) { - //Key will start with the string "app:" if it's a global application command that should be handled here, + //Key will start with the string "app||" if it's a global application command that should be handled here, //otherwise it's a local command for a local form only - //If there is any extended information required for the command it will be in the "data" key of the menu item (e.g. the url in a app:help link) + //If there is any extended information required for the command it will be in the key after the command portion of the menu item (e.g. the url in a app||help link) + //split a key into component parts, part one is the responsible party, part two is the command, part three to part * are all extra info + //each part is separated by a double pipe symbol || //Handle different items - if (!menuitem.disabled && menuitem.key.startsWith("app:")) { - switch (menuitem.key) { - case "app:help": - var helpurl = that.$store.state.helpUrl + menuitem.data; + if (!menuitem.disabled && menuitem.key.startsWith("app||")) { + var keyparts = menuitem.key.split("||"); + var cmd = keyparts[1]; + var data = keyparts[2] ? keyparts[2] : null; + switch (cmd) { + case "help": + var helpurl = that.$store.state.helpUrl + data; window.open(helpurl, "_blank"); break; - case "app:logout": + case "logout": processLogout(); that.$router.replace({ name: "login" }); break; + case "nav": + that.$router.replace({ name: data }); + break; default: alert( "gzmenu:handleClick - unrecognized command [" + menuitem.key + "]" diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index e69001e7..11990c87 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -70,9 +70,10 @@ export default function initialize() { addNavItem(locale.get("Operations"), "cogs", "ops"); } + //MOVED TO MENU OUT OF NAV //Everyone can see about and logout - addNavItem(locale.get("HelpAboutAyaNova"), "info-circle", "/about"); - addNavItem(locale.get("Logout"), "sign-out-alt", "/login"); + // addNavItem(locale.get("HelpAboutAyaNova"), "info-circle", "/about"); + // addNavItem(locale.get("Logout"), "sign-out-alt", "/login"); }) .catch(function handleIntializeError(error) { store.commit("logItem", "Initialize::() ltfetch -> error" + error); diff --git a/ayanova/src/views/About.vue b/ayanova/src/views/About.vue index df0eba6f..b3ec2ba0 100644 --- a/ayanova/src/views/About.vue +++ b/ayanova/src/views/About.vue @@ -2,7 +2,7 @@ - + {{ this.$gzlocale.get("ClientApp")}} @@ -106,6 +106,13 @@