From 9fdb7e4b7d3f8142b1c4d0a9ffd3e7d8f9225f5f Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sun, 18 Aug 2024 09:57:56 -0500 Subject: [PATCH 01/27] 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 02/27] 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 03/27] 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 04/27] 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 @@ \ No newline at end of file diff --git a/client/AdminMgmt/ListMgmt/listMgmtTbl.js b/client/AdminMgmt/ListMgmt/listMgmtTbl.js index d737894..fb348a8 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtTbl.js +++ b/client/AdminMgmt/ListMgmt/listMgmtTbl.js @@ -2,7 +2,7 @@ import { Lists } from '../../../imports/api/lists.js'; import { M } from '../../lib/assets/materialize.js'; Template.listMgmtTbl.onCreated(function() { - this.subscribe("myLists"); + this.subscribe("allLists"); }); Template.listMgmtTbl.onRendered(function() { @@ -14,7 +14,12 @@ Template.listMgmtTbl.onRendered(function() { Template.listMgmtTbl.helpers({ lists: function() { - return Lists.find({}); + let showComplete = Session.get("showCompletedLists"); + if (showComplete) { + return Lists.find({ listComplete: true }); + } else { + return Lists.find({}); + } } }); @@ -51,5 +56,16 @@ Template.listMgmtTbl.events({ // console.log(" SUCCESS marking complete."); } }); + }, + 'click .markListNotComplete' (event) { + event.preventDefault(); + let listId = this._id; + Meteor.call('mark.incomplete', listId, function(err, result) { + if (err) { + + } else { + + } + }); } }); \ No newline at end of file diff --git a/imports/api/lists.js b/imports/api/lists.js index 6b8651d..1c02722 100644 --- a/imports/api/lists.js +++ b/imports/api/lists.js @@ -64,7 +64,21 @@ Meteor.methods({ listComplete: true, completedOn: new Date() } - });; + }); + }, + 'mark.incomplete' (listId) { + check(listId, String); + + if (!this.userId) { + throw new Meteor.Error('You are not allowed to restore completed lists. Make sure you are logged in with valid user credentials.'); + } + + return Lists.update({ _id: listId }, { + $set: { + listComplete: false, + completedOn: new Date() + } + }); }, 'clean.Lists' () { if (!this.userId) { From 717994508add8fbf556af6c42831d1cfbc67ab7d Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Tue, 27 May 2025 13:33:38 -0500 Subject: [PATCH 10/27] Small change to address a simple filter --- client/AdminMgmt/ListMgmt/listMgmtTbl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/AdminMgmt/ListMgmt/listMgmtTbl.js b/client/AdminMgmt/ListMgmt/listMgmtTbl.js index fb348a8..3681ded 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtTbl.js +++ b/client/AdminMgmt/ListMgmt/listMgmtTbl.js @@ -16,9 +16,9 @@ Template.listMgmtTbl.helpers({ lists: function() { let showComplete = Session.get("showCompletedLists"); if (showComplete) { - return Lists.find({ listComplete: true }); - } else { return Lists.find({}); + } else { + return Lists.find({ listComplete: false }); } } }); @@ -62,7 +62,7 @@ Template.listMgmtTbl.events({ let listId = this._id; Meteor.call('mark.incomplete', listId, function(err, result) { if (err) { - + } else { } From cca29bc591757bae3d2535fed0539d037d7cd97b Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 21 Jun 2025 07:28:59 -0500 Subject: [PATCH 11/27] Updating framework to meteor 3 and later --- .meteor/packages | 38 +- .meteor/release | 2 +- .meteor/versions | 188 +- client/Accounts/Login/login.js | 1 + client/Accounts/Login/reg.js | 24 +- client/Accounts/UserMgmt/userInfoModal.html | 2 +- client/Accounts/UserMgmt/userInfoModal.js | 86 +- client/Accounts/UserMgmt/userMgmt.js | 2 +- .../modalConfirm/cleanUpModalConfirm.js | 38 +- client/AdminMgmt/ListMgmt/listMgmtForm.js | 67 +- client/AdminMgmt/ListMgmt/listMgmtTbl.js | 33 +- client/AdminMgmt/MgmtPage/mgmtPage.js | 2 + client/AdminMgmt/ProductMgmt/prodMgmtForm.js | 51 +- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 15 +- client/AdminMgmt/StoreMgmt/storeMgmtForm.js | 89 +- client/AdminMgmt/SystemAdmin/systemAdmin.js | 28 +- client/AdminMgmt/Tasks/taskForm.js | 13 +- client/AdminMgmt/Tasks/taskTbl.js | 8 +- client/Dashboard/dashboard.html | 16 +- client/Dashboard/dashboard.js | 73 +- .../deleteConfirmationModal.js | 8 +- client/General/headerBar.html | 2 +- client/General/headerBar.js | 25 +- client/ListItems/listItemsForm.js | 38 +- client/ListItems/listItemsTbl.js | 4 +- client/Lists/listsTbl.js | 23 +- client/MainLayout.js | 33 +- client/MenuItems/addProdToListModal.js | 8 +- client/MenuItems/menuItemsForm.js | 101 +- client/MenuItems/menuItemsTbl.js | 18 +- client/MenuItems/modalLinkProducts.js | 42 +- client/Menus/addMenuModal.js | 8 +- client/Menus/mainMenuTbl.js | 44 +- client/MyTasks/myTasksForm.js | 14 +- client/MyTasks/myTasksTbl.js | 8 +- client/UserConfig/userConfig.js | 59 +- imports/api/listItems.js | 68 +- imports/api/lists.js | 12 +- imports/api/mScripts.js | 2 +- imports/api/menu.js | 24 +- imports/api/menuItems.js | 10 +- imports/api/menuProdLinks.js | 4 +- imports/api/products.js | 27 +- imports/api/recipeItems.js | 6 +- imports/api/recipes.js | 6 +- imports/api/stores.js | 6 +- imports/api/systemConfig.js | 44 +- imports/api/tasks.js | 40 +- imports/api/updateInfo.js | 4 +- imports/api/userConfig.js | 31 +- imports/api/userConfigOptions.js | 2 +- imports/api/userLast.js | 43 +- lib/routes.js | 40 +- package-lock.json | 1993 ++++++++++------- package.json | 2 +- server/main.js | 299 +-- server/methods.js | 62 +- server/publish.js | 7 + 58 files changed, 2332 insertions(+), 1611 deletions(-) diff --git a/.meteor/packages b/.meteor/packages index c866ba8..4af5ec1 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -4,29 +4,27 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -meteor-base@1.5.1 # Packages every Meteor app needs to have -mobile-experience@1.1.1 # Packages for a great mobile UX -mongo@1.16.10 # The database Meteor supports right now +meteor-base@1.5.2 # Packages every Meteor app needs to have +mobile-experience@1.1.2 # Packages for a great mobile UX +mongo@2.1.2 # The database Meteor supports right now blaze-html-templates # Compile .html files into Meteor Blaze views jquery # Wrapper package for npm-installed jquery -reactive-var@1.0.12 # Reactive variable for tracker -tracker@1.3.3 # Meteor's client-side reactive programming library +reactive-var@1.0.13 # Reactive variable for tracker +tracker@1.3.4 # Meteor's client-side reactive programming library -standard-minifier-css@1.9.2 # CSS minifier run for production mode -standard-minifier-js@2.8.1 # JS minifier run for production mode -es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers -ecmascript@0.16.8 # Enable ECMAScript2015+ syntax in app code -typescript@4.9.5 # Enable TypeScript syntax in .ts and .tsx modules -shell-server@0.5.0 # Server-side component of the `meteor shell` command +standard-minifier-css@1.9.3 # CSS minifier run for production mode +standard-minifier-js@3.1.0 # JS minifier run for production mode +es5-shim@4.8.1 # ECMAScript 5 compatibility for older browsers +ecmascript@0.16.11 # Enable ECMAScript2015+ syntax in app code +typescript@5.6.4 # Enable TypeScript syntax in .ts and .tsx modules +shell-server@0.6.1 # Server-side component of the `meteor shell` command -hot-module-replacement@0.5.3 # Update code in development without reloading the page +hot-module-replacement@0.5.4 # Update code in development without reloading the page blaze-hot # Update files using Blaze's API with HMR -alanning:roles@2.2.0 -email@2.2.6 -session@1.2.1 - -raix:handlebar-helpers -kadira:flow-router -kadira:blaze-layout -accounts-password@2.4.0 +roles@1.0.1 +session@1.2.2 +email@3.1.2 +arianjahiri:meteor-handlebars-helpers +ostrio:flow-router-extra +accounts-password@3.2.0 diff --git a/.meteor/release b/.meteor/release index 5152abe..d515fb7 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -METEOR@2.16 +METEOR@3.3 diff --git a/.meteor/versions b/.meteor/versions index 6007c47..17cd573 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,94 +1,94 @@ -accounts-base@2.2.11 -accounts-password@2.4.0 -alanning:roles@2.2.0 -allow-deny@1.1.1 -autoupdate@1.8.0 -babel-compiler@7.10.5 -babel-runtime@1.5.1 -base64@1.0.12 -binary-heap@1.0.11 -blaze@2.9.0 -blaze-hot@1.1.2 -blaze-html-templates@1.2.1 -blaze-tools@1.1.4 -boilerplate-generator@1.7.2 -caching-compiler@1.2.2 -caching-html-compiler@1.2.2 -callback-hook@1.5.1 -check@1.4.1 -ddp@1.4.1 -ddp-client@2.6.2 -ddp-common@1.4.1 -ddp-rate-limiter@1.2.1 -ddp-server@2.7.1 -deps@1.0.12 -diff-sequence@1.1.2 -dynamic-import@0.7.3 -ecmascript@0.16.8 -ecmascript-runtime@0.8.1 -ecmascript-runtime-client@0.12.1 -ecmascript-runtime-server@0.11.0 -ejson@1.1.3 -email@2.2.6 -es5-shim@4.8.0 -fetch@0.1.4 -geojson-utils@1.0.11 -hot-code-push@1.0.4 -hot-module-replacement@0.5.3 -html-tools@1.1.4 -htmljs@1.2.1 -id-map@1.1.1 -inter-process-messaging@0.1.1 -jquery@3.0.0 -kadira:blaze-layout@2.0.1 -kadira:flow-router@2.12.1 -launch-screen@2.0.0 -localstorage@1.2.0 -logging@1.3.4 -meteor@1.11.5 -meteor-base@1.5.1 -minifier-css@1.6.4 -minifier-js@2.8.0 -minimongo@1.9.4 -mobile-experience@1.1.1 -mobile-status-bar@1.1.0 -modern-browsers@0.1.10 -modules@0.20.0 -modules-runtime@0.13.1 -modules-runtime-hot@0.14.2 -mongo@1.16.10 -mongo-decimal@0.1.3 -mongo-dev-server@1.1.0 -mongo-id@1.0.8 -npm-mongo@4.17.2 -observe-sequence@1.0.22 -ordered-dict@1.1.0 -promise@0.12.2 -raix:handlebar-helpers@0.2.5 -random@1.2.1 -rate-limit@1.1.1 -react-fast-refresh@0.2.8 -reactive-dict@1.3.1 -reactive-var@1.0.12 -reload@1.3.1 -retry@1.1.0 -routepolicy@1.1.1 -session@1.2.1 -sha@1.0.9 -shell-server@0.5.0 -socket-stream-client@0.5.2 -spacebars@1.6.0 -spacebars-compiler@1.3.2 -standard-minifier-css@1.9.2 -standard-minifier-js@2.8.1 -templating@1.4.3 -templating-compiler@1.4.2 -templating-runtime@1.6.4 -templating-tools@1.2.3 -tracker@1.3.3 -typescript@4.9.5 -ui@1.0.13 -underscore@1.6.2 -url@1.3.2 -webapp@1.13.8 -webapp-hashing@1.1.1 +accounts-base@3.1.1 +accounts-password@3.2.0 +allow-deny@2.1.0 +arianjahiri:meteor-handlebars-helpers@0.0.1 +autoupdate@2.0.1 +babel-compiler@7.12.0 +babel-runtime@1.5.2 +base64@1.0.13 +binary-heap@1.0.12 +blaze@3.0.2 +blaze-hot@2.0.0 +blaze-html-templates@3.0.0 +blaze-tools@2.0.0 +boilerplate-generator@2.0.1 +caching-compiler@2.0.1 +caching-html-compiler@2.0.0 +callback-hook@1.6.0 +check@1.4.4 +core-runtime@1.0.0 +ddp@1.4.2 +ddp-client@3.1.1 +ddp-common@1.4.4 +ddp-rate-limiter@1.2.2 +ddp-server@3.1.2 +deps@1.0.5-pre.1 +diff-sequence@1.1.3 +dynamic-import@0.7.4 +ecmascript@0.16.11 +ecmascript-runtime@0.8.3 +ecmascript-runtime-client@0.12.3 +ecmascript-runtime-server@0.11.1 +ejson@1.1.5 +email@3.1.2 +es5-shim@4.8.1 +facts-base@1.0.2 +fetch@0.1.6 +geojson-utils@1.0.12 +hot-code-push@1.0.5 +hot-module-replacement@0.5.4 +html-tools@2.0.0 +htmljs@2.0.1 +id-map@1.2.0 +inter-process-messaging@0.1.2 +jquery@3.0.2 +launch-screen@2.0.1 +localstorage@1.2.1 +logging@1.3.6 +meteor@2.1.1 +meteor-base@1.5.2 +minifier-css@2.0.1 +minifier-js@3.0.2 +minimongo@2.0.2 +mobile-experience@1.1.2 +mobile-status-bar@1.1.1 +modern-browsers@0.2.2 +modules@0.20.3 +modules-runtime@0.13.2 +modules-runtime-hot@0.14.3 +mongo@2.1.2 +mongo-decimal@0.2.0 +mongo-dev-server@1.1.1 +mongo-id@1.0.9 +npm-mongo@6.10.2 +observe-sequence@2.0.0 +ordered-dict@1.2.0 +ostrio:flow-router-extra@3.12.0 +promise@1.0.0 +random@1.2.2 +rate-limit@1.1.2 +react-fast-refresh@0.2.9 +reactive-dict@1.3.2 +reactive-var@1.0.13 +reload@1.3.2 +retry@1.1.1 +roles@1.0.1 +routepolicy@1.1.2 +session@1.2.2 +sha@1.0.10 +shell-server@0.6.1 +socket-stream-client@0.6.1 +spacebars@2.0.0 +spacebars-compiler@2.0.0 +standard-minifier-css@1.9.3 +standard-minifier-js@3.1.0 +templating@1.4.4 +templating-compiler@2.0.0 +templating-runtime@2.0.1 +templating-tools@2.0.0 +tracker@1.3.4 +typescript@5.6.4 +underscore@1.6.4 +url@1.3.5 +webapp@2.0.7 +webapp-hashing@1.1.2 diff --git a/client/Accounts/Login/login.js b/client/Accounts/Login/login.js index 7f3c38a..d251060 100644 --- a/client/Accounts/Login/login.js +++ b/client/Accounts/Login/login.js @@ -1,4 +1,5 @@ import { SysConfig } from '../../../imports/api/systemConfig.js'; +import { FlowRouter } from 'meteor/ostrio:flow-router-extra'; Template.login.onCreated(function() { this.subscribe("SystemConfig"); diff --git a/client/Accounts/Login/reg.js b/client/Accounts/Login/reg.js index c2ddbe2..8bf158e 100644 --- a/client/Accounts/Login/reg.js +++ b/client/Accounts/Login/reg.js @@ -1,4 +1,5 @@ import { SysConfig } from "../../../imports/api/systemConfig.js"; +import { FlowRouter } from 'meteor/ostrio:flow-router-extra'; Template.reg.onCreated(function() { this.subscribe("SystemConfig"); @@ -29,12 +30,15 @@ Template.reg.helpers({ return Session.get("missingReq"); }, allowReg: function() { - let conf = SysConfig.findOne(); - if (typeof conf != 'undefined') { - return conf.allowReg; - } else { - return true + const sysConf = async() => { + let conf = await SysConfig.findOneAsync(); + if (!conf) { + return true; + } else { + return conf.allowReg; + } } + sysConf(); } }); @@ -84,14 +88,16 @@ Template.reg.events({ let userId = Meteor.userId(); console.log("User ID: " + userId); - Meteor.call("addToRole", "user", function(err, result) { - if (err) { - console.log(" ERROR: ROLES - Error adding user to role: " + err); + const addRole = async() => { + let result = await Meteor.callAsync("addToRole", "user"); + if (!result) { + console.log(" ERROR: ROLES - Error adding user to role: "); } else { // console.log("User should be added to role - teacher."); FlowRouter.go('/dashboard'); } - }); + } + addRole(); } } }, diff --git a/client/Accounts/UserMgmt/userInfoModal.html b/client/Accounts/UserMgmt/userInfoModal.html index e25fda3..156a66a 100644 --- a/client/Accounts/UserMgmt/userInfoModal.html +++ b/client/Accounts/UserMgmt/userInfoModal.html @@ -15,7 +15,7 @@ {{#if $eq passMatch false}}

Passwords do not match!

{{/if}} -
+
{{#each taskUsers}} @@ -11,7 +11,7 @@ {{/each}}
-
+
diff --git a/client/AdminMgmt/Tasks/taskForm.js b/client/AdminMgmt/Tasks/taskForm.js index c5a6a0f..2ff956e 100644 --- a/client/AdminMgmt/Tasks/taskForm.js +++ b/client/AdminMgmt/Tasks/taskForm.js @@ -69,7 +69,6 @@ Template.taskForm.events({ let taskDateErr = false; let userInfo; let actDate = []; - // console.dir(taskNameArr); if (taskNameArr == null || taskNameArr == []) { taskNameErr = true; diff --git a/client/MyTasks/myTasksForm.js b/client/MyTasks/myTasksForm.js index 6f4e6e3..d0ce6db 100644 --- a/client/MyTasks/myTasksForm.js +++ b/client/MyTasks/myTasksForm.js @@ -33,36 +33,26 @@ Template.myTasksForm.events({ let taskDateArray = Session.get("taskDateArr"); let actDate = []; + console.dir(taskNameArray); + console.dir(taskDateArray); + if (taskNameArray == null || taskNameArray == [] || taskNameArray == "") { taskNameErr = true; } if (taskDateArray == null || taskDateArray == []|| taskDateArray == "") { taskDateErr = true; - } else { - for (let i = 0; i < taskDateArray.length; i++) { - // console.log(taskDateArray[i]); - let actDateTask = new Date(taskDateArray[i]); - actDate.push(actDateTask); - } } // console.log("Date Error: " + taskDateErr + " - Name Error: " + taskNameErr); if (taskDateErr == false && taskNameErr == false) { - const addTask = async() => { - let result = await Meteor.callAsync("add.task", taskNameArray, "self", "selfId", taskDateArray, actDate); - if (!result) { - console.log(" ERROR adding task for self: "); - showSnackbar("Error adding task for self!", "red"); - } else { - console.log(" SUCCESS adding task for self."); - Session.set("taskDateArr", []); - $("#myTaskName").val(""); - $("#myTaskDate").val(""); - showSnackbar("Added Tasks Successfully!", "green"); + for (const task of taskNameArray) { + for (const date of taskDateArray) { + let actDate = new Date(date); + + addTask(task.id, date, actDate); } } - addTask(); } else { showSnackbar("Error! Both Task & Date are Required!", "red"); } @@ -93,4 +83,18 @@ Template.myTasksForm.events({ taskDateArr.push(taskDate); Session.set("taskDateArr", taskDateArr); }, -}); \ No newline at end of file +}); + +const addTask = async(task, date, actDate) => { + let result = await Meteor.callAsync("add.myTask", task, date, actDate); + if (!result) { + console.log(" ERROR adding task for self: "); + showSnackbar("Error adding task for self!", "red"); + } else { + console.log(" SUCCESS adding task for self."); + // Session.set("taskDateArr", []); + // $("#myTaskName").val(""); + // $("#myTaskDate").val(""); + showSnackbar("Added Tasks Successfully!", "green"); + } +} \ No newline at end of file diff --git a/imports/api/tasks.js b/imports/api/tasks.js index 7bb2037..1fece81 100644 --- a/imports/api/tasks.js +++ b/imports/api/tasks.js @@ -13,7 +13,7 @@ TaskItems.allow({ }); Meteor.methods({ - 'add.task' (taskNameArr, assignedTo, assignedToId, taskDateArr, actDate) { + async 'add.task' (taskNameArr, assignedTo, assignedToId, taskDateArr, actDate) { check(taskNameArr, [Object]); check(assignedTo, String); check(taskDateArr, [String]); @@ -23,41 +23,15 @@ Meteor.methods({ if (!this.userId) { throw new Meteor.Error('You are not allowed to add tasks. Make sure you are logged in with valid user credentials.'); } - - let username; - let usInfo; - - if (assignedTo == "self") { - const uInfo = async() => { - let userInfo = await Meteor.users.findOneAsync({ _id: this.userId }); - if (!userInfo) { - console.log("No matching user info found.") - } else { - username = userInfo.profile.fullname; - assignedToId = this.userId; - let usInf = { "username": username, "assignedToId": assignedToId }; - console.log("setting username = " + username +", and id = " + assignedToId); - return usInf; - } - } - usInfo = uInfo(); - console.dir(usInfo); - } else { - username = assignedTo; - usInfo = { "username": assignedTo, "assignedToId": assignedToId }; - console.log("Set username = " + assignedTo); - } - - console.log("assignedToId = " + usInfo.assignedToId); - + for (let i=0; i < taskDateArr.length; i++) { for (let j=0; j < taskNameArr.length; j++) { - TaskItems.insertAsync({ + await TaskItems.insertAsync({ taskName: taskNameArr[j].id, taskDate: taskDateArr[i], actualDate: actDate[i], - assignedTo: usInfo.username, - assignedToId: usInfo.assignedToId, + assignedTo: assignedTo, + assignedToId: assignedToId, isComplete: false, completedOn: null, assignedOn: new Date(), @@ -65,9 +39,8 @@ Meteor.methods({ }); } } - return; }, - 'add.mytask' (taskName, assignedTo, assignedToId, taskDate, actDate) { + async 'add.myTask' (taskName, taskDate, actDate) { check(taskName, String); check(taskDate, String); check(actDate, Date); @@ -76,40 +49,28 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add tasks. Make sure you are logged in with valid user credentials.'); } - let username; - let usInfo; - - if (assignedTo == "self") { - const uInfo = async() => { - let userInfo = await Meteor.users.findOneAsync({ _id: this.userId }); - if (!userInfo) { - console.log("No matching user info found.") - } else { - username = userInfo.profile.fullname; - assignedToId = this.userId; - let usinf = { username: username, assignedToId: assignedToId }; - return usinf; - } - } - usInfo = uInfo(); + let userInfo = await Meteor.users.findOneAsync({ _id: this.userId }); + if (!userInfo) { + console.log("No matching user info found.") } else { - username = assignedTo; - usInfo = { username: assignedTo, assignedToId: assignedToId }; + try { + return await TaskItems.insertAsync({ + taskName: taskName, + taskDate: taskDate, + actualDate: actDate, + assignedTo: userInfo.profile.fullname, + assignedToId: this.userId, + isComplete: false, + completedOn: null, + assignedOn: new Date(), + assignedBy: this.userId, + }); + } catch(error) { + console.log(" ERROR adding tasksL " + error.message); + } } - - return TaskItems.insertAsync({ - taskName: taskName, - taskDate: taskDate, - actualDate: actDate, - assignedTo: usInfo.username, - assignedToId: usInfo.assignedToId, - isComplete: false, - completedOn: null, - assignedOn: new Date(), - assignedBy: this.userId, - }); }, - 'edit.task' (taskId, taskName, assignedTo, taskDate) { + async 'edit.task' (taskId, taskName, assignedTo, taskDate) { check(taskId, String); check(taskName, String); check(assignedTo, String); @@ -119,7 +80,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit tasks. Make sure you are logged in with valid user credentials.'); } - return TaskItems.updateAsync({ _id: taskId }, { + return await TaskItems.updateAsync({ _id: taskId }, { $set: { taskName: taskName, taskDate: taskDate, @@ -129,23 +90,23 @@ Meteor.methods({ } }); }, - 'delete.task' (taskId) { + async 'delete.task' (taskId) { check(taskId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete tasks. Make sure you are logged in with valid user credentials.'); } - return TaskItems.removeAsync({ _id: taskId }); + return await TaskItems.removeAsync({ _id: taskId }); }, - 'markTask.complete' (taskId) { + async 'markTask.complete' (taskId) { check(taskId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark tasks complete. Make sure you are logged in with valid user credentials.'); } - return TaskItems.updateAsync({ _id: taskId }, { + return await TaskItems.updateAsync({ _id: taskId }, { $set: { isComplete: true, completedOn: new Date(), @@ -153,14 +114,14 @@ Meteor.methods({ } }); }, - 'markTask.notComplete' (taskId) { + async 'markTask.notComplete' (taskId) { check(taskId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark tasks not complete. Make sure you are logged in with valid user credentials.'); } - return TaskItems.updateAsync({ _id: taskId }, { + return await TaskItems.updateAsync({ _id: taskId }, { $set: { isComplete: false, markedUncomplteOn: new Date(), @@ -168,7 +129,7 @@ Meteor.methods({ } }); }, - 'clean.Tasks' (timeFrame) { + async 'clean.Tasks' (timeFrame) { check(timeFrame, String); if (!this.userId) { @@ -202,6 +163,6 @@ Meteor.methods({ break; } - return TaskItems.removeAsync({ actualDate: { $lt: new Date((new Date()) - upToDate )}}); + return await TaskItems.removeAsync({ actualDate: { $lt: new Date((new Date()) - upToDate )}}); } }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f2a6116..0d65189 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,12 +16,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", - "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", + "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -29,22 +27,26 @@ "node_modules/addressparser": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz", - "integrity": "sha512-aQX7AISOMM7HFE0iZ3+YnD07oIeJqWGVnJ+ZIKaBZAk03ftmVYVqsGas/rbXKR21n4D/hKCSHypvcyOkds/xzg==" + "integrity": "sha512-aQX7AISOMM7HFE0iZ3+YnD07oIeJqWGVnJ+ZIKaBZAk03ftmVYVqsGas/rbXKR21n4D/hKCSHypvcyOkds/xzg==", + "license": "MIT" }, "node_modules/array-indexofobject": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-indexofobject/-/array-indexofobject-0.0.1.tgz", - "integrity": "sha512-tpdPBIBm4TMNxSp8O3pZgC7mF4+wn9SmJlhE+7bi5so6x39PvzUqChQMbv93R5ilYGZ1HV+Neki4IH/i+87AoQ==" + "integrity": "sha512-tpdPBIBm4TMNxSp8O3pZgC7mF4+wn9SmJlhE+7bi5so6x39PvzUqChQMbv93R5ilYGZ1HV+Neki4IH/i+87AoQ==", + "license": "MIT" }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" }, "node_modules/feedparser": { "version": "2.2.10", "resolved": "https://registry.npmjs.org/feedparser/-/feedparser-2.2.10.tgz", "integrity": "sha512-WoAOooa61V8/xuKMi2pEtK86qQ3ZH/M72EEGdqlOTxxb3m6ve1NPvZcmPFs3wEDfcBbFLId2GqZ4YjsYi+h1xA==", + "license": "MIT", "dependencies": { "addressparser": "^1.0.1", "array-indexofobject": "~0.0.1", @@ -66,50 +68,57 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" }, "node_modules/jquery": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", - "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "license": "MIT" }, "node_modules/lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==", + "license": "MIT" }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead." + "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead.", + "license": "MIT" }, "node_modules/lodash.has": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", - "integrity": "sha512-rnYUdIo6xRCJnQmbVFEwcxF144erlD+M3YcJUVesflU9paQaE8p+fJDcIQrlMYbxoANFL+AB9hZrzSBBk5PL+g==" + "integrity": "sha512-rnYUdIo6xRCJnQmbVFEwcxF144erlD+M3YcJUVesflU9paQaE8p+fJDcIQrlMYbxoANFL+AB9hZrzSBBk5PL+g==", + "license": "MIT" }, "node_modules/lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "license": "MIT" }, "node_modules/meteor-node-stubs": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.5.tgz", - "integrity": "sha512-FLlOFZx3KnZ5s3yPCK+x58DyX9ewN+oQ12LcpwBXMLtzJ/YyprMQVivd6KIrahZbKJrNenPNUGuDS37WUFg+Mw==", + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.19.tgz", + "integrity": "sha512-lryhEAPp7aysrC0j3XU1yTs92ktPQQhzQzLVz3OGQEZjL//iLhvJyeYNSvV01XJn6fXUXe48agossxniJkzYOQ==", "bundleDependencies": [ + "@meteorjs/crypto-browserify", "assert", "browserify-zlib", "buffer", "console-browserify", "constants-browserify", - "crypto-browserify", "domain-browser", "events", "https-browserify", @@ -128,64 +137,167 @@ "util", "vm-browserify" ], + "license": "MIT", "dependencies": { - "assert": "^2.0.0", + "@meteorjs/crypto-browserify": "^3.12.1", + "assert": "^2.1.0", "browserify-zlib": "^0.2.0", "buffer": "^5.7.1", "console-browserify": "^1.2.0", "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.12.0", - "domain-browser": "^4.22.0", - "elliptic": "^6.5.4", + "domain-browser": "^4.23.0", "events": "^3.3.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", - "path-browserify": "^1.0.0", + "path-browserify": "^1.0.1", "process": "^0.11.10", "punycode": "^1.4.1", "querystring-es3": "^0.2.1", - "readable-stream": "^3.6.0", + "readable-stream": "^3.6.2", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "string_decoder": "^1.3.0", "timers-browserify": "^2.0.12", "tty-browserify": "0.0.1", - "url": "^0.11.0", - "util": "^0.12.4", + "url": "^0.11.4", + "util": "^0.12.5", "vm-browserify": "^1.1.2" } }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign": { + "version": "4.2.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "bn.js": "^5.2.1", + "brorand": "^1.1.0", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash-base": "~3.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "inBundle": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/create-ecdh": { + "version": "4.0.5", + "inBundle": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/create-ecdh/node_modules/bn.js": { + "version": "4.12.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/crypto-browserify": { + "version": "3.12.4", + "inBundle": true, + "license": "MIT", + "dependencies": { + "@meteorjs/browserify-sign": "^4.2.3", + "@meteorjs/create-ecdh": "^4.0.4", + "browserify-cipher": "^1.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "diffie-hellman": "^5.0.3", + "hash-base": "~3.0.4", + "inherits": "^2.0.4", + "pbkdf2": "^3.1.2", + "public-encrypt": "^4.0.3", + "randombytes": "^2.1.0", + "randomfill": "^1.0.4" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/meteor-node-stubs/node_modules/asn1.js": { - "version": "5.4.1", + "version": "4.10.1", "inBundle": true, "license": "MIT", "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "minimalistic-assert": "^1.0.0" } }, "node_modules/meteor-node-stubs/node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.0", + "version": "4.12.2", "inBundle": true, "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/assert": { - "version": "2.0.0", + "version": "2.1.0", "inBundle": true, "license": "MIT", "dependencies": { - "es6-object-assign": "^1.1.0", - "is-nan": "^1.2.1", - "object-is": "^1.0.1", - "util": "^0.12.0" + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" } }, "node_modules/meteor-node-stubs/node_modules/available-typed-arrays": { - "version": "1.0.4", + "version": "1.0.7", "inBundle": true, "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -213,7 +325,7 @@ "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/bn.js": { - "version": "5.2.0", + "version": "5.2.2", "inBundle": true, "license": "MIT" }, @@ -257,28 +369,16 @@ } }, "node_modules/meteor-node-stubs/node_modules/browserify-rsa": { - "version": "4.1.0", + "version": "4.1.1", "inBundle": true, "license": "MIT", "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/meteor-node-stubs/node_modules/browserify-sign": { - "version": "4.2.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "bn.js": "^5.2.1", + "randombytes": "^2.1.0", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/meteor-node-stubs/node_modules/browserify-zlib": { @@ -323,24 +423,59 @@ "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/call-bind": { + "version": "1.0.8", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/call-bind-apply-helpers": { "version": "1.0.2", "inBundle": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/meteor-node-stubs/node_modules/call-bound": { + "version": "1.0.4", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/meteor-node-stubs/node_modules/cipher-base": { - "version": "1.0.4", + "version": "1.0.6", "inBundle": true, "license": "MIT", "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/meteor-node-stubs/node_modules/console-browserify": { @@ -352,17 +487,8 @@ "inBundle": true, "license": "MIT" }, - "node_modules/meteor-node-stubs/node_modules/create-ecdh": { - "version": "4.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "node_modules/meteor-node-stubs/node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", + "node_modules/meteor-node-stubs/node_modules/core-util-is": { + "version": "1.0.3", "inBundle": true, "license": "MIT" }, @@ -391,40 +517,40 @@ "sha.js": "^2.4.8" } }, - "node_modules/meteor-node-stubs/node_modules/crypto-browserify": { - "version": "3.12.0", + "node_modules/meteor-node-stubs/node_modules/define-data-property": { + "version": "1.1.4", "inBundle": true, "license": "MIT", "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/meteor-node-stubs/node_modules/define-properties": { - "version": "1.1.3", - "inBundle": true, - "license": "MIT", - "dependencies": { - "object-keys": "^1.0.12" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/define-properties": { + "version": "1.2.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/meteor-node-stubs/node_modules/des.js": { - "version": "1.0.1", + "version": "1.1.0", "inBundle": true, "license": "MIT", "dependencies": { @@ -443,14 +569,14 @@ } }, "node_modules/meteor-node-stubs/node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", + "version": "4.12.2", "inBundle": true, "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/domain-browser": { - "version": "4.22.0", + "version": "4.23.0", "inBundle": true, - "license": "MIT", + "license": "Artistic-2.0", "engines": { "node": ">=10" }, @@ -458,75 +584,46 @@ "url": "https://bevry.me/fund" } }, - "node_modules/meteor-node-stubs/node_modules/elliptic": { - "version": "6.5.4", + "node_modules/meteor-node-stubs/node_modules/dunder-proto": { + "version": "1.0.1", "inBundle": true, "license": "MIT", "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/meteor-node-stubs/node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/meteor-node-stubs/node_modules/es-abstract": { - "version": "1.18.3", - "inBundle": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", - "object-inspect": "^1.10.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/meteor-node-stubs/node_modules/es-to-primitive": { - "version": "1.2.1", + "node_modules/meteor-node-stubs/node_modules/es-define-property": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/meteor-node-stubs/node_modules/es-errors": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/meteor-node-stubs/node_modules/es-object-atoms": { + "version": "1.1.1", "inBundle": true, "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "es-errors": "^1.3.0" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/meteor-node-stubs/node_modules/es6-object-assign": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT" - }, "node_modules/meteor-node-stubs/node_modules/events": { "version": "3.3.0", "inBundle": true, @@ -544,50 +641,65 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/meteor-node-stubs/node_modules/foreach": { - "version": "2.0.5", - "inBundle": true, - "license": "MIT" - }, - "node_modules/meteor-node-stubs/node_modules/function-bind": { - "version": "1.1.1", - "inBundle": true, - "license": "MIT" - }, - "node_modules/meteor-node-stubs/node_modules/get-intrinsic": { - "version": "1.1.1", + "node_modules/meteor-node-stubs/node_modules/for-each": { + "version": "0.3.5", "inBundle": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/meteor-node-stubs/node_modules/has": { - "version": "1.0.3", + "node_modules/meteor-node-stubs/node_modules/function-bind": { + "version": "1.1.2", + "inBundle": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/get-intrinsic": { + "version": "1.3.0", "inBundle": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.1" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/meteor-node-stubs/node_modules/has-bigints": { + "node_modules/meteor-node-stubs/node_modules/get-proto": { "version": "1.0.1", "inBundle": true, "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/meteor-node-stubs/node_modules/has-symbols": { - "version": "1.0.2", + "node_modules/meteor-node-stubs/node_modules/gopd": { + "version": "1.2.0", "inBundle": true, "license": "MIT", "engines": { @@ -597,17 +709,52 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/meteor-node-stubs/node_modules/has-property-descriptors": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/has-symbols": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/has-tostringtag": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/meteor-node-stubs/node_modules/hash-base": { - "version": "3.1.0", + "version": "3.0.5", "inBundle": true, "license": "MIT", "dependencies": { "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "safe-buffer": "^5.2.1" }, "engines": { - "node": ">=4" + "node": ">= 0.10" } }, "node_modules/meteor-node-stubs/node_modules/hash.js": { @@ -619,6 +766,17 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/meteor-node-stubs/node_modules/hasown": { + "version": "2.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/meteor-node-stubs/node_modules/hmac-drbg": { "version": "1.0.1", "inBundle": true, @@ -659,33 +817,12 @@ "license": "ISC" }, "node_modules/meteor-node-stubs/node_modules/is-arguments": { - "version": "1.1.0", + "version": "1.2.0", "inBundle": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-bigint": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-boolean-object": { - "version": "1.1.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -695,18 +832,7 @@ } }, "node_modules/meteor-node-stubs/node_modules/is-callable": { - "version": "1.2.3", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-date-object": { - "version": "1.0.4", + "version": "1.2.7", "inBundle": true, "license": "MIT", "engines": { @@ -717,9 +843,15 @@ } }, "node_modules/meteor-node-stubs/node_modules/is-generator-function": { - "version": "1.0.9", + "version": "1.1.0", "inBundle": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, "engines": { "node": ">= 0.4" }, @@ -742,60 +874,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/meteor-node-stubs/node_modules/is-negative-zero": { - "version": "2.0.1", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-number-object": { - "version": "1.0.5", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/meteor-node-stubs/node_modules/is-regex": { - "version": "1.1.3", + "version": "1.2.1", "inBundle": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-string": { - "version": "1.0.6", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/is-symbol": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -805,15 +892,11 @@ } }, "node_modules/meteor-node-stubs/node_modules/is-typed-array": { - "version": "1.1.5", + "version": "1.1.15", "inBundle": true, "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -822,6 +905,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/meteor-node-stubs/node_modules/isarray": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/meteor-node-stubs/node_modules/math-intrinsics": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/meteor-node-stubs/node_modules/md5.js": { "version": "1.3.5", "inBundle": true, @@ -845,7 +941,7 @@ } }, "node_modules/meteor-node-stubs/node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", + "version": "4.12.2", "inBundle": true, "license": "MIT" }, @@ -860,20 +956,23 @@ "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/object-inspect": { - "version": "1.10.3", + "version": "1.13.4", "inBundle": true, "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/meteor-node-stubs/node_modules/object-is": { - "version": "1.1.5", + "version": "1.1.6", "inBundle": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -891,13 +990,15 @@ } }, "node_modules/meteor-node-stubs/node_modules/object.assign": { - "version": "4.1.2", + "version": "4.1.7", "inBundle": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -918,15 +1019,19 @@ "license": "(MIT AND Zlib)" }, "node_modules/meteor-node-stubs/node_modules/parse-asn1": { - "version": "5.1.6", + "version": "5.1.7", "inBundle": true, "license": "ISC", "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/meteor-node-stubs/node_modules/path-browserify": { @@ -949,6 +1054,14 @@ "node": ">=0.12" } }, + "node_modules/meteor-node-stubs/node_modules/possible-typed-array-names": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/meteor-node-stubs/node_modules/process": { "version": "0.11.10", "inBundle": true, @@ -957,6 +1070,11 @@ "node": ">= 0.6.0" } }, + "node_modules/meteor-node-stubs/node_modules/process-nextick-args": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT" + }, "node_modules/meteor-node-stubs/node_modules/public-encrypt": { "version": "4.0.3", "inBundle": true, @@ -971,7 +1089,7 @@ } }, "node_modules/meteor-node-stubs/node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.0", + "version": "4.12.2", "inBundle": true, "license": "MIT" }, @@ -980,11 +1098,18 @@ "inBundle": true, "license": "MIT" }, - "node_modules/meteor-node-stubs/node_modules/querystring": { - "version": "0.2.0", + "node_modules/meteor-node-stubs/node_modules/qs": { + "version": "6.14.0", "inBundle": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, "engines": { - "node": ">=0.4.x" + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/meteor-node-stubs/node_modules/querystring-es3": { @@ -1012,7 +1137,7 @@ } }, "node_modules/meteor-node-stubs/node_modules/readable-stream": { - "version": "3.6.0", + "version": "3.6.2", "inBundle": true, "license": "MIT", "dependencies": { @@ -1052,10 +1177,37 @@ "inBundle": true, "license": "MIT" }, - "node_modules/meteor-node-stubs/node_modules/safer-buffer": { - "version": "2.1.2", + "node_modules/meteor-node-stubs/node_modules/safe-regex-test": { + "version": "1.1.0", "inBundle": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/set-function-length": { + "version": "1.2.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/meteor-node-stubs/node_modules/setimmediate": { "version": "1.0.5", @@ -1074,6 +1226,74 @@ "sha.js": "bin.js" } }, + "node_modules/meteor-node-stubs/node_modules/side-channel": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/side-channel-list": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/side-channel-map": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/meteor-node-stubs/node_modules/side-channel-weakmap": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/meteor-node-stubs/node_modules/stream-browserify": { "version": "3.0.0", "inBundle": true, @@ -1102,30 +1322,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/meteor-node-stubs/node_modules/string.prototype.trimend": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/meteor-node-stubs/node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/meteor-node-stubs/node_modules/timers-browserify": { "version": "2.0.12", "inBundle": true, @@ -1142,36 +1338,20 @@ "inBundle": true, "license": "MIT" }, - "node_modules/meteor-node-stubs/node_modules/unbox-primitive": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/meteor-node-stubs/node_modules/url": { - "version": "0.11.0", + "version": "0.11.4", "inBundle": true, "license": "MIT", "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" + "punycode": "^1.4.1", + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/meteor-node-stubs/node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "inBundle": true, - "license": "MIT" - }, "node_modules/meteor-node-stubs/node_modules/util": { - "version": "0.12.4", + "version": "0.12.5", "inBundle": true, "license": "MIT", "dependencies": { @@ -1179,7 +1359,6 @@ "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", "which-typed-array": "^1.1.2" } }, @@ -1193,33 +1372,18 @@ "inBundle": true, "license": "MIT" }, - "node_modules/meteor-node-stubs/node_modules/which-boxed-primitive": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/meteor-node-stubs/node_modules/which-typed-array": { - "version": "1.1.4", + "version": "1.1.19", "inBundle": true, "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -1237,9 +1401,10 @@ } }, "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", "engines": { "node": "*" } @@ -1248,6 +1413,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -1256,6 +1422,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", + "license": "ISC", "dependencies": { "uuid": "8.3.2" }, @@ -1267,6 +1434,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -1285,12 +1453,14 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" }, "node_modules/readable-stream": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -1301,15 +1471,11 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, "node_modules/rss-url-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rss-url-parser/-/rss-url-parser-3.0.0.tgz", "integrity": "sha512-x39bDQDe1BwpiVwPrjg52ILbTMZc5h7oDPE7FRLa/sgYar7BrNRBTU/msxgokacPZN1rawXmK1rtBU5N7Gsn4A==", + "license": "MIT", "dependencies": { "feedparser": "^2.2.10", "node-fetch": "^2.6.7" @@ -1322,17 +1488,20 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" }, "node_modules/sax": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "license": "ISC" }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } @@ -1340,22 +1509,26 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" }, "node_modules/typeahead-standalone": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typeahead-standalone/-/typeahead-standalone-5.2.0.tgz", - "integrity": "sha512-9GTbCO7XhwimgolmxzuPklftoIa2NEGXBI30n9f5kQZOptvTeJ9ublhNYy4W00RN1D5gSHM5n4dI5vOojr51hg==" + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/typeahead-standalone/-/typeahead-standalone-5.4.0.tgz", + "integrity": "sha512-aKm/POm1SXb9kPBCZLne+evPOrZtVPtZ8K63EsPhKda77Ax+CaZpxnc+Ahr5Ba4T6BdKMdCiGxBUePF2Sw1Fpw==", + "license": "MIT" }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -1363,12 +1536,14 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" From 706c5dc3ef65f3ea8b6a2a61bc7d351bbc861907 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Tue, 22 Jul 2025 13:50:49 -0500 Subject: [PATCH 16/27] Updates for async and await - still --- client/AdminMgmt/ListMgmt/listMgmtForm.js | 6 +- imports/api/listItems.js | 119 +++++++++++----------- imports/api/lists.js | 24 ++--- imports/api/mScripts.js | 4 +- imports/api/menu.js | 36 +++---- imports/api/menuItems.js | 20 ++-- imports/api/menuProdLinks.js | 8 +- imports/api/products.js | 34 +++---- imports/api/recipeItems.js | 12 +-- imports/api/recipes.js | 12 +-- imports/api/shopList.js | 12 +-- imports/api/stores.js | 12 +-- imports/api/systemConfig.js | 12 +-- imports/api/updateInfo.js | 8 +- imports/api/userConfig.js | 8 +- imports/api/userConfigOptions.js | 4 +- imports/api/userLast.js | 53 +++++----- server/methods.js | 69 ++++++------- 18 files changed, 220 insertions(+), 233 deletions(-) diff --git a/client/AdminMgmt/ListMgmt/listMgmtForm.js b/client/AdminMgmt/ListMgmt/listMgmtForm.js index 509a4c6..75a01c3 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtForm.js +++ b/client/AdminMgmt/ListMgmt/listMgmtForm.js @@ -71,9 +71,8 @@ Template.listMgmtForm.events({ const addList = async(listName, shared) => { let result = await Meteor.callAsync('add.list', listName, shared); if (!result) { - // console.log(" ERROR adding list name: "); + console.log("Nothing returned from method call add.list"); } else { - // console.log(" SUCCESS adding list name."); $("#listNameInp").val(""); $("#isShared").prop("checked", false); } @@ -82,9 +81,8 @@ const addList = async(listName, shared) => { const editList = async(listId, listName, shared) => { let result = await Meteor.callAsync('edit.list', listId, listName, shared); if (!result) { - // console.log(" ERROR editing list name: " + err); + // console.log("Nothing returned from method call edit.list"); } else { - // console.log(" SUCCESS editing list name."); $("#listNameInp").val(""); $("#isShared").prop("checked", false); Session.set("listNameEditMode", false); diff --git a/imports/api/listItems.js b/imports/api/listItems.js index 7f3ff0c..eb66875 100644 --- a/imports/api/listItems.js +++ b/imports/api/listItems.js @@ -14,7 +14,7 @@ ListItems.allow({ }); Meteor.methods({ - 'add.listItem' (itemName, listId) { + async 'add.listItem' (itemName, listId) { check(itemName, String); check(listId, String); @@ -25,50 +25,45 @@ Meteor.methods({ let iname = itemName.charAt(0).toUpperCase() + itemName.slice(1); // look up the item from the Products collection - const prodIsIn = async() => { - let prodInfo = await Products.findOneAsync({ prodName: iname }); - try { - if (!prodInfo) { - // add product info first - const addProd = async() => { - let added = await Meteor.callAsync("add.product", itemName, [""]); - if (!added) { - console.log(" ERROR adding item to products: " + err); - } else { - // console.log(" SUCCESS adding item to Products."); - - return ListItems.insertAsync({ - itemName: iname, - listId: listId, - prodId: result, - addedBy: this.userId, - itemStore: "", - itemOrdered: false, - itemReceived: false, - dateAddedToList: new Date(), - }); - } - } + + let prodInfo = await Products.findOneAsync({ prodName: iname }); + try { + if (!prodInfo) { + // add product info first + let added = await Meteor.callAsync("add.product", itemName, [""]); + if (!added) { + console.log(" ERROR adding item to products: " + err); } else { - return ListItems.insertAsync({ + // console.log(" SUCCESS adding item to Products."); + + return await ListItems.insertAsync({ itemName: iname, listId: listId, - prodId: prodInfo._id, + prodId: result, addedBy: this.userId, - itemStore: prodInfo.prodStore, + itemStore: "", itemOrdered: false, itemReceived: false, dateAddedToList: new Date(), }); } - } catch(error) { - console.log(" ERROR adding new product and item: " + error); + } else { + return await ListItems.insertAsync({ + itemName: iname, + listId: listId, + prodId: prodInfo._id, + addedBy: this.userId, + itemStore: prodInfo.prodStore, + itemOrdered: false, + itemReceived: false, + dateAddedToList: new Date(), + }); } + } catch(error) { + console.log(" ERROR adding new product and item: " + error); } - let prodIn = prodIsIn(); - return prodIn; }, - 'add.itemsFromMenuItem' (itemIds, listId) { + async 'add.itemsFromMenuItem' (itemIds, listId) { check(itemIds, [String]); check(listId, String); @@ -80,67 +75,71 @@ Meteor.methods({ for (i=0; i < itemIds.length; i++) { // let's check and make sure the product isn't already on the list - let onList = ListItems.find({ listId: listId, prodId: itemIds[i] }).count(); - console.log("Number On List: " + onList); + let onList = await ListItems.find({ listId: listId, prodId: itemIds[i] }).count(); + // console.log("Number On List: " + onList); if (onList == 0) { // now pull the product - let prodInfo = Products.findOne({ _id: itemIds[i] }); - ListItems.insertAsync({ - itemName: prodInfo.prodName, - listId: listId, - prodId: prodInfo._id, - addedBy: this.userId, - itemStore: prodInfo.prodStore, - itemOrdered: false, - itemReceived: false, - dateAddedToList: new Date(), - }); + let prodInfo = await Products.findOneAsync({ _id: itemIds[i] }); + if (!prodInfo) { + console.log("Unable to load product info."); + } else { + ListItems.insertAsync({ + itemName: prodInfo.prodName, + listId: listId, + prodId: prodInfo._id, + addedBy: this.userId, + itemStore: prodInfo.prodStore, + itemOrdered: false, + itemReceived: false, + dateAddedToList: new Date(), + }); + } } else { // product exists on list, move on to next console.log("Product Exists on Selected List."); } } }, - 'setOrdered.listItem' (itemId) { + async 'setOrdered.listItem' (itemId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to set items as ordered. Make sure you are logged in with valid user credentials.'); } - return ListItems.updateAsync({ _id: itemId }, { + return await ListItems.updateAsync({ _id: itemId }, { $set: { itemOrdered: true, dateOrdered: new Date(), } }); }, - 'setAllOrdered.listItem' (shopListId) { + async 'setAllOrdered.listItem' (shopListId) { // set all items that are not already set as ordered, or set as received to ordered on this list }, - 'setNotOrdered.listItem' (itemId) { + async 'setNotOrdered.listItem' (itemId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to set items as not ordered. Make sure you are logged in with valid user credentials.'); } - return ListItems.updateAsync({ _id: itemId }, { + return await ListItems.updateAsync({ _id: itemId }, { $set: { itemOrdered: false, dateUnOrdered: new Date(), } }); }, - 'setReceived.listItem' (itemId) { + async 'setReceived.listItem' (itemId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to set items as received. Make sure you are logged in with valid user credentials.'); } - return ListItems.updateAsync({ _id: itemId }, { + return await ListItems.updateAsync({ _id: itemId }, { $set: { itemReceived: true, dateReceived: new Date(), @@ -148,25 +147,25 @@ Meteor.methods({ }); }, - 'setNotReceived.listItem' (shopListId) { + async 'setNotReceived.listItem' (shopListId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to set items as not received. Make sure you are logged in with valid user credentials.'); } - return ListItems.updateAsync({ _id: itemId }, { + return await ListItems.updateAsync({ _id: itemId }, { $set: { itemReceived: false, dateNotReceived: new Date(), } }); }, - 'setAllReceived.listItem' () { + async 'setAllReceived.listItem' () { // set all items that are not already listed as received to received on this list }, - 'edit.listItem' (itemId, itemName) { + async 'edit.listItem' (itemId, itemName) { check(itemId, String); check(itemName, String); @@ -174,19 +173,19 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add items. Make sure you are logged in with valid user credentials.'); } - return ListItems.updateAsync({ _id: itemId }, { + return await ListItems.updateAsync({ _id: itemId }, { $set: { itemName: itemName, } }); }, - 'delete.listItem' (itemId) { + async 'delete.listItem' (itemId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete list items. Make sure you are logged in with valid user credentials.'); } - return ListItems.removeAsync({ _id: itemId }); + return await ListItems.removeAsync({ _id: itemId }); } }); diff --git a/imports/api/lists.js b/imports/api/lists.js index 037e73e..65f2f5d 100644 --- a/imports/api/lists.js +++ b/imports/api/lists.js @@ -12,7 +12,7 @@ Lists.allow({ }); Meteor.methods({ - 'add.list' (listName, isShared) { + async 'add.list' (listName, isShared) { check(listName, String); check(isShared, Boolean); @@ -20,14 +20,14 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add lists. Make sure you are logged in with valid user credentials.'); } - return Lists.insertAsync({ + return await Lists.insertAsync({ listName: listName, listShared: isShared, listOwner: this.userId, listComplete: false, }); }, - 'edit.list' (listId, listName, isShared) { + async 'edit.list' (listId, listName, isShared) { check(listId, String); check(listName, String); check(isShared, Boolean); @@ -36,55 +36,55 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit lists. Make sure you are logged in with valid user credentials.'); } - return Lists.updateAsync({ _id: listId }, { + return await Lists.updateAsync({ _id: listId }, { $set: { listName: listName, listShared: isShared, } }); }, - 'delete.list' (listId) { + async 'delete.list' (listId) { check(listId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete lists. Make sure you are logged in with valid user credentials.'); } - return Lists.removeAsync({ _id: listId }); + return await Lists.removeAsync({ _id: listId }); }, - 'mark.complete' (listId) { + async 'mark.complete' (listId) { check(listId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark lists complete. Make sure you are logged in with valid user credentials.'); } - return Lists.updateAsync({ _id: listId }, { + return await Lists.updateAsync({ _id: listId }, { $set: { listComplete: true, completedOn: new Date() } }); }, - 'mark.incomplete' (listId) { + async 'mark.incomplete' (listId) { check(listId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to restore completed lists. Make sure you are logged in with valid user credentials.'); } - return Lists.updateAsync({ _id: listId }, { + return await Lists.updateAsync({ _id: listId }, { $set: { listComplete: false, completedOn: new Date() } }); }, - 'clean.Lists' () { + async 'clean.Lists' () { if (!this.userId) { throw new Meteor.Error('You are not allowed to clean up old lists. Make sure you are logged in with valid user credentials.'); } - return Lists.removeAsync({ listComplete: true }); + return await Lists.removeAsync({ listComplete: true }); }, }); \ No newline at end of file diff --git a/imports/api/mScripts.js b/imports/api/mScripts.js index 710c530..67c1685 100644 --- a/imports/api/mScripts.js +++ b/imports/api/mScripts.js @@ -12,10 +12,10 @@ MScripts.allow({ }); Meteor.methods({ - 'set.ScriptRun' (scriptName) { + async 'set.ScriptRun' (scriptName) { check(scriptName, String); - MScripts.insertAsync({ + return await MScripts.insertAsync({ scriptName: scriptName, hasRun: true, runOn: new Date(), diff --git a/imports/api/menu.js b/imports/api/menu.js index 7ea3be2..cf3b8eb 100644 --- a/imports/api/menu.js +++ b/imports/api/menu.js @@ -15,20 +15,20 @@ Menus.allow({ }); Meteor.methods({ - 'add.menu' (menuName) { + async 'add.menu' (menuName) { check(menuName, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to add menus. Make sure you are logged in with valid user credentials.'); } - return Menus.insertAsync({ + return await Menus.insertAsync({ menuName: menuName, menuOwner: this.userId, menuComplete: false, }); }, - 'edit.menu' (menuId, menuName) { + async 'edit.menu' (menuId, menuName) { check(menuId, String); check(menuName, String); @@ -36,48 +36,48 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit menus. Make sure you are logged in with valid user credentials.'); } - return Menus.updateAsync({ _id: menuId }, { + return await Menus.updateAsync({ _id: menuId }, { $set: { menuName: menuName, } }); }, - 'delete.menu' (menuId) { + async 'delete.menu' (menuId) { check(menuId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete menus. Make sure you are logged in with valid user credentials.'); } - return Menus.removeAsync({ _id: menuId }); + return await Menus.removeAsync({ _id: menuId }); }, - 'markMenu.complete' (menuId) { + async 'markMenu.complete' (menuId) { check(menuId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark menus complete. Make sure you are logged in with valid user credentials.'); } - return Menus.updateAsync({ _id: menuId }, { + return await Menus.updateAsync({ _id: menuId }, { $set: { menuComplete: true, } }); }, - 'markMenu.notComplete' (menuId) { + async 'markMenu.notComplete' (menuId) { check(menuId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark menus not complete. Make sure you are logged in with valid user credentials.'); } - return Menus.updateAsync({ _id: menuId }, { + return await Menus.updateAsync({ _id: menuId }, { $set: { menuComplete: false, } }); }, - 'clean.Menus' () { + async 'clean.Menus' () { if (!this.userId) { throw new Meteor.Error('You are not allowed to clean up old Menus. Make sure you are logged in with valid user credentials.'); } @@ -114,10 +114,10 @@ Meteor.methods({ // finally we'll cycle through the ids and remove the items we collected up. for (let l = 0; l < removeMenuIds.length; l++) { - Menus.removeAsync({ _id: removeMenuIds[l] }); + await Menus.removeAsync({ _id: removeMenuIds[l] }); } }, - 'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) { + async 'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) { check(menuId, String); check(menuItem, String); check(menuItemId, String); @@ -130,7 +130,7 @@ Meteor.methods({ let serveDateActual = new Date(dateSrv); - return Menus.updateAsync({ _id: menuId }, { + return await Menus.updateAsync({ _id: menuId }, { $addToSet: { menuItems: { @@ -143,7 +143,7 @@ Meteor.methods({ } }); }, - 'link.inMenu' (menuItemId, isLinked) { + async 'link.inMenu' (menuItemId, isLinked) { check(menuItemId, String); check(isLinked, Boolean); @@ -151,13 +151,13 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to link menu items to products. Make sure you are logged in with valid user credentials.'); } - return Menus.updateAsync({ 'menuItems.menuItemId': menuItemId }, { + return await Menus.updateAsync({ 'menuItems.menuItemId': menuItemId }, { $set: { "menuItems.$.isLinked": isLinked } }); }, - 'delete.itemFromMenu' (itemIds) { + async 'delete.itemFromMenu' (itemIds) { check(itemIds, String); if (!this.userId) { @@ -167,7 +167,7 @@ Meteor.methods({ let ids = itemIds.split('_'); console.log("item ids: " + ids[0] + " and " + ids[1]); - return Menus.updateAsync({ _id: ids[0] }, { + return await Menus.updateAsync({ _id: ids[0] }, { $pull: { menuItems: { menuItemId: ids[1], diff --git a/imports/api/menuItems.js b/imports/api/menuItems.js index 69f47fe..232d510 100644 --- a/imports/api/menuItems.js +++ b/imports/api/menuItems.js @@ -12,21 +12,21 @@ MenuItems.allow({ }); Meteor.methods({ - 'add.menuItem' (itemName) { + async 'add.menuItem' (itemName) { check(itemName, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to add items. Make sure you are logged in with valid user credentials.'); } - return MenuItems.insertAsync({ + return await MenuItems.insertAsync({ itemName: itemName, addedBy: this.userId, dateAddedtoMenu: new Date(), isLinked: false, }); }, - 'update.menuItemLinked' (itemId, isLinked) { + async 'update.menuItemLinked' (itemId, isLinked) { check(itemId, String); check(isLinked, Boolean); @@ -34,13 +34,13 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to set this menu item as linked to products. Make sure you are logged in with valid user credentials.'); } - return MenuItems.updateAsync({ _id: itemId }, { + return await MenuItems.updateAsync({ _id: itemId }, { $set: { isLinked: isLinked, } }); }, - 'edit.madeItem' (itemId, itemName) { + async 'edit.madeItem' (itemId, itemName) { check(itemId, String); check(itemName, String); @@ -48,22 +48,22 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit menu items. Make sure you are logged in with valid user credentials.'); } - return MenuItems.updateAsync({ _id: itemId }, { + return await MenuItems.updateAsync({ _id: itemId }, { $set: { itemName: itemName, } }); }, - 'delete.menuItem' (itemId) { + async 'delete.menuItem' (itemId) { check(itemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete menu items. Make sure you are logged in with valid user credentials.'); } - return MenuItems.removeAsync({ _id: itemId }); + return await MenuItems.removeAsync({ _id: itemId }); }, - 'shiftDate' (itemId, momentAddDay) { + async 'shiftDate' (itemId, momentAddDay) { check(itemId, String); check(momentAddDay, String); @@ -71,7 +71,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to shift menu item dates. Make sure you are logged in with valid user credentials.'); } - return MenuItems.updateAsync({ _id: itemId }, { + return await MenuItems.updateAsync({ _id: itemId }, { $set: { serveDate: momentAddDay, } diff --git a/imports/api/menuProdLinks.js b/imports/api/menuProdLinks.js index 0a9b2de..9cfe22a 100644 --- a/imports/api/menuProdLinks.js +++ b/imports/api/menuProdLinks.js @@ -13,7 +13,7 @@ MenuProdLinks.allow({ }); Meteor.methods({ - 'add.menuProdLinks' (menuItemId, menuItemName, prodNameArray) { + async 'add.menuProdLinks' (menuItemId, menuItemName, prodNameArray) { check(menuItemId, String); check(menuItemName, String); check(prodNameArray, [Object]); @@ -34,7 +34,7 @@ Meteor.methods({ } }); } else { - return MenuProdLinks.insertAsync({ + return await MenuProdLinks.insertAsync({ menuItemId: menuItemId, menuItemName: menuItemName, products: prodNameArray, @@ -43,7 +43,7 @@ Meteor.methods({ }); } }, - 'update.menuPordLInks' (menuItemId, menuItemName, prodNameArray) { + async 'update.menuPordLInks' (menuItemId, menuItemName, prodNameArray) { check(menuItemId, String); check(menuItemName, String); check(prodNameArray, [Object]); @@ -52,7 +52,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add menu and product links. Make sure you are logged in with valid user credentials.'); }; - return MenuProdLinks.updateAsync({ menuItemId: menuItemId }, { + return await MenuProdLinks.updateAsync({ menuItemId: menuItemId }, { $set: { products: prodNameArray, dateUpdated: Date(), diff --git a/imports/api/products.js b/imports/api/products.js index 3eafefa..b8d5056 100644 --- a/imports/api/products.js +++ b/imports/api/products.js @@ -12,7 +12,7 @@ Products.allow({ }); Meteor.methods({ - 'add.product' (prodName, prodStore) { + async 'add.product' (prodName, prodStore) { check(prodName, String); check(prodStore, [String]); @@ -24,24 +24,20 @@ Meteor.methods({ // first does this product already exist? - const productIsIn = async() => { - let prodExists = await Products.findOneAsync({ prodName: pname }); - try { - if (!prodExists) { - return Products.insertAsync({ - prodName: pname, - prodOwner: this.userId, - prodStore: prodStore, - }); - } - } catch(error) { - console.log(" ERROR adding Pdocut: " + error); + let prodExists = await Products.findOneAsync({ prodName: pname }); + try { + if (!prodExists) { + return await Products.insertAsync({ + prodName: pname, + prodOwner: this.userId, + prodStore: prodStore, + }); } + } catch(error) { + console.log(" ERROR adding Pdocut: " + error); } - let prodIn = productIsIn(); - return prodIn; }, - 'edit.product' (prodId, prodName, prodStore) { + async 'edit.product' (prodId, prodName, prodStore) { check(prodId, String); check(prodName, String); check(prodStore, [String]); @@ -52,20 +48,20 @@ Meteor.methods({ let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1); - return Products.updateAsync({ _id: prodId }, { + return await Products.updateAsync({ _id: prodId }, { $set: { prodName: pname, prodStore: prodStore, } }); }, - 'delete.product' (prodId) { + async 'delete.product' (prodId) { check(prodId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete products. Make sure you are logged in with valid user credentials.'); } - return Products.removeAsync({ _id: prodId }); + return await Products.removeAsync({ _id: prodId }); } }); diff --git a/imports/api/recipeItems.js b/imports/api/recipeItems.js index b19a0ea..42b374f 100644 --- a/imports/api/recipeItems.js +++ b/imports/api/recipeItems.js @@ -12,7 +12,7 @@ RecipeItems.allow({ }); Meteor.methods({ - 'add.recipeItem' (recipeId, recipeItemType, recipeItem) { + async 'add.recipeItem' (recipeId, recipeItemType, recipeItem) { check(recipeId, String); check(recipeItemType, String); check(recipeItem, String); @@ -21,13 +21,13 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add recipe items. Make sure you are logged in with valid user credentials.'); } - return RecipeItems.insertAsync({ + return await RecipeItems.insertAsync({ recipeId: recipeId, recipeItemType: recipeItemType, recipeItem: recipeItem, }); }, - 'edit.recipeItem' (recipeItemId, recipeId, recipeItemType, recipeItem) { + async 'edit.recipeItem' (recipeItemId, recipeId, recipeItemType, recipeItem) { check(recipeItemId, String); check(recipeId, String); check(recipeItemType, String); @@ -37,7 +37,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit recipe items. Make sure you are logged in with valid user credentials.'); } - return RecipeItems.updateAsync({ _id: recipeItemId }, { + return await RecipeItems.updateAsync({ _id: recipeItemId }, { $set: { recipeId: recipeId, recipeItemType: recipeItemType, @@ -45,13 +45,13 @@ Meteor.methods({ } }); }, - 'delete.recipeItem' (recipeItemId) { + async 'delete.recipeItem' (recipeItemId) { check(recipeItemId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete recipe items. Make sure you are logged in with valid user credentials.'); } - return RecipeItems.removeAsync({ _id: recipeItemId }); + return await RecipeItems.removeAsync({ _id: recipeItemId }); } }); \ No newline at end of file diff --git a/imports/api/recipes.js b/imports/api/recipes.js index d1edbe3..008bb51 100644 --- a/imports/api/recipes.js +++ b/imports/api/recipes.js @@ -12,20 +12,20 @@ Recipes.allow({ }); Meteor.methods({ - 'add.recipe' (recipeName) { + async 'add.recipe' (recipeName) { check(recipeName, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to add recipes. Make sure you are logged in with valid user credentials.'); } - return Recipes.insertAsync({ + return await Recipes.insertAsync({ recipeName: recipeName, addedBy: this.userId, addedOn: new Date(), }); }, - 'edit.recipe' (recipeId, recipeName) { + async 'edit.recipe' (recipeId, recipeName) { check(recipeId, String); check(recipeName, String); @@ -33,7 +33,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add recipes. Make sure you are logged in with valid user credentials.'); } - return Recipes.updateAsync({ _id: recipeId }, { + return await Recipes.updateAsync({ _id: recipeId }, { $set: { recipeName: recipeName, updatedOn: new Date(), @@ -41,13 +41,13 @@ Meteor.methods({ } }); }, - 'delete.recipe' (recipeId) { + async 'delete.recipe' (recipeId) { check(recipeId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete recipes. Make sure you are logged in with valid user credentials.'); } - return Recipes.removeAsync({ _id: recipeId }); + return await Recipes.removeAsync({ _id: recipeId }); } }); \ No newline at end of file diff --git a/imports/api/shopList.js b/imports/api/shopList.js index b013d50..637e740 100644 --- a/imports/api/shopList.js +++ b/imports/api/shopList.js @@ -12,19 +12,19 @@ ShopLists.allow({ }); Meteor.methods({ - 'add.shopList' (shopName) { + async 'add.shopList' (shopName) { check(shopName, Sring); if (!this.userId) { throw new Meteor.Error('You are not allowed to add shopping lists. Make sure you are logged in with valid user credentials.'); } - return ShopLists.insert({ + return await ShopLists.insert({ shopName: shopName, shopOwner: this.userId, }); }, - 'edit.shopList' (shopId, shopName) { + async 'edit.shopList' (shopId, shopName) { check(shopId, String); check(shopName, String); @@ -32,19 +32,19 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit shopping lists. Make sure you are logged in with valid user credentials.'); } - return ShopLists.update({ _id: shopId }, { + return await ShopLists.update({ _id: shopId }, { $set: { shopName: shopName, } }); }, - 'delete.shopList' (shopId) { + async 'delete.shopList' (shopId) { check(shopId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete shopping lists. Make sure you are logged in with valid user credentials.'); } - return ShopLists.remove({ _id: shopId }); + return await ShopLists.remove({ _id: shopId }); }, }); \ No newline at end of file diff --git a/imports/api/stores.js b/imports/api/stores.js index b0fbec9..c97b381 100644 --- a/imports/api/stores.js +++ b/imports/api/stores.js @@ -12,19 +12,19 @@ Stores.allow({ }); Meteor.methods({ - 'add.store' (storeName) { + async 'add.store' (storeName) { check(storeName, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to add stores. Make sure you are logged in with valid user credentials.'); } - return Stores.insertAsync({ + return await Stores.insertAsync({ storeName: storeName, owner: this.userId, }); }, - 'edit.store' (storeId, storeName) { + async 'edit.store' (storeId, storeName) { check(storeId, String); check(storeName, String); @@ -32,19 +32,19 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to edit stores. Make sure you are logged in with valid user credentials.'); } - return Stores.updateAsync({ _id: storeId }, { + return await Stores.updateAsync({ _id: storeId }, { $set: { storeName: storeName, } }); }, - 'delete.store' (storeId) { + async 'delete.store' (storeId) { check(storeId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to delete stores. Make sure you are logged in with valid user credentials.'); } - return Stores.removeAsync({ _id: storeId }); + return await Stores.removeAsync({ _id: storeId }); }, }); \ No newline at end of file diff --git a/imports/api/systemConfig.js b/imports/api/systemConfig.js index 7188ebd..a278007 100644 --- a/imports/api/systemConfig.js +++ b/imports/api/systemConfig.js @@ -12,7 +12,7 @@ SysConfig.allow({ }); Meteor.methods({ - 'add.noSysAdminReg' (admReg, genReg) { + async 'add.noSysAdminReg' (admReg, genReg) { check(admReg, Boolean); check(genReg, Boolean); @@ -24,7 +24,7 @@ Meteor.methods({ let curr = await SysConfig.findOneAsync({}); if (!curr) { try { - return SysConfig.insertAsync({ + return await SysConfig.insertAsync({ SysAdminReg: admReg, dateAdded: new Date(), allowReg: genReg, @@ -52,7 +52,7 @@ Meteor.methods({ } currConfig(); }, - 'edit.noSysAdminReg' (configId, canReg, genReg) { + async 'edit.noSysAdminReg' (configId, canReg, genReg) { check(canReg, Boolean); check(configId, String); check(genReg, Boolean); @@ -61,7 +61,7 @@ Meteor.methods({ throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.'); } - return SysConfig.updateAsync({ _id: configId }, { + return await SysConfig.updateAsync({ _id: configId }, { $set: { SysAdminReg: canReg, allowReg: genReg, @@ -69,7 +69,7 @@ Meteor.methods({ } }); }, - 'allow.updateInfo' (allowUpdate) { + async 'allow.updateInfo' (allowUpdate) { check(allowUpdate, Boolean); if (!this.userId) { @@ -80,7 +80,7 @@ Meteor.methods({ let configId = curr._id; - return SysConfig.updateAsync({ _id: configId }, { + return await SysConfig.updateAsync({ _id: configId }, { $set: { allowUpdates: allowUpdate, } diff --git a/imports/api/updateInfo.js b/imports/api/updateInfo.js index 4fd9faa..34f222b 100644 --- a/imports/api/updateInfo.js +++ b/imports/api/updateInfo.js @@ -12,24 +12,24 @@ UpdateInfo.allow({ }); Meteor.methods({ - 'add.updateInfo' (updateObject) { + async 'add.updateInfo' (updateObject) { check(updateObject, Object); - return UpdateInfo.insertAsync({ + return await UpdateInfo.insertAsync({ title: updateObject.title, description: updateObject.description, dateRelease: updateObject.date, releaseLink: updateObject.link }); }, - 'markUpdate.read' (updateId) { + async 'markUpdate.read' (updateId) { check(updateId, String); if (!this.userId) { throw new Meteor.Error('You are not allowed to mark updates as read. Make sure you are logged in with valid user credentials.'); } - return UpdateInfo.updateAsync({ _id: updateId }, { + return await UpdateInfo.updateAsync({ _id: updateId }, { $set: { viewed: true } diff --git a/imports/api/userConfig.js b/imports/api/userConfig.js index a1d0614..ac6ab2e 100644 --- a/imports/api/userConfig.js +++ b/imports/api/userConfig.js @@ -16,27 +16,27 @@ UserConfig.allow({ }); Meteor.methods({ - 'add.darkModePref' (pref) { + async 'add.darkModePref' (pref) { check(pref, String); if (!this.userId) { throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.'); } - return UserConfig.insertAsync({ + return await UserConfig.insertAsync({ user: this.userId, darkMode: pref, dateAdded: Date() }); }, - 'update.darkModePref' (pref) { + async 'update.darkModePref' (pref) { check(pref, String); if (!this.userId) { throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.'); } - return UserConfig.updateAsync({ user: this.userId }, { + return await UserConfig.updateAsync({ user: this.userId }, { $set: { darkMode: pref, dateUpdate: Date() diff --git a/imports/api/userConfigOptions.js b/imports/api/userConfigOptions.js index c6290a2..09c9207 100644 --- a/imports/api/userConfigOptions.js +++ b/imports/api/userConfigOptions.js @@ -12,10 +12,10 @@ UserConfigOptions.allow({ }); Meteor.methods({ - 'change.userPass' (usersId, password) { + async 'change.userPass' (usersId, password) { check(usersId, String); check(password, String); - return Accounts.setPasswordAsync(usersId, password); + return await Accounts.setPasswordAsync(usersId, password); }, }); \ No newline at end of file diff --git a/imports/api/userLast.js b/imports/api/userLast.js index dbeb078..33e156b 100644 --- a/imports/api/userLast.js +++ b/imports/api/userLast.js @@ -12,7 +12,7 @@ UserLast.allow({ }); Meteor.methods({ - 'add.userLast' (view, viewId) { + async 'add.userLast' (view, viewId) { check(view, String); check(viewId, String); @@ -22,36 +22,33 @@ Meteor.methods({ // first let's find out if there's an entry for this user and view, and if so // we'll just edit that entry with updated information - const getUserLast = async() => { - let userListInfo = await UserLast.findOneAsync({ userId: this.userId, view: view }); - if (!userListInfo) { - console.log("Adding new user last item."); - return UserLast.insertAsync({ - userId: this.userId, - view: view, - viewId: viewId, - dateAdded: Date(), - }); + let userListInfo = await UserLast.findOneAsync({ userId: this.userId, view: view }); + if (!userListInfo) { + console.log("Adding new user last item."); + return await UserLast.insertAsync({ + userId: this.userId, + view: view, + viewId: viewId, + dateAdded: Date(), + }); + } else { + console.log("Editing existing user last itme."); + // entry exists, call the edit function instead + let result = await Meteor.callAsync('edit.userLast', view, viewId); + if (!result) { + try { + console.log("Issue editing existing entry in userLast. Check the logs."); + } catch(error) { + console.log(" ERROR adding userLast item: " + error); + console.log(error.message); + console.log(error.stack); + } } else { - console.log("Editing existing user last itme."); - // entry exists, call the edit function instead - let result = await Meteor.callAsync('edit.userLast', view, viewId); - if (!result) { - try { - console.log("Issue editing existing entry in userLast. Check the logs."); - } catch(error) { - console.log(" ERROR adding userLast item: " + error); - console.log(error.message); - console.log(error.stack); - } - } else { - return true; - } + return true; } } - return getUserLast(); }, - 'edit.userLast' (view, viewId) { + async 'edit.userLast' (view, viewId) { check(view, String); check(viewId, String); @@ -60,7 +57,7 @@ Meteor.methods({ } console.log("Edit in progress."); - return UserLast.updateAsync({ view: view, userId: this.userId }, { + return await UserLast.updateAsync({ view: view, userId: this.userId }, { $set: { viewId: viewId, dateLastUpdate: Date(), diff --git a/server/methods.js b/server/methods.js index 742a93e..d634eed 100644 --- a/server/methods.js +++ b/server/methods.js @@ -6,66 +6,63 @@ import { SysConfig } from '../imports/api/systemConfig'; import { Roles } from 'meteor/roles'; Meteor.methods({ - 'addToRole' (role) { - const getUserInfo = async() => { - try { - let countOfUsers = await Meteor.users.find().countAsync(); - const user = await Meteor.userAsync(); - if (user) { - let userId = user._id; - if (countOfUsers > 1) { - Roles.addUsersToRolesAsync(userId, role); - const result = await Meteor.callAsync('add.darkModePref', "light"); - if (!result) { - console.log(" ERROR: can't set user dark mode preference: " + err); - } else { - // console.log(" SUCCESSFULLY set user dark mode preference."); - } - } else if (countOfUsers == 1) { - Roles.addUsersToRolesAsync(userId, "systemadmin"); - const result = await Meteor.callAsync('add.darkModePref', "light"); - if (!result) { - console.log(" ERROR: can't set user dark mode preference: " + err); - } else { - console.log(" SUCCESSFULLY set user dark mode preference."); - } + async 'addToRole' (role) { + try { + let countOfUsers = await Meteor.users.find().countAsync(); + const user = await Meteor.userAsync(); + if (user) { + let userId = user._id; + if (countOfUsers > 1) { + await Roles.addUsersToRolesAsync(userId, role); + const result = await Meteor.callAsync('add.darkModePref', "light"); + if (!result) { + console.log(" ERROR: can't set user dark mode preference: " + err); } else { - console.log("The count of users didn't seem to work when adding a new user."); + // console.log(" SUCCESSFULLY set user dark mode preference."); + } + } else if (countOfUsers == 1) { + await Roles.addUsersToRolesAsync(userId, "systemadmin"); + const result = await Meteor.callAsync('add.darkModePref', "light"); + if (!result) { + console.log(" ERROR: can't set user dark mode preference: " + err); + } else { + console.log(" SUCCESSFULLY set user dark mode preference."); } } else { - console.log(" ---- No user info found.") + console.log("The count of users didn't seem to work when adding a new user."); } - } catch(error) { - console.log(" ERROR getting user info on server: " + error); + } else { + console.log(" ---- No user info found.") } + } catch(error) { + console.log(" ERROR getting user info on server: " + error); } - getUserInfo(); }, - 'edit.userPass' (userId, newPassword) { + async 'edit.userPass' (userId, newPassword) { check(userId, String); check(newPassword, String); - return Accounts.setPasswordAsync(userId, newPassword); + return await Accounts.setPasswordAsync(userId, newPassword); }, - 'delete.userFromSys' (userId) { + async 'delete.userFromSys' (userId) { check(userId, String); - return Meteor.users.removeAsync({ _id: userId }); + return await Meteor.users.removeAsync({ _id: userId }); }, - 'update.userEmail' (userId, email) { + async 'update.userEmail' (userId, email) { check(userId, String); check(email, String); - return Meteor.users.updateAsync({ _id: userId }, { + return await Meteor.users.updateAsync({ _id: userId }, { $set: { 'emails.0.address': email, } }); }, - 'edit.userRole' (userId, role) { + async 'edit.userRole' (userId, role) { check(userId, String); check(role, String); - return Roles.setUserRolesAsync(userId, role); + return await Roles.setUserRolesAsync(userId, role); }, }); From 4de73528c414096be7460db995d478da1aa44e21 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Wed, 23 Jul 2025 19:05:06 -0500 Subject: [PATCH 17/27] Updated Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6cf4fd2..de9dad3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM alpine:3.17 +FROM alpine:3.22.1 -ENV NODE_VERSION=14.21.4 -ENV NODE_URL="https://static.meteor.com/dev-bundle-node-os/unofficial-builds/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" +ENV NODE_VERSION=22.16.0 +ENV NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" ENV DIR_NODE=/usr/local RUN apk add --no-cache \ From 4687f2701188fcf2c3f8a0086cdb4a4b1115e7ef Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Wed, 23 Jul 2025 19:18:01 -0500 Subject: [PATCH 18/27] Update Dockerfile proper --- Dockerfile | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index de9dad3..5064534 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,4 @@ -FROM alpine:3.22.1 - -ENV NODE_VERSION=22.16.0 -ENV NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" -ENV DIR_NODE=/usr/local +FROM node:22.16.0-alpine RUN apk add --no-cache \ libstdc++ \ @@ -20,13 +16,6 @@ RUN apk add --no-cache \ ccache \ xz -RUN echo $NODE_URL -RUN curl -sSL "$NODE_URL" | tar -xz -C /usr/local/ && mv $DIR_NODE/node-v${NODE_VERSION}-linux-x64 $DIR_NODE/v$NODE_VERSION - -# add node and npm to path so the commands are available -ENV NODE_PATH $DIR_NODE/v$NODE_VERSION/lib/node_modules -ENV PATH $DIR_NODE/v$NODE_VERSION/bin:$PATH - # confirm installation RUN node -v RUN npm -v @@ -38,11 +27,11 @@ ENV MONGO_URL=mongodb://mongo:27017/get_my\ RUN mkdir -p /usr/src/get_my WORKDIR /usr/src/get_my -COPY bundle/ /usr/src/get_my/ +COPY ../bundle/ /usr/src/get_my/ RUN cd /usr/src/get_my/programs/server/ \ && npm install EXPOSE 3000 -CMD [ "node", "main.js" ] +CMD [ "node", "main.js" ] \ No newline at end of file From d25ef56591fd80e203af784f7654a238bd9f7bb5 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Wed, 23 Jul 2025 19:44:24 -0500 Subject: [PATCH 19/27] Commenting out console logging. --- client/Accounts/Login/login.js | 2 +- client/Accounts/Login/reg.js | 2 +- client/AdminMgmt/ProductMgmt/prodMgmtForm.js | 4 ++-- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 2 +- client/AdminMgmt/StoreMgmt/storeMgmtForm.js | 4 ++-- client/AdminMgmt/SystemAdmin/systemAdmin.js | 4 ++-- client/AdminMgmt/Tasks/taskForm.js | 6 +++--- client/AdminMgmt/Tasks/taskTbl.js | 2 +- client/Dashboard/dashboard.js | 10 +++++----- .../DeleteConfModal/deleteConfirmationModal.js | 4 ++-- client/General/headerBar.js | 6 +++--- client/ListItems/listItemTblByStore.js | 6 +++--- client/ListItems/listItemsForm.js | 6 +++--- client/ListItems/listItemsTbl.js | 6 +++--- client/Lists/listsTbl.js | 6 +++--- client/MainLayout.js | 6 +++--- client/MenuItems/addProdToListModal.js | 10 +++++----- client/MenuItems/menuItemsForm.js | 10 +++++----- client/MenuItems/menuItemsTbl.js | 4 ++-- client/MenuItems/modalLinkProducts.js | 6 +++--- client/Menus/addMenuModal.js | 4 ++-- client/Menus/mainMenuTbl.js | 14 +++++++------- client/MyTasks/myTasksForm.js | 4 ++-- client/MyTasks/myTasksTbl.js | 4 ++-- client/UserConfig/userConfig.js | 2 +- imports/api/listItems.js | 8 ++++---- imports/api/menu.js | 2 +- imports/api/menuProdLinks.js | 6 +++--- imports/api/systemConfig.js | 4 ++-- imports/api/tasks.js | 12 ++++++------ imports/api/userLast.js | 8 ++++---- 31 files changed, 87 insertions(+), 87 deletions(-) diff --git a/client/Accounts/Login/login.js b/client/Accounts/Login/login.js index d251060..f436e4b 100644 --- a/client/Accounts/Login/login.js +++ b/client/Accounts/Login/login.js @@ -26,7 +26,7 @@ Template.login.helpers({ Template.login.events({ 'click #logmein' (event) { event.preventDefault(); - console.log("clicked login"); + // console.log("clicked login"); let email = $("#email").val(); let pass = $("#password").val(); diff --git a/client/Accounts/Login/reg.js b/client/Accounts/Login/reg.js index 6a028cc..2a46225 100644 --- a/client/Accounts/Login/reg.js +++ b/client/Accounts/Login/reg.js @@ -88,7 +88,7 @@ Template.reg.events({ }); let userId = Meteor.userId(); - console.log("User ID: " + userId); + // console.log("User ID: " + userId); const addRole = async() => { let result = await Meteor.callAsync("addToRole", "user"); if (!result) { diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js index 1022602..cb5fc18 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js @@ -53,7 +53,7 @@ Template.prodMgmtForm.events({ }, 'click #showNoStoreSet' (event) { let noStoreSet = $("#showNoStoreSet").prop('checked'); - console.log("Clicked: " + noStoreSet); + // console.log("Clicked: " + noStoreSet); if (noStoreSet == true) { Session.set("noStoreSet", true); } else { @@ -69,7 +69,7 @@ const newProd = async(name, store) => { let result = await Meteor.callAsync('add.product', name, store); try { if (!result) { - console.log("No result when trying to add a new product."); + // console.log("No result when trying to add a new product."); showSnackbar("Unable to add new product."); } else { $("#prodName").val(""); diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js index ccebb15..cf49c52 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js @@ -60,7 +60,7 @@ Template.prodMgmtTbl.events({ const getProds = async() => { let prodInfo = await Products.findOneAsync({ _id: this._id }); if (!prodInfo) { - console.log("No Product Returned."); + // console.log("No Product Returned."); } else { $("#prodName").val(prodInfo.prodName); $("#prodStore").val(prodInfo.prodStore); diff --git a/client/AdminMgmt/StoreMgmt/storeMgmtForm.js b/client/AdminMgmt/StoreMgmt/storeMgmtForm.js index 559a010..07da897 100644 --- a/client/AdminMgmt/StoreMgmt/storeMgmtForm.js +++ b/client/AdminMgmt/StoreMgmt/storeMgmtForm.js @@ -62,7 +62,7 @@ Template.storeMgmtForm.events({ const addStore = async(storeName) => { let result = await Meteor.callAsync("add.store", storeName); if (!result) { - console.log("ERROR: Store add failed."); + // console.log("ERROR: Store add failed."); } else { $("#storeName").val(""); showSnackbar("Store Added Successfully!", "green"); @@ -72,7 +72,7 @@ const addStore = async(storeName) => { const editStore = async(storeId, storeName) => { let result = await Meteor.callAsync("edit.store", storeId, storeName); if (!result) { - console.log("ERROR: Store add failed: " + err); + // console.log("ERROR: Store add failed: " + err); } else { $("#storeName").val(""); Session.set("editModeStore", false); diff --git a/client/AdminMgmt/SystemAdmin/systemAdmin.js b/client/AdminMgmt/SystemAdmin/systemAdmin.js index 035a143..2e52c4e 100644 --- a/client/AdminMgmt/SystemAdmin/systemAdmin.js +++ b/client/AdminMgmt/SystemAdmin/systemAdmin.js @@ -14,7 +14,7 @@ Template.systemAdmin.onRendered(function() { $("#allAdmReg").prop('checked', curr.SysAdminReg); $("#recvUpdateMsgs").prop('checked', curr.allowUpdates); } else { - console.log(" ---- unable to find current system configuration."); + // console.log(" ---- unable to find current system configuration."); } }); @@ -49,7 +49,7 @@ Template.systemAdmin.events({ const allowUpdateInfo = async() => { let result = await Meteor.callAsync('allow.updateInfo', updSet); if (!result) { - console.log(" ERROR changing update setting."); + // console.log(" ERROR changing update setting."); showSnackbar("Update Setting Change Failed.", "red"); } else { showSnackbar("Update Setting Changed Successfully!", "green"); diff --git a/client/AdminMgmt/Tasks/taskForm.js b/client/AdminMgmt/Tasks/taskForm.js index 2ff956e..2c5f42a 100644 --- a/client/AdminMgmt/Tasks/taskForm.js +++ b/client/AdminMgmt/Tasks/taskForm.js @@ -50,7 +50,7 @@ Template.taskForm.events({ event.preventDefault(); let elemcc = document.getElementById('taskName'); let taskName = M.Chips.getInstance(elemcc).chipsData; - console.log(taskName); + // console.log(taskName); }, 'change #taskDate' (event) { let taskDate = $("#taskDate").val(); @@ -94,9 +94,9 @@ Template.taskForm.events({ const addTask = async() => { let result = await Meteor.callAsync("add.task", taskNameArr, userInfo[0], userInfo[1], taskDateArr, actDate); if (!result) { - console.log(" ERROR adding the new task."); + // console.log(" ERROR adding the new task."); } else { - console.log(" SUCCESS adding the new task."); + // console.log(" SUCCESS adding the new task."); Session.set("taskDateArr", []); $("#taskDate").val(""); $("#taskUser").val(""); diff --git a/client/AdminMgmt/Tasks/taskTbl.js b/client/AdminMgmt/Tasks/taskTbl.js index def48f4..dfb41eb 100644 --- a/client/AdminMgmt/Tasks/taskTbl.js +++ b/client/AdminMgmt/Tasks/taskTbl.js @@ -46,7 +46,7 @@ Template.taskTbl.events({ const markComp = async() => { let result = await Meteor.callAsync("markTask.complete", taskId); if (!result) { - console.log(" ERROR marking task completeL " + err); + // console.log(" ERROR marking task completeL " + err); showSnackbar("ERROR Marking Task Complete!", "red"); } else { showSnackbar("Successfully Marked Task Complete!", "green"); diff --git a/client/Dashboard/dashboard.js b/client/Dashboard/dashboard.js index 4eb2c8c..6489fc0 100644 --- a/client/Dashboard/dashboard.js +++ b/client/Dashboard/dashboard.js @@ -68,10 +68,10 @@ Template.dashboard.helpers({ let updateAvail = UpdateInfo.find({}); try { if (!updateAvail) { - console.log("No update info found."); + // console.log("No update info found."); return false; } else { - console.dir(updateAvail); + // console.dir(updateAvail); return updateAvail; } } catch(error) { @@ -82,10 +82,10 @@ Template.dashboard.helpers({ const ifUpdate = async() => { let updateExists = await UpdateInfo.findOneAsync({ viewed: false }); if (!updateExists) { - console.log("Update doesn't exist as false."); + // console.log("Update doesn't exist as false."); return false; } else { - console.log("Update found with false."); + // console.log("Update found with false."); return true; } } @@ -179,7 +179,7 @@ Template.dashboard.events({ let result = await Meteor.callAsync('markUpdate.read', eventId); try { if (!result) { - console.log(" Error marking this read."); + // console.log(" Error marking this read."); showSnackbar("Error Marking Read!", "red"); } else { showSnackbar("Successfully Marked as Read.", "green"); diff --git a/client/General/DeleteConfModal/deleteConfirmationModal.js b/client/General/DeleteConfModal/deleteConfirmationModal.js index f153ae7..2d9d52a 100644 --- a/client/General/DeleteConfModal/deleteConfirmationModal.js +++ b/client/General/DeleteConfModal/deleteConfirmationModal.js @@ -25,9 +25,9 @@ Template.deleteConfirmationModal.events({ const delItem = async() => { let result = await Meteor.callAsync(method, deleteId); if (!result) { - console.log(" ERROR deleting item from modal: " + err); + // console.log(" ERROR deleting item from modal: " + err); } else { - console.log(" SUCCESSFULLY deleted."); + // console.log(" SUCCESSFULLY deleted."); // put the new modal open / close here // $('#modalDelete').modal('close'); } diff --git a/client/General/headerBar.js b/client/General/headerBar.js index 3a3af52..3e246f0 100644 --- a/client/General/headerBar.js +++ b/client/General/headerBar.js @@ -22,10 +22,10 @@ Template.headerBar.onRendered(function() { let isRole = await Roles.getRolesForUserAsync(userId); try { if (!isRole) { - console.log("SystemAdmin role for user not found: " + isRole);; + // console.log("SystemAdmin role for user not found: " + isRole);; } else { - console.log("Found role for the user: "); - console.dir(isRole); + // console.log("Found role for the user: "); + // console.dir(isRole); } } catch(error) { console.log(" ERROR getting role for user: " + error); diff --git a/client/ListItems/listItemTblByStore.js b/client/ListItems/listItemTblByStore.js index 4141227..a914cd0 100644 --- a/client/ListItems/listItemTblByStore.js +++ b/client/ListItems/listItemTblByStore.js @@ -58,13 +58,13 @@ Template.listItemTblByStore.events({ if (typeof itemOrder == 'undefined' || itemOrder == "" || itemOrder == false) { Meteor.call("setOrdered.listItem", itemId, function(err, result) { if (err) { - console.log(" ERROR updating order status to ordered: " + err); + // console.log(" ERROR updating order status to ordered: " + err); } }); } else { Meteor.call("setNotOrdered.listItem", itemId, function(err, result) { if (err) { - console.log(" ERROR updating order status to unordered: " + err); + // console.log(" ERROR updating order status to unordered: " + err); } }); } @@ -73,7 +73,7 @@ Template.listItemTblByStore.events({ event.preventDefault(); Meteor.call('setReceived.listItem', this._id, function(err, result) { if (err) { - console.log(" ERROR setting item as received: " + err); + // console.log(" ERROR setting item as received: " + err); } else { // console.log(" SUCCESS setting item received."); } diff --git a/client/ListItems/listItemsForm.js b/client/ListItems/listItemsForm.js index 2f73857..20959a3 100644 --- a/client/ListItems/listItemsForm.js +++ b/client/ListItems/listItemsForm.js @@ -39,7 +39,7 @@ Template.listItemsForm.helpers({ selListId = selListInfo.viewId; Session.set("listId", selListId); } else { - console.log("not finding any value for viewId."); + // console.log("not finding any value for viewId."); } } let listInfo = Lists.findOne({ _id: selListId }); @@ -100,7 +100,7 @@ Template.listItemsForm.events({ // console.log(findItemVal); let listItemInfo = Products.find({ prodName: {$regex: findItemVal + '.*', $options: 'i'}}).fetch(); if (!listItemInfo) { - console.log("No data for key input."); + // console.log("No data for key input."); } else { getDataList(listItemInfo); } @@ -128,7 +128,7 @@ const addItem = async(item, listId) => { let result = await Meteor.callAsync("add.listItem", item, listId); try { if (!result) { - console.log(" ISSUE adding list item. See logs."); + // console.log(" ISSUE adding list item. See logs."); } else { $("#findListItems").val(""); } diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js index 497b4f9..7960b52 100644 --- a/client/ListItems/listItemsTbl.js +++ b/client/ListItems/listItemsTbl.js @@ -44,7 +44,7 @@ Template.listItemsTbl.events({ if (itemInfo.itemOrdered == true) { Meteor.call('setNotOrdered.listItem', this._id, function(err, result) { if (err) { - console.log(" ERROR setting this item as NOT ordered: " + err); + // console.log(" ERROR setting this item as NOT ordered: " + err); } else { // console.log(" SUCCESS setting this item as NOT ordered."); } @@ -52,7 +52,7 @@ Template.listItemsTbl.events({ } else { Meteor.call('setOrdered.listItem', this._id, function(err, result) { if (err) { - console.log(" ERROR marking item ordered: " + err); + // console.log(" ERROR marking item ordered: " + err); } else { // console.log(" SUCCESS marking this item ordered."); } @@ -63,7 +63,7 @@ Template.listItemsTbl.events({ event.preventDefault(); Meteor.call('setReceived.listItem', this._id, function(err, result) { if (err) { - console.log(" ERROR setting item as received: " + err); + // console.log(" ERROR setting item as received: " + err); } else { // console.log(" SUCCESS setting item received."); } diff --git a/client/Lists/listsTbl.js b/client/Lists/listsTbl.js index a905e78..05a065e 100644 --- a/client/Lists/listsTbl.js +++ b/client/Lists/listsTbl.js @@ -26,12 +26,12 @@ Template.listsTbl.events({ if (listId == "addList") { // opens the modal and allows you to add a new List } else { - console.log("listId is: " + listId); + // console.log("listId is: " + listId); Session.set("listId", listId); const addUserLast = async() => { let result = await Meteor.callAsync('add.userLast', "List", listId); if (!result) { - console.log(" ERROR setting user last list id in db: " + err); + // console.log(" ERROR setting user last list id in db: " + err); } else { setTimeout(function() { FlowRouter.go('/listitems'); @@ -53,7 +53,7 @@ Template.listsTbl.events({ const markComp = async() => { let result = await Meteor.callAsync("mark.complete", listId); if (!result) { - console.log(" ERROR marking list complete!"); + // console.log(" ERROR marking list complete!"); showSnackbar("ERROR! List Not Makred Complete!", "red"); } else { // console.log(" SUCCESS marking list complete."); diff --git a/client/MainLayout.js b/client/MainLayout.js index ebcea0b..010b72f 100644 --- a/client/MainLayout.js +++ b/client/MainLayout.js @@ -11,14 +11,14 @@ Template.MainLayout.onRendered(function() { let myprefs = await UserConfig.findOneAsync({ user: myId }); try { if (!myprefs) { - console.log("User Prefs appear undefined."); + // console.log("User Prefs appear undefined."); } else { if (myprefs.darkMode == "light") { - console.log("Found theme as light"); + // console.log("Found theme as light"); Session.set("myTheme", "light"); document.documentElement.setAttribute('theme', "light"); } else { - console.log("Found theme as dark"); + // console.log("Found theme as dark"); Session.set("myTheme", "dark"); document.documentElement.setAttribute('theme', "dark"); } diff --git a/client/MenuItems/addProdToListModal.js b/client/MenuItems/addProdToListModal.js index 79543e5..4dd32ea 100644 --- a/client/MenuItems/addProdToListModal.js +++ b/client/MenuItems/addProdToListModal.js @@ -31,9 +31,9 @@ Template.addProdToListModal.helpers({ }, productToChoose: function() { let menuItemId = Session.get("menuItemId"); - console.log("Menu Item Id received is: " + menuItemId); + // console.log("Menu Item Id received is: " + menuItemId); let prodLinkLIst = MenuProdLinks.find({ menuItemId: menuItemId}); - console.dir(prodLinkLIst); + // console.dir(prodLinkLIst); if (typeof prodLinkLIst != 'undefined' && prodLinkLIst != "" && prodLinkLIst != null) { return prodLinkLIst; } @@ -44,9 +44,9 @@ Template.addProdToListModal.events({ 'click .productListing' (event) { let itemId = event.currentTarget.id; let selected = Session.get("itemsSelected"); - console.log("Item clicked: " + itemId); + // console.log("Item clicked: " + itemId); selected.push(itemId); - console.dir(selected); + // console.dir(selected); Session.set("itemsSelected", selected); }, 'click #saveProdsToList' (event) { @@ -56,7 +56,7 @@ Template.addProdToListModal.events({ const addItemsFromMenu = async() => { let result = await Meteor.callAsync('add.itemsFromMenuItem', selectedItems, listId); if (!result) { - console.log(" ERROR adding menu components to list: " + err); + // console.log(" ERROR adding menu components to list: " + err); } else { showSnackbar("Items Added to List!", "green"); } diff --git a/client/MenuItems/menuItemsForm.js b/client/MenuItems/menuItemsForm.js index 4aeb09b..35d7b67 100644 --- a/client/MenuItems/menuItemsForm.js +++ b/client/MenuItems/menuItemsForm.js @@ -89,7 +89,7 @@ Template.menuItemsForm.events({ const addMenuItem = async() => { let result = await Meteor.callAsync('add.menuItem', menuItem); if (!result) { - console.log(" ERROR adding menu item: " + err); + // console.log(" ERROR adding menu item: " + err); } else { // console.log(" SUCCESS adding menu item."); return result; @@ -98,13 +98,13 @@ Template.menuItemsForm.events({ let addedItem = addMenuItem(); if (!addedItem) { - console.log("Item was not added."); + // console.log("Item was not added."); } else { // now add this item to the menu const addToMenu = async() => { let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv); if (!result2) { - console.log(" ERROR adding menuitem to menu: " + error); + // console.log(" ERROR adding menuitem to menu: " + error); } else { $("#menuItemInp").val(""); $("#dateServed").val(""); @@ -126,7 +126,7 @@ Template.menuItemsForm.events({ const addToMenu = async() => { let result = await Meteor.callAsync('addto.Menu', menuId, menuItem, menuItemId, dateSrv, isLinked); if (!result) { - console.log(" ERROR adding menuitem to menu: " + error); + // console.log(" ERROR adding menuitem to menu: " + error); } else { // console.log("Added item to menu - no problem."); $("#menuItemInp").val(""); @@ -149,7 +149,7 @@ Template.menuItemsForm.events({ const shiftDay = async() => { let result = await Meteor.callAsync('shiftDate', menuItemId, momentAddDay); if (!result) { - console.log(" ERROR shifting meal days: " + err); + // console.log(" ERROR shifting meal days: " + err); } else { showSnackbar("Items Shifted Out by 1 Calendar Day", "green"); } diff --git a/client/MenuItems/menuItemsTbl.js b/client/MenuItems/menuItemsTbl.js index b75f811..f931e62 100644 --- a/client/MenuItems/menuItemsTbl.js +++ b/client/MenuItems/menuItemsTbl.js @@ -53,7 +53,7 @@ Template.menuItemsTbl.events({ 'click .deleteMenuItem' (event) { event.preventDefault(); let theseIds = Session.get("menuId") + "_" + this.menuItemId; - console.log("These Ids: " + theseIds); + // console.log("These Ids: " + theseIds); Session.set("deleteId", theseIds); Session.set("method", "delete.itemFromMenu"); Session.set("item", this.menuItemName); @@ -63,7 +63,7 @@ Template.menuItemsTbl.events({ event.preventDefault(); Session.set("menuItemId", this.menuItemId); Session.set("menuItemName", this.menuItemName); - console.log("menu item name = " + this.menuItemName); + // console.log("menu item name = " + this.menuItemName); }, 'click .addProdsToList' (event) { event.preventDefault(); diff --git a/client/MenuItems/modalLinkProducts.js b/client/MenuItems/modalLinkProducts.js index 674a63c..5d6bf33 100644 --- a/client/MenuItems/modalLinkProducts.js +++ b/client/MenuItems/modalLinkProducts.js @@ -53,7 +53,7 @@ Template.modalLinkProducts.events({ const addMenuProdLinks = async() => { let result = await Meteor.callAsync("add.menuProdLinks", menuItemId, menuItemName, linkObjArray); if (!result) { - console.log(" ERROR adding product links to this menu item: " + err); + // console.log(" ERROR adding product links to this menu item: " + err); } else { updMenuItemLinks(); } @@ -63,7 +63,7 @@ Template.modalLinkProducts.events({ const updMenuItemLinks = async() => { let result = await Meteor.callAsync('update.menuItemLinked', menuItemId, true); if (!result) { - console.log(" ERROR adding link to menu item: " + err); + // console.log(" ERROR adding link to menu item: " + err); } else { linkInMenu(); } @@ -72,7 +72,7 @@ Template.modalLinkProducts.events({ const linkInMenu = async() => { let result = await Meteor.callAsync('link.inMenu', menuItemId, true); if (!result) { - console.log(" ERROR adding link to menu sub-item: " + error); + // console.log(" ERROR adding link to menu sub-item: " + error); } else { showSnackbar("Products added to Menu Item successfully!", "green"); } diff --git a/client/Menus/addMenuModal.js b/client/Menus/addMenuModal.js index 449c8be..638f81d 100644 --- a/client/Menus/addMenuModal.js +++ b/client/Menus/addMenuModal.js @@ -30,9 +30,9 @@ Template.addMenuModal.events({ const addMenu = async() => { let result = await Meteor.callAsync("add.menu", menuName); if (!result) { - console.log(" ERROR adding menu: " + err); + // console.log(" ERROR adding menu: " + err); } else { - console.log(" SUCCESS adding menu."); + // console.log(" SUCCESS adding menu."); $("#menuNameInp").val(""); } } diff --git a/client/Menus/mainMenuTbl.js b/client/Menus/mainMenuTbl.js index 97fbb0b..55b884c 100644 --- a/client/Menus/mainMenuTbl.js +++ b/client/Menus/mainMenuTbl.js @@ -27,13 +27,13 @@ Template.mainMenuTbl.events({ if (sender.localName == "li") { let menuId = event.currentTarget.id; if (menuId == "addMenu") { - console.log("add menu clicked"); + // console.log("add menu clicked"); } else { - console.log("menuId is: " + menuId); + // console.log("menuId is: " + menuId); const addUserLast = async() => { let result = await Meteor.callAsync('add.userLast', "Menu", menuId); if (!result) { - console.log(" ERROR writing last menu viewed by user to db."); + // console.log(" ERROR writing last menu viewed by user to db."); } else { Session.set("menuId", menuId); Meteor.setTimeout(function() { @@ -48,9 +48,9 @@ Template.mainMenuTbl.events({ const makrMenuComp = async() => { let result = await Meteor.callAsync("markMenu.complete", menuId); if (!result) { - console.log(" ERROR: can't mark menu complete."); + // console.log(" ERROR: can't mark menu complete."); } else { - console.log(" SUCCESS marking menu complete."); + // console.log(" SUCCESS marking menu complete."); setAllMade(); } } @@ -59,9 +59,9 @@ Template.mainMenuTbl.events({ const setAllMade = async() => { let result = await Meteor.callAsync('setAllMade.menuItem', menuId); if (!result) { - console.log(" ERROR: cannot set all items as made."); + // console.log(" ERROR: cannot set all items as made."); } else { - console.log(" SUCCESS setting all items made."); + // console.log(" SUCCESS setting all items made."); } } } diff --git a/client/MyTasks/myTasksForm.js b/client/MyTasks/myTasksForm.js index d0ce6db..82e4b1a 100644 --- a/client/MyTasks/myTasksForm.js +++ b/client/MyTasks/myTasksForm.js @@ -88,10 +88,10 @@ Template.myTasksForm.events({ const addTask = async(task, date, actDate) => { let result = await Meteor.callAsync("add.myTask", task, date, actDate); if (!result) { - console.log(" ERROR adding task for self: "); + // console.log(" ERROR adding task for self: "); showSnackbar("Error adding task for self!", "red"); } else { - console.log(" SUCCESS adding task for self."); + // console.log(" SUCCESS adding task for self."); // Session.set("taskDateArr", []); // $("#myTaskName").val(""); // $("#myTaskDate").val(""); diff --git a/client/MyTasks/myTasksTbl.js b/client/MyTasks/myTasksTbl.js index cb82446..9f2bc91 100644 --- a/client/MyTasks/myTasksTbl.js +++ b/client/MyTasks/myTasksTbl.js @@ -58,7 +58,7 @@ Template.myTasksTbl.events({ const makrTaskComp = async() => { let result = await Meteor.callAsync("markTask.complete", taskId); if (!result) { - console.log(" ERROR marking task completeL " + err); + // console.log(" ERROR marking task completeL " + err); showSnackbar("ERROR Marking Task Complete!", "red"); } else { showSnackbar("Successfully Marked Task Complete!", "green"); @@ -67,7 +67,7 @@ Template.myTasksTbl.events({ }, 'click .deleteMyTask' (event) { event.preventDefault(); - console.log("detected click"); + // console.log("detected click"); Session.set("deleteId", this._id); Session.set("method", "delete.task"); Session.set("item", this.taskName); diff --git a/client/UserConfig/userConfig.js b/client/UserConfig/userConfig.js index 7c83fca..e5f8725 100644 --- a/client/UserConfig/userConfig.js +++ b/client/UserConfig/userConfig.js @@ -50,7 +50,7 @@ Template.userConfig.events({ const setDarkMode = async(mode) => { let result = await Meteor.callAsync('update.darkModePref', mode); if (!result) { - console.log(" - Did not receive back a 'result' from the update."); + // console.log(" - Did not receive back a 'result' from the update."); } else { showSnackbar("Dark Mode Preference Set to " + mode, "green"); } diff --git a/imports/api/listItems.js b/imports/api/listItems.js index eb66875..b54ef38 100644 --- a/imports/api/listItems.js +++ b/imports/api/listItems.js @@ -32,14 +32,14 @@ Meteor.methods({ // add product info first let added = await Meteor.callAsync("add.product", itemName, [""]); if (!added) { - console.log(" ERROR adding item to products: " + err); + // console.log(" ERROR adding item to products: " + err); } else { // console.log(" SUCCESS adding item to Products."); return await ListItems.insertAsync({ itemName: iname, listId: listId, - prodId: result, + prodId: added, addedBy: this.userId, itemStore: "", itemOrdered: false, @@ -81,7 +81,7 @@ Meteor.methods({ // now pull the product let prodInfo = await Products.findOneAsync({ _id: itemIds[i] }); if (!prodInfo) { - console.log("Unable to load product info."); + // console.log("Unable to load product info."); } else { ListItems.insertAsync({ itemName: prodInfo.prodName, @@ -96,7 +96,7 @@ Meteor.methods({ } } else { // product exists on list, move on to next - console.log("Product Exists on Selected List."); + // console.log("Product Exists on Selected List."); } } }, diff --git a/imports/api/menu.js b/imports/api/menu.js index cf3b8eb..3cd7939 100644 --- a/imports/api/menu.js +++ b/imports/api/menu.js @@ -165,7 +165,7 @@ Meteor.methods({ } let ids = itemIds.split('_'); - console.log("item ids: " + ids[0] + " and " + ids[1]); + // console.log("item ids: " + ids[0] + " and " + ids[1]); return await Menus.updateAsync({ _id: ids[0] }, { $pull: { diff --git a/imports/api/menuProdLinks.js b/imports/api/menuProdLinks.js index 9cfe22a..29304ca 100644 --- a/imports/api/menuProdLinks.js +++ b/imports/api/menuProdLinks.js @@ -25,12 +25,12 @@ Meteor.methods({ let linkExists = MenuProdLinks.findOne({ menuItemId: menuItemId }); if (linkExists) { - console.log("sending to update method instead."); + // console.log("sending to update method instead."); Meteor.call('update.menuPordLInks', menuItemId, menuItemName, prodNameArray, function(err, result) { if (err) { - console.log(" ERROR moving to the update method: " + err); + // console.log(" ERROR moving to the update method: " + err); } else { - console.log("Successfully updated the menu prod links.") + // console.log("Successfully updated the menu prod links.") } }); } else { diff --git a/imports/api/systemConfig.js b/imports/api/systemConfig.js index a278007..7126453 100644 --- a/imports/api/systemConfig.js +++ b/imports/api/systemConfig.js @@ -39,9 +39,9 @@ Meteor.methods({ let configId = curr._id; const addNoSys = await Meteor.callAsync('edit.noSysAdminReg', configId, admReg, genReg); if (!addNoSys) { - console.log(" Couldn't edit the system config."); + // console.log(" Couldn't edit the system config."); } else { - console.log("Success updating sys admin reg."); + // console.log("Success updating sys admin reg."); } } catch(error) { console.log(" ERROR trying to pull current system config:"); diff --git a/imports/api/tasks.js b/imports/api/tasks.js index 1fece81..a3d5a83 100644 --- a/imports/api/tasks.js +++ b/imports/api/tasks.js @@ -51,7 +51,7 @@ Meteor.methods({ let userInfo = await Meteor.users.findOneAsync({ _id: this.userId }); if (!userInfo) { - console.log("No matching user info found.") + // console.log("No matching user info found.") } else { try { return await TaskItems.insertAsync({ @@ -140,23 +140,23 @@ Meteor.methods({ let upToDate = ""; switch(timeFrame) { case "1-week": - console.log("1 Week"); + // console.log("1 Week"); upToDate = 7 * 24 * 60 * 60 * 1000; break; case "2-weeks": - console.log("2 Week"); + // console.log("2 Week"); upToDate = 14 * 24 * 60 * 60 * 1000; break; case '1-month': - console.log("1 month"); + // console.log("1 month"); upToDate = 30 * 24 * 60 * 60 * 1000; break; case '3-months': - console.log("3 months"); + // console.log("3 months"); upToDate = 90 * 24 * 60 * 60 * 1000; break; case 'all': - console.log("all"); + // console.log("all"); upToDate = 1 * 24 * 60 * 60 * 1000; break; default: diff --git a/imports/api/userLast.js b/imports/api/userLast.js index 33e156b..a370e2f 100644 --- a/imports/api/userLast.js +++ b/imports/api/userLast.js @@ -24,7 +24,7 @@ Meteor.methods({ // we'll just edit that entry with updated information let userListInfo = await UserLast.findOneAsync({ userId: this.userId, view: view }); if (!userListInfo) { - console.log("Adding new user last item."); + // console.log("Adding new user last item."); return await UserLast.insertAsync({ userId: this.userId, view: view, @@ -32,12 +32,12 @@ Meteor.methods({ dateAdded: Date(), }); } else { - console.log("Editing existing user last itme."); + // console.log("Editing existing user last itme."); // entry exists, call the edit function instead let result = await Meteor.callAsync('edit.userLast', view, viewId); if (!result) { try { - console.log("Issue editing existing entry in userLast. Check the logs."); + // console.log("Issue editing existing entry in userLast. Check the logs."); } catch(error) { console.log(" ERROR adding userLast item: " + error); console.log(error.message); @@ -56,7 +56,7 @@ Meteor.methods({ throw new Meteor.Error('Not able to change user view last setting. Make sure you are logged in with valid system administrator credentials.'); } - console.log("Edit in progress."); + // console.log("Edit in progress."); return await UserLast.updateAsync({ view: view, userId: this.userId }, { $set: { viewId: viewId, From b5d490c052092287cb1d145054daf7925be2fad5 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Tue, 29 Jul 2025 16:58:25 -0500 Subject: [PATCH 20/27] Just updated menu items to be added correctly in new version --- client/MenuItems/menuItemsForm.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/MenuItems/menuItemsForm.js b/client/MenuItems/menuItemsForm.js index 35d7b67..e0a6e65 100644 --- a/client/MenuItems/menuItemsForm.js +++ b/client/MenuItems/menuItemsForm.js @@ -69,6 +69,10 @@ Template.menuItemsForm.events({ let dateSrv = $("#dateServed").val(); let menuId = Session.get("menuId"); + if (menuId == null || menuId == "") { + console.log(" ---- NO MENU ID! ----"); + } + const mie = async() => { let menuItemExists = await MenuItems.findOneAsync({ itemName: menuItem }); if (!menuItemExists) { @@ -76,6 +80,7 @@ Template.menuItemsForm.events({ notExists(); } else { // call to add it to the menu only + console.dir(menuItemExists); itExists(menuItemExists); } } @@ -91,18 +96,19 @@ Template.menuItemsForm.events({ if (!result) { // console.log(" ERROR adding menu item: " + err); } else { - // console.log(" SUCCESS adding menu item."); + // console.log(" SUCCESS adding menu item. Result is: " + result); return result; } } - let addedItem = addMenuItem(); + let addedItem = await addMenuItem(); if (!addedItem) { // console.log("Item was not added."); } else { // now add this item to the menu + // console.log("Added Item = " + addedItem); const addToMenu = async() => { - let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv); + let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv, false); if (!result2) { // console.log(" ERROR adding menuitem to menu: " + error); } else { @@ -160,7 +166,11 @@ Template.menuItemsForm.events({ if (event.which != 13) { let findMenuItem = $("#menuItemInp").val(); let menuItemInfo = MenuItems.find({ itemName: {$regex: findMenuItem + '.*', $options: 'i' }}).fetch(); - if (typeof menuItemInfo != 'undefined' && menuItemInfo != '' && menuItemInfo != null) { + if (!menuItemInfo) { + console.log("Nothing found in menu items:"); + console.dir(menuItemInfo); + } else { + console.dir(menuItemInfo) getMenuItemList(menuItemInfo); } } From 9223f21e069df4e35d56f5f697496eca348ac981 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Wed, 30 Jul 2025 07:11:50 -0500 Subject: [PATCH 21/27] Updates to make Menu and lists work together again. --- client/ListItems/listItemsTbl.js | 25 ++++++++++++------------ client/MenuItems/addProdToListModal.html | 5 ++--- client/MenuItems/addProdToListModal.js | 2 +- client/MenuItems/modalLinkProducts.js | 2 +- client/Menus/mainMenuTbl.js | 6 ++---- imports/api/listItems.js | 15 ++++++++++---- imports/api/menuProdLinks.js | 4 ++-- 7 files changed, 32 insertions(+), 27 deletions(-) diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js index 7960b52..1ff8aae 100644 --- a/client/ListItems/listItemsTbl.js +++ b/client/ListItems/listItemsTbl.js @@ -40,24 +40,25 @@ Template.listItemsTbl.helpers({ Template.listItemsTbl.events({ 'click li' (event) { event.preventDefault(); - let itemInfo = ListItems.findOne({ _id: this._id }); - if (itemInfo.itemOrdered == true) { - Meteor.call('setNotOrdered.listItem', this._id, function(err, result) { - if (err) { - // console.log(" ERROR setting this item as NOT ordered: " + err); + const setOrd = async() => { + let itemInfo = await ListItems.findOneAsync({ _id: this._id }); + if (itemInfo.itemOrdered == true) { + let result = await Meteor.callAsync('setNotOrdered.listItem', this._id); + if (!result) { + // console.log(" ERROR seeting item as not ordered."); } else { - // console.log(" SUCCESS setting this item as NOT ordered."); - } - }); - } else { - Meteor.call('setOrdered.listItem', this._id, function(err, result) { - if (err) { + // console.log(" SUCCESS setting item as ordered."); + } + } else { + let result = Meteor.callAsync('setOrdered.listItem', this._id); + if (!result) { // console.log(" ERROR marking item ordered: " + err); } else { // console.log(" SUCCESS marking this item ordered."); } - }); + } } + setOrd(); }, 'click .markListItemReceived' (event) { event.preventDefault(); diff --git a/client/MenuItems/addProdToListModal.html b/client/MenuItems/addProdToListModal.html index 191eaeb..4ac3f34 100644 --- a/client/MenuItems/addProdToListModal.html +++ b/client/MenuItems/addProdToListModal.html @@ -39,10 +39,9 @@ Cancel
-
- +
{{> snackbar}} diff --git a/client/MenuItems/addProdToListModal.js b/client/MenuItems/addProdToListModal.js index 4dd32ea..914273a 100644 --- a/client/MenuItems/addProdToListModal.js +++ b/client/MenuItems/addProdToListModal.js @@ -56,7 +56,7 @@ Template.addProdToListModal.events({ const addItemsFromMenu = async() => { let result = await Meteor.callAsync('add.itemsFromMenuItem', selectedItems, listId); if (!result) { - // console.log(" ERROR adding menu components to list: " + err); + console.log(" ERROR adding menu components to list: "); } else { showSnackbar("Items Added to List!", "green"); } diff --git a/client/MenuItems/modalLinkProducts.js b/client/MenuItems/modalLinkProducts.js index 5d6bf33..00326ff 100644 --- a/client/MenuItems/modalLinkProducts.js +++ b/client/MenuItems/modalLinkProducts.js @@ -72,7 +72,7 @@ Template.modalLinkProducts.events({ const linkInMenu = async() => { let result = await Meteor.callAsync('link.inMenu', menuItemId, true); if (!result) { - // console.log(" ERROR adding link to menu sub-item: " + error); + console.log(" ERROR adding link to menu sub-item: " + error); } else { showSnackbar("Products added to Menu Item successfully!", "green"); } diff --git a/client/Menus/mainMenuTbl.js b/client/Menus/mainMenuTbl.js index 55b884c..a64e4c3 100644 --- a/client/Menus/mainMenuTbl.js +++ b/client/Menus/mainMenuTbl.js @@ -31,14 +31,12 @@ Template.mainMenuTbl.events({ } else { // console.log("menuId is: " + menuId); const addUserLast = async() => { + Session.set("menuId", menuId); let result = await Meteor.callAsync('add.userLast', "Menu", menuId); if (!result) { // console.log(" ERROR writing last menu viewed by user to db."); } else { - Session.set("menuId", menuId); - Meteor.setTimeout(function() { - FlowRouter.go('/menuitems'); - }, 100); + FlowRouter.go('/menuitems'); } } addUserLast(); diff --git a/imports/api/listItems.js b/imports/api/listItems.js index b54ef38..ad85f68 100644 --- a/imports/api/listItems.js +++ b/imports/api/listItems.js @@ -72,17 +72,20 @@ Meteor.methods({ } console.dir(itemIds); + let noitems = itemIds.length; + let i; - for (i=0; i < itemIds.length; i++) { + for (i=0; i < noitems; i++) { // let's check and make sure the product isn't already on the list - let onList = await ListItems.find({ listId: listId, prodId: itemIds[i] }).count(); + let onList = await ListItems.find({ listId: listId, prodId: itemIds[i] }).countAsync(); // console.log("Number On List: " + onList); if (onList == 0) { // now pull the product let prodInfo = await Products.findOneAsync({ _id: itemIds[i] }); if (!prodInfo) { - // console.log("Unable to load product info."); + console.log("Unable to load product info."); } else { + console.log("Run " + i); ListItems.insertAsync({ itemName: prodInfo.prodName, listId: listId, @@ -96,7 +99,11 @@ Meteor.methods({ } } else { // product exists on list, move on to next - // console.log("Product Exists on Selected List."); + console.log("Product Exists on Selected List."); + } + if (i == (noitems - 1)) { + console.log("Returning now."); + return true; } } }, diff --git a/imports/api/menuProdLinks.js b/imports/api/menuProdLinks.js index 29304ca..70bded5 100644 --- a/imports/api/menuProdLinks.js +++ b/imports/api/menuProdLinks.js @@ -22,11 +22,11 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add menu and product links. Make sure you are logged in with valid user credentials.'); }; - let linkExists = MenuProdLinks.findOne({ menuItemId: menuItemId }); + let linkExists = await MenuProdLinks.findOneAsync({ menuItemId: menuItemId }); if (linkExists) { // console.log("sending to update method instead."); - Meteor.call('update.menuPordLInks', menuItemId, menuItemName, prodNameArray, function(err, result) { + await Meteor.callAsync('update.menuPordLInks', menuItemId, menuItemName, prodNameArray, function(err, result) { if (err) { // console.log(" ERROR moving to the update method: " + err); } else { From 839390f820157f09108b9f34348456acc9d82256 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 2 Aug 2025 15:45:34 -0500 Subject: [PATCH 22/27] attempting to make product load better in drop down --- client/MenuItems/modalLinkProducts.js | 28 +++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/client/MenuItems/modalLinkProducts.js b/client/MenuItems/modalLinkProducts.js index 00326ff..8d777d3 100644 --- a/client/MenuItems/modalLinkProducts.js +++ b/client/MenuItems/modalLinkProducts.js @@ -18,17 +18,29 @@ Template.modalLinkProducts.onRendered(function() { dropdownOptions: 4, }); - setTimeout(function() { - var instances = M.Modal.init(elems, {}); - var instancese = M.FormSelect.init(elemse, { - dropdownOptions: 4, - }); - }, 250); + this.autorun(() => { + if (this.subscriptionsReady()) { + // setTimeout(function() { + // var instances = M.Modal.init(elems, {}); + var elemse = document.querySelectorAll('select'); + var instancese = M.FormSelect.init(elemse, { + dropdownOptions: 4, + }); + // }, 250); + } + }); }); Template.modalLinkProducts.helpers({ products: function() { - return Products.find({}, {sort: { prodName:1 }}); + let prodInfo = Products.find({}, { sort: { prodName:1 }}); + // return Products.find({}, {sort: { prodName:1 }}); + if (!prodInfo) { + console.log("no product info yet."); + } else { + console.log("prod info found."); + return prodInfo; + } } }); @@ -79,4 +91,4 @@ Template.modalLinkProducts.events({ } } } -}); +}); \ No newline at end of file From aaddbf0b44ab203c6bd401214d1463cae2a3c6b3 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 2 Aug 2025 17:05:09 -0500 Subject: [PATCH 23/27] Fixed Menu Clean up. --- imports/api/menu.js | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/imports/api/menu.js b/imports/api/menu.js index 3cd7939..e9bd450 100644 --- a/imports/api/menu.js +++ b/imports/api/menu.js @@ -82,40 +82,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to clean up old Menus. Make sure you are logged in with valid user credentials.'); } - let removeMenuIds = []; - - - // let's find all the menus with menu items that are past their date. - let menuList = Menus.find({ menuComplete: false }).fetch(); - for (i=0; i < menuList.length; i++) { - let removeMenu = true; - let items = MenuItems.find({ menuId: menuList[i]._id }).fetch(); - for (let j=0; j < items.length; j++) { - let srvDate = moment(items[j].serveDateActual); - let today = moment(); - let expired = moment(today).isAfter(srvDate); - if (expired != true) { - removeMenu = false; - } - if (j == items.length - 1) { - if (removeMenu == true) { - removeMenuIds.push(menuList[i]._id); - } - } - } - } - - // next let's add the ids of any menus that are marked complete - let markedComplete = Menus.find({ menuComplete: true }).fetch(); - for (let k = 0; k < markedComplete.length; k++) { - let menuId = markedComplete[k]._id; - removeMenuIds.push(menuId); - } - - // finally we'll cycle through the ids and remove the items we collected up. - for (let l = 0; l < removeMenuIds.length; l++) { - await Menus.removeAsync({ _id: removeMenuIds[l] }); - } + return await Menus.removeAsync({ menuComplete: true }); }, async 'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) { check(menuId, String); From c6c5951d1674625895f4e2d1b632d1ff99fc95f9 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 2 Aug 2025 19:22:37 -0500 Subject: [PATCH 24/27] tiny update to add console logging. --- client/AdminMgmt/ListMgmt/listMgmtTbl.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/AdminMgmt/ListMgmt/listMgmtTbl.js b/client/AdminMgmt/ListMgmt/listMgmtTbl.js index 922028b..256f7d5 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtTbl.js +++ b/client/AdminMgmt/ListMgmt/listMgmtTbl.js @@ -15,6 +15,7 @@ Template.listMgmtTbl.onRendered(function() { Template.listMgmtTbl.helpers({ lists: function() { let showComplete = Session.get("showCompletedLists"); + // console.log("Show Complete Lists: " + showComplete); if (showComplete) { return Lists.find({}); } else { From 680f7c614d2032db03c081815e95adbb346c0435 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 9 Aug 2025 07:21:46 -0500 Subject: [PATCH 25/27] Fixing clean Up and added option to show which products arent used in a list --- .../modalConfirm/cleanUpModalConfirm.js | 13 ++++++++-- .../AdminMgmt/ProductMgmt/prodMgmtForm.html | 24 ++++++++++++------- client/AdminMgmt/ProductMgmt/prodMgmtForm.js | 8 +++++++ client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 18 ++++++++++++++ imports/api/products.js | 10 ++++++++ server/publish.js | 8 +++++++ 6 files changed, 71 insertions(+), 10 deletions(-) diff --git a/client/AdminMgmt/CleanUp/modalConfirm/cleanUpModalConfirm.js b/client/AdminMgmt/CleanUp/modalConfirm/cleanUpModalConfirm.js index 247da06..19245ea 100644 --- a/client/AdminMgmt/CleanUp/modalConfirm/cleanUpModalConfirm.js +++ b/client/AdminMgmt/CleanUp/modalConfirm/cleanUpModalConfirm.js @@ -29,7 +29,7 @@ Template.cleanUpModalConfirm.events({ case "Menus": cleanUp("clean.Menus", whatItems); case "Products": - // cleanUp("clean.Products", whatItems); + cleanUp("clean.Products", whatItems); case "Stores": // cleanUp("clean.Stores", whatItems); case "Tasks": @@ -43,7 +43,7 @@ Template.cleanUpModalConfirm.events({ cleanUp = async function(methodName, whatItems) { let result = Meteor.callAsync(methodName); if (!result) { - console.log(" ERROR cleaning " + whatItems + ": " + err); + console.log(" ERROR cleaning " + whatItems); } else { showSnackbar(whatItems + " have been cleaned up!", "green"); let confirmModal = document.getElementById('cleanUpConfirm'); @@ -51,6 +51,15 @@ cleanUp = async function(methodName, whatItems) { } } +cleanProducts = async function(methodName, whatItems) { + let result = await Meteor.call(methodName, whatItems); + if (!result) { + console.log(" ERROR cleaning " + whatItems); + } else { + showSnackbar(whatItems + " have been cleaned up.", "green"); + } +} + cleanTasks = async function(methodName, whatItems) { let timeFrame = Session.get("overdueVal"); let result = await Meteor.call(methodName, timeFrame); diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html index 357b19c..3a6ff9c 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html @@ -2,14 +2,22 @@

Product Management

{{#if Template.subscriptionsReady}}
-
-

- -

-
+
+

+ +

+
+
+

+ +

+
diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js index cb5fc18..f0c2a2d 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js @@ -60,6 +60,14 @@ Template.prodMgmtForm.events({ Session.set("noStoreSet", false); } }, + 'click #showNoList' (event) { + let notUsedInList = $("#showNoList").prop('checked'); + if (notUsedInList == true) { + Session.set("noListUsed", true); + } else { + Session.set("noListUsed", false); + } + }, 'submit .prodInputForm' (event) { }, diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js index cf49c52..48dfee1 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js @@ -1,14 +1,17 @@ import { Products } from '../../../imports/api/products.js'; +import { ListItems } from '../../../imports/api/listItems.js'; import { M } from '../../lib/assets/materialize.js'; Template.prodMgmtTbl.onCreated(function() { this.subscribe("myProducts"); + this.subscribe("allListItems"); }); Template.prodMgmtTbl.onRendered(function() { Session.set("searchProds", false); Session.set("searchStore", false); Session.set("noStoreSet", false); + Session.set("noListUsed", false); }); Template.prodMgmtTbl.helpers({ @@ -16,6 +19,7 @@ Template.prodMgmtTbl.helpers({ let searchProd = Session.get("searchProds"); let searchStore = Session.get("searchStore"); let noStoreSet = Session.get("noStoreSet"); + let noListUsed = Session.get("noListUsed"); if (searchProd == true) { let searchVal = Session.get("searchVal"); @@ -33,6 +37,20 @@ Template.prodMgmtTbl.helpers({ } } else if (noStoreSet == true) { return Products.find({ prodStore: '' }, { sort: { prodName: 1 }}); + } else if (noListUsed == true) { + let i; + let idList = []; + let idsInLists = ListItems.find({}).fetch(); + for (i=0; i < idsInLists.length; i++) { + // console.log(idsInList[i]); + idList.push(idsInLists[i].prodId); + } + if (i > idsInLists.length - 1) { + console.dir(idList); + let noProdsNot = Products.find({ _id: { $nin: idList }}).count(); + console.log(noProdsNot); + return Products.find({ _id: { $nin: idList }}, { sort: { prodName: 1 }}); + } } else { return Products.find({}, { sort: { prodName: 1 }}); } diff --git a/imports/api/products.js b/imports/api/products.js index b8d5056..35e8206 100644 --- a/imports/api/products.js +++ b/imports/api/products.js @@ -63,5 +63,15 @@ Meteor.methods({ } return await Products.removeAsync({ _id: prodId }); + }, + async 'clean.Products' () { + if (!this.userId) { + throw new Meteor.Error('You are not allowed to delete products. Make sure you are logged in with valid user credentials.'); + } + + // first we need to find potential duplicate products + // next we need to see which of those are on incomplete lists + // Then we'll update those to use the main products ID instead + // finally we'll delete the duplicates } }); diff --git a/server/publish.js b/server/publish.js index c0f8072..61750dd 100644 --- a/server/publish.js +++ b/server/publish.js @@ -96,6 +96,14 @@ Meteor.publish("myListItems", function(listId) { } }); +Meteor.publish("allListItems", function() { + try { + return ListItems.find({}); + } catch (error) { + console.log(" ERROR pulling all list items."); + } +}); + Meteor.publish("myStoreListItems", function(listId) { try { let stores = Store.find({}); From 047befcae920bedb36f6ebd0ac8be9cbd8fa4b19 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sat, 9 Aug 2025 07:24:54 -0500 Subject: [PATCH 26/27] Adjusted layout and removed logging --- client/AdminMgmt/ProductMgmt/prodMgmtForm.html | 4 ++-- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html index 3a6ff9c..7ebd800 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html @@ -2,7 +2,7 @@

Product Management

{{#if Template.subscriptionsReady}} -
+

-
+

  • My Lists
  • My Menus
  • My Tasks
  • -
  • My Settings
  • +
  • My Settings
  • {{#if isInRole "systemadmin"}}
  • Manage
  • {{/if}} @@ -30,7 +30,7 @@
  • My Lists
  • My Menus
  • My Tasks
  • -
  • My Settings
  • +
  • My Settings
  • {{#if isInRole 'systemadmin'}}
  • Manage
  • {{#if $eq updateExists true}} diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js index 1ff8aae..4d04e18 100644 --- a/client/ListItems/listItemsTbl.js +++ b/client/ListItems/listItemsTbl.js @@ -62,13 +62,15 @@ Template.listItemsTbl.events({ }, 'click .markListItemReceived' (event) { event.preventDefault(); - Meteor.call('setReceived.listItem', this._id, function(err, result) { - if (err) { - // console.log(" ERROR setting item as received: " + err); + const setRcvd = async() => { + let result = await Meteor.callAsync('setReceived.listItem', this._id); + if (!result) { + // console.log("Item not marked properly - why?"); } else { - // console.log(" SUCCESS setting item received."); + // console.log("Item Marked Received."); } - }); + } + setRcvd(); }, 'click .deleteListItem' (event) { event.preventDefault(); diff --git a/imports/api/menuProdLinks.js b/imports/api/menuProdLinks.js index 70bded5..3dba4fc 100644 --- a/imports/api/menuProdLinks.js +++ b/imports/api/menuProdLinks.js @@ -52,6 +52,7 @@ Meteor.methods({ throw new Meteor.Error('You are not allowed to add menu and product links. Make sure you are logged in with valid user credentials.'); }; + console.log(" ---- Doing an Update instead! ---- "); return await MenuProdLinks.updateAsync({ menuItemId: menuItemId }, { $set: { products: prodNameArray, diff --git a/package-lock.json b/package-lock.json index 0d65189..a78ea76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,9 +16,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", - "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -109,9 +109,9 @@ "license": "MIT" }, "node_modules/meteor-node-stubs": { - "version": "1.2.19", - "resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.19.tgz", - "integrity": "sha512-lryhEAPp7aysrC0j3XU1yTs92ktPQQhzQzLVz3OGQEZjL//iLhvJyeYNSvV01XJn6fXUXe48agossxniJkzYOQ==", + "version": "1.2.24", + "resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.24.tgz", + "integrity": "sha512-tw9QzDFVOI5A5CcEw4tTD6CjF+Lk14uzhy2gWH5ImoH4mx4pyPVcha9MmyVur+rEVgpzk+aMG6rs3RxAF9SwiA==", "bundleDependencies": [ "@meteorjs/crypto-browserify", "assert", @@ -154,6 +154,7 @@ "punycode": "^1.4.1", "querystring-es3": "^0.2.1", "readable-stream": "^3.6.2", + "sha.js": "^2.4.12", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "string_decoder": "^1.3.0", @@ -188,6 +189,11 @@ "node": ">= 0.12" } }, + "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/isarray": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT" + }, "node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/readable-stream": { "version": "2.3.8", "inBundle": true, @@ -906,7 +912,7 @@ } }, "node_modules/meteor-node-stubs/node_modules/isarray": { - "version": "1.0.0", + "version": "2.0.5", "inBundle": true, "license": "MIT" }, @@ -1040,20 +1046,49 @@ "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/pbkdf2": { - "version": "3.1.2", + "version": "3.1.3", "inBundle": true, "license": "MIT", "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "create-hash": "~1.1.3", + "create-hmac": "^1.1.7", + "ripemd160": "=2.0.1", + "safe-buffer": "^5.2.1", + "sha.js": "^2.4.11", + "to-buffer": "^1.2.0" }, "engines": { "node": ">=0.12" } }, + "node_modules/meteor-node-stubs/node_modules/pbkdf2/node_modules/create-hash": { + "version": "1.1.3", + "inBundle": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" + } + }, + "node_modules/meteor-node-stubs/node_modules/pbkdf2/node_modules/hash-base": { + "version": "2.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1" + } + }, + "node_modules/meteor-node-stubs/node_modules/pbkdf2/node_modules/ripemd160": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "hash-base": "^2.0.0", + "inherits": "^2.0.1" + } + }, "node_modules/meteor-node-stubs/node_modules/possible-typed-array-names": { "version": "1.1.0", "inBundle": true, @@ -1215,15 +1250,22 @@ "license": "MIT" }, "node_modules/meteor-node-stubs/node_modules/sha.js": { - "version": "2.4.11", + "version": "2.4.12", "inBundle": true, "license": "(MIT AND BSD-3-Clause)", "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" }, "bin": { "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/meteor-node-stubs/node_modules/side-channel": { @@ -1333,11 +1375,37 @@ "node": ">=0.6.0" } }, + "node_modules/meteor-node-stubs/node_modules/to-buffer": { + "version": "1.2.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/meteor-node-stubs/node_modules/tty-browserify": { "version": "0.0.1", "inBundle": true, "license": "MIT" }, + "node_modules/meteor-node-stubs/node_modules/typed-array-buffer": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/meteor-node-stubs/node_modules/url": { "version": "0.11.4", "inBundle": true, diff --git a/server/publish.js b/server/publish.js index 61750dd..57e5e13 100644 --- a/server/publish.js +++ b/server/publish.js @@ -30,7 +30,7 @@ Meteor.publish("SystemConfig", function() { Meteor.publish("UserConfigPrefs", function() { try { - return UserConfig.find({}); + return UserConfig.find({ user: this.userId }); } catch (error) { console.log(" ERROR: Error accessing user config: " + error); }