From 9fdb7e4b7d3f8142b1c4d0a9ffd3e7d8f9225f5f Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sun, 18 Aug 2024 09:57:56 -0500 Subject: [PATCH 1/4] Set List of products in alphabetical order --- client/MenuItems/modalLinkProducts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/MenuItems/modalLinkProducts.js b/client/MenuItems/modalLinkProducts.js index 86c3378..d15780e 100644 --- a/client/MenuItems/modalLinkProducts.js +++ b/client/MenuItems/modalLinkProducts.js @@ -28,7 +28,7 @@ Template.modalLinkProducts.onRendered(function() { Template.modalLinkProducts.helpers({ products: function() { - return Products.find({}); + return Products.find({}, {sort: { prodName:1 }}); } }); From c41857ab3e6b08fcaee8ec7d9588f85a459f3869 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sun, 18 Aug 2024 09:59:58 -0500 Subject: [PATCH 2/4] Made items list in alphabetical order --- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js index 8f4b4cc..5f9d817 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js @@ -22,19 +22,19 @@ Template.prodMgmtTbl.helpers({ if (typeof searchVal == 'undefined' || searchVal.length == 0) { return Products.find({}); } else { - return Products.find({ prodName: { $regex: searchVal + '.*', $options: 'i' } }); + return Products.find({ prodName: { $regex: searchVal + '.*', $options: 'i' } }, { sort: { prodName: 1 }}); } } else if (searchStore == true) { let searchVal = Session.get("searchStoreVal"); if (typeof searchVal == 'undefined' || searchVal.length == 0) { return Products.find({}); } else { - return Products.find({ prodStore: { $regex: searchVal + '.*', $options: 'i' } }); + return Products.find({ prodStore: { $regex: searchVal + '.*', $options: 'i' } }, { sort: { prodName: 1 }}); } } else if (noStoreSet == true) { - return Products.find({ prodStore: '' }); + return Products.find({ prodStore: '' }, { sort: { prodName: 1 }}); } else { - return Products.find({}); + return Products.find({}, { sort: { prodName: 1 }}); } }, searchProd: function() { From f02ea7d549f10629c2b22fb7bd26b1d6852193ca Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sun, 18 Aug 2024 10:12:43 -0500 Subject: [PATCH 3/4] Putting a capital letter on the front of any product added. --- imports/api/products.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imports/api/products.js b/imports/api/products.js index 965346e..b2c08d7 100644 --- a/imports/api/products.js +++ b/imports/api/products.js @@ -20,8 +20,10 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add products. Make sure you are logged in with valid user credentials.'); } + let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1); + return Products.insert({ - prodName: prodName, + prodName: pname, prodOwner: this.userId, prodStore: prodStore, }); @@ -35,9 +37,11 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit products. Make sure you are logged in with valid user credentials.'); } + let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1); + return Products.update({ _id: prodId }, { $set: { - prodName: prodName, + prodName: pname, prodStore: prodStore, } }); From c70f9bd74e50933111b7a00180fb09e92e1a0f84 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Wed, 21 Aug 2024 07:01:36 -0500 Subject: [PATCH 4/4] Multiple updates and additions - Added a permission to show or hide update version information on that dashboard as a card that will only show when new update info is available and not yet dismissed. - Updated Lists so list items added will have their fist letter auto-capitalized - Updated Lists so list items are searched against the products before being added to the list, so we have store info more commonly in lists - Updated Products so new products will have their first letter capitalized automatically - Updated the dashboard to show the Update Available card if this is enbaled in permissions. - The dashboard card only shows for System Admin roles. - The dashboard card is enabled by default - The dashboard card is pulled from the GitLab releases RSS feed. - The RSS Feed is only checked every 30 minutes using node-cron - Updated System Configuration to have a toggle for the update available card - Added a bell icon to the top and slide out navigation, shown when a new update is available, if update available is enabled in system configuration. --- client/AdminMgmt/SystemAdmin/systemAdmin.html | 32 +++- client/AdminMgmt/SystemAdmin/systemAdmin.js | 32 +++- client/Dashboard/dashboard.html | 37 +++++ client/Dashboard/dashboard.js | 42 ++++- client/General/headerBar.html | 4 + client/General/headerBar.js | 13 +- imports/api/listItems.js | 15 +- imports/api/products.js | 18 +- imports/api/systemConfig.js | 19 ++- package-lock.json | 157 ++++++++++++++++++ package.json | 2 + server/main.js | 44 +++++ server/methods.js | 1 + server/publish.js | 23 +++ 14 files changed, 410 insertions(+), 29 deletions(-) diff --git a/client/AdminMgmt/SystemAdmin/systemAdmin.html b/client/AdminMgmt/SystemAdmin/systemAdmin.html index 9fa8709..2a31b13 100644 --- a/client/AdminMgmt/SystemAdmin/systemAdmin.html +++ b/client/AdminMgmt/SystemAdmin/systemAdmin.html @@ -1,7 +1,7 @@ \ No newline at end of file + diff --git a/client/AdminMgmt/SystemAdmin/systemAdmin.js b/client/AdminMgmt/SystemAdmin/systemAdmin.js index 95f6e1d..80b7ffd 100644 --- a/client/AdminMgmt/SystemAdmin/systemAdmin.js +++ b/client/AdminMgmt/SystemAdmin/systemAdmin.js @@ -1,7 +1,9 @@ import { SysConfig } from '../../../imports/api/systemConfig.js'; +import { M } from '../../lib/assets/materialize.js'; Template.systemAdmin.onCreated(function() { this.subscribe("SystemConfig"); + this.subscribe("rolesAvailable"); }); Template.systemAdmin.onRendered(function() { @@ -10,16 +12,24 @@ Template.systemAdmin.onRendered(function() { if (typeof curr != 'undefined') { $("#allowGenReg").prop('checked', curr.allowReg); $("#allAdmReg").prop('checked', curr.SysAdminReg); + $("#recvUpdateMsgs").prop('checked', curr.allowUpdates); } else { console.log(" ---- unable to find current system configuration."); } }); + + var elems = document.querySelectorAll('select'); + + setTimeout(function() { + var instances = M.FormSelect.init(elems, {}); + }, 300); + }); Template.systemAdmin.helpers({ currConfigs: function() { - } + }, }); Template.systemAdmin.events({ @@ -29,12 +39,22 @@ Template.systemAdmin.events({ // console.log("General Reg set to: " + genReg); Meteor.call("add.noSysAdminReg", admReg, genReg, function(err, result) { if (err) { - console.log(" ERROR updating permission to allow general registration: " + err); - showSnackbar("Registration Permission Change Failed.", "red"); + // console.log(" ERROR updating permission to allow general registration: " + err); + // showSnackbar("Registration Permission Change Failed.", "red"); } else { - console.log(" Successfully updated permission to allow general registration."); + // console.log(" Successfully updated permission to allow general registration."); showSnackbar("Registration Permission Successfully Changed.", "green") } }); - } -}); \ No newline at end of file + }, + 'change #recvUpdateMsgs' (event) { + let updSet = $("#recvUpdateMsgs").prop('checked'); + Meteor.call('allow.updateInfo', updSet, function(err, result) { + if (err) { + console.log(" ERROR changing update setting: " + err); + } else { + showSnackbar("Update Setting Changed Successfully!", "green"); + } + }); + }, +}); diff --git a/client/Dashboard/dashboard.html b/client/Dashboard/dashboard.html index 017ac4f..30085b4 100644 --- a/client/Dashboard/dashboard.html +++ b/client/Dashboard/dashboard.html @@ -1,6 +1,43 @@