From c733727829f1812a5fb30fe9b676b0cd94822da7 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 24 Aug 2024 10:50:20 -0500 Subject: [PATCH] Updated lists to group by store Lists have been updated to group by store. This feature adds a new tab to the List view. Users can now view their items on the general (un-ordered) list, or can see their items gouped by store(s) the product has been assigned. If a product is on the list, and does not have an assigned store, it will not show on the new store grouped tab. Updated the dashboard card for update available information to place the update release notes in a prettier format. --- client/Dashboard/dashboard.html | 2 +- client/Dashboard/dashboard.js | 5 +- client/General/headerBar.html | 4 +- client/ListItems/listItemTblByStore.html | 21 +++++++- client/ListItems/listItemTblByStore.js | 67 ++++++++++++++++++++++-- client/ListItems/listItemsMain.html | 21 +++++++- client/ListItems/listItemsMain.js | 7 ++- client/ListItems/listItemsTbl.js | 4 +- 8 files changed, 115 insertions(+), 16 deletions(-) diff --git a/client/Dashboard/dashboard.html b/client/Dashboard/dashboard.html index 30085b4..0bb3c46 100644 --- a/client/Dashboard/dashboard.html +++ b/client/Dashboard/dashboard.html @@ -16,7 +16,7 @@
Release Notes: -

{{descriptionSinHTML}}

+

{{{descriptionSinHTML}}}

Release Date: diff --git a/client/Dashboard/dashboard.js b/client/Dashboard/dashboard.js index efc49aa..68e0d7f 100644 --- a/client/Dashboard/dashboard.js +++ b/client/Dashboard/dashboard.js @@ -60,7 +60,8 @@ Template.dashboard.helpers({ return todayDate; }, updates: function() { - return UpdateInfo.find({}); + let updateAvail = UpdateInfo.find({}); + return updateAvail; }, updatesExist: function() { let updateExists = UpdateInfo.find({ viewed: false }).fetch(); @@ -76,7 +77,7 @@ Template.dashboard.helpers({ descriptionSinHTML: function() { let desc = this.description; let sinH = $(desc).text(); - return sinH; + return desc; }, niceDate: function() { let rDateNorm = this.date; diff --git a/client/General/headerBar.html b/client/General/headerBar.html index 5a92d36..9971514 100644 --- a/client/General/headerBar.html +++ b/client/General/headerBar.html @@ -33,7 +33,9 @@
  • My Settings
  • {{#if isInRole 'systemadmin'}}
  • Manage
  • -
  • notifications
  • + {{#if $eq updateExists true}} +
  • notifications
  • + {{/if}} {{/if}}
  • Sign Out
  • {{else}} diff --git a/client/ListItems/listItemTblByStore.html b/client/ListItems/listItemTblByStore.html index 9ae249b..45a431f 100644 --- a/client/ListItems/listItemTblByStore.html +++ b/client/ListItems/listItemTblByStore.html @@ -1,9 +1,26 @@ diff --git a/client/ListItems/listItemsMain.js b/client/ListItems/listItemsMain.js index fe9e509..a81812f 100644 --- a/client/ListItems/listItemsMain.js +++ b/client/ListItems/listItemsMain.js @@ -1,9 +1,12 @@ +import { M } from '../lib/assets/materialize.js'; + Template.listItemsMain.onCreated(function() { }); Template.listItemsMain.onRendered(function() { - + var elems = document.querySelectorAll('.tabs'); + var instance = M.Tabs.init(elems, {}); }); Template.listItemsMain.helpers({ @@ -12,4 +15,4 @@ Template.listItemsMain.helpers({ Template.listItemsMain.events({ -}); \ No newline at end of file +}); diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js index 314ae0f..e17a006 100644 --- a/client/ListItems/listItemsTbl.js +++ b/client/ListItems/listItemsTbl.js @@ -20,7 +20,7 @@ Template.listItemsTbl.onRendered(function() { Template.listItemsTbl.helpers({ 'thisListItems': function() { let showRecvd = Session.get("showReceivedItems"); - let searchVal = Session.get("searchVal");; + let searchVal = Session.get("searchVal"); if (showRecvd == false) { if (typeof searchVal == 'undefined' || searchVal.length === 0) { return ListItems.find({ itemReceived: false }); @@ -76,4 +76,4 @@ Template.listItemsTbl.events({ Session.set("item", this.itemName); Session.set("view", "List Items"); }, -}); \ No newline at end of file +});