@solidstarters/solid-core-ui 1.1.6 → 1.1.8

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