json-object-editor 0.10.120 → 0.10.201
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/CHANGELOG.md +7 -0
- package/grunt/package-lock.json +9105 -9105
- package/js/JsonObjectEditor.jquery.craydent.js +11 -1
- package/js/joe-full.js +11 -1
- package/js/joe.js +11 -1
- package/js/libs/craydent-1.8.1.js +2 -1
- package/package.json +1 -1
- package/server/fields/core.js +40 -0
- package/server/modules/Cache.js +2 -2
- package/server/modules/Server.js +3 -2
- package/server/modules/Utils.js +11 -1
- package/server/plugins/memberRegistry.js +60 -1
- package/server/schemas/recipe.js +5 -1
|
@@ -3385,6 +3385,9 @@ this.renderHTMLContent = function(specs){
|
|
|
3385
3385
|
break;*/
|
|
3386
3386
|
case 'passthrough':
|
|
3387
3387
|
html+= self.renderPassthroughField(prop);
|
|
3388
|
+
break;
|
|
3389
|
+
case 'userfavorite':
|
|
3390
|
+
html+= self.renderUserFavoriteField(prop);
|
|
3388
3391
|
break;
|
|
3389
3392
|
default:
|
|
3390
3393
|
if(self.Fields[proptype] && self.Fields[proptype].render){
|
|
@@ -4065,7 +4068,13 @@ this.renderHTMLContent = function(specs){
|
|
|
4065
4068
|
return html;
|
|
4066
4069
|
};
|
|
4067
4070
|
encapsulateFieldType('guid',self.renderGuidField);
|
|
4068
|
-
|
|
4071
|
+
/*----------------------------->
|
|
4072
|
+
F.2 | UserFavorite
|
|
4073
|
+
<-----------------------------*/
|
|
4074
|
+
this.renderUserFavoriteField = function(prop){
|
|
4075
|
+
var html= 'user favorite';
|
|
4076
|
+
return html;
|
|
4077
|
+
};
|
|
4069
4078
|
/*----------------------------->
|
|
4070
4079
|
G | Guid
|
|
4071
4080
|
<-----------------------------*/
|
|
@@ -10240,6 +10249,7 @@ logit(intent)
|
|
|
10240
10249
|
<--------------------------------------------------------------------*/
|
|
10241
10250
|
this.SVG = {
|
|
10242
10251
|
icon:{
|
|
10252
|
+
'favorite':'<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 2h16a1 1 0 0 1 1 1v19.276a.5.5 0 0 1-.704.457L12 19.03l-8.296 3.702A.5.5 0 0 1 3 22.276V3a1 1 0 0 1 1-1zm8 11.5l2.939 1.545-.561-3.272 2.377-2.318-3.286-.478L12 6l-1.47 2.977-3.285.478 2.377 2.318-.56 3.272L12 13.5z"/></svg>',
|
|
10243
10253
|
'left':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M11.3 21C7.1 18.2 3.3 13.8 3.2 13.6 3.1 13.5 3 13.2 3 13 3 12.8 3.1 12.5 3.2 12.3 3.3 12.1 7.2 7.7 11.3 4.9 11.6 4.7 12 4.7 12.4 4.8 12.8 5.1 13 5.4 13 5.8L13 9.5C13 9.5 21.7 10 22.1 10.3 22.7 10.7 23 12 23 13 23 14.1 22.6 15.2 22.1 15.6 21.7 15.9 13 16.5 13 16.5L13 20.2C13 20.6 12.8 20.9 12.4 21.1 12.1 21.3 11.7 21.2 11.3 21Z"/></svg>',
|
|
10244
10254
|
'cancel':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M13 0.2C5.9 0.2 0.2 5.9 0.2 13 0.2 20.1 5.9 25.8 13 25.8 20.1 25.8 25.8 20.1 25.8 13 25.8 5.9 20.1 0.2 13 0.2ZM18.8 17.4L17.4 18.8C17.1 19 16.7 19 16.5 18.8L13 15.3 9.5 18.8C9.3 19 8.9 19 8.6 18.8L7.2 17.4C7 17.1 7 16.7 7.2 16.5L10.7 13 7.2 9.5C7 9.3 7 8.9 7.2 8.6L8.6 7.2C8.9 7 9.3 7 9.5 7.2L13 10.7 16.5 7.2C16.7 7 17.1 7 17.4 7.2L18.8 8.6C19 8.9 19 9.3 18.8 9.5L15.3 13 18.8 16.5C19 16.7 19 17.1 18.8 17.4Z"/></svg>',
|
|
10245
10255
|
close:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 44 44"><path d="M26 22.3L22.3 26c0 0-5.9-6.3-6.3-6.3C15.6 19.7 9.7 26 9.7 26L6 22.3c0 0 6.3-5.8 6.3-6.3C12.3 15.5 6 9.7 6 9.7l3.7-3.7c0 0 5.9 6.3 6.3 6.3 0.4 0 6.3-6.3 6.3-6.3L26 9.7c0 0-6.3 5.9-6.3 6.3C19.7 16.4 26 22.3 26 22.3z"/></svg>',
|
package/js/joe-full.js
CHANGED
|
@@ -14689,6 +14689,9 @@ this.renderHTMLContent = function(specs){
|
|
|
14689
14689
|
break;*/
|
|
14690
14690
|
case 'passthrough':
|
|
14691
14691
|
html+= self.renderPassthroughField(prop);
|
|
14692
|
+
break;
|
|
14693
|
+
case 'userfavorite':
|
|
14694
|
+
html+= self.renderUserFavoriteField(prop);
|
|
14692
14695
|
break;
|
|
14693
14696
|
default:
|
|
14694
14697
|
if(self.Fields[proptype] && self.Fields[proptype].render){
|
|
@@ -15369,7 +15372,13 @@ this.renderHTMLContent = function(specs){
|
|
|
15369
15372
|
return html;
|
|
15370
15373
|
};
|
|
15371
15374
|
encapsulateFieldType('guid',self.renderGuidField);
|
|
15372
|
-
|
|
15375
|
+
/*----------------------------->
|
|
15376
|
+
F.2 | UserFavorite
|
|
15377
|
+
<-----------------------------*/
|
|
15378
|
+
this.renderUserFavoriteField = function(prop){
|
|
15379
|
+
var html= 'user favorite';
|
|
15380
|
+
return html;
|
|
15381
|
+
};
|
|
15373
15382
|
/*----------------------------->
|
|
15374
15383
|
G | Guid
|
|
15375
15384
|
<-----------------------------*/
|
|
@@ -21544,6 +21553,7 @@ logit(intent)
|
|
|
21544
21553
|
<--------------------------------------------------------------------*/
|
|
21545
21554
|
this.SVG = {
|
|
21546
21555
|
icon:{
|
|
21556
|
+
'favorite':'<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 2h16a1 1 0 0 1 1 1v19.276a.5.5 0 0 1-.704.457L12 19.03l-8.296 3.702A.5.5 0 0 1 3 22.276V3a1 1 0 0 1 1-1zm8 11.5l2.939 1.545-.561-3.272 2.377-2.318-3.286-.478L12 6l-1.47 2.977-3.285.478 2.377 2.318-.56 3.272L12 13.5z"/></svg>',
|
|
21547
21557
|
'left':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M11.3 21C7.1 18.2 3.3 13.8 3.2 13.6 3.1 13.5 3 13.2 3 13 3 12.8 3.1 12.5 3.2 12.3 3.3 12.1 7.2 7.7 11.3 4.9 11.6 4.7 12 4.7 12.4 4.8 12.8 5.1 13 5.4 13 5.8L13 9.5C13 9.5 21.7 10 22.1 10.3 22.7 10.7 23 12 23 13 23 14.1 22.6 15.2 22.1 15.6 21.7 15.9 13 16.5 13 16.5L13 20.2C13 20.6 12.8 20.9 12.4 21.1 12.1 21.3 11.7 21.2 11.3 21Z"/></svg>',
|
|
21548
21558
|
'cancel':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M13 0.2C5.9 0.2 0.2 5.9 0.2 13 0.2 20.1 5.9 25.8 13 25.8 20.1 25.8 25.8 20.1 25.8 13 25.8 5.9 20.1 0.2 13 0.2ZM18.8 17.4L17.4 18.8C17.1 19 16.7 19 16.5 18.8L13 15.3 9.5 18.8C9.3 19 8.9 19 8.6 18.8L7.2 17.4C7 17.1 7 16.7 7.2 16.5L10.7 13 7.2 9.5C7 9.3 7 8.9 7.2 8.6L8.6 7.2C8.9 7 9.3 7 9.5 7.2L13 10.7 16.5 7.2C16.7 7 17.1 7 17.4 7.2L18.8 8.6C19 8.9 19 9.3 18.8 9.5L15.3 13 18.8 16.5C19 16.7 19 17.1 18.8 17.4Z"/></svg>',
|
|
21549
21559
|
close:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 44 44"><path d="M26 22.3L22.3 26c0 0-5.9-6.3-6.3-6.3C15.6 19.7 9.7 26 9.7 26L6 22.3c0 0 6.3-5.8 6.3-6.3C12.3 15.5 6 9.7 6 9.7l3.7-3.7c0 0 5.9 6.3 6.3 6.3 0.4 0 6.3-6.3 6.3-6.3L26 9.7c0 0-6.3 5.9-6.3 6.3C19.7 16.4 26 22.3 26 22.3z"/></svg>',
|
package/js/joe.js
CHANGED
|
@@ -3391,6 +3391,9 @@ this.renderHTMLContent = function(specs){
|
|
|
3391
3391
|
break;*/
|
|
3392
3392
|
case 'passthrough':
|
|
3393
3393
|
html+= self.renderPassthroughField(prop);
|
|
3394
|
+
break;
|
|
3395
|
+
case 'userfavorite':
|
|
3396
|
+
html+= self.renderUserFavoriteField(prop);
|
|
3394
3397
|
break;
|
|
3395
3398
|
default:
|
|
3396
3399
|
if(self.Fields[proptype] && self.Fields[proptype].render){
|
|
@@ -4071,7 +4074,13 @@ this.renderHTMLContent = function(specs){
|
|
|
4071
4074
|
return html;
|
|
4072
4075
|
};
|
|
4073
4076
|
encapsulateFieldType('guid',self.renderGuidField);
|
|
4074
|
-
|
|
4077
|
+
/*----------------------------->
|
|
4078
|
+
F.2 | UserFavorite
|
|
4079
|
+
<-----------------------------*/
|
|
4080
|
+
this.renderUserFavoriteField = function(prop){
|
|
4081
|
+
var html= 'user favorite';
|
|
4082
|
+
return html;
|
|
4083
|
+
};
|
|
4075
4084
|
/*----------------------------->
|
|
4076
4085
|
G | Guid
|
|
4077
4086
|
<-----------------------------*/
|
|
@@ -10246,6 +10255,7 @@ logit(intent)
|
|
|
10246
10255
|
<--------------------------------------------------------------------*/
|
|
10247
10256
|
this.SVG = {
|
|
10248
10257
|
icon:{
|
|
10258
|
+
'favorite':'<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 2h16a1 1 0 0 1 1 1v19.276a.5.5 0 0 1-.704.457L12 19.03l-8.296 3.702A.5.5 0 0 1 3 22.276V3a1 1 0 0 1 1-1zm8 11.5l2.939 1.545-.561-3.272 2.377-2.318-3.286-.478L12 6l-1.47 2.977-3.285.478 2.377 2.318-.56 3.272L12 13.5z"/></svg>',
|
|
10249
10259
|
'left':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M11.3 21C7.1 18.2 3.3 13.8 3.2 13.6 3.1 13.5 3 13.2 3 13 3 12.8 3.1 12.5 3.2 12.3 3.3 12.1 7.2 7.7 11.3 4.9 11.6 4.7 12 4.7 12.4 4.8 12.8 5.1 13 5.4 13 5.8L13 9.5C13 9.5 21.7 10 22.1 10.3 22.7 10.7 23 12 23 13 23 14.1 22.6 15.2 22.1 15.6 21.7 15.9 13 16.5 13 16.5L13 20.2C13 20.6 12.8 20.9 12.4 21.1 12.1 21.3 11.7 21.2 11.3 21Z"/></svg>',
|
|
10250
10260
|
'cancel':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -5 36 36"><path d="M13 0.2C5.9 0.2 0.2 5.9 0.2 13 0.2 20.1 5.9 25.8 13 25.8 20.1 25.8 25.8 20.1 25.8 13 25.8 5.9 20.1 0.2 13 0.2ZM18.8 17.4L17.4 18.8C17.1 19 16.7 19 16.5 18.8L13 15.3 9.5 18.8C9.3 19 8.9 19 8.6 18.8L7.2 17.4C7 17.1 7 16.7 7.2 16.5L10.7 13 7.2 9.5C7 9.3 7 8.9 7.2 8.6L8.6 7.2C8.9 7 9.3 7 9.5 7.2L13 10.7 16.5 7.2C16.7 7 17.1 7 17.4 7.2L18.8 8.6C19 8.9 19 9.3 18.8 9.5L15.3 13 18.8 16.5C19 16.7 19 17.1 18.8 17.4Z"/></svg>',
|
|
10251
10261
|
close:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 44 44"><path d="M26 22.3L22.3 26c0 0-5.9-6.3-6.3-6.3C15.6 19.7 9.7 26 9.7 26L6 22.3c0 0 6.3-5.8 6.3-6.3C12.3 15.5 6 9.7 6 9.7l3.7-3.7c0 0 5.9 6.3 6.3 6.3 0.4 0 6.3-6.3 6.3-6.3L26 9.7c0 0-6.3 5.9-6.3 6.3C19.7 16.4 26 22.3 26 22.3z"/></svg>',
|
|
@@ -2533,7 +2533,8 @@ if (__thisIsNewer) {
|
|
|
2533
2533
|
error('Queue', e);
|
|
2534
2534
|
}
|
|
2535
2535
|
}
|
|
2536
|
-
function Set (records) {
|
|
2536
|
+
/*function Set (records) {*/
|
|
2537
|
+
window.Set = function(records) {
|
|
2537
2538
|
/*|{
|
|
2538
2539
|
"info": "Collection class that filters out duplicate values",
|
|
2539
2540
|
"category": "Global",
|
package/package.json
CHANGED
package/server/fields/core.js
CHANGED
|
@@ -405,6 +405,46 @@ var fields = {
|
|
|
405
405
|
icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -4 36 36"><path d="M12 1C8.7 1 6 3.7 6 7L6 8C4.9 8 4 8.9 4 10L4 20C4 21.1 4.9 22 6 22L18 22C19.1 22 20 21.1 20 20L20 10C20 8.9 19.1 8 18 8L18 7C18 3.7 15.3 1 12 1ZM12 3C14.3 3 16 4.7 16 7L16 8 8 8 8 7C8 4.7 9.7 3 12 3ZM12 13C13.1 13 14 13.9 14 15 14 16.1 13.1 17 12 17 10.9 17 10 16.1 10 15 10 13.9 10.9 13 12 13Z"/></svg>',
|
|
406
406
|
label:'users must be logged in to view this item and reports'
|
|
407
407
|
},
|
|
408
|
+
favorite:{
|
|
409
|
+
type:'boolean',
|
|
410
|
+
byUser:true,
|
|
411
|
+
display:'favorite',
|
|
412
|
+
icon:'<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 2h16a1 1 0 0 1 1 1v19.276a.5.5 0 0 1-.704.457L12 19.03l-8.296 3.702A.5.5 0 0 1 3 22.276V3a1 1 0 0 1 1-1zm8 11.5l2.939 1.545-.561-3.272 2.377-2.318-3.286-.478L12 6l-1.47 2.977-3.285.478 2.377 2.318-.56 3.272L12 13.5z"/></svg>',
|
|
413
|
+
label:'one of your favorites',
|
|
414
|
+
hidelabel:true
|
|
415
|
+
},
|
|
416
|
+
// favorite:{
|
|
417
|
+
// type:'userfavorite',
|
|
418
|
+
// display:'favorite',
|
|
419
|
+
// icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -4 36 36"><path d="M12 1C8.7 1 6 3.7 6 7L6 8C4.9 8 4 8.9 4 10L4 20C4 21.1 4.9 22 6 22L18 22C19.1 22 20 21.1 20 20L20 10C20 8.9 19.1 8 18 8L18 7C18 3.7 15.3 1 12 1ZM12 3C14.3 3 16 4.7 16 7L16 8 8 8 8 7C8 4.7 9.7 3 12 3ZM12 13C13.1 13 14 13.9 14 15 14 16.1 13.1 17 12 17 10.9 17 10 16.1 10 15 10 13.9 10.9 13 12 13Z"/></svg>',
|
|
420
|
+
// label:'items that have been favorited'
|
|
421
|
+
// },
|
|
422
|
+
// favorite:{
|
|
423
|
+
// type:'objectReference',values:'user',icon:'user',
|
|
424
|
+
// after:function(item){
|
|
425
|
+
// var action = `_joe.getField('members').methods.addUser('${_joe.User._id}');`;
|
|
426
|
+
// var template = `<joe-button class="joe-button joe-svg-button joe-orangegrey-button joe-svg-button" onclick="${action}">
|
|
427
|
+
// favorite this
|
|
428
|
+
// </joe-button>`;
|
|
429
|
+
// return template;
|
|
430
|
+
// },
|
|
431
|
+
// disabled:true,
|
|
432
|
+
// template:'<joe-subtext>${name}</joe-subtext><joe-title>${fullname}</joe-title><joe-subtext>${info}</joe-subtext>',
|
|
433
|
+
// autocomplete_template:'<joe-title>${name}</joe-title><joe-subtitle>${fullname}</joe-subtitle>',
|
|
434
|
+
// reference_specs:{stripecolor:'${color}'},
|
|
435
|
+
// methods:{
|
|
436
|
+
// toggleFavorite:function(userid){
|
|
437
|
+
|
|
438
|
+
// },
|
|
439
|
+
// addUser:function(userid,goto){
|
|
440
|
+
// var current = _jco(true);
|
|
441
|
+
// if(current.favorite.indexOf(userid) == -1){
|
|
442
|
+
// current.favorite.push(userid);
|
|
443
|
+
// _joe.Fields.rerender('members',{members:current.members});
|
|
444
|
+
// }
|
|
445
|
+
// }
|
|
446
|
+
// }
|
|
447
|
+
// },
|
|
408
448
|
references:{
|
|
409
449
|
display:'related joe items',
|
|
410
450
|
type:'objectReference',
|
package/server/modules/Cache.js
CHANGED
|
@@ -68,8 +68,8 @@ function Cache(updateNow) {
|
|
|
68
68
|
//gets a search query and finds within all items
|
|
69
69
|
//TODO: cache queries
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
// var results = self.list.where(query);
|
|
72
|
+
// logit(query,results);
|
|
73
73
|
return self.list.where(query);
|
|
74
74
|
}
|
|
75
75
|
this.findByID = function(collection,id,specs,returnProp){
|
package/server/modules/Server.js
CHANGED
|
@@ -183,8 +183,8 @@ function cleanPayload(results){
|
|
|
183
183
|
})
|
|
184
184
|
return results;
|
|
185
185
|
}
|
|
186
|
-
//ITEM QUERY
|
|
187
|
-
server.get(['/API/item/:collection/:
|
|
186
|
+
//ITEM QUERY - secured, preferred
|
|
187
|
+
server.get(['/API/item/:collection/fields/:fields','/API/item/:collection/:key/:value','/API/item/:collection'],auth,function(req,res,next){
|
|
188
188
|
var st = new Date().getTime();
|
|
189
189
|
var collection = req.params.collection || req.query.collection;
|
|
190
190
|
var key = req.params.key || req.query.key;
|
|
@@ -215,6 +215,7 @@ server.get(['/API/item/:collection/:key/:value','/API/item/:collection','/API/it
|
|
|
215
215
|
// })
|
|
216
216
|
payload.item = JOE.Utils.ProjectedItemsFromFields(fields,payload.item);
|
|
217
217
|
}
|
|
218
|
+
payload.item = cleanPayload(payload.item);
|
|
218
219
|
payload.elapsed = new Date().getTime() - st;
|
|
219
220
|
res.jsonp(payload);
|
|
220
221
|
});
|
package/server/modules/Utils.js
CHANGED
|
@@ -132,7 +132,7 @@ var utils = function(){
|
|
|
132
132
|
return m.exports;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
this.ProjectedItemsFromFields = function(fields,data){
|
|
135
|
+
this.ProjectedItemsFromFields = function(fields,data,makeSet){
|
|
136
136
|
fields = fields.split(',');
|
|
137
137
|
var finalItems = [];
|
|
138
138
|
data.map(item=>{
|
|
@@ -162,6 +162,16 @@ var utils = function(){
|
|
|
162
162
|
})
|
|
163
163
|
finalItems.push(copy);
|
|
164
164
|
});
|
|
165
|
+
if(makeSet){
|
|
166
|
+
var items = [];
|
|
167
|
+
let template = (typeof makeSet == "string" && makeSet)||fields.map(f=>{return '${'+f+'}'}).join('_');
|
|
168
|
+
finalItems.map(fi=>{
|
|
169
|
+
//get template or use fields with _
|
|
170
|
+
items.push($c.fillTemplate(template,fi).trim().toLowerCase())
|
|
171
|
+
})
|
|
172
|
+
items = Array.from(new Set(items));
|
|
173
|
+
return items;
|
|
174
|
+
}
|
|
165
175
|
return finalItems;
|
|
166
176
|
}
|
|
167
177
|
|
|
@@ -17,6 +17,9 @@ function MemberRegisty(){
|
|
|
17
17
|
this.search = function(data,req){
|
|
18
18
|
var query = data.query || {};
|
|
19
19
|
var sortby = data.sortby || 'name';
|
|
20
|
+
var fields = data.fields || null;
|
|
21
|
+
var makeSet = data.makeSet || false;
|
|
22
|
+
if(makeSet === "true"){makeSet = true;}
|
|
20
23
|
try{
|
|
21
24
|
if(typeof query != 'object'){
|
|
22
25
|
query = eval('('+query+')');
|
|
@@ -27,14 +30,70 @@ function MemberRegisty(){
|
|
|
27
30
|
data:data,
|
|
28
31
|
//reqQ:req.query,
|
|
29
32
|
query:query,
|
|
33
|
+
count:members.length,
|
|
30
34
|
members:members
|
|
31
35
|
}
|
|
36
|
+
if(fields){
|
|
37
|
+
payload.members = JOE.Utils.ProjectedItemsFromFields(fields,payload.members,makeSet);
|
|
38
|
+
return payload;
|
|
39
|
+
}
|
|
32
40
|
return payload;
|
|
33
41
|
}catch(e){
|
|
34
|
-
return {errors:'plugin error: '+e,failedat:'plugin'};
|
|
42
|
+
return {errors:'plugin error: '+e,failedat:'plugin',e:e};
|
|
35
43
|
}
|
|
36
44
|
};
|
|
45
|
+
var state_lookups = {
|
|
46
|
+
'nm':'NM',
|
|
47
|
+
'new mexico':'NM',
|
|
48
|
+
|
|
49
|
+
'tx':'TX',
|
|
50
|
+
'texas':'TX',
|
|
51
|
+
|
|
52
|
+
'az':'AZ',
|
|
53
|
+
'arizona':'AZ',
|
|
54
|
+
'colorado':'CO'
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
this.getLocationList = function(data,req){
|
|
59
|
+
try{
|
|
60
|
+
var llQuery = {
|
|
61
|
+
"active": {"$in": [true,"true"]},
|
|
62
|
+
"profession.0": {
|
|
63
|
+
"$exists": true
|
|
64
|
+
},
|
|
65
|
+
itemtype:'member'
|
|
66
|
+
};
|
|
67
|
+
var members = JOE.Cache.list.where(llQuery)
|
|
68
|
+
var loqs = {}
|
|
69
|
+
members.map(m=>{
|
|
70
|
+
if(!m.state){return;}
|
|
71
|
+
let stname = state_lookups[m.state.trim().toLowerCase()] || m.state;
|
|
72
|
+
//get state, add to obj
|
|
73
|
+
loqs[stname] = loqs[stname] ||{cities:[]};
|
|
74
|
+
loqs[stname].cities.push(m.city.trim().toLowerCase());
|
|
75
|
+
});
|
|
76
|
+
Object.keys(loqs).map(ck=>{
|
|
77
|
+
loqs[ck].cities = Array.from(new Set(loqs[ck].cities)).sort();
|
|
78
|
+
loqs[ck].count = loqs[ck].cities.length;
|
|
79
|
+
})
|
|
80
|
+
//var loqs = JOE.Utils.ProjectedItemsFromFields('city',members,true).sort();
|
|
81
|
+
//JOE.Data.member.where(query)
|
|
82
|
+
var payload = {
|
|
83
|
+
data:data,
|
|
84
|
+
//reqQ:req.query,
|
|
85
|
+
query:llQuery,
|
|
86
|
+
count:loqs.length,
|
|
87
|
+
//members:members,
|
|
88
|
+
loqs
|
|
89
|
+
}
|
|
37
90
|
|
|
91
|
+
return payload;
|
|
92
|
+
}catch(e){
|
|
93
|
+
return {errors:'plugin error: '+e,failedat:'plugin',e:e};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
38
97
|
this.update = function(data,req,res){
|
|
39
98
|
try{
|
|
40
99
|
var updates = data.updates;
|
package/server/schemas/recipe.js
CHANGED
|
@@ -9,7 +9,8 @@ var schema = {
|
|
|
9
9
|
<joe-subtitle>${(i.info && i.info+' -')|| ''} ${((i.ingredients||[]).length)} ingredient(s) </joe-subtitle>`;},
|
|
10
10
|
listWindowTitle: 'Recipes'
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
checkbox:{prop:'family_favorite'},
|
|
13
|
+
sorter:['name','mealtype','family_favorite','created'],
|
|
13
14
|
menuicon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-8 -8 80 80"><rect x="16.2" y="43.3" width="30.1" height="2.3"/><rect x="16.2" y="49.3" width="30.1" height="2.3"/><path d="M9.5 1.9v60.1h45.1V1.9H9.5zM51.5 59.1H12.5V4.9h39.1V59.1z"/><path d="M31 10c-7.7 0-14 6.3-14 14s6.3 14 14 14 14-6.3 14-14S38.7 10 31 10zM29.2 24c0 1.2 0.7 4 0.7 6.7s-1 3.4-1.7 3.4c-0.7 0-1.7-0.5-1.7-3.4s0.7-5.5 0.7-6.7 -2.4-0.8-2.4-3.9c0-2.8 0.4-5.6 0.4-5.6s0.3-0.3 1.2-0.4v5.5c0 0.3 0.2 0.6 0.6 0.6s0.6-0.2 0.6-0.6V14v-0.1c0.1 0 0.3 0 0.4 0 0.2 0 0.4 0 0.7 0 0 0.1 0 0.1 0 0.1v5.5c0 0.3 0.2 0.6 0.6 0.6s0.6-0.2 0.6-0.6v-5.4c0.8 0.2 1.2 0.4 1.2 0.4s0.5 3.8 0.5 5.6C31.6 23.3 29.2 22.8 29.2 24zM36 30.2c0 1.7-0.3 3.9-1.1 3.9 -0.8 0-1.1-1.2-1.1-3.9 0-1.8 0-16.2 0-16.2 2.9 1.4 3.4 4.4 3.4 5.8 0 2.5-1.7 4.5-1.7 6.2C35.5 26.9 36 27.9 36 30.2z"/></svg>',
|
|
14
15
|
subsets:function(){
|
|
15
16
|
var subs = [];
|
|
@@ -45,6 +46,9 @@ var schema = {
|
|
|
45
46
|
'updated',
|
|
46
47
|
'reports',
|
|
47
48
|
'tags',
|
|
49
|
+
{name:'family_favorite',type:'boolean',display:"FAMILY FAVORITE", label:'will show up as option for tasker'},
|
|
50
|
+
|
|
51
|
+
/*'favorite',*/
|
|
48
52
|
{sidebar_end:'right'},
|
|
49
53
|
|
|
50
54
|
{section_start:'system',collapsed:true},
|