@solidstarters/solid-core-ui 1.1.211 → 1.1.212
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/Svg/DevDocs.tsx +9 -0
- package/dist/components/Svg/DocsSvg.tsx +9 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FieldSvg.tsx +9 -0
- package/dist/components/Svg/FileSvg.tsx +18 -0
- package/dist/components/Svg/HomePageModuleSvg.tsx +179 -0
- package/dist/components/Svg/ModelSvg.tsx +9 -0
- package/dist/components/Svg/ModuleSvg.tsx +9 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Svg/SettingsSvg.tsx +9 -0
- package/dist/components/auth/AuthLayout.tsx +223 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +33 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +63 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +222 -0
- package/dist/components/auth/SolidForgotPassword.tsx +127 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +271 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +218 -0
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +14 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +428 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.tsx +454 -0
- package/dist/components/auth/SolidResetPassword.tsx +194 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +79 -0
- package/dist/components/common/BackButton.tsx +72 -0
- package/dist/components/common/CancelButton.tsx +61 -0
- package/dist/components/common/CodeEditor.tsx +38 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DownloadProgressToast.tsx +55 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +1225 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +84 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +64 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +73 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +6 -0
- package/dist/components/common/SolidBreadcrumb.tsx +129 -0
- package/dist/components/common/SolidExport.tsx +563 -0
- package/dist/components/common/SolidExportStepper.tsx +135 -0
- package/dist/components/common/SolidFieldTooltip.tsx +23 -0
- package/dist/components/common/SolidFormHeader.tsx +25 -0
- package/dist/components/common/SolidFormStepper.tsx +350 -0
- package/dist/components/common/SolidModuleHome.tsx +128 -0
- package/dist/components/common/SolidPopupContainer.tsx +37 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/SettingDropzoneActivePlaceholder.tsx +20 -0
- package/dist/components/common/SolidSettings/SettingsImageRemoveButton.tsx +15 -0
- package/dist/components/common/SolidSettings/SolidUploadedImage.tsx +16 -0
- package/dist/components/common/SolidThemeLink.tsx +6 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/StepperArrows/ActiveArrowStep.tsx +18 -0
- package/dist/components/common/StepperArrows/ActiveBeforeStepArrow.tsx +18 -0
- package/dist/components/common/StepperArrows/InactiveStepArrow.tsx +19 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/common/useHandleFormCustomButtonClick.ts +40 -0
- package/dist/components/common/useHandleListCustomButtonClick.ts +42 -0
- package/dist/components/core/chatter/SolidChatter.tsx +248 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +35 -0
- package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +46 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +218 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +163 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +146 -0
- package/dist/components/core/common/AvatarWidget.tsx +55 -0
- package/dist/components/core/common/DateFieldViewComponent.tsx +36 -0
- package/dist/components/core/common/FilterComponent.tsx +458 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/PDFViewer.tsx +117 -0
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +89 -0
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +188 -0
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +139 -0
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +311 -0
- package/dist/components/core/common/SolidCreateButton.tsx +48 -0
- package/dist/components/core/common/SolidGenericImport/DocumentSvg.tsx +15 -0
- package/dist/components/core/common/SolidGenericImport/SolidGenericImport.tsx +64 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +125 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportInstructions.tsx +122 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportStepper.tsx +217 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +205 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransactionStatus.tsx +158 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +29 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +1470 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidLoaders/SolidCircularLoader.tsx +7 -0
- package/dist/components/core/common/SolidPasswordHelperText.tsx +34 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +75 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.ts +421 -0
- package/dist/components/core/common/SolidXAiIframe.tsx +77 -0
- package/dist/components/core/dashboard/SolidDashboard.tsx +332 -0
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +117 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +28 -0
- package/dist/components/core/dashboard/SolidDashboardHeader.tsx +10 -0
- package/dist/components/core/dashboard/SolidDashboardLoading.tsx +55 -0
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +32 -0
- package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +29 -0
- package/dist/components/core/dashboard/SolidDashboardVariable.tsx +256 -0
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +78 -0
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +18 -0
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +54 -0
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +25 -0
- package/dist/components/core/dashboard/dashboard-utils.ts +39 -0
- package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.tsx +17 -0
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +36 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +114 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +213 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +138 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +209 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +131 -0
- package/dist/components/core/field/FieldListViewData.tsx +313 -0
- package/dist/components/core/filter/SolidBooleanFilterElement.tsx +30 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +131 -0
- package/dist/components/core/filter/SolidManyToManyFilterElement.tsx +64 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +61 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +209 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +68 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +63 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +61 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +62 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +17 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +51 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToManyField.tsx +62 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +84 -0
- package/dist/components/core/form/SolidFormActionHeader.tsx +497 -0
- package/dist/components/core/form/SolidFormFieldRender.tsx +53 -0
- package/dist/components/core/form/SolidFormFieldRenderExtension.tsx +26 -0
- package/dist/components/core/form/SolidFormFooter.tsx +162 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +84 -0
- package/dist/components/core/form/SolidFormView.tsx +1856 -0
- package/dist/components/core/form/SolidFormViewContextMenuHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewNormalHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +109 -0
- package/dist/components/core/form/fields/ISolidField.tsx +71 -0
- package/dist/components/core/form/fields/SolidBooleanField.tsx +434 -0
- package/dist/components/core/form/fields/SolidDateField.tsx +247 -0
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +229 -0
- package/dist/components/core/form/fields/SolidDecimalField.tsx +171 -0
- package/dist/components/core/form/fields/SolidEmailField.tsx +176 -0
- package/dist/components/core/form/fields/SolidIntegerField.tsx +282 -0
- package/dist/components/core/form/fields/SolidJsonField.tsx +185 -0
- package/dist/components/core/form/fields/SolidLongTextField.tsx +618 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +663 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +547 -0
- package/dist/components/core/form/fields/SolidPasswordField.tsx +390 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +56 -0
- package/dist/components/core/form/fields/SolidRichTextField.tsx +188 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +340 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +462 -0
- package/dist/components/core/form/fields/SolidShortTextField.tsx +399 -0
- package/dist/components/core/form/fields/SolidTimeField.tsx +245 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +453 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +1036 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +627 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +38 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMessageFieldFormWidget.tsx +135 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMetadataFieldFormWidget.tsx +144 -0
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +265 -0
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +32 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +50 -0
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +222 -0
- package/dist/components/core/form/fields/widgets/SolidShortTextFieldAvatarWidget.tsx +70 -0
- package/dist/components/core/form/widgets/CustomHtml.tsx +20 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +150 -0
- package/dist/components/core/kanban/KanbanCard.tsx +279 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +84 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +894 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +154 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +16 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +140 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +164 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +41 -0
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +242 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +111 -0
- package/dist/components/core/list/SolidListView.tsx +2007 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +165 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +339 -0
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +31 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +30 -0
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +41 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.tsx +78 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +35 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +27 -0
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +301 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +170 -0
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +21 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +160 -0
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +106 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +117 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +110 -0
- package/dist/components/core/list/widgets/SolidManyToManyRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidManyToOneRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +70 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +91 -0
- package/dist/components/core/locales/SolidLocale.tsx +127 -0
- package/dist/components/core/model/CreateModel.tsx +495 -0
- package/dist/components/core/model/FieldMetaData.tsx +263 -0
- package/dist/components/core/model/FieldMetaDataForm.tsx +3509 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +384 -0
- package/dist/components/core/model/ModelMetaData.tsx +921 -0
- package/dist/components/core/module/CreateModule.tsx +617 -0
- package/dist/components/core/module/ModuleListViewData.tsx +431 -0
- package/dist/components/core/solid-ai/SolidAiMainWrapper.tsx +8 -0
- package/dist/components/core/solid-ai/SolidXAIIcon.tsx +37 -0
- package/dist/components/core/users/CreateUser.tsx +467 -0
- package/dist/components/core/users/CreateUserRole.tsx +212 -0
- package/dist/components/core/users/UserListView.tsx +376 -0
- package/dist/components/layout/AdminLayout.tsx +57 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +232 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.tsx +205 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +72 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +213 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/constants/error-messages.ts +238 -0
- package/dist/declarations.d.ts +22 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +94 -0
- package/dist/helpers/autoCompleteVirtualScroll.ts +41 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadFileWithProgress.ts +91 -0
- package/dist/helpers/downloadMediaFile.tsx +21 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +61 -0
- package/dist/helpers/hydrateRelationRules.ts +120 -0
- package/dist/helpers/permissions.ts +7 -0
- package/dist/helpers/registry.ts +337 -0
- package/dist/helpers/resendOtpHelper.tsx +5 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/helpers/rolesHelper.ts +17 -0
- package/dist/helpers/solidIcons.tsx +1831 -0
- package/dist/helpers/updatePasswordField.ts +41 -0
- package/dist/index.ts +421 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -1
- package/dist/nextAuth/authProviders.js +6 -5
- package/dist/nextAuth/authProviders.js.map +1 -1
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/api/aiInteractionApi.ts +59 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/dashboardApi.ts +56 -0
- package/dist/redux/api/dashboardQuestionApi.ts +17 -0
- package/dist/redux/api/exportTemplateApi.tsx +59 -0
- package/dist/redux/api/fetchBaseQuery.tsx +118 -0
- package/dist/redux/api/fieldApi.ts +86 -0
- package/dist/redux/api/importTransactionApi.tsx +69 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/modelApi.ts +80 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.ts +25 -0
- package/dist/redux/api/solidEntityApi.tsx +164 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidServiceApi.ts +31 -0
- package/dist/redux/api/solidSettingsApi.tsx +83 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +135 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +37 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/redux/hooks/useSolidPopup.ts +20 -0
- package/dist/redux/store/defaultStoreConfig.ts +62 -0
- package/dist/styles.ts +4 -0
- package/dist/types/handlebars.d.ts +4 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +320 -0
- package/package.json +1 -1
- package/src/components/auth/SolidLogin.tsx +26 -13
- package/src/nextAuth/authProviders.tsx +9 -5
|
@@ -0,0 +1,894 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
import { permissionExpression } from "../../../helpers/permissions";
|
|
5
|
+
import { createSolidEntityApi } from "../../../redux/api/solidEntityApi";
|
|
6
|
+
import { useGetSolidViewLayoutQuery } from "../../../redux/api/solidViewApi";
|
|
7
|
+
import { useLazyCheckIfPermissionExistsQuery } from "../../../redux/api/userApi";
|
|
8
|
+
import { DropResult } from "@hello-pangea/dnd";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
import { FilterMatchMode } from "primereact/api";
|
|
11
|
+
import { Button } from "primereact/button";
|
|
12
|
+
import { Dialog } from "primereact/dialog";
|
|
13
|
+
import qs from "qs";
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { SolidCreateButton } from "../common/SolidCreateButton";
|
|
16
|
+
import { SolidGlobalSearchElement } from "../common/SolidGlobalSearchElement";
|
|
17
|
+
import KanbanBoard from "./KanbanBoard";
|
|
18
|
+
import CompactImage from '../../../resources/images/layout/images/compact.png';
|
|
19
|
+
import CozyImage from '../../../resources/images/layout/images/cozy.png';
|
|
20
|
+
import ComfortableImage from '../../../resources/images/layout/images/comfortable.png';
|
|
21
|
+
import KanbanImage from '../../../resources/images/layout/images/kanban.png';
|
|
22
|
+
import { capitalize } from "lodash";
|
|
23
|
+
import Lightbox from "yet-another-react-lightbox";
|
|
24
|
+
import Counter from "yet-another-react-lightbox/plugins/counter";
|
|
25
|
+
import Download from "yet-another-react-lightbox/plugins/download";
|
|
26
|
+
import "yet-another-react-lightbox/styles.css";
|
|
27
|
+
import "yet-another-react-lightbox/plugins/counter.css";
|
|
28
|
+
import { useRouter, useSearchParams } from "next/navigation";
|
|
29
|
+
import { SolidKanbanViewConfigure } from "./SolidKanbanViewConfigure";
|
|
30
|
+
import { KanbanUserViewLayout } from "./KanbanUserViewLayout";
|
|
31
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
32
|
+
import { queryObjectToQueryString, queryStringToQueryObject } from "../list/SolidListView";
|
|
33
|
+
import { Toast } from "primereact/toast";
|
|
34
|
+
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
35
|
+
import { showNavbar, toggleNavbar } from "../../../redux/features/navbarSlice";
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
type SolidKanbanViewParams = {
|
|
39
|
+
moduleName: string;
|
|
40
|
+
modelName: string;
|
|
41
|
+
embeded: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
46
|
+
const { user } = useSelector((state: any) => state.auth);
|
|
47
|
+
const visibleNavbar = useSelector((state: any) => state.navbarState?.visibleNavbar);
|
|
48
|
+
const dispatch = useDispatch()
|
|
49
|
+
|
|
50
|
+
const solidGlobalSearchElementRef = useRef();
|
|
51
|
+
const searchParams = useSearchParams().toString(); // Converts the query params to a string
|
|
52
|
+
const router = useRouter();
|
|
53
|
+
// TODO: The initial filter state will be created based on the fields which are present on this kanban view.
|
|
54
|
+
const [filters, setFilters] = useState<any>();
|
|
55
|
+
const [toPopulate, setToPopulate] = useState<string[]>([]);
|
|
56
|
+
const [toPopulateMedia, setToPopulateMedia] = useState<string[]>([]);
|
|
57
|
+
const [actionsAllowed, setActionsAllowed] = useState<string[]>([]);
|
|
58
|
+
const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
59
|
+
const [showArchived, setShowArchived] = useState(false);
|
|
60
|
+
const sizeOptions = [
|
|
61
|
+
{ label: 'Compact', value: 'small', image: CompactImage },
|
|
62
|
+
{ label: 'Cozy', value: 'normal', image: CozyImage },
|
|
63
|
+
{ label: 'Comfortable', value: 'large', image: ComfortableImage }
|
|
64
|
+
]
|
|
65
|
+
const [size, setSize] = useState<string | any>(sizeOptions[1].value);
|
|
66
|
+
const [viewModes, setViewModes] = useState<any>([]);
|
|
67
|
+
const [groupByFieldName, setGroupByFieldName] = useState<string>("");
|
|
68
|
+
const [groupedView, setGroupedView] = useState(true);
|
|
69
|
+
const [triggerCheckIfPermissionExists] = useLazyCheckIfPermissionExistsQuery();
|
|
70
|
+
const [openLightbox, setOpenLightbox] = useState(false);
|
|
71
|
+
const [lightboxUrls, setLightboxUrls] = useState({});
|
|
72
|
+
const [filterQueryString, setFilterQueryString] = useState<any>();
|
|
73
|
+
const [isLayoutDialogVisible, setLayoutDialogVisible] = useState(false);
|
|
74
|
+
const toast = useRef<Toast>(null);
|
|
75
|
+
|
|
76
|
+
const pushFiltersToRouter = (filterQueryString: any) => {
|
|
77
|
+
router.push(`?${filterQueryString}`, undefined, { shallow: true });
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (filterQueryString) {
|
|
82
|
+
pushFiltersToRouter(filterQueryString);
|
|
83
|
+
}
|
|
84
|
+
}, [filterQueryString]);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const fetchPermissions = async () => {
|
|
90
|
+
if (params.modelName) {
|
|
91
|
+
const permissionNames = [
|
|
92
|
+
permissionExpression(params.modelName, 'create'),
|
|
93
|
+
permissionExpression(params.modelName, 'delete'),
|
|
94
|
+
permissionExpression(params.modelName, 'update')
|
|
95
|
+
]
|
|
96
|
+
const queryData = {
|
|
97
|
+
permissionNames: permissionNames
|
|
98
|
+
};
|
|
99
|
+
const queryString = qs.stringify(queryData, {
|
|
100
|
+
encodeValuesOnly: true
|
|
101
|
+
});
|
|
102
|
+
const response = await triggerCheckIfPermissionExists(queryString);
|
|
103
|
+
setActionsAllowed(response.data.data);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
fetchPermissions();
|
|
107
|
+
}, [params.modelName]);
|
|
108
|
+
|
|
109
|
+
const isFilterApplied = filters ? true : false;
|
|
110
|
+
|
|
111
|
+
// Create the RTK slices for this entity
|
|
112
|
+
const entityApi = createSolidEntityApi(params.modelName);
|
|
113
|
+
const {
|
|
114
|
+
useCreateSolidEntityMutation,
|
|
115
|
+
useDeleteMultipleSolidEntitiesMutation,
|
|
116
|
+
useDeleteSolidEntityMutation,
|
|
117
|
+
useGetSolidEntitiesQuery,
|
|
118
|
+
useGetSolidEntityByIdQuery,
|
|
119
|
+
useLazyGetSolidEntitiesQuery,
|
|
120
|
+
useGetSolidKanbanEntitiesQuery,
|
|
121
|
+
useLazyGetSolidKanbanEntitiesQuery,
|
|
122
|
+
useLazyGetSolidEntityByIdQuery,
|
|
123
|
+
usePrefetch,
|
|
124
|
+
useUpdateSolidEntityMutation,
|
|
125
|
+
usePatchUpdateSolidEntityMutation
|
|
126
|
+
} = entityApi;
|
|
127
|
+
|
|
128
|
+
// Get the kanban view layout & metadata first.
|
|
129
|
+
const kanbanViewMetaDataQs = qs.stringify({ ...params, viewType: 'kanban' }, {
|
|
130
|
+
encodeValuesOnly: true,
|
|
131
|
+
});
|
|
132
|
+
const [kanbanViewMetaData, setKanbanViewMetaData] = useState<any>({});
|
|
133
|
+
|
|
134
|
+
const {
|
|
135
|
+
data: solidKanbanViewMetaData,
|
|
136
|
+
error: solidKanbanViewMetaDataError,
|
|
137
|
+
isLoading: solidKanbanViewMetaDataIsLoading,
|
|
138
|
+
isError: solidKanbanViewMetaDataIsError
|
|
139
|
+
} = useGetSolidViewLayoutQuery(kanbanViewMetaDataQs);
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
const initialFilterMethod = () => {
|
|
144
|
+
|
|
145
|
+
const solidView = solidKanbanViewMetaData.data.solidView;
|
|
146
|
+
const solidFieldsMetadata = solidKanbanViewMetaData.data.solidFieldsMetadata;
|
|
147
|
+
|
|
148
|
+
const initialFilters: any = {};
|
|
149
|
+
const toPopulate: string[] = [];
|
|
150
|
+
const toPopulateMedia: string[] = [];
|
|
151
|
+
function extractFields(node: any, result: any = []) {
|
|
152
|
+
if (node.type === "field") {
|
|
153
|
+
result.push(node);
|
|
154
|
+
}
|
|
155
|
+
if (node.children) {
|
|
156
|
+
node.children.forEach((child: any) => extractFields(child, result));
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const data = { /* Your JSON object here */ };
|
|
162
|
+
const layoutFields = extractFields(solidView.layout);
|
|
163
|
+
|
|
164
|
+
for (let i = 0; i < layoutFields.length; i++) {
|
|
165
|
+
const column = layoutFields[i];
|
|
166
|
+
const fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
167
|
+
if (fieldMetadata) {
|
|
168
|
+
|
|
169
|
+
// Form the initial filters after iterating over the columns and field metadata.
|
|
170
|
+
if (['int', 'bigint', 'float', 'decimal'].includes(fieldMetadata.type)) {
|
|
171
|
+
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
|
172
|
+
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.EQUALS }
|
|
173
|
+
}
|
|
174
|
+
else if (['date', 'datetime', 'time', 'boolean'].includes(fieldMetadata.type)) {
|
|
175
|
+
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }
|
|
176
|
+
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.EQUALS }
|
|
177
|
+
}
|
|
178
|
+
else if (['relation', 'selectionStatic', 'selectionDynamic'].includes(fieldMetadata.type)) {
|
|
179
|
+
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.IN }
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] }
|
|
183
|
+
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.STARTS_WITH }
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (column.attrs.name === 'id') {
|
|
187
|
+
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.IN }
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Form the "toPopulate" array.
|
|
191
|
+
if (fieldMetadata.type === 'relation') {
|
|
192
|
+
toPopulate.push(fieldMetadata.name);
|
|
193
|
+
}
|
|
194
|
+
if (fieldMetadata.type === 'mediaSingle' || fieldMetadata.type === 'mediaMultiple') {
|
|
195
|
+
toPopulateMedia.push(fieldMetadata.name);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// setFilters(initialFilters);
|
|
201
|
+
const recordsInSwimlane = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.recordsInSwimlane ? solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.recordsInSwimlane : 10;
|
|
202
|
+
// setToPopulate(toPopulate);
|
|
203
|
+
// setToPopulateMedia(toPopulateMedia);
|
|
204
|
+
// setRecordsInSwimlane(recordsInSwimlane);
|
|
205
|
+
// setToPopulate(toPopulate);
|
|
206
|
+
// setToPopulateMedia(toPopulateMedia);
|
|
207
|
+
return { recordsInSwimlane, toPopulate, toPopulateMedia }
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
// Initial Filter data
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
|
|
214
|
+
if (solidKanbanViewMetaData) {
|
|
215
|
+
setKanbanViewMetaData(solidKanbanViewMetaData);
|
|
216
|
+
const viewModes = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.length > 0 && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.map((view: any) => { return { label: capitalize(view), value: view } });
|
|
217
|
+
setViewModes(viewModes);
|
|
218
|
+
if (solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.grouped !== false) {
|
|
219
|
+
setGroupByFieldName(solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.groupBy)
|
|
220
|
+
} else {
|
|
221
|
+
setGroupByFieldName("deletedTracker");
|
|
222
|
+
setGroupedView(false);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}, [solidKanbanViewMetaData]);
|
|
226
|
+
|
|
227
|
+
// All kanban view state.
|
|
228
|
+
const [kanbanViewData, setKanbanViewData] = useState<any>([]);
|
|
229
|
+
const [kanbanLoadMoreData, setKanbanLoadMoreData] = useState<any>({});
|
|
230
|
+
const [recordsInSwimlane, setRecordsInSwimlane] = useState(10);
|
|
231
|
+
const [selectedRecords, setSelectedRecords] = useState<any[]>([]);
|
|
232
|
+
const [loading, setLoading] = useState<boolean>(true);
|
|
233
|
+
const [isDialogVisible, setDialogVisible] = useState(false);
|
|
234
|
+
const [createButtonUrl, setCreateButtonUrl] = useState<string>();
|
|
235
|
+
const [editButtonUrl, setEditButtonUrl] = useState<string>();
|
|
236
|
+
const [createActionQueryParams, setCreateActionQueryParams] = useState<Record<string, string>>({});
|
|
237
|
+
const [editActionQueryParams, setEditActionQueryParams] = useState<Record<string, string>>({});
|
|
238
|
+
const [columnsCount, setColumnsCount] = useState(5);
|
|
239
|
+
const [swimLaneCurrentPageNumber, setSwimLaneCurrentPageNumber] = useState(1);
|
|
240
|
+
const [queryDataLoaded, setQueryDataLoaded] = useState(false);
|
|
241
|
+
const [showSaveFilterPopup, setShowSaveFilterPopup] = useState<boolean>(false);
|
|
242
|
+
const [maxSwimLanesCount, setMaxSwimLanesCount] = useState<number>(0);
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
246
|
+
toast.current?.show({
|
|
247
|
+
severity,
|
|
248
|
+
summary,
|
|
249
|
+
detail,
|
|
250
|
+
...(severity === "error"
|
|
251
|
+
? { sticky: true } // stays until user closes
|
|
252
|
+
: { life: 3000 }),
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
// Get the kanban view data.
|
|
256
|
+
// const [triggerGetSolidEntitiesForKanban, { data: solidEntityKanbanViewData, isLoading, error }] = useLazyGetSolidKanbanEntitiesQuery();
|
|
257
|
+
const [triggerGetSolidEntities, { data: solidEntityKanbanViewData, isLoading, error }] = useLazyGetSolidEntitiesQuery();
|
|
258
|
+
|
|
259
|
+
// Delete mutation
|
|
260
|
+
const [
|
|
261
|
+
deleteManySolidEntities,
|
|
262
|
+
{
|
|
263
|
+
isLoading: isSolidEntitiesDeleted,
|
|
264
|
+
isSuccess: isDeleteSolidEntitiesSucess,
|
|
265
|
+
isError: isSolidEntitiesDeleteError,
|
|
266
|
+
error: SolidEntitiesDeleteError,
|
|
267
|
+
data: DeletedSolidEntities,
|
|
268
|
+
},
|
|
269
|
+
] = useDeleteMultipleSolidEntitiesMutation();
|
|
270
|
+
const [
|
|
271
|
+
patchKanbanView,
|
|
272
|
+
{ isSuccess: isKanbanUpdateSuccessfull, isError: isKanbanUpdateError, error: kanbanUpdateError },
|
|
273
|
+
] = usePatchUpdateSolidEntityMutation();
|
|
274
|
+
|
|
275
|
+
// After data is fetched populate the kanban view state so as to be able to render the data.
|
|
276
|
+
useEffect(() => {
|
|
277
|
+
if (solidEntityKanbanViewData) {
|
|
278
|
+
// Merge groupRecords by groupName: update existing, add new
|
|
279
|
+
setMaxSwimLanesCount(solidEntityKanbanViewData?.meta?.totalRecords || 0);
|
|
280
|
+
const groupRecords = solidEntityKanbanViewData?.groupRecords || [];
|
|
281
|
+
const groupMap = new Map((kanbanViewData || []).map((g: any) => [g.groupName, g]));
|
|
282
|
+
groupRecords.forEach((newGroup: any) => {
|
|
283
|
+
groupMap.set(newGroup.groupName, newGroup);
|
|
284
|
+
});
|
|
285
|
+
const latestKanbanGroupData = Array.from(groupMap.values());
|
|
286
|
+
setKanbanViewData(latestKanbanGroupData);
|
|
287
|
+
const loadmoredata = Object.entries(latestKanbanGroupData).reduce((acc: any, [key, value]: any) => {
|
|
288
|
+
acc[value.groupName] = {
|
|
289
|
+
offset: (value.groupData.meta.currentPage - 1) * value.groupData.meta.perPage,
|
|
290
|
+
limit: value.groupData.meta.perPage,
|
|
291
|
+
count: value.groupData.meta.totalRecords
|
|
292
|
+
};
|
|
293
|
+
return acc;
|
|
294
|
+
}, {});
|
|
295
|
+
|
|
296
|
+
setKanbanLoadMoreData(loadmoredata)
|
|
297
|
+
setLoading(false);
|
|
298
|
+
}
|
|
299
|
+
}, [solidEntityKanbanViewData]);
|
|
300
|
+
|
|
301
|
+
useEffect(() => {
|
|
302
|
+
if (solidKanbanViewMetaData) {
|
|
303
|
+
const kanbanViewLayoutAttrs = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs;
|
|
304
|
+
const createActionUrl = kanbanViewLayoutAttrs?.createAction && kanbanViewLayoutAttrs?.createAction?.type === "custom" ? kanbanViewLayoutAttrs?.createAction?.customComponent : "form/new";
|
|
305
|
+
const editActionUrl = kanbanViewLayoutAttrs?.editAction && kanbanViewLayoutAttrs?.editAction?.type === "custom" ? kanbanViewLayoutAttrs?.editAction?.customComponent : "form";
|
|
306
|
+
|
|
307
|
+
if (kanbanViewLayoutAttrs?.createAction) {
|
|
308
|
+
setCreateActionQueryParams({
|
|
309
|
+
actionName: kanbanViewLayoutAttrs.createAction.name,
|
|
310
|
+
actionType: kanbanViewLayoutAttrs.createAction.type,
|
|
311
|
+
actionContext: kanbanViewLayoutAttrs.createAction.context,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
if (kanbanViewLayoutAttrs?.editAction) {
|
|
315
|
+
setEditActionQueryParams({
|
|
316
|
+
actionName: kanbanViewLayoutAttrs.editAction.name,
|
|
317
|
+
actionType: kanbanViewLayoutAttrs.editAction.type,
|
|
318
|
+
actionContext: kanbanViewLayoutAttrs.editAction.context,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (createActionUrl) {
|
|
323
|
+
setCreateButtonUrl(createActionUrl)
|
|
324
|
+
}
|
|
325
|
+
if (editActionUrl) {
|
|
326
|
+
setEditButtonUrl(editActionUrl)
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}, [solidKanbanViewMetaData])
|
|
330
|
+
|
|
331
|
+
// Fetch data after toPopulate has been populated...
|
|
332
|
+
useEffect(() => {
|
|
333
|
+
|
|
334
|
+
if (solidKanbanViewMetaData) {
|
|
335
|
+
|
|
336
|
+
const swimlanesCount = solidKanbanViewMetaData?.data.solidView?.layout?.attrs?.swimlanesCount || 5;
|
|
337
|
+
if (groupByFieldName) {
|
|
338
|
+
|
|
339
|
+
const queryObject = queryStringToQueryObject();
|
|
340
|
+
let queryString = "";
|
|
341
|
+
if (queryObject) {
|
|
342
|
+
const filters = {
|
|
343
|
+
$and: []
|
|
344
|
+
}
|
|
345
|
+
if (queryObject.custom_filter_predicate) {
|
|
346
|
+
filters.$and.push(queryObject.custom_filter_predicate);
|
|
347
|
+
}
|
|
348
|
+
if (queryObject.search_predicate) {
|
|
349
|
+
filters.$and.push(queryObject.search_predicate);
|
|
350
|
+
}
|
|
351
|
+
// if (queryObject.saved_filter_predicate) {
|
|
352
|
+
// filters.$and.push(queryObject.saved_filter_predicate);
|
|
353
|
+
// }
|
|
354
|
+
// if (queryObject.predefined_search_predicate) {
|
|
355
|
+
// filters.$and.push(queryObject.predefined_search_predicate);
|
|
356
|
+
// }
|
|
357
|
+
|
|
358
|
+
const queryData = {
|
|
359
|
+
offset: 0,
|
|
360
|
+
limit: Number(queryObject.limit) + Number(queryObject.offset),
|
|
361
|
+
// fields: queryObject.fields || [`${groupByFieldName}`, `count(${groupByFieldName})`],
|
|
362
|
+
groupBy: queryObject.groupBy || groupByFieldName,
|
|
363
|
+
populateMedia: queryObject.populateMedia || toPopulateMedia,
|
|
364
|
+
populateGroup: queryObject.populateGroup || true,
|
|
365
|
+
groupFilter: {
|
|
366
|
+
limit: Number(queryObject.groupFilter.limit) + Number(queryObject.groupFilter.offset) || kanbanViewMetaData?.data?.solidView?.layout?.attrs?.recordsInSwimlane,
|
|
367
|
+
offset: 0,
|
|
368
|
+
filters: filters,
|
|
369
|
+
populate: queryObject.groupFilter.populate || toPopulate,
|
|
370
|
+
populateMedia: queryObject.groupFilter.populateMedia || toPopulateMedia
|
|
371
|
+
}
|
|
372
|
+
// sort: [`id:desc`],
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
const { recordsInSwimlane, toPopulate, toPopulateMedia } = initialFilterMethod();
|
|
377
|
+
setToPopulate(toPopulate);
|
|
378
|
+
setToPopulateMedia(toPopulateMedia);
|
|
379
|
+
setRecordsInSwimlane(recordsInSwimlane);
|
|
380
|
+
// setFilters(filters);
|
|
381
|
+
setQueryDataLoaded(true);
|
|
382
|
+
|
|
383
|
+
queryString = qs.stringify(queryData, {
|
|
384
|
+
encodeValuesOnly: true
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
} else {
|
|
388
|
+
const { recordsInSwimlane, toPopulate, toPopulateMedia } = initialFilterMethod();
|
|
389
|
+
const queryData = {
|
|
390
|
+
offset: 0,
|
|
391
|
+
limit: swimlanesCount,
|
|
392
|
+
// fields: [`${groupByFieldName}`, `count(${groupByFieldName})`],
|
|
393
|
+
groupBy: groupByFieldName,
|
|
394
|
+
populateMedia: toPopulateMedia,
|
|
395
|
+
populateGroup: true,
|
|
396
|
+
groupFilter: {
|
|
397
|
+
limit: kanbanViewMetaData?.data?.solidView?.layout?.attrs?.recordsInSwimlane || 10,
|
|
398
|
+
offset: 0,
|
|
399
|
+
filters: filters,
|
|
400
|
+
populate: toPopulate,
|
|
401
|
+
populateMedia: toPopulateMedia
|
|
402
|
+
}
|
|
403
|
+
// sort: [`id:desc`],
|
|
404
|
+
};
|
|
405
|
+
setRecordsInSwimlane(recordsInSwimlane);
|
|
406
|
+
setToPopulate(toPopulate);
|
|
407
|
+
setToPopulateMedia(toPopulateMedia);
|
|
408
|
+
|
|
409
|
+
// fields=status&groupBy=status&fields=count(status)&populateGroup=true
|
|
410
|
+
queryString = qs.stringify(queryData, {
|
|
411
|
+
encodeValuesOnly: true
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
setQueryDataLoaded(true)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// triggerGetSolidEntities(queryString);
|
|
418
|
+
setSelectedRecords([]);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}, [isDeleteSolidEntitiesSucess, groupByFieldName, solidKanbanViewMetaData]);
|
|
422
|
+
|
|
423
|
+
// clickable link allowing one to open the detail / form view.
|
|
424
|
+
const detailsBodyTemplate = (solidViewData: any) => {
|
|
425
|
+
return (
|
|
426
|
+
<Link href={`${editButtonUrl}/${solidViewData.id}?viewMode=view&${new URLSearchParams(editActionQueryParams).toString()}`} rel="noopener noreferrer" className="text-sm font-bold p-0" style={{ color: "#12415D" }}>
|
|
427
|
+
<i className="pi pi-pencil" style={{ fontSize: "1rem" }}></i>
|
|
428
|
+
</Link>
|
|
429
|
+
);
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// handle bulk deletion
|
|
433
|
+
const deleteBulk = () => {
|
|
434
|
+
let deleteList: any = [];
|
|
435
|
+
selectedRecords.forEach((element: any) => {
|
|
436
|
+
deleteList.push(element.id);
|
|
437
|
+
});
|
|
438
|
+
deleteManySolidEntities(deleteList);
|
|
439
|
+
setDialogVisible(false);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
// handle closing of the delete dialog...
|
|
443
|
+
const onDeleteClose = () => {
|
|
444
|
+
setDialogVisible(false);
|
|
445
|
+
setSelectedRecords([]);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
// Individual Swimlane Load More
|
|
450
|
+
const handleLoadMore = async (groupByField: string) => {
|
|
451
|
+
const { offset, limit, records } = kanbanLoadMoreData[groupByField];
|
|
452
|
+
const newLoadMoreData = kanbanLoadMoreData;
|
|
453
|
+
kanbanLoadMoreData[groupByField].offset = offset + limit;
|
|
454
|
+
try {
|
|
455
|
+
const queryData = {
|
|
456
|
+
offset: offset + limit,
|
|
457
|
+
limit: limit,
|
|
458
|
+
populate: toPopulate,
|
|
459
|
+
populateMedia: toPopulateMedia,
|
|
460
|
+
populateGroup: true,
|
|
461
|
+
filters: {
|
|
462
|
+
[groupByFieldName]: {
|
|
463
|
+
$in: [groupByField],
|
|
464
|
+
},
|
|
465
|
+
...filters
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
const queryString = qs.stringify(queryData, {
|
|
471
|
+
encodeValuesOnly: true
|
|
472
|
+
});
|
|
473
|
+
// router.push(`?${queryString}`);
|
|
474
|
+
const data: any = await triggerGetSolidEntities(queryString);
|
|
475
|
+
const newRecords = data.data.records;
|
|
476
|
+
const currentData = kanbanViewData;
|
|
477
|
+
const mergeData = (
|
|
478
|
+
kanbanViewData: any[],
|
|
479
|
+
newRecords: any[],
|
|
480
|
+
groupByField: string
|
|
481
|
+
) => {
|
|
482
|
+
// Find the group matching the specified groupByField
|
|
483
|
+
const originalData = structuredClone(kanbanViewData);
|
|
484
|
+
const targetGroup = originalData.find(
|
|
485
|
+
(group: any) => group.groupName === groupByField
|
|
486
|
+
);
|
|
487
|
+
if (targetGroup) {
|
|
488
|
+
const { groupData } = targetGroup;
|
|
489
|
+
|
|
490
|
+
if (targetGroup.groupData) {
|
|
491
|
+
// Extract existing records
|
|
492
|
+
const existingRecords = targetGroup.groupData.records;
|
|
493
|
+
const updatedRecords = [...existingRecords, ...newRecords];
|
|
494
|
+
targetGroup.groupData.records = updatedRecords
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
// Update the meta data (you can adjust this logic as needed)
|
|
498
|
+
groupData.meta.prevPage = groupData.meta.currentPage
|
|
499
|
+
groupData.meta.currentPage = groupData.meta.currentPage + 1
|
|
500
|
+
groupData.meta.nextPage = groupData.meta.currentPage + 1
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return originalData;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
const updatedData = mergeData(kanbanViewData, newRecords, groupByField);
|
|
508
|
+
setKanbanViewData(updatedData);
|
|
509
|
+
const loadmoredata = Object.entries(updatedData).reduce((acc: any, [key, value]: any) => {
|
|
510
|
+
acc[value.groupName] = {
|
|
511
|
+
offset: (value.groupData.meta.currentPage - 1) * value.groupData.meta.perPage,
|
|
512
|
+
limit: value.groupData.meta.perPage,
|
|
513
|
+
count: value.groupData.meta.totalRecords
|
|
514
|
+
};
|
|
515
|
+
return acc;
|
|
516
|
+
}, {});
|
|
517
|
+
setKanbanLoadMoreData(loadmoredata)
|
|
518
|
+
|
|
519
|
+
} catch (error) {
|
|
520
|
+
console.error(ERROR_MESSAGES.LOAD_MORE_DATA, error);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
// Handle drag-and-drop functionality
|
|
526
|
+
const onDragEnd = async (result: DropResult): void => {
|
|
527
|
+
const { source, destination } = result;
|
|
528
|
+
if (!destination) return;
|
|
529
|
+
|
|
530
|
+
const sourceGroupName = source.droppableId;
|
|
531
|
+
const destinationGroupName = destination.droppableId;
|
|
532
|
+
|
|
533
|
+
// Find the source and destination groups
|
|
534
|
+
const sourceGroupIndex = kanbanViewData.findIndex((group: any) => group.groupName === sourceGroupName);
|
|
535
|
+
const destinationGroupIndex = kanbanViewData.findIndex((group: any) => group.groupName === destinationGroupName);
|
|
536
|
+
|
|
537
|
+
if (sourceGroupIndex === -1 || destinationGroupIndex === -1) return;
|
|
538
|
+
|
|
539
|
+
// If dragging within the same group
|
|
540
|
+
if (sourceGroupName === destinationGroupName) {
|
|
541
|
+
setKanbanViewData((prevData: typeof kanbanViewData) =>
|
|
542
|
+
prevData.map((group: any) => {
|
|
543
|
+
if (group.groupName === sourceGroupName) {
|
|
544
|
+
const updatedRecords = [...group.groupData.records];
|
|
545
|
+
const [movedItem] = updatedRecords.splice(source.index, 1); // Remove the item
|
|
546
|
+
updatedRecords.splice(destination.index, 0, movedItem); // Insert at the new position
|
|
547
|
+
|
|
548
|
+
return {
|
|
549
|
+
...group,
|
|
550
|
+
groupData: {
|
|
551
|
+
...group.groupData,
|
|
552
|
+
records: updatedRecords,
|
|
553
|
+
},
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
return group;
|
|
557
|
+
})
|
|
558
|
+
);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Deep clone the source and destination groups
|
|
563
|
+
const sourceGroup = JSON.parse(JSON.stringify(kanbanViewData[sourceGroupIndex]));
|
|
564
|
+
const destinationGroup = JSON.parse(JSON.stringify(kanbanViewData[destinationGroupIndex]));
|
|
565
|
+
|
|
566
|
+
// Clone the records for immutability
|
|
567
|
+
const sourceRecords = [...sourceGroup.groupData.records];
|
|
568
|
+
const destinationRecords = [...destinationGroup.groupData.records];
|
|
569
|
+
|
|
570
|
+
// Remove the item from the source
|
|
571
|
+
const [movedItem] = sourceRecords.splice(source.index, 1);
|
|
572
|
+
|
|
573
|
+
// Create a mutable copy of the moved item
|
|
574
|
+
const updatedItem = { ...movedItem, status: destinationGroupName };
|
|
575
|
+
|
|
576
|
+
// Add the updated item to the destination
|
|
577
|
+
destinationRecords.splice(destination.index, 0, updatedItem);
|
|
578
|
+
|
|
579
|
+
// Update the group data
|
|
580
|
+
sourceGroup.groupData.records = sourceRecords;
|
|
581
|
+
destinationGroup.groupData.records = destinationRecords;
|
|
582
|
+
|
|
583
|
+
// Update the kanbanViewData state
|
|
584
|
+
const oldkanbanViewData = structuredClone(kanbanViewData);
|
|
585
|
+
try {
|
|
586
|
+
const formData = new FormData();
|
|
587
|
+
formData.append(groupByFieldName, destinationGroupName);
|
|
588
|
+
// Update the kanbanViewData state
|
|
589
|
+
setKanbanViewData((prevData: typeof kanbanViewData) =>
|
|
590
|
+
prevData.map((group: any) => {
|
|
591
|
+
if (group.groupName === sourceGroupName) {
|
|
592
|
+
return sourceGroup;
|
|
593
|
+
}
|
|
594
|
+
if (group.groupName === destinationGroupName) {
|
|
595
|
+
return destinationGroup;
|
|
596
|
+
}
|
|
597
|
+
return group;
|
|
598
|
+
})
|
|
599
|
+
);
|
|
600
|
+
const kanbanUpdateResponse = await patchKanbanView({ id: +movedItem.id, data: formData }).unwrap();
|
|
601
|
+
|
|
602
|
+
if (kanbanUpdateResponse?.statusCode === 200) {
|
|
603
|
+
showToast("success", ERROR_MESSAGES.IS_SUCCESS, ERROR_MESSAGES.KANBAN_UPDATED);
|
|
604
|
+
} else {
|
|
605
|
+
showToast("error", ERROR_MESSAGES.DUPLICATE_KEY, kanbanUpdateResponse?.error);
|
|
606
|
+
// Update the kanbanViewData state
|
|
607
|
+
setKanbanViewData(oldkanbanViewData);
|
|
608
|
+
}
|
|
609
|
+
} catch (error: any) {
|
|
610
|
+
// 6. Handle 500 or network errors
|
|
611
|
+
console.error(ERROR_MESSAGES.API_ERROR, error);
|
|
612
|
+
showToast("error", ERROR_MESSAGES.SOMETHING_WRONG, error?.data?.message || ERROR_MESSAGES.SOMETHING_WRONG);
|
|
613
|
+
setKanbanViewData(oldkanbanViewData);
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
// Handle SwimLane Pagination
|
|
619
|
+
const handleSwimLanePagination = async () => {
|
|
620
|
+
|
|
621
|
+
if (solidKanbanViewMetaData) {
|
|
622
|
+
|
|
623
|
+
const swimlanesCount = solidKanbanViewMetaData?.data.solidView?.layout?.attrs?.swimlanesCount || 5;
|
|
624
|
+
const queryData = {
|
|
625
|
+
offset: swimLaneCurrentPageNumber * swimlanesCount,
|
|
626
|
+
limit: swimlanesCount,
|
|
627
|
+
// fields: [`${groupByFieldName}`, `count(${groupByFieldName})`],
|
|
628
|
+
groupBy: groupByFieldName,
|
|
629
|
+
populateMedia: toPopulateMedia,
|
|
630
|
+
populate: toPopulate,
|
|
631
|
+
populateGroup: true,
|
|
632
|
+
groupFilter: {
|
|
633
|
+
limit: recordsInSwimlane,
|
|
634
|
+
offset: 0,
|
|
635
|
+
filters: filters,
|
|
636
|
+
populate: toPopulate,
|
|
637
|
+
populateMedia: toPopulateMedia
|
|
638
|
+
|
|
639
|
+
}
|
|
640
|
+
// sort: [`id:desc`],
|
|
641
|
+
};
|
|
642
|
+
// fields=status&groupBy=status&fields=count(status)&populateGroup=true
|
|
643
|
+
const queryString = qs.stringify(queryData, {
|
|
644
|
+
encodeValuesOnly: true
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
const data: any = await triggerGetSolidEntities(queryString);
|
|
648
|
+
if (data && data?.data?.groupRecords.length > 0) {
|
|
649
|
+
const updatedData = [...kanbanViewData, ...data.data.groupRecords];
|
|
650
|
+
setKanbanViewData(updatedData);
|
|
651
|
+
}
|
|
652
|
+
setSwimLaneCurrentPageNumber(swimLaneCurrentPageNumber + 1)
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
// Handle the custom filter and Search Filter
|
|
658
|
+
const handleApplyCustomFilter = async (transformedFilter: any) => {
|
|
659
|
+
|
|
660
|
+
if (solidKanbanViewMetaData) {
|
|
661
|
+
const queryfilter = {
|
|
662
|
+
$and: [
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
// if (transformedFilter.s_filter) {
|
|
666
|
+
// queryfilter.$and.push(transformedFilter.s_filter)
|
|
667
|
+
// }
|
|
668
|
+
// if (transformedFilter.c_filter) {
|
|
669
|
+
// queryfilter.$and.push(transformedFilter.c_filter)
|
|
670
|
+
// }
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
if (transformedFilter.custom_filter_predicate) {
|
|
674
|
+
queryfilter.$and.push(transformedFilter.custom_filter_predicate);
|
|
675
|
+
}
|
|
676
|
+
if (transformedFilter.search_predicate) {
|
|
677
|
+
queryfilter.$and.push(transformedFilter.search_predicate);
|
|
678
|
+
}
|
|
679
|
+
if (transformedFilter.saved_filter_predicate) {
|
|
680
|
+
queryfilter.$and.push(transformedFilter.saved_filter_predicate);
|
|
681
|
+
}
|
|
682
|
+
if (transformedFilter.predefined_search_predicate) {
|
|
683
|
+
queryfilter.$and.push(transformedFilter.predefined_search_predicate);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
const customFilter = transformedFilter;
|
|
687
|
+
const updatedFilter = { ...(filters || {}), ...(queryfilter || {}) };
|
|
688
|
+
|
|
689
|
+
// Then update state
|
|
690
|
+
setFilters(updatedFilter);
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
const swimlanesCount = solidKanbanViewMetaData?.data.solidView?.layout?.attrs?.swimlanesCount || 5;
|
|
694
|
+
// const { toPopulate, toPopulateMedia } = initialFilterMethod();
|
|
695
|
+
|
|
696
|
+
const queryData = {
|
|
697
|
+
offset: 0,
|
|
698
|
+
limit: swimlanesCount,
|
|
699
|
+
// fields: [`${groupByFieldName}`, `count(${groupByFieldName})`],
|
|
700
|
+
groupBy: groupByFieldName,
|
|
701
|
+
populateMedia: toPopulateMedia,
|
|
702
|
+
populateGroup: true,
|
|
703
|
+
groupFilter: {
|
|
704
|
+
limit: recordsInSwimlane,
|
|
705
|
+
offset: 0,
|
|
706
|
+
filters: updatedFilter,
|
|
707
|
+
populate: toPopulate,
|
|
708
|
+
populateMedia: toPopulateMedia
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
const queryString = qs.stringify(queryData, {
|
|
712
|
+
encodeValuesOnly: true
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
// s_filter and c_filter format that needs to be passed to the router
|
|
716
|
+
// only present if handleCustomFilter is applied
|
|
717
|
+
if (customFilter) {
|
|
718
|
+
let url
|
|
719
|
+
const urlData = structuredClone(queryData);
|
|
720
|
+
delete urlData.filters;
|
|
721
|
+
// urlData.s_filter = customFilter.s_filter || {};
|
|
722
|
+
// urlData.c_filter = customFilter.c_filter || {};
|
|
723
|
+
urlData.custom_filter_predicate = customFilter.custom_filter_predicate || {};
|
|
724
|
+
urlData.search_predicate = customFilter.search_predicate || {};
|
|
725
|
+
queryObjectToQueryString(urlData);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
const data: any = await triggerGetSolidEntities(queryString);
|
|
730
|
+
|
|
731
|
+
// Update the kanban view data with the new data based on filter
|
|
732
|
+
setSwimLaneCurrentPageNumber(1);
|
|
733
|
+
if (data && data?.data?.groupRecords.length > 0) {
|
|
734
|
+
const updatedData = [...data.data.groupRecords];
|
|
735
|
+
setKanbanViewData(updatedData);
|
|
736
|
+
}
|
|
737
|
+
setSelectedRecords([]);
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
useEffect(() => {
|
|
745
|
+
if (solidKanbanViewMetaData) {
|
|
746
|
+
const createActionUrl = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.createAction && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.createAction?.type === "custom" ? solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.createAction?.customComponent : "form/new";
|
|
747
|
+
const editActionUrl = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.editAction && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.editAction?.type === "custom" ? solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.editAction?.customComponent : "form";
|
|
748
|
+
const viewModes = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.length > 0 && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.map((view: any) => { return { label: capitalize(view), value: view } });
|
|
749
|
+
setViewModes(viewModes);
|
|
750
|
+
if (createActionUrl) {
|
|
751
|
+
setCreateButtonUrl(createActionUrl)
|
|
752
|
+
}
|
|
753
|
+
if (editActionUrl) {
|
|
754
|
+
setEditButtonUrl(editActionUrl)
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}, [solidKanbanViewMetaData])
|
|
758
|
+
|
|
759
|
+
const kanbanViewTitle = solidKanbanViewMetaData?.data?.solidView?.displayName
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
const toggleBothSidebars = () => {
|
|
763
|
+
if (visibleNavbar) {
|
|
764
|
+
dispatch(toggleNavbar()); // close both
|
|
765
|
+
} else {
|
|
766
|
+
dispatch(showNavbar()); // open both
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
return (
|
|
771
|
+
<div className="page-parent-wrapper">
|
|
772
|
+
<Toast ref={toast} />
|
|
773
|
+
<div className="page-header flex-column lg:flex-row">
|
|
774
|
+
<div className="flex justify-content-between w-full ">
|
|
775
|
+
|
|
776
|
+
<div className="flex align-items-center solid-header-buttons-wrapper">
|
|
777
|
+
{params.embeded !== true &&
|
|
778
|
+
<div className="apps-icon block md:hidden cursor-pointer" onClick={toggleBothSidebars}>
|
|
779
|
+
<i className="pi pi-th-large"></i>
|
|
780
|
+
</div>
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
<p className="m-0 view-title solid-text-wrapper">{kanbanViewTitle}</p>
|
|
784
|
+
{solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.enableGlobalSearch === true &&
|
|
785
|
+
// <SolidGlobalSearchElement viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
|
|
786
|
+
<div className="hidden lg:flex">
|
|
787
|
+
<SolidGlobalSearchElement showSaveFilterPopup={showSaveFilterPopup} setShowSaveFilterPopup={setShowSaveFilterPopup} ref={solidGlobalSearchElementRef} viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
|
|
788
|
+
</div>
|
|
789
|
+
}
|
|
790
|
+
</div>
|
|
791
|
+
|
|
792
|
+
<div className="flex align-items-center solid-header-buttons-wrapper">
|
|
793
|
+
{solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.enableGlobalSearch === true &&
|
|
794
|
+
<div className="flex lg:hidden">
|
|
795
|
+
<Button
|
|
796
|
+
type="button"
|
|
797
|
+
size="small"
|
|
798
|
+
icon="pi pi-search"
|
|
799
|
+
severity="secondary"
|
|
800
|
+
outlined
|
|
801
|
+
className="solid-icon-button"
|
|
802
|
+
onClick={() => setShowGlobalSearchElement(!showGlobalSearchElement)}>
|
|
803
|
+
</Button>
|
|
804
|
+
</div>
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
{actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.create !== false &&
|
|
808
|
+
<SolidCreateButton createButtonUrl={createButtonUrl} createActionQueryParams={createActionQueryParams} responsiveIconOnly={true} />
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
{actionsAllowed.includes(`${permissionExpression(params.modelName, 'delete')}`) && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.delete !== false && selectedRecords.length > 0 && <Button
|
|
812
|
+
type="button"
|
|
813
|
+
label="Delete"
|
|
814
|
+
size="small"
|
|
815
|
+
onClick={() => setDialogVisible(true)}
|
|
816
|
+
className="small-button "
|
|
817
|
+
severity="danger"
|
|
818
|
+
/>}
|
|
819
|
+
<Button
|
|
820
|
+
type="button"
|
|
821
|
+
size="small"
|
|
822
|
+
icon="pi pi-refresh"
|
|
823
|
+
severity="secondary"
|
|
824
|
+
className="solid-icon-button"
|
|
825
|
+
outlined
|
|
826
|
+
onClick={() => {
|
|
827
|
+
window.location.reload()
|
|
828
|
+
}}
|
|
829
|
+
/>
|
|
830
|
+
<SolidKanbanViewConfigure
|
|
831
|
+
solidKanbanViewMetaData={solidKanbanViewMetaData}
|
|
832
|
+
actionsAllowed={actionsAllowed}
|
|
833
|
+
viewModes={viewModes}
|
|
834
|
+
setLayoutDialogVisible={setLayoutDialogVisible}
|
|
835
|
+
setShowSaveFilterPopup={setShowSaveFilterPopup}
|
|
836
|
+
/>
|
|
837
|
+
{/* <SolidConfigureLayoutElement></SolidConfigureLayoutElement> */}
|
|
838
|
+
</div>
|
|
839
|
+
</div>
|
|
840
|
+
{/* </div> */}
|
|
841
|
+
{solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.enableGlobalSearch === true && showGlobalSearchElement && (
|
|
842
|
+
<div className="flex lg:hidden">
|
|
843
|
+
<SolidGlobalSearchElement showSaveFilterPopup={showSaveFilterPopup} setShowSaveFilterPopup={setShowSaveFilterPopup} ref={solidGlobalSearchElementRef} viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
|
|
844
|
+
</div>
|
|
845
|
+
)}
|
|
846
|
+
</div>
|
|
847
|
+
|
|
848
|
+
<style>{`.p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}`}</style>
|
|
849
|
+
{solidKanbanViewMetaData && kanbanViewData &&
|
|
850
|
+
<KanbanBoard groupByFieldName={groupByFieldName} groupedView={groupedView} kanbanViewData={kanbanViewData} maxSwimLanesCount={maxSwimLanesCount} solidKanbanViewMetaData={solidKanbanViewMetaData?.data} setKanbanViewData={setKanbanViewData} handleLoadMore={handleLoadMore} onDragEnd={onDragEnd} handleSwimLanePagination={handleSwimLanePagination} setLightboxUrls={setLightboxUrls} setOpenLightbox={setOpenLightbox} editButtonUrl={editButtonUrl}></KanbanBoard>
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
<Dialog
|
|
854
|
+
visible={isDialogVisible}
|
|
855
|
+
header="Confirm Delete"
|
|
856
|
+
modal
|
|
857
|
+
className="solid-confirm-dialog"
|
|
858
|
+
footer={() => (
|
|
859
|
+
<div className="flex justify-content-center">
|
|
860
|
+
<Button label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={deleteBulk} />
|
|
861
|
+
<Button label="No" icon="pi pi-times" className='small-button' onClick={onDeleteClose} />
|
|
862
|
+
</div>
|
|
863
|
+
)}
|
|
864
|
+
onHide={() => setDialogVisible(false)}
|
|
865
|
+
>
|
|
866
|
+
<p>Are you sure you want to delete the selected records?</p>
|
|
867
|
+
</Dialog>
|
|
868
|
+
{openLightbox &&
|
|
869
|
+
<Lightbox
|
|
870
|
+
open={openLightbox}
|
|
871
|
+
plugins={[Counter, Download]}
|
|
872
|
+
close={() => setOpenLightbox(false)}
|
|
873
|
+
slides={lightboxUrls}
|
|
874
|
+
/>
|
|
875
|
+
}
|
|
876
|
+
<Dialog
|
|
877
|
+
visible={isLayoutDialogVisible}
|
|
878
|
+
header="Change Kanban Layout"
|
|
879
|
+
modal
|
|
880
|
+
onHide={() => setLayoutDialogVisible(false)}
|
|
881
|
+
// contentStyle={{
|
|
882
|
+
// width: 800
|
|
883
|
+
// }}
|
|
884
|
+
style={{ width: '800px' }}
|
|
885
|
+
breakpoints={{
|
|
886
|
+
'1024px': '75vw', '991px': '86vw', '767px': '92vw', '250px': '96vw'
|
|
887
|
+
}}
|
|
888
|
+
|
|
889
|
+
>
|
|
890
|
+
<KanbanUserViewLayout solidKanbanViewMetaData={solidKanbanViewMetaData} setLayoutDialogVisible={setLayoutDialogVisible} />
|
|
891
|
+
</Dialog>
|
|
892
|
+
</div>
|
|
893
|
+
);
|
|
894
|
+
};
|