@solidstarters/solid-core-ui 1.1.5 → 1.1.7

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.
Files changed (157) hide show
  1. package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
  2. package/dist/components/auth/SolidChangeForcePassword.js +7 -7
  3. package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
  4. package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
  5. package/dist/components/auth/SolidForgotPassword.js +9 -4
  6. package/dist/components/auth/SolidForgotPassword.js.map +1 -1
  7. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  8. package/dist/components/auth/SolidLogin.js +14 -7
  9. package/dist/components/auth/SolidLogin.js.map +1 -1
  10. package/dist/components/common/BackButton.d.ts +2 -0
  11. package/dist/components/common/BackButton.d.ts.map +1 -0
  12. package/dist/components/common/BackButton.js +17 -0
  13. package/dist/components/common/BackButton.js.map +1 -0
  14. package/dist/components/common/CancelButton.js +2 -2
  15. package/dist/components/common/CancelButton.js.map +1 -1
  16. package/dist/components/common/DropzonePlaceholder.d.ts.map +1 -1
  17. package/dist/components/common/DropzonePlaceholder.js +2 -1
  18. package/dist/components/common/DropzonePlaceholder.js.map +1 -1
  19. package/dist/components/common/FileReaderExt.d.ts +4 -0
  20. package/dist/components/common/FileReaderExt.d.ts.map +1 -0
  21. package/dist/components/common/FileReaderExt.js +15 -0
  22. package/dist/components/common/FileReaderExt.js.map +1 -0
  23. package/dist/components/common/GeneralSettings.d.ts +4 -0
  24. package/dist/components/common/GeneralSettings.d.ts.map +1 -0
  25. package/dist/components/common/GeneralSettings.js +139 -0
  26. package/dist/components/common/GeneralSettings.js.map +1 -0
  27. package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
  28. package/dist/components/common/SingleSelectAutoCompleteField.js +1 -1
  29. package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
  30. package/dist/components/common/SocialMediaLogin.js +1 -1
  31. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  32. package/dist/components/common/SolidFormStepper.d.ts +2 -0
  33. package/dist/components/common/SolidFormStepper.d.ts.map +1 -0
  34. package/dist/components/common/SolidFormStepper.js +6 -0
  35. package/dist/components/common/SolidFormStepper.js.map +1 -0
  36. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  37. package/dist/components/core/form/SolidFormView.js +83 -54
  38. package/dist/components/core/form/SolidFormView.js.map +1 -1
  39. package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
  40. package/dist/components/core/form/fields/SolidBooleanField.js +4 -4
  41. package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
  42. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  43. package/dist/components/core/form/fields/SolidDateField.js +7 -7
  44. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  45. package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
  46. package/dist/components/core/form/fields/SolidDateTimeField.js +7 -7
  47. package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
  48. package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
  49. package/dist/components/core/form/fields/SolidDecimalField.js +4 -4
  50. package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
  51. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  52. package/dist/components/core/form/fields/SolidIntegerField.js +4 -4
  53. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  54. package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
  55. package/dist/components/core/form/fields/SolidJsonField.js +2 -2
  56. package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
  57. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  58. package/dist/components/core/form/fields/SolidLongTextField.js +2 -2
  59. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  60. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  61. package/dist/components/core/form/fields/SolidMediaMultipleField.js +11 -11
  62. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  63. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  64. package/dist/components/core/form/fields/SolidMediaSingleField.js +13 -13
  65. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  66. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  67. package/dist/components/core/form/fields/SolidRichTextField.js +2 -2
  68. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  69. package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
  70. package/dist/components/core/form/fields/SolidSelectionDynamicField.js +4 -4
  71. package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
  72. package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
  73. package/dist/components/core/form/fields/SolidSelectionStaticField.js +4 -4
  74. package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
  75. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  76. package/dist/components/core/form/fields/SolidShortTextField.js +2 -2
  77. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  78. package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
  79. package/dist/components/core/form/fields/SolidTimeField.js +7 -7
  80. package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
  81. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  82. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +15 -14
  83. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  84. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  85. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +2 -2
  86. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  87. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +2 -2
  88. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  89. package/dist/components/core/model/CreateModel.d.ts.map +1 -1
  90. package/dist/components/core/model/CreateModel.js +15 -11
  91. package/dist/components/core/model/CreateModel.js.map +1 -1
  92. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  93. package/dist/components/core/model/FieldMetaData.js +6 -6
  94. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  95. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  96. package/dist/components/core/model/FieldMetaDataForm.js +167 -152
  97. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  98. package/dist/components/core/model/FieldSelector.d.ts.map +1 -1
  99. package/dist/components/core/model/FieldSelector.js +1 -1
  100. package/dist/components/core/model/FieldSelector.js.map +1 -1
  101. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  102. package/dist/components/core/model/ModelMetaData.js +46 -42
  103. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  104. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  105. package/dist/components/core/module/CreateModule.js +98 -60
  106. package/dist/components/core/module/CreateModule.js.map +1 -1
  107. package/dist/components/core/users/CreateUser.d.ts.map +1 -1
  108. package/dist/components/core/users/CreateUser.js +18 -15
  109. package/dist/components/core/users/CreateUser.js.map +1 -1
  110. package/dist/index.d.ts +5 -0
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +5 -0
  113. package/dist/index.js.map +1 -1
  114. package/dist/redux/api/solidSettingsApi.d.ts +9 -0
  115. package/dist/redux/api/solidSettingsApi.d.ts.map +1 -0
  116. package/dist/redux/api/solidSettingsApi.js +40 -0
  117. package/dist/redux/api/solidSettingsApi.js.map +1 -0
  118. package/package.json +1 -1
  119. package/src/components/auth/SolidChangeForcePassword.tsx +2 -3
  120. package/src/components/auth/SolidForgotPassword.tsx +9 -4
  121. package/src/components/auth/SolidLogin.tsx +22 -13
  122. package/src/components/common/BackButton.tsx +27 -0
  123. package/src/components/common/CancelButton.tsx +2 -2
  124. package/src/components/common/DropzonePlaceholder.tsx +11 -3
  125. package/src/components/common/FileReaderExt.tsx +18 -0
  126. package/src/components/common/GeneralSettings.tsx +286 -0
  127. package/src/components/common/SingleSelectAutoCompleteField.tsx +0 -1
  128. package/src/components/common/SocialMediaLogin.tsx +1 -1
  129. package/src/components/common/SolidFormStepper.tsx +12 -0
  130. package/src/components/core/form/SolidFormView.tsx +201 -186
  131. package/src/components/core/form/fields/SolidBooleanField.tsx +3 -7
  132. package/src/components/core/form/fields/SolidDateField.tsx +2 -8
  133. package/src/components/core/form/fields/SolidDateTimeField.tsx +19 -24
  134. package/src/components/core/form/fields/SolidDecimalField.tsx +2 -7
  135. package/src/components/core/form/fields/SolidIntegerField.tsx +17 -22
  136. package/src/components/core/form/fields/SolidJsonField.tsx +15 -19
  137. package/src/components/core/form/fields/SolidLongTextField.tsx +19 -24
  138. package/src/components/core/form/fields/SolidMediaMultipleField.tsx +47 -51
  139. package/src/components/core/form/fields/SolidMediaSingleField.tsx +47 -51
  140. package/src/components/core/form/fields/SolidRichTextField.tsx +3 -7
  141. package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +2 -7
  142. package/src/components/core/form/fields/SolidSelectionStaticField.tsx +20 -25
  143. package/src/components/core/form/fields/SolidShortTextField.tsx +18 -23
  144. package/src/components/core/form/fields/SolidTimeField.tsx +19 -24
  145. package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +51 -52
  146. package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +20 -25
  147. package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +6 -5
  148. package/src/components/core/model/CreateModel.tsx +68 -53
  149. package/src/components/core/model/FieldMetaData.tsx +16 -21
  150. package/src/components/core/model/FieldMetaDataForm.tsx +802 -896
  151. package/src/components/core/model/FieldSelector.tsx +10 -15
  152. package/src/components/core/model/ModelMetaData.tsx +364 -356
  153. package/src/components/core/module/CreateModule.tsx +327 -295
  154. package/src/components/core/users/CreateUser.tsx +175 -167
  155. package/src/index.ts +5 -2
  156. package/src/redux/api/solidSettingsApi.tsx +47 -0
  157. package/solidstarters-solid-core-ui-1.1.2.tgz +0 -0
@@ -6,6 +6,7 @@ import { useLazyGetmodulesQuery } from "@/redux/api/moduleApi";
6
6
  import { useFormik } from "formik";
7
7
  import { usePathname, useRouter } from "next/navigation";
8
8
  import { Checkbox } from "primereact/checkbox";
9
+ import { Divider } from "primereact/divider";
9
10
  import { InputText } from "primereact/inputtext";
10
11
  import { InputTextarea } from "primereact/inputtextarea";
11
12
  import { Message } from "primereact/message";
@@ -15,7 +16,7 @@ import qs from "qs";
15
16
  import React, { useEffect, useRef, useState } from "react";
16
17
  import * as Yup from "yup";
17
18
 
18
- const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allModelsNames, deleteModelFunction, nextTab, formikModelMetadataRef,params }: any, ref) => {
19
+ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allModelsNames, deleteModelFunction, nextTab, formikModelMetadataRef, params }: any, ref) => {
19
20
 
20
21
  // const ModelMetaData = ({ modelMetaData, setModelMetaData, deleteModelFunction, nextTab, formikModelMetadataRef }: any) => {
21
22
 
@@ -254,95 +255,65 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
254
255
  return (
255
256
 
256
257
  <>
257
-
258
- <div className="grid">
259
- <div className="col-12 xl:col-12 mx-auto">
260
- <div>
261
- <Toast ref={toast} />
262
- <form onSubmit={formik.handleSubmit}>
263
- {params.id === "new" ? <div className="flex gap-3 justify-content-between mb-5">
264
- <div className="form-wrapper-title" style={{ color: '#000' }}> Create Model</div>
265
- <div>
266
- {/* <Button label="Save" size="small" onClick={() => showError()} type="submit" className="small-button" /> */}
267
- </div>
268
- </div> :
269
- <div className="flex gap-3 justify-content-end mb-5">
270
- {/* <h3 className="m-0">Model</h3> */}
271
- <div className="gap-3 flex">
272
- {/* <div>
273
- <Button label="Save" onClick={() => showError()} type="submit" size="small" className="small-button" />
274
- </div> */}
275
- {/* <div>
276
- <Button outlined label="Delete" severity="danger" type="button" onClick={deleteModelFunction} />
277
- </div> */}
278
- </div>
258
+ <Toast ref={toast} />
259
+ <form onSubmit={formik.handleSubmit}>
260
+ {/* <div className="form-wrapper-subtitle">Name</div> */}
261
+ <div className="">
262
+ <div className="grid formgrid">
263
+ <div className="field col-6">
264
+ <p className="form-wrapper-heading text-base">Basic Info</p>
265
+ <div className="grid formgrid">
266
+ <div className="field col-12 flex flex-column gap-2">
267
+ <label htmlFor="type" className="form-field-label">
268
+ Module
269
+ </label>
270
+ <SingleSelectAutoCompleteField
271
+ disabled={params.id !== 'new'}
272
+ key="module"
273
+ formik={formik}
274
+ isFormFieldValid={isFormFieldValid}
275
+ relationField={true}
276
+ fieldName="module"
277
+ fieldNameId="moduleId"
278
+ labelKey="displayName"
279
+ valueKey="id"
280
+ searchData={searchModule}
281
+ existingData={formik.values.module}
282
+ />
283
+ {isFormFieldValid(formik, "module") && (
284
+ <Message severity="error" text={formik?.errors?.moduleId?.toString()} />
285
+ )}
279
286
  </div>
280
- }
281
- {/* <div className="form-wrapper-subtitle">Name</div> */}
282
- <div className="">
283
- <div className="grid formgrid">
284
- <div className="md:col-6 sm:col-12">
285
- <div className="form-wrapper">
286
- <p className="form-wrapper-heading">Advanced Settings</p>
287
- <div className="field">
288
- <label htmlFor="type" className="form-label form-field-label">
289
- Module
290
- </label>
291
- <div>
292
- <SingleSelectAutoCompleteField
293
- disabled={params.id !== 'new'}
294
- key="module"
295
- formik={formik}
296
- isFormFieldValid={isFormFieldValid}
297
- relationField={true}
298
- fieldName="module"
299
- fieldNameId="moduleId"
300
- labelKey="displayName"
301
- valueKey="id"
302
- searchData={searchModule}
303
- existingData={formik.values.module}
304
- />
305
- {isFormFieldValid(formik, "module") && (
306
- <Message severity="error" text={formik?.errors?.moduleId?.toString()} />
307
- )}
308
- </div>
309
- </div>
310
287
 
311
- <div className="field mt-3">
312
- <label htmlFor="dataSource" className="form-label form-field-label">
313
- Data Source
314
- </label>
315
- <div>
316
-
317
- <SingleSelectAutoCompleteField
318
- disabled={params.id !== 'new'}
319
- key="dataSource"
320
- formik={formik}
321
- isFormFieldValid={isFormFieldValid}
322
- // relationField={false}
323
- fieldName="dataSource"
324
- fieldNameId={null}
325
- labelKey="label"
326
- valueKey="value"
327
- searchData={serachDataSource}
328
- existingData={formik.values.dataSource}
329
- additionalAction={(e: any) => formik.setFieldValue("dataSourceType", e.target.value.type)}
330
- />
331
- {formik.values.dataSourceType && <Message severity="info" text={`Your datasource will connect to a ${formik.values.dataSourceType} database`} />}
332
-
333
- {isFormFieldValid(formik, "dataSource") && (
334
- <Message severity="error" text={formik?.errors?.dataSource?.toString()} />
335
- )}
336
- </div>
337
- </div>
288
+ <div className="field col-12 flex flex-column gap-2 mt-4">
289
+ <label htmlFor="dataSource" className="form-field-label">
290
+ Data Source
291
+ </label>
292
+ <SingleSelectAutoCompleteField
293
+ disabled={params.id !== 'new'}
294
+ key="dataSource"
295
+ formik={formik}
296
+ isFormFieldValid={isFormFieldValid}
297
+ // relationField={false}
298
+ fieldName="dataSource"
299
+ fieldNameId={null}
300
+ labelKey="label"
301
+ valueKey="value"
302
+ searchData={serachDataSource}
303
+ existingData={formik.values.dataSource}
304
+ additionalAction={(e: any) => formik.setFieldValue("dataSourceType", e.target.value.type)}
305
+ />
306
+ {isFormFieldValid(formik, "dataSource") && (
307
+ <Message severity="error" text={formik?.errors?.dataSource?.toString()} />
308
+ )}
309
+ </div>
338
310
 
339
311
 
340
- {/* <div className="field mt-3">
341
- <label htmlFor="dataSourceType" className="form-label form-field-label">
342
- Data Source Type
343
- </label>
344
- <div>
345
- <SingleSelectAutoCompleteField
312
+ <div className="field col-12 flex flex-column gap-2 my-4">
313
+ <label htmlFor="dataSourceType" className="form-field-label">
314
+ Data Source Type
315
+ </label>
316
+ {/* <SingleSelectAutoCompleteField
346
317
  key="dataSourceType"
347
318
  formik={formik}
348
319
  isFormFieldValid={isFormFieldValid}
@@ -353,260 +324,305 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
353
324
  valueKey="value"
354
325
  searchData={serachDataSourceType}
355
326
  existingData={formik.values.dataSourceType}
356
- />
357
- <InputText
358
- disabled
359
- type="text"
360
- id="dataSourceType"
361
- name="dataSourceType"
362
- onChange={formik.handleChange}
363
- value={formik.values.dataSourceType}
364
- className={classNames("p-inputtext-sm w-full small-input", {
365
- "p-invalid": isFormFieldValid(formik, "dataSourceType"),
366
- })}
367
- />
368
-
369
-
370
- {isFormFieldValid(formik, "dataSourceType") && (
371
- <Message severity="error" text={formik?.errors?.dataSourceType?.toString()} />
372
- )}
373
- </div>
374
- </div> */}
375
- </div>
376
- <div className="form-wrapper mt-4">
377
- <p className="form-wrapper-heading">Configurations</p>
378
-
379
- <div className="grid formgrid">
380
- {/* {params.id === 'new' &&
381
-
382
- <div className="md:col-6 sm:col-12">
383
- <div className="field">
384
- <div className="flex align-items-center">
385
- <Checkbox
386
- disabled={params.id !== 'new'}
387
- name="isSystem"
388
- onChange={(e) => {
389
- formik.setFieldValue("isSystem", e.checked);
390
- }}
391
- checked={formik.values.isSystem}
392
- ></Checkbox>
393
- <label htmlFor="isSystem" className="form-field-label ml-2">
394
- Is System
395
- </label>
396
- </div>
397
- {isFormFieldValid(formik, "isSystem") && (
398
- <Message
399
- severity="error"
400
- text={formik?.errors?.isSystem?.toString()}
401
- />
402
- )}
403
- </div>
404
- </div>} */}
405
- <div className="md:col-6 sm:col-12">
406
- <div className="field">
407
- <div className="flex align-items-center">
408
- <Checkbox
409
- name="enableSoftDelete"
410
- onChange={(e) => {
411
- formik.setFieldValue("enableSoftDelete", e.checked);
412
- }}
413
- disabled={params.id !== 'new'}
414
- checked={formik.values.enableSoftDelete}
415
- ></Checkbox>
416
- <label htmlFor="enableSoftDelete" className="form-field-label ml-2">
417
- Enable Soft Delete
418
- </label>
419
- </div>
420
- {params.id !== 'new' && <p className="fieldSubTitle">Soft Delete is disabled in edit mode</p>}
421
- {isFormFieldValid(formik, "enableSoftDelete") && (
422
- <Message
423
- severity="error"
424
- text={formik?.errors?.enableSoftDelete?.toString()}
425
- />
426
- )}
427
- </div>
428
- </div>
429
- {/* <div className="md:col-6 sm:col-12">
430
- <div className="field">
431
- <div className="flex align-items-center">
432
- <Checkbox
433
- name="enableAuditTracking"
434
- onChange={(e) => {
435
- formik.setFieldValue("enableAuditTracking", e.checked);
436
- }}
437
- checked={formik.values.enableAuditTracking}
438
- ></Checkbox>
439
- <label htmlFor="enableAuditTracking" className="form-field-label ml-2">
440
- Enable Audit Tracking
441
- </label>
442
- </div>
443
- {isFormFieldValid(formik, "enableAuditTracking") && (
444
- <Message
445
- severity="error"
446
- text={formik?.errors?.enableAuditTracking?.toString()}
447
- />
448
- )}
449
- </div>
450
- </div> */}
451
- {/* <div className="md:col-6 sm:col-12">
452
- <div className="field">
453
- <div className="flex align-items-center">
454
- <Checkbox
455
- name="internationalisation"
456
- onChange={(e) => {
457
- formik.setFieldValue("internationalisation", e.checked);
458
- }}
459
- checked={formik.values.internationalisation}
460
- ></Checkbox>
461
- <label htmlFor="internationalisation" className="form-field-label ml-2">
462
- Internationalisation
463
- </label>
464
- </div>
465
- {isFormFieldValid(formik, "internationalisation") && (
466
- <Message
467
- severity="error"
468
- text={formik?.errors?.internationalisation?.toString()}
469
- />
470
- )}
471
- </div>
472
- </div> */}
473
-
474
- </div>
475
-
327
+ /> */}
328
+ <InputText
329
+ disabled
330
+ type="text"
331
+ id="dataSourceType"
332
+ name="dataSourceType"
333
+ onChange={formik.handleChange}
334
+ value={formik.values.dataSourceType}
335
+ className={classNames("", {
336
+ "p-invalid": isFormFieldValid(formik, "dataSourceType"),
337
+ })}
338
+ />
339
+
340
+
341
+ {isFormFieldValid(formik, "dataSourceType") && (
342
+ <Message severity="error" text={formik?.errors?.dataSourceType?.toString()} />
343
+ )}
344
+ </div>
345
+ </div>
346
+ <Divider />
347
+ <p className="form-wrapper-heading text-base">Configurations</p>
348
+ <div className="grid formgrid">
349
+ {params.id === 'new' &&
350
+
351
+ <div className="field col-6">
352
+ <div className="flex align-items-center gap-2">
353
+ <Checkbox
354
+ disabled={params.id !== 'new'}
355
+ name="isSystem"
356
+ onChange={(e) => {
357
+ formik.setFieldValue("isSystem", e.checked);
358
+ }}
359
+ checked={formik.values.isSystem}
360
+ ></Checkbox>
361
+ <label htmlFor="isSystem" className="form-field-label">
362
+ Is System
363
+ </label>
476
364
  </div>
365
+ {isFormFieldValid(formik, "isSystem") && (
366
+ <Message
367
+ severity="error"
368
+ text={formik?.errors?.isSystem?.toString()}
369
+ />
370
+ )}
371
+ </div>}
372
+ <div className="field col-6">
373
+ <div className="flex align-items-center gap-2">
374
+ <Checkbox
375
+ name="enableSoftDelete"
376
+ onChange={(e) => {
377
+ formik.setFieldValue("enableSoftDelete", e.checked);
378
+ }}
379
+ disabled={params.id !== 'new'}
380
+ checked={formik.values.enableSoftDelete}
381
+ ></Checkbox>
382
+ <label htmlFor="enableSoftDelete" className="form-field-label">
383
+ Enable Soft Delete
384
+ </label>
477
385
  </div>
478
- <div className="md:col-6 sm:col-12">
479
- <div className="form-wrapper">
480
- <p className="form-wrapper-heading">Basic Settings</p>
481
- <div className="field">
482
- <label htmlFor="displayName" className="form-label form-field-label">
483
- Display Name
484
- </label>
485
- <InputText
486
- type="text"
487
- id="displayName"
488
- name="displayName"
489
- onChange={(e) => {
490
-
491
- formik.handleChange(e);
492
- const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(e.target.value);
493
- if (params.id === 'new') {
494
- formik.setFieldValue("singularName", toCamelCase);
495
- formik.setFieldValue("pluralName", toPluralCamelCase);
496
- }
497
- if (showTableName == true) {
498
- if (params.id === 'new') {
499
- formik.setFieldValue("tableName", toSnakeCase);
500
- }
501
- }
502
-
503
-
504
- }}
505
- value={formik.values.displayName}
506
- className={classNames("p-inputtext-sm w-full small-input", {
507
- "p-invalid": isFormFieldValid(formik, "displayName"),
508
- })}
509
-
510
- />
386
+ {params.id !== 'new' && <p className="form-field-label">Soft Delete is disabled in edit mode</p>}
387
+ {isFormFieldValid(formik, "enableSoftDelete") && (
388
+ <Message
389
+ severity="error"
390
+ text={formik?.errors?.enableSoftDelete?.toString()}
391
+ />
392
+ )}
393
+ </div>
394
+ {/* <div className="field col-6">
395
+ <div className="flex align-items-center gap-2 mt-3">
396
+ <Checkbox
397
+ name="enableAuditTracking"
398
+ onChange={(e) => {
399
+ formik.setFieldValue("enableAuditTracking", e.checked);
400
+ }}
401
+ checked={formik.values.enableAuditTracking}
402
+ ></Checkbox>
403
+ <label htmlFor="enableAuditTracking" className="form-field-label">
404
+ Enable Audit Tracking
405
+ </label>
406
+ </div>
407
+ {isFormFieldValid(formik, "enableAuditTracking") && (
408
+ <Message
409
+ severity="error"
410
+ text={formik?.errors?.enableAuditTracking?.toString()}
411
+ />
412
+ )}
413
+ </div>
414
+ <div className="field col-6">
415
+ <div className="flex align-items-center gap-2 mt-3">
416
+ <Checkbox
417
+ name="internationalisation"
418
+ onChange={(e) => {
419
+ formik.setFieldValue("internationalisation", e.checked);
420
+ }}
421
+ checked={formik.values.internationalisation}
422
+ ></Checkbox>
423
+ <label htmlFor="internationalisation" className="form-field-label">
424
+ Internationalisation
425
+ </label>
426
+ </div>
427
+ {isFormFieldValid(formik, "internationalisation") && (
428
+ <Message
429
+ severity="error"
430
+ text={formik?.errors?.internationalisation?.toString()}
431
+ />
432
+ )}
433
+ </div>
511
434
 
512
- {isFormFieldValid(formik, "displayName") && (
513
- <Message
514
- severity="error"
515
- text={formik?.errors?.displayName?.toString()}
516
- />
517
- )}
518
- </div>
519
- <div className="field mt-3">
520
- <label htmlFor="singularName" className="form-label form-field-label">
521
- Singular Name
435
+ <div className="field col-6 mt-3">
436
+ <div className="flex align-items-center gap-2">
437
+ <Checkbox
438
+ name="isExportable"
439
+ onChange={(e) => {
440
+ formik.setFieldValue("isExportable", e.checked);
441
+ }}
442
+ checked={formik.values.isExportable}
443
+ ></Checkbox>
444
+ <label htmlFor="isExportable" className="form-field-label">
445
+ Is Exportable
446
+ </label>
447
+ </div>
448
+ {isFormFieldValid(formik, "isExportable") && (
449
+ <Message
450
+ severity="error"
451
+ text={formik?.errors?.isExportable?.toString()}
452
+ />
453
+ )}
454
+ </div>
455
+ <div className="field col-6 mt-3">
456
+ <div className="flex align-items-center gap-2">
457
+
458
+ <Checkbox onChange={e => {
459
+ setShowUserKeyField(e.checked);
460
+ formik.setFieldValue("hasUserKey", e.checked);
461
+ }} checked={showUserKeyField}></Checkbox>
462
+ <label htmlFor="ingredient1" className="form-field-label">
463
+ Has User Key
464
+ </label>
465
+ </div>
466
+ {showUserKeyField &&
467
+ <div className="formgrid grid">
468
+ <div className="field col-12 mt-3">
469
+ <label htmlFor="userKeyFieldId" className="form-field-label">
470
+ User Key Field
522
471
  </label>
523
472
  <InputText
524
- disabled={true}
525
473
  type="text"
526
- id="singularName"
527
- name="singularName"
474
+ id="userKeyFieldId"
475
+ name="userKeyFieldId"
528
476
  onChange={formik.handleChange}
529
- value={formik.values.singularName}
530
- className={classNames("p-inputtext-sm w-full small-input", {
531
- "p-invalid": isFormFieldValid(formik, "singularName"),
477
+ value={formik.values.userKeyFieldId}
478
+ className={classNames("", {
479
+ "p-invalid": isFormFieldValid(formik, "userKeyFieldId"),
532
480
  })}
533
481
  />
534
- {isFormFieldValid(formik, "singularName") && (
482
+ {isFormFieldValid(formik, "userKeyFieldId") && (
535
483
  <Message
536
484
  severity="error"
537
- text={formik?.errors?.singularName?.toString()}
485
+ text={formik?.errors?.userKeyFieldId?.toString()}
538
486
  />
539
487
  )}
540
488
  </div>
541
- <div className="field mt-3">
542
- <label htmlFor="pluralName" className="form-label form-field-label">
543
- Plural Name
544
- </label>
545
- <InputText
546
- disabled={true}
547
- type="text"
548
- id="pluralName"
549
- name="pluralName"
550
- onChange={formik.handleChange}
551
- value={formik.values.pluralName}
552
- className={classNames("p-inputtext-sm w-full small-input", {
553
- "p-invalid": isFormFieldValid(formik, "pluralName"),
554
- })}
555
- />
556
- {isFormFieldValid(formik, "pluralName") && (
557
- <Message severity="error" text={formik?.errors?.pluralName?.toString()} />
558
- )}
559
- </div>
489
+ </div>
490
+ }
491
+ </div>*/}
560
492
 
561
- <div className="field mt-5">
562
- <div className="flex align-items-center">
563
-
564
- <div className="flex align-items-center">
565
- <Checkbox onChange={e => {
566
- setShowTableName(e.checked);
567
- if (e.checked === true) {
568
- const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(formik.values.displayName);
569
- if (params.id === 'new') {
570
- formik.setFieldValue("tableName", toSnakeCase);
571
- }
572
- }
573
-
574
- }} checked={showTableName}></Checkbox>
575
- <label htmlFor="ingredient1" className="ml-2">
576
- Set table name
577
- </label>
578
- </div>
579
- </div>
580
- </div>
581
- {showTableName &&
582
- <div className="field mt-3">
583
- <label htmlFor="tableName" className="form-label form-field-label">
584
- Table Name
585
- </label>
586
- <InputText
587
- disabled={params.id !== 'new'}
588
- type="text"
589
- id="tableName"
590
- name="tableName"
591
- onChange={formik.handleChange}
592
- value={formik.values.tableName}
593
- className={classNames("p-inputtext-sm w-full small-input", {
594
- "p-invalid": isFormFieldValid(formik, "tableName"),
595
- })}
596
- />
597
- {isFormFieldValid(formik, "tableName") && (
598
- <Message
599
- severity="error"
600
- text={formik?.errors?.tableName?.toString()}
601
- />
602
- )}
603
- </div>
493
+ </div>
494
+
495
+ </div>
496
+ <div className="field col-6">
497
+
498
+ <p className="form-wrapper-heading text-base">Basic Settings</p>
499
+ <div className="grid formgrid">
500
+ <div className="field col-12 flex flex-column gap-2">
501
+ <label htmlFor="displayName" className="form-field-label">
502
+ Display Name
503
+ </label>
504
+ <InputText
505
+ type="text"
506
+ id="displayName"
507
+ name="displayName"
508
+ onChange={(e) => {
509
+
510
+ formik.handleChange(e);
511
+ const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(e.target.value);
512
+ if (params.id === 'new') {
513
+ formik.setFieldValue("singularName", toCamelCase);
514
+ formik.setFieldValue("pluralName", toPluralCamelCase);
604
515
  }
605
- <div className="field mt-3">
606
- <label htmlFor="description" className="form-label form-field-label">
607
- Description
608
- </label>
609
- {/* <InputText
516
+ if (showTableName == true) {
517
+ if (params.id === 'new') {
518
+ formik.setFieldValue("tableName", toSnakeCase);
519
+ }
520
+ }
521
+
522
+
523
+ }}
524
+ value={formik.values.displayName}
525
+ className={classNames("", {
526
+ "p-invalid": isFormFieldValid(formik, "displayName"),
527
+ })}
528
+
529
+ />
530
+
531
+ {isFormFieldValid(formik, "displayName") && (
532
+ <Message
533
+ severity="error"
534
+ text={formik?.errors?.displayName?.toString()}
535
+ />
536
+ )}
537
+ </div>
538
+ <div className="field col-12 flex flex-column gap-2 mt-4">
539
+ <label htmlFor="singularName" className="form-field-label">
540
+ Singular Name
541
+ </label>
542
+ <InputText
543
+ disabled={true}
544
+ type="text"
545
+ id="singularName"
546
+ name="singularName"
547
+ onChange={formik.handleChange}
548
+ value={formik.values.singularName}
549
+ className={classNames("", {
550
+ "p-invalid": isFormFieldValid(formik, "singularName"),
551
+ })}
552
+ />
553
+ {isFormFieldValid(formik, "singularName") && (
554
+ <Message
555
+ severity="error"
556
+ text={formik?.errors?.singularName?.toString()}
557
+ />
558
+ )}
559
+ </div>
560
+ <div className="field col-12 flex flex-column gap-2 mt-4">
561
+ <label htmlFor="pluralName" className="form-field-label">
562
+ Plural Name
563
+ </label>
564
+ <InputText
565
+ disabled={true}
566
+ type="text"
567
+ id="pluralName"
568
+ name="pluralName"
569
+ onChange={formik.handleChange}
570
+ value={formik.values.pluralName}
571
+ className={classNames("", {
572
+ "p-invalid": isFormFieldValid(formik, "pluralName"),
573
+ })}
574
+ />
575
+ {isFormFieldValid(formik, "pluralName") && (
576
+ <Message severity="error" text={formik?.errors?.pluralName?.toString()} />
577
+ )}
578
+ </div>
579
+
580
+ <div className="field col-12 mt-4">
581
+ <div className="flex align-items-center gap-2">
582
+ <Checkbox onChange={e => {
583
+ setShowTableName(e.checked);
584
+ if (e.checked === true) {
585
+ const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(formik.values.displayName);
586
+ if (params.id === 'new') {
587
+ formik.setFieldValue("tableName", toSnakeCase);
588
+ }
589
+ }
590
+
591
+ }} checked={showTableName}></Checkbox>
592
+ <label htmlFor="ingredient1" className="form-field-label">
593
+ Set table name
594
+ </label>
595
+ </div>
596
+ </div>
597
+ {showTableName &&
598
+ <div className="field col-12 flex flex-column gap-2 mt-4">
599
+ <label htmlFor="tableName" className="form-field-label">
600
+ Table Name
601
+ </label>
602
+ <InputText
603
+ disabled={params.id !== 'new'}
604
+ type="text"
605
+ id="tableName"
606
+ name="tableName"
607
+ onChange={formik.handleChange}
608
+ value={formik.values.tableName}
609
+ className={classNames("", {
610
+ "p-invalid": isFormFieldValid(formik, "tableName"),
611
+ })}
612
+ />
613
+ {isFormFieldValid(formik, "tableName") && (
614
+ <Message
615
+ severity="error"
616
+ text={formik?.errors?.tableName?.toString()}
617
+ />
618
+ )}
619
+ </div>
620
+ }
621
+ <div className="field col-12 flex flex-column gap-2 mt-4">
622
+ <label htmlFor="description" className="form-field-label">
623
+ Description
624
+ </label>
625
+ {/* <InputText
610
626
  type="text"
611
627
  id="description"
612
628
  name="description"
@@ -616,28 +632,28 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
616
632
  "p-invalid": isFormFieldValid(formik, "description"),
617
633
  })}
618
634
  /> */}
619
- <InputTextarea
620
- id="description"
621
- name="description"
622
- onChange={formik.handleChange}
623
- value={formik.values.description}
624
- className={classNames("p-inputtext-sm w-full", {
625
- "p-invalid": isFormFieldValid(formik, "description"),
626
- })}
627
- rows={5}
628
- cols={30}
629
- />
630
- {isFormFieldValid(formik, "description") && (
631
- <Message
632
- severity="error"
633
- text={formik?.errors?.description?.toString()}
634
- />
635
- )}
636
- </div>
637
- </div>
638
- </div>
635
+ <InputTextarea
636
+ id="description"
637
+ name="description"
638
+ onChange={formik.handleChange}
639
+ value={formik.values.description}
640
+ className={classNames("", {
641
+ "p-invalid": isFormFieldValid(formik, "description"),
642
+ })}
643
+ rows={5}
644
+ cols={30}
645
+ />
646
+ {isFormFieldValid(formik, "description") && (
647
+ <Message
648
+ severity="error"
649
+ text={formik?.errors?.description?.toString()}
650
+ />
651
+ )}
652
+ </div>
653
+ </div>
654
+ </div>
639
655
 
640
- {/* <div className="md:col-6 sm:col-12">
656
+ {/* <div className="md:col-6 sm:col-12">
641
657
  <div className="field">
642
658
  <label htmlFor="pluralName" className="form-label form-field-label">
643
659
  Plural Name
@@ -659,7 +675,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
659
675
  </div> */}
660
676
 
661
677
 
662
- {/* <div className="md:col-6 sm:col-12">
678
+ {/* <div className="md:col-6 sm:col-12">
663
679
  <div className="field form-dropdown-select">
664
680
  <label htmlFor="dataSourceType" className="form-labe form-field-label">
665
681
  Data Source
@@ -691,19 +707,11 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
691
707
  </div> */}
692
708
 
693
709
 
694
- </div>
695
- </div>
696
- </form>
697
710
  </div>
698
- </div >
699
- </div >
700
-
701
-
711
+ </div>
712
+ </form>
702
713
  </>
703
-
704
714
  );
705
715
  });
706
716
 
707
- // };
708
-
709
717
  export default ModelMetaData;