@dhyasama/totem-models 6.0.0 → 6.1.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/lib/Organization.js +23 -18
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -213,41 +213,46 @@ module.exports = function(mongoose, config) {
|
|
|
213
213
|
color: { type: String, trim: true }
|
|
214
214
|
}],
|
|
215
215
|
|
|
216
|
-
voting: {
|
|
217
|
-
active: { type: Boolean, default: false },
|
|
218
|
-
votes: [{
|
|
219
|
-
name: { type: String, trim: true },
|
|
220
|
-
value: { type: Number }
|
|
221
|
-
}]
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
sectors: {
|
|
225
|
-
active: { type: Boolean, default: false }
|
|
226
|
-
},
|
|
227
|
-
|
|
228
216
|
customFields: [{
|
|
229
217
|
|
|
230
|
-
custom: { type: Boolean },
|
|
231
|
-
|
|
232
218
|
// Data stored on deals will be accessed with this key
|
|
233
219
|
// It must follow standard js variable naming rules
|
|
234
220
|
// Whenever possible, just use the label and replace spaces with underscore
|
|
235
221
|
// Will not be displayed
|
|
236
|
-
|
|
222
|
+
// Changing it after data is in the system will make data inaccessible
|
|
223
|
+
key: { type: String, trim: true, required: true },
|
|
237
224
|
|
|
238
225
|
// User friendly text, will be displayed
|
|
239
226
|
label: { type: String, trim: true, required: true },
|
|
240
227
|
|
|
241
228
|
// Dictates the type of control rendered on form
|
|
242
229
|
// Also impacts data validation
|
|
243
|
-
type: { type: String, enum: ['Text', 'Checkbox', 'Single select', 'Multiple select'], required: true },
|
|
230
|
+
type: { type: String, enum: ['Text', 'Number', 'Tags', 'Poll', 'Checkbox', 'Single select', 'Multiple select'], required: true },
|
|
231
|
+
|
|
232
|
+
// These will be the choices in polls, single-selects and multi-selects
|
|
233
|
+
options: [{
|
|
244
234
|
|
|
245
|
-
|
|
246
|
-
|
|
235
|
+
// This is the option shown to users
|
|
236
|
+
label: { type: String, trim: true, required: true },
|
|
247
237
|
|
|
238
|
+
// This is the value that gets stored
|
|
239
|
+
value: { type: String, trim: true, required: true },
|
|
240
|
+
|
|
241
|
+
// This is used to validate and aggregate answers for polls
|
|
242
|
+
type: { type: String, enum: ['String', 'Number', 'Boolean'] }
|
|
243
|
+
|
|
244
|
+
}],
|
|
245
|
+
|
|
246
|
+
// For controlling display on web pages
|
|
248
247
|
display: {
|
|
248
|
+
|
|
249
|
+
// Sets the order to render fields
|
|
249
250
|
order: { type: Number },
|
|
251
|
+
|
|
252
|
+
// Optionally show or hide fields on deals list
|
|
253
|
+
// Fields are always shown on org pages and in edit forms
|
|
250
254
|
showOnList: { type: Boolean }
|
|
255
|
+
|
|
251
256
|
}
|
|
252
257
|
|
|
253
258
|
}]
|