mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +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
|
|
@ -22,14 +22,16 @@ Template.deleteConfirmationModal.events({
|
|||
let deleteId = Session.get("deleteId");
|
||||
let method = Session.get("method");
|
||||
|
||||
Meteor.call(method, deleteId, function(err, result) {
|
||||
if (err) {
|
||||
const delItem = async() => {
|
||||
let result = await Meteor.callAsync(method, deleteId);
|
||||
if (!result) {
|
||||
console.log(" ERROR deleting item from modal: " + err);
|
||||
} else {
|
||||
console.log(" SUCCESSFULLY deleted.");
|
||||
// put the new modal open / close here
|
||||
// $('#modalDelete').modal('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
delItem();
|
||||
},
|
||||
});
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<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="#" class="navBtn {{#if $eq myTheme 'dark'}}white-text{{/if}}" id="mySettings">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>
|
||||
{{/if}}
|
||||
<li class="signOut {{#if $eq myTheme 'dark'}}white-text{{/if}}"><a href="#" class="signOut">Log Out</a></li>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,38 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { M } from '../lib/assets/materialize';
|
||||
import { UpdateInfo } from '../../imports/api/updateInfo.js';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { Roles } from 'meteor/roles';
|
||||
|
||||
Template.headerBar.onCreated(function() {
|
||||
this.subscribe("UpdateVersion");
|
||||
this.subscribe("assignment");
|
||||
});
|
||||
|
||||
Template.headerBar.onRendered(function() {
|
||||
var elems = document.querySelectorAll('.sidenav');
|
||||
var instances = M.Sidenav.init(elems, {});
|
||||
var elemd = document.querySelectorAll('.dropdown-trigger');
|
||||
var instances = M.Dropdown.init(elemd, {});
|
||||
var instances = M.Dropdown.init(elemd, {});
|
||||
|
||||
setTimeout(function() {
|
||||
const getRoles = async() => {
|
||||
let userId = Meteor.userId();
|
||||
// let isRole = await Roles.userIsInRoleAsync(userId, "systemadmin");
|
||||
let isRole = await Roles.getRolesForUserAsync(userId);
|
||||
try {
|
||||
if (!isRole) {
|
||||
console.log("SystemAdmin role for user not found: " + isRole);;
|
||||
} else {
|
||||
console.log("Found role for the user: ");
|
||||
console.dir(isRole);
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(" ERROR getting role for user: " + error);
|
||||
}
|
||||
}
|
||||
getRoles();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Template.headerBar.helpers({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue