mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
Updating framework to meteor 3 and later
This commit is contained in:
parent
717994508a
commit
cca29bc591
58 changed files with 2332 additions and 1611 deletions
|
|
@ -7,6 +7,8 @@ import moment from 'moment';
|
|||
import { TaskItems } from "../../imports/api/tasks";
|
||||
import { UpdateInfo } from '../../imports/api/updateInfo.js';
|
||||
import { SysConfig } from '../../imports/api/systemConfig.js';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { M } from '../lib/assets/materialize.js';
|
||||
|
||||
Template.dashboard.onCreated(function() {
|
||||
this.subscribe("userList");
|
||||
|
|
@ -23,7 +25,10 @@ Template.dashboard.onCreated(function() {
|
|||
});
|
||||
|
||||
Template.dashboard.onRendered(function() {
|
||||
|
||||
setTimeout(function() {
|
||||
var elems = document.querySelectorAll('.collapsible');
|
||||
var instances = M.Collapsible.init(elems, {});
|
||||
}, 200);
|
||||
});
|
||||
|
||||
Template.dashboard.helpers({
|
||||
|
|
@ -61,18 +66,47 @@ Template.dashboard.helpers({
|
|||
},
|
||||
updates: function() {
|
||||
let updateAvail = UpdateInfo.find({});
|
||||
return updateAvail;
|
||||
},
|
||||
updatesExist: function() {
|
||||
let updateExists = UpdateInfo.find({ viewed: false }).fetch();
|
||||
if (updateExists.length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
try {
|
||||
if (!updateAvail) {
|
||||
console.log("No update info found.");
|
||||
return false;
|
||||
} else {
|
||||
console.dir(updateAvail);
|
||||
return updateAvail;
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(" ERROR trying to grab update info: " + error);
|
||||
}
|
||||
},
|
||||
updatesExist: function() {
|
||||
const ifUpdate = async() => {
|
||||
let updateExists = await UpdateInfo.findOneAsync({ viewed: false });
|
||||
if (!updateExists) {
|
||||
console.log("Update doesn't exist as false.");
|
||||
return false;
|
||||
} else {
|
||||
console.log("Update found with false.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
let updateAvail = ifUpdate();
|
||||
return updateAvail;
|
||||
},
|
||||
currConfig: function() {
|
||||
return SysConfig.findOne({});
|
||||
const getSys = async() => {
|
||||
let currSys = SysConfig.findOneAsync({});
|
||||
try {
|
||||
if (!currSys) {
|
||||
// console.log("No System Config found.")
|
||||
} else {
|
||||
return currSys;
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(" ERROR trying to fetch current system config: " + error);
|
||||
}
|
||||
}
|
||||
let currConf = getSys();
|
||||
return currConf;
|
||||
},
|
||||
descriptionSinHTML: function() {
|
||||
let desc = this.description;
|
||||
|
|
@ -141,12 +175,19 @@ Template.dashboard.events({
|
|||
'click .readLink' (event) {
|
||||
let eventId = event.currentTarget.id;
|
||||
|
||||
Meteor.call('markUpdate.read', eventId, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR marking update as 'read': " + err);
|
||||
} else {
|
||||
console.log("marked read successfully!");
|
||||
const markUpdate = async() => {
|
||||
let result = await Meteor.callAsync('markUpdate.read', eventId);
|
||||
try {
|
||||
if (!result) {
|
||||
console.log(" Error marking this read.");
|
||||
showSnackbar("Error Marking Read!", "red");
|
||||
} else {
|
||||
showSnackbar("Successfully Marked as Read.", "green");
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(" ERROR trying to mark this update as read: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
markUpdate();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue