@dhyasama/totem-models 6.3.4 → 6.3.6
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/lib/Organization.js +29 -25
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -220,39 +220,39 @@ module.exports = function(mongoose, config) {
|
|
|
220
220
|
// order for standard fields only sets the order on the list page. their position is fixed on the org page deal section and edit form.
|
|
221
221
|
// order is co-mingled with order for custom fields
|
|
222
222
|
// colspan is for the number of columns the field should take up on the list page
|
|
223
|
-
//
|
|
224
|
-
//
|
|
223
|
+
// showOnFilter controls whether values are extracted and used in filtering options on list page
|
|
224
|
+
// showOnList controls if the field will be on deal list page
|
|
225
225
|
|
|
226
226
|
fundraise: {
|
|
227
227
|
active: { type: Boolean, default: true },
|
|
228
228
|
order: { type: Number, default: 99 },
|
|
229
229
|
colspan: { type: Number, default: 1 },
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
showOnFilter: { type: Boolean, default: true },
|
|
231
|
+
showOnList: { type: Boolean, default: true }
|
|
232
232
|
},
|
|
233
233
|
|
|
234
234
|
sources: {
|
|
235
235
|
active: { type: Boolean, default: true },
|
|
236
236
|
order: { type: Number, default: 99 },
|
|
237
237
|
colspan: { type: Number, default: 1 },
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
showOnFilter: { type: Boolean, default: true },
|
|
239
|
+
showOnList: { type: Boolean, default: true }
|
|
240
240
|
},
|
|
241
241
|
|
|
242
242
|
referrers: {
|
|
243
243
|
active: { type: Boolean, default: true },
|
|
244
244
|
order: { type: Number, default: 99 },
|
|
245
245
|
colspan: { type: Number, default: 1 },
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
showOnFilter: { type: Boolean, default: true },
|
|
247
|
+
showOnList: { type: Boolean, default: true }
|
|
248
248
|
},
|
|
249
249
|
|
|
250
250
|
resources: {
|
|
251
251
|
active: { type: Boolean, default: true },
|
|
252
252
|
order: { type: Number, default: 99 },
|
|
253
253
|
colspan: { type: Number, default: 1 },
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
showOnFilter: { type: Boolean, default: true },
|
|
255
|
+
showOnList: { type: Boolean, default: true }
|
|
256
256
|
},
|
|
257
257
|
|
|
258
258
|
},
|
|
@@ -297,12 +297,12 @@ module.exports = function(mongoose, config) {
|
|
|
297
297
|
// colspan is for the number of columns the field should take up on the list page
|
|
298
298
|
colspan: { type: Number, default: 1 },
|
|
299
299
|
|
|
300
|
-
//
|
|
301
|
-
|
|
300
|
+
// showOnFilter controls whether values are extracted and used in filtering options on list page
|
|
301
|
+
showOnFilter: { type: Boolean, default: true },
|
|
302
302
|
|
|
303
|
-
//
|
|
303
|
+
// showOnList controls if the field will be on deal list page
|
|
304
304
|
// fields are always shown on org pages and in edit forms
|
|
305
|
-
|
|
305
|
+
showOnList: { type: Boolean, default: true }
|
|
306
306
|
|
|
307
307
|
}
|
|
308
308
|
|
|
@@ -515,15 +515,15 @@ module.exports = function(mongoose, config) {
|
|
|
515
515
|
standardFields = standardFields || {
|
|
516
516
|
fundraise: {
|
|
517
517
|
active: false,
|
|
518
|
-
|
|
518
|
+
showOnList: false
|
|
519
519
|
},
|
|
520
520
|
sources: {
|
|
521
521
|
active: false,
|
|
522
|
-
|
|
522
|
+
showOnList: false
|
|
523
523
|
},
|
|
524
524
|
referrers: {
|
|
525
525
|
active: false,
|
|
526
|
-
|
|
526
|
+
showOnList: false
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
|
|
@@ -531,36 +531,40 @@ module.exports = function(mongoose, config) {
|
|
|
531
531
|
var result = [];
|
|
532
532
|
|
|
533
533
|
// Add the standard fields that are active
|
|
534
|
-
if (standardFields.fundraise.active && standardFields.fundraise.
|
|
534
|
+
if (standardFields.fundraise.active && standardFields.fundraise.showOnList) {
|
|
535
535
|
result.push({
|
|
536
536
|
name: 'Fundraise Amount',
|
|
537
|
-
order: standardFields.fundraise.order * 10
|
|
537
|
+
order: standardFields.fundraise.order * 10,
|
|
538
|
+
colspan: standardFields.fundraise.colspan
|
|
538
539
|
}, {
|
|
539
540
|
name: 'Fundraise Valuation',
|
|
540
541
|
order: standardFields.fundraise.order * 10 + 1
|
|
541
542
|
});
|
|
542
543
|
}
|
|
543
544
|
|
|
544
|
-
if (standardFields.sources.active && standardFields.sources.
|
|
545
|
+
if (standardFields.sources.active && standardFields.sources.showOnList) {
|
|
545
546
|
result.push({
|
|
546
547
|
name: 'Source',
|
|
547
|
-
order: standardFields.sources.order * 10
|
|
548
|
+
order: standardFields.sources.order * 10,
|
|
549
|
+
colspan: standardFields.fundraise.colspan
|
|
548
550
|
});
|
|
549
551
|
}
|
|
550
552
|
|
|
551
|
-
if (standardFields.referrers.active && standardFields.referrers.
|
|
553
|
+
if (standardFields.referrers.active && standardFields.referrers.showOnList) {
|
|
552
554
|
result.push({
|
|
553
555
|
name: 'Referrers',
|
|
554
|
-
order: standardFields.referrers.order * 10
|
|
556
|
+
order: standardFields.referrers.order * 10,
|
|
557
|
+
colspan: standardFields.fundraise.colspan
|
|
555
558
|
});
|
|
556
559
|
}
|
|
557
560
|
|
|
558
561
|
// Add the custom fields
|
|
559
562
|
_.each(customFields, function(field) {
|
|
560
|
-
if (field.display.
|
|
563
|
+
if (field.display.showOnList) {
|
|
561
564
|
result.push({
|
|
562
565
|
name: field.label,
|
|
563
|
-
order: field.display.order * 10
|
|
566
|
+
order: field.display.order * 10,
|
|
567
|
+
colspan: field.display.colspan
|
|
564
568
|
});
|
|
565
569
|
}
|
|
566
570
|
});
|