@solidxai/core-ui 0.1.5-beta.8 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/AuthTabs.d.ts +14 -0
- package/dist/components/auth/AuthTabs.d.ts.map +1 -0
- package/dist/components/auth/AuthTabs.js +19 -0
- package/dist/components/auth/AuthTabs.js.map +1 -0
- package/dist/components/auth/AuthTabs.tsx +38 -0
- 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/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/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/SolidErrorStatePage.d.ts +12 -0
- package/dist/components/common/SolidErrorStatePage.d.ts.map +1 -0
- package/dist/components/common/SolidErrorStatePage.js +16 -0
- package/dist/components/common/SolidErrorStatePage.js.map +1 -0
- package/dist/components/common/SolidErrorStatePage.tsx +55 -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/chatter/SolidChatterDateDivider.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.js +4 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +5 -1
- 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/PLAN.md +92 -0
- 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/SolidDataTable.d.ts +58 -0
- package/dist/components/core/list/SolidDataTable.d.ts.map +1 -0
- package/dist/components/core/list/SolidDataTable.js +141 -0
- package/dist/components/core/list/SolidDataTable.js.map +1 -0
- package/dist/components/core/list/SolidDataTable.tsx +314 -0
- 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/solid-ai/SolidAiChat.d.ts +3 -0
- package/dist/components/core/solid-ai/SolidAiChat.d.ts.map +1 -0
- package/dist/components/core/solid-ai/SolidAiChat.js +1043 -0
- package/dist/components/core/solid-ai/SolidAiChat.js.map +1 -0
- package/dist/components/core/solid-ai/SolidAiChat.module.css +1339 -0
- package/dist/components/core/solid-ai/SolidAiChat.tsx +1237 -0
- 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/AdminTopHeader.d.ts +2 -0
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -0
- package/dist/components/layout/AdminTopHeader.js +80 -0
- package/dist/components/layout/AdminTopHeader.js.map +1 -0
- package/dist/components/layout/AdminTopHeader.tsx +165 -0
- 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/SolidAiStudioLayout.d.ts +10 -0
- package/dist/components/layout/SolidAiStudioLayout.d.ts.map +1 -0
- package/dist/components/layout/SolidAiStudioLayout.js +159 -0
- package/dist/components/layout/SolidAiStudioLayout.js.map +1 -0
- package/dist/components/layout/SolidAiStudioLayout.tsx +333 -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/components/shad-cn-ui/SolidAutocomplete.d.ts +24 -0
- package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidAutocomplete.js +224 -0
- package/dist/components/shad-cn-ui/SolidAutocomplete.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidAutocomplete.tsx +339 -0
- package/dist/components/shad-cn-ui/SolidButton.d.ts +14 -0
- package/dist/components/shad-cn-ui/SolidButton.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidButton.js +36 -0
- package/dist/components/shad-cn-ui/SolidButton.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidButton.tsx +54 -0
- package/dist/components/shad-cn-ui/SolidInput.d.ts +5 -0
- package/dist/components/shad-cn-ui/SolidInput.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidInput.js +35 -0
- package/dist/components/shad-cn-ui/SolidInput.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidInput.tsx +12 -0
- package/dist/components/shad-cn-ui/SolidNumberInput.d.ts +10 -0
- package/dist/components/shad-cn-ui/SolidNumberInput.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidNumberInput.js +33 -0
- package/dist/components/shad-cn-ui/SolidNumberInput.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidNumberInput.tsx +24 -0
- package/dist/components/shad-cn-ui/SolidSelect.d.ts +16 -0
- package/dist/components/shad-cn-ui/SolidSelect.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidSelect.js +26 -0
- package/dist/components/shad-cn-ui/SolidSelect.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidSelect.tsx +65 -0
- package/dist/components/shad-cn-ui/SolidTabs.d.ts +18 -0
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/SolidTabs.js +22 -0
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -0
- package/dist/components/shad-cn-ui/SolidTabs.tsx +73 -0
- package/dist/components/shad-cn-ui/index.d.ts +7 -0
- package/dist/components/shad-cn-ui/index.d.ts.map +1 -0
- package/dist/components/shad-cn-ui/index.js +7 -0
- package/dist/components/shad-cn-ui/index.js.map +1 -0
- package/dist/components/shad-cn-ui/index.ts +6 -0
- package/dist/helpers/studioSandbox.d.ts +31 -0
- package/dist/helpers/studioSandbox.d.ts.map +1 -0
- package/dist/helpers/studioSandbox.js +104 -0
- package/dist/helpers/studioSandbox.js.map +1 -0
- package/dist/helpers/studioSandbox.ts +117 -0
- 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/redux/features/solidStudioSlice.d.ts +9 -0
- package/dist/redux/features/solidStudioSlice.d.ts.map +1 -0
- package/dist/redux/features/solidStudioSlice.js +72 -0
- package/dist/redux/features/solidStudioSlice.js.map +1 -0
- package/dist/redux/features/solidStudioSlice.ts +78 -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/dist/resources/images/errors/error-astronaut-404.png +0 -0
- package/dist/resources/shadcn-base.css +4171 -0
- package/dist/routes/SolidLayoutRegistry.d.ts +51 -0
- package/dist/routes/SolidLayoutRegistry.d.ts.map +1 -0
- package/dist/routes/SolidLayoutRegistry.js +108 -0
- package/dist/routes/SolidLayoutRegistry.js.map +1 -0
- package/dist/routes/SolidLayoutRegistry.tsx +157 -0
- package/dist/routes/guards/AdminGuard.d.ts +2 -0
- package/dist/routes/guards/AdminGuard.d.ts.map +1 -0
- package/dist/routes/guards/AdminGuard.js +16 -0
- package/dist/routes/guards/AdminGuard.js.map +1 -0
- package/dist/routes/guards/AdminGuard.tsx +17 -0
- package/dist/routes/pages/studio/StudioHomePage.d.ts +2 -0
- package/dist/routes/pages/studio/StudioHomePage.d.ts.map +1 -0
- package/dist/routes/pages/studio/StudioHomePage.js +22 -0
- package/dist/routes/pages/studio/StudioHomePage.js.map +1 -0
- package/dist/routes/pages/studio/StudioHomePage.tsx +106 -0
- package/dist/routes/pages/studio/StudioLandingPage.d.ts +2 -0
- package/dist/routes/pages/studio/StudioLandingPage.d.ts.map +1 -0
- package/dist/routes/pages/studio/StudioLandingPage.js +78 -0
- package/dist/routes/pages/studio/StudioLandingPage.js.map +1 -0
- package/dist/routes/pages/studio/StudioLandingPage.tsx +320 -0
- package/package.json +1 -1
|
@@ -400,13 +400,13 @@ export const mergeAllDiffFilters = (customFilter: any, searchFilter: any, savedF
|
|
|
400
400
|
return filters;
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, openSavedCustomFilter, setSavedFilterTobeDeleted, setIsDeleteSQDialogVisible }: any) => {
|
|
403
|
+
const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, openSavedCustomFilter, setSavedFilterTobeDeleted, setIsDeleteSQDialogVisible, isFocused }: any) => {
|
|
404
404
|
return (
|
|
405
405
|
<div className="flex align-items-center justify-content-between gap-2">
|
|
406
406
|
<div>
|
|
407
407
|
<Button text
|
|
408
408
|
size="small"
|
|
409
|
-
className=
|
|
409
|
+
className={`text-base py-1 w-full ${isFocused ? 'surface-hover' : ''}`}
|
|
410
410
|
severity={Number(activeSavedFilter) == savedfilter.id ? "secondary" : "contrast"}
|
|
411
411
|
onClick={() => applySavedFilter(savedfilter)}
|
|
412
412
|
tooltip={savedfilter?.description}>{savedfilter.name}
|
|
@@ -617,6 +617,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
617
617
|
const [savedFilterQueryString, setSavedFilterQueryString] = useState<string>();
|
|
618
618
|
const [showOverlay, setShowOverlay] = useState(false);
|
|
619
619
|
const overlayRef = useRef<HTMLDivElement | null>(null);
|
|
620
|
+
const [focusedIndex, setFocusedIndex] = useState<number>(-1);
|
|
620
621
|
|
|
621
622
|
const { data: session, status } = useSession();
|
|
622
623
|
const user = session?.user;
|
|
@@ -1390,10 +1391,59 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
1390
1391
|
|
|
1391
1392
|
|
|
1392
1393
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
1393
|
-
|
|
1394
|
-
|
|
1394
|
+
const hasInput = !!inputValue?.trim();
|
|
1395
|
+
const searchCount = hasInput ? searchableFields.length : 0;
|
|
1396
|
+
const predefinedCount = hasInput ? (predefinedSearches?.length || 0) : 0;
|
|
1397
|
+
const savedFiltersCount = savedFilters?.length || 0;
|
|
1398
|
+
const totalItems = searchCount + predefinedCount + savedFiltersCount;
|
|
1399
|
+
|
|
1400
|
+
if (e.key === "ArrowDown") {
|
|
1395
1401
|
e.preventDefault();
|
|
1396
|
-
|
|
1402
|
+
if (showOverlay) {
|
|
1403
|
+
setFocusedIndex(prev => (prev < totalItems - 1 ? prev + 1 : prev));
|
|
1404
|
+
}
|
|
1405
|
+
} else if (e.key === "ArrowUp") {
|
|
1406
|
+
e.preventDefault();
|
|
1407
|
+
if (showOverlay) {
|
|
1408
|
+
setFocusedIndex(prev => (prev > -1 ? prev - 1 : prev));
|
|
1409
|
+
}
|
|
1410
|
+
} else if (e.key === "Enter") {
|
|
1411
|
+
if (hasInput || focusedIndex >= 0) e.preventDefault();
|
|
1412
|
+
|
|
1413
|
+
const predefinedSearchOffset = searchCount;
|
|
1414
|
+
const savedFilterOffset = predefinedSearchOffset + predefinedCount;
|
|
1415
|
+
|
|
1416
|
+
if (showOverlay && focusedIndex >= 0 && focusedIndex < predefinedSearchOffset) {
|
|
1417
|
+
const value = searchableFields[focusedIndex];
|
|
1418
|
+
const currentValue = inputValue?.trim() || "";
|
|
1419
|
+
const values = currentValue.split(",").map((v) => v.trim()).filter((v) => v !== "");
|
|
1420
|
+
const chipsToAdd = values.map((v: any) => ({
|
|
1421
|
+
columnName: value.fieldName,
|
|
1422
|
+
value: v,
|
|
1423
|
+
columnDisplayName: value.displayName,
|
|
1424
|
+
searchField: value.searchField,
|
|
1425
|
+
matchMode: value.matchMode
|
|
1426
|
+
}));
|
|
1427
|
+
setSearchChips((prev) => [...prev, ...chipsToAdd]);
|
|
1428
|
+
setInputValue("");
|
|
1429
|
+
setHasSearched(true);
|
|
1430
|
+
setRefreshKey((prev) => prev + 1);
|
|
1431
|
+
setShowOverlay(false);
|
|
1432
|
+
setFocusedIndex(-1);
|
|
1433
|
+
} else if (showOverlay && focusedIndex >= predefinedSearchOffset && focusedIndex < savedFilterOffset) {
|
|
1434
|
+
const predefinedSearch = predefinedSearches[focusedIndex - predefinedSearchOffset];
|
|
1435
|
+
handlePredefinedSearch(predefinedSearch);
|
|
1436
|
+
setFocusedIndex(-1);
|
|
1437
|
+
} else if (showOverlay && focusedIndex >= savedFilterOffset && focusedIndex < totalItems) {
|
|
1438
|
+
const savedFilterIdx = focusedIndex - savedFilterOffset;
|
|
1439
|
+
const savedFilter = savedFilters[savedFilterIdx];
|
|
1440
|
+
if (savedFilter) applySavedFilter(savedFilter);
|
|
1441
|
+
setFocusedIndex(-1);
|
|
1442
|
+
} else if (hasInput) {
|
|
1443
|
+
handleAddChip();
|
|
1444
|
+
setShowOverlay(false);
|
|
1445
|
+
setFocusedIndex(-1);
|
|
1446
|
+
}
|
|
1397
1447
|
} else if (e.key === "Backspace" && inputValue === "") {
|
|
1398
1448
|
|
|
1399
1449
|
if (searchChips.length > 0) {
|
|
@@ -1542,6 +1592,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
1542
1592
|
onChange={(e) => {
|
|
1543
1593
|
setInputValue(e.target.value);
|
|
1544
1594
|
setShowOverlay(true);
|
|
1595
|
+
setFocusedIndex(-1);
|
|
1545
1596
|
}}
|
|
1546
1597
|
onFocus={() => {
|
|
1547
1598
|
if (inputValue?.trim()) setShowOverlay(true);
|
|
@@ -1580,7 +1631,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
1580
1631
|
return (
|
|
1581
1632
|
<Button
|
|
1582
1633
|
key={index}
|
|
1583
|
-
className=
|
|
1634
|
+
className={`p-2 flex gap-1 text-color ${focusedIndex === index ? 'surface-hover' : ''}`}
|
|
1584
1635
|
// onClick={() => handleAddChip(value)}
|
|
1585
1636
|
onMouseDown={(e) => {
|
|
1586
1637
|
// Prevent focus loss from input
|
|
@@ -1620,7 +1671,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
1620
1671
|
{predefinedSearches.map((predefinedSearch: any, index: number) => (
|
|
1621
1672
|
<Button
|
|
1622
1673
|
key={index}
|
|
1623
|
-
className=
|
|
1674
|
+
className={`p-2 flex flex-column align-items-start gap-1 text-color ${focusedIndex === (index + searchableFields.length) ? 'surface-hover' : ''}`}
|
|
1624
1675
|
onMouseDown={(e) => {
|
|
1625
1676
|
e.preventDefault();
|
|
1626
1677
|
handlePredefinedSearch(predefinedSearch);
|
|
@@ -1651,9 +1702,13 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handle
|
|
|
1651
1702
|
<div className="p-3">
|
|
1652
1703
|
<p className="font-medium">Saved Filters</p>
|
|
1653
1704
|
<div className="flex flex-column gap-2">
|
|
1654
|
-
{savedFilters.map((savedfilter: any) =>
|
|
1655
|
-
|
|
1656
|
-
|
|
1705
|
+
{savedFilters.map((savedfilter: any, idx: number) => {
|
|
1706
|
+
const hasInput = !!inputValue?.trim();
|
|
1707
|
+
const combinedOffset = (hasInput ? searchableFields.length : 0) + (hasInput ? (predefinedSearches?.length || 0) : 0);
|
|
1708
|
+
return (
|
|
1709
|
+
<SavedFilterList key={idx} savedfilter={savedfilter} activeSavedFilter={activeSavedFilter} applySavedFilter={applySavedFilter} openSavedCustomFilter={openSavedCustomFilter} setSavedFilterTobeDeleted={setSavedFilterTobeDeleted} setIsDeleteSQDialogVisible={setIsDeleteSQDialogVisible} isFocused={focusedIndex === combinedOffset + idx}></SavedFilterList>
|
|
1710
|
+
)
|
|
1711
|
+
})}
|
|
1657
1712
|
</div>
|
|
1658
1713
|
</div>
|
|
1659
1714
|
<Divider className="m-0" />
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteModelRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"DeleteModelRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAa1F,QAAA,MAAM,oBAAoB,UAAW,oCAAoC,4CAkFxE,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js
CHANGED
|
@@ -37,23 +37,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
38
|
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
39
39
|
import { Button } from "primereact/button";
|
|
40
|
-
import {
|
|
40
|
+
import { useState } from "react";
|
|
41
41
|
import { useDispatch } from "react-redux";
|
|
42
|
-
import {
|
|
42
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
43
43
|
import { DataTable } from "primereact/datatable";
|
|
44
44
|
import { Column } from "primereact/column";
|
|
45
45
|
import { Checkbox } from "primereact/checkbox";
|
|
46
46
|
import { kebabCase } from "lodash";
|
|
47
47
|
import { createSolidEntityApi } from "../../../../../../redux/api/solidEntityApi";
|
|
48
48
|
import { ERROR_MESSAGES } from "../../../../../../constants/error-messages";
|
|
49
|
-
import showToast from "../../../../../../helpers/showToast";
|
|
50
49
|
var DeleteModelRowAction = function (event) {
|
|
51
50
|
var _a = useState(false), isConfirmed = _a[0], setIsConfirmed = _a[1];
|
|
52
51
|
var dispatch = useDispatch();
|
|
53
52
|
var entityApi = createSolidEntityApi(event.params.modelName);
|
|
54
53
|
var useDeleteSolidEntityMutation = entityApi.useDeleteSolidEntityMutation;
|
|
55
54
|
var _b = useDeleteSolidEntityMutation(), deleteSolidSingleEntiry = _b[0], isSolidEntitiesDeleteError = _b[1].isError;
|
|
56
|
-
var toast = useRef(null);
|
|
57
55
|
var deleteModelHandler = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
56
|
var res, message, err_1;
|
|
59
57
|
var _a, _b, _c;
|
|
@@ -69,17 +67,17 @@ var DeleteModelRowAction = function (event) {
|
|
|
69
67
|
message = ((_b = (_a = res.error) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
70
68
|
((_c = res.error) === null || _c === void 0 ? void 0 : _c.error) ||
|
|
71
69
|
ERROR_MESSAGES.ERROR_OCCURED;
|
|
72
|
-
showToast(
|
|
70
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.DELETE_FAIELD, detail: message }));
|
|
73
71
|
}
|
|
74
72
|
else {
|
|
75
|
-
showToast(
|
|
73
|
+
dispatch(showToast({ severity: 'success', summary: ERROR_MESSAGES.MODEL_DELETE, detail: ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName) }));
|
|
76
74
|
dispatch(closePopup());
|
|
77
75
|
}
|
|
78
76
|
return [3 /*break*/, 3];
|
|
79
77
|
case 2:
|
|
80
78
|
err_1 = _d.sent();
|
|
81
79
|
console.error("catch error", err_1);
|
|
82
|
-
showToast(
|
|
80
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.ERROR, detail: ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR }));
|
|
83
81
|
return [3 /*break*/, 3];
|
|
84
82
|
case 3: return [2 /*return*/];
|
|
85
83
|
}
|
|
@@ -96,7 +94,7 @@ var DeleteModelRowAction = function (event) {
|
|
|
96
94
|
{ file: "".concat(kebabCase(event.rowData.singularName), "-metadata.json"), description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },
|
|
97
95
|
{ file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },
|
|
98
96
|
];
|
|
99
|
-
return (_jsxs("div", { className: "", children: [_jsx(
|
|
97
|
+
return (_jsxs("div", { className: "", children: [_jsx("div", { className: "p-dialog-header secondary-border-bottom py-3", style: { background: 'var(--solid-light-grey)' }, children: _jsx("span", { className: "p-dialog-title", children: "Delete Model" }) }), _jsxs("div", { className: "px-4 pb-4 pt-3", children: [_jsxs("div", { children: [_jsx("p", { className: "form-field-label font-medium", children: "Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:" }), _jsxs(DataTable, { value: rows, size: "small", children: [_jsx(Column, { field: "file", header: "File Name" }), _jsx(Column, { field: "description", header: "Description" }), _jsx(Column, { field: "intervention", header: "Intervention" })] }), _jsx("div", { className: "my-4", children: _jsxs("div", { className: "flex align-items-center", children: [_jsx(Checkbox, { inputId: "confirmation", name: "confirm", checked: isConfirmed, onChange: function () { return setIsConfirmed(!isConfirmed); } }), _jsx("label", { htmlFor: "confirmation", className: "ml-2 form-field-label", children: "I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied." })] }) })] }), _jsxs("div", { className: "flex gap-3 justify-content-start", children: [_jsx(Button, { size: "small", label: "Apply", disabled: !isConfirmed, autoFocus: true, onClick: deleteModelHandler }), _jsx(Button, { size: "small", label: "Cancel", outlined: true, onClick: function () { return dispatch(closePopup()); } })] })] })] }));
|
|
100
98
|
};
|
|
101
99
|
export default DeleteModelRowAction;
|
|
102
100
|
//# sourceMappingURL=DeleteModelRowAction.js.map
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteModelRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,SAAS,MAA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C,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Toast } from 'primereact/toast';\nimport { DataTable } from \"primereact/datatable\";\nimport { Column } from \"primereact/column\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { kebabCase } from \"lodash\";\nimport { createSolidEntityApi } from \"../../../../../../redux/api/solidEntityApi\";\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\nimport showToast from \"../../../../../../helpers/showToast\";\n\n\nconst DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const [isConfirmed, setIsConfirmed] = useState(false);\n const dispatch = useDispatch();\n const entityApi = createSolidEntityApi(event.params.modelName);\n const {useDeleteSolidEntityMutation} = entityApi;\n const [deleteSolidSingleEntiry, { \n isError:isSolidEntitiesDeleteError , \n }] = useDeleteSolidEntityMutation()\n\n const toast = useRef<Toast>(null);\n\n const deleteModelHandler = async () => {\n try {\n const res: any = await deleteSolidSingleEntiry(event.rowData.id);\n \n // console.log('delete model res', res);\n if (res.error) {\n // handle backend or RTK error object\n const message =\n res.error?.data?.message ||\n res.error?.error ||\n ERROR_MESSAGES.ERROR_OCCURED;\n showToast(toast, 'error', ERROR_MESSAGES.DELETE_FAIELD, message);\n } else {\n showToast(toast, 'success', ERROR_MESSAGES.MODEL_DELETE, ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName));\n dispatch(closePopup());\n }\n } catch (err: any) {\n console.error(\"catch error\", err);\n showToast(toast, 'error', ERROR_MESSAGES.ERROR, ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR);\n }\n }\n\n const rows = [\n { file: `${kebabCase(event.rowData.singularName)}.entity.ts`, description: 'The TypeORM entity definition for this model. Deleting it removes the model’s schema mapping', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.create.dto.ts`, description: 'DTO defining the payload for creating a new record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.update.dto.ts`, description: 'DTO defining the payload for updating an existing record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.repository.ts`, description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.service.ts`, description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.controller.ts`, description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All imports and references to the deleted model are removed automatically', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}-metadata.json`, description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },\n { file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },\n ];\n\n\n\n return (\n <div className=\"\">\n <Toast ref={toast} />\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Delete Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <div>\n <p className=\"form-field-label font-medium\">\n Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:\n </p>\n <DataTable value={rows} size=\"small\">\n <Column field=\"file\" header=\"File Name\" />\n <Column field=\"description\" header=\"Description\" />\n <Column field=\"intervention\" header=\"Intervention\" />\n </DataTable>\n <div className=\"my-4\">\n <div className=\"flex align-items-center\">\n <Checkbox\n inputId=\"confirmation\"\n name=\"confirm\"\n checked={isConfirmed}\n onChange={() => setIsConfirmed(!isConfirmed)} />\n <label htmlFor=\"confirmation\" className=\"ml-2 form-field-label\">\n I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied.\n </label>\n </div>\n </div>\n </div>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Apply\" disabled={!isConfirmed} autoFocus onClick={deleteModelHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default DeleteModelRowAction;\n"]}
|
|
1
|
+
{"version":3,"file":"DeleteModelRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAG5E,IAAM,oBAAoB,GAAG,UAAC,KAA2C;IAC/D,IAAA,KAA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AAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { showToast } from \"../../../../../../redux/features/toastSlice\";\nimport { DataTable } from \"primereact/datatable\";\nimport { Column } from \"primereact/column\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { kebabCase } from \"lodash\";\nimport { createSolidEntityApi } from \"../../../../../../redux/api/solidEntityApi\";\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\n\n\nconst DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const [isConfirmed, setIsConfirmed] = useState(false);\n const dispatch = useDispatch();\n const entityApi = createSolidEntityApi(event.params.modelName);\n const {useDeleteSolidEntityMutation} = entityApi;\n const [deleteSolidSingleEntiry, { \n isError:isSolidEntitiesDeleteError , \n }] = useDeleteSolidEntityMutation()\n\n const deleteModelHandler = async () => {\n try {\n const res: any = await deleteSolidSingleEntiry(event.rowData.id);\n \n // console.log('delete model res', res);\n if (res.error) {\n // handle backend or RTK error object\n const message =\n res.error?.data?.message ||\n res.error?.error ||\n ERROR_MESSAGES.ERROR_OCCURED;\n dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.DELETE_FAIELD, detail: message }));\n } else {\n dispatch(showToast({ severity: 'success', summary: ERROR_MESSAGES.MODEL_DELETE, detail: ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName) }));\n dispatch(closePopup());\n }\n } catch (err: any) {\n console.error(\"catch error\", err);\n dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.ERROR, detail: ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR }));\n }\n }\n\n const rows = [\n { file: `${kebabCase(event.rowData.singularName)}.entity.ts`, description: 'The TypeORM entity definition for this model. Deleting it removes the model’s schema mapping', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.create.dto.ts`, description: 'DTO defining the payload for creating a new record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.update.dto.ts`, description: 'DTO defining the payload for updating an existing record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.repository.ts`, description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.service.ts`, description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.controller.ts`, description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All imports and references to the deleted model are removed automatically', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}-metadata.json`, description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },\n { file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },\n ];\n\n\n\n return (\n <div className=\"\">\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Delete Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <div>\n <p className=\"form-field-label font-medium\">\n Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:\n </p>\n <DataTable value={rows} size=\"small\">\n <Column field=\"file\" header=\"File Name\" />\n <Column field=\"description\" header=\"Description\" />\n <Column field=\"intervention\" header=\"Intervention\" />\n </DataTable>\n <div className=\"my-4\">\n <div className=\"flex align-items-center\">\n <Checkbox\n inputId=\"confirmation\"\n name=\"confirm\"\n checked={isConfirmed}\n onChange={() => setIsConfirmed(!isConfirmed)} />\n <label htmlFor=\"confirmation\" className=\"ml-2 form-field-label\">\n I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied.\n </label>\n </div>\n </div>\n </div>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Apply\" disabled={!isConfirmed} autoFocus onClick={deleteModelHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default DeleteModelRowAction;\n"]}
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx
CHANGED
|
@@ -3,16 +3,15 @@ import { useGenerateCodeForModelMutation } from "../../../../../../redux/api/mod
|
|
|
3
3
|
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
4
4
|
import { SolidListRowdataDynamicFunctionProps } from "../../../../../../types/solid-core";
|
|
5
5
|
import { Button } from "primereact/button";
|
|
6
|
-
import {
|
|
6
|
+
import { useState } from "react";
|
|
7
7
|
import { useDispatch } from "react-redux";
|
|
8
|
-
import {
|
|
8
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
9
9
|
import { DataTable } from "primereact/datatable";
|
|
10
10
|
import { Column } from "primereact/column";
|
|
11
11
|
import { Checkbox } from "primereact/checkbox";
|
|
12
12
|
import { kebabCase } from "lodash";
|
|
13
13
|
import { createSolidEntityApi } from "../../../../../../redux/api/solidEntityApi";
|
|
14
14
|
import { ERROR_MESSAGES } from "../../../../../../constants/error-messages";
|
|
15
|
-
import showToast from "../../../../../../helpers/showToast";
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
@@ -24,8 +23,6 @@ const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
|
24
23
|
isError:isSolidEntitiesDeleteError ,
|
|
25
24
|
}] = useDeleteSolidEntityMutation()
|
|
26
25
|
|
|
27
|
-
const toast = useRef<Toast>(null);
|
|
28
|
-
|
|
29
26
|
const deleteModelHandler = async () => {
|
|
30
27
|
try {
|
|
31
28
|
const res: any = await deleteSolidSingleEntiry(event.rowData.id);
|
|
@@ -37,14 +34,14 @@ const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
|
37
34
|
res.error?.data?.message ||
|
|
38
35
|
res.error?.error ||
|
|
39
36
|
ERROR_MESSAGES.ERROR_OCCURED;
|
|
40
|
-
showToast(
|
|
37
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.DELETE_FAIELD, detail: message }));
|
|
41
38
|
} else {
|
|
42
|
-
showToast(
|
|
39
|
+
dispatch(showToast({ severity: 'success', summary: ERROR_MESSAGES.MODEL_DELETE, detail: ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName) }));
|
|
43
40
|
dispatch(closePopup());
|
|
44
41
|
}
|
|
45
42
|
} catch (err: any) {
|
|
46
43
|
console.error("catch error", err);
|
|
47
|
-
showToast(
|
|
44
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.ERROR, detail: ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR }));
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
|
|
@@ -64,7 +61,6 @@ const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
|
64
61
|
|
|
65
62
|
return (
|
|
66
63
|
<div className="">
|
|
67
|
-
<Toast ref={toast} />
|
|
68
64
|
<div className="p-dialog-header secondary-border-bottom py-3" style={{ background: 'var(--solid-light-grey)' }}>
|
|
69
65
|
<span className="p-dialog-title">
|
|
70
66
|
Delete Model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateModelCodeRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"GenerateModelCodeRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAU1F,QAAA,MAAM,0BAA0B,UAAW,oCAAoC,4CAuL9E,CAAA;AAED,eAAe,0BAA0B,CAAC"}
|
package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js
CHANGED
|
@@ -39,13 +39,12 @@ import { useGenerateCodeForModelMutation } from "../../../../../../redux/api/mod
|
|
|
39
39
|
import { useSeederMutation } from "../../../../../../redux/api/solidServiceApi";
|
|
40
40
|
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
41
41
|
import { Button } from "primereact/button";
|
|
42
|
-
import { useEffect,
|
|
42
|
+
import { useEffect, useState } from "react";
|
|
43
43
|
import { useDispatch } from "react-redux";
|
|
44
|
-
import {
|
|
44
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
45
45
|
import { SolidCircularLoader } from '../../../../../../components/core/common/SolidLoaders/SolidCircularLoader';
|
|
46
46
|
import { ERROR_MESSAGES } from "../../../../../../constants/error-messages";
|
|
47
47
|
import { env } from "../../../../../../adapters/env";
|
|
48
|
-
import showToast from "../../../../../../helpers/showToast";
|
|
49
48
|
var GenerateModelCodeRowAction = function (event) {
|
|
50
49
|
var _a, _b;
|
|
51
50
|
var dispatch = useDispatch();
|
|
@@ -110,7 +109,6 @@ var GenerateModelCodeRowAction = function (event) {
|
|
|
110
109
|
}); };
|
|
111
110
|
// TODO: START REFACTORING - reusable code alert
|
|
112
111
|
var _e = useSeederMutation(), triggerSeeder = _e[0], _f = _e[1], data = _f.data, isLoading = _f.isLoading, isSeederSuccess = _f.isSuccess, isSeederError = _f.isError;
|
|
113
|
-
var toast = useRef(null);
|
|
114
112
|
// Utitlity to track if solid-api is up
|
|
115
113
|
var _g = useState(false), isPinging = _g[0], setIsPinging = _g[1];
|
|
116
114
|
var _h = useState(false), isGenerating = _h[0], setIsGenerating = _h[1];
|
|
@@ -170,7 +168,7 @@ var GenerateModelCodeRowAction = function (event) {
|
|
|
170
168
|
case 3:
|
|
171
169
|
dispatch(closePopup());
|
|
172
170
|
console.log("Backend is not alive, cannot run seeder");
|
|
173
|
-
showToast(
|
|
171
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.BACKEND_UNAVAILABLE, detail: ERROR_MESSAGES.SEEDER_NOT_TRIGGERED }));
|
|
174
172
|
_a.label = 4;
|
|
175
173
|
case 4: return [2 /*return*/];
|
|
176
174
|
}
|
|
@@ -183,24 +181,24 @@ var GenerateModelCodeRowAction = function (event) {
|
|
|
183
181
|
useEffect(function () {
|
|
184
182
|
if (isSeederSuccess) {
|
|
185
183
|
console.log(ERROR_MESSAGES.IS_SEEDER_SUCCESS, data);
|
|
186
|
-
showToast(
|
|
184
|
+
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY, detail: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY }));
|
|
187
185
|
setIsGenerating(false);
|
|
188
186
|
dispatch(closePopup());
|
|
189
187
|
window.location.reload();
|
|
190
188
|
}
|
|
191
189
|
if (isSeederError) {
|
|
192
190
|
console.log(ERROR_MESSAGES.IS_SEEDER_ERROR, isSeederError);
|
|
193
|
-
showToast(
|
|
191
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.SEEDER_ERROR, detail: ERROR_MESSAGES.SEEDER_NOT_RUN }));
|
|
194
192
|
setIsGenerating(false);
|
|
195
193
|
}
|
|
196
194
|
}, [isSeederSuccess]);
|
|
197
195
|
// TODO: END REFACTORING - reusable code alert
|
|
198
196
|
return (_jsx(_Fragment, { children: isGenerating ?
|
|
199
|
-
|
|
197
|
+
_jsx(_Fragment, { children: _jsxs("div", { className: "flex flex-column align-items-center justify-content-center", style: { padding: '2rem', height: 200 }, children: [_jsx(SolidCircularLoader, {}), _jsx("p", { className: "mt-4 font-medium", children: "Waiting for backend..." })] }) })
|
|
200
198
|
:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
_jsx(_Fragment, { children: ((_b = (_a = event === null || event === void 0 ? void 0 : event.rowData) === null || _a === void 0 ? void 0 : _a.module) === null || _b === void 0 ? void 0 : _b.name) != "solid-core" ?
|
|
200
|
+
_jsxs("div", { className: "", children: [_jsx("div", { className: "p-dialog-header secondary-border-bottom py-3", style: { background: 'var(--solid-light-grey)' }, children: _jsx("span", { className: "p-dialog-title", children: "Generate Model" }) }), _jsxs("div", { className: "px-4 pb-4 pt-3", children: [_jsx("p", { className: "", children: "Proceed with model code generation? Existing files will be overwritten." }), _jsx("p", { children: "Below is the list of files that will be created " }), _jsxs("ul", { children: [_jsx("li", { children: "Model Entity File" }), _jsx("li", { children: "Model Repository" }), _jsx("li", { children: "Model Controller File" }), _jsx("li", { children: "Model Service File" }), _jsx("li", { children: "Model Create and Update Dto files" })] }), _jsxs("div", { className: "flex gap-3 justify-content-start", children: [_jsx(Button, { size: "small", label: "Ok", autoFocus: true, onClick: generateCodeHandler }), _jsx(Button, { size: "small", label: "Cancel", outlined: true, onClick: function () { return dispatch(closePopup()); } })] })] })] }) :
|
|
201
|
+
_jsxs("div", { className: "", children: [_jsx("div", { className: "p-dialog-header secondary-border-bottom py-3", style: { background: 'var(--solid-light-grey)' }, children: _jsx("span", { className: "p-dialog-title", children: "Generate Model" }) }), _jsxs("div", { className: "px-4 pb-4 pt-3", children: [_jsx("p", { className: "text-center", children: "You cannot generate code for Solid Core models" }), _jsx("div", { className: "flex gap-3 justify-content-center", children: _jsx(Button, { size: "small", label: "Cancel", outlined: true, onClick: function () { return dispatch(closePopup()); } }) })] })] }) }) }));
|
|
204
202
|
};
|
|
205
203
|
export default GenerateModelCodeRowAction;
|
|
206
204
|
//# sourceMappingURL=GenerateModelCodeRowAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateModelCodeRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAC;AAChH,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AACrD,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAG5D,IAAM,0BAA0B,GAAG,UAAC,KAA2C;;IAC3E,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IACzB,IAAA,KAMD,+BAA+B,EAAE,EAN/B,YAAY,QAAA,EAAE,UAMpB,EALc,sBAAsB,eAAA,EACtB,qBAAqB,eAAA,EACvB,mBAAmB,aAAA,EACrB,iBAAiB,WAAA,EAClB,gBAAgB,UACY,CAAC;IAEvC,0DAA0D;IAC1D,UAAU;IACV,sDAAsD;IACtD,8DAA8D;IAC9D,oBAAoB;IACpB,+BAA+B;IAC/B,mCAAmC;IACnC,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,yBAAyB,EAAE,YAC1G,eAAM,SAAS,EAAC,gBAAgB,+BAEzB,GACL,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC3B,YAAG,SAAS,EAAC,EAAE,wFAA4E,EAC3F,2EAAuD,EACvD,yBACI,6CAA0B,EAC1B,4CAAyB,EACzB,iDAA8B,EAC9B,8CAA2B,EAC3B,6DAA0C,IACzC,EACL,eAAK,SAAS,EAAC,kCAAkC,aAC7C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,QAAC,OAAO,EAAE,mBAAmB,GAAI,EAC1E,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACH,CAAC,CAAC;4BACT,eAAK,SAAS,EAAC,EAAE,aACb,cAAK,SAAS,EAAC,8CAA8C,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,yBAAyB,EAAE,YAC1G,eAAM,SAAS,EAAC,gBAAgB,+BAEzB,GACL,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC3B,YAAG,SAAS,EAAC,aAAa,+DAAmD,EAC7E,cAAK,SAAS,EAAC,mCAAmC,YAC9C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,GACpF,IACJ,IACJ,IAEX,GAGR,CACN,CAAA;AACL,CAAC,CAAA;AAED,eAAe,0BAA0B,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { useSeederMutation } from \"../../../../../../redux/api/solidServiceApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Toast } from 'primereact/toast';\nimport { SolidCircularLoader } from '../../../../../../components/core/common/SolidLoaders/SolidCircularLoader';\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\nimport { env } from \"../../../../../../adapters/env\";\nimport showToast from \"../../../../../../helpers/showToast\";\n\n\nconst GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const dispatch = useDispatch();\n const [generateCode, {\n isLoading: isGenerateCodeUpdating,\n isSuccess: isGenerateCodeSuceess,\n isError: isGenerateCodeError,\n error: generateCodeError,\n data: generateCodeData\n }] = useGenerateCodeForModelMutation();\n\n // const mqMessageApi = createSolidEntityApi(\"mqMessage\");\n // const {\n // useGetSolidEntitiesQuery: useGetMqMessageQuery,\n // useLazyGetSolidEntitiesQuery: useLazyGetMqMessageQuery,\n // } = mqMessageApi;\n // const [getMqMessageStatus, {\n // data: solidListViewMetaData,\n // error: solidListViewMetaDataError,\n // isLoading: solidListViewMetaDataIsLoading,\n // isError: solidListViewMetaDataIsError\n // }] = useLazyGetMqMessageQuery();\n // const fetchMqMessageStatus = async (retries = 30, delay = 500, generateCodeData: any): Promise<boolean> => {\n // for (let i = 0; i < retries; i++) {\n // try {\n // const query = {\n // filters: {\n // messageId: {\n // $eq: generateCodeData?.data?.messageId\n // }\n // }\n // };\n // const queryString = qs.stringify(query, {\n // encodeValuesOnly: true,\n // });\n // const res = await getMqMessageStatus(queryString)\n // if (res.isSuccess === true) {\n // if (res.data.records.length > 0) {\n // const messageStage = res.data.records[0].stage;\n // console.log(\"messageStatus\", messageStage);\n // if (messageStage === \"succeeded\") {\n // return true\n // }\n // if (messageStage === \"failed\") {\n // return false\n // }\n // }\n // }\n // } catch (e) {\n // // ignore and retry\n // }\n // await new Promise((resolve) => setTimeout(resolve, delay));\n // }\n // return false;\n // };\n\n const generateCodeHandler = async () => {\n const response: any = await generateCode({ id: event?.rowData?.id });\n console.log(\"response generate code handler\", response);\n setIsGenerating(true);\n }\n\n // TODO: START REFACTORING - reusable code alert\n const [triggerSeeder, {\n data,\n isLoading,\n isSuccess: isSeederSuccess,\n isError: isSeederError\n }] = useSeederMutation();\n\n const toast = useRef<Toast>(null);\n\n // Utitlity to track if solid-api is up\n const [isPinging, setIsPinging] = useState(false);\n const [isGenerating, setIsGenerating] = useState(false);\n const pingBackendWithRetry = async (retries = 30, delay = 500): Promise<boolean> => {\n for (let i = 0; i < retries; i++) {\n try {\n const res = await fetch(`${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/ping`);\n console.log(\"ping response\", res);\n\n if (res.ok)\n return true;\n } catch (e) {\n // ignore and retry\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n return false;\n };\n\n useEffect(() => {\n const runSeederIfQueueStatusIsSuccess = async () => {\n if (isGenerateCodeSuceess) {\n // console.log(\"isGenerateCodeSuceess\", isGenerateCodeSuceess);\n // setIsPinging(true);\n // const hasMqMessageCompleted = await fetchMqMessageStatus(30, 500, generateCodeData);\n const isAlive = await pingBackendWithRetry();\n setIsPinging(false);\n\n // const hasMqMessageCompleted = true;\n // const isAlive = true;\n // if (hasMqMessageCompleted && isAlive) {\n if (isAlive) {\n await triggerSeeder(\"ModuleMetadataSeederService\");\n } else {\n dispatch(closePopup());\n console.log(\"Backend is not alive, cannot run seeder\");\n showToast(toast, \"error\", ERROR_MESSAGES.BACKEND_UNAVAILABLE , ERROR_MESSAGES.SEEDER_NOT_TRIGGERED);\n }\n }\n };\n setTimeout(() => {\n runSeederIfQueueStatusIsSuccess();\n }, 5000);\n }, [isGenerateCodeSuceess]);\n\n useEffect(() => {\n if (isSeederSuccess) {\n console.log(ERROR_MESSAGES.IS_SEEDER_SUCCESS, data);\n showToast(toast, \"success\", ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY, ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY);\n setIsGenerating(false);\n dispatch(closePopup());\n window.location.reload();\n }\n if (isSeederError) {\n console.log(ERROR_MESSAGES.IS_SEEDER_ERROR, isSeederError);\n showToast(toast, \"error\", ERROR_MESSAGES.SEEDER_ERROR, ERROR_MESSAGES.SEEDER_NOT_RUN);\n setIsGenerating(false);\n }\n }, [isSeederSuccess])\n // TODO: END REFACTORING - reusable code alert\n\n return (\n <>\n {isGenerating ?\n <>\n <Toast ref={toast} />\n <div className=\"flex flex-column align-items-center justify-content-center\" style={{ padding: '2rem', height: 200 }}>\n <SolidCircularLoader />\n <p className=\"mt-4 font-medium\">Waiting for backend...</p>\n </div>\n </>\n :\n <>\n <Toast ref={toast} />\n {event?.rowData?.module?.name != \"solid-core\" ?\n <div className=\"\">\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Generate Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <p className=\"\">Proceed with model code generation? Existing files will be overwritten.</p>\n <p>Below is the list of files that will be created </p>\n <ul>\n <li>Model Entity File</li>\n <li>Model Repository</li>\n <li>Model Controller File</li>\n <li>Model Service File</li>\n <li>Model Create and Update Dto files</li>\n </ul>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Ok\" autoFocus onClick={generateCodeHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div > :\n <div className=\"\">\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Generate Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <p className=\"text-center\">You cannot generate code for Solid Core models</p>\n <div className=\"flex gap-3 justify-content-center\">\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n }\n </>\n }\n\n </>\n )\n}\n\nexport default GenerateModelCodeRowAction;\n"]}
|
|
1
|
+
{"version":3,"file":"GenerateModelCodeRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAC;AAChH,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAGrD,IAAM,0BAA0B,GAAG,UAAC,KAA2C;;IAC3E,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IACzB,IAAA,KAMD,+BAA+B,EAAE,EAN/B,YAAY,QAAA,EAAE,UAMpB,EALc,sBAAsB,eAAA,EACtB,qBAAqB,eAAA,EACvB,mBAAmB,aAAA,EACrB,iBAAiB,WAAA,EAClB,gBAAgB,UACY,CAAC;IAEvC,0DAA0D;IAC1D,UAAU;IACV,sDAAsD;IACtD,8DAA8D;IAC9D,oBAAoB;IACpB,+BAA+B;IAC/B,mCAAmC;IACnC,yCAAyC;IACzC,iDAAiD;IACjD,4CAA4C;IAC5C,mCAAmC;IACnC,+GAA+G;IAC/G,0CAA0C;IAC1C,gBAAgB;IAChB,8BAA8B;IAC9B,6BAA6B;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AAS,EAAC,EAAE,wFAA4E,EAC3F,2EAAuD,EACvD,yBACI,6CAA0B,EAC1B,4CAAyB,EACzB,iDAA8B,EAC9B,8CAA2B,EAC3B,6DAA0C,IACzC,EACL,eAAK,SAAS,EAAC,kCAAkC,aAC7C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,QAAC,OAAO,EAAE,mBAAmB,GAAI,EAC1E,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACH,CAAC,CAAC;wBACT,eAAK,SAAS,EAAC,EAAE,aACb,cAAK,SAAS,EAAC,8CAA8C,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,yBAAyB,EAAE,YAC1G,eAAM,SAAS,EAAC,gBAAgB,+BAEzB,GACL,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC3B,YAAG,SAAS,EAAC,aAAa,+DAAmD,EAC7E,cAAK,SAAS,EAAC,mCAAmC,YAC9C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,GACpF,IACJ,IACJ,GAEX,GAGR,CACN,CAAA;AACL,CAAC,CAAA;AAED,eAAe,0BAA0B,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { useSeederMutation } from \"../../../../../../redux/api/solidServiceApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useEffect, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { showToast } from \"../../../../../../redux/features/toastSlice\";\nimport { SolidCircularLoader } from '../../../../../../components/core/common/SolidLoaders/SolidCircularLoader';\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\nimport { env } from \"../../../../../../adapters/env\";\n\n\nconst GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const dispatch = useDispatch();\n const [generateCode, {\n isLoading: isGenerateCodeUpdating,\n isSuccess: isGenerateCodeSuceess,\n isError: isGenerateCodeError,\n error: generateCodeError,\n data: generateCodeData\n }] = useGenerateCodeForModelMutation();\n\n // const mqMessageApi = createSolidEntityApi(\"mqMessage\");\n // const {\n // useGetSolidEntitiesQuery: useGetMqMessageQuery,\n // useLazyGetSolidEntitiesQuery: useLazyGetMqMessageQuery,\n // } = mqMessageApi;\n // const [getMqMessageStatus, {\n // data: solidListViewMetaData,\n // error: solidListViewMetaDataError,\n // isLoading: solidListViewMetaDataIsLoading,\n // isError: solidListViewMetaDataIsError\n // }] = useLazyGetMqMessageQuery();\n // const fetchMqMessageStatus = async (retries = 30, delay = 500, generateCodeData: any): Promise<boolean> => {\n // for (let i = 0; i < retries; i++) {\n // try {\n // const query = {\n // filters: {\n // messageId: {\n // $eq: generateCodeData?.data?.messageId\n // }\n // }\n // };\n // const queryString = qs.stringify(query, {\n // encodeValuesOnly: true,\n // });\n // const res = await getMqMessageStatus(queryString)\n // if (res.isSuccess === true) {\n // if (res.data.records.length > 0) {\n // const messageStage = res.data.records[0].stage;\n // console.log(\"messageStatus\", messageStage);\n // if (messageStage === \"succeeded\") {\n // return true\n // }\n // if (messageStage === \"failed\") {\n // return false\n // }\n // }\n // }\n // } catch (e) {\n // // ignore and retry\n // }\n // await new Promise((resolve) => setTimeout(resolve, delay));\n // }\n // return false;\n // };\n\n const generateCodeHandler = async () => {\n const response: any = await generateCode({ id: event?.rowData?.id });\n console.log(\"response generate code handler\", response);\n setIsGenerating(true);\n }\n\n // TODO: START REFACTORING - reusable code alert\n const [triggerSeeder, {\n data,\n isLoading,\n isSuccess: isSeederSuccess,\n isError: isSeederError\n }] = useSeederMutation();\n\n // Utitlity to track if solid-api is up\n const [isPinging, setIsPinging] = useState(false);\n const [isGenerating, setIsGenerating] = useState(false);\n const pingBackendWithRetry = async (retries = 30, delay = 500): Promise<boolean> => {\n for (let i = 0; i < retries; i++) {\n try {\n const res = await fetch(`${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/ping`);\n console.log(\"ping response\", res);\n\n if (res.ok)\n return true;\n } catch (e) {\n // ignore and retry\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n return false;\n };\n\n useEffect(() => {\n const runSeederIfQueueStatusIsSuccess = async () => {\n if (isGenerateCodeSuceess) {\n // console.log(\"isGenerateCodeSuceess\", isGenerateCodeSuceess);\n // setIsPinging(true);\n // const hasMqMessageCompleted = await fetchMqMessageStatus(30, 500, generateCodeData);\n const isAlive = await pingBackendWithRetry();\n setIsPinging(false);\n\n // const hasMqMessageCompleted = true;\n // const isAlive = true;\n // if (hasMqMessageCompleted && isAlive) {\n if (isAlive) {\n await triggerSeeder(\"ModuleMetadataSeederService\");\n } else {\n dispatch(closePopup());\n console.log(\"Backend is not alive, cannot run seeder\");\n dispatch(showToast({ severity: \"error\", summary: ERROR_MESSAGES.BACKEND_UNAVAILABLE, detail: ERROR_MESSAGES.SEEDER_NOT_TRIGGERED }));\n }\n }\n };\n setTimeout(() => {\n runSeederIfQueueStatusIsSuccess();\n }, 5000);\n }, [isGenerateCodeSuceess]);\n\n useEffect(() => {\n if (isSeederSuccess) {\n console.log(ERROR_MESSAGES.IS_SEEDER_SUCCESS, data);\n dispatch(showToast({ severity: \"success\", summary: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY, detail: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY }));\n setIsGenerating(false);\n dispatch(closePopup());\n window.location.reload();\n }\n if (isSeederError) {\n console.log(ERROR_MESSAGES.IS_SEEDER_ERROR, isSeederError);\n dispatch(showToast({ severity: \"error\", summary: ERROR_MESSAGES.SEEDER_ERROR, detail: ERROR_MESSAGES.SEEDER_NOT_RUN }));\n setIsGenerating(false);\n }\n }, [isSeederSuccess])\n // TODO: END REFACTORING - reusable code alert\n\n return (\n <>\n {isGenerating ?\n <>\n <div className=\"flex flex-column align-items-center justify-content-center\" style={{ padding: '2rem', height: 200 }}>\n <SolidCircularLoader />\n <p className=\"mt-4 font-medium\">Waiting for backend...</p>\n </div>\n </>\n :\n <>\n {event?.rowData?.module?.name != \"solid-core\" ?\n <div className=\"\">\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Generate Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <p className=\"\">Proceed with model code generation? Existing files will be overwritten.</p>\n <p>Below is the list of files that will be created </p>\n <ul>\n <li>Model Entity File</li>\n <li>Model Repository</li>\n <li>Model Controller File</li>\n <li>Model Service File</li>\n <li>Model Create and Update Dto files</li>\n </ul>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Ok\" autoFocus onClick={generateCodeHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div > :\n <div className=\"\">\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Generate Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <p className=\"text-center\">You cannot generate code for Solid Core models</p>\n <div className=\"flex gap-3 justify-content-center\">\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n }\n </>\n }\n\n </>\n )\n}\n\nexport default GenerateModelCodeRowAction;\n"]}
|
package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx
CHANGED
|
@@ -4,13 +4,12 @@ import { useSeederMutation } from "../../../../../../redux/api/solidServiceApi";
|
|
|
4
4
|
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
5
5
|
import { SolidListRowdataDynamicFunctionProps } from "../../../../../../types/solid-core";
|
|
6
6
|
import { Button } from "primereact/button";
|
|
7
|
-
import { useEffect,
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
8
|
import { useDispatch } from "react-redux";
|
|
9
|
-
import {
|
|
9
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
10
10
|
import { SolidCircularLoader } from '../../../../../../components/core/common/SolidLoaders/SolidCircularLoader';
|
|
11
11
|
import { ERROR_MESSAGES } from "../../../../../../constants/error-messages";
|
|
12
12
|
import { env } from "../../../../../../adapters/env";
|
|
13
|
-
import showToast from "../../../../../../helpers/showToast";
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
@@ -82,8 +81,6 @@ const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps)
|
|
|
82
81
|
isError: isSeederError
|
|
83
82
|
}] = useSeederMutation();
|
|
84
83
|
|
|
85
|
-
const toast = useRef<Toast>(null);
|
|
86
|
-
|
|
87
84
|
// Utitlity to track if solid-api is up
|
|
88
85
|
const [isPinging, setIsPinging] = useState(false);
|
|
89
86
|
const [isGenerating, setIsGenerating] = useState(false);
|
|
@@ -120,7 +117,7 @@ const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps)
|
|
|
120
117
|
} else {
|
|
121
118
|
dispatch(closePopup());
|
|
122
119
|
console.log("Backend is not alive, cannot run seeder");
|
|
123
|
-
showToast(
|
|
120
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.BACKEND_UNAVAILABLE, detail: ERROR_MESSAGES.SEEDER_NOT_TRIGGERED }));
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
123
|
};
|
|
@@ -132,14 +129,14 @@ const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps)
|
|
|
132
129
|
useEffect(() => {
|
|
133
130
|
if (isSeederSuccess) {
|
|
134
131
|
console.log(ERROR_MESSAGES.IS_SEEDER_SUCCESS, data);
|
|
135
|
-
showToast(
|
|
132
|
+
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY, detail: ERROR_MESSAGES.CODE_GENERTAE_SUCCESSFULLY }));
|
|
136
133
|
setIsGenerating(false);
|
|
137
134
|
dispatch(closePopup());
|
|
138
135
|
window.location.reload();
|
|
139
136
|
}
|
|
140
137
|
if (isSeederError) {
|
|
141
138
|
console.log(ERROR_MESSAGES.IS_SEEDER_ERROR, isSeederError);
|
|
142
|
-
showToast(
|
|
139
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.SEEDER_ERROR, detail: ERROR_MESSAGES.SEEDER_NOT_RUN }));
|
|
143
140
|
setIsGenerating(false);
|
|
144
141
|
}
|
|
145
142
|
}, [isSeederSuccess])
|
|
@@ -149,7 +146,6 @@ const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps)
|
|
|
149
146
|
<>
|
|
150
147
|
{isGenerating ?
|
|
151
148
|
<>
|
|
152
|
-
<Toast ref={toast} />
|
|
153
149
|
<div className="flex flex-column align-items-center justify-content-center" style={{ padding: '2rem', height: 200 }}>
|
|
154
150
|
<SolidCircularLoader />
|
|
155
151
|
<p className="mt-4 font-medium">Waiting for backend...</p>
|
|
@@ -157,7 +153,6 @@ const GenerateModelCodeRowAction = (event: SolidListRowdataDynamicFunctionProps)
|
|
|
157
153
|
</>
|
|
158
154
|
:
|
|
159
155
|
<>
|
|
160
|
-
<Toast ref={toast} />
|
|
161
156
|
{event?.rowData?.module?.name != "solid-core" ?
|
|
162
157
|
<div className="">
|
|
163
158
|
<div className="p-dialog-header secondary-border-bottom py-3" style={{ background: 'var(--solid-light-grey)' }}>
|
package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteModuleRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"DeleteModuleRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAU1F,QAAA,MAAM,qBAAqB,UAAW,oCAAoC,4CA2GzE,CAAA;AAED,eAAe,qBAAqB,CAAC"}
|
package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.js
CHANGED
|
@@ -43,9 +43,9 @@ import { kebabCase } from "lodash";
|
|
|
43
43
|
import { Button } from "primereact/button";
|
|
44
44
|
import { Column } from "primereact/column";
|
|
45
45
|
import { DataTable } from "primereact/datatable";
|
|
46
|
-
import { useEffect,
|
|
46
|
+
import { useEffect, useState } from "react";
|
|
47
47
|
import { useDispatch } from "react-redux";
|
|
48
|
-
import showToast from "../../../../../../
|
|
48
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
49
49
|
var DeleteModuleRowAction = function (event) {
|
|
50
50
|
var _a;
|
|
51
51
|
var _b = useState(false), isConfirmed = _b[0], setIsConfirmed = _b[1];
|
|
@@ -66,7 +66,6 @@ var DeleteModuleRowAction = function (event) {
|
|
|
66
66
|
setAllowDelete(false);
|
|
67
67
|
}
|
|
68
68
|
}, [models]);
|
|
69
|
-
var toast = useRef(null);
|
|
70
69
|
var deleteModuleHandler = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
70
|
var res, message, err_1;
|
|
72
71
|
var _a, _b, _c;
|
|
@@ -90,10 +89,10 @@ var DeleteModuleRowAction = function (event) {
|
|
|
90
89
|
((_c = res.error) === null || _c === void 0 ? void 0 : _c.error) ||
|
|
91
90
|
ERROR_MESSAGES.ERROR_OCCURED;
|
|
92
91
|
setErrorState(message);
|
|
93
|
-
showToast(
|
|
92
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.DELETE_FAIELD, detail: message }));
|
|
94
93
|
}
|
|
95
94
|
else {
|
|
96
|
-
showToast(
|
|
95
|
+
dispatch(showToast({ severity: 'success', summary: ERROR_MESSAGES.MODEL_DELETE, detail: ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName) }));
|
|
97
96
|
dispatch(closePopup());
|
|
98
97
|
}
|
|
99
98
|
return [3 /*break*/, 5];
|
|
@@ -101,7 +100,7 @@ var DeleteModuleRowAction = function (event) {
|
|
|
101
100
|
err_1 = _d.sent();
|
|
102
101
|
console.error(ERROR_MESSAGES.DELETE_ERROR, err_1);
|
|
103
102
|
setErrorState(err_1.message || ERROR_MESSAGES.NETWORK_ERROR);
|
|
104
|
-
showToast(
|
|
103
|
+
dispatch(showToast({ severity: 'error', summary: ERROR_MESSAGES.ERROR, detail: ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR }));
|
|
105
104
|
return [3 /*break*/, 5];
|
|
106
105
|
case 4:
|
|
107
106
|
setIsDeleting(false);
|