@dhyasama/totem-models 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +14 -0
- package/lib/Interaction.js +14 -0
- package/lib/Organization.js +9 -9
- package/package-lock.json +1163 -0
- package/package.json +1 -1
- package/test/Interaction.js +162 -0
package/.npmignore
ADDED
package/lib/Interaction.js
CHANGED
|
@@ -84,6 +84,9 @@ module.exports = function(mongoose, config) {
|
|
|
84
84
|
|
|
85
85
|
Interaction.statics.getForPeople = function getForPeople(personIds, options, cb) {
|
|
86
86
|
|
|
87
|
+
// This filters by customer so is NOT usable by admin tools
|
|
88
|
+
if (config.CUSTOMER_ID == 'GLOBAL_PROCESS') return cb(new Error('Access denied. Use getForPeopleLite.'), null);
|
|
89
|
+
|
|
87
90
|
var self = this;
|
|
88
91
|
|
|
89
92
|
options.limit = options.limit || -1;
|
|
@@ -128,6 +131,17 @@ module.exports = function(mongoose, config) {
|
|
|
128
131
|
|
|
129
132
|
};
|
|
130
133
|
|
|
134
|
+
Interaction.statics.getForPeopleLite = function getForPeopleLite(personIds, cb) {
|
|
135
|
+
|
|
136
|
+
// This doesn't filter by customer so is only usable by admin tools
|
|
137
|
+
if (config.CUSTOMER_ID != 'GLOBAL_PROCESS') return cb(new Error('Access denied'), null);
|
|
138
|
+
|
|
139
|
+
var self = this;
|
|
140
|
+
var query = self.find({'attendees.external': { $in : personIds }});
|
|
141
|
+
query.exec(cb);
|
|
142
|
+
|
|
143
|
+
};
|
|
144
|
+
|
|
131
145
|
Interaction.statics.getNotes = function getNotes(personIds, options, cb) {
|
|
132
146
|
|
|
133
147
|
var self = this;
|
package/lib/Organization.js
CHANGED
|
@@ -302,12 +302,12 @@ module.exports = function(mongoose, config) {
|
|
|
302
302
|
|
|
303
303
|
_.each(self.people, function(p) {
|
|
304
304
|
var boardRole = p.board;
|
|
305
|
-
if (p.person && boardRole && boardRole != 'none') members.push(p
|
|
305
|
+
if (p.person && boardRole && boardRole != 'none') members.push(p);
|
|
306
306
|
});
|
|
307
307
|
|
|
308
308
|
members = _.sortBy(members, function(member) {
|
|
309
|
-
if (!member || !member.name) return null;
|
|
310
|
-
return member.name.last + member.name.first;
|
|
309
|
+
if (!member || !member.person || !member.person.name) return null;
|
|
310
|
+
return member.person.name.last + member.person.name.first;
|
|
311
311
|
});
|
|
312
312
|
|
|
313
313
|
return members;
|
|
@@ -321,12 +321,12 @@ module.exports = function(mongoose, config) {
|
|
|
321
321
|
|
|
322
322
|
_.each(self.people, function(p) {
|
|
323
323
|
var boardRole = p.board;
|
|
324
|
-
if (p.person && p.current && boardRole && boardRole != 'none') members.push(p
|
|
324
|
+
if (p.person && p.current && boardRole && boardRole != 'none') members.push(p);
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
members = _.sortBy(members, function(member) {
|
|
328
|
-
if (!member || !member.name) return null;
|
|
329
|
-
return member.name.last + member.name.first;
|
|
328
|
+
if (!member || !member.person || !member.name) return null;
|
|
329
|
+
return member.person.name.last + member.person.name.first;
|
|
330
330
|
});
|
|
331
331
|
|
|
332
332
|
return members;
|
|
@@ -340,12 +340,12 @@ module.exports = function(mongoose, config) {
|
|
|
340
340
|
|
|
341
341
|
_.each(self.people, function(p) {
|
|
342
342
|
var boardRole = p.board;
|
|
343
|
-
if (p.person && !p.current && boardRole && boardRole != 'none') members.push(p
|
|
343
|
+
if (p.person && !p.current && boardRole && boardRole != 'none') members.push(p);
|
|
344
344
|
});
|
|
345
345
|
|
|
346
346
|
members = _.sortBy(members, function(member) {
|
|
347
|
-
if (!member || !member.name) return null;
|
|
348
|
-
return member.name.last + member.name.first;
|
|
347
|
+
if (!member || !member.person || !member.name) return null;
|
|
348
|
+
return member.person.name.last + member.person.name.first;
|
|
349
349
|
});
|
|
350
350
|
|
|
351
351
|
return members;
|