identity-admin 1.22.4 → 1.22.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.
@@ -58,7 +58,7 @@ class SchemaGenerator {
58
58
  model[field].defaultValue = schema[field].defaultValue ? schema[field].defaultValue : undefined;
59
59
  model[field].required = model[field].required ? model[field].required : schemaField.isRequired ? schemaField.isRequired : false;
60
60
  model[field].apiRoute = model[field].apiRoute ? model[field].apiRoute : schemaField.options.ref ? 'admin/' + StringUtils_1.default.lowerCaseFirstLetter(pluralize(schemaField.options.ref)) : undefined;
61
- model[field].enumValues = model[field].type === helpers_1.FieldTypes.ENUM ? schemaField.enumValues : undefined;
61
+ model[field].enumValues = (model[field].type === helpers_1.FieldTypes.ENUM || model[field].arrayType === helpers_1.FieldTypes.ENUM) ? model[field].enumValues ? model[field].enumValues : schemaField.enumValues : undefined;
62
62
  model[field].value = model[field].value ? model[field].value : translation ? translation : refCheck ? StringUtils_1.default.checkRefId(field) ? StringUtils_1.default.convertCamelCaseToWord(field.slice(0, -2)) : StringUtils_1.default.convertCamelCaseToWord(field) : StringUtils_1.default.convertCamelCaseToWord(field);
63
63
  });
64
64
  if (model.virtuals) {
@@ -189,6 +189,11 @@ export interface IFieldValue {
189
189
  * @default 'Same as schema''
190
190
  */
191
191
  type?: FieldTypes;
192
+ /**
193
+ * Specify the enum values if the field type is an enum.
194
+ * @default 'Same as schema''
195
+ */
196
+ enumValues?: string[];
192
197
  /**
193
198
  * Specify the allowed country codes.
194
199
  * @required if the type is phone number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.22.4",
3
+ "version": "1.22.6",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",