@solidxai/core-ui 0.1.5-beta.9 → 0.1.7-beta.0
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/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/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +4 -2
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +5 -5
- 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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useFormik } from 'formik';
|
|
2
2
|
import { Button } from 'primereact/button';
|
|
3
3
|
import { InputText } from 'primereact/inputtext';
|
|
4
|
-
import {
|
|
5
|
-
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
4
|
+
import { useCallback, useEffect, useState } from 'react'
|
|
6
5
|
import { CancelButton } from './CancelButton';
|
|
7
6
|
import { InputSwitch } from 'primereact/inputswitch';
|
|
8
7
|
import { RadioButton } from 'primereact/radiobutton';
|
|
@@ -21,11 +20,10 @@ import { Dropdown } from 'primereact/dropdown';
|
|
|
21
20
|
import { OpenAiProviderComponent } from './SolidSettings/LlmSettings/OpenAiProviderComponent';
|
|
22
21
|
import { AnthropicProviderComponent } from './SolidSettings/LlmSettings/AnthropicProviderComponent';
|
|
23
22
|
import { useDispatch, useSelector } from 'react-redux';
|
|
24
|
-
import { handleError } from '../../helpers/ToastContainer';
|
|
25
23
|
import { ERROR_MESSAGES } from '../../constants/error-messages';
|
|
26
24
|
import { useBulkUpdateSolidSettingsMutation, useLazyGetSolidSettingsQuery } from '../../redux/api/solidSettingsApi';
|
|
27
25
|
import { env } from "../../adapters/env";
|
|
28
|
-
import showToast from
|
|
26
|
+
import { showToast } from '../../redux/features/toastSlice';
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
export const GeneralSettings = () => {
|
|
@@ -43,8 +41,6 @@ export const GeneralSettings = () => {
|
|
|
43
41
|
}, [trigger])
|
|
44
42
|
const pathname = usePathname();
|
|
45
43
|
const [bulkUpdateSolidSettings] = useBulkUpdateSolidSettingsMutation();
|
|
46
|
-
const toast = useRef<Toast>(null);
|
|
47
|
-
|
|
48
44
|
const initialValues = {
|
|
49
45
|
appLogo: solidSettingsData?.data?.appLogo ?? null,
|
|
50
46
|
companylogo: solidSettingsData?.data?.companylogo ?? null,
|
|
@@ -134,7 +130,7 @@ export const GeneralSettings = () => {
|
|
|
134
130
|
});
|
|
135
131
|
|
|
136
132
|
if (updatedSettingsArray.length === 0) {
|
|
137
|
-
showToast(
|
|
133
|
+
dispatch(showToast({ severity: "success", summary: "No Changes", detail: "No settings were updated" }));
|
|
138
134
|
return;
|
|
139
135
|
}
|
|
140
136
|
|
|
@@ -145,13 +141,13 @@ export const GeneralSettings = () => {
|
|
|
145
141
|
const response = await bulkUpdateSolidSettings({ data: formData }).unwrap();
|
|
146
142
|
|
|
147
143
|
if (response.statusCode === 200) {
|
|
148
|
-
showToast(
|
|
144
|
+
dispatch(showToast({ severity: "success", summary: "Updated", detail: "Settings updated" }));
|
|
149
145
|
trigger("")
|
|
150
146
|
}
|
|
151
147
|
|
|
152
148
|
} catch (error: any) {
|
|
153
149
|
console.log("Error updating settings:", error);
|
|
154
|
-
showToast(
|
|
150
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.FAILED, detail: error?.data?.message || ERROR_MESSAGES.SOMETHING_WRONG }));
|
|
155
151
|
}
|
|
156
152
|
},
|
|
157
153
|
});
|
|
@@ -160,8 +156,8 @@ export const GeneralSettings = () => {
|
|
|
160
156
|
const errors = await formik.validateForm();
|
|
161
157
|
const errorMessages = Object.values(errors);
|
|
162
158
|
|
|
163
|
-
if (errorMessages.length > 0
|
|
164
|
-
|
|
159
|
+
if (errorMessages.length > 0) {
|
|
160
|
+
dispatch(showToast({ severity: 'error', summary: 'Error', detail: Array.isArray(errorMessages) ? errorMessages.join(', ') : errorMessages }));
|
|
165
161
|
}
|
|
166
162
|
}
|
|
167
163
|
useEffect(() => {
|
|
@@ -179,12 +175,7 @@ export const GeneralSettings = () => {
|
|
|
179
175
|
const file = acceptedFiles[0];
|
|
180
176
|
if (file) {
|
|
181
177
|
if (file.size > 2 * 1024 * 1024) {
|
|
182
|
-
|
|
183
|
-
severity: "error",
|
|
184
|
-
summary: "File too large",
|
|
185
|
-
detail: "Maximum file size is 2MB",
|
|
186
|
-
sticky: true
|
|
187
|
-
});
|
|
178
|
+
dispatch(showToast({ severity: "error", summary: "File too large", detail: "Maximum file size is 2MB" }));
|
|
188
179
|
return;
|
|
189
180
|
}
|
|
190
181
|
formik.setFieldValue("appLogo", file);
|
|
@@ -198,12 +189,7 @@ export const GeneralSettings = () => {
|
|
|
198
189
|
const file = acceptedFiles[0];
|
|
199
190
|
if (file) {
|
|
200
191
|
if (file.size > 2 * 1024 * 1024) {
|
|
201
|
-
|
|
202
|
-
severity: "error",
|
|
203
|
-
summary: "File too large",
|
|
204
|
-
detail: "Maximum file size is 2MB",
|
|
205
|
-
sticky: true
|
|
206
|
-
});
|
|
192
|
+
dispatch(showToast({ severity: "error", summary: "File too large", detail: "Maximum file size is 2MB" }));
|
|
207
193
|
return;
|
|
208
194
|
}
|
|
209
195
|
formik.setFieldValue("companylogo", file);
|
|
@@ -262,12 +248,7 @@ export const GeneralSettings = () => {
|
|
|
262
248
|
const file = acceptedFiles[0];
|
|
263
249
|
if (file) {
|
|
264
250
|
if (file.size > 2 * 1024 * 1024) {
|
|
265
|
-
|
|
266
|
-
severity: "error",
|
|
267
|
-
summary: ERROR_MESSAGES.FILE_LARGE,
|
|
268
|
-
detail: ERROR_MESSAGES.MAX_FILE_SIZE,
|
|
269
|
-
sticky: true
|
|
270
|
-
});
|
|
251
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.FILE_LARGE, detail: ERROR_MESSAGES.MAX_FILE_SIZE }));
|
|
271
252
|
return;
|
|
272
253
|
}
|
|
273
254
|
formik.setFieldValue("authScreenRightBackgroundImage", file);
|
|
@@ -281,12 +262,7 @@ export const GeneralSettings = () => {
|
|
|
281
262
|
const file = acceptedFiles[0];
|
|
282
263
|
if (file) {
|
|
283
264
|
if (file.size > 2 * 1024 * 1024) {
|
|
284
|
-
|
|
285
|
-
severity: "error",
|
|
286
|
-
summary: ERROR_MESSAGES.FILE_LARGE,
|
|
287
|
-
detail: ERROR_MESSAGES.MAX_FILE_SIZE,
|
|
288
|
-
sticky: true,
|
|
289
|
-
});
|
|
265
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.FILE_LARGE, detail: ERROR_MESSAGES.MAX_FILE_SIZE }));
|
|
290
266
|
return;
|
|
291
267
|
}
|
|
292
268
|
formik.setFieldValue("authScreenLeftBackgroundImage", file);
|
|
@@ -298,12 +274,7 @@ export const GeneralSettings = () => {
|
|
|
298
274
|
const file = acceptedFiles[0];
|
|
299
275
|
if (file) {
|
|
300
276
|
if (file.size > 2 * 1024 * 1024) {
|
|
301
|
-
|
|
302
|
-
severity: "error",
|
|
303
|
-
summary: ERROR_MESSAGES.FILE_LARGE,
|
|
304
|
-
detail: ERROR_MESSAGES.MAX_FILE_SIZE,
|
|
305
|
-
sticky: true,
|
|
306
|
-
});
|
|
277
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.FILE_LARGE, detail: ERROR_MESSAGES.MAX_FILE_SIZE }));
|
|
307
278
|
return;
|
|
308
279
|
}
|
|
309
280
|
formik.setFieldValue("authScreenCenterBackgroundImage", file);
|
|
@@ -447,7 +418,6 @@ export const GeneralSettings = () => {
|
|
|
447
418
|
|
|
448
419
|
return (
|
|
449
420
|
<div className="page-parent-wrapper">
|
|
450
|
-
<Toast ref={toast} />
|
|
451
421
|
<div className="solid-form-wrapper">
|
|
452
422
|
<div className="solid-form-section">
|
|
453
423
|
<form onSubmit={formik.handleSubmit}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalToast.d.ts","sourceRoot":"","sources":["../../../src/components/common/GlobalToast.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,+CAmBvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Toast } from 'primereact/toast';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
+
import { clearToast } from '../../redux/features/toastSlice';
|
|
6
|
+
export var GlobalToast = function () {
|
|
7
|
+
var toastRef = useRef(null);
|
|
8
|
+
var dispatch = useDispatch();
|
|
9
|
+
var message = useSelector(function (state) { return state.toast.message; });
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
var _a;
|
|
12
|
+
if (message && toastRef.current) {
|
|
13
|
+
toastRef.current.show({
|
|
14
|
+
severity: message.severity,
|
|
15
|
+
summary: message.summary,
|
|
16
|
+
detail: message.detail,
|
|
17
|
+
sticky: message.sticky,
|
|
18
|
+
life: message.sticky ? undefined : ((_a = message.life) !== null && _a !== void 0 ? _a : 3000),
|
|
19
|
+
});
|
|
20
|
+
dispatch(clearToast());
|
|
21
|
+
}
|
|
22
|
+
}, [message]);
|
|
23
|
+
return _jsx(Toast, { ref: toastRef });
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=GlobalToast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalToast.js","sourceRoot":"","sources":["../../../src/components/common/GlobalToast.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,MAAM,CAAC,IAAM,WAAW,GAAG;IACvB,IAAM,QAAQ,GAAG,MAAM,CAAQ,IAAI,CAAC,CAAC;IACrC,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAM,OAAO,GAAG,WAAW,CAAC,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,OAAO,EAAnB,CAAmB,CAAC,CAAC;IAEjE,SAAS,CAAC;;QACN,IAAI,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;YAC7B,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;gBAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,CAAC;aAC5D,CAAC,CAAC;YACH,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;SAC1B;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,KAAC,KAAK,IAAC,GAAG,EAAE,QAAQ,GAAI,CAAC;AACpC,CAAC,CAAC","sourcesContent":["import { Toast } from 'primereact/toast';\nimport React, { useEffect, useRef } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { clearToast } from '../../redux/features/toastSlice';\n\nexport const GlobalToast = () => {\n const toastRef = useRef<Toast>(null);\n const dispatch = useDispatch();\n const message = useSelector((state: any) => state.toast.message);\n\n useEffect(() => {\n if (message && toastRef.current) {\n toastRef.current.show({\n severity: message.severity,\n summary: message.summary,\n detail: message.detail,\n sticky: message.sticky,\n life: message.sticky ? undefined : (message.life ?? 3000),\n });\n dispatch(clearToast());\n }\n }, [message]);\n\n return <Toast ref={toastRef} />;\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Toast } from 'primereact/toast';
|
|
2
|
+
import React, { useEffect, useRef } from 'react';
|
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
+
import { clearToast } from '../../redux/features/toastSlice';
|
|
5
|
+
|
|
6
|
+
export const GlobalToast = () => {
|
|
7
|
+
const toastRef = useRef<Toast>(null);
|
|
8
|
+
const dispatch = useDispatch();
|
|
9
|
+
const message = useSelector((state: any) => state.toast.message);
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (message && toastRef.current) {
|
|
13
|
+
toastRef.current.show({
|
|
14
|
+
severity: message.severity,
|
|
15
|
+
summary: message.summary,
|
|
16
|
+
detail: message.detail,
|
|
17
|
+
sticky: message.sticky,
|
|
18
|
+
life: message.sticky ? undefined : (message.life ?? 3000),
|
|
19
|
+
});
|
|
20
|
+
dispatch(clearToast());
|
|
21
|
+
}
|
|
22
|
+
}, [message]);
|
|
23
|
+
|
|
24
|
+
return <Toast ref={toastRef} />;
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type SolidErrorStatePageProps = {
|
|
2
|
+
eyebrow?: string;
|
|
3
|
+
statusCode?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
actionLabel: string;
|
|
7
|
+
actionHref?: string;
|
|
8
|
+
onAction?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const SolidErrorStatePage: ({ eyebrow, statusCode, title, description, actionLabel, actionHref, onAction, }: SolidErrorStatePageProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=SolidErrorStatePage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidErrorStatePage.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidErrorStatePage.tsx"],"names":[],"mappings":"AAEA,KAAK,wBAAwB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,oFAQ7B,wBAAwB,4CAkC1B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SolidButton } from "../shad-cn-ui/SolidButton";
|
|
3
|
+
export var SolidErrorStatePage = function (_a) {
|
|
4
|
+
var _b = _a.eyebrow, eyebrow = _b === void 0 ? "Whoops!" : _b, statusCode = _a.statusCode, title = _a.title, description = _a.description, actionLabel = _a.actionLabel, actionHref = _a.actionHref, onAction = _a.onAction;
|
|
5
|
+
var handleAction = function () {
|
|
6
|
+
if (onAction) {
|
|
7
|
+
onAction();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (actionHref) {
|
|
11
|
+
window.location.href = actionHref;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return (_jsxs("div", { className: "solid-error-page", children: [_jsx("section", { className: "solid-error-page__content", children: _jsxs("div", { className: "solid-error-page__copy", children: [_jsx("p", { className: "solid-error-page__eyebrow", children: eyebrow }), _jsx("h1", { className: "solid-error-page__title", children: title }), _jsx("p", { className: "solid-error-page__description", children: description }), _jsx(SolidButton, { size: "lg", className: "solid-error-page__cta", onClick: handleAction, children: actionLabel })] }) }), _jsx("section", { className: "solid-error-page__visual", "aria-hidden": "true", children: _jsx("div", { className: "solid-error-page__visual-card", children: statusCode ? _jsx("span", { className: "solid-error-page__code", children: statusCode }) : null }) })] }));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=SolidErrorStatePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidErrorStatePage.js","sourceRoot":"","sources":["../../../src/components/common/SolidErrorStatePage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAYxD,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAQT;QAPzB,eAAmB,EAAnB,OAAO,mBAAG,SAAS,KAAA,EACnB,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,QAAQ,cAAA;IAER,IAAM,YAAY,GAAG;QACnB,IAAI,QAAQ,EAAE;YACZ,QAAQ,EAAE,CAAC;YACX,OAAO;SACR;QACD,IAAI,UAAU,EAAE;YACd,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC;SACnC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,kBAAkB,aAC/B,kBAAS,SAAS,EAAC,2BAA2B,YAC5C,eAAK,SAAS,EAAC,wBAAwB,aACrC,YAAG,SAAS,EAAC,2BAA2B,YAAE,OAAO,GAAK,EACtD,aAAI,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAM,EACpD,YAAG,SAAS,EAAC,+BAA+B,YAAE,WAAW,GAAK,EAC9D,KAAC,WAAW,IACV,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,YAAY,YAEpB,WAAW,GACA,IACV,GACE,EACV,kBAAS,SAAS,EAAC,0BAA0B,iBAAa,MAAM,YAC9D,cAAK,SAAS,EAAC,+BAA+B,YAC3C,UAAU,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,wBAAwB,YAAE,UAAU,GAAQ,CAAC,CAAC,CAAC,IAAI,GAC7E,GACE,IACN,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { SolidButton } from \"../shad-cn-ui/SolidButton\";\n\ntype SolidErrorStatePageProps = {\n eyebrow?: string;\n statusCode?: string;\n title: string;\n description: string;\n actionLabel: string;\n actionHref?: string;\n onAction?: () => void;\n};\n\nexport const SolidErrorStatePage = ({\n eyebrow = \"Whoops!\",\n statusCode,\n title,\n description,\n actionLabel,\n actionHref,\n onAction,\n}: SolidErrorStatePageProps) => {\n const handleAction = () => {\n if (onAction) {\n onAction();\n return;\n }\n if (actionHref) {\n window.location.href = actionHref;\n }\n };\n\n return (\n <div className=\"solid-error-page\">\n <section className=\"solid-error-page__content\">\n <div className=\"solid-error-page__copy\">\n <p className=\"solid-error-page__eyebrow\">{eyebrow}</p>\n <h1 className=\"solid-error-page__title\">{title}</h1>\n <p className=\"solid-error-page__description\">{description}</p>\n <SolidButton\n size=\"lg\"\n className=\"solid-error-page__cta\"\n onClick={handleAction}\n >\n {actionLabel}\n </SolidButton>\n </div>\n </section>\n <section className=\"solid-error-page__visual\" aria-hidden=\"true\">\n <div className=\"solid-error-page__visual-card\">\n {statusCode ? <span className=\"solid-error-page__code\">{statusCode}</span> : null}\n </div>\n </section>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { SolidButton } from "../shad-cn-ui/SolidButton";
|
|
2
|
+
|
|
3
|
+
type SolidErrorStatePageProps = {
|
|
4
|
+
eyebrow?: string;
|
|
5
|
+
statusCode?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
actionLabel: string;
|
|
9
|
+
actionHref?: string;
|
|
10
|
+
onAction?: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const SolidErrorStatePage = ({
|
|
14
|
+
eyebrow = "Whoops!",
|
|
15
|
+
statusCode,
|
|
16
|
+
title,
|
|
17
|
+
description,
|
|
18
|
+
actionLabel,
|
|
19
|
+
actionHref,
|
|
20
|
+
onAction,
|
|
21
|
+
}: SolidErrorStatePageProps) => {
|
|
22
|
+
const handleAction = () => {
|
|
23
|
+
if (onAction) {
|
|
24
|
+
onAction();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (actionHref) {
|
|
28
|
+
window.location.href = actionHref;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="solid-error-page">
|
|
34
|
+
<section className="solid-error-page__content">
|
|
35
|
+
<div className="solid-error-page__copy">
|
|
36
|
+
<p className="solid-error-page__eyebrow">{eyebrow}</p>
|
|
37
|
+
<h1 className="solid-error-page__title">{title}</h1>
|
|
38
|
+
<p className="solid-error-page__description">{description}</p>
|
|
39
|
+
<SolidButton
|
|
40
|
+
size="lg"
|
|
41
|
+
className="solid-error-page__cta"
|
|
42
|
+
onClick={handleAction}
|
|
43
|
+
>
|
|
44
|
+
{actionLabel}
|
|
45
|
+
</SolidButton>
|
|
46
|
+
</div>
|
|
47
|
+
</section>
|
|
48
|
+
<section className="solid-error-page__visual" aria-hidden="true">
|
|
49
|
+
<div className="solid-error-page__visual-card">
|
|
50
|
+
{statusCode ? <span className="solid-error-page__code">{statusCode}</span> : null}
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidExport.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidExport.tsx"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidExport.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidExport.tsx"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,CAAC;AAsC5B,eAAO,MAAM,WAAW,kCAAmC,GAAG,mDA8f7D,CAAC"}
|
|
@@ -47,8 +47,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
47
47
|
import { useFormik } from "formik";
|
|
48
48
|
import './solid-export.css';
|
|
49
49
|
import { Button } from "primereact/button";
|
|
50
|
-
import {
|
|
51
|
-
import
|
|
50
|
+
import React, { useEffect, useState } from "react";
|
|
51
|
+
import { useDispatch } from 'react-redux';
|
|
52
|
+
import { showToast } from '../../redux/features/toastSlice';
|
|
52
53
|
import { createSolidEntityApi } from "../../redux/api/solidEntityApi";
|
|
53
54
|
import { Dropdown } from "primereact/dropdown";
|
|
54
55
|
import { Dialog } from "primereact/dialog";
|
|
@@ -60,7 +61,7 @@ import { Checkbox } from "primereact/checkbox";
|
|
|
60
61
|
import { ERROR_MESSAGES } from "../../constants/error-messages";
|
|
61
62
|
export var SolidExport = function (_a) {
|
|
62
63
|
var listViewMetaData = _a.listViewMetaData, filters = _a.filters;
|
|
63
|
-
var
|
|
64
|
+
var dispatch = useDispatch();
|
|
64
65
|
var entityApi = createSolidEntityApi("userViewMetadata");
|
|
65
66
|
var useUpsertSolidEntityMutation = entityApi.useUpsertSolidEntityMutation;
|
|
66
67
|
var upsertUserView = useUpsertSolidEntityMutation()[0];
|
|
@@ -149,9 +150,9 @@ export var SolidExport = function (_a) {
|
|
|
149
150
|
}, [templatesData]);
|
|
150
151
|
var handleAddTemplate = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
151
152
|
var tname, customSelectedFields, fieldsData, exportData, response, newAddedTemplate_1, err_1;
|
|
152
|
-
var _a
|
|
153
|
-
return __generator(this, function (
|
|
154
|
-
switch (
|
|
153
|
+
var _a;
|
|
154
|
+
return __generator(this, function (_b) {
|
|
155
|
+
switch (_b.label) {
|
|
155
156
|
case 0:
|
|
156
157
|
setIsDialogVisible(false);
|
|
157
158
|
tname = newTemplateName.trim();
|
|
@@ -167,17 +168,13 @@ export var SolidExport = function (_a) {
|
|
|
167
168
|
fields: fieldsData,
|
|
168
169
|
modelMetadataId: (_a = solidView === null || solidView === void 0 ? void 0 : solidView.model) === null || _a === void 0 ? void 0 : _a.id,
|
|
169
170
|
};
|
|
170
|
-
|
|
171
|
+
_b.label = 1;
|
|
171
172
|
case 1:
|
|
172
|
-
|
|
173
|
+
_b.trys.push([1, 3, , 4]);
|
|
173
174
|
return [4 /*yield*/, createExportTemplate(exportData).unwrap()];
|
|
174
175
|
case 2:
|
|
175
|
-
response =
|
|
176
|
-
(
|
|
177
|
-
severity: "success",
|
|
178
|
-
summary: "Template Added",
|
|
179
|
-
detail: "Template Saved",
|
|
180
|
-
});
|
|
176
|
+
response = _b.sent();
|
|
177
|
+
dispatch(showToast({ severity: "success", summary: "Template Added", detail: "Template Saved" }));
|
|
181
178
|
newAddedTemplate_1 = {
|
|
182
179
|
name: (selectedTemplate === null || selectedTemplate === void 0 ? void 0 : selectedTemplate.name) || "",
|
|
183
180
|
code: response.data.id,
|
|
@@ -191,17 +188,13 @@ export var SolidExport = function (_a) {
|
|
|
191
188
|
setSelectedFormat(formatOptions.find(function (format) { return format.code === (selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.code); }) || null);
|
|
192
189
|
return [3 /*break*/, 4];
|
|
193
190
|
case 3:
|
|
194
|
-
err_1 =
|
|
191
|
+
err_1 = _b.sent();
|
|
195
192
|
console.error(ERROR_MESSAGES.TEMPLATE_FAILED, err_1);
|
|
196
193
|
return [3 /*break*/, 4];
|
|
197
194
|
case 4: return [3 /*break*/, 6];
|
|
198
195
|
case 5:
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
summary: ERROR_MESSAGES.TEMPLATE_FAILED,
|
|
202
|
-
detail: ERROR_MESSAGES.TEMPLATE_FAILED,
|
|
203
|
-
});
|
|
204
|
-
_d.label = 6;
|
|
196
|
+
dispatch(showToast({ severity: "error", summary: ERROR_MESSAGES.TEMPLATE_FAILED, detail: ERROR_MESSAGES.TEMPLATE_FAILED }));
|
|
197
|
+
_b.label = 6;
|
|
205
198
|
case 6: return [2 /*return*/];
|
|
206
199
|
}
|
|
207
200
|
});
|
|
@@ -302,18 +295,13 @@ export var SolidExport = function (_a) {
|
|
|
302
295
|
} })] }));
|
|
303
296
|
var handleDeleteTemplate = function (id) { return __awaiter(void 0, void 0, void 0, function () {
|
|
304
297
|
var response;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
switch (_b.label) {
|
|
298
|
+
return __generator(this, function (_a) {
|
|
299
|
+
switch (_a.label) {
|
|
308
300
|
case 0: return [4 /*yield*/, deleteExportTemplate(id).unwrap()];
|
|
309
301
|
case 1:
|
|
310
|
-
response =
|
|
302
|
+
response = _a.sent();
|
|
311
303
|
setTemplateOptions(function (prev) { return prev.filter(function (template) { return template.code !== id; }); });
|
|
312
|
-
(
|
|
313
|
-
severity: "success",
|
|
314
|
-
summary: "Template Deleted",
|
|
315
|
-
detail: "Template Deleted",
|
|
316
|
-
});
|
|
304
|
+
dispatch(showToast({ severity: "success", summary: "Template Deleted", detail: "Template Deleted" }));
|
|
317
305
|
return [2 /*return*/];
|
|
318
306
|
}
|
|
319
307
|
});
|
|
@@ -324,7 +312,7 @@ export var SolidExport = function (_a) {
|
|
|
324
312
|
handleDeleteTemplate(option.code);
|
|
325
313
|
}, xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7 4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2h4a1 1 0 1 1 0 2h-1.069l-.867 12.142A2 2 0 0 1 17.069 22H6.93a2 2 0 0 1-1.995-1.858L4.07 8H3a1 1 0 0 1 0-2h4V4zm2 2h6V4H9v2zM6.074 8l.857 12H17.07l.857-12H6.074zM10 10a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1z", fill: "#ff3d32" }) })] }));
|
|
326
314
|
};
|
|
327
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
315
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "p-0", children: currentStepValue === 'export' &&
|
|
328
316
|
_jsxs(_Fragment, { children: [_jsxs("div", { className: "SolidExportControls mx-2 gap-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(Checkbox, { inputId: "applyFilters", onChange: function (e) { return setCheckedApplyFilter(!!e.checked); }, checked: checkApplyFilter }), _jsx("label", { htmlFor: "applyFilters", className: "ml-2", children: " Apply Filters" })] }), _jsx(Dropdown, { value: selectedFormat, onChange: function (e) { return setSelectedFormat(e.value); }, options: formatOptions, optionLabel: "name", placeholder: "Format .", className: "p-dropdown p-outlined",
|
|
329
317
|
// 👇 Render icon + text for dropdown list options
|
|
330
318
|
itemTemplate: function (option) {
|