@solidxai/core-ui 0.1.5-beta.10 → 0.1.5-beta.12
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/auth/GoogleAuthChecking.d.ts.map +1 -1
- package/dist/components/auth/GoogleAuthChecking.js +10 -10
- package/dist/components/auth/GoogleAuthChecking.js.map +1 -1
- package/dist/components/auth/GoogleAuthChecking.tsx +8 -9
- package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
- package/dist/components/auth/SolidChangeForcePassword.js +9 -10
- package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
- package/dist/components/auth/SolidChangeForcePassword.tsx +6 -9
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +8 -8
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.tsx +6 -8
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +57 -57
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +10 -11
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +57 -57
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +10 -11
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +12 -12
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +11 -16
- package/dist/components/auth/SolidOTPVerify.d.ts +3 -0
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -0
- package/dist/components/auth/SolidOTPVerify.js +67 -0
- package/dist/components/auth/SolidOTPVerify.js.map +1 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +19 -19
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +18 -23
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +15 -15
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.tsx +7 -8
- package/dist/components/common/AuthBanner.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +87 -120
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +12 -42
- package/dist/components/common/GlobalToast.d.ts +2 -0
- package/dist/components/common/GlobalToast.d.ts.map +1 -0
- package/dist/components/common/GlobalToast.js +25 -0
- package/dist/components/common/GlobalToast.js.map +1 -0
- package/dist/components/common/GlobalToast.tsx +25 -0
- package/dist/components/common/SolidExport.d.ts.map +1 -1
- package/dist/components/common/SolidExport.js +19 -31
- package/dist/components/common/SolidExport.js.map +1 -1
- package/dist/components/common/SolidExport.tsx +7 -19
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +41 -41
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +5 -6
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +2 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js +50 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js +9 -9
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +8 -9
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js +8 -8
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +7 -9
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.js +11 -11
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +10 -11
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.d.ts.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.js +9 -9
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.js.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +8 -9
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.d.ts.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +7 -7
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +6 -7
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +78 -21
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +65 -10
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +6 -8
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +5 -9
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js +9 -11
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +5 -10
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.js +5 -6
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +5 -8
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js +10 -12
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +6 -11
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js +11 -6
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +13 -1
- package/dist/components/core/form/SolidFormUserViewLayout.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormUserViewLayout.js +7 -8
- package/dist/components/core/form/SolidFormUserViewLayout.js.map +1 -1
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +5 -7
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +12 -21
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +11 -33
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +22 -15
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +14 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +37 -26
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +38 -5
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +11 -11
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +9 -11
- package/dist/components/core/kanban/KanbanUserViewLayout.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanUserViewLayout.js +7 -8
- package/dist/components/core/kanban/KanbanUserViewLayout.js.map +1 -1
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +4 -6
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +5 -7
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +4 -9
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.d.ts.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js +13 -13
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +5 -6
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +20 -67
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +9 -76
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +15 -25
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +12 -32
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +6 -17
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +5 -26
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +48 -55
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +4 -22
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +42 -44
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +13 -27
- package/dist/components/core/module/ModuleListViewData.d.ts.map +1 -1
- package/dist/components/core/module/ModuleListViewData.js +11 -7
- package/dist/components/core/module/ModuleListViewData.js.map +1 -1
- package/dist/components/core/module/ModuleListViewData.tsx +10 -8
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +32 -69
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +8 -47
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +24 -37
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +8 -46
- package/dist/components/core/users/UserListView.d.ts.map +1 -1
- package/dist/components/core/users/UserListView.js +9 -16
- package/dist/components/core/users/UserListView.js.map +1 -1
- package/dist/components/core/users/UserListView.tsx +5 -21
- package/dist/components/layout/AdminLayout.d.ts.map +1 -1
- package/dist/components/layout/AdminLayout.js +4 -2
- package/dist/components/layout/AdminLayout.js.map +1 -1
- package/dist/components/layout/AdminLayout.tsx +4 -2
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +1 -2
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +0 -2
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +2 -1
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/layout/Layout.tsx +2 -0
- package/dist/components/layout/navbar-one.d.ts.map +1 -1
- package/dist/components/layout/navbar-one.js +1 -2
- package/dist/components/layout/navbar-one.js.map +1 -1
- package/dist/components/layout/navbar-one.tsx +0 -2
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +50 -24
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.tsx +48 -30
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +198 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.d.ts +2 -0
- package/dist/nextAuth/handleLogout.d.ts.map +1 -0
- package/dist/nextAuth/handleLogout.js +36 -0
- package/dist/nextAuth/handleLogout.js.map +1 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +24 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/features/settingsSlice.d.ts +20 -0
- package/dist/redux/features/settingsSlice.d.ts.map +1 -0
- package/dist/redux/features/settingsSlice.js +39 -0
- package/dist/redux/features/settingsSlice.js.map +1 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/redux/features/toastSlice.d.ts +15 -0
- package/dist/redux/features/toastSlice.d.ts.map +1 -0
- package/dist/redux/features/toastSlice.js +20 -0
- package/dist/redux/features/toastSlice.js.map +1 -0
- package/dist/redux/features/toastSlice.ts +35 -0
- package/dist/redux/store/defaultStoreConfig.d.ts +1 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +2 -1
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +2 -0
- package/package.json +1 -1
- package/dist/components/auth/AuthTabs.d.ts +0 -14
- package/dist/components/auth/AuthTabs.d.ts.map +0 -1
- package/dist/components/auth/AuthTabs.js +0 -19
- package/dist/components/auth/AuthTabs.js.map +0 -1
- package/dist/components/auth/AuthTabs.tsx +0 -38
- package/dist/components/common/SolidErrorStatePage.d.ts +0 -12
- package/dist/components/common/SolidErrorStatePage.d.ts.map +0 -1
- package/dist/components/common/SolidErrorStatePage.js +0 -16
- package/dist/components/common/SolidErrorStatePage.js.map +0 -1
- package/dist/components/common/SolidErrorStatePage.tsx +0 -55
- package/dist/components/core/list/PLAN.md +0 -92
- package/dist/components/core/list/SolidDataTable.d.ts +0 -58
- package/dist/components/core/list/SolidDataTable.d.ts.map +0 -1
- package/dist/components/core/list/SolidDataTable.js +0 -141
- package/dist/components/core/list/SolidDataTable.js.map +0 -1
- package/dist/components/core/list/SolidDataTable.tsx +0 -314
- package/dist/components/core/list/SolidDataTablePagination.d.ts +0 -15
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.js +0 -22
- package/dist/components/core/list/SolidDataTablePagination.js.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.tsx +0 -71
- package/dist/components/layout/AdminTopHeader.d.ts +0 -2
- package/dist/components/layout/AdminTopHeader.d.ts.map +0 -1
- package/dist/components/layout/AdminTopHeader.js +0 -68
- package/dist/components/layout/AdminTopHeader.js.map +0 -1
- package/dist/components/layout/AdminTopHeader.tsx +0 -135
- package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts +0 -24
- package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.js +0 -224
- package/dist/components/shad-cn-ui/SolidAutocomplete.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.tsx +0 -339
- package/dist/components/shad-cn-ui/SolidButton.d.ts +0 -14
- package/dist/components/shad-cn-ui/SolidButton.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidButton.js +0 -36
- package/dist/components/shad-cn-ui/SolidButton.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidButton.tsx +0 -54
- package/dist/components/shad-cn-ui/SolidInput.d.ts +0 -5
- package/dist/components/shad-cn-ui/SolidInput.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidInput.js +0 -35
- package/dist/components/shad-cn-ui/SolidInput.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidInput.tsx +0 -12
- package/dist/components/shad-cn-ui/SolidNumberInput.d.ts +0 -10
- package/dist/components/shad-cn-ui/SolidNumberInput.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidNumberInput.js +0 -33
- package/dist/components/shad-cn-ui/SolidNumberInput.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidNumberInput.tsx +0 -24
- package/dist/components/shad-cn-ui/SolidSelect.d.ts +0 -16
- package/dist/components/shad-cn-ui/SolidSelect.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidSelect.js +0 -26
- package/dist/components/shad-cn-ui/SolidSelect.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidSelect.tsx +0 -65
- package/dist/components/shad-cn-ui/SolidTabs.d.ts +0 -18
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +0 -22
- package/dist/components/shad-cn-ui/SolidTabs.js.map +0 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +0 -73
- package/dist/components/shad-cn-ui/index.d.ts +0 -7
- package/dist/components/shad-cn-ui/index.d.ts.map +0 -1
- package/dist/components/shad-cn-ui/index.js +0 -7
- package/dist/components/shad-cn-ui/index.js.map +0 -1
- package/dist/components/shad-cn-ui/index.ts +0 -6
- package/dist/components/solid-ui/SolidButton.d.ts +0 -14
- package/dist/components/solid-ui/SolidButton.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidButton.js +0 -36
- package/dist/components/solid-ui/SolidButton.js.map +0 -1
- package/dist/components/solid-ui/SolidButton.tsx +0 -54
- package/dist/components/solid-ui/SolidTabs.d.ts +0 -18
- package/dist/components/solid-ui/SolidTabs.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidTabs.js +0 -22
- package/dist/components/solid-ui/SolidTabs.js.map +0 -1
- package/dist/components/solid-ui/SolidTabs.tsx +0 -73
- package/dist/components/solid-ui/index.d.ts +0 -3
- package/dist/components/solid-ui/index.d.ts.map +0 -1
- package/dist/components/solid-ui/index.js +0 -3
- package/dist/components/solid-ui/index.js.map +0 -1
- package/dist/components/solid-ui/index.ts +0 -2
- package/dist/resources/images/errors/error-astronaut-404.png +0 -0
- package/dist/resources/shadcn-base.css +0 -3200
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { useFormik } from "formik";
|
|
3
3
|
import './solid-export.css';
|
|
4
4
|
import { Button } from "primereact/button";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import React, { useEffect, useState } from "react";
|
|
6
|
+
import { useDispatch } from 'react-redux';
|
|
7
|
+
import { showToast } from '../../redux/features/toastSlice';
|
|
7
8
|
import { createSolidEntityApi } from "../../redux/api/solidEntityApi";
|
|
8
9
|
import { Dropdown } from "primereact/dropdown";
|
|
9
10
|
import { Dialog } from "primereact/dialog";
|
|
@@ -38,7 +39,7 @@ interface Question {
|
|
|
38
39
|
name: string;
|
|
39
40
|
}
|
|
40
41
|
export const SolidExport = ({ listViewMetaData, filters }: any) => {
|
|
41
|
-
const
|
|
42
|
+
const dispatch = useDispatch();
|
|
42
43
|
const entityApi = createSolidEntityApi("userViewMetadata");
|
|
43
44
|
const { useUpsertSolidEntityMutation } = entityApi;
|
|
44
45
|
|
|
@@ -226,11 +227,7 @@ export const SolidExport = ({ listViewMetaData, filters }: any) => {
|
|
|
226
227
|
|
|
227
228
|
try {
|
|
228
229
|
const response = await createExportTemplate(exportData).unwrap();
|
|
229
|
-
|
|
230
|
-
severity: "success",
|
|
231
|
-
summary: "Template Added",
|
|
232
|
-
detail: "Template Saved",
|
|
233
|
-
});
|
|
230
|
+
dispatch(showToast({ severity: "success", summary: "Template Added", detail: "Template Saved" }));
|
|
234
231
|
let newAddedTemplate: TemplateOption = {
|
|
235
232
|
name: selectedTemplate?.name || "",
|
|
236
233
|
code: response.data.id,
|
|
@@ -246,11 +243,7 @@ export const SolidExport = ({ listViewMetaData, filters }: any) => {
|
|
|
246
243
|
console.error(ERROR_MESSAGES.TEMPLATE_FAILED, err);
|
|
247
244
|
}
|
|
248
245
|
} else {
|
|
249
|
-
|
|
250
|
-
severity: "error",
|
|
251
|
-
summary: ERROR_MESSAGES.TEMPLATE_FAILED,
|
|
252
|
-
detail: ERROR_MESSAGES.TEMPLATE_FAILED,
|
|
253
|
-
});
|
|
246
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.TEMPLATE_FAILED, detail: ERROR_MESSAGES.TEMPLATE_FAILED }));
|
|
254
247
|
}
|
|
255
248
|
};
|
|
256
249
|
|
|
@@ -387,11 +380,7 @@ export const SolidExport = ({ listViewMetaData, filters }: any) => {
|
|
|
387
380
|
const handleDeleteTemplate = async (id: string) => {
|
|
388
381
|
const response = await deleteExportTemplate(id).unwrap();
|
|
389
382
|
setTemplateOptions((prev) => prev.filter((template) => template.code !== id));
|
|
390
|
-
|
|
391
|
-
severity: "success",
|
|
392
|
-
summary: "Template Deleted",
|
|
393
|
-
detail: "Template Deleted",
|
|
394
|
-
});
|
|
383
|
+
dispatch(showToast({ severity: "success", summary: "Template Deleted", detail: "Template Deleted" }));
|
|
395
384
|
};
|
|
396
385
|
const itemTemplate = (option: TemplateOption) => {
|
|
397
386
|
return (
|
|
@@ -410,7 +399,6 @@ export const SolidExport = ({ listViewMetaData, filters }: any) => {
|
|
|
410
399
|
|
|
411
400
|
return (
|
|
412
401
|
<>
|
|
413
|
-
<Toast ref={toast} />
|
|
414
402
|
{/*<div className="flex align-items-center justify-content-between m-0 p-0">
|
|
415
403
|
<SolidExportStepper
|
|
416
404
|
solidFormViewWorkflowData={steps}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidFormStepper.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidFormStepper.tsx"],"names":[],"mappings":"AASA,UAAU,KAAK;IACX,qBAAqB,CAAC,EAAE,GAAG,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,uBAAuB,CAAC,EAAE,GAAG,CAAA;IAC7B,0BAA0B,CAAC,EAAE,GAAG,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B;AAED,eAAO,MAAM,gBAAgB,UAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"SolidFormStepper.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidFormStepper.tsx"],"names":[],"mappings":"AASA,UAAU,KAAK;IACX,qBAAqB,CAAC,EAAE,GAAG,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,uBAAuB,CAAC,EAAE,GAAG,CAAA;IAC7B,0BAA0B,CAAC,EAAE,GAAG,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B;AAED,eAAO,MAAM,gBAAgB,UAAW,KAAK,4CA2T5C,CAAA"}
|
|
@@ -48,15 +48,15 @@ import { OverlayPanel } from 'primereact/overlaypanel';
|
|
|
48
48
|
import { useEffect, useRef, useState } from 'react';
|
|
49
49
|
import { createSolidEntityApi } from '../../redux/api/solidEntityApi';
|
|
50
50
|
import { useFormik } from 'formik';
|
|
51
|
-
import { Toast } from 'primereact/toast';
|
|
52
51
|
import { useSearchParams } from "../../hooks/useSearchParams";
|
|
53
52
|
import { ERROR_MESSAGES } from '../../constants/error-messages';
|
|
54
|
-
import
|
|
53
|
+
import { useDispatch } from 'react-redux';
|
|
54
|
+
import { showToast } from '../../redux/features/toastSlice';
|
|
55
55
|
export var SolidFormStepper = function (props) {
|
|
56
56
|
var _a;
|
|
57
57
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
58
58
|
var solidFormViewMetaData = props.solidFormViewMetaData, modelName = props.modelName, initialEntityData = props.initialEntityData, id = props.id, solidWorkflowFieldValue = props.solidWorkflowFieldValue, setSolidWorkflowFieldValue = props.setSolidWorkflowFieldValue, onStepperUpdate = props.onStepperUpdate;
|
|
59
|
-
var
|
|
59
|
+
var dispatch = useDispatch();
|
|
60
60
|
var formStepperOverlay = useRef(null);
|
|
61
61
|
var containerRef = useRef(null);
|
|
62
62
|
var leftFormStepperOverlay = useRef(null);
|
|
@@ -171,7 +171,7 @@ export var SolidFormStepper = function (props) {
|
|
|
171
171
|
case 1:
|
|
172
172
|
result = _c.sent();
|
|
173
173
|
if ((result === null || result === void 0 ? void 0 : result.statusCode) === 200) {
|
|
174
|
-
showToast(
|
|
174
|
+
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FIELD_UPDATE(defaultWorkflowFieldDisplayName), detail: ERROR_MESSAGES.FIELD_UPDATE_SUCCESSFULLY(defaultWorkflowFieldDisplayName) }));
|
|
175
175
|
if ((_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b[solidWorkflowFieldKey]) {
|
|
176
176
|
setSolidWorkflowFieldValue(result.data[solidWorkflowFieldKey]);
|
|
177
177
|
}
|
|
@@ -183,7 +183,7 @@ export var SolidFormStepper = function (props) {
|
|
|
183
183
|
case 2:
|
|
184
184
|
error_1 = _c.sent();
|
|
185
185
|
console.error(ERROR_MESSAGES.UPDATING_STEPPER, error_1);
|
|
186
|
-
showToast(
|
|
186
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.UPDATE_FAILED, detail: ERROR_MESSAGES.FAILED_UPDATE_FROM }));
|
|
187
187
|
return [3 /*break*/, 3];
|
|
188
188
|
case 3: return [2 /*return*/];
|
|
189
189
|
}
|
|
@@ -233,41 +233,41 @@ export var SolidFormStepper = function (props) {
|
|
|
233
233
|
}
|
|
234
234
|
var hasPreviousSteps = previousSteps.length > 0 && !isSingleVisibleStep;
|
|
235
235
|
var hasNextSteps = nextSteps.length > 0 || (isSingleVisibleStep && previousSteps.length > 0);
|
|
236
|
-
return (
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
236
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { ref: containerRef, className: 'arrow-stepper-container', children: [hasPreviousSteps && (_jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("button", { type: 'button', className: "overflow-button overlow-left-button", onClick: function (e) {
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
leftFormStepperOverlay.current.toggle(e);
|
|
239
|
+
}, children: _jsx("i", { className: "pi pi-ellipsis-h" }) }), _jsx(OverlayPanel, { ref: leftFormStepperOverlay, className: "solid-custom-overlay solid-form-stepper-overlay", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }, children: previousSteps.map(function (step, index) {
|
|
240
|
+
var stepIndex = index;
|
|
241
|
+
var isStepActive = stepIndex === activeIndex;
|
|
242
|
+
var isStepBeforeActive = stepIndex < activeIndex;
|
|
243
|
+
return (_jsx("button", { type: 'button', className: "overlay-step-button ".concat(isStepActive ? 'active' : '', " ").concat(isStepBeforeActive ? 'completed' : ''), onClick: function () {
|
|
244
|
+
handleButtonClick(step.value);
|
|
245
|
+
// @ts-ignore
|
|
246
|
+
leftFormStepperOverlay.current.hide();
|
|
247
|
+
}, children: step.label }, stepIndex));
|
|
248
|
+
}) }) })] })), visibleSteps.map(function (step) {
|
|
249
|
+
var stepIndex = solidFormViewWorkflowData.findIndex(function (s) { return s.value === step.value; });
|
|
250
|
+
var isActive = stepIndex === activeIndex;
|
|
251
|
+
var isBeforeActive = stepIndex < activeIndex;
|
|
252
|
+
var isSingleButton = visibleSteps.length === 1;
|
|
253
|
+
return (_jsx("button", { type: "button", className: "arrow-step-button ".concat(isSingleButton ? 'single-button' : '', " ").concat(isActive
|
|
254
|
+
? 'arrow-step-active'
|
|
255
|
+
: isBeforeActive
|
|
256
|
+
? 'arrow-step-completed'
|
|
257
|
+
: 'arrow-step-future'), onClick: function () { return handleButtonClick(step.value); }, title: step.label, children: _jsx("span", { className: "step-text", children: step.label }) }, step.value));
|
|
258
|
+
}), hasNextSteps && (_jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("button", { type: 'button', className: "overflow-button overflow-right-button", onClick: function (e) {
|
|
259
|
+
// @ts-ignore
|
|
260
|
+
formStepperOverlay.current.toggle(e);
|
|
261
|
+
}, children: _jsx("i", { className: "pi pi-ellipsis-h" }) }), _jsx(OverlayPanel, { ref: formStepperOverlay, className: "solid-custom-overlay solid-form-stepper-overlay", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }, children: (isSingleVisibleStep
|
|
262
|
+
? __spreadArray(__spreadArray([], previousSteps, true), nextSteps, true) : nextSteps).map(function (step) {
|
|
263
|
+
var stepIndex = solidFormViewWorkflowData.findIndex(function (s) { return s.value === step.value; });
|
|
264
|
+
var isStepActive = stepIndex === activeIndex;
|
|
265
|
+
var isStepBeforeActive = stepIndex < activeIndex;
|
|
266
|
+
return (_jsx("button", { type: 'button', className: "overlay-step-button ".concat(isStepActive ? 'active' : '', " ").concat(isStepBeforeActive ? 'completed' : ''), onClick: function () {
|
|
267
|
+
handleButtonClick(step.value);
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
formStepperOverlay.current.hide();
|
|
270
|
+
}, children: step.label }, stepIndex));
|
|
271
|
+
}) }) })] }))] }) }));
|
|
272
272
|
};
|
|
273
273
|
//# sourceMappingURL=SolidFormStepper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidFormStepper.js","sourceRoot":"","sources":["../../../src/components/common/SolidFormStepper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,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Y,IACT,GAAG,EAAE,kBAAkB,EACvB,SAAS,EAAC,iDAAiD,YAE3D,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,YACtF,CAAC,mBAAmB;wCACjB,CAAC,iCAAK,aAAa,SAAK,SAAS,QACjC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,UAAC,IAAS;wCAEvB,IAAM,SAAS,GAAG,yBAAyB,CAAC,SAAS,CACjD,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAtB,CAAsB,CACrC,CAAC;wCAEF,IAAM,YAAY,GAAG,SAAS,KAAK,WAAW,CAAC;wCAC/C,IAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,CAAC;wCAEnD,OAAO,CACH,iBAEI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,8BAAuB,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,cAAI,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAE,EACzG,OAAO,EAAE;gDACL,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gDAC9B,aAAa;gDACb,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;4CACtC,CAAC,YAEA,IAAI,CAAC,KAAK,IATN,SAAS,CAUT,CACZ,CAAA;oCACL,CAAC,CAAC,GACJ,GACK,IACb,CACT,IACC,IACP,CACN,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { OverlayPanel } from 'primereact/overlaypanel';\nimport { useEffect, useRef, useState } from 'react'\nimport { createSolidEntityApi } from '../../redux/api/solidEntityApi';\nimport { useFormik } from 'formik';\nimport { Toast } from 'primereact/toast';\nimport { useSearchParams } from \"../../hooks/useSearchParams\";\nimport { ERROR_MESSAGES } from '../../constants/error-messages';\nimport showToast from \"../../helpers/showToast\";\n\ninterface Props {\n solidFormViewMetaData?: any;\n modelName?: any,\n initialEntityData?: any;\n id?: any,\n solidWorkflowFieldValue?: any\n setSolidWorkflowFieldValue?: any\n onStepperUpdate?: () => void\n}\n\nexport const SolidFormStepper = (props: Props) => {\n const { solidFormViewMetaData, modelName, initialEntityData, id, solidWorkflowFieldValue, setSolidWorkflowFieldValue, onStepperUpdate } = props;\n const toast = useRef<Toast>(null);\n const formStepperOverlay = useRef(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const leftFormStepperOverlay = useRef(null);\n\n const searchParams = useSearchParams();\n const viewMode = searchParams.get('viewMode');\n\n const solidFormViewWorkflowData = solidFormViewMetaData?.data?.solidFormViewWorkflowData;\n const solidWorkflowField = solidFormViewMetaData?.data?.solidView?.layout?.attrs?.workflowField;\n const solidWorkflowFieldEnabled = solidFormViewMetaData?.data?.solidView?.layout?.attrs?.workflowFieldUpdateEnabled;\n const defaultWorkflowFieldValue = solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.defaultValue\n const defaultWorkflowFieldDisplayName = solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.displayName\n const activeStep = solidFormViewMetaData?.data?.solidFormViewWorkflowData[0].value\n const [solidWorkflowFieldKey, setSolidWorkflowFieldKey] = useState<string>(\"\");\n const [visibleStepsCount, setVisibleStepsCount] = useState<number>(1);\n\n // Dynamic responsive logic\n useEffect(() => {\n const calculateVisibleSteps = () => {\n if (!containerRef.current || !solidFormViewWorkflowData || solidFormViewWorkflowData.length === 0) return;\n\n const containerWidth = containerRef.current.offsetWidth;\n const overflowButtonWidth = 50;\n const arrowWidth = 30; // Width for arrow between buttons\n const spacing = 0; // No gap needed as arrows connect buttons\n\n const tempContainer = document.createElement('div');\n tempContainer.style.visibility = 'hidden';\n tempContainer.style.position = 'absolute';\n document.body.appendChild(tempContainer);\n\n const buttonWidths: number[] = [];\n\n solidFormViewWorkflowData.forEach((step: any) => {\n const tempButton = document.createElement('button');\n tempButton.className = 'arrow-step-button';\n tempButton.textContent = step.label;\n tempButton.style.padding = '0.5rem 1.5rem';\n tempButton.style.minWidth = '100px';\n tempContainer.appendChild(tempButton);\n buttonWidths.push(Math.max(100, tempButton.offsetWidth));\n });\n\n document.body.removeChild(tempContainer);\n\n let count = 0;\n let totalWidth = 0;\n\n for (let i = 0; i < buttonWidths.length; i++) {\n const buttonWidth = buttonWidths[i];\n const arrowSpace = i > 0 ? arrowWidth : 0;\n const needsOverflow = i < buttonWidths.length - 1;\n const requiredWidth = totalWidth + buttonWidth + arrowSpace + (needsOverflow ? overflowButtonWidth : 0);\n\n if (requiredWidth <= containerWidth) {\n totalWidth += buttonWidth + arrowSpace;\n count++;\n } else {\n break;\n }\n }\n\n count = Math.max(1, count);\n setVisibleStepsCount(count);\n };\n\n calculateVisibleSteps();\n\n const resizeObserver = new ResizeObserver(calculateVisibleSteps);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n\n const timeoutId = setTimeout(calculateVisibleSteps, 100);\n\n return () => {\n resizeObserver.disconnect();\n clearTimeout(timeoutId);\n };\n }, [solidFormViewWorkflowData]);\n\n useEffect(() => {\n if (!solidWorkflowField) return;\n\n setSolidWorkflowFieldKey(solidWorkflowField);\n\n setSolidWorkflowFieldValue(() => {\n if (initialEntityData?.[solidWorkflowField] !== undefined) {\n if (solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.type === \"relation\") {\n return initialEntityData[solidWorkflowField]?.id || initialEntityData[solidWorkflowField];\n } else {\n return initialEntityData[solidWorkflowField];\n }\n } else if (defaultWorkflowFieldValue !== undefined) {\n return defaultWorkflowFieldValue;\n } else {\n return activeStep;\n }\n });\n }, [solidWorkflowField, initialEntityData, defaultWorkflowFieldValue, activeStep]);\n\n const formik = useFormik({\n enableReinitialize: true,\n initialValues: {\n id: +id,\n [solidWorkflowFieldKey]: solidWorkflowFieldValue || \"\",\n },\n onSubmit: (values) => {\n handleStepChange(values);\n }\n });\n\n const entityApi = createSolidEntityApi(modelName);\n const { usePatchUpdateSolidEntityMutation } = entityApi;\n\n const [\n updateStepper,\n { isSuccess: isStepperUpdateSuccessfull, isError: isStepperUpdateError, error: stepperUpdateError },\n ] = usePatchUpdateSolidEntityMutation();\n\n const handleStepChange = async (values: any) => {\n try {\n const result = await updateStepper({ id: values.id, data: { [solidWorkflowFieldKey]: values[solidWorkflowFieldKey] } }).unwrap();\n if (result?.statusCode === 200) {\n showToast(toast, \"success\", ERROR_MESSAGES.FIELD_UPDATE(defaultWorkflowFieldDisplayName), ERROR_MESSAGES.FIELD_UPDATE_SUCCESSFULLY(defaultWorkflowFieldDisplayName));\n if (result?.data?.[solidWorkflowFieldKey]) {\n setSolidWorkflowFieldValue(result.data[solidWorkflowFieldKey]);\n }\n if (onStepperUpdate) {\n onStepperUpdate();\n }\n }\n } catch (error) {\n console.error(ERROR_MESSAGES.UPDATING_STEPPER, error);\n showToast(toast, \"error\", ERROR_MESSAGES.UPDATE_FAILED, ERROR_MESSAGES.FAILED_UPDATE_FROM);\n }\n }\n\n const handleButtonClick = (stepValue: any) => {\n if (solidWorkflowFieldEnabled === false || id === \"new\" || viewMode === \"view\") {\n return\n } else {\n formik.setFieldValue(solidWorkflowFieldKey, stepValue);\n formik.handleSubmit();\n }\n }\n\n const activeIndex = solidFormViewWorkflowData?.findIndex((step: any) => step.value === solidWorkflowFieldValue) ?? -1;\n\n let visibleSteps: any[] = [];\n let previousSteps: any[] = [];\n let nextSteps: any[] = [];\n const isSingleVisibleStep = visibleStepsCount === 1;\n\n if (solidFormViewWorkflowData && solidFormViewWorkflowData.length > 0) {\n if (activeIndex === -1) {\n visibleSteps = solidFormViewWorkflowData.slice(0, visibleStepsCount);\n nextSteps = solidFormViewWorkflowData.slice(visibleStepsCount);\n } else if (visibleStepsCount === 1) {\n visibleSteps = [solidFormViewWorkflowData[activeIndex]];\n previousSteps = solidFormViewWorkflowData.slice(0, activeIndex);\n nextSteps = solidFormViewWorkflowData.slice(activeIndex + 1);\n } else {\n const totalSteps = solidFormViewWorkflowData.length;\n\n if (activeIndex < visibleStepsCount) {\n visibleSteps = solidFormViewWorkflowData.slice(0, visibleStepsCount);\n nextSteps = solidFormViewWorkflowData.slice(visibleStepsCount);\n } else {\n const slotsAvailable = visibleStepsCount - 1;\n const afterActive = Math.min(Math.floor(slotsAvailable / 2), totalSteps - activeIndex - 1);\n const beforeActive = slotsAvailable - afterActive;\n\n const startIndex = Math.max(0, activeIndex - beforeActive);\n const endIndex = Math.min(totalSteps, activeIndex + afterActive + 1);\n\n previousSteps = solidFormViewWorkflowData.slice(0, startIndex);\n visibleSteps = solidFormViewWorkflowData.slice(startIndex, endIndex);\n nextSteps = solidFormViewWorkflowData.slice(endIndex);\n }\n }\n }\n\n const hasPreviousSteps =\n previousSteps.length > 0 && !isSingleVisibleStep;\n\n const hasNextSteps =\n nextSteps.length > 0 || (isSingleVisibleStep && previousSteps.length > 0);\n\n return (\n <>\n <Toast ref={toast} />\n <div ref={containerRef} className='arrow-stepper-container'>\n {hasPreviousSteps && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <button\n type='button'\n className=\"overflow-button overlow-left-button\"\n onClick={(e) => {\n // @ts-ignore\n leftFormStepperOverlay.current.toggle(e)\n }}\n >\n <i className=\"pi pi-ellipsis-h\" />\n </button>\n <OverlayPanel\n ref={leftFormStepperOverlay}\n className=\"solid-custom-overlay solid-form-stepper-overlay\"\n >\n <div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }}>\n {previousSteps.map((step: any, index: number) => {\n const stepIndex = index;\n const isStepActive = stepIndex === activeIndex;\n const isStepBeforeActive = stepIndex < activeIndex;\n\n return (\n <button\n key={stepIndex}\n type='button'\n className={`overlay-step-button ${isStepActive ? 'active' : ''} ${isStepBeforeActive ? 'completed' : ''}`}\n onClick={() => {\n handleButtonClick(step.value);\n // @ts-ignore\n leftFormStepperOverlay.current.hide();\n }}\n >\n {step.label}\n </button>\n )\n })}\n </div>\n </OverlayPanel>\n </div>\n )}\n\n {visibleSteps.map((step: any) => {\n const stepIndex = solidFormViewWorkflowData.findIndex(\n (s: any) => s.value === step.value\n );\n\n const isActive = stepIndex === activeIndex;\n const isBeforeActive = stepIndex < activeIndex;\n const isSingleButton = visibleSteps.length === 1;\n\n return (\n <button\n key={step.value}\n type=\"button\"\n className={`arrow-step-button ${isSingleButton ? 'single-button' : ''\n } ${isActive\n ? 'arrow-step-active'\n : isBeforeActive\n ? 'arrow-step-completed'\n : 'arrow-step-future'\n }`}\n onClick={() => handleButtonClick(step.value)}\n title={step.label}\n >\n <span className=\"step-text\">{step.label}</span>\n </button>\n );\n })}\n\n {hasNextSteps && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <button\n type='button'\n className=\"overflow-button overflow-right-button\"\n onClick={(e) => {\n // @ts-ignore\n formStepperOverlay.current.toggle(e)\n }}\n >\n <i className=\"pi pi-ellipsis-h\" />\n </button>\n <OverlayPanel\n ref={formStepperOverlay}\n className=\"solid-custom-overlay solid-form-stepper-overlay\"\n >\n <div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }}>\n {(isSingleVisibleStep\n ? [...previousSteps, ...nextSteps]\n : nextSteps).map((step: any) => {\n\n const stepIndex = solidFormViewWorkflowData.findIndex(\n (s: any) => s.value === step.value\n );\n\n const isStepActive = stepIndex === activeIndex;\n const isStepBeforeActive = stepIndex < activeIndex;\n\n return (\n <button\n key={stepIndex}\n type='button'\n className={`overlay-step-button ${isStepActive ? 'active' : ''} ${isStepBeforeActive ? 'completed' : ''}`}\n onClick={() => {\n handleButtonClick(step.value);\n // @ts-ignore\n formStepperOverlay.current.hide();\n }}\n >\n {step.label}\n </button>\n )\n })}\n </div>\n </OverlayPanel>\n </div>\n )}\n </div>\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SolidFormStepper.js","sourceRoot":"","sources":["../../../src/components/common/SolidFormStepper.tsx"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,CAAE,EACzG,OAAO,EAAE;4CACL,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;4CAC9B,aAAa;4CACb,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;wCACtC,CAAC,YAEA,IAAI,CAAC,KAAK,IATN,SAAS,CAUT,CACZ,CAAA;gCACL,CAAC,CAAC,GACJ,GACK,IACb,CACT,IACC,GACP,CACN,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { OverlayPanel } from 'primereact/overlaypanel';\nimport { useEffect, useRef, useState } from 'react'\nimport { createSolidEntityApi } from '../../redux/api/solidEntityApi';\nimport { useFormik } from 'formik';\nimport { useSearchParams } from \"../../hooks/useSearchParams\";\nimport { ERROR_MESSAGES } from '../../constants/error-messages';\nimport { useDispatch } from 'react-redux';\nimport { showToast } from '../../redux/features/toastSlice';\n\ninterface Props {\n solidFormViewMetaData?: any;\n modelName?: any,\n initialEntityData?: any;\n id?: any,\n solidWorkflowFieldValue?: any\n setSolidWorkflowFieldValue?: any\n onStepperUpdate?: () => void\n}\n\nexport const SolidFormStepper = (props: Props) => {\n const { solidFormViewMetaData, modelName, initialEntityData, id, solidWorkflowFieldValue, setSolidWorkflowFieldValue, onStepperUpdate } = props;\n const dispatch = useDispatch();\n const formStepperOverlay = useRef(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const leftFormStepperOverlay = useRef(null);\n\n const searchParams = useSearchParams();\n const viewMode = searchParams.get('viewMode');\n\n const solidFormViewWorkflowData = solidFormViewMetaData?.data?.solidFormViewWorkflowData;\n const solidWorkflowField = solidFormViewMetaData?.data?.solidView?.layout?.attrs?.workflowField;\n const solidWorkflowFieldEnabled = solidFormViewMetaData?.data?.solidView?.layout?.attrs?.workflowFieldUpdateEnabled;\n const defaultWorkflowFieldValue = solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.defaultValue\n const defaultWorkflowFieldDisplayName = solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.displayName\n const activeStep = solidFormViewMetaData?.data?.solidFormViewWorkflowData[0].value\n const [solidWorkflowFieldKey, setSolidWorkflowFieldKey] = useState<string>(\"\");\n const [visibleStepsCount, setVisibleStepsCount] = useState<number>(1);\n\n // Dynamic responsive logic\n useEffect(() => {\n const calculateVisibleSteps = () => {\n if (!containerRef.current || !solidFormViewWorkflowData || solidFormViewWorkflowData.length === 0) return;\n\n const containerWidth = containerRef.current.offsetWidth;\n const overflowButtonWidth = 50;\n const arrowWidth = 30; // Width for arrow between buttons\n const spacing = 0; // No gap needed as arrows connect buttons\n\n const tempContainer = document.createElement('div');\n tempContainer.style.visibility = 'hidden';\n tempContainer.style.position = 'absolute';\n document.body.appendChild(tempContainer);\n\n const buttonWidths: number[] = [];\n\n solidFormViewWorkflowData.forEach((step: any) => {\n const tempButton = document.createElement('button');\n tempButton.className = 'arrow-step-button';\n tempButton.textContent = step.label;\n tempButton.style.padding = '0.5rem 1.5rem';\n tempButton.style.minWidth = '100px';\n tempContainer.appendChild(tempButton);\n buttonWidths.push(Math.max(100, tempButton.offsetWidth));\n });\n\n document.body.removeChild(tempContainer);\n\n let count = 0;\n let totalWidth = 0;\n\n for (let i = 0; i < buttonWidths.length; i++) {\n const buttonWidth = buttonWidths[i];\n const arrowSpace = i > 0 ? arrowWidth : 0;\n const needsOverflow = i < buttonWidths.length - 1;\n const requiredWidth = totalWidth + buttonWidth + arrowSpace + (needsOverflow ? overflowButtonWidth : 0);\n\n if (requiredWidth <= containerWidth) {\n totalWidth += buttonWidth + arrowSpace;\n count++;\n } else {\n break;\n }\n }\n\n count = Math.max(1, count);\n setVisibleStepsCount(count);\n };\n\n calculateVisibleSteps();\n\n const resizeObserver = new ResizeObserver(calculateVisibleSteps);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n\n const timeoutId = setTimeout(calculateVisibleSteps, 100);\n\n return () => {\n resizeObserver.disconnect();\n clearTimeout(timeoutId);\n };\n }, [solidFormViewWorkflowData]);\n\n useEffect(() => {\n if (!solidWorkflowField) return;\n\n setSolidWorkflowFieldKey(solidWorkflowField);\n\n setSolidWorkflowFieldValue(() => {\n if (initialEntityData?.[solidWorkflowField] !== undefined) {\n if (solidFormViewMetaData?.data?.solidFieldsMetadata?.[solidWorkflowField]?.type === \"relation\") {\n return initialEntityData[solidWorkflowField]?.id || initialEntityData[solidWorkflowField];\n } else {\n return initialEntityData[solidWorkflowField];\n }\n } else if (defaultWorkflowFieldValue !== undefined) {\n return defaultWorkflowFieldValue;\n } else {\n return activeStep;\n }\n });\n }, [solidWorkflowField, initialEntityData, defaultWorkflowFieldValue, activeStep]);\n\n const formik = useFormik({\n enableReinitialize: true,\n initialValues: {\n id: +id,\n [solidWorkflowFieldKey]: solidWorkflowFieldValue || \"\",\n },\n onSubmit: (values) => {\n handleStepChange(values);\n }\n });\n\n const entityApi = createSolidEntityApi(modelName);\n const { usePatchUpdateSolidEntityMutation } = entityApi;\n\n const [\n updateStepper,\n { isSuccess: isStepperUpdateSuccessfull, isError: isStepperUpdateError, error: stepperUpdateError },\n ] = usePatchUpdateSolidEntityMutation();\n\n const handleStepChange = async (values: any) => {\n try {\n const result = await updateStepper({ id: values.id, data: { [solidWorkflowFieldKey]: values[solidWorkflowFieldKey] } }).unwrap();\n if (result?.statusCode === 200) {\n dispatch(showToast({ severity: \"success\", summary: ERROR_MESSAGES.FIELD_UPDATE(defaultWorkflowFieldDisplayName), detail: ERROR_MESSAGES.FIELD_UPDATE_SUCCESSFULLY(defaultWorkflowFieldDisplayName) }));\n if (result?.data?.[solidWorkflowFieldKey]) {\n setSolidWorkflowFieldValue(result.data[solidWorkflowFieldKey]);\n }\n if (onStepperUpdate) {\n onStepperUpdate();\n }\n }\n } catch (error) {\n console.error(ERROR_MESSAGES.UPDATING_STEPPER, error);\n dispatch(showToast({ severity: \"error\", summary: ERROR_MESSAGES.UPDATE_FAILED, detail: ERROR_MESSAGES.FAILED_UPDATE_FROM }));\n }\n }\n\n const handleButtonClick = (stepValue: any) => {\n if (solidWorkflowFieldEnabled === false || id === \"new\" || viewMode === \"view\") {\n return\n } else {\n formik.setFieldValue(solidWorkflowFieldKey, stepValue);\n formik.handleSubmit();\n }\n }\n\n const activeIndex = solidFormViewWorkflowData?.findIndex((step: any) => step.value === solidWorkflowFieldValue) ?? -1;\n\n let visibleSteps: any[] = [];\n let previousSteps: any[] = [];\n let nextSteps: any[] = [];\n const isSingleVisibleStep = visibleStepsCount === 1;\n\n if (solidFormViewWorkflowData && solidFormViewWorkflowData.length > 0) {\n if (activeIndex === -1) {\n visibleSteps = solidFormViewWorkflowData.slice(0, visibleStepsCount);\n nextSteps = solidFormViewWorkflowData.slice(visibleStepsCount);\n } else if (visibleStepsCount === 1) {\n visibleSteps = [solidFormViewWorkflowData[activeIndex]];\n previousSteps = solidFormViewWorkflowData.slice(0, activeIndex);\n nextSteps = solidFormViewWorkflowData.slice(activeIndex + 1);\n } else {\n const totalSteps = solidFormViewWorkflowData.length;\n\n if (activeIndex < visibleStepsCount) {\n visibleSteps = solidFormViewWorkflowData.slice(0, visibleStepsCount);\n nextSteps = solidFormViewWorkflowData.slice(visibleStepsCount);\n } else {\n const slotsAvailable = visibleStepsCount - 1;\n const afterActive = Math.min(Math.floor(slotsAvailable / 2), totalSteps - activeIndex - 1);\n const beforeActive = slotsAvailable - afterActive;\n\n const startIndex = Math.max(0, activeIndex - beforeActive);\n const endIndex = Math.min(totalSteps, activeIndex + afterActive + 1);\n\n previousSteps = solidFormViewWorkflowData.slice(0, startIndex);\n visibleSteps = solidFormViewWorkflowData.slice(startIndex, endIndex);\n nextSteps = solidFormViewWorkflowData.slice(endIndex);\n }\n }\n }\n\n const hasPreviousSteps =\n previousSteps.length > 0 && !isSingleVisibleStep;\n\n const hasNextSteps =\n nextSteps.length > 0 || (isSingleVisibleStep && previousSteps.length > 0);\n\n return (\n <>\n <div ref={containerRef} className='arrow-stepper-container'>\n {hasPreviousSteps && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <button\n type='button'\n className=\"overflow-button overlow-left-button\"\n onClick={(e) => {\n // @ts-ignore\n leftFormStepperOverlay.current.toggle(e)\n }}\n >\n <i className=\"pi pi-ellipsis-h\" />\n </button>\n <OverlayPanel\n ref={leftFormStepperOverlay}\n className=\"solid-custom-overlay solid-form-stepper-overlay\"\n >\n <div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }}>\n {previousSteps.map((step: any, index: number) => {\n const stepIndex = index;\n const isStepActive = stepIndex === activeIndex;\n const isStepBeforeActive = stepIndex < activeIndex;\n\n return (\n <button\n key={stepIndex}\n type='button'\n className={`overlay-step-button ${isStepActive ? 'active' : ''} ${isStepBeforeActive ? 'completed' : ''}`}\n onClick={() => {\n handleButtonClick(step.value);\n // @ts-ignore\n leftFormStepperOverlay.current.hide();\n }}\n >\n {step.label}\n </button>\n )\n })}\n </div>\n </OverlayPanel>\n </div>\n )}\n\n {visibleSteps.map((step: any) => {\n const stepIndex = solidFormViewWorkflowData.findIndex(\n (s: any) => s.value === step.value\n );\n\n const isActive = stepIndex === activeIndex;\n const isBeforeActive = stepIndex < activeIndex;\n const isSingleButton = visibleSteps.length === 1;\n\n return (\n <button\n key={step.value}\n type=\"button\"\n className={`arrow-step-button ${isSingleButton ? 'single-button' : ''\n } ${isActive\n ? 'arrow-step-active'\n : isBeforeActive\n ? 'arrow-step-completed'\n : 'arrow-step-future'\n }`}\n onClick={() => handleButtonClick(step.value)}\n title={step.label}\n >\n <span className=\"step-text\">{step.label}</span>\n </button>\n );\n })}\n\n {hasNextSteps && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <button\n type='button'\n className=\"overflow-button overflow-right-button\"\n onClick={(e) => {\n // @ts-ignore\n formStepperOverlay.current.toggle(e)\n }}\n >\n <i className=\"pi pi-ellipsis-h\" />\n </button>\n <OverlayPanel\n ref={formStepperOverlay}\n className=\"solid-custom-overlay solid-form-stepper-overlay\"\n >\n <div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem', padding: '0.5rem' }}>\n {(isSingleVisibleStep\n ? [...previousSteps, ...nextSteps]\n : nextSteps).map((step: any) => {\n\n const stepIndex = solidFormViewWorkflowData.findIndex(\n (s: any) => s.value === step.value\n );\n\n const isStepActive = stepIndex === activeIndex;\n const isStepBeforeActive = stepIndex < activeIndex;\n\n return (\n <button\n key={stepIndex}\n type='button'\n className={`overlay-step-button ${isStepActive ? 'active' : ''} ${isStepBeforeActive ? 'completed' : ''}`}\n onClick={() => {\n handleButtonClick(step.value);\n // @ts-ignore\n formStepperOverlay.current.hide();\n }}\n >\n {step.label}\n </button>\n )\n })}\n </div>\n </OverlayPanel>\n </div>\n )}\n </div>\n </>\n )\n}\n"]}
|
|
@@ -2,10 +2,10 @@ import { OverlayPanel } from 'primereact/overlaypanel';
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react'
|
|
3
3
|
import { createSolidEntityApi } from '../../redux/api/solidEntityApi';
|
|
4
4
|
import { useFormik } from 'formik';
|
|
5
|
-
import { Toast } from 'primereact/toast';
|
|
6
5
|
import { useSearchParams } from "../../hooks/useSearchParams";
|
|
7
6
|
import { ERROR_MESSAGES } from '../../constants/error-messages';
|
|
8
|
-
import
|
|
7
|
+
import { useDispatch } from 'react-redux';
|
|
8
|
+
import { showToast } from '../../redux/features/toastSlice';
|
|
9
9
|
|
|
10
10
|
interface Props {
|
|
11
11
|
solidFormViewMetaData?: any;
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
|
|
20
20
|
export const SolidFormStepper = (props: Props) => {
|
|
21
21
|
const { solidFormViewMetaData, modelName, initialEntityData, id, solidWorkflowFieldValue, setSolidWorkflowFieldValue, onStepperUpdate } = props;
|
|
22
|
-
const
|
|
22
|
+
const dispatch = useDispatch();
|
|
23
23
|
const formStepperOverlay = useRef(null);
|
|
24
24
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
25
25
|
const leftFormStepperOverlay = useRef(null);
|
|
@@ -144,7 +144,7 @@ export const SolidFormStepper = (props: Props) => {
|
|
|
144
144
|
try {
|
|
145
145
|
const result = await updateStepper({ id: values.id, data: { [solidWorkflowFieldKey]: values[solidWorkflowFieldKey] } }).unwrap();
|
|
146
146
|
if (result?.statusCode === 200) {
|
|
147
|
-
showToast(
|
|
147
|
+
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FIELD_UPDATE(defaultWorkflowFieldDisplayName), detail: ERROR_MESSAGES.FIELD_UPDATE_SUCCESSFULLY(defaultWorkflowFieldDisplayName) }));
|
|
148
148
|
if (result?.data?.[solidWorkflowFieldKey]) {
|
|
149
149
|
setSolidWorkflowFieldValue(result.data[solidWorkflowFieldKey]);
|
|
150
150
|
}
|
|
@@ -154,7 +154,7 @@ export const SolidFormStepper = (props: Props) => {
|
|
|
154
154
|
}
|
|
155
155
|
} catch (error) {
|
|
156
156
|
console.error(ERROR_MESSAGES.UPDATING_STEPPER, error);
|
|
157
|
-
showToast(
|
|
157
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.UPDATE_FAILED, detail: ERROR_MESSAGES.FAILED_UPDATE_FROM }));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -211,7 +211,6 @@ export const SolidFormStepper = (props: Props) => {
|
|
|
211
211
|
|
|
212
212
|
return (
|
|
213
213
|
<>
|
|
214
|
-
<Toast ref={toast} />
|
|
215
214
|
<div ref={containerRef} className='arrow-stepper-container'>
|
|
216
215
|
{hasPreviousSteps && (
|
|
217
216
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadDynamicJsxComponent.d.ts","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,uBAAuB,gBAAiB,GAAG,4CAoDvD,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
4
|
+
import dynamic from "next/dynamic";
|
|
5
|
+
import { useState, useEffect } from "react";
|
|
6
|
+
// Fallback component for missing components
|
|
7
|
+
const FallbackComponent = ({ componentName }) => (_jsxs("div", { style: { color: "red" }, children: ["Could not load ", _jsx("strong", { children: componentName })] }));
|
|
8
|
+
export const LoadDynamicJsxComponent = ({ context }) => {
|
|
9
|
+
// const Component = dynamic<Props>(
|
|
10
|
+
// async () => {
|
|
11
|
+
// try {
|
|
12
|
+
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
13
|
+
// const mod = await import();
|
|
14
|
+
// // Return the default export or a named export matching the componentName
|
|
15
|
+
// return mod.default || mod[componentName];
|
|
16
|
+
// } catch (error) {
|
|
17
|
+
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
18
|
+
// // Return a fallback component if the import fails
|
|
19
|
+
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
20
|
+
// }
|
|
21
|
+
// },
|
|
22
|
+
// { ssr: false } // Disable server-side rendering
|
|
23
|
+
// );
|
|
24
|
+
const [Component, setComponent] = useState(null);
|
|
25
|
+
const componentPath = context?.rowAction?.action?.customComponent;
|
|
26
|
+
const componentKey = componentPath?.split("/")?.pop();
|
|
27
|
+
const componentMap = {
|
|
28
|
+
"GenerateModelCodeRowAction": dynamic(() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"), { ssr: false }),
|
|
29
|
+
"GenerateModuleCodeRowAction": dynamic(() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"), { ssr: false }),
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!componentKey)
|
|
33
|
+
return;
|
|
34
|
+
if (componentMap[componentKey]) {
|
|
35
|
+
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
import(componentPath)
|
|
39
|
+
.then((mod) => setComponent(() => mod.default || mod))
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
42
|
+
setComponent(() => () => _jsx(FallbackComponent, { componentName: componentKey }));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [componentKey]);
|
|
46
|
+
if (!Component)
|
|
47
|
+
return _jsx("p", { children: "Loading..." });
|
|
48
|
+
return _jsx(Component, { context: context });
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=LoadDynamicJsxComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadDynamicJsxComponent.js","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC,EAAE,aAAa,EAAO,EAAE,EAAE,CAAC,CAClD,eAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gCACT,2BAAS,aAAa,GAAU,IAC7C,CACT,CAAC;AAMF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAO,EAAE,EAAE;IAGxD,oCAAoC;IACpC,oBAAoB;IACpB,gBAAgB;IAEhB,kGAAkG;IAClG,0CAA0C;IAC1C,wFAAwF;IACxF,wDAAwD;IACxD,4BAA4B;IAC5B,kHAAkH;IAClH,iEAAiE;IACjE,6EAA6E;IAC7E,YAAY;IACZ,SAAS;IACT,sDAAsD;IACtD,KAAK;IACL,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAM,IAAI,CAAC,CAAC;IACtD,MAAM,a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OAAO,EAAE,OAAO,GAAI,CAAC;AAC3C,CAAC,CAAA","sourcesContent":["'use client';\nimport { ERROR_MESSAGES } from \"../../../constants/error-messages\";\nimport dynamic from \"next/dynamic\";\nimport { useState, useEffect } from \"react\";\n// Fallback component for missing components\nconst FallbackComponent = ({ componentName }: any) => (\n <div style={{ color: \"red\" }}>\n Could not load <strong>{componentName}</strong>\n </div>\n);\n\ntype Props = {\n context: any;\n};\n\nexport const LoadDynamicJsxComponent = ({ context }: any) => {\n\n \n // const Component = dynamic<Props>(\n // async () => {\n // try {\n \n // const componentName = context?.rowAction?.action?.customComponent.split('/').pop();\n // const mod = await import();\n // // Return the default export or a named export matching the componentName\n // return mod.default || mod[componentName];\n // } catch (error) {\n // console.error(`Failed to load component \"${context?.rowAction?.action?.customComponent}\":`, error);\n // // Return a fallback component if the import fails\n // return () => <GenerateModelCodeRowAction context={context} />;\n // }\n // },\n // { ssr: false } // Disable server-side rendering\n // );\n const [Component, setComponent] = useState<any>(null);\n const componentPath = context?.rowAction?.action?.customComponent;\n const componentKey = componentPath?.split(\"/\")?.pop();\n\n const componentMap: Record<string, any> = {\n \"GenerateModelCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction\"),\n { ssr: false }\n ),\n \"GenerateModuleCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction\"),\n { ssr: false }\n ),\n };\n\n useEffect(() => {\n if (!componentKey) return;\n\n if (componentMap[componentKey]) {\n setComponent(() => () => setComponent(() => componentMap[componentKey]));\n } else {\n import(componentPath)\n .then((mod) => setComponent(() => mod.default || mod))\n .catch((err) => {\n console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);\n setComponent(() => () => <FallbackComponent componentName={componentKey} />);\n });\n }\n }, [componentKey]);\n\n if (!Component) return <p>Loading...</p>;\n\n return <Component context={context} />;\n}\n\n\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
3
|
+
import dynamic from "next/dynamic";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
// Fallback component for missing components
|
|
6
|
+
const FallbackComponent = ({ componentName }: any) => (
|
|
7
|
+
<div style={{ color: "red" }}>
|
|
8
|
+
Could not load <strong>{componentName}</strong>
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
context: any;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const LoadDynamicJsxComponent = ({ context }: any) => {
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// const Component = dynamic<Props>(
|
|
20
|
+
// async () => {
|
|
21
|
+
// try {
|
|
22
|
+
|
|
23
|
+
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
24
|
+
// const mod = await import();
|
|
25
|
+
// // Return the default export or a named export matching the componentName
|
|
26
|
+
// return mod.default || mod[componentName];
|
|
27
|
+
// } catch (error) {
|
|
28
|
+
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
29
|
+
// // Return a fallback component if the import fails
|
|
30
|
+
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
31
|
+
// }
|
|
32
|
+
// },
|
|
33
|
+
// { ssr: false } // Disable server-side rendering
|
|
34
|
+
// );
|
|
35
|
+
const [Component, setComponent] = useState<any>(null);
|
|
36
|
+
const componentPath = context?.rowAction?.action?.customComponent;
|
|
37
|
+
const componentKey = componentPath?.split("/")?.pop();
|
|
38
|
+
|
|
39
|
+
const componentMap: Record<string, any> = {
|
|
40
|
+
"GenerateModelCodeRowAction": dynamic(
|
|
41
|
+
() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"),
|
|
42
|
+
{ ssr: false }
|
|
43
|
+
),
|
|
44
|
+
"GenerateModuleCodeRowAction": dynamic(
|
|
45
|
+
() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"),
|
|
46
|
+
{ ssr: false }
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!componentKey) return;
|
|
52
|
+
|
|
53
|
+
if (componentMap[componentKey]) {
|
|
54
|
+
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
55
|
+
} else {
|
|
56
|
+
import(componentPath)
|
|
57
|
+
.then((mod) => setComponent(() => mod.default || mod))
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
60
|
+
setComponent(() => () => <FallbackComponent componentName={componentKey} />);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [componentKey]);
|
|
64
|
+
|
|
65
|
+
if (!Component) return <p>Loading...</p>;
|
|
66
|
+
|
|
67
|
+
return <Component context={context} />;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidChangePassword.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidChangePassword.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,0BAA2B,GAAG,
|
|
1
|
+
{"version":3,"file":"SolidChangePassword.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidChangePassword.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,0BAA2B,GAAG,4CAkK7D,CAAA"}
|
|
@@ -42,17 +42,17 @@ import { useSession } from "../../../../hooks/useSession";
|
|
|
42
42
|
import { Button } from 'primereact/button';
|
|
43
43
|
import { Message } from 'primereact/message';
|
|
44
44
|
import { Password } from 'primereact/password';
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
45
|
+
import { useMemo } from 'react';
|
|
46
|
+
import { useDispatch } from 'react-redux';
|
|
47
|
+
import { showToast } from '../../../../redux/features/toastSlice';
|
|
47
48
|
import * as Yup from 'yup';
|
|
48
49
|
import { SolidPasswordHelperText } from '../SolidPasswordHelperText';
|
|
49
50
|
import { ERROR_MESSAGES } from '../../../../constants/error-messages';
|
|
50
51
|
import { env } from "../../../../adapters/env";
|
|
51
|
-
import showToast from "../../../../helpers/showToast";
|
|
52
52
|
export var SolidChangePassword = function (_a) {
|
|
53
53
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
54
54
|
var solidSettingsData = _a.solidSettingsData;
|
|
55
|
-
var
|
|
55
|
+
var dispatch = useDispatch();
|
|
56
56
|
var changePassword = useChangePasswordMutation()[0];
|
|
57
57
|
var session = useSession();
|
|
58
58
|
var envPasswordRegex = env("NEXT_PUBLIC_PASSWORD_REGEX");
|
|
@@ -125,7 +125,7 @@ export var SolidChangePassword = function (_a) {
|
|
|
125
125
|
case 1:
|
|
126
126
|
response = _k.sent();
|
|
127
127
|
if (response === null || response === void 0 ? void 0 : response.error) {
|
|
128
|
-
showToast(
|
|
128
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.ERROR, detail: response.error }));
|
|
129
129
|
setErrors({
|
|
130
130
|
currentPassword: ERROR_MESSAGES.INCORRECT_CURRENT,
|
|
131
131
|
newPassword: ERROR_MESSAGES.MUST_MATCH,
|
|
@@ -133,14 +133,14 @@ export var SolidChangePassword = function (_a) {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
|
-
showToast(
|
|
137
|
-
handleLogout(
|
|
136
|
+
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.PASSWORD_CHANGE, detail: ERROR_MESSAGES.PASSWORD_CHANGE }));
|
|
137
|
+
handleLogout(null);
|
|
138
138
|
resetForm();
|
|
139
139
|
}
|
|
140
140
|
return [3 /*break*/, 3];
|
|
141
141
|
case 2:
|
|
142
142
|
err_1 = _k.sent();
|
|
143
|
-
showToast(
|
|
143
|
+
dispatch(showToast({ severity: "error", summary: (_d = err_1 === null || err_1 === void 0 ? void 0 : err_1.data) === null || _d === void 0 ? void 0 : _d.message, detail: ((_f = (_e = err_1 === null || err_1 === void 0 ? void 0 : err_1.data) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.message) ? (_h = (_g = err_1 === null || err_1 === void 0 ? void 0 : err_1.data) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.message : (_j = err_1 === null || err_1 === void 0 ? void 0 : err_1.data) === null || _j === void 0 ? void 0 : _j.message }));
|
|
144
144
|
return [3 /*break*/, 3];
|
|
145
145
|
case 3: return [2 /*return*/];
|
|
146
146
|
}
|
|
@@ -151,6 +151,6 @@ export var SolidChangePassword = function (_a) {
|
|
|
151
151
|
var isFormFieldValid = function (formik, fieldName) {
|
|
152
152
|
return formik.touched[fieldName] && formik.errors[fieldName];
|
|
153
153
|
};
|
|
154
|
-
return (_jsxs("form", { onSubmit: formik.handleSubmit, className: "h-full flex flex-column justify-content-between", children: [
|
|
154
|
+
return (_jsxs("form", { onSubmit: formik.handleSubmit, className: "h-full flex flex-column justify-content-between", children: [_jsxs("div", { children: [_jsx("div", { className: 'grid', children: _jsxs("div", { className: 'col-12 md-col-8 lg:col-5', children: [_jsxs("div", { className: "flex flex-column gap-2", children: [_jsx("label", { htmlFor: "currentPassword", className: "solid-auth-input-label", children: "Current Password" }), _jsx(Password, { id: "currentPassword", name: "currentPassword", value: formik.values.currentPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, toggleMask: true, invalid: !!formik.errors.currentPassword, inputClassName: "w-full", feedback: false }), isFormFieldValid(formik, "currentPassword") && _jsx(Message, { className: "text-red-500 text-sm", severity: "error", text: (_g = (_f = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _f === void 0 ? void 0 : _f.currentPassword) === null || _g === void 0 ? void 0 : _g.toString() })] }), _jsxs("div", { className: "flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4", children: [_jsx("label", { htmlFor: "password", className: "solid-auth-input-label", children: "New Password" }), _jsx(Password, { id: "newPassword", name: "newPassword", value: formik.values.newPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, toggleMask: true, invalid: !!formik.errors.newPassword, inputClassName: "w-full", feedback: false }), isFormFieldValid(formik, "newPassword") && _jsx(Message, { className: "text-red-500 text-sm", severity: "error", text: (_j = (_h = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _h === void 0 ? void 0 : _h.newPassword) === null || _j === void 0 ? void 0 : _j.toString() })] }), _jsxs("div", { className: "flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4", children: [_jsx("label", { htmlFor: "password", className: "solid-auth-input-label", children: "Confirm New Password" }), _jsx(Password, { id: "confirmPassword", name: "confirmPassword", value: formik.values.confirmPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, toggleMask: true, invalid: !!formik.errors.confirmPassword, inputClassName: "w-full", feedback: false }), isFormFieldValid(formik, "confirmPassword") && _jsx(Message, { className: "text-red-500 text-sm", severity: "error", text: (_l = (_k = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _k === void 0 ? void 0 : _k.confirmPassword) === null || _l === void 0 ? void 0 : _l.toString() })] })] }) }), _jsx(SolidPasswordHelperText, { text: (_m = solidSettingsData === null || solidSettingsData === void 0 ? void 0 : solidSettingsData.data) === null || _m === void 0 ? void 0 : _m.authenticationPasswordComplexityDescription })] }), _jsx("div", { children: _jsx(Button, { type: 'submit', size: 'small', label: "Change Password", disabled: formik.isSubmitting, loading: formik.isSubmitting }) })] }));
|
|
155
155
|
};
|
|
156
156
|
//# sourceMappingURL=SolidChangePassword.js.map
|