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() { 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 @@