Moving the namespace and some functions from user-management to user package
This commit is contained in:
1 parent
65ee016efc
commit
08fc0100f8
11 files changed
+20
-14
No files matched your search
@@ -1,2 +1,3 @@
|
||||
import './components';
|
||||
import './lib';
|
||||
import './routes';
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.user.getName = () => {
|
||||
const user = Meteor.user();
|
||||
if (!user) return '';
|
||||
const nameSplit = Meteor.user().profile.fullName.split(' ');
|
||||
const lastName = nameSplit[nameSplit.length - 1];
|
||||
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';
|
||||
return nameSplit.join(' ');
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
import './getName';
|
||||
import './logout';
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.user.logout = () => Meteor.logout(error => {
|
||||
if (error) {
|
||||
OHIF.ui.showDialog('dialogInfo', {
|
||||
title: 'Error',
|
||||
message: error.reason
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
/*
|
||||
* Defines the base OHIF user object
|
||||
*/
|
||||
const user = {};
|
||||
|
||||
OHIF.user = user;
|
||||
|
||||
export { user };
|
||||
@@ -24,6 +24,9 @@ Package.onUse(function(api) {
|
||||
api.use('ohif:design');
|
||||
api.use('ohif:core');
|
||||
|
||||
// Main module
|
||||
api.mainModule('main.js', ['client', 'server']);
|
||||
|
||||
// Client imports
|
||||
api.addFiles('client/index.js', 'client');
|
||||
});
|
||||
Reference in new issue
Block a user