mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Compare commits
6 commits
2.0.1-beta
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76d3591d51 | ||
|
|
047befcae9 | ||
|
|
680f7c614d | ||
|
|
c6c5951d16 | ||
|
|
aaddbf0b44 | ||
|
|
839390f820 |
17 changed files with 208 additions and 99 deletions
|
|
@ -6,18 +6,18 @@
|
||||||
|
|
||||||
meteor-base@1.5.2 # Packages every Meteor app needs to have
|
meteor-base@1.5.2 # Packages every Meteor app needs to have
|
||||||
mobile-experience@1.1.2 # Packages for a great mobile UX
|
mobile-experience@1.1.2 # Packages for a great mobile UX
|
||||||
mongo@2.1.2 # The database Meteor supports right now
|
mongo@2.1.4 # The database Meteor supports right now
|
||||||
blaze-html-templates # Compile .html files into Meteor Blaze views
|
blaze-html-templates # Compile .html files into Meteor Blaze views
|
||||||
jquery # Wrapper package for npm-installed jquery
|
jquery # Wrapper package for npm-installed jquery
|
||||||
reactive-var@1.0.13 # Reactive variable for tracker
|
reactive-var@1.0.13 # Reactive variable for tracker
|
||||||
tracker@1.3.4 # Meteor's client-side reactive programming library
|
tracker@1.3.4 # Meteor's client-side reactive programming library
|
||||||
|
|
||||||
standard-minifier-css@1.9.3 # CSS minifier run for production mode
|
standard-minifier-css@1.9.3 # CSS minifier run for production mode
|
||||||
standard-minifier-js@3.1.0 # JS minifier run for production mode
|
standard-minifier-js@3.1.1 # JS minifier run for production mode
|
||||||
es5-shim@4.8.1 # ECMAScript 5 compatibility for older browsers
|
es5-shim@4.8.1 # ECMAScript 5 compatibility for older browsers
|
||||||
ecmascript@0.16.11 # Enable ECMAScript2015+ syntax in app code
|
ecmascript@0.16.13 # Enable ECMAScript2015+ syntax in app code
|
||||||
typescript@5.6.4 # Enable TypeScript syntax in .ts and .tsx modules
|
typescript@5.6.6 # Enable TypeScript syntax in .ts and .tsx modules
|
||||||
shell-server@0.6.1 # Server-side component of the `meteor shell` command
|
shell-server@0.6.2 # Server-side component of the `meteor shell` command
|
||||||
|
|
||||||
hot-module-replacement@0.5.4 # 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
|
blaze-hot # Update files using Blaze's API with HMR
|
||||||
|
|
@ -27,4 +27,4 @@ session@1.2.2
|
||||||
email@3.1.2
|
email@3.1.2
|
||||||
arianjahiri:meteor-handlebars-helpers
|
arianjahiri:meteor-handlebars-helpers
|
||||||
ostrio:flow-router-extra
|
ostrio:flow-router-extra
|
||||||
accounts-password@3.2.0
|
accounts-password@3.2.1
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
METEOR@3.3
|
METEOR@3.3.2
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
accounts-base@3.1.1
|
accounts-base@3.1.2
|
||||||
accounts-password@3.2.0
|
accounts-password@3.2.1
|
||||||
allow-deny@2.1.0
|
allow-deny@2.1.0
|
||||||
arianjahiri:meteor-handlebars-helpers@0.0.1
|
arianjahiri:meteor-handlebars-helpers@0.0.1
|
||||||
autoupdate@2.0.1
|
autoupdate@2.0.1
|
||||||
babel-compiler@7.12.0
|
babel-compiler@7.12.2
|
||||||
babel-runtime@1.5.2
|
babel-runtime@1.5.2
|
||||||
base64@1.0.13
|
base64@1.0.13
|
||||||
binary-heap@1.0.12
|
binary-heap@1.0.12
|
||||||
|
|
@ -11,10 +11,10 @@ blaze@3.0.2
|
||||||
blaze-hot@2.0.0
|
blaze-hot@2.0.0
|
||||||
blaze-html-templates@3.0.0
|
blaze-html-templates@3.0.0
|
||||||
blaze-tools@2.0.0
|
blaze-tools@2.0.0
|
||||||
boilerplate-generator@2.0.1
|
boilerplate-generator@2.0.2
|
||||||
caching-compiler@2.0.1
|
caching-compiler@2.0.1
|
||||||
caching-html-compiler@2.0.0
|
caching-html-compiler@2.0.0
|
||||||
callback-hook@1.6.0
|
callback-hook@1.6.1
|
||||||
check@1.4.4
|
check@1.4.4
|
||||||
core-runtime@1.0.0
|
core-runtime@1.0.0
|
||||||
ddp@1.4.2
|
ddp@1.4.2
|
||||||
|
|
@ -25,7 +25,7 @@ ddp-server@3.1.2
|
||||||
deps@1.0.5-pre.1
|
deps@1.0.5-pre.1
|
||||||
diff-sequence@1.1.3
|
diff-sequence@1.1.3
|
||||||
dynamic-import@0.7.4
|
dynamic-import@0.7.4
|
||||||
ecmascript@0.16.11
|
ecmascript@0.16.13
|
||||||
ecmascript-runtime@0.8.3
|
ecmascript-runtime@0.8.3
|
||||||
ecmascript-runtime-client@0.12.3
|
ecmascript-runtime-client@0.12.3
|
||||||
ecmascript-runtime-server@0.11.1
|
ecmascript-runtime-server@0.11.1
|
||||||
|
|
@ -48,19 +48,19 @@ logging@1.3.6
|
||||||
meteor@2.1.1
|
meteor@2.1.1
|
||||||
meteor-base@1.5.2
|
meteor-base@1.5.2
|
||||||
minifier-css@2.0.1
|
minifier-css@2.0.1
|
||||||
minifier-js@3.0.2
|
minifier-js@3.0.4
|
||||||
minimongo@2.0.2
|
minimongo@2.0.4
|
||||||
mobile-experience@1.1.2
|
mobile-experience@1.1.2
|
||||||
mobile-status-bar@1.1.1
|
mobile-status-bar@1.1.1
|
||||||
modern-browsers@0.2.2
|
modern-browsers@0.2.3
|
||||||
modules@0.20.3
|
modules@0.20.3
|
||||||
modules-runtime@0.13.2
|
modules-runtime@0.13.2
|
||||||
modules-runtime-hot@0.14.3
|
modules-runtime-hot@0.14.3
|
||||||
mongo@2.1.2
|
mongo@2.1.4
|
||||||
mongo-decimal@0.2.0
|
mongo-decimal@0.2.0
|
||||||
mongo-dev-server@1.1.1
|
mongo-dev-server@1.1.1
|
||||||
mongo-id@1.0.9
|
mongo-id@1.0.9
|
||||||
npm-mongo@6.10.2
|
npm-mongo@6.16.1
|
||||||
observe-sequence@2.0.0
|
observe-sequence@2.0.0
|
||||||
ordered-dict@1.2.0
|
ordered-dict@1.2.0
|
||||||
ostrio:flow-router-extra@3.12.0
|
ostrio:flow-router-extra@3.12.0
|
||||||
|
|
@ -76,18 +76,18 @@ roles@1.0.1
|
||||||
routepolicy@1.1.2
|
routepolicy@1.1.2
|
||||||
session@1.2.2
|
session@1.2.2
|
||||||
sha@1.0.10
|
sha@1.0.10
|
||||||
shell-server@0.6.1
|
shell-server@0.6.2
|
||||||
socket-stream-client@0.6.1
|
socket-stream-client@0.6.1
|
||||||
spacebars@2.0.0
|
spacebars@2.0.0
|
||||||
spacebars-compiler@2.0.0
|
spacebars-compiler@2.0.0
|
||||||
standard-minifier-css@1.9.3
|
standard-minifier-css@1.9.3
|
||||||
standard-minifier-js@3.1.0
|
standard-minifier-js@3.1.1
|
||||||
templating@1.4.4
|
templating@1.4.4
|
||||||
templating-compiler@2.0.0
|
templating-compiler@2.0.0
|
||||||
templating-runtime@2.0.1
|
templating-runtime@2.0.1
|
||||||
templating-tools@2.0.0
|
templating-tools@2.0.0
|
||||||
tracker@1.3.4
|
tracker@1.3.4
|
||||||
typescript@5.6.4
|
typescript@5.6.6
|
||||||
underscore@1.6.4
|
underscore@1.6.4
|
||||||
url@1.3.5
|
url@1.3.5
|
||||||
webapp@2.0.7
|
webapp@2.0.7
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Template.cleanUpModalConfirm.events({
|
||||||
case "Menus":
|
case "Menus":
|
||||||
cleanUp("clean.Menus", whatItems);
|
cleanUp("clean.Menus", whatItems);
|
||||||
case "Products":
|
case "Products":
|
||||||
// cleanUp("clean.Products", whatItems);
|
cleanUp("clean.Products", whatItems);
|
||||||
case "Stores":
|
case "Stores":
|
||||||
// cleanUp("clean.Stores", whatItems);
|
// cleanUp("clean.Stores", whatItems);
|
||||||
case "Tasks":
|
case "Tasks":
|
||||||
|
|
@ -43,7 +43,7 @@ Template.cleanUpModalConfirm.events({
|
||||||
cleanUp = async function(methodName, whatItems) {
|
cleanUp = async function(methodName, whatItems) {
|
||||||
let result = Meteor.callAsync(methodName);
|
let result = Meteor.callAsync(methodName);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
console.log(" ERROR cleaning " + whatItems + ": " + err);
|
console.log(" ERROR cleaning " + whatItems);
|
||||||
} else {
|
} else {
|
||||||
showSnackbar(whatItems + " have been cleaned up!", "green");
|
showSnackbar(whatItems + " have been cleaned up!", "green");
|
||||||
let confirmModal = document.getElementById('cleanUpConfirm');
|
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) {
|
cleanTasks = async function(methodName, whatItems) {
|
||||||
let timeFrame = Session.get("overdueVal");
|
let timeFrame = Session.get("overdueVal");
|
||||||
let result = await Meteor.call(methodName, timeFrame);
|
let result = await Meteor.call(methodName, timeFrame);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ Template.listMgmtTbl.onRendered(function() {
|
||||||
Template.listMgmtTbl.helpers({
|
Template.listMgmtTbl.helpers({
|
||||||
lists: function() {
|
lists: function() {
|
||||||
let showComplete = Session.get("showCompletedLists");
|
let showComplete = Session.get("showCompletedLists");
|
||||||
|
// console.log("Show Complete Lists: " + showComplete);
|
||||||
if (showComplete) {
|
if (showComplete) {
|
||||||
return Lists.find({});
|
return Lists.find({});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,22 @@
|
||||||
<h4>Product Management</h4>
|
<h4>Product Management</h4>
|
||||||
{{#if Template.subscriptionsReady}}
|
{{#if Template.subscriptionsReady}}
|
||||||
<form action="submit" class="row prodInputForm" style="gap: 1em;">
|
<form action="submit" class="row prodInputForm" style="gap: 1em;">
|
||||||
<div class="col s12">
|
<div class="col l4 m6 s12">
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="showNoStoreSet" />
|
<input type="checkbox" id="showNoStoreSet" />
|
||||||
<span>Show Products without Store Assigned</span>
|
<span>Show Products without Store Assigned</span>
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col l4 m6 s12">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="showNoList" />
|
||||||
|
<span>Show Products Never Used in a List</span>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<div class="col s12 m6 l6 input-field outlined">
|
<div class="col s12 m6 l6 input-field outlined">
|
||||||
<input type="text" class="prodName" style="{{#if $eq prodNameErr true}}border: 2px solid red;{{/if}}" id="prodName" />
|
<input type="text" class="prodName" style="{{#if $eq prodNameErr true}}border: 2px solid red;{{/if}}" id="prodName" />
|
||||||
<label for="prodName">Name*</label>
|
<label for="prodName">Name*</label>
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,14 @@ Template.prodMgmtForm.events({
|
||||||
Session.set("noStoreSet", false);
|
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) {
|
'submit .prodInputForm' (event) {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
import { Products } from '../../../imports/api/products.js';
|
import { Products } from '../../../imports/api/products.js';
|
||||||
|
import { ListItems } from '../../../imports/api/listItems.js';
|
||||||
import { M } from '../../lib/assets/materialize.js';
|
import { M } from '../../lib/assets/materialize.js';
|
||||||
|
|
||||||
Template.prodMgmtTbl.onCreated(function() {
|
Template.prodMgmtTbl.onCreated(function() {
|
||||||
this.subscribe("myProducts");
|
this.subscribe("myProducts");
|
||||||
|
this.subscribe("allListItems");
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.prodMgmtTbl.onRendered(function() {
|
Template.prodMgmtTbl.onRendered(function() {
|
||||||
Session.set("searchProds", false);
|
Session.set("searchProds", false);
|
||||||
Session.set("searchStore", false);
|
Session.set("searchStore", false);
|
||||||
Session.set("noStoreSet", false);
|
Session.set("noStoreSet", false);
|
||||||
|
Session.set("noListUsed", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.prodMgmtTbl.helpers({
|
Template.prodMgmtTbl.helpers({
|
||||||
|
|
@ -16,6 +19,7 @@ Template.prodMgmtTbl.helpers({
|
||||||
let searchProd = Session.get("searchProds");
|
let searchProd = Session.get("searchProds");
|
||||||
let searchStore = Session.get("searchStore");
|
let searchStore = Session.get("searchStore");
|
||||||
let noStoreSet = Session.get("noStoreSet");
|
let noStoreSet = Session.get("noStoreSet");
|
||||||
|
let noListUsed = Session.get("noListUsed");
|
||||||
|
|
||||||
if (searchProd == true) {
|
if (searchProd == true) {
|
||||||
let searchVal = Session.get("searchVal");
|
let searchVal = Session.get("searchVal");
|
||||||
|
|
@ -33,6 +37,17 @@ Template.prodMgmtTbl.helpers({
|
||||||
}
|
}
|
||||||
} else if (noStoreSet == true) {
|
} else if (noStoreSet == true) {
|
||||||
return Products.find({ prodStore: '' }, { sort: { prodName: 1 }});
|
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++) {
|
||||||
|
idList.push(idsInLists[i].prodId);
|
||||||
|
}
|
||||||
|
if (i > idsInLists.length - 1) {
|
||||||
|
let noProdsNot = Products.find({ _id: { $nin: idList }}).count();
|
||||||
|
return Products.find({ _id: { $nin: idList }}, { sort: { prodName: 1 }});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return Products.find({}, { sort: { prodName: 1 }});
|
return Products.find({}, { sort: { prodName: 1 }});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ Template.deleteConfirmationModal.events({
|
||||||
const delItem = async() => {
|
const delItem = async() => {
|
||||||
let result = await Meteor.callAsync(method, deleteId);
|
let result = await Meteor.callAsync(method, deleteId);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// console.log(" ERROR deleting item from modal: " + err);
|
console.log(" ERROR deleting item from modal: " + err);
|
||||||
} else {
|
} else {
|
||||||
// console.log(" SUCCESSFULLY deleted.");
|
console.log(" SUCCESSFULLY deleted.");
|
||||||
// put the new modal open / close here
|
// put the new modal open / close here
|
||||||
// $('#modalDelete').modal('close');
|
// $('#modalDelete').modal('close');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<li><a href="#" id="mylists" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Lists</a></li>
|
<li><a href="#" id="mylists" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Lists</a></li>
|
||||||
<li><a href="#" id="mymenus" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Menus</a></li>
|
<li><a href="#" id="mymenus" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Menus</a></li>
|
||||||
<li><a href="#" id="myTasks" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Tasks</a></li>
|
<li><a href="#" id="myTasks" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Tasks</a></li>
|
||||||
<li><a href="#" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}" id="mySettings">My Settings</a></li>
|
<li><a href="#" id="mySettings" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Settings</a></li>
|
||||||
{{#if isInRole "systemadmin"}}
|
{{#if isInRole "systemadmin"}}
|
||||||
<li><a href="#" id="manage" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">Manage</a></li>
|
<li><a href="#" id="manage" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">Manage</a></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
<li><a href="#!" id="mylists" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Lists</a></li>
|
<li><a href="#!" id="mylists" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Lists</a></li>
|
||||||
<li><a href="#!" id="mymenus" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Menus</a></li>
|
<li><a href="#!" id="mymenus" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Menus</a></li>
|
||||||
<li><a href="#!" id="myTasks" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Tasks</a></li>
|
<li><a href="#!" id="myTasks" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Tasks</a></li>
|
||||||
<li><a href="#!" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}" id="mySettings">My Settings</a></li>
|
<li><a href="#!" id="mySettings" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">My Settings</a></li>
|
||||||
{{#if isInRole 'systemadmin'}}
|
{{#if isInRole 'systemadmin'}}
|
||||||
<li><a href="#!" id="manage" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">Manage</a></li>
|
<li><a href="#!" id="manage" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}">Manage</a></li>
|
||||||
{{#if $eq updateExists true}}
|
{{#if $eq updateExists true}}
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,15 @@ Template.listItemsTbl.events({
|
||||||
},
|
},
|
||||||
'click .markListItemReceived' (event) {
|
'click .markListItemReceived' (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
Meteor.call('setReceived.listItem', this._id, function(err, result) {
|
const setRcvd = async() => {
|
||||||
if (err) {
|
let result = await Meteor.callAsync('setReceived.listItem', this._id);
|
||||||
// console.log(" ERROR setting item as received: " + err);
|
if (!result) {
|
||||||
|
// console.log("Item not marked properly - why?");
|
||||||
} else {
|
} else {
|
||||||
// console.log(" SUCCESS setting item received.");
|
// console.log("Item Marked Received.");
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
setRcvd();
|
||||||
},
|
},
|
||||||
'click .deleteListItem' (event) {
|
'click .deleteListItem' (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,29 @@ Template.modalLinkProducts.onRendered(function() {
|
||||||
dropdownOptions: 4,
|
dropdownOptions: 4,
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
this.autorun(() => {
|
||||||
var instances = M.Modal.init(elems, {});
|
if (this.subscriptionsReady()) {
|
||||||
var instancese = M.FormSelect.init(elemse, {
|
// setTimeout(function() {
|
||||||
dropdownOptions: 4,
|
// var instances = M.Modal.init(elems, {});
|
||||||
});
|
var elemse = document.querySelectorAll('select');
|
||||||
}, 250);
|
var instancese = M.FormSelect.init(elemse, {
|
||||||
|
dropdownOptions: 4,
|
||||||
|
});
|
||||||
|
// }, 250);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.modalLinkProducts.helpers({
|
Template.modalLinkProducts.helpers({
|
||||||
products: function() {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.');
|
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 = [];
|
return await Menus.removeAsync({ menuComplete: true });
|
||||||
|
|
||||||
|
|
||||||
// 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] });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async 'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) {
|
async 'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) {
|
||||||
check(menuId, String);
|
check(menuId, String);
|
||||||
|
|
|
||||||
|
|
@ -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.');
|
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 }, {
|
return await MenuProdLinks.updateAsync({ menuItemId: menuItemId }, {
|
||||||
$set: {
|
$set: {
|
||||||
products: prodNameArray,
|
products: prodNameArray,
|
||||||
|
|
|
||||||
|
|
@ -63,5 +63,15 @@ Meteor.methods({
|
||||||
}
|
}
|
||||||
|
|
||||||
return await Products.removeAsync({ _id: prodId });
|
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
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
100
package-lock.json
generated
100
package-lock.json
generated
|
|
@ -16,9 +16,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime": {
|
"node_modules/@babel/runtime": {
|
||||||
"version": "7.27.6",
|
"version": "7.28.4",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
|
||||||
"integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==",
|
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
|
|
@ -109,9 +109,9 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/meteor-node-stubs": {
|
"node_modules/meteor-node-stubs": {
|
||||||
"version": "1.2.19",
|
"version": "1.2.24",
|
||||||
"resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.19.tgz",
|
"resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.24.tgz",
|
||||||
"integrity": "sha512-lryhEAPp7aysrC0j3XU1yTs92ktPQQhzQzLVz3OGQEZjL//iLhvJyeYNSvV01XJn6fXUXe48agossxniJkzYOQ==",
|
"integrity": "sha512-tw9QzDFVOI5A5CcEw4tTD6CjF+Lk14uzhy2gWH5ImoH4mx4pyPVcha9MmyVur+rEVgpzk+aMG6rs3RxAF9SwiA==",
|
||||||
"bundleDependencies": [
|
"bundleDependencies": [
|
||||||
"@meteorjs/crypto-browserify",
|
"@meteorjs/crypto-browserify",
|
||||||
"assert",
|
"assert",
|
||||||
|
|
@ -154,6 +154,7 @@
|
||||||
"punycode": "^1.4.1",
|
"punycode": "^1.4.1",
|
||||||
"querystring-es3": "^0.2.1",
|
"querystring-es3": "^0.2.1",
|
||||||
"readable-stream": "^3.6.2",
|
"readable-stream": "^3.6.2",
|
||||||
|
"sha.js": "^2.4.12",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"stream-http": "^3.2.0",
|
"stream-http": "^3.2.0",
|
||||||
"string_decoder": "^1.3.0",
|
"string_decoder": "^1.3.0",
|
||||||
|
|
@ -188,6 +189,11 @@
|
||||||
"node": ">= 0.12"
|
"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": {
|
"node_modules/meteor-node-stubs/node_modules/@meteorjs/browserify-sign/node_modules/readable-stream": {
|
||||||
"version": "2.3.8",
|
"version": "2.3.8",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
|
|
@ -906,7 +912,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/meteor-node-stubs/node_modules/isarray": {
|
"node_modules/meteor-node-stubs/node_modules/isarray": {
|
||||||
"version": "1.0.0",
|
"version": "2.0.5",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
|
@ -1040,20 +1046,49 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/meteor-node-stubs/node_modules/pbkdf2": {
|
"node_modules/meteor-node-stubs/node_modules/pbkdf2": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.3",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"create-hash": "^1.1.2",
|
"create-hash": "~1.1.3",
|
||||||
"create-hmac": "^1.1.4",
|
"create-hmac": "^1.1.7",
|
||||||
"ripemd160": "^2.0.1",
|
"ripemd160": "=2.0.1",
|
||||||
"safe-buffer": "^5.0.1",
|
"safe-buffer": "^5.2.1",
|
||||||
"sha.js": "^2.4.8"
|
"sha.js": "^2.4.11",
|
||||||
|
"to-buffer": "^1.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12"
|
"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": {
|
"node_modules/meteor-node-stubs/node_modules/possible-typed-array-names": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
|
|
@ -1215,15 +1250,22 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/meteor-node-stubs/node_modules/sha.js": {
|
"node_modules/meteor-node-stubs/node_modules/sha.js": {
|
||||||
"version": "2.4.11",
|
"version": "2.4.12",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "(MIT AND BSD-3-Clause)",
|
"license": "(MIT AND BSD-3-Clause)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.4",
|
||||||
"safe-buffer": "^5.0.1"
|
"safe-buffer": "^5.2.1",
|
||||||
|
"to-buffer": "^1.2.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"sha.js": "bin.js"
|
"sha.js": "bin.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/meteor-node-stubs/node_modules/side-channel": {
|
"node_modules/meteor-node-stubs/node_modules/side-channel": {
|
||||||
|
|
@ -1333,11 +1375,37 @@
|
||||||
"node": ">=0.6.0"
|
"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": {
|
"node_modules/meteor-node-stubs/node_modules/tty-browserify": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "MIT"
|
"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": {
|
"node_modules/meteor-node-stubs/node_modules/url": {
|
||||||
"version": "0.11.4",
|
"version": "0.11.4",
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ Meteor.publish("SystemConfig", function() {
|
||||||
|
|
||||||
Meteor.publish("UserConfigPrefs", function() {
|
Meteor.publish("UserConfigPrefs", function() {
|
||||||
try {
|
try {
|
||||||
return UserConfig.find({});
|
return UserConfig.find({ user: this.userId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(" ERROR: Error accessing user config: " + error);
|
console.log(" ERROR: Error accessing user config: " + error);
|
||||||
}
|
}
|
||||||
|
|
@ -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) {
|
Meteor.publish("myStoreListItems", function(listId) {
|
||||||
try {
|
try {
|
||||||
let stores = Store.find({});
|
let stores = Store.find({});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue