@solidstarters/solid-core-ui 1.1.69 → 1.1.71
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/dist/components/CustomFooter/CustomFooter.tsx +264 -0
- package/dist/components/CustomFooter/FooterForm.tsx +19 -0
- package/dist/components/CustomHeader/CallIcon.tsx +20 -0
- package/dist/components/CustomHeader/CustomDropdown.tsx +175 -0
- package/dist/components/CustomHeader/CustomHeader.tsx +64 -0
- package/dist/components/CustomHeader/EmailIcon.tsx +12 -0
- package/dist/components/CustomHeader/HeaderCart.tsx +15 -0
- package/dist/components/CustomHeader/productNavData.tsx +180 -0
- package/dist/components/FormView/DetailsViews.tsx +46 -0
- package/dist/components/FormView/OrderAddressDetails.tsx +70 -0
- package/dist/components/FormView/OrderPaymentDetails.tsx +18 -0
- package/dist/components/FormView/OrderTableDetails.tsx +36 -0
- package/dist/components/FormView/OrderedProductDetail.tsx +22 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FileSvg.tsx +19 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.d.ts +2 -0
- package/dist/components/Svg/RightArrowSvg.d.ts.map +1 -0
- package/dist/components/Svg/RightArrowSvg.js +5 -0
- package/dist/components/Svg/RightArrowSvg.js.map +1 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Tag/CustomTag.tsx +50 -0
- package/dist/components/auth/AuthLayout.tsx +140 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +48 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +60 -0
- package/dist/components/auth/Login.tsx +155 -0
- package/dist/components/auth/Register.tsx +239 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +145 -0
- package/dist/components/auth/SolidForgotPassword.tsx +125 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +152 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +141 -0
- package/dist/components/auth/SolidLogin.tsx +275 -0
- package/dist/components/auth/SolidOTPVerify.tsx +132 -0
- package/dist/components/auth/SolidRegister.tsx +348 -0
- package/dist/components/auth/SolidResetPassword.tsx +162 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +76 -0
- package/dist/components/common/BackButton.tsx +27 -0
- package/dist/components/common/CancelButton.tsx +48 -0
- package/dist/components/common/CodeEditor.tsx +26 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +406 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +16 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +62 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +67 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +7 -0
- package/dist/components/common/SolidBreadcrumb.tsx +103 -0
- package/dist/components/common/SolidFormHeader.tsx +22 -0
- package/dist/components/common/SolidFormStepper.tsx +213 -0
- package/dist/components/common/SolidModuleHome.tsx +61 -0
- package/dist/components/common/SolidThemeLink.tsx +5 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/core/chatter/SolidChatter.d.ts +7 -0
- package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatter.js +269 -0
- package/dist/components/core/chatter/SolidChatter.js.map +1 -0
- package/dist/components/core/chatter/SolidChatter.tsx +252 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.d.ts +6 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.js +7 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.d.ts +17 -0
- package/dist/components/core/chatter/SolidChatterHeader.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterHeader.js +67 -0
- package/dist/components/core/chatter/SolidChatterHeader.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +178 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +19 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.js +46 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +165 -0
- package/dist/components/core/chatter/SolidMessageComposer.d.ts +7 -0
- package/dist/components/core/chatter/SolidMessageComposer.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidMessageComposer.js +119 -0
- package/dist/components/core/chatter/SolidMessageComposer.js.map +1 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +145 -0
- package/dist/components/core/chatter/chatter.module.css +70 -0
- package/dist/components/core/common/FilterComponent.tsx +434 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/SolidCreateButton.tsx +20 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +843 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +74 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.d.ts +1 -1
- package/dist/components/core/common/SolidViewLayoutManager.ts +85 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +59 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +38 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts +2 -2
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +123 -0
- package/dist/components/core/field/FieldListViewData.tsx +312 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +128 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +180 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +50 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +58 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +51 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +56 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +56 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +13 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +45 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +45 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +80 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +85 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +53 -46
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +1352 -0
- package/dist/components/core/form/fields/ISolidField.tsx +69 -0
- package/dist/components/core/form/fields/SolidBooleanField.d.ts +4 -1
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +80 -29
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +269 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +45 -25
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.tsx +153 -0
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +44 -25
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +154 -0
- package/dist/components/core/form/fields/SolidDecimalField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +41 -21
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.tsx +155 -0
- package/dist/components/core/form/fields/SolidEmailField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.js +41 -21
- package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.tsx +168 -0
- package/dist/components/core/form/fields/SolidIntegerField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +41 -21
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +158 -0
- package/dist/components/core/form/fields/SolidJsonField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +51 -15
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.tsx +173 -0
- package/dist/components/core/form/fields/SolidLongTextField.d.ts +3 -2
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +33 -52
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.tsx +161 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +262 -153
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +639 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +243 -149
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +522 -0
- package/dist/components/core/form/fields/SolidPasswordField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.js +50 -20
- package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.tsx +187 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +54 -0
- package/dist/components/core/form/fields/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +49 -20
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.tsx +177 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +88 -60
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +204 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts +5 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +88 -27
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +272 -0
- package/dist/components/core/form/fields/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +57 -26
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.tsx +208 -0
- package/dist/components/core/form/fields/SolidTimeField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +44 -22
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +147 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +4 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +77 -19
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +309 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +5 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +136 -107
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +291 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts +5 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +159 -107
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +311 -0
- package/dist/components/core/form/fields/relations/widgets/SolidRelationManyToManyAutocompleteWidget.d.ts +1 -1
- package/dist/components/core/form/fields/relations/widgets/SolidRelationManyToManyCheckboxWidget.d.ts +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +33 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidBooleanCheckboxFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidBooleanSelectFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidFormFieldViewMediaMultipleWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidFormFieldViewMediaSingleWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.d.ts +3 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.d.ts.map +1 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.js +29 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.js.map +1 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +46 -0
- package/dist/components/core/form/fields/widgets/SolidSelectionStaticAutocompleteFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidSelectionStaticRadioFieldWidget.d.ts +1 -1
- package/dist/components/core/form/widgets/CustomHtml.d.ts +1 -1
- package/dist/components/core/form/widgets/CustomHtml.tsx +19 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +131 -0
- package/dist/components/core/kanban/KanbanCard.tsx +255 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +85 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +803 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +146 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +136 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +158 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +6 -6
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +42 -0
- package/dist/components/core/list/SolidListColumnSelector.tsx +167 -0
- package/dist/components/core/list/SolidListView.js +6 -6
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +961 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +162 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +198 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +12 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +33 -2
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +89 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +23 -0
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +27 -3
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +27 -3
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js +27 -3
- package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.js +27 -3
- package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.js +27 -3
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +48 -22
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +100 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +41 -13
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +98 -0
- package/dist/components/core/list/columns/SolidRelationColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.js +7 -0
- package/dist/components/core/list/columns/SolidRelationColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +20 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +27 -3
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +27 -3
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +16 -37
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +103 -0
- package/dist/components/core/list/columns/SolidTimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js +27 -3
- package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidUuidColumn.js +27 -3
- package/dist/components/core/list/columns/SolidUuidColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts +6 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js +70 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +110 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts +2 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +42 -17
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +95 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts +6 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js +70 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +111 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.d.ts +4 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.js +60 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.js.map +1 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.tsx +89 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js +42 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js.map +1 -0
- package/{src/components/core/list/widgets/SolidUserNameAvatarWidget.tsx → dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx} +18 -11
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.d.ts +2 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.d.ts.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.js +4 -4
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.js.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/model/CreateModel.tsx +476 -0
- package/dist/components/core/model/FieldMetaData.tsx +193 -0
- package/dist/components/core/model/FieldMetaDataForm.js +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +3048 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +383 -0
- package/dist/components/core/model/ModelMetaData.tsx +840 -0
- package/dist/components/core/module/CreateModule.tsx +620 -0
- package/dist/components/core/module/ModuleListViewData.tsx +429 -0
- package/dist/components/core/users/CreateUser.tsx +434 -0
- package/dist/components/core/users/CreateUserRole.tsx +211 -0
- package/dist/components/core/users/UserListView.tsx +374 -0
- package/dist/components/layout/AdminLayout.tsx +62 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.d.ts +1 -1
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +225 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.d.ts +1 -1
- package/dist/components/layout/Layout.tsx +136 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.d.ts +1 -1
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +73 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +120 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/components/tables/DemoData.tsx +318 -0
- package/dist/components/tables/DynamicTable.tsx +56 -0
- package/dist/components/tables/ListViewTable.tsx +156 -0
- package/dist/declarations.d.ts +19 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +93 -0
- package/dist/helpers/authHeader.ts +20 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadMediaFile.tsx +19 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.d.ts +4 -0
- package/dist/helpers/getRandomColors.d.ts.map +1 -0
- package/dist/helpers/getRandomColors.js +63 -0
- package/dist/helpers/getRandomColors.js.map +1 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +40 -0
- package/dist/helpers/menu.tsx +670 -0
- package/dist/helpers/permissions.ts +19 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +76 -35
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +172 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +642 -0
- package/dist/nextAuth/authProviders.tsx +221 -0
- package/dist/nextAuth/refreshAccessToken.tsx +27 -0
- package/dist/redux/api/articleApi.ts +55 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/automationApi.ts +55 -0
- package/dist/redux/api/categoryApi.tsx +46 -0
- package/dist/redux/api/cityApi.tsx +56 -0
- package/dist/redux/api/cmsBannerImageApi.tsx +55 -0
- package/dist/redux/api/countryApi.tsx +56 -0
- package/dist/redux/api/fetchBaseQuery.tsx +15 -0
- package/dist/redux/api/fieldApi.ts +78 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/menuApi.tsx +55 -0
- package/dist/redux/api/menuItemsApi.tsx +56 -0
- package/dist/redux/api/modelApi.ts +77 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/orderAttributeApi.tsx +37 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/productData.tsx +87 -0
- package/dist/redux/api/radixExtraModelAttributeApi.tsx +37 -0
- package/dist/redux/api/radixModelMetadataApi.tsx +62 -0
- package/dist/redux/api/radixModelsApi.tsx +64 -0
- package/dist/redux/api/ratingApi.ts +55 -0
- package/dist/redux/api/reviewApi.ts +55 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts +7 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -0
- package/dist/redux/api/solidChatterMessageApi.js +29 -0
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -0
- package/dist/redux/api/solidChatterMessageApi.ts +30 -0
- package/dist/redux/api/solidEntityApi.tsx +110 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidSettingsApi.tsx +47 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/tagApi.ts +55 -0
- package/dist/redux/api/tagGroupApi.tsx +55 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +120 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +27 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/resources/globals.css +59 -0
- package/dist/types/index.d.ts +60 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +139 -0
- package/package.json +4 -3
- package/src/components/Svg/RightArrowSvg.tsx +9 -0
- package/src/components/core/chatter/SolidChatter.tsx +252 -0
- package/src/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/src/components/core/chatter/SolidChatterHeader.tsx +178 -0
- package/src/components/core/chatter/SolidChatterMessageBox.tsx +165 -0
- package/src/components/core/chatter/SolidMessageComposer.tsx +145 -0
- package/src/components/core/chatter/chatter.module.css +70 -0
- package/src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +2 -2
- package/src/components/core/form/SolidFormView.tsx +166 -136
- package/src/components/core/form/fields/SolidBooleanField.tsx +170 -48
- package/src/components/core/form/fields/SolidDateField.tsx +86 -51
- package/src/components/core/form/fields/SolidDateTimeField.tsx +89 -52
- package/src/components/core/form/fields/SolidDecimalField.tsx +84 -49
- package/src/components/core/form/fields/SolidEmailField.tsx +90 -51
- package/src/components/core/form/fields/SolidIntegerField.tsx +86 -49
- package/src/components/core/form/fields/SolidJsonField.tsx +112 -42
- package/src/components/core/form/fields/SolidLongTextField.tsx +76 -117
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +474 -258
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +408 -249
- package/src/components/core/form/fields/SolidPasswordField.tsx +112 -55
- package/src/components/core/form/fields/SolidRichTextField.tsx +105 -52
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +138 -91
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +169 -37
- package/src/components/core/form/fields/SolidShortTextField.tsx +131 -74
- package/src/components/core/form/fields/SolidTimeField.tsx +85 -53
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +193 -30
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +206 -165
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +223 -142
- package/src/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +46 -0
- package/src/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +10 -10
- package/src/components/core/list/SolidListView.tsx +5 -5
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +30 -2
- package/src/components/core/list/columns/SolidDateColumn.tsx +23 -8
- package/src/components/core/list/columns/SolidDatetimeColumn.tsx +24 -8
- package/src/components/core/list/columns/SolidExternalIdColumn.tsx +23 -8
- package/src/components/core/list/columns/SolidIdColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidIntColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +68 -45
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +48 -26
- package/src/components/core/list/columns/SolidRelationColumn.tsx +7 -0
- package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +24 -9
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +26 -39
- package/src/components/core/list/columns/SolidTimeColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidUuidColumn.tsx +22 -7
- package/src/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +110 -0
- package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +43 -19
- package/src/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +111 -0
- package/src/components/core/list/widgets/SolidRelationAvatarWidget.tsx +89 -0
- package/src/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +59 -0
- package/src/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +5 -3
- package/src/components/core/model/FieldMetaDataForm.tsx +1 -1
- package/src/helpers/getRandomColors.tsx +68 -0
- package/src/helpers/registry.ts +89 -38
- package/src/index.ts +1 -0
- package/src/redux/api/solidChatterMessageApi.ts +30 -0
- package/src/resources/globals.css +59 -0
- package/src/types/solid-core.d.ts +24 -16
- package/src/components/core/form/fields/relations/widgets/SolidRelationManyToManyAutocompleteWidget.tsx +0 -74
- package/src/components/core/form/fields/relations/widgets/SolidRelationManyToManyCheckboxWidget.tsx +0 -103
- package/src/components/core/form/fields/widgets/SolidBooleanCheckboxFieldWidget.tsx +0 -79
- package/src/components/core/form/fields/widgets/SolidBooleanSelectFieldWidget.tsx +0 -68
- package/src/components/core/form/fields/widgets/SolidFormFieldJsonViewModeWidget.tsx +0 -23
- package/src/components/core/form/fields/widgets/SolidFormFieldMediaViewModeWidget.tsx +0 -13
- package/src/components/core/form/fields/widgets/SolidFormFieldPasswordViewModeWidget.tsx +0 -23
- package/src/components/core/form/fields/widgets/SolidFormFieldRelationViewModeWidget.tsx +0 -32
- package/src/components/core/form/fields/widgets/SolidFormFieldRichTextViewModeWidget.tsx +0 -17
- package/src/components/core/form/fields/widgets/SolidFormFieldViewMediaMultipleWidget.tsx +0 -174
- package/src/components/core/form/fields/widgets/SolidFormFieldViewMediaSingleWidget.tsx +0 -115
- package/src/components/core/form/fields/widgets/SolidFormFieldViewModeWidget.tsx +0 -11
- package/src/components/core/form/fields/widgets/SolidSelectionStaticAutocompleteFieldWidget.tsx +0 -72
- package/src/components/core/form/fields/widgets/SolidSelectionStaticRadioFieldWidget.tsx +0 -72
- package/src/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.tsx +0 -11
|
@@ -0,0 +1,3048 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import CodeEditor from "@/components/common/CodeEditor";
|
|
3
|
+
import { SingleSelectAutoCompleteField } from "@/components/common/SingleSelectAutoCompleteField";
|
|
4
|
+
import { getSingularAndPlural } from "@/helpers/helpers";
|
|
5
|
+
import { useGetFieldDefaultMetaDataQuery } from "@/redux/api/fieldApi";
|
|
6
|
+
import { useLazyGetMediaStorageProvidersQuery } from "@/redux/api/mediaStorageProviderApi";
|
|
7
|
+
import { useLazyGetModelsQuery, useUpdateUserKeyMutation } from "@/redux/api/modelApi";
|
|
8
|
+
import { useLazyGetmodulesQuery } from "@/redux/api/moduleApi";
|
|
9
|
+
import { useFormik } from "formik";
|
|
10
|
+
import { capitalize } from "lodash";
|
|
11
|
+
import { usePathname } from "next/navigation";
|
|
12
|
+
import { AutoComplete } from "primereact/autocomplete";
|
|
13
|
+
import { Button } from "primereact/button";
|
|
14
|
+
import { Calendar } from "primereact/calendar";
|
|
15
|
+
import { Checkbox } from "primereact/checkbox";
|
|
16
|
+
import { Dialog } from "primereact/dialog";
|
|
17
|
+
import { Dropdown, DropdownChangeEvent } from "primereact/dropdown";
|
|
18
|
+
import { InputNumber } from "primereact/inputnumber";
|
|
19
|
+
import { InputText } from "primereact/inputtext";
|
|
20
|
+
import { InputTextarea } from "primereact/inputtextarea";
|
|
21
|
+
import { Message } from "primereact/message";
|
|
22
|
+
import { MultiSelect } from "primereact/multiselect";
|
|
23
|
+
import { RadioButton } from "primereact/radiobutton";
|
|
24
|
+
import { SelectButton } from "primereact/selectbutton";
|
|
25
|
+
import { TabPanel, TabView } from "primereact/tabview";
|
|
26
|
+
import { Toast } from "primereact/toast";
|
|
27
|
+
import { classNames } from "primereact/utils";
|
|
28
|
+
import qs from "qs";
|
|
29
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
30
|
+
import * as Yup from "yup";
|
|
31
|
+
import FieldSelector from "./FieldSelector";
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
enum SolidFieldType {
|
|
36
|
+
// numeric types
|
|
37
|
+
int = 'int',
|
|
38
|
+
bigint = 'bigint',
|
|
39
|
+
float = 'float',
|
|
40
|
+
// double = 'double',
|
|
41
|
+
decimal = 'decimal',
|
|
42
|
+
|
|
43
|
+
// text types
|
|
44
|
+
shortText = 'shortText',
|
|
45
|
+
longtext = 'longText',
|
|
46
|
+
richText = 'richText',
|
|
47
|
+
json = 'json',
|
|
48
|
+
|
|
49
|
+
// boolean types
|
|
50
|
+
boolean = 'boolean',
|
|
51
|
+
|
|
52
|
+
// date
|
|
53
|
+
date = 'date',
|
|
54
|
+
datetime = 'datetime',
|
|
55
|
+
time = 'time',
|
|
56
|
+
|
|
57
|
+
// relation
|
|
58
|
+
relation = 'relation',
|
|
59
|
+
|
|
60
|
+
// media
|
|
61
|
+
mediaSingle = 'mediaSingle',
|
|
62
|
+
mediaMultiple = 'mediaMultiple',
|
|
63
|
+
|
|
64
|
+
email = 'email',
|
|
65
|
+
password = 'password',
|
|
66
|
+
|
|
67
|
+
// selection
|
|
68
|
+
selectionStatic = 'selectionStatic',
|
|
69
|
+
selectionDynamic = 'selectionDynamic',
|
|
70
|
+
|
|
71
|
+
computed = 'computed',
|
|
72
|
+
|
|
73
|
+
uuid = 'uuid'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const SelectionStaticValues = ({ enumValue, onUpdate, onDelete, onAdd }: any) => {
|
|
77
|
+
const [value, display] = enumValue.split(":");
|
|
78
|
+
|
|
79
|
+
const handleValueChange = (newValue: string) => {
|
|
80
|
+
onUpdate(`${newValue}:${display || ""}`);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleDisplayChange = (newDisplay: string) => {
|
|
84
|
+
onUpdate(`${value || ""}:${newDisplay}`);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="flex align-items-center gap-2 mt-2">
|
|
89
|
+
|
|
90
|
+
{/* Input field for Value */}
|
|
91
|
+
<InputText
|
|
92
|
+
value={value || ""}
|
|
93
|
+
onChange={(e) => handleValueChange(e.target.value)}
|
|
94
|
+
placeholder="Value"
|
|
95
|
+
className="w-full"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
{/* Input field for Display */}
|
|
99
|
+
<InputText
|
|
100
|
+
value={display || ""}
|
|
101
|
+
onChange={(e) => handleDisplayChange(e.target.value)}
|
|
102
|
+
placeholder="Display"
|
|
103
|
+
className="w-full"
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
{/* Plus Button to add a new row */}
|
|
109
|
+
<Button
|
|
110
|
+
icon="pi pi-plus"
|
|
111
|
+
size="small"
|
|
112
|
+
onClick={onAdd}
|
|
113
|
+
type="button"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
{/* Trash Button to delete the row */}
|
|
117
|
+
<Button
|
|
118
|
+
icon="pi pi-trash"
|
|
119
|
+
size="small"
|
|
120
|
+
onClick={onDelete}
|
|
121
|
+
outlined
|
|
122
|
+
severity="danger"
|
|
123
|
+
type="button"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const fieldBasedPayloadFormating = (values: any, currentFields: string[], fieldMetaData: any) => {
|
|
131
|
+
// const booleanFields: string | any[] = [
|
|
132
|
+
// "isSystem",
|
|
133
|
+
// "defaultValue",
|
|
134
|
+
// "required",
|
|
135
|
+
// "unique",
|
|
136
|
+
// "encrypt",
|
|
137
|
+
// "index",
|
|
138
|
+
// "private",
|
|
139
|
+
// "relationCreateInverse"];
|
|
140
|
+
const transformedPayload = currentFields.reduce((acc: any, key: any) => {
|
|
141
|
+
acc[key] = values[key]; // Set key and its value as the same string
|
|
142
|
+
// if (booleanFields.includes(acc[key])) {
|
|
143
|
+
// acc[key] = values[key] == "false" ? "" : true
|
|
144
|
+
// }
|
|
145
|
+
return acc;
|
|
146
|
+
}, {});
|
|
147
|
+
transformedPayload.displayName = transformedPayload.displayName.trim()
|
|
148
|
+
|
|
149
|
+
transformedPayload.identifier = fieldMetaData ? fieldMetaData.identifier : Date.now();
|
|
150
|
+
if (fieldMetaData?.id) {
|
|
151
|
+
transformedPayload.id = fieldMetaData.id
|
|
152
|
+
}
|
|
153
|
+
if (currentFields.includes("mediaStorageProviderId")) {
|
|
154
|
+
transformedPayload.mediaStorageProvider = values.mediaStorageProvider
|
|
155
|
+
}
|
|
156
|
+
if (currentFields.includes("selectionDynamicProviderCtxt")) {
|
|
157
|
+
const prettified = JSON.stringify(JSON.parse(values.selectionDynamicProviderCtxt), null, 2);
|
|
158
|
+
|
|
159
|
+
transformedPayload.selectionDynamicProviderCtxt = prettified
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (currentFields.includes("computedFieldValueProviderCtxt")) {
|
|
163
|
+
const prettified = JSON.stringify(JSON.parse(values.computedFieldValueProviderCtxt), null, 2);
|
|
164
|
+
transformedPayload.computedFieldValueProviderCtxt = prettified
|
|
165
|
+
}
|
|
166
|
+
if (currentFields.includes("relationCreateInverse")) {
|
|
167
|
+
transformedPayload.relationCreateInverse = values.relationCreateInverse == false ? false : true
|
|
168
|
+
}
|
|
169
|
+
if (transformedPayload.relationType == "many-to-one") {
|
|
170
|
+
transformedPayload.relationCascade = values.relationCascade;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (transformedPayload.relationType == "many-to-many") {
|
|
174
|
+
transformedPayload.isRelationManyToManyOwner = true;
|
|
175
|
+
}
|
|
176
|
+
return transformedPayload
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function fetchCurrentFields(solidFieldType: any, fieldDefaultMetaData: any) {
|
|
181
|
+
|
|
182
|
+
if (solidFieldType) {
|
|
183
|
+
const allowedFields = fieldDefaultMetaData?.data?.fieldTypes.filter((e: any) => e.fieldType === solidFieldType);
|
|
184
|
+
if (allowedFields.length > 0) {
|
|
185
|
+
return allowedFields[0].fields
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
return [
|
|
190
|
+
"name",
|
|
191
|
+
"displayName",
|
|
192
|
+
"type",
|
|
193
|
+
"ormType",
|
|
194
|
+
"required",
|
|
195
|
+
"unique",
|
|
196
|
+
"index",
|
|
197
|
+
"private",
|
|
198
|
+
"encrypt",
|
|
199
|
+
"isUserKey"
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const createValidationSchema = (currentFields: any, selectedType: any, allFields: any, fieldMetaData: any, encryptState: any) => {
|
|
205
|
+
|
|
206
|
+
let reservedNames;
|
|
207
|
+
|
|
208
|
+
if (fieldMetaData) {
|
|
209
|
+
reservedNames = allFields.length > 0 ? allFields.filter((i: any) => i.id !== fieldMetaData.id).map((f: any) => f.name) : [];
|
|
210
|
+
} else {
|
|
211
|
+
|
|
212
|
+
reservedNames = allFields.length > 0 ? allFields.map((f: any) => f.name) : [];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
const schema = {
|
|
218
|
+
name: Yup.string()
|
|
219
|
+
// .matches(/^[a-z]+(-[a-z]+)*$/,"Invalid format. Use lowercase letters and hyphens only.")
|
|
220
|
+
.notOneOf(reservedNames, "Name Already in use. Please choose a different name.")
|
|
221
|
+
.required("Name is required."),
|
|
222
|
+
displayName: Yup.string().required("Display Name is required"),
|
|
223
|
+
description: Yup.string().nullable(),
|
|
224
|
+
type: Yup.string().required("Type is required"),
|
|
225
|
+
isSystem: Yup.boolean(),
|
|
226
|
+
// Conditionally add validation rules based on `currentFields`
|
|
227
|
+
...(currentFields.includes("ormType") && {
|
|
228
|
+
ormType: Yup.string().required("Orm Type is required"),
|
|
229
|
+
}),
|
|
230
|
+
...(currentFields.includes("length") && {
|
|
231
|
+
length: Yup.number().typeError("Length must be an integer").nullable(),
|
|
232
|
+
}),
|
|
233
|
+
// ...(currentFields.includes("defaultValue") && {
|
|
234
|
+
// defaultValue: Yup.string().required("Default Value is required"),
|
|
235
|
+
// }),
|
|
236
|
+
// Conditionally validate defaultValue based on SolidFieldType
|
|
237
|
+
...(currentFields.includes("defaultValue") && {
|
|
238
|
+
defaultValue: Yup.mixed().nullable().when("type", (type: any) => {
|
|
239
|
+
switch (selectedType.value) {
|
|
240
|
+
case "int":
|
|
241
|
+
case "bigint":
|
|
242
|
+
return Yup.number().nullable().typeError("Default value must be an integer")
|
|
243
|
+
.integer("Default value must be an integer");
|
|
244
|
+
case "float":
|
|
245
|
+
case "decimal":
|
|
246
|
+
return Yup.number().nullable().typeError("Default value must be an integer")
|
|
247
|
+
case "shortText":
|
|
248
|
+
case "longText":
|
|
249
|
+
case "richText":
|
|
250
|
+
case "json":
|
|
251
|
+
return Yup.string().nullable().typeError("Default value must be an String")
|
|
252
|
+
case "boolean":
|
|
253
|
+
return Yup.boolean().nullable().typeError("Default value must be a boolean")
|
|
254
|
+
case "date":
|
|
255
|
+
case "datetime":
|
|
256
|
+
case "time":
|
|
257
|
+
return Yup.date().nullable().typeError("Default value must be an Date")
|
|
258
|
+
default:
|
|
259
|
+
return Yup.mixed().nullable(); // Default fallback if no match
|
|
260
|
+
}
|
|
261
|
+
}),
|
|
262
|
+
}),
|
|
263
|
+
|
|
264
|
+
// Add more conditional fields as needed
|
|
265
|
+
|
|
266
|
+
...(currentFields.includes("regexPattern") && {
|
|
267
|
+
regexPattern: Yup.string(),
|
|
268
|
+
regexPatternNotMatchingErrorMsg: Yup.string(),
|
|
269
|
+
}),
|
|
270
|
+
...(currentFields.includes("required") && {
|
|
271
|
+
required: Yup.boolean(),
|
|
272
|
+
}),
|
|
273
|
+
...(currentFields.includes("unique") && {
|
|
274
|
+
unique: Yup.boolean(),
|
|
275
|
+
}),
|
|
276
|
+
...(currentFields.includes("encrypt") && {
|
|
277
|
+
encrypt: Yup.boolean(),
|
|
278
|
+
}),
|
|
279
|
+
...(currentFields.includes("encryptionType") && encryptState == true && {
|
|
280
|
+
encryptionType: Yup.string().required(
|
|
281
|
+
"Encryption Type Value is required"
|
|
282
|
+
),
|
|
283
|
+
}),
|
|
284
|
+
...(currentFields.includes("decryptWhen") && encryptState == true && {
|
|
285
|
+
|
|
286
|
+
decryptWhen: Yup.string().required("Decrypt When Value is required"),
|
|
287
|
+
}),
|
|
288
|
+
...(currentFields.includes("index") && {
|
|
289
|
+
index: Yup.boolean(),
|
|
290
|
+
}),
|
|
291
|
+
// ...(currentFields.includes("min") && {
|
|
292
|
+
// min: Yup.number().required("Min is required"),
|
|
293
|
+
// }),
|
|
294
|
+
...(currentFields.includes("min") && {
|
|
295
|
+
min: Yup.mixed().nullable()
|
|
296
|
+
.when("type", (type: any) => {
|
|
297
|
+
switch (selectedType.value) {
|
|
298
|
+
case "int":
|
|
299
|
+
return Yup.number().nullable().typeError("Min must be an integer")
|
|
300
|
+
.integer("Min must be an integer");
|
|
301
|
+
case "decimal":
|
|
302
|
+
case "shortText":
|
|
303
|
+
case "longText":
|
|
304
|
+
case "richText":
|
|
305
|
+
case "json":
|
|
306
|
+
return Yup.number().nullable().typeError("Min must be an integer");
|
|
307
|
+
default:
|
|
308
|
+
return Yup.mixed().nullable().nullable(); // Default fallback if no match
|
|
309
|
+
}
|
|
310
|
+
}),
|
|
311
|
+
}),
|
|
312
|
+
// ...(currentFields.includes("max") && {
|
|
313
|
+
// max: Yup.number().required("Max is required"),
|
|
314
|
+
// }),
|
|
315
|
+
...(currentFields.includes("max") && {
|
|
316
|
+
max: Yup.mixed()
|
|
317
|
+
.when("type", (type: any) => {
|
|
318
|
+
switch (selectedType.value) {
|
|
319
|
+
case "int":
|
|
320
|
+
return Yup.number().nullable().typeError("Max must be an integer")
|
|
321
|
+
.integer("Max must be an integer")
|
|
322
|
+
.test(
|
|
323
|
+
"greater-than-min",
|
|
324
|
+
"Max must be greater than Min",
|
|
325
|
+
function (value) {
|
|
326
|
+
const { min } = this.parent; // Access sibling field 'min'
|
|
327
|
+
// if (min != null && value == null) {
|
|
328
|
+
// // Trigger error if Min is filled but Max is empty
|
|
329
|
+
// return this.createError({
|
|
330
|
+
// message: "Max is required if Min is specified",
|
|
331
|
+
// });
|
|
332
|
+
// }
|
|
333
|
+
return value == null || value > min; // Validate only if Max exists
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
case "decimal":
|
|
339
|
+
case "shortText":
|
|
340
|
+
case "longText":
|
|
341
|
+
case "richText":
|
|
342
|
+
case "json":
|
|
343
|
+
return Yup.number().nullable().typeError("Max must be an integer")
|
|
344
|
+
.test(
|
|
345
|
+
"greater-than-min",
|
|
346
|
+
"Max must be greater than Min",
|
|
347
|
+
function (value) {
|
|
348
|
+
const { min } = this.parent; // Access sibling field 'min'
|
|
349
|
+
// if (min != null && value == null) {
|
|
350
|
+
// // Trigger error if Min is filled but Max is empty
|
|
351
|
+
// return this.createError({
|
|
352
|
+
// message: "Max is required if Min is specified",
|
|
353
|
+
// });
|
|
354
|
+
// }
|
|
355
|
+
return value == null || value > min; // Validate only if Max exists
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
default:
|
|
361
|
+
return Yup.mixed().nullable().nullable(); // Default fallback if no match
|
|
362
|
+
}
|
|
363
|
+
}),
|
|
364
|
+
}),
|
|
365
|
+
...(currentFields.includes("private") && {
|
|
366
|
+
private: Yup.boolean(),
|
|
367
|
+
}),
|
|
368
|
+
...(currentFields.includes("mediaTypes") && {
|
|
369
|
+
mediaTypes: Yup.mixed().required("Media Types must be an array").required("Media Types is required"),
|
|
370
|
+
}),
|
|
371
|
+
|
|
372
|
+
...(currentFields.includes("mediaMaxSizeKb") && {
|
|
373
|
+
mediaMaxSizeKb: Yup.number().required("Media Max Size is required"),
|
|
374
|
+
}),
|
|
375
|
+
...(currentFields.includes("mediaStorageProviderId") && {
|
|
376
|
+
mediaStorageProviderId: Yup.number().required(
|
|
377
|
+
"Media Storage Provider is required"
|
|
378
|
+
),
|
|
379
|
+
}),
|
|
380
|
+
...(currentFields.includes("mediaStorageProviderId") && {
|
|
381
|
+
mediaStorageProvider: Yup.object().required(
|
|
382
|
+
"Media Storage Provider is required"
|
|
383
|
+
),
|
|
384
|
+
}),
|
|
385
|
+
|
|
386
|
+
...(currentFields.includes("mediaEmbedded") && {
|
|
387
|
+
mediaEmbedded: Yup.boolean(),
|
|
388
|
+
}),
|
|
389
|
+
...(currentFields.includes("relationType") && {
|
|
390
|
+
relationType: Yup.string().required("Relation Type is required"),
|
|
391
|
+
}),
|
|
392
|
+
...(currentFields.includes("relationCoModelSingularName") && {
|
|
393
|
+
relationCoModelSingularName: Yup.string().required(
|
|
394
|
+
"Relation Model Singular Name is required"
|
|
395
|
+
),
|
|
396
|
+
}),
|
|
397
|
+
...(currentFields.includes("relationCoModelFieldName") && {
|
|
398
|
+
relationCoModelFieldName: Yup.string()
|
|
399
|
+
// .required(
|
|
400
|
+
// "Relation Model Field Name is required"
|
|
401
|
+
// ),
|
|
402
|
+
}),
|
|
403
|
+
...(currentFields.includes("relationCreateInverse") && {
|
|
404
|
+
relationCreateInverse: Yup.boolean(),
|
|
405
|
+
}),
|
|
406
|
+
...(currentFields.includes("relationCoModelFieldName") && {
|
|
407
|
+
relationCoModelFieldName: Yup.string().when("relationCreateInverse", (relationCreateInverse: any, schema) => {
|
|
408
|
+
console.log("relationCreateInverse", relationCreateInverse);
|
|
409
|
+
if (relationCreateInverse.length > 0 && relationCreateInverse[0] == true) {
|
|
410
|
+
return schema.required("Relation Co Model Field Name is required")
|
|
411
|
+
} else {
|
|
412
|
+
return schema.notRequired();
|
|
413
|
+
}
|
|
414
|
+
}),
|
|
415
|
+
}),
|
|
416
|
+
|
|
417
|
+
// ...(currentFields.includes("relationCascade") && {
|
|
418
|
+
// relationCascade: Yup.string().required(
|
|
419
|
+
// "Relation Cascade Value is required"
|
|
420
|
+
// ),
|
|
421
|
+
// }),
|
|
422
|
+
|
|
423
|
+
// Conditionally validate relationCascade based on relationType
|
|
424
|
+
...(currentFields.includes("relation") && {
|
|
425
|
+
relationCascade: Yup.string().when("relationType", (relationType: any, schema) => {
|
|
426
|
+
return relationType === "one-to-one"
|
|
427
|
+
? schema.required("Relation Cascade Value is required for one-to-one relationships")
|
|
428
|
+
: schema.notRequired();
|
|
429
|
+
}),
|
|
430
|
+
}),
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
...(currentFields.includes("relationModelModuleName") && {
|
|
434
|
+
relationModelModuleName: Yup.string().required(
|
|
435
|
+
"Relation Model Module Name Value is required"
|
|
436
|
+
),
|
|
437
|
+
}),
|
|
438
|
+
|
|
439
|
+
...(currentFields.includes("relationFieldFixedFilter") && {
|
|
440
|
+
relationFieldFixedFilter: Yup.string().nullable(),
|
|
441
|
+
}),
|
|
442
|
+
|
|
443
|
+
...(currentFields.includes("selectionDynamicProvider") && {
|
|
444
|
+
selectionDynamicProvider: Yup.string().required(
|
|
445
|
+
"Selection Dynamic Provider Value is required"
|
|
446
|
+
),
|
|
447
|
+
}),
|
|
448
|
+
...(currentFields.includes("selectionDynamicProviderCtxt") && {
|
|
449
|
+
selectionDynamicProviderCtxt: Yup.string().required(
|
|
450
|
+
"Selection Dynamic Provider Context Value is required"
|
|
451
|
+
).test(
|
|
452
|
+
"is-valid-json",
|
|
453
|
+
"Computed Field Value Provider Context Value must be valid JSON",
|
|
454
|
+
(value) => {
|
|
455
|
+
if (!value) return false; // Ensure it's required
|
|
456
|
+
try {
|
|
457
|
+
JSON.parse(value); // Check if it's valid JSON
|
|
458
|
+
return true;
|
|
459
|
+
} catch {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
}),
|
|
465
|
+
|
|
466
|
+
...(currentFields.includes("selectionStaticValues") && {
|
|
467
|
+
selectionStaticValues: Yup.array().of(
|
|
468
|
+
Yup.string().matches(/^[\w\s\d-]+:[\w\s-]+$/, "Label and Value are required.")
|
|
469
|
+
),
|
|
470
|
+
}),
|
|
471
|
+
...(currentFields.includes("computedFieldValueProvider") && {
|
|
472
|
+
computedFieldValueProvider: Yup.string().required(
|
|
473
|
+
"Computed Field Function Value is required"
|
|
474
|
+
),
|
|
475
|
+
}),
|
|
476
|
+
...(currentFields.includes("computedFieldValueProviderCtxt") && {
|
|
477
|
+
computedFieldValueProviderCtxt: Yup.string().required(
|
|
478
|
+
"Computed Field Value Provider Context Value is required"
|
|
479
|
+
).test(
|
|
480
|
+
"is-valid-json",
|
|
481
|
+
"Computed Field Value Provider Context Value must be valid JSON",
|
|
482
|
+
(value) => {
|
|
483
|
+
if (!value) return false; // Ensure it's required
|
|
484
|
+
try {
|
|
485
|
+
JSON.parse(value); // Check if it's valid JSON
|
|
486
|
+
return true;
|
|
487
|
+
} catch {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
|
|
493
|
+
}),
|
|
494
|
+
...(currentFields.includes("computedFieldValueType") && {
|
|
495
|
+
computedFieldValueType: Yup.string().required(
|
|
496
|
+
"Computed Field Value Type is required"
|
|
497
|
+
),
|
|
498
|
+
}),
|
|
499
|
+
|
|
500
|
+
...(currentFields.includes("columnName") && {
|
|
501
|
+
columnName: Yup.string().nullable().matches(
|
|
502
|
+
/^[a-z0-9_]+$/,
|
|
503
|
+
"Column name must be in snake_case (lowercase letters, numbers, and underscores only)."
|
|
504
|
+
),
|
|
505
|
+
}),
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
// ...(currentFields.includes("externalIdProvider") && {
|
|
511
|
+
// externalIdProvider: Yup.string().required(
|
|
512
|
+
// "ExternalId Provider Value is required"
|
|
513
|
+
// ),
|
|
514
|
+
// }),
|
|
515
|
+
// ...(currentFields.includes("externalIdProviderCtxt") && {
|
|
516
|
+
// externalIdProviderCtxt: Yup.string().required(
|
|
517
|
+
// "EexternalId Provider Context Value is required"
|
|
518
|
+
// ),
|
|
519
|
+
// }),
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
return Yup.object(schema);
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldMetaData, allFields, deleteModelFunction, setVisiblePopup, params, setIsRequiredPopUp, showToaster }: any) => {
|
|
526
|
+
|
|
527
|
+
const booleanOptions = ["false", "true"];
|
|
528
|
+
const [isBackPopupVisible, setIsBackPopupVisible] = useState(false);
|
|
529
|
+
const [showColumnName, setShowColumnName] = useState<any>(false);
|
|
530
|
+
|
|
531
|
+
const pathname = usePathname();
|
|
532
|
+
|
|
533
|
+
const toast = useRef<Toast>(null);
|
|
534
|
+
const { data: fieldDefaultMetaData, isLoading, error, refetch } = useGetFieldDefaultMetaDataQuery(null);
|
|
535
|
+
const [currentFields, setCurrentFields] = useState(
|
|
536
|
+
fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
const [triggerGetMediaStorageProvider, { data: MediaStorageProviderData, isFetching: isMediaStorageProviderFetching, error: MediaStorageProviderError }] = useLazyGetMediaStorageProvidersQuery();
|
|
540
|
+
const [triggerGetModules, { data: moduleData, isFetching: isModuleFetching, error: moduleError }] = useLazyGetmodulesQuery();
|
|
541
|
+
const [triggerGetModels, { data: modelData, isFetching: ismodelFetching, error: modelError }] = useLazyGetModelsQuery();
|
|
542
|
+
const [
|
|
543
|
+
updateUserKey,
|
|
544
|
+
{ isLoading: isUpdateUserKeyLoading, isSuccess: isUpdateUserKeySuccess, isError: isUpdateUserKeyError, error: UpdateUserKeyError, data: newModel },
|
|
545
|
+
] = useUpdateUserKeyMutation();
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
const [markdownText, setMarkdownText] = useState<string>();
|
|
549
|
+
const [encryptState, setEncryptState] = useState<any>(false);
|
|
550
|
+
|
|
551
|
+
const [showTypeFilter, setShowTypeFilter] = useState(fieldMetaData ? false : true);
|
|
552
|
+
const [selectedType, setSelectedType] = useState(fieldMetaData?.type && { label: fieldMetaData?.type, value: fieldMetaData?.type });
|
|
553
|
+
const [selectedComputedFieldValueType, setSelectedComputedFieldValueType] = useState(fieldMetaData?.computedFieldValueType && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType });
|
|
554
|
+
const [selectionDynamicProvider, setSelectionDynamicProvider] = useState(fieldMetaData?.selectionDynamicProvider && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider });
|
|
555
|
+
// const [externalIdProvider, setExternalIdProvider] = useState(fieldMetaData?.externalIdProvider && { label: fieldMetaData.externalIdProvider, value: fieldMetaData.externalIdProvider });
|
|
556
|
+
const [selectionStaticValues, setSelectionStaticValues] = useState(fieldMetaData && fieldMetaData.selectionStaticValues && fieldMetaData.selectionStaticValues.length > 0 && fieldMetaData?.selectionStaticValues.filter((line: any) => line.trim() !== "").join("\n"));
|
|
557
|
+
const [filteredComputedFieldValueTypes, setFilteredComputedFieldValueTypes] = useState([]);
|
|
558
|
+
const [
|
|
559
|
+
filteredSelectionDynamicProvider,
|
|
560
|
+
setFilteredSelectionDynamicProvider,
|
|
561
|
+
] = useState([]);
|
|
562
|
+
|
|
563
|
+
const [ormTypeOptions, setOrmTypeOptions] = useState([]);
|
|
564
|
+
const [selectedOrmType, setSelectedOrmType] = useState<any>(fieldMetaData?.ormType);
|
|
565
|
+
|
|
566
|
+
const [isUserKeyFields, setUserKeyFields] = useState(false);
|
|
567
|
+
const [userKeyData, setUserKeyData] = useState([]);
|
|
568
|
+
|
|
569
|
+
const [
|
|
570
|
+
filteredExternalIdProvider,
|
|
571
|
+
setFilteredExternalIdProvider,
|
|
572
|
+
] = useState([]);
|
|
573
|
+
|
|
574
|
+
const [filteredSelectionEncryptionType, setFilteredSelectionEncryptionType] = useState([]);
|
|
575
|
+
|
|
576
|
+
const [filteredSelectionDecryptWhen, setFilteredSelectionDecryptWhen] = useState([]);
|
|
577
|
+
|
|
578
|
+
const items = Array.from({ length: 100000 }).map((_, i) => ({
|
|
579
|
+
label: `Item #${i}`,
|
|
580
|
+
value: i,
|
|
581
|
+
}));
|
|
582
|
+
|
|
583
|
+
const validationSchema = React.useMemo(
|
|
584
|
+
() => createValidationSchema(currentFields, selectedType, allFields, fieldMetaData, encryptState),
|
|
585
|
+
[currentFields, encryptState]
|
|
586
|
+
);
|
|
587
|
+
|
|
588
|
+
const [typeSelected, setTypeSelected] = useState(false);
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
const searchMediaTypes = async (event: any) => {
|
|
592
|
+
const query = event.query;
|
|
593
|
+
try {
|
|
594
|
+
const suggestionData: any = fieldDefaultMetaData.data.mediaTypes.filter((t: any) => t.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
595
|
+
return suggestionData;
|
|
596
|
+
} catch (error) {
|
|
597
|
+
console.error("Error fetching items:", error);
|
|
598
|
+
return []
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
const searchMediaStorageProvIderId = async (event: any) => {
|
|
603
|
+
try {
|
|
604
|
+
const query = event.query;
|
|
605
|
+
const queryData = {
|
|
606
|
+
limit: 10,
|
|
607
|
+
offset: 0,
|
|
608
|
+
// filters: {
|
|
609
|
+
// name: {
|
|
610
|
+
// $containsi: query,
|
|
611
|
+
// },
|
|
612
|
+
// },
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
const queryString = qs.stringify(queryData, {
|
|
616
|
+
encodeValuesOnly: true,
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
const result = await triggerGetMediaStorageProvider(queryString).unwrap();
|
|
620
|
+
|
|
621
|
+
if (result && result.records) {
|
|
622
|
+
const updatedSuggestion = [...result.records];
|
|
623
|
+
return updatedSuggestion
|
|
624
|
+
} else {
|
|
625
|
+
return []
|
|
626
|
+
}
|
|
627
|
+
} catch (error) {
|
|
628
|
+
return []
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
const searchModel = async (event: any) => {
|
|
634
|
+
const query = event.query;
|
|
635
|
+
const queryData = {
|
|
636
|
+
limit: 10,
|
|
637
|
+
offset: 0,
|
|
638
|
+
// filters: {
|
|
639
|
+
// title: {
|
|
640
|
+
// $containsi: query
|
|
641
|
+
// }
|
|
642
|
+
// }
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
const queryString = qs.stringify(queryData, {
|
|
646
|
+
encodeValuesOnly: true
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
// Trigger the API call manually
|
|
650
|
+
const result = await triggerGetModels(queryString).unwrap(); // Unwrap to access the data
|
|
651
|
+
|
|
652
|
+
// Map the API response to AutoComplete format
|
|
653
|
+
if (result && result.records) {
|
|
654
|
+
const filteredMenu = result.records.map((m: any) => (
|
|
655
|
+
{
|
|
656
|
+
label: m.name,
|
|
657
|
+
value: m.id,
|
|
658
|
+
name: m.name,
|
|
659
|
+
id: m.id,
|
|
660
|
+
}
|
|
661
|
+
));
|
|
662
|
+
|
|
663
|
+
// Update the suggestions in state
|
|
664
|
+
return filteredMenu
|
|
665
|
+
} else {
|
|
666
|
+
// Handle the case where no data is returned
|
|
667
|
+
return []
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
const searchOrmTypes = async (event: any) => {
|
|
675
|
+
const query = event.query;
|
|
676
|
+
try {
|
|
677
|
+
|
|
678
|
+
const ormType = fieldDefaultMetaData.data.ormType[modelMetaData?.dataSourceType];
|
|
679
|
+
const _filteredOrmType = ormType[formik.values.type].ormTypes.map((e: any) => ({ label: e, value: e }))
|
|
680
|
+
|
|
681
|
+
const suggestionData: any = _filteredOrmType.filter((t: any) => t.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
682
|
+
return suggestionData
|
|
683
|
+
} catch (error) {
|
|
684
|
+
console.error("Error fetching items:", error);
|
|
685
|
+
return []
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
const searchRelationModelModuleNames = async (event: any) => {
|
|
693
|
+
try {
|
|
694
|
+
const query = event.query;
|
|
695
|
+
const queryData = {
|
|
696
|
+
limit: 10,
|
|
697
|
+
offset: 0,
|
|
698
|
+
filters: {
|
|
699
|
+
name: {
|
|
700
|
+
$containsi: query,
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
const queryString = qs.stringify(queryData, {
|
|
706
|
+
encodeValuesOnly: true,
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
const result = await triggerGetModules(queryString).unwrap(); // Unwrap to access the data
|
|
710
|
+
|
|
711
|
+
if (result && result.records) {
|
|
712
|
+
const updatedSuggestion = [...result.records];
|
|
713
|
+
return updatedSuggestion
|
|
714
|
+
} else {
|
|
715
|
+
return []
|
|
716
|
+
}
|
|
717
|
+
} catch (error) {
|
|
718
|
+
return []
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
const searchrelationCoModelSingularNames = async (event: any) => {
|
|
723
|
+
try {
|
|
724
|
+
const query = event.query;
|
|
725
|
+
const queryData: any = {
|
|
726
|
+
limit: 10,
|
|
727
|
+
offset: 0,
|
|
728
|
+
filters: {
|
|
729
|
+
module: {
|
|
730
|
+
name: {
|
|
731
|
+
$containsi: formik.values.relationModelModuleName
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
if (query) {
|
|
737
|
+
queryData.filters.singularName = {
|
|
738
|
+
$containsi: query,
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
const queryString = qs.stringify(queryData, {
|
|
742
|
+
encodeValuesOnly: true,
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
const result = await triggerGetModels(queryString).unwrap(); // Unwrap to access the data
|
|
746
|
+
|
|
747
|
+
if (result && result.records) {
|
|
748
|
+
const updatedSuggestion = [...result.records];
|
|
749
|
+
return updatedSuggestion
|
|
750
|
+
} else {
|
|
751
|
+
return []
|
|
752
|
+
}
|
|
753
|
+
} catch (error) {
|
|
754
|
+
return []
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
const searchUserKeyField = () => {
|
|
759
|
+
return userKeyData;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
const searchComputedFieldValueType = async (event: any) => {
|
|
763
|
+
const query = event.query;
|
|
764
|
+
try {
|
|
765
|
+
|
|
766
|
+
const _filteredTypes: any = fieldDefaultMetaData.data.computedFieldValueTypes.filter((t: any) => t.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
767
|
+
|
|
768
|
+
setFilteredComputedFieldValueTypes(_filteredTypes);
|
|
769
|
+
} catch (error) {
|
|
770
|
+
console.error("Error fetching items:", error);
|
|
771
|
+
setFilteredComputedFieldValueTypes([]);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
const searchSelectionDynamicProvider = async (event: any) => {
|
|
778
|
+
const query = event.query;
|
|
779
|
+
try {
|
|
780
|
+
const filterredData: any = fieldDefaultMetaData.data.selectionDynamicProviders.filter((t: any) => t.provider.toLowerCase().startsWith(query.toLowerCase()));
|
|
781
|
+
const transformedData = filterredData.map((e: any) => ({ label: e.provider, value: e.provider, help: e.help }));
|
|
782
|
+
return transformedData
|
|
783
|
+
} catch (error) {
|
|
784
|
+
console.error("Error fetching items:", error);
|
|
785
|
+
return []
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
const searchComputedProvider = async (event: any) => {
|
|
792
|
+
const query = event.query;
|
|
793
|
+
try {
|
|
794
|
+
const filterredData: any = fieldDefaultMetaData.data.computedProviders.filter((t: any) => t.provider.toLowerCase().startsWith(query.toLowerCase()));
|
|
795
|
+
const transformedData = filterredData.map((e: any) => ({ label: e.provider, value: e.provider, help: e.help }));
|
|
796
|
+
return transformedData
|
|
797
|
+
} catch (error) {
|
|
798
|
+
console.error("Error fetching items:", error);
|
|
799
|
+
return []
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
const searchExternalIdProvider = async (event: any) => {
|
|
804
|
+
const query = event.query;
|
|
805
|
+
try {
|
|
806
|
+
const filterredData: any = fieldDefaultMetaData.data.externalIdProviders.filter((t: any) => t.provider.toLowerCase().startsWith(query.toLowerCase()));
|
|
807
|
+
const transformedData = filterredData.map((e: any) => ({ label: e.provider, value: e.provider, help: e.help }));
|
|
808
|
+
return transformedData
|
|
809
|
+
} catch (error) {
|
|
810
|
+
console.error("Error fetching items:", error);
|
|
811
|
+
return []
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
const searchSelectionEncryptionType = async (event: any) => {
|
|
818
|
+
const query = event.query;
|
|
819
|
+
try {
|
|
820
|
+
|
|
821
|
+
const _filteredTypes: any = fieldDefaultMetaData.data.encryptionTypes.filter((t: any) => t.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
822
|
+
|
|
823
|
+
setFilteredSelectionEncryptionType(_filteredTypes);
|
|
824
|
+
return _filteredTypes
|
|
825
|
+
} catch (error) {
|
|
826
|
+
console.error("Error fetching items:", error);
|
|
827
|
+
setFilteredSelectionEncryptionType([]);
|
|
828
|
+
return []
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
const searchSelectionDecryptWhen = async (event: any) => {
|
|
833
|
+
const query = event.query;
|
|
834
|
+
try {
|
|
835
|
+
|
|
836
|
+
const _filteredTypes: any = fieldDefaultMetaData.data.decryptWhenTypes.filter((t: any) => t.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
837
|
+
|
|
838
|
+
setFilteredSelectionDecryptWhen(_filteredTypes);
|
|
839
|
+
return _filteredTypes
|
|
840
|
+
} catch (error) {
|
|
841
|
+
console.error("Error fetching items:", error);
|
|
842
|
+
setFilteredSelectionDecryptWhen([]);
|
|
843
|
+
return []
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
const isFormFieldValid = (formik: any, fieldName: string) => {
|
|
849
|
+
return formik.touched[fieldName] && formik.errors[fieldName];
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
const mediaStorageProviderId = [
|
|
854
|
+
{ label: "mediaStorageProviderId", value: "mediaStorageProviderId" },
|
|
855
|
+
{ label: "id2", value: "2" },
|
|
856
|
+
];
|
|
857
|
+
|
|
858
|
+
const selctionValueTypes = [
|
|
859
|
+
{ label: "String", value: "string" },
|
|
860
|
+
{ label: "Int", value: "int" },
|
|
861
|
+
];
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
const relationCreateInverses = [
|
|
865
|
+
{ label: "True", value: "true" },
|
|
866
|
+
{ label: "False", value: "false" },
|
|
867
|
+
];
|
|
868
|
+
|
|
869
|
+
const [selectedPasswordPolicy, setSelectedPasswordPolicy] = useState<any>(fieldMetaData?.regexPattern);
|
|
870
|
+
const passwordPolicyOptions = [
|
|
871
|
+
{ label: 'Lowercase and Uppercase Alphabets Required', value: '^(?=.*[a-z])(?=.*[A-Z]).*$' },
|
|
872
|
+
{ label: 'Lowercase and Uppercase Alphabets and Numbers Required', value: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).*$' },
|
|
873
|
+
{ label: 'Lowercase and Uppercase Alphabets, Numbers, and Special Characters Required', value: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&]).*$' },
|
|
874
|
+
{ label: 'custom', value: 'custom' },
|
|
875
|
+
|
|
876
|
+
];
|
|
877
|
+
|
|
878
|
+
const mediaTypesOptions = [
|
|
879
|
+
{ label: 'Image (Supports JPEG, PNG, WEBP, etc.)', value: 'image' },
|
|
880
|
+
{ label: 'Audio (Supports MP3, WAV, AAC, etc.)', value: 'audio' },
|
|
881
|
+
{ label: 'Video (Supports MP4, AVI, MKV, etc.)', value: 'video' },
|
|
882
|
+
{ label: 'File (Supports PDF, DOCX, TXT, etc.)', value: 'file' }
|
|
883
|
+
];
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
const initialValues = {
|
|
887
|
+
name: fieldMetaData ? fieldMetaData?.name : null,
|
|
888
|
+
displayName: fieldMetaData ? fieldMetaData?.displayName : null,
|
|
889
|
+
description: fieldMetaData ? fieldMetaData?.description : null,
|
|
890
|
+
type: fieldMetaData ? fieldMetaData?.type : null,
|
|
891
|
+
ormType: fieldMetaData ? fieldMetaData?.ormType : null,
|
|
892
|
+
length: fieldMetaData ? fieldMetaData?.length : null,
|
|
893
|
+
defaultValue: fieldMetaData ? fieldMetaData?.defaultValue : null,
|
|
894
|
+
regexPattern: fieldMetaData ? fieldMetaData?.regexPattern : null,
|
|
895
|
+
regexPatternNotMatchingErrorMsg: fieldMetaData ? fieldMetaData?.regexPatternNotMatchingErrorMsg : "",
|
|
896
|
+
required: fieldMetaData ? fieldMetaData?.required : false,
|
|
897
|
+
unique: fieldMetaData ? fieldMetaData?.unique : false,
|
|
898
|
+
encrypt: fieldMetaData ? fieldMetaData?.encrypt : false,
|
|
899
|
+
encryptionType: fieldMetaData ? fieldMetaData?.encryptionType : null,
|
|
900
|
+
decryptWhen: fieldMetaData ? fieldMetaData?.decryptWhen : null,
|
|
901
|
+
index: fieldMetaData ? fieldMetaData?.index : false,
|
|
902
|
+
min: fieldMetaData ? fieldMetaData?.min : null,
|
|
903
|
+
max: fieldMetaData ? fieldMetaData?.max : null,
|
|
904
|
+
private: fieldMetaData ? fieldMetaData?.private : false,
|
|
905
|
+
mediaTypes: fieldMetaData ? fieldMetaData?.mediaTypes : null,
|
|
906
|
+
mediaMaxSizeKb: fieldMetaData ? fieldMetaData?.mediaMaxSizeKb : null,
|
|
907
|
+
mediaStorageProviderId: fieldMetaData ? fieldMetaData?.mediaStorageProvider?.id : null,
|
|
908
|
+
mediaStorageProvider: fieldMetaData ? fieldMetaData?.mediaStorageProvider : null,
|
|
909
|
+
mediaEmbedded: fieldMetaData ? (fieldMetaData?.mediaEmbedded && fieldMetaData?.mediaEmbedded.toString()) : "true",
|
|
910
|
+
relationType: fieldMetaData ? fieldMetaData?.relationType : null,
|
|
911
|
+
relationCoModelSingularName: fieldMetaData ? fieldMetaData?.relationCoModelSingularName : null,
|
|
912
|
+
relationCoModelFieldName: fieldMetaData ? fieldMetaData?.relationCoModelFieldName : null,
|
|
913
|
+
relationCreateInverse: fieldMetaData ? fieldMetaData?.relationCreateInverse : false,
|
|
914
|
+
relationCascade: fieldMetaData ? fieldMetaData?.relationCascade : 'cascade',
|
|
915
|
+
relationModelModuleName: fieldMetaData ? fieldMetaData?.relationModelModuleName : modelMetaData?.module.name,
|
|
916
|
+
relationFieldFixedFilter: fieldMetaData ? fieldMetaData?.relationFieldFixedFilter : "",
|
|
917
|
+
selectionDynamicProvider: fieldMetaData ? fieldMetaData?.selectionDynamicProvider : null,
|
|
918
|
+
selectionDynamicProviderCtxt: fieldMetaData ? fieldMetaData?.selectionDynamicProviderCtxt : "",
|
|
919
|
+
selectionStaticValues: fieldMetaData ? fieldMetaData?.selectionStaticValues : [""],
|
|
920
|
+
selectionValueType: fieldMetaData ? fieldMetaData?.selectionValueType : null,
|
|
921
|
+
computedFieldValueProvider: fieldMetaData ? fieldMetaData?.computedFieldValueProvider : null,
|
|
922
|
+
computedFieldValueType: fieldMetaData ? fieldMetaData?.computedFieldValueType : null,
|
|
923
|
+
computedFieldValueProviderCtxt: fieldMetaData ? fieldMetaData?.computedFieldValueProviderCtxt : "",
|
|
924
|
+
// externalIdProvider: fieldMetaData ? fieldMetaData?.externalIdProvider : null,
|
|
925
|
+
// externalIdProviderCtxt: fieldMetaData ? fieldMetaData?.externalIdProviderCtxt : "",
|
|
926
|
+
isSystem: fieldMetaData ? fieldMetaData?.isSystem : false,
|
|
927
|
+
columnName: fieldMetaData ? fieldMetaData?.columnName : null,
|
|
928
|
+
isUserKey: fieldMetaData ? fieldMetaData?.isUserKey : false,
|
|
929
|
+
relationCoModelColumnName: fieldMetaData ? fieldMetaData?.relationCoModelColumnName : null,
|
|
930
|
+
relationJoinTableName: fieldMetaData ? fieldMetaData?.relationJoinTableName : null,
|
|
931
|
+
userKey: fieldMetaData ? fieldMetaData?.userKey : null
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
const formik = useFormik({
|
|
936
|
+
initialValues,
|
|
937
|
+
validationSchema,
|
|
938
|
+
enableReinitialize: true,
|
|
939
|
+
onSubmit: async (values) => {
|
|
940
|
+
try {
|
|
941
|
+
setFieldMetaData((prevItems: any) => {
|
|
942
|
+
const newFieldData = { ...values, isSystem: values.isSystem == true ? true : '' }
|
|
943
|
+
const formtatedFieldPayload = fieldBasedPayloadFormating(newFieldData, currentFields, fieldMetaData);
|
|
944
|
+
const existingIndex = prevItems.findIndex((item: any) => item.identifier === formtatedFieldPayload.identifier);
|
|
945
|
+
if (existingIndex !== -1) {
|
|
946
|
+
const updatedItems = [...prevItems];
|
|
947
|
+
updatedItems[existingIndex] = formtatedFieldPayload;
|
|
948
|
+
return updatedItems
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
if (params?.id !== 'new' && formtatedFieldPayload?.required && !formtatedFieldPayload?.defaultValue) {
|
|
952
|
+
setIsRequiredPopUp(true);
|
|
953
|
+
}
|
|
954
|
+
return [...prevItems, formtatedFieldPayload]
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
if (values.userKey) {
|
|
958
|
+
const data = {
|
|
959
|
+
modelName: values.relationCoModelSingularName,
|
|
960
|
+
fieldName: values.userKey
|
|
961
|
+
}
|
|
962
|
+
updateUserKey(data);
|
|
963
|
+
}
|
|
964
|
+
// nextTab()
|
|
965
|
+
setVisiblePopup(false);
|
|
966
|
+
|
|
967
|
+
} catch (err) {
|
|
968
|
+
console.error("Failed to create Radix Model:", err);
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
validateOnBlur: false // Disable validation on blur
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
const showError = async () => {
|
|
978
|
+
const errors = await formik.validateForm(); // Trigger validation and get the updated errors
|
|
979
|
+
const errorMessages = Object.values(errors);
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
if (errorMessages.length > 0) {
|
|
983
|
+
toast?.current?.show({
|
|
984
|
+
severity: "error",
|
|
985
|
+
summary: "Can you send me the report?",
|
|
986
|
+
// sticky: true,
|
|
987
|
+
life: 3000,
|
|
988
|
+
//@ts-ignore
|
|
989
|
+
content: (props) => (
|
|
990
|
+
<div
|
|
991
|
+
className="flex flex-column align-items-left"
|
|
992
|
+
style={{ flex: "1" }}
|
|
993
|
+
>
|
|
994
|
+
{errorMessages.map((m, index) => (
|
|
995
|
+
<div className="flex align-items-center gap-2" key={index}>
|
|
996
|
+
<span className="font-bold text-900">{String(m)}</span>
|
|
997
|
+
</div>
|
|
998
|
+
))}
|
|
999
|
+
</div>
|
|
1000
|
+
),
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
useEffect(() => {
|
|
1006
|
+
if (isUpdateUserKeySuccess) {
|
|
1007
|
+
showToaster([newModel?.data?.message], "success");
|
|
1008
|
+
} if (isUpdateUserKeyError) {
|
|
1009
|
+
showToaster(UpdateUserKeyError, 'error')
|
|
1010
|
+
}
|
|
1011
|
+
}, [isUpdateUserKeySuccess, isUpdateUserKeyError])
|
|
1012
|
+
|
|
1013
|
+
const handleTypeSelect = (e: any, label: string) => {
|
|
1014
|
+
|
|
1015
|
+
setShowTypeFilter(false);
|
|
1016
|
+
setSelectedType({ label: label, value: e });
|
|
1017
|
+
formik.setFieldValue("type", e);
|
|
1018
|
+
if (e == "email") {
|
|
1019
|
+
formik.setFieldValue("regexPattern", "^[a-zA-Z0-9. _%+-]+@[a-zA-Z0-9. -]+\\. [a-zA-Z]{2,}$");
|
|
1020
|
+
} else {
|
|
1021
|
+
formik.setFieldValue("regexPattern", "");
|
|
1022
|
+
}
|
|
1023
|
+
const ormType = fieldDefaultMetaData.data.ormType[modelMetaData?.dataSourceType];
|
|
1024
|
+
const availableOrmTypes = ormType[e];
|
|
1025
|
+
// setFilteredOrmTypes(availableOrmTypes.ormTypes.map((e: any) => ({
|
|
1026
|
+
// label: e,
|
|
1027
|
+
// value: e,
|
|
1028
|
+
// })));
|
|
1029
|
+
// setSelectedOrmType({ label: availableOrmTypes.ormTypes[0], value: availableOrmTypes.ormTypes[0] });
|
|
1030
|
+
setOrmTypeOptions(availableOrmTypes.ormTypes)
|
|
1031
|
+
formik.setFieldValue("ormType", availableOrmTypes.ormTypes[0].label);
|
|
1032
|
+
setSelectedOrmType(availableOrmTypes.ormTypes[0].label)
|
|
1033
|
+
setCurrentFields(
|
|
1034
|
+
fetchCurrentFields(e, fieldDefaultMetaData)
|
|
1035
|
+
);
|
|
1036
|
+
// setTypeSelected(true);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
useEffect((() => {
|
|
1041
|
+
setOrmTypeOptions(fieldDefaultMetaData && formik.values.type && fieldDefaultMetaData.data.ormType[modelMetaData?.dataSourceType][formik.values.type].ormTypes);
|
|
1042
|
+
}), [formik])
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
useEffect(() => {
|
|
1046
|
+
if (fieldMetaData && fieldMetaData.columnName) {
|
|
1047
|
+
setShowColumnName(true)
|
|
1048
|
+
}
|
|
1049
|
+
}, [fieldMetaData])
|
|
1050
|
+
|
|
1051
|
+
useEffect(() => {
|
|
1052
|
+
const fetchFields = async () => {
|
|
1053
|
+
const queryData: any = {
|
|
1054
|
+
limit: 100,
|
|
1055
|
+
offset: 0,
|
|
1056
|
+
filters: {
|
|
1057
|
+
singularName: {
|
|
1058
|
+
$eq: formik.values.relationCoModelSingularName
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
populate: ['fields']
|
|
1062
|
+
};
|
|
1063
|
+
const queryString = qs.stringify(queryData, {
|
|
1064
|
+
encodeValuesOnly: true,
|
|
1065
|
+
});
|
|
1066
|
+
const result = await triggerGetModels(queryString).unwrap();
|
|
1067
|
+
|
|
1068
|
+
if (result && result.records) {
|
|
1069
|
+
if (!result?.records[0]?.userKeyField) {
|
|
1070
|
+
setUserKeyFields(true);
|
|
1071
|
+
const validUserKeyFields = result?.records[0]?.fields?.filter(
|
|
1072
|
+
(field: any) => field?.unique === true && field?.type === 'shortText'
|
|
1073
|
+
);
|
|
1074
|
+
setUserKeyData(validUserKeyFields)
|
|
1075
|
+
} else {
|
|
1076
|
+
setUserKeyFields(false);
|
|
1077
|
+
setUserKeyData([]);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
if (formik.values.relationCoModelSingularName) {
|
|
1082
|
+
fetchFields();
|
|
1083
|
+
}
|
|
1084
|
+
}, [formik.values.relationCoModelSingularName])
|
|
1085
|
+
|
|
1086
|
+
const updateEnumValues = (index: number, updatedString: string) => {
|
|
1087
|
+
const updatedValues = formik.values.selectionStaticValues.map((enumValue: string, i: number) =>
|
|
1088
|
+
i === index ? updatedString : enumValue
|
|
1089
|
+
);
|
|
1090
|
+
formik.setFieldValue("selectionStaticValues", updatedValues);
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
const addEnumValue = () => {
|
|
1094
|
+
formik.setFieldValue("selectionStaticValues", [...formik.values.selectionStaticValues, ":"]);
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
const deleteEnumValue = (index: number) => {
|
|
1098
|
+
if (formik.values.selectionStaticValues.length > 1) {
|
|
1099
|
+
const updatedRows = formik.values.selectionStaticValues.filter((_: string, rowIndex: number) => rowIndex !== index);
|
|
1100
|
+
formik.setFieldValue("selectionStaticValues", updatedRows);
|
|
1101
|
+
} else {
|
|
1102
|
+
|
|
1103
|
+
}
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
useEffect(() => {
|
|
1107
|
+
if (formik.dirty) {
|
|
1108
|
+
setIsDirty(true);
|
|
1109
|
+
}
|
|
1110
|
+
}, [formik.dirty]);
|
|
1111
|
+
|
|
1112
|
+
return (
|
|
1113
|
+
<div>
|
|
1114
|
+
<Toast ref={toast} />
|
|
1115
|
+
<div>
|
|
1116
|
+
<form onSubmit={formik.handleSubmit}>
|
|
1117
|
+
<div className="solid-field-metadata-form-header">
|
|
1118
|
+
{pathname.includes('create') ?
|
|
1119
|
+
<>
|
|
1120
|
+
<div className="flex align-items-center gap-3">
|
|
1121
|
+
{showTypeFilter === false ?
|
|
1122
|
+
<>
|
|
1123
|
+
<Button
|
|
1124
|
+
text
|
|
1125
|
+
icon='pi pi-arrow-left'
|
|
1126
|
+
size="small"
|
|
1127
|
+
type="button"
|
|
1128
|
+
aria-label="Back"
|
|
1129
|
+
className='max-w-2rem bg-primary-reverse text-color'
|
|
1130
|
+
onClick={() => {
|
|
1131
|
+
if (!formik.values.displayName) {
|
|
1132
|
+
setShowTypeFilter(true)
|
|
1133
|
+
} else {
|
|
1134
|
+
setIsBackPopupVisible(true)
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
/>
|
|
1139
|
+
<div className="form-wrapper-title text-base">{capitalize(modelMetaData?.displayName)}</div>
|
|
1140
|
+
</>
|
|
1141
|
+
:
|
|
1142
|
+
<div className="flex text-2xl font-bold align-items-center ml-4" style={{ color: '#000' }}>
|
|
1143
|
+
<div className="form-wrapper-title text-base">Model - {capitalize(modelMetaData?.displayName)}</div>
|
|
1144
|
+
</div>
|
|
1145
|
+
}
|
|
1146
|
+
</div>
|
|
1147
|
+
<div className="flex align-items-center gap-3 close-popup">
|
|
1148
|
+
<Button icon="pi pi-times" rounded text aria-label="Cancel" type="reset" size="small" onClick={() => setVisiblePopup(false)}
|
|
1149
|
+
className='max-w-2rem bg-primary-reverse text-color' />
|
|
1150
|
+
</div>
|
|
1151
|
+
</>
|
|
1152
|
+
:
|
|
1153
|
+
<>
|
|
1154
|
+
<div className="flex align-items-center gap-3">
|
|
1155
|
+
{!fieldMetaData?.id &&
|
|
1156
|
+
<Button
|
|
1157
|
+
text
|
|
1158
|
+
icon='pi pi-arrow-left'
|
|
1159
|
+
size="small"
|
|
1160
|
+
type="button"
|
|
1161
|
+
aria-label="Back"
|
|
1162
|
+
className='max-w-2rem bg-primary-reverse text-color'
|
|
1163
|
+
onClick={() => {
|
|
1164
|
+
if (!formik.values.displayName) {
|
|
1165
|
+
setShowTypeFilter(true)
|
|
1166
|
+
} else {
|
|
1167
|
+
setIsBackPopupVisible(true)
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
} />
|
|
1171
|
+
}
|
|
1172
|
+
{fieldMetaData ?
|
|
1173
|
+
|
|
1174
|
+
<div className="form-wrapper-title text-base">Edit {capitalize(fieldMetaData?.displayName)}</div>
|
|
1175
|
+
:
|
|
1176
|
+
<div className="form-wrapper-title text-base">Add New {selectedType?.label && !showTypeFilter && capitalize(selectedType.label)} Field to {capitalize(modelMetaData?.displayName)}</div>
|
|
1177
|
+
}
|
|
1178
|
+
</div>
|
|
1179
|
+
<div className="flex align-items-center gap-3 close-popup">
|
|
1180
|
+
<Button icon="pi pi-times" text aria-label="Cancel" type="reset" size="small" onClick={() => setVisiblePopup(false)}
|
|
1181
|
+
className='max-w-2rem bg-primary-reverse text-color'
|
|
1182
|
+
/>
|
|
1183
|
+
</div>
|
|
1184
|
+
</>
|
|
1185
|
+
}
|
|
1186
|
+
</div>
|
|
1187
|
+
{showTypeFilter === true ?
|
|
1188
|
+
<FieldSelector
|
|
1189
|
+
handleTypeSelect={handleTypeSelect}
|
|
1190
|
+
modelMetaData={modelMetaData}
|
|
1191
|
+
></FieldSelector>
|
|
1192
|
+
:
|
|
1193
|
+
<div className="p-4" style={{ maxHeight: '80vh', overflowY: 'auto', overflowX: 'hidden' }}>
|
|
1194
|
+
<div className="p-d-flex p-jc-center creat-field-for form-dem">
|
|
1195
|
+
<div className="p-fluid" style={{ position: 'relative' }}>
|
|
1196
|
+
{/* <div className="mb-3">
|
|
1197
|
+
<div className="form-wrapper-title">{fieldMetaData ? `Edit ${capitalize(selectedType.label)} Field` : `Add a new ${capitalize(selectedType.label)} Field`}</div>
|
|
1198
|
+
</div> */}
|
|
1199
|
+
<TabView panelContainerClassName="px-0">
|
|
1200
|
+
<TabPanel
|
|
1201
|
+
header="Basic Info"
|
|
1202
|
+
className={(formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : ""}
|
|
1203
|
+
// rightIcon="pi pi-info-circle ml-2"
|
|
1204
|
+
>
|
|
1205
|
+
<div className="formgrid grid">
|
|
1206
|
+
{currentFields.includes("displayName") && (
|
|
1207
|
+
<div className="field col-6 flex-flex-column gap-2 mt-2">
|
|
1208
|
+
<label htmlFor="displayName" className="form-field-label">
|
|
1209
|
+
Display Name
|
|
1210
|
+
</label>
|
|
1211
|
+
<InputText
|
|
1212
|
+
type="text"
|
|
1213
|
+
disabled={fieldMetaData?.id}
|
|
1214
|
+
id="displayName"
|
|
1215
|
+
name="displayName"
|
|
1216
|
+
onChange={(e) => {
|
|
1217
|
+
formik.setFieldValue("displayName", e.target.value);
|
|
1218
|
+
const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(e.target.value);
|
|
1219
|
+
formik.setFieldValue("name", toCamelCase);
|
|
1220
|
+
if (showColumnName) {
|
|
1221
|
+
formik.setFieldValue("columnName", toSnakeCase);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
}}
|
|
1225
|
+
value={formik.values.displayName}
|
|
1226
|
+
className={classNames("", {
|
|
1227
|
+
"p-invalid": isFormFieldValid(
|
|
1228
|
+
formik,
|
|
1229
|
+
"displayName"
|
|
1230
|
+
),
|
|
1231
|
+
})}
|
|
1232
|
+
/>
|
|
1233
|
+
{isFormFieldValid(formik, "displayName") && (
|
|
1234
|
+
<Message
|
|
1235
|
+
severity="error"
|
|
1236
|
+
text={formik?.errors?.displayName?.toString()}
|
|
1237
|
+
/>
|
|
1238
|
+
)}
|
|
1239
|
+
</div>
|
|
1240
|
+
)}
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
{currentFields.includes("name") && (
|
|
1244
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1245
|
+
<label htmlFor="name" className="form-field-label">
|
|
1246
|
+
Name
|
|
1247
|
+
</label>
|
|
1248
|
+
<InputText
|
|
1249
|
+
disabled={fieldMetaData?.id}
|
|
1250
|
+
type="text"
|
|
1251
|
+
id="name"
|
|
1252
|
+
name="name"
|
|
1253
|
+
onChange={formik.handleChange}
|
|
1254
|
+
value={formik.values.name}
|
|
1255
|
+
className={classNames("", {
|
|
1256
|
+
"p-invalid": isFormFieldValid(formik, "name"),
|
|
1257
|
+
})}
|
|
1258
|
+
/>
|
|
1259
|
+
{isFormFieldValid(formik, "name") && (
|
|
1260
|
+
<Message
|
|
1261
|
+
severity="error"
|
|
1262
|
+
text={formik?.errors?.name?.toString()}
|
|
1263
|
+
/>
|
|
1264
|
+
)}
|
|
1265
|
+
</div>
|
|
1266
|
+
)}
|
|
1267
|
+
{currentFields.includes("description") && (
|
|
1268
|
+
<div className="field col-6 flex-flex-column gap-2 mt-4">
|
|
1269
|
+
<label htmlFor="description" className="form-field-label">
|
|
1270
|
+
Description
|
|
1271
|
+
</label>
|
|
1272
|
+
<InputTextarea
|
|
1273
|
+
aria-describedby="Description of your field"
|
|
1274
|
+
id="description"
|
|
1275
|
+
name="description"
|
|
1276
|
+
onChange={formik.handleChange}
|
|
1277
|
+
value={formik.values.description}
|
|
1278
|
+
rows={5}
|
|
1279
|
+
cols={30}
|
|
1280
|
+
className={classNames("", {
|
|
1281
|
+
"p-invalid": isFormFieldValid(
|
|
1282
|
+
formik,
|
|
1283
|
+
"description"
|
|
1284
|
+
),
|
|
1285
|
+
})}
|
|
1286
|
+
/>
|
|
1287
|
+
{isFormFieldValid(formik, "description") && (
|
|
1288
|
+
<Message
|
|
1289
|
+
severity="error"
|
|
1290
|
+
text={formik?.errors?.description?.toString()}
|
|
1291
|
+
/>
|
|
1292
|
+
)}
|
|
1293
|
+
</div>
|
|
1294
|
+
)}
|
|
1295
|
+
|
|
1296
|
+
{currentFields.includes("columnName") && (
|
|
1297
|
+
<div className="field col-6 mt-4">
|
|
1298
|
+
<div className="flex align-items-center gap-2">
|
|
1299
|
+
<Checkbox onChange={e => {
|
|
1300
|
+
setShowColumnName(e.checked);
|
|
1301
|
+
if (e.checked === true) {
|
|
1302
|
+
const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(formik.values.displayName);
|
|
1303
|
+
if (pathname.includes('create')) {
|
|
1304
|
+
formik.setFieldValue("columnName", toSnakeCase);
|
|
1305
|
+
}
|
|
1306
|
+
} else {
|
|
1307
|
+
formik.setFieldValue("columnName", null);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
}} checked={showColumnName} disabled={fieldMetaData?.id}></Checkbox>
|
|
1311
|
+
<label htmlFor="ingredient1" className="form-field-label">
|
|
1312
|
+
Set Column Name
|
|
1313
|
+
</label>
|
|
1314
|
+
</div>
|
|
1315
|
+
{showColumnName &&
|
|
1316
|
+
<div className="field col-12 flex-flex-column gap-2 mt-4">
|
|
1317
|
+
<label htmlFor="columnName" className="form-field-label">
|
|
1318
|
+
Column Name
|
|
1319
|
+
</label>
|
|
1320
|
+
<InputText
|
|
1321
|
+
disabled={fieldMetaData?.id}
|
|
1322
|
+
type="text"
|
|
1323
|
+
id="columnName"
|
|
1324
|
+
name="columnName"
|
|
1325
|
+
onChange={formik.handleChange}
|
|
1326
|
+
value={formik.values.columnName}
|
|
1327
|
+
className={classNames("", {
|
|
1328
|
+
"p-invalid": isFormFieldValid(formik, "columnName"),
|
|
1329
|
+
})}
|
|
1330
|
+
/>
|
|
1331
|
+
{isFormFieldValid(formik, "columnName") && (
|
|
1332
|
+
<Message
|
|
1333
|
+
severity="error"
|
|
1334
|
+
text={formik?.errors?.columnName?.toString()}
|
|
1335
|
+
/>
|
|
1336
|
+
)}
|
|
1337
|
+
</div>
|
|
1338
|
+
}
|
|
1339
|
+
</div>
|
|
1340
|
+
)}
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
{/* {currentFields.includes("type") && (
|
|
1344
|
+
<div className="md:col-6 sm:col-12">
|
|
1345
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1346
|
+
<label htmlFor="type" className="form-field-label">
|
|
1347
|
+
Type
|
|
1348
|
+
</label>
|
|
1349
|
+
<AutoComplete
|
|
1350
|
+
value={selectedType}
|
|
1351
|
+
suggestions={filteredTypes}
|
|
1352
|
+
invalid={isFormFieldValid(formik, "type")}
|
|
1353
|
+
completeMethod={searchTypes}
|
|
1354
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
1355
|
+
field="label"
|
|
1356
|
+
className="small-input"
|
|
1357
|
+
dropdown
|
|
1358
|
+
onChange={(e) => {
|
|
1359
|
+
formik.setFieldTouched('type', true); // Manually mark as touched
|
|
1360
|
+
setSelectedType(e.value);
|
|
1361
|
+
formik.setFieldValue("type", e.value.value);
|
|
1362
|
+
if (e.value.value == "email") {
|
|
1363
|
+
formik.setFieldValue("regexPattern", "/^[a-zA-Z0-9. _%+-]+@[a-zA-Z0-9. -]+\\. [a-zA-Z]{2,}$/");
|
|
1364
|
+
} else {
|
|
1365
|
+
formik.setFieldValue("regexPattern", "");
|
|
1366
|
+
}
|
|
1367
|
+
const _filteredOrmType: any = fieldDefaultMetaData.data.ormType.filter((t: any) => t.solidType == e.value.value);
|
|
1368
|
+
setSelectedOrmType(_filteredOrmType[0].value)
|
|
1369
|
+
formik.setFieldValue("ormType", _filteredOrmType[0].value);
|
|
1370
|
+
|
|
1371
|
+
setCurrentFields(
|
|
1372
|
+
fetchCurrentFields(e.value.value, fieldDefaultMetaData)
|
|
1373
|
+
);
|
|
1374
|
+
}}
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
/>
|
|
1378
|
+
|
|
1379
|
+
{isFormFieldValid(formik, "type") && (
|
|
1380
|
+
<Message
|
|
1381
|
+
severity="error"
|
|
1382
|
+
text={formik?.errors?.type?.toString()}
|
|
1383
|
+
/>
|
|
1384
|
+
)}
|
|
1385
|
+
</div>
|
|
1386
|
+
</div>
|
|
1387
|
+
)} */}
|
|
1388
|
+
|
|
1389
|
+
</div>
|
|
1390
|
+
|
|
1391
|
+
</TabPanel>
|
|
1392
|
+
|
|
1393
|
+
<TabPanel header="Advance Config"
|
|
1394
|
+
|
|
1395
|
+
// rightIcon="pi pi-cog ml-2"
|
|
1396
|
+
>
|
|
1397
|
+
{formik?.values?.type?.length > 0 && (
|
|
1398
|
+
<div className="formgrid grid">
|
|
1399
|
+
{currentFields.includes("length") && (
|
|
1400
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1401
|
+
<label htmlFor="length" className="form-field-label">
|
|
1402
|
+
Length
|
|
1403
|
+
</label>
|
|
1404
|
+
<InputNumber
|
|
1405
|
+
// type="text"
|
|
1406
|
+
id="length"
|
|
1407
|
+
name="length"
|
|
1408
|
+
onValueChange={formik.handleChange}
|
|
1409
|
+
value={formik.values.length}
|
|
1410
|
+
className={classNames("", {
|
|
1411
|
+
"p-invalid": isFormFieldValid(
|
|
1412
|
+
formik,
|
|
1413
|
+
"length"
|
|
1414
|
+
),
|
|
1415
|
+
})}
|
|
1416
|
+
/>
|
|
1417
|
+
{isFormFieldValid(formik, "length") && (
|
|
1418
|
+
<Message
|
|
1419
|
+
severity="error"
|
|
1420
|
+
text={formik?.errors?.length?.toString()}
|
|
1421
|
+
/>
|
|
1422
|
+
)}
|
|
1423
|
+
</div>
|
|
1424
|
+
)}
|
|
1425
|
+
{currentFields.includes("defaultValue") && (
|
|
1426
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1427
|
+
<label
|
|
1428
|
+
htmlFor="defaultValue"
|
|
1429
|
+
className="form-field-label"
|
|
1430
|
+
>
|
|
1431
|
+
Default Value
|
|
1432
|
+
</label>
|
|
1433
|
+
{/* <InputText
|
|
1434
|
+
type="text"
|
|
1435
|
+
id="defaultValue"
|
|
1436
|
+
name="defaultValue"
|
|
1437
|
+
onChange={formik.handleChange}
|
|
1438
|
+
value={formik.values.defaultValue}
|
|
1439
|
+
className={classNames("", {
|
|
1440
|
+
"p-invalid": isFormFieldValid(
|
|
1441
|
+
formik,
|
|
1442
|
+
"defaultValue"
|
|
1443
|
+
),
|
|
1444
|
+
})}
|
|
1445
|
+
/> */}
|
|
1446
|
+
{(selectedType.value === "shortText" || selectedType.value === "longText" || selectedType.value === "richText" || selectedType.value === "json" || selectedType.value === "password" || selectedType.value === "selectionStatic") &&
|
|
1447
|
+
<InputText
|
|
1448
|
+
type="text"
|
|
1449
|
+
id="defaultValue"
|
|
1450
|
+
name="defaultValue"
|
|
1451
|
+
onChange={formik.handleChange}
|
|
1452
|
+
value={formik.values.defaultValue}
|
|
1453
|
+
className={classNames("", {
|
|
1454
|
+
"p-invalid": isFormFieldValid(
|
|
1455
|
+
formik,
|
|
1456
|
+
"defaultValue"
|
|
1457
|
+
),
|
|
1458
|
+
})}
|
|
1459
|
+
/>
|
|
1460
|
+
}
|
|
1461
|
+
{(selectedType.value === "float" || selectedType.value === "decimal") &&
|
|
1462
|
+
<InputNumber
|
|
1463
|
+
id="defaultValue"
|
|
1464
|
+
name="defaultValue"
|
|
1465
|
+
minFractionDigits={2}
|
|
1466
|
+
maxFractionDigits={5}
|
|
1467
|
+
value={formik.values.defaultValue}
|
|
1468
|
+
onValueChange={(e) => formik.setFieldValue("defaultValue", e.value)} // Ensure correct value change handling
|
|
1469
|
+
className={classNames("", {
|
|
1470
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1471
|
+
})}
|
|
1472
|
+
/>
|
|
1473
|
+
}
|
|
1474
|
+
{(selectedType.value === "int" || selectedType.value === "bigint") &&
|
|
1475
|
+
<InputNumber
|
|
1476
|
+
id="defaultValue"
|
|
1477
|
+
name="defaultValue"
|
|
1478
|
+
value={formik.values.defaultValue}
|
|
1479
|
+
onValueChange={(e) => formik.setFieldValue("defaultValue", e.value)} // Ensure correct value change handling
|
|
1480
|
+
className={classNames("", {
|
|
1481
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1482
|
+
})}
|
|
1483
|
+
/>
|
|
1484
|
+
}
|
|
1485
|
+
{selectedType.value === "boolean" &&
|
|
1486
|
+
<SelectButton
|
|
1487
|
+
value={formik.values.defaultValue ? formik.values.defaultValue : "false"}
|
|
1488
|
+
onChange={(e) => formik.setFieldValue("defaultValue", e.value)} // Custom handling for boolean input
|
|
1489
|
+
options={booleanOptions}
|
|
1490
|
+
className={classNames("", {
|
|
1491
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1492
|
+
})}
|
|
1493
|
+
/>
|
|
1494
|
+
}
|
|
1495
|
+
{(selectedType.value === "date" || selectedType.value === "datetime" || selectedType.value === "time") &&
|
|
1496
|
+
<Calendar
|
|
1497
|
+
id="defaultValue"
|
|
1498
|
+
name="defaultValue"
|
|
1499
|
+
value={formik.values.defaultValue ? new Date(formik.values.defaultValue) : null}
|
|
1500
|
+
onChange={(e) => formik.setFieldValue("defaultValue", e.value)} // Use setFieldValue for proper handling
|
|
1501
|
+
showTime={formik.values.type === "datetime"} // Show time picker for datetime
|
|
1502
|
+
timeOnly={formik.values.type === "time"} // Time-only for time
|
|
1503
|
+
dateFormat="yy-mm-dd"
|
|
1504
|
+
hourFormat="24" // 24-hour format for time
|
|
1505
|
+
className={classNames("", {
|
|
1506
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1507
|
+
})}
|
|
1508
|
+
/>
|
|
1509
|
+
}
|
|
1510
|
+
{isFormFieldValid(formik, "defaultValue") && (
|
|
1511
|
+
<Message
|
|
1512
|
+
severity="error"
|
|
1513
|
+
text={formik?.errors?.defaultValue?.toString()}
|
|
1514
|
+
/>
|
|
1515
|
+
)}
|
|
1516
|
+
</div>
|
|
1517
|
+
)}
|
|
1518
|
+
|
|
1519
|
+
{currentFields.includes("mediaTypes") && (
|
|
1520
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1521
|
+
<label
|
|
1522
|
+
htmlFor="mediaTypes"
|
|
1523
|
+
className="form-field-label"
|
|
1524
|
+
>
|
|
1525
|
+
Media Type
|
|
1526
|
+
</label>
|
|
1527
|
+
{/* <MultipleSelectAutoCompleteField
|
|
1528
|
+
key="mediaTypes"
|
|
1529
|
+
formik={formik}
|
|
1530
|
+
isFormFieldValid={isFormFieldValid}
|
|
1531
|
+
fieldName="mediaTypes"
|
|
1532
|
+
fieldNameId="mediaTypes"
|
|
1533
|
+
labelKey="label"
|
|
1534
|
+
valueKey="value"
|
|
1535
|
+
searchData={searchMediaTypes}
|
|
1536
|
+
existingData={formik.values.mediaTypes}
|
|
1537
|
+
/> */}
|
|
1538
|
+
|
|
1539
|
+
{/* {selectedType.value === "mediaSingle" &&
|
|
1540
|
+
<SingleSelectAutoCompleteField
|
|
1541
|
+
key="mediaTypes"
|
|
1542
|
+
formik={formik}
|
|
1543
|
+
isFormFieldValid={isFormFieldValid}
|
|
1544
|
+
fieldName="mediaTypes"
|
|
1545
|
+
fieldNameId="mediaTypes"
|
|
1546
|
+
labelKey="label"
|
|
1547
|
+
valueKey="value"
|
|
1548
|
+
searchData={searchMediaTypes}
|
|
1549
|
+
existingData={formik.values.mediaTypes}
|
|
1550
|
+
/>
|
|
1551
|
+
} */}
|
|
1552
|
+
|
|
1553
|
+
{isFormFieldValid(formik, "mediaTypes") && (
|
|
1554
|
+
<Message
|
|
1555
|
+
severity="error"
|
|
1556
|
+
text={formik?.errors?.mediaTypes?.toString()}
|
|
1557
|
+
/>
|
|
1558
|
+
)}
|
|
1559
|
+
<MultiSelect value={formik.values.mediaTypes} onChange={(e) => formik.setFieldValue("mediaTypes", e.value)} options={mediaTypesOptions} optionLabel="label"
|
|
1560
|
+
placeholder="Select Media Types" maxSelectedLabels={3} display="chip" className="" />
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
{/* <Dropdown
|
|
1564
|
+
id="mediaTypes"
|
|
1565
|
+
name="mediaTypes"
|
|
1566
|
+
multiple
|
|
1567
|
+
value={formik.values.mediaTypes}
|
|
1568
|
+
options={fieldDefaultMetaData.data.mediaTypes}
|
|
1569
|
+
onChange={(e) =>
|
|
1570
|
+
formik.setFieldValue("mediaTypes", e.value)
|
|
1571
|
+
}
|
|
1572
|
+
placeholder="Select a Media Type"
|
|
1573
|
+
className={classNames("", {
|
|
1574
|
+
"p-invalid": isFormFieldValid(
|
|
1575
|
+
formik,
|
|
1576
|
+
"mediaTypes"
|
|
1577
|
+
),
|
|
1578
|
+
})}
|
|
1579
|
+
/> */}
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
</div>
|
|
1583
|
+
)}
|
|
1584
|
+
{currentFields.includes("mediaMaxSizeKb") && (
|
|
1585
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1586
|
+
<label
|
|
1587
|
+
htmlFor="mediaMaxSizeKb"
|
|
1588
|
+
className="form-field-label"
|
|
1589
|
+
>
|
|
1590
|
+
Media Max Size (Mb)
|
|
1591
|
+
</label>
|
|
1592
|
+
<InputNumber
|
|
1593
|
+
id="mediaMaxSizeKb"
|
|
1594
|
+
name="mediaMaxSizeKb"
|
|
1595
|
+
onValueChange={formik.handleChange}
|
|
1596
|
+
value={formik.values.mediaMaxSizeKb}
|
|
1597
|
+
className={classNames("", {
|
|
1598
|
+
"p-invalid": isFormFieldValid(
|
|
1599
|
+
formik,
|
|
1600
|
+
"mediaMaxSizeKb"
|
|
1601
|
+
),
|
|
1602
|
+
})}
|
|
1603
|
+
/>
|
|
1604
|
+
|
|
1605
|
+
{isFormFieldValid(formik, "mediaMaxSizeKb") && (
|
|
1606
|
+
<Message
|
|
1607
|
+
severity="error"
|
|
1608
|
+
text={formik?.errors?.mediaMaxSizeKb?.toString()}
|
|
1609
|
+
/>
|
|
1610
|
+
)}
|
|
1611
|
+
</div>
|
|
1612
|
+
)}
|
|
1613
|
+
{currentFields.includes("mediaStorageProviderId") && (
|
|
1614
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1615
|
+
<label
|
|
1616
|
+
htmlFor="mediaStorageProviderId"
|
|
1617
|
+
className="form-field-label"
|
|
1618
|
+
>
|
|
1619
|
+
Media Storage Provider
|
|
1620
|
+
</label>
|
|
1621
|
+
|
|
1622
|
+
<SingleSelectAutoCompleteField
|
|
1623
|
+
key="mediaStorageProviderId"
|
|
1624
|
+
formik={formik}
|
|
1625
|
+
isFormFieldValid={isFormFieldValid}
|
|
1626
|
+
relationField={true}
|
|
1627
|
+
fieldName="mediaStorageProvider"
|
|
1628
|
+
fieldNameId="mediaStorageProviderId"
|
|
1629
|
+
labelKey="name"
|
|
1630
|
+
valueKey="value"
|
|
1631
|
+
searchData={searchMediaStorageProvIderId}
|
|
1632
|
+
existingData={formik.values.mediaStorageProvider}
|
|
1633
|
+
/>
|
|
1634
|
+
|
|
1635
|
+
{isFormFieldValid(
|
|
1636
|
+
formik,
|
|
1637
|
+
"mediaStorageProvider"
|
|
1638
|
+
) && (
|
|
1639
|
+
<Message
|
|
1640
|
+
severity="error"
|
|
1641
|
+
text={formik?.errors?.mediaStorageProviderId?.toString()}
|
|
1642
|
+
/>
|
|
1643
|
+
)}
|
|
1644
|
+
</div>
|
|
1645
|
+
)}
|
|
1646
|
+
|
|
1647
|
+
{currentFields.includes("mediaEmbedded") && (
|
|
1648
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1649
|
+
<label
|
|
1650
|
+
htmlFor="mediaEmbedded"
|
|
1651
|
+
className="form-field-label"
|
|
1652
|
+
>
|
|
1653
|
+
Media Embedded
|
|
1654
|
+
</label>
|
|
1655
|
+
{/* <InputText
|
|
1656
|
+
type="text"
|
|
1657
|
+
id="mediaEmbedded"
|
|
1658
|
+
name="mediaEmbedded"
|
|
1659
|
+
onChange={formik.handleChange}
|
|
1660
|
+
value={formik.values.mediaEmbedded}
|
|
1661
|
+
className={classNames("", {
|
|
1662
|
+
"p-invalid": isFormFieldValid(
|
|
1663
|
+
formik,
|
|
1664
|
+
"mediaEmbedded"
|
|
1665
|
+
),
|
|
1666
|
+
})}
|
|
1667
|
+
/> */}
|
|
1668
|
+
<SelectButton
|
|
1669
|
+
value={formik.values.mediaEmbedded}
|
|
1670
|
+
// onChange={formik.handleChange}
|
|
1671
|
+
onChange={(e) => {
|
|
1672
|
+
formik.setFieldValue("mediaEmbedded", e.value);
|
|
1673
|
+
}}
|
|
1674
|
+
options={booleanOptions}
|
|
1675
|
+
className={classNames("", {
|
|
1676
|
+
"p-invalid": isFormFieldValid(
|
|
1677
|
+
formik,
|
|
1678
|
+
"mediaEmbedded"
|
|
1679
|
+
),
|
|
1680
|
+
})}
|
|
1681
|
+
/>
|
|
1682
|
+
{isFormFieldValid(formik, "mediaEmbedded") && (
|
|
1683
|
+
<Message
|
|
1684
|
+
severity="error"
|
|
1685
|
+
text={formik?.errors?.mediaEmbedded?.toString()}
|
|
1686
|
+
/>
|
|
1687
|
+
)}
|
|
1688
|
+
</div>
|
|
1689
|
+
)}
|
|
1690
|
+
{currentFields.includes("relationType") && (
|
|
1691
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1692
|
+
{/* <label
|
|
1693
|
+
htmlFor="relationType"
|
|
1694
|
+
className="form-field-label"
|
|
1695
|
+
>
|
|
1696
|
+
Relation Type
|
|
1697
|
+
</label>
|
|
1698
|
+
<Dropdown
|
|
1699
|
+
id="relationType"
|
|
1700
|
+
name="relationType"
|
|
1701
|
+
value={formik.values.relationType}
|
|
1702
|
+
options={fieldDefaultMetaData.data.relationTypes}
|
|
1703
|
+
onChange={(e) =>
|
|
1704
|
+
formik.setFieldValue("relationType", e.value)
|
|
1705
|
+
}
|
|
1706
|
+
placeholder="Select a Data Source"
|
|
1707
|
+
className={classNames("", {
|
|
1708
|
+
"p-invalid": isFormFieldValid(
|
|
1709
|
+
formik,
|
|
1710
|
+
"relationType"
|
|
1711
|
+
),
|
|
1712
|
+
})}
|
|
1713
|
+
/> */}
|
|
1714
|
+
|
|
1715
|
+
<label
|
|
1716
|
+
htmlFor="relationType"
|
|
1717
|
+
className="form-field-label "
|
|
1718
|
+
>
|
|
1719
|
+
Relation Type
|
|
1720
|
+
</label>
|
|
1721
|
+
<SelectButton
|
|
1722
|
+
value={formik.values.relationType}
|
|
1723
|
+
options={fieldDefaultMetaData.data.relationTypes}
|
|
1724
|
+
onChange={(e) => {
|
|
1725
|
+
formik.setFieldValue("relationType", e.value);
|
|
1726
|
+
if (e.value === "one-to-many") {
|
|
1727
|
+
formik.setFieldValue("relationCreateInverse", true);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
className={classNames("", {
|
|
1732
|
+
"p-invalid": isFormFieldValid(formik, "relationType"),
|
|
1733
|
+
})}
|
|
1734
|
+
optionLabel="label"
|
|
1735
|
+
/>
|
|
1736
|
+
|
|
1737
|
+
{/* <div className="align-items-center">
|
|
1738
|
+
<div className="flex mt-3">
|
|
1739
|
+
{fieldDefaultMetaData?.data?.relationTypes.map((i: any) => (
|
|
1740
|
+
<div key={i.value} className="mr-3">
|
|
1741
|
+
<RadioButton
|
|
1742
|
+
inputId="ingredient1"
|
|
1743
|
+
name="pizza"
|
|
1744
|
+
value={i.value}
|
|
1745
|
+
onChange={(e) => formik.setFieldValue("relationType", e.value)}
|
|
1746
|
+
checked={formik.values.relationType === i.value}
|
|
1747
|
+
/>
|
|
1748
|
+
<label htmlFor="ingredient1" className="form-field-label ml-2">{i.value}</label>
|
|
1749
|
+
</div>
|
|
1750
|
+
))}
|
|
1751
|
+
</div>
|
|
1752
|
+
</div> */}
|
|
1753
|
+
|
|
1754
|
+
{isFormFieldValid(formik, "relationType") && (
|
|
1755
|
+
<Message
|
|
1756
|
+
severity="error"
|
|
1757
|
+
text={formik?.errors?.relationType?.toString()}
|
|
1758
|
+
/>
|
|
1759
|
+
)}
|
|
1760
|
+
</div>
|
|
1761
|
+
)}
|
|
1762
|
+
{currentFields.includes("relationType") && formik.values.relationType === "many-to-one" && (
|
|
1763
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1764
|
+
<label
|
|
1765
|
+
htmlFor="relationCascade"
|
|
1766
|
+
className="form-field-label"
|
|
1767
|
+
>
|
|
1768
|
+
Relation Cascade
|
|
1769
|
+
</label>
|
|
1770
|
+
<Dropdown
|
|
1771
|
+
id="relationCascade"
|
|
1772
|
+
name="relationCascade"
|
|
1773
|
+
value={formik.values.relationCascade}
|
|
1774
|
+
options={fieldDefaultMetaData.data.cascadeTypes}
|
|
1775
|
+
onChange={(e) =>
|
|
1776
|
+
formik.setFieldValue(
|
|
1777
|
+
"relationCascade",
|
|
1778
|
+
e.value
|
|
1779
|
+
)
|
|
1780
|
+
}
|
|
1781
|
+
placeholder="Cascade"
|
|
1782
|
+
className={classNames("w-full", {
|
|
1783
|
+
"p-invalid": isFormFieldValid(
|
|
1784
|
+
formik,
|
|
1785
|
+
"relationCascade"
|
|
1786
|
+
),
|
|
1787
|
+
})}
|
|
1788
|
+
/>
|
|
1789
|
+
{isFormFieldValid(formik, "relationCascade") && (
|
|
1790
|
+
<Message
|
|
1791
|
+
severity="error"
|
|
1792
|
+
text={formik?.errors?.relationCascade?.toString()}
|
|
1793
|
+
/>
|
|
1794
|
+
)}
|
|
1795
|
+
</div>
|
|
1796
|
+
)}
|
|
1797
|
+
|
|
1798
|
+
{currentFields.includes("relationModelModuleName") && (
|
|
1799
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1800
|
+
<label
|
|
1801
|
+
htmlFor="relationModelModuleName"
|
|
1802
|
+
className="form-field-label"
|
|
1803
|
+
>
|
|
1804
|
+
Co-Module Name
|
|
1805
|
+
</label>
|
|
1806
|
+
|
|
1807
|
+
<SingleSelectAutoCompleteField
|
|
1808
|
+
key="relationModelModuleName"
|
|
1809
|
+
formik={formik}
|
|
1810
|
+
isFormFieldValid={isFormFieldValid}
|
|
1811
|
+
fieldName="relationModelModuleName"
|
|
1812
|
+
fieldNameId="relationModelModuleName"
|
|
1813
|
+
labelKey="name"
|
|
1814
|
+
valueKey="name"
|
|
1815
|
+
searchData={searchRelationModelModuleNames}
|
|
1816
|
+
existingData={formik.values.relationModelModuleName}
|
|
1817
|
+
additionalAction={(e: any) => {
|
|
1818
|
+
formik.setFieldValue("relationCoModelSingularName", "");
|
|
1819
|
+
formik.setFieldValue("relationCoModelColumnName", "");
|
|
1820
|
+
formik.setFieldValue("relationJoinTableName", "");
|
|
1821
|
+
}}
|
|
1822
|
+
/>
|
|
1823
|
+
|
|
1824
|
+
{/* <AutoComplete
|
|
1825
|
+
value={selectedRelationModelModuleName}
|
|
1826
|
+
suggestions={filteredRelationModelModuleNames}
|
|
1827
|
+
invalid={isFormFieldValid(
|
|
1828
|
+
formik,
|
|
1829
|
+
"relationModelModuleName"
|
|
1830
|
+
)}
|
|
1831
|
+
completeMethod={searchRelationModelModuleNames}
|
|
1832
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
1833
|
+
field="label"
|
|
1834
|
+
className="small-input"
|
|
1835
|
+
dropdown
|
|
1836
|
+
onChange={(e) => {
|
|
1837
|
+
setSelectedRelationModelModuleName(e.value);
|
|
1838
|
+
formik.setFieldValue(
|
|
1839
|
+
"relationModelModuleName",
|
|
1840
|
+
e.value
|
|
1841
|
+
);
|
|
1842
|
+
}}
|
|
1843
|
+
/> */}
|
|
1844
|
+
|
|
1845
|
+
{isFormFieldValid(
|
|
1846
|
+
formik,
|
|
1847
|
+
"relationModelModuleName"
|
|
1848
|
+
) && (
|
|
1849
|
+
<Message
|
|
1850
|
+
severity="error"
|
|
1851
|
+
text={formik?.errors?.relationModelModuleName?.toString()}
|
|
1852
|
+
/>
|
|
1853
|
+
)}
|
|
1854
|
+
</div>
|
|
1855
|
+
)}
|
|
1856
|
+
|
|
1857
|
+
{currentFields.includes(
|
|
1858
|
+
"relationCoModelSingularName"
|
|
1859
|
+
) && (
|
|
1860
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1861
|
+
<label
|
|
1862
|
+
htmlFor="relationCoModelSingularName"
|
|
1863
|
+
className="form-field-label"
|
|
1864
|
+
>
|
|
1865
|
+
Co-Model Name
|
|
1866
|
+
</label>
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
<SingleSelectAutoCompleteField
|
|
1870
|
+
key="relationCoModelSingularName"
|
|
1871
|
+
formik={formik}
|
|
1872
|
+
isFormFieldValid={isFormFieldValid}
|
|
1873
|
+
fieldName="relationCoModelSingularName"
|
|
1874
|
+
fieldNameId="relationCoModelSingularName"
|
|
1875
|
+
labelKey="displayName"
|
|
1876
|
+
valueKey="singularName"
|
|
1877
|
+
searchData={searchrelationCoModelSingularNames}
|
|
1878
|
+
existingData={formik.values.relationCoModelSingularName}
|
|
1879
|
+
/>
|
|
1880
|
+
{isFormFieldValid(
|
|
1881
|
+
formik,
|
|
1882
|
+
"relationCoModelSingularName"
|
|
1883
|
+
) && (
|
|
1884
|
+
<Message
|
|
1885
|
+
severity="error"
|
|
1886
|
+
text={formik?.errors?.relationCoModelSingularName?.toString()}
|
|
1887
|
+
/>
|
|
1888
|
+
)}
|
|
1889
|
+
</div>
|
|
1890
|
+
)}
|
|
1891
|
+
|
|
1892
|
+
{currentFields.includes(
|
|
1893
|
+
"relationFieldFixedFilter"
|
|
1894
|
+
) && (
|
|
1895
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1896
|
+
<label
|
|
1897
|
+
htmlFor="relationFieldFixedFilter"
|
|
1898
|
+
className="form-field-label"
|
|
1899
|
+
>
|
|
1900
|
+
Relation Field Fixed Filter
|
|
1901
|
+
</label>
|
|
1902
|
+
|
|
1903
|
+
<InputTextarea
|
|
1904
|
+
aria-describedby="Fixed Filter"
|
|
1905
|
+
id="relationFieldFixedFilter"
|
|
1906
|
+
name="relationFieldFixedFilter"
|
|
1907
|
+
onChange={formik.handleChange}
|
|
1908
|
+
value={formik.values.relationFieldFixedFilter}
|
|
1909
|
+
rows={5}
|
|
1910
|
+
cols={30}
|
|
1911
|
+
className={classNames("", {
|
|
1912
|
+
"p-invalid": isFormFieldValid(
|
|
1913
|
+
formik,
|
|
1914
|
+
"relationFieldFixedFilter"
|
|
1915
|
+
),
|
|
1916
|
+
})}
|
|
1917
|
+
/>
|
|
1918
|
+
{/*
|
|
1919
|
+
<InputText
|
|
1920
|
+
type="text"
|
|
1921
|
+
id="relationFieldFixedFilter"
|
|
1922
|
+
name="relationFieldFixedFilter"
|
|
1923
|
+
onChange={formik.handleChange}
|
|
1924
|
+
disabled={fieldMetaData?.id}
|
|
1925
|
+
value={formik.values.relationFieldFixedFilter}
|
|
1926
|
+
className={classNames("", {
|
|
1927
|
+
"p-invalid": isFormFieldValid(
|
|
1928
|
+
formik,
|
|
1929
|
+
"relationFieldFixedFilter"
|
|
1930
|
+
),
|
|
1931
|
+
})}
|
|
1932
|
+
/> */}
|
|
1933
|
+
{isFormFieldValid(formik, "relationFieldFixedFilter") && (
|
|
1934
|
+
<Message
|
|
1935
|
+
severity="error"
|
|
1936
|
+
text={formik?.errors?.relationFieldFixedFilter?.toString()}
|
|
1937
|
+
/>
|
|
1938
|
+
)}
|
|
1939
|
+
|
|
1940
|
+
</div>
|
|
1941
|
+
)}
|
|
1942
|
+
{isUserKeyFields && (
|
|
1943
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1944
|
+
<label
|
|
1945
|
+
htmlFor="userKey"
|
|
1946
|
+
className="form-field-label"
|
|
1947
|
+
>
|
|
1948
|
+
Set User Key
|
|
1949
|
+
</label>
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
<SingleSelectAutoCompleteField
|
|
1953
|
+
key="userKey"
|
|
1954
|
+
formik={formik}
|
|
1955
|
+
isFormFieldValid={isFormFieldValid}
|
|
1956
|
+
fieldName="userKey"
|
|
1957
|
+
fieldNameId="userKey"
|
|
1958
|
+
labelKey="displayName"
|
|
1959
|
+
valueKey="name"
|
|
1960
|
+
searchData={searchUserKeyField}
|
|
1961
|
+
existingData={formik.values.userKey}
|
|
1962
|
+
/>
|
|
1963
|
+
{isFormFieldValid(
|
|
1964
|
+
formik,
|
|
1965
|
+
"userKey"
|
|
1966
|
+
) && (
|
|
1967
|
+
<Message
|
|
1968
|
+
severity="error"
|
|
1969
|
+
text={formik?.errors?.userKey?.toString()}
|
|
1970
|
+
/>
|
|
1971
|
+
)}
|
|
1972
|
+
</div>
|
|
1973
|
+
)}
|
|
1974
|
+
|
|
1975
|
+
{currentFields.includes("relationCreateInverse") && (
|
|
1976
|
+
<div className="field col-6 flex flex-column gap-2 mt-3">
|
|
1977
|
+
<label htmlFor="relationCreateInverse" className="form-field-label">
|
|
1978
|
+
Relation Create Inverse
|
|
1979
|
+
</label>
|
|
1980
|
+
<div className="flex align-items-center">
|
|
1981
|
+
<Checkbox
|
|
1982
|
+
inputId="relationCreateInverse"
|
|
1983
|
+
name="relationCreateInverse"
|
|
1984
|
+
checked={formik.values.relationCreateInverse}
|
|
1985
|
+
disabled={formik.values.relationType === "one-to-many" ? true : false}
|
|
1986
|
+
onChange={(e) => formik.setFieldValue("relationCreateInverse", e.checked)}
|
|
1987
|
+
/>
|
|
1988
|
+
<label htmlFor="relationCreateInverse" className="ml-2">Create Inverse</label>
|
|
1989
|
+
</div>
|
|
1990
|
+
{isFormFieldValid(formik, "relationCreateInverse") && (
|
|
1991
|
+
<Message severity="error" text={formik?.errors?.relationCreateInverse?.toString()} />
|
|
1992
|
+
)}
|
|
1993
|
+
</div>
|
|
1994
|
+
)}
|
|
1995
|
+
|
|
1996
|
+
{currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && (
|
|
1997
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1998
|
+
<label
|
|
1999
|
+
htmlFor="relationCoModelFieldName"
|
|
2000
|
+
className="form-field-label"
|
|
2001
|
+
>
|
|
2002
|
+
Relation Co-Model Field Name
|
|
2003
|
+
</label>
|
|
2004
|
+
<InputText
|
|
2005
|
+
type="text"
|
|
2006
|
+
id="relationCoModelFieldName"
|
|
2007
|
+
name="relationCoModelFieldName"
|
|
2008
|
+
onChange={formik.handleChange}
|
|
2009
|
+
disabled={fieldMetaData?.id}
|
|
2010
|
+
value={formik.values.relationCoModelFieldName}
|
|
2011
|
+
className={classNames("", {
|
|
2012
|
+
"p-invalid": isFormFieldValid(
|
|
2013
|
+
formik,
|
|
2014
|
+
"relationCoModelFieldName"
|
|
2015
|
+
),
|
|
2016
|
+
})}
|
|
2017
|
+
/>
|
|
2018
|
+
{isFormFieldValid(formik, "relationCoModelFieldName") && (
|
|
2019
|
+
<Message
|
|
2020
|
+
severity="error"
|
|
2021
|
+
text={formik?.errors?.relationCoModelFieldName?.toString()}
|
|
2022
|
+
/>
|
|
2023
|
+
)}
|
|
2024
|
+
|
|
2025
|
+
</div>
|
|
2026
|
+
)}
|
|
2027
|
+
|
|
2028
|
+
{/* {currentFields.includes("joinColumnName") && formik.values.relationType === "many-to-many" && (
|
|
2029
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2030
|
+
<label
|
|
2031
|
+
htmlFor="joinColumnName"
|
|
2032
|
+
className="form-field-label"
|
|
2033
|
+
>
|
|
2034
|
+
Join Column Name
|
|
2035
|
+
</label>
|
|
2036
|
+
<InputText
|
|
2037
|
+
type="text"
|
|
2038
|
+
id="joinColumnName"
|
|
2039
|
+
name="joinColumnName"
|
|
2040
|
+
onChange={formik.handleChange}
|
|
2041
|
+
value={formik.values.joinColumnName}
|
|
2042
|
+
className={classNames("", {
|
|
2043
|
+
"p-invalid": isFormFieldValid(
|
|
2044
|
+
formik,
|
|
2045
|
+
"joinColumnName"
|
|
2046
|
+
),
|
|
2047
|
+
})}
|
|
2048
|
+
/>
|
|
2049
|
+
{isFormFieldValid(formik, "joinColumnName") && (
|
|
2050
|
+
<Message
|
|
2051
|
+
severity="error"
|
|
2052
|
+
text={formik?.errors?.joinColumnName?.toString()}
|
|
2053
|
+
/>
|
|
2054
|
+
)}
|
|
2055
|
+
|
|
2056
|
+
</div>
|
|
2057
|
+
)} */}
|
|
2058
|
+
|
|
2059
|
+
{currentFields.includes("relationCoModelColumnName") && formik.values.relationCreateInverse && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (
|
|
2060
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2061
|
+
<label
|
|
2062
|
+
htmlFor="relationCoModelColumnName"
|
|
2063
|
+
className="form-field-label"
|
|
2064
|
+
>
|
|
2065
|
+
Relation Co-Model Column Name
|
|
2066
|
+
</label>
|
|
2067
|
+
<InputText
|
|
2068
|
+
type="text"
|
|
2069
|
+
id="relationCoModelColumnName"
|
|
2070
|
+
name="relationCoModelColumnName"
|
|
2071
|
+
onChange={formik.handleChange}
|
|
2072
|
+
disabled={fieldMetaData?.id}
|
|
2073
|
+
value={formik.values.relationCoModelColumnName}
|
|
2074
|
+
className={classNames("", {
|
|
2075
|
+
"p-invalid": isFormFieldValid(
|
|
2076
|
+
formik,
|
|
2077
|
+
"relationCoModelColumnName"
|
|
2078
|
+
),
|
|
2079
|
+
})}
|
|
2080
|
+
/>
|
|
2081
|
+
{isFormFieldValid(formik, "relationCoModelColumnName") && (
|
|
2082
|
+
<Message
|
|
2083
|
+
severity="error"
|
|
2084
|
+
text={formik?.errors?.relationCoModelColumnName?.toString()}
|
|
2085
|
+
/>
|
|
2086
|
+
)}
|
|
2087
|
+
|
|
2088
|
+
</div>
|
|
2089
|
+
)}
|
|
2090
|
+
|
|
2091
|
+
{currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (
|
|
2092
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2093
|
+
<label
|
|
2094
|
+
htmlFor="relationJoinTableName"
|
|
2095
|
+
className="form-field-label"
|
|
2096
|
+
>
|
|
2097
|
+
Relation Join Table Name
|
|
2098
|
+
</label>
|
|
2099
|
+
<InputText
|
|
2100
|
+
type="text"
|
|
2101
|
+
id="relationJoinTableName"
|
|
2102
|
+
name="relationJoinTableName"
|
|
2103
|
+
onChange={formik.handleChange}
|
|
2104
|
+
disabled={fieldMetaData?.id}
|
|
2105
|
+
value={formik.values.relationJoinTableName}
|
|
2106
|
+
className={classNames("", {
|
|
2107
|
+
"p-invalid": isFormFieldValid(
|
|
2108
|
+
formik,
|
|
2109
|
+
"relationJoinTableName"
|
|
2110
|
+
),
|
|
2111
|
+
})}
|
|
2112
|
+
/>
|
|
2113
|
+
{isFormFieldValid(formik, "relationJoinTableName") && (
|
|
2114
|
+
<Message
|
|
2115
|
+
severity="error"
|
|
2116
|
+
text={formik?.errors?.relationJoinTableName?.toString()}
|
|
2117
|
+
/>
|
|
2118
|
+
)}
|
|
2119
|
+
|
|
2120
|
+
</div>
|
|
2121
|
+
)}
|
|
2122
|
+
|
|
2123
|
+
{currentFields.includes("selectionDynamicProvider") && (
|
|
2124
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2125
|
+
<label
|
|
2126
|
+
htmlFor="selectionDynamicProvider"
|
|
2127
|
+
className="form-field-label"
|
|
2128
|
+
>
|
|
2129
|
+
Selection Dynamic Provider
|
|
2130
|
+
</label>
|
|
2131
|
+
|
|
2132
|
+
<SingleSelectAutoCompleteField
|
|
2133
|
+
key="selectionDynamicProvider"
|
|
2134
|
+
formik={formik}
|
|
2135
|
+
isFormFieldValid={isFormFieldValid}
|
|
2136
|
+
// relationField={false}
|
|
2137
|
+
fieldName="selectionDynamicProvider"
|
|
2138
|
+
fieldNameId={null}
|
|
2139
|
+
labelKey="label"
|
|
2140
|
+
valueKey="value"
|
|
2141
|
+
searchData={searchSelectionDynamicProvider}
|
|
2142
|
+
existingData={formik.values.selectionDynamicProvider}
|
|
2143
|
+
additionalAction={(e: any) => setMarkdownText(e.target.value.help)}
|
|
2144
|
+
/>
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
{/* <AutoComplete
|
|
2148
|
+
value={selectionDynamicProvider}
|
|
2149
|
+
suggestions={filteredSelectionDynamicProvider}
|
|
2150
|
+
invalid={isFormFieldValid(
|
|
2151
|
+
formik,
|
|
2152
|
+
"selectionDynamicProvider"
|
|
2153
|
+
)}
|
|
2154
|
+
completeMethod={searchSelectionDynamicProvider}
|
|
2155
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
2156
|
+
field="label"
|
|
2157
|
+
className="small-input"
|
|
2158
|
+
dropdown
|
|
2159
|
+
onChange={(e) => {
|
|
2160
|
+
setSelectionDynamicProvider(e.value);
|
|
2161
|
+
formik.setFieldValue(
|
|
2162
|
+
"selectionDynamicProvider",
|
|
2163
|
+
e.value.value
|
|
2164
|
+
);
|
|
2165
|
+
}}
|
|
2166
|
+
/> */}
|
|
2167
|
+
|
|
2168
|
+
{isFormFieldValid(
|
|
2169
|
+
formik,
|
|
2170
|
+
"selectionDynamicProvider"
|
|
2171
|
+
) && (
|
|
2172
|
+
<Message
|
|
2173
|
+
severity="error"
|
|
2174
|
+
text={formik?.errors?.selectionDynamicProvider?.toString()}
|
|
2175
|
+
/>
|
|
2176
|
+
)}
|
|
2177
|
+
</div>
|
|
2178
|
+
)}
|
|
2179
|
+
{currentFields.includes("selectionValueType") && (
|
|
2180
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2181
|
+
<label
|
|
2182
|
+
htmlFor="selectionValueType"
|
|
2183
|
+
className="form-field-label"
|
|
2184
|
+
>
|
|
2185
|
+
Select Value Type
|
|
2186
|
+
</label>
|
|
2187
|
+
<Dropdown
|
|
2188
|
+
id="selectionValueType"
|
|
2189
|
+
name="selectionValueType"
|
|
2190
|
+
value={formik.values.selectionValueType}
|
|
2191
|
+
options={selctionValueTypes}
|
|
2192
|
+
onChange={(e) =>
|
|
2193
|
+
formik.setFieldValue(
|
|
2194
|
+
"selectionValueType",
|
|
2195
|
+
e.value
|
|
2196
|
+
)
|
|
2197
|
+
}
|
|
2198
|
+
placeholder="Select Value Type"
|
|
2199
|
+
className={classNames("", {
|
|
2200
|
+
"p-invalid": isFormFieldValid(
|
|
2201
|
+
formik,
|
|
2202
|
+
"selectionValueType"
|
|
2203
|
+
),
|
|
2204
|
+
})}
|
|
2205
|
+
/>
|
|
2206
|
+
{isFormFieldValid(
|
|
2207
|
+
formik,
|
|
2208
|
+
"selectionValueType"
|
|
2209
|
+
) && (
|
|
2210
|
+
<Message
|
|
2211
|
+
severity="error"
|
|
2212
|
+
text={formik?.errors?.selectionValueType?.toString()}
|
|
2213
|
+
/>
|
|
2214
|
+
)}
|
|
2215
|
+
</div>
|
|
2216
|
+
)}
|
|
2217
|
+
|
|
2218
|
+
{currentFields.includes("selectionStaticValues") && (
|
|
2219
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2220
|
+
<label
|
|
2221
|
+
htmlFor="selectionStaticValues"
|
|
2222
|
+
className="form-field-label"
|
|
2223
|
+
>
|
|
2224
|
+
Selection Static Values
|
|
2225
|
+
</label>
|
|
2226
|
+
{/* <InputTextarea
|
|
2227
|
+
value={selectionStaticValues}
|
|
2228
|
+
placeholder="male:Male"
|
|
2229
|
+
onChange={(e) => {
|
|
2230
|
+
const data = e.target.value
|
|
2231
|
+
.split("\n")
|
|
2232
|
+
.filter((line) => line.trim() !== "");
|
|
2233
|
+
|
|
2234
|
+
setSelectionStaticValues(e.target.value);
|
|
2235
|
+
formik.setFieldValue(
|
|
2236
|
+
"selectionStaticValues",
|
|
2237
|
+
data
|
|
2238
|
+
);
|
|
2239
|
+
}}
|
|
2240
|
+
rows={5}
|
|
2241
|
+
cols={30}
|
|
2242
|
+
/> */}
|
|
2243
|
+
{formik.values.selectionStaticValues.map((enumValue: string, index: number) => (
|
|
2244
|
+
<SelectionStaticValues
|
|
2245
|
+
key={index}
|
|
2246
|
+
enumValue={enumValue}
|
|
2247
|
+
onUpdate={(updatedString: any) => updateEnumValues(index, updatedString)}
|
|
2248
|
+
onDelete={() => deleteEnumValue(index)}
|
|
2249
|
+
onAdd={addEnumValue}
|
|
2250
|
+
/>
|
|
2251
|
+
))
|
|
2252
|
+
}
|
|
2253
|
+
{isFormFieldValid(
|
|
2254
|
+
formik,
|
|
2255
|
+
"selectionStaticValues"
|
|
2256
|
+
) && (
|
|
2257
|
+
<Message
|
|
2258
|
+
severity="error"
|
|
2259
|
+
text={formik?.errors?.selectionStaticValues?.toString()}
|
|
2260
|
+
/>
|
|
2261
|
+
)}
|
|
2262
|
+
</div>
|
|
2263
|
+
)}
|
|
2264
|
+
{currentFields.includes("computedFieldValueType") && (
|
|
2265
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2266
|
+
<label
|
|
2267
|
+
htmlFor="computedFieldValueType"
|
|
2268
|
+
className="form-field-label"
|
|
2269
|
+
>
|
|
2270
|
+
Computed Field Value Type
|
|
2271
|
+
</label>
|
|
2272
|
+
<AutoComplete
|
|
2273
|
+
|
|
2274
|
+
value={selectedComputedFieldValueType}
|
|
2275
|
+
invalid={isFormFieldValid(formik, "computedFieldValueType")}
|
|
2276
|
+
suggestions={filteredComputedFieldValueTypes}
|
|
2277
|
+
completeMethod={searchComputedFieldValueType}
|
|
2278
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
2279
|
+
field="label"
|
|
2280
|
+
dropdown
|
|
2281
|
+
className="solid-standard-autocomplete"
|
|
2282
|
+
onChange={(e) => {
|
|
2283
|
+
setSelectedComputedFieldValueType(e.value);
|
|
2284
|
+
formik.setFieldValue("computedFieldValueType", e.value.value);
|
|
2285
|
+
}}
|
|
2286
|
+
/>
|
|
2287
|
+
|
|
2288
|
+
{/* <Dropdown
|
|
2289
|
+
id="mediaTypes"
|
|
2290
|
+
name="mediaTypes"
|
|
2291
|
+
value={formik.values.mediaTypes}
|
|
2292
|
+
options={fieldDefaultMetaData.data.mediaTypes}
|
|
2293
|
+
onChange={(e) =>
|
|
2294
|
+
formik.setFieldValue("mediaTypes", e.value)
|
|
2295
|
+
}
|
|
2296
|
+
placeholder="Select a Data Source"
|
|
2297
|
+
className={classNames("", {
|
|
2298
|
+
"p-invalid": isFormFieldValid(
|
|
2299
|
+
formik,
|
|
2300
|
+
"mediaTypes"
|
|
2301
|
+
),
|
|
2302
|
+
})}
|
|
2303
|
+
/> */}
|
|
2304
|
+
{isFormFieldValid(formik, "computedFieldValueType") && (
|
|
2305
|
+
<Message
|
|
2306
|
+
severity="error"
|
|
2307
|
+
text={formik?.errors?.computedFieldValueType?.toString()}
|
|
2308
|
+
/>
|
|
2309
|
+
)}
|
|
2310
|
+
</div>
|
|
2311
|
+
)}
|
|
2312
|
+
|
|
2313
|
+
{currentFields.includes(
|
|
2314
|
+
"computedFieldValueProvider"
|
|
2315
|
+
) && (
|
|
2316
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2317
|
+
<label
|
|
2318
|
+
htmlFor="computedFieldValueProvider"
|
|
2319
|
+
className="form-field-label"
|
|
2320
|
+
>
|
|
2321
|
+
Computed Field Provider
|
|
2322
|
+
</label>
|
|
2323
|
+
|
|
2324
|
+
<SingleSelectAutoCompleteField
|
|
2325
|
+
key="computedFieldValueProvider"
|
|
2326
|
+
formik={formik}
|
|
2327
|
+
isFormFieldValid={isFormFieldValid}
|
|
2328
|
+
// relationField={false}
|
|
2329
|
+
fieldName="computedFieldValueProvider"
|
|
2330
|
+
fieldNameId={null}
|
|
2331
|
+
labelKey="label"
|
|
2332
|
+
valueKey="value"
|
|
2333
|
+
searchData={searchComputedProvider}
|
|
2334
|
+
existingData={formik.values.computedFieldValueProvider}
|
|
2335
|
+
additionalAction={(e: any) => setMarkdownText(e.target.value.help)}
|
|
2336
|
+
|
|
2337
|
+
/>
|
|
2338
|
+
{/* <InputText
|
|
2339
|
+
type="text"
|
|
2340
|
+
id="computedFieldValueProvider"
|
|
2341
|
+
name="computedFieldValueProvider"
|
|
2342
|
+
onChange={formik.handleChange}
|
|
2343
|
+
value={formik.values.computedFieldValueProvider}
|
|
2344
|
+
className={classNames("", {
|
|
2345
|
+
"p-invalid": isFormFieldValid(
|
|
2346
|
+
formik,
|
|
2347
|
+
"computedFieldValueProvider"
|
|
2348
|
+
),
|
|
2349
|
+
})}
|
|
2350
|
+
/> */}
|
|
2351
|
+
{isFormFieldValid(
|
|
2352
|
+
formik,
|
|
2353
|
+
"computedFieldValueProvider"
|
|
2354
|
+
) && (
|
|
2355
|
+
<Message
|
|
2356
|
+
severity="error"
|
|
2357
|
+
text={formik?.errors?.computedFieldValueProvider?.toString()}
|
|
2358
|
+
/>
|
|
2359
|
+
)}
|
|
2360
|
+
</div>
|
|
2361
|
+
)}
|
|
2362
|
+
{/* {currentFields.includes("externalIdProvider") && (
|
|
2363
|
+
<div className="md:col-6 sm:col-12">
|
|
2364
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2365
|
+
<label
|
|
2366
|
+
htmlFor="externalIdProvider"
|
|
2367
|
+
className="form-field-label"
|
|
2368
|
+
>
|
|
2369
|
+
External Id Provider
|
|
2370
|
+
</label>
|
|
2371
|
+
<SingleSelectAutoCompleteField
|
|
2372
|
+
key="externalIdProvider"
|
|
2373
|
+
formik={formik}
|
|
2374
|
+
isFormFieldValid={isFormFieldValid}
|
|
2375
|
+
// relationField={false}
|
|
2376
|
+
fieldName="externalIdProvider"
|
|
2377
|
+
fieldNameId={null}
|
|
2378
|
+
labelKey="label"
|
|
2379
|
+
valueKey="value"
|
|
2380
|
+
searchData={searchExternalIdProvider}
|
|
2381
|
+
existingData={formik.values.externalIdProvider}
|
|
2382
|
+
additionalAction={(e: any) => setMarkdownText(e.target.value.help)}
|
|
2383
|
+
/>
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
{isFormFieldValid(
|
|
2387
|
+
formik,
|
|
2388
|
+
"externalIdProvider"
|
|
2389
|
+
) && (
|
|
2390
|
+
<Message
|
|
2391
|
+
severity="error"
|
|
2392
|
+
text={formik?.errors?.externalIdProvider?.toString()}
|
|
2393
|
+
/>
|
|
2394
|
+
)}
|
|
2395
|
+
</div>
|
|
2396
|
+
</div>
|
|
2397
|
+
)} */}
|
|
2398
|
+
|
|
2399
|
+
{currentFields.includes("selectionDynamicProviderCtxt") && (
|
|
2400
|
+
// {/* {markdownText &&
|
|
2401
|
+
// <div className="md:col-12 sm:col-12">
|
|
2402
|
+
// <div className="field col-6 flex-flex-column gap-2">
|
|
2403
|
+
// <label htmlFor="name" className="form-field-label">
|
|
2404
|
+
// Markdown
|
|
2405
|
+
// </label>
|
|
2406
|
+
// <MarkdownViewer data={markdownText}></MarkdownViewer>
|
|
2407
|
+
// </div>
|
|
2408
|
+
// </div>
|
|
2409
|
+
// } */}
|
|
2410
|
+
|
|
2411
|
+
<div className="field col-12 flex-flex-column gap-2 mt-4">
|
|
2412
|
+
<label htmlFor="selectionDynamicProviderCtxt" className="form-field-label">
|
|
2413
|
+
Selection Dynamic Provider Context
|
|
2414
|
+
</label>
|
|
2415
|
+
<CodeEditor
|
|
2416
|
+
formik={formik}
|
|
2417
|
+
field="selectionDynamicProviderCtxt" >
|
|
2418
|
+
</CodeEditor>
|
|
2419
|
+
<div className=" form-field-label mt-4">{markdownText}</div>
|
|
2420
|
+
|
|
2421
|
+
{isFormFieldValid(
|
|
2422
|
+
formik,
|
|
2423
|
+
"selectionDynamicProviderCtxt"
|
|
2424
|
+
) && (
|
|
2425
|
+
<Message
|
|
2426
|
+
severity="error"
|
|
2427
|
+
text={formik?.errors?.selectionDynamicProviderCtxt?.toString()}
|
|
2428
|
+
/>
|
|
2429
|
+
)}
|
|
2430
|
+
</div>
|
|
2431
|
+
// {/* {currentFields.includes("markdown") && ( */}
|
|
2432
|
+
|
|
2433
|
+
)}
|
|
2434
|
+
|
|
2435
|
+
{currentFields.includes("computedFieldValueProviderCtxt") && (
|
|
2436
|
+
<div className="field col-12 flex-flex-column gap-2 mt-4">
|
|
2437
|
+
<label htmlFor="computedFieldValueProviderCtxt" className="form-field-label">
|
|
2438
|
+
Computed Field Value Provider Context
|
|
2439
|
+
</label>
|
|
2440
|
+
<CodeEditor
|
|
2441
|
+
formik={formik}
|
|
2442
|
+
field="computedFieldValueProviderCtxt" >
|
|
2443
|
+
</CodeEditor>
|
|
2444
|
+
<div className="form-field-label mt-4">{markdownText}</div>
|
|
2445
|
+
|
|
2446
|
+
{isFormFieldValid(
|
|
2447
|
+
formik,
|
|
2448
|
+
"computedFieldValueProviderCtxt"
|
|
2449
|
+
) && (
|
|
2450
|
+
<Message
|
|
2451
|
+
severity="error"
|
|
2452
|
+
text={formik?.errors?.computedFieldValueProviderCtxt?.toString()}
|
|
2453
|
+
/>
|
|
2454
|
+
)}
|
|
2455
|
+
</div>
|
|
2456
|
+
)}
|
|
2457
|
+
|
|
2458
|
+
{/* {currentFields.includes("externalIdProviderCtxt") && (
|
|
2459
|
+
<div className="md:col-12 sm:col-12">
|
|
2460
|
+
|
|
2461
|
+
<div className="formgrid grid">
|
|
2462
|
+
{markdownText &&
|
|
2463
|
+
<div className="md:col-12 sm:col-12">
|
|
2464
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2465
|
+
<label htmlFor="name" className="form-field-label">
|
|
2466
|
+
Markdown
|
|
2467
|
+
</label>
|
|
2468
|
+
<MarkdownViewer data={markdownText}></MarkdownViewer>
|
|
2469
|
+
</div>
|
|
2470
|
+
</div>
|
|
2471
|
+
}
|
|
2472
|
+
<div className="md:col-12 sm:col-12">
|
|
2473
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2474
|
+
<label htmlFor="name" className="form-field-label">
|
|
2475
|
+
External Id Provider Context
|
|
2476
|
+
</label>
|
|
2477
|
+
<CodeEditor
|
|
2478
|
+
formik={formik}
|
|
2479
|
+
field="externalIdProviderCtxt" >
|
|
2480
|
+
</CodeEditor>
|
|
2481
|
+
{isFormFieldValid(
|
|
2482
|
+
formik,
|
|
2483
|
+
"externalIdProviderCtxt"
|
|
2484
|
+
) && (
|
|
2485
|
+
<Message
|
|
2486
|
+
severity="error"
|
|
2487
|
+
text={formik?.errors?.externalIdProviderCtxt?.toString()}
|
|
2488
|
+
/>
|
|
2489
|
+
)}
|
|
2490
|
+
</div>
|
|
2491
|
+
</div>
|
|
2492
|
+
|
|
2493
|
+
</div>
|
|
2494
|
+
</div>
|
|
2495
|
+
)} */}
|
|
2496
|
+
|
|
2497
|
+
</div>
|
|
2498
|
+
)}
|
|
2499
|
+
{(currentFields.includes("regexPattern") || currentFields.includes("min") || currentFields.includes("max") || currentFields.includes("ormType")) && ormTypeOptions && selectedType.value !== 'relation' &&
|
|
2500
|
+
<>
|
|
2501
|
+
<p className="form-wrapper-heading text-base mt-3">Validations</p>
|
|
2502
|
+
<div className="formgrid grid">
|
|
2503
|
+
{(currentFields.includes("regexPattern") && selectedType.value === "password") &&
|
|
2504
|
+
<>
|
|
2505
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2506
|
+
<label
|
|
2507
|
+
htmlFor="regexPattern"
|
|
2508
|
+
className="form-field-label"
|
|
2509
|
+
>
|
|
2510
|
+
Password Policy
|
|
2511
|
+
</label>
|
|
2512
|
+
<Dropdown value={selectedPasswordPolicy} onChange={(e: DropdownChangeEvent) => {
|
|
2513
|
+
setSelectedPasswordPolicy(e.value)
|
|
2514
|
+
if (e.value !== "custom") {
|
|
2515
|
+
formik.setFieldValue('regexPattern', e.value)
|
|
2516
|
+
}
|
|
2517
|
+
}} options={passwordPolicyOptions} optionLabel="label"
|
|
2518
|
+
placeholder="Select a Password Policy"
|
|
2519
|
+
// className="w-full md:w-14rem"
|
|
2520
|
+
className=""
|
|
2521
|
+
checkmark={true} highlightOnSelect={false} />
|
|
2522
|
+
|
|
2523
|
+
</div>
|
|
2524
|
+
</>
|
|
2525
|
+
}
|
|
2526
|
+
{currentFields.includes("regexPattern") && (
|
|
2527
|
+
<>
|
|
2528
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2529
|
+
<label
|
|
2530
|
+
htmlFor="regexPattern"
|
|
2531
|
+
className="form-field-label"
|
|
2532
|
+
>
|
|
2533
|
+
Regex Pattern
|
|
2534
|
+
</label>
|
|
2535
|
+
<InputText
|
|
2536
|
+
type="text"
|
|
2537
|
+
id="regexPattern"
|
|
2538
|
+
name="regexPattern"
|
|
2539
|
+
onChange={formik.handleChange}
|
|
2540
|
+
value={formik.values.regexPattern}
|
|
2541
|
+
className={classNames("", {
|
|
2542
|
+
"p-invalid": isFormFieldValid(
|
|
2543
|
+
formik,
|
|
2544
|
+
"regexPattern"
|
|
2545
|
+
),
|
|
2546
|
+
})}
|
|
2547
|
+
/>
|
|
2548
|
+
{isFormFieldValid(formik, "regexPattern") && (
|
|
2549
|
+
<Message
|
|
2550
|
+
severity="error"
|
|
2551
|
+
text={formik?.errors?.regexPattern?.toString()}
|
|
2552
|
+
/>
|
|
2553
|
+
)}
|
|
2554
|
+
</div>
|
|
2555
|
+
{currentFields.includes("regexPattern") && (
|
|
2556
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2557
|
+
<label
|
|
2558
|
+
htmlFor="regexPatternNotMatchingErrorMsg"
|
|
2559
|
+
className="form-field-label"
|
|
2560
|
+
>
|
|
2561
|
+
Regex Pattern Not Matching Error Msg
|
|
2562
|
+
</label>
|
|
2563
|
+
<InputText
|
|
2564
|
+
type="text"
|
|
2565
|
+
id="regexPatternNotMatchingErrorMsg"
|
|
2566
|
+
name="regexPatternNotMatchingErrorMsg"
|
|
2567
|
+
onChange={formik.handleChange}
|
|
2568
|
+
value={formik.values.regexPatternNotMatchingErrorMsg}
|
|
2569
|
+
className={classNames("", {
|
|
2570
|
+
"p-invalid": isFormFieldValid(
|
|
2571
|
+
formik,
|
|
2572
|
+
"regexPatternNotMatchingErrorMsg"
|
|
2573
|
+
),
|
|
2574
|
+
})}
|
|
2575
|
+
/>
|
|
2576
|
+
{isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (
|
|
2577
|
+
<Message
|
|
2578
|
+
severity="error"
|
|
2579
|
+
text={formik?.errors?.regexPatternNotMatchingErrorMsg?.toString()}
|
|
2580
|
+
/>
|
|
2581
|
+
)}
|
|
2582
|
+
</div>
|
|
2583
|
+
)}
|
|
2584
|
+
</>
|
|
2585
|
+
|
|
2586
|
+
)}
|
|
2587
|
+
{(currentFields.includes("min") || currentFields.includes("max")) &&
|
|
2588
|
+
<>
|
|
2589
|
+
{currentFields.includes("min") && (
|
|
2590
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2591
|
+
<label htmlFor="min" className="form-field-label">
|
|
2592
|
+
Min {(selectedType.value !== "int" && selectedType.value !== "decimal") && `(Characters Allowed)`}
|
|
2593
|
+
|
|
2594
|
+
</label>
|
|
2595
|
+
{/* <InputText
|
|
2596
|
+
type="text"
|
|
2597
|
+
id="min"
|
|
2598
|
+
name="min"
|
|
2599
|
+
onChange={formik.handleChange}
|
|
2600
|
+
value={formik.values.min}
|
|
2601
|
+
className={classNames("", {
|
|
2602
|
+
"p-invalid": isFormFieldValid(formik, "min"),
|
|
2603
|
+
})}
|
|
2604
|
+
/> */}
|
|
2605
|
+
{/* <RenderMinValueInput></RenderMinValueInput> */}
|
|
2606
|
+
{(selectedType.value === "int" ||
|
|
2607
|
+
selectedType.value === "decimal" ||
|
|
2608
|
+
selectedType.value === "shortText" ||
|
|
2609
|
+
selectedType.value === "decimal" ||
|
|
2610
|
+
selectedType.value === "longText" ||
|
|
2611
|
+
selectedType.value === "richText" ||
|
|
2612
|
+
selectedType.value === "password" ||
|
|
2613
|
+
selectedType.value === "json") &&
|
|
2614
|
+
<InputNumber
|
|
2615
|
+
id="min"
|
|
2616
|
+
name="min"
|
|
2617
|
+
onValueChange={formik.handleChange}
|
|
2618
|
+
value={formik.values.min}
|
|
2619
|
+
className={classNames("", {
|
|
2620
|
+
"p-invalid": isFormFieldValid(
|
|
2621
|
+
formik,
|
|
2622
|
+
"min"
|
|
2623
|
+
),
|
|
2624
|
+
})}
|
|
2625
|
+
disabled={fieldMetaData?.id}
|
|
2626
|
+
/>
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
{isFormFieldValid(formik, "min") && (
|
|
2630
|
+
<Message
|
|
2631
|
+
severity="error"
|
|
2632
|
+
text={formik?.errors?.min?.toString()}
|
|
2633
|
+
/>
|
|
2634
|
+
)}
|
|
2635
|
+
</div>
|
|
2636
|
+
)}
|
|
2637
|
+
{currentFields.includes("max") && (
|
|
2638
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2639
|
+
<label htmlFor="max" className="form-field-label">
|
|
2640
|
+
Max {(selectedType.value !== "int" &&
|
|
2641
|
+
selectedType.value !== "decimal") && `(Characters allowed)`}
|
|
2642
|
+
</label>
|
|
2643
|
+
{/* <InputText
|
|
2644
|
+
type="text"
|
|
2645
|
+
id="max"
|
|
2646
|
+
name="max"
|
|
2647
|
+
onChange={formik.handleChange}
|
|
2648
|
+
value={formik.values.max}
|
|
2649
|
+
className={classNames("", {
|
|
2650
|
+
"p-invalid": isFormFieldValid(formik, "max"),
|
|
2651
|
+
})}
|
|
2652
|
+
/> */}
|
|
2653
|
+
{(selectedType.value === "int" ||
|
|
2654
|
+
selectedType.value === "decimal" ||
|
|
2655
|
+
selectedType.value === "shortText" ||
|
|
2656
|
+
selectedType.value === "decimal" ||
|
|
2657
|
+
selectedType.value === "longText" ||
|
|
2658
|
+
selectedType.value === "richText" ||
|
|
2659
|
+
selectedType.value === "password" ||
|
|
2660
|
+
selectedType.value === "json") &&
|
|
2661
|
+
<InputNumber
|
|
2662
|
+
id="max"
|
|
2663
|
+
name="max"
|
|
2664
|
+
onValueChange={formik.handleChange}
|
|
2665
|
+
value={formik.values.max}
|
|
2666
|
+
className={classNames("", {
|
|
2667
|
+
"p-invalid": isFormFieldValid(
|
|
2668
|
+
formik,
|
|
2669
|
+
"max"
|
|
2670
|
+
),
|
|
2671
|
+
})}
|
|
2672
|
+
disabled={fieldMetaData?.id}
|
|
2673
|
+
/>
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
{isFormFieldValid(formik, "max") && (
|
|
2677
|
+
<Message
|
|
2678
|
+
severity="error"
|
|
2679
|
+
text={formik?.errors?.max?.toString()}
|
|
2680
|
+
/>
|
|
2681
|
+
)}
|
|
2682
|
+
</div>
|
|
2683
|
+
)}
|
|
2684
|
+
</>
|
|
2685
|
+
}
|
|
2686
|
+
{currentFields.includes("ormType") && (
|
|
2687
|
+
<div className="md:col-12 sm:col-12">
|
|
2688
|
+
{ormTypeOptions && ormTypeOptions.length > 1 &&
|
|
2689
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2690
|
+
<label htmlFor="ormType" className="form-field-label">
|
|
2691
|
+
Type
|
|
2692
|
+
</label>
|
|
2693
|
+
{/* <SingleSelectAutoCompleteField
|
|
2694
|
+
key="ormType"
|
|
2695
|
+
formik={formik}
|
|
2696
|
+
isFormFieldValid={isFormFieldValid}
|
|
2697
|
+
fieldName="ormType"
|
|
2698
|
+
fieldNameId="ormType"
|
|
2699
|
+
labelKey="label"
|
|
2700
|
+
valueKey="value"
|
|
2701
|
+
searchData={searchOrmTypes}
|
|
2702
|
+
existingData={formik.values.ormType}
|
|
2703
|
+
/> */}
|
|
2704
|
+
|
|
2705
|
+
<div className="ormTypeflex">
|
|
2706
|
+
{ormTypeOptions && ormTypeOptions.map((ormType: any) => {
|
|
2707
|
+
return (
|
|
2708
|
+
<>
|
|
2709
|
+
<div key={ormType.key} className="mr-3 align-items-center">
|
|
2710
|
+
<RadioButton inputId={ormType.label} name="ormType" value={ormType.label} onChange={(e) => {
|
|
2711
|
+
formik.setFieldValue("ormType", e.value);
|
|
2712
|
+
setSelectedOrmType(e.value)
|
|
2713
|
+
}} checked={selectedOrmType === ormType.label} />
|
|
2714
|
+
<label htmlFor={ormType.label} className="ml-2">{ormType.label}<br></br>
|
|
2715
|
+
<span className="ml-4 fieldSubTitle">{ormType.description}</span>
|
|
2716
|
+
</label>
|
|
2717
|
+
</div>
|
|
2718
|
+
|
|
2719
|
+
</>
|
|
2720
|
+
);
|
|
2721
|
+
})}
|
|
2722
|
+
|
|
2723
|
+
</div>
|
|
2724
|
+
|
|
2725
|
+
{isFormFieldValid(formik, "ormType") && (
|
|
2726
|
+
<Message
|
|
2727
|
+
severity="error"
|
|
2728
|
+
text={formik?.errors?.ormType?.toString()}
|
|
2729
|
+
/>
|
|
2730
|
+
)}
|
|
2731
|
+
</div>
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
</div>
|
|
2735
|
+
)}
|
|
2736
|
+
</div>
|
|
2737
|
+
</>
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
{(formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && <p className="form-wrapper-heading text-base">Settings</p>}
|
|
2741
|
+
<div className="formgrid grid">
|
|
2742
|
+
{currentFields.includes("required") && (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && (
|
|
2743
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2744
|
+
<div className="flex align-items-center">
|
|
2745
|
+
<Checkbox
|
|
2746
|
+
name="required"
|
|
2747
|
+
onChange={(e) => {
|
|
2748
|
+
formik.setFieldValue("required", e.checked);
|
|
2749
|
+
}}
|
|
2750
|
+
checked={formik.values.required}
|
|
2751
|
+
></Checkbox>
|
|
2752
|
+
<label htmlFor="ingredient1" className="form-field-label ml-2">
|
|
2753
|
+
Required
|
|
2754
|
+
</label>
|
|
2755
|
+
</div>
|
|
2756
|
+
<p className="text-xs mt-2">You won't be able to create an entry if this field is empty</p>
|
|
2757
|
+
|
|
2758
|
+
{isFormFieldValid(formik, "required") && (
|
|
2759
|
+
<Message
|
|
2760
|
+
severity="error"
|
|
2761
|
+
text={formik?.errors?.required?.toString()}
|
|
2762
|
+
/>
|
|
2763
|
+
)}
|
|
2764
|
+
</div>
|
|
2765
|
+
)}
|
|
2766
|
+
{currentFields.includes("unique") && selectedType.value !== 'relation' && (
|
|
2767
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2768
|
+
<div className="flex align-items-center">
|
|
2769
|
+
<Checkbox
|
|
2770
|
+
name="unique"
|
|
2771
|
+
onChange={(e) => {
|
|
2772
|
+
formik.setFieldValue("unique", e.checked);
|
|
2773
|
+
formik.setFieldValue("isUserKey", false);
|
|
2774
|
+
}}
|
|
2775
|
+
checked={formik.values.unique}
|
|
2776
|
+
></Checkbox>
|
|
2777
|
+
<label htmlFor="ingredient1" className="form-field-label ml-2">
|
|
2778
|
+
Unique
|
|
2779
|
+
</label>
|
|
2780
|
+
</div>
|
|
2781
|
+
<p className="text-xs mt-2">You won't be able to create an entry if there is an existing entry with identical content</p>
|
|
2782
|
+
|
|
2783
|
+
{isFormFieldValid(formik, "unique") && (
|
|
2784
|
+
<Message
|
|
2785
|
+
severity="error"
|
|
2786
|
+
text={formik?.errors?.unique?.toString()}
|
|
2787
|
+
/>
|
|
2788
|
+
)}
|
|
2789
|
+
</div>
|
|
2790
|
+
)}
|
|
2791
|
+
{currentFields.includes("index") && selectedType.value !== 'relation' && (
|
|
2792
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2793
|
+
<div className="flex align-items-center">
|
|
2794
|
+
<Checkbox
|
|
2795
|
+
name="index"
|
|
2796
|
+
onChange={(e) => {
|
|
2797
|
+
formik.setFieldValue("index", e.checked);
|
|
2798
|
+
}}
|
|
2799
|
+
checked={formik.values.index}
|
|
2800
|
+
></Checkbox>
|
|
2801
|
+
<label htmlFor="ingredient1" className="form-field-label ml-2">
|
|
2802
|
+
Index
|
|
2803
|
+
</label>
|
|
2804
|
+
</div>
|
|
2805
|
+
{isFormFieldValid(formik, "index") && (
|
|
2806
|
+
<Message
|
|
2807
|
+
severity="error"
|
|
2808
|
+
text={formik?.errors?.index?.toString()}
|
|
2809
|
+
/>
|
|
2810
|
+
)}
|
|
2811
|
+
</div>
|
|
2812
|
+
)}
|
|
2813
|
+
{currentFields.includes("private") && selectedType.value !== 'relation' && (
|
|
2814
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2815
|
+
<div className="flex align-items-center">
|
|
2816
|
+
<Checkbox
|
|
2817
|
+
name="private"
|
|
2818
|
+
onChange={(e) => {
|
|
2819
|
+
formik.setFieldValue("private", e.checked);
|
|
2820
|
+
}}
|
|
2821
|
+
checked={formik.values.private}
|
|
2822
|
+
></Checkbox>
|
|
2823
|
+
<label htmlFor="ingredient1" className="form-field-label ml-2">
|
|
2824
|
+
Private
|
|
2825
|
+
</label>
|
|
2826
|
+
</div>
|
|
2827
|
+
<p className="text-xs mt-2">This field will not show up in the API response</p>
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
{isFormFieldValid(formik, "private") && (
|
|
2831
|
+
<Message
|
|
2832
|
+
severity="error"
|
|
2833
|
+
text={formik?.errors?.private?.toString()}
|
|
2834
|
+
/>
|
|
2835
|
+
)}
|
|
2836
|
+
</div>
|
|
2837
|
+
)}
|
|
2838
|
+
{currentFields.includes("encrypt") && selectedType.value !== 'relation' && (
|
|
2839
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2840
|
+
<div className="flex align-items-center gap-2">
|
|
2841
|
+
<Checkbox
|
|
2842
|
+
name="encrypt"
|
|
2843
|
+
onChange={(e) => {
|
|
2844
|
+
formik.setFieldValue("encrypt", e.checked);
|
|
2845
|
+
setEncryptState(e.checked);
|
|
2846
|
+
}}
|
|
2847
|
+
checked={formik.values.encrypt}
|
|
2848
|
+
></Checkbox>
|
|
2849
|
+
<label htmlFor="ingredient1" className="form-field-label">
|
|
2850
|
+
Encrypt
|
|
2851
|
+
</label>
|
|
2852
|
+
</div>
|
|
2853
|
+
{isFormFieldValid(formik, "encrypt") && (
|
|
2854
|
+
<Message
|
|
2855
|
+
severity="error"
|
|
2856
|
+
text={formik?.errors?.encrypt?.toString()}
|
|
2857
|
+
/>
|
|
2858
|
+
)}
|
|
2859
|
+
</div>
|
|
2860
|
+
)}
|
|
2861
|
+
{/* {currentFields.includes("isSystem") && (
|
|
2862
|
+
<div className="md:col-6 sm:col-12">
|
|
2863
|
+
<div className="field">
|
|
2864
|
+
<div className="flex align-items-center">
|
|
2865
|
+
<Checkbox
|
|
2866
|
+
name="isSystem"
|
|
2867
|
+
onChange={(e) => {
|
|
2868
|
+
formik.setFieldValue("isSystem", e.checked);
|
|
2869
|
+
}}
|
|
2870
|
+
checked={formik.values.isSystem}
|
|
2871
|
+
></Checkbox>
|
|
2872
|
+
<label htmlFor="ingredient1" className="form-field-label">
|
|
2873
|
+
isSystem
|
|
2874
|
+
</label>
|
|
2875
|
+
</div>
|
|
2876
|
+
{isFormFieldValid(formik, "isSystem") && (
|
|
2877
|
+
<Message
|
|
2878
|
+
severity="error"
|
|
2879
|
+
text={formik?.errors?.isSystem?.toString()}
|
|
2880
|
+
/>
|
|
2881
|
+
)}
|
|
2882
|
+
</div>
|
|
2883
|
+
</div>
|
|
2884
|
+
)} */}
|
|
2885
|
+
{currentFields.includes("isUserKey") && formik.values.unique && (
|
|
2886
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2887
|
+
<div className="flex align-items-center gap-2">
|
|
2888
|
+
<Checkbox
|
|
2889
|
+
name="isUserKey"
|
|
2890
|
+
onChange={(e) => {
|
|
2891
|
+
formik.setFieldValue("isUserKey", e.checked);
|
|
2892
|
+
}}
|
|
2893
|
+
checked={formik.values.isUserKey}
|
|
2894
|
+
></Checkbox>
|
|
2895
|
+
<label htmlFor="ingredient1" className="form-field-label">
|
|
2896
|
+
Is Userkey
|
|
2897
|
+
</label>
|
|
2898
|
+
</div>
|
|
2899
|
+
<p className="fieldSubTitle">By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten</p>
|
|
2900
|
+
|
|
2901
|
+
{isFormFieldValid(formik, "isUserKey") && (
|
|
2902
|
+
<Message
|
|
2903
|
+
severity="error"
|
|
2904
|
+
text={formik?.errors?.isUserKey?.toString()}
|
|
2905
|
+
/>
|
|
2906
|
+
)}
|
|
2907
|
+
</div>
|
|
2908
|
+
)}
|
|
2909
|
+
</div>
|
|
2910
|
+
|
|
2911
|
+
|
|
2912
|
+
{formik.values.encrypt === true && (
|
|
2913
|
+
<div className="formgrid grid mt-2">
|
|
2914
|
+
<div className="md:col-6 sm:col-12">
|
|
2915
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2916
|
+
<label
|
|
2917
|
+
htmlFor="encryptionType"
|
|
2918
|
+
className="form-field-label"
|
|
2919
|
+
>
|
|
2920
|
+
Encryption Type
|
|
2921
|
+
</label>
|
|
2922
|
+
{/* <AutoComplete
|
|
2923
|
+
value={selectedEncryptionType}
|
|
2924
|
+
suggestions={filteredSelectionEncryptionType}
|
|
2925
|
+
invalid={isFormFieldValid(
|
|
2926
|
+
formik,
|
|
2927
|
+
"encryptionType"
|
|
2928
|
+
)}
|
|
2929
|
+
completeMethod={searchSelectionEncryptionType}
|
|
2930
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
2931
|
+
field="label"
|
|
2932
|
+
className="small-input"
|
|
2933
|
+
dropdown
|
|
2934
|
+
onChange={(e) => {
|
|
2935
|
+
setSelectedEncryptionType(e.value);
|
|
2936
|
+
formik.setFieldValue("encryptionType", e.value.value);
|
|
2937
|
+
}}
|
|
2938
|
+
/> */}
|
|
2939
|
+
|
|
2940
|
+
<SingleSelectAutoCompleteField
|
|
2941
|
+
key="encryptionType"
|
|
2942
|
+
formik={formik}
|
|
2943
|
+
isFormFieldValid={isFormFieldValid}
|
|
2944
|
+
fieldName="encryptionType"
|
|
2945
|
+
fieldNameId="encryptionType"
|
|
2946
|
+
labelKey="label"
|
|
2947
|
+
valueKey="value"
|
|
2948
|
+
searchData={searchSelectionEncryptionType}
|
|
2949
|
+
existingData={formik.values.encryptionType}
|
|
2950
|
+
/>
|
|
2951
|
+
{isFormFieldValid(formik, "encryptionType") && (
|
|
2952
|
+
<Message
|
|
2953
|
+
severity="error"
|
|
2954
|
+
text={formik?.errors?.encryptionType?.toString()}
|
|
2955
|
+
/>
|
|
2956
|
+
)}
|
|
2957
|
+
</div>
|
|
2958
|
+
</div>
|
|
2959
|
+
<div className="md:col-6 sm:col-12">
|
|
2960
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
2961
|
+
<label htmlFor="decryptWhen" className="form-field-label">
|
|
2962
|
+
Decrypt When
|
|
2963
|
+
</label>
|
|
2964
|
+
{/* <AutoComplete
|
|
2965
|
+
value={selectedDecryptWhen}
|
|
2966
|
+
suggestions={filteredSelectionDecryptWhen}
|
|
2967
|
+
invalid={isFormFieldValid(formik, "decryptWhen")}
|
|
2968
|
+
completeMethod={searchSelectionDecryptWhen}
|
|
2969
|
+
virtualScrollerOptions={{ itemSize: 38 }}
|
|
2970
|
+
field="label"
|
|
2971
|
+
className="small-input"
|
|
2972
|
+
dropdown
|
|
2973
|
+
onChange={(e) => {
|
|
2974
|
+
setSelectedeDecryptWhen(e.value);
|
|
2975
|
+
formik.setFieldValue("decryptWhen", e.value.value);
|
|
2976
|
+
}}
|
|
2977
|
+
/> */}
|
|
2978
|
+
|
|
2979
|
+
<SingleSelectAutoCompleteField
|
|
2980
|
+
key="decryptWhen"
|
|
2981
|
+
formik={formik}
|
|
2982
|
+
isFormFieldValid={isFormFieldValid}
|
|
2983
|
+
fieldName="decryptWhen"
|
|
2984
|
+
fieldNameId="decryptWhen"
|
|
2985
|
+
labelKey="label"
|
|
2986
|
+
valueKey="value"
|
|
2987
|
+
searchData={searchSelectionDecryptWhen}
|
|
2988
|
+
existingData={formik.values.decryptWhen}
|
|
2989
|
+
/>
|
|
2990
|
+
{isFormFieldValid(formik, "decryptWhen") && (
|
|
2991
|
+
<Message
|
|
2992
|
+
severity="error"
|
|
2993
|
+
text={formik?.errors?.decryptWhen?.toString()}
|
|
2994
|
+
/>
|
|
2995
|
+
)}
|
|
2996
|
+
</div>
|
|
2997
|
+
</div>
|
|
2998
|
+
</div>
|
|
2999
|
+
)}
|
|
3000
|
+
</TabPanel>
|
|
3001
|
+
</TabView>
|
|
3002
|
+
<div className="flex gap-3">
|
|
3003
|
+
<div>
|
|
3004
|
+
<Button label="Finish" size="small" onClick={() => showError()} type="submit" />
|
|
3005
|
+
</div>
|
|
3006
|
+
<div>
|
|
3007
|
+
<Button label="Cancel" size="small" severity="secondary" type="reset" onClick={() => setVisiblePopup(false)} outlined />
|
|
3008
|
+
</div>
|
|
3009
|
+
</div>
|
|
3010
|
+
</div>
|
|
3011
|
+
{/* <div className="ml-4">
|
|
3012
|
+
<Button
|
|
3013
|
+
label="Save"
|
|
3014
|
+
onClick={() => showError(formik.validateForm)}
|
|
3015
|
+
type="submit"
|
|
3016
|
+
/>
|
|
3017
|
+
</div> */}
|
|
3018
|
+
</div>
|
|
3019
|
+
</div>
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
</form>
|
|
3023
|
+
</div >
|
|
3024
|
+
<Dialog
|
|
3025
|
+
visible={isBackPopupVisible}
|
|
3026
|
+
header="Select Type"
|
|
3027
|
+
headerClassName="text-center"
|
|
3028
|
+
modal
|
|
3029
|
+
footer={() => (
|
|
3030
|
+
<div className="flex gap-3">
|
|
3031
|
+
<Button label="Yes" icon="pi pi-check" size="small" type="reset" severity="danger" autoFocus onClick={() => {
|
|
3032
|
+
formik.resetForm()
|
|
3033
|
+
setIsBackPopupVisible(false);
|
|
3034
|
+
setShowTypeFilter(true);
|
|
3035
|
+
}} />
|
|
3036
|
+
<Button label="No" icon="pi pi-times" size="small" onClick={() => setIsBackPopupVisible(false)} />
|
|
3037
|
+
</div>
|
|
3038
|
+
)}
|
|
3039
|
+
onHide={() => setIsBackPopupVisible(false)}
|
|
3040
|
+
>
|
|
3041
|
+
<p>You have some unsaved data are you sure you want to go back?</p>
|
|
3042
|
+
</Dialog>
|
|
3043
|
+
</div >
|
|
3044
|
+
);
|
|
3045
|
+
};
|
|
3046
|
+
|
|
3047
|
+
|
|
3048
|
+
export default FieldMetaDataForm;
|