{"version":3,"sources":["locales/translations.ts","utils/LocaleHE.js","utils/date-utils.ts","api/odata/ODataFilter.ts","styles/colors/bookitColors.ts","utils/userProfileSettings.ts","app/slice/selectors.ts","app/components/BasicTable/types/FilterParam.ts","api/HttpClient.ts","app/components/BasicIcons/FontAwesome/index.tsx","app/components/Forms/FormsLayout/FormRightSection/index.tsx","app/components/Forms/FormsLayout/StyledForm/index.tsx","api/SettingsApi.ts","app/slice/workers/doPrefetchConfigurableColumns.ts","app/slice/saga.ts","app/slice/index.ts","app/components/BasicButtons/Button/index.tsx","app/components/Typography/index.tsx","utils/url-utils.ts","app/slice/types.ts","utils/loadable.tsx","app/Layout/FrontendLayout/slice/type.ts","app/components/BasicButtons/IconButton/index.tsx","app/Layout/FrontendLayout/slice/saga.ts","app/Layout/FrontendLayout/slice/index.ts","app/components/basic/Wrappers/Box/index.tsx","types/AppSettings.ts","app/Layout/FrontendLayout/slice/selectors.ts","utils/typeUtils.ts","utils/globalSettings/GlobalSettings.ts","types/KnownModules.ts","utils/mobileDetect.ts","app/components/BasicPickers/AutocompletePicker/index.tsx","app/components/BasicPickers/BaseOptionsPicker/highlightSearchTerm.tsx","app/components/BasicTooltips/Tooltip/index.tsx","api/odata/generated/enums/AvailabilityTypes.ts","app/components/Typography/BasicTypography.tsx","enums/ServiceTypes.ts","enums/AssetAttributes.ts","styles/typography/bookitTypography.ts","utils/redux-injectors.ts","app/components/BasicPickers/Utils/autoCompletePickerUtils.ts","utils/enumKeys.ts","utils/string-utils.ts","app/hooks/useEffectOnMount.ts","app/pages/ReservationDetails/Details/slice/types.ts","app/hooks/useAsyncAwaitedState.ts","app/components/ExternalLink/index.tsx","app/hooks/useSystemDate.ts","app/Layout/FrontendLayout/components/CoverWrapper/index.tsx","app/components/LinearProgress/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/Head.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/ShortHead.tsx","app/Layout/FrontendLayout/components/PageWrapper/styled/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/ButtonsPanel.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/TopButtonsPanel.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/FormSkeleton.tsx","app/Layout/FrontendLayout/components/PageWrapper/index.tsx","utils/assertExhaustive.tsx","app/pages/OtherServiceDetails/Details/slice/selectors.ts","app/pages/ReservationDetails/Details/slice/selectors.ts","app/components/Forms/FormTextField.tsx","enums/ConfigurableTypes.ts","utils/@reduxjs/toolkit.tsx","app/components/Forms/Schemas/index.ts","app/components/BasicButtons/TopActionButton/index.tsx","app/hooks/useSidePanelOpen.tsx","app/components/DialogConfirm/index.tsx","app/components/BasicIcons/InfoIcon/index.tsx","app/pages/Samples/RequestSamplesPage/slice/types.ts","app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn.ts","app/pages/Samples/RequestSamplesPage/slice/selectors.ts","enums/RepetitiveOptions.ts","utils/globalSettings/AllowedSettings.ts","app/components/BasicPickers/BaseOptionsPicker/index.tsx","app/components/Forms/FormRender/FormRenderer.tsx","app/components/DatePeriods/index.tsx","app/Layout/FrontendLayout/components/Snackbar/types.ts","app/pages/CalendarPage/Scheduler/components/event_text/handlebars.ts","app/pages/CalendarPage/Scheduler/components/event_text/ExtractPathsVisitor.ts","app/pages/CalendarPage/Scheduler/slice/selectors.ts","api/odata/generated/enums/RequiredTypes.ts","api/odata/generated/enums/DisplayTypes.ts","app/components/CustomForm/CustomFormUtils.ts","app/components/pickers/AutocompletePickers/UserPicker/index.tsx","types/CustomDate.ts","app/hooks/usePromise.ts","types/PresetDatesRange.ts","app/pages/Samples/RequestSamplesPage/slice/saga.ts","app/pages/Samples/RequestSamplesPage/slice/index.ts","utils/entity-utils.ts","app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker/index.tsx","app/components/pickers/MultiSelectPickers/AssetsPicker/index.tsx","types/AuthenticatedUser.ts","app/pages/Samples/SamplePlatesPage/slice/index.ts","app/components/Forms/FormRichTextField.tsx","app/pages/AssetPopUp/OpenAssetDetails/index.tsx","enums/RestrictDurationUnitTypes.ts","app/pages/CalendarPage/Scheduler/utils/index.ts","app/components/LoadingIndicator/index.tsx","app/pages/OtherServiceDetails/Details/slice/types.ts","app/pages/OtherServiceDetails/Details/slice/saga.ts","app/pages/OtherServiceDetails/Details/slice/index.ts","app/pages/Samples/SamplesListPage/slice/index.ts","app/components/BasicTable/withSavedHistory.tsx","app/components/BasicInputs/BaseTextField/index.tsx","app/components/DropDown/index.tsx","app/components/BasicTable/CellRenderers/DateRenderer/index.tsx","enums/commentReferenceTypes.ts","enums/Article.ts","app/components/Forms/FormConnectedFilters/slice/selectors.ts","app/components/pickers/MultiSelectPickers/OnlineServicesPicker/index.tsx","app/components/Forms/FormLabelText.tsx","enums/TrainingState.ts","api/OtherServicesApi.ts","app/components/BasicInputs/TextControlField/index.tsx","app/components/Forms/FormNumberField.tsx","app/components/PopupImportExport/Actions/Types.ts","api/odata/generated/enums/PurchaseOrderOptions.ts","app/components/BasicTable/Filters/AssetRangeFilter/index.tsx","app/components/BasicTable/types/ColumnWithDeps.ts","app/components/BasicTable/Comparers/index.ts","app/components/BasicTable/index.tsx","app/hooks/useIsMobile.ts","api/ReservationsApi.ts","app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes.ts","app/components/ReactActions/useStyles.tsx","app/components/ReactActions/StyledMenuItem.tsx","app/components/ReactActions/HoverActions.tsx","app/components/ReactActions/ClickableActions.tsx","app/components/ReactActions/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/selectors.ts","app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton/index.tsx","utils/messages.ts","app/components/BasicTable/BasicFilter/AppliedFilterComponent.tsx","app/pages/Samples/EditableTable/EditableCell/index.tsx","app/components/BasicTable/Filters/BooleanPickerFilter/index.tsx","app/components/BasicButtons/ActionButton/index.tsx","app/hooks/useAsyncGetOnMount.ts","app/permissions/WorkOrders/allowedroles.tsx","app/permissions/WorkOrders/workOrdersPermissionUtils.ts","app/components/pickers/AutocompletePickers/BudgetPicker/index.tsx","app/components/BasicTable/components/BooleanRender/index.tsx","app/components/Forms/FormBookitDatePicker/index.tsx","app/pages/ReservationDetails/Details/components/useGlobalSettingsHook.ts","app/components/pickers/AutocompletePickers/OfflineServiceTypePicker/index.tsx","app/components/BasicTable/Filters/DatesRangeFilter/index.tsx","app/components/BasicTable/RowActions.tsx","app/pages/ArticlesPage/slice/selectors.ts","app/pages/ReservationDetails/Details/components/utils.ts","app/components/DatePicker/utils/pickerDateValidate.tsx","app/components/DateTimeLabel/index.tsx","app/components/BasicInputs/Check/styles.ts","app/components/BasicInputs/Check/index.tsx","enums/enums.ts","api/CommentsApi.ts","enums/DraftReservationTypes.ts","api/odata/generated/enums/AllowReservationCollaboratorsTypes.ts","app/pages/ReservationDetails/Details/slice/mapSettingsFromServices.ts","app/pages/ReservationDetails/Details/slice/ConvertModelToUpdateEntity.ts","app/pages/ReservationDetails/Details/slice/ConvertModelToInsertEntity.ts","app/pages/ReservationDetails/Details/slice/saga.ts","app/pages/ReservationDetails/Details/slice/TryDisableRemoveableEquipments.ts","app/pages/ReservationDetails/Details/slice/ConvertDtoToModel.ts","app/pages/ReservationDetails/Details/slice/getReservationSettings.ts","app/pages/ReservationDetails/Details/slice/index.ts","api/WorkOrderApi.ts","app/components/BasicInputs/GhostInput/index.tsx","enums/BudgetFields.ts","app/components/BasicChip/index.tsx","app/components/LargeFilesUpload/slice/saga.ts","app/components/LargeFilesUpload/slice/index.ts","app/components/Forms/FormConnectedFilters/slice/types.ts","app/components/Forms/FormConnectedFilters/slice/saga.ts","app/components/Forms/FormConnectedFilters/slice/index.ts","styles/constantVariables.ts","app/components/pickers/AutocompletePickers/ExtraddlPicker/index.tsx","app/components/BasicPickers/AutocompleteMultiPicker/index.tsx","app/components/BasicPickers/BaseURLPicker/index.tsx","app/pages/SavedViewsPage/SavedViewPage/slice/types.ts","app/pages/SavedViewsPage/SavedViewPage/slice/saga.ts","app/pages/SavedViewsPage/SavedViewPage/slice/index.ts","enums/EmptySlotAdminClick.ts","app/components/BasicTable/useProfileSetting/index.ts","app/components/LargeFilesUpload/Components/useUploadToNewComment.ts","app/components/Forms/Switch.tsx","app/pages/SavedViewsPage/SavedViewPage/slice/selectors.ts","app/components/Forms/FormBookitDateTimePicker/index.tsx","app/components/BasicTable/Filters/ExtraDDLFilter/index.tsx","app/components/pickers/AutocompletePickers/UserGroupPicker/index.tsx","app/components/BasicPickers/AutocompleteMultiPickerEx/index.tsx","app/pages/Samples/RequestSamplesPage/slice/path.ts","app/components/AssetThumbImage/getAssetImageSrc.tsx","app/components/BasicTable/useProfileSetting/parseProfileUrl.ts","enums/WorkingHoursTypes.ts","app/pages/CalendarPage/Scheduler/slice/saga.ts","app/pages/CalendarPage/Scheduler/slice/index.ts","app/components/BasicTable/UnconfigurableTable/FilterHandler.tsx","app/components/Forms/FormUserPicker.tsx","app/components/BasicAlert/index.tsx","app/pages/Samples/EditableTable/Fields/TextField/index.tsx","app/components/Messages/slice/type.ts","app/pages/AssetPopUp/IAsset.tsx","app/components/BasicTable/components/UserProfileLink/index.tsx","app/components/PopupImportExport/Actions/index.ts","app/components/PopupImportExport/Actions/Api.ts","app/pages/Samples/SamplesListPage/slice/selectors.ts","app/components/BasicTable/Filters/index.tsx","app/components/TextField/index.tsx","app/components/Forms/FormCheckbox.tsx","app/components/BasicTable/BasicFilter/AddFilterButton.tsx","app/components/BasicTable/BasicFilter/AppliedFiltersContainer/index.tsx","app/components/BasicTable/BasicFilter/index.tsx","app/components/Forms/FormControls/FormControl/index.tsx","app/components/BookitDatePicker/DateInput.tsx","app/components/DatePicker/utils/toEndDateDisplayValue.tsx","app/components/DatePicker/utils/truncateTime.tsx","utils/DateFormattingUtils/longFormatters.ts","utils/DateFormattingUtils/getFormatTokens.ts","app/components/BookitDatePicker/utils/types.ts","app/components/BookitDatePicker/StyledPicker.tsx","app/components/pickers/StaticOptionsPickers/DaysByMonthPicker/index.tsx","app/components/pickers/StaticOptionsPickers/MonthOfYearPicker/index.tsx","app/components/pickers/StaticOptionsPickers/YearsPicker/index.tsx","app/components/BookitDatePicker/DateDropDown/index.tsx","app/components/pickers/StaticOptionsPickers/HoursPicker/index.tsx","app/components/pickers/StaticOptionsPickers/MinutesPicker/index.tsx","app/components/pickers/StaticOptionsPickers/AmPmPicker/index.tsx","app/components/BookitDatePicker/TimeDropDown/index.tsx","app/hooks/useIsomorphicLayoutEffect.ts","app/hooks/useEventListener.ts","app/components/BookitDatePicker/utils/useDateTimeChange.ts","app/components/BookitDatePicker/KeyboardRifmInput/index.tsx","app/components/BookitDatePicker/KeyboardInput.tsx","app/components/BookitDatePicker/TimeOptionPicker/index.tsx","app/components/BookitDatePicker/index.tsx","app/hooks/useKeyUpOutside.ts","utils/logLevel.ts","types/DatesRange.ts","app/hooks/useExpandedSideBarState.ts","types/SiteMapSettings.ts","types/IRepetitiveDto.ts","styles/shadows/bookitShadow.ts","api/savedViewsApi.ts","app/components/pickers/AutocompletePickers/WorkOrderTypePicker/index.tsx","app/components/pickers/AutocompletePickers/InventoryBatchesPicker/index.tsx","app/pages/CalendarPage/Scheduler/utils/parseType.tsx","api/odata/generated/enums/TimelineGroupBy.ts","app/pages/CalendarPage/parseCalendarPageParams.tsx","app/components/BasicTable/CellRenderers/AlignRight.tsx","enums/CustomFormType.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/saga.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/index.ts","app/components/BasicTable/Filters/UserFilter/index.tsx","app/components/BasicTable/components/DescriptionCell/index.tsx","app/pages/CalendarPage/GetCalendarPagePath.tsx","app/pages/Samples/EditableTable/Fields/NumberField/index.tsx","app/pages/ServiceRequestsKanbanPage/slice/selectors.ts","app/components/pickers/ServiceGroupPicker/index.tsx","app/components/Forms/FormServiceGroupPicker.tsx","app/components/Forms/FormControls/FormControlLabel/index.tsx","app/components/Forms/FormControls/FormHelperText/index.tsx","utils/number-utils.ts","app/pages/ArticlesPage/slice/saga.ts","app/pages/ArticlesPage/slice/index.ts","app/components/PrintToPDF/slice/saga.ts","app/components/PrintToPDF/slice/index.ts","app/pages/ServiceRequestsKanbanPage/slice/saga.ts","app/pages/ServiceRequestsKanbanPage/slice/index.ts","app/components/LargeFilesUpload/slice/selectoes.ts","app/permissions/Asset/assetPermissions.ts","app/components/BasicTable/Hooks/aggregations.js","app/components/BasicTable/Hooks/utils.js","app/components/BasicTable/Hooks/useSummary.js","app/components/BasicTable/components/TableCard/index.tsx","app/components/BasicTable/components/TabsToolbar/index.tsx","app/components/BasicTable/components/FloatingActions.tsx","app/components/BasicTable/components/CustomTableToolbar/index.tsx","app/components/BasicTable/ControlledTable/RenderRow.tsx","app/components/BasicTable/components/CustomEmptyTable/index.tsx","app/components/BasicTable/ControlledTable/TableCell.tsx","app/components/BasicTable/ControlledTable/RenderGroupedRow.tsx","app/components/BasicTable/ImportButton/index.tsx","app/components/BasicTable/ControlledTable/index.tsx","app/components/BasicTable/components/TableSkeleton/index.tsx","app/components/BasicInputs/Toggle/index.tsx","app/components/BasicToggle/index.tsx","app/components/basic/Wrappers/FlexWrappers/flexRow.tsx","app/components/PrintToPDF/slice/selectors.ts","app/components/Comments/index.tsx","app/components/CalendarButton/index.tsx","app/components/Forms/FormFundingTypePicker.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember.tsx","app/components/BasicInputs/Select/index.tsx","app/components/BasicTable/BasicFilter/SavedListsDropDown/index.tsx","app/components/BasicPickers/EnumPicker/index.tsx","types/IConnectedFiltersDto.ts","app/components/PrintToPDF/PrintPDFSection.tsx","app/components/BasicTable/Filters/NumberFieldFilter/index.tsx","app/components/pickers/AutocompletePickers/BuildingPicker/index.tsx","api/utils.ts","app/components/pickers/AutocompletePickers/CampusPicker/index.tsx","app/components/pickers/AutocompletePickers/RoomPicker/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/TableToolbarHeader.tsx","app/components/BasicTable/BasicFilter/TableToolbar/index.tsx","app/components/pickers/AutocompletePickers/AssetPicker/index.tsx","app/components/BasicTable/UnconfigurableTable/UnconfigurableTable.tsx","app/Layout/FrontendLayout/components/TopBar/styled/index.tsx","app/components/Forms/FormsLayout/wrappers/index.tsx","app/components/Forms/FormsLayout/FormSectionTitle.tsx","app/slice/globalDbSettingsSelectors.ts","app/components/Forms/FormAssetsPicker.tsx","app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker/index.tsx","app/components/BasicTable/Filters/ResrvationStatusMultiFilter/index.tsx","app/components/BasicTable/Filters/UpcomingReservationfilter/index.tsx","app/components/BasicTable/Filters/WorkflowBookingFilter/index.tsx","app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker/index.tsx","app/components/BasicTable/Filters/ReservationByIdWithPartsFilter/index.tsx","app/components/BasicTable/BasicFilter/FilterDisplay/InstrumentsFilterDisplay/index.tsx","app/pages/ReservationHistoryPage/Filter.tsx","app/components/Forms/FormRepetitive/slice/saga.ts","app/components/Forms/FormRepetitive/slice/index.ts","enums/ServiceGroupRegistrationStatus.ts","app/components/BasicTable/ConfigurableColumns.ts","enums/RemindBefore.ts","app/components/pickers/AutocompletePickers/UserMultiPicker/index.tsx","app/components/BasicTable/BasicFilter/utils.ts","app/components/Forms/FormEquipmentsPicker.tsx","api/odata/generated/entities/IAssetDto.ts","app/components/Forms/FormBudgetPicker.tsx","api/odata/generated/enums/ServiceRequestMilestoneStatuses.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types.ts","api/odata/ODataParamsBuilder.ts","app/components/BasicList/StyledList/index.tsx","styles/colors/info.ts","styles/MUIExtend/themeOverrides.ts","styles/theme.tsx","app/components/BasicTable/Filters/BuildingPickerFilter/index.tsx","app/components/pickers/AutocompletePickers/LocationPicker/index.tsx","app/components/pickers/MultiSelectPickers/ServiceGroupsPicker/index.tsx","app/hooks/useGlobalServiceGroupsFilter.ts","app/components/BasicTable/CellRenderers/AssetRenderer/index.tsx","app/components/ButtonConfirm/index.tsx","app/pages/InvoiceDetails/InvoiceDetailsSidePanel/index.tsx","app/components/Forms/ValidationSchemaProvider.tsx","app/pages/Samples/components/RunTypePicker/index.tsx","app/components/BasicTable/CellRenderers/BooleanRenderer/index.tsx","enums/OnlineServiceTypeEnum.ts","app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker/index.tsx","app/components/pickers/AutocompletePickers/RegionPicker/index.tsx","app/hooks/useResponseModel.ts","app/pages/AssetPopUp/AttributeRenderers/index.tsx","app/pages/AssetPopUp/IAssetRow.tsx","app/pages/AssetPopUp/AssetLocationLastUpdate.tsx","app/components/BasicTable/components/DoubleRenderer/index.tsx","app/pages/AssetPopUp/components/AssetComments.tsx","app/pages/AssetPopUp/getAssetEditLink.ts","app/pages/AssetPopUp/Rows.tsx","app/pages/AssetPopUp/components/Utils.ts","app/pages/AssetPopUp/components/TopAssetActionsDropDown.tsx","app/pages/AssetPopUp/CreateAnAssetRelatedEvent.tsx","app/pages/AssetPopUp/components/AssetDetailsFiles.tsx","app/pages/AssetPopUp/components/RenderAssetRows.tsx","app/pages/AssetPopUp/components/MismatchCoreMessage.tsx","app/pages/AssetPopUp/components/AssetDetailsTabContent.tsx","app/pages/AssetPopUp/components/AssetBookingRules.tsx","app/pages/AssetPopUp/components/TableFilters.tsx","app/pages/AssetPopUp/components/GetTableCount.ts","app/pages/AssetPopUp/components/AssetTrainingSessions.tsx","app/pages/AssetPopUp/components/AssetArcticlesTable.tsx","app/pages/AssetPopUp/components/AssetWorkOrders.tsx","app/pages/AssetPopUp/components/BadgeCounter.tsx","app/pages/AssetPopUp/components/AssetMobileDropDownTabs/index.tsx","app/pages/AssetPopUp/components/AssetDetailsTabs.tsx","app/pages/AssetPopUp/components/types.ts","app/pages/AssetPopUp/index.tsx","app/components/BasicLinks/Link/index.tsx","app/components/BasicButtons/ActionIconButton/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions.tsx","app/pages/ReservationDetails/Details/slice/getBudgetVisible.ts","app/pages/Actions/GlobalSelectedActions/OpenWorkOrder.tsx","app/components/CommentsContainer/styles.ts","app/components/CommentsContainer/FileButton.tsx","app/components/LargeFilesUpload/Upload/index.ts","app/components/LargeFilesUpload/Upload/Api.ts","app/components/LargeFilesUpload/Components/FileCard.tsx","app/components/LargeFilesUpload/Components/SelectFile.tsx","app/components/LargeFilesUpload/index.tsx","app/components/CommentsContainer/index.tsx","app/pages/OtherServiceDetails/Details/components/AddService.tsx","app/pages/OtherServiceDetails/Details/components/InventoryBatchChip.tsx","app/pages/OtherServiceDetails/Details/components/QuickServiceItem.tsx","app/pages/Actions/PageTopActions/AddConsumable/index.tsx","app/pages/OtherServiceDetails/Details/components/AddServiceFromSelection.tsx","app/pages/OtherServiceDetails/Details/components/BookQuickServices.tsx","enums/ReservationOrDowntimeEnum.ts","app/components/BookitDatePicker/BookitDateTimePicker.tsx","app/pages/AssetsInventory/Details/slice/selectors.ts","enums/MultipleInstrumentReservations.ts","app/pages/CalendarPage/Scheduler/slice/types.ts","app/components/BasicTable/Filters/ServiceMultiFilter/index.tsx","app/pages/NotFoundPage/P.ts","app/pages/NotFoundPage/index.tsx","styles/MUIExtend/autocompleteStyles.ts","app/components/BasicTable/initFilterData.ts","enums/InvoiceStatuses.ts","app/components/Forms/FormRepetitive/slice/types.ts","app/components/pickers/DatePeriodsPicker/index.tsx","app/components/pickers/AutocompletePickers/UnitTypePicker/index.tsx","app/components/AssetThumbImage/index.tsx","app/components/Forms/FormAutocompleteOptions.tsx","app/components/Forms/FormAutocompleteMultiOptions.tsx","api/ExternalApi.ts","app/components/CustomForm/CustomFormFields/CustomFormDropDown.tsx","styles/colors/types.ts","app/pages/CalendarPage/Scheduler/utils/formatSchedulerDateOrUndefined.tsx","api/odata/generated/enums/FileTypes.ts","utils/fileStoreHelper.ts","api/odata/generated/enums/Roles.ts","app/pages/Samples/RequestSamplesPage/slice/prepareServiceRequestRowModel.ts","app/pages/LocationsPage/Details/index.tsx","enums/CatRateTypes.ts","app/components/Forms/Schemas/InvoiceChildRowBaseSchema/index.ts","enums/allowCreateInvoicesBy.ts","app/pages/AddPaymentPage/index.tsx","app/pages/AddPaymentPage/PaymentSchema.ts","api/ChargeApi.ts","app/components/Forms/FormCatRateTypePicker.tsx","app/components/pickers/AutocompletePickers/OfflineServicePicker/index.tsx","app/components/Forms/FormOfflineServicePicker.tsx","app/components/Forms/FormSampleTypePicker.tsx","app/components/Forms/FormServiceUserGroupPicker.tsx","app/pages/AddChargePage/index.tsx","app/pages/AddChargePage/ChargeSchema.ts","app/pages/LabelTypesPage/LabelTypeEdit/Loadable.ts","app/pages/ArticlesPage/Hooks/useAllowedToChangeStatus.tsx","app/pages/ArticlesPage/ArticleDetails/index.tsx","app/components/Forms/FormAssetPicker.tsx","app/pages/ArticlesPage/utils.ts","app/components/Forms/FormCustomPicker.tsx","app/pages/ArticlesPage/ArticlePickers/index.tsx","app/pages/ArticlesPage/ArticleFormPickers/index.tsx","app/pages/ArticlesPage/NewArticleDetailsForm/index.tsx","app/components/CommentsContainer/IComment.ts","app/pages/ArticlesPage/ArticleComments.tsx","app/pages/ArticlesPage/EditArticleDetailsForm/index.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/Actions/UserAttributesActions.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/types.ts","api/UserAttributesApi.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/saga.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/index.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/selectors.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/UserAttributesForm/index.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/index.tsx","api/odata/generated/enums/Priorities.ts","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema.ts","app/components/pickers/StaticOptionsPickers/PriorityPicker/index.tsx","app/components/Forms/FormPriorityPicker.tsx","app/components/Forms/FormServiceRequestStatusPicker.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/components/Form/index.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/components/AddSubTicket/index.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/index.tsx","app/pages/OtherServiceDetails/StockRenewal/StockRenewalForm.tsx","app/pages/OtherServiceDetails/StockRenewal/index.tsx","app/pages/OtherServiceDetails/RenewStock/RenewStockForm.tsx","app/pages/OtherServiceDetails/RenewStock/index.tsx","app/pages/OtherServiceDetails/InventoryBatch/InventoryBatchForm.tsx","app/pages/OtherServiceDetails/InventoryBatch/index.tsx","app/pages/ArticlesPage/ArticleAssociationForm/index.tsx","app/Layout/FrontendLayout/components/SidePanel/SidePanelRenderer.tsx","app/components/pickers/AutocompletePickers/AssetCatGroupPicker/index.tsx","app/components/pickers/AutocompletePickers/InstitutePicker/index.tsx","app/components/pickers/AutocompletePickers/AssetCatPicker/index.tsx","app/components/pickers/AutocompletePickers/DepartmentPicker/index.tsx","app/components/BasicTable/Filters/RoomPickerFilter/index.tsx","app/components/Description/index.tsx","app/components/pickers/AutocompletePickers/InstituteTypePicker/index.tsx","app/components/BasicCards/index.tsx","app/components/BasicTable/TableFilterBuilder/index.ts","app/pages/Animals/InternalIdLoginPage/slice/saga.ts","app/pages/Animals/InternalIdLoginPage/slice/index.ts","app/components/Forms/FormUsersPicker.tsx","app/components/pickers/AutocompletePickers/SubLocationListPicker/index.tsx","app/components/ReservationEditButton/index.tsx","app/components/BasicPickers/BaseOptionsMultiPicker/index.tsx","app/slice/router-selectors.ts","enums/BudgetExperimentStatuses.ts","app/components/pickers/AutocompletePickers/SuperGroupPicker/index.tsx","app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils.ts","app/pages/Actions/GlobalSelectedActions/AddWorkOrder.tsx","app/components/BasicTable/Filters/RegionFilter/index.tsx","app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker/index.tsx","app/components/BasicButtons/FilterIconButton/index.tsx","app/components/ReservationCreateButton/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenReservation.tsx","app/pages/CalendarPage/SchedulerWithFiltersProps.tsx","app/pages/CalendarPage/getDefaultFilter.tsx","app/pages/CalendarPage/getRequiredFilter.tsx","app/pages/CalendarPage/CalendarPageDefaultRedir.tsx","app/pages/CalendarPage/index.tsx","app/components/BooleanPicker/index.tsx","app/components/DialogAlert/slice/index.ts","app/components/ErrorBoundary/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/TitlePage.tsx","app/components/CommentsContainer/commentParser.tsx","app/pages/ReservationDetails/Details/slice/combineOfflineServiceTypes.ts","app/components/pickers/AutocompletePickers/TrainingSessionPicker/index.tsx","app/components/pickers/StaticOptionsPickers/RemindBeforePicker/index.tsx","app/components/pickers/AutocompletePickers/WorkflowBookingPicker/index.tsx","enums/GlobalEnums.ts","app/components/BasicTable/styles.ts","app/components/BasicTable/useMemoFilters.ts","app/components/ValueLabel/index.tsx","app/components/BasicTabs/TabPanel/index.tsx","app/components/Forms/FormAutocomplete.tsx","app/components/Forms/FormAutocompleteMulti.tsx","app/components/CustomForm/CustomFormFields/CustomFormUserSelection.tsx","app/components/Forms/FormRepetitive/slice/selectors.ts","app/components/pickers/AutocompletePickers/SampleTypePicker.index.tsx","app/components/Forms/FormOfflineServiceTypePicker.tsx","app/pages/Regions/RegionLink.tsx","app/components/Forms/FromRadioGroup.tsx","app/components/CustomForm/CustomFormFields/CustomFormAnswerQuestions.tsx","app/components/CustomForm/CustomFormFields/CustomFormCheckBox.tsx","app/components/CustomForm/CustomFormFields/CustomFormDate.tsx","app/components/CustomForm/CustomFormFields/CustomFormDisclimer.tsx","app/components/CustomForm/CustomFormFields/CustomFormEmail.tsx","app/components/CustomForm/CustomFormFields/CustomFormNumberText.tsx","app/components/CustomForm/CustomFormFields/CustomFormParagraph.tsx","app/components/CustomForm/CustomFormFields/CustomFormPositiveNumber.tsx","app/components/CustomForm/CustomFormFields/CustomFormRadioGroup.tsx","app/components/CustomForm/CustomFormFields/CustomFormRichText.tsx","app/components/CustomForm/CustomFormFields/CustomFormShortText.tsx","app/components/CustomForm/CustomFormFields.tsx","app/components/BookitlabLogo/messages.ts","app/pages/CalendarPage/Scheduler/utils/syncSchedulerEvents.tsx","api/fileStoreApi.ts","app/hooks/usePrevious.tsx","api/odata/generated/entities/IUserFilterDto.ts","api/odata/generated/enums/SamplePlatePositionNamingTypes.ts","api/CustomFormApi.ts","app/components/CustomForm/CustomFormContent/index.tsx","app/components/CustomForm/CusomFormControl/Form/index.tsx","app/components/CustomForm/CusomFormControl/index.tsx","app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker/index.tsx","app/components/RadioGroup/index.tsx","api/BillingActionsApi.ts","app/permissions/Reservations/reservationPermissions.ts","app/pages/OnlineBudgetsStatusPage/slice/types.ts","app/components/DateLabel.tsx/index.tsx","api/PaymentApi.ts","app/components/Forms/FormsLayout/FormRow/index.tsx","app/pages/Samples/SamplePlatesPage/slice/selectors.ts","app/components/BasicTable/BasicFilter/FilterBox/index.tsx","app/components/DownloadFileButton/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/Actions/TrainingActions.tsx","app/components/Forms/FormInputFile.tsx","app/components/Forms/Schemas/SchemaMethods.ts","app/components/pickers/AutocompletePickers/WorkOrdersPicker/index.tsx","app/components/Forms/FormRestrictedUserGroupPicker.tsx","app/pages/ServiceRequestsKanbanPage/Filter.ts","app/pages/Samples/EditableTable/TablePaginationActions.tsx","app/pages/Samples/EditableTable/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePositionsPicker/index.tsx","app/components/Forms/FormGradientPicker.tsx","app/pages/Samples/components/CreateSampleRunReservation/index.tsx","app/pages/Samples/RunDetailsPage/ImportComponents/PopupImport.tsx","app/pages/Samples/RunDetailsPage/ImportButton.tsx","app/pages/Samples/RunDetailsPage/Actions/index.ts","app/pages/Samples/RunDetailsPage/SelectedRowActions/GetSelectaedRowActions.tsx","app/pages/Samples/RunDetailsPage/AnalyticalSampleIDSuffix.tsx","app/pages/Samples/RunDetailsPage/CellPositionToNumber.tsx","app/pages/Samples/RunDetailsPage/index.tsx","api/EmailNotificationsApi.ts","app/pages/EmailNotificationsPage/index.tsx","app/pages/EmailNotificationsPage/SelectedRowActions/GetSelectedRowActions.tsx","app/components/BasicInputs/BaseInputs/StandardInput/styles.ts","app/components/BasicInputs/BaseInputs/StandardInput/index.tsx","app/components/BasicTable/withGlobalServiceGroupFilter.tsx","app/components/BasicTable/Filters/UserGroupFIlter/index.tsx","app/components/Admin/AdminActions/index.tsx","app/components/BasicLinks/ButtonLink/index.tsx","app/components/BasicTable/Filters/AssetCatGroupFilter/index.tsx","app/components/BasicTable/Filters/InstituteFilter/index.tsx","types/ResponseType.ts","app/components/pickers/AutocompletePickers/ProjectPicker/index.tsx","app/components/BasicTable/Filters/ProjectFilter/index.tsx","app/components/BasicTable/Filters/AssetCatFilter/index.tsx","app/components/BasicTable/Filters/ServiceGroupFilter/index.tsx","app/components/BasicTable/Filters/DepartmentFilter/index.tsx","app/components/pickers/AutocompletePickers/ServiceTypePicker/index.tsx","app/components/pickers/AutocompletePickers/UserDisciplinePicker/index.tsx","app/components/BookitlabLogo/index.tsx","app/components/BasicTable/Filters/InstituteTypeFilter/index.tsx","app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker/index.tsx","app/components/LabelPrint/Printers/getQrUrl.ts","app/components/LabelPrint/Printers/Dymo.ts","app/components/LabelPrint/Printers/Zebra.ts","app/components/LabelPrint/Printers/index.ts","app/components/LabelPrint/slice/saga.ts","app/components/LabelPrint/slice/index.ts","app/components/pickers/AutocompletePickers/TrainingLevelPicker/index.tsx","app/components/pickers/AutocompletePickers/AssetMultiPicker/index.tsx","app/components/BasicTable/Filters/AssetMultiFilter/index.tsx","app/components/BasicTable/Filters/LocationPickerFilter/index.tsx","app/Layout/FrontendLayout/components/CustomerLogo/index.tsx","app/components/BasicTable/Filters/CampusPickerFilter/index.tsx","app/components/QrCodeExport/index.tsx","app/components/pickers/AutocompletePickers/AreassPicker/index.tsx","api/odata/generated/enums/EmailType.ts","app/components/BasicDialog/BasicDialogTitle.tsx","app/components/BasicButtons/BaseToggleButton/index.tsx","app/components/BasicButtons/BaseToggleButtonGroup/index.tsx","app/components/BasicTable/FilterContainer/index.tsx","app/pages/Actions/PageTopActions/AddReservation/index.tsx","app/components/BasicTable/Filters/ServiceGroupsFilter/index.tsx","app/components/BasicTable/Filters/SuperGroupFilter/index.tsx","app/components/pickers/AutocompletePickers/TagsPicker/index.tsx","app/components/pickers/AutocompletePickers/LoanablePicker/index.tsx","app/components/pickers/AutocompletePickers/StatusPicker/index.tsx","app/components/pickers/AutocompletePickers/LockersPicker/index.tsx","app/components/BasicTable/Filters/SubLocationListFilter/index.tsx","app/components/PrintToPDF/Components/PrintStyles.ts","app/components/PrintToPDF/index.tsx","enums/InstrumentListAssemblyTypes.ts","app/components/pickers/StaticOptionsPickers/AssemblyTypePicker/index.tsx","app/components/Forms/FormsLayout/StyledFormFieldsContainer/index.tsx","app/components/BasicTable/getFilterValue.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/SkeletonIfLoading.tsx","app/components/Forms/FormControls/FormGroup/index.tsx","app/components/BasicTable/BasicFilter/FiltersButton/index.tsx","app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings.tsx","app/components/pickers/AutocompletePickers/AvailabilityTypePicker/index.tsx","app/components/BasicTable/GlobalFilter.tsx","app/pages/WorkOrdersPage/Actions/NewWorkOrder/index.tsx","app/pages/Actions/GlobalSelectedActions/BringBackUp.tsx","app/pages/Actions/GlobalSelectedActions/DownWorkOrder.tsx","app/pages/Actions/GlobalSelectedActions/OpenCalendar.tsx","app/pages/Actions/GlobalSelectedActions/OpenWrokOrders.tsx","app/components/BasicTable/useConfigurableColumnsAdvanced.ts","app/components/Popover/index.tsx","app/components/BasicDialog/BasicDialogContentWithTitle.tsx","app/components/BasicDialog/index.tsx","app/components/BasicCheckBox/index.tsx","app/components/BasicTable/components/TableCardGrid/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/styled/index.tsx","api/odata/getPredicates.ts","app/components/BasicLinks/RouterLink/index.tsx","app/pages/ArticlesPage/ArticleDoiLink/index.tsx","app/components/pickers/StaticOptionsPickers/PaymentMethodEnumPicker/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePicker/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePositionPicker/index.tsx","app/pages/Samples/SamplesListPage/ImportButton.tsx","app/components/pickers/StaticOptionsPickers/PriceSheetMethodPicker/index.tsx","api/ServiceRequestsApi.ts","app/pages/MyAssetsPage/DefaultFilter.tsx","app/components/BasicTable/CellRenderers/DecimalRenderer/index.tsx","app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker/index.tsx","app/pages/Samples/EditableTable/Fields/DateField/index.tsx","app/components/pickers/AutocompletePickers/ServiceRequestStatusPicker/index.tsx","app/components/DialogForm/index.tsx","app/pages/AddChargePage/AddChargeButton.tsx","app/components/BasicTable/withoutGlobalServiceGroupFilter.tsx","app/components/pickers/MultiSelectPickers/EquipmentReservationPicker/index.tsx","app/components/Forms/FormReservationEquipmentsPicker.tsx","app/components/Forms/FormReservationStatusPicker.tsx","app/pages/ReservationDetails/Details/components/ReservationCustomForm.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/BudgetListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/UserNameListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/UserGroupListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/StartTimeListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/EndTimeListener.tsx","app/components/BasicChip/ChipChekBoxGroup.tsx","app/components/BasicChip/ChipLabelGroup.tsx","app/components/Forms/FormChipsGroup.tsx","app/pages/ReservationDetails/Details/components/ReservationOfflineServices.tsx","app/components/pickers/MultiSelectPickers/AccompaniedServicesPicker/index.tsx","app/components/Forms/FormAccompaniedServicesPicker.tsx","app/pages/ReservationDetails/Details/components/ReservationActions.tsx","app/pages/ReservationDetails/Details/components/TerminateReservation.tsx","app/components/Forms/FormTrainingSessionPicker.tsx","app/components/pickers/AutocompletePickers/ReservationBudgetExperimentPicker/index.tsx","app/components/Forms/ReservationBudgetExperimentPicker.tsx","app/pages/ReservationDetails/Details/ReservationForm/getReservationsLink.tsx","app/pages/TrainingSessionsPage/components/EditTrainingSessionsLink/index.tsx","app/pages/ReservationDetails/Details/components/TrainingSignUpAdminAlertContent/index.tsx","app/pages/ReservationDetails/Details/components/ReservationTimePicker/index.tsx","app/pages/ReservationDetails/Details/components/EquipmentsDataAssemblies/index.tsx","app/pages/ReservationDetails/Details/components/ReservationWorkOrders/index.tsx","app/components/Forms/FormWorkFlowBooking/index.tsx","app/pages/ReservationDetails/Details/components/ReadOnlyDetails/index.tsx","app/pages/ReservationDetails/Details/components/RequestDetails/index.tsx","app/pages/ReservationDetails/Details/ReservationForm/index.tsx","app/pages/ReservationDetails/Details/ReservationForm/handlers.tsx","app/pages/ReservationDetails/Details/ReservationForm/getReservationCollaboratorsFilter.tsx","app/pages/ReservationDetails/Details/components/ApproveTrainingRecords.tsx","app/pages/ReservationDetails/Details/components/TransferReservation.tsx","app/pages/ReservationDetails/Details/components/Modifications/index.tsx","app/pages/ReservationDetails/Details/components/Modifications/Columns.tsx","app/pages/ReservationDetails/Details/components/Modifications/Filter.tsx","app/pages/ReservationDetails/Details/components/CalculatePricing/index.tsx","app/pages/ReservationDetails/Details/index.tsx","enums/MinTimeAheadPeriodTypes.ts","api/RestrictionsApi.ts","enums/TrainingStatus.ts","app/pages/InstrumentRestrictionsPage/Details/components/UserOwnPermissions.tsx","api/UserPermissionsApi.ts","app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions.tsx","app/components/Copyright/messages.ts","app/components/Copyright/styled/index.tsx","app/components/Copyright/index.tsx","app/components/Messages/slice/selector.ts","app/pages/ReservationDetails/Details/useOpenReservationSidePanel.tsx","app/components/Messages/index.tsx","api/BarcodeScanApi.ts","app/pages/AssetsInventory/Details/slice/saga.ts","app/pages/AssetsInventory/Details/slice/index.ts","app/components/Messages/slice/saga.ts","app/components/Messages/slice/index.ts","app/components/EndUsageConfirm/EndUsageOfflineServices/index.tsx","app/components/EndUsageConfirm/index.tsx","app/components/BasicDialog/BasicDialogActions.tsx","app/components/Popper/index.tsx","app/components/Popper/PopperTitle.tsx","app/components/RichTextEditor/index.tsx","app/components/Forms/FormAdminUserPicker.tsx","app/components/BasicTable/Filters/DatesPeriodFilter/index.tsx","api/odata/generated/enums/ServiceType.ts","enums/WorkWeekDays.ts","app/pages/CalendarPage/Scheduler/utils/parseLength.tsx","app/pages/CalendarPage/Scheduler/utils/applyForceFullDayReservations.tsx","app/pages/CalendarPage/Scheduler/utils/adjustSchedulerEventTimes.tsx","app/hooks/useGlobalDomEvents.ts","app/components/BasicTable/BasicFilter/FiltersGroupDisplay/index.tsx","app/components/BasicTable/BasicFilter/FilterDisplay/index.tsx","app/components/LabelPrint/PrintSelectedAssetLabelsButton/index.tsx","app/components/BasicTable/useConfigurableColumns.ts","app/components/BasicTable/TablePaginationActions.tsx","app/components/BasicTable/ExportButton/index.tsx","app/components/BasicTable/SelectedActions/index.tsx","app/components/BasicTable/components/ConfigureColumnsButton.tsx","app/hooks/useLocationChange.ts","app/components/BasicTabs/TabsWrapper.tsx","app/components/CustomForm/CustomFormFields/CustomFormFileUpload.tsx","app/components/Forms/FormRepetitive/RepetitiveControl.tsx","api/SamplesApi.ts","app/pages/Samples/RunDetailsPage/ImportComponents/ImportComponent.tsx","utils/redux-saga/index.ts","api/InvoiceTemplatesApi.ts","app/components/Forms/FormInventoryBatchPicker.tsx","enums/ReferenceType.ts","app/components/BasicDialog/BasicDialogContent.tsx","app/pages/ServiceRequestsKanbanPage/components/getServiceRequestTicketTitle.tsx","app/pages/ServiceRequestsKanbanPage/components/ParentTicketDetailsButton/index.tsx","app/components/Forms/FormsLayout/FormErrorSummury/index.tsx","app/pages/ArticlesExternalSearchPage/Loadable.ts","app/components/pickers/AutocompletePickers/BudgetExperimentsPicker/index.tsx","app/components/Forms/FormBudgetExperimentsPicker.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/UserGroupListener.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/UserNameListener.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/BudgetListener.tsx","app/components/Forms/FormConnectedFilters/index.tsx","app/components/Forms/FormConnectedFilters/ConnectedFiltersControl.tsx","api/RegionsApi.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/saga.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/index.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/selectors.ts","app/pages/Regions/RegionsDetailsPage/Details/index.tsx","app/components/PrintToPDF/Components/Dialog.tsx","app/components/PrintToPDF/Components/styles.ts","app/components/PrintToPDF/Components/CheckBox.tsx","app/components/PrintToPDF/Components/PopupPrintToPDFComponent.tsx","app/components/PrintToPDF/Components/PrintToPDFPopup.tsx","app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusPicker/index.tsx","app/components/Forms/FormServiceRequestMilestoneStatusPicker.tsx","app/pages/Samples/components/ServiceRequestMilestoneDetails/index.tsx","app/components/Forms/FormUnitTypePicker.tsx","app/components/Forms/FormServiceRequestMilestoneChargeServicePicker.tsx","app/pages/Samples/components/ServiceRequestMilestoneChargeDetails/index.tsx","app/components/RichTextEditor/RichEditorSerializer.tsx","app/components/RichTextEditor/RichEditor.tsx","app/components/RichTextEditor/styles.ts","app/components/Avatar/styles.ts","app/components/Avatar/index.tsx","app/pages/OtherServiceDetails/Details/OfflineForm/index.tsx","app/pages/OtherServiceDetails/Details/index.tsx","app/components/pickers/AutocompletePickers/PaymentMethodPicker/index.tsx","app/components/Forms/FormPaymentMethodPicker.tsx","app/components/BasicTable/ControlledTable/addRowSelect.tsx","app/components/BasicTable/ControlledTable/ConditionalSelectHeaderCheckbox.ts","enums/InvoiceFundingType.ts","enums/ScreenToShowOn.ts","app/components/BasicTable/Filters/InstrumentCatFilter/index.tsx","app/components/BasicTable/Filters/UserAssetContactMultiFilter/index.tsx","app/pages/UsersPage/PageActions/Actions.ts","app/pages/BillingPreviewPage/Actions/Apis.ts","app/components/BasicTable/CellRenderers/PercentageRenderer/index.tsx","app/components/LabelPrint/slice/selectors.ts","app/components/BasicTable/CellRenderers/DateTimeRenderer/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenArticleDetails.tsx","app/components/BasicTable/CellRenderers/DurationRenderer/index.tsx","app/pages/LocationsPage/Details/ditails.ts","app/pages/Animals/InternalIdLoginPage/slice/selectors.ts","app/components/BasicTable/Filters/CustomPickerFilter/index.tsx","app/components/pickers/CustomPicker/index.tsx","app/pages/PublicAssets/slice/selectors.ts","app/components/BasicTable/Filters/ServiceTypeFilter/index.tsx","api/EmailApi.ts","app/hooks/useSendMail.ts","app/components/BasicTable/Filters/UserDisciplineFilter/index.tsx","app/components/pickers/AutocompletePickers/ServiceUserGroupPicker/index.tsx","app/components/InfoIcon/index.tsx","app/pages/SavedViewsPage/AddToLists/index.tsx","app/components/BasicTable/CellRenderers/ListRenderer/index.tsx","app/components/pickers/AutocompletePickers/ReservationStatusPicker/index.tsx","app/components/Forms/FormRoomPicker.tsx","app/components/PopupImportExport/Components/Dialog/index.tsx","app/components/PopupImportExport/Components/Types.ts","app/components/PopupImportExport/Data/index.ts","app/components/PopupImportExport/Components/SelectFile.tsx","app/components/PopupImportExport/Components/TypePicker.tsx","app/components/PopupImportExport/Components/AutomaticAssetImportNamingPicker.tsx","app/components/PopupImportExport/Components/ImageList.tsx","app/components/PopupImportExport/Components/SelectImageFiles.tsx","app/components/PopupImportExport/Components/step1.tsx","app/components/PopupImportExport/Components/step2_4.tsx","app/components/PopupImportExport/Components/NamePicker.tsx","app/components/PopupImportExport/Components/Table/index.tsx","app/components/PopupImportExport/Components/step3.tsx","app/components/PopupImportExport/Components/step5.tsx","app/components/PopupImportExport/index.tsx","app/components/BasicTable/Filters/CampusFilter/index.tsx","app/components/pickers/AutocompletePickers/UserGroupMultiPicker/index.tsx","app/pages/PublicAssets/slice/saga.ts","app/pages/PublicAssets/slice/index.ts","app/components/InvoiceRowReferenceLinks/index.tsx","app/components/Forms/FormLocationPicker.tsx","app/components/PopupImport/index.tsx","app/components/BasicTable/Filters/TagsFilter/index.tsx","app/components/BasicTable/Filters/LoanableFilter/index.tsx","app/components/BasicTable/Filters/StatusFilter/index.tsx","app/components/BasicTable/Filters/LockersFilter/index.tsx","app/components/BasicTable/Filters/AssemblyTypesFilter/index.tsx","app/components/BasicTable/Filters/AreasFilter/index.tsx","app/components/BasicTable/Filters/OnlineServiceTypeFilter/index.tsx","app/components/BasicTable/Filters/MyAssetAvailabilityTypeMultiPickerFilter/index.tsx","enums/InternalServiceRequestStatuses.ts","app/components/pickers/AutocompletePickers/TrainingStatePicker/index.tsx","app/components/BasicTable/Filters/TrainingStatePickerFilter/index.tsx","app/components/pickers/AutocompletePickers/ReservationOrDowntimePicker/index.tsx","app/components/BasicTable/Filters/ReservationOrDowntimePickerFilter/index.tsx","app/components/BasicTable/Filters/WithReservationsOnlyFilter/index.tsx","app/pages/CalendarPage/Filter.tsx","app/components/pickers/AutocompletePickers/SamplePlateTypePicker/index.tsx","app/components/Forms/FromSamplePlateTypePicker.tsx","app/components/Forms/FormsLayout/FormFieldsSection/index.tsx","app/components/Forms/FormsLayout/FormLeftSection/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/RefreshIcon.tsx","app/components/BasicTable/Filters/NumbersRangeFilter/index.tsx","app/components/BasicTable/Filters/AvailabilityTypeBookableFilter/index.tsx","app/pages/TrainingSessionsPage/PrimaryAction.ts","app/pages/WorkOrdersPage/PrimaryAction.ts","app/pages/OtherServiceDetails/Details/components/InventoryBatchList.tsx","app/components/BasicInputs/Radio/index.tsx","app/components/Forms/FormParagraph.tsx","app/components/pickers/AutocompletePickers/CatRateTypePicker/index.tsx","app/components/BasicTable/CellRenderers/ImageRenderer/index.tsx","app/components/BasicPickers/BaseURLMultiPicker/index.tsx","app/components/BasicTable/CellRenderers/EquipmentIdRenderer/index.tsx","app/components/BasicTable/CellRenderers/OperationTypeIdRenderer/index.tsx","app/components/BasicTable/CellRenderers/AssetImageRenderer/index.tsx","app/pages/ReservationHistoryPage/PrimaryAction.ts","app/pages/OtherServiceDetails/OtherServiceDetailsPage/index.tsx","app/components/BasicTable/Filters/ServiceFilter/index.tsx","app/components/BasicIcons/SvgIcons/I-cursor.svg","app/components/BasicIcons/SvgIcons/check.svg","app/components/BasicIcons/SvgIcons/times.svg","app/components/BasicIcons/SvgIcons/chevron-down.svg","app/components/BasicIcons/SvgIcons/chevron-up.svg","app/components/BasicIcons/SvgIcons/notavailable.svg","app/components/BasicIcons/SvgIcons/notAllowed.svg","app/components/BasicIcons/SvgIcons/checked.svg","app/components/BasicIcons/SvgIcons/unchecked.svg","app/components/BasicIcons/SvgIcons/undeterminate.svg","app/components/BasicIcons/SvgIcons/index.tsx","app/components/pickers/AutocompletePickers/RoomTSPicker/index.tsx","app/components/BasicTable/Filters/RoomTSFilter/index.tsx","app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker/index.tsx","app/components/BasicTable/Filters/TrainingProgramsMultiFilter/index.tsx","app/pages/TrainingSessionsPage/Filter.tsx","app/components/pickers/AutocompletePickers/ActiveSampleTypesPicker/index.tsx","app/components/pickers/AutocompletePickers/RelevantBudgetPicker/index.tsx","app/pages/ServiceRequestListPage/CreateNewRequest/index.tsx","app/Layout/FrontendLayout/components/SidePanel/wrappers/index.tsx","app/Layout/FrontendLayout/components/SidePanel/SidePanelPopup.tsx","app/Layout/FrontendLayout/components/SidePanel/index.tsx","app/components/BasicInputs/BaseInputs/FilledInput/index.tsx","api/TermsOfUseAgreementApi.ts","utils/ExportToExcel.ts","app/components/BasicTable/getNextFilter.tsx","app/components/pickers/AutocompletePickers/InvoiceStatusPicker/index.tsx","app/Layout/FrontendLayout/components/TopBar/components/openMenuButton/index.tsx","app/components/BasicTable/CellRenderers/UserRenderer/index.tsx","app/pages/CalendarPage/Scheduler/components/ViewTypeLengthDropDown/index.tsx","app/pages/CalendarPage/Scheduler/components/ExportToPDF.tsx","app/components/BasicTable/Filters/DatePickerFilter/index.tsx","app/components/BasicTable/Filters/TextFieldFilter/index.tsx","app/pages/ReservationHistoryPage/MyListFilter.tsx","app/pages/Documents/DocumentsTable.tsx","app/components/BasicTable/components/NoTableData/index.tsx","app/components/BasicTable/components/TableError/index.tsx","app/components/BasicTable/CellRenderers/DefaultRenderer/index.tsx","app/pages/Documents/Columns.tsx","app/components/BasicTable/CellRenderers/FileNameRenderer/index.tsx","app/pages/TrainingSessionsPage/Columns.tsx","app/components/BasicTable/CellRenderers/UsedSlotsRenderer/index.tsx","app/components/BasicTable/CellRenderers/TrainingStateRenderer/index.tsx","app/pages/TrainingSessionsPage/RowActions/ReservationLink.tsx","app/pages/TrainingSessionsPage/TrainingSessionsTable.tsx","app/pages/ArticlesPage/ArticlesTable.tsx","app/pages/ArticlesPage/PrimaryAction.ts","app/pages/WorkOrdersPage/WorkOrdersTable.tsx","app/components/ScannerView/index.tsx","api/AssetDetailsApi.ts","app/pages/QuizDetailsPage/QuizDetails/index.tsx","app/components/pickers/AutocompletePickers/WorkOrderTypeStatusPicker/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenTimeline.tsx","app/pages/Samples/SamplePlatesPage/slice/saga.ts","app/components/PopupImportExport/Actions/Import.tsx","app/pages/MyAssetsPage/Columns.tsx","app/components/BasicTable/Filters/ServiceTypeEnumFilter/index.tsx","app/pages/Actions/GlobalSelectedActions/CloneEquipments.tsx","app/components/BasicTable/Filters/AssetFilter/index.tsx","app/pages/ReservationHistoryPage/Columns.tsx","app/components/BasicTable/CellRenderers/BookedByRenderer/index.tsx","app/pages/ReservationHistoryPage/ReservationHistoryTable.tsx","app/pages/InvoiceBatches/InvoiceBatchesComments.tsx","app/pages/OtherServiceDetails/OtherServiceDetailsPage/getQueryStringParameter.ts","app/pages/OnlineBudgetsStatusPage/Filter.tsx","app/components/InfiniteScroll/index.tsx","enums/JoinStatus.ts","app/components/BasicTable/CellRenderers/RegionRenderer/index.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/EventContent.tsx","app/pages/CalendarPage/Scheduler/utils/formatSchedulerTime.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/EventHeader.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/TrainingSessionStatus.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/TrainingSessionEventConent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/ReservationStatusIcon.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/ReservationEventContent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/OfflineEventContent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/index.tsx","app/pages/CalendarPage/Scheduler/servicesToSections.ts","app/pages/CalendarPage/Scheduler/serverListUtils.tsx","app/pages/CalendarPage/Scheduler/renderServiceLabel.tsx","app/pages/CalendarPage/Scheduler/utils/timelineEventsSortIteratee.ts","app/pages/CalendarPage/Scheduler/components/NoServices/index.tsx","app/hooks/useComparedHooks.ts","app/pages/CalendarPage/Scheduler/components/EventRender/EventTimelineContent.tsx","app/pages/CalendarPage/Scheduler/components/event_text/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/TooltipLine/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/TrainingSessionTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/OfflineTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/ReservationTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/index.tsx","app/hooks/useDidUpdate.ts","app/pages/CalendarPage/Scheduler/updateView.tsx","app/pages/CalendarPage/Scheduler/deleteTempReservations.tsx","app/pages/CalendarPage/Scheduler/resetEventEdits.tsx","app/pages/CalendarPage/Scheduler/findParentTarget.tsx","app/pages/CalendarPage/Scheduler/transformToSerializableEvent.tsx","app/components/PrintToPDF/Scheduler/ExportMethods.ts","app/components/PrintToPDF/Scheduler/index.tsx","app/pages/CalendarPage/Scheduler/index.tsx","app/pages/CalendarPage/Scheduler/utils/getEvent.tsx","app/pages/CalendarPage/Scheduler/utils/adjustMonthTimelineLength.tsx","app/pages/CalendarPage/Scheduler/createTimelineView.tsx","app/pages/CalendarPage/Scheduler/createUnitsView.tsx","app/pages/CalendarPage/Scheduler/getServiceIdFromServiceClickEvent.tsx","app/components/pickers/AutocompletePickers/InvoiceTemplatePicker/index.tsx","app/pages/InvoiceDetails/Slice/saga.ts","app/pages/InvoiceDetails/Slice/index.ts","app/pages/InvoiceDetails/Slice/selector.ts","app/pages/InvoiceDetails/InvoiceComments/index.tsx","app/pages/InvoiceDetails/InvoiceInReview/styles.ts","app/pages/InvoiceDetails/InvoiceInReview/index.tsx","app/pages/InvoiceDetails/ReadOnly/styles.ts","app/pages/InvoiceDetails/InvoiceRemarks/index.tsx","app/pages/InvoiceDetails/ReadOnly/index.tsx","app/pages/InvoiceDetails/ReadOnly/Rows.tsx","app/pages/InvoiceDetails/Tables/Details/Columns.tsx","app/components/BasicTable/Filters/SampleTypeFilter/index.tsx","app/pages/InvoiceDetails/Tables/Filter.tsx","app/pages/InvoiceDetails/Tables/Details/getDefaultFilters.ts","app/pages/InvoiceDetails/Tables/Details/index.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/index.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/Columns.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/Filter.tsx","app/pages/InvoiceDetails/Tables/PayHistory/index.tsx","app/pages/InvoiceDetails/Tables/PayHistory/columns.tsx","app/pages/InvoiceDetails/Tables/PayHistory/Filter.tsx","app/pages/InvoiceDetails/Tables/Payments/index.tsx","app/pages/InvoiceDetails/Tables/Payments/Columns.tsx","app/pages/InvoiceDetails/Tables/RowHistory/index.tsx","app/pages/InvoiceDetails/Tables/RowHistory/Columns.tsx","app/pages/InvoiceDetails/Tables/RowHistory/Filter.tsx","app/pages/InvoiceDetails/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/Actions/WorkOrderActions.tsx","app/components/Forms/FormWorkOrderTypePicker.tsx","app/components/Forms/FormWorkOrderTypeStatusPicker.tsx","app/components/Forms/FormRemindBeforePicker.tsx","app/components/pickers/AutocompletePickers/SymptomCodesPicker/index.tsx","app/components/Forms/FormSymptomCodesPicker.tsx","app/components/pickers/AutocompletePickers/RepairCodesPicker/index.tsx","app/components/Forms/FormRepairCodesPicker.tsx","app/components/pickers/AutocompletePickers/ReasonTypePicker/index.tsx","app/components/Forms/FormReasonTypePicker.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/CreationDetails/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/FormUnlimitedDowntime.tsx","app/components/pickers/AutocompletePickers/CustomFormPicker/index.tsx","app/components/Forms/FormCustomFormPicker.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderComments.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/AddCalibrationWorkOrder.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/HoverLinkItem.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/WorkOrderLinks.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/validationSchema.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/index.tsx","app/components/pickers/StaticOptionsPickers/ScreenToShowOnPicker/index.tsx","app/components/pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker/index.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/types.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/saga.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/index.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/selectors.ts","app/components/pickers/MultiSelectPickers/EmailAttachmentTypePicker/EATBaseURLMultiPicker/index.tsx","app/components/pickers/MultiSelectPickers/EmailAttachmentTypePicker/index.tsx","app/components/Forms/FormEmailAttachmentTypePicker.tsx","app/components/Forms/FormInvoiceStatusPicker.tsx","app/components/Forms/FormScreenToShowOnPicker.tsx","app/components/Forms/FormPaymentMethodEnumPicker.tsx","app/components/pickers/MultiSelectPickers/EmailRecipientTypesPicker/ERTBaseURLMultiPicker/index.tsx","app/components/pickers/MultiSelectPickers/EmailRecipientTypesPicker/index.tsx","app/components/Forms/FormEmailRecipientTypesPicker.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/BillingActionsForm/index.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/Actions/BillingActions_Actions.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/index.tsx","app/pages/CoreSelectionPage/Table/getFilters.tsx","app/pages/CoreSelectionPage/Table/getDefaultFilters.ts","app/components/pickers/AutocompletePickers/PermissionLevelPicker/index.tsx","app/components/Forms/FormPermissionLevelPicker/index.tsx","app/components/pickers/AutocompletePickers/TimeSlotTypePicker/index.tsx","app/components/Forms/FormTimeSlotTypePicker/index.tsx","app/components/Forms/FormUserGroupsPicker/index.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/UpdateUserGroupPermissions/UpdateGroupPermissions.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/UpdateUserGroupPermissions/index.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/GetSelectedActions.tsx","app/pages/CoreSelectionPage/Table/CoreSelectionTable.tsx","app/pages/CoreSelectionPage/Table/Columns.tsx","app/pages/CoreSelectionPage/slice/index.ts","app/pages/CoreSelectionPage/slice/selectors.ts","app/pages/CoreSelectionPage/CoreSelection.tsx","app/components/CheckBoxGroup/index.tsx","app/components/Forms/FormCheckBoxGroup.tsx","app/components/pickers/StaticOptionsPickers/EveryDaysPicker/index.tsx","app/components/Forms/FormEveryDaysPicker.tsx","app/components/pickers/StaticOptionsPickers/RepeatMonthlyBy/index.tsx","app/components/Forms/FormRepeatMonthlyByPicker.tsx","app/components/pickers/StaticOptionsPickers/RepeatPeriodPicker/index.tsx","app/components/Forms/FormRepeatPeriodPicker.tsx","app/components/pickers/StaticOptionsPickers/RepetitiveOptionsPicker/index.tsx","app/components/Forms/FormRepetitiveOptionsPicker.tsx","app/components/Forms/Schemas/RepititiveSchema.ts","app/components/Forms/FormRepetitive/index.tsx","api/UserTrainingApi.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/types.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/saga.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/index.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/selectors.ts","app/components/pickers/AutocompletePickers/TrainingReservationsPicker/index.tsx","app/components/Forms/FormTrainingReservationsPicker.tsx","app/components/Forms/FormTrainingLevelPicker.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/UserTrainingForm/UserTrainingComments/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/UserTrainingForm/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/index.tsx","app/pages/CalendarPage/FiltersComponent.tsx","app/pages/CalendarPage/Scheduler/components/MultiToggle/index.tsx","app/components/FullScreenButton/index.tsx","app/pages/CalendarPage/Scheduler/components/FullScreenSchedulerButton/index.tsx","app/pages/CalendarPage/Scheduler/components/CalendarDatePicker/index.tsx","app/pages/CalendarPage/Scheduler/components/TimelineGroupByPicker/index.tsx","app/pages/CalendarPage/Scheduler/components/CalendarHeader/index.tsx","app/pages/CalendarPage/Scheduler/components/useRefreshInterval.ts","app/pages/PriceSheetPeriodDetails/Details/slice/types.ts","api/PriceSheetApi.ts","app/pages/PriceSheetPeriodDetails/Details/slice/saga.ts","app/pages/PriceSheetPeriodDetails/Details/slice/index.ts","app/pages/PriceSheetPeriodDetails/Details/slice/selectors.ts","app/components/Forms/FormPriceSheetMethodPicker.tsx","app/pages/PriceSheetPeriodDetails/Details/PricePeriodsForm/index.tsx","app/pages/PriceSheetPeriodDetails/Details/index.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/Actions/CalendarMessagesActions.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/types.ts","api/CalendarMessagesApi.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/saga.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/index.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/selectors.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/CalendarMessagesForm/index.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/index.tsx","app/pages/MyAssetsPage/AssetsSelection/Filter.tsx","app/pages/MyAssetsPage/AssetsSelection/AssetsSelectionTable.tsx","app/pages/MyAssetsPage/AssetsSelection/slice/index.ts","app/pages/MyAssetsPage/AssetsSelection/slice/selectors.ts","app/pages/MyAssetsPage/AssetsSelection/RecentAssets.tsx","app/pages/MyAssetsPage/AssetsSelection/AssetsSelection.tsx","app/pages/MyAssetsPage/AssetsSelection/useAddNewActions.ts","app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker/index.tsx","app/components/BasicTable/Filters/BarcodeLogStatusFilter/index.tsx","app/pages/AssetsInventoryLog/InventoryLog/GetFilters.tsx","app/pages/AssetsInventoryLog/InventoryLog/InventoryLogTable.tsx","app/pages/AssetsInventoryLog/InventoryLog/GetColumns.tsx","app/pages/AssetsInventoryLog/InventoryLog/index.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/Actions/SavedViewActions.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/SavedViewForm.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/validationSchema.ts","app/pages/SavedViewsPage/SavedViewPage/Details/index.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/Actions/RightTopActions.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/PopUpListItems/index.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/HtmlTextBox/index.tsx","app/components/Forms/FormColorPicker.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/PreviewButton.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/index.tsx","app/components/BasicInputs/FileUpload/styles.ts","app/components/BasicInputs/FileUpload/FileView.tsx","app/components/BasicInputs/FileUpload/FileInput.tsx","app/components/BasicInputs/FileUpload/FilesPreview.tsx","app/components/BasicInputs/FileUpload/FileUpload.tsx","app/components/pickers/StaticOptionsPickers/EmailTypePicker/index.tsx","app/components/BasicTable/Filters/EmailTypeFilter/index.tsx","app/pages/EmailNotificationsPage/Filter.tsx","app/components/CustomForm/CustomFormSkeleton/index.tsx","app/components/CustomForm/QuizCustomForm.tsx","app/pages/QuizPage/StartQuiz/index.tsx","app/components/BasicChip/StatusChip.tsx","app/pages/WorkOrdersPage/Columns.tsx","utils/export.ts","app/pages/Samples/SamplesListPage/slice/saga.ts","app/pages/MyAssetsPage/Actions/Api.ts","app/pages/MyAssetsPage/SelectedRowActions/GetSelectedActions.tsx","app/pages/OtherServiceDetails/ReportConsumables/ConsumablesForm.tsx","app/pages/OtherServiceDetails/ReportConsumables/index.tsx","app/pages/ArticlesPage/AricleDatasetLink/index.tsx","app/pages/ArticlesPage/Columns.tsx","app/pages/Samples/EditableTable/Fields/StyledSelect.tsx","app/pages/Samples/components/TmtType/index.tsx","app/components/BasicTabs/BasicTab/index.tsx","app/components/BasicTabs/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/EventsCount/index.tsx","api/assetQuickSearchApi.ts","app/components/AssetQuickSearch/slice/saga.ts","app/components/AssetQuickSearch/slice/index.ts","app/components/AssetQuickSearch/slice/selectors.ts","app/components/ListItemLink/index.tsx","app/components/AssetQuickSearch/AssetListItem/index.tsx","app/components/AssetQuickSearch/RecentWrappers/wrappers.tsx","app/components/AssetQuickSearch/RecentAssetsList/index.tsx","app/components/AssetQuickSearch/RecentItem/index.tsx","app/components/AssetQuickSearch/RecentSearchTermsList/index.tsx","app/components/AssetQuickSearch/MenuSearchItem/index.tsx","app/components/AssetQuickSearch/MenuSearchResultList/index.tsx","app/components/AssetQuickSearch/AssetSearchResultsByType/index.tsx","app/components/AssetQuickSearch/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/messages.ts","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/UserMenu/UserMenuButton.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/UserMenu/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/SwitchSites/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/index.tsx","app/Layout/FrontendLayout/components/TopBar/components/ToggleSideMenuButton.tsx","app/Layout/FrontendLayout/components/TopBar/TopToolbar/index.tsx","app/components/GlobalServiceGroupFilter/TopGroupButton/index.tsx","app/components/GlobalServiceGroupFilter/CoreDashboardButton/index.tsx","app/components/GlobalServiceGroupFilter/styles.ts","app/components/GlobalServiceGroupFilter/CoreSelectionButton/index.tsx","app/Layout/FrontendLayout/components/TopBar/SubTopToolbar/index.tsx","app/Layout/FrontendLayout/components/TopBar/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/MenuItemComponent.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/HoverMenu.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/MenuItem.tsx","styles/CssVariables/styledVariables.ts","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/index.tsx","app/components/BookitlabLogo/BookitlabShortLogo.tsx","app/Layout/FrontendLayout/components/SideBar/UserProfileMobile/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarHeader/index.tsx","app/Layout/FrontendLayout/components/SideBar/styles.ts","app/Layout/FrontendLayout/components/SideBar/SideBarFooter/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarQuickAction/index.tsx","app/Layout/FrontendLayout/components/SideBar/index.tsx","app/Layout/FrontendLayout/SideBarDrawer.tsx","app/Layout/FrontendLayout/styled/index.tsx","app/Layout/FrontendLayout/components/AdminPanel/index.tsx","app/Layout/FrontendLayout/index.tsx","app/hooks/useRequiredRedirectToCoreSelection.ts","app/pages/Samples/components/SamplesTable/index.tsx","app/pages/Samples/RequestSamplesPage/components/ServiceRequestCustomForm/index.tsx","app/pages/Samples/components/EventBudgetPicker/index.tsx","app/pages/Samples/components/ReadonlyField/index.tsx","app/pages/Samples/components/Utils/index.ts","api/odata/generated/enums/InternalServiceRequestStatus.ts","app/pages/Samples/components/ServiceRequestSubmissionDetails/index.tsx","app/pages/Samples/RequestSamplesPage/components/SubmitServiceRequestButton/index.tsx","app/pages/Samples/RequestSamplesPage/components/CancelServiceRequestButton/index.tsx","app/pages/Samples/components/ServiceRequestAddons/index.tsx","app/pages/Samples/components/ServiceRequestAddons/utils.ts","app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusMenuPicker/index.tsx","app/pages/Samples/components/ServiceRequestMilestones/index.tsx","app/pages/Samples/components/ServiceRequestMilestonesSection/index.tsx","app/pages/Samples/RequestSamplesPage/components/CloneServiceRequestButton/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/AddServiceRequestRowButton/index.tsx","app/pages/Samples/components/ServiceRequestRowEditableCell/index.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/index.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/IWithAsyncOptions.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/useAsyncOptions.tsx","app/pages/Samples/EditableTable/Fields/getCellComponent.tsx","app/pages/Samples/EditableTable/Fields/getReadonlyCell.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getCustomFormTableColumns.tsx","app/pages/Samples/components/ServiceRequestRowStatusPicker/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getTableColumns.tsx","api/odata/generated/enums/InternalServiceRequestRowStatus.ts","app/pages/Samples/components/ServiceRequestRowsTable/components/ServiceRequestComments/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/ServiceRequestRowsImport/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/BulkUpdate/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/ColumnsSelect/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/index.tsx","app/pages/Samples/RequestSamplesPage/components/QuoteSentToUserAlert/index.tsx","app/pages/Samples/RequestSamplesPage/components/SendQuoteButton/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getServiceRequestRowSchema.ts","app/pages/Samples/RequestSamplesPage/components/DownloadAllFiles/index.tsx","app/pages/Samples/components/ServiceRequestReservations/index.tsx","app/components/pickers/AutocompletePickers/GradientsPicker/index.tsx","app/pages/Samples/components/CreateRequestReservation/index.tsx","app/pages/Samples/RequestSamplesPage/index.tsx","app/components/PrintToPDF/getPrintPDFSections.tsx","app/pages/Samples/RequestSamplesPage/utils/validationSchema.ts","app/pages/EmailNotificationsPage/getNotificationsLogPageLocation.tsx","app/pages/Samples/RequestSamplesPage/getServiceRequestTitle.tsx","app/pages/ServiceRequestsKanbanPage/components/ServiceRequestCard/index.tsx","app/pages/ServiceRequestsKanbanPage/components/Kanban/index.tsx","app/Layout/FrontendLayout/components/ContentBox/index.tsx","app/pages/ServiceRequestsKanbanPage/index.tsx","styles/global-styles.ts","app/pages/NotFoundPage/Loadable.tsx","app/Layout/FrontendLayout/Loadable.ts","locales/i18n.ts","app/pages/AnimalTypesPage/Loadable.ts","app/components/DialogAlert/messages.ts","app/components/DialogAlert/slice/selectors.ts","app/components/DialogAlert/index.tsx","app/Layout/FrontendLayout/components/Snackbar/Loadable.ts","app/pages/Animals/InternalIdLoginPage/Loadable.ts","app/pages/AnimalsListPage/Loadable.ts","app/Layout/PosLayout/index.tsx","app/pages/Animals/AnimalCaseConsumablesPage/Loadable.ts","app/components/basic/Wrappers/FlexWrappers/flexColumn.tsx","app/Layout/LoginLayout/index.tsx","app/pages/Animals/AnimalsHomePage/Loadable.ts","app/pages/Animals/PrivateAnimalRoute/index.tsx","app/pages/Animals/CreateNewCasePage/Loadable.ts","app/pages/Samples/SamplesListPage/Loadable.ts","app/pages/Samples/RunDetailsPage/Loadable.ts","app/pages/Samples/RequestSamplesPage/Loadable.ts","app/pages/TrainingSessionsPage/Loadable.ts","app/pages/Buildings/Loadable.ts","app/pages/ReservationHistoryPage/Loadable.ts","app/pages/AddNewReportPage/Loadable.ts","app/pages/TrainingWaitingListPage/Loadable.ts","store/history.ts","app/pages/EmailNotificationsPage/Loadable.ts","app/pages/ExperimentTemplates/Loadable.ts","app/pages/UsersHistoryPage/Loadable.ts","app/pages/UserTrainingsPage/Loadable.ts","app/pages/NotAvailablePage/Loadable.ts","app/components/Routers/RestrictedRoute/index.tsx","app/pages/UsersPage/loadable.ts","app/pages/Animals/AnimalExtendedBillingReportPage/Loadable.ts","app/pages/UserTrainingHistoryPage/Loadable.ts","app/pages/OtherServicesPage/Loadable.ts","app/pages/BudgetsPage/Loadable.ts","app/pages/ServiceRequestListPage/Loadable.ts","app/pages/WorkOrdersPage/Loadable.ts","app/pages/Documents/Loadable.ts","app/pages/QuizPage/Loadable.ts","app/pages/QuizDetailsPage/Loadable.ts","app/pages/UserTrainings/TrainingDetailsPage/Loadable.ts","app/pages/Samples/SampleModificationsPage/Loadable.ts","app/pages/UsageHistoryPage/Loadable.ts","app/pages/Samples/RunsListPage/Loadable.ts","app/pages/Animals/AnimalCaseEditPage/AnimalCasesHistory/Loadable.ts","app/pages/SendEmailToUsers/Loadable.ts","app/pages/ChargesPage/Loadable.ts","app/pages/MyAssetsPage/Loadable.ts","app/pages/LocationsPage/loadable.ts","app/pages/LocationsPage/BuildingPage/loadable.ts","app/pages/LocationsPage/CampusesPage/loadable.ts","app/pages/LocationsPage/AreasPage/loadable.ts","app/pages/LocationsPage/LocationListPage/loadable.ts","app/pages/LocationsPage/SubLocationListPage/loadable.ts","app/pages/InvoiceBatches/Loadable.ts","app/pages/CategoriesPage/Loadable.ts","app/pages/CategoryGroupsPage/Loadable.ts","app/pages/BillingPreviewPage/Loadable.ts","app/pages/OnlineBudgetsStatusPage/slice/selectors.ts","app/pages/OnlineBudgetsStatusPage/slice/saga.ts","app/pages/OnlineBudgetsStatusPage/slice/index.ts","app/pages/OnlineBudgetsStatusPage/ChargeOnlineBudgetsButton/index.tsx","app/pages/OnlineBudgetsStatusPage/GenerateInvoicesButton/index.tsx","app/pages/OnlineBudgetsStatusPage/PayButton/index.tsx","app/pages/OnlineBudgetsStatusPage/GenerateInvoicesAndSendToSap/index.tsx","app/pages/AddPaymentPage/AddPaymentButton.tsx","app/pages/OnlineBudgetsStatusPage/useRowActions.tsx","app/pages/OnlineBudgetsStatusPage/index.tsx","app/pages/OnlineBudgetsStatusPage/columns.tsx","app/pages/OnlineBudgetsStatusPage/pageActions.tsx","app/pages/OnlineBudgetsStatusPage/getDefaultFitlers.ts","app/pages/InvoiceDetails/Loadable.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Loadable.ts","app/pages/InvoiceBillingPage/Loadable.ts","app/pages/BillingActions/BillingActionsPage/Loadable.ts","app/pages/BillingActions/BillingActionsDetailsPage/Loadable.ts","app/pages/LocationsPage/LocationTypesPage/loadable.ts","app/pages/LocationsPage/SubLocationTypesPage/loadable.ts","app/pages/SavedViewsPage/SavedViewPage/Loadable.ts","app/pages/SavedViewsPage/SavedViewsPage/Loadable.ts","app/pages/LabelTypesPage/Loadable.ts","app/pages/AssetDetailsPage/Loadable.ts","app/components/LabelPrint/LabelPrintDialog/Loadable.ts","app/pages/KioskProjects/Loadable.ts","app/pages/KioskProjects/KioskProjectConsumablesPage/Loadable.ts","app/pages/KioskProjects/PrivateKioskProjectsRoute/Loadable.ts","app/components/SessionTimeout/SessionTimeout.ts","app/components/SessionTimeout/DialogAlert.tsx","app/components/SessionTimeout/index.tsx","app/pages/QuizSubmissionsPage/Loadable.ts","app/pages/QuizzesPage/Loadable.ts","app/pages/AdHocReportListPage/Loadable.ts","app/pages/RoomsPage/Loadable.ts","app/pages/CalendarMessages/CalendarMessagesPage/Loadable.ts","app/pages/CoresDirectoryPage/Loadable.ts","app/pages/Samples/SamplePlatesPage/Loadable.ts","app/Layout/FrontendLayout/components/HeadTitle/useTabTitle.ts","app/Layout/FrontendLayout/components/HeadTitle/index.tsx","app/pages/InstrumentRestrictionsPage/Loadable.ts","app/pages/LabelTypeDetailsPage/Loadable.ts","app/pages/ConfigurableColumnExportImport/Loadable.ts","app/components/Routers/ShortURLRoute/index.tsx","app/components/Routers/ServerBarcodesRoute/index.tsx","app/pages/NewMessagePage/Loadable.ts","app/pages/OtherServiceDetails/OtherServiceDetailsPage/Loadable.ts","app/pages/InvoiceTemplates/InvoiceTemplatesPage/Loadable.ts","app/pages/ExpensesPage/Loadable.ts","app/pages/PriceSheetPeriodsPage/Loadable.ts","app/pages/PriceSheetPeriodDetails/PriceSheetPeriodDetailsPage/Loadable.ts","app/pages/ArticlesPage/Loadable.ts","app/Layout/AccountLayout/Loadable.ts","app/pages/Account/Register/Loadable.ts","app/pages/CalendarPage/Loadable.tsx","app/hocs/withSaveAsLastVisitedPage.tsx","app/pages/ReservationDetails/ReservationDetailsPage/Loadable.ts","app/pages/HomePage/Loadable.tsx","app/pages/SystemPage/Loadable.tsx","app/pages/DashboardPage/Loadable.ts","app/pages/CoreSelectionPage/Loadable.ts","app/pages/CoreHomePage/Loadable.ts","app/pages/CoreStatsPage/Loadable.ts","app/pages/ReportingPage/Loadable.ts","app/pages/BookitLabDashboardPage/Loadable.ts","app/components/RedirectWithSearch/index.tsx","app/pages/MyAssetsPage/AssetsSelection/Loadable.ts","app/pages/TermsOfUseAgreementPage/Loadable.ts","app/Layout/FrontendLayout/components/Snackbar/SnackWrapper.tsx","app/pages/ActiveUserGroupPage/Loadable.ts","app/pages/CannedReports/Loadable.ts","app/pages/UserAttributes/UserAttributesPage/Loadable.ts","app/pages/OtherServiceDetails/ReportConsumables/ReportConsumablesPage/Loadable.ts","app/pages/LoginPage/Loadable.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Loadable.ts","app/pages/ServiceRequestsKanbanPage/Loadable.ts","app/pages/OfflineServiceTypesPage/Loadable.ts","app/pages/Animals/AnimalCaseEditPage/Loadable.ts","app/AllIcons.ts","app/Layout/PublicAssetsLayout/index.tsx","app/pages/PublicAssets/Loadable.ts","app/pages/NotAllowedPage/Loadable.ts","app/pages/PlayGround/Loadable.ts","app/pages/AssetsInventory/Loadable.ts","app/pages/AssetsInventoryLog/Loadable.ts","app/pages/ServiceRequestAuditTrailHistoryPage/Loadable.ts","app/pages/FloorsPage/Loadable.ts","app/pages/SubscriptionTypesPage/Loadable.ts","app/pages/BudgetExperimentsPage/Loadable.ts","app/pages/Regions/RegionsPage/Actions/AddRegion/index.tsx","app/pages/Regions/RegionsPage/index.tsx","app/pages/Regions/RegionsPage/Columns.tsx","app/pages/Regions/RegionsPage/Actions/GetPageActions.tsx","app/pages/Regions/RegionsDetailsPage/index.tsx","app/pages/SuperGroups/SuperGroupsPage/Actions/AddSuperGroup/index.tsx","app/pages/SuperGroups/SuperGroupsPage/index.tsx","app/pages/SuperGroups/SuperGroupsPage/Columns.tsx","app/pages/SuperGroups/SuperGroupsPage/Actions/GetPageActions.tsx","app/pages/SuperGroups/SuperGroupsPage/Filters.tsx","app/pages/JoinAdGroup/Loadable.ts","app/pages/JoinAdGroup/JoinConfirmPage/Loadable.ts","app/index.tsx","store/BarcodeScanner.ts","reportWebVitals.ts","app/components/MobileBarcodeScanner/index.tsx","index.tsx","store/configureStore.ts","store/reducers.ts"],"names":["translations","convertLanguageJsonToObject","json","objToConvertTo","current","Object","keys","forEach","key","currentLookupKey","obj","_index","require","__esModule","default","formatLongHE","date","formats","full","long","medium","short","defaultWidth","time","dateTime","log","getLogger","dateUtils","dateFnsUtils","DateIOFormats","dayOfMonth","fullDate","fullDateWithWeekday","fullDateTime","fullDateTime12h","fullDateTime24h","fullTime","fullTime12h","fullTime24h","hours12h","hours24h","keyboardDate","keyboardDateTime","keyboardDateTime12h","keyboardDateTime24h","minutes","month","monthAndDate","monthAndYear","monthShort","weekday","weekdayShort","normalDate","normalDateWithWeekday","seconds","shortDate","year","isToday","differenceInSeconds","differenceInMinutes","differenceInHours","differenceInDays","differenceInWeeks","differenceInMonths","differenceInQuarters","differenceInYears","differenceInCalendarDays","add","addMilliseconds","addSeconds","addMinutes","addHours","addDays","addWeeks","addMonths","addQuarters","addYears","startOfMinute","startOfHour","startOfDay","startOfMonth","startOfQuarter","startOfYear","endOfHour","endOfDay","endOfMonth","endOfQuarter","endOfYear","endOfTomorrow","startOfTomorrow","startOfYesterday","endOfYesterday","startOfToday","lastDayOfMonth","getDaysInMonth","getDayOfYear","getYear","getMonth","getHours","getMinutes","getDate","setDate","setMonth","setYear","setHours","setMinutes","intervalToDuration","this","DateFnsUtils","s","split","x","y","undefined","toUpperCase","toLowerCase","locale","cultureName","systemFirstDayOfWeek","dateFnsCultureName","getLocale","options","weekStartsOn","console","error","culture","a","result","code","formatLong","v","parseISO","firstWeekContainsDate","localeFirstWeekContainsDate","toInteger","defaultFirstWeekContainsDate","localeWeekStartsOn","defaultWeekStartsOn","f","d","dateOrStringToDate","format","err","truncatedString","length","substr","isNaN","getTime","parse","formatDistanceToNow","addSuffix","timeFormat","dateFormat","representation","gfs","Date","formatDate","formatISO","convertedDate","value","fdow","startOfWeek","Array","from","map","e","i","startDate","endDate","months","getFullYear","firstDayOfWeek","endOfWeek","getDay","week","setWeek","day","setDay","values","set","FirstDayOfWeek","getWeekOfMonth","hoursMinutes","parseInt","CustomDate","toDate","meridiem","ampm","val","hours","ODataOperators","quoteODataValue","toString","escapeODataValue","isArray","join","Id","Error","replaceAll","withisInversed","condition","isInversed","Condition","field","operator","field1","c1","start","push","GreaterThanEqual","end","LessThanEqual","c","GreaterThan","LessThan","res","fieldName","name","String","Equals","NotEquals","Contains","ContainsM","resCM","Between","between","Intersection","intersection","Any","hasAny","NotAny","notAny","In","InM","inM","Includes","Excludes","AnyIn","anyIn","HasNoAny","haNoAny","All","all","AllIn","allIn","ODataFilterBuilder","predicates","globalServiceGroupFilter","stringColumns","stringSearch","isOptionalServiceGroup","filter","stringValue","p","concat","bookitColors","base","black","white","grayscale","blackRegular","blackComponents","graySubtitles","grayComponents","grayComponentsLight","grayBorders","graySelection","graybgComponents","grayBackground","grayBackgroundLight","overlays","overlayBlack","overlayWhite","primary","dark","hover","regular","components","componentsLight","borders","disabled","bgHover","background","bgLight","secondary","violet","danger","success","warning","UserProfile","settings","savedSettings","sett","find","index","Key","defaultSetting","Value","Enabled","Selected","UserName","Name","AdGroup","DefaultGroups","IsMultiple","StaffEnabled","comparator","selectSlice","state","appSettings","initialState","selectAppSettings","createSelector","selectKnownModules","Modules","selectKnownModule","knownModules","includes","selectDateFnsLocale","Globalization","Locale","selectUseAmPm","UseAmPm","selectSystemFirstDayOfWeek","selectWebVersion","WebVersion","selectUploadFileSizeLimit","UploadFileSizeLimit","selectMinimizedBookitlabLogo","MinimizedBookitlabLogo","defaultForbiddenFileExtensions","selectForbiddenFileExtensions","ForbiddenFileExtensions","selectLastCodeUpdate","LastCodeUpdate","selectAppTimeZone","TimeZone","selectPublicUrl","PublicBaseUrl","appendTrailingSlash","selectRegisterUserGroup","DefaultRegistrationGroup","selectOffsetDate","timeZone","systemOffset","TimezoneOffsetMinutes","correctDate","currentDateOffset","getTimezoneOffset","selectEmailFromAddress","UserRegistersToSpecificCores","UserRegistersToSpecificCoresType","UserRegistersToSpecificCores_NA","EmailFromAddress","selectExistingImages","ExistingImages","selectAuthenticatedUserObject","authenticatedUser","selectAuthenticatedUser","AuthenticatedUser","constructAuthenticatedUser","selectAssetFieldSettings","pickBy","AssetFieldSettings","IsPublic","selectAssetPopupSettings","assetFieldSettings","entries","Visible","DisplayName","selectIsFullScreen","isFullScreen","selectLoading","currentLanguage","isAuthenticated","loadingAppSettings","loadingSiteMapSettings","loadingUserProfileSettings","loadingSystemSettings","loadingAuthenticatedUser","selectLoadingUser","selectNotifications","notifications","selectGlobalSettingsObj","systemSettings","selectglobalSettings","GlobalSettings","selectGlobalSetting","globalSettingsObj","trim","AllowedSettings","selectImageExist","image","existingImages","some","selectGlobalSettingBool","selectSiteMapSettings","siteMapSettings","selectSiteMapProvider","siteMapProvider","SiteMapProvider","selectEventsCount","eventsCount","selectEventsCountLoading","loadingEventsCount","selectUserProfileSettings","userProfileSettings","selectUserProfileSetting","GetSettingByKey","selectIsSubBarCollapsed","isExpanded","subBarCollapsed","selectIsAuthenticated","updatedUserProfileSettings","selectIsExpandedSideBar","updatedExpandState","isMobile","expanded","GetSideBarExpanded","selectGlobalServiceGroupFilter","topServiceGroupsIsHidden","selectShowGlobalServiceGroupFilter","showGlobalServiceGroupFilter","selectShowGlobalServiceGroupsAsList","showGlobalServiceGroupsAsList","selectBarcodeScanTarget","barcodeScanTarget","selectShowAllCores","showAllCores","selectReservationStatuses","KnownModules","UserGroupCoordRole","AllowWorkflowBooking","MultipleTentativeReservationsUnderWorkflowBooking","DraftReservationsEnabled","t","GetListItem","ReservationStatus","list","Approved","Pending","PendingCoord","Cancelled","CancelledByAdmin","Tentative","Draft","URLSearchParamsCI","params","URLSearchParams","append","delete","get","other","b","GetRawValue","setisInversedForUrl","isInversedPrefix","findIsfilterInversed","search","startsWith","isFilterInversed","definedVal","hasprefix","substring","GetNumberOrUndefined","rawValue","number","GetStringOrUndefined","getStringUnionOrUndefined","unionArray","toLocaleLowerCase","GetBooleanOrUndefined","GetDateOrUndefined","type","parseQueryStringDate","GetPartialEntity","id","GetEnum","enumObject","enumToEntityArray","numValue","tryParseInt","item","GetBooleanEntity","Yes","No","initPickerValue","additionalOptions","additionalItem","option","Promise","resolve","failureResult","data","verifiedData","initExPickerValue","sourceUrl","withoutServiceGroups","initMultiExPickerValue","separator","serviceGroups","ids","additionalItems","every","initMultiPickerValue","getPeriodTypeNameOrUndefined","lowered","namedValue","ALL_PERIOD_TYPES","num","getDefaultFilterDatePeriod","periodTypeFieldName","customStartFieldName","customEndFieldName","periodType","isNullOrUndefined","PresetDatesRange","Custom","fromType","presetDatesRangeToQueryString","formatQueryStringDate","getDefaultFilterNumberPeriod","NumebersRangeToQueryString","startFieldName","endFieldName","formatQueryStringDateValue","serializeValue","defaultSerializer","arrayToQueryString","stringValues","arrayByNameEntityNumberToQueryString","getStringEntityArray","allSearch","splitFilterValue","allEntities","getNumberEntityArray","getNumberEntityArrayFromString","assetRangeSerializer","fieldname","isAssetRangeType","unitType","getAssetRange","valOrNull","parseFloat","getSplitNumberArray","indexOf","joinArray","axios","defaults","baseURL","process","timeout","isStatusOK","status","httpClient","cancelToken","CancelToken","url","response","config","put","post","patch","payload","requests","r","rootedPathWithSearch","toRootedURL","pathName","method","atomicityGroup","URL","window","location","origin","headers","uniqueId","body","responses","urls","batch","file","formData","FormData","responseType","Accept","Icon","React","ref","icon","color","colorExtend","info","props","iconName","theme","useTheme","defColor","getColor","WithTitle","children","title","FormRightSection","isCover","DetectIsMobile","sidePanelExpanded","useSelector","selectExpandedSidePanel","sidePanelOpen","selectSidePanelOpen","showShortView","className","clsx","shortView","StyledForm","onSubmit","avoidStyles","sectionStyle","noPadding","skipShortView","StyledFormFieldsContainer","SettingsApi","$select","names","enumStringKeys","$filter","doPrefetchConfigurableColumns","select","authSet","ScreensId","CoresDirectory","ReservationHistory","UserTraining","m","Instruments","UpcomingTrainingSessions","ServiceRequests","MyAssets","Alerts","MaintenanceAssets","noAuthSet","PublicAssets","screenId","GetCachedConfigurableColumnsData","ConfigurableTypes","ColumnScreenConfig","getAppSettings","getAuthenticatedUser","doSetIsAuthenticated","setLanguage","getSiteMapSource","doNavigate","getEventsCount","getUserProfileSettings","getSystemSettings","getLoginSystemSettings","updateUserProfileSettings","doUpdateExpandedState","doLoadGlobalServiceGroupFilter","doSaveGlobalServiceGroupFilter","doSaveUserProfileSetting","doSaveFilter","doSavePageSize","doSaveCardsMode","doUpdateMyListSelected","doBarcodeScan","handleFullScreenChange","doEnterFullScreen","doExitFullScreen","doSetBarcodeScannigTarget","doShowAllCores","doCollapseSubBar","doAgreeTermOfUse","getAppSettingsFromSaga","action","call","actions","appSettingsLoaded","changeLanguage","loadSystemSettings_Success","noAuthSettings","loadError","message","user","LoginType","LoginTypes","Password","getAuthenticatedUser_Success","Roles","LargeAnimalsOperatingRoomTechnician","internalIdLoginActions","setIsAuthenticated","replace","getAuthenticatedUser_Error","IsAuthenticatedChanged","language","l","i18next","setLocale","languageChanged","siteMap","loadSiteMapSettings_Success","debug","loadSiteMapSettings_Error","href","count","loadEventsCount_Success","loadEventsCount_Error","delay","loadUserProfile_Success","loadUserProfile_Error","loadSystemSettings_Error","loadLoginSystemSettings_Success","loadLoginSystemSettings_Error","withDelay","GetSettingByKeyOrDefault","assign","model","requestURL","updateUserProfile_Success","updateUserProfile_Error","updateExpandedState_Success","updateExpandedState_Error","loadGlobalServiceGroupFilter_Success","selection","addNotification","variant","SwitchedTo","httpPaload","equals","navigate","updateMyList","MIN_LENGTH_DEFAULT","MinBarcodeLength","minBarcodeLengthString","scannTarget","ScanTarget","BarcodeScanModalBody","scanResult","parseBarcode","BarcodeNotFoundEx","ScanTemplateResult","Asset","Internal","External","InternalCode","getRoomByExternalBarcode","roomId","roomid","barcode","$top","document","fullscreenElement","enterFullScreen_Success","exitFullScreen_Success","selector","documentElement","querySelector","fullScreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullScreenExitFunction","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","barcodeScannigTarget_Success","setShowAllCores","setCollapseSubBar","TermsOfUseAgreementApi","agreeTermsOfUseAgreement","ErrorMessages","takeLatest","loadAppSettings","loadSiteMapSettings","loadEventsCount","loadUserProfileSettings","updateExpandedState","loadGlobalServiceGroupFilter","saveGlobalServiceGroupFilter","saveUserProfileSetting","saveFilter","loadSystemSettings","loadLoginSystemSettings","savePageSize","updateMyListSelected_Local","BARCODE_SCANNED","saveCardsMode","fullScreenChannel","eventChannel","emitter","addEventListener","removeEventListener","takeEvery","takeLeading","enterFullScreen","exitFullScreen","setBarcodeScannigTarget","collapseSubBar","agreeTermOfUse","notificationsCount","slice","createSlice","reducers","Language","findIndex","splice","addNotifications","removeNotification","array","keyFn","upsert","itemIndex","updatedItem","userNodes","ChildNodes","flat","element","reactUrl","pathname","Url","ss","LoginScreenCompanyLogo","LoginScreenCompanyLogoLink","LoginScreenCompanyLogoHeight","ShowForgotPassword","Help_Login","updateExpandedState_Local","saveGlobalServiceGroupFilter_Success","setShowGlobalServiceGroupsAsList","enterFullScreen_Error","exitFullScreen_Error","barcodeScannigTarget_Error","appSettingsActions","useAppSettingsSlice","useInjectReducer","reducer","useInjectSaga","saga","Button","processing","size","component","to","dispatch","useDispatch","appActions","absolutePath","path","handleClick","onClick","toto","toLocationDescriptor","disableRipple","disableFocusRipple","disableTouchRipple","event","capitalize","startIcon","endIcon","H1","H2","H3","H4","Body","bold","bodyVarian","Caption","captionVarian","Uppercase","Tips","tipsVarian","InputLabel","inputLabelVarian","InputValue","inputValueVarian","ButtonLabel","buttonLabeVarian","isAbsoluteURL","urlString","schema","query","cpath","tryCleanASPRoot","rootedpath","isRooted","basePath","trimEnd","trimStart","combine","toQueryString","buildURL","endsWith","useAbsolute","toPath","publicUrl","getExportParameters","$format","getExportForImportParameters","openExportLinkOld","open","openExportLink","cd","filename","fileDownload","odataUrlPrefix","getReturnURL","defaultReturnURL","returnURLKey","downloadFile","decodeURIComponent","defaultFileName","getFileName","defaultName","anonimusUrls","parseBarcodeURL","assetScanned","regExpTemplate","AssetBarcodeRelativeUrlTemplate","toCompareUrl","internalCode","regObject","RegExp","exec","groups","resUrl","parseAssetUrl","subLocationScanned","SubLocationBarcodeRelativeUrlTemplate","subLocationId","locationId","RoomId","locationid","sublocationid","SubLocation","LocationId","SubLocationId","parseSubLocationUrl","locationScanned","LocationBarcodeRelativeUrlTemplate","Location","parseLocationUrl","roomScanned","RoomBarcodeRelativeUrlTemplate","Room","parseRoomUrl","external","lazyLoad","importFunc","selectorFunc","opts","fallback","lazyFactory","then","module","LazyComponent","lazy","RenderPageType","IconButton","shape","target","stopPropagation","doOpenSidePanel","doOpenAdminPanel","layoutSaga","selectHasNotSavedChanges","isChangesNotSaved","setContinueState","continue","setConfirmOpen","resetSidePanel","setTuggleOpenState","selectAdminPanelOpen","resetAdminPanel","setAdminPanelUrl","setAdminPanelOpen","openSidePanel","openAdminPanel","sidePanelState","pageType","pageProps","coverOpen","coverExpanded","confirmState","confirmOpen","approved","rejected","showLocalConfirm","continueToLink","hasAnyNotSavedChanges","doRefreshTable","continueState","continueOnApprove","hideNavigation","actionTableProcessing","upsnackbarIndex","isMobileView","adminPanelState","adminPanelOpen","toggleSidePanel","setPageType","setPageProps","setExpanded","resetConfirmState","setConfirmApproved","setConfirmRejected","setContinueToLink","setNotSavedChanges","setRefreshTable","setActionTableProcessing","setLocalConfirm","setContinueOnApprove","setHideNavigation","resetContinueState","setUpSnackBarIndex","setIsMobileView","setIsCoverOpen","setIsCoverExpanded","layoutActions","useLayoutSlice","Box","EnumAssetTypes","IsBudgetFieldEnabled","setting","BudgetField","BudgetFieldSettings","bf","Disabled","IsModuleEnabled","IsAssetFieldEnabled","AssetField","AssetAvailabilityType","AssetAttributes","AssetTypes","IsAssetFieldIsPublic","IsAssetImageExist","imageName","imageSize","getOffsetDate","GetAssetTypeFrom","availability","AvailabilityTypes","NotAvailable","AvailableNotBookable","FreelyBookable","LoanableEquipment","ServiceRelated","ServiceGroup","SuperGroup","RequestRelated","TrainingProgram","LectureRoom","layout","selectSidePanelState","selectPageType","selectPageTypeProps","selectConfirmOpen","selectConfirmApproved","selectConfirmRejected","selectDoRefreshTable","selectContinueState","selectContinueToLink","selectHideNavigation","selectSnackBarIndex","selectIsMobileView","selectActionTableProcessing","selectProcessingIndicator","methodName","selectIsCoverOpen","selectIsCoverExpanded","selectAdminPanelUrl","isEmptyOrWhitespace","toUndefinedIfEmptyOrWhitespace","toLowerCaseSafely","notUndefined","toNumberOrNull","keyValue","TryGet","GetString","typeEnum","getDefault","checkIsMobile","useIsMobile","GetBrowserInfo","rdd","AutocompletePicker","label","loadData","filterOptions","onChange","mini","isOpen","disableClearable","style","fullWidth","noOptionsText","required","ariaLabel","propsLoading","loading","freeSolo","handleInputChange","additionalSearchTerm","renderOptionName","getOptionLabelName","inputProps","autoFocus","autoHighlight","autoComplete","autoSelect","blurOnSelect","clearOnEscape","includeInputInList","selectOnFocus","disableListWrap","filterSelectedOptions","disableCloseOnSelect","openOnFocus","setSomeOpen","ListboxProps","useTranslation","classes","autocompleteStyles","extClasses","autocompleteExtendStyles","timerRef","firstOpen","setOpen","setOptions","searchTerm","setSearchTerm","hasSelected","setSelected","firstMounted","setFirstMounted","useEffectOnMount","handleSelectText","setSelectionRange","clearTimeout","setLoading","doload","active","rawResponse","extractDataFromResponse","optionsData","loadDataAndPrepareOptions","Autocomplete","onOpen","onPickerOpen","onClose","reason","details","multiple","onInputChange","newInputValue","getOptionSelected","getOptionDisabled","getOptionLabel","NA","renderOption","text","highlight","matches","match","parts","part","highlightSearchTerm","inputValue","root","tag","tagSizeSmall","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","paper","listbox","noOptions","groupLabel","groupUl","extendRoot","onBlur","popupIcon","closeIcon","renderInput","BaseTextField","placeholder","AllValues","helperText","onFocus","setTimeout","InputProps","CircularProgress","position","right","top","InfoIcon","infoIcon","infoWidthPlus","infoWidthMinus","Tooltip","themeColor","headTitle","arrow","interactive","popper","BasicTypography","italic","typographyComponentMapping","ServiceType","boldS","fontFamily","fontSize","fontStyle","lineHeight","fontWeight","letterSpacing","bodyS","tipsRegular","inputLabelM","inputLabelXS","inputValueS","buttonM","buttonS","bookitTypography","h1","h2","h3","h4","subtitle1","subtitle2","boldL","boldM","bodyL","bodyM","captionBold","captionRegular","uppercase","textTransform","tipsBold","inputValueM","useReducer","useSaga","MAX_TOP","getAutoCompleteLoadDataFn","idPropertyName","DisplaynamePropertyName","basePredicates","expand","transformModel","useSearchOrPredicate","queryString","maxTop","dynamicPredicates","$orderby","uniq","$expand","undefinedIfIsEmpty","more","limit","unshift","nonSelectableOptions","ShowingFirstXRecords","maxRecordsLimit","isNumber","onlyStringReducer","nums","reduce","enumToDescriptedArray","enumeration","Number","description","tryGetName","tFunction","GetTFunction","i18n","isInitialized","getFixedT","ns","defaultNS","toEntityEnumArray","prefixKey","OriginalName","GetOptionsFilterFunction","items","customSearch","enumToArray","removeHtml","tryParseWithoutNaN","tryParse","tryParseFloat","tryParseBool","isNumericPositive","test","effect","FundingTypes","RecurringReservationUpdateOptions","ReservationRepeatPeriods","ReservationRepeatMonthlyTypes","getSingleReservationStatus","useAsyncExtendedState","useState","setState","useMemo","nextState","initialNextState","mounted","partialState","initialExtendState","ExternalLink","LinkBehavior","Link","useInlineUrl","rest","history","useHistory","useStyles","emptyLink","localPath","handleLocalPathClick","showIcon","externalLinkRoot","link","CopyURL","clipboardWrite","URLCopied","makeStyles","whiteSpace","cursor","externalLinkIcon","display","clipboardWriteEnabled","navigator","permissions","clipboard","writeText","copyResult","useSystemDate","appTimeZone","currentTimezoneOffser","getOffset","useCallback","newDate","parsedDate","getOffsetDateOrNull","localDate","withoutOffset","withOffset","CoverWrapper","height","Dialog","maxWidth","coverShortRoot","hideBackdrop","scroll","disableAutoFocus","LinearProgress","styled","visible","TitleRoot","paddingTop","flexDirection","alignItems","width","gap","justifyContent","alignSelf","padding","spacing","flex","Head","closable","useSidePanel","closePanel","pageName","titlePage","pageLink","titleTooltip","disableExpandToggle","expandPanel","subTitlePage","leftTopActions","rightTopActions","showProcessing","useSwithActions","switchState","rightTopActionsLength","rightActionsLoading","actionsLength","SkeletonIfLoading","cover","aria-label","ShowLess","TitlePage","buttonsLenth","tooltip","Skeleton","backgroundColor","ReactActions","ot","ind","keepOpen","SwitchActions","getProps","Close","ShortTitleRoot","ShortHead","toPageLink","rightTopActionsAsMenu","useShortView","hideMenu","topIconsLength","absolutePageLink","toExpandPanel","CloseSidePanel","TopButtonsContainer","ButtonsPanel","leftActions","rightActions","leftActionsMaxLength","MoreOptionsMobile","iconVariant","paddingInline","TopButtonsPanel","maxLeftTopButtonsLength","leftActionsLoading","getRandomWidth","Math","random","toFixed","ButtonsSkeleton","FormSkeleton","overflow","fullPage","PageWrapperRoot","minWidth","overflowY","boxShadow","palette","common","borderRadius","marginBottom","bookitShadows","shadowBorderTop","flexShrink","flexGrow","PageWrapper","closeSidePanel","confirm","closeCover","useSwitchActions","topProcessing","hideTitleBar","coverClosed","isCoverOpen","collapsedBar","showGroups","isCovered","isCoverClosed","setIsCoverClosed","covered","baseRootUsePanelHeight","baseRootUsePanelShortHeight","baseRootHeight","subBarExpanded","baseNavigationHeight","contentRoot","contentMobRoot","assertExhaustive","offlineServiceState","selectProcessing","selectInitConsumablesProcessing","consumablesProcessing","selectService","detailsState","selectServiceHasError","hasErrors","selectServiceCompleted","completed","selectConnectedInitState","connectedDataState","selectServiceChangeState","serviceChangeResultState","selectFieldHandler","valueHandler","selectCreditState","creditState","selectCredit","selectCreditProcessing","selectCreditCompleted","selectHasCharges","hasCharges","selectConsumablesState","consumablesState","selectSavedReservationService","savedReservationService","selectConsumablesData","selectConsumablesHasErrors","selectConsumablesCompleted","selectConsumablesValueHandler","consumablesValueHandler","selectSelectedServiceType","selectedServiceTypes","selectEditCreatableService","editCreatableService","selectBarcodeScanned","barcodeScanned","selectRefreshConsumableServices","refeshOfflineServices","selectStockRenewalsState","stockRenewalState","selectStockRenewalProcessing","selectStockRenewalData","selectStockRenewalHasErrors","selectStockRenewalCompleted","selectStockRenewalValueHandler","stockRenewalValueHandler","selectRenewStockState","renewStockState","selectRenewStockProcessing","selectRenewStockData","selectRenewStockHasErrors","selectRenewStockCompleted","selectRenewStockValueHandler","renewStockValueHandler","selectIsEdit","isEdit","selectInventoryBatchState","inventoryBatchState","selectInventoryBatchProcessing","selectInventoryBatchData","selectInventoryBatchHasErrors","selectInventoryBatchCompleted","selectInventoryBatchValueHandler","inventoryBatchValueHandler","selectInventoryBatchIsEdit","batchIsEdit","selectInventoryBatchEditable","inventoryBatchEditable","selectCreatableService","getCreatableService","reservation","selectReservationState","selectReservation","selectReservationProcessing","selectReservationHasError","selectReservationCompleted","selectReservationData","selectReservationSettings","reservationSettingsState","selectEquipmentsSettings","equipmentsSettingsState","selectConfirmAssistedReservations","confirmAssistedReservations","selectUserTrainingData","trainingsData","selectRequestedValueFor","requestedValueFor","selectEquipmentChangeState","requestedValue","equipmentChangeResultState","selectEquipmentChangeCompleted","isChangeCompleted","selectAsyncChangeLoading","asyncChangeLoading","selectTransferState","transferState","selectTransferProcessing","transferProcessing","selectTransferStepCompleted","transferStepCompleted","selectTransferToUser","User","selectTransferReservation","ReservtionId","selectTransferWaitingApproval","WaitingTransferApproval","selectCalculateCreditState","caluclateCreditState","selectShowConfirmPricing","showConfirmPricing","selectSavedOfflineServices","savedOfflineServices","selectRefreshOfflineServices","refeshOfflineService","selectTerminateState","terminationState","selectTerminateProcessing","terminatProcessing","selectTerminateCompleted","terminateCompleted","selectCloneReservations","cloneReservation","selectReservationDtoState","reservationDtoState","selectSavedForLater","SaveForLater","selectSubmitCalculateCredit","submitCalculateCredit","selectByApprovalErrors","ByApprovalErrors","selectUserCanRequestApproval","userCanRequestApproval","selectRefreshWorkOrderLink","refreshWorkOrderLink","selectReservationNotFound","notFound","FormTextField","useField","meta","ExportTypes","createSliceOriginal","EntityNumberSchema","Yup","ensure","EntityStringSchema","CheckEntityShema","defined","checked","inventoryBatchesSchema","of","ServiceGroupEntitySchema","ServiceGroupId","ServiceTypeId","Active","HideProjects","IntQuantityOnly","UnitTypeID","nullable","UnitTypeName","AllowToUser","Inventory","DefaultQuantity","notRequired","ReservationOverlappingInventory","IsAdmin","AllowedBudgets","StaffOnly","BudgetsTurnedOn","NotLessThanZero","TrackInventory","InventoryBatchesEnabled","InventoryBatches","BudgetEntitySechema","BudgetExperimentEntitySechema","InstituteProjectEntitySechema","PaymentMethodEntitySchema","UserEntitySchema","OnlineServiceEntitySchema","OfflineServiceTypeEntitySchema","FeeTypeEntitySchema","UserGroupEntitySchema","ServiceTypeSchema","TopActionButton","customIcon","noChangeOnMobile","isIconButton","starticon","endicon","useSidePanelState","onConfirm","onReject","confirmRejected","confirmApproved","continueToOther","continueLink","setCover","setCoverClosed","onCloseCover","showConfirm","openPanel","renderPageType","renderPageProps","DialogConfirm","confirmButtonLabel","cancelButtonLabel","onCancel","subtitle","confirmTitle","managedState","dialogRootClassName","disableBackdropClick","handleClose","handleConfirm","btnActions","Confirm","Cancel","isopen","PaperProps","styles","createStyles","zIndex","left","ColumnTypesArray","ServiceRequestTableColumn","columnDto","isAdmin","IsColumn","Options","ColumnType","isRequired","Label","Index","Required","ParentId","SizeLimit","Description","DisplayType","CopyPrevValues","CustomRoles","UserSelectionType","FixedRoles","Parent","Children","isColumnRequired","createOptions","parentFieldName","getParentFieldName","parent","getFieldName","columnId","ServiceRequestTableColumnsCollection","columnsData","VisibleToAdminOnly","columnsObj","columns","column","keyBy","orderBy","AssignParent","requestSamples","selectRequestSamples","selectServiceRequestStatuses","ServiceRequestStatuses","selectServiceRequestRowStatues","ServiceRequestRowStatuses","selectSubmitting","submitting","selectServiceRequestStatusesByInternalId","serviceRequestInternalStatus","InternalStatusId","selectServiceRequestId","serviceRequestId","selectRequestDetails","RequestDetails","selectCommentIsInternal","CommentIsInternal","selectRequestDetailsData","selectServiceRequestCustomForm","FormValues","selectServiceRequestCustomTable","Rows","selectServiceRequestFormData","formValues","rows","selectRequestDetailsFieldsState","fieldsState","selectServiceRequestDetailsFieldState","Service","selectStatus","Status","selectCreatedFor","CreatedFor","selectIsServiceRequestAdmin","isOwner","isEditable","Administrators","IsAdminOf","ServiceId","Sample","internalStatusId","selectSamplesTableState","SamplesTableState","selectSamplesData","RequestSamples","selectImportState","ImportState","selectSelectedSamples","SamplesSelected","selectCustomForm","CustomForm","selectCustomFormFields","FormFields","selectServiceRequestCustomFormColumns","customForm","selectServiceRequestCustomFormFields","selectServiceRequestMilestones","Milestones","selectServiceRequestMilestoneProcessing","milestoneProcessing","selectServiceRequestSidePanel","SidePanel","ServiceRequestRows","fromDtoValue","formValueDto","tryFormatIso","DisplayValue","selectServiceRequestRowInsertStatus","createServiceRequestRowStatus","RepetitiveOptions","RepeatPeriod","RepeatMonthlyBy","GetRepetitiveOptions","dayName","getDayText","weekName","WorkWeekDays","getWeekNumberOfMonth","weekDays","getLongDaysArray","RepeatWeeklyOn","RepeatMonthlyOn","RepeatEveryWeekDay","BaseOptionsPicker","getOptions","createFilterOptions","ignoreAccents","ignoreCase","stringify","FormikField","fullRow","hide","minRow","FormikSection","fields","order","avoidRenderSection","titleSection","FormListener","onFormChange","useFormikContext","setFieldValue","isValid","dirty","setFieldTouched","validateField","setFieldError","validate","SubmittingHandler","resetSubmitting","setSubmitting","FieldHandler","run","fieldKey","fieldValue","shouldValidate","resetFieldState","additionalFunc","useFieldChangeHandler","changeField","FieldValue","setValue","resetValueKey","getFieldMeta","getPeriodTypesEntity","valueType","getPeriods","getPeriodTypesEntityById","SnackBarActionType","SnackBarMessageType","Handlebar","sanitizeHtml","customFormAst","template","compileHandlebarsTemplate","ast","ReplaceMutatingVisitor","accept","replacementStatement","_replacementStatement","_path","mutating","mustache","original","ExtractPathsVisitor","paths","scheduler","selectScheduler","selectEvents","events","selectSchedulerOfflineHours","viewState","offlineHours","selectTrainingSessions","trainingSessions","selectSchedulerViewState","selectSchedulerDateTs","selectSchedulerViewType","viewType","selectNonWorkingHours","nonWorkingHours","selectSchedulerTempEvents","tempReservations","selectLoadedServices","selectedServices","selectSchedulerServicesLimit","services","globalSettings","limitKey","limitString","selectSchedulerFilters","filters","selectWithReservationsOnly","selectSchedulerServicesLimitReached","limitNumber","selectSchedulerSelectedServices","selectSchedulerDerivedServices","derivedServices","selectMappedReservations","mapEvents","reservation_id","start_date","StartTime","end_date","EndTime","EquipmentColor","service_id","EquipmentId","service_name","EquipmentName","selectMappedOfflineHours","offline","alert_id","AlertId","offline_id","selectMappedTrainingSessions","ReservationId","trainingsession_id","selectMapped","selectSchedulerParseEvents","mappedEvents","TrainingSignUp","readonly","notClickable","canEditReservation","Online","UserId","BookedById","Restricted","allowedToViewAlert","ReportedBy","_no_resize_end","_no_resize_start","_no_drag_move","selectSchedulerServices","WithReservationsOnly","servicesWithEvents","Set","service","has","filterServicesByEvents","serviceGroupIds","filterServicesByServiceGroups","selectSchedulerPreviousViewState","previousViewState","selectMultipleModeState","MultipleInstrumentReservations","selectSelectedSavedView","multipleInstrumentsSetting","currentSelected","userProfile","NotAllowed","instrumentMultipleEnabled","GetSettingValueBy","Multiple","AllowedDefaultMultiple","selectSchedulerViewStartDate","getViewStartDate","viewLength","customStart","selectSchedulerViewEndDate","getViewEndDate","customDays","selectSchedulerViewCustomStart","selectNotUseLocation","notUseLocation","selectEmptySlotAdminClick","emptySlotAdminClick","selectSchedulerNewEventServices","tempReservation","getSingleServiceEventServices","selectTwoDaysTimelineButtonEnabled","GetBoolean","selectCustomDaysTimelineButtonEnabled","selectSelectedReservationEvents","selectedReservationEvents","selectDefaultCustomDaysTimelineValue","daysString","selectIncludeCustomFormInSchedulerReservationTooltip","IncludeCustomFormInSchedulerReservationTooltip","selectSchedulerReservationBodyTemplate","SchedulerReservationBodyTemplate","selectSchedulerReservationTooltipTemplate","SchedulerReservationTooltipTemplate","selectCalendarReservationColumns","EquipmentAssemblies","schedulerReservationBodyTemplate","schedulerReservationTooltipTemplate","equipmentAssemblies","allowWorkflowBooking","includeCustomFormInSchedulerReservationTooltip","pathExtractor","reservationHistorySelectArray","union","selectSchedulerLoadingEvents","loadingEvents","selectTimelineGroupBy","groupBy","selectExportToPDF","exportToPDF","RequiredTypes","DisplayTypes","formFileSchema","Size","PostedFile","formValueSchema","FormFieldId","Readonly","SourceValueId","AlertTypeId","CustomFormId","CustomFormName","RequestId","ExperimentItemId","BudgetExperimentId","ServiceGroupUserId","ParseFormFieldEnums","formFields","ff","DeserializeValue","formField","formValue","Type","ddlValue","getDropDownInitValue","SerializeValue","objects","members","object","member","instanceOfIFormValueType","fileValue","getSerializableIsRequired","getFieldSchema","fileSize","notAllowedExt","when","RequiredFieldToCompare","DependencyFieldId","is","context","exclusive","min","files","blockedTypes","lookup","allowedExt","getCustomFormDateSchema","email","max","singleResult","multipleResult","RequiredValueToCompare","comparedValue","getParentValue","isDependencyVisible","DependencyValue","valueTocompare","parentValue","DependencyMultiple","DependencyVisibility","vp","pv","vf","hasOwnProperty","getFieldsVisibilities","visibleOnCompletion","visibilities","visibleOnComletion","AlwaysVisible","VisibleToUserOnDoneRequest","isVisible","useCustomFormSchema","getCustomFormInitialValues","startQuiz","initialValues","orderFields","next","serializeValues","serialized","serializeCustomFormRowValue","getCustomFormColumnSchema","baseSchema","integer","getCustomFormColumnBaseSchema","noExpandURlTypes","fullActiveUrl","adminsUrl","relevantUrl","budgetExperimentsUrl","initUserData","urlType","$skip","initUrl","UserPicker","servicegroups","withGroupFilter","selectArray","AllUsers","ServicesFilter","budgetExperimentEnabled","userGroupId","budgetId","defaultBudgetEnabled","isDefaultSelected","HideProject","AdminServicesFilter","serviceItems","groupIds","groupsF","servF","initAssigneeAdminUsers","AssignedToCoreAdmin","AssignedToInstrumentAdmin","AssignedToLabTech","reject","usePromise","asyncFunction","isCancelled","useRef","isUnmounted","callAsyncFunction","promise","cancel","fulfillPromise","reset","stateWithReset","useEffect","shortDateTimeFormat","DatesRange","fromPreset","st","et","doInit","doLoadRequestDetails","doRefreshRequestDetails","doLoadFormValues","doSaveFormValue","doLoadSamples","doLoadServiceRequestRows","doLoadMilestones","doCreateSample","doUpdateServiceRequestSampleField","doUpdateServiceRequestRowValue","doImport","doDeleteSamples","doPatchRequestDetails","doUpdateStatus","doUpdateServiceRequestRowStatus","doUpdateBudget","doUpdateGradient","doUpdateOverheadMinutes","doUpdatePurchaseOrder","doUpdateExternalInternalNumber","doUpdateFundingType","doSubmit","putErrorMessages","doCancelServiceRequest","doInsertMilestoneCharge","doDeleteServiceRequestMilestoneCharge","doUpdateMilestoneCharge","doInsertMilestone","doDeleteMilestone","doUpdateMilestone","doCloseSidePanel","doCloneServiceRequest","doCreateServiceRequestRow","doLoadServiceRequestRowStatuses","requestSamplesSaga","statuses","initServiceRequestStatuses_Success","SampleManagementTables","SampleManagementTablesEnabled","requestDetails","loadRequestDetails_Success","omit","loadFormValues","pageIndex","pageSize","RequestMilestones","requestMilestones","MilestonesAddonsType","loadMilestones","InvoiceId","requestblockedbyinvoice","loadRequestDetails_Error","refreshRequestDetails_Success","valuesObject","loadFormValues_Success","warn","currentTableState","$count","sortBy","desc","TableFilterBuilder","customFilters","globalFilter","searchColumns","loadSamples_Success","loadSamples_Error","AnErrorOccurred","Forbidden","prepareServiceRequestRowModel","loadServiceRequestRows_Success","loadMilestones_Success","createSample_Success","createSample_Error","updateServiceRequestSampleField_Success","updateServiceRequestSampleField_Error","msg","innererror","serviceRequestValue","RowId","ColumnId","JSON","updateServiceRequestRowValue_Success","updateServiceRequestRowValue_Error","uploadFile","AllRowsImportedSuccessfully","OneOrMoreErrorOccurredDuringImportPleaseReviewOutputFile","import_Success","import_Error","deleteSamples","errors","successCount","tableState","loadSamples","XRecordsWereBeDeleted","patch_Success","patch_Error","axiosError","statusText","Reason","updateStatus_Success","StatusUpdatedTo","updateStatus_Error","ServiceRequestStatusUpdate_Error","serviceRequestRowId","updateServiceRequestRowStatus_Success","Budget","updateBudget_Success","BudgetUpdatedTo","refreshRequestDetails","updateBudget_Error","Gradient","updateGradient_Success","GradientUpdatedTo","updateGradient_Error","OverheadMinutes","updateOverheadMinutes_Success","OverheadTimeUpdatedTo","updateOverheadMinutes_Error","PurchaseOrder","updatePurchaseOrder_Success","PurchaseOrderUpdatedTo","updatePurchaseOrder_Error","ExternalInternalNumber","updateExternalInternalNumber_Success","ExternalInternalNumberUpdatedTo","updateExternalInternalNumber_Error","FundingTypeId","updateFundingType_Success","FundingTypeUpdatedTo","getSingleInvoiceFundingType","updateFundingType_Error","submitStep_success","StepHasBeenSubmitted","errorMessages","getErrorMessages","submitStep_Error","isAxiosError","dataErrorMessages","RequestCancelled","ServiceRequestId","ServiceRequestMilestoneId","charge","Amount","Rate","OfflineServiceType","Quantity","OfflineServiceTypeId","Remarks","UnitTypeId","UpdatedBy","Title","UnitType","Unit","insertMilestoneCharge_Success","InsertSuccess","insertMilestoneCharge_Error","serviceRequest","deleteMilestoneCharge_Success","DeleteSuccess","updateMilestoneCharge_Success","UpdateSuccess","updateMilestoneCharge_Error","CompletionDate","Assignees","u","Charged","ServiceRequestMilestoneCharges","TargetDate","insertMilestone_Success","insertMilestone_Error","deleteMilestone_Success","requestPayload","StatusId","ServiceRequestMilestoneStatuses","updateMilestone_Success","ServiceRequestDetails","resetRequestDetails","GetServiceRequestDetailsPath","NewRequestId","messages","getv2ControllerErrorMessages","messageKey","dto","serviceRequestModelToDto","createServiceRequestRow_Success","ServiceRequestRow_InsertSuccess","ServiceRequestRow_InsertError","ExceptionMessage","Message","loadServiceRequestRowStatuses_Success","init","loadRequestDetails","insertMilestoneCharge","updateMilestoneCharge","deleteMilestoneCharge","insertMilestone","updateMilestone","deleteMilestone","updateStatus","updateServiceRequestRowStatus","updateBudget","updatePurchaseOrder","updateExternalInternalNumber","updateFundingType","updateGradient","updateOverheadMinutes","submitStep","cancelServiceRequest","createSample","debounce","updateServiceRequestSampleField","updateServiceRequestRowValue","import","cloneServiceRequest","createServiceRequestRow","loadServiceRequestRows","takeLatestByKey","saveFormValues","initServiceRequestStatuses_Error","milestoneChargeProcessing","merge","prev","dataLength","loadServiceRequestRows_Error","deleteServiceRequestRows","deleteServiceRequestRows_Success","createServiceRequestRow_Error","milestone","updateMilestone_Error","remove","row","toggleImport","setHasFiles","HasFiles","requestSamplesActions","useRequestSamplesSlice","toEntity","otherData","InvoiceFundingType","initFundingTypeData","initval","FundingTypeIdPicker","bookable","bookableAndnotbookable","servicesRelated","initAssetsData","byService","serviceTypes","admin","types","AssetsFilterForWorkOrder","orederType","Groups","AssetCats","AssetsFilterForCalibrationWorkOrder","selectedIds","AssetsFilterForSavedView","topServiceGroups","AssetsPicker","defaultValue","restrictByAvType","showOnlyActiveAssets","avFilter","getAvFilter","innerLoadData","CustomRolePermissionLevel","CustomRoleAllowePages","CultureName","UserGroups","ActiveUserGroup","AdminEquipments","AdminServiceGroups","InstrumentEventsGroups","CreatableGroups","HasRegisterableServiceGroups","FormatedName","HasNotifications","HasOptOutCoreSelection","CalendarType","RequireUserGroupCoordApproval","HasSignedTermsOfUse","IsActiveDirectory","JoinStatus","CustomRoleUrls","HasAdminGroupPermissions","HasLabTechGroupPermissions","HasAdminServicePermissions","HasLabTechServicePermissions","pages","level","CustomRole","page","rootedPage","serviceGroupId","GroupAdministrators","IsLabTech","LabTech","serviceTypeId","serviceId","EquipmentAdministrator","CreateNewAssetsAdmin","InventoryAdmin","g","IsAllAdminGroupPermissions","IsAllServicesAdmin","IsAllLabTechGroupPermissions","IsAllServicesLabTech","isInRole","role","baseRoles","odjRoles","create","bulckCreate","update","visibleColumns","get_Success","get_Error","export","getPlateTypes_Success","plateTypes","showCreate","IsRack","SamplePlateType","showBulkCreate","hideCreate","hideBulkCreate","bulkCreate","bulkCreate_SetProgress","progress","create_Success","bulkCreate_Success","create_Error","bulkCreate_Error","hideUpdate","edit","LocationName","RoomName","SamplePlateTypeId","SamplePlateTypeName","ServiceGroupName","update_Success","update_Error","delete_Success","delete_Error","deactivatePlates","deactivatePlates_Success","deactivatePlates_Error","deletePlates","deletePlates_Success","deletePlates_Error","samplePlatesActions","useSamplePlatesSlice","samplePlatesSaga","FormRichTextField","hasMentions","onChangeMentions","additionalButtons","isInvoiceTemplateEditor","extendedMode","labelOnTop","helpers","RichTextField","formikValue","autofocus","controlsVisible","setControlsVisible","Boolean","AssetLink","openAsset","useOpenAssetPopUp","ShowAssetSidePanel","pick","openPanelWithCover","assetPopupProps","identifier","AssetDetails","OpenAssetPrimaryAction","toggle","serviceType","getAssetLinkIdentifier","getAssetIdentifier","RestrictDurationUnitTypes","getViewLength","viewMode","getViewType","parseViewMode","getSchedulerViewMode","viewlength","getSchedulerViewType","datets","days","getPeriodDisplayLabel","compact","isSameYear","isSameMonth","lengthTypeToPeriodType","lengthType","viewStateFromFilter","periodTypeUnion","schedulerPreset","SchedulerDatePositionArray","periodTypeToLengthType","preset","serializeSchedulerDate","getPeriodFromViewLength","timelineColumnWidth","MatchUnitSlotToEnd","startTime","endTime","amount","dateSt","slotLength","lastCorrectEnd","diffDuration","LimitMinutes","getMinutesDiff","LimitHours","getHoursDiff","LimitDays","getDaysDiff","LimitWeeks","LimitMonths","getMonthDiff","adjustToTimeSlot","workingHours","minDuration","weekStartDay","slots","mergeDateAndTime","DayOfWeek","startSlots","startOrdered","correctEnd","weekEndDay","endSlots","endOrdered","Progress","inProgress","marginTop","marginLeft","ConvertDtoToConnectedModel","BookedBy","UserDisplayName","UserGroup","UserGroupName","BudgetID","InstituteProject","InstituteProjectId","InstituteProjectName","ServiceDate","BudgetExperiment","BudgetExperimentName","ExternalCustomer","ExternalCustomerId","ExternalCustomerName","FundingType","Reference","ConvertModelToInsertEntity","connectedModel","ServiceTypeID","DiscountFactor","UsageId","SyncReservation","SyncUsage","Units","InventoryBatchId","InventoryBatch","InventoryBatchName","InventoryBatchAmount","ConvertModelToUpdateEntity","ConvertModelToUpdateRenewStockEntity","autoGenerateBatch","DateReceived","RenewStockInventory","AutoGenerateNewBatches","getDefaultService","Mandatory","HasCharges","getDefaultBatch","shortDateFormat","ExpirationDate","Lot","OfflineServiceTypeName","PurchaseDate","PurchasePricePerUnit","ConvertConsumablesToInsertEntity","discountFactor","remarks","savedData","InsertedAt","ServiceRate","DepartmentId","InsertedBy","Institute","InstituteId","InstituteTypeId","globalFactor","serviceFactor","ConvertRenewStockToInsertEntity","ConvertInventoryBatchToEntity","doInitDetails","doInitServiceChangeStateData","doCreate","doUpdate","doSetAnyValue","doSetConsumableValue","doSetRenewalValue","doGetCredit","doGetTotalCredit","doInitConsumables","doCreateConsumables","doSetIsBarcodeScanned","doInitStockRenewal","doCreateStockRenewals","doInitRenewStock","doCreateRenewStock","doUpdateRenewStock","doInitInventoryBatch","doCreateInventoryBatch","doUpdateInventoryBatch","doSetRenewStockValue","doSetInventoryBatchValue","offlineServiceStateSaga","hasError","api","initOfflineService","uuid","WarningMessages","SuccessMessages","IsValid","getServiceType","connectedFiltersActions","extendSettingsState","Offline","saveState","initDetails_Success","editCreatable","parameters","ServiceTypes","ADGroup","Start","BudgetId","initServiceChangeStateData","initDetails_Error","getServiceChangeState","initServiceChangeStateData_Success","initServiceChangeStateData_Error","selectConnectedFiltersData","httpPayloads","insertOtherService","responseErrors","responseWarnings","responseSuccess","messageType","openSidepanelDetails","messageTypeProps","created","itemName","OfflineService","detailsType","OtherServiceDetails","detailsTypeProps","queryParams","initialService","saveCreatable","setReservationService","createService_Success","errormessage","createService_Error","updatedService","updateOtherService","results","respErrors","updateService_Success","modelState","getModelStateErrors","updateService_Error","setAnyValueSuccess","setConsumableValueSuccess","setStockRenewalValueSuccess","calculateCredit","getCredit_Success","credit","TotalCost","balance","Balance","calculateTotalCredit","getTotalCredit_Success","initConsumableServices","ConnectedFiltersInit","reservationUserGroupGroupByBudgetUserGroup","initConsumables_Success","userGroup","initConsumables_Error","Services","insertConsumableServices","itemEndName","multiDetails","createConsumables_Success","createConsumables_Error","getAssetByInternalCode","Consumables","scanedBarcode","internalId","setSelectedServiceType","setBarcodeScanned","setBarcodeScanned_Success","initStockRenewalServices","initStockRenewal_Success","initStockRenewal_Error","insertStockRenewalServices","RenewStock","createStockRenewals_Success","createStockRenewals_Error","initRenewStockService","initRenewStock_Success","initRenewStock_Error","setEditCreatableService","createRenewStock_Success","preventRefreshTable","createRenewStock_Error","updateRenewStock_Success","updateRenewStock_Error","initInventoryBatch","initInventoryBatch_Success","initInventoryBatch_Error","insertInventoryBatch","initialBatch","setInventoryBatchEditable","createInventoryBatch_Success","createInventoryBatch_Error","updateInventoryBatch","updateInventoryBatch_Success","updateInventoryBatch_Error","setRenewStockValueSuccess","setInventoryBatchValueSuccess","initDetails","createService","updateService","setAnyValue","setConsumableValue","createConsumables","getCredit","getTotalCredit","initConsumables","setStockRenewalValue","setRenewStockValue","setInventoryBatchValue","initStockRenewal","createStockRenewals","initRenewStock","createRenewStock","updateRenewStock","createInventoryBatch","ConvertDtoToModel","resetDetailsState","resetValueHandler","resetServiceChangeState","getCredit_Error","resetCreditState","getTotalCredit_Error","resetTotalCreditState","resetConsumableValueHandler","extendConsumablesData","resetConsumablesState","resetSelectedServiceType","setRefreshConsumableOfflineServices","resetStockRenewalValueHandler","resetStockRenewalState","resetRenewStockValueHandler","ConvertRenewStockToModel","resetRenewStockState","resetInventoryBatchValueHandler","resetInventoryBatchState","offlineServiceStateActions","useOfflineServiceStateSlice","SamplesList","SamplesListTableState","EditMode","ShowRunDialog","ImportStarted","ImportFinished","loadSamplesList","loadSamplesList_Success","loadSamplesList_Error","setSelectedSamples","loadAllFilteredSamples","loadAllFilteredSamples_Success","updateField","updateField_Success","updateField_Error","loadRunDetqails","loadRunDetqails_Success","RunDetails","runSelectedSamples","SelectedRunType","runType","runSelectedSamples_Success","updateRunSampleValue","Samples","rt","RUN_TYPES","k","RunType","prop","payloadWithoutId","TMT_Set","setShowRunDialog","setRunType","StandardRun","MassSpec","Labeling","setShowImportDialog","readImportFile","readImportFile_Success","record","sample","TargetPosition","TargetPlateId","TargetTubeLabel","TargetSampleType","TargetConcentration","TargetVolume","completeRun","aciton","completeRun_Success","completeRun_Error","updateRun","updateRun_Success","Instrument","SecondaryInstrument","ACQUISITION_TYPE","updateRun_Error","exportRun","toggleEditMode","samplesListActions","useSamplesListSlice","samplesListSaga","toURLSearchParams","queryStringSerializer","serializer","n","useFilters","savedFilterKey","GetFiltersDefinition","getDefaultFilter","reservedQueryStringParameterNames","getRequiredFilter","getSelectedViewFilter","enableSavedLists","savedListSettings","useCardsByDefault","getPartialResults","useSyncSearch","useSavedViewSlice","savedViewActions","useLocation","showFiltersFn","visibleFiltersFilter","rowsKey","useCardsKey","useProfileSetting","profileSettingKey","savedUrl","savedValue","updateSavedFilterValue","updateValue","parseProfileUrl","savedFilterValue","filterChange","setFilterChange","defaultSearch","getPresetFilter","isDefault","requiredSearch","savedViewId","SAVEDVIEW_SEARCH_KEY","selectSavedView","localizedFilters","getLocalizedFilters","visibleFilters","mapDefaultFilters","urlKey","depFilters","getDependencyFilters","setAppliedFilters","initFilterData","routerActions","defaultRows","setPageSize","defaultCardsMode","setCardsMode","removeEmptyFilters","newParams","savedFilter","allFilters","appliedFilters","setPageIndex","cardsMode","syncSearch","newState","currentSearch","getNextFilter","originalSearch","savedListSerializedKey","selectMyList","currentSearchString","handleFilterChange","setFilterValueCallback","getFilterValueCallback","getFilterValue","handelPageSizeChange","handelPageIndexChange","handleCardsModeChange","isCardsMode","defaultFilters","setDefaultFilters","getDefaultFilters","allfilters","setFilterValue","onModeChange","notNullable","notDefault","withSavedHistoryT","Component","onFilterChange","availableFilters","onPageSizeChanged","onPageIndexChanged","getIgnoredSearch","ignore","variantComponent","standard","StandardInput","filled","FilledInput","outlined","BaseField","FormHelperTextProps","hiddenLabel","InputLabelProps","inputRef","focused","multiline","rowsMax","rowsMin","SelectProps","inputMore","shrink","notched","displayRequired","native","requiredPlaseholder","helperTextId","inputLabelId","InputComponent","sizeClass","InputElement","aria-describedby","noLabel","LabelElement","htmlFor","withLabel","labelId","withStyles","DropDown","onMouseDown","menuChildren","menuProps","addChevron","onHandleClose","iconButton","disablePortal","anchorEl","setAnchorEl","marginThreshold","anchorOrigin","handleOpen","currentTarget","aria-controls","aria-haspopup","getContentAnchorEl","MenuListProps","dense","container","vertical","horizontal","transformOrigin","DateRenderer","CommentReferenceTypes","ArticleStatus","selectConnectedFilters","connectedFilters","selectConnectedFieldHandler","connectedValueHandler","selectConnectedSettings","connectedSettings","adminUrl","reservableUrl","initOnlineServicesData","sourceurl","OnlineServiceMultiPicker","OnlineServiceSinglePicker","RestrictedByAdminFilter","ServiceGroupIds","IsAdminPanel","ServiceGroupFilter","FormLabelText","html","StyledInfo","TrainingState","OtherServicesApi","otherService","otherServices","rowId","deleteService","deleteCustom","isBudgetsTurnedOn","offlineServiceTypeId","calculateCreditModel","getReservationOfflineServices","reservationId","repeat","deleteInventoryBatch","loadOfflineServiceData","TextControlField","startIconComponent","endIconComponent","startAdornment","FormNumberField","noWarnOnNuN","customChange","ImportAdditionalData","ImportResult","PurchaseOrderOptions","entity","initAssetRangeData","initUnitTypeData","assetRangeCustomFilter","filterBySelectedUnit","SourceUnits","sourceFilter","unit","rate","ConversionRate","TargetId","TargetUnits","targetFilter","assetRangeDisplay","AssetRangeFilter","customData","stateValue","handleOnChange","PleaseSelectRangeUnitType","hasDeps","SortByComparer","ServiceGroupsComparer","columnsComparer","accessor","ColumnAccesorsComparer","REQUEST_CANCELLED_MESSAGE","defaultRowIdAccessor","BasicTable","additionalColumns","getRowId","useExport","rowActions","inlineRowActions","pageActions","screenName","selectedRowsActions","filterOpen","customParams","useImportLink","importLink","importHandler","needRefresh","ServiceGroupsOptional","topAlertMessage","expandedColumns","floatingTabSettings","useExportForImport","customEmptyTableSettings","exportForImportFilterKey","printing","tableContainerSyles","initComplete","dataState","setDataState","extendDataState","doRefresh","setTableState","handleChangeState","serviceGroupsCompared","useCustomCompareMemo","additionalColumnsCompared","columnsCompared","useConfigurableColumns","configurableColumns","handleConfigurableColumns","configCompleted","refreshConfigurableColumns","getDisplayColumns","calculateColumnAccessors","columnAccessors","getColumnAccessors","getAllAdditionalColumns","flatMap","deps","customFilter","useMemoFilters","fetchData","oDataParams","buildParams","getUrlAndParams","controlledPageCount","ceil","titleKey","cancelTokenSource","source","allAdditionalColumns","columnsConfig","isFetchReady","globalFilterValue","token","handleExportClick","TryGetExportColumns","exportColumnAccessors","tableParams","exporturl","getAllFilteredRows","allRowsSelected","setAllRowsSelected","toggleAllRowsSelected","handleRefresh","reloadConfigurableColumns","useRowSelect","selectedRowIds","refreshFromState","TableSkeleton","ControlledTable","compactTable","onChangeState","onExport","pageCount","initialPageSize","onDownloadTemplate","onSelectedRowsChange","subHeader","onRefresh","onConfigurableColumns","useGlobalFilter","imageSrcKey","allowCards","primaryAction","withToolBar","tabSectionSettings","isRowSelectable","onSelectedChange","hideMenuOnMobile","viewCardsCheck","cardSize","cardPosition","useConfigurable","customToolbarSettings","preventInnerClicks","getAllFilteredRowsCallback","hideFilters","baseTableActionsOnToolbar","screenNameVariant","customExpandMenu","customScreenName","showGlobalSearchIconOnToolbar","toggleGlobalSearchIcon","importMenuItems","isContentEditable","tablePaddingVariant","minCardHeight","useMobileOrientation","orientation","isLandscape","isPortrait","innerWidth","breakpoints","md","ReservationsApi","initReservation","insertReservation","updateReservation","getReservation","getReservationUserTrainingEquipments","hasAnyFirstReservations","getEquipmentsChangeState","getValidationState","getReservationSlots","validateDuration","validatePrerequisite","validatePermissions","changeStatus","getEquipmentsData","createTraining","reservations","HasFutureReservationsHttp","equipmentNames","transferReservation","sendTransferNotification","sendCancelTransferNotification","cancelTransferReservation","sendTerminateNotification","ReservationIds","hasUsage","resId","eqid","eqId","endUsage","sids","quantity","userCanBookEquipment","equipmentid","RenderTypes","AllowedToRender","renderType","asset","AllowedByRolePermissions","AvailableByServiceType","AvailableByAvailabilityType","Availability","AddToList","AddWorkOrder","OpenCalendar","OpenTimeline","OpenWorkOrder","OpenWorkOrders","NewReservation","DownWorkOrder","BringBackUp","ExportQRCodes","PrintAssetLabels","CloneEquipments","DownloadImages","ExportForImport","serType","availabilityType","avType","StyledMenuItem","button","MenuItem","HoverActions","popupState","usePopupState","popupId","buttons","anchorRef","bindHover","bindMenu","close","ClickableActions","bindTrigger","Menu","closeAfterTransition","hoverMenu","nonEmptyItems","selectWorkOrder","workOrder","selectWorkOrderProcessing","selectCreateWorkOrderProcessing","createState","selectUpdateWorkOrderProcessing","updateState","selectCreateWorkOrder","selectUpdateWorkOrder","selectCreateWorkOrderCompleted","selectUpdateWorkOrderCompleted","selectCreateWorkOrderHasError","selectUpdateWorkOrderHasError","selectSendEmailOnResOffline","sendEmailOnOffline","selectReservationOffline","reservationOffline","selectReservationOfflineData","selectReservationOfflineProcessing","selectReservationOfflineCompleted","selectReadonlyWorkOrder","readonlyState","selectUpdateAllRecurrent","updateAllRecurrent","selectOfflineEventStart","OfflineEventStart","selectOfflineEventEnd","OfflineEventEnd","selectSavedLinkedOrders","doSaveNewComments","createdOrders","savedLinkedOrders","selectLinksProcessing","calibrationsChanged","linksProcessing","selectDowntimeOverlaps","downtimeOverlaps","SelectedRowsActionIconButton","snackBarMessageType","confirmBody","variantButton","updateDialogVariant","validConfirm","busy","setBusy","setShowConfirm","handleAction","resp","Notification","persist","showLinkMessage","linkUrl","linkText","respm","errmsg","sccmsg","wrnmsg","_t","IsEntity","IsEntityType","IsEntityArray","IsEntityString","IsEmptyArray","IsNotEmptyArray","PureAppliedFilterComponent","onRemove","onApply","direction","filterData","filterPredicates","depValue","depKey","predict","setPredict","handleChange","applyItem","handleRemoveClick","labelFunc","invalidLabel","canHaveInversed","inversionDisabled","toggleInversed","fieldName1","displayName","selected","dateTimeClear","NonRemovableFilter","margin","textOverflow","flexWrap","AppliedFilterComponent","prevProps","nextProps","predicetes","EditableCell","WrappedComponent","initialValue","updateMyData","BooleanPickerFilter","trueName","falseName","ActionButton","isSafary","placement","PopperProps","useAsyncGetWthEffect","load","defaultVal","setVal","allowedroles","InstrumentEventsAdmin","useWorkOrdersPermissions","roles","callback","hasPermissions","allowedToView","isMainOrInstrumentEventsAdmin","HasAdminGroupOnlyPermissions","HasAdminServiceOnlyPermissions","HasInstrumentEventsGroupPermissions","IsReadOnlyUser","CalendarOnly","initBudgetData","queryUrl","BudgetPicker","allActiveBudgets","BudgetByUserGroupFilter","loadBudgets","restrictedBudgetFilter","budgetLimitedByUsers","isBudgetsWithoutUserGroup","userDefaultBudgetEnabled","hideNonDefaultBudgets","fundingType","usrFilter","memberTimeFilter","fundingTypeId","startFilter","endFilter","groupFilter","servFilter","deffFilter","BooleanRender","FormBookitDatePicker","disableFuture","disablePast","inputVariant","clearable","fullScreen","truncateTime","minDate","maxDate","useGlobalSettingsHook","adminRoles","InstituteCoord","privateBudgetsRoles","HeadOfLab","userRoles","reservationRestricted","setReservationRestricted","budgetModuleEnabled","setBudgetModuleEnabled","priceSheetPricing","setPriceSheetPricing","billingEnabled","setBillingEnabled","purchaseOrderLengthSetting","setPurchaseOrderLengthSetting","userIsMainAdmin","setUserIsMainAdmin","userSettings","allowOngoingReservationModificationEnabled","setAllowOngoingReservationModificationEnabled","doNotAllowReservationUserChangeByStaff","setDoNotAllowReservationUserChangeByStaff","instituteProjectsEnabled","setInstituteProjectsEnabled","projectsAreOptional","setProjectsAreOptional","reservationTerminationEnabled","setReservationTerminationEnabled","draftReservationsEnabled","setDraftReservationsEnabled","MandatoryOfflineServicesOnTrainingSignUps","setMandatoryOfflineServicesOnTrainingSignUps","crossInstrumentTrainingEnabled","setCrossInstrumentTrainingEnabled","userAndGroupPermissionsEnabled","setUserAndGroupPermissionsEnabled","tutoringModulesEnabled","setTutoringModulesEnabled","accServicesEnabled","setAccServicesEnabled","allowUsersToViewTheirCharges","setAllowUsersToViewTheirCharges","showReferenceFieldInReservationDetails","setShowReferenceFieldInReservationDetails","offlineServiceWithReservation","setOfflineServiceWithReservation","multipleInstrumentsEnabled","setMultipleInstrumentsEnabled","trainingSessionEnabled","setTrainingSessionEnabled","reservationFormEnabled","setReservationFormEnabled","resMultipleFormsEnabled","setResMultipleFormsEnabled","assistedReservationsEnabled","setAssistedReservationsEnabled","showCalcPriceOnOfflineService","setShowCalcPriceOnOfflineService","showCalculatePrice","setShowCalculatePrice","allowPartialProjectCharges","setAllowPartialProjectCharges","allowPartialSingleProjectCharges","setAllowPartialSingleProjectCharges","budgetExperimentModuleEnabled","setBudgetExperimentModuleEnabled","fundingTypeBudgetEnabled","setFundingTypeBudgetEnabled","purchaseOrderBudgetEnabled","setPurchaseOrderBudgetEnabled","setIsBudgetsWithoutUserGroup","requestReservationEnabled","setRequestReservationEnabled","setIsBudgetLimitedByUsers","setHideNonDefaultBudgets","assemblyPartsEnabled","setAssemblyPartsEnabled","setUserDefaultBudgetEnabled","setDefaultBudgetEnabled","userGroupReservationRestricted","setUserGroupReservationRestricted","setReservationUserGroupGroupByBudgetUserGroup","onlyOwnUserGroupsAllowed","setOnlyOwnUserGroupsAllowed","allowAddRemoveOnEditReservation","setAllowAddRemoveOnEditReservation","allowToRemoveFromMultipleReservation","setAllowToRemoveFromMultipleReservation","hideReservationCollaborators","setHideReservationCollaborators","isConfidentialBudgetsEnabled","setIsConfidentialBudgetsEnabled","allowWorkflowBookingEnabled","setAllowWorkflowBookingEnabled","modifyReservationNameForUsers","setModifyReservationNameForUsers","loadCompleted","setLoadCompleted","BudgetFields","Confidential","MultipleInstruments_AddRemoveOnEditReservation","AllowToRemoveFromMultipleReservation","HideTrainingSessionsSettings","ModifyReservationNameForUsers","InstituteProjects","GetBooleanByKey","ProjectsAreOptional","GetNullableByKey","TerminateReservation","AccServices","AllowOngoingReservationModification","DoNotAllowReservationUserChangeByStaff","HideReferenceFieldInReservationDetails","AllowUsersToViewCharges","HideAssistedReservationsSettings","BudgetLimited_ByUsers","Budgets","PriceSheetPricing","Billing","PurchaseOrderLengthSetting","intValue","OfflineServiceWithReservation","resRestrictedSetting","UserReservationsRestricted","UserOwnRestricted","resUserGroupRestrictedSetting","UserGroupRestricted","UserPermission","GroupPermissions","ReservationUserGroupGroupByBudgetUserGroup","CrossInstrumentTraining","ShowDefaultBudgetOnUserProfile","HideCalcPriceOnOfflineService","Invoices","Default","PurchaseOrderOption","Tutoring","TutoringHours","HideNonDefaultBudgets","SGACreateProjects","BudgetExperiments","DisableBillingEvents","AllowPartialMultipleProjectCharges","AllowPartialSingleProjectCharges","ReservationsCustomForm","MultipleCustomForms","HideReservationCollaborators","ServiceRequestReservations","billingModuleEnabled","resCustomFormEnabled","AssemblyPartsEnabled","confidentialBudgetsEnabled","ServiceRequestReservationEnabled","OfflineServiceTypePicker","UsageRelatedFilter","Ids","excludedIds","ReservationsRelatedFilter","equipmentGroups","optionalServiceTypes","hideProject","allServicesAllowed","budgetServiceGroupServicesAllowed","byAdmin","byUser","OfflineServiceRelatedFilter","relatedGroups","RenewStockRelatedFilter","InventoryBatchRelatedFilter","allPeriods","noFuturePeriods","DatesRangeFilter","periodValue","changedValue","periods","Forever","From","minutesStep","saveOnSelect","maskIfEmpty","To","StyledItemIcon","ListItemIcon","RowMenuActions","tooltipOpen","setTooltipOpen","popupProps","RowAction","setProcessing","withLoading","renderAsTitle","localizedText","RouterLink","RowActionsMenu","useRowActionsColumn","tablePlugins","actionColumns","Header","Action","disableSortBy","Cell","hooks","useInlineRowActionsColumn","selectArticles","articles","selectArticlesExternalSearchResults","externalSearchResults","selectArticlesExternalSearchForm","externalSearchFormDetails","selectArticlesExternalSearchPageIndex","externalSearchPageIndex","selectArticlesExternalSearchPageSize","externalSearchPageSize","selectArticlesExternalSearchPageData","selectArticleDetails","articleDetails","selectRefreshEditArticleAssociation","refreshEditArticleAssociation","selectArticleDetailsBusy","articleDetailsBusy","selectEditArticleAssociationBusy","editArticleAssociationBusy","selectArticleDetailsForm","ServiceGroupAssets","Assets","InstrumentAssets","updateFormValues","coming","orn","o","validateReservation","validateMinEnd","validateAccServices","allEquipments","allAcc","acc","getWorkFlowName","userName","getPrintPDFDefaultSections","serviceRequestEnabled","hasCustomForm","sections","ReservationDetails","ReservationConsumables","CustomFormDetails","AssociatedServiceRequestDetails","validateError","propss","utils","validateDate","currentDate","opDate","maxMonthDays","finalDate","maxDateMessage","minDateMessage","invalidDateMessage","strictCompareDates","validateTime","convertToMeridiem","getMeridiem","DateTimeLabel","withPadding","backgroundImage","checkedIcon","content","indeterminateIcon","Check","checkicon","uncheckicon","indetermicon","Checkbox","PriceSheetBy","BudgetType","AutomaticAssetNamings","SideBarQuickActionsEnum","CommentsApi","GetComments","reference","SendComment","typeId","referenceId","Files","Text","IsInternal","form","removeFile","delteUrl","DraftReservationTypes","AllowReservationCollaboratorsTypes","mapSettingsFromServices","equipments","accServices","HasHideProjects","HasConflictProjects","HasMultipleProjects","AllowPartialProjectCharges","HasPartialSingleProject","AllOffServicesAllowed","ReservationOfflineServicesEnabled","OfflineServicesVisible","AllowReservationCollaborators","AllowedToStartUsage","NotAllowedToStartUsage","budgetExperimentVisible","BudgetExperimentSettings","TrainingSignUpApproval","HideTrainingSession","HasAttendance","ForceTutoring","ForceFullDayReservations","IsEquipmentTutoring","NotAllowReservations","AllowOneAccSerOnly","IsAllAdmin","RestrictReservationToTimeSlots","DefaultReservationDuration","sort","MinOrderHours","MaxOrderHours","MaxOrderDuration","MinOrderGap","RestrictDurationUnitsAmount","RestrictDurationUnitType","DefaultAccServiceId","Billable","IsLoanDesc","LoanTypeId","AllowModification","AllowExtendReservation","AllowUsersToShortenReservations","AllowedToTransfer","AllowedToTransferAll","EnforceReservationRestrictions","LimitlessReservationAllowed","BudgetVisible","getBudgetVisible","OfflineServiceTypes","combineOfflineServiceTypes","arr","HasAccServices","StaffUserVisibleAllways","StaffUserSelectionVisible","StaffUserVisibleOnPending","StaffUserRequiredAlwais","StaffUserSelectionRequired","StaffUserRequiredOnPending","StaffUserSelection","DraftForAll","DraftReservationsTypeId","DraftReservationTypes_AllUser","DraftApprovalRequred","DraftReservationTypes_ApprovalRequired","DraftSaveForLater","DraftReservationTypes_SaveForLater","combineOptionalEquipments","offlineServices","terminate","EquipmentsData","AccServiceIds","AssemblyId","SampleRunId","SampleIds","Collaborators","CollaboratedUsers","PartialAttendance","PartialAttendanceStart","PartialAttendanceEnd","FullDayReservation","Username","StaffUser","UserGroupId","TrainingSessionId","TrainingSession","TransferFromId","UserRequestedByApproval","TransferredTo","WorkflowBooking","RecurringUpdateOption","AllStartTimes","BudgetIds","OfflineServices","ServiceTypeName","UnitsName","Factor","TransferInProgress","Entered","RecordDate","UpdatedAt","CancelledAt","CustomFormValues","FieldId","Parts","TutorName","Terminated","SavedForLater","StartDate","EndDate","PartReservations","BudgetName","AssignToServiceRequestId","AssignToServiceRequestRowIds","AssignToServiceRequestSampleIds","Repeat","RecurringEvents","DoNotRepeat","RepeatsEveryType","RepeatsEveryPeriod","RepeatsEveryNum","RepeatsEveryDay","RepeatEndTime","RecurringEndDate","RepeatOption","Repeat_Period","RepeatsBy","RepeatsMonthlyBy","RepeatsOn","RepeatsOnDays","MandatoriesEquipments","OptionalsEquipments","doInitReservation","doInitReservationEdit","getReservationProperty","selectConfirmPricingEnabled","doCreateReservation","doCreateReservationInternal","doUpdateReservation","doUpdateSettigs","doUpdateEquipmentSettigs","doLoadValidationData","doSetStart","doSetEnd","doSetAny","doTransferReservation","doCancelTransferReservation","doTerminateReservation","reservationSaga","UpdateToNow","isChange","resourceChanged","BaseEquipment","extendEquipmentSettingsState","mandatories","End","sampleRunId","initReservation_Success","isChanged","userTrainigData","userTrainingsApprovalData","Equipments","CheckStatus","prevState","bid","CheckSession","initValidationData","warnings","initReservation_Error","doInitReservationEdit_Load_OfflineMandatory","OfflineMandatory","extendReservationSettings","SamplesAutomation","userTrainingEquipments","FatherId","setTrainingsData","fork","ConfirmPricing","confirmPricingEnabled","GetIsNotBillable","calcCredit","createReservationInternal","take","сonfirmPricing","confirmAction","createReservation_Success","createReservation_Error","isCloned","customFormFiles","getFilesModel","FileTypes","ReservationFile","CustomFormTypeEnum","Reservation","FileStoreApi","saveFormFiles","fileRes","fileResponse","self","setCloneReservation","caluclateCredit_Success","warnOnTrainingSession","FirstEquipmentId","ClickHere","afterLinkText","res_futureTrainingSession_LinkTitle","repetitiveActions","resetState","reservationIds","insertModel","insertedModel","reservationDto","reccurentUpdateOption","filesData","originalCustomFormFiles","currentCustomFormFiles","updateFormFiles","fileResponses","terminateReservation_error","Succes_ReservationTerminated","terminateReservation_success","offRes","offErrors","offResponse","offWarnings","initClonedReservation_Success","updateReservation_Success","updateReservation_Error","updateReservationSettings","newSettings","updateEquipmentSettingsState","CustomForms","StatusChange","IsForceTutoring","initValidationData_Success","initValidationData_Error","setStartSuccess","setEndSuccess","transferReservation_Error","transferReservation_Success","cancelTransfer_Error","cancelTransfer_Success","createReservation","setStartDate","setEndDate","cancelTransfer","terminateReservation","TryDisableRemoveableEquipments","noremoved","titleInfo","StaffMandatoryEquipment","generateTrainingSessionName","op","AssemblyParts","getReservationSettings","TrainingSessionOnly","SessionId","LastUpdateDate","LastUpdateAdmin","ParentAssemblyReservationId","TopAssemblyReservationId","HasOfflineServices","HasTrainingSession","NextReservationTime","CurrentReservation","FirstInitEquipments","FutureReservation","IsFuture","Ongoing","IsOngoing","PastReservation","IsPast","resetDetailsErrorsState","resetAssisteTrainingData","resetEquipmentChangeState","getAnyValue","getAnyValueSuccess","resetRequestedFor","resetTransferState","calculateCredit_Error","setSubmitCalculateCredit","setSavedOfflineServices","setRefreshOfflineServices","resetTerminateState","setAsyncChangeLoading","setByApprovalErrors","setUserCanRequestApproval","setRefreshWorkOrderLink","reservationActions","useReservationSlice","WorkOrderApi","initCreateData","initUpdateData","insertWorkOrder","updateWorkOrder","offData","getNewWorkOrderStatus","deleteOrders","deleteTempComments","commentIds","catch","DowntimeOrders","assetIds","foo","nowDate","removefromLinks","linkedId","addToLinked","removeLinkedCalibration","addLinkedToCalibration","getLinkedToCalibration","getOverlappingDowntimes","updateWorkOrdersStatus","workOrderStatus","workOrdersIds","statusId","GhostInput","valueHtml","valueText","labelBolder","ghosInputLabelBold","StyledChip","custombgcolor","main","customsize","customcolor","paddingBlock","opacity","pointerEvents","darken","fullwidth","customwidth","notremoved","labelSmall","clickable","sizeSmall","deleteIcon","customiconcolor","contrastText","fade","Chip","BookitChip","aria-disabled","onDelete","preventDefault","BookitChipWithCheck","BookitChipWithInfo","checkname","checkid","largeFilesUploadSaga","selectedFiles","canUpload","uploading","targetId","startedToUpload","currentNumberOfUploadedFiles","numberOfUploadedFiles","commentType","setSeletedFiles","setCommentProperties","setCanUpload","addFile","resetNumberOfUploadedFiles","useLargeFilesUploadSlice","mapSettings","isEditMode","budgetEnabled","getOfflineBudgetVisible","resUGEnabled","isServiceAdmin","IsAllGroupOrLabTechAdmin","isRoleAdmin","isUserGroupCoordinator","UserGroupCoord","btExpEnabled","chargesViewAllowed","FinAdmin","InvoicesReader","hasConflictProjects","budgetVisible","fundingTypeVisible","userGroupVisible","userVisible","budgetExpirementVisible","instProjVisible","extCustomerVisible","purchaseOrderVisible","PurchaseOrderOptionId","Hidden","referenceVisible","endTimeVisible","startTimeVisible","doSetConnectedValue","doResetState","connectedFiltersSaga","setConnectedValueSuccess","currentData","updateSettingsState","resetConnectedState_success","setConnectedValue","resetConnectedState","toISOString","setSubmit","resetConnectedHandler","useConnectedFiltersSlice","DRAWER_WIDTH","DRAWER_MOBILE_WIDTH","SIDE_PANEL_WIDTH","COVER_WIDTH","initExtraDDLData","ExtraDDLPicker","AutocompleteMultiPicker","fullWdithOptions","renderTags","renderOptionLabel","renderOptions","onChipClick","setInputValue","newValue","getTagProps","Color","Fragment","BaseURLPicker","queryfilter","ConvertModelToEntity","Shared","doInitNewDetails","doUpdateViewAssets","doSelectSavedView","doPatch","doUseSavedView","savedViewSaga","loadNew","eid","initNewDetails_Success","initNewDetails_Error","httpPayload","createSavedView","MyInstrumentList","SavedViewDetails","createView_Success","createView_Error","updateSavedView","updateView_Success","updateView_Error","newAssets","assets","el","view","groupId","shared","updateViewAssets_Success","updateViewAssets_Error","selectSavedView_Success","savedViewsApi","patch_success","useSavedView","useSavedView_success","initNewDetails","createView","updateView","updateViewAssets","savedViewUserName","SavedViewExtraData","UserNameDisplay","createdAt","CreatedAt","usages","UsageCount","resetCreateSavedViewState","resetUpdateSavedViewState","selectedSavedView","selectSavedView_Error","EmptySlotAdminClick","userProfileSetting","savedEnabled","updateEnabled","useUploadToNewComment","largeFileActions","onCommentAdded","comment","FormSwitch","boldLebel","maxLabelWidth","boldLabel","boxed","savedView","selectSavedViewProcessing","selectCreateSavedView","selectUpdateSavedView","selectUpdateUserName","selectExtraData","selectCreateSavedViewCompleted","selectUpdateSavedViewCompleted","selectCreateSavedViewHasError","selectUpdateSavedViewHasError","FormBookitDateTimePicker","labelInline","dateLabel","timeLabel","ExtraDDLFilter","initUserGroupData","UserGroupPicker","RestrictedUserGroupPicker","RestrictedFilter","departmentId","instituteId","instituteTypeId","restricted","AutocompleteMultiPickerEx","selectable","ServiceRequestDetailsPath","generatePath","getAssetImageThumbSrc","imageExist","defaultImage","getDefaultImage","getAssetImageSrc","part1","part2","isEmpty","PartOfDay","doChangeViewMode","doChangeViewModePartial","changeLocation","doGetEvents","doGetServices","doGetDerivedServices","doEdit","doEditTrainingSession","doEditReservation","doEditAlert","doReset","doUpdateMultipleMode","doUpdateEmptySlotClick","doGetEmptySlotAdminClick","doSetFilters","doResetWorkOrder","schedulerSaga","previous","isStateEqual","forceEvents","getEvents","setPreviousViewState","pickViewState","isEqual","applyStateSearchParams","periodFilterFieldName","groupByFilterFieldName","currentMode","previousMode","GetCalendarPagePath","eventsParams","splitFilter","eventFilters","training","ReservationOrDowntime","sharedFilter","servicesFilter","equipmentIdArray","withReservationsOnly","fetchedServices","reservations_fields","effects","fetchEvents","fetchTrainingSessions","noServicesSelected","loadWorkingHoursForFetchedEvents","fetchWorkingHours","fetchedEventsEffect","fetchedTrainingSessionsEffect","fetchWorkingHoursEffect","fetchedEvents","fetchedTrainingSessions","fetchedWorkingHours","getEvents_Success","offlineServicesFilter","getOfflineHours_Success","distinctEquipmentIds","getDerivedServices","getNonWorkingHours","nonWorking","getNonWorkingHours_Success","ReservationOrDowntimeEnum","ReservationsOnly","OffLine","DownTimeOnly","trainingFilterBuilder","serviceIdParameter","startParameter","prepareDateParameter","endParameter","batchResponse","getServiceDetails","getServices_Success","needMoreServiceProps","servicesResponse","requiredProps","actualProps","getDerivedServices_Success","trainingSession","un","tsid","reservationDetailsState","reservationSidePanelOpened","offStart","offEnd","workOrderActions","setOfflineEventStart","setOfflineEventEnd","WorkOrderDetails","requestedServices","defaultMulti","defaultMultiModeBehavior","equipmentChanged","equipment","payloadServiceIds","requestedServicesAssemblyIds","TopAssemblyId","useRequestedServices","Scheduler_AssemblyPartSelected_InfoMessage","reservationSidePanelServiceId","srid","srrid","ug","sample_run_id","alertQueryParams","down","offH","eStart","aType","alert_type","useSwithButtons","useSwitchButtons","updateMultiMode_Success","updateEmptySlotSettings_success","gsettings","defaultEmptySlotSetting","CalendarTimelineEmptySlotClickSettings","defaultEmptySlotClick","WhatToAdd","userEmptySlotAdminClick","userSetting","getPredicate","predicate","serviceRelatedFilters","filteredServices","serviceFilterValue","MaximumTimelineRowsLimit","maxTimelineServices","CalendarServicesPickerCapacity","maxCalendarServices","maxServices","changeViewMode","changeViewModePartial","createWorkOrder_Success","updateWorkOrder_Success","resetUpdateWorkOrderState","resetCreateWorkOrderState","getServices","setFilters","updateMultiMode","updateEmptySlotSettings","getEmptySlotAdminClick","TimelineGroupBy","withNoChangeLocation","changeGroupBy","getEvents_Error","getTrainingSessions_Success","multipleInstrumentsMode","setNotUseLocation","setSelectedReservationEvents","resetExportToPDF","schedulerActions","useSchedulerSlice","filterHandler","isSidePanel","saved","withoutReserved","withReserved","addReserved","filterSearch","filterValue","reserved","FormUserPicker","MessageText","div","css","showMore","minHeight","defaultIconMapping","BasicAlert","collapsedMinHeight","isShowMore","setIsShowMore","in","severity","iconMapping","show","TextField","disableUnderline","mapToAssetDto","myAsset","AssetCatId","AvailabilityTypeId","AvailabilityTypeName","ServiceGroupAssetId","UserProfileLink","twoRows","UserFormatResult","Api","ConfigurableColumns","listId","configurableType","ListID","ConfigurableType","TemplateColumns","ScreenId","Iad","none","iad","ImportTemplate","Ext","ext","importImages","maxContentLength","ExportImportActions","Export","Import","ImportImages","samplesList","selectSamplesList","selectRunDetails","selectShowRunDialog","selectSamplesListEditMode","selectImportingRunDetails","selectImportingRunDetailsFinished","selectRunDetailsInstrument","selectRunDetailsSecondaryInstrument","selectRunDetailsGradient","selectRunDetailsCreatedDate","CreateDate","selectRunDetailsAcquision_type","StyledTextField","MatTextField","FormCheckbox","selectPaper","selectRoot","selectTitle","textAlign","selectContent","addButtonRoot","addCollapsContainer","AddFilterButton","filtersSelectionOpen","setInnput","disabledTitle","Popper","SelectFieldToFilterBy","SearchFilter","MenuList","mobHorizontal","tabIndex","handleFilterSelect","AppliedFiltersContainer","mobileRoot","mobileHorizontalRoot","maxHeight","dependencyProp","depFiltered","filt","filterValues","updateDepValues","BasicFilterGroup","appliedFiltersDirection","filterDefaultOpen","setVisibleFilters","handleAddFilterWithValue","currentState","handleApply","areSameFilter","handleRemoveFitler","available","applied","appliedFitltersCount","autoOpenAddFilter","SavedListsDropDown","serviceItem","savedListRelatedPickerName","hasInVisibleFilters","addFilter","serializedKey","listViewbyAsset","ButtonsContainer","MoreFilters","MoreFiltersDisabled","apply","ResetFilters_info","ResetFilters","FormControl","DateInput","openPicker","TextFieldComponent","validationError","togglePicker","TextComponent","innerInputProps","readOnly","InputAdornment","ev","nodeName","onKeyDown","toEndDateDisplayValue","truncatedDate","dir","dateLongFormatter","pattern","timeLongFormatter","longFormatters","P","dateTimeFormat","matchResult","datePattern","timePattern","formattingTokensRegExp","longFormattingTokensRegExp","getFormatTokens","formatString","tokens","firstCharacter","longFormatter","setInputViewDate","ddd","getValueDateOrTruncat","getMaskedDateValue","mask","singleValue","dateStartFrom","dateSeparator","getMaskedTimeValue","hour","minute","StyledPicker","PickerPopper","shadowXL","daysEntityArray","_","defaultDayValue","getDayEntityFromDate","DaysByMonthPicker","maxDay","monthDate","monthEntityArray","FullName","MonthId","defaultMonthValue","getMonthEntityFromDate","MonthOfYearPicker","MAX_YEAR","yearsEntityArray","defaultYearValue","getYearEntityFromDate","YearsPicker","DateDropDown","dayDisabled","monthDisabled","yearDisabled","onError","useUtils","dateTimeValue","dateSelected","setDateSelected","daySelected","setDaySelected","monthSelected","setMonthSelected","yearSelected","setYearSelected","innerError","setInnerError","isYearOpen","setIsYearOpen","isMonthOpen","setIsMonthOpen","isDayOpen","setIsDayOpen","someOpen","withCompletion","handleDayChange","handleMonthChange","handleYearChange","FormHelperText","hoursEntityArray12","hoursEntityArray24","defaultHourValue12","getMeridiemHours","defaultHourValue24","getHoursEntityFromDate","HoursPicker","useAmPm","minutesEntityArray","defaultMinutes","getMinutesEntityFromDate","MinutesPicker","AmPmEntityArray","defaultAmPm","getAmPmEntityFromDate","AmPmPicker","TimeDropDown","hoursDisabled","minutesDisabled","hoursSelected","setHoursSelected","minutesSelected","setMinutesSelected","ampmSelected","setAmpmSelected","isHourOpen","setIsHourOpen","isMinuteOpen","setIsMinuteOpen","isAmPmOpen","setIsAmPmOpen","ampmValue","handleHoursChange","handleMinutesChange","handleAmPmChange","ampmVal","useIsomorphicLayoutEffect","useLayoutEffect","useEventListener","eventName","handler","savedHandler","targetElement","eventListener","useDateTimeChange","refresh","valueRef","dateTimeMask","maskFormats","dateStartOf","userValue","isDeleleteButtonDownRef","wasZeroBefore","selectionStateChanged","eventValue","increment","isHourChanged","isMinutesChanged","isAmPmChanged","isDayChanged","isMonthChanged","isYearChanged","isNoOperation","selectionChanged","formattedValue","moveSelectionForward","finalTime","partChanged","maskFormat","prevValue","stayOnSelection","newTime","prevParts","prevHour","prevMinute","prevMeridiem","newVal","hourInt","prevHourInt","comb","minuteInt","prevMinuteInt","formatingTime","finalValue","isPrevZero","isSelectionChanged","zeroPress","startedFrom","dayVal","prevDayVal","dayInt","prevInt","monthVal","prevMonthVal","monthInt","prevMonthInt","yearVal","prevYearVal","yearInt","padEnd","formatingDate","oneLetterHour","handleKeyDown","evt","handleKeyUp","hasSingleChar","selectionStart","maskedValue","onSelectionChange","selectionEnd","KeyboardRifmInput","isPickerOpen","defTokens","first","dateStartWith","dateTokens","timeTokens","defaultDateTimeMask","inputMask","setHasError","errorMessage","setErrorMessage","setSelectionChanged","dateChange","onMouseUp","timeSelection","dateSelection","onKeyUp","arrows","dateArrowSelection","selStart","selEnd","nativeEvent","stopImmediatePropagation","KeyboardInput","displayDate","emptyLabel","getDisplayDate","innerInputValue","setInnerInputValue","changedValueRef","dateVal","getParsableDate","setValidationError","innerValidationError","textValue","TimeOptionPicker","hoursItems","minutesItems","ampmItems","hourRef","minuteRef","selectedId","scrollTo","hourScroll","step","minuteScroll","PickerOptions","List","disablePadding","ListItem","Divider","ap","gridAutoColumns","gridAutoRows","gridColumn","gridRow","borderBottom","borderTop","listStyle","scrollBehavior","BookitDatePicker","elementRef","closablePicker","closeTitle","readonlyInput","useTimeClockPicker","useTimeDropDowns","useDateDropDowns","dateInputProps","keyboardInputProps","dateValue","setDateValue","handleSave","contains","countState","inputDisplayValue","getInputViewDate","ClickAwayListener","mouseEvent","onClickAway","inpValue","transition","TransitionProps","Fade","Paper","TimePicker","disableToolbar","timeValue","DatePicker","Save","Clear","prefix","levelFormatter","nameFormatter","timestampFormatter","createPeriod","now","startFn","endFn","addFn","offset","useExpandedSideBarState","expandLocal","MainTabs","AssetsSubTab","AssetsSubTabUnionArray","NoAuthNodes","HasChildNodes","ResourceKey","reg_NewUserRegistration","RootNode","HideReact","isAdminNode","ParentNode","Hide","MainTab","SubTab","IsAdminSettings","GroupTab","node","searchItem","irurl","chitem","rurl","rpath","prurl","purl","rurl1","getCurrentMainNode","getUserNodes","parentNodes","childNodes","currentPathNameLowered","elementPathName","newSearch","getCurrentNodes","currentNode","findNode","HasCustomRoleUrlPermission","menuTab","filtered","nodeAccesibleByRole","it","subTab","findMainTabNode","subTabTitle","ShortWeekDays","getShortDaysArray","RepetitiveInit","untilDate","GetAutoCreateTitle","eventStart","AutoCreateEvent","AutoCreateFor","RepeatCustom","periodName","Days","Weeks","RepeatDaily","parseISOOrNull","GetIntervals","dates","originStart","originalEnd","nextWeek","dayWeek","newMonthDate","newDayWeek","calcDay","checkDate","counter","theDay","firstDay","lastDay","newDay","period","everyDayNum","nextDay","daysToAdd","newDayDate","mtheDay","mnextDay","mdaysToAdd","Months","RepeatsBy_DayOfMonth","monthDay","RepeatsBy_DayOfWeek","newMonth","box_shadow_s","box_shadow_m","shadowXS","shadowS","shadowM","shadowL","deleteSavedViews","viewIds","getMySavedViews","mySavedViewFilter","onlyMyView","initWOTypeData","initWOTypeDataParams","downtime","filteredWorkOrderTypes","calibration","grp","elem","cts","byGroups","byCats","WorkOrderTypePicker","convertInventoryBatchName","loadBaseData","InventoryBatchPicker","loadInventoryBatchesData","BatchesByServiceTypeFilter","withStockRenewed","TimelineGroupByUnionArray","parseCalendarPageParams","dashView","defaultviewType","parseType","presetPeriodToViewLength","getTimelineGroupBy","AlignRight","doInitCreate","doInitUpdate","doSendReservationsOfflineEmail","doRemoveFromLinked","doAddToLinked","doRemoveLinkedCalibration","doaddLinkedCalibration","doSetCreatedOrders","doCheckDowntimeOverlaps","doRemoveTempComments","workOrderSaga","initWorkOrder_Success","initWorkOrder_Error","initUpdateWorkOrder_Success","initUpdateWorkOrder_Error","ConvertNewWorkOrdersToModel","submissionFormFiles","workOrderDetails","SubmissionFormFiles","savedLinkeCalibrations","idx","commmentIds","AlertTypeFile","AlertType","WorkOrderTypeId","setSaveNewComments","setOrderNumbers","WorkOrdersPageName","widx","addLinkedCalibration","WorkOrderType","hasResOffline","ReservationOffline","ReasonName","createWorkOrder_Error","staffFormFiles","StaffFormFiles","updateAll","UpdateAll","originalSubFormFiles","RecurringAssetId","RecurringGroupId","originalStaffFormFiles","AlertFile","Alert","AutoCreatedOrders","longDateTimeFormat","updateWorkOrder_Error","paload","deleted","insert","doNotNotifyUsers","allAffectedUsers","sendData","sendReservationsOfflineEmail_Success","sendReservationsOfflineEmail_Error","removeFromLinked_success","addToLink_success","removeLinkedCalibration_success","addLinkedCalibration_success","setOrderNumbers_success","checkDowntimeOverlaps_Success","initWorkOrder","initUpdateWorkOrder","createWorkOrder","sendReservationsOfflineEmail","removeFromLinked","checkDowntimeOverlaps","ConvertEntityToModel","ToDown","resetReservationsOfflineState","setUpdateAllRecurrent","LinkedAlerts","setSavedLinkedOrders","resetSavedLinkedOrders","setCalibrationChanged","useWorkOrderSlice","UserFilter","DescriptionCell","leaveDelay","leaveTouchDelay","GetSchedulerPagePath","calendarPageFullPath","useCalendarLink","selectGlobalDbSetting_EnableLegacyScheduler","openToBook","NumberField","withMinMax","withProps","serviceRequestsKanban","selectServiceRequestsKanban","selectServiceRequestsKanbanProcessingUpdate","processingUpdate","selectServiceRequestsKanbanProcessingInsert","processingInsert","selectServiceRequestsKanbanTickets","selectServiceRequestsKanbanSelectedStatuses","selectedStatuses","selectServiceRequestsKanbanData","tickets","dataList","section","selectShowAddSubTicket","showAddSubTicket","selectEdit","parentTicket","ticket","regPublicUrl","billableAdminUrl","initServiceGroupsData","ServiceGroupPicker","serviceGroupFilterUrl","FormServiceGroupPicker","FormControlLabel","withInfo","boxedChecked","boxedError","shiftRight","roundTwoPlacesAfterDecimalPoint","round","doShowDetails","doExternalSearch","doSaveArticleAssociation","articlesSaga","externalId","externalIdSource","showDetails_Success","externalSearch_Skip","searchForm","Source","externalSearch_Success","Count","Items","StatusCodes","TOO_MANY_REQUESTS","TooManyRequests","externalSearch_Error","isNew","fn","Queryable","AwaitingApproval","PublicationAwaitingApproval","Success","saveArticleAssociation_Success","mes","saveArticleAssociation_Error","showDetails","externalSearch","chnagePage","saveArticleAssociation","article","resetArticleAssociationState","someAction","clearArticleDetails","articlesActions","useArticlesSlice","doUpdateSections","doSaveSections","printPDFSaga","selectPrintPDFSections","updateSections","saveSections","isLoading","useSections","setPrinting","setUseSections","Sections","updateSection","clearLoading","tables","table","printPDFActions","usePrintPDFSlice","doGetItems","doGetMoreItems","doSetSelectedStatuses","doReorder","doInsert","selectorChangeSaga","monitorSelector","doShowEdit","doShowEditParent","serviceRequestsKanbanSaga","ENTITY_SET_URL","fetchTicketsByStatusId","fetchTicketsParams","skip","fetchTicketById","FETCH_SELECT_EXPAND","$orderBy","notificationMessageKey_getItems","bar","getItems_Success","getItems_Error","getMoreItems_Success","loadedIds","currentStatusIdentifiers","getItems","indexChanges","ServiceRequestStatusId","destinationSectionId","destinationIndex","reorder_Success","reorder_Error","sourceIndex","sourceSectionId","notificationMessageKey","AssignedTo_Id","AssignedTo","Priority","SamplesCount","ParentTicket","ParentTicketId","insert_Success","GenericInsertSuccessMessage","insert_Error","GenericUpdateSuccessMessage","extractErrorMessages","previousValue","currentValue","takePattern","nextValue","openSidePanelProps","showEdit_Success","ServiceRequestTicketDetails","showEdit","showEdit_Error","getMoreItems","setSelectedStatuses","reorder","showEditParent","selectedStatusIds","fetchCount","sourceSection","destinationSection","removed","updateSamplesCount","serviceRequestsKanbanActions","useServiceRequestsKanbanSlice","originalSamplesCount","selectLargeFilesUpload","largeFilesUpload","selectLargeFilesCanUpload","selectLargeFilesUploading","selectLargeFilesStartedToUpload","selectLargeFilesUploadTargetId","selectLargeFilesUploadFilesNumber","selectLargeFilesUploadSelectedFiles","useAdminPermissions","allowedToEdit","allowedToAdd","HasCreateAdminGroupPermissions","allowedToEditOffline","allowedToAddOffline","allowedToEditBatch","allowedToEditGroup","allowedRoles","hasRolePermissions","sum","aggregatedValues","minMax","average","median","mid","floor","unique","uniqueCount","Map","getFirstDefined","args","flattenBy","recurse","emptyArray","emptyObject","resetGroupBy","setGroupBy","useSummary","stateReducers","visibleColumnsDeps","instance","useInstance","prepareRow","previousState","groupByColumns","col","nonGroupByColumns","isGrouped","groupedIndex","pluginName","defaultUserAggregations","flatRows","rowsById","allColumns","groupByFn","defaultGroupByFn","manualGroupBy","aggregations","userAggregations","plugins","autoResetGroupBy","disableGroupBy","defaultCanGroupBy","ensurePluginOrder","defaultColumnGroupBy","defaultGroupBy","columnDisableGroupBy","canGroupBy","Aggregated","existingGroupBy","aggregateRowsToValues","leafRows","groupedRows","depth","aggregateFn","aggregate","groupedValues","leafValues","columnValue","aggregateValue","aggregateValueFn","groupedFlatRows","groupedRowsById","onlyGroupedFlatRows","onlyGroupedRowsById","nonGroupedFlatRows","nonGroupedRowsById","groupUpRecursively","parentId","rowGroupsMap","aggregatedGroupedRows","groupByVal","subRows","groupByID","subRow","summaryRows","getAutoResetGroupBy","useGetLatest","useMountedLayoutEffect","preGroupedRows","preGroupedFlatRow","preGroupedRowsById","allCells","cell","isPlaceholder","isAggregated","resKey","TableCard","viewCheckBox","useSelect","hasAdditionalActions","hasInlineRowActions","someSelected","showTitleCell","contentEditable","useButtons","cells","sizeOfMobileCard","img","hasImg","imgSrc","showSelect","setShowSelect","isDisabled","render","CardMouseOver_info","backStyle","imageSrc","selectVisible","checkBox","showBullet","mobileSize","toggleRowSelected","useImage","topActions","hasTopActions","cardContentRows","TabsToolbar","leftTabs","selectedValue","selectedArray","rowsCount","getMultiMode","onAllRowsSelected","disableMultiMode","defaultMultiMode","rightTabActions","multiMode","setMultiMode","TabsContainer","Grow","Tabs","updateIndicator","selectionFollowsFocus","indicatorColor","tab","allPagesUnselected","Unselect","ClearSelection","CoreMultiSelect_info","CoreSelectAll","genericMemo","FloatingContainer","insetBlock","insetInline","bottom","SperActions","FloatingActions","selectedActions","totalRows","buttonActions","maxButtons","baseActions","sperActions","fixedContainer","fixedContainerMobile","isPopup","mobile","compactActions","CustomToolbarFunc","customRoot","tabsContant","buttonsContant","CustomToolbar","RenderRow","onRowClicked","canClickRow","TableRow","getRowProps","TableCell","getCellProps","CustomEmptyTable","TableHeaderCellLabel","RenderGroupedRow","ImportButton","handleImport","menuItems","showSingleImportButton","keepMounted","defaultGetSubRows","defaultCheckIfRowIsSelectable","tableRowsSize","getSubRows","manualPagination","manualSorting","enablePagination","alwaysShowTableHeader","baseSortBy","globalActions","filtersButtonAnchorEl","setFiltersButtonAnchorEl","useSortBy","useExpanded","usePagination","addRowSelect","columnsDefinition","columnDefaults","DefaultRenderer","useTable","manualSortBy","manualGlobalFilter","autoResetSelectedRows","autoResetPage","getTableProps","getTableBodyProps","headerGroups","reactTableRows","reactTablePage","gotoPage","setGlobalFilter","selectedFlatRows","isAllRowsSelected","setSortBy","isSomeSelected","accumulator","appliedFiltersLength","alreadySelected","setAlreadySelected","filterRef","handleFilterOpen","customProcesing","globalSearchOpen","selectGlobalSearchOpen","showGlobalFilter","defaultPageActions","dataCount","FilterIconButton","filterLength","innerRef","rowsPerPageOptions","sortedUniq","handleSortBy","sortAction","newSortBy","sortDescFirst","isSortedDesc","existingSortBy","existingIndex","hasDescDefined","sortByActual","topMessage","setTopMessage","setGlobalMessage","ShowNotRelatedServiceGroups_warning","autoHideDuration","isCards","setIsCards","print","onLoading","baseTableActions","ConfigureColumnsButton","ExportButton","selectedFilterRowProp","onDownloadTemplateClick","Table","Cards","table_id","tableHead","TableHead","headerGroup","getHeaderGroupProps","getHeaderProps","getSortByToggleProps","TableSortLabel","IconComponent","TableHeaderIcon","isSorted","hideSortIcon","TableContainer","TableToolbar","showMenu","showGlobalSearchIcon","toggleGlobalFilter","FilterContainer","BasicFilter","showFooter","tableButtonsRoot","tableButtonsRootShort","tableButtonsLeft","tableButtonWrap","tableButtonNoWrap","SelectedActions","GlobalFilter","FiltersButton","tableButtonsRight","tableButtonsRightShort","filterDisplayRoot","filterDisplayRootShort","FiltersGroupDisplay","openFilter","useCustomToolbar","useTabsSection","selectedTabValue","showClear","tableContent","tableContentShort","TableError","TableCardGrid","tableScrolling","withFooter","TableBody","rowIndex","summaryRow","tableFooter","tableFooterWithBorder","TablePagination","colSpan","rowsPerPage","labelRowsPerPage","MenuProps","menuPaper","onChangePage","onChangeRowsPerPage","newPageSize","ActionsComponent","TablePaginationActions","NoTableData","useFloatingActions","selectedFloatingActions","buttonFloatingActions","tableContainer","tableHeaderCell","borderRight","tableHeader","tableRowContainer","tableRowCell","tableRow","tableFooterContainer","shadow","useTableCardsStyle","card","cardVertical","cardHorizontal","cardSkelet","RenderTableRowsItems","aria-live","aria-busy","xs","RenderTableHeaderCells","RenderTableRows","TableCardsSkeleton","TableRowsSkeleton","sm","Toggle","Switch","BasicToggle","isChecked","setIsChecked","withInfoLabel","baseLabelStyle","FormGroup","control","FlexRowDiv","selectPrintPDF","printPDF","selectPrintPDFPrinting","selectPrintPDFisLoading","Comments","defaultComment","cannotComment","emailType","disableFileUpload","changed","setChanged","comments","finally","withMentions","Invoice","referenceName","CalendarButton","FormFundingTypePicker","isMember","selectedUser","selectedUserGroup","samePrimaryUserGroup","userGroups","Select","renderValue","classNames","ITEM_HEIGHT","displayEmpty","SavedLists","savedActions","selectedServiceGroups","fetchView","myViews","setMyViews","fetchViewState","fetchViewPromise","selectedView","displayedOptions","searchText","getViewDislpayName","renderedView","selectedChangeLocation","selectedViewChange","removeSelected","openDetailsList","FilterBox","InstrumentList","PleaseSelectView","MySavedLists","ListItemText","SharedLists","ManageLists","AddSavedView","EnumPicker","nameRender","EnumNamesArray","selectedOption","marginRight","withEnumOptions","PrintPDFSection","printPDFSections","componentRef","printClasses","forceChecked","PrintSection","sectionClass","NumberFieldFilter","assetBuildingUrl","publicBuildingUrl","LocationsUrl","initBuildingData","BuildingPicker","isAuth","handleBadRequest","ModelState","ms","assetCampusUrl","publicCampusUrl","initCampusData","CampusPicker","CampusByServiceGroupFilter","convertRoomWithBuildingName","BuildingName","assetRoomUrl","initRoomData","RoomPicker","RoomByBuildingFilter","TableToolbarHeader","FormSectionTitle","gutterBottom","memo","alertContent","showAlert","titleIcon","titleAsColumn","disableGutters","shortview","edge","titleAndIconMobile","RefreshIcon","RefreshContent","initAssetData","AssetPicker","UnconfigurableTable","onExportForImport","exportNotConfigurable","setData","setDataLength","setControlledPageCount","serializedCustomFilter","handleSelectedRowsChange","StyledTopBar","drawerWidth","sidePanelWidth","drawer","transitions","easing","sharp","duration","leavingScreen","enteringScreen","SubTopBar","attrs","easeInOut","ProfileSection","StyledUserMenu","Section","LeftSection","RightSection","RowSection","FormFieldsBox","SectionTitle","EnableLegacyScheduler","FormAssetsPicker","initReservationStatusMultiData","ReservationStatusMultiPicker","BaseOptionsMultiPicker","ResrvationStatusMultiFilter","Future","getInitUpcomingReservationfilterMultiData","UpcomingReservationfilter","AllReservations","WorkflowBookingFilter","WorkflowBookingPicker","initReservationByIdWithPartsData","ReservationByIdWithPartsPicker","ReservationByIdWithPartsFilter","InstrumentFilterChip","InstrumentsFilterDisplay","handleDelete","border","noWrap","chip","GetFilters","RG_DatePeriod","pushServicesFilter","initData","pushBookedByFilter","budgetsFilter","getBudgetsFilterSettings","pushAssetCatGroupFilter","pushAssetCatFilter","pushAssetAvailabilityFilter","initInstituteData","InstituteFilter","ExcludeStatus","UserGroupFilter","ReservationsRelatedToReservationId","refreshAfterInit","ReservationParts","OrderedBy","ReservationStartsOn","DatePickerFilter","ReservationEndsOn","Loanable","Duration","NumbersRangeFilter","Department","initDepartmentData","DepartmentFilter","InstituteType","initInstituteTypeData","InstituteTypeFilter","Model","TextFieldFilter","ModelNumber","pushRoomFilter","pushBuildingFilter","Discipline","UserDisciplineFilter","initUserDisciplineData","pushBudgetManagerFilter","pushCampusFilter","UpcomingReservations","pushWorkflowBookingFilter","AssetCatGroupName","initAssetCatGroupData","AssetCatGroupFilter","AvailabilityType","initAvailabilityTypeData","AvailabilityTypeBookableFilter","BudgetManager","AssetCategory","initAssetCatData","AssetCatFilter","RoomPickerFilter","Building","BuildingPickerFilter","includeAllMyManagedServicesOption","allMyManagedServicesOption","AllMyManagedServices","InstrumentServiceName","ServiceAdminFilter","ServiceReservationFilter","ServiceMultiFilter","pushServicesCalendarFilter","renderFilterDisplay","Campus","CampusFilter","initWorkflowBookingData","doSaveState","doSetRepetitiveValue","repetitiveSaga","saveState_success","setRepetitiveValueSuccess","setRepetitiveValue","repetitiveValueHandler","resetRepetitiveHandler","useRepetitiveSlice","ServiceGroupRegistrationStatus","configurableColumnsCache","force","param","getTableColumns","ConfigurableColumnsSetUp","j","hasCustomName","CustomName","ColumnExportConfig","RemindBefore","defaultUrl","initUserMultiData","UserMultiPicker","filterKey","FormOnlineServicesComboPicker","FormOnlineServicesSinglePicker","mapAssetsToServiceFilterDto","mapAssetsToServiceTypeFilterDto","FormBudgetPicker","ServiceRequestMilestoneStatusesUnionArray","toDown","AlertStart","AssignUsers","AssignedUsers","AlertDescription","Downtime","InstrumentWasDown","EventEnd","EventStart","OfflineRemarks","ReasonType","ReasonTypeId","ReasonTypeName","getSingleReminder","RemindMeBefore","WorkOrderTypeStatus","StatusName","RepairCodes","SymptomCodes","AlertTitle","AutoCreateTitle","StaffFormValues","fv","SubmissionFormValues","StuffCustomForm","HasAletForm","IsClosed","ClosedStatuses","ShowOnCalibrationHistory","NotEditable","entities","workModel","repeatAsset","times","repetitive","alert","offlineStart","offlineEnd","dur","alertStart","offend","parseRepetitive","assetGuid","Guid","ass","timesGuid","AssetId","MaxDate","RepeatAssets","RecurringAssetUniq","RecurringGroupUniq","CommentIds","AssetName","getAlertStart","remindBefore","doNotNotify","oneday","twodays","threedays","oneweek","onemonth","isExport","expaneded","customparams","getPredicates","bulletedStyles","overflowX","rowOverRule","SimpleList","BulletedList","infoColors","colorInfoFull","cyan","colorInfoDark","colorInfoHover","colorInfoRegular","colorInfoComponents","colorInfoComponentsLight","colorInfoBorders","colorInfoDisabled","colorInfoBgHover","colorInfoBg","colorInfoBgLight","MuiButtonOverride","textDecoration","contained","containedSizeSmall","containedSizeLarge","textSizeSmall","textSizeLarge","sizeLarge","iconSizeMedium","iconSizeLarge","iconSizeSmall","MuiIconButtonOverride","MuiToggleButtonGroupOverride","borderColor","grouped","groupedHorizontal","borderLeft","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","groupedVertical","MuiToggleButtonOverride","boxSizing","createBreakpoints","lato_Light","src","lato_Regular","lato_Bold","lato_Black","DefaultThemeSettings","typography","overrides","MuiCssBaseline","unicodeRange","BookitThemeSettings","mobileStepper","speedDial","appBar","modal","snackbar","light","textHover","accent","blackComponent","graySubtitle","backgroundHover","grayDividers","MuiTypography","colorError","colorPrimary","colorSecondary","colorTextPrimary","colorTextSecondary","MuiAppBar","colorDefault","MuiLink","MuiSelect","MuiInputBase","adornedStart","paddingLeft","adornedEnd","paddingRight","MuiFilledInput","borderBottomColor","underline","transform","shorter","easeOut","marginInline","borderBottomStyle","marginDense","paddingBottom","inputMarginDense","inputHiddenLabel","inputMultiline","inputAdornedStart","inputAdornedEnd","MuiFormHelperText","MuiFormGroup","MuiFormLabel","asterisk","MuiInputLabel","formControl","animated","MuiInputAdornment","positionStart","positionEnd","MuiSvgIcon","fontSizeSmall","MuiList","MuiListItem","MuiListItemText","MuiListItemIcon","MuiAvatar","MuiTableContainer","MuiTable","MuiTableHead","MuiTableBody","MuiTableRow","MuiTableCell","head","footer","MuiTableSortLabel","MuiTablePagination","caption","spacer","toolbar","menuItem","MuiTextField","MuiChip","MuiButton","MuiIconButton","MuiToggleButtonGroup","MuiToggleButton","MuiSwitch","verticalAlign","colorAdjust","switchBase","shortest","thumb","track","MuiFormControl","marginNormal","MuiFormControlLabel","WebkitTapHighlightColor","labelPlacementStart","labelPlacementTop","labelPlacementBottom","MuiCheckbox","MuiRadio","PrivateSwitchBase","MuiBadge","badge","MUIDataTableBodyCell","MUIDataTableBody","MUIDataTableHeadCell","contentWrapper","fixedHeader","toolButton","MUIDataTableToolbarSelect","paddingLe","MuiDialog","paperWidthXs","scrollPaper","paperWidthFalse","paperScrollPaper","paperFullWidth","MuiBackdrop","MuiAlert","MuiMenu","MuiMenuItem","MuiPickersDatePickerRoot","toolbarLandscape","dateLandscape","MuiPickerDTToolbar","MuiDrawer","up","paperAnchorDockedLeft","MuiPickersToolbar","MuiPickersToolbarButton","toolbarBtn","MuiPickersToolbarText","toolbarTxt","toolbarBtnSelected","MuiAutocomplete","MuiTabs","flexContainer","scrollable","indicator","MuiTab","wrapper","textColorInherit","MuiTooltip","darkTheme","grey","green","animalsThemeSettings","h5","h6","body1","body2","CreateTheme","baseTheme","createMuiTheme","getBaseTheme","initLocationData","LocationPicker","serviceGroup","initServiceGroupsMultiData","initFiltersServiceGroupsData","ServiceGroupByDivisionsFilter","ServiceGroupsPicker","useGlobalServiceGroupsFilter","applyGlobalServiceGroupsFilter","gloabalSettings","HideTopServiceGroupFilter","AssetRenderer","ButtonConfirm","confirmationDialogTitle","confirmationDialogBody","AreYouSure","InvoiceDetailsSidePanel","InvoiceDetailsSidePanelLink","InvoiceDetails","RequiredFieldsContext","createContext","requiredFields","ValidationSchemaProvider","skipValidation","describe","fieldValidationSchema","getIn","tests","Provider","useIsRequired","useContext","getRunTypeOptions","getRunTypeValue","runtype","RunTypePicker","BooleanRenderer","OnlineServiceType","getSingleOnlineServiceType","GetAvailableOnlineServiceTypes","roomsEnabled","Software","LocalApp","Relay","IpRelay","WebRelayTm","WebRelayX600m","UsageForm","LoanDesk","DoorAccess","NiDAQmx","KmTronicRelay","RaspberryPi","initOnlineServiceTypeData","getOnlineServiceTypeAssetFilter","enabledTypes","enabledUsageTypes","enabledRemoteTypes","OnlineServiceTypePicker","RoomUserRoleEnabled","filterUrl","initRegionData","RegionPicker","useResponseModel","ShortText","FullText","ImageGallery","imageRendering","backgroundSize","backgroundBlendMode","HtmlRenderer","fullText","setFullText","needButton","setNeedButton","clientHeight","scrollHeight","clientWidth","scrollWidth","ShowMore","ArrayRenderer","indx","AssetRowState","UsersRenderer","Email","OfficeTel","AssetLocationLastUpdate","assetId","fetchState","fetch","Updated","DoubleRender","AssetComments","staffonly","noTitle","getAssetEditLink","divisionId","getRows","PropName","Image","defaultImgSrc","defaultImgMobileSrc","defaultImg","pathSrc","setPathSrc","loadingImg","setLoadingImg","imageDimensions","setImageDimensions","checkImage","onload","onerror","cardImageMobile","backgroundRepeat","backgroundPosition","AssetDetailsImageRender","AssetImageSizeType","NoHeader","validToRender","editLink","DivisionId","ApprovalRequired","TrainingMandatory","MinimumReservationDurationH","MaximumReservationDurationH","ReservationMinimumGap","CarryOverTimeSlotGap","CarryOverTimeSlotTypeName","dependencies","AssetsInstituteBusiness","DivisionName","Accessories","AssetCatEnabled","SeeAllRelatedAssets","setProps","actionType","assetCatGroupId","AssetCat","GroupId","customPredicates","hideCoresToggle","AssetsSelection","InternalServiceAvaliable","assetCatId","NickName","OtherNames","Brand","RoomNumber","LocationsList","EquipmentExpert","ContactsPersonForEquipment","ExternalCompany","MainSpecificationRange","ElectricalSpecs","FunctionalCharacteristics","WebLink","RoutineActiveAnalysisCapable","Tags","Asset_ExtraDate0","Asset_ExtraDate1","Asset_ExtraDate2","Asset_ExtraDate3","Asset_ExtraDate4","Asset_ExtraDate5","Asset_ExtraDate6","Asset_ExtraDate7","Asset_ExtraDate8","Asset_ExtraDate9","Asset_ExtraText0","Asset_ExtraText1","Asset_ExtraText2","Asset_ExtraText3","Asset_ExtraText4","Asset_ExtraText5","Asset_ExtraText6","Asset_ExtraText7","Asset_ExtraText8","Asset_ExtraText9","Asset_ExtraText10","Asset_ExtraText11","Asset_ExtraText12","Asset_ExtraText13","Asset_ExtraText14","Asset_ExtraText15","Asset_ExtraInt0","Asset_ExtraInt1","Asset_ExtraInt2","Asset_ExtraInt3","Asset_ExtraInt4","Asset_ExtraDec0","Asset_ExtraDec1","Asset_ExtraDec2","Asset_ExtraDec3","Asset_ExtraDec4","Asset_ExtraBool0","Asset_ExtraBool1","Asset_ExtraBool2","Asset_ExtraBool3","Asset_ExtraBool4","Asset_ExtraUrl0","Asset_ExtraUrl1","Asset_ExtraUrl2","Asset_ExtraUrl3","Asset_ExtraUrl4","Asset_ExtraRichText0","Asset_ExtraRichText1","Asset_ExtraRichText2","Asset_ExtraRichText3","Asset_ExtraRichText4","Asset_ExtraDDL0","ExtraDDL0","Asset_ExtraDDL1","ExtraDDL1","Asset_ExtraDDL2","ExtraDDL2","Asset_ExtraDDL3","ExtraDDL3","Asset_ExtraDDL4","ExtraDDL4","Asset_ExtraDDL5","ExtraDDL5","Asset_ExtraDDL6","ExtraDDL6","Asset_ExtraDDL7","ExtraDDL7","Asset_ExtraDDL8","ExtraDDL8","Asset_ExtraDDL9","ExtraDDL9","Asset_ExtraDDL10","ExtraDDL10","Asset_ExtraDDL11","ExtraDDL11","Asset_ExtraDDL12","ExtraDDL12","Asset_ExtraDDL13","ExtraDDL13","Asset_ExtraDDL14","ExtraDDL14","Asset_ExtraDDL15","ExtraDDL15","BrandBarcodeNumber","ServiceContract","WarrantyEndDate","LifeDateView","ExportLicense","InternalEquipmentBarcodeNumber","AccountingId","State","SectionName","AssetClassification","AssetLocation","AssetContacts","AssetIdentifiers","AssetAdditionalInfo","AssetSectionLabel7","AssetSectionLabel8","AssetSectionLabel9","AssetSectionLabel10","Doi","doiURL","AssetDoiTooltip","RenderStatus","AssemblyStructure","AssetDetailsLink","Details","renderItem","childRes","Range","MinValue","MaxValue","CommentsAndAttachments","CommentsAreStaffonly","isBookable","isOnlineService","moveArrayItem","pos","ri","GetReservationEnabled","notAllowReservations","reservationEnabled","GetUsageEnabled","autoMode","AutoMode","LocalAppEnabled","GetAlertsEnabled","alertsEnabled","RemoveLastEmptySections","pop","GetRawSections","CheckEmptyRawSections","RemoveEmptySections","GetSections","noNameSection","GetRowsSections","leftRes","rightRes","checkSection","getSectionsFilter","resSections","imageSection","removeArrayItem","RowToSections","leftSections","rightSections","RowsToSections","fetchAssetBy","fetchAssetByInternal","Division","AssetCatGroup","AlertsEnabled","fetchAssetAdditionalData","buttonsData","ButtonOrLink","CreateAnAssetRelatedEvent","fetchAlertTypesPromise","fetchAlertTypesState","fetchAlertTypes","downtimeProps","mismatchCore","PleaseSelectAnEventType","Event","ExcludeAssetDocumentsColumns","AssetDetailsFiles","documentsColumns","getColumns","assetPredicate","groupPredicate","DocumentsTable","notFullWidth","noLabelRendersArray","asHtmlRenderArray","DefautltCell","RenderRows","cellData","RenderLeftSection","RenderRightSection","MismatchCore","MismatchCoreMessage","updateGlobalServiceGroup","sg","MismatchAssetCore_warning","SwitchToThisCore","AssetDetailsTabContent","AssetBookingRules","InstrumentRestrictions","initUser","showTable","assetPickerDisabled","withNoPadding","hideEquipmentFormTitle","withNoWrapper","BaseFilterValues","GetFilter","SetValue","GettableCount","AssetTrainingSessionsColumns","GetPredicates","serviceGroupPredicate","Trainer","updateCounters","AssetTrainingSessions","filterBy","rf","getTrainingFilters","trainingSessionsColumns","AddNew","ManageSessions","goToTrainingSessions","hasNextSession","trainingSessionPrimaryAction","TrainingSessionsTable","AssetArticlesTable","articlePrimaryAction","ArticlesTable","AssetWorkOrdersColumns","AssetCalibrationColumns","calibrationPredicate","GetWorkOrdersTableCount","AssetWorkOrders","workOrdersColumns","PageActions","allowToAddNew","NewWorkOrder","WorkOrder","initAsset","assetName","workOrderPrimaryAction","goToWorkOrders","WorkOrdersTable","ActiveIncidents","Badge","BadgeCounter","hasValue","DropDownTabsWrapper","AssetMobileDropDownTabs","tabs","tabsId","tabsPanelId","handleTabChange","selectedTab","tabPanels","getTabProps","ListItemSecondaryAction","TabPanel","scrollableContent","Content","AssetDetailsTabs","setSelectedTab","handleSelectedTabChange","tabsPanels","BasicTabs","selectedTabIndex","ExpandableRows","DefaultRows","DefaultAttributes","countersForTabs","Reservations","Schedule","WorkOrders","Calibrations","enabled","Publications","TrainingSessions","AssetPopUp","useRedirectToDash","addFromCalendar","setRows","selectColumns","setSelectColumns","expandColumns","setExpandColumns","setButtonsData","idChanged","setIdChanged","loadingAdditionalData","setLoadingAdditionalData","loadingButtonsAdditionalData","setLoadingButtonsAdditionalData","openEndUsage","setOpenEndUsage","endUsageProcessing","setEndUsageProcessing","assetCover","counters","setCounters","assetProps","isDashboardCore","assetFieldEnabled","tempCounters","updateCountersEnable","dict","loadAdditionalData","ad","AssetAssemblyStructure","Allowed_ByTraining","EndUsageIds","CanRequestAccess","ApprovalStatusId","CanBeCreatedFromLinkOnly","ReservationEnabled","loadButtonsAdditionalData","UsageEnabled","CanStartUsage","CanEndUsage","PlanedEventsEnabled","AlertInfo","NotifyExists","ShowFeed","loadCounters","GetTrainingSessionsTableCount","GetArticlesTableCount","enabledAssetProps","columnNamesFilter","setRequestParams","rn","addArrayItemByName","moveArrayItemByName","rs","assetProp","handleEndUsage","usageData","AssetDetailsApi","getTopAssetActionsDropDown","isMismatchCore","canAddQuiz","useAssetsPermissions","NotificationIsAvailable","EditSettings","Settings","menu_AddNewTrainingSessions","NewTrainingSession","UntrainedToolTip","Calendar","Timeline","PrintSelectedAssetLabelsButton","PrintLabels","menu_ReservationsHistory","UsageHistory","Quizzes","TrainingQuiz","AlertsIcon","ScheduledEvents","RequestAnOtherService","CreateNewSampleRequest","ResCancelNotifications","ReservationNotification","NotifyToolTip","NoNotifyToolTip","EditRemainders","AddRemainders","CalendarPublicIntegrationFeed_Icon","OutlookGoogle","useTopAssetActionsDropDown","addWorkOrder","addReservation","ReservationCreateButton","PlaceAReservation","instruments","openPanelOrCover","addUsage","StartUsage","Use","StopUsage","Stop","addTakeDown","hasDownActive","noAlerts","hasActive","alertId","HasActiveDownAlertsAdmin_info","Up","TrendingUpRounded","HasNoAlertsAdmin_info","SampleRequests","ReportAConsumable","stid","ReportConsumables","LogConsumables","SwitchToCoreOpenItsBoard","CoreBoard","approvalStatus","RequestAccess","addRequestAccess","assetActionsDropDown","AssetDetailsTab_Details","commentsForStaff","BookingRules","AssetDetailsTab_WorkOrders","handleCloselClick","dataFound","ShowAssetFull","EndUsageConfirm","usageId","usageProcessing","Messages","err_Equipment_NotFound","NotFoundPage","tt","isPathAndQuery","ActionIconButton","SwitchTarget","updateX","openReservation","openWorkOrder","SwitchToReservationTitle","SwitchToDowntime","setSelectedOption","isNotBillable","OpenWorkOrderButton","buttonName","orderId","bringBackUp","orderProps","panelProps","openOrder","menu_EditWorkOrder","WorkOrderLink","useOpenWorkOrderPopUp","panelState","useCommentStyles","commentSection","commentTextFiles","commentText","nameAndTime","nameTitleButtons","nameTitle","useContainerStyles","commentsContainer","sectionTitle","controlBox","addCommentBox","leftSide","rightSide","alertSpacing","flexBasis","itemCheck","fileSizeToString","dp","thresh","abs","units","FileButton","canRemove","onDeleteFile","openDelete","setOpenDelete","sendNotifications","msg_DeleteFile","Grid","rawName","suffix","shortenName","Delete","err_DeleteFileFailure","minChunkSize","UploadLargeFile","_pause","_busy","finished","fileId","uploadId","NeedCompleteMultipartUpload","uploadResponses","pause","DeleteUnfinishedLargeFiles","chunkSendResult","continueFrom","uploadEnd","CompletionResult","conscreateCancelToken","chunkSize","uploadChunk","Result","FileId","UploadId","ETag","PartNumber","CompleteMultipartUpload","finish","uploadChunck","fileName","chunck","EMPTY","chunk","FileCard","remorFile","canUplpoad","setInProgress","setProgress","setPart","setError","setShow","setPause","getFileSize","notificationActions","uploadLargeFile","closeHandler","deleteUnfinishedLargeFiles","upload","stopAndCancel","Card","CardContent","ErrorDueUpload","ReUploadFile","string","SelectFile","filesPlaceholder","downloadFileName","maxFilesCount","maxSize","maxFiles","onDrop","acceptedFiles","useDropzone","getRootProps","getInputProps","StyledDropboxContainer","borderWidth","borderStyle","outline","LargeFilesUpdate","AllowLargeFilesUpload","fh","MaxLargeFileSize","MaxUploadFileSize","DragTheFilesOrBrowse","Attachments","Template","AddComment","bindSubmitComment","formRef","scrollIntoView","behavior","block","inline","userSchema","Users","initial","innerClicked","handleSubmit","resetForm","validationSchema","formik","submitForm","getFieldHelpers","VisibleToUsers","fixedWidth","WriteAComment","isSubmitting","CommentCell","onEditComment","onDeleteComment","setHover","setEdit","setFiles","currentUserComment","CreatedBy","uploadedFiles","commentId","filesUpload","getComments","newComment","Avatar","onMouseEnter","onMouseLeave","Edit","CommentsContainer","emailBody","emailSubject","shouldSendEmail","setCount","sortedComments","writeCommentOpen","setWriteCommentOpen","sendMail","useSendMail","innerSender","createEmail","DefaultEmailTemplateBody","DefaultEmailTemplateSubject","DefaultPageName","DefaultReferenceName","CommentsCount","Comments_EmptyMessage","Subject","renderToStaticMarkup","SaveToLog","Cc","Bcc","AddService","addService","getServiceTypes","fetchServiceTypes","setServiceTypes","fetchServiceTypeState","fetchServiceTypePromise","onClickCapture","ContentWrapper","NotFound","AddConsumable","InventoryBatchChip","renderService","onServiceClick","onAddBatchClick","renewStock","handleServiceChange","onRenewStockClick","batchRequested","savedCreatableRenewal","handleBatchListClose","availableBatches","currentBatch","handleChipSelect","InventoryBatchEmptyGenerateOn_info","InventoryBatchEmptyGenerateOff_info","InventoryBatch_notFound","handleBatchListOpen","InventoryBatchList","addNewBatchClick","onBatchClick","selectedBatch","showRenewStockButtons","createdRenewal","batchId","batches","QuickItem","QuickServiceItem","mandatory","handleRemove","createdEditable","minStep","maxStep","handleAddError","setQuantity","err_Quantity_required","IsAdminOfService","counterUpdated","setCounterUpdated","arrowTitle","RenewStockArrow_info","ReservationOfflineServiceEditArrow_info","ConsumableCreateArrow_info","ReservationOfflineServiceCreateArrow_info","serviceChange","change","withError","precision","err_LowQuantity","err_HighQuantity","OfflineServiceMandatory_info","valid","StyledBaseTextField","spin","AddCoverConsumable","onAddClick","AddServiceFromSelection","addServices","removeServices","addAndRemoveServices","newSelectedServices","updated","setUpdated","isBarcodeScanned","added","QuickServiceItems","BookQuickServices","refreshServices","refreshCosumables","offlineActions","initServicesFunc","onServiceRemove","onServicesRemove","onServiceUpdate","createServiceFromServiceType","createServicesFromServiceType","loadSeviceTypes","useAssetSelection","onAddAndRemoveServices","showScannerView","fetchServices","currentUser","serviceCreated","setServiceCreated","setServices","fetchServicesState","fetchServicesPromise","handleRemoveService","handleAddService","StokRenewed","handleAddServices","handleRemoveServices","newServices","handleAddAndRemoveServices","staticServices","addedServ","focusedService","hasServices","ScannerView","selParams","offTypeIds","BookitDateTimePicker","dateId","timeId","dateName","timeName","dateLabelInline","timeLabelInline","parsedValue","setTimeValue","setDateError","handleDateChange","displayValue","getSeconds","handleTimeChange","dateError","timeError","setTimeError","handleOnError","onDateError","onTimeError","noLabelInline","datePlaceholder","timePlaceholder","selectAssetInventory","assetInventory","selectRoomSelected","selectedRoomState","selectLocationSelected","selectedLocationState","selectSubLocationSelected","selectedSubLocationState","selectScanProcessing","scanProcessing","selectNoRoomAccessProcessing","noRoomAccessProcessing","selectInventoryLogFilters","logFilters","ViewLengthsArray","viewLengthOptions","shortName","viewTypeOptions","Wrapper","DivStyle","viewBox","fill","xmlns","clipPath","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","visibility","hasPopupIcon","hasClearIcon","clearIndicatorDirty","popperDisablePortal","disabledOpacity","filterByServiceGroups","initCompleted","ServiceGroups","InvoiceStatuses","RepetitiveFor","DATE_PERIODS","DatePeriodsPicker","getOptionsCallback","getUnitTypesData","UnitTypePicker","MAX_SIZE_DEFAULT","AssetThumbImage","hasImgeBroken","setHasImgeBroken","avatar","alt","getContrastText","FormAutocompleteOptions","FormAutocomplete","FormAutocompleteMultiOptions","FormAutocompleteMulti","ExternalApi","formFieldId","isMultiple","OptionsSourceType","deserializeOptions","optsArray","opt","CustomFormDropDown","externalLoadData","getBlackColorOption","getColorOption","serializeSchedulerDateOrUndefined","formType","updateOption","reccurentAssetId","recurrentGroupId","alertTypeId","operation","Values","rowValues","getArray","modelValue","LocationDetails","hasChanges","shallowEqual","DeatilsOperations","handleSubmitForm","submitFormRef","handleCancelClick","PageComponent","bindSubmitForm","handleSubmitCallResult","submitcall","LocationContent","ModelDetails","Update","IdSpec","onBeforeunload","CatRateTypes","InvoiceChildRowBaseSchema","PleaseSelectABudgetNumber","PleaseSelectServiceGroup","PleaseSelectADate","AllowCreateInvoicesBy","AddPayment","notifyActions","submitRef","refreshTable","sendResponse","closeApproved","closeRejected","paymentId","invoiceId","submit","payment","PaymentApi","UpdatePayment","success_EditInvoicePayment","err_EditInvoicePayment","err_InvoicePaymentAdd","budget","Method","setinitialValues","BudgetNumber","MethodId","PaymentMethodName","isMounted","PaymentSchema","optional","err_PaymentMethodRequired","PleaseEnterAnAmount","positive","InvalidValue","getPaymentSchema","PaymentSchemaWithBudgetNotRequired","getPaymentSchemaWithBudgetNotRequired","Paymentform","validateOnMount","inputMode","FormPaymentMethodPicker","PaymentMethod","Submit","Payment","AddPaymentInvoice","ChargeApi","Resource","OtherService","BaseRate","CatRateTypeId","FeeType","SampleTypeId","SampleType","ActualRate","FormCatRateTypePicker","CatRateTypePicker","OfflineServicePicker","FormOfflineServicePicker","FormSampleTypePicker","FormServiceUserGroupPicker","ServiceUserGroupPicker","AddCharge","insertedAt","setinsertedAt","insertedBy","setinsertedBy","userGroupByBudeget","Manual","setInitialValue","OnlineServiceId","OnlineService","CatRateType","SampleServiceId","SampleService","queryBudg","budgetRes","serviceGroupRes","budegtval","success_EditInvoiceLine","msg_addedChargeSuccessfully","budgetOnly","CreateInovicesBy","AlllowCreateInvoicesBy_BudgetsOnly","ChargeSchema","catRateType","Refund","Discount","negative","GetChargeSchema","ChargeForm","setAmount","bySystemSetting","manual","setValues","produce","Equipment","Charge","AddManualInvoiceLine","LabelTypePage","LabelTypeEdit","useAllowedToChangeStatus","readOnlyUser","ArticleDetails","selectedArticle","refreshDetails","isSaved","articleDetailsForm","allowedToChangeStatus","CreatedByMe","PublicationRecordApproved_info","useCanEdit","canEdit","canAdd","useCanAdd","firstLoad","setFirstLoad","ExternalId","ExternalIdSource","openExternalEntry","ArticleEdit","editArticle","ArticleForm","getValue","PublicationDetails","EditAssociationButton","Authors","EnteredBy","EnteredAt","ArticleDoiLink","doi","ArticleDataset","Dataset","ISSN","ORCID","ORCIDs","Year","RelatedUser","RelatedUserDisplayName","CalibrationRecord","Journal","ArticlePageNumber","PageNumber","ParticipatedLabs","ParticipatedInstruments","Abstract","EditArticle","EditAssociation","AssociateThisPublicationTitle","AssociateThisPublication","FormAssetPicker","assetSchema","assetsSchema","GetInstrumentFilter","sv","GetCalibrationRecordFilter","test_s","FormCustomPicker","CustomPickerFilter","ArticleWorkOrdersPicker","ArticleFormPicker","NewArticleDetailsForm","oldServiceGroups","setOldServiceGroups","setServiceGroups","setInstruments","canEditStatus","setCanEditStatus","ServiceGroupAsset","otherwise","handleCloseClick","instrumentFilter","CalibrationRecordFilter","handleFormChange","setTouched","ArticleContributionLevelId","FirstInstrumentAssetName","FirstServiceGroupAssetName","CalibrationRecordName","DepartmentName","InstituteName","InstituteTypeName","statusPickerData","AddPublication","validateOnBlur","ValueLabel","ArticlePleaseSelectEquipmentFirst","PleaseSelectWorkOrder","CalibrationRecord_info","PleaseSelectAUser","PleaseSelectAsset","ConvertNewToComment","newcomment","newFiles","ArticleComments","commentsFormRef","setchanged","newSavedComments","setNewSavedComments","newComments","setNewComments","Article","portalRef","Portal","EditArticleDetailsForm","editProcessing","detailsLoading","submitCommentRef","GetServiceGroupAsset","SaveFormButton","ConvertModelToEntityUserAttributesDetails","Attribute","AttributeLocalized","SSO","SSOAttribute","RegistrationForm","UserDetails","UserSidePanel","Order","ConvertEntityToModelUserAttributesDetails","UserAttributesApi","userAttributesDetailsSaga","initUserAttributesDetails_Success","initUserAttributesDetails_Error","initUpdateUserAttributesDetails_Success","initUpdateUserAttributesDetails_Error","menu_UserAttributes","UserAttributesDetails","createUserAttributesDetails_Success","createUserAttributesDetails_Error","updateUserAttributesDetails_Success","updateUserAttributesDetails_Error","initUserAttributesDetails","initUpdateUserAttributesDetails","createUserAttributesDetails","updateUserAttributesDetails","resetUpdateUserAttributesDetailsState","resetCreateUserAttributesDetailsState","userAttributesDetailsActions","selectUserAttributesDetails","userAttributesDetail","selectCreateUserAttributesDetails","selectCreateUserAttributesDetailsCompleted","selectUpdateUserAttributesDetails","selectUpdateUserAttributesDetailsCompleted","selectUserAttributesDetailsProcessing","UserAttributesForm","isNotEditableField","userAttributesDetailsSchema","sso","formikHelpers","UserAttributeDetails","MandatoryFieldsArePartOfTheRegistrationForm","hasUnsavedChanges","requestCreateCompleted","requestUpdateCompleted","createModel","editModel","baseModel","requestCompleted","setRequestCompleted","handleSaveClick","EditAttribute","AddNewAttribute","Priorities","getInitialValues","getTicketSchema","samplesAutomationEnabled","parentSamplesCount","samplesRequired","PriorityPicker","FormPriorityPicker","FormServiceRequestStatusPicker","ServiceRequestStatusPicker","Form","AssignedSamplesToThisTicket","AddSubTicket","ServiceRequest","SubSamplesCount","TotalSamplesCount","handleCancel","AddSubServiceRequestTicket","editState","editItem","enableAddSubTicket","handleAddSubTicketClick","ParentTicketDetailsButton","getServiceRequestTicketTitle","ServiceRequestTicket","ServiceRequestTickets","StockRenewalForm","innerFormRef","onAddServiceClick","fieldHandler","validateForms","resetFieldHandler","serviceChanged","setServiceChanged","recentMostBatchesChanged","setRecentMostBatchesChanged","allIsValid","setAllIsValid","servicesSelected","setServicesSelected","validateForm","otherServicesSchema","changeOfflineServices","stockRenwevalSchema","err_OfflineServiceTypeRequired","err_DateReceived_required","initServices","prepareService","StockRenewal","createServices","onRemoveService","onRemoveServices","onUpdateService","loadServiceTypes","validateOnChange","enableReinitialize","setErrors","ReportConsumablesMainInfo","ReceivedDateTimeLabel","AutoGenerateNewBatchesDisabled_info","AutoGenerateNewBatches_info","ReportedConsumables","staticService","initialServices","actionCompleted","stockRenewalServicesData","isReadOnlyUser","RoomOnly","assetsFilter","renewProps","batchProps","StockRenewals","RenewStockForm","batchChanged","setBatchChanged","serviceTypeSelected","setServiceTypeSelected","computedSchema","renewStockSchema","currVal","err_IntQuantityOnly","Batch","withMutation","NotAllowNegativeInventory_currentEqualsZero_err","NotAllowNegativeInventory_currentMoreThanZero_err","err_InventoryBatch_required","RenewStockInfo","Consumable","FormOfflineServiceTypePicker","PleaseSelectServices","FormInventoryBatchPicker","AddNewBatch","EditSelectedBatch","renewStockData","RenewStockOfConsumables","InventoryBatchForm","inventoryBatchSchema","BatchName","err_BatchName_required","BatchExpirationDate","BatchPurchaseDate","err_BatchPurchaseDate_required","BatchInventory","err_BatchInventory_required","BatchLot","BatchPurchasePricePerUnit","NotAllowNegativeInventory_err","BatchInfo","Inventory_ServiceType_Description","inventoryBatchData","CreateNewBatch","ArticleAssociationForm","SidePanelRenderer","TrainingDetails","QuizCreate","StartQuiz","QuizzDetails","QuizDetails","AddBillingAction","LabelType","RestrictionDetails","PricePeriodsDetails","ArticleNew","InvoiceTemplatePopUp","CoreSelection","CalendarMessagesDetails","ServiceRequestMilestone","ServiceRequestMilestoneDetails","ServiceRequestMilestoneCharge","ServiceRequestMilestoneChargeDetails","InvoiceBatchesComments","AssetInventoryLog","InventoryLog","RegionDetails","assetBaseUrl","AssetCatGroupPicker","noGlobalServiceGroupFilter","InstitutePicker","AssetCatPicker","DepartmentPicker","DEFAULT_WIDTH","tryCleanValue","titleValue","parsedTitle","htmlParse","maxChars","toCharsWidth","data-html","TruncatedDescriptionText","Styled","toCssWidth","InstituteTypePicker","BasicCard","cardContent","iconTitle","maxContentHeight","imgError","setImageError","imageUrl","loadImage","showHeader","contentHeight","mouseUp","setMouseUp","trimTitleText","trimmedTitle","trimSize","StyledCard","cardActive","cardInfo","cardSuccess","cardWarning","cardError","position_vertical","position_horizontal","cardSize_small","cardSize_medium","parentElement","ImageContainer","mobileSizeMedium","mobileSizeSmall","onLoadedMetadata","onLoad","BasicCardWithInfo","additionalFilters","multipleServiceGroups","filterSettingToCondition","extractValuePart","doLogin","doRedirectToLogin","internalIdLoginSaga","SESSIONSTORAGE_KEY","storeInternalIdLogin","sessionStorage","removeItem","setItem","loadInternalIdLogin","getItem","storedIdentity","init_success","isLargeAnimals","General","InternalId","login","redirectToLogin","logout","initialized","returnUrl","identity","clearError","useInternalIdLoginSlice","FormUsersPicker","initSubLocationListData","SubLocationListPicker","ReservationEditButton","useReservationEditBehavior","ReservationEditButtonLink","legacyURL","selectRouterSlice","router","selectRouterLocation","selectRouterSearch","selectRouterSearchParams","selectRouterPathname","BudgetExperimentStatuses","baseUrl","initSuperGroupData","SuperGroupPicker","WorkButton","getAssets","setAssets","workTypes","setWorkTypes","workTypeLoading","setWorkTypeLoading","assetLoading","setAssetLoading","handleAssetChange","getParamFromUrl","handleWorkTypeClick","AssetAlertType","sympt","aStatus","aStart","sid","AddEvent","wrap","QuickWorkOrderPleaseSelectAssets","wt","NoAlertTypesFoundForSelectedAssets","RegionFilter","onlineUrl","initMyAssetAvailabilityTypeMultiData","initMyAssetAvailabilityTypeOnlineMultiData","MyAssetAvailabilityTypeMultiPicker","filterLengs","badgeContent","showZero","openProps","ReservationLink","openDetails","useOpenReservationPopUp","getLink","useReservationLinkUrl","ClickToSeeReservationDetails","ctrlKey","resProps","SchedulerConnectedWithFilters","customDaysEnabled","twoDaysEnabled","new_state","setFilterOpen","handleFilterClose","handleSetPeriodFilter","updateSearchPeriod","handleViewTypeLengthChange","noChangeLocation","presetValue","searchComp","servicesLimit","limitReached","SchedulerServicesLimitReachedWarningMessage","CalendarHeader","onMultipleModeChange","onFilterClose","onFilterOpen","ErrorBoundary","fallBack","Scheduler","defaultDuration","presetPosition","onDataUpdated","onViewModeChange","onEdit","onCreate","reservationEditEvents","getFilters","MyListFilter","CalendarPageDefaultRedir","calendarPathUserProfileKey","defaultPathName","savedPathName","savedSearch","calendarPageDefaultPath","CalendarPagePaths","CalendarPage","viewStateSearchParams","parseViewState","searchParams","purlSearchParams","schedulerServices","selectedMultipleEvents","handleEdit","handleCreate","selectedEquipment","GetBooleanFilterOptions","BooleanPicker","hideAlert","useDialogAlertSlice","_log","errorInfo","TitleSection","ShortTitle","showCopy","setShowCopy","copied","setCopied","truncatedTitle","cliTruncate","iconSize","domNode","attribs","class","attributes","haidProject","group","combineMandatoryOfflineServices","RemainedSlots","MaxAttendees_NA","TrainingSessionPicker","PleaseSelectATRainingSession","ReservRelatedFilter","RemindBeforePicker","UserGroupsProviderTypes","tableRoot","filterPanel","tableButtonsLeftShort","divider","nonEmpty","singleValueToId","mapped","scrollablePanel","hidden","aria-labelledby","initValue","initids","getGetUserSelectionsAutocompleteFn","CustomFormUserSelection","selectRepetitive","selectRepetitiveData","selectRepetitiveFieldHandler","initSampleTypeData","SampleTypePicker","RegionLink","openRegion","useOpenRegionPopUp","initialModel","FormRadioGroup","submitCount","showError","touched","StyledFormControl","StyledFormLabel","StyledFormTitle","RadioGroup","StyledFormHelperText","FormLabel","CustomFormAnswerQuestions","QuizScore","Points","indexToAlpha","CustomFormCheckBox","CustomFormDate","CustomFormDisclimer","CustomFormEmail","CustomFormNumberText","CustomFormParagraph","FormParagraph","CustomFormPositiveNumberText","CustomFormRadioGroup","CustomFormRichText","CustomFormShortText","CustomFormField","CustomFormDisclaimer","CustomFormFileUpload","requireComponent","bookitlab","BookitLab","syncSchedulerEvents","_events","mappedEventIds","getState","min_date","max_date","mapfn","usePrevious","convertAuthToIUserFilterDto","SamplePlatePositionNamingTypes","CustomFormApi","customFormId","CustomFormContent","validationEnabled","sectionStyles","withTopSeparator","withBottomSeparator","isVisibleField","sortedActiveFormFields","styleSection","formName","formIsValid","setInitialValues","CustomFormControl","FormType","onLoadCompleted","onLoadStarted","originalFiles","setOriginalFiles","fetchCustomForm","loadValue","fieldId","InitFormFiles","resvalue","fetchFormValues","getFormValues","fetchFormState","fetchFormPromise","loadedValues","serializedvalues","vals","initServiceRequestStatusMultiData","ServiceRequestStatusMultiPicker","exclude","BillingActionsApi","insertBillingActionsDetails","updateBillingActionsDetails","deleteBillingActionsDetails","billingActionIds","getBillingActions","screen","getBillingActionById","billingActionId","getBillingActionInvoices","batchInvoiceIds","processEmailAction","billingActionsParams","invoiceIds","ProcessSftpUploadAction","processStatusAction","getRecipientsEmailAddresses","billingActionsRow","emailTypes","EmailRecipientTypes","ShowOn","specEmailAddresses","SpecificEmailAddresses","useReservationPermissions","IsAdminOrOwnerOf","PaymentMethods","DateLabel","ShouldCloseInvoice","FormRow","wrapOnMobile","shrinkClass","hideRow","selectSamplePlates","samplePlates","selectSamplePlatesData","selectSamplePlatesTableState","selectSamplePlatesCreate","selectBulkSamplePlatesCreate","selectSamplePlatesUpdate","DownloadFileButon","Error_FileNotAvailable","Download","TrainingActivationAllowedBySGAOnly","UpdateActiveTrainingWarningTitle","DeactivateTrainingMessage","ActivateButton","DeactivateTraining","Deactivate","FormInputFile","helper","fileInputProps","errorMesage","showPreview","saveFiles","TransformDate","ctx","isType","WorkOrderPicker","WorkOrdersCalibrationFilter","woTypeId","excludeIds","loadWorkOrders","FormRestrictedUserGroupPicker","StatusFilterId","IncludeStatus","EditableTable","getToggleAllRowsSelectedProps","getToggleRowSelectedProps","tableInstance","isSomeselected","handleExport","newPage","range","SamplePlatePositionsPicker","plateId","samplePlateId","loadDatax","plate","SamplePlateTypeRows","columnsCount","SamplePlateTypeColumns","SamplePlateTypeColumnsNaming","Alpha","fromCharCode","SamplePlateTypeRowsNaming","S2Value","TargetSamplePlatePositionsPicker","FormGradientPicker","EstimatedRuntimeMinutes","SampleOverhead","TotalOverhead","SecondaryEquipment","CreateSampleRunReservation","runDetails","save","setSave","formikRef","CreateReservation","InstrumentId","SecondaryInstrumentId","GradientId","srsid","getReservationDuration","handleCreateReservationButtonClick","DialogTitle","RunDetailsCreateReservation","SaveGradient_info","DialogContent","SampleRunGradient","DialogActions","totalMinutes","ImportSamplePlateForm","setFile","generatePlatesonImport","setGeneratePlatesonImport","handleFileChange","handleCheckboxChange","ImportRecords","ImportComponent","hideMessage","onDownloadTemplateButtonClick","GeneratePlatesOnImport","FormRoomPicker","FormLocationPicker","importStarted","importFinished","ImportTargetSamples","ExportForImportRunDetailsSamples","exportConfigurableColumns","samples_url","exportUrl","GetSelectedActions","validUpdate","Suffix","PopupSuffixComponent","handleSubmitk","AnalyticalSampleIDSuffix","AnalyticalSampleIDSuffix_info","Continue","AnalyticalSampleIDSuffixPopup","SuffixDialog","disableEscapeKeyDown","RUN_DETAILS_PAGE_PATH","RunDetailsPage","requestactions","instrument","secondaryInstrument","gradient","createdDate","acquision_type","showSuffixDialog","setShowSuffixDialog","samples","handleCompleteButtonClick","submitSuffixDialog","showCompleteDialog","runId","handleExportButtonClick","handleDownloadTemplateButtonClick","SampleId","TMT_Type","TMT_Label","SamplePlateId","UniquePlateNumber","PlatePosition","NumericalPlatePosition","charCodeAt","CellPositionToNumber","SamplePlatePicker","TargetSamplePlatePositionPicker","ExportForRobot","useConfigurableColumnsAdvanced","SampleRunsDetails","handleDownloadTemplateClick","DownloadTemplateRunDetailsSamples","hideImportButton","RunDetailsPageInstructions","ExportRunDetailsSamples","paddingX","EmailNotificationsApi","NOTIFICATIONS_LOG_PAGE_PATH","TTable","EmailNotificationsPage","withGlobalServiceGroupFilter","scopeOfMonth","DeleteEmailNotficationsMonth","EmailNotficationsScreenWarning","isMainAdmin","Timestamp","Recipient","RecipientName","EmailTo","EmailCc","EmailBcc","EmailMessage","Attachment","selectedRowActions","DeleteEmailNotificationsRows_info","DeleteRows","ConfirmDeleteEmailNotif_title","ConfirmDeleteEmailNotif_message","OK","postData","DeleteNotifications_success","DeleteNotifications_error","menu_EmailNotifications","WebkitBoxShadow","WebkitTextFillColor","caretColor","inputTypeSearch","forwardRef","inputComponent","Input","AdminActions","adminSettings","adminSettingsActions","ar","AssetsRelatedSetting","ButtonLink","StyledLink","GetResponseMessages","infoText","initProjectData","ProjectFilter","AllBudgets","initServiceTypeData","ServiceTypePicker","withServiceGroupFilter","UserDisciplinePicker","loadPublicData","UserDisciplinePublicPicker","BookitlabLogo","BookitlabLoginLogo","initInvoiceIdData","InvoiceIdMultiPicker","getQrUrl","urlTemplate","assetDetails","AssetBarcodeUrlTemplate","getAssetQrUrl","Handlebars","compile","getQrUrlH","generateLabel","labelXml","assetData","globalThis","dymo","framework","openLabelXml","objectMapping","getObjectMapping","objectName","writeData","splittedData","SubLocationName","setObjectText","staticObjectNames","getObjectNames","nameParts","assetPropertyName","properties","shift","Dymo","getPrinters","dymoLabelPrinterOption","printer","Device","initDymoFramework","getLabelWriterPrintersAsync","dymoPrinters","preview","labelType","blob","dataURItoBlob","Xml","download","Blob","getLabelXml","printParams","createLabelWriterPrintParamsXml","twinTurboRoll","TwinTurboRoll","errorDetails","dataURI","byteString","atob","mimeString","ab","ArrayBuffer","ia","Uint8Array","registerHelper","maxLength","fillString","padStart","DymoPrinter","Zebra","BrowserPrint","getLocalDevices","device_list","uid","noEscape","labels","zebra","Printer","stopWatching","send","getPrinterInterface","doGetPrinters","doGetLabelTypes","doGetObjects","doOpen","doPrint","labelPrintSaga","printers","DymoPrinterSupported","dymo_printers","getPrinters_Error","ZebraPrinterSupported","zebra_printers","serializablePayload","getPrinters_Success","labelTypes","getLabelTypes_Success","getLabelTypes_Error","loadObjects","assetResponse","roomResponse","locationlistsResponse","sublocationlistsResponse","samplePlatesResponse","consumableTypesResponse","getAssetDetails_Success","getAssetDetails_Failure","selectLabelPrint","getAssetDetails","getLabelTypes","DymoPrinterIsNotSupported","print_Error","ZebraPrinterIsNotSupported","printerInterface","RoomBarcodeUrlTemplate","LocationBarcodeUrlTemplate","SubLocationBarcodeUrlTemplate","SamplePlateBarcodeUrlTemplate","ConsumableTypeBarcodeUrlTemplate","QR","printAction","print_Success","printState","closeAssetLabelPrintDialog","selectedPrinter","selectedTemplate","download_Success","download_Error","preview_Success","preview_Error","labelPrintActions","useLabelPrintSlice","initTrainingLevelData","TrainingLevelPicker","TrainingLevelFilter","trainingLevelPermissionsEnabled","userPermissionsEnabled","eq","UseServiceGroupTrainingLevels","initAssetMultiData","AssetMultiFilter","AssetWorkOrderMultiFilter","LocationPickerFilter","objectFit","CustomerLogo","customerLink","setCustomerLink","customerImg","setCustomerImg","TopCustomerLogoLink","TopCustomerLogo","CompanyLogo","CampusPickerFilter","ExportQRCodesButton","ExportQR","initAreasData","AreasPicker","EmailType","EmailTypeUnionArray","titleStyles","titleContainer","titleBody","titleSubtitle","closeButton","BasicDialogTitle","disableTypography","BaseToggleButton","mainIcon","separated","ToggleButton","BaseToggleButtonGroupInner","otherOptions","toggleValue","setToggleValue","handleOtherChange","handleToggleValue","newViewType","ToggleButtonGroup","errorBorder","fullWidthButton","hasStartIcon","hasEndIcon","hasMainIcon","withTitle","Other","BaseToggleButtonGroup","filterRoot","scrollPaperCompact","useGlobalDOMEvents","keyup","Filters","PaperComponent","StyledDialogPaper","BackdropProps","invisible","clickAway","clickAwayFunc","AddReservation","serviceIdsRawValue","serviceIds","ServiceGroupsFilter","SuperGroupFilter","assetTagsUrl","publicAssetTagsUrl","initTagsData","intIds","strIds","TagsPicker","LoanTypeOptions","initLoanableData","LoanablePicker","initStatusData","StatusPicker","initLockersData","LockersPicker","SubLocationFilter","printtopdf","PrintToPDF","printPDFFisLoading","startPrinting","setStartPrinting","promiseResolveRef","handlePrint","useReactToPrint","documentTitle","printTitle","onAfterPrint","onBeforeGetContent","saveMarkedSections","StyledDiv","PrintToPDFPopup","preparing","AssemblyTypes","initAssemblyTypeData","AssemblyTypePicker","SceletonBox","allFiltersLength","loadBookableData","AvailabilityTypeBookablePicker","useRemoveSearch","useAsyncDebounce","Search","NewWorkOrderButton","loadingAsset","setLoadingAssets","useLocationChange","previus","bindPopover","getAssetIds","getEquipmentIds","fetchDownOrders","downOrders","setDownOrders","fetchOrdersState","fetchOrdersPromise","calendarLinkParams","calendarLink","alertslink","aid","downTime","BringBackUpOnWorkOrders","BringBackUpOnCalendar","bookMultiple","menu_WorkOrders","excludeFroExport","configurableColumnsExport","GetTargetColumns","columnsToRemove","ExcludeColumns","Popover","rootMobile","elevation","closeButtonTitle","BasicDialogContentWithTitle","titles","formContainer","MuiDialogContent","BasicDialog","dialogStyles","BasicDialogActions","BasicCheckBox","CardGrid","StyledToolbar","cp","doiId","tryGetDoiFromUrl","externalIdSourceType","linkURL","getSinglePaymentMethod","PaymentMethodEnumPicker","SamplePlatePositionPicker","SourceSamplePlatePositionPicker","onImportButtonClick","getSinglePriceSheetMethod","PriceSheetMethodPicker","SourceUrl","ServiceRequestsApi","UpdateStatuses","DeleteRequests","AddRequest","osid","purchaseOrder","updateAdminOnComment","DefaultFilter","DecimalRenderer","getSingleServiceTypeEnum","initServiceTypeEnumData","ServiceTypeEnumPicker","Workflow","Workflows","GetAvailableServiceTypes","DateField","DialogForm","FormContent","subTitle","AddChargeButton","singleAdminServiceGroup","ServiceGroupBudgetsAdmin","chargesProps","withoutGlobalServiceGroupFilter","initEquipmentsData","ReservationEquipmentsPicker","ReservationSingleEquipmentPicker","ReservationsEquipmentFilter","firstInitEquipments","mandatoryIds","FormReservationEquipmentsPicker","autoExpand","FormReservationStatusPicker","ReservationStatusPicker","ReservationCustomForm","customForms","customFormRef","mandatoryForms","optionalForms","isAsyncChangeLoading","selectedForms","formValuesForms","formId","BudgetListener","setUserGroup","initilized","setInitilized","UserNameListener","equipmentSettings","UserGroupListener","StartTimeListener","initialStart","initialEnd","changeHandler","prevStartTime","setPrevStartTime","prevEndTime","setPrevEndTime","isStartChanged","isEndChanged","prevEnd","EndTimeListener","setInitialized","newEnd","ChipCheckBoxGroup","isRow","ChipLabelGroup","FormChipCheckBoxGroup","setOnChanged","FormChipLabelGroup","ReservationOfflineServices","savedServices","savedServiceEditable","offActions","reservationSettings","hanleUpdateLocalServices","OfflineOptional","ServiceGroupServicesAllowed","fetchServiceType","sortFunc","ReservationOfflineServiceDefaultRemarks","servicesFiltered","responseDel","fetchAnyServices","potentialData","hasAnyServices","setHasAnyServices","fetchAnyServicesState","fetchAnyServicesPromise","AccompaniedServicesPicker","SingleAccompaniedServicesPicker","ReservationsAccServicesFilter","FormAccompaniedServicesPicker","CancelReservationButton","ApproveReservationButton","SaveForLaterButton","TransferButton","TerminateReservationButton","CreateTrainingButton","isLoaanDesc","onTerminate","settingActions","terminateProcessing","endUsageOfflineServiceIds","setEndUsageOfflineServiceIds","showConfirmEndUsage","setShowConfirmEndUsage","showEndUsage","setShowEndUsage","usageEndProcessing","setUsageEndProcessing","hasUsageProcessing","setHasUsageProcessing","HasUsage","OfflineServiceTypeIds","TerminateReservationMobile","TerminateReservationWithUsage","FormTrainingSessionPicker","budgetDtoFields","budgetExperimentDtoFields","getLoadData","getBudgetExperimentsValidForReservationPathInfo","getBudgetExpandClause","pp","userId","ReservationBudgetExperimentPicker","getDefaultBudgetExperiment","selectedExpirementId","FormReservationBudgetExperimentPicker","fetchDefaultBudgetExperimentState","fetchDefaultBudgetExperiment","setValueRef","serializedServices","deserializedServices","componentDidMount","BudgetTaskBudgetId","getReservationsLink","trainingSignUp","EditTrainingSessionLink","trainingSessionId","TrainingSignUpAdminAlertContent","attendees","getSessionSlots","Attendees","TrainingSessionsCountMessage","ManageSignUps","EditTrainingSession","trainingSesisonId","FormReservationTimePeriodPicker","StartTimePropertyName","startField","startMeta","EndTimePropertyName","endField","endMeta","endHelpers","getStoreValue","handleStartTimeChange","originalStartTime","originalEndTime","diff","adjustEndByStart","onStartTimeChange","handleEndTimeChange","onEndTimeChange","datePickerVariant","startTimeLabel","startTimeDisabled","endTimeLabel","endTimeDisabled","fetchAssemblies","sorted","Path","assembly","assemblyParts","EquipmentsDataAssemblies","reservedAssemblyParts","extendState","fetchAssembliesPromiseState","fetchAssembliesPromise","popperAnchor","equipmentsData","reservedAssemblyPart","RenderAssemblyParts","NoDataFound","PartsIncludedWithin","err_ErrorOccured","ReservationWorkOrders","onWorkTypeClick","refreshWorkOrders","equipmentIds","relatedAssets","relatedWorkOrders","workOrdersLink","workOrdersLinkTitle","ReservationAlertsLink","titleLink","StaffOnly_Icon","NoReservationAlerts","PleaseSelectAnAlertType","FormWorkFlowBooking","useWorkFlowPicker","entityVal","ReadOnlyDetails","DetailsWrapper","ReservationAdvancedDetails","LastUpdated","LastUpdatedBy","ReservationRequestDetails","relatedReservation","RequestWrapper","TotalRowsCount","TotalSamples","AssociatedRowsCount","SamplesAssociatedWithThisReservation","ReservationForm","repetitiveFormRef","onEquipmentClicked","onRestrictionsClick","onStatusChange","onOfflineServiceClick","editable","endTimeEnabled","waitingTransferApproval","transferToUser","terminationEnabled","transferForId","handleTerminate","allowEditMultipleEquipments","offlineServicesErrors","assistedTrainingData","allowOngoingModifications","requestedFor","equipmentChangeState","equipmentChangeCompleted","insertUpdateCompleted","savedForLater","durationErrors","setDurationErrors","permissionErrors","setPermissionErrors","prerequisitErrors","setPrerequisitErrors","customFormErrors","setCustomFormErrors","otherErrors","setOtherErrors","otherWarnings","setOtherWarnings","otherInfo","setOtherInfo","otherSuccess","setOtherSuccess","customFormOnlyPrinted","mandatoryServices","ParentName","resetAllErrors","currentFormFiles","originalFormFiles","reserValueKey","saveRequestedValue","addPrerquisitErrors","PrerequisiteTrainings","ErrorMessage","pre","AllRestrictions","per","prerquisitErrorsHandler","nodes","addDurationErrors","durationErrorsHandler","addOtheMessages","setMessage","otheMessagesHandler","addCustomFormErrors","customFormErrorsHandler","addPermissionsErrors","permissionsErrorsHandler","userGroupChanged","setUserGroupChanged","bookedbyChanged","setBookedByChanged","staffChanged","setStaffChanged","accServiceChanged","setAccServiceChanged","budgetChanged","setBudgetChanged","statusChanged","setStatusChanged","startTimeChanged","setStartTimeChanged","endTimeChanged","setEndTimeChanged","tutoringChanged","setTutoringChanged","optionalChanged","setOptionalChanged","trainingSessionChanged","setTrainingSessionChanged","setOriginalFormFiles","setCurrentFormFiles","setFirstInitEquipments","currentStatus","setCurrentStatus","isTrainingSignUp","setIsTrainingSignUp","userProfileVisible","tutoringVisible","tutoringEnabled","tutoringAllowed","forceTutoring","hasValidTraining","RequiresAdminApproval","trainingSessionVisible","workflowBookingVisible","workflowBookingEnabled","trainingSignUpVisible","staffVisible","reservationCollaboratorsVisible","staffRequired","warningMessages","AvailableInstrumentsMessage","ReservationPendingApproval","Approve","res_wrn_NewPendingReservation","RequireGroupCoordApprovalMessage","res_wrn_NewPendingCoordReservation","res_wrn_DraftReservation","MakeFirm","Transfer","ReservationTransferMessage","TrainingSessionsRes_warning","infoMessages","TutoringAssistedReservation","AssistedReservationsPendingApprovalInfo","TransferReservation","TransferredToDetailsMessage","CancelTransfer","resIdTransferredFrom","TakeOverTransfer","NotUsingThisReservation","TerminateReservationInfo","ReleaseUnusedTimeButton","session","ReservationSidePanelAssemblyPart_ErrorMessage","successMessages","ReservationAssistedApproved","equipmentsChangeHandler","selectedEqs","extendStaffMandatoryEquipment","staff","extendMandatoryEquipments","initStaffReservation","staffEquipmentId","accid","singleClick","ft","terminated","staffUser","initTrainingSession","trainingSessionData","setStaffEquipmentRestricted","staffUserName","err_res_StaffUserEquipmentRestricted","staffChangeHandler","StaffEquipmentId","setEquipments","staffEquipment","mand","alleqs","staffUserChangeHandler","multipleEquipmentsChangeHandler","getMandatoryOfflineServices","warn_TrainingSessionsTimeSlot","SignUp","trainingSessionChangeHandler","TrainerName","TrainingSessionData","DefaultBudget","validations","resultValidation","PermissionErrors","UserCanRequestApproval","err_MultipleEquipmentsWithAndWithoutAccServices","reservationSchema","err_OnlineServiceFieldRequired","AssemblyPartReservationCanNotBeUpdatedDirectly","HideExperiments","res_err_BudgetExperimentRequired","err_UserFieldRequired","_errStartTimeRequired","_errEndTimeRequired","err_EndTimeLowerThanStartTime","valueOf","OrderStatus","ExperimentEln","Experiment","Attendance","PartialAttendanceStartDuration","PartialAttendanceEndDuration","AccompaniedService","CollaboratorUsers","BudgetIsRequired","err_AccompaniedService_required","StaffUserRequired","err_WorkflowBookingRequired","prevProcessing","setPrevProcessing","handleFullDayReservationChange","fullDayReservation","currentPeriod","adjusted","adjustSchedulerEventTimes","partialReservationDetailsState","messageList","fieldDisabled","reservationCollaboratorsFilter","getReservationCollaboratorsFilter","staffUserPickerPredicates","warningNodes","infoNodes","successNodes","PleaseSelectAnAccompaniedService","rotate","AddingsMandatoryEquipments","AddingsOptionalEquipments","ReservationName_Desc","FullDayReservation_Description","SponsorDepartment_Desc","ReservationUser_Desc","IsDefault","StaffUser_Info","PleaseSelectStaffUser","CollaboratorUsers_Info","ReservationTrainingApproval_Desc","TrainingSignUp_info","RepetitiveControl","RepetitiveReservation","ReservationSampleRunId_Desc","ApproveTrainingRecords","handleApproveOnce","handleEditAssisted","appSetActions","existingTrainings","servicesWithoutTraining","TrainingRecordId","showPopupAccordingToSetting","NotShowPopup","showPopup","handleEditClick","equId","equIds","fatherId","rid","handleNweCreateClick","handleCreateTrainings","TrainingLevelId","trdata","TrainingsCreatedSuccessfully","TrainingsAlreadyExist","ApproveOnce","menu_EditUserTraining","CreateDetailedTraining","ApproveForGood","AssistedReservationApprovalOptions","This_user_already_has_a_valid_training","CreateNewTrainingRecord_YesNo","handleTransfer","transferAllowedToGroup","adGroup","budgetExpirementModuleEnabled","trnsferSubmitted","trasferToUser","setTranferToUser","TransferReservation_info","TransferToUser","ReservationModifications","Field","OldValue","NewValue","Done","ModificationsHistory","Period","CreditContainer","CalculatePricing","creditProcessing","creditCompleted","Pricing_EstimatedCost","PricingConfirmationLabelEditText1","PricingConfirmationLabelText1","Pricing_Balance","Pricing_BalanceResult","onCloseReservation","printActions","repetitiveValues","reservationProcessing","confirmAssisted","transferStepWaiting","transferUser","transferredForId","reservationNotFound","setPrint","printExpanded","setPrintExpanded","handlePrintToPDF","handleClosePrintToPDF","confirmBeforeTransfer","setShowTransfer","setConfirmBeforeTransfer","showConfirmRecurring","setShowConfirmRecurring","showConfirmAssisted","setShowConfirmAssisted","createTrainingOpen","setCreateTrainingOpen","showTransfer","showCalculateCredit","setShowCalculateCredit","confirmCloned","setConfirmCloned","canceled","setCanceled","openModifications","setOpenModifications","userReadOnly","allowSortenReservation","timeEnabledForOwner","timeEnabled","canBeCanceled","canBeApproved","canSaveForLater","reservationCanceled","calculateButtonVisible","not_restricted","noInstumentRestricted","confidential","workOrderSwithProps","eqids","cancelReservation","approveReservation","draftReservation","handleChangeStatus","setOfflineServicesErrors","handleSetError","AutoEndReservation_remarks","handleUpdateAllRecurrent","handleUpdateFollowing","Following","handleByApprovalConfirm","editAssisted","onTrainingClose","handleEquipmentClick","handleRestrictionsClick","restrictProps","handleOfflineServiceClick","otherProps","woProps","handleAddBatchClick","handleCalculateCredit","mactions","CancelReservation","ApproveReservation","CreateTraining","OfflineServicesError_info","CalculatePricing_info","res_SaveAndClone_info","SaveAndClone","CreateAndClone","relId","ShowRelatedReservations","PrintPdf","pageTitle","CloneReservation","menu_ReservationDetails","menu_NewReservation","ByApprovalAvailable","CancelMultipleReservations","UpdateMultipleReservations","WeeklyReservationConfirmationMessage","JustThisOne","CancelFollowing","UpdateFollowing","CancelAll","CloneReservationConfirm","Proceed","transfer","PricingConfirmationModalTitle","ByApprovalConfirmationModalTitle","ReservationConfirmByApproval","justifySelf","RestrictedNotAllowed","MinTimeAheadPeriodTypes","RestrictionsApi","TrainingStatus","PrerequisiteFor","UserOwnPermissions","onUserChange","permLoading","restrictedOption","handleUserChange","userIsAdmin","ShowRestrictionsFor","clearOnBlur","permRoot","Valid","contentRow","PermissionName","TimeSlotTypeName","TimeSlotTypeId","NoAdditionalRestrictionsFound","res_err_Permissions_StaffOnly","cardTitle","titleOverRule","rowTitle","rowText","cardActions","cardActionsButtons","restUrl","UserPermissionsApi","authuser","equipmentId","setEquipmentId","equipmentGroupId","setEquipmentGroupId","selectedService","setSelectedService","setSelectedUser","fetchRestrictions","restrictions","setRestriction","fetchRestrictionsState","fetchRestrictionsPromise","userRestrictions","setUserRestrictions","fetchUserRestrictions","username","fetchUserRestrictionsState","fetchUserRestrictionsPromise","fetchAsset","fetchAssetState","fetchAssetPromise","getStatus","validRender","PrerequisiteTrainingsIndicators","found","CoreWideRequirement","prerequisites","PrerequisiteEquipments","preq","usrrest","ImageName","userOnChange","assetOnChange","RenderContent","Permissions","Passed","Expired","PreApproved","PreApproved_info","MinReservationOrder","MaxReservationOrder","CarryOverTimeSlotTypeId","MinTimeAheadPeriodValue","MinTimeAheadMinutesSinceMidnight","MinimumTimeAhead","AdvancedReservation_info","ToBeBookedBy_info","Before","AdvancedReservation","MinTimeAheadPeriodType","OnTheSameDay","ToBeBookedBy","RestrictionsOverview","BypassQuotas","BypassQuotasForReservations","BypassUserQuotasAndGaps","BypassUserQuotasAndGapsD","BypassUserQuotasAndGapsD_Description","BypassUserQuotasAndGapsD_DescriptionCont","BypassMinResDurationD","BypassMinResDurationT","BypassMinResDurationD_DescriptionCont","AdditionalRestrictions","SpecificUserSlotPermissions_info","ReservationRestrictions","Prog4biz","BookitlabCopyrightNoticeTitle","SoftwareBy","SystemTime","TermsOfUse","CopyrightSection","Copyright","webVersion","lastUpdate","appOffset","appNow","setAppNow","interval","setInterval","clearInterval","align","disableVersionOnMobile","messagesState","selectMessages","selectMessagesAlreadyExist","useOpenReservationSidePanel","useMessageStyles","closeAllKey","pageToType","calendar","reservationStarted","usageReservation","secondaryPage","alreadyExists","hideIconVariant","preventDuplicate","maxSnack","MaxMessage","variantInfo","MessagesChildren","useSnackbar","enqueueSnackbar","closeSnackbar","useMessagesSlice","allMessages","clear","closeAllOptions","removableAnnouncment","gotIt","DashboardAnnouncement","CloseAll","GotIt","RenderMessge","Announcment","loadDesk","ReservationStartedMessage","AllUsagesEnded","InstrumentStillReservered","ReleaseUnusedReservation","YouHaveOngoingReservations","curr","ReservationStarted","UpdateOngoingReservations","UsageReservationMessage","IpRelay_reservationTimeForInstrument","IpRelay_LinkToUsage","CalendarMessage","LoanDeskMessage","ReservationStartedMessage_LoanDesk","WithSpace","Truncicated","getSize","parsed","moreTitle","MoreTitle","truncate","createElement","classList","innerText","appendChild","inner","innerHTML","parentNode","removeChild","MoreLink","MoreButton","TitleIfExists","MorePopUp","WebkitLineClamp","WebkitBoxOrient","BarcodeScanApi","sublocationId","doSetSelectedRoom","doSetSelectedLocation","doSetSelectedSubLocation","doSetNoRoomAccess","assetInventoryStateSaga","setSelectedRoom_Success","setSelectedLocation_Success","setSelectedSubLocation_Success","QRCodeBaseLength","minBarcodeAssetLengthString","MinAssetQRLength","setScanProcessing","scanManualBarcode_error","room","subLocation","Barcode","RoomDetails","scanManualBarcode_Success","roomResult","LocationListId","SubLocationDetails","roomSelected","setNoRoomAccess_error","setNoRoomAccess_success","setSelectedSubLocation","setSelectedLocation","setSelectedRoom","scanManualBarcode","setNoRoomAccess","setNoRoomAccessProcessing","setLogFilters","assetInventoryActions","useAssetInventorySlice","doeRefreshReservations","addReservations","addUsages","addLoanDesks","addCalendarMessages","doGotIt","messagesSaga","calendarUrl","func","funcs","getPageMessages","_action","reservationsInValue","_i","usagesInValue","LoanDeskInValue","LoanDesks","withNull","calendarInValue","calendars","refreshUsages","messagesActions","EndUsageOfflineServices","offlineIds","UsageOfflineServiceDefaultRemarks","titleVariant","setSelectedServices","setRemarks","setIds","setReset","setUsageData","confirmUsageEnd","setConfirmUsageEnd","usage","endUsageWithOffline","endUsageOfflineValid","ConfirmEndUsage_title","EndUsageConfirmTitle","EndUsageRoot","isProcessing","UsageEndOfflineService","ReasonRemarks","UsageEndRemarksPlaceholder","ConfirmServicesCorrectly","ConfirmEndUsage","ConfirmEndUsage_err","actionsStyles","rootMobileHorizontal","poperPaper","poperRoot","poperTitle","PopperTitle","poperTditle","RichTextEditor","HideCommentSharingForAllUsers","FormAdminUsersPicker","FormAdminSingleUsersPicker","applyForceFullDayReservations","forceFullDayReservations","truncatedEndTime","flow","partialRight","setItems","FilterChip","FilterDisplay","GetPresetDatesRangeDisplayString","getDisplay","setConfigurableColumns","loadConfigurableColumns","WrongColumnDefinition_info","fetchConfigState","getConfigurableColumns","setConfigurableColumnsExport","loadConfigurableColumnsExport","fetchExport","publicSub","redirUrl","ReturnUrl","handleExportForImportClick","handleExportForImport","rowsCallback","toBigQS","selectedRows","exportRows","MaxRecordsAllowedAssetImport","messageLongQS","err_ImportForExportFailed_longQS","deffMessage","err_ImportForExportFailed","showSingleExportButton","ExportButtonTooltip","ExportToXLSX","DownloadTemplate","allActions","ConfigurableColumnsLink","Columns","prevLocation","TabsWrapper","TabPanelWrapper","shrinkLabel","saveRepetitive","setInitData","RepetitiveData","buttonId","ImportRecordsDescription","ImportRecordsSteps","ToImportNewRecords","UploadTheUpdatedFile","patternOrChannel","keyfn","tasks","isKeyEmpty","task","InvoiceTemplatesApi","insertInvoiceTemplate","invoiceTemplate","HeaderFile","FooterFile","updateInvoiceTemplate","deleteInvoiceTemplates","invoiceTemplatesIds","getInvoiceTemplateById","ReferenceType","BasicDialogContent","StyledDialogContent","MainTicket","SummuryBox","ErrorsSummury","ArticlesExternalSearchPagePath","ArticlesExternalSearchPage","budgetExperimentsFilter","resStart","resEnd","BudgetExperimentsPicker","loadBudgetExperiments","FormBudgetExperimentsPicker","setUser","setBudget","forceDisabled","serviceSettings","selectedUserGroupo","selectedUserDto","setBudgetExperiment","serviceTypeEnum","fetchBudgetExperiment","budgetExperiments","budg","experiments","ConnectedFiltersForm","isChildEntry","ConnectedFiltersData","startLabelInline","endLabelInline","orderForConsumables","budgetPickerInfo","connectedData","userChanged","setUserChanged","budgetExpirementChanged","setBudgetExpirementChanged","ConnectedFiltersSchema","err_UserGroupRequired","reserFieldHandler","updateDataState","editAllowed","createUpdateAllowed","ConnectedFiltersControl","saveConnectedFilters","RegionsApi","doInitRegion","doCreateRegion","doUpdateRegion","regionsSaga","initRegion_Success","initRegion_Error","Region","createRegion_Success","createRegion_Error","updateRegion_Success","updateRegion_Error","initRegion","createRegion","updateRegion","resetRegionState","regionsActions","selectRegions","regions","selectRegionsProcessing","selectRegionsData","selectRegionsHasErrors","selectDetailsCompleted","regionData","regionSchema","RegionNameIsRequired","menu_EditRegion","menu_AddNewRegion","AddRegion","RegionName","PopupPrintToPDFDialog","boxcontainer","selectFileBox","infoBox","CheckBox","PopupPrintToPDFComponent","convertItemsToFlags","checkboxes","setCheckboxes","handleCheckboxChecked","static","ServiceRequestMilestoneStatusPicker","FormServiceRequestMilestoneStatusPicker","toDto","updateCharge","handleSubmitButtonClick","toInitialValues","AddMilestone","Milestone","serviceRequestMilestoneSchema","newStatus","oneOf","FormUnitTypeTypePicker","FormServiceRequestMilestoneChargeServicePicker","selectedType","setSelectedType","insertCharge","serviceRequestMilestoneId","initUnitTypeValue","addServiceSchema","handle","enableAddonCharge","enableManualCharge","ChargeTypeToggle","entityValue","ELEMENT_TAGS","A","getAttribute","BLOCKQUOTE","H5","H6","IMG","LI","OL","PRE","UL","MENTION","TABLE","TBODY","THEAD","TR","TD","TH","TEXT_TAGS","CODE","DEL","strikethrough","EM","I","S","STRONG","U","DATA","plain","deserialize","nodeType","textContent","jsx","child","deserializeHtmlString","htmlString","currentSring","DOMParser","parseFromString","serializeItemHtmlString","leaf","leafHtmlString","elementHtmlString","EMPTY_SLATE_NODE","serializeHtmlString","emptyValue","HOTKEYS","RichTextWithMentions","useCodeButton","renderElement","renderLeaf","editor","withImages","withTables","withHtml","withHistory","withReact","createEditor","setInitValue","setTarget","setIndex","setSearch","users","setUsers","mention","setMention","mentions","setMentions","showControlPanel","stringVal","isLabTech","isGroupAdmin","unmounted","Transforms","insertNodes","at","move","distance","prevIndex","nextIndex","rect","ReactEditor","toDOMRange","getBoundingClientRect","pageYOffset","pageXOffset","header","headerControls","textWithControls","textWithInfo","withTopLabel","showControls","showControlsWithTop","editorClass","editorBodyStyle","debounceValue","isCollapsed","edges","wordBefore","Editor","before","beforeRange","beforeText","beforeMatch","after","afterRange","afterMatch","newMentions","getMentions","onMentionsChange","anchor","focus","EnterAUser","spellCheck","hotkey","isHotkey","toggleMark","data-cy","char","isMarkActive","removeMark","addMark","MarkButton","useSlate","BlockButton","isBlockActive","toggleBlock","LIST_TYPES","isActive","isList","unwrapNodes","setNodes","wrapNodes","marks","StartRichEditor","isInline","isVoid","ReactDOM","createPortal","insertData","getData","insertImage","uri","fnRemoteImage","isImageUrl","isUrl","imageExtensions","deleteBackward","deleteForward","insertBreak","isEditor","SlateElement","isElement","cellPath","Point","fragment","insertFragment","Element","Leaf","ImageElement","useSelected","useFocused","TrStyled","TdStyled","Mention","withPointer","initials","defaultText","OfflineForm","connectedFiltersFormRef","connectedInit","serviceChangeState","quantityChanged","setQuantityChanged","DefaultExperiment","otherServiceSchema","LogDateTimeLabel","offlineService","creditProccessing","handleCalculateClose","topButtons","OfflineServiceCharges","refType","refId","EditOfflineServiceTitle","AddNewOfflineService","ConsumableLog","PricingConfirmationOfflineEditText1","PricingConfirmationOfflineText1","PaymentMethodPicker","checkboxProps","headerProps","checkIfRowIsSelectable","shouldSelectPage","checkIfAllSelectableRowsSelected","isSelected","isSelectPage","getToggleAllPageRowsSelectedProps","indeterminate","getConditionalSelectHeaderCheckboxProps","checkProps","getConditionalSelectColumnCheckboxProps","getToggleRowExpandedProps","ScreenToShowOn","initInstrumentCatData","InstrumentCatFilter","UserAssetContactMultiFilter","GetMessagesArray","DoAction1","Failed","DoAction","insertUserAD","BillingPreviewApi","FormView1_UpdateItem","PercentageRenderer","labelPrint","DateTimeRenderer","TruncatedLabel","ArticleLink","openArticle","useOpenArticlePopUp","DurationRenderer","totalSeconds","internalIdLogin","selectInternalIdLogin","selectInternalIdLoginUserId","selectInternalIdLoginUserName","selectLoginType","initCustomPicker","CustomPicker","selectPublicAsset","publicAsset","selectSelectedUnitItem","selectSelectedUnitSearch","selectedData","dataSearch","selectMenuOpen","menuOpen","ServiceTypeFilter","EmailApi","err_SendEmailToUserFailed","initServiceUserGroupData","AddToLists","getEquipments","setLoadingCompleted","hasUpdateError","updateAssets","CreateList","ListRenderer","localized","notLocalizedValue","onlyone","tooltipTitle","initReservationStatusData","NaN","PopupImportExportDialog","AutomaticAssetImportNaming","ImprotData","_ScreenId","needReloadTemplateColumns","_ImportAssetImageFiles","_AutoGenerateAssetNamesBasedOn","_UpdateQRCode","_ImportAdditionalData","File","Images","RowCount","AddOnly","book","Excel","Include","fi","hvalue","cn","tvalue","ExcelName","InitHeaderByTemplate","ValueType","Null","SharedString","Formula","RichText","Hyperlink","xlsx","ws","getWorksheet","rowCount","row1","getRow","eachCell","rc","tr","GetCellData","Papa","dynamicTyping","complete","LoadXlsx","LoadCsv","selectFileHandler","Init","TypePicker","AutomaticAssetImportNamingPicker","ByAssetCatModelNumber","ImageList","RemoveImage","removeImage","SelectImageFiles","importing","setImporting","setPaths","MaximumImagesPerOneUpload","MaxImageSize","MaxLoadedAssetImageMbSize","setImages","createObjectURL","AddImages","ClearImages","RecommendationsOfLoadImages","RecommendationsBodyOfLoadImages","InformationToLoadImages","LoadImages","ClearAll","selectImageBox","PopupImportExportStep1","filetype","setFiletype","fileIsSelected","setFileIsSelected","ImportAssetImageFiles","importAssetImageFiles","setImportAssetImageFiles","handleImportAssetImageFiles","handleFileTypeChange","AssetProperties","SelectFileBox","fileType","BulkImportTitle","ImportTenplateHandler","GetTheTemplate","InfoBox","nextName","cancelName","AutoGenerateAssetNamesBasedOn","autoGenerateAssetNamesBasedOn","setAutoGenerateAssetNamesBasedOn","UpdateQRCode","updateQRCode","setUpdateQRCode","app","showInternalCode","ImportAssetAutoNaming","handleImageChange","handleAutoNameingChange","handleUpdateQRCodeChange","ImportAssetAutoNaming_info","ImportAssetsUpdateQRcodes","ImportAssetsUpdateQRcodesInfo","SelectImageFilesBox","MaxFileSize","ImportFileType","DragTheImagesOrBrowse","AssetImgSupportedTypes","BulkCreateNewRecords","Bulk_CNR1","ExcelImportSpecificRequirements","Excel_ISR1","Excel_ISR2","CSVImportSpecificRequirements","CSV_ISR1","Buli_CNR2","UpdateExistingRecords","Update_ER1","Update_ER2","Update_ER3","PopupImportExportProgress","NamePicker","headerRow","StyledTableRow","HeaderColumn","setChecked","handleCheckChandge","HeaderColumnPicker","showPicker","setShowPicker","handleValueChandge","header1","header2","containerCenter","toggleBox","PopupImportExportStep3","toggle1","setToggle1","handleColumnCheckboxChange","handleColumnPickerChange","handleToggleChange1","ToggleBox","back","backName","toggle2","setToggle2","RecordsInTheFile","handleChange1","handleChange2","defaultChecked","FirstRowContainsColumnsName","UpdateAnyExistingRecords","UncheckColumnIfYouDontWantItToBeImported","OnlyFirst5RowsOfTheFileAreDisplayedForPreview","containerRows","rowData","RowData","PopupImportExportStep5","ImportSuccessfullyCompleted","NewRecordsImported","newRows","ExistingRecordsUpdated","existingRows","ErrorsDuringImport","handleDownloadImportErrorReport","DownloadImportErrorReport","DownloadDetailedImportResults","ImportCompletedWithErrors","failed","ImportHasFailed","ImportErrorFailedMessage","ImportAdditionalDetails","ImportBackToPage","PopupImportExport","budgetType","setStep","setColumns","importResult","setImportResult","resultData","setResultData","resultFileName","setResultFileName","setNewRows","setExistingRows","cancelFileUpload","cancelImport","LoadExcelfile","LoadTemplateColumns","cc","SetTemplateColumns","ColumnCount","GenericImport","importFileResult","ImportErrors","steps","Next","UploadingFile","CancelFileUpload","RowsFound","Back","ImportingData","CancelImport","ImportRowsFor","ImportColumns","initUserGroupMultiData","UserGroupMultiPicker","dosetSelectedItem","dosetSelectedItems","dosetAssetPublicFilters","publicAssetSaga","setSelectedItem_Success","setSelectedItems_Success","currValue","setAssetPublicFilters_success","setSelectedItem","setSelectedItems","setAssetPublicFilters","setMenuOpen","toggleMenuOpen","setGlobalSearchOpen","toggleGlobalSearchOpen","publicAssetActions","usePublicAssetSlice","InvoiceRowReferenceLinks","references","menu_UsageDetails","SubscriptionId","SubscriptionDetails","OfflineServiceId","PopupImport","downloadTemplateprocessing","setDownloadTemplateProcessing","TagsFilter","LoanableFilter","StatusFilter","LockersFilter","AssetTypesFilter","AreasFilter","OnlineServiceTypeFilter","AvailabilityTypeAvailableMultiFilter","AvailabilityTypeAvailableOnlineMultiFilter","InternalServiceRequestStatuses","TrainingStatePicker","TrainingStatePickerFilter","ReservationOrDowntimePicker","ReservationOrDowntimePickerFilter","WithReservationsOnlyFilter","ShowAll","WithEventsOnly_info","WithEventsOnly","pushReservationsOnlyFilter","Available","UnderMinimum","Maximum","SignedUp","getTrainingStatePickerFilter","getReservationOrDowntimePickerFilter","SamplePlateTypePicker","FormSamplePlateTypePicker","FormFieldsSection","FormLeftSection","pageDescription","dataErrors","setDataErrors","dataWarnings","setDataWarnings","dataSuccess","setDataSuccess","dataInfos","setDataInfos","colapsedMinHeight","handleCloseError","handleCloseWarning","handleCloseInfo","handleCloseSuccess","succ","propsValue","hasReservation","myReservationId","batchDeletable","removedBatch","setRemovedBatch","removeBatchOpen","setRemoveBatchOpen","DeleteBatchInventory_title","DeleteBatchInventory_message","Radio","RadioIconUnchecked","RadioIconChecked","initCatRateTypeData","bysSystemSetting","ImageRenderer","BaseURLMultiPicker","useServiceIdAction","hrefPath","ID","ServiceIdRenderer","OperationTypeIdRenderer","AssetImageRenderer","reservationsPrimaryAction","OtherServiceDetailsPage","queryProps","getParams","OtherServiceEditLink","ServiceFilter","arrayValue","arguments","prototype","excluded","sourceKeys","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","SvgChevronUp","_ref","svgRef","titleId","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","strokeWidth","strokeMiterlimit","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","_ref38","_ref39","_ref40","_ref41","_ref42","_ref43","_ref44","_ref45","strokeLinecap","strokeLinejoin","_ref46","_ref47","_ref48","_ref49","_ref50","_ref51","_ref52","_ref53","_ref54","_ref55","_ref56","_ref57","_ref58","_ref59","_ref60","_ref61","_ref62","_ref63","_ref64","_ref65","_ref66","_ref67","_ref68","_ref69","_ref70","_ref71","_ref72","SvgNotavailable","SvgNotAllowed","SvgIcon","ChevronUpIcon","NotAvailableSVG","htmlColor","NotAvailableIcon","NotAllowedSVG","NotAllowedIcon","initRoomTSData","RoomTSPicker","RoomTSFilter","initTrainingProgramMultiData","TrainingProgramsMultiPicker","applyGlobalServiceGroupFilter","TrainingProgramsMultiFilter","CustomDatePeriods","ShowOnlyWithAvailability","UpcomingSessionsOnly","ActiveSampleTypesPicker","RelevantBudgetPicker","selectedBudget","budgets","CreateNewRequest","chosenUser","setChosenUser","AffiliatedGroups","IsUserOwneGroup","chosenUserGroup","setChosenUserGroup","chosenFundingType","setFundingType","chosenPurchaseOrder","setPurchaseOrder","chosenBudget","setChosenBudget","setService","initActiveSampleTypesData","getServiceRequest","getService","showProject","ProjectIsRequired","purchaseOrderLength","purchaseOrderRequired","purchaseLengthInvalid","projectIsRequired","userGroupEnabled","userGroupRequired","onUserGroupChange","Requests_Created_Failure","Requests_Created_Success","propsSide","mt","RequiredLabServiceLabel","PleaseSelectUserGroup","PleaseSelectUser","FundingTypeRequired","Reservation_Error_ShortPurchaseOrderLength","Reservation_Error_PurchaseOrderRequired","ServiceRequests_Ordering","SidePanelRoot","SidePanelPopper","SidePanelPopup","sidePanelRootExpanded","sidePanelRootCollapsed","backdropOpen","rootopen","rootclose","mobileroot","modifiers","keepTogether","preventOverflow","boundariesElement","flip","getTermsOfUseAgreement","versionId","ExportToExcel","sheetName","sheet","addWorksheet","workBook","workSheet","addRow","columnNames","GetObjectNames","AddWorkSheetHeader","GetObjectValues","SetWorkSheetHeader","AddWorkSheetData","writeBuffer","buffer","InvoiceStatusPicker","OpenMenuButton","UserRenderer","ViewTypeLengthDropDown","onTypeLengthChange","lengthOptions","haideCalendarViewType","customTimelineDays","customCalendarDays","titletext","itemText","vt","subheader","vl","ExportToPDF","debouncedOnChange","newProps","Reflect","deleteProperty","Documents","menu_Documents","dash_EmptyWidgetTitle","dash_EmptyWidgetBody","LoadingFailed","FileName","FileNameRenderer","DocumentType","FileType","AvailableToUsers","StaffUsersFiles","StaffOnlyFiles","PublicFiles","Signups","TrainingStateRenderer","TrainingResource","DurationH","MinimumAttendance","MaximumAttendance","TotalUsedSlots","UsedSlotsRenderer","HashSymbol","HasNextSession","NextSession","ReservationLinkAction","asLinkRendered","TrainingSessions_Calendar_SignedUp","TrainingSessions_Calendar_UnderMinimum","TrainingSessions_Calendar_Maximum","TrainingSessions_Calendar_Available","iconsize","AllTrainingSessions","globalServiceGroupsFilter","newPredicates","externalPredicates","Articles","menu_AllWorkOrders","StyledScanView","BarcodeScannViewDescription","getAssetById","expandable","downloadImages","downUrl","scanBarcode","logNoRoomAccess","quizSubmissionId","fetchDataPromiseState","fetchDataPromise","backToQuizess","BackToQuizzes","Quiz","QuizzYourScoreIsXoutofY","Score","MaxScore","CongratulationsYouHavePassedTheQuiz","YouAreNowCertified","TrainingLevelName","Level","QuizSuccessTestMessage","SorryThisDidNotWorkSoWell","QuizFailureTestMessage","WorkOrderTypeStatusPicker","onlyNew","doGet","doExport","doBulkCreate","doDelete","doDeactivatePlates","doDeletePlates","getLoadDataParams","someResult","genratePlatesFromBulk","LastId","firstId","FirstId","log10","Prefix","plates","samplePlate","ParseResultBlob","jsonBlobSize","jsonBlobSizeText","jsonBlob","InsertedRows","UpdatedRows","Errors","SystemErrorMessage","testmsg","suppliersLabel","RequireSupplierExternalId","SupplierExternalId","notShowTitle","Created","LifeDate","InstrumentCat","OperationType","AssetCatName","AssetType2Counter","Overdue","DueToday","ShortDescriptionOfInstrument","AreaMapId","RoomMapId","CoreName","Raac","MainSpecRange","BrandCode","Rank","ExtraDDL8Value","GasSource","SGA_Public","UnderOriginalWarranty","WarrantyEndDateVisibleAllUsers","canview","EquipmentExperts","AssemblyParent","AssemblyChilds","BookAppVersion","BookAppVersionUpdateDate","LateTime","EarlyLeaveTime","EarlyStartAllowedMinutes","InstrumentType","LocationTracking","LocationUpdatedAt","Divisions","DivisionAssetId","RegionId","ServiceTypeEnumFilter","CloneEquipmentSettings","menu_CloneEquipmentSettings","AssetPickerFilter","DurationT","AccService","CancelledBefore","BudgetTaskName","BookedByRenderer","NumberOfUsages","LastModifiedAt","WorkflowBookingName","BudgetInternalId","RemainingDurationD","UserEmail","BudgetRemarks","UserGroupMail","DivisionDescription","BudgetFund","AssetInternalCode","AssetRoom","AssetDescription","AssetModel","AssetModelNumber","TotalReservations","BudgetInitialCost","BudgetLeader","BudgetExternalUpdatedAt","BudgetExternalEndDate","BudgetIsOnline","BudgetEndDate","BudgetStartDate","BudgetHideExperiments","BudgetSubsProfCostCenter","BudgetSubsProfProjectNumber","FacilityProject","AssetCampus","BudgetSubsProfActivity","PartialAttendanceDuration","AssetCategoryGroup","BudgetHardLimit","BudgetSoftLimit","BudgetAmount","AssetBuilding","ServiceActivityCode","AssetBrandCode","Month","WeekNumber","UserDiscipline","ServiceGroupAdminEmail","BudgetBudget","BudgetPercent","Charges","ReservationHistoryTable","addColumns","InvoiceBatchesCommentsRenderer","ipid","servicedate","be","ecid","po","factor","adg","HasBalanceOrEstimatedCharges","Company","InfiniteScroll","scrollableTarget","FrontendLayout_MainContent_ID","loader","JoinStatusEnum","RegionRenderer","EventContent","dhx_event_move","dhx_event_click","containerWidth","offsetTopHeight","formatSchedulerTime","formatSchedulerDateTime","EventHeader","TrainingSessionStatus","stateid","TrainingSessionEventConent","TrainingSessionEventHeader","TrainingSessionEventBody","ReservationStatusIcon","reservationStatus","ReservationEventConent","ReservationEventBody","columnGap","rowGap","OfflineEventConent","renderEvent","header_content","body_content","container_width","getBackgroundColor","topEventHeight","getSlotsFromEvent","scroll_hour","originalEvent","getEvent","RenderFC","eventType","RenderEvent","ReactDOMServer","HTMLReactParser","eithSlotsHeight","startHeight","defaultColor","prepareSchedulerSections","r1","groupByOption","currentIndex","groupAssemblyParts","chain","assetCat","mapServiceToSection","scheduler_services_collection_name","getServerListService","serverList","getServerList","scheduleServiceTemplate","mobileView","containerProps","scheduleServiceContainerClassName","scheduleServicePaddingMobile","scheduleServicePadding","scheduleServiceIdAttributeName","imageProps","scheduleImageClassName","labelTextProps","scheduleServiceLabelTextMobile","scheduleServiceLabelText","TimelineServiceContent","timelineEventsSortIteratee","compareFn","valueA","valueB","NoServices","NothingToShowForThisScheduler_Title","NothingToShowForThisScheduler_Message","eqStrict","fromEquals","strictEqual","eqArray","eqDependencies","ReadonlyArray","Record","EventTimelineContent","bodyContent","event_text","timeline_event_text","TooltipLine","lablel","TrainingSessionTooltip","statusTextLocalizationKey","statusTextKey","footerTextLocalizationKey","statusClickTextKey","MaxAttendees","CampusName","TrainingSignedUp","MinAttendees","TrainingSessions_Calendar_ClickToView","TrainingSessions_Calendar_ClickToSignUp","OfflineTooltip","user_name","ReservationTooltip","reservationHtml","reservationTooltipTemplate","stripHtml","DraftReservationStatus","ApprovedByStaff","tooltip_text","HIDE_TOOLTIP","TooltipElement","SchedulerEventTooltip","tooltipElementProps","GetSchedulerEventTooltipProps","tooltip_text_fn","currentPosition","forceUpdate","currentView","getView","_mark_now","deleteTempReservations","schedulerRef","deleteEvent","resetEventEdits","updateEvent","findParentTarget","selectors","closest","std","getElementSizes","sizes","_els","add_export_methods","getTimeline","mode","matrix","dpi","zoom","rtl","_export_html","_send_to_export","exportToPNG","exportToICal","_serialize_plain","exportToExcel","templates","xml_format","_serialize_columns","_plain_export_copy","$text","date_to_str","version","skin","_ajax_to_export","_create_hidden_form","firstChild","server","_hidden_export_form","_get_export_size","scales","A5","A4","A3","A2","A1","A0","dataX","cSize","initialSizes","smartRendering","timeline","smart_rendering","nav_height","xy","scroll_width","style_width","_obj","style_height","timeline_scrollable","timeline_smart_rendering","getInitialSizes","setExportSizes","setCurrentView","setInitialSizes","PrintSchedulerToPDF","NEW_EVENT_TEXT","zoomEnabled","schedulerContainer","hasCustomStart","compiledSchedulerReservationBodyTemplate","compiledSchedulerReservationTooltipTemplate","permissionsError","role_err_Permissions","DefaultDuration","restrictTimeSlots","WorkingHours","restrictDuration","durationType","durationAmount","transformedEvent","transformToSerializableEvent","useCustomCompareCallback","attachEvent","detachEvent","handleBeforeDrag","handleBeforeEventChange","is_new","new_end","newSlot","onEmptyClick","handleEmptyClick","containerClassName","action_data","getActionData","eventDate","truncateSeconds","new_event","addEvent","initSchedulerEvents","attachEventSettings","old_mode","old_date","prevViewState","currentViewState","x_size","x_length","qst","qet","offsetStart","weeks","getWeekDiff","x_start","adjustMonthTimelineLength","new_viewMode","new_date","event_bar_date","openToReport","alertType","initDate","addEventNow","DHTMLX","getSchedulerInstance","timeline_tab","calendar_tab","section_custom","all_timed","treetimeline","daytimeline","multiselect","configOptions","multi_day","details_on_create","details_on_dblclick","start_on_monday","CurrentLocale","tryGetStartOnMonday","edit_on_create","hour_date","mark_now","now_date","time_step","touch","touch_drag","delay_render","drag_event_body","check_limits","scale_width","scale_height","hour_size_px","min_event_height","parse_date","event_class","select_id","event_bar_text","week_scale_date","unit_scale_text","hour_scale","week_date_class","today","orderedServerListData","setServerList","schedulerSectionsGroupByField","y_unit","y_property","column_width","event_min_dy","createTimelineView","x_unit","x_date","x_step","second_scale","week_timeline_start","week_start","get_week_timeline_end","month_start","sharedSettings","property","unitsName","createUnitsView","_key","_label","_date","destructor","handleServiceLabelClick","handleSchedulerClick","serviceContainer","serviceIdAttributeValue","getServiceIdFromServiceClickEvent","dom","capture","stringifiedServices","parsedServices","updateCollection","updateServerList","nonWorkingHoursRef","getUnits","timeSpans","deleteMarkedTimespan","highlights","timeSpan","spanId","addMarkedTimespan","startdate","hourSet","hasMount","useDidUpdate","setRange","newStart","showProgress","showNoDataPlaceholder","hideCalData","getTitle","hight","dhx_cal_container","InvoiceTemplatePicker","doGetInvoice","InvoiceDetailsSaga","invoice","setInvoice","getInvoice","InvoiceDetailActions","useInvoiceDetailsSlice","selectNotFound","selectActiveFilters","selectInvoice","InvoiceComments","InvoiceInReview","notifActions","SentToReview","yup","InvoiceInReviewMessage","InvoiceDetailsUrl","ReviewApproved","InvoiceApprovedMsg","Reject","EnterInvoiceRejectReason","InvoiceRejectReasonPrefix","ReviewRejected","InvoiceRemarks","UpdatedOK","UpdateFailed","openChangeStatus","openChangeInvoiceTemplate","currency","ISOCurrencySymbol","InvoiceBalance","attrib","InvoiceTemplate","InvoiceTemplateId","LastSentToBilling","justify","InvoiceNotFound","hasSubRows","SampleTypeFilter","ShowZeroAmountRows","showZeroAmountRows","DetailsTable","OpenEditRow","appsettings","openEdit","BudgetCat","BudgetCats","InstrumentsAndServices","Task","EquipmentService","Mixed","TimeSlotType","SubsProfPercentage","SubsidyProfit","RelevantToManualCharges","InsertedByDisplay","EditInvoiceLine","RowActions","DeletInvoiceRows","ConfirmDeleting","deleteInvoiceConfirmMessage","toggleAll","InvoicePaid","EditBudgetInvoiceRows","EditBudgetInvoiceRows_info","Change","ReferenceId","SubscriptionName","setIsGrouped","InvoiceCharges","menu_InvoiceCharges","GroupByReferenceDescription","DoNotGroupByReference","GroupByReference","InvoiceHistory","History","PayHistory","InvoiceRowId","PaymentTable","openEditPayment","EditInvoicePayment","PaymentDeleteConfirm","PaymentsDelete_success","PaymentsDelete_err","menu_InvoicePayments","RowHistory","deleteInvoiceOpen","setDeleteInvoiceOpen","allowedFees","AllowedFeeTypes","isChargesAllowed","pagelink","setfilterCallback","invoiceHistoryOpen","setInvoiceHistoryOpen","rowHistoryOpen","setRowHistoryOpen","payHistoryOpen","setPayHistoryOpen","updateStatusOpen","setUpdateStatusOpen","updateInvoiceTemplateOpen","setUpdateInvoiceTemplateOpen","updateInvoiceIdsOpen","setUpdateInvoiceIdsOpen","openNewCharge","chargProps","openNewPayment","paymentProps","deletable","setNewStatus","setInvoiceTemplate","setInvoiceIds","deleteInvoice","invoiceTemplateId","AddACharge","EditInvoiceStatus","EditInvoiceTemplate","CantDeleteInvoice","InvoiceRowsHistory","Preview","invoiceIdEntity","paymentPageActions","PaymentModificationsHistory","PayId","disableEnforceFocus","UpdateInvoiceStatus","UpdateInvoiceTemplate","handlePreview","InvoiceDeleteConfirmationMessage","ReopenOrderButton","DeleteOrderButton","FormWorkOrderTypePicker","FormWorkOrderTypeStatusPicker","FormRemindBeforePicker","SymptomCodesPicker","FormSymptomCodesPicker","RepairCodesPicker","AssetCatIds","ac","FormRepairCodesPicker","initReasonTypeData","ReasonTypePicker","FormReasonTypePicker","CreationDetails","WorkOrderAdvancedDetails","ReportedByDisplayName","ReportedDate","EventTypeStatus","ClosedAt","DoneDate","WorkStillInProgress","ClosedBy","DoneBy","FormUnlimitedDowntime","UnlimitedDowntime","EndDowntime","CustomFormPicker","FormCustomFormPicker","WorkOrderComments","onNewCommmentAdded","onCommmentsReady","isUploading","formSubmitted","setFormSubitted","isInner","AddCalibrationWorkOrder","workOrederIds","workOrederTypeId","saveLinkedOrders","setAsset","setWorkOrder","workOrderType","setWorkOrderType","fetchWorkOrderType","woId","handleWorkTypeChange","handleWorkOrderChange","LinkWorkOrder","AddCalibrationReference","PleaseSelectACalibration","HoverLinkedItem","linked","useHoverButton","onHoverClick","hoverIcon","HoverLinkedItems","onItemClcik","Linked","getLength","WorkOrderLinks","links","countLinks","LinkedWorkOrders","Collapse","unmountOnExit","WorkOrderForm","handleTypeChange","workOrderTypeFormRef","workOrderStaffFormRef","readonlyDetails","canView","onAssetClicked","setWorkOrderOfflineStartChangedValue","setWorkOrderOfflineEndChangedValue","onLinkedClick","bringUp","overlaps","unlimitedDowntime","setUnlimitedDowntime","typeChanged","setTypeChanged","downTimeChanged","setDownTimeChanged","remindBeforeChanged","setRemindBeforeChanged","setOriginalSubFormFiles","setOriginalStaffFormFiles","linkedWorkOrders","Links","workOrderSchema","err_AssetRequired","errEvent_Type_Required","typeError","AlertName","err_AlertNameRequired","errEvent_Type_Status_Required","EventDueDate","err_EventDueDateRequired","AlertStartTimeLabel","OfflineEventStartLabel","check","OfflineEventStartRequired","OfflineEventEndLabel","err_DownTimeEndGreaterThenStart","getWorkOrdersShema","DefaultSubject","DowntimeReasonTypeId","DowntimeDuration","DefaultRemaindBefore","remb","assignee","AssignedToCreator","changeLinkedOrders","orders","addedOrders","removedOrders","removeCalibrationOrder","addCalibrationOrder","handleOfflineEventStartChange","handleOfflineEventEndChange","InstrumentHasOverlappingDowntimeEvents","ShowAllDowntimeEventsOn","isInitialValid","LockedClosedRecord","EventDetails","PleaseSelectAnAssigneeUser","PleaseSelectAnAlertTypeStatus","ReportSymptoms","PleaseSelectAnAlertSymptomCode","RepairCodesEnabled","PleaseSelectAnAlertRepairCode","EventDueDateTimeLabel","RemindMeBefore_Description","PleaseSelectAReasonType","OfflineRemarksPlaceholder","SubmissionFormDetails","StaffFilledForm","PleaseSelectCustomForm","continueTo","sendOfflineEmail","sendOfflineProcessing","sendOfflineData","sendEmailCompleted","hasCreateProcessing","hasUpdateUpdateProcessing","hasCreateError","showDeleteRecurring","setShowDeleteRecurring","showSendEmail","setShowSendEmail","showCloseStatus","setShowCloseStatus","closedStatus","setClosedStatus","radioNotifyUsersValue","setRadioNotifyUsersValue","radioCancelAffectedReservationsValue","setRadioCancelAffectedReservationsValue","workOrderOfflineStartChangedValue","workOrderOfflineEndChangedValue","isCloseWorkOrderClicked","setIsCloseWorkOrderClicked","hasProcessing","IsAllInstrumentEventsGroupPermissions","viewPermissions","typeName","setTypeName","newCommentIds","reservationSwithProps","commentsReady","setCommentsReady","onCommentsReady","createValue","setCreateValue","subFormFiles","orderType","handleDeleteOrder","OnlyMainOrResourceWorkOrdersAdminCanDeleteCalibrationRecords","handleSendEmailClick","handleCancelSend","handleCloseOrder","handleOpenOrder","handleDeleteClick","handleDeleteAllNext","CloseIncident","CloseEvent","ReopenIncident","ReopenEvent","DeleteIncident","DeleteEvent","SendCustomEmail_short","SendCustomEmail","ViewCalendar_short","ViewCalendar","ShowAllRecurringEvents","notifyUsersRadioGroupOptions","Info","JustBookedUsers","AllAffectedUsers","AllAffectedUsers_info","cancelAffectedReservationsRadioGroupOptions","menu_AddNewWorkOrder","Add","WorkOrderRestrictedNotAllowed","UpdateDowntimeAdditionalActions","CreateDowntimeAdditionalActions","TheDowntimePeriodHasChangedNotifyUsers","NotifyUsers","isChangedStartDowntimeShorter","isChangedEndDowntimeShorter","isChangedDowntimeShorter","CancelAffectedReservations","UpdateDowntime","CreateDowntime","UpdateRecurringEventsTitle","EventRepeatConfirmationMessage","UpdateAllRecurringEvents","DeleteRecurringEvents","DeleteAllRecurringEvents","DeleteAllFutureRecurringEvents","YouAreClosingCalibrationRecord","RecordWillBeNotEditableAfterClosing","getSingleScreenToShowOn","ScreenToShowOnPicker","getSingleInvoiceStatusWithStaticOptions","InvoiceStatusWithStaticOptionsPicker","ConvertModelToEntityBillingActionsDetails","OperationName","IsSendEmail","IsSftpUpload","EmailAttachmentTypes","ChangeStatusTo","GeneratePayment","ConvertEntityToModelBillingActionsDetails","billingActionsDetailsSaga","initBillingActionsDetails_Success","initBillingActionsDetails_Error","initUpdateBillingActionsDetails_Success","initUpdateBillingActionsDetails_Error","createBillingActionsDetails_Success","createBillingActionsDetails_Error","BillingActionsPageName","updateBillingActionsDetails_Success","updateBillingActionsDetails_Error","initBillingActionsDetails","initUpdateBillingActionsDetails","createBillingActionsDetails","resetUpdateBillingActionsDetailsState","resetCreateBillingActionsDetailsState","billingActionsDetailsActions","selectBillingActionsDetails","billingActionsDetail","selectCreateBillingActionsDetails","selectCreateBillingActionsDetailsCompleted","selectUpdateBillingActionsDetails","selectUpdateBillingActionsDetailsCompleted","selectBillingActionsDetailsProcessing","EATBaseURLMultiPicker","EmailAttachmentTypePicker","FormEmailAttachmentTypePicker","FormInvoiceStatusPicker","FormScreenToShowOnPicker","FormPaymentMethodEnumPicker","ERTBaseURLMultiPicker","EmailRecipientTypesPicker","FormEmailRecipientTypesPicker","BillingActionsForm","isSftpEnabled","SAP_SFTP","budgetFieldFundingTypeEnabled","IsSendEmailChanged","setIsSendEmailChanged","IsSftpUploadChanged","setIsSftpUploadChanged","isMultipleEmails","billingActionsDetailsSchema","err_OperationNameRequired","err_ShowOn","FundingTypeIsRequired","BillingActionDetails","err_OperationNameUnique","AllInvoiceStatuses","EnterEmailsSeparatedByCommaWithoutSpaces","BillingActionsDetails","menu_EditAction","menu_AddNewAction","EditAction","AddNewAction","hasOwnedGroups","OnlyMyCores","onlyMyCores","ownedbyme","PermissionLevelPicker","FormPermissionLevelPicker","TimeSlotTypePicker","FormTimeSlotTypePicker","FormUserGroupsPicker","UpdateGroupPermissionsForm","AdGroups","PermissionLevel","err_SelectPermissionLevelException","err_TimeSlotTypeRequired","SetPermissionsOnSelectedServiceGroups","UpdateUserGroupPermissions","updtPermissionOpen","setUpdtPermissionOpen","submitted","setSubmitted","updatePermission","PermissionLevelId","CreateUpdateGroupPermissions","SetPermissions","CoreSelectionTable","updtFirstLogin","updtOptOut","redirectToDash","optOutCoreSelection","serviceGroupActions","savedServiceGroups","setOnlyMyCores","tabNumber","setTubNumber","showImportConfirm","setShowImportConfirm","userHelp","Help_ServiceGroupRegistration","multiCoresSelectionMode","setMultiCoresselectionMode","skipCoreSelectionScreen","SkipCoreSelectionScreen","setSelectedRowIds","loacalServiceGroups","setLoacalServiceGroups","showMyCoresOptions","handleRemoveGroup","oldGroups","handleRowsServiceGroupsChange","handleServiceGroupsChange","handleSingleGroupChange","onSelectChange","canSwitch","OnSelectNotRegisteredCore_error","primaryMultipleAction","cols","OwnedByMe","AdminEmail","OnlineServicesCount","OfflineServicesCount","RequestTypesCount","LimitServiceGroupLicenses","ServiceGroupAdminsLimit","AdminsTotal","LabTechsLimit","LabTechTotal","DeSelectServiceGroup","SelectServiceGroup","ViewServiceGroupDetails","_selectedRows","_rows","_onRefresh","_toggleAll","toggleSingle","DeleteSelectedCard_info","tabLeftActions","Tab","AllCores","_count","MyCores","tabRightActions","DontShowThisAgain","_ev","CoreSelectionOptOut_info","selectedBulkActions","DeleteSelectedGroups","SelectedServiceGroupsWillBeDeleted","err_ServiceGroupCanNotBeDeleted","DeactivateServiceGroup","ConfirmDeactivate","err_ServiceGroupCanNotBeDeactivated","allowedToUseBulkActions","acts","CreateNew","SelectDeffServiceGroups","CoresTabSetting","adds","ImportHandler","handleImportClose","menu_CoreSelection","Rejected","_toggleAllRowsSelected","selectCoreSelection","coreSelection","selectCoreSelectionFilters","noDashboardRedirectByClick","NoDashboardRedirectOnCoreSelection","isFirstLogin","updateIsFirstLogin","OptOutCoreSelection","updateIsOptOut","Private","CheckBoxGroup","labelPlacement","FormCheckBoxGroup","EveryDaysPicker","FormEveryDaysPicker","RepeatMonthlyByPicker","FormRepeatMonthlyByPicker","RepeatPeriodPicker","FormRepeatPeriodPicker","RepetitiveOptionsPicker","withParamsFilter","FormRepetitiveOptionsPicker","RepetitiveSchema","Until","err_RepeatUntilDateLessThanStart","err_AlertInvalidRecurringUntilDate","err_PepeatsOnDaysRequired","RepetitiveForm","recurringChanged","setRecurringChanged","repeatPeriodChanged","setRepeatPeriodChanged","repeatEndChanged","setRepeatEndChanged","leftSideSections","RepeatsEvery","UserTrainingApi","trainings","approve","ur","AllowBookingFromTrainingDate","ExpiredDate","MustOrderEveryDays","MustUseEveryDays","TrainerId","TrainingDate","TrainingLevel","UnhideServiceGroup","TrainingProgramId","TrainingProgramName","duUpdateTraining","doApproveRejectReservations","doActivate","trainingSaga","initCreateTraining_Success","initCreateTraining_Error","initUpdateTraining_Success","initUpdateTraining_Error","trainingsResponse","createTraining_Success","createTraining_Error","updateTraining_Success","updateTraining_Error","approveRejectReservations_success","approveRejectReservations_error","activateDeactivateTraining_success","activate","activateDeactivateTraining_error","initCreateTraining","initUpdateTraining","updateTraining","approveRejectReservations","activateDeactivateTraining","reservationsUpdateState","showApproveReservations","showRejectReservations","ApproveRejectRecords","ShowApproveReservationsMessage","ShowReviseToPendingMessage","resetCreateTrainingState","resetReservationsState","resetUpdateTrainingState","ReservationStart","ReservationEnd","setReservationsUpdateState","trainingActions","selectTraining","selectInitTrainingProcessing","selectCreateTraining","selectUpdateTraining","selectCreateTrainingCompleted","selectUpdateTrainingCompleted","selectCreateTrainingHasError","selectUpdateTrainingHasError","selectShowApproveReservatiions","selectShowRejectReservatiions","selectReservatiionsData","selectReservatiionsProcessing","selectReservatiionsUpdateCompleted","formatName","TrainingResevationsPicker","trainingDate","tDate","strDate","FormTrainingReservationsPicker","FormTrainingLevelPicker","UserTrainingComments","UserTrainingForm","TrainingLevelPermissions","usersShema","equipmentShema","err_UserNameRequired","ServiceType_Online","err_TrainingDateFieldRequired","err_TrainerIsRequired","activeDisabled","resDisbaled","setResDisbaled","allowBookingDisbaled","setAllowBookingDisbaled","setAllowBookingVisible","setEquipmentChanged","trDateChanged","setTrDateChanged","trLevelChanged","setTrLevelChanged","handleEquipmentChange","handleTrDateChange","handleTrLevelChange","ExpiredDays","UserTrainingTopMessage","NotActive","UserTraining_EquipmentInfo","UserTraining_UserInfo","UsersPlaceholder","DateOfTraining","LevelAchieved","TrainingLevelPlaceholder","TrainerPlaceholder","LinkedReservation","SelectLinkedReservation","TrainingRestrictions","TrainingExpiration","User_ExpiredDate_Description","User_MustOrderEveryDays_Description","EnterNumberOfDays","User_MustUseEveryDays_Description","HideInstrumentsFromUntrainedUsers","UnhideServiceGroup_Description","AllowBookingFromNow","showApprove","setShowApprove","showReject","setShowReject","approveReservations","rejectReservations","relatedReservations","updateResCompleted","editTraining","currenTrainingServiceGroupId","activateAllowed","handleActivateTraining","handleReject","handleApprove","handleResCancel","ActivateTraining","UserTrainingModificationHistory","menu_UserTraining","menu_AddNewUserTraining","RejectAllReservations","UserTraining_ReviseReservations","RejectAll","ApproveAllReservations","UserTraining_ApproveReservations","ApproveAll","FiltersComponent","MultiToggle","ToggleMultipleInstruments_info","onchange","FullScreenButton","OpenInFullScreen","FullScreenSchedulerButton","CalendarDatePicker","views","openTo","TimelineGroupByPicker","GroupReservationBy","GroupByAssemblyPartTimeline_info","showPeriodPicker","multipleMode","intervalRefreshingCalendar","IntervalRefreshingCalendar","calendarOnly","configuredRefreshInterval","refreshIntervalNumber","refreshInterval","useRefreshInterval","moveToDate","customDiff","addDateFn","lengths","EquipmentAssembliesEnabled","TimelineGroupByEnumsArray","secondaryPageActions","calendarActions","primaryPageActions","withoutHeader","otherControls","periodControls","Previous","Today","viewTypeControls","PriceSheetApi","doCreatePeriod","doUpdatePeriod","pricePeriodSaga","menu_PriceSheetPeriod","initialPeriod","createPeriod_Success","createPeriod_Error","updatedPeriod","updatePeriod_Success","updatePeriod_Error","updatePeriod","pricePeriodActions","selectPricePeriod","pricePeriod","selectDetails","selectDetailsHasError","FormPriceSheetMethodPicker","PricePeriodsForm","globalPriceSheetEnabled","priceEnabled","serviceGroupChanged","setServiceGroupChanged","startChanged","setStartChanged","endChanged","setEndChanged","pricPeriodsSchema","PriceSheetMethod","err_ServiceGroupRequired","err_PriceSheetMethod_isrequired","PricePeriodDetails","PriceSheetMethod_info","GlobalPriceSheetPeriods","priceSheetByEnabled","priceSheetBy","fullAdmin","PriceSheets","OpenPriceSheetInfo","periodId","gName","priceBy","EditPriceSheetPeriod","AddPriceSheetPeriod","PricePeriod","AddPricePeriod","ConvertModelToEntityCalendarMessagesDetails","PlantDate","DisplaySeconds","ConvertEntityToModelCalendarMessagesDetails","CalendarMessagesApi","calendarMessagesDetailsSaga","initCalendarMessagesDetails_Success","initCalendarMessagesDetails_Error","initUpdateCalendarMessagesDetails_Success","initUpdateCalendarMessagesDetails_Error","menu_CalendarMessages","createCalendarMessagesDetails_Success","createCalendarMessagesDetails_Error","updateCalendarMessagesDetails_Success","updateCalendarMessagesDetails_Error","initCalendarMessagesDetails","initUpdateCalendarMessagesDetails","createCalendarMessagesDetails","updateCalendarMessagesDetails","resetUpdateCalendarMessagesDetailsState","resetCreateCalendarMessagesDetailsState","calendarMessagesDetailsActions","selectCalendarMessagesDetails","calendarMessagesDetail","selectCreateCalendarMessagesDetails","selectCreateCalendarMessagesDetailsCompleted","selectUpdateCalendarMessagesDetails","selectUpdateCalendarMessagesDetailsCompleted","selectCalendarMessagesDetailsProcessing","CalendarMessagesForm","initValues","IsServiceGroupChanged","setIsServiceGroupChanged","IsEquipmentChanged","setIsEquipmentChanged","calendarMessagesDetailsSchema","Laboratory","Group","getDisabledInfo","AllServiceGroups","Announcement","AddNewAnnouncement","myAssetsDefaultFilters","AdvancedAssetSearchFilterAttributes","CreatedSince","ActiveAssets","Areas","LocationList","SubLocationsList","LocationNotUpdatedSince","ResourceServiceType","ShowAssemblyParts","UsageStatus","RangeWeight","RangekN","RangeTemperature","RangeArea","RangeVolume","RangeAmount","AssetsSelectionTable","primaryMultiAction","multiModeDisabled","useRecentAssets","RecentAssets","isShortView","emptyTable","canExportAssetRanges","POnumber","AssetAccessories","Contacts","Experts","Suppliers","ShortDescription","multiAssetSelectionMode","setMultiAssetSelectionMode","setCurrentMode","currentModeRef","loacalAssets","setLoacalAssets","localAssetsRef","getMyListFilter","selectedRws","selectedRowDefaultActions","isShowAllCores","handleRowsChange","handleSingleChange","oldAssets","AssetSearch","selectAssetsSelection","assetsSelection","selectAssetsSelectionFilters","RecentContent","collapseOpen","setCollapseOpen","fetchRecentAssets","recentAssets","setRecentAssets","fetchRecentAssetsState","fetchRecentAssetsPromise","recentShort","requestTypeIds","appSettingsAction","openRequest","setOpenRequest","requestId","setRequestId","selectedAssets","setSelectedAssets","schedActions","AssetCatGroupId","createOffline","addTrainingSession","startUsage","useAddNewActions","allowMultiToggle","allowAllCoresToggle","availabilityTypesArray","SelectConsumables","CreateRequest","CreateAWorkOrder","AddTrainingSession","InstrumentAssetSearch","noTableData","NoConsumablesHeadTitle","NoConsumablesTitle","primaryRecentAction","notAvailable","handleSearchAllCores","SearchAllCores","menu_MyInstrumentsAssets","Statuses","initLogStatusesData","BarcodeLogStatusPicker","BarcodeLogStatusFilter","AllStatuses","hideRoomFloor","HideRoomFloorTextBoxes","EntryDate","fromInitPreset","FloorName","ShowBarcodesWithoutAssetsOrRooms","InventoryLogTable","defaultFilter","BarCode","BarcodeScanLog","menu_AssetInventoryLog","defaultFilterSearch","dateFilter","SavedViewForm","viewOnly","ExtraData","savedViewSchema","err_SavedViewNameRequired","SavedViewName","err_savedViewAssetRequired","SavedViewAssets","SavedViewShared","SavedViewBookMultiple","getsavedViewSchema","TimesUsed","SavedViewAssetsPlaceholder","SavedViewBookMultiple_info","extraData","isServiceGroupAdmin","useView","notShown","BookableAsset","TakeDown","useLeftTopActions","menu_EditSavedView","menu_AddNewSavedView","PopUpListItems","invoiceTemplateRightSection","BillingAddress_info","BudgetActivityCode_info","BudgetCostCenter_info","BudgetExtraTextField1_info","BudgetExtraTextField2_info","BudgetExtraTextField3_info","BudgetExtraTextField4_info","BudgetExtraTextField5_info","BudgetProjectCode_info","BudgetProjectName_info","CoreCostCenter_info","CreditCode_info","InvoiceBalance_info","InvoiceCore_info","InvoiceCurrency_info","InvoiceCustomerEHF_info","InvoiceCustomerRef_info","InvoiceDate_info","InvoiceDepartment_info","InvoiceFromDate_info","InvoiceId_info","InvoiceInstitute_info","InvoiceInstituteType_info","InvoiceIdLink_info","InvoiceProcessedUser_info","InvoiceProcessedUserEmail_info","InvoiceProcessedUserGroup_info","InvoiceProcessedUserMobile_info","InvoiceProcessedUserPhone_info","InvoiceProjectNumber_info","InvoiceRemarks_info","ConfigureColumns","InvoiceLetters","InvoiceSummaryTable_info","InvoiceSummarServicesTable_info","InvoiceSummury_BudgetUserService_info","InvoiceSummaryByInvoiceRowsNonGrouped","InvoiceToDate_info","InvoiceTotalCost_info","InvoiceAdGroup_info","InvoiceUserGroupEmail_info","InvoiceVAT_template_info","BudgetInvoicingRemarks_info","LastRequestID_info","LetterDate_info","ProjectActivity_info","ProjectNumber_info","InvoiceUserGroup_info","HtmlTextBox","formikValues","Html","textBoxValue","setTextBoxValue","OnUpdate","invoiceTemplateHtmlTextBox","InvoiceTemplateHtmlSource","FormColorPicker","PreviewButton","handleInvoiceIdChange","InvoiceTemplatePopUpLink","TableHeaderColor","TableBodyColor","HeaderFileName","FooterFileName","testHex","InvoiceTemplatePopUpSchema","OnSubmit","invoiceTemplateHtml","valueToReplace","patrn","originalValue","html_replace","InvoiceTemplateUpdateSuccess","InvoiceTemplateAddedSuccessfully","leftSectionH6Image","rightSectionH5Title","InvoiceTemplateForm","classname","TemplateName","AllFundingTypes","uploadLabel","TemplateHeaderImage","ModifyInvoiceLetterTemplateHere","TemplateFooterImage","InvoiceLetterTableHeadColor","InvoiceLetterTableHeadColor_info","InvoiceLetterTableBodyColor","InvoiceLetterTableBodyColor_info","ReservedWordsForInvoiceLetterTemplateMsg","menu_InvoiceTemplates","AddInvoiceTemplate","uploadStyle","buttonRoot","buttonLabel","dividerRoot","previewContainer","previewIconAndText","previewIcon","previewText","previewTextSize","previewCloseButton","previewCloseButtonIcon","FileView","withShrinkLabel","prettyBytes","maximumFractionDigits","mimeType","fileUrl","webkitRelativePath","previewImg","downloadClick","FileInput","onFileChange","shrinkFile","FilesPreview","FileUpload","innerFiles","setInnerFiles","fileValues","setFileValues","updateFiles","deleteFileName","savedFiles","convertFilesToArray","gridRowGap","updatedFiles","addNewFiles","EmailTypePicker","EmailTypeFilter","NotificationType","CustomFormSkeleton","QuizCustomForm","fetchQuiz","quizId","ShuffleFields","Question","UsedAttempts","Submissions","SubmittedById","QuizTrainingPassingScore","UserCanStartQuiz","QuizNumberOfAttempts","fetchQuizPromiseState","fetchQuizPromise","setStartQuiz","quizSubmission","submitStatus","submitQuiz","submission","setSubmission","submissionId","resultQuiz","ContinueToQuiz","CancelYourSubmission","QuizDescription","QuizInstructions","QuizFiledAttemptsMessage","QuizFiledAttemptsInstrumentMessage","StatusChip","LastComment","LastCommentBy","LastCommentAt","AlertOfflineTime","writeCsvFile","exportCsv","stringData","csvContent","doLoadData","doUpdateField","doRunSelectedSamples","doCompleteRun","doUpdateRun","doLoadRunDetqails","doImportRunDetails","doLoadAllSelectedSamples","doExportRun","loadIds","httpUrl","allsamples","completeRunResponse","XSamplesWereProcessed","skippedSamplesCount","XSamplesWereSkipped","derivativesCount","runupdate","samples_response","readCsvFile","platesUrl","createPlate","createPlates","runSamples","tpid","records","tablestate","AnalyticalSampleId","Position","TubeLabel","Volume","Concentration","AssetsApi","allowedToImport","enabledByCores","ExportAssetRangesTooltip","ExportAssetRanges","AssetRanges","DownloadAssetImages","UpgradeLocalApp","ConsumablesForm","innerDiscountFactor","setDiscountFactor","innerRemarks","reportConsumableSchema","ConsumableProject_info","consumableServicesData","byGroup","AllowedServices","updatedRemarks","ArticleDatasetLink","dataset","ArticleServiceGroupsColumnId","ArticleInstrumentsColumnId","PubMedId","FileComment","checkRow","StyledSelect","TmtType","autoWidth","BasicTab","textColor","scrollButtons","centered","setTabIndex","tabsVertical","tabsHorizontal","scrollContent","EventsCount","eventsLoading","isMaintenanceAssetsEnabled","StyledSpanIcon","AssetQuickSearchApi","getAssetSearch","q","Results","TotalResultsLength","getRecentAssets","doShowSearchInput","doSetOpen","doSearchAssets","doSearchAllAssets","doGetRecentAssets","doGetRecentSearchTerms","assetQuickSearchSaga","getRecentSearchTerms","searchAssets_Success","searchAssets_Error","allCores","searchMenus","searchMenu","menuResult","setMenuSearchResults","setOnlineSearchResults","setOfflineSearchResults","setRequestSearchResults","setTotalSearchCount","online","request","totalRresults","searchAllAssets_Success","searchAllAssets_Error","getRecentAssets_Success","getRecentAssets_Error","getRecentSearchTerms_Success","getRecentSearchTerms_Error","menuNodes","childItems","ch","uniqBy","showSearchInput","searchAssets","searchAllAssets","showSearchInSidebar","showSearchResults","recentSearchTerms","searchResults","allSearchResults","onlineSearchResults","offlineSearchResults","requestSearchResults","totalSearchCount","menuItemsSearchResult","assetQuickSearchActions","useAssetQuickSearchSlice","selectAssetQuickSearch","assetQuickSearch","selectRecentAssets","selectRecentSearchTerms","selectAllSearchResults","selectSearchTerm","selectOpen","selectShowSearchInSidebar","selectOnlineSearchResults","selectOfflineSearchResults","selectRequestSearchResults","selectTotalSearchCount","selectMenuSearchResults","ListItemLink","DefaultQuickAssetSearchAction","getAssetDetailsLink","getCalendarLink","getTimelineLink","AssetListItem","useAssetPopup","truncateName","defaultLink","validKey","getSettingValue","showCalendarLinks","handleAssetClick","ShowFullDetails","QuickSearchSection","QuickSearchSectionTitle","QuickSearchSearchesItems","QuickSearchRecentItems","QuickSearchEmptySection","QuickSearchEmptyContent","QuickSearchSeeAll","QuickSearchMainTitleSection","QuickSearchAllInstrumentsSection","MenuSearchEmptyContent","RecentAssetsList","RecentItem","RecentSearchTermsList","recentSearchTermsState","RecentSearches","NoSearchTermFound","MenuSearchItem","convertUrl","LinkWithChildren","MenuSearchResultList","menuSearchState","RelatedScreens","NoRelatedScreensFound","AssetSearchResultsByType","onAllAssetsClick","onlineState","offlineState","requestState","menuItemsState","OnlineServiceLabel","InstrumentsFound","RequestServiceLabel","RequestsFound","OfflineServiceLabel","ConsumablesFound","showOnline","showOffline","showRequests","NothingFound","FullResults","AssetQuickSearch","searchAllCores","handleOpenAssets","showInSideBar","SearchAnAssets","inputRootMobile","AssetsSearch","SeeAllInstruments","menuButton","searchIcon","inputInput","paperTitleSection","reg_ChangePassword","main_master_LogOutLinkText","Help","OptOutNotifications","ServiceGroupRegistration","menu_GoogleCalendar","menu_OutlookCalendar","Notifications","UserMenuButton","UserMenu","googleCalendarModuleEnabled","GoogleCalendar","multipleAdGroupsModuleEnabled","MultipleAdGroups","serviceGroupRegistrationModuleEnabled","googleCalendar","outlookCalendar","Opt_Out","AllowUsersToOpt_Out","SwitchFromToAnotherUserGroup","SwitchFrom","SwitchSites","allowToSwitchToOtherSites","AllowToSwitchToOtherSites","externalTitleOne","ExternalSwitchTitle1","externalUrlOne","ExternalSwitchUrl1","externalTitleTwo","ExternalSwitchTitle2","externalUrlTwo","ExternalSwitchUrl2","externalSitesIcon","ExternalSitesIcon","buttonIcon","hasExternalOne","hasExternalTwo","useExternalLinks","SwitchToOtherSites","ProfileMenu","ToggleSideMenuButton","Separator","TopToolbar","TopGroupButton","firstServiceGroupName","CoreDashboardMenu","popoverPaper","mainContentAndScroll","mainContent","searchAndHeader","controlButtons","coresAndServices","coreCheks","scrollPaddings","ddlClasses","listItemText","useListStyles","setSelectedServiceGroups","availableServiceGroups","setAvailableServiceGroups","availableLoading","setAvailableLoading","Dashboard_ServiceGroupSelection","handleItemClick","handleSaveItemClick","Dashboard_ServiceGroupSwith","CoreSelectionButton","showInlineGroups","SubTopToolbar","serviceGroupsCount","singleCore","isAdminOfSingle","handleCollapse","OpenCore","TopBar","sidePanelCollapsed","appBarShift","sidePanelShift","MenuItemComponent","currentindex","onExternalClick","childRoot","focusVisible","createMenuItemRefs","rowInd","menuItemRefs","HoverSideMenu","handleChildClick","childActiveIndex","setChildActiveIndex","parentRowIndex","keyCode","bindFocus","anchorPosition","TransitionComponent","cindex","exact","focusVisibleClassName","SidbarMenuItem","PropTypes","bool","indexChanged","chIndex","mainTab","hasAdminSettings","closeOnClick","isExpandable","setChildIndex","sidebarExpanded","urlLink","setUrlLink","mainTabMenu","mainTabExpanded","mainTabShort","mainTabOpen","data-parent-id","verticalScrolling","NavWrapper","MainMenuItem","replaceIcon","SideBarMenu","routerPathName","selectedIndex","setSelectedIndex","mapItems","citem","chItem","groupTab","handleListItemClick","sideBarExpanded","sideBarCollapsed","sideBarListMobile","mainMenuItemExpanded","mainMenuItemCollapsed","BookitlabShortLogo","xmlnsXlink","enableBackground","xmlSpace","UserProfileMobile","assetSearchActions","SearchAssets","SideBarHeader","logoMinimized","sideBarHeaderOpen","sideBarHeaderMobile","headerButtonsMobile","sideBarHeader","sideBarFooter","SideBarFooter","SideBarQuickAction","actionOptions","defaultSystemAction","SideBarQuickActions","systemAction","coreSelected","baseAction","SidebarQuickAction","sideBarQickActionMobile","SideBarComponent","setCurrentNode","currentNodes","setCurrentNodes","SideBar","SideBarDrawer","handleDrawerClose","Drawer","ModalProps","sideBarMobile","sideBarMobileHorizontal","drawerOpen","drawerClose","LayoutRoot","Main","AdminPanelPopper","sideBarOpen","AdminPanel","iframeLoaded","setIframeLoaded","iframeRef","closeAdminPanel","FrontendLayout","isBudgets","globalCoreVisible","termsOfUseAgreementEnabled","TermsOfUseAgreement","joinAdGroupEnabled","JoinAdGroup","UserGroupsProviderType","isFirstActiveUserGroupSelected","usageKioskRoleEnabled","UsageKioskRoleEnabled","roomUserRoleEnabled","redirectToTermsOfUseAgreement","setRedirectToTermsOfUseAgreement","redirectToActiveUserGroup","setRedirectToActiveUserGroup","redirectToCoreSelection","setRedirectToCoreSelection","redirectToUsageKiosk","setRedirectToUsageKiosk","redirectToUsageRoom","setRedirectToUsageRoom","redirectToConsumableKiosk","setRedirectToConsumableKiosk","redirectToJoinAdGroup","setRedirectToJoinAdGroup","SQL","KioskAdmin","ConsumableKiosk","useRequiredRedirect","isRedirectToTermsOfUseAgreement","isRedirectToActiveUserGroup","isRedirectToCoreSelection","isRedirectToUsageKiosk","isRedirectToUsageRoom","isRedirectToConsumableKiosk","isRedirectToJoinAdGroup","handleRejectConfirm","handleApproveConfirm","layoutRootMobile","useselectable","mobileOpen","NotSavedChanges_message","NotSavedChanges_title","READONLY_COLUMNS","SamplesTable","samplesTableState","selectedSamples","CellTextField","BiologicalSampleId","SubjectId","TaxaId","Grouping","CellDateField","CellNumberField","customPageSize","handleCreateButtonClick","SourceRunIds","TargetRunIds","openExportUrl","readWriteOnly","exportColumns","downloadTemplateUrl","goToSamplesList","OpenInSamplesList","_refresh","handelDeleteSamplesClick","ThisCannotBeUndoneAreYouSure","AddSample","MoreActions","getActions","ServiceRequestCustomForm","allowUserUpload","fieldRequired","nextField","nextFullRow","prevField","prevFullRow","nextIsEmpty","EventBudgetPicker","eventPredicates","ReadonlyField","useServiceRequestStatusUpdate","serviceRequestStatusId","fieldState","InternalServiceRequestStatus","ServiceRequestSubmissionDetails","authUser","poLocal","setPoLocal","internalLocal","setInternalLocal","projectFieldVisibleToUser","ReturnedToUser","purchaseOrderMandatory","statusFieldState","handlePurchaseOrderSave","debouncedPoChange","handleExternalInternalNumberSave","debouncedInterChange","SubmittedBy","SubmittedAt","StatusAndBudget","SendQuoteToUser","handleFundingTypeChange","ShowInternalNumber","SubmitServiceRequestButton","getRowsErrors","submitEnabled","ServiceRequestSubmitButtonTooltip_Enabled","ServiceRequestSubmitButtonTooltip_Disabled","ServiceRequest_SubmitStepAlert","CancelServiceRequestButton","CancelRequest","ServiceRequestAddons","ServiceOrCharge","show_newAddonCharge","ServiceRequestInternalStatus","ServiceRequestAddonTypes","showAddonCharge","AddonType","InternalStatus","show_newManualCharge","showManualCharge","handleAddServiceClick","handleAddChargeClick","charges","AddOnServices","AddonCharges_Empty_AddEnabled","ServiceRequestMilestoneStatusMenuPicker","getChipColor","handleMenuItemClick","ServiceRequestMilestones","milestones","handleAddMilestoneClick","sidePanelProps","showActionsColumn","Records","Total","handleStatusChange","ServicesRow","backgroundClip","ServiceRequestMilestonesSection","tableContainerStyles","CloneServiceRequestButton","handleCloneButtonClick","Clone","AddServiceRequestRowButton","AddNewCustomTableRow","arrayHelpers","AddRows","ServiceRequestRowEditableCell","fieldProps","innerValue","setInnerValue","useDebounce","getDebounceValue","childColumn","getServiceRequestRowFieldName","getServiceRequestRowName","columnFieldName","columnType","SRSelect","withAsyncOptions","hocProps","asyncOptionProps","async","optionsPromise","fetchOptions","promiseState","debounced","trailing","maxWait","useAsyncOptions","getCellComponent","getReadonlyCell","getValueRenderer","getCustomFormTableColumns","fieldComponent","isFocused","getCell","originalRow","enableHide","ServiceRequestRowStatusPicker","handleBlur","ServiceREquestRowStatusCell","RowGap","ActionsCell","DeleteButton","CloneButton","handleCloneClick","InternalServiceRequestRowStatus","CommentsWrap","ServiceRequestRowComments","canUserEdit","ServiceRequestRowsImport","ImportSuccessMessage","convertImportResponse","ImportErrorMessage","UpdateColumnValueAcrossMultipleRows","DownloadImportTemplate","ExportRows","importResponse","mapValues","Completed","InsertDate","Serial","SourceLinkId","SourceRowId","UpdateDate","BulkUpdate","Column","formikContext","rowIdentifiers","postValue","rowids","GenericUpdateErrorMessage","ColumnsSelect","getHidableColumns","colvis_buttontext","toggleHideColumn","handleToggle","hiddenColumns","getHiddenColumnsKey","getHiddenColumns","localStorage","columnIds","ServiceRequestRowsTable","customFormColumns","changeState","tableColumns","dynamicColumns","staticColumns","cellProps","tableSectionStyles","serviceRequestTypeId","onCreateReservation","SRFormContent","autoResetExpanded","setHiddenColumns","ServiceRequestTable","RequestRows_error","SRTableBody","rowProps","EditableCellField","StyledTableCell","ServiceRequestRow","SRTablePagination","QuoteSentToUserAlert","approvedStatus","QuoteApproved","cancelledStatuses","Request_SendQuoteToUser_PendingMessage","Request_SendQuoteToUser_ApproveQuote","firstCancelledStatus","dialogOpen","setDialogOpen","Request_SendQuoteToUser_RejectQuote","ConfirmRejectDialog","RejectReasonEmpty_err","Confirm_RejectQuote_Title","Confirm_RejectQuote_TextLabel","SendQuoteButtonButton","SendQuote","getSchema","dynamicValuesSchema","DownloadAllFiles","SRReservationColumns","reservationsColumns","GradientsPicker","CreateRequestReservation","requestOverheadMinutes","serviceRequestRelatedEquipments","createOpen","equipmentsPredicates","overheadMinText","setOverheadMinText","selectedGradient","setSelectedGradient","setSelectedEquipment","handleOverheadSave","handleOverheadChange","validToCreate","openIn","ServiceRequestCreateRservation","ServiceRequestGradient","ServiceRequestGradient_info","RequestReservationTime_info","RequestReservationOverallOverheadTime","RequestReservationTime","PleaseSelectAnInstrument","PleaseSelectAnEquipmentAndSamples","OpenInSchedule","RequestSamplesPage","RequestDetailsPage","requestDetailsData","serviceRequestFormData","submittingRequest","ServiceRequestRelatedEquipments","sidePanel","reservationOpen","setReservationOpen","setSelectedRows","showCancelRequest","handleCreateResClose","handleCreateRowReservation","printSections","userProfileSettingsSections","ExportPDF_SubmissionsDetails","ExportPDF_RequestForm_Table","ExportPDF_Comments","ExportPDF_RequestRows_Table","ExportPDF_Milestones_Services","ExportPDF_ModificationHistory","getPrintPDFSections","customFormFields","customFormSchema","getRequestDetailsSchema","hasRowsErrors","setHasRowsErrors","PleaseSubmitRequestFirstInOrderToPrint","NotificationTypeId","openRowsSidePanel","NOT_FOUND","addonType","AddonCharges","getServiceRequestTitle","AllowUserUpload","CommentOnEditOnly","ServiceRequestCard","CardHeader","dragHandleProps","StyledCardContentRow","StyledFoo","PriorityIcon","priority","CardActions","getIcon","getIconColor","Kanban","onDragEnd","provided","destination","itemId","draggableId","droppableId","StyledGridContainer","StyledColumn","droppableProvided","droppableSnapshot","hasMore","scrollThreshold","sectionId","onLoadMore","CardsContainer","renderTitle","draggableProvided","draggableSnapshot","draggableRubric","draggableProps","FrontendLayoutContentBox","ServiceRequestsKanbanPagePath","ServiceRequestsKanban","SERVICE_REQUEST_KANBAN_IGNORED_STATUSES","ServiceRequestsKanbanPage","kanban","StyledServiceRequestStatusMultiPicker","GlobalStyle","createGlobalStyle","CustomStyle","en","backendOptions","loadPath","lngs","namespaces","AnimalTypesPage","use","Backend","initReactI18next","lng","fallbackLng","appendNamespaceToMissingKey","interpolation","escapeValue","backend","selectDialogAlert","dialogAlert","DialogAlert","useMediaQuery","DialogContentText","SnackbarManager","InternalIdLoginPage","AnimalsListPage","PosLayout","PosWrapper","AnimalCaseConsumablesPage","FlexColumnDiv","mainWrapper","LoginLayout","AppBar","Toolbar","LogoMenu","Container","AnimalsHomePage","PrivateAnimalRoute","encodeURIComponent","CreateNewCasePage","SamplesListPage","TrainingSessionsPage","BuildingsPage","HistoryPage","AddNewReportPage","TrainingWaitingListPage","createBrowserHistory","basename","ExperimentTemplatesPage","UsersHistoryPage","UsersHistory","UserTrainingPage","RestrictedRoute","allowedNode","accesibleByRole","UsersPage","AnimalExtendedBillingReportPage","UserTrainingHistoryPage","UserTrainingHistory","OtherServicesPage","BudgetsPage","ServiceRequestPage","ServiceRequestListPage","WorkOrdersPage","DocumentsPage","QuizPage","QuizDetailsPage","UserTrainingDetailsPage","TrainingDetailsPage","SampleModificationsPage","UsageHistoryPage","RunsListPage","AnimalCasesHistoryPage","SendEmailToUsersPage","SendEmailToUsers","ChargesPage","MyAssetsPage","Locations","LocationsPage","BuildingPage","CampusesPage","AreasPage","LocationListPage","SubLocationListPage","InvoiceBatches","InvoiceBatchesPage","CategoriesPage","CategoryGroupsPage","BillingPreviewPage","selectOnlineBudgetsStatus","onlineBudgetsStatus","selectOnlineBudgetsStatusSelected","selectPayState","pay","selectGenerateInvoicesState","generateInvoicesState","selectChargeOnlineBudgetsState","selectEndDate","selectIGenerateInvoicesAndSendToSapState","generateInvoicesAndSendToSap","doGetTableData","doGenerateInvoices","doChargeOnlineBudgets","doDownloadChargeOnlineBudgetsErrors","doPay","doGenerateSelectedInvoices","onlineBudgetsStatusSaga","getTableData_Success","getTableData_Error","Item","ServiceGroupsCsv","UserGroupsCsv","PeriodType","BudgetIncluded","invoiceBy","CoreInvoiceBy","InvoiceCreatedBy","InvoiceVat","CoreBy","ShowZeroAmountInvoices","ShowInvoicePartialEvents","Async","Recalculate","generateInvoices_Success","getTableData","generateInvoices_Error","processed","chargeOnlineBudgets_SetCurrentRecord","chargeOnlineBudgets_SetStatus","SuccessTransactionsCount","HostBudgetNumber","chargeOnlineBudgets_Error","chargeOnlineBudgets_Success","chargeOnlineBudgets_SetDialogOpen","ProcessingFinished","paymentDate","payments","balanceRow","Payments","pay_setStatus","pay_Finish","PaymentCreatedSuccess","GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord","GenerateInvoicesAndChargeOnlineBudgets_SetProgress","GenerateSelectedInvoices_Error","GenerateSelectedInvoices_Success","chargeOnlineBudgets","generateInvoices","chargeOnlineBudgets_DownloadErrors","GenerateInvoicesAndChargeOnlineBudgets","needTableRefresh","setneedTableRefresh","currentRecord","pay_Open","pay_SetSelected","pay_Close","GenerateSelectedInvoices_SetDialogOpen","onlineBudgetsStatusActions","useOnlineBudgetsStatusSlice","ChargeOnlineBudgetsButton","handleDialogClose","confirmationMessage","SendBalanceToSap","ChargeBalanceOnline","DownloadErrors","GenerateInvoicesButton","GenerateInvoiceForEstimatedCharges","PayButton","totalUpaidBalance","UnpaidBalance","PayDescription","Pay","paymentMethod","TotalPayments","PaySelected","GenerateInvoicesAndSendToSap","GenerateInvoices","AddPaymentButton","useRowActions","accumulateInvoices","AccumulateNewChargesToExistingInvoice","invoices","tryParseInvoicesData","getBudget","getServiceGroup","getPaymentAmount","subActions","InvoiceStart","InvoiceEnd","InvoiceDetailsLink","SeeFullDetailsOfBalanceAndTransferChargesToAnotherBudget","BudgetDetailsBudgetTransfer","InvoiceBudgetBalanceKeyAccessor","OnlineBudgetsStatusPage","ByProjectUserGroup","IDNo","TotalInvoiced","ugid","showEstimated","TotlaPaid","OnlineBudgetStatusBalanceTooltip","OverallEstimatedBalanceTooltip","OverallEstimatedBalance","OnlineBudgetStatusEstimatedChargesTooltip","EstimatedCharges","useColumns","endDateString","memoedColumns","disableActionButtons","EndDateMustBeSetToTodayOrEarlier","WS_Billing","usePageActions","handleEndDateChange","OnlineBudgetsBillingUnfinishedUsagesRemark0","OnlineBudgetsBillingUnfinishedUsagesRemark1","OnlineBudgetsBillingUnfinishedUsagesRemark2","OnlineBudgetsBillingUnfinishedUsagesRemark4","OnlineBudgetsBillingUnfinishedUsagesRemark3","rowAccessor","OnlineBudgetsStatusTable","BillingByProjectsOrCores","OnlineBudgetsStatus","InvoiceDetailsPage","WorkOrderDetailsPage","BillingPage","BillingActions","BillingActionsPage","BillingActionsDetailsPage","LocationTypesPage","SubLocationTypesPage","SavedViewDetailsPage","SavedViews","SavedViewsPage","LabelTypesPage","AssetDetailsPage","LabelPrintDialog","KioskProjectsPage","KioskProjectConsumablesPage","PrivateKioskProjectsRoute","SESSIONTIMEOUT_ASHX_CACHE_BUST","checkFailCount","CheckSessionTimeout","loginUrl","appRoot","showWarning","redirectAction","onbeforeunload","currentUrl","Fulfilled","ExtendSessionTimeout","dataType","contentType","buttonText","onButtonClick","SessionTimeout","checkUrl","ignoreSession","Warning","SessionExpirationWarning","SubmissionsPage","QuizzesPage","AdHocReportListPage","Rooms","CalendarMessages","CalendarMessagesPage","CoresDirectoryPage","SamplePlatesPage","useTabTitle","loaded","setLoaded","selectorLoading","setTitle","favIconImg","FavIconImg","favIconTitle","FavIconTitle","favIcon","favLink","getElementById","HeadTitle","isDispatcherLoading","handleFavIconChange","handleTitleChange","titleTemplate","defaultTitle","htmlAttributes","lang","InstrumentRestrictionsPage","LabelTypeDetailsPage","ConfigurableColumnExportImportPage","ShortURLRoute","hash","rooted","ServerBarcodeRoute","NewMessagePage","InvoiceTemplates","InvoiceTemplatesPage","Expenses","ExpensesPage","PricePeriodsPagePage","PricePeriods","PriceSheetPeriodDetailsPage","ArticlesPagePath","ArticlesPage","AccountLayout","RegisterPage","updateY","withSaveAsLastVisitedPage","ReservationDetailsPage","HomePage","SystemPage","DashboardPage","DefaultDashboardPage","CoreSelectionPage","CoreHomePage","CoreHomeByRoutePage","CoreStatsPage","ReportingPage","BookitLabDashboadPage","RedirectWithSearch","preserveSearch","AssetSelectionPage","TermsOfUseAgreementPage","SnackWrapper","upSnackbarIndex","zindex301","ActiveUserGroupPage","CannedReportsPage","CannedReports","UserAttributes","UserAttributesPage","ReportConsumablesPage","LoginPage","CalendarMessagesDetailsPage","OfflineServiceTypesPage","AnimalCaseEditPage","library","faUserCircle","faChevronUp","faPencil","faLock","faUsers","faBell","faQuestionCircle","faSignOutAlt","faHome","faLayerGroup","faBookmark","faCalendarAlt","faDumbbell","faCommentAltDots","faBolt","faListUl","faChartBar","faChartColumn","faChartLine","faChartPie","faChartPieAlt","faMegaphone","faFileInvoiceDollar","faCog","faTimes","faCircle","faCircleSmall","faCircleCheck","faPrint","faSearch","faChevronDoubleUp","faChevronDoubleDown","faCheck","faCheckDouble","faInfo","faTriangleExclamation","faXmark","faChevronDown","faCircleXmark","faEllipsisV","faPlus","faFilter","faTable","faMinus","faFileImport","faGlobe","faLockOpen","faEdit","faTrash","faInfoCircle","faGripVertical","faBellSlash","faExclamationCircle","faTimesCircle","faArrowLeft","faTools","faPlay","faHistory","faAdd","faStream","faRulerTriangle","faThList","faClipboardListCheck","faPencilAlt","faCalendarPlus","faPause","faSave","faCalendars","faListTimeline","faCode","faBan","faFloppyDiskCircleArrowRight","faCalculator","faRefresh","faSquare","faClone","faClock","faChevronRight","faClipboardList","faEnvelope","faCalendar","faCheckCircle","faLink","faChevronDoubleRight","faChevronDoubleLeft","faChevronLeft","faList","faUser","faGripHorizontal","faArrowFromLeft","faVial","faStopwatch","faWrench","faArrowUpRightFromSquare","faExternalLink","faExternalLinkAlt","faClose","faDownload","faBold","faItalic","faUnderline","faH1","faH2","faQuoteRight","faListOl","faFileAlt","faAt","faBarcode","faChain","faPowerOff","faPlug","faMicroscope","faCalendarCheck","faCalendarExclamation","faCalendarTimes","faFileUpload","faSpinner","faMoneyCheckEdit","faLevelUpAlt","faPaperclip","faAbacus","faAlbum","faFile","faSync","faRectangleVerticalHistory","faUniversity","faShopSlash","faDollarSign","faExchange","faSms","faUserPlus","faUserShield","faWarning","faLocationCrosshairs","faCircleDollarToSlot","faCopy","faCodeBranch","faChevronsUp","faChevronsDown","faEquals","faFileSpreadsheet","faFilePdf","faNewspaper","faFileImage","faFlag","faBarcodeScan","faMap","faBars","faMagnifyingGlass","faGrid2","faScrewdriver","faBullhorn","faMoneyBill","faFileArrowUp","faEarthEurope","faScannerKeyboard","faChevronsLeft","faChevronsRight","faCircleNotch","faMapLocation","faScrewdriverWrench","faBandage","faHourglassHalf","fasInfinity","falCircleCheck","falTriangleExclamation","falCircleQuarters","falCircleExclamation","falMinimize","falMaximize","falTable","falCalendars","fadTelescope","fadInfinity","fadCalendarCheck","fadCalendarExclamation","fadCalendarTimes","fadCalendarPlus","farMaximize","farCommentQuestion","farcircleExclamation","farCircleCheck","fabGoogle","fabWindows","faShare","PublicAssetsLayout","PublicAssetsPage","NotAllowedPage","PlayGroundPage","AssetsInventoryPage","AssetsInventoryLogPage","ServiceRequestAuditTrailHistoryPage","Floors","SubscriptionTypesPage","BudgetExperimentsPage","Regions","GePageActions","responsemessage","menu_Regions","RegionDetailsPage","regionId","AddSuperGroup","SuperGroupsPage","menu_Divisions","JoinAdGroupPage","JoinConfirmPage","jss","jssPreset","App","userLoading","isLoginPage","isPublicPage","bookitTheme","defaultTheme","animalTheme","kioskTheme","dateFnsLocale","dateFnsLocales","StylesProvider","CssBaseline","barcodeScannerMiddleware","store","BARCODE_SCANNING","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","MobileBarcodeScanner","handleBarcodeScanned","mobileBarcodeScanCallback","sagaMiddleware","createSagaMiddleware","runSaga","middlewares","createRouterMiddleware","createReducer","injectedReducers","combineReducers","connectRouter","barcodeScanner","barcodeScannerReducer","enhancers","createInjectorsEnhancer","configureStore","middleware","getDefaultMiddleware","serializableCheck","ignoredPaths","ignoredActionPaths","devTools","configureAppStore","MOUNT_NODE","google","families","intervalBetweenKeyPress","scanningEndTimeout","ignoreOnInput","historyLength"],"mappings":";sGAEA,oEASO,IAAMA,EAA2D,GAQ3DC,EAA8B,SAA9BA,EACXC,GAGI,IAFJC,EAEG,uDAFcH,EACjBI,EACG,uCACHC,OAAOC,KAAKJ,GAAMK,SAAQ,SAAAC,GACxB,IAAMC,EAAmBL,EAAO,UAAMA,EAAN,YAAiBI,GAAQA,EAChC,kBAAdN,EAAKM,IACdL,EAAeK,GAAO,GACtBP,EACEC,EAAKM,GACLL,EAAeK,GACfC,IAGFN,EAAeK,GAAOC,O,yECzBIC,E,6pBAJ5BC,IAI4BD,EAH9BE,EAAQ,QAIMF,EAAIG,WAAaH,EAAM,CAAEI,QAASJ,GAGlD,IAmCaK,GAjBI,CACfC,MAAM,EAAIL,GAAOG,SAAS,CACxBG,QApBc,CAChBC,KAAM,uBACNC,KAAM,iBACNC,OAAQ,gBACRC,MAAO,SAiBLC,aAAc,SAEhBC,MAAM,EAAIZ,GAAOG,SAAS,CACxBG,QAlBc,CAChBC,KAAM,eACNC,KAAM,YACNC,OAAQ,UACRC,MAAO,QAeLC,aAAc,SAEhBE,UAAU,EAAIb,GAAOG,SAAS,CAC5BG,QAhBkB,CACpBC,KAAM,+CACNC,KAAM,+CACNC,OAAQ,qBACRC,MAAO,sBAaLC,aAAc,U,mBCqCZG,GAAMC,aAAU,aA2jBTC,GAAY,I,WAxjBvB,aAAe,yBADfC,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AAAO,GAAM,OAAIA,EAAO6mX,yBCRNC,GAAYrnX,aACvB,kBAAM,0DACN,SAAAO,GAAM,OAAIA,EAAO8mX,aCINC,GAA8BtnX,aACzC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO+mX,+BCFNhV,GAA4BtyW,aACvC,kBAAM,6CACN,SAAAO,GAAM,OAAIA,EAAO+xW,6BCHNiV,GAA0BvnX,aACrC,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAOgnX,2B,oBCDNC,GAAqBxnX,aAChC,kBAAM,yDACN,SAAAO,GAAM,OAAIA,EAAOinX,sB,ugEC6XnBC,KAAQ3+Y,IAEN4+Y,gBACAC,eACAC,YACAC,UACAC,WACAC,UACAC,oBACAC,gBACAC,UACAC,gBACAC,cACAC,iBACAC,cACAC,oBACAC,UACAC,YACAC,cACAC,iBACAC,eACAC,cACAC,iBACAC,eACAC,uBACAC,SACAC,WACAC,YACAC,iBACAC,iBACAC,WACAC,YACAC,qBACAC,uBACAC,WACAC,iBACAC,UACAC,yBACAC,WACAC,iBACAC,iBACAC,eACAC,UACAC,YACAC,WACAC,WACAC,gBACAC,WACAC,cACAC,UACAC,WACAC,gBACAC,kBACAC,eACAC,uBACAC,iBACAC,eACAC,WACAC,UACAC,aACAC,SACAC,YACAC,mBACAC,YACAC,wBACAC,eACAC,kBACAC,WACAC,UACAC,eACAC,kBACAC,UACAC,SACAC,gCACAC,gBACAC,aACAC,YACAC,WACAC,WACAC,kBACAC,mBACAC,cACAC,cACAC,iBACAC,UACAC,wBACAC,uBACAC,iBACAC,UACAC,UACAC,oBACAC,mBACAC,UACAC,eACAC,YACAC,4BACAC,kBACAC,qBACAC,WACAC,cACAC,UACAC,YACAC,eACAC,QACAC,QACAC,gBACAC,YACAC,aACAC,QACAC,aACAC,WACAC,cACAC,UACAC,gBACAC,mBACAC,yBACAC,mBACAC,gBACAC,aACAC,oBACAC,gBACAC,eACAC,YACAC,WACAC,UACAC,UACAC,8BACAC,gBACAC,eACA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BACA,gBACA,WACA,mBACA,0BAEA,gBACA,wCACA,oBACA,aACA,YACA,YACA,SACA,gBACA,mBACA,kBACA,cACA,kBACA,kBACA,uBACA,gCACA,oBACA,wBACA,WACA,kBACA,2BACA,8BACA,iBACA,oBACA,sBACA,mBACA,WACA,cACA,uBACA,0BACA,0BACA,kBACA,oBACA,YACA,kCACA,oBACA,2BACA,wBACA,gBACA,2BACA,wBACA,eACA,uBACA,2BACA,iBACA8vC,KACAy+G,GACA,kBACA,uBAEA,iBACA,oBACA,wBACA,cACA,mCACA,eACA,qBACA,qBACA,eACA,WACA,sBACA,mBACA,gBACA,yBA/HJ,SAkIE,eAAC,IAAD,CAAkBz7X,MAAOgrY,EAAzB,SAGE,eAACp5B,EAAD,UAEE,gBAAC,IAAD,WACE,eAAC,IAAD,CACE7hW,KAAM,mBACNN,UAAWusX,KAEb,eAAC,IAAD,CACEjsX,KAAM,CAAC,sCACPN,UAAW4sX,KAEb,eAAC,IAAD,CACEtsX,KAAM,wBACNN,UAAW8sX,KAEb,eAAC,IAAD,CACExsX,KAAM,wBACNN,UAAW+sX,KAEb,eAAC,IAAD,CACEzsX,KAAM,cACNN,UAAWysX,KAEb,eAAC,IAAD,CACEnsX,KAAM,iBACNN,UAAW2sX,KAEb,eAAC,IAAD,CACErsX,KAAM,cACNN,UAAWwsX,KAEb,eAAC,IAAD,CACElsX,KAAM,6BACNN,UAAWgtX,KAEb,eAAC,IAAD,CACEjwB,OAAK,EACLz8V,KAAMmnI,wBACNznI,UAAW4pN,KAEb,eAAC,IAAD,CACEmzI,OAAK,EACLz8V,KAAMopN,2BACN1pN,UAAWqpN,KAEb,eAAC,IAAD,CACE0zI,OAAK,EACLz8V,KAAM,eACNN,UAAW05W,IAEb,eAAC,IAAD,CACE3c,OAAK,EACLz8V,KAAM,WACNN,UAAW26W,KAEb,eAAC,IAAD,CACE5d,OAAK,EACLz8V,KAAM,mBACNN,UAAW+8W,KAEb,eAAC,IAAD,CACEhgB,OAAK,EACLz8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tBC,kBAAmB,CACjBC,aAAc,CACZ,4CACA,kDAEFC,mBAAoB,CAClB,+CACA,0CACA,sCACA,iCACA,0BACA,iCACA,kCACA,sCAKRC,UAAUtwY,EACV8vY,cDhCUS,GACRC,GAAa/jY,SAASqwX,eAAe,QAE3C/tG,SACE,eAAC,aAAD,UACE,eAAC,WAAD,CAAgB51Q,SAAU,KAA1B,SACE,gBAAC,WAAD,CAAUm1X,MAAOA,GAAjB,UACE,eAAC,KAAD,UACE,eAAC,KAAD,CAAe7tY,OAjBL,CAKlBgwY,OAAQ,CACNC,SAAU,CAAC,4CAWL,SACE,eAACjD,GAAD,QAGJ,eAAC,kBAAD,CACEhtY,OAAQ,CACNkwY,wBAAyB,GACzBC,mBAAoB,IACpBpnY,OAAOxJ,EACP6wY,eAAe,EACfC,cAAe,KAGnB,eAAC,GAAD,WAINN,IAaFhC,O","file":"static/js/main.b24ce064.chunk.js","sourcesContent":["import { ConvertedToObjectType, TranslationJsonType } from './types';\r\n\r\n/**\r\n * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.\r\n * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module\r\n **/\r\n\r\n/**\r\n * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.\r\n * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module\r\n */\r\nexport const translations: ConvertedToObjectType = {} as any;\r\n\r\n/*\r\n * Converts the static JSON file into an object where keys are identical\r\n * but values are strings concatenated according to syntax.\r\n * This is helpful when using the JSON file keys and still having the intellisense support\r\n * along with type-safety\r\n */\r\nexport const convertLanguageJsonToObject = (\r\n json: any,\r\n objToConvertTo = translations,\r\n current?: string,\r\n) => {\r\n Object.keys(json).forEach(key => {\r\n const currentLookupKey = current ? `${current}.${key}` : key;\r\n if (typeof json[key] === 'object') {\r\n objToConvertTo[key] = {};\r\n convertLanguageJsonToObject(\r\n json[key],\r\n objToConvertTo[key],\r\n currentLookupKey,\r\n );\r\n } else {\r\n objToConvertTo[key] = currentLookupKey;\r\n }\r\n });\r\n};\r\n","// This module is copied from\r\n// node_modules\\date-fns\\locale\\he\\_lib\\formatLong\\index.js\r\n// and modified to solve the date separator problem for \"HE\".\r\n// Here the date separator \".\" is replaced with \"/\" for short date case.\r\n\r\nvar _index = _interopRequireDefault(\r\n require('date-fns/locale/_lib/buildFormatLongFn/index.js'),\r\n);\r\n\r\nfunction _interopRequireDefault(obj) {\r\n return obj && obj.__esModule ? obj : { default: obj };\r\n}\r\n\r\nvar dateFormats = {\r\n full: 'EEEE, d בMMMM y',\r\n long: 'd בMMMM y',\r\n medium: 'd בMMM y',\r\n short: 'd/M/y',\r\n};\r\nvar timeFormats = {\r\n full: 'H:mm:ss zzzz',\r\n long: 'H:mm:ss z',\r\n medium: 'H:mm:ss',\r\n short: 'H:mm',\r\n};\r\nvar dateTimeFormats = {\r\n full: \"{{date}} 'בשעה' {{time}}\",\r\n long: \"{{date}} 'בשעה' {{time}}\",\r\n medium: '{{date}}, {{time}}',\r\n short: '{{date}}, {{time}}',\r\n};\r\nvar formatLong = {\r\n date: (0, _index.default)({\r\n formats: dateFormats,\r\n defaultWidth: 'full',\r\n }),\r\n time: (0, _index.default)({\r\n formats: timeFormats,\r\n defaultWidth: 'full',\r\n }),\r\n dateTime: (0, _index.default)({\r\n formats: dateTimeFormats,\r\n defaultWidth: 'full',\r\n }),\r\n};\r\n/*var _default = formatLong;\r\nexports.default = _default;\r\nmodule.exports = exports.default;*/\r\nexport const formatLongHE = formatLong;\r\n","import DateFnsUtils from '@date-io/date-fns';\r\nimport { IUtils } from '@date-io/core/IUtils';\r\nimport getWeekOfMonth from 'date-fns/getWeekOfMonth';\r\n\r\nimport {\r\n parse,\r\n parseISO,\r\n formatDistanceToNow,\r\n isToday,\r\n startOfMonth,\r\n endOfHour,\r\n endOfTomorrow,\r\n differenceInCalendarDays,\r\n getDay,\r\n getYear,\r\n getMonth,\r\n getHours,\r\n getMinutes,\r\n setWeek,\r\n setDay,\r\n getDate,\r\n setDate,\r\n setMonth,\r\n setYear,\r\n setHours,\r\n setMinutes,\r\n set,\r\n intervalToDuration,\r\n startOfTomorrow,\r\n startOfYesterday,\r\n endOfYesterday,\r\n startOfToday,\r\n lastDayOfMonth,\r\n getDaysInMonth,\r\n getDayOfYear,\r\n} from 'date-fns';\r\n\r\nimport {\r\n differenceInSeconds,\r\n differenceInMinutes,\r\n differenceInHours,\r\n differenceInDays,\r\n differenceInWeeks,\r\n differenceInMonths,\r\n differenceInQuarters,\r\n differenceInYears,\r\n} from 'date-fns';\r\nimport {\r\n add,\r\n addMilliseconds,\r\n addSeconds,\r\n addMinutes,\r\n addHours,\r\n addDays,\r\n addWeeks,\r\n addMonths,\r\n addQuarters,\r\n addYears,\r\n} from 'date-fns';\r\n\r\nimport {\r\n endOfDay,\r\n endOfMonth,\r\n endOfQuarter,\r\n endOfWeek,\r\n endOfYear,\r\n startOfHour,\r\n startOfMinute,\r\n startOfDay,\r\n startOfQuarter,\r\n startOfWeek,\r\n startOfYear,\r\n} from 'date-fns';\r\nimport { CustomDate, DateType } from 'types/CustomDate';\r\nimport { formatLongHE } from 'utils/LocaleHE';\r\nimport { getLogger } from './logLevel';\r\nimport { toInteger } from 'lodash';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\n\r\nconst log = getLogger('DateUtils');\r\nclass DateUtils {\r\n dateFnsUtils: IUtils;\r\n constructor() {\r\n this.dateFnsUtils = new DateFnsUtils();\r\n }\r\n /**\r\n * he->he\r\n * en-us->enUS\r\n * @param s\r\n * @returns\r\n */\r\n dateFnsCultureName(s: string): string {\r\n let [x, y] = s.split('-');\r\n y = y === undefined ? '' : y.toUpperCase();\r\n return x.toLowerCase() + y;\r\n }\r\n CurrentLocale(): Locale {\r\n return this.dateFnsUtils.locale;\r\n }\r\n public async setLocale(cultureName: string, systemFirstDayOfWeek: number) {\r\n const x = this.dateFnsCultureName(cultureName);\r\n try {\r\n const locale = await this.getLocale(x);\r\n this.dateFnsUtils.locale = locale;\r\n this.dateFnsUtils.locale.options.weekStartsOn = systemFirstDayOfWeek;\r\n } catch (err) {\r\n console.error('setLocale', cultureName, err);\r\n }\r\n }\r\n async getLocale(culture: string) {\r\n const locale = await import(`date-fns/locale`);\r\n var result = locale[culture];\r\n if (result.code === 'he') {\r\n result.formatLong = formatLongHE;\r\n }\r\n return result;\r\n }\r\n dateOrStringToDate(v: string | Date): Date {\r\n const d = typeof v === 'string' ? this.parseISO(v as string) : (v as Date);\r\n return d;\r\n }\r\n // format(v: Date | string | null | undefined, f: keyof DateIOFormats) {\r\n // if (v == null || v === undefined) {\r\n // return null;\r\n // }\r\n // try {\r\n // const d = this.dateOrStringToDate(v);\r\n // return this.dateFnsUtils.formatByString(d, this.defaultFormats[f]);\r\n // } catch (err) {\r\n // console.error(err);\r\n // return null;\r\n // }\r\n // }\r\n localeFirstWeekContainsDate(): number | null {\r\n return (\r\n this.dateFnsUtils.locale.options &&\r\n this.dateFnsUtils.locale.options.firstWeekContainsDate\r\n );\r\n }\r\n defaultFirstWeekContainsDate(): number {\r\n return this.localeFirstWeekContainsDate() == null\r\n ? 1\r\n : toInteger(this.localeFirstWeekContainsDate());\r\n }\r\n firstWeekContainsDate(): number {\r\n return this.dateFnsUtils.locale.options.firstWeekContainsDate == null\r\n ? this.defaultFirstWeekContainsDate()\r\n : toInteger(this.dateFnsUtils.locale.options.firstWeekContainsDate);\r\n }\r\n localeWeekStartsOn(): number | null {\r\n return (\r\n this.dateFnsUtils.locale.options &&\r\n this.dateFnsUtils.locale.options.weekStartsOn\r\n );\r\n }\r\n defaultWeekStartsOn(): number {\r\n return this.localeWeekStartsOn() == null\r\n ? 0\r\n : toInteger(this.localeWeekStartsOn());\r\n }\r\n weekStartsOn(): number {\r\n return this.dateFnsUtils.locale.options.weekStartsOn == null\r\n ? this.defaultWeekStartsOn()\r\n : toInteger(this.dateFnsUtils.locale.options.weekStartsOn.weekStartsOn);\r\n }\r\n subFnOptions() {\r\n return {\r\n firstWeekContainsDate: this.firstWeekContainsDate(),\r\n weekStartsOn: this.weekStartsOn(),\r\n locale: this.dateFnsUtils.locale,\r\n };\r\n } // If timezone isn't specified, it will be set to the system timezone\r\n format(v: Date | string | null | undefined, f: string): string | null {\r\n if (v == null || v === undefined) {\r\n return null;\r\n }\r\n try {\r\n const d = this.dateOrStringToDate(v);\r\n return this.dateFnsUtils.format(d, f);\r\n } catch (err) {\r\n console.error(err);\r\n return null;\r\n }\r\n }\r\n // formatByString(\r\n // v: Date | string | null | undefined,\r\n // f: string,\r\n // ): string | null {\r\n // if (v == null || v === undefined) {\r\n // return null;\r\n // }\r\n // try {\r\n // const d = this.dateOrStringToDate(v);\r\n // return this.dateFnsUtils.formatByString(d, f);\r\n // } catch (err) {\r\n // console.error(err);\r\n // return null;\r\n // }\r\n // }\r\n public HoursMinutesSecondsFormat(v: Date | string | null): string | null {\r\n //return this.format(v, 'hh:mm:ss');\r\n return this.format(v, this.DateIOFormats.fullTime);\r\n }\r\n /**\r\n * Format to long date only format (localized). e.g. 23 Apr 2987\r\n * @param v date\r\n * @returns localized formatted string\r\n */\r\n public longDateFormat(v: Date | string | null | undefined): string | null {\r\n return this.format(v, this.DateIOFormats.fullDate); //'PP'\r\n }\r\n /**\r\n * Format to short date only format (localized). e.g. 23 04 2987\r\n * @param v date\r\n * @returns localized formatted string\r\n */\r\n public shortDateFormat(v: Date | string | null | undefined): string | null {\r\n return this.format(v, this.DateIOFormats.keyboardDate); //'P'\r\n }\r\n /**\r\n * Format to long date + time format (localized). e.g. 23 Apr 2987 12:13 AM\r\n * @param v date\r\n * @returns localized formatted string\r\n */\r\n public longDateTimeFormat(\r\n v: Date | string | null | undefined,\r\n ): string | null {\r\n return this.format(v, this.DateIOFormats.fullDateTime); //PP pp\r\n }\r\n /**\r\n * Format to short date + time format (localized). e.g. 23 04 2987 12:13 AM\r\n * @param v date\r\n * @returns localized formatted string\r\n */\r\n public shortDateTimeFormat(\r\n v: Date | string | null | undefined,\r\n ): string | null {\r\n return this.format(v, this.DateIOFormats.keyboardDateTime); //P p\r\n }\r\n public timeFormat(v: Date | string | null | undefined): string | null {\r\n return this.format(v, this.DateIOFormats.fullTime); //p\r\n }\r\n public parseISO(s: string | Date): Date {\r\n if (typeof s === 'string') {\r\n // Remove the timezone offeset part before parsing the date\r\n // Currently the dates are serialized as with a fake UTC offset\r\n // this might change in the future so dates will be received with a proper timezone offset\r\n const truncatedString =\r\n s[s.length - 1] === 'Z' ? s.substr(0, s.length - 1) : s;\r\n const date = parseISO(truncatedString);\r\n\r\n return date;\r\n } else {\r\n return s;\r\n }\r\n }\r\n /**\r\n * Little helper function to parse .net dto date fields.\r\n * @param s ISO like string\r\n * @returns parsed date or null\r\n */\r\n public parseISOOrNull(s: string | Date | null): Date | null {\r\n if (s === null) {\r\n return null;\r\n }\r\n if (typeof s === 'string') {\r\n try {\r\n return parseISO(s);\r\n } catch (error) {\r\n log.error(`parseISOOrNull - failed to parse ${s}`);\r\n return null;\r\n }\r\n } else {\r\n return s;\r\n }\r\n }\r\n public tryParse(s: string | undefined | null): Date | null {\r\n if (s === undefined) {\r\n return null;\r\n }\r\n if (s === null) {\r\n return null;\r\n }\r\n //first try pars using iso\r\n let result = this.parseISO(s);\r\n if (result === undefined) {\r\n return null;\r\n }\r\n if (!isNaN(result.getTime())) {\r\n return result;\r\n }\r\n\r\n // then try localized short date time\r\n result = parse(s, 'P p', 0, { locale: this.dateFnsUtils.locale });\r\n if (!isNaN(result.getTime())) {\r\n return result;\r\n }\r\n\r\n return null;\r\n }\r\n public formatDistanceToNow(v: string | Date) {\r\n const d = this.dateOrStringToDate(v);\r\n return formatDistanceToNow(d, {\r\n addSuffix: true,\r\n locale: this.dateFnsUtils.locale,\r\n });\r\n }\r\n public truncateTime(v: Date | string): Date {\r\n const d = this.dateOrStringToDate(v);\r\n const s = startOfDay(d);\r\n return s;\r\n }\r\n public truncateSeconds(v: Date | string): Date {\r\n const d = this.dateOrStringToDate(v);\r\n const s = startOfMinute(d);\r\n return s;\r\n }\r\n /**\r\n * Custom ISO format is needed since the OData api works with a fake UTC timezone\r\n * Dates on the server are without timezone offset as the dates in the App time zone\r\n * OData processes the DateTime by appending a Zero timezone offset (UTC)\r\n * @param date date to format\r\n * @param options format options\r\n * @returns ISO string representation\r\n */\r\n public formatISO(\r\n date: Date,\r\n options?: {\r\n format?: 'extended' | 'basic';\r\n representation?: DateType;\r\n },\r\n ) {\r\n const timeFormat = 'HH:mm:ss';\r\n const dateFormat = 'yyyy-MM-dd';\r\n const gfs = (representation: DateType | undefined) => {\r\n switch (representation) {\r\n default:\r\n case 'complete':\r\n return `${dateFormat}'T'${timeFormat}'Z'`;\r\n case 'date':\r\n return dateFormat;\r\n case 'time':\r\n return timeFormat;\r\n }\r\n };\r\n const dateString = this.dateFnsUtils.format(\r\n date,\r\n gfs(options?.representation),\r\n );\r\n return dateString;\r\n }\r\n public tryFormatIso(\r\n date: any,\r\n options?: {\r\n format?: 'extended' | 'basic';\r\n representation?: DateType;\r\n },\r\n ) {\r\n try {\r\n if (date === null) {\r\n return null;\r\n }\r\n if (date === undefined) {\r\n return undefined;\r\n }\r\n if (typeof date === 'string' || date instanceof Date) {\r\n const formatDate = this.dateOrStringToDate(date);\r\n return this.formatISO(formatDate, options);\r\n } else {\r\n return null;\r\n }\r\n } catch (error) {\r\n return null;\r\n }\r\n }\r\n public formatQueryStringDate(\r\n date: Date,\r\n options?: {\r\n representation?: DateType;\r\n },\r\n ): string {\r\n let convertedDate = this.dateOrStringToDate(date);\r\n switch (options?.representation ?? 'complete') {\r\n default:\r\n case 'complete':\r\n return this.dateFnsUtils.format(convertedDate, \"yyyy-MM-dd'T'HH:mm:ss\");\r\n case 'date':\r\n return this.dateFnsUtils.format(convertedDate, 'yyyy-MM-dd');\r\n case 'time':\r\n return this.dateFnsUtils.format(convertedDate, 'HH:mm:ss');\r\n }\r\n }\r\n public parseQueryStringDate(value: string): Date {\r\n return this.parseISO(value);\r\n }\r\n public getDayText(date: Date): string {\r\n return this.dateFnsUtils.format(date, 'cccc');\r\n }\r\n\r\n public getShortDaysArray(): string[] {\r\n const fdow = startOfWeek(new Date());\r\n return Array.from(Array(7)).map((e, i) =>\r\n this.dateFnsUtils.format(\r\n addDays(fdow, i),\r\n this.DateIOFormats.weekdayShort,\r\n ),\r\n );\r\n }\r\n public getLongDaysArray(): string[] {\r\n const fdow = startOfWeek(new Date());\r\n return Array.from(Array(7)).map((e, i) =>\r\n this.dateFnsUtils.format(addDays(fdow, i), this.DateIOFormats.weekday),\r\n );\r\n }\r\n public getMinutesDiff(startDate: Date, endDate: Date) {\r\n let diff = endDate.getTime() - startDate.getTime();\r\n return diff / 60000;\r\n }\r\n public getHoursDiff(startDate: Date, endDate: Date) {\r\n const msInHour = 1000 * 60 * 60;\r\n return (endDate.getTime() - startDate.getTime()) / msInHour;\r\n }\r\n public getDaysDiff(startDate: Date, endDate: Date) {\r\n const msInDays = 1000 * 3600 * 24;\r\n return (endDate.getTime() - startDate.getTime()) / msInDays;\r\n }\r\n public getWeekDiff(startDate: Date, endDate: Date) {\r\n const msInWeek = 7 * 24 * 60 * 60 * 1000;\r\n return (endDate.getTime() - startDate.getTime()) / msInWeek;\r\n }\r\n public getMonthDiff(startDate: Date, endDate: Date) {\r\n var months;\r\n months = (endDate.getFullYear() - startDate.getFullYear()) * 12;\r\n months -= startDate.getMonth();\r\n months += endDate.getMonth();\r\n return months <= 0 ? 0 : months;\r\n }\r\n public DateIOFormats: DateIOFormats = {\r\n dayOfMonth: 'd',\r\n fullDate: 'PP',\r\n fullDateWithWeekday: 'PPPP',\r\n fullDateTime: 'PP p',\r\n fullDateTime12h: 'PP hh:mm aaa',\r\n fullDateTime24h: 'PP HH:mm',\r\n fullTime: 'p',\r\n fullTime12h: 'hh:mm aaa',\r\n fullTime24h: 'HH:mm',\r\n hours12h: 'hh',\r\n hours24h: 'HH',\r\n keyboardDate: 'P',\r\n keyboardDateTime: 'P p',\r\n keyboardDateTime12h: 'P hh:mm aaa',\r\n keyboardDateTime24h: 'P HH:mm',\r\n minutes: 'mm',\r\n month: 'LLLL',\r\n monthAndDate: 'MMMM d',\r\n monthAndYear: 'LLLL yyyy',\r\n monthShort: 'MMM',\r\n weekday: 'EEEE',\r\n weekdayShort: 'EEE',\r\n normalDate: 'd MMMM',\r\n normalDateWithWeekday: 'EEE, MMM d',\r\n seconds: 'ss',\r\n shortDate: 'MMM d',\r\n year: 'yyyy',\r\n };\r\n public isToday = isToday;\r\n // diff functions\r\n public differenceInSeconds = differenceInSeconds;\r\n public differenceInMinutes = differenceInMinutes;\r\n public differenceInHours = differenceInHours;\r\n public differenceInDays = differenceInDays;\r\n public differenceInWeeks = differenceInWeeks;\r\n public differenceInMonths = differenceInMonths;\r\n public differenceInQuarters = differenceInQuarters;\r\n public differenceInYears = differenceInYears;\r\n public differenceInCalendarDays = differenceInCalendarDays;\r\n\r\n // add functions\r\n public add = add;\r\n public addMilliseconds = addMilliseconds;\r\n public addSeconds = addSeconds;\r\n public addMinutes = addMinutes;\r\n public addHours = addHours;\r\n public addDays = addDays;\r\n public addWeeks = addWeeks;\r\n public addMonths = addMonths;\r\n public addQuarters = addQuarters;\r\n public addYears = addYears;\r\n\r\n // startOf functions\r\n public startOfMinute = startOfMinute;\r\n public startOfHour = startOfHour;\r\n public startOfDay = startOfDay;\r\n public startOfWeek(\r\n date: Date | number,\r\n firstDayOfWeek?: WeekStartsOn | number,\r\n ) {\r\n return startOfWeek(date, {\r\n locale: dateUtils.dateFnsUtils.locale,\r\n weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n });\r\n }\r\n public startOfMonth = startOfMonth;\r\n public startOfQuarter = startOfQuarter;\r\n public startOfYear = startOfYear;\r\n\r\n // endOf functions\r\n public endOfHour = endOfHour;\r\n public endOfDay = endOfDay;\r\n public endOfWeek(\r\n date: Date | number,\r\n firstDayOfWeek?: WeekStartsOn | number,\r\n ) {\r\n return endOfWeek(date, {\r\n locale: dateUtils.dateFnsUtils.locale,\r\n weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n });\r\n }\r\n public endOfMonth = endOfMonth;\r\n public endOfQuarter = endOfQuarter;\r\n public endOfYear = endOfYear;\r\n public endOfTomorrow = endOfTomorrow;\r\n public startOfTomorrow = startOfTomorrow;\r\n public startOfYesterday = startOfYesterday;\r\n public endOfYesterday = endOfYesterday;\r\n public startOfToday = startOfToday;\r\n public lastDayOfMonth = lastDayOfMonth;\r\n public getDaysInMonth = getDaysInMonth;\r\n public getDayOfYear = getDayOfYear;\r\n\r\n //other\r\n public getYear = getYear;\r\n public getMonth = getMonth;\r\n public getHours = getHours;\r\n public getMinutes = getMinutes;\r\n public getDate = getDate;\r\n public setDate = setDate;\r\n public setMonth = setMonth;\r\n public setYear = setYear;\r\n public setHours = setHours;\r\n public setMinutes = setMinutes;\r\n public getDay(date: Date | number): number {\r\n return getDay(date) as number;\r\n }\r\n public setWeek(\r\n date: Date | number,\r\n week: number,\r\n firstDayOfWeek: WeekStartsOn | number,\r\n ): Date {\r\n return setWeek(date, week, {\r\n locale: this.dateFnsUtils.locale,\r\n weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n });\r\n }\r\n public setDay(\r\n date: Date | number,\r\n day: number,\r\n firstDayOfWeek: WeekStartsOn | number,\r\n ): Date {\r\n return setDay(date, day, {\r\n locale: this.dateFnsUtils.locale,\r\n weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n });\r\n }\r\n public set(\r\n date: Date | number,\r\n values: {\r\n year?: number;\r\n month?: number;\r\n date?: number;\r\n hours?: number;\r\n minutes?: number;\r\n seconds?: number;\r\n milliseconds?: number;\r\n },\r\n ): Date {\r\n return set(date, values);\r\n }\r\n\r\n public getWeekNumberOfMonth(\r\n date: Date,\r\n FirstDayOfWeek?: WeekStartsOn | number,\r\n ): number {\r\n return getWeekOfMonth(date, {\r\n locale: this.dateFnsUtils.locale,\r\n weekStartsOn: FirstDayOfWeek as WeekStartsOn,\r\n });\r\n }\r\n public intervalToDuration = intervalToDuration;\r\n\r\n public timeStringToDecimal(time: string): number {\r\n var hoursMinutes = time.split(/[.:]/);\r\n var hours = parseInt(hoursMinutes[0], 10);\r\n var minutes = hoursMinutes[1] ? parseInt(hoursMinutes[1], 10) : 0;\r\n return hours + minutes / 60;\r\n }\r\n public toDate(date: Date | string) {\r\n return dateUtils.dateOrStringToDate(date);\r\n }\r\n public newDate(date: Date | string | undefined) {\r\n if (!date) {\r\n return new CustomDate(new Date(), 'complete');\r\n } else {\r\n return new CustomDate(this.toDate(date), 'complete');\r\n }\r\n }\r\n public getMeridiem(date: Date | string) {\r\n return dateUtils.getHours(dateUtils.toDate(date)) >= 12 ? 'pm' : 'am';\r\n }\r\n public convertToMeridiem(\r\n time: Date | string,\r\n meridiem: 'am' | 'pm',\r\n ampm: boolean,\r\n ) {\r\n let val = dateUtils.toDate(time);\r\n if (ampm) {\r\n var currentMeridiem = dateUtils.getHours(val) >= 12 ? 'pm' : 'am';\r\n if (currentMeridiem !== meridiem) {\r\n var hours =\r\n meridiem === 'am'\r\n ? dateUtils.getHours(val) - 12\r\n : dateUtils.getHours(val) + 12;\r\n return dateUtils.setHours(val, hours);\r\n }\r\n }\r\n return val;\r\n }\r\n public getMeridiemHours(time: Date | string) {\r\n let val = dateUtils.toDate(time);\r\n var currentMeridiem = dateUtils.getHours(val) > 12 ? 'pm' : 'am';\r\n if (currentMeridiem === 'pm') {\r\n let hours = dateUtils.getHours(val) - 12;\r\n return hours;\r\n }\r\n return dateUtils.getHours(val);\r\n }\r\n public getParsableDate(date: ParsableDate) {\r\n var resDate =\r\n date === null || date === undefined\r\n ? null\r\n : typeof date === 'object'\r\n ? new Date(date as Date)\r\n : typeof date === 'number'\r\n ? new Date(date)\r\n : dateUtils.dateOrStringToDate(date);\r\n return resDate;\r\n }\r\n}\r\n\r\nexport const dateUtils = new DateUtils();\r\n\r\nexport type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;\r\nexport interface DateIOFormats {\r\n /** Localized full date @example \"Jan 1, 2019\" */\r\n fullDate: TLibFormatToken;\r\n /** Partially localized full date with weekday, useful for text-to-speech accessibility @example \"Tuesday, January 1, 2019\" */\r\n fullDateWithWeekday: TLibFormatToken;\r\n /** Date format string with month and day of month @example \"1 January\" */\r\n normalDate: TLibFormatToken;\r\n /** Date format string with weekday, month and day of month @example \"Wed, Jan 1\" */\r\n normalDateWithWeekday: TLibFormatToken;\r\n /** Shorter day format @example \"Jan 1\" */\r\n shortDate: TLibFormatToken;\r\n /** Year format string @example \"2019\" */\r\n year: TLibFormatToken;\r\n /** Month format string @example \"January\" */\r\n month: TLibFormatToken;\r\n /** Short month format string @example \"Jan\" */\r\n monthShort: TLibFormatToken;\r\n /** Month with year format string @example \"January 2018\" */\r\n monthAndYear: TLibFormatToken;\r\n /** Month with date format string @example \"January 1\" */\r\n monthAndDate: TLibFormatToken;\r\n /** Weekday format string @example \"Wednesday\" */\r\n weekday: TLibFormatToken;\r\n /** Short weekday format string @example \"Wed\" */\r\n weekdayShort: TLibFormatToken;\r\n /** Day format string @example \"1\" */\r\n dayOfMonth: TLibFormatToken;\r\n /** Hours format string @example \"11\" */\r\n hours12h: TLibFormatToken;\r\n /** Hours format string @example \"23\" */\r\n hours24h: TLibFormatToken;\r\n /** Minutes format string @example \"44\" */\r\n minutes: TLibFormatToken;\r\n /** Seconds format string @example \"00\" */\r\n seconds: TLibFormatToken;\r\n /** Full time localized format string @example \"11:44 PM\" for US, \"23:44\" for Europe */\r\n fullTime: TLibFormatToken;\r\n /** Not localized full time format string @example \"11:44 PM\" */\r\n fullTime12h: TLibFormatToken;\r\n /** Not localized full time format string @example \"23:44\" */\r\n fullTime24h: TLibFormatToken;\r\n /** Date & time format string with localized time @example \"Jan 1, 2018 11:44 PM\" */\r\n fullDateTime: TLibFormatToken;\r\n /** Not localized date & Time format 12h @example \"Jan 1, 2018 11:44 PM\" */\r\n fullDateTime12h: TLibFormatToken;\r\n /** Not localized date & Time format 24h @example \"Jan 1, 2018 23:44\" */\r\n fullDateTime24h: TLibFormatToken;\r\n /** Localized keyboard input friendly date format @example \"02/13/2020 */\r\n keyboardDate: TLibFormatToken;\r\n /** Localized keyboard input friendly date/time format @example \"02/13/2020 23:44\" */\r\n keyboardDateTime: TLibFormatToken;\r\n /** Partially localized keyboard input friendly date/time 12h format @example \"02/13/2020 11:44 PM\" */\r\n keyboardDateTime12h: TLibFormatToken;\r\n /** Partially localized keyboard input friendly date/time 24h format @example \"02/13/2020 23:44\" */\r\n keyboardDateTime24h: TLibFormatToken;\r\n}\r\n","import { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { SearchColumnType } from 'app/components/BasicTable/BasicTableProps';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Supported OData operators\r\n * TODO: extend to greater than, etc\r\n */\r\nexport enum ODataOperators {\r\n Equals = 'eq',\r\n NotEquals = 'ne',\r\n GreaterThan = 'gt',\r\n GreaterThanEqual = 'ge',\r\n LessThan = 'lt',\r\n LessThanEqual = 'le',\r\n Contains = 'contains',\r\n Between = 'between',\r\n Intersection = 'intersection',\r\n Any = 'any',\r\n NotAny = 'notAny',\r\n In = 'in',\r\n Includes = 'includes',\r\n Excludes = 'excludes',\r\n InM = 'inm',\r\n AnyIn = 'AnyIn',\r\n ContainsM = 'containsm',\r\n HasNoAny = 'hasNoAny',\r\n All = 'all',\r\n AllIn = 'allIn',\r\n}\r\nexport type OdataFilterOperatorType =\r\n | ODataOperators\r\n | ((value: FilterValueType | undefined) => string);\r\nexport const operatorToString = (\r\n key: ODataOperators,\r\n value: FilterValueType | undefined,\r\n t: TFunction,\r\n): string => {\r\n return key === ODataOperators.Equals\r\n ? t(translations.ODataEquals)\r\n : key === ODataOperators.NotEquals\r\n ? t(translations.ODataNotEquals)\r\n : key === ODataOperators.GreaterThan\r\n ? value instanceof Date\r\n ? t(translations.ODataGtAfter)\r\n : t(translations.ODataGreaterThan)\r\n : key === 'lt'\r\n ? value instanceof Date\r\n ? t(translations.ODataLtBefore)\r\n : t(translations.ODataLessThan)\r\n : key === ODataOperators.GreaterThanEqual\r\n ? t(translations.ODataGreaterThanEqual)\r\n : key === ODataOperators.LessThanEqual\r\n ? t(translations.ODataLessThanEqual)\r\n : key === ODataOperators.Intersection\r\n ? t(translations.ODataIntersection)\r\n : key === ODataOperators.NotAny\r\n ? t(translations.ODataNotAny)\r\n : key === ODataOperators.Includes\r\n ? t(translations.ODataIncludes)\r\n : key === ODataOperators.Excludes\r\n ? t(translations.ODataExcludes)\r\n : key === ODataOperators.AnyIn\r\n ? t(translations.ODataAnyIn)\r\n : key === ODataOperators.ContainsM\r\n ? t(translations.ODataContainsM)\r\n : key === ODataOperators.InM\r\n ? t(translations.ODataInM)\r\n : key === ODataOperators.HasNoAny\r\n ? t(translations.ODataHasNoAny)\r\n : key === ODataOperators.All\r\n ? t(translations.ODataAll)\r\n : key === ODataOperators.AllIn\r\n ? t(translations.ODataAllIn)\r\n : key === ODataOperators.In\r\n ? t(translations.ODataIn)\r\n : key === ODataOperators.Any\r\n ? t(translations.ODataAny)\r\n : key;\r\n};\r\n/**\r\n * Supported value types\r\n */\r\nexport type ODataFieldType = string | number | Date | boolean;\r\n\r\n/**\r\n * Formats a const value in oData format.\r\n * @param value value\r\n * @returns formatted value that can be used in odata filter expression\r\n */\r\nexport function quoteODataValue(\r\n value: FilterValueType | Array,\r\n) {\r\n if (value === null) {\r\n return null;\r\n } else if (typeof value === 'number') {\r\n return value.toString();\r\n } else if (typeof value === 'boolean') {\r\n return value.toString();\r\n } else if (typeof value === 'string') {\r\n return `'${escapeODataValue(value)}'`;\r\n } else if (value instanceof CustomDate) {\r\n return `${dateUtils.formatISO(value, {\r\n representation: (value as CustomDate).representation ?? 'date',\r\n })}`;\r\n } else if (value instanceof Date) {\r\n return `${dateUtils.formatISO(value, { representation: 'complete' })}`;\r\n } else if (Array.isArray(value)) {\r\n return `(${value.map(v => quoteODataValue(v)).join(',')})`;\r\n } else if ('Id' in value) {\r\n return quoteODataValue(value.Id);\r\n } else {\r\n console.error(`Value type not supported: ${value}`, value);\r\n throw new Error(`Value type not supported: ${value}`);\r\n }\r\n}\r\n/**\r\n * Escapes const OData value\r\n * @param value value\r\n * @returns\r\n */\r\nexport function escapeODataValue(value: string): string {\r\n return value.replaceAll(\"'\", \"''\");\r\n}\r\n\r\nexport function withisInversed<\r\n T extends string | undefined = string | undefined\r\n>(condition: T, isInversed: boolean | undefined) {\r\n if (!isInversed || (condition ?? '') === '') {\r\n return condition;\r\n }\r\n return '(' + condition + ') eq false';\r\n}\r\n\r\n/**\r\n * Filter condition to be used in future custom filters\r\n */\r\nexport class Condition {\r\n public field: keyof TRow;\r\n public field1?: keyof TRow;\r\n public operator?: ODataOperators;\r\n public value?: FilterValueType;\r\n public isInversed?: boolean;\r\n constructor(\r\n field: keyof TRow,\r\n operator: ODataOperators,\r\n value: FilterValueType | undefined,\r\n field1?: keyof TRow,\r\n isInversed?: boolean,\r\n ) {\r\n this.field = field;\r\n this.field1 = field1;\r\n this.operator = operator;\r\n this.value = value;\r\n this.isInversed = isInversed;\r\n }\r\n\r\n /**\r\n * Format the range filter (between operator)\r\n * @returns odata filter string\r\n */\r\n between() {\r\n const c1: Condition[] = [];\r\n const start = (this.value as any).start;\r\n if (start !== null) {\r\n c1.push(\r\n new Condition(this.field, ODataOperators.GreaterThanEqual, start),\r\n );\r\n }\r\n const end = (this.value as any).end;\r\n if (end !== null) {\r\n c1.push(new Condition(this.field, ODataOperators.LessThanEqual, end));\r\n }\r\n const result =\r\n c1.length > 0 ? `(${c1.map(c => c.toString()).join(' and ')})` : '';\r\n return result;\r\n }\r\n /**\r\n * Format the range filter (intersection operator)\r\n * @returns odata filter string\r\n */\r\n intersection() {\r\n if (this.field1 === undefined) return '';\r\n const c1: Condition[] = [];\r\n const start = (this.value as any).start;\r\n if (start !== null) {\r\n c1.push(new Condition(this.field1, ODataOperators.GreaterThan, start));\r\n }\r\n const end = (this.value as any).end;\r\n if (end !== null) {\r\n c1.push(new Condition(this.field, ODataOperators.LessThan, end));\r\n }\r\n const result =\r\n c1.length > 0 ? `${c1.map(c => c.toString()).join(' and ')}` : '';\r\n return result;\r\n }\r\n hasAny() {\r\n //if (this.field1 === undefined) return '';\r\n const result = `${this.field}/any(g: g${\r\n this.field1 ? '/' + this.field1 : ''\r\n } eq ${quoteODataValue(this.value as number)})`;\r\n return result;\r\n }\r\n haNoAny() {\r\n const result = `not ${this.field}/any()`;\r\n return result;\r\n }\r\n notAny() {\r\n if (this.field1 === undefined) return '';\r\n const result = `${this.field}/any(g: g/${this.field1} eq ${quoteODataValue(\r\n this.value as number,\r\n )}) eq false`;\r\n return result;\r\n }\r\n anyIn() {\r\n if (!Array.isArray(this.value)) return '';\r\n const result = `${this.field}/any(g: g${\r\n !!this.field1 ? '/' + this.field1 : ''\r\n } in ${quoteODataValue(this.value)})`;\r\n return result;\r\n }\r\n allIn() {\r\n if (!Array.isArray(this.value)) return '';\r\n const result = `${this.field}/all(g: g${\r\n this.field1 ? '/' + this.field1 : ''\r\n } in ${quoteODataValue(this.value)})`;\r\n return result;\r\n }\r\n all() {\r\n if (this.field1 === undefined) return '';\r\n const result = `${this.field}/all(g: g/${this.field1} eq ${quoteODataValue(\r\n this.value as number,\r\n )})`;\r\n return result;\r\n }\r\n inM() {\r\n let res: string[] | undefined =\r\n this.value !== null && Array.isArray(this.value)\r\n ? (this.value as Array).map(v => {\r\n return `${quoteODataValue(v)} in ${this.field}`;\r\n })\r\n : undefined;\r\n return res !== undefined ? `(${res.join(' or ')})` : '';\r\n }\r\n public withNull(fieldName?: string) {\r\n const res = this.toString();\r\n const name = fieldName ?? String(this.field);\r\n if (res === undefined) return res;\r\n return '((' + res + ') or ' + name + ' eq null)';\r\n }\r\n public toString(): string | undefined {\r\n if (this.value === undefined) {\r\n return undefined;\r\n }\r\n if (this.operator === undefined) {\r\n return undefined;\r\n }\r\n switch (this.operator) {\r\n case ODataOperators.Equals:\r\n case ODataOperators.NotEquals:\r\n case ODataOperators.GreaterThan:\r\n case ODataOperators.GreaterThanEqual:\r\n case ODataOperators.LessThan:\r\n case ODataOperators.LessThanEqual:\r\n return `${this.field} ${this.operator} ${quoteODataValue(this.value)}`;\r\n case ODataOperators.Contains:\r\n return `contains(tolower(${this.field}), ${quoteODataValue(\r\n this.value,\r\n ).toLowerCase()})`;\r\n case ODataOperators.ContainsM:\r\n let resCM: string[] | undefined =\r\n this.value !== null && Array.isArray(this.value)\r\n ? (this.value as Array).map(v => {\r\n return `contains(tolower(${this.field}), ${quoteODataValue(\r\n v?.['Name'] ?? v,\r\n ).toLowerCase()})`;\r\n })\r\n : undefined;\r\n return resCM !== undefined ? resCM.join(' or ') : '';\r\n case ODataOperators.Between:\r\n return this.between();\r\n case ODataOperators.Intersection:\r\n return this.intersection();\r\n case ODataOperators.Any:\r\n return this.hasAny();\r\n case ODataOperators.NotAny:\r\n return this.notAny();\r\n case ODataOperators.In:\r\n return `(${quoteODataValue(this.value)} in ${this.field})`;\r\n case ODataOperators.InM:\r\n return this.inM();\r\n case ODataOperators.Includes:\r\n return `(${this.field} in ${quoteODataValue(this.value)})`;\r\n case ODataOperators.Excludes:\r\n return `(${this.field} in ${quoteODataValue(this.value)} eq false)`;\r\n case ODataOperators.AnyIn:\r\n return this.anyIn();\r\n case ODataOperators.HasNoAny:\r\n return this.haNoAny();\r\n case ODataOperators.All:\r\n return this.all();\r\n case ODataOperators.AllIn:\r\n return this.allIn();\r\n default:\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * OData filter expression builder\r\n */\r\nexport class ODataFilterBuilder {\r\n predicates: (string | Condition)[] = [];\r\n globalServiceGroupFilter: Condition[] = [];\r\n stringColumns?: Array>;\r\n stringSearch?: string | null;\r\n isOptionalServiceGroup?: boolean;\r\n constructor(x: {\r\n predicates: (string | Condition)[];\r\n stringColumns?: Array>;\r\n stringSearch?: string | null;\r\n globalServiceGroupFilter?: Condition[];\r\n timezone?: string;\r\n isOptionalServiceGroup?: boolean;\r\n }) {\r\n this.predicates = x.predicates.filter(\r\n f => f.toString() !== '' && f.toString() !== undefined,\r\n );\r\n this.stringColumns = x.stringColumns;\r\n this.stringSearch = x.stringSearch;\r\n this.globalServiceGroupFilter = x.globalServiceGroupFilter || [];\r\n this.isOptionalServiceGroup = x.isOptionalServiceGroup;\r\n }\r\n public toString(): string | undefined {\r\n const x: string[] = [];\r\n if (\r\n this.stringSearch !== undefined &&\r\n this.stringSearch !== null &&\r\n this.stringSearch !== ''\r\n ) {\r\n if (this.stringColumns !== undefined) {\r\n const stringValue = this.stringSearch.toLowerCase();\r\n x.push(\r\n '(' +\r\n this.stringColumns\r\n .map(c =>\r\n typeof c === 'function'\r\n ? c(\"'\" + escapeODataValue(stringValue) + \"'\")\r\n : new Condition(\r\n c as keyof T,\r\n ODataOperators.Contains,\r\n stringValue,\r\n ),\r\n )\r\n .map(c => c.toString())\r\n .join(' or ') +\r\n ')',\r\n );\r\n }\r\n }\r\n if (this.predicates?.length > 0) {\r\n x.push(\r\n '(' +\r\n this.predicates\r\n .map(p => withisInversed(p.toString(), p['isInversed']))\r\n .filter(p => p !== '' && p !== undefined)\r\n .join(' and ') +\r\n ')',\r\n );\r\n }\r\n if (\r\n this.globalServiceGroupFilter.length > 0 &&\r\n this.globalServiceGroupFilter[0].field !== ''\r\n ) {\r\n if (this.globalServiceGroupFilter[0].field === 'ServiceGroupId') {\r\n x.push(\r\n '(' +\r\n (this.isOptionalServiceGroup === true\r\n ? this.globalServiceGroupFilter\r\n .concat(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n null,\r\n ),\r\n )\r\n .map(p => p.toString())\r\n .join(' or ')\r\n : this.globalServiceGroupFilter\r\n .map(p => p.toString())\r\n .join(' or ')) +\r\n ')',\r\n );\r\n } else {\r\n x.push(\r\n '(' +\r\n this.globalServiceGroupFilter.map(p => p.toString()).join(' or ') +\r\n ')',\r\n );\r\n }\r\n }\r\n const result =\r\n x.length === 0\r\n ? undefined\r\n : x.length === 1 && x[0] === '()'\r\n ? undefined\r\n : x.join(' and ');\r\n return result;\r\n }\r\n}\r\n\r\nexport type oDataValue = { operator: ODataOperators; value: string };\r\n","//base colors\r\nexport const base_black_c11 = '#121926';\r\nexport const base_white_c0 = '#FFFFFF';\r\n//grayscale colors\r\nexport const grayscale_black_regular_c10 = '#202939';\r\nexport const grayscale_black_components_c9 = '#364152';\r\nexport const grayscale_gray_subtitles_c8 = '#4B5565';\r\nexport const grayscale_gray_components_c7 = '#697586';\r\nexport const grayscale_gray_components_light_c6 = '#9AA3B2';\r\nexport const grayscale_gray_borders_c5 = '#CDD5DF';\r\nexport const grayscale_gray_selection_c4 = '#E3E8EF';\r\nexport const grayscale_gray_bg_components_c3 = '#EEF2F6';\r\nexport const grayscale_gray_background_c2 = '#F8FAFC';\r\nexport const grayscale_gray_bg_light_c1 = '#FCFCFD';\r\n\r\n//opacity colors\r\nexport const overlay_opacity_black = 'rgba(0, 5, 10, 0.70)';\r\nexport const overlay_opacity_white = 'rgba(255, 255, 255, 0.95)';\r\n\r\n//primary colors\r\nexport const primary_dark_text_c10 = '#0B4A6F';\r\nexport const primary_hover_c9 = '#065986';\r\nexport const primary_regular_c8 = '#026AA2';\r\nexport const primary_components_c7 = '#0086C9';\r\nexport const primary_components_light_c6 = '#0BA5EC';\r\nexport const primary_borders_c5 = '#36BFFA';\r\nexport const primary_disabled_c4 = '#C5EAFE';\r\nexport const primary_bg_hover_c3 = '#E0F2FE';\r\nexport const primary_background_c2 = '#F0F9FF';\r\nexport const primary_bg_light_c1 = '#F5FBFF';\r\n\r\n//secondary colors\r\nexport const secondary_violet_dark_text_c10 = '#283493';\r\nexport const secondary_violet_hover_c9 = '#404FB7';\r\nexport const secondary_violet_regular_c8 = '#5C6FDB';\r\nexport const secondary_violet_components_c7 = '#7F94FF';\r\nexport const secondary_violet_components_light_c6 = '#9FB0FF';\r\nexport const secondary_violet_borders_c5 = '#B2C1FF';\r\nexport const secondary_violet_disabled_c4 = '#CBD6FF';\r\nexport const secondary_violet_bg_hover_c3 = '#E5EBFF';\r\nexport const secondary_violet_background_c2 = '#F2F5FF';\r\nexport const secondary_violet_bg_light_c1 = '#F9FAFF';\r\n\r\n//danger colors\r\nexport const semantic_danger_dark_text_c10 = '#841444';\r\nexport const semantic_danger_hover_c9 = '#A41F4C';\r\nexport const semantic_danger_regular_c8 = '#C42E52';\r\nexport const semantic_danger_components_c7 = '#EF6D74';\r\nexport const semantic_danger_components_light_c6 = '#EF6D74';\r\nexport const semantic_danger_borders_c5 = '#F78F8B';\r\nexport const semantic_danger_disabled_c4 = '#FCBCB3';\r\nexport const semantic_danger_bg_hover_c3 = '#FDE1D8';\r\nexport const semantic_danger_background_c2 = '#FEF0EC';\r\nexport const semantic_danger_bg_light_c1 = '#FFF8F5';\r\n\r\n//secondary colors\r\nexport const semantic_success_dark_text_c10 = '#076F4F';\r\nexport const semantic_success_hover_c9 = '#0C8654';\r\nexport const semantic_success_regular_c8 = '#13A75C';\r\nexport const semantic_success_components_c7 = '#1CC760';\r\nexport const semantic_success_components_light_c6 = '#27E861';\r\nexport const semantic_success_borders_c5 = '#7CF889';\r\nexport const semantic_success_disabled_c4 = '#A8FCA9';\r\nexport const semantic_success_bg_hover_c3 = '#D7FDD3';\r\nexport const semantic_success_background_c2 = '#EBFEE9';\r\nexport const semantic_success_bg_light_c1 = '#F5FFF4';\r\n\r\n//alert(warning) colors\r\nexport const semantic_alert_dark_text_c10 = '#7F5000';\r\nexport const semantic_alert_hover_c9 = '#9D6800';\r\nexport const semantic_alert_regular_c8 = '#BC8200';\r\nexport const semantic_alert_components_c7 = '#DB9E00';\r\nexport const semantic_alert_components_light_c6 = '#E9BD3A';\r\nexport const semantic_alert_borders_c5 = '#F4D361';\r\nexport const semantic_alert_disabled_c4 = '#FBE896';\r\nexport const semantic_alert_bg_hover_c3 = '#FDF4CA';\r\nexport const semantic_alert_background_c2 = '#FEFAE4';\r\nexport const semantic_alert_bg_light_c1 = '#FFFCF2';\r\n\r\nexport const bookitColors = {\r\n base: {\r\n black: base_black_c11,\r\n white: base_white_c0,\r\n },\r\n grayscale: {\r\n blackRegular: grayscale_black_regular_c10,\r\n blackComponents: grayscale_black_components_c9,\r\n graySubtitles: grayscale_gray_subtitles_c8,\r\n grayComponents: grayscale_gray_components_c7,\r\n grayComponentsLight: grayscale_gray_components_light_c6,\r\n grayBorders: grayscale_gray_borders_c5,\r\n graySelection: grayscale_gray_selection_c4,\r\n graybgComponents: grayscale_gray_bg_components_c3,\r\n grayBackground: grayscale_gray_background_c2,\r\n grayBackgroundLight: grayscale_gray_bg_light_c1,\r\n },\r\n overlays: {\r\n overlayBlack: overlay_opacity_black,\r\n overlayWhite: overlay_opacity_white,\r\n },\r\n primary: {\r\n dark: primary_dark_text_c10,\r\n hover: primary_hover_c9,\r\n regular: primary_regular_c8,\r\n components: primary_components_c7,\r\n componentsLight: primary_components_light_c6,\r\n borders: primary_borders_c5,\r\n disabled: primary_disabled_c4,\r\n bgHover: primary_bg_hover_c3,\r\n background: primary_background_c2,\r\n bgLight: primary_bg_light_c1,\r\n },\r\n secondary: {\r\n violet: {\r\n dark: secondary_violet_dark_text_c10,\r\n hover: secondary_violet_hover_c9,\r\n regular: secondary_violet_regular_c8,\r\n components: secondary_violet_components_c7,\r\n componentsLight: secondary_violet_components_light_c6,\r\n borders: secondary_violet_borders_c5,\r\n disabled: secondary_violet_disabled_c4,\r\n bgHover: secondary_violet_bg_hover_c3,\r\n background: secondary_violet_background_c2,\r\n bgLight: secondary_violet_bg_light_c1,\r\n },\r\n },\r\n danger: {\r\n dark: semantic_danger_dark_text_c10,\r\n hover: semantic_danger_hover_c9,\r\n regular: semantic_danger_regular_c8,\r\n components: semantic_danger_components_c7,\r\n componentsLight: semantic_danger_components_light_c6,\r\n borders: semantic_danger_borders_c5,\r\n disabled: semantic_danger_disabled_c4,\r\n bgHover: semantic_danger_bg_hover_c3,\r\n background: semantic_danger_background_c2,\r\n bgLight: semantic_danger_bg_light_c1,\r\n },\r\n success: {\r\n dark: semantic_success_dark_text_c10,\r\n hover: semantic_success_hover_c9,\r\n regular: semantic_success_regular_c8,\r\n components: semantic_success_components_c7,\r\n componentsLight: semantic_success_components_light_c6,\r\n borders: semantic_success_borders_c5,\r\n disabled: semantic_success_disabled_c4,\r\n bgHover: semantic_success_bg_hover_c3,\r\n background: semantic_success_background_c2,\r\n bgLight: semantic_success_bg_light_c1,\r\n },\r\n warning: {\r\n dark: semantic_alert_dark_text_c10,\r\n hover: semantic_alert_hover_c9,\r\n regular: semantic_alert_regular_c8,\r\n components: semantic_alert_components_c7,\r\n componentsLight: semantic_alert_components_light_c6,\r\n borders: semantic_alert_borders_c5,\r\n disabled: semantic_alert_disabled_c4,\r\n bgHover: semantic_alert_bg_hover_c3,\r\n background: semantic_alert_background_c2,\r\n bgLight: semantic_alert_bg_light_c1,\r\n },\r\n};\r\nexport interface ColorsMeta {\r\n Name: string;\r\n SemanticMeta: ColorSemanticMeta[];\r\n}\r\nexport interface ColorSemanticMeta {\r\n Name: string;\r\n Title: string;\r\n Colors: ColorDescriptionMeta[];\r\n}\r\nexport interface ColorDescriptionMeta {\r\n color: string;\r\n colorName: string;\r\n colorCode: string;\r\n colorVariable: string;\r\n}\r\nexport const baseColorMeta: ColorSemanticMeta = {\r\n Name: 'Base',\r\n Title:\r\n 'Black Palette for titles, copyrighting and components. Brand black color',\r\n Colors: [\r\n {\r\n color: bookitColors.base.black,\r\n colorName: 'Black',\r\n colorCode: 'c11',\r\n colorVariable: 'base_black_c11',\r\n },\r\n {\r\n color: bookitColors.base.white,\r\n colorName: 'White',\r\n colorCode: 'c0',\r\n colorVariable: 'base_white_c0',\r\n },\r\n ],\r\n};\r\nexport const overlaysColorMeta: ColorSemanticMeta = {\r\n Name: 'Overlays',\r\n Title:\r\n 'Black and white overlays for popups, popovers and transparent elements',\r\n Colors: [\r\n {\r\n color: bookitColors.overlays.overlayBlack,\r\n colorName: 'Black Popup Overlay',\r\n colorCode: 'opacity-black',\r\n colorVariable: 'overlay_opacity_black',\r\n },\r\n {\r\n color: bookitColors.overlays.overlayWhite,\r\n colorName: 'White Popup Overlay',\r\n colorCode: 'opacity-white',\r\n colorVariable: 'overlay_opacity_white',\r\n },\r\n ],\r\n};\r\nexport const grayscaleColorMeta: ColorSemanticMeta = {\r\n Name: 'Grayscale',\r\n Title:\r\n 'Black Palette for titles, copyrighting and components. Brand black color',\r\n Colors: [\r\n {\r\n color: bookitColors.grayscale.blackRegular,\r\n colorName: 'Regular',\r\n colorCode: 'c10',\r\n colorVariable: 'grayscale_black_regular_c10',\r\n },\r\n {\r\n color: bookitColors.grayscale.blackComponents,\r\n colorName: 'Black Components',\r\n colorCode: 'c9',\r\n colorVariable: 'grayscale_black_components_c9',\r\n },\r\n {\r\n color: bookitColors.grayscale.graySubtitles,\r\n colorName: 'Gray Subtitles',\r\n colorCode: 'c8',\r\n colorVariable: 'grayscale_gray_subtitles_c8',\r\n },\r\n {\r\n color: bookitColors.grayscale.grayComponents,\r\n colorName: 'Gray Components',\r\n colorCode: 'c7',\r\n colorVariable: 'grayscale_gray_components_c7',\r\n },\r\n {\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n colorName: 'Gray Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'grayscale_gray_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.grayscale.grayBorders,\r\n colorName: 'Gray Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'grayscale_gray_borders_c5',\r\n },\r\n {\r\n color: bookitColors.grayscale.graySelection,\r\n colorName: 'Gray Selection',\r\n colorCode: 'c4',\r\n colorVariable: 'grayscale_gray_selection_c4',\r\n },\r\n {\r\n color: bookitColors.grayscale.graybgComponents,\r\n colorName: 'Gray Bg Components',\r\n colorCode: 'c3',\r\n colorVariable: 'grayscale_gray_bg_components_c3',\r\n },\r\n {\r\n color: bookitColors.grayscale.grayBackground,\r\n colorName: 'Gray Background',\r\n colorCode: 'c2',\r\n colorVariable: 'grayscale_gray_background_c2',\r\n },\r\n {\r\n color: bookitColors.grayscale.grayBackgroundLight,\r\n colorName: 'Gray Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'grayscale_gray_bg_light_c1',\r\n },\r\n ],\r\n};\r\nexport const primaryColorMeta: ColorSemanticMeta = {\r\n Name: 'Primary',\r\n Title: 'Primary brand blue color',\r\n Colors: [\r\n {\r\n color: bookitColors.primary.dark,\r\n colorName: 'Dark Text',\r\n colorCode: 'c10',\r\n colorVariable: 'primary_dark_text_c10',\r\n },\r\n {\r\n color: bookitColors.primary.hover,\r\n colorName: 'Hover',\r\n colorCode: 'c9',\r\n colorVariable: 'primary_hover_c9',\r\n },\r\n {\r\n color: bookitColors.primary.regular,\r\n colorName: 'Regular',\r\n colorCode: 'c8',\r\n colorVariable: 'primary_regular_c8',\r\n },\r\n {\r\n color: bookitColors.primary.components,\r\n colorName: 'Components',\r\n colorCode: 'c7',\r\n colorVariable: 'primary_components_c7',\r\n },\r\n {\r\n color: bookitColors.primary.componentsLight,\r\n colorName: 'Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'primary_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.primary.borders,\r\n colorName: 'Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'primary_borders_c5',\r\n },\r\n {\r\n color: bookitColors.primary.disabled,\r\n colorName: 'Disabled',\r\n colorCode: 'c4',\r\n colorVariable: 'primary_disabled_c4',\r\n },\r\n {\r\n color: bookitColors.primary.bgHover,\r\n colorName: 'Background Hover',\r\n colorCode: 'c3',\r\n colorVariable: 'primary_bg_hover_c3',\r\n },\r\n {\r\n color: bookitColors.primary.background,\r\n colorName: 'Background',\r\n colorCode: 'c2',\r\n colorVariable: 'primary_background_c2',\r\n },\r\n {\r\n color: bookitColors.primary.bgLight,\r\n colorName: 'Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'primary_bg_light_c1',\r\n },\r\n ],\r\n};\r\nexport const successColorMeta: ColorSemanticMeta = {\r\n Name: 'Success',\r\n Title: 'Main confirmation messages',\r\n Colors: [\r\n {\r\n color: bookitColors.success.dark,\r\n colorName: 'Dark Text',\r\n colorCode: 'c10',\r\n colorVariable: 'success_dark_text_c10',\r\n },\r\n {\r\n color: bookitColors.success.hover,\r\n colorName: 'Hover',\r\n colorCode: 'c9',\r\n colorVariable: 'success_hover_c9',\r\n },\r\n {\r\n color: bookitColors.success.regular,\r\n colorName: 'Regular',\r\n colorCode: 'c8',\r\n colorVariable: 'success_regular_c8',\r\n },\r\n {\r\n color: bookitColors.success.components,\r\n colorName: 'Components',\r\n colorCode: 'c7',\r\n colorVariable: 'success_components_c7',\r\n },\r\n {\r\n color: bookitColors.success.componentsLight,\r\n colorName: 'Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'success_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.success.borders,\r\n colorName: 'Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'success_borders_c5',\r\n },\r\n {\r\n color: bookitColors.success.disabled,\r\n colorName: 'Disabled',\r\n colorCode: 'c4',\r\n colorVariable: 'success_disabled_c4',\r\n },\r\n {\r\n color: bookitColors.success.bgHover,\r\n colorName: 'Background Hover',\r\n colorCode: 'c3',\r\n colorVariable: 'success_bg_hover_c3',\r\n },\r\n {\r\n color: bookitColors.success.background,\r\n colorName: 'Background',\r\n colorCode: 'c2',\r\n colorVariable: 'success_background_c2',\r\n },\r\n {\r\n color: bookitColors.success.bgLight,\r\n colorName: 'Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'success_bg_light_c1',\r\n },\r\n ],\r\n};\r\nexport const dangerColorMeta: ColorSemanticMeta = {\r\n Name: 'Danger',\r\n Title: 'For main danger buttons and indication',\r\n Colors: [\r\n {\r\n color: bookitColors.danger.dark,\r\n colorName: 'Dark Text',\r\n colorCode: 'c10',\r\n colorVariable: 'danger_dark_text_c10',\r\n },\r\n {\r\n color: bookitColors.danger.hover,\r\n colorName: 'Hover',\r\n colorCode: 'c9',\r\n colorVariable: 'danger_hover_c9',\r\n },\r\n {\r\n color: bookitColors.danger.regular,\r\n colorName: 'Regular',\r\n colorCode: 'c8',\r\n colorVariable: 'danger_regular_c8',\r\n },\r\n {\r\n color: bookitColors.danger.components,\r\n colorName: 'Components',\r\n colorCode: 'c7',\r\n colorVariable: 'danger_components_c7',\r\n },\r\n {\r\n color: bookitColors.danger.componentsLight,\r\n colorName: 'Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'danger_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.danger.borders,\r\n colorName: 'Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'danger_borders_c5',\r\n },\r\n {\r\n color: bookitColors.danger.disabled,\r\n colorName: 'Disabled',\r\n colorCode: 'c4',\r\n colorVariable: 'danger_disabled_c4',\r\n },\r\n {\r\n color: bookitColors.danger.bgHover,\r\n colorName: 'Background Hover',\r\n colorCode: 'c3',\r\n colorVariable: 'danger_bg_hover_c3',\r\n },\r\n {\r\n color: bookitColors.danger.background,\r\n colorName: 'Background',\r\n colorCode: 'c2',\r\n colorVariable: 'danger_background_c2',\r\n },\r\n {\r\n color: bookitColors.danger.bgLight,\r\n colorName: 'Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'danger_bg_light_c1',\r\n },\r\n ],\r\n};\r\nexport const alertColorMeta: ColorSemanticMeta = {\r\n Name: 'alert',\r\n Title: 'For main alert buttons and indication',\r\n Colors: [\r\n {\r\n color: bookitColors.warning.dark,\r\n colorName: 'Dark Text',\r\n colorCode: 'c10',\r\n colorVariable: 'alert_dark_text_c10',\r\n },\r\n {\r\n color: bookitColors.warning.hover,\r\n colorName: 'Hover',\r\n colorCode: 'c9',\r\n colorVariable: 'alert_hover_c9',\r\n },\r\n {\r\n color: bookitColors.warning.regular,\r\n colorName: 'Regular',\r\n colorCode: 'c8',\r\n colorVariable: 'alert_regular_c8',\r\n },\r\n {\r\n color: bookitColors.warning.components,\r\n colorName: 'Components',\r\n colorCode: 'c7',\r\n colorVariable: 'alert_components_c7',\r\n },\r\n {\r\n color: bookitColors.warning.componentsLight,\r\n colorName: 'Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'alert_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.warning.borders,\r\n colorName: 'Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'alert_borders_c5',\r\n },\r\n {\r\n color: bookitColors.warning.disabled,\r\n colorName: 'Disabled',\r\n colorCode: 'c4',\r\n colorVariable: 'alert_disabled_c4',\r\n },\r\n {\r\n color: bookitColors.warning.bgHover,\r\n colorName: 'Background Hover',\r\n colorCode: 'c3',\r\n colorVariable: 'alert_bg_hover_c3',\r\n },\r\n {\r\n color: bookitColors.warning.background,\r\n colorName: 'Background',\r\n colorCode: 'c2',\r\n colorVariable: 'alert_background_c2',\r\n },\r\n {\r\n color: bookitColors.warning.bgLight,\r\n colorName: 'Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'alert_bg_light_c1',\r\n },\r\n ],\r\n};\r\nexport const violetColorMeta: ColorSemanticMeta = {\r\n Name: 'Violet',\r\n Title: 'Secondary',\r\n Colors: [\r\n {\r\n color: bookitColors.secondary.violet.dark,\r\n colorName: 'Dark Text',\r\n colorCode: 'c10',\r\n colorVariable: 'secondary_violet_dark_text_c10',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.hover,\r\n colorName: 'Hover',\r\n colorCode: 'c9',\r\n colorVariable: 'secondary_violet_hover_c9',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.regular,\r\n colorName: 'Regular',\r\n colorCode: 'c8',\r\n colorVariable: 'secondary_violet_regular_c8',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.components,\r\n colorName: 'Components',\r\n colorCode: 'c7',\r\n colorVariable: 'secondary_violet_components_c7',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.componentsLight,\r\n colorName: 'Components Light',\r\n colorCode: 'c6',\r\n colorVariable: 'secondary_violet_components_light_c6',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.borders,\r\n colorName: 'Borders',\r\n colorCode: 'c5',\r\n colorVariable: 'secondary_violet_borders_c5',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.disabled,\r\n colorName: 'Disabled',\r\n colorCode: 'c4',\r\n colorVariable: 'secondary_violet_disabled_c4',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.bgHover,\r\n colorName: 'Background Hover',\r\n colorCode: 'c3',\r\n colorVariable: 'secondary_violet_bg_hover_c3',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.background,\r\n colorName: 'Background',\r\n colorCode: 'c2',\r\n colorVariable: 'secondary_violet_background_c2',\r\n },\r\n {\r\n color: bookitColors.secondary.violet.bgLight,\r\n colorName: 'Background Light',\r\n colorCode: 'c1',\r\n colorVariable: 'secondary_violet_bg_light_c1',\r\n },\r\n ],\r\n};\r\n","/**\r\n * UserProfileSettings\r\n */\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nexport const USER_PROFILE_KEYS = ['SideBarExpanded'] as const;\r\nexport class UserProfile {\r\n savedSettings: UserProfileSettings[];\r\n constructor(settings: UserProfileSettings[]) {\r\n this.savedSettings = settings;\r\n }\r\n public GetSettingByKey(key: string): UserProfileSettings | null {\r\n if (this.savedSettings.length > 0) {\r\n let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n return sett === undefined ? null : sett;\r\n } else {\r\n return null;\r\n }\r\n }\r\n public GetSettingByKeyOrDefault(key: string): UserProfileSettings {\r\n let defaultSetting = {\r\n Key: key,\r\n Value: '',\r\n Enabled: false,\r\n Selected: false,\r\n UserName: '',\r\n Id: 0,\r\n Name: '',\r\n AdGroup: '',\r\n DefaultGroups: '',\r\n IsMultiple: null,\r\n StaffEnabled: false,\r\n } as UserProfileSettings;\r\n if (this.savedSettings.length > 0) {\r\n let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n return sett === undefined ? defaultSetting : sett;\r\n } else {\r\n return defaultSetting;\r\n }\r\n }\r\n public UpdateSettingByKey(key: string): UserProfileSettings {\r\n let defaultSetting = {\r\n Key: key,\r\n Value: '',\r\n Enabled: false,\r\n Selected: false,\r\n UserName: '',\r\n Id: 0,\r\n Name: '',\r\n AdGroup: '',\r\n DefaultGroups: '',\r\n IsMultiple: null,\r\n StaffEnabled: false,\r\n } as UserProfileSettings;\r\n if (this.savedSettings.length > 0) {\r\n let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n return sett === undefined ? defaultSetting : sett;\r\n } else {\r\n return defaultSetting;\r\n }\r\n }\r\n public GetSettingValueBy(\r\n comparator: (item: UserProfileSettings) => boolean,\r\n ): UserProfileSettings | undefined {\r\n return this.savedSettings.find(comparator);\r\n }\r\n\r\n public GetSettingValueByKey(key: string): any | null {\r\n if (this.savedSettings.length > 0) {\r\n let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n switch (key) {\r\n case 'SideBarExpanded': {\r\n return sett === undefined ? true : sett.Enabled;\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n public GetSideBarExpanded(key: string): any | null {\r\n if (this.savedSettings.length > 0) {\r\n let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n switch (key) {\r\n case 'SideBarExpanded': {\r\n return sett === undefined ? true : sett.Enabled;\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n}\r\n","import { RootState } from 'types';\r\nimport { createSelector } from '@reduxjs/toolkit';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { initialState } from '.';\r\nimport { UserRegistersToSpecificCoresType } from 'enums/enums';\r\nimport { appendTrailingSlash } from 'utils/url-utils';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { Entity } from 'types/common';\r\nimport { pickBy } from 'lodash';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n return state.appSettings || initialState;\r\n};\r\nexport const selectAppSettings = createSelector(\r\n [selectSlice],\r\n state => state.appSettings,\r\n);\r\n\r\nexport const selectKnownModules = createSelector(\r\n [selectAppSettings],\r\n state => state?.Modules,\r\n);\r\nexport const selectKnownModule = createSelector(\r\n [selectKnownModules, (state, knownModules: KnownModules) => knownModules],\r\n (state, knownModules: KnownModules) => state?.includes(knownModules) ?? false,\r\n);\r\nexport const selectSystemLocale = createSelector(\r\n [selectAppSettings],\r\n state => state?.Globalization.Locale,\r\n);\r\nexport const selectDateFnsLocale = createSelector(\r\n [selectAppSettings],\r\n state => {\r\n const locale = state?.Globalization?.Locale;\r\n return locale === undefined\r\n ? undefined\r\n : dateUtils.dateFnsCultureName(locale);\r\n },\r\n);\r\nexport const selectUseAmPm = createSelector([selectAppSettings], state => {\r\n return state?.Globalization?.UseAmPm;\r\n});\r\nexport const selectSystemFirstDayOfWeek = createSelector(\r\n [selectAppSettings],\r\n state => state?.Globalization.FirstDayOfWeek ?? 1,\r\n);\r\nexport const selectWebVersion = createSelector(\r\n [selectAppSettings],\r\n state => state?.WebVersion,\r\n);\r\nconst DefaultUploadFileSizeLimit = 500000;\r\nexport const selectUploadFileSizeLimit = createSelector(\r\n [selectAppSettings],\r\n state => state?.UploadFileSizeLimit || DefaultUploadFileSizeLimit,\r\n);\r\nexport const selectMinimizedBookitlabLogo = createSelector(\r\n [selectAppSettings],\r\n state => state?.MinimizedBookitlabLogo || false,\r\n);\r\nconst defaultForbiddenFileExtensions = [\r\n '.dll',\r\n '.exe',\r\n '.vbs',\r\n '.js',\r\n '.ts',\r\n '.tsx',\r\n '.msi',\r\n '.com',\r\n '.bat',\r\n];\r\nexport const selectForbiddenFileExtensions = createSelector(\r\n [selectAppSettings],\r\n state => state?.ForbiddenFileExtensions ?? defaultForbiddenFileExtensions,\r\n);\r\nexport const selectLastCodeUpdate = createSelector(\r\n [selectAppSettings],\r\n state => state?.LastCodeUpdate,\r\n);\r\nexport const selectAppTimeZone = createSelector(\r\n [selectAppSettings],\r\n state => state?.TimeZone,\r\n);\r\nexport const selectPublicUrl = createSelector([selectAppSettings], state =>\r\n state?.PublicBaseUrl === undefined\r\n ? undefined\r\n : appendTrailingSlash(state.PublicBaseUrl),\r\n);\r\nexport const selectRegisterUserGroup = createSelector(\r\n [selectAppSettings],\r\n state => state?.DefaultRegistrationGroup,\r\n);\r\nexport const selectOffsetDate = createSelector(\r\n [selectAppTimeZone, (state, date: Date | string | undefined | null) => date],\r\n (timeZone, date) => {\r\n const systemOffset = timeZone?.TimezoneOffsetMinutes ?? 0;\r\n let correctDate =\r\n date === null || date === undefined\r\n ? dateUtils.dateOrStringToDate(new Date())\r\n : dateUtils.dateOrStringToDate(date);\r\n const currentDateOffset = correctDate.getTimezoneOffset();\r\n const dateOrNow = dateUtils.addMinutes(\r\n correctDate,\r\n systemOffset + currentDateOffset,\r\n );\r\n return dateOrNow;\r\n },\r\n);\r\nexport const selectUserRegistersToSpecificCores = createSelector(\r\n [selectAppSettings],\r\n state =>\r\n (state?.UserRegistersToSpecificCores as UserRegistersToSpecificCoresType) ||\r\n UserRegistersToSpecificCoresType.UserRegistersToSpecificCores_NA,\r\n);\r\nexport const selectEmailFromAddress = createSelector(\r\n [selectAppSettings],\r\n state => state?.EmailFromAddress,\r\n);\r\nexport const selectExistingImages = createSelector(\r\n [selectAppSettings],\r\n state => state?.ExistingImages,\r\n);\r\nconst constructAuthenticatedUser = (a?: IAuthenticatedUser) => {\r\n return a === undefined ? undefined : new AuthenticatedUser(a);\r\n};\r\nconst selectAuthenticatedUserObject = createSelector(\r\n [selectSlice],\r\n state => state.authenticatedUser,\r\n);\r\nexport const selectAuthenticatedUser = createSelector(\r\n [selectAuthenticatedUserObject],\r\n state => {\r\n const a = state;\r\n const b = constructAuthenticatedUser(a);\r\n return b;\r\n },\r\n);\r\n/**\r\n * Returns enabled asset attributes for current session (public/private)\r\n * */\r\nexport const selectAssetFieldSettings = createSelector(\r\n [selectAppSettings, selectAuthenticatedUser],\r\n (appSettings, authenticatedUser) =>\r\n pickBy(\r\n appSettings?.AssetFieldSettings,\r\n (value, key) => value.IsPublic || authenticatedUser !== undefined,\r\n ),\r\n);\r\nexport const selectAssetPopupSettings = createSelector(\r\n [selectAppSettings, selectAssetFieldSettings, selectAuthenticatedUser],\r\n (appSettings, assetFieldSettings, authenticatedUser) => {\r\n return Object.entries(assetFieldSettings).map(([key, value]) => ({\r\n Id: key,\r\n Visible: true,\r\n DisplayName: value.DisplayName,\r\n }));\r\n },\r\n);\r\nexport const selectIsFullScreen = createSelector(\r\n [selectSlice],\r\n state => state.isFullScreen,\r\n);\r\nexport const selectCurrentLanguage = createSelector(\r\n [selectSlice],\r\n state => state.currentLanguage,\r\n);\r\n\r\nexport const selectLoading = createSelector([selectSlice], state => {\r\n let loading =\r\n state.isAuthenticated === true\r\n ? state.loadingAppSettings ||\r\n state.loadingSiteMapSettings ||\r\n state.loadingUserProfileSettings ||\r\n state.loadingSystemSettings\r\n : state.isAuthenticated === false\r\n ? state.loadingAppSettings || state.loadingSystemSettings\r\n : state.loadingAuthenticatedUser || state.loadingSystemSettings;\r\n return loading;\r\n});\r\nexport const selectError = createSelector([selectSlice], state => state.error);\r\nexport const selectLoadingUser = createSelector(\r\n [selectSlice],\r\n state => state.loadingAuthenticatedUser,\r\n);\r\nexport const selectNotifications = createSelector(\r\n [selectSlice],\r\n state => state.notifications,\r\n);\r\nconst selectGlobalSettingsObj = createSelector(\r\n [selectSlice],\r\n state => state.systemSettings,\r\n);\r\nexport const selectglobalSettings = createSelector(\r\n [selectGlobalSettingsObj],\r\n state => new GlobalSettings(state || ([] as SettingModel[])),\r\n);\r\nexport const selectGlobalSetting = createSelector(\r\n [selectGlobalSettingsObj, (state, name: AllowedSettings) => name],\r\n (globalSettingsObj, name) => {\r\n const x = globalSettingsObj.find(\r\n f =>\r\n f.Name.trim().toLowerCase() ===\r\n AllowedSettings[name].trim().toLowerCase(),\r\n );\r\n return x?.Value ?? undefined;\r\n },\r\n);\r\nexport const selectImageExist = createSelector(\r\n [selectExistingImages, (state, image: string | null) => image],\r\n (existingImages, image) => {\r\n let result = false;\r\n if (image === null) {\r\n return false;\r\n }\r\n if (!!existingImages && existingImages.length > 0) {\r\n result = existingImages.some(f => f === image);\r\n }\r\n return result;\r\n },\r\n);\r\nexport const selectGlobalSettingBool = createSelector(\r\n [selectGlobalSettingsObj, (state, name: AllowedSettings) => name],\r\n (globalSettingsObj, name) => {\r\n const x = globalSettingsObj.find(\r\n f =>\r\n f.Name.trim().toLowerCase() ===\r\n AllowedSettings[name].trim().toLowerCase(),\r\n );\r\n return x?.Value === null ||\r\n x?.Value === undefined ||\r\n x.Value === '' ||\r\n x.Value.toLowerCase() === 'false'\r\n ? false\r\n : x.Value.toLowerCase() === 'true';\r\n },\r\n);\r\nexport const selectSiteMapSettings = createSelector(\r\n [selectSlice],\r\n state => state.siteMapSettings,\r\n);\r\nexport const selectSiteMapProvider = createSelector(\r\n [selectSlice],\r\n state => state.siteMapProvider ?? new SiteMapProvider(state.siteMapSettings),\r\n);\r\nexport const selectEventsCount = createSelector(\r\n [selectSlice],\r\n state => state.eventsCount,\r\n);\r\nexport const selectEventsCountLoading = createSelector(\r\n [selectSlice],\r\n state => state.loadingEventsCount,\r\n);\r\nexport const selectUserProfileSettings = createSelector(\r\n [selectSlice],\r\n state => new UserProfile(state.userProfileSettings),\r\n);\r\n/**\r\n * Selects specific user profile setting value provided by the key\r\n * usage example:\r\n * const userProfileValue = useSelector(state => selectUserProfileSetting(state, \"userProfileKey\"))\r\n */\r\nexport const selectUserProfileSetting = createSelector(\r\n [selectUserProfileSettings, (state, key) => key],\r\n (state, key) => state.GetSettingByKey(key)?.Value,\r\n);\r\nexport const selectIsExpanded = createSelector(\r\n [selectSlice],\r\n state => state.isExpanded,\r\n);\r\nexport const selectIsSubBarCollapsed = createSelector(\r\n [selectSlice],\r\n state => state.subBarCollapsed,\r\n);\r\n\r\nexport const selectUpdatedUserProfileSettings = createSelector(\r\n [selectSlice],\r\n state => state.updatedUserProfileSettings,\r\n);\r\nexport const selectIsAuthenticated = createSelector(\r\n [selectSlice],\r\n state => state.isAuthenticated,\r\n);\r\nexport const selectUpdatedExpandState = createSelector(\r\n [selectSlice],\r\n state => state.updatedExpandState,\r\n);\r\nexport const selectIsExpandedSideBar = createSelector(\r\n [selectSlice, (state, isMobile) => isMobile],\r\n (state, isMobile) => {\r\n let result: boolean = false;\r\n if (isMobile) {\r\n result = state.isExpanded;\r\n } else {\r\n if (state.updatedExpandState) {\r\n result = state.isExpanded;\r\n } else {\r\n let sett = new UserProfile(state.userProfileSettings);\r\n let expanded = sett.GetSideBarExpanded('SideBarExpanded');\r\n result = expanded !== null ? expanded : true;\r\n }\r\n }\r\n return result;\r\n },\r\n);\r\nexport const selectGlobalServiceGroupFilter = createSelector(\r\n [selectSlice],\r\n state => {\r\n let topServiceGroupsIsHidden = state.systemSettings.find(\r\n f => f.Id === 'HideTopServiceGroupFilter',\r\n );\r\n if (\r\n topServiceGroupsIsHidden !== null &&\r\n topServiceGroupsIsHidden !== undefined\r\n ) {\r\n if (topServiceGroupsIsHidden.Value === 'True') {\r\n return [];\r\n } else {\r\n return state.globalServiceGroupFilter;\r\n }\r\n } else {\r\n return state.globalServiceGroupFilter;\r\n }\r\n },\r\n);\r\nexport const selectShowGlobalServiceGroupFilter = createSelector(\r\n [selectSlice],\r\n state => state.showGlobalServiceGroupFilter,\r\n);\r\nexport const selectShowGlobalServiceGroupsAsList = createSelector(\r\n [selectSlice],\r\n state => state.showGlobalServiceGroupsAsList,\r\n);\r\nexport const selectBarcodeScanTarget = createSelector(\r\n [selectSlice],\r\n state => state.barcodeScanTarget,\r\n);\r\nexport const selectShowAllCores = createSelector(\r\n [selectSlice],\r\n state => state.showAllCores,\r\n);\r\n\r\n/**\r\n * Selects reservation statuses enabled on the system level\r\n * ```\r\n * const statuses = useSelector(state => selectReservationStatuses(state, t));\r\n * ```\r\n */\r\nexport const selectReservationStatuses = createSelector(\r\n [\r\n selectSlice,\r\n state => selectKnownModule(state, KnownModules.UserGroupCoordRole),\r\n state =>\r\n selectGlobalSettingBool(state, AllowedSettings.AllowWorkflowBooking) &&\r\n selectGlobalSettingBool(\r\n state,\r\n AllowedSettings.MultipleTentativeReservationsUnderWorkflowBooking,\r\n ),\r\n state =>\r\n selectGlobalSettingBool(state, AllowedSettings.DraftReservationsEnabled),\r\n (state, t: TFunction) => t,\r\n ],\r\n (\r\n state,\r\n UserGroupCoordRole,\r\n AllowWorkflowBooking,\r\n DraftReservationsEnabled,\r\n t,\r\n ) => {\r\n const GetListItem = (s: ReservationStatus) => ({\r\n Id: s,\r\n Name: t(ReservationStatus[s]),\r\n });\r\n const list: Array> = [];\r\n\r\n list.push(GetListItem(ReservationStatus.Approved));\r\n list.push(GetListItem(ReservationStatus.Pending));\r\n if (UserGroupCoordRole) {\r\n list.push(GetListItem(ReservationStatus.PendingCoord));\r\n }\r\n list.push(GetListItem(ReservationStatus.Cancelled));\r\n list.push(GetListItem(ReservationStatus.CancelledByAdmin));\r\n if (AllowWorkflowBooking) {\r\n list.push(GetListItem(ReservationStatus.Tentative));\r\n }\r\n if (DraftReservationsEnabled) {\r\n list.push(GetListItem(ReservationStatus.Draft));\r\n }\r\n return list;\r\n },\r\n);\r\n","import { GetBooleanFilterOptions } from 'app/components/BooleanPicker';\r\nimport { ALL_PERIOD_TYPES, PeriodTypes } from 'app/components/DatePeriods';\r\nimport startOfDay from 'date-fns/startOfDay';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { CustomDate, DateType } from 'types/CustomDate';\r\nimport { INumbersRange } from 'types/INumbersRange';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isNullOrUndefined, valOrNull } from 'utils/typeUtils';\r\nimport { FilterValueType } from '../BasicFilter/FilterValueType';\r\nimport {\r\n FilterIntializer,\r\n FilterSerializer,\r\n} from '../BasicFilter/IFilterSettings';\r\nimport { AssetRangeType, isAssetRangeType } from '../Filters/AssetRangeFilter';\r\n\r\nexport interface FilterParam {\r\n Name: string;\r\n Value?: FilterValueType;\r\n}\r\n\r\n/**\r\n * Case Insensitive URLSearchParams\r\n */\r\nexport class URLSearchParamsCI extends URLSearchParams {\r\n constructor(value?: string | URLSearchParams) {\r\n super();\r\n\r\n const params = new URLSearchParams(value);\r\n for (const [name, value] of params) {\r\n this.append(name.toLowerCase(), value);\r\n }\r\n }\r\n public get(name: string): string | null {\r\n return super.get(name.toLowerCase());\r\n }\r\n public set(name: string, value: string | undefined) {\r\n this.delete(name.toLowerCase());\r\n if (value !== undefined) {\r\n super.set(name, value);\r\n }\r\n }\r\n\r\n public toObject() {\r\n const result = {};\r\n for (const key of this.keys()) {\r\n result[key] = this.get(key);\r\n }\r\n return result;\r\n }\r\n\r\n public equals(other: URLSearchParams): boolean {\r\n const b = new URLSearchParamsCI(other);\r\n return this.toString() === b.toString();\r\n }\r\n}\r\n\r\nexport function GetRawValue(params: URLSearchParams, fieldName: string) {\r\n var value = params.get(fieldName);\r\n if (value === null) {\r\n return undefined;\r\n }\r\n if (value === '') {\r\n return null;\r\n }\r\n return setisInversedForUrl(value, false);\r\n}\r\n\r\nexport const isInversedPrefix = 'not;';\r\n\r\nexport function isFilterInversed(val: string | null | undefined) {\r\n if ((val ?? '') === '') {\r\n return false;\r\n }\r\n return val!.startsWith(isInversedPrefix);\r\n}\r\n\r\nexport function findIsfilterInversed(search: string, key: string | undefined) {\r\n if (key === undefined) return undefined;\r\n const params = new URLSearchParams(search);\r\n const val = params.get(key);\r\n return isFilterInversed(val);\r\n}\r\n\r\nexport function setisInversedForUrl<\r\n T extends string | null | undefined = string | null | undefined\r\n>(val: T, isInversed: boolean) {\r\n if ((val ?? '') === '') return val;\r\n const definedVal = val!;\r\n const hasprefix = definedVal.startsWith(isInversedPrefix);\r\n if (isInversed && !hasprefix) {\r\n return isInversedPrefix + definedVal;\r\n }\r\n if (!isInversed && hasprefix) {\r\n return definedVal.substring(isInversedPrefix.length);\r\n }\r\n return definedVal;\r\n}\r\n\r\n/**\r\n *\r\n * @param rawValue\r\n * @returns\r\n */\r\nexport function GetNumberOrUndefined(rawValue: string | undefined | null) {\r\n if (rawValue === undefined) {\r\n return undefined;\r\n }\r\n if (rawValue === null) {\r\n return null;\r\n }\r\n var number = parseInt(rawValue);\r\n if (isNaN(number)) {\r\n return undefined;\r\n }\r\n return number;\r\n}\r\nexport function GetStringOrUndefined(rawValue: string | undefined | null) {\r\n if (rawValue === undefined) {\r\n return undefined;\r\n }\r\n if (rawValue === null) {\r\n return null;\r\n }\r\n if (rawValue === '') {\r\n return null;\r\n }\r\n return rawValue;\r\n}\r\nexport function getStringUnionOrUndefined(\r\n rawValue: string | undefined | null,\r\n unionArray: Array,\r\n) {\r\n if (rawValue === undefined) {\r\n return undefined;\r\n }\r\n if (rawValue === null) {\r\n return null;\r\n }\r\n if (rawValue === '') {\r\n return null;\r\n }\r\n return unionArray.find(\r\n f => f.toLocaleLowerCase() === rawValue?.toLowerCase(),\r\n );\r\n}\r\nexport function GetBooleanOrUndefined(rawValue: string | undefined | null) {\r\n if (rawValue === undefined) {\r\n return undefined;\r\n }\r\n if (rawValue === null) {\r\n return null;\r\n }\r\n const value = rawValue.toLowerCase() === 'true';\r\n return value;\r\n}\r\nexport function GetDateOrUndefined(\r\n rawValue: string | undefined | null,\r\n type?: DateType,\r\n) {\r\n if (rawValue === undefined) {\r\n return undefined;\r\n }\r\n if (rawValue === null) {\r\n return null;\r\n }\r\n const date = dateUtils.parseQueryStringDate(rawValue);\r\n if (isNaN(date.getTime())) {\r\n return undefined;\r\n }\r\n return new CustomDate(date, type ?? 'complete');\r\n}\r\n\r\nexport function GetPartialEntity(\r\n id: T | undefined | null,\r\n): Identifiable | undefined | null {\r\n if (id === undefined) {\r\n return undefined;\r\n }\r\n if (id === null) {\r\n return null;\r\n }\r\n return { Id: id };\r\n}\r\nexport function GetEnum(\r\n value: string | null | undefined,\r\n enumObject: object,\r\n t: TFunction,\r\n) {\r\n if (value === null) {\r\n return null;\r\n }\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n var options = enumToEntityArray(enumObject, t);\r\n var numValue = tryParseInt(value);\r\n if (numValue === undefined) {\r\n return null;\r\n }\r\n if (isNaN(numValue)) {\r\n return null;\r\n }\r\n var item = options.find(f => f.Id === numValue);\r\n\r\n return item ?? null;\r\n}\r\nexport function GetBooleanEntity(\r\n value: boolean | undefined | null,\r\n t: TFunction,\r\n): Entity | undefined | null {\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n if (value === null) {\r\n return null;\r\n }\r\n return {\r\n Id: value,\r\n Name: t(value === true ? translations.Yes : translations.No),\r\n };\r\n}\r\n\r\nexport const initPickerValue = (\r\n f: (value: string) => Promise[]>,\r\n additionalOptions?: Array>,\r\n): FilterIntializer => {\r\n return async (item: FilterValueType) => {\r\n const x = item as Identifiable;\r\n const id = x.Id;\r\n // if some \"addionalItem\" are injected through the filter - first try to look the entity there\r\n // for example, the \"all my managed servcies\" - with the magic -999 id\r\n const additionalItem = additionalOptions?.find(option => option.Id === id);\r\n if (additionalItem !== undefined) {\r\n return Promise.resolve(additionalItem);\r\n }\r\n const failureResult: Entity = { Id: id, Name: 'N/A' };\r\n if (item === null || (!!x && x.Id === '')) {\r\n return Promise.resolve(failureResult);\r\n }\r\n try {\r\n const data: any = await f(id.toString());\r\n const verifiedData = !!data.value ? data.value : data;\r\n const name =\r\n verifiedData.length > 0\r\n ? (verifiedData[0] as Entity)\r\n : failureResult;\r\n return name;\r\n } catch {\r\n return failureResult;\r\n }\r\n };\r\n};\r\nexport const initExPickerValue = (\r\n f: (\r\n value: string,\r\n sourceUrl?: any,\r\n withoutServiceGroups?: boolean,\r\n ) => Promise[]>,\r\n additionalOptions?: Array>,\r\n sourceUrl?: any,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n return async (item: FilterValueType) => {\r\n const x = item as Identifiable;\r\n const id = x.Id;\r\n // if some \"addionalItem\" are injected through the filter - first try to look the entity there\r\n // for example, the \"all my managed servcies\" - with the magic -999 id\r\n const additionalItem = additionalOptions?.find(option => option.Id === id);\r\n if (additionalItem !== undefined) {\r\n return Promise.resolve(additionalItem);\r\n }\r\n const failureResult: Entity = { Id: id, Name: 'N/A' };\r\n if (item === null || (!!x && x.Id === '')) {\r\n return Promise.resolve(failureResult);\r\n }\r\n try {\r\n const data: any = await f(id.toString(), sourceUrl, withoutServiceGroups);\r\n const verifiedData = !!data.value ? data.value : data;\r\n const name =\r\n verifiedData.length > 0\r\n ? (verifiedData[0] as Entity)\r\n : failureResult;\r\n return name;\r\n } catch {\r\n return failureResult;\r\n }\r\n };\r\n};\r\n\r\nexport const initMultiExPickerValue = (\r\n f: (\r\n value: string | undefined,\r\n sourceUrl?: any,\r\n separator?: string,\r\n serviceGroups?: Array>,\r\n ) => Promise[]>,\r\n additionalOptions?: Entity[],\r\n sourceUrl?: any,\r\n separator?: string,\r\n): FilterIntializer => {\r\n return async (\r\n item: FilterValueType,\r\n serviceGroups?: Array>,\r\n ) => {\r\n const x = item as Identifiable[];\r\n const ids = x.map(v => v.Id);\r\n const additionalItems = additionalOptions?.filter(option =>\r\n ids.includes(option.Id),\r\n );\r\n if (additionalItems && additionalItems.length) {\r\n return additionalItems;\r\n }\r\n const failureResult: Entity[] = [];\r\n if (item === null || (!!x && !x.length) || ids.every(v => !v || v === '')) {\r\n return failureResult;\r\n }\r\n try {\r\n const data: Entity[] = await f(\r\n ids.join(separator || '|'),\r\n sourceUrl,\r\n separator || '|',\r\n serviceGroups,\r\n );\r\n return data.length > 0 ? data : failureResult;\r\n } catch {\r\n return failureResult;\r\n }\r\n };\r\n};\r\n\r\nexport const initMultiPickerValue = (\r\n f: (value: string) => Promise[]>,\r\n additionalOptions?: Entity[],\r\n) => {\r\n return async (item: FilterValueType) => {\r\n const x = item as Identifiable[];\r\n const ids = x.map(v => v.Id);\r\n const additionalItems = additionalOptions?.filter(option =>\r\n ids.includes(option.Id),\r\n );\r\n if (additionalItems && additionalItems.length) {\r\n return Promise.resolve(additionalItems);\r\n }\r\n const failureResult: Entity[] = [];\r\n if (\r\n item === null ||\r\n (!!x && !x.length) ||\r\n ids.every(v => v === undefined || v === null || v === '')\r\n ) {\r\n return Promise.resolve(failureResult);\r\n }\r\n try {\r\n const data = await f(ids.join('|'));\r\n return data.length > 0 ? data : failureResult;\r\n } catch {\r\n return failureResult;\r\n }\r\n };\r\n};\r\n\r\nexport function getFilterParams(search: string): FilterParam[] {\r\n let result = [] as FilterParam[];\r\n const params = new URLSearchParams(search);\r\n params.forEach((value, key) => {\r\n if (value !== '' && value !== undefined)\r\n result.push({ Name: key, Value: value });\r\n });\r\n return result;\r\n}\r\n\r\nexport function getDefaultFilterValue(\r\n name: string,\r\n params: FilterParam[],\r\n): string | undefined {\r\n const f = params.find(item => item.Name === name && item.Value !== '');\r\n if (f !== undefined) {\r\n return f.Value as string;\r\n } else return undefined;\r\n}\r\n\r\nexport function getDefaultFilterBool(\r\n name: string,\r\n params: FilterParam[],\r\n t: TFunction,\r\n): Entity | null {\r\n const f = params.find(item => item.Name === name && item.Value !== '');\r\n const value = f?.Value;\r\n const options = GetBooleanFilterOptions(t);\r\n\r\n return options.find(item => item.Id.toString() === value) ?? null;\r\n}\r\n\r\nexport function getDefaultFilterDate(\r\n name: string,\r\n params: FilterParam[],\r\n): Date | null {\r\n const st = getDefaultFilterValue(name, params);\r\n if (st === undefined) {\r\n return null;\r\n }\r\n const date = dateUtils.parseQueryStringDate(st);\r\n if (date === null) {\r\n return null;\r\n }\r\n return startOfDay(date);\r\n}\r\nexport const getPeriodTypeNameOrUndefined = (s: string | null | undefined) => {\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const lowered = s?.toLowerCase();\r\n const namedValue: PeriodTypes | undefined = ALL_PERIOD_TYPES.find(\r\n f => f.toLowerCase() === lowered,\r\n );\r\n if (namedValue !== undefined) {\r\n return namedValue;\r\n }\r\n\r\n const num = GetNumberOrUndefined(s);\r\n if (num === null || num === undefined) {\r\n return null;\r\n }\r\n if (isNaN(num)) {\r\n return null;\r\n }\r\n\r\n if (num >= 0 && num < ALL_PERIOD_TYPES.length) {\r\n const numberedValue = ALL_PERIOD_TYPES[num];\r\n return numberedValue;\r\n }\r\n\r\n return namedValue;\r\n};\r\n\r\nexport function getDefaultFilterDatePeriod(\r\n periodTypeFieldName: string,\r\n customStartFieldName: string,\r\n customEndFieldName: string,\r\n params: URLSearchParams,\r\n): PresetDatesRange | undefined | null {\r\n let periodType = getPeriodTypeNameOrUndefined(\r\n GetRawValue(params, periodTypeFieldName),\r\n );\r\n\r\n const start = GetDateOrUndefined(\r\n GetRawValue(params, customStartFieldName),\r\n 'complete',\r\n );\r\n const end = GetDateOrUndefined(\r\n GetRawValue(params, customEndFieldName),\r\n 'complete',\r\n );\r\n\r\n // set the periodType to CustomDate if either start or end date were provided\r\n // this intended to handle cases where a link to the page is not fully constructed\r\n // e.g. /sompage?start=xxx will be translated to period type=CustomDate, start=xxx\r\n if (isNullOrUndefined(periodType)) {\r\n if (!isNullOrUndefined(start) || !isNullOrUndefined(end)) {\r\n periodType = 'CustomDate';\r\n }\r\n }\r\n\r\n if (periodType === undefined || periodType === null) {\r\n return periodType;\r\n }\r\n\r\n if (periodType === 'CustomDate') {\r\n return PresetDatesRange.Custom(start, end);\r\n } else {\r\n return PresetDatesRange.fromType(periodType, null, null);\r\n }\r\n}\r\n\r\nexport const presetDatesRangeToQueryString = (\r\n periodTypeFieldName,\r\n customStartFieldName,\r\n customEndFieldName,\r\n) => (value: FilterValueType | undefined) => {\r\n var result = new URLSearchParams();\r\n\r\n if (value === null) {\r\n result.append(periodTypeFieldName, '');\r\n return result;\r\n }\r\n if (value !== null && value !== undefined) {\r\n const type = (value as PresetDatesRange).type?.Id;\r\n const id = (value as PresetDatesRange).type?.Id;\r\n\r\n if (id !== undefined) {\r\n result.append(periodTypeFieldName, id.toString());\r\n if (type === 'CustomDate') {\r\n var start = (value as PresetDatesRange).start;\r\n if (start !== null && start !== undefined) {\r\n result.append(\r\n customStartFieldName,\r\n dateUtils.formatQueryStringDate(start, {\r\n representation:\r\n (start as CustomDate)?.representation ?? 'complete',\r\n }),\r\n );\r\n }\r\n var end = (value as PresetDatesRange).end;\r\n if (end !== null && end !== undefined) {\r\n result.append(\r\n customEndFieldName,\r\n dateUtils.formatQueryStringDate(end, {\r\n representation:\r\n (start as CustomDate)?.representation ?? 'complete',\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n};\r\n\r\nexport const getDefaultFilterNumberPeriod = (\r\n fieldName: string,\r\n params: URLSearchParams,\r\n): INumbersRange | undefined | null => {\r\n const start = GetNumberOrUndefined(GetRawValue(params, `${fieldName}-min`));\r\n const end = GetNumberOrUndefined(GetRawValue(params, `${fieldName}-max`));\r\n if (start === undefined && end === undefined) {\r\n return undefined;\r\n } else if (start === null && end === null) {\r\n return null;\r\n } else {\r\n return {\r\n start: start ?? null,\r\n end: end ?? null,\r\n };\r\n }\r\n};\r\nexport const NumebersRangeToQueryString = fieldName => (\r\n value: FilterValueType | undefined,\r\n) => {\r\n var result = new URLSearchParams();\r\n const startFieldName = `${fieldName}-min`;\r\n const endFieldName = `${fieldName}-max`;\r\n if (value === null) {\r\n result.append(startFieldName, '');\r\n result.append(endFieldName, '');\r\n return result;\r\n }\r\n if (value !== null && value !== undefined) {\r\n const start = (value as INumbersRange)?.start;\r\n const end = (value as INumbersRange)?.end;\r\n\r\n result.append(startFieldName, start?.toString() ?? '');\r\n result.append(endFieldName, end?.toString() ?? '');\r\n }\r\n return result;\r\n};\r\nexport const formatQueryStringDateValue: (\r\n fieldName: string,\r\n) => FilterSerializer = (fieldName: string) => (\r\n value: FilterValueType | undefined | null,\r\n) => {\r\n var result = new URLSearchParams();\r\n if (value === null) {\r\n result.set(fieldName, '');\r\n }\r\n if (\r\n value !== undefined &&\r\n value !== null &&\r\n !isNaN((value as Date)?.getTime?.())\r\n ) {\r\n result.set(\r\n fieldName,\r\n dateUtils.formatQueryStringDate(value as Date, {\r\n representation: 'date',\r\n }),\r\n );\r\n }\r\n return result;\r\n};\r\nfunction serializeValue(value: FilterValueType): string | undefined | null {\r\n try {\r\n if (value === null) {\r\n return null;\r\n }\r\n return typeof value === 'string'\r\n ? value\r\n : typeof value === 'number'\r\n ? value?.toString()\r\n : value instanceof CustomDate\r\n ? dateUtils.formatQueryStringDate(value, {\r\n representation: (value as CustomDate).representation ?? 'date',\r\n })\r\n : value instanceof Date\r\n ? dateUtils.formatQueryStringDate(value)\r\n : (value as Entity)?.Id?.toString();\r\n } catch {\r\n return undefined;\r\n }\r\n}\r\n\r\nexport const defaultSerializer: (\r\n fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n var result = new URLSearchParams();\r\n if (value === null) {\r\n result.set(fieldName, '');\r\n }\r\n if (value !== undefined) {\r\n var stringValue = serializeValue(value);\r\n if (stringValue !== null && stringValue !== undefined) {\r\n result.set(fieldName, stringValue);\r\n }\r\n }\r\n return result;\r\n};\r\n\r\nexport const arrayToQueryString: (\r\n fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n let result = new URLSearchParams();\r\n if (Array.isArray(value) || value == null) {\r\n let stringValues = value\r\n ?.map(v => serializeValue(v))\r\n .filter(v => v !== undefined);\r\n result.set(fieldName, stringValues?.join('|') ?? '');\r\n }\r\n return result;\r\n};\r\n\r\nexport const arrayByNameEntityNumberToQueryString: (\r\n fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n let result = new URLSearchParams();\r\n if (Array.isArray(value) || value == null) {\r\n let stringValues = value\r\n ?.map(v => (v as Entity)?.Name?.toString())\r\n .filter(v => v !== undefined);\r\n result.set(fieldName, stringValues?.join('|') ?? '');\r\n }\r\n return result;\r\n};\r\nexport const getStringEntityArray = (\r\n params: URLSearchParams,\r\n fieldName: string,\r\n): FilterValueType | undefined => {\r\n let search = GetRawValue(params, fieldName);\r\n if (search === undefined) return undefined;\r\n if (search === null) return null;\r\n let allSearch = splitFilterValue(search).map(v => GetStringOrUndefined(v));\r\n allSearch = allSearch.filter(v => v !== undefined);\r\n if (!allSearch.length) return undefined;\r\n let allEntities = allSearch.map(v => GetPartialEntity(v));\r\n allEntities = allEntities.filter(v => v !== undefined);\r\n if (!allEntities.length) return undefined;\r\n return allEntities as FilterValueType;\r\n};\r\n\r\nexport const getNumberEntityArray = (\r\n params: URLSearchParams,\r\n fieldName: string,\r\n): FilterValueType | undefined => {\r\n let search = GetRawValue(params, fieldName);\r\n return getNumberEntityArrayFromString(search) as FilterValueType;\r\n};\r\nexport const getNumberEntityArrayFromString = (\r\n search: string | undefined | null,\r\n) => {\r\n if (search === undefined) return undefined;\r\n if (search === null) return null;\r\n let allSearch = splitFilterValue(search).map(v => GetNumberOrUndefined(v));\r\n allSearch = allSearch.filter(v => v !== undefined);\r\n if (!allSearch.length) return undefined;\r\n let allEntities = allSearch.map(v => GetPartialEntity(v));\r\n allEntities = allEntities.filter(v => v !== undefined);\r\n if (!allEntities.length) return undefined;\r\n return allEntities;\r\n};\r\n\r\nexport const assetRangeSerializer: (fieldName: string) => FilterSerializer = (\r\n fieldname: string,\r\n) => value => {\r\n const res = new URLSearchParams();\r\n if (isAssetRangeType(value)) {\r\n res.set(fieldname + 'Val', serializeValue(value.value) ?? '');\r\n res.set(fieldname + 'Type', serializeValue(value.unitType) ?? '');\r\n }\r\n return res;\r\n};\r\n\r\nexport const getAssetRange = (\r\n params: URLSearchParams,\r\n fieldName: string,\r\n): FilterValueType | undefined => {\r\n const val = GetRawValue(params, fieldName + 'Val');\r\n const type = GetRawValue(params, fieldName + 'Type');\r\n if (\r\n valOrNull(val) === null ||\r\n isNaN(parseFloat(val ?? '')) ||\r\n valOrNull(type) === null ||\r\n isNaN(parseInt(type ?? ''))\r\n ) {\r\n return undefined;\r\n }\r\n return {\r\n unitType: { Id: parseInt(type ?? '') },\r\n value: parseFloat(val ?? ''),\r\n } as AssetRangeType;\r\n};\r\nexport const getSplitNumberArray = (search: string): number[] => {\r\n return splitFilterValue(search)\r\n .map(v => {\r\n var number = parseInt(v);\r\n if (isNaN(number)) {\r\n return 0;\r\n }\r\n return number;\r\n })\r\n .filter(f => f > 0);\r\n};\r\nexport const splitFilterValue = (search: string, separator?: string) => {\r\n let x = search.indexOf(separator ?? '|') >= 0 ? separator ?? '|' : ',';\r\n let allSearch = search.split(x);\r\n return allSearch;\r\n};\r\nexport const joinArray = (values: Array, separator?: string) => {\r\n return values.join(separator ?? '|');\r\n};\r\n","import axios, { AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { uniqueId } from 'lodash';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\naxios.defaults.baseURL = process.env.PUBLIC_URL;\r\naxios.defaults.timeout = 600000;\r\n\r\n/**\r\n * Check if HTTP status is a success - anything in 2xx range\r\n * e.g. 200, 201, etc.\r\n * @param status HTTP_STATUS\r\n * @returns true for all success statuses\r\n */\r\nconst isStatusOK = (status: number) => status >= 200 && status < 300;\r\n\r\nexport type BatchRequest = {\r\n id?: string;\r\n method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';\r\n pathName: string;\r\n search?: URLSearchParams;\r\n body?: any;\r\n};\r\ninterface BatchResponse {\r\n id: string;\r\n atomicityGroup: string;\r\n status: StatusCodes;\r\n headers: Record;\r\n body?: unknown;\r\n}\r\nexport interface BatchResponses {\r\n responses: BatchResponse[];\r\n}\r\n// const y = {\r\n// responses: [\r\n// {\r\n// id: 'g1_0',\r\n// atomicityGroup: 'f27f07a2-e8f4-4c62-8216-4611e3ba07c6',\r\n// status: 204,\r\n// headers: { 'odata-version': '4.0' },\r\n// },\r\n// {\r\n// id: 'g1_1',\r\n// atomicityGroup: 'f27f07a2-e8f4-4c62-8216-4611e3ba07c6',\r\n// status: 204,\r\n// headers: { 'odata-version': '4.0' },\r\n// },\r\n// ],\r\n// };\r\n// const x = {\r\n// requests: [\r\n// {\r\n// method: 'PATCH',\r\n// atomicityGroup: 'g1',\r\n// url:\r\n// 'http://localhost:3194/bkt_webApp/api/odata/v4/ServiceRequestTickets(650)',\r\n// headers: {\r\n// 'content-type':\r\n// 'application/json; odata.metadata=minimal; odata.streaming=true',\r\n// 'odata-version': '4.0',\r\n// },\r\n// id: 'g1_0',\r\n// body: { Index: 0 },\r\n// },\r\n// {\r\n// method: 'PATCH',\r\n// atomicityGroup: 'g1',\r\n// url:\r\n// 'http://localhost:3194/bkt_webApp/api/odata/v4/ServiceRequestTickets(651)',\r\n// headers: {\r\n// 'content-type':\r\n// 'application/json; odata.metadata=minimal; odata.streaming=true',\r\n// 'odata-version': '4.0',\r\n// },\r\n// id: 'g1_1',\r\n// body: { Index: 1 },\r\n// },\r\n// ],\r\n// };\r\n\r\nclass Client {\r\n public cancelToken = axios.CancelToken;\r\n public async get(\r\n url: string,\r\n params?: any,\r\n cancelToken?: CancelToken,\r\n ): Promise {\r\n try {\r\n const response = await axios.get(url, {\r\n params: params,\r\n cancelToken: cancelToken,\r\n });\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n } catch (err) {\r\n throw err;\r\n }\r\n }\r\n public async put>(\r\n url: string,\r\n data?: any,\r\n config?: AxiosRequestConfig,\r\n ): Promise {\r\n const response = await axios.put(url, data, config);\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n }\r\n public async post(\r\n url: string,\r\n data?: any,\r\n config?: AxiosRequestConfig,\r\n ): Promise {\r\n try {\r\n const response = await axios.post(url, data, config);\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n public async patch(\r\n url: string,\r\n data?: any,\r\n config?: AxiosRequestConfig,\r\n ): Promise {\r\n const response = await axios.patch(url, data, config);\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n }\r\n public async delete>(\r\n url: string,\r\n config?: AxiosRequestConfig,\r\n ): Promise {\r\n const response = await axios.delete(url);\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n }\r\n public async deleteCustom(\r\n url: string,\r\n config?: AxiosRequestConfig,\r\n ): Promise {\r\n const response = await axios.delete(url);\r\n if (isStatusOK(response.status)) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n }\r\n public async batch(b: Array): Promise {\r\n const atomicityGroup = 'g1';\r\n const payload = {\r\n requests: b\r\n // each request needs to be fully qualified e.g. https://foo/api/odata/v4/entity otherwise odata throws NullRef exception regarding virtualpath\r\n .map((r, index) => {\r\n const rootedPathWithSearch = toRootedURL(\r\n r.pathName + (r.search === undefined ? '' : `?${r.search}`),\r\n );\r\n return {\r\n method: r.method,\r\n atomicityGroup: atomicityGroup,\r\n url: new URL(rootedPathWithSearch, new URL(window.location.origin)),\r\n\r\n headers: {\r\n 'content-type':\r\n 'application/json; odata.metadata=minimal; odata.streaming=true',\r\n 'odata-version': '4.0',\r\n },\r\n id: r.id ?? uniqueId(`${atomicityGroup}_`),\r\n body: r.body,\r\n };\r\n }),\r\n };\r\n const response: AxiosResponse = await axios.post(\r\n '/api/odata/v4/$batch',\r\n payload,\r\n );\r\n\r\n if (\r\n response.data.responses.every(response => isStatusOK(response.status))\r\n ) {\r\n return response.data;\r\n } else {\r\n throw response;\r\n }\r\n }\r\n public async batchDelete(urls: string[]) {\r\n return this.batch(\r\n urls.map(f => ({\r\n pathName: f,\r\n method: 'DELETE',\r\n })),\r\n );\r\n }\r\n /**\r\n * Response type is blob by default due to historical reasons. If json is expected, then\r\n * uploadFile('url', data, {resposneType:'json'})\r\n * @param url\r\n * @param file\r\n * @param config\r\n */\r\n public async uploadFile(url, file, config?: AxiosRequestConfig) {\r\n const formData = new FormData();\r\n formData.append('File', file);\r\n const response = await axios.post(url, formData, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n Accept: 'application/json',\r\n },\r\n ...config,\r\n });\r\n return response;\r\n }\r\n}\r\nexport const httpClient = new Client();\r\n","import { IconName as fontawesome_IconName } from '@fortawesome/fontawesome-svg-core';\r\nimport {\r\n FontAwesomeIcon,\r\n FontAwesomeIconProps,\r\n} from '@fortawesome/react-fontawesome';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { getColor, TypeColor, TypeColorOptions } from 'styles/colors/types';\r\nimport { IconName, IconProp } from 'app/AllIcons';\r\n\r\nexport interface IconProps\r\n extends Omit {\r\n color?: TypeColor;\r\n colorExtend?: TypeColorOptions;\r\n icon: IconProp;\r\n info?: string;\r\n}\r\n\r\nexport const Icon = React.forwardRef(function Icon(\r\n { icon, color, colorExtend, info, ...props }: IconProps,\r\n ref,\r\n) {\r\n const iconName = icon as IconName;\r\n //typeof icon === 'string' ? () : (icon as IconProp);\r\n const theme = useTheme();\r\n const defColor = color && getColor(theme, color, colorExtend); //|| theme.palette.common.graySubtitle\r\n\r\n const WithTitle = ({ children }: { children: React.ReactNode }) =>\r\n info ? (\r\n \r\n {children}\r\n \r\n ) : (\r\n <>{children}\r\n );\r\n return (\r\n \r\n \r\n \r\n );\r\n});\r\n// variant with ref - using SvgIcon component\r\n\r\n// export const Icon = React.forwardRef((props, ref) => {\r\n// const { icon, color, ...rest } = props;\r\n// const iconName = icon as IconName;\r\n// const theme = useTheme();\r\n// const defColor = color && getColor(theme, color);\r\n// return (\r\n// \r\n// \r\n// \r\n// );\r\n// });\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useTheme } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { RightSection } from '../wrappers';\r\n\r\nexport interface FormRightSectionProps {\r\n children: React.ReactNode;\r\n isCover?: boolean;\r\n}\r\nexport const FormRightSection = (props: FormRightSectionProps) => {\r\n const { children, isCover } = props;\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView =\r\n isMobile || (sidePanelOpen && !sidePanelExpanded) || isCover;\r\n const theme = useTheme();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Form } from 'formik';\r\nimport { CSSProperties } from '@material-ui/styles';\r\nimport { StyledFormFieldsContainer } from '../StyledFormFieldsContainer';\r\nexport interface IndexNode {\r\n node: React.ReactNode;\r\n index: number | string;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n showMore?: boolean;\r\n}\r\nexport interface StyledFormProps {\r\n onSubmit?: (e?: React.FormEvent | undefined) => void;\r\n children: React.ReactNode;\r\n avoidStyles?: boolean;\r\n id?: string;\r\n sectionStyle?: CSSProperties;\r\n isCover?: boolean;\r\n noPadding?: boolean;\r\n skipShortView?: boolean;\r\n}\r\nexport const StyledForm = (props: StyledFormProps) => {\r\n const {\r\n id,\r\n onSubmit,\r\n avoidStyles,\r\n children,\r\n sectionStyle,\r\n isCover,\r\n noPadding,\r\n skipShortView,\r\n ...other\r\n } = props;\r\n return (\r\n
\r\n \r\n {children}\r\n \r\n \r\n );\r\n};\r\n","import { enumStringKeys } from 'utils/enumKeys';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { httpClient } from './HttpClient';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const SettingsApi = {\r\n getSystemSettingByKey: (payload: { key: string }) => {\r\n const url = '/api/odata/v4/SystemSettings';\r\n const params: {\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $filter: '(Id eq ' + payload.key + ')',\r\n $select: 'Id,Name,Value',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n getAllSystemSetting: () => {\r\n const url = '/api/odata/v4/SystemSettings';\r\n const params: {\r\n $select: string;\r\n } = {\r\n $select: 'Id,Name,Value',\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n getAlowedSystemSetting: () => {\r\n const url = '/api/odata/v4/SystemSettings';\r\n const params: {\r\n $select: string;\r\n $filter?: string;\r\n } = {\r\n $select: 'Id,Name,Value',\r\n };\r\n\r\n let names: Identifiable[] = enumStringKeys(AllowedSettings).map(\r\n v => {\r\n return { Id: v };\r\n },\r\n );\r\n\r\n let filter =\r\n new Condition(\r\n 'Name',\r\n ODataOperators.Includes,\r\n names,\r\n ).toString() ?? '';\r\n params.$filter = filter;\r\n return httpClient.get(url, params);\r\n },\r\n getAllSystemSettingFromList: (keys: string[]) => {\r\n const url = '/api/odata/v4/SystemSettings';\r\n const params: {\r\n $select: string;\r\n $filter?: string;\r\n } = {\r\n $select: 'Id,Name,Value',\r\n };\r\n\r\n let names: Identifiable[] = keys.map(v => {\r\n return { Id: v };\r\n });\r\n\r\n let filter =\r\n new Condition(\r\n 'Name',\r\n ODataOperators.Includes,\r\n names,\r\n ).toString() ?? '';\r\n params.$filter = filter;\r\n return httpClient.get(url, params);\r\n },\r\n getLoginSystemSettings: () => {\r\n const url = '/api/v3/appsettings/GetLoginSettings';\r\n return httpClient.get(url);\r\n },\r\n setSystemSetting: (setting: SettingModel) => {\r\n const url = '/api/odata/v4/SystemSettings';\r\n return httpClient.post(url, setting);\r\n },\r\n};\r\n","import { select } from 'redux-saga/effects';\r\nimport { selectAppSettings, selectIsAuthenticated } from '../selectors';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ConfigurableTypes, ScreensId } from 'enums/ConfigurableTypes';\r\nimport { GetCachedConfigurableColumnsData } from 'app/components/BasicTable/ConfigurableColumns';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\n/**\r\n * Does prefetch for configurable columns for selected table based pages. These should include mostly used/mostly visited ones\r\n */\r\nexport function* doPrefetchConfigurableColumns() {\r\n const settings: AppSettings = yield select(selectAppSettings);\r\n const isAuthenticated: boolean | undefined = yield select(\r\n selectIsAuthenticated,\r\n );\r\n // Ids of the pages (ScreenId enum) and respective required modules\r\n // Some of the pages can be disabled and are not shown so not all of the configurable columns might be needed\r\n const authSet: Array<{ s: ScreensId; m?: KnownModules }> = [\r\n // service groups aka cores directory src\\app\\pages\\CoresDirectoryPage\\index.tsx\r\n { s: ScreensId.CoresDirectory },\r\n // reservation history - C:\\Users\\mikea\\Projects\\bookitlab\\web-ui\\src\\app\\pages\\ReservationHistoryPage\\index.tsx\r\n { s: ScreensId.ReservationHistory },\r\n // user training - src\\app\\pages\\UserTrainingsPage\\index.tsx\r\n { s: ScreensId.UserTraining, m: KnownModules.Instruments },\r\n // training sessions - src\\app\\pages\\TrainingSessionsPage\\index.tsx\r\n {\r\n s: ScreensId.UpcomingTrainingSessions,\r\n m: KnownModules.Instruments,\r\n },\r\n // service requests - src\\app\\pages\\ServiceRequestListPage\\index.tsx\r\n { s: ScreensId.ServiceRequests, m: KnownModules.ServiceRequests },\r\n // my assets / instruments - src\\app\\pages\\MyAssetsPage\\index.tsx\r\n { s: ScreensId.MyAssets },\r\n // work orders aka events aka alerts - src\\app\\pages\\WorkOrdersPage\\index.tsx\r\n { s: ScreensId.Alerts, m: KnownModules.MaintenanceAssets },\r\n ];\r\n const noAuthSet: Array<{ s: ScreensId; m?: KnownModules }> = [\r\n // public assets src\\app\\pages\\PublicAssets\\index.tsx\r\n { s: ScreensId.PublicAssets },\r\n ];\r\n const screens: Array = (isAuthenticated ? authSet : noAuthSet)\r\n .filter(item => item.m === undefined || settings.Modules.includes(item.m))\r\n .map(item => item.s);\r\n // preloads reservations history display columns to get faster to the table data\r\n // does not return anything here, but the fetched data will be already prefetch for the later use elsewhere\r\n screens.map(screenId =>\r\n GetCachedConfigurableColumnsData(\r\n screenId,\r\n ConfigurableTypes.ColumnScreenConfig,\r\n isAuthenticated,\r\n ),\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { SettingsApi } from 'api/SettingsApi';\r\nimport { internalIdLoginActions } from 'app/pages/Animals/InternalIdLoginPage/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { push, replace } from 'connected-react-router';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n call,\r\n put,\r\n takeLatest,\r\n delay,\r\n all,\r\n select,\r\n takeEvery,\r\n takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { appSettingsActions as actions } from '.';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectBarcodeScanTarget,\r\n selectGlobalSetting,\r\n selectSystemFirstDayOfWeek,\r\n selectUserProfileSettings,\r\n} from './selectors';\r\nimport {\r\n LoginTypes,\r\n parseBarcode,\r\n Roles,\r\n SaveUserProfileSettingAction,\r\n ScanTarget,\r\n ScanTemplateResult,\r\n} from './types';\r\nimport { Location } from 'history';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { eventChannel } from 'redux-saga';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { doPrefetchConfigurableColumns } from './workers/doPrefetchConfigurableColumns';\r\nimport { TermsOfUseAgreementApi } from 'api/TermsOfUseAgreementApi';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport function* getAppSettings(action: PayloadAction) {\r\n const requestURL = '/api/v3/appsettings';\r\n const noAuthURL = '/api/v3/appsettings/NotAuthenticatedSettings';\r\n const url = action.payload ? requestURL : noAuthURL;\r\n try {\r\n const appSettings = yield call(httpClient.get, url);\r\n yield put(actions.appSettingsLoaded(appSettings));\r\n yield put(actions.changeLanguage(appSettings.Globalization.Locale));\r\n if (!action.payload) {\r\n yield put(actions.loadSystemSettings_Success(appSettings.noAuthSettings));\r\n }\r\n } catch (err: unknown) {\r\n yield put(\r\n actions.loadError({\r\n message: 'fail -' + (err as AxiosError)?.response?.status,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* getAuthenticatedUser(action: PayloadAction) {\r\n const requestURL = '/api/v3/appsettings/authenticateduser';\r\n try {\r\n const response = yield call(httpClient.get, requestURL);\r\n const user = response as IAuthenticatedUser;\r\n user.LoginType = LoginTypes.Password;\r\n yield put(actions.getAuthenticatedUser_Success(user));\r\n if (user.Roles.indexOf(Roles.LargeAnimalsOperatingRoomTechnician) >= 0) {\r\n yield put(internalIdLoginActions.success(user));\r\n }\r\n } catch (err) {\r\n console.error(err);\r\n const status = (err as AxiosError)?.response?.status;\r\n if (status === 401 || !status || action.payload) {\r\n yield put(actions.setIsAuthenticated(false));\r\n } else {\r\n window.location.replace(toRootedURL('/login'));\r\n }\r\n yield put(actions.getAuthenticatedUser_Error('auth get fail'));\r\n }\r\n}\r\nfunction* doSetIsAuthenticated(action: PayloadAction) {\r\n yield put(actions.IsAuthenticatedChanged(action.payload));\r\n}\r\nfunction* setLanguage(action: PayloadAction) {\r\n if (action.payload === null) {\r\n return;\r\n }\r\n try {\r\n const locale: string = action.payload;\r\n const [language] = locale?.split('-');\r\n\r\n const systemFirstDayOfWeek: number = yield select(\r\n selectSystemFirstDayOfWeek,\r\n );\r\n\r\n yield all([\r\n call(l => i18next.changeLanguage(l), language),\r\n call(l => dateUtils.setLocale(l, systemFirstDayOfWeek), locale),\r\n ]);\r\n yield put(actions.languageChanged(i18next.language));\r\n } catch (err) {\r\n console.error('setLanguage', err);\r\n }\r\n}\r\nfunction* getSiteMapSource() {\r\n const requestURL = '/api/v3/siteMapSettings';\r\n try {\r\n const siteMap = yield call(httpClient.get, requestURL);\r\n yield put(actions.loadSiteMapSettings_Success(siteMap));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(actions.loadSiteMapSettings_Error('site map loding error'));\r\n }\r\n}\r\nfunction* doNavigate(action: PayloadAction) {\r\n if (\r\n typeof action.payload === 'string' &&\r\n action.payload.indexOf('.aspx') > 0\r\n ) {\r\n window.location.href = toRootedURL(action.payload);\r\n } else {\r\n yield put(push(action.payload));\r\n }\r\n}\r\nfunction* getEventsCount() {\r\n const requestURL = '/api/v3/eventsCount';\r\n try {\r\n const count = yield call(httpClient.get, requestURL);\r\n yield put(actions.loadEventsCount_Success(count));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(actions.loadEventsCount_Error('events count loading error'));\r\n }\r\n}\r\nfunction* getUserProfileSettings() {\r\n yield delay(500);\r\n const requestURL = '/api/v3/userProfile';\r\n try {\r\n const settings = yield call(httpClient.get, requestURL);\r\n yield put(actions.loadUserProfile_Success(settings));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(\r\n actions.loadUserProfile_Error('user profile settings loading error'),\r\n );\r\n }\r\n}\r\nfunction* getSystemSettings() {\r\n yield delay(500);\r\n try {\r\n const settings = yield call(SettingsApi.getAlowedSystemSetting);\r\n yield put(actions.loadSystemSettings_Success(settings));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(\r\n actions.loadSystemSettings_Error('user profile settings loading error'),\r\n );\r\n }\r\n}\r\nfunction* getLoginSystemSettings() {\r\n try {\r\n const settings = yield call(SettingsApi.getLoginSystemSettings);\r\n yield put(actions.loadLoginSystemSettings_Success(settings));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(\r\n actions.loadLoginSystemSettings_Error('Login settings loading error'),\r\n );\r\n }\r\n}\r\nfunction* updateUserProfileSettings(\r\n action: PayloadAction<{\r\n key: string;\r\n model: UserProfileSettings;\r\n withDelay?: boolean;\r\n }>,\r\n) {\r\n if (action.payload.withDelay) {\r\n yield delay(500);\r\n }\r\n const sett: UserProfile = yield select(selectUserProfileSettings);\r\n let item = sett.GetSettingByKeyOrDefault(\r\n action.payload.key,\r\n ) as UserProfileSettings;\r\n const payload = Object.assign({}, item, action.payload.model);\r\n const requestURL = `/api/v3/userProfile/update?key=${action.payload.key}`;\r\n try {\r\n const data = yield call(httpClient.put, requestURL, payload);\r\n yield put(actions.updateUserProfile_Success(data));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(\r\n actions.updateUserProfile_Error('user profile settings loading error'),\r\n );\r\n }\r\n}\r\nfunction* doUpdateExpandedState(action: PayloadAction) {\r\n const sett: UserProfile = yield select(selectUserProfileSettings);\r\n let item = sett.GetSettingByKeyOrDefault(\r\n 'SideBarExpanded',\r\n ) as UserProfileSettings;\r\n const payload = Object.assign({}, item, { Enabled: action.payload });\r\n const requestURL = `/api/v3/userProfile/update?key=SideBarExpanded`;\r\n try {\r\n const data = yield call(httpClient.put, requestURL, payload);\r\n yield put(actions.updateExpandedState_Success(data));\r\n } catch (err) {\r\n console.debug(err);\r\n yield put(\r\n actions.updateExpandedState_Error('user profile settings loading error'),\r\n );\r\n }\r\n}\r\n// function* doUpdateExpandedState_Local(action: PayloadAction) {\r\n// yield put(actions.setExpandedState_Local(action.payload));\r\n// }\r\nfunction* doLoadGlobalServiceGroupFilter() {\r\n try {\r\n const url = '/api/odata/v4/servicegroups/GetGlobalServiceGroupsFilter';\r\n const params = { $select: 'Id,Name,SidebarQuickAction' };\r\n const data = yield call(httpClient.get, url, params);\r\n yield put(actions.loadGlobalServiceGroupFilter_Success(data.value));\r\n } catch {\r\n //noop\r\n }\r\n}\r\nfunction* doSaveGlobalServiceGroupFilter(\r\n action: PayloadAction[]>,\r\n) {\r\n try {\r\n const url = '/api/odata/v4/servicegroups/SetGlobalServiceGroupsFilter';\r\n const data = { selection: action.payload.map(f => f.Id) };\r\n yield call(httpClient.post, url, data);\r\n yield put(actions.loadGlobalServiceGroupFilter_Success(action.payload));\r\n\r\n if (action.payload.length <= 3) {\r\n yield put(\r\n actions.addNotification({\r\n key: 'topServiceGroups',\r\n variant: 'success',\r\n message: `${i18next.t(translations.SwitchedTo)} ${action.payload\r\n .map(f => f.Name)\r\n .join(', ')}`,\r\n }),\r\n );\r\n } else {\r\n yield put(\r\n actions.addNotification({\r\n key: 'topServiceGroups',\r\n variant: 'success',\r\n message: `${i18next.t(translations.SwitchedTo)} ${\r\n action.payload[0].Name\r\n } and + ${action.payload.length - 1} more`,\r\n }),\r\n );\r\n }\r\n } catch {\r\n //noop\r\n }\r\n}\r\nfunction* doSaveUserProfileSetting(action: SaveUserProfileSettingAction) {\r\n try {\r\n // save the filter in the backend\r\n const url = `/api/v3/userProfile/update`;\r\n const httpPaload: Partial = {\r\n Value: action.payload.Value,\r\n Enabled: action.payload.Enabled,\r\n };\r\n\r\n yield call(httpClient.put, url, httpPaload, {\r\n params: { key: action.payload.Key },\r\n });\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n}\r\nfunction* doSaveFilter(\r\n action: PayloadAction<{\r\n key: string;\r\n location: Location;\r\n search: string;\r\n }>,\r\n) {\r\n try {\r\n // push new search to browser history\r\n const search = action.payload.search;\r\n const noChangeInURL = new URLSearchParamsCI(search).equals(\r\n new URLSearchParamsCI(action.payload.location.search),\r\n );\r\n if (!noChangeInURL) {\r\n if (\r\n action.payload.location.search !== search ||\r\n (action.payload.location.search === '' && search === '')\r\n ) {\r\n yield put(\r\n actions.navigate({\r\n search: search,\r\n }),\r\n );\r\n }\r\n }\r\n\r\n const authenticatedUser: AuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n yield* doSaveUserProfileSetting({\r\n type: action.type,\r\n payload: {\r\n Key: action.payload.key,\r\n Value: search.toString(),\r\n UserName: authenticatedUser.Id,\r\n Enabled: true,\r\n },\r\n });\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n}\r\n\r\nfunction* doSavePageSize(\r\n action: PayloadAction<{ key: string; value: number }>,\r\n) {\r\n try {\r\n const url = `/api/v3/userProfile/update`;\r\n const httpPaload: Partial = {\r\n Value: action.payload.value.toString(),\r\n };\r\n\r\n yield call(httpClient.put, url, httpPaload, {\r\n params: { key: action.payload.key },\r\n });\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n}\r\nfunction* doSaveCardsMode(\r\n action: PayloadAction<{ key: string; value: boolean }>,\r\n) {\r\n try {\r\n const url = `/api/v3/userProfile/update`;\r\n const httpPaload: Partial = {\r\n Value: action.payload.value.toString(),\r\n };\r\n\r\n yield call(httpClient.put, url, httpPaload, {\r\n params: { key: action.payload.key },\r\n });\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n}\r\nfunction* doUpdateMyListSelected(\r\n action: PayloadAction,\r\n) {\r\n yield put(actions.updateMyList(action.payload));\r\n}\r\n\r\n/**\r\n * Handle barcode scans\r\n * @param action action raised by barcode scanner middleware\r\n */\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n const MIN_LENGTH_DEFAULT = 6;\r\n const minBarcodeLengthString: string | undefined = yield select(state =>\r\n selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n );\r\n const MinBarcodeLength =\r\n tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n // prevent accidental barcode detection on fast user input\r\n if (action.payload.data.length < MinBarcodeLength) {\r\n return;\r\n }\r\n const scannTarget: ScanTarget | undefined = yield select(\r\n selectBarcodeScanTarget,\r\n );\r\n if (scannTarget !== undefined && scannTarget !== ScanTarget.All) {\r\n return;\r\n }\r\n const appSettings: AppSettings = yield select(selectAppSettings);\r\n yield put(\r\n actions.addNotification({\r\n variant: 'info',\r\n message:\r\n i18next.t(translations.BarcodeScanModalBody) +\r\n ' ' +\r\n action.payload.data,\r\n }),\r\n );\r\n try {\r\n // // in case and the barcode is a valid internal url - it should be opened in the current window\r\n // const path = parseBarcodeURL(action, appSettings);\r\n // if (path !== undefined) {\r\n // // perform full navigation since not all target pages are react compatible\r\n // // replace with yeild put(push(path)) when asset details + search are converted to react\r\n // globalThis.window.location.href = toRootedURL(path);\r\n // return;\r\n // }\r\n\r\n // // first lookup room by it's external barcode\r\n // let roomId = yield call(getRoomByExternalBarcode, action.payload.data);\r\n // if (roomId !== undefined) {\r\n // window.location.href = toRootedURL('/Assets/default.aspx', {\r\n // roomid: roomId,\r\n // });\r\n // return;\r\n // }\r\n const scanResult = parseBarcode(action.payload.data, appSettings);\r\n if (scanResult === undefined) {\r\n yield put(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.BarcodeNotFoundEx),\r\n }),\r\n );\r\n return;\r\n } else {\r\n switch (scanResult.type) {\r\n case ScanTemplateResult.Asset:\r\n yield put(push(''));\r\n yield put(replace(`Assets/Details?id=${scanResult.InternalCode}`));\r\n return;\r\n case ScanTemplateResult.Internal:\r\n let roomId = yield call(\r\n getRoomByExternalBarcode,\r\n scanResult.InternalCode ?? action.payload.data,\r\n );\r\n if (roomId !== undefined) {\r\n window.location.href = toRootedURL('/Assets/Public', {\r\n roomid: roomId,\r\n });\r\n return;\r\n }\r\n break;\r\n case ScanTemplateResult.External:\r\n console.error(\r\n `${action.type}`,\r\n action.payload,\r\n 'scanned external URL',\r\n );\r\n yield put(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Error: Scanned external URL',\r\n }),\r\n );\r\n return;\r\n }\r\n }\r\n\r\n // TODO: add other barcode lookups below\r\n\r\n yield put(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.BarcodeNotFoundEx),\r\n }),\r\n );\r\n } catch (error) {\r\n console.error(`${action.type}`, action.payload, error);\r\n }\r\n}\r\nasync function getRoomByExternalBarcode(barcode: string) {\r\n try {\r\n var response: IODataQueryResponse = await httpClient.get(\r\n '/api/odata/v4/rooms',\r\n {\r\n $top: 1,\r\n $select: 'Id',\r\n $filter: new Condition(\r\n 'ExternalBarcode',\r\n ODataOperators.Equals,\r\n barcode,\r\n ).toString(),\r\n },\r\n );\r\n var roomId = response.value[0]?.Id;\r\n return roomId;\r\n } catch (error) {}\r\n}\r\n// function parseBarcodeURL(action, appSettings) {\r\n// try {\r\n// const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n// var url = new URL(action.payload.data);\r\n// var isLocal = url\r\n// .toString()\r\n// .toLowerCase()\r\n// .startsWith(appSettings.PublicBaseUrl.toLowerCase());\r\n// if (!isLocal) {\r\n// console.error(`${action.type}`, action.payload, 'scanned external URL');\r\n// return;\r\n// }\r\n// const path = toRelative(publicBaseURL, url);\r\n// return path;\r\n// } catch (error) {\r\n// return undefined;\r\n// }\r\n// }\r\nfunction* handleFullScreenChange() {\r\n const isFullScreen = document.fullscreenElement !== null;\r\n if (isFullScreen) {\r\n yield put(actions.enterFullScreen_Success());\r\n } else {\r\n yield put(actions.exitFullScreen_Success());\r\n }\r\n}\r\nfunction* doEnterFullScreen(action: PayloadAction<{ selector?: string }>) {\r\n const log = getLogger('doEnterFullScreen');\r\n const selector = action.payload.selector;\r\n const x =\r\n selector === undefined\r\n ? document.documentElement\r\n : document.querySelector(selector);\r\n const fullScreenElement = (x ?? document.documentElement) as HTMLElement & {\r\n mozRequestFullScreen(): Promise;\r\n webkitRequestFullscreen(): Promise;\r\n msRequestFullscreen(): Promise;\r\n };\r\n try {\r\n yield call;\r\n if (fullScreenElement.requestFullscreen) {\r\n fullScreenElement.requestFullscreen();\r\n }\r\n if (fullScreenElement.webkitRequestFullscreen) {\r\n fullScreenElement.webkitRequestFullscreen();\r\n }\r\n if (fullScreenElement.mozRequestFullScreen) {\r\n fullScreenElement.mozRequestFullScreen();\r\n }\r\n if (fullScreenElement.msRequestFullscreen) {\r\n fullScreenElement.msRequestFullscreen();\r\n }\r\n\r\n yield put(actions.enterFullScreen_Success());\r\n log.info('Entered FullScreen', fullScreenElement);\r\n } catch (error) {\r\n log.info('Error entering full screen mode', error);\r\n yield put(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Failed to enter full screen mode. ' + String(error),\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doExitFullScreen() {\r\n const fullScreenExitFunction = document as Document & {\r\n mozCancelFullScreen(): Promise;\r\n webkitExitFullscreen(): Promise;\r\n msExitFullscreen(): Promise;\r\n };\r\n if (document.fullscreenElement !== null) {\r\n if (fullScreenExitFunction.exitFullscreen) {\r\n fullScreenExitFunction.exitFullscreen();\r\n } else if (fullScreenExitFunction.mozCancelFullScreen) {\r\n /* Firefox */\r\n fullScreenExitFunction.mozCancelFullScreen();\r\n } else if (fullScreenExitFunction.webkitExitFullscreen) {\r\n /* Chrome, Safari and Opera */\r\n fullScreenExitFunction.webkitExitFullscreen();\r\n } else if (fullScreenExitFunction.msExitFullscreen) {\r\n /* IE/Edge */\r\n fullScreenExitFunction.msExitFullscreen();\r\n }\r\n }\r\n yield put(actions.exitFullScreen_Success());\r\n}\r\nfunction* doSetBarcodeScannigTarget(\r\n action: PayloadAction,\r\n) {\r\n yield put(actions.barcodeScannigTarget_Success(action.payload));\r\n}\r\nfunction* doShowAllCores(action: PayloadAction) {\r\n yield put(actions.setShowAllCores(action.payload));\r\n}\r\nfunction* doCollapseSubBar(action: PayloadAction) {\r\n yield put(actions.setCollapseSubBar(action.payload));\r\n}\r\nfunction* doAgreeTermOfUse(action: PayloadAction) {\r\n try {\r\n const result = yield call(\r\n TermsOfUseAgreementApi.agreeTermsOfUseAgreement,\r\n action.payload,\r\n );\r\n const response = result as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n } else {\r\n yield put(actions.getAuthenticatedUser(false));\r\n yield put(actions.navigate('/dashboards'));\r\n }\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n}\r\n\r\nexport function* getAppSettingsFromSaga() {\r\n yield takeLatest(actions.loadAppSettings.type, getAppSettings);\r\n yield takeLatest(actions.getAuthenticatedUser.type, getAuthenticatedUser);\r\n yield takeLatest(actions.loadSiteMapSettings.type, getSiteMapSource);\r\n yield takeLatest(actions.changeLanguage.type, setLanguage);\r\n yield takeLatest(actions.loadEventsCount.type, getEventsCount);\r\n yield takeLatest(\r\n actions.loadUserProfileSettings.type,\r\n getUserProfileSettings,\r\n );\r\n yield takeLatest(\r\n actions.updateUserProfileSettings.type,\r\n updateUserProfileSettings,\r\n );\r\n yield takeLatest(actions.setIsAuthenticated.type, doSetIsAuthenticated);\r\n yield takeLatest(actions.updateExpandedState.type, doUpdateExpandedState);\r\n // yield takeLatest(\r\n // actions.updateExpandedState_Local.type,\r\n // doUpdateExpandedState_Local,\r\n // );\r\n yield takeLatest(actions.navigate.type, doNavigate);\r\n yield takeLatest(\r\n actions.loadGlobalServiceGroupFilter.type,\r\n doLoadGlobalServiceGroupFilter,\r\n );\r\n yield takeLatest(\r\n actions.saveGlobalServiceGroupFilter.type,\r\n doSaveGlobalServiceGroupFilter,\r\n );\r\n yield takeLatest(\r\n actions.saveUserProfileSetting.type,\r\n doSaveUserProfileSetting,\r\n );\r\n yield takeLatest(actions.saveFilter.type, doSaveFilter);\r\n yield takeLatest(actions.loadSystemSettings.type, getSystemSettings);\r\n yield takeLatest(\r\n actions.loadLoginSystemSettings.type,\r\n getLoginSystemSettings,\r\n );\r\n // currently prefetch only depends on the modules (appSettings), so it made sense to fire those immediately after the modules availability\r\n yield takeLatest(\r\n actions.appSettingsLoaded.type,\r\n doPrefetchConfigurableColumns,\r\n );\r\n yield takeLatest(actions.savePageSize.type, doSavePageSize);\r\n yield takeLatest(\r\n actions.updateMyListSelected_Local.type,\r\n doUpdateMyListSelected,\r\n );\r\n yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n yield takeLatest(actions.saveCardsMode.type, doSaveCardsMode);\r\n const fullScreenChannel = eventChannel(emitter => {\r\n document.addEventListener('fullscreenchange', emitter);\r\n return () => document.removeEventListener('fullscreenchange', emitter);\r\n });\r\n yield takeEvery(fullScreenChannel, handleFullScreenChange);\r\n yield takeLeading(actions.enterFullScreen, doEnterFullScreen);\r\n yield takeLeading(actions.exitFullScreen, doExitFullScreen);\r\n yield takeLatest(\r\n actions.setBarcodeScannigTarget.type,\r\n doSetBarcodeScannigTarget,\r\n );\r\n yield takeLatest(actions.showAllCores.type, doShowAllCores);\r\n yield takeLatest(actions.collapseSubBar.type, doCollapseSubBar);\r\n yield takeLatest(actions.agreeTermOfUse.type, doAgreeTermOfUse);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { AppSettings, AppSettingsErrorType } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { Notification } from 'types/Notification';\r\nimport { SiteMapSettings } from 'types/SiteMapSettings';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { getAppSettingsFromSaga } from './saga';\r\nimport {\r\n AppSettingsState,\r\n LoginSettingsModel,\r\n LoginTypes,\r\n SaveUserProfileSettingAction,\r\n ScanTarget,\r\n} from './types';\r\nimport * as H from 'history';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\n\r\nexport const initialState: AppSettingsState = {\r\n error: null,\r\n loadingAppSettings: true,\r\n loadingAuthenticatedUser: false,\r\n loadingSiteMapSettings: false,\r\n loadingEventsCount: false,\r\n loadingUserProfileSettings: false,\r\n appSettings: null,\r\n notifications: [],\r\n siteMapSettings: null,\r\n siteMapProvider: null,\r\n eventsCount: 0,\r\n userProfileSettings: [],\r\n updatedUserProfileSettings: false,\r\n isExpanded: false,\r\n globalServiceGroupFilter: undefined,\r\n showGlobalServiceGroupFilter: false,\r\n systemSettings: [],\r\n loadingSystemSettings: false,\r\n isAuthenticated: undefined,\r\n showGlobalServiceGroupsAsList: false,\r\n isFullScreen: false,\r\n barcodeScanTarget: ScanTarget.All,\r\n showAllCores: false,\r\n subBarCollapsed: undefined,\r\n updatedExpandState: undefined,\r\n};\r\n\r\nlet notificationsCount = 1;\r\nconst slice = createSlice({\r\n name: 'appSettings',\r\n initialState,\r\n reducers: {\r\n loadAppSettings(state, action: PayloadAction) {\r\n state.loadingAppSettings = true;\r\n },\r\n appSettingsLoaded(state, action: PayloadAction) {\r\n const appSettings = action.payload;\r\n state.appSettings = appSettings;\r\n state.loadingAppSettings = false;\r\n },\r\n loadError(state, action: PayloadAction) {\r\n //TODO: process error state - show feedback?\r\n state.error = action.payload.message;\r\n state.loadingAppSettings = false;\r\n },\r\n getAuthenticatedUser(state, action: PayloadAction) {\r\n state.loadingAuthenticatedUser = true;\r\n state.authenticatedUser = undefined;\r\n },\r\n getAuthenticatedUser_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n const LoginType = LoginTypes.Password;\r\n state.loadingAuthenticatedUser = false;\r\n state.isAuthenticated = true;\r\n state.authenticatedUser = { ...action.payload, LoginType };\r\n state.currentLanguage = action.payload.Language;\r\n },\r\n getAuthenticatedUser_Error(state, action: PayloadAction) {\r\n state.loadingAuthenticatedUser = false;\r\n },\r\n setIsAuthenticated(state, action: PayloadAction) {},\r\n IsAuthenticatedChanged(state, action: PayloadAction) {\r\n state.isAuthenticated = action.payload;\r\n },\r\n changeLanguage(state, action: PayloadAction) {},\r\n languageChanged(state, action: PayloadAction) {\r\n state.currentLanguage = action.payload;\r\n },\r\n addNotification(state, action: PayloadAction) {\r\n // remove notification with the same key if exists\r\n const key = action.payload.key ?? notificationsCount++;\r\n const index = state.notifications.findIndex(x => x.key === key);\r\n if (index >= 0) {\r\n state.notifications.splice(index, 1);\r\n }\r\n // add new notification\r\n state.notifications.push({\r\n key: key,\r\n ...action.payload,\r\n });\r\n },\r\n addNotifications(state, action: PayloadAction) {\r\n action.payload.forEach(item =>\r\n state.notifications.push({\r\n key: notificationsCount++,\r\n ...item,\r\n }),\r\n );\r\n },\r\n removeNotification(state, action: PayloadAction) {\r\n const index = state.notifications.findIndex(\r\n x => x.key === action.payload,\r\n );\r\n if (index >= 0) {\r\n state.notifications.splice(index, 1);\r\n }\r\n },\r\n loadSiteMapSettings(state) {\r\n state.loadingSiteMapSettings = true;\r\n },\r\n loadSiteMapSettings_Success(state, action: PayloadAction) {\r\n const siteMap = action.payload;\r\n state.siteMapSettings = siteMap;\r\n state.loadingSiteMapSettings = false;\r\n },\r\n loadSiteMapSettings_Error(state, action: PayloadAction) {\r\n state.error = action.payload;\r\n state.loadingSiteMapSettings = false;\r\n },\r\n saveUserProfileSetting(state, action: SaveUserProfileSettingAction) {\r\n function upsert(array: Array, item: T, keyFn: (T) => string) {\r\n const key = keyFn(item);\r\n const e = array.find(a => keyFn(a) === key);\r\n if (e === undefined) {\r\n return array.push(item);\r\n } else {\r\n Object.assign(e, item);\r\n }\r\n }\r\n upsert(\r\n state.userProfileSettings,\r\n {\r\n ...{\r\n Id: 0,\r\n Name: null,\r\n AdGroup: null,\r\n DefaultGroups: null,\r\n Enabled: true,\r\n IsMultiple: false,\r\n Selected: false,\r\n StaffEnabled: false,\r\n },\r\n ...action.payload,\r\n },\r\n f => f.Key?.toLowerCase(),\r\n );\r\n },\r\n saveFilter(\r\n state,\r\n action: PayloadAction<{\r\n key: string;\r\n location: H.LocationDescriptorObject;\r\n search: string;\r\n }>,\r\n ) {\r\n const itemIndex =\r\n state.userProfileSettings.findIndex(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n ) ?? -1;\r\n if (itemIndex >= 0) {\r\n let updatedItem = state.userProfileSettings.find(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n );\r\n if (!!updatedItem) {\r\n updatedItem.Value = action.payload.search;\r\n state.userProfileSettings.splice(itemIndex, 1);\r\n state.userProfileSettings.push(updatedItem);\r\n }\r\n } else {\r\n let item = {\r\n UserName: state.authenticatedUser?.DisplayName,\r\n Id: 0,\r\n Key: action.payload.key,\r\n Value: action.payload.search,\r\n } as UserProfileSettings;\r\n state.userProfileSettings.push(item);\r\n }\r\n // state.userProfileSettings.forEach(item => {\r\n // if (item.Key.toLowerCase() === action.payload.key.toLowerCase()) {\r\n // Object.assign({}, item, { Value: action.payload.search });\r\n // }\r\n // });\r\n // (\r\n // state.siteMapProvider ?? new SiteMapProvider(state.siteMapSettings)\r\n // ).updatePath(action.payload.location.pathname, action.payload.search);\r\n state.siteMapSettings?.userNodes\r\n .map(f => f.ChildNodes)\r\n .flat()\r\n .forEach(element => {\r\n if (element !== undefined) {\r\n const reactUrl = element.reactUrl;\r\n if (reactUrl !== undefined && reactUrl !== null) {\r\n const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n if (elementPath === action.payload.location.pathname) {\r\n element.reactUrl = `${action.payload.location.pathname}?${action.payload.search}`;\r\n element.Url = `${action.payload.location.pathname}?${action.payload.search}`;\r\n }\r\n }\r\n }\r\n });\r\n },\r\n savePageSize(state, action: PayloadAction<{ key: string; value: number }>) {\r\n const itemIndex =\r\n state.userProfileSettings.findIndex(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n ) ?? -1;\r\n if (itemIndex >= 0) {\r\n let updatedItem = state.userProfileSettings.find(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n );\r\n if (!!updatedItem) {\r\n updatedItem.Value = action.payload.value.toString();\r\n state.userProfileSettings.splice(itemIndex, 1);\r\n state.userProfileSettings.push(updatedItem);\r\n }\r\n } else {\r\n let item = {\r\n UserName: state.authenticatedUser?.DisplayName,\r\n Id: 0,\r\n Key: action.payload.key,\r\n Value: action.payload.value.toString(),\r\n } as UserProfileSettings;\r\n state.userProfileSettings.push(item);\r\n }\r\n },\r\n saveCardsMode(\r\n state,\r\n action: PayloadAction<{ key: string; value: boolean }>,\r\n ) {\r\n const itemIndex =\r\n state.userProfileSettings.findIndex(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n ) ?? -1;\r\n if (itemIndex >= 0) {\r\n let updatedItem = state.userProfileSettings.find(\r\n item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n );\r\n if (!!updatedItem) {\r\n updatedItem.Value = action.payload.value.toString();\r\n state.userProfileSettings.splice(itemIndex, 1);\r\n state.userProfileSettings.push(updatedItem);\r\n }\r\n } else {\r\n let item = {\r\n UserName: state.authenticatedUser?.DisplayName,\r\n Id: 0,\r\n Key: action.payload.key,\r\n Value: action.payload.value.toString(),\r\n } as UserProfileSettings;\r\n state.userProfileSettings.push(item);\r\n }\r\n },\r\n loadEventsCount(state) {\r\n state.loadingEventsCount = true;\r\n },\r\n loadEventsCount_Success(state, action: PayloadAction) {\r\n state.eventsCount = action.payload;\r\n state.loadingEventsCount = false;\r\n },\r\n loadEventsCount_Error(state, action: PayloadAction) {\r\n state.error = action.payload;\r\n state.loadingEventsCount = false;\r\n },\r\n\r\n loadSystemSettings(state) {\r\n state.loadingSystemSettings = true;\r\n },\r\n loadSystemSettings_Success(state, action: PayloadAction) {\r\n let data: any = action.payload;\r\n state.systemSettings = !!data.value\r\n ? (data.value as SettingModel[])\r\n : (data as SettingModel[]); /* action.payload; */\r\n state.loadingSystemSettings = false;\r\n },\r\n loadSystemSettings_Error(state, action: PayloadAction) {\r\n state.error = action.payload;\r\n state.loadingSystemSettings = false;\r\n },\r\n\r\n loadLoginSystemSettings(state) {\r\n state.loadingSystemSettings = true;\r\n },\r\n\r\n loadLoginSystemSettings_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n let data: any = action.payload;\r\n data.settings.forEach(s => {\r\n let ss = state.systemSettings.find(f => f.Id === s.Id);\r\n if (ss !== undefined) {\r\n ss.Value = s.Value;\r\n } else {\r\n state.systemSettings.push(s);\r\n }\r\n });\r\n\r\n if (state.appSettings !== null) {\r\n data.Modules.forEach(m => {\r\n if (state.appSettings?.Modules.find(f => f === m) === undefined) {\r\n state.appSettings?.Modules.push(m);\r\n }\r\n });\r\n state.appSettings.LoginScreenCompanyLogo = data.LoginScreenCompanyLogo;\r\n state.appSettings.LoginScreenCompanyLogoLink =\r\n data.LoginScreenCompanyLogoLink;\r\n state.appSettings.LoginScreenCompanyLogoHeight =\r\n data.LoginScreenCompanyLogoHeight;\r\n state.appSettings.ShowForgotPassword = data.ShowForgotPassword;\r\n state.appSettings.Help_Login = data.Help_Login;\r\n } else {\r\n let settings = {} as AppSettings;\r\n settings.LoginScreenCompanyLogo = data.LoginScreenCompanyLogo;\r\n settings.LoginScreenCompanyLogoLink = data.LoginScreenCompanyLogoLink;\r\n settings.LoginScreenCompanyLogoHeight =\r\n data.LoginScreenCompanyLogoHeight;\r\n settings.ShowForgotPassword = data.ShowForgotPassword;\r\n settings.Help_Login = data.Help_Login;\r\n settings.Modules = data.Modules;\r\n settings.WebVersion = data.WebVersion;\r\n settings.LastCodeUpdate = data.LastCodeUpdate;\r\n state.appSettings = settings;\r\n }\r\n state.loadingSystemSettings = false;\r\n },\r\n loadLoginSystemSettings_Error(state, action: PayloadAction) {\r\n state.error = action.payload;\r\n state.loadingSystemSettings = false;\r\n },\r\n\r\n loadUserProfileSettings(state) {\r\n state.loadingUserProfileSettings = true;\r\n },\r\n loadUserProfile_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.userProfileSettings = action.payload;\r\n state.loadingUserProfileSettings = false;\r\n },\r\n loadUserProfile_Error(state, action: PayloadAction) {\r\n state.error = action.payload;\r\n state.loadingUserProfileSettings = false;\r\n },\r\n updateUserProfileSettings(\r\n state,\r\n action: PayloadAction<{ key: string; model: UserProfileSettings }>,\r\n ) {\r\n state.updatedUserProfileSettings = true;\r\n },\r\n updateUserProfile_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.updatedUserProfileSettings = false;\r\n const itemIndex =\r\n state.userProfileSettings.findIndex(\r\n item => item.Key === action.payload.Key,\r\n ) ?? -1;\r\n if (itemIndex >= 0) {\r\n state.userProfileSettings.splice(itemIndex, 1);\r\n state.userProfileSettings.push(action.payload);\r\n } else {\r\n state.userProfileSettings.push(action.payload);\r\n }\r\n },\r\n updateUserProfile_Error(state, action: PayloadAction) {\r\n state.updatedUserProfileSettings = false;\r\n },\r\n updateExpandedState(state, action: PayloadAction) {\r\n state.updatedExpandState = true;\r\n },\r\n updateExpandedState_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.updatedExpandState = false;\r\n const itemIndex =\r\n state.userProfileSettings.findIndex(\r\n item => item.Key === action.payload.Key,\r\n ) ?? -1;\r\n if (itemIndex >= 0) {\r\n state.userProfileSettings.splice(itemIndex, 1);\r\n state.userProfileSettings.push(action.payload);\r\n } else {\r\n state.userProfileSettings.push(action.payload);\r\n }\r\n },\r\n updateExpandedState_Error(state, action: PayloadAction) {\r\n state.updatedExpandState = false;\r\n },\r\n updateExpandedState_Local(state, action: PayloadAction) {\r\n state.isExpanded = action.payload;\r\n },\r\n // setExpandedState_Local(state, action: PayloadAction) {\r\n // state.isExpanded = action.payload;\r\n // },\r\n navigate(\r\n state,\r\n action: PayloadAction>,\r\n ) {},\r\n\r\n showGlobalServiceGroupFilter(state, action: PayloadAction) {\r\n state.showGlobalServiceGroupFilter = action.payload;\r\n },\r\n loadGlobalServiceGroupFilter(state, action: PayloadAction) {},\r\n loadGlobalServiceGroupFilter_Success(\r\n state,\r\n action: PayloadAction[]>,\r\n ) {\r\n state.globalServiceGroupFilter = action.payload;\r\n },\r\n saveGlobalServiceGroupFilter(\r\n state,\r\n action: PayloadAction[]>,\r\n ) {\r\n state.globalServiceGroupFilter = action.payload;\r\n },\r\n saveGlobalServiceGroupFilter_Success(\r\n state,\r\n action: PayloadAction[]>,\r\n ) {\r\n state.globalServiceGroupFilter = action.payload;\r\n },\r\n setShowGlobalServiceGroupsAsList(state, action: PayloadAction) {\r\n state.showGlobalServiceGroupsAsList = action.payload;\r\n },\r\n updateMyListSelected_Local(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n console.log('myListSelected', action.payload);\r\n },\r\n updateMyList(state, action: PayloadAction) {\r\n if (state.appSettings !== null) {\r\n // state.appSettings.myListSelected = action.payload;\r\n }\r\n },\r\n enterFullScreen(state, action: PayloadAction<{ selector?: string }>) {},\r\n exitFullScreen(state, action: PayloadAction) {},\r\n enterFullScreen_Success(state, action: PayloadAction) {\r\n state.isFullScreen = true;\r\n },\r\n exitFullScreen_Success(state, action: PayloadAction) {\r\n state.isFullScreen = false;\r\n },\r\n enterFullScreen_Error(\r\n state,\r\n action: PayloadAction<{ selector: string }>,\r\n ) {},\r\n exitFullScreen_Error(state, action: PayloadAction<{ selector: string }>) {},\r\n setBarcodeScannigTarget(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n barcodeScannigTarget_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.barcodeScanTarget = action.payload;\r\n },\r\n barcodeScannigTarget_Error(state, action: PayloadAction) {\r\n state.barcodeScanTarget = undefined;\r\n },\r\n showAllCores(state, action: PayloadAction) {},\r\n setShowAllCores(state, action: PayloadAction) {\r\n state.showAllCores = action.payload;\r\n },\r\n collapseSubBar(state, action: PayloadAction) {},\r\n setCollapseSubBar(state, action: PayloadAction) {\r\n state.subBarCollapsed = action.payload;\r\n },\r\n agreeTermOfUse(state, action: PayloadAction) {},\r\n },\r\n});\r\n\r\nexport const { actions: appSettingsActions } = slice;\r\n\r\nexport const useAppSettingsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: getAppSettingsFromSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useAppSettingsSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import {\r\n Button as MatButton,\r\n ButtonProps as MatButtonProps,\r\n CircularProgress,\r\n} from '@material-ui/core/index';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { capitalize } from 'lodash';\r\nimport * as React from 'react';\r\n// import { generatePath, useHistory } from 'react-router-dom';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport clsx from 'clsx';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nexport type ButtonsVariant =\r\n | 'main'\r\n | 'gray'\r\n | 'accent'\r\n | 'white'\r\n | 'ghost'\r\n | 'ghostColor'\r\n | 'danger'\r\n | 'text'\r\n | 'textGray';\r\nexport interface ButtonProps extends Omit {\r\n processing?: boolean;\r\n /**\r\n * Variants overview:\r\n * main - Regular in figma — main color button, used for CTA (call-to-action) buttons\r\n * white - Secondary White in figma — White button with borders. Used as a button for secondary actions across all application.\r\n * ghost - Ghost Gray in figma — button that in the Resting state looks like a simple text , but it contains internal paddings and color background on hover and focus states\r\n * ghostColor - Ghost Color in figma — button that in the Resting state looks like a link/text button , but it contains internal paddings and color background on hover and focus states\r\n * accent - Accent in figma — Alternative button for the CTA actions, used on the screens that already contain several panels and too many primary buttons. However, this style is now barely used and is candidate to deprecation.\r\n * gray - Secondary Gray in figma — Gray button style that before used in filters. This style is now barely used and is candidate to deprecation.\r\n * danger - Primary Danger in figma — Red filled primary button that is used in the confirmation popups and screens only\r\n * warning - Primary Alert in figma — Alert filled button that is used to warn users on the section when we need to pay attention about some behavior in the component so user should click on it to fix some issue.\r\n * Currntly is used to warn about conflict in the Configurable columns, so user should resolve it.\r\n * text - Text Button in figma - Have similar behavior to Anchor Link.\r\n * textGray - Text Button in figma - The same as text varian only styled as grey text link.\r\n */\r\n variant?: ButtonsVariant;\r\n href?: string | IPathAndQuery;\r\n component?: React.ElementType;\r\n to?: string | IPathAndQuery;\r\n target?: string;\r\n}\r\n\r\nexport const Button = React.forwardRef(\r\n (\r\n {\r\n children,\r\n disabled,\r\n processing,\r\n size = 'medium',\r\n variant = 'main',\r\n href,\r\n component,\r\n title,\r\n to,\r\n ...props\r\n }: ButtonProps,\r\n ref,\r\n ) => {\r\n // const history = useHistory();\r\n const dispatch = useDispatch();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n const absolutePath =\r\n href === undefined\r\n ? undefined\r\n : typeof href === 'string'\r\n ? toRootedURL(href)\r\n : toRootedURL(\r\n (href as IPathAndQuery).path,\r\n (href as IPathAndQuery).search,\r\n );\r\n const handleClick = (e: any) => {\r\n if (props.onClick) {\r\n props.onClick(e);\r\n }\r\n if (!!to) {\r\n let toto = typeof to === 'string' ? to : toLocationDescriptor(to);\r\n dispatch(appActions.navigate(toto));\r\n //history.push(toto);\r\n }\r\n };\r\n return title ? (\r\n <>\r\n {/**/}\r\n \r\n \r\n {\r\n handleClick(event);\r\n }}\r\n className={clsx(\r\n props.className,\r\n `variant${capitalize(variant)}${\r\n props.startIcon !== undefined ? ' hasStartIcon' : ''\r\n }${props.endIcon !== undefined ? ' hasEndIcon' : ''}`,\r\n )}\r\n href={absolutePath}\r\n {...props}\r\n >\r\n {children}\r\n\r\n {processing && }\r\n \r\n \r\n \r\n {/**/}\r\n \r\n ) : (\r\n {\r\n handleClick(event);\r\n }}\r\n className={clsx(\r\n props.className,\r\n `variant${capitalize(variant)}${\r\n props.startIcon !== undefined ? ' hasStartIcon' : ''\r\n }${props.endIcon !== undefined ? ' hasEndIcon' : ''}`,\r\n )}\r\n href={absolutePath}\r\n {...props}\r\n >\r\n {children}\r\n\r\n {processing && }\r\n \r\n );\r\n },\r\n);\r\n","import BasicTypography, { BasicTypographyProps } from './BasicTypography';\r\n\r\nexport function H1(props: BasicTypographyProps) {\r\n const { children, ...other } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport function H2(props: BasicTypographyProps) {\r\n const { children, ...other } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport function H3(props: BasicTypographyProps) {\r\n const { children, ...other } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport function H4(props: BasicTypographyProps) {\r\n const { children, ...other } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport interface SubTitleProps extends BasicTypographyProps {\r\n size?: 'small' | 'medium';\r\n children: React.ReactNode;\r\n}\r\nexport function SubTitle(props: SubTitleProps) {\r\n const { size, children, ...other } = props;\r\n const subtitleVarian = size === 'small' ? 'subtitle2' : 'subtitle1';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nexport interface BodyProps extends BasicTypographyProps {\r\n size?: 'small' | 'medium' | 'large';\r\n bold?: boolean;\r\n children: React.ReactNode;\r\n}\r\nexport function Body(props: BodyProps) {\r\n const { size, bold, children, ...other } = props;\r\n const bodyVarian =\r\n size === 'large'\r\n ? bold\r\n ? 'boldL'\r\n : 'bodyL'\r\n : size === 'small'\r\n ? bold\r\n ? 'boldS'\r\n : 'bodyS'\r\n : bold\r\n ? 'boldM'\r\n : 'bodyM';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nexport interface CaptionProps extends BasicTypographyProps {\r\n bold?: boolean;\r\n children: React.ReactNode;\r\n}\r\nexport function Caption(props: CaptionProps) {\r\n const { bold, children, ...other } = props;\r\n const captionVarian = bold ? 'captionBold' : 'captionRegular';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport interface UppercaseProps extends BasicTypographyProps {\r\n children: React.ReactNode;\r\n}\r\nexport function Uppercase(props: UppercaseProps) {\r\n const { children, ...other } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport interface TipsProps extends BasicTypographyProps {\r\n bold?: boolean;\r\n children: React.ReactNode;\r\n}\r\nexport function Tips(props: TipsProps) {\r\n const { bold, children, ...other } = props;\r\n const tipsVarian = bold ? 'tipsBold' : 'tipsRegular';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport interface InputLabelProps extends BasicTypographyProps {\r\n size?: 'xs' | 'medium';\r\n children: React.ReactNode;\r\n}\r\nexport function InputLabel(props: InputLabelProps) {\r\n const { size, children, ...other } = props;\r\n const inputLabelVarian = size === 'xs' ? 'inputLabelXS' : 'inputLabelM';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nexport interface InputValueProps extends BasicTypographyProps {\r\n size?: 'small' | 'medium';\r\n children: React.ReactNode;\r\n}\r\nexport function InputValue(props: InputValueProps) {\r\n const { size, children, ...other } = props;\r\n const inputValueVarian = size === 'small' ? 'inputValueS' : 'inputValueM';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nexport interface ButtonLabelProps extends BasicTypographyProps {\r\n size?: 'small' | 'medium';\r\n children: React.ReactNode;\r\n}\r\nexport function ButtonLabel(props: ButtonLabelProps) {\r\n const { size, children, ...other } = props;\r\n const buttonLabeVarian = size === 'small' ? 'buttonS' : 'buttonM';\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n","import { trimEnd, trimStart } from 'lodash';\r\nimport * as H from 'history';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport fileDownload from 'js-file-download';\r\nimport axios, { AxiosResponse } from 'axios';\r\n\r\nconst PATH_SEPARATOR = '/';\r\nconst ASP_ROOT = '~';\r\nexport function isAbsoluteURL(urlString: string): boolean {\r\n const lowered = urlString.toLowerCase();\r\n return ['http://', 'https://'].some(schema => lowered.startsWith(schema));\r\n}\r\nfunction isRooted(path: string): boolean {\r\n return path.toLowerCase().startsWith(process.env.PUBLIC_URL.toLowerCase());\r\n}\r\nfunction tryCleanASPRoot(path: string): string {\r\n return path.startsWith(ASP_ROOT) ? path.replace(ASP_ROOT, '') : path;\r\n}\r\nexport function combine(basePath: string, path: string): string {\r\n var result =\r\n trimEnd(basePath, PATH_SEPARATOR) +\r\n PATH_SEPARATOR +\r\n trimStart(path, PATH_SEPARATOR);\r\n return result;\r\n}\r\n\r\n/**\r\n * convert relative path to host rooted, e.g. /reservations -> /bkt_webApp/reservations\r\n * @param path\r\n * @returns url usable in an href attribute\r\n */\r\nexport function toRootedURL(path: string, query?: Record): string {\r\n const cpath = tryCleanASPRoot(path);\r\n const alreadyRoot = isAbsoluteURL(cpath) || isRooted(cpath);\r\n const rootedpath = alreadyRoot\r\n ? cpath\r\n : combine(process.env.PUBLIC_URL, cpath);\r\n const fullPath =\r\n query === undefined ? rootedpath : `${rootedpath}?${toQueryString(query)}`;\r\n return fullPath;\r\n}\r\n\r\n/**\r\n * Converts Record values to string and add to URLSearchParams\r\n * @param p object representation of query string\r\n * @returns URLSearchParams\r\n */\r\nexport function toQueryString(p: Record): URLSearchParams {\r\n var result = new URLSearchParams();\r\n Object.entries(p)\r\n .filter(([key, value]) => value !== undefined)\r\n .forEach(([key, value]) => {\r\n result.append(key, value);\r\n });\r\n return result;\r\n}\r\n\r\nexport function buildURL(path: string, params: Record): string {\r\n var result = [toRootedURL(path), '?', toQueryString(params)].join('');\r\n return result;\r\n}\r\nexport function toRelative(root: URL, url: URL) {\r\n if (root.origin !== url.origin) {\r\n return undefined;\r\n }\r\n if (!url.pathname.toLowerCase().startsWith(root.pathname.toLowerCase())) {\r\n throw new Error('External path found.');\r\n }\r\n const rootPath = appendTrailingSlash(root.pathname);\r\n const pathStart = url.pathname.substr(rootPath.length - 1);\r\n const result = pathStart + url.search + url.hash;\r\n return result;\r\n}\r\nexport function appendTrailingSlash(pathname: string) {\r\n return pathname + (pathname.endsWith('/') ? '' : '/');\r\n}\r\nexport function removeLeadingSlash(pathname: string) {\r\n if (pathname.startsWith('/')) {\r\n return pathname.substring(1);\r\n } else {\r\n return pathname;\r\n }\r\n}\r\n\r\n/**\r\n * Provides absoluteURL (e.g. https://foo.bar/baz?foo) given the usual path & search parameters that can be shared/copied\r\n * @param path target pathName\r\n * @param params search parameters\r\n * @returns absolute url\r\n */\r\nexport function useAbsolute(path?: string, toPath?: string) {\r\n const publicUrl = useSelector(selectPublicUrl);\r\n if (toPath !== undefined) {\r\n path = toPath;\r\n }\r\n if (publicUrl === undefined) {\r\n return undefined;\r\n }\r\n if (path === undefined) {\r\n return undefined;\r\n }\r\n if (isAbsoluteURL(path)) {\r\n return path;\r\n }\r\n\r\n var baseURL = new URL(publicUrl);\r\n var targetURL = new URL(removeLeadingSlash(path), baseURL);\r\n return targetURL.toString();\r\n}\r\n\r\n/**\r\n * Converts odata api parameters to export query string\r\n * @param params odata api parameters\r\n * @returns\r\n */\r\nexport function getExportParameters(params: Record) {\r\n const result = { ...params, $format: 'application/xlsx' };\r\n delete result['$count'];\r\n delete result['$top'];\r\n delete result['$skip'];\r\n return result;\r\n}\r\nexport function getExportForImportParameters(params: Record) {\r\n const result = { ...params };\r\n delete result['$count'];\r\n delete result['$top'];\r\n delete result['$skip'];\r\n return result;\r\n}\r\nexport function openExportLinkOld(\r\n path: string,\r\n params?: Record,\r\n): void {\r\n const url = toRootedURL(path, params);\r\n window.open(url, '_blank');\r\n}\r\n\r\nexport async function openExportLink(\r\n path: string,\r\n params?: Record,\r\n): Promise {\r\n return new Promise(async resolve => {\r\n const url = path.replace(process.env.PUBLIC_URL, '');\r\n try {\r\n const response = await axios.get(url, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n params: params,\r\n });\r\n const cd = response.headers['content-disposition'];\r\n const filename: string =\r\n cd !== undefined ? cd.split('filename=')[1] : 'ExportFile.xlsx';\r\n fileDownload(response.data, filename);\r\n } catch {}\r\n resolve();\r\n });\r\n}\r\n\r\nexport const odataUrlPrefix = '/api/odata/v4/';\r\n\r\nexport type IPathAndQuery = { path: string; search: Record };\r\n\r\nexport function getReturnURL(\r\n location: H.Location,\r\n defaultReturnURL: string = '/',\r\n): string {\r\n try {\r\n const params = new URLSearchParamsCI(location.search);\r\n const returnURLKey = 'returnURL';\r\n const value = params.get(returnURLKey);\r\n return value ?? defaultReturnURL;\r\n } catch (error) {\r\n return defaultReturnURL;\r\n }\r\n}\r\n\r\n/**\r\n * Pipes content-disposition=attachments download links through client side\r\n * @param props\r\n */\r\nexport async function downloadFile(props: {\r\n path: string;\r\n defaultFileName?: string;\r\n}) {\r\n const response = await axios.get(props.path, {\r\n timeout: 60 * 60 * 1000,\r\n responseType: 'blob',\r\n });\r\n const cd = response.headers['content-disposition'];\r\n const [, filename] = cd?.split('=');\r\n fileDownload(\r\n response.data,\r\n decodeURIComponent(filename ?? props.defaultFileName),\r\n );\r\n}\r\n\r\nexport const getFileName = (result: AxiosResponse, defaultName?: string) => {\r\n const cd = result.headers['content-disposition'];\r\n const [, filename] = cd?.split('=');\r\n return filename ?? defaultName;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Notification } from 'types/Notification';\r\nimport { SiteMapProvider, SiteMapSettings } from 'types/SiteMapSettings';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { buildURL } from 'utils/url-utils';\r\n/* --- STATE --- */\r\n\r\n/**\r\n * AppSettings state interface\r\n * TODO: auto generate based on bkt_webApp.Api.V4.Models.SettingsModel\r\n */\r\nexport interface AppSettingsState {\r\n error: string | null;\r\n loadingAppSettings: boolean;\r\n appSettings: AppSettings | null;\r\n loadingAuthenticatedUser: boolean;\r\n loadingSiteMapSettings: boolean;\r\n authenticatedUser?: IAuthenticatedUser;\r\n currentLanguage?: string;\r\n notifications: Notification[];\r\n siteMapSettings: SiteMapSettings | null;\r\n siteMapProvider: SiteMapProvider | null;\r\n eventsCount: number;\r\n loadingEventsCount: boolean;\r\n userProfileSettings: UserProfileSettings[];\r\n loadingUserProfileSettings: boolean;\r\n updatedUserProfileSettings: boolean;\r\n isExpanded: boolean;\r\n systemSettings: SettingModel[];\r\n loadingSystemSettings: boolean;\r\n isAuthenticated?: boolean;\r\n /**\r\n * List of Service Groups selected by the user in the global service group filter aka Top Sg filter\r\n */\r\n globalServiceGroupFilter: Entity[] | undefined;\r\n showGlobalServiceGroupFilter: boolean;\r\n showGlobalServiceGroupsAsList: boolean;\r\n isFullScreen: boolean;\r\n barcodeScanTarget?: ScanTarget;\r\n showAllCores?: boolean;\r\n subBarCollapsed?: boolean;\r\n updatedExpandState?: boolean;\r\n}\r\n\r\nexport type ContainerState = AppSettingsState;\r\n\r\n/**\r\n * User roles enum - local/Bookit.Data/Enums.cs\r\n */\r\n\r\nexport enum Roles {\r\n Administrators = 1,\r\n GroupAdministrators = 2,\r\n InstituteCoord = 3,\r\n HeadOfLab = 4,\r\n CagesAdministrators = 5,\r\n LabTech = 6,\r\n FinAdmin = 7,\r\n RepAdmin = 8,\r\n InventoryAdmin = 9,\r\n UserGroupCoord = 10,\r\n InstrumentEventsAdmin = 11,\r\n GroupBudgetsAdmin = 12,\r\n CalendarOnly = 13,\r\n Readonly = 14,\r\n LoanDeskManager = 15,\r\n EquipmentAdministrator = 16,\r\n UserInquiryAdmin = 17,\r\n ModelAdmin = 18,\r\n RoomOnly = 19,\r\n InvoicesReader = 20,\r\n KioskAdmin = 21,\r\n CustomRole = 22,\r\n BudgetAdmin = 23,\r\n GroupAdminAffiliated = 24,\r\n ServiceGroupBudgetsAdmin,\r\n AnimalAdmin = 25,\r\n /// \r\n /// Users in this role will unlock the large animals operating room pos\r\n /// \r\n LargeAnimalsOperatingRoomUser = 26,\r\n LargeAnimalsOperatingRoomTechnician = 27,\r\n LargeAnimalsOperatingRoomVeterinarian = 28,\r\n CoreBudgetsAdmin = 29,\r\n ConsumableKiosk = 30,\r\n CreateNewAssetsAdmin = 31,\r\n}\r\n\r\nexport enum LoginTypes {\r\n Password,\r\n InternalId,\r\n}\r\nexport type ISaveUserProfileSettingPayload = Pick<\r\n UserProfileSettings,\r\n 'Key' | 'Value' | 'UserName' | 'Enabled'\r\n>;\r\nexport type SaveUserProfileSettingAction = PayloadAction<\r\n ISaveUserProfileSettingPayload\r\n>;\r\nexport interface NoAuthSettings {\r\n defaultUserGroup?: Entity;\r\n registrationEnabled?: boolean;\r\n requiredUserProps: string[];\r\n hiddenUserProps: string[];\r\n}\r\nexport const anonimusUrls = [\r\n 'registeraccount',\r\n 'assets/public',\r\n 'assets/details',\r\n];\r\nexport enum ScanTarget {\r\n All,\r\n Consumables = 1,\r\n Asset = 2,\r\n Inventory = 3,\r\n Login = 4,\r\n}\r\nexport interface BarcodeData {\r\n data: string;\r\n key: ScanTarget;\r\n}\r\nexport interface LoginSettingsModel {\r\n Modules?: KnownModules[];\r\n settings?: SettingModel[];\r\n LoginScreenCompanyLogoLink?: string;\r\n LoginScreenCompanyLogo?: string;\r\n LoginScreenCompanyLogoHeight?: string;\r\n ShowForgotPassword?: boolean;\r\n Help_Login?: string;\r\n WebVersion?: string;\r\n LastCodeUpdate?: Date;\r\n}\r\nexport enum ScanTemplateResult {\r\n Asset,\r\n Room,\r\n Location,\r\n SubLocation,\r\n Plate,\r\n External,\r\n Internal,\r\n}\r\nexport interface BarcodeScanResult {\r\n url: string;\r\n type: ScanTemplateResult;\r\n InternalCode?: string;\r\n RoomId?: string;\r\n LocationId?: string;\r\n SubLocationId?: string;\r\n PlateId?: string;\r\n external?: boolean;\r\n}\r\nexport function parseAssetUrl(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n const template =\r\n appSettings.AssetBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n ? appSettings.AssetBarcodeRelativeUrlTemplate.split('?').join('/')\r\n : appSettings.AssetBarcodeRelativeUrlTemplate;\r\n\r\n const regExpTemplate = template.replace(/:([^\\\\}]+)/g, '(?<$1>\\\\d+)');\r\n\r\n var url = new URL(data);\r\n const path = url.pathname + url.search;\r\n let toCompareUrl =\r\n path.indexOf('?') >= 0 ? path.split('?').join('/') : path;\r\n let internalCode: string | undefined = undefined;\r\n let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n if (regObject !== null) {\r\n let groups = regObject.groups;\r\n if (groups !== undefined) {\r\n internalCode = groups['internalCode'];\r\n }\r\n }\r\n if (internalCode !== undefined) {\r\n let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Details.aspx`, {\r\n InternalCode: internalCode,\r\n });\r\n return {\r\n type: ScanTemplateResult.Asset,\r\n url: resUrl,\r\n InternalCode: internalCode,\r\n } as BarcodeScanResult;\r\n }\r\n return undefined;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n}\r\nfunction parseRoomUrl(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n const template =\r\n appSettings.RoomBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n ? appSettings.RoomBarcodeRelativeUrlTemplate.split('?').join('/')\r\n : appSettings.RoomBarcodeRelativeUrlTemplate;\r\n\r\n const regExpTemplate = template.replace(\r\n /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n '(?<$1>\\\\d+)',\r\n );\r\n\r\n var url = new URL(data);\r\n let toCompareUrl =\r\n url.pathname.indexOf('?') >= 0\r\n ? url.pathname.split('?').join('/')\r\n : url.pathname;\r\n let roomId: string | undefined = undefined;\r\n let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n if (regObject !== null) {\r\n let groups = regObject.groups;\r\n if (groups !== undefined) {\r\n roomId = groups['Id'];\r\n }\r\n }\r\n if (roomId !== undefined) {\r\n let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n RoomId: roomId,\r\n });\r\n return {\r\n type: ScanTemplateResult.Room,\r\n url: resUrl,\r\n RoomId: roomId,\r\n } as BarcodeScanResult;\r\n }\r\n return undefined;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n}\r\nexport function parseLocationUrl(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n const template =\r\n appSettings.LocationBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n ? appSettings.LocationBarcodeRelativeUrlTemplate.split('?').join('/')\r\n : appSettings.LocationBarcodeRelativeUrlTemplate;\r\n\r\n const regExpTemplate = template.replace(\r\n /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n '(?<$1>\\\\d+)',\r\n );\r\n\r\n var url = new URL(data);\r\n let toCompareUrl =\r\n url.pathname.indexOf('?') >= 0\r\n ? url.pathname.split('?').join('/')\r\n : url.pathname;\r\n let locationId: string | undefined = undefined;\r\n let roomId: string | undefined = undefined;\r\n let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n if (regObject !== null) {\r\n let groups = regObject.groups;\r\n if (groups !== undefined) {\r\n locationId = groups['Id'];\r\n roomId = groups['RoomId'];\r\n }\r\n }\r\n if (locationId !== undefined && roomId !== undefined) {\r\n let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n RoomId: roomId,\r\n locationid: locationId,\r\n });\r\n return {\r\n type: ScanTemplateResult.Location,\r\n url: resUrl,\r\n RoomId: roomId,\r\n LocationId: locationId,\r\n } as BarcodeScanResult;\r\n }\r\n return undefined;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n}\r\nexport function parseSubLocationUrl(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n const template =\r\n appSettings.SubLocationBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n ? appSettings.SubLocationBarcodeRelativeUrlTemplate.split('?').join('/')\r\n : appSettings.SubLocationBarcodeRelativeUrlTemplate;\r\n\r\n const regExpTemplate = template.replace(\r\n /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n '(?<$1>\\\\d+)',\r\n );\r\n\r\n var url = new URL(data);\r\n let toCompareUrl =\r\n url.pathname.indexOf('?') >= 0\r\n ? url.pathname.split('?').join('/')\r\n : url.pathname;\r\n let subLocationId: string | undefined = undefined;\r\n let locationId: string | undefined = undefined;\r\n let roomId: string | undefined = undefined;\r\n let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n if (regObject !== null) {\r\n let groups = regObject.groups;\r\n if (groups !== undefined) {\r\n subLocationId = groups['Id'];\r\n locationId = groups['LocationListId'];\r\n roomId = groups['RoomId'];\r\n }\r\n }\r\n if (\r\n subLocationId !== undefined &&\r\n locationId !== undefined &&\r\n roomId !== undefined\r\n ) {\r\n let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n RoomId: roomId,\r\n locationid: locationId,\r\n sublocationid: subLocationId,\r\n });\r\n return {\r\n type: ScanTemplateResult.SubLocation,\r\n url: resUrl,\r\n RoomId: roomId,\r\n LocationId: locationId,\r\n SubLocationId: subLocationId,\r\n } as BarcodeScanResult;\r\n }\r\n return undefined;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n}\r\n\r\nexport function parseBarcodeURL(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n data = data.replace(/=/g, '='); // for backward compatibility\r\n let assetScanned = parseAssetUrl(data, appSettings);\r\n let subLocationScanned = parseSubLocationUrl(data, appSettings);\r\n let locationScanned = parseLocationUrl(data, appSettings);\r\n let roomScanned = parseRoomUrl(data, appSettings);\r\n if (!!assetScanned) {\r\n console.debug(assetScanned);\r\n return assetScanned;\r\n }\r\n if (!!subLocationScanned) {\r\n console.debug(subLocationScanned);\r\n return subLocationScanned;\r\n }\r\n if (!!locationScanned) {\r\n console.debug(locationScanned);\r\n return locationScanned;\r\n }\r\n if (!!roomScanned) {\r\n console.debug(roomScanned);\r\n return roomScanned;\r\n }\r\n return undefined;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n}\r\nexport function parseBarcode(\r\n data: string,\r\n appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n try {\r\n // in case when barcode come as URL, try to create url...\r\n var url = new URL(data);\r\n var isLocal = url\r\n .toString()\r\n .toLowerCase()\r\n .startsWith(appSettings.PublicBaseUrl.toLowerCase());\r\n if (!isLocal) {\r\n console.debug({ InternalCode: data });\r\n return {\r\n url: url.toString(),\r\n type: ScanTemplateResult.External,\r\n InternalCode: data,\r\n external: true,\r\n };\r\n } else {\r\n return parseBarcodeURL(data, appSettings);\r\n }\r\n } catch (error) {\r\n console.debug({ InternalCode: data });\r\n return {\r\n url: buildURL(`${appSettings.PublicBaseUrl}Assets/Details.aspx`, {\r\n InternalCode: data,\r\n }),\r\n type: ScanTemplateResult.Internal,\r\n InternalCode: data,\r\n } as BarcodeScanResult;\r\n }\r\n}\r\n","import React, { lazy, Suspense } from 'react';\r\n\r\ninterface Opts {\r\n fallback: React.ReactNode;\r\n}\r\ntype Unpromisify = T extends Promise ? P : never;\r\n\r\nexport const lazyLoad = <\r\n T extends Promise,\r\n U extends React.ComponentType\r\n>(\r\n importFunc: () => T,\r\n selectorFunc?: (s: Unpromisify) => U,\r\n opts: Opts = { fallback: null },\r\n) => {\r\n let lazyFactory: () => Promise<{ default: U }> = importFunc;\r\n\r\n if (selectorFunc) {\r\n lazyFactory = () =>\r\n importFunc().then(module => ({ default: selectorFunc(module) }));\r\n }\r\n\r\n const LazyComponent = lazy(lazyFactory);\r\n\r\n return (props: React.ComponentProps): JSX.Element => (\r\n \r\n \r\n \r\n );\r\n};\r\n","import { LocationDetailsProps } from 'app/pages/LocationsPage/Details';\r\nimport { AssetPopUpProps } from 'app/pages/AssetPopUp';\r\nimport { QuizDetailsProps } from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { StartQuizProps } from 'app/pages/QuizPage/StartQuiz';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { PaymentProps } from 'app/pages/AddPaymentPage';\r\nimport { ChargeProps } from 'app/pages/AddChargePage';\r\nimport { InvoiceDetailsSidePanelProps } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { BillingActionsDetailsProps } from 'app/pages/BillingActions/BillingActionsDetailsPage/Details';\r\nimport { SavedViewDetailsProps } from 'app/pages/SavedViewsPage/SavedViewPage/Details';\r\nimport { InstrumentRestrictionsProps } from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { InvoiceTemplatePopUpProps } from 'app/pages/InvoiceTemplates/InvoiceTemplatePopUp';\r\nimport { OtherServiceDetailsProps } from 'app/pages/OtherServiceDetails/Details';\r\nimport { PricePeriodDetailsProps } from 'app/pages/PriceSheetPeriodDetails/Details';\r\nimport { CoreSelectionProps } from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { UserAttributesDetailsProps } from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details';\r\nimport { ServiceRequestDetailsProps } from 'app/pages/Samples/RequestSamplesPage';\r\nimport { CalendarMessagesDetailsProps } from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details';\r\nimport { ReportConsumablesProps } from 'app/pages/OtherServiceDetails/ReportConsumables';\r\nimport { ServiceRequestTicketDetailsProps } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\nimport { ServiceRequestMilestoneDetailsProps } from 'app/pages/Samples/components/ServiceRequestMilestoneDetails';\r\nimport { ServiceRequestMilestoneChargeDetailsProps } from 'app/pages/Samples/components/ServiceRequestMilestoneChargeDetails';\r\nimport { StockRenewalProps } from 'app/pages/OtherServiceDetails/StockRenewal';\r\nimport { RenewStockProps } from 'app/pages/OtherServiceDetails/RenewStock';\r\nimport { InventoryBatchProps } from 'app/pages/OtherServiceDetails/InventoryBatch';\r\nimport { InvoiceBatchesCommentsProps } from 'app/pages/InvoiceBatches/InvoiceBatchesComments';\r\nimport { InventoryLogProps } from 'app/pages/AssetsInventoryLog/InventoryLog';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ArticleAssociationFormProps } from 'app/pages/ArticlesPage/ArticleAssociationForm';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\nexport interface LayoutState {\r\n sidePanelState: SidePanelState;\r\n confirmState: ConfirmState;\r\n continueState: ContinueState;\r\n hasAnyNotSavedChanges: boolean;\r\n doRefreshTable: boolean;\r\n hideNavigation?: boolean;\r\n actionTableProcessing?: ProcessingData;\r\n upsnackbarIndex?: boolean;\r\n isMobileView?: boolean;\r\n adminPanelState: AdminPanelState;\r\n}\r\nexport interface SidePanelState {\r\n sidePanelOpen: boolean;\r\n pageType?: RenderPageType;\r\n pageProps?: PageTypeProps;\r\n expanded: boolean;\r\n coverOpen?: boolean;\r\n coverExpanded?: boolean;\r\n}\r\nexport interface ConfirmState {\r\n confirmOpen: boolean;\r\n approved: boolean;\r\n rejected: boolean;\r\n showLocalConfirm: boolean;\r\n continueToLink?: string;\r\n}\r\nexport interface ContinueState {\r\n pageType?: RenderPageType;\r\n pageProps?: PageTypeProps;\r\n expanded?: boolean;\r\n continueOnApprove: boolean;\r\n}\r\nexport interface AdminPanelState {\r\n adminPanelOpen: boolean;\r\n url?: string | IPathAndQuery;\r\n}\r\nexport interface ProcessingData {\r\n name: string;\r\n processing: boolean;\r\n}\r\nexport enum RenderPageType {\r\n TrainingDetails,\r\n QuizCreate,\r\n QuizzDetails,\r\n LocationDetails,\r\n AssetDetails,\r\n WorkOrderDetails,\r\n AddPayment,\r\n AddCharge,\r\n InvoiceDetails,\r\n AddBillingAction,\r\n SavedViewDetails,\r\n LabelType,\r\n LabelTypeEdit,\r\n OtherServiceDetails,\r\n RestrictionDetails,\r\n InvoiceTemplatePopUp,\r\n ReservationDetails,\r\n PricePeriodsDetails,\r\n Article,\r\n CoreSelection,\r\n AssetsSelection,\r\n ArticleNew,\r\n ArticleEdit,\r\n UserAttributesDetails,\r\n ServiceRequestDetails,\r\n CalendarMessagesDetails,\r\n ReportConsumables,\r\n ServiceRequestTicketDetails,\r\n ServiceRequestMilestone,\r\n ServiceRequestMilestoneCharge,\r\n StockRenewal,\r\n RenewStock,\r\n InventoryBatch,\r\n InvoiceBatchesComments,\r\n AssetInventoryLog,\r\n ArticleForm,\r\n RegionDetails,\r\n}\r\nexport interface SidePanelContentProps {\r\n useSidePanel: boolean;\r\n}\r\nexport type PageTypeProps =\r\n | TrainingDetailsProps\r\n | StartQuizProps\r\n | QuizDetailsProps\r\n | LocationDetailsProps\r\n | AssetPopUpProps\r\n | WorkOrderDetailsProps\r\n | PaymentProps\r\n | ChargeProps\r\n | InvoiceDetailsSidePanelProps\r\n | BillingActionsDetailsProps\r\n | SavedViewDetailsProps\r\n | InvoiceTemplatePopUpProps\r\n | OtherServiceDetailsProps\r\n | InstrumentRestrictionsProps\r\n | ReservationDetailsProps\r\n | PricePeriodDetailsProps\r\n | CoreSelectionProps\r\n | AssetsSelectionProps\r\n | UserAttributesDetailsProps\r\n | ServiceRequestDetailsProps\r\n | ServiceRequestTicketDetailsProps\r\n | ReportConsumablesProps\r\n | CalendarMessagesDetailsProps\r\n | ServiceRequestMilestoneDetailsProps\r\n | ServiceRequestMilestoneChargeDetailsProps\r\n | StockRenewalProps\r\n | RenewStockProps\r\n | InventoryBatchProps\r\n | InvoiceBatchesCommentsProps\r\n | InventoryLogProps\r\n | ArticleAssociationFormProps\r\n | RegionDetailsProps;\r\n","import * as React from 'react';\r\nimport {\r\n IconButton as MatIconButton,\r\n IconButtonProps as MatIconButtonProps,\r\n Link,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { capitalize } from 'lodash';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface IconButtonPropsBase\r\n extends Omit {\r\n disabled?: boolean;\r\n children?: React.ReactNode;\r\n href?: string | IPathAndQuery;\r\n to?: string | IPathAndQuery;\r\n target?: string;\r\n icon?: IconProp;\r\n}\r\nexport interface IPrimaryIconStyleThemeProps {\r\n size?: 'large' | 'medium' | 'small' | 'xs';\r\n variant?: ButtonsVariant;\r\n shape?: 'circle' | 'square';\r\n}\r\nexport type IconButtonProps = IconButtonPropsBase & IPrimaryIconStyleThemeProps;\r\n\r\nexport function IconButton(props: IconButtonProps) {\r\n const {\r\n children,\r\n disabled,\r\n size = 'small',\r\n variant = 'main',\r\n shape = 'square',\r\n href,\r\n to,\r\n title,\r\n target,\r\n icon,\r\n ...other\r\n } = props;\r\n const dispatch = useDispatch();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n const handleClick = (e: any) => {\r\n if (props.onClick) {\r\n props.onClick(e);\r\n }\r\n if (!!to) {\r\n let toto = typeof to === 'string' ? to : toLocationDescriptor(to);\r\n dispatch(appActions.navigate(toto));\r\n //history.push(toto);\r\n }\r\n };\r\n const absolutePath =\r\n href === undefined\r\n ? undefined\r\n : typeof href === 'string'\r\n ? toRootedURL(href)\r\n : toRootedURL(\r\n (href as IPathAndQuery).path,\r\n (href as IPathAndQuery).search,\r\n );\r\n\r\n return href ? (\r\n \r\n \r\n {\r\n event.stopPropagation();\r\n handleClick(event);\r\n }}\r\n {...other}\r\n >\r\n {!!children ? children : }\r\n \r\n \r\n \r\n ) : (\r\n \r\n {\r\n event.stopPropagation();\r\n handleClick(event);\r\n }}\r\n disabled={disabled}\r\n disableRipple\r\n {...other}\r\n >\r\n {!!children ? children : }\r\n \r\n \r\n );\r\n}\r\n\r\nexport function WithTitle({\r\n children,\r\n title,\r\n}: React.PropsWithChildren<{\r\n title?: string;\r\n}>) {\r\n if (title) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n } else {\r\n return <>{children};\r\n }\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { delay, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { layoutActions as actions } from '.';\r\nimport { PageTypeProps, RenderPageType } from './type';\r\nimport {\r\n selectAdminPanelOpen,\r\n selectHasNotSavedChanges,\r\n selectSidePanelOpen,\r\n} from './selectors';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\n\r\n// export function* doInitSidePanel() {\r\n// yield put(actions.initLayoutState());\r\n// }\r\nexport function* doOpenSidePanel(\r\n action: PayloadAction<{\r\n type: RenderPageType | undefined;\r\n props: PageTypeProps | undefined;\r\n expanded: boolean | undefined;\r\n }>,\r\n) {\r\n const isChangesNotSaved: boolean = yield select(selectHasNotSavedChanges);\r\n const sidePanelOpen: boolean = yield select(selectSidePanelOpen);\r\n if (isChangesNotSaved) {\r\n yield put(\r\n actions.setContinueState({\r\n type: action.payload.type,\r\n props: action.payload.props,\r\n expanded: action.payload.expanded,\r\n continue: true,\r\n }),\r\n );\r\n yield put(actions.setConfirmOpen(true));\r\n } else {\r\n if (sidePanelOpen) {\r\n yield put(actions.resetSidePanel(true));\r\n yield delay(200);\r\n yield put(\r\n actions.setTuggleOpenState({\r\n expanded: !!action.payload.expanded,\r\n type: action.payload.type,\r\n props: action.payload.props,\r\n open: true,\r\n }),\r\n );\r\n } else {\r\n yield put(\r\n actions.setTuggleOpenState({\r\n expanded: !!action.payload.expanded,\r\n type: action.payload.type,\r\n props: action.payload.props,\r\n open: true,\r\n }),\r\n );\r\n }\r\n }\r\n}\r\nexport function* doOpenAdminPanel(\r\n action: PayloadAction<{\r\n url: string | IPathAndQuery;\r\n }>,\r\n) {\r\n const adminPanelOpen: boolean = yield select(selectAdminPanelOpen);\r\n if (adminPanelOpen) {\r\n yield put(actions.resetAdminPanel(true));\r\n yield delay(100);\r\n yield put(actions.setAdminPanelUrl(action.payload.url));\r\n } else {\r\n yield put(actions.setAdminPanelUrl(action.payload.url));\r\n yield put(actions.setAdminPanelOpen(true));\r\n }\r\n}\r\nexport function* layoutSaga() {\r\n yield takeLatest(actions.openSidePanel.type, doOpenSidePanel);\r\n yield takeLatest(actions.openAdminPanel.type, doOpenAdminPanel);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { layoutSaga } from './saga';\r\nimport {\r\n LayoutState,\r\n PageTypeProps,\r\n ProcessingData,\r\n RenderPageType,\r\n} from './type';\r\n\r\nexport const initialState: LayoutState = {\r\n sidePanelState: {\r\n sidePanelOpen: false,\r\n pageType: undefined,\r\n pageProps: undefined,\r\n expanded: false,\r\n coverOpen: false,\r\n coverExpanded: false,\r\n },\r\n confirmState: {\r\n confirmOpen: false,\r\n approved: false,\r\n rejected: false,\r\n showLocalConfirm: false,\r\n continueToLink: undefined,\r\n },\r\n hasAnyNotSavedChanges: false,\r\n doRefreshTable: false,\r\n continueState: {\r\n continueOnApprove: false,\r\n pageProps: undefined,\r\n pageType: undefined,\r\n expanded: undefined,\r\n },\r\n hideNavigation: undefined,\r\n actionTableProcessing: undefined,\r\n upsnackbarIndex: undefined,\r\n isMobileView: undefined,\r\n adminPanelState: {\r\n adminPanelOpen: false,\r\n url: undefined,\r\n },\r\n};\r\nexport interface IOpenSidePanelPayload {\r\n type: RenderPageType | undefined;\r\n props: PageTypeProps | undefined;\r\n expanded?: boolean;\r\n}\r\n\r\nconst slice = createSlice({\r\n name: 'layout',\r\n initialState,\r\n reducers: {\r\n toggleSidePanel(state, action: PayloadAction) {\r\n state.sidePanelState.sidePanelOpen = action.payload;\r\n },\r\n openSidePanel(state, action: PayloadAction) {},\r\n setTuggleOpenState(\r\n state,\r\n action: PayloadAction<{\r\n expanded: boolean;\r\n type: RenderPageType | undefined;\r\n props: PageTypeProps | undefined;\r\n open: boolean;\r\n }>,\r\n ) {\r\n state.sidePanelState.expanded = action.payload.expanded;\r\n state.sidePanelState.pageProps = action.payload.props;\r\n state.sidePanelState.pageType = action.payload.type;\r\n state.sidePanelState.sidePanelOpen = action.payload.open;\r\n },\r\n setPageType(state, action: PayloadAction) {\r\n state.sidePanelState.pageType = action.payload;\r\n },\r\n setPageProps(state, action: PayloadAction) {\r\n state.sidePanelState.pageProps = action.payload;\r\n },\r\n setExpanded(state, action: PayloadAction) {\r\n state.sidePanelState.expanded = action.payload;\r\n },\r\n resetSidePanel(state, action: PayloadAction) {\r\n state.sidePanelState.sidePanelOpen = action.payload || false;\r\n state.sidePanelState.pageProps = undefined;\r\n state.sidePanelState.pageType = undefined;\r\n state.sidePanelState.expanded = false;\r\n state.sidePanelState.coverExpanded = undefined;\r\n state.sidePanelState.coverOpen = undefined;\r\n state.confirmState = {\r\n confirmOpen: false,\r\n approved: false,\r\n rejected: false,\r\n showLocalConfirm: false,\r\n continueToLink: undefined,\r\n };\r\n state.hasAnyNotSavedChanges = false;\r\n state.upsnackbarIndex = undefined;\r\n },\r\n setConfirmOpen(state, action: PayloadAction) {\r\n state.confirmState.confirmOpen = action.payload;\r\n },\r\n resetConfirmState(state, action: PayloadAction) {\r\n state.confirmState = {\r\n confirmOpen: false,\r\n approved: false,\r\n rejected: false,\r\n showLocalConfirm: false,\r\n continueToLink: undefined,\r\n };\r\n },\r\n setConfirmApproved(state, action: PayloadAction) {\r\n state.confirmState.approved = action.payload;\r\n },\r\n setConfirmRejected(state, action: PayloadAction) {\r\n state.confirmState.rejected = action.payload;\r\n },\r\n setContinueToLink(state, action: PayloadAction) {\r\n state.confirmState.continueToLink = action.payload;\r\n },\r\n setNotSavedChanges(state, action: PayloadAction) {\r\n state.hasAnyNotSavedChanges = action.payload;\r\n },\r\n setRefreshTable(state, action: PayloadAction) {\r\n state.doRefreshTable = action.payload;\r\n },\r\n setActionTableProcessing(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.actionTableProcessing = action.payload;\r\n },\r\n setLocalConfirm(state, action: PayloadAction) {\r\n state.confirmState.showLocalConfirm = action.payload;\r\n },\r\n setContinueOnApprove(state, action: PayloadAction) {\r\n state.continueState.continueOnApprove = action.payload;\r\n },\r\n setHideNavigation(state, action: PayloadAction) {\r\n state.hideNavigation = action.payload;\r\n },\r\n setContinueState(\r\n state,\r\n action: PayloadAction<{\r\n type: RenderPageType | undefined;\r\n props: PageTypeProps | undefined;\r\n expanded: boolean | undefined;\r\n continue: boolean;\r\n }>,\r\n ) {\r\n state.continueState.continueOnApprove = action.payload.continue;\r\n state.continueState.pageProps = action.payload.props;\r\n state.continueState.pageType = action.payload.type;\r\n state.continueState.expanded = action.payload.expanded;\r\n },\r\n resetContinueState(state, action: PayloadAction) {\r\n state.continueState = {\r\n continueOnApprove: false,\r\n pageProps: undefined,\r\n pageType: undefined,\r\n expanded: undefined,\r\n };\r\n },\r\n setUpSnackBarIndex(state, action: PayloadAction) {\r\n state.upsnackbarIndex = action.payload;\r\n },\r\n setIsMobileView(state, action: PayloadAction) {\r\n state.isMobileView = action.payload;\r\n },\r\n setIsCoverOpen(state, action: PayloadAction) {\r\n state.sidePanelState.coverOpen = action.payload;\r\n },\r\n setIsCoverExpanded(state, action: PayloadAction) {\r\n state.sidePanelState.coverExpanded = action.payload;\r\n },\r\n openAdminPanel(\r\n state,\r\n action: PayloadAction<{ url: string | IPathAndQuery }>,\r\n ) {},\r\n resetAdminPanel(state, action: PayloadAction) {\r\n state.adminPanelState.adminPanelOpen = action.payload || false;\r\n state.adminPanelState.url = undefined;\r\n },\r\n setAdminPanelUrl(state, action: PayloadAction) {\r\n state.adminPanelState.url = action.payload;\r\n },\r\n setAdminPanelOpen(state, action: PayloadAction) {\r\n state.adminPanelState.adminPanelOpen = action.payload || false;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: layoutActions } = slice;\r\n\r\nexport const useLayoutSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: layoutSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import React from 'react';\r\nimport { Box as MuiBox, BoxProps as MuiBoxProps } from '@material-ui/core';\r\nexport interface BoxProps extends MuiBoxProps {\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport function Box({ children, ...props }: BoxProps) {\r\n return {children};\r\n}\r\n","import { BudgetFields } from 'enums/BudgetFields';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { KnownModules } from './KnownModules';\r\nimport { Entity } from './common';\r\nimport { ImageSize } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\n\r\nexport enum EnumAssetTypes {\r\n Equipment,\r\n TrainingProgram,\r\n LectureRoom,\r\n ServiceGroup,\r\n SuperGroup,\r\n Request,\r\n OfflineService,\r\n NotAvailable,\r\n}\r\nexport interface AppSettings {\r\n Globalization: CultureInfoModel;\r\n Modules: KnownModules[];\r\n UserInternalIdLength: number | null;\r\n InternalUserId2FieldLength: number | null;\r\n WebVersion: string;\r\n LastCodeUpdate: Date;\r\n UserGroupsProviderType: number;\r\n AssetFieldSettings: Record;\r\n PublicBaseUrl: string;\r\n UploadFileSizeLimit: number;\r\n MinimizedBookitlabLogo: boolean;\r\n ForbiddenFileExtensions: string[];\r\n BudgetFieldSettings: {\r\n BudgetField: BudgetFields;\r\n Disabled: Boolean;\r\n }[];\r\n TimeZone: ITimeZone;\r\n AssetBarcodeUrlTemplate: string;\r\n AssetBarcodeRelativeUrlTemplate: string;\r\n RoomBarcodeUrlTemplate: string;\r\n RoomBarcodeRelativeUrlTemplate: string;\r\n LocationBarcodeUrlTemplate: string;\r\n LocationBarcodeRelativeUrlTemplate: string;\r\n SubLocationBarcodeUrlTemplate: string;\r\n SubLocationBarcodeRelativeUrlTemplate: string;\r\n SamplePlateBarcodeUrlTemplate: string;\r\n SamplePlateBarcodeRelativeUrlTemplate: string;\r\n ConsumableTypeBarcodeUrlTemplate: string;\r\n ConsumableTypeBarcodeRelativeUrlTemplate: string;\r\n RequiredUserProps: string[];\r\n HideUserProps: string[];\r\n DefaultRegistrationGroup: Entity | null;\r\n UserRegistersToSpecificCores: number;\r\n TopCustomerLogoLink: string;\r\n TopCustomerLogo: string;\r\n FavIconImg: string;\r\n FavIconTitle: string;\r\n DTUOrbitWebServiceEnabled: boolean;\r\n PubMedWebServiceEnabled: boolean;\r\n EmailFromAddress: string;\r\n ShowRawErrors: boolean;\r\n ExistingImages: string[];\r\n Help_Login: string | null;\r\n LoginScreenCompanyLogoLink: string;\r\n LoginScreenCompanyLogo: string;\r\n LoginScreenCompanyLogoHeight: string;\r\n ShowForgotPassword: boolean;\r\n AdvancedAssetPublicSearchFilterAttributes: string;\r\n BrowseByUnitBy: number;\r\n noAuthSettings?: SettingModel[];\r\n}\r\n\r\nexport interface ITimeZone {\r\n Id: string;\r\n StandardName: string;\r\n TimezoneOffsetMinutes: number;\r\n DisplayName: string;\r\n}\r\n\r\nexport function IsBudgetFieldEnabled(\r\n setting: AppSettings | null,\r\n BudgetField: BudgetFields,\r\n): boolean {\r\n if (!!setting && setting.BudgetFieldSettings) {\r\n var result = setting.BudgetFieldSettings.find(bf => {\r\n return bf.BudgetField === BudgetField;\r\n });\r\n return result !== undefined ? result.Disabled === false : true;\r\n }\r\n return false;\r\n}\r\nexport interface CultureInfoModel {\r\n Locale: string;\r\n FirstDayOfWeek: number;\r\n UseAmPm: boolean;\r\n}\r\n\r\nexport interface AppSettingsErrorType {\r\n message: string;\r\n}\r\nexport function IsModuleEnabled(\r\n setting: AppSettings | null,\r\n module: KnownModules,\r\n): boolean {\r\n if (!!setting && setting.Modules) {\r\n return setting?.Modules.includes(module);\r\n }\r\n return false;\r\n}\r\nexport function IsAssetFieldEnabled(\r\n setting: AppSettings | null,\r\n AssetField: AssetAttributes,\r\n AssetAvailabilityType?: AssetTypes,\r\n): boolean {\r\n if (!!setting && setting.AssetFieldSettings && AssetField !== undefined) {\r\n const s = setting.AssetFieldSettings[AssetAttributes[AssetField]];\r\n if (s !== undefined) {\r\n if (AssetAvailabilityType !== undefined) {\r\n const id = EnumAssetTypes[AssetAvailabilityType];\r\n return s.AssetTypes.includes(id);\r\n } else {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nexport function IsAssetFieldIsPublic(\r\n setting: AppSettings | null,\r\n AssetField: AssetAttributes,\r\n AssetAvailabilityType?: AssetTypes,\r\n): boolean {\r\n if (!!setting && setting.AssetFieldSettings && AssetField !== undefined) {\r\n const s = setting.AssetFieldSettings[AssetAttributes[AssetField]];\r\n if (s !== undefined) {\r\n if (AssetAvailabilityType !== undefined) {\r\n const id = EnumAssetTypes[AssetAvailabilityType];\r\n return s.AssetTypes.includes(id) && s.IsPublic === true;\r\n } else {\r\n return s.IsPublic === true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nexport function IsAssetImageExist(\r\n settings: AppSettings | null,\r\n imageName: string | null,\r\n imageSize?: ImageSize,\r\n) {\r\n if (\r\n imageName === null ||\r\n settings === null ||\r\n !settings.ExistingImages ||\r\n (!!settings.ExistingImages && settings.ExistingImages.length < 1)\r\n ) {\r\n return false;\r\n }\r\n let result = false;\r\n result =\r\n !!settings.ExistingImages &&\r\n settings.ExistingImages.length > 0 &&\r\n settings.ExistingImages.some(f => f === imageName);\r\n // switch (imageSize) {\r\n // case 'full':\r\n // result =\r\n\r\n // break;\r\n // case 'thumb':\r\n // result =\r\n // !!settings.ExistingImages.ThumbImages &&\r\n // settings.ExistingImages.ThumbImages.length > 0 &&\r\n // settings.ExistingImages.ThumbImages.some(f => f === imageName);\r\n // break;\r\n // case 'vertical':\r\n // result =\r\n // !!settings.ExistingImages.CardVerticalImages &&\r\n // settings.ExistingImages.CardVerticalImages.length > 0 &&\r\n // settings.ExistingImages.CardVerticalImages.some(f => f === imageName);\r\n // break;\r\n // case 'horizontal':\r\n // result =\r\n // !!settings.ExistingImages.CardHorizontalImages &&\r\n // settings.ExistingImages.CardHorizontalImages.length > 0 &&\r\n // settings.ExistingImages.CardHorizontalImages.some(f => f === imageName);\r\n // break;\r\n // default:\r\n // result = false;\r\n // }\r\n return result;\r\n}\r\nexport function getOffsetDate(\r\n settings: AppSettings | null,\r\n date: Date | string | undefined | null,\r\n) {\r\n const systemOffset = settings?.TimeZone?.TimezoneOffsetMinutes ?? 0;\r\n let correctDate =\r\n date === null || date === undefined\r\n ? dateUtils.dateOrStringToDate(new Date())\r\n : dateUtils.dateOrStringToDate(date);\r\n const currentDateOffset = correctDate.getTimezoneOffset();\r\n const dateOrNow = dateUtils.addMinutes(\r\n correctDate,\r\n systemOffset + currentDateOffset,\r\n );\r\n return dateOrNow;\r\n}\r\n\r\nexport function GetAssetTypeFrom(\r\n availability: AvailabilityTypes,\r\n): AssetTypes | undefined {\r\n switch (availability) {\r\n case AvailabilityTypes.NotAvailable:\r\n case AvailabilityTypes.AvailableNotBookable:\r\n return 'NotAvailable';\r\n case AvailabilityTypes.FreelyBookable:\r\n case AvailabilityTypes.LoanableEquipment:\r\n return 'Equipment';\r\n case AvailabilityTypes.ServiceRelated:\r\n return 'OfflineService';\r\n case AvailabilityTypes.ServiceGroup:\r\n return 'ServiceGroup';\r\n case AvailabilityTypes.SuperGroup:\r\n return 'SuperGroup';\r\n case AvailabilityTypes.RequestRelated:\r\n return 'Request';\r\n case AvailabilityTypes.TrainingProgram:\r\n return 'TrainingProgram';\r\n case AvailabilityTypes.LectureRoom:\r\n return 'LectureRoom';\r\n default:\r\n return;\r\n }\r\n}\r\n\r\nexport type AssetTypes =\r\n | 'Equipment'\r\n | 'TrainingProgram'\r\n | 'LectureRoom'\r\n | 'ServiceGroup'\r\n | 'SuperGroup'\r\n | 'Request'\r\n | 'OfflineService'\r\n | 'NotAvailable';\r\nexport interface IAssetAttributeSettingDto {\r\n Name: string;\r\n AssetTypes: Array;\r\n AssetCats: Array;\r\n IsPublic: boolean;\r\n Enabled: boolean;\r\n DisplayName: string;\r\n Order: number;\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types/RootState';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n return state.layout || initialState;\r\n};\r\nexport const selectSidePanelState = createSelector(\r\n [selectSlice],\r\n state => state.sidePanelState,\r\n);\r\nexport const selectSidePanelOpen = createSelector(\r\n [selectSlice],\r\n state => state.sidePanelState.sidePanelOpen,\r\n);\r\nexport const selectPageType = createSelector(\r\n [selectSlice],\r\n state => state.sidePanelState.pageType,\r\n);\r\nexport const selectExpandedSidePanel = createSelector(\r\n [selectSlice],\r\n state => state.sidePanelState.expanded,\r\n);\r\nexport const selectPageTypeProps = createSelector(\r\n [selectSlice],\r\n state => state.sidePanelState.pageProps,\r\n);\r\nexport const selectConfirmState = createSelector(\r\n [selectSlice],\r\n state => state.confirmState,\r\n);\r\nexport const selectConfirmOpen = createSelector(\r\n [selectSlice],\r\n state => state.confirmState.confirmOpen,\r\n);\r\nexport const selectConfirmApproved = createSelector(\r\n [selectSlice],\r\n state => state.confirmState.approved,\r\n);\r\nexport const selectConfirmRejected = createSelector(\r\n [selectSlice],\r\n state => state.confirmState.rejected,\r\n);\r\nexport const selectHasNotSavedChanges = createSelector(\r\n [selectSlice],\r\n state => state.hasAnyNotSavedChanges,\r\n);\r\nexport const selectDoRefreshTable = createSelector(\r\n [selectSlice],\r\n state => state.doRefreshTable,\r\n);\r\nexport const selectShowLocalConfirm = createSelector(\r\n [selectSlice],\r\n state => state.confirmState.showLocalConfirm,\r\n);\r\nexport const selectContinueOnApprove = createSelector(\r\n [selectSlice],\r\n state => state.continueState.continueOnApprove,\r\n);\r\nexport const selectContinueState = createSelector(\r\n [selectSlice],\r\n state => state.continueState,\r\n);\r\nexport const selectContinueToLink = createSelector(\r\n [selectSlice],\r\n state => state.confirmState.continueToLink,\r\n);\r\nexport const selectHideNavigation = createSelector(\r\n [selectSlice],\r\n state => state.hideNavigation,\r\n);\r\nexport const selectSnackBarIndex = createSelector(\r\n [selectSlice],\r\n state => state.upsnackbarIndex,\r\n);\r\nexport const selectIsMobileView = createSelector(\r\n [selectSlice],\r\n state => state.isMobileView,\r\n);\r\nexport const selectActionTableProcessing = createSelector(\r\n [selectSlice],\r\n state => state.actionTableProcessing,\r\n);\r\nexport const selectProcessingIndicator = createSelector(\r\n [selectActionTableProcessing],\r\n processing => (methodName: string) => {\r\n if (processing === undefined) {\r\n return undefined;\r\n } else if (methodName === processing.name) {\r\n return processing.processing;\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n);\r\nexport const selectIsCoverOpen = createSelector(\r\n [selectSidePanelState],\r\n state => state.coverOpen,\r\n);\r\nexport const selectIsCoverExpanded = createSelector(\r\n [selectSidePanelState],\r\n state => state.coverExpanded,\r\n);\r\nexport const selectAdminPanelOpen = createSelector(\r\n [selectSlice],\r\n state => state.adminPanelState.adminPanelOpen,\r\n);\r\nexport const selectAdminPanelUrl = createSelector(\r\n [selectSlice],\r\n state => state.adminPanelState.url,\r\n);\r\n","import { Identifiable } from 'types/common';\r\n\r\nexport function isNullOrUndefined(\r\n value: T | null | undefined,\r\n): value is null | undefined {\r\n return value === null || value === undefined;\r\n}\r\n\r\nexport function isEmptyOrWhitespace(s: string | null | undefined): boolean {\r\n return s === null || s === undefined || s === '' || s.trim() === '';\r\n}\r\nexport function toUndefinedIfEmptyOrWhitespace(s: string | null | undefined) {\r\n return isEmptyOrWhitespace(s) ? undefined : s;\r\n}\r\nexport function toLowerCaseSafely(s: string | null | undefined): string | null {\r\n return s === null || s === undefined ? null : s.toLowerCase();\r\n}\r\n\r\nexport const valOrNull = (val: T | undefined | null) => {\r\n return val ?? null;\r\n};\r\n\r\n//for use in filter to mark all as not undefined\r\nexport const notUndefined = (val: T | undefined): val is T => {\r\n return val !== undefined;\r\n};\r\n\r\nexport type PartialExceptId> = Pick &\r\n Partial>;\r\n\r\nexport function toNumberOrNull(value: any): number | null {\r\n if (value === null || value === undefined) {\r\n return null;\r\n }\r\n if (typeof value === 'string') {\r\n if (isNaN(parseInt(value))) {\r\n return null;\r\n } else {\r\n return parseInt(value);\r\n }\r\n } else if (typeof value === 'number') {\r\n return value;\r\n } else {\r\n return null;\r\n }\r\n}\r\n","import { EnumType } from 'typescript';\r\nimport { AllowedSettings } from './AllowedSettings';\r\nimport { SettingModel } from './SettingModel';\r\n\r\nexport class GlobalSettings {\r\n settings: SettingModel[];\r\n constructor(sett: SettingModel[]) {\r\n this.settings = sett;\r\n }\r\n public TryGet(key: string): string | null {\r\n if (this.settings.length > 0) {\r\n let obj = this.settings.find((value, index) => value.Name === key);\r\n return obj === undefined ? null : obj.Value;\r\n } else {\r\n return null;\r\n }\r\n }\r\n //please dont forget to add key of the setting to the allowed list of the enum AllowedSettings\r\n public GetString(key: AllowedSettings): string {\r\n let keyValue = AllowedSettings[key];\r\n let res = this.TryGet(keyValue.toString());\r\n return res === null ? '' : res;\r\n }\r\n public GetNullableByKey(key: AllowedSettings): string | null {\r\n let keyValue = AllowedSettings[key];\r\n return this.TryGet(keyValue.toString());\r\n }\r\n public GetNullableString(key: string): string | null {\r\n return this.TryGet(key);\r\n }\r\n public GetBooleanByKey(key: AllowedSettings): boolean {\r\n let res = this.GetString(key);\r\n return res === '' ? false : res.toLowerCase() === 'true';\r\n }\r\n public GetBoolean(key: string): boolean {\r\n let res = this.TryGet(key);\r\n return res === null ? false : res.toLowerCase() === 'true';\r\n }\r\n public GetNullableBoolean(key: string): boolean | null {\r\n let res = this.TryGet(key);\r\n return res === null ? null : res.toLowerCase() === 'true';\r\n }\r\n public GetEnum(key: string, typeEnum: EnumType): EnumType {\r\n let res = this.TryGet(key);\r\n return res === null ? typeEnum.getDefault() : typeEnum[res];\r\n }\r\n public GetNullableEnum(key: string, typeEnum: EnumType): EnumType | null {\r\n let res = this.TryGet(key);\r\n return res === null ? null : typeEnum[res];\r\n }\r\n}\r\n","export enum KnownModules {\r\n Default = 0,\r\n Assets = 1,\r\n BudgetsSyncDoNotDeactivateMissingBudgets = 2,\r\n AccServices = 3,\r\n Quizzes = 4,\r\n AllowOngoingReservationModification = 5,\r\n AssetBarcodePrinting = 6,\r\n AssetDetailsDisplayContactsRelatedOnly = 7,\r\n AutomatedEndTimeUpdate = 8,\r\n AutomaticEmailSending = 9,\r\n AutomaticMonthlyPaymentLetter = 10,\r\n Billing = 11,\r\n Blitz = 12,\r\n WebRelayTm = 13,\r\n WebRelayX600m = 14,\r\n NiDAQmx = 15,\r\n KmTronicRelay = 16,\r\n Budgets = 17,\r\n BudgetCats = 18,\r\n BudgetLimits = 19,\r\n Cages = 20,\r\n Colonies = 21,\r\n ConfigurableColumns = 22,\r\n CoreWizard = 23,\r\n CostObjects = 24,\r\n CustmerBranding = 25,\r\n CreditByQuarter = 26,\r\n CustomFormLinks = 27,\r\n CustomRoles = 28,\r\n Dashboards = 29,\r\n DashboardAnnouncement = 30,\r\n DataStorage = 31,\r\n DataStoreCharge = 32,\r\n Departments = 33,\r\n Dictionaries = 34,\r\n Divisions = 35,\r\n Documents = 36,\r\n DoorAccess = 37,\r\n DoorAccessTibboController = 38,\r\n DoorAccessImport = 39,\r\n Eln /*Projects/Experiments*/ = 40,\r\n Experiment = 41,\r\n EmailCommunicationWithUsers = 42,\r\n EquipmentAssemblies = 43,\r\n EventsBillingByEndDate = 44,\r\n EventsBillingByStartDate = 45,\r\n Expenses = 46,\r\n Factors = 47,\r\n FactorsByInstTypes = 48,\r\n FactorsByUserGroups = 49,\r\n FinAdminRole = 50,\r\n FixedRate = 51,\r\n ForgotPassword = 52,\r\n Genomics = 53,\r\n GroupPermissions = 54,\r\n GroupTrainingBookings = 55,\r\n GoogleCalendar = 56,\r\n HideInstrumentsFromUntrainedUsers = 57,\r\n HideNonDefaultBudgets = 58,\r\n HeaderStyle = 59,\r\n IdleTimeOut = 60,\r\n InstituteCoordRole = 61,\r\n Instruments = 62,\r\n Invoices = 63,\r\n IpRelay = 64,\r\n JoinAdGroup = 65,\r\n //JoinAdGroupText = 66,\r\n JoinAdGroupGenerate = 67,\r\n LabTechRole = 68,\r\n LargeAnimals = 69,\r\n LocalApp = 70,\r\n LocationTracking = 71,\r\n MaintenanceAssets = 72,\r\n Messages = 73,\r\n MultipleAdGroups = 74,\r\n Newsletter = 75,\r\n OfflineFactors = 76,\r\n OfflineServiceWithReservation = 77,\r\n OfflineServices = 78,\r\n OnlineBudgets = 79,\r\n PaymentsByBudgets = 80,\r\n PaymentsManagement = 81,\r\n Plates = 82,\r\n PlatesProcessing = 83,\r\n Pricing = 84,\r\n ProjectQuotes = 85,\r\n Projects = 86,\r\n QuickbooksExport = 87,\r\n Quotes = 88,\r\n Relay = 89,\r\n RepAdminRole = 90,\r\n RequestedServiceLinesInwokradditionalstatuses = 91,\r\n RequestsLinesManagement = 92,\r\n RequireAssetRoomAndBuilding = 93,\r\n ResCancelNotifications = 94,\r\n ReservationNotification = 95,\r\n ReservationShrink = 96,\r\n ReservationTakeOver = 97,\r\n ReservationsCustomForm = 99,\r\n RetroReservations = 101,\r\n RetroReservationsAdminAsUser = 102,\r\n SAP_Billing = 103,\r\n SAP_NRC_Billing = 104,\r\n SAP_SFTP = 105,\r\n SampleManagementAutoProcessRequests = 106,\r\n SampleManagementTables = 107,\r\n SampleProcessing = 108,\r\n SampleRequestPrintLabels = 109,\r\n SampleRequestQuote = 110,\r\n SampleRequestResultFiles = 111,\r\n Sensors = 112,\r\n ServiceRequests = 113,\r\n RequestMilestones = 114,\r\n ShibbolethAuthentication = 115,\r\n ShibbolethExternalBudgets = 116,\r\n ShowLicenseScreen = 117,\r\n SkipPendingReservationCharge = 118,\r\n SkipReservationBudgetValidation = 119,\r\n SystemSettings = 120,\r\n OAuth = 121,\r\n Suppliers = 122,\r\n TempUsers = 123,\r\n TimeZone = 124,\r\n Timeline = 125,\r\n TrainingExpiration = 126,\r\n Tutoring = 127,\r\n TutoringHours = 128,\r\n Undergraduate = 129,\r\n UsageForm = 130,\r\n UsageTutoring = 131,\r\n UserBudgets = 132,\r\n UserCanExpire = 133,\r\n UserGroupCoordRole = 134,\r\n UserGroupSelfAssign = 135,\r\n UserGroupsAssignment = 136,\r\n UserPermission = 137,\r\n WS_Billing = 138,\r\n WeeklyCalendar = 139,\r\n WindowsAuthentication = 140,\r\n Workflows = 141,\r\n ShowAvailableNotBookableAssetsOnDashboard = 142,\r\n EnableWorkflowExperiments = 143,\r\n MultipleInstruments_AddRemoveOnEditReservation = 144,\r\n PriceSheetPricing = 145,\r\n PriceSheetFeeTypes = 146,\r\n BudgetExperiments = 147,\r\n Location = 148,\r\n ServiceGroupRegistration = 149,\r\n ReportsGenerator = 150,\r\n AssetDecommission = 151,\r\n //ShowBudgetsScreenFromUsers = 152,\r\n CloningInstrumentsAssets = 153,\r\n InstituteProjects = 154,\r\n OfflineServiceBookedBy = 155,\r\n TermsOfUseAgreement = 156,\r\n TrainingLevelPermissions = 157,\r\n TrainingPrograms = 158,\r\n SourceAndLabelSampleProccessing = 159,\r\n LocalAppRemoteControl = 160,\r\n LoanDesk = 161,\r\n VisualLogBook = 162,\r\n BiWeeklyWorkingHoursPeriods = 163,\r\n ReservationsImport = 164,\r\n ServiceRequestProjectsInReservations = 165,\r\n AllowSGAToControlSingleEquipment = 166,\r\n MultipleCustomForms = 167,\r\n UserInquiry = 168,\r\n ProjectJoinRequests = 169,\r\n DTUStudentCardIntergration = 170,\r\n AssetModels = 171,\r\n PriceSheetUserGroups = 172,\r\n PeopleSoftBilling = 173,\r\n DisableBillingEvents = 174,\r\n InstrumetServiceProjectCode = 175,\r\n RaspberryPi = 176,\r\n SamplesAutomation = 177,\r\n}\r\n","import { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport * as rdd from 'react-device-detect';\r\n\r\nexport function DetectIsMobile() {\r\n const { checkIsMobile } = useIsMobile();\r\n return checkIsMobile();\r\n}\r\nexport function GetBrowserInfo() {\r\n console.debug(`\r\n fullBrowserVersion: ${rdd.fullBrowserVersion};\r\n browserName: ${rdd.browserName};\r\n browserVersion: ${rdd.browserVersion};\r\n deviceType: ${rdd.deviceType};\r\n engineName: ${rdd.engineName};\r\n engineVersion: ${rdd.engineVersion};\r\n osName: ${rdd.osName};\r\n osVersion: ${rdd.osVersion};\r\n mobileModel: ${rdd.mobileModel};\r\n mobileVendor: ${rdd.mobileVendor};\r\n `);\r\n}\r\n","/**\r\n *\r\n * AutocompletePickerS2\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { CircularProgress, InputBaseComponentProps } from '@material-ui/core';\r\nimport Autocomplete from '@material-ui/lab/Autocomplete';\r\nimport { EntityType } from 'types/common';\r\nimport {\r\n autocompleteExtendStyles,\r\n autocompleteStyles,\r\n} from 'styles/MUIExtend/autocompleteStyles';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport clsx from 'clsx';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n extractDataFromResponse,\r\n IDisableable,\r\n loadDataAndPrepareOptions,\r\n OptionType,\r\n} from '../Utils/autoCompletePickerUtils';\r\nimport { FilterOptionsState } from '@material-ui/lab';\r\nimport { highlightSearchTerm } from '../BaseOptionsPicker/highlightSearchTerm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nexport interface AutocompletePickerProps {\r\n loadData: (\r\n searchTerm: string | null,\r\n predicates?: (string | Condition)[],\r\n ) => Promise;\r\n filterOptions?: (\r\n options: OptionType[],\r\n state: FilterOptionsState>,\r\n ) => OptionType[];\r\n value?: T | null;\r\n label?: string;\r\n onChange?: (value: T | null) => void;\r\n size?: 'medium' | 'small';\r\n mini?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n isOpen?: boolean;\r\n disableClearable?: boolean;\r\n style?: CSSProperties;\r\n required?: boolean;\r\n fullWidth?: boolean;\r\n additionalItem?: T | null;\r\n disabled?: boolean;\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n info?: string;\r\n noOptionsText?: React.ReactNode;\r\n defaultValue?: T | null;\r\n id?: string;\r\n select?: boolean;\r\n customData?: T | T[] | null;\r\n predicates?: (string | Condition)[];\r\n ariaLabel?: string;\r\n className?: string;\r\n title?: string;\r\n loading?: boolean;\r\n clearOnBlur?: boolean;\r\n freeSolo?: boolean;\r\n handleInputChange?: (value: string) => void;\r\n additionalSearchTerm?: string | null;\r\n onPickerOpen?: () => void;\r\n renderOptionName?: (option: OptionType) => string;\r\n getOptionLabelName?: (option: OptionType) => string;\r\n inputProps?: InputBaseComponentProps | undefined;\r\n autoFocus?: boolean;\r\n autoHighlight?: boolean;\r\n autoComplete?: boolean;\r\n autoSelect?: boolean;\r\n blurOnSelect?: 'touch' | 'mouse' | true | false;\r\n clearOnEscape?: boolean;\r\n includeInputInList?: boolean;\r\n selectOnFocus?: boolean;\r\n disableListWrap?: boolean;\r\n disableCloseOnSelect?: boolean;\r\n filterSelectedOptions?: boolean;\r\n openOnFocus?: boolean;\r\n setSomeOpen?: (open: boolean) => void;\r\n ListboxProps?: object;\r\n}\r\n\r\nexport function AutocompletePicker({\r\n label,\r\n loadData,\r\n filterOptions = options => options,\r\n value,\r\n onChange,\r\n size,\r\n mini,\r\n variant,\r\n isOpen,\r\n disableClearable,\r\n style,\r\n fullWidth = false,\r\n additionalItem,\r\n disabled,\r\n info,\r\n noOptionsText,\r\n id,\r\n select,\r\n required,\r\n predicates,\r\n ariaLabel,\r\n className,\r\n title,\r\n loading: propsLoading,\r\n freeSolo,\r\n handleInputChange,\r\n additionalSearchTerm,\r\n renderOptionName,\r\n getOptionLabelName,\r\n inputProps,\r\n autoFocus,\r\n autoHighlight = true,\r\n autoComplete,\r\n autoSelect = true,\r\n blurOnSelect,\r\n clearOnEscape,\r\n includeInputInList,\r\n selectOnFocus,\r\n disableListWrap,\r\n filterSelectedOptions,\r\n disableCloseOnSelect,\r\n openOnFocus,\r\n setSomeOpen,\r\n ListboxProps,\r\n ...props\r\n}: AutocompletePickerProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const classes = autocompleteStyles();\r\n const extClasses = autocompleteExtendStyles();\r\n const timerRef = React.useRef(null);\r\n //const miniClass = `${size === 'small' && mini ? 'miniDense' : ''}`;\r\n let firstOpen = isOpen;\r\n const [open, setOpen] = React.useState(firstOpen);\r\n const [options, setOptions] = React.useState<\r\n Array> | undefined\r\n >([]);\r\n const [searchTerm, setSearchTerm] = React.useState(\r\n additionalSearchTerm === undefined ? null : additionalSearchTerm,\r\n );\r\n const [hasSelected, setSelected] = React.useState(\r\n value !== undefined && value !== null,\r\n );\r\n const [firstMounted, setFirstMounted] = React.useState(\r\n true,\r\n );\r\n useEffectOnMount(() => {\r\n !!setSomeOpen && setSomeOpen(isOpen ?? false);\r\n });\r\n const handleSelectText = (\r\n event: React.FocusEvent,\r\n ) => {\r\n event.target.select();\r\n event.target.setSelectionRange(0, event.target.value.length);\r\n setFirstMounted(undefined);\r\n console.log('auto focus running');\r\n };\r\n React.useEffect(() => {\r\n return () => clearTimeout(timerRef.current);\r\n }, []);\r\n const [loading, setLoading] = React.useState(propsLoading ?? false);\r\n // update internal \"loading\" state when \"loading\" property changes it's value\r\n React.useEffect(() => {\r\n if (propsLoading !== undefined) {\r\n setLoading(propsLoading);\r\n }\r\n }, [propsLoading]);\r\n const doload = open && (options === undefined || options?.length === 0);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n\r\n React.useEffect(() => {\r\n let active = true;\r\n if (!doload) {\r\n return undefined;\r\n }\r\n (async () => {\r\n try {\r\n setLoading(true);\r\n const rawResponse = await loadData(searchTerm, predicates);\r\n const response = extractDataFromResponse(rawResponse);\r\n const optionsData = loadDataAndPrepareOptions({\r\n response,\r\n additionalItem,\r\n t,\r\n });\r\n\r\n if (active) {\r\n setOptions(optionsData);\r\n setLoading(false);\r\n }\r\n } catch {\r\n if (!active) return;\r\n setOptions([]);\r\n setLoading(false);\r\n }\r\n })();\r\n\r\n return () => {\r\n active = false;\r\n };\r\n }, [additionalItem, doload, loadData, predicates, searchTerm, t]);\r\n\r\n React.useEffect(() => {\r\n if (!open) {\r\n setOptions(undefined);\r\n }\r\n }, [open]);\r\n\r\n return (\r\n {\r\n !disableClearable && setOptions(undefined);\r\n !selectOnFocus && setSearchTerm(null);\r\n setOpen(true);\r\n !!setSomeOpen && setSomeOpen(true);\r\n !!props.onPickerOpen && props.onPickerOpen();\r\n }}\r\n onClose={() => {\r\n setSearchTerm(null);\r\n setOpen(false);\r\n !!setSomeOpen && setSomeOpen(false);\r\n setLoading(false);\r\n }}\r\n onChange={(event, value, reason, details) => {\r\n if (\r\n value == null ||\r\n ((value as T)?.Id !== undefined &&\r\n ((value as unknown) as IDisableable)?.disabled !== true)\r\n ) {\r\n setSearchTerm(null);\r\n onChange?.(value as T);\r\n setSelected(value !== undefined && value !== null);\r\n }\r\n }}\r\n multiple={false}\r\n onInputChange={(event, newInputValue, reason) => {\r\n setOptions(undefined);\r\n if (reason === 'input') {\r\n let val =\r\n !!newInputValue && newInputValue !== null\r\n ? newInputValue.trimStart()\r\n : newInputValue;\r\n setSearchTerm(val);\r\n if (handleInputChange !== undefined) {\r\n handleInputChange(val);\r\n }\r\n }\r\n }}\r\n style={style}\r\n getOptionSelected={(option, value) =>\r\n (option as T)?.Id !== undefined &&\r\n (value as T)?.Id !== undefined &&\r\n (option as T)?.Id === (value as T)?.Id\r\n }\r\n getOptionDisabled={option =>\r\n ((option as unknown) as IDisableable)?.disabled ?? false\r\n }\r\n getOptionLabel={option => {\r\n if (!!getOptionLabelName) {\r\n return getOptionLabelName(option);\r\n } else {\r\n return option.Name ?? t(translations.NA);\r\n }\r\n }}\r\n renderOption={(option, state) =>\r\n highlightSearchTerm(\r\n !!renderOptionName ? renderOptionName(option) : option.Name,\r\n state.inputValue,\r\n )\r\n }\r\n options={(options as OptionType[]) ?? []}\r\n filterSelectedOptions={filterSelectedOptions}\r\n /**\r\n * filter is needed to be disabled in order to show server filterd items that might not contain the searchterm as is\r\n * or to show any other additional label like \"showing x records, please search fo more\"\r\n * */\r\n filterOptions={filterOptions}\r\n loading={loading}\r\n value={value ?? null}\r\n classes={{\r\n root: clsx(classes.root, showShortView ? 'shortView' : undefined),\r\n tag: classes.tag,\r\n tagSizeSmall: classes.tagSizeSmall,\r\n inputRoot: classes.inputRoot,\r\n input: classes.input,\r\n inputFocused: classes.inputFocused,\r\n endAdornment: classes.endAdornment,\r\n clearIndicator: classes.clearIndicator,\r\n popupIndicator: classes.popupIndicator,\r\n popupIndicatorOpen: classes.popupIndicatorOpen,\r\n paper: classes.paper,\r\n listbox: classes.listbox,\r\n loading: classes.loading,\r\n noOptions: classes.noOptions,\r\n option: classes.option,\r\n groupLabel: classes.groupLabel,\r\n groupUl: classes.groupUl,\r\n }}\r\n fullWidth={fullWidth}\r\n className={clsx(className, extClasses.extendRoot)}\r\n disableClearable={disableClearable}\r\n onBlur={props?.onBlur}\r\n size={size}\r\n popupIcon={}\r\n closeIcon={}\r\n freeSolo={freeSolo}\r\n selectOnFocus={selectOnFocus || (isMobile ? false : true)}\r\n renderInput={params => (\r\n event.target.select()}\r\n autoFocus={autoFocus}\r\n onFocus={event => {\r\n clearTimeout(timerRef.current);\r\n if (\r\n autoFocus &&\r\n value !== null &&\r\n value !== undefined &&\r\n selectOnFocus &&\r\n firstMounted\r\n ) {\r\n timerRef.current = setTimeout(handleSelectText, 100, event);\r\n }\r\n }}\r\n inputProps={{\r\n ...params.inputProps,\r\n ...inputProps,\r\n 'aria-label': `${\r\n label ? undefined : ariaLabel ? ariaLabel : 'search input'\r\n }`,\r\n // 'aria-labelledby': `${\r\n // label ? undefined : id ? `${id}_label` : undefined\r\n // }`,\r\n title: title,\r\n }}\r\n InputProps={{\r\n //autoFocus: firstOpen || autoFocus,\r\n classes: {\r\n root: clsx(showShortView ? 'shortView' : undefined),\r\n },\r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {props.error}\r\n {loading ? (\r\n \r\n ) : info ? (\r\n \r\n ) : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ),\r\n }}\r\n />\r\n )}\r\n autoHighlight={autoHighlight}\r\n autoComplete={autoComplete}\r\n autoSelect={autoSelect}\r\n blurOnSelect={blurOnSelect}\r\n clearOnEscape={clearOnEscape}\r\n includeInputInList={includeInputInList}\r\n disableListWrap={disableListWrap}\r\n openOnFocus={openOnFocus}\r\n disableCloseOnSelect={disableCloseOnSelect}\r\n ListboxProps={ListboxProps}\r\n />\r\n );\r\n}\r\n","import parse from 'autosuggest-highlight/parse';\r\nimport match from 'autosuggest-highlight/match';\r\n\r\nexport function highlightSearchTerm(text, highlight) {\r\n // Split on highlight term and include term into parts, ignore case\r\n const matches = match(text, highlight);\r\n const parts = parse(text, matches);\r\n\r\n return (\r\n \r\n {parts.map((part, index) =>\r\n part.highlight ? (\r\n {part.text}\r\n ) : (\r\n {part.text}\r\n ),\r\n )}\r\n \r\n );\r\n}\r\n","import {\r\n capitalize,\r\n Tooltip as MuiTooltip,\r\n TooltipProps as MuiTooltipProps,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TFunctionResult } from 'i18next';\r\nimport * as React from 'react';\r\nexport type ThemeColor = 'dark' | 'light';\r\nexport interface TooltipsProps extends Omit {\r\n themeColor?: ThemeColor;\r\n /**\r\n * Tooltip title. redefined here to include TFunctionResult\r\n */\r\n title: React.ReactNode | TFunctionResult;\r\n headTitle?: React.ReactNode | TFunctionResult;\r\n}\r\n\r\nexport function Tooltip({\r\n children,\r\n themeColor = 'dark',\r\n title,\r\n headTitle,\r\n arrow = true,\r\n interactive,\r\n ...props\r\n}: TooltipsProps) {\r\n return (\r\n \r\n {!!headTitle && (\r\n \r\n {headTitle}\r\n \r\n )}\r\n \r\n {title}\r\n \r\n \r\n ) : (\r\n ''\r\n )\r\n }\r\n {...props}\r\n >\r\n {children}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.AvailabilityTypes\r\n *\r\n */\r\n\r\nexport enum AvailabilityTypes {\r\n NotAvailable = 0,\r\n AvailableNotBookable = 1,\r\n FreelyBookable = 2,\r\n //BookableWApproval = 3,\r\n ServiceRelated = 4,\r\n ServiceGroup = 5,\r\n SuperGroup = 6,\r\n //FreelyBookableBillable = 7,\r\n //ApprovalRequiredBillable = 8,\r\n RequestRelated = 9,\r\n TrainingProgram = 10,\r\n LoanableEquipment = 11,\r\n LectureRoom = 12,\r\n}\r\nexport type AvailabilityTypesUnion = keyof typeof AvailabilityTypes;\r\nexport const AvailabilityTypesUnionArray: Array = [\r\n 'NotAvailable',\r\n 'AvailableNotBookable',\r\n 'FreelyBookable',\r\n //'BookableWApproval',\r\n 'ServiceRelated',\r\n 'ServiceGroup',\r\n 'SuperGroup',\r\n //'FreelyBookableBillable',\r\n //'ApprovalRequiredBillable',\r\n 'RequestRelated',\r\n 'TrainingProgram',\r\n 'LoanableEquipment',\r\n 'LectureRoom',\r\n];\r\n","import { Typography, TypographyProps } from '@material-ui/core';\r\nimport { BookitTypographyVariant } from '@material-ui/core/styles/createTypography';\r\nimport { capitalize } from 'lodash';\r\nimport * as React from 'react';\r\nimport { typographyComponentMapping } from 'styles/typography/bookitTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface BasicTypographyProps extends Omit {\r\n variant?: BookitTypographyVariant;\r\n component?: React.ElementType;\r\n italic?: boolean;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n}\r\nexport const BasicTypography = (props: BasicTypographyProps) => {\r\n const {\r\n children,\r\n variant = 'bodyM',\r\n italic,\r\n component,\r\n color,\r\n style,\r\n className,\r\n ...other\r\n } = props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\nexport default BasicTypography;\r\n","export enum ServiceType {\r\n Online = 1,\r\n Offline = 2,\r\n Sample = 3,\r\n Workflow = 4,\r\n}\r\n\r\nexport type ServiceTypeUnion = keyof typeof ServiceType;\r\n","export enum AssetAttributes {\r\n NotActive,\r\n AssetAccessories,\r\n AssetCat,\r\n AssetCatGroup,\r\n AccountingId,\r\n NickName,\r\n OtherNames,\r\n Type2Counter,\r\n Brand,\r\n Model,\r\n ModelID,\r\n ModelNumber,\r\n Building,\r\n Room,\r\n Experts,\r\n Contacts,\r\n Public,\r\n Raac,\r\n MainSpecRange,\r\n FunctionalCharacteristics,\r\n ElectricalSpecs,\r\n WebLink,\r\n Tags,\r\n Suppliers,\r\n BrandCode,\r\n InternalCode,\r\n POnumber,\r\n Campus,\r\n LifeDate,\r\n ExtraText0,\r\n ExtraText1,\r\n ExtraText2,\r\n ExtraText3,\r\n ExtraText4,\r\n ExtraText5,\r\n ExtraText6,\r\n ExtraText7,\r\n ExtraText8,\r\n ExtraText9,\r\n ExtraText10,\r\n ExtraText11,\r\n ExtraText12,\r\n ExtraText13,\r\n ExtraText14,\r\n ExtraText15,\r\n ExtraInt0,\r\n ExtraInt1,\r\n ExtraInt2,\r\n ExtraInt3,\r\n ExtraInt4,\r\n ExtraDec0,\r\n ExtraDec1,\r\n ExtraDec2,\r\n ExtraDec3,\r\n ExtraDec4,\r\n ExtraBool0,\r\n ExtraBool1,\r\n ExtraBool2,\r\n ExtraBool3,\r\n ExtraBool4,\r\n ExtraUrl0,\r\n ExtraUrl1,\r\n ExtraUrl2,\r\n ExtraUrl3,\r\n ExtraUrl4,\r\n ExtraRichText0,\r\n ExtraRichText1,\r\n ExtraRichText2,\r\n ExtraRichText3,\r\n ExtraRichText4,\r\n ExtraDDL0,\r\n ExtraDDL1,\r\n ExtraDDL2,\r\n ExtraDDL3,\r\n ExtraDDL4,\r\n ExtraDDL5,\r\n ExtraDDL6,\r\n ExtraDDL7,\r\n ExtraDDL8,\r\n ExtraDDL9,\r\n ExtraDDL10,\r\n ExtraDDL11,\r\n ExtraDDL12,\r\n ExtraDDL13,\r\n ExtraDDL14,\r\n ExtraDDL15,\r\n ExtraDate0,\r\n ExtraDate1,\r\n ExtraDate2,\r\n ExtraDate3,\r\n ExtraDate4,\r\n ExtraDate5,\r\n ExtraDate6,\r\n ExtraDate7,\r\n ExtraDate8,\r\n ExtraDate9,\r\n UnderOriginalWarranty,\r\n WarrantyEndDate,\r\n ServiceContract,\r\n GasSource,\r\n ImageName,\r\n Description,\r\n ShortDescription,\r\n // not present on asset search results\r\n LocationsList,\r\n // not present on asset search results\r\n Range,\r\n ExportLicense,\r\n ForceTutoring,\r\n SubLocationsList,\r\n Details,\r\n Classification,\r\n Location,\r\n SectionContacts,\r\n Identifiers,\r\n AdditionalInfo,\r\n SectionLabel7,\r\n SectionLabel8,\r\n SectionLabel9,\r\n SectionLabel10,\r\n Status,\r\n ServiceGroup,\r\n Division,\r\n AvailabilityType,\r\n DOI,\r\n}\r\n","import {\r\n BookitTypographyVariant,\r\n FontStyleOptions,\r\n TypographyStyleOptions,\r\n Variant,\r\n} from '@material-ui/core/styles/createTypography';\r\nimport { CSSProperties } from '@material-ui/styles';\r\nexport const h1: CSSProperties = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '40px',\r\n fontStyle: 'normal',\r\n fontWeight: 700,\r\n lineHeight: '141%',\r\n letterSpacing: '-0.4px' /* 56.4px */,\r\n};\r\nexport const h2: CSSProperties = {\r\n //styleName: Bkt/Header 2;\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '32px',\r\n fontStyle: 'normal',\r\n fontWeight: 700,\r\n lineHeight: '146%', ///* 46.72px */\r\n letterSpacing: '-0.4px',\r\n};\r\nexport const h3: CSSProperties = {\r\n //styleName: Bkt/Header 3;\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '24px',\r\n fontStyle: 'normal',\r\n fontWeight: 700,\r\n lineHeight: '160%' /* 38.4px */,\r\n letterSpacing: '-0.2px',\r\n};\r\nexport const h4: CSSProperties = {\r\n //styleName: Bkt/Header 4:\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '20px',\r\n fontStyle: 'normal',\r\n fontWeight: 700,\r\n lineHeight: '160%' /* 32px */,\r\n letterSpacing: '-0.1px',\r\n};\r\nexport const subtitle1: CSSProperties = {\r\n /* Bkt/Subtitle 1 */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '24px',\r\n fontStyle: 'normal',\r\n lineHeight: '160%' /* 38.4px */,\r\n fontWeight: 400,\r\n};\r\nexport const subtitle2: CSSProperties = {\r\n /* Bkt/Subtitle 2 */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '20px',\r\n fontStyle: 'normal',\r\n lineHeight: '160%' /* 32px */,\r\n fontWeight: 400,\r\n};\r\nexport const boldL: CSSProperties = {\r\n /* Bkt/Bold L */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '18px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 25.38px */,\r\n fontWeight: 700,\r\n letterSpacing: '0px',\r\n};\r\nexport const boldM: CSSProperties = {\r\n /* Bkt/Bold M */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 25.38px */,\r\n fontWeight: 700,\r\n letterSpacing: '0px',\r\n};\r\nexport const boldS: CSSProperties = {\r\n /* Bkt/Bold S */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '14px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 19.74px */,\r\n fontWeight: 700,\r\n letterSpacing: '0.1px',\r\n};\r\nexport const bodyL: CSSProperties = {\r\n /* Bkt/Body L */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '18px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 22.56px */,\r\n fontWeight: 400,\r\n letterSpacing: '0px',\r\n};\r\nexport const bodyM: CSSProperties = {\r\n /* Bkt/Body M */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 22.56px */,\r\n fontWeight: 400,\r\n letterSpacing: '0px',\r\n};\r\nexport const bodyS: CSSProperties = {\r\n /* Bkt/Body S */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '14px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 19.74px */,\r\n fontWeight: 400,\r\n letterSpacing: '0.1px',\r\n};\r\n\r\nexport const captionBold: CSSProperties = {\r\n /* Bkt/Caption Bold */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '12px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 16.92px */,\r\n fontWeight: 700,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const captionRegular: CSSProperties = {\r\n /* Bkt/Caption */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '12px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 16.92px */,\r\n fontWeight: 400,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const uppercase: CSSProperties = {\r\n /* Bkt/UPPERCASE */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '12px',\r\n fontStyle: 'normal',\r\n lineHeight: '160%' /* 19.2px */,\r\n fontWeight: 400,\r\n letterSpacing: '0.1px',\r\n textTransform: 'uppercase',\r\n};\r\nexport const tipsBold: CSSProperties = {\r\n /* Bkt/Tips Bold */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '10px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 19.2px */,\r\n fontWeight: 700,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const tipsRegular: CSSProperties = {\r\n /* Bkt/Tips Regular */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '10px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 19.2px */,\r\n fontWeight: 400,\r\n letterSpacing: '0.2px',\r\n};\r\n\r\nexport const inputLabelM: CSSProperties = {\r\n /* Components Styles/Input Label - M */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 125% */,\r\n fontWeight: 400,\r\n letterSpacing: '0px',\r\n};\r\nexport const inputLabelXS: CSSProperties = {\r\n /* Components Styles/Input Label - XS */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '12px',\r\n fontStyle: 'normal',\r\n lineHeight: '16px' /* 133.333% */,\r\n fontWeight: 400,\r\n letterSpacing: '0px',\r\n};\r\nexport const inputValueM: CSSProperties = {\r\n /* Components Styles/Input - Value M */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 125% */,\r\n fontWeight: 400,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const inputValueS: CSSProperties = {\r\n /* Components Styles/Input - Value S */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '14px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 142.857% */,\r\n fontWeight: 400,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const buttonM: CSSProperties = {\r\n /* Components Styles/Button - M */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 125% */,\r\n fontWeight: 600,\r\n letterSpacing: '0.2px',\r\n};\r\nexport const buttonS: CSSProperties = {\r\n /* Components Styles/Button - S */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '14px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 142.857% */,\r\n fontWeight: 600,\r\n letterSpacing: '0.2px',\r\n};\r\n\r\nexport const bookitTypography: BookitTypographyOptions = {\r\n h1: h1,\r\n h2: h2,\r\n h3: h3,\r\n h4: h4,\r\n subtitle1: subtitle1,\r\n subtitle2: subtitle2,\r\n boldL: boldL,\r\n boldM: boldM,\r\n boldS: boldS,\r\n bodyL: bodyL,\r\n bodyM: bodyM,\r\n bodyS: bodyS,\r\n captionBold: captionBold,\r\n captionRegular: captionRegular,\r\n uppercase: uppercase,\r\n tipsBold: tipsBold,\r\n tipsRegular: tipsRegular,\r\n inputLabelM: inputLabelM,\r\n inputLabelXS: inputLabelXS,\r\n inputValueM: inputValueM,\r\n inputValueS: inputValueS,\r\n buttonM: buttonM,\r\n buttonS: buttonS,\r\n};\r\n\r\nexport const defaultVariantMapping: Partial> = {\r\n h1: 'h1',\r\n h2: 'h2',\r\n h3: 'h3',\r\n h4: 'h4',\r\n h5: 'h5',\r\n h6: 'h6',\r\n subtitle1: 'h6',\r\n subtitle2: 'h6',\r\n body1: 'p',\r\n body2: 'p',\r\n button: 'label',\r\n caption: 'label',\r\n overline: 'label',\r\n};\r\nexport const typographyComponentMapping: Partial> = {\r\n h1: 'h1',\r\n h2: 'h2',\r\n h3: 'h3',\r\n h4: 'h4',\r\n bodyL: 'p',\r\n bodyM: 'p',\r\n bodyS: 'p',\r\n boldL: 'p',\r\n boldM: 'p',\r\n boldS: 'p',\r\n buttonM: 'label',\r\n buttonS: 'label',\r\n captionRegular: 'label',\r\n captionBold: 'label',\r\n inputLabelM: 'label',\r\n inputLabelXS: 'label',\r\n inputValueM: 'span',\r\n inputValueS: 'span',\r\n subtitle1: 'p',\r\n subtitle2: 'p',\r\n tipsBold: 'label',\r\n tipsRegular: 'label',\r\n uppercase: 'p',\r\n};\r\nexport const typographyNameMapping: Partial> = {\r\n h1: 'Header 1',\r\n h2: 'Header 2',\r\n h3: 'Header 3',\r\n h4: 'Header 4',\r\n bodyL: 'Body L',\r\n bodyM: 'Body M',\r\n bodyS: 'Body S',\r\n boldL: 'Bold L',\r\n boldM: 'Bold M',\r\n boldS: 'Bold S',\r\n buttonM: 'Button M',\r\n buttonS: 'Button S',\r\n captionRegular: 'Caption Regular',\r\n captionBold: 'Caption Bold',\r\n inputLabelM: 'Input Label M',\r\n inputLabelXS: 'Input Label XS',\r\n inputValueM: 'Input Value M',\r\n inputValueS: 'Input Value S',\r\n subtitle1: 'Subtitle 1',\r\n subtitle2: 'Subtitle 2',\r\n tipsBold: 'Tips Bold',\r\n tipsRegular: 'Tips Regular',\r\n uppercase: 'UPPERCASE',\r\n};\r\n\r\nexport interface TypographyOptionMeta {\r\n Name: string;\r\n variant: BookitTypographyVariant;\r\n style: CSSProperties;\r\n}\r\nexport const getTypographyMeta = (): TypographyOptionMeta[] => {\r\n const data: TypographyOptionMeta[] = Object.entries(bookitTypography).map(\r\n ent => {\r\n return {\r\n Name: typographyNameMapping[ent[0]] as string,\r\n style: ent[1] as CSSProperties,\r\n variant: ent[0] as BookitTypographyVariant,\r\n };\r\n },\r\n );\r\n return data;\r\n};\r\nexport interface BookitTypographyOptions\r\n extends Partial<\r\n Record & FontStyleOptions\r\n > {}\r\n","import {\r\n useInjectReducer as useReducer,\r\n useInjectSaga as useSaga,\r\n} from 'redux-injectors';\r\nimport {\r\n InjectReducerParams,\r\n InjectSagaParams,\r\n RootStateKeyType,\r\n} from './types/injector-typings';\r\n\r\n/* Wrap redux-injectors with stricter types */\r\n\r\nexport function useInjectReducer(\r\n params: InjectReducerParams,\r\n) {\r\n return useReducer(params);\r\n}\r\n\r\nexport function useInjectSaga(params: InjectSagaParams) {\r\n return useSaga(params);\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { EntityType, INamedEntity } from 'types/common';\r\nimport {\r\n Condition,\r\n escapeODataValue,\r\n ODataFilterBuilder,\r\n} from 'api/odata/ODataFilter';\r\nimport { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { uniq } from 'lodash';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\n\r\n/**\r\n * Sets maximum limit of rows to fetch from the server for autocomplete picker.\r\n * Fetching all at once significantly slows down UI on slow connections.\r\n */\r\nconst MAX_TOP = 200;\r\n\r\ninterface loadDataParams {\r\n url: string;\r\n idPropertyName?: keyof TEntity;\r\n DisplaynamePropertyName?: keyof TEntity;\r\n predicates?: (string | Condition)[];\r\n select?: Array;\r\n globalServiceGroupFilter?: Condition[];\r\n expand?: string;\r\n isOptionalServiceGroup?: boolean;\r\n transformModel?: (item: TEntity) => TEntity;\r\n useSearchOrPredicate?: boolean;\r\n queryString?: Record;\r\n maxTop?: number;\r\n}\r\nexport interface autocompleteLoadDataResult {\r\n value: TEntity[];\r\n more: boolean;\r\n limit?: number;\r\n}\r\nexport const getAutoCompleteLoadDataFn = ({\r\n url,\r\n idPropertyName = 'Id',\r\n DisplaynamePropertyName = 'Name',\r\n select = [idPropertyName, DisplaynamePropertyName],\r\n predicates: basePredicates = [],\r\n globalServiceGroupFilter = [],\r\n isOptionalServiceGroup = undefined,\r\n expand = undefined,\r\n transformModel = undefined,\r\n useSearchOrPredicate = undefined,\r\n queryString,\r\n maxTop,\r\n}: loadDataParams) => async (\r\n searchTerm: string | null,\r\n dynamicPredicates?: (string | Condition)[],\r\n) => {\r\n const params = {\r\n ...queryString,\r\n ...{\r\n $orderby: `${String(DisplaynamePropertyName)} asc`,\r\n $select: uniq(select).join(','),\r\n $top: (maxTop ?? MAX_TOP) + 1,\r\n $filter:\r\n useSearchOrPredicate && searchTerm !== null\r\n ? `(${String(DisplaynamePropertyName)} eq ${\r\n \"'\" + escapeODataValue(searchTerm) + \"'\"\r\n })`\r\n : new ODataFilterBuilder({\r\n predicates: dynamicPredicates\r\n ? [...(dynamicPredicates ?? [])]\r\n : basePredicates,\r\n stringColumns: [DisplaynamePropertyName],\r\n stringSearch: searchTerm ?? undefined,\r\n globalServiceGroupFilter: globalServiceGroupFilter,\r\n isOptionalServiceGroup: isOptionalServiceGroup,\r\n }).toString(),\r\n $expand: undefinedIfIsEmpty(expand),\r\n },\r\n };\r\n\r\n const response = await httpClient.get(url, params);\r\n const value = !!transformModel\r\n ? (response.value as TEntity[]).map(f => transformModel(f))\r\n : (response.value as TEntity[]);\r\n\r\n return {\r\n value: value.slice(0, maxTop ?? MAX_TOP),\r\n more: value.length > (maxTop ?? MAX_TOP),\r\n limit: maxTop ?? MAX_TOP,\r\n };\r\n};\r\nexport const extractDataFromResponse = (\r\n response: T[] | autocompleteLoadDataResult,\r\n) => {\r\n if (Array.isArray(response)) {\r\n return { value: response, more: false };\r\n } else {\r\n return response as autocompleteLoadDataResult;\r\n }\r\n};\r\n\r\nexport const loadDataAndPrepareOptions = ({\r\n t,\r\n response,\r\n additionalItem,\r\n}: {\r\n t: TFunction;\r\n response: autocompleteLoadDataResult;\r\n additionalItem?: T | null;\r\n}) => {\r\n const value = response.value;\r\n if (additionalItem !== null && additionalItem !== undefined) {\r\n value.unshift(additionalItem);\r\n }\r\n const nonSelectableOptions: NonSelectableOption[] = response.more\r\n ? [\r\n {\r\n disabled: true,\r\n Name: t(translations.ShowingFirstXRecords, {\r\n maxRecordsLimit: response.limit ?? MAX_TOP,\r\n }),\r\n },\r\n ]\r\n : [];\r\n return [...value, ...nonSelectableOptions];\r\n};\r\n\r\nexport interface IDisableable {\r\n disabled: boolean;\r\n}\r\nexport interface IRemoveable {\r\n noremoved: boolean;\r\n}\r\nexport interface IInfoOption {\r\n titleInfo?: string;\r\n}\r\nexport interface IColored {\r\n Color?: string;\r\n}\r\n\r\nexport type NonSelectableOption = INamedEntity & IDisableable;\r\nexport type NonRemoveableOption = INamedEntity & IRemoveable;\r\nexport type InfoOption = INamedEntity & IInfoOption;\r\nexport type ColoredOption = INamedEntity &\r\n NonSelectableOption &\r\n NonRemoveableOption &\r\n InfoOption &\r\n IColored;\r\nexport type OptionType =\r\n | T\r\n | NonSelectableOption\r\n | NonRemoveableOption\r\n | InfoOption\r\n | ColoredOption;\r\n","import i18next, { TFunction } from 'i18next';\r\nimport { Entity, INamedEntity } from 'types/common';\r\n\r\nconst isNumber = (x: string | number): x is number => !isNaN(+x);\r\nconst onlyNumbersReducer = (nums: number[], x: string | number): number[] =>\r\n isNumber(x) ? [...nums, x] : nums;\r\nconst onlyStringReducer = (nums: string[], x: string | number): string[] =>\r\n isNumber(x) ? nums : [...nums, x];\r\n\r\ntype Descripted = {\r\n [K in keyof T]: {\r\n readonly id: T[K];\r\n readonly description: string;\r\n };\r\n}[keyof T];\r\n\r\ntype NonFunctional = T extends Function ? never : T;\r\nexport interface EnumEntity extends Entity {\r\n OriginalName: string;\r\n}\r\n/**\r\n * Helper function to map with a TypeScript enum\r\n * This returns an array of numbers (e.g. [0,1,2,...])\r\n * corresponding to the enum, so you can create arrays that the enum can index.\r\n * @param keys TypeScript enum\r\n */\r\nexport const enumKeys = (keys: unknown): number[] =>\r\n Object.keys(keys as string[]).reduce(onlyNumbersReducer, []);\r\n\r\nexport const enumStringKeys = (keys: unknown): string[] =>\r\n Object.keys(keys as string[]).reduce(onlyStringReducer, []);\r\n\r\n/**\r\n * Helper to produce an array of enum descriptors.\r\n * @param enumeration Enumeration object.\r\n * @param separatorRegex Regex that would catch the separator in your enum key.\r\n */\r\nexport function enumToDescriptedArray(\r\n enumeration: T,\r\n): Descripted[] {\r\n return (Object.keys(enumeration) as Array)\r\n .filter(key => isNaN(Number(key)))\r\n .filter(\r\n key =>\r\n typeof enumeration[key] === 'number' ||\r\n typeof enumeration[key] === 'string',\r\n )\r\n .map(key => ({\r\n id: enumeration[key],\r\n description: String(key),\r\n }));\r\n}\r\n\r\n/**\r\n * TFunction may throw an error if called before i18next has been initialized.\r\n * There's really good point to try and use localization before it's been localized but it's used this way in a couple of places already\r\n * @param key localizaiton key\r\n * @param t TFunction\r\n * @returns localized value or null\r\n */\r\nfunction tryGetName(key: string, t?: TFunction): string {\r\n try {\r\n const tFunction = t ?? GetTFunction();\r\n return tFunction?.(key) ?? key;\r\n } catch (error) {\r\n return key;\r\n }\r\n}\r\n/**\r\n * Gets TFunction from i18next instance\r\n * @returns TFunction\r\n */\r\nconst GetTFunction: () => TFunction | undefined = () => {\r\n const i18n = i18next;\r\n if (i18n.isInitialized) {\r\n const defaultNS = 'translation';\r\n return i18n.getFixedT(\r\n null,\r\n i18n.options.ns ?? i18n.options.defaultNS ?? defaultNS,\r\n );\r\n }\r\n return undefined;\r\n};\r\nexport function toEntityEnumArray(\r\n enumeration: T,\r\n t?: TFunction,\r\n prefixKey?: string,\r\n): EnumEntity[] {\r\n return Object.keys(enumeration)\r\n .filter(key => isNaN(Number(key)))\r\n .filter(\r\n key =>\r\n typeof enumeration[key] === 'number' ||\r\n typeof enumeration[key] === 'string',\r\n )\r\n .map(key => {\r\n return {\r\n Id: enumeration[key],\r\n Name: !!prefixKey\r\n ? tryGetName(prefixKey + String(key), t)\r\n : tryGetName(String(key), t),\r\n OriginalName: String(key),\r\n };\r\n });\r\n}\r\nexport function enumToEntityArray(\r\n enumeration: T,\r\n t?: TFunction,\r\n prefixKey?: string,\r\n): Entity[] {\r\n return Object.keys(enumeration)\r\n .filter(key => isNaN(Number(key)))\r\n .filter(\r\n key =>\r\n typeof enumeration[key] === 'number' ||\r\n typeof enumeration[key] === 'string',\r\n )\r\n .map(key => {\r\n return {\r\n Id: enumeration[key],\r\n Name: !!prefixKey\r\n ? tryGetName(prefixKey + String(key), t)\r\n : tryGetName(String(key), t),\r\n };\r\n });\r\n}\r\nexport function GetOptionsFilterFunction(\r\n items: Array,\r\n customSearch?: (value: TItem, search: string) => boolean,\r\n) {\r\n return (searchTerm: string | null) => {\r\n if (searchTerm !== null && searchTerm !== '' && searchTerm !== undefined) {\r\n return items.filter(\r\n f =>\r\n f.Name.toLowerCase().startsWith(searchTerm.toLowerCase()) ||\r\n f.Name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1 ||\r\n (!!customSearch && customSearch(f, searchTerm)),\r\n );\r\n }\r\n return items;\r\n };\r\n}\r\n\r\n/**\r\n * Helper to produce an array of enum values.\r\n * @param enumeration Enumeration object.\r\n */\r\nexport function enumToArray(\r\n enumeration: T,\r\n): NonFunctional[] {\r\n return Object.keys(enumeration)\r\n .filter(key => isNaN(Number(key)))\r\n .map(key => enumeration[key])\r\n .filter(val => typeof val === 'number' || typeof val === 'string');\r\n}\r\n\r\nexport class EnumHelpers {\r\n static getNamesAndValues(e: any) {\r\n return EnumHelpers.getNames(e).map(n => ({ name: n, value: e[n] as T }));\r\n }\r\n\r\n static getNames(e: any) {\r\n return EnumHelpers.getObjValues(e).filter(\r\n v => typeof v === 'string',\r\n ) as string[];\r\n }\r\n\r\n static getValues(e: any) {\r\n return EnumHelpers.getObjValues(e).filter(\r\n v => typeof v === 'number',\r\n ) as T[];\r\n }\r\n\r\n static getSelectList(\r\n e: any,\r\n stringConverter: (arg: U) => string,\r\n ) {\r\n const selectList = new Map();\r\n this.getValues(e).forEach(val =>\r\n selectList.set(val as T, stringConverter((val as unknown) as U)),\r\n );\r\n return selectList;\r\n }\r\n\r\n static getSelectListAsArray(\r\n e: any,\r\n stringConverter: (arg: U) => string,\r\n ) {\r\n return Array.from(this.getSelectList(e, stringConverter), value => ({\r\n value: value[0] as T,\r\n presentation: value[1],\r\n }));\r\n }\r\n\r\n private static getObjValues(e: any): (number | string)[] {\r\n return Object.keys(e).map(k => e[k]);\r\n }\r\n}\r\n","/**\r\n * Formats string similar to .net string.Format\r\n * @param s format string\r\n * @param params interpolated values\r\n */\r\nexport function stringFormat(s, ...args: any) {\r\n return s.replace(/{(\\d+)}/g, function (match, number) {\r\n return typeof args[number] != 'undefined' ? args[number] : match;\r\n });\r\n}\r\n\r\n/**\r\n * Removes html tags and leaves only the text\r\n * @param value html text\r\n * @returns plain text without tags\r\n */\r\nexport function removeHtml(value: string) {\r\n return value.replace(/<[^>]+>/g, '');\r\n}\r\n\r\nexport function tryParseWithoutNaN(parse: (value: string) => number) {\r\n return (value: string) => {\r\n const x = parse(value);\r\n if (isNaN(x)) {\r\n return undefined;\r\n } else {\r\n return x;\r\n }\r\n };\r\n}\r\n\r\nexport function tryParse(\r\n parse: (value: string) => TResult,\r\n): (value: string | null | undefined) => TResult | undefined {\r\n return (value: string | null | undefined) => {\r\n if (value === null) {\r\n return undefined;\r\n }\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n try {\r\n const x = parse(value);\r\n return x;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Tries to parse string-like value.\r\n * Usefull to reduce bloat when an integer value needs to be converted to number without resorting to null/undefined checks.\r\n * @param value string/null/undefined\r\n * @returns number if it's int-like or undefined otherwise\r\n */\r\nexport function tryParseInt(value: string | null | undefined) {\r\n return tryParse(tryParseWithoutNaN(parseInt))(value);\r\n}\r\n\r\nexport function tryParseFloat(value: string | null | undefined) {\r\n return tryParse(tryParseWithoutNaN(parseFloat))(value);\r\n}\r\nexport function tryParsePositiveFloat(value: string | null | undefined) {\r\n return tryParse(value => {\r\n const x = parseFloat(value);\r\n if (x > 0) {\r\n return x;\r\n }\r\n })(value);\r\n}\r\n\r\nexport function tryParseBool(value: string | null | undefined) {\r\n return tryParse(value => value.toLowerCase() === 'true')(value);\r\n}\r\nexport function isNumericPositive(value: string): boolean {\r\n let res = /^\\d+$/.test(value);\r\n return res === true;\r\n}\r\n","import * as React from 'react';\r\nexport const useEffectOnMount = (effect: React.EffectCallback) => {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n React.useEffect(effect, []);\r\n};\r\nexport const useLayoutEffectOnMount = (effect: React.EffectCallback) => {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n React.useLayoutEffect(effect, []);\r\n};\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { SqlDayOfWeek } from 'api/odata/generated/enums/SqlDayOfWeek';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IReservationAssemblyPartDto } from 'api/odata/generated/entities/IReservationAssemblyPartDto';\r\n\r\n/* --- STATE --- */\r\nexport interface ReservationState {\r\n detailsState: AsyncDataState;\r\n reservationSettingsState?: ReservationSettingsState;\r\n equipmentsSettingsState?: ServiceSettingsState;\r\n confirmAssistedReservations?: boolean;\r\n trainingsData: UserTrainingReservationData | null;\r\n processing: boolean;\r\n valueHandler?: FieldHandlerProps;\r\n requestedValueFor?: keyof ReservationDetailsState;\r\n requestedValue?: any;\r\n equipmentChangeResultState?: ReservationEquipmentsChangeResult;\r\n isChangeCompleted?: boolean;\r\n transferState: TransferState;\r\n caluclateCreditState: AsyncDataState;\r\n hasCharges?: boolean;\r\n savedOfflineServices: IOtherServices[];\r\n refeshOfflineService?: boolean;\r\n terminationState: TerminationState;\r\n cloneReservation?: boolean;\r\n reservationDtoState?: IReservationDto;\r\n isEdit: boolean;\r\n asyncChangeLoading?: boolean;\r\n submitCalculateCredit?: boolean;\r\n /**\r\n * Shows/hides pricing confirmation (ConfirmPricing)\r\n */\r\n showConfirmPricing?: boolean;\r\n ByApprovalErrors?: Array;\r\n userCanRequestApproval?: boolean;\r\n refreshWorkOrderLink?: boolean;\r\n notFound?: boolean;\r\n}\r\nexport interface ReservationQueryStringParameters {\r\n uid?: string;\r\n id?: string;\r\n selectedIds?: string;\r\n Start?: string;\r\n End?: string;\r\n proj?: string;\r\n tsid?: string;\r\n remarks?: string;\r\n accid?: string;\r\n singleClick?: string;\r\n duration?: string;\r\n ug?: string;\r\n un?: string;\r\n ft?: string;\r\n /**\r\n * Service Request ID\r\n */\r\n srid?: string;\r\n /**\r\n * ServiceRequest row ID\r\n */\r\n srrid?: string;\r\n /**\r\n * Service request sample IDs (comma separated)\r\n */\r\n srsid?: string;\r\n /**\r\n * Service request samples run ID\r\n */\r\n sampleRunId?: string;\r\n Edit?: string;\r\n defaultMulti?: string;\r\n resIdTransferredFrom?: string;\r\n source?: string;\r\n UpdateToNow?: string;\r\n terminated?: string;\r\n Shrink?: string;\r\n resourceChanged?: string;\r\n staffEquipmentId?: string;\r\n staffUser?: string;\r\n bid?: string;\r\n}\r\n// Model to Save Reservation - mutch Server Model\r\nexport interface ReservationEquipment {\r\n EquipmentId: number;\r\n EquipmentName: string;\r\n AccServiceIds: number[];\r\n AssemblyId: number | null;\r\n\r\n ReservationId: number | null;\r\n}\r\nexport interface ReservationBudgetModel {\r\n id: number;\r\n text: string;\r\n percent: number | null;\r\n ReservationId: number | null;\r\n}\r\nexport interface CustomFormValueModel {\r\n FieldId: number;\r\n Value?: string;\r\n DisplayValue?: string;\r\n}\r\nexport interface ReservationPartModel {\r\n StarTime: Date | string;\r\n EquipmentId: number;\r\n Id: number;\r\n BudgetId: number | null;\r\n}\r\nexport enum FundingTypes {\r\n Internal = 0,\r\n External = 1,\r\n}\r\nexport enum ReservationStatus {\r\n Approved = 1,\r\n Pending = 2,\r\n Cancelled = 3,\r\n AllStatus = 4,\r\n CancelledByAdmin = 5,\r\n Done = 6,\r\n NotDone = 7,\r\n DoneWOBooking = 8,\r\n ApprovedOnce = 9,\r\n PendingCoord = 10,\r\n Tentative = 11,\r\n Draft = 12,\r\n}\r\nexport type ReservationStatusUnion = keyof typeof ReservationStatus;\r\nexport enum RecurringReservationUpdateOptions {\r\n CurrentReservation = 1,\r\n Following = 2,\r\n All = 3,\r\n}\r\nexport enum ReservationRepeatPeriods {\r\n Daily = 1,\r\n Weekly = 2,\r\n Monthly = 3,\r\n}\r\nexport enum ReservationRepeatMonthlyTypes {\r\n SameDate = 1,\r\n SameWeekDay = 2,\r\n}\r\nexport interface ReservationRepeatModel {\r\n RepeatsEveryNum: number | null;\r\n RepeatsEveryType: ReservationRepeatPeriods | null;\r\n RepeatsOn: SqlDayOfWeek[];\r\n RepeatsBy: ReservationRepeatMonthlyTypes;\r\n RepeatOption: RepetitiveOptions;\r\n RepeatEndTime: Date | string;\r\n Repeat_Period: number | null;\r\n}\r\n\r\nexport interface ReservationModel {\r\n Id: number;\r\n Services: ReservationEquipment[];\r\n StartTime: Date | string;\r\n EndTime: Date | string;\r\n Username: string;\r\n UserGroupId: string;\r\n Collaborators: string[];\r\n BudgetId: number | null;\r\n BudgetExperimentId: number | null;\r\n InstituteProjectId: number | null;\r\n WorkflowBooking: Entity | null;\r\n ExternalCustomerId: number | null;\r\n FundingTypeId: FundingTypes | null;\r\n StaffUser: string | null;\r\n PurchaseOrder: string | null;\r\n Reference: string | null;\r\n Tutoring: boolean;\r\n TrainingSignUp: boolean;\r\n TrainingSessionId: number | null;\r\n Status: ReservationStatus;\r\n AllStartTimes: (Date | string)[];\r\n InsertedAt: Date | string | null;\r\n InsertedBy: string | null;\r\n UpdatedAt: Date | string | null;\r\n UpdatedBy: string | null;\r\n CancelledAt: Date | string | null;\r\n UserRequestedByApproval: boolean;\r\n Remarks: string | null;\r\n TutorName: string | null;\r\n PartialAttendance: boolean;\r\n PartialAttendanceStart: number | null;\r\n PartialAttendanceEnd: number | null;\r\n CustomFormValues: CustomFormValueModel[];\r\n Name: string;\r\n TransferFromId: number | null;\r\n TransferInProgress: boolean;\r\n TransferredTo: string | null;\r\n WaitingTransferApproval: boolean;\r\n Parts: ReservationPartModel[];\r\n RecurringUpdateOption: RecurringReservationUpdateOptions;\r\n BudgetIds: ReservationBudgetModel[];\r\n OfflineServices: OfflineservicesModel[];\r\n Terminated: boolean;\r\n TotalCost: number;\r\n SavedForLater: boolean;\r\n FullDayReservation: boolean;\r\n SampleRunId: number | null;\r\n}\r\nexport interface ReservationInsertModel extends ReservationModel {\r\n Repeat: ReservationRepeatModel | null;\r\n AssignToServiceRequestId: number | null;\r\n AssignToServiceRequestRowIds: number[];\r\n AssignToServiceRequestSampleIds: number[];\r\n}\r\nexport interface ReservationUpdateModel extends ReservationModel {}\r\nexport interface OfflineservicesModel {\r\n ServiceTypeName: string;\r\n Quantity: number;\r\n UnitsName: string;\r\n Remarks: string;\r\n Factor: number;\r\n OfflineServiceTypeId: number;\r\n InventoryBatchId: number | null;\r\n BudgetId: number | null;\r\n BudgetExperimentId: number | null;\r\n UserGroup: string | null;\r\n}\r\n// react side Model\r\n\r\nexport interface IMandatoryEquipmentsDto extends CheckEntity {\r\n Id: number;\r\n ParentName: string;\r\n Name: string;\r\n AssetId: number | null;\r\n AccServices: IEquipmentAccServiceDto[];\r\n AssemblyId: number | null;\r\n HasAssemblyParts: boolean;\r\n HideProjects: boolean;\r\n AllowPartialProjectCharges: boolean;\r\n AllowPartialSingleProjectCharges: boolean;\r\n TrainingSignUpApproval: number;\r\n HideTrainingSession: boolean;\r\n HasAttendance: boolean;\r\n ForceTutoring: boolean;\r\n IsEquipmentTutoring: boolean;\r\n NotAllowReservations: boolean;\r\n AllowOneAccSerOnly: boolean;\r\n AllowReservationCollaborators: number;\r\n ForceFullDayReservations: boolean;\r\n IsAdmin: boolean;\r\n Color: string;\r\n ServiceGroupId: number;\r\n ServiceGroupName: string;\r\n ReservationOfflineServicesEnabled: boolean | null;\r\n RestrictReservationToTimeSlots: boolean;\r\n MinOrderHours: number;\r\n DefaultReservationDuration: number;\r\n DefaultAccServiceId: number | null;\r\n BudgetsTurnedOn: boolean;\r\n Billable: boolean;\r\n OfflineServices: IEquipmentOfflineServiceTypeDto[];\r\n FirstCustomFormId: number | null;\r\n CustomFormId: number | null;\r\n CustomForms: ICustomFormDto[];\r\n LoanTypeId: number;\r\n AllowModification: boolean;\r\n AllowExtendReservation: boolean;\r\n AllowUsersToShortenReservations: boolean;\r\n AllowedToTransfer: boolean;\r\n AllowedToTransferAll: boolean;\r\n EnforceReservationRestrictions: boolean;\r\n LimitlessReservationAllowed: boolean | null;\r\n checked: boolean;\r\n disabled: boolean;\r\n MaxOrderHours: number;\r\n MinOrderGap: number;\r\n RestrictDurationUnitsAmount: number | null;\r\n RestrictDurationUnitType: number | null;\r\n StaffUserSelectionVisible: boolean | null;\r\n StaffUserSelectionRequired: boolean | null;\r\n StaffUserSelection: IUserFilterDto[];\r\n RequireUserGroupCoordApproval: boolean;\r\n DraftReservationsTypeId: number;\r\n}\r\nexport interface IReservationEquipmentDto extends Entity {\r\n Id: number;\r\n Name: string;\r\n AssetId: number | null;\r\n AccServices: IEquipmentAccServiceDto[];\r\n AssemblyId: number | null;\r\n HasAssemblyParts: boolean;\r\n ReservationId?: number;\r\n HideProjects: boolean;\r\n AllowPartialProjectCharges: boolean;\r\n AllowPartialSingleProjectCharges: boolean;\r\n TrainingSignUpApproval: number;\r\n HideTrainingSession: boolean;\r\n HasAttendance: boolean;\r\n ForceTutoring: boolean;\r\n IsEquipmentTutoring: boolean;\r\n NotAllowReservations: boolean;\r\n AllowOneAccSerOnly: boolean;\r\n AllowReservationCollaborators: number;\r\n ForceFullDayReservations: boolean;\r\n BudgetExperimentSettings: boolean;\r\n Color: string;\r\n ServiceGroupId: number;\r\n ServiceGroupName: string;\r\n ReservationOfflineServicesEnabled: boolean | null;\r\n RestrictReservationToTimeSlots: boolean;\r\n MinOrderHours: number;\r\n DefaultReservationDuration: number;\r\n DefaultAccServiceId: number | null;\r\n BudgetsTurnedOn: boolean;\r\n Billable: boolean;\r\n MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n OfflineServices: IEquipmentOfflineServiceTypeDto[];\r\n FirstCustomFormId: number | null;\r\n CustomFormId: number | null;\r\n CustomForms: ICustomFormDto[];\r\n LoanTypeId: number;\r\n AllowModification: boolean;\r\n AllowExtendReservation: boolean;\r\n AllowUsersToShortenReservations: boolean;\r\n AllowedToTransfer: boolean;\r\n AllowedToTransferAll: boolean;\r\n EnforceReservationRestrictions: boolean;\r\n LimitlessReservationAllowed: boolean | null;\r\n MaxOrderHours: number;\r\n MinOrderGap: number;\r\n RestrictDurationUnitsAmount: number | null;\r\n RestrictDurationUnitType: number | null;\r\n StaffUserSelectionVisible: boolean | null;\r\n StaffUserSelectionRequired: boolean | null;\r\n StaffUserSelection: IUserFilterDto[];\r\n RequireUserGroupCoordApproval: boolean;\r\n DraftReservationsTypeId: number;\r\n}\r\nexport interface IEquipmentOfflineServiceTypeDto extends Entity {\r\n Id: number;\r\n Name: string;\r\n EquipmentId: number;\r\n Mandatory: boolean;\r\n HideProject: boolean;\r\n}\r\n/**\r\n * Represents an entity connected to a budget (e.g. Reservation)\r\n */\r\nexport interface IWithBudget {\r\n Budget: Entity | null; //IBudgetFilterDto | null;\r\n}\r\nexport interface ReservationDetailsState extends IWithBudget {\r\n Id: number;\r\n EquipmentsData: Entity[];\r\n FatherId?: number | null;\r\n TrainingSession: ITrainingSessionDto | null;\r\n StaffUser: Entity | null; //IUserFilterDto | null;\r\n BookedBy: Entity | null; //IUserFilterDto | null;\r\n Remarks?: string | null;\r\n StartTime: Date | string;\r\n EndTime: Date | string;\r\n Tutoring: boolean;\r\n Status?: Entity | null;\r\n TrainingSignUp: boolean;\r\n ADGroup?: Entity | null;\r\n DisplayName?: string | null;\r\n InstituteProject: Entity | null;\r\n WorkflowBooking?: Entity | null;\r\n ExternalCustomer?: Entity | null;\r\n FundingType?: Entity | null;\r\n PurchaseOrder?: string | null;\r\n Reference?: string | null;\r\n BudgetExperiment?: Entity | null;\r\n SampleIds: number[];\r\n PartialAttendance: boolean;\r\n PartialAttendanceStart?: number | null;\r\n PartialAttendanceEnd?: number | null;\r\n TransferredTo: Entity | null;\r\n WaitingTransferApproval: boolean;\r\n TransferFromId: number | null;\r\n SampleRunId?: number | null;\r\n AccServices: Entity[]; //IAccServiceDto[];\r\n FormValues: IFormValueDto[];\r\n CollaboratedUsers: Entity[]; //IUserFilterDto[];\r\n OptionalsEquipments: CheckEntity[];\r\n FullDayReservation: boolean;\r\n AssemblyParts?: IReservationAssemblyPartDto[] | null;\r\n}\r\nexport interface ReservationSettingsState {\r\n BaseEquipment: IReservationEquipmentDto | null;\r\n FatherId: number | null;\r\n Repeat_Period: number | null;\r\n TrainingSessionOnly: boolean;\r\n SessionId: number | null;\r\n RecordDate: Date | string | null;\r\n LastUpdateDate: Date | string | null;\r\n Entered: Date | string | null;\r\n Cancelled: Date | string | null;\r\n LastUpdateAdmin: Entity | null;\r\n RepeatEndTime: Date | string | null;\r\n Repeat: boolean;\r\n HasCharges: boolean;\r\n FundingTypeId: number | null;\r\n ParentAssemblyReservationId: number | null;\r\n TopAssemblyReservationId: number | null;\r\n TransferInProgress: boolean;\r\n HasOfflineServices: boolean;\r\n HasTrainingSession: boolean;\r\n NextReservationTime: string | null;\r\n PartReservations: IReservationPartDto[];\r\n AssignToServiceRequestId: number | null;\r\n AssignToServiceRequestRowIds: number[];\r\n AssignToServiceRequestSampleIds: number[];\r\n TutorName?: string | null;\r\n CustomForms: ICustomFormDto[];\r\n MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n FirstInitEquipments: number[];\r\n OfflineMandatory: IOtherServices[];\r\n OfflineOptional: IOtherServices[];\r\n //localSettings\r\n UserRequestedByApproval: boolean;\r\n RecurringUpdateOption: number | null;\r\n TerminateReservation: boolean;\r\n Owner: boolean;\r\n Ongoing: boolean;\r\n FutureReservation: boolean;\r\n PastReservation: boolean;\r\n IsForceTutoring: boolean;\r\n ForceFullDayReservations: boolean;\r\n StaffMandatoryEquipment: IReservationEquipmentDto | null;\r\n TotalCost?: number;\r\n SaveForLater: boolean;\r\n}\r\nexport interface IReservationDto {\r\n Id: number;\r\n EquipmentsData: IReservationEquipmentDto[];\r\n Budget: IBudgetFilterDto | null; //IBudgetFilterDto | null;\r\n TrainingSession: ITrainingSessionDto | null; //ITrainingSessionDto | null;\r\n StaffUser: IUserFilterDto | null; //IUserFilterDto | null;\r\n BookedBy: IUserFilterDto | null; //IUserFilterDto | null;\r\n Remarks?: string | null;\r\n StartTime: Date | string;\r\n EndTime: Date | string;\r\n Tutoring: boolean;\r\n FullDayReservation: boolean;\r\n TutorName?: string | null;\r\n StatusId: number;\r\n TrainingSignUp: boolean;\r\n ADGroup?: Entity | null;\r\n DisplayName?: string | null;\r\n InstituteProject: Entity | null;\r\n WorkflowBooking?: Entity | null;\r\n ExternalCustomer?: Entity | null;\r\n PurchaseOrder?: string | null;\r\n Reference?: string | null;\r\n BudgetExperiment?: Entity | null;\r\n TransferFromId: number | null;\r\n PartialAttendance: boolean;\r\n PartialAttendanceStart?: number | null;\r\n PartialAttendanceEnd?: number | null;\r\n TransferredTo: Entity | null;\r\n SampleRunId?: number | null;\r\n AccServiceId: number | null;\r\n AccSerIds: string | null;\r\n AccServices: IEquipmentAccServiceDto[]; //IAccServiceDto[];\r\n FormValues: IFormValueDto[];\r\n CollaboratedUsers: IUserFilterDto[]; //IUserFilterDto[];\r\n SampleIds: number[];\r\n PartReservations: IReservationPartDto[];\r\n BaseEquipment: IReservationEquipmentDto | null;\r\n FatherId: number | null;\r\n Repeat_Period: number | null;\r\n TrainingSessionOnly: boolean;\r\n SessionId: number | null;\r\n RecordDate: Date | string | null;\r\n LastUpdateDate: Date | string | null;\r\n Entered: Date | string | null;\r\n Cancelled: Date | string | null;\r\n LastUpdateAdmin: IUserFilterDto | null;\r\n RepeatEndTime: Date | string | null;\r\n Repeat: boolean;\r\n HasCharges: boolean;\r\n\r\n /**\r\n * This property is used to read the funding type from the server (initReservation)\r\n */\r\n FundingTypeId: number | null;\r\n ParentAssemblyReservationId: number | null;\r\n TopAssemblyReservationId: number | null;\r\n WaitingTransferApproval: boolean;\r\n TransferInProgress: boolean;\r\n HasOfflineServices: boolean;\r\n HasTrainingSession: boolean;\r\n NextReservationTime: string | null;\r\n AssignToServiceRequestId: number | null;\r\n AssignToServiceRequestRowIds: number[];\r\n AssignToServiceRequestSampleIds: number[];\r\n CustomForms: ICustomFormDto[];\r\n MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n TerminateReservation: boolean;\r\n FirstInitEquipments: number[];\r\n OfflineMandatory: IOtherServices[];\r\n IsForceTutoring: boolean;\r\n ForceFullDayReservations: boolean;\r\n ForceReservationSettingsState: boolean;\r\n IsFuture: boolean;\r\n IsPast: boolean;\r\n IsOngoing: boolean;\r\n StaffMandatoryEquipment: IReservationEquipmentDto | null;\r\n AssemblyParts: IReservationAssemblyPartDto[] | null;\r\n}\r\nexport interface IReservationPartDto {\r\n Id: number;\r\n Equipment: IReservationEquipmentDto;\r\n BudgetID: number | null;\r\n BudgetName: string | null;\r\n StartTime: Date | string;\r\n ParentAssemblyReservationId: number | null;\r\n TopAssemblyReservationId: number | null;\r\n AccServiceId: number | null;\r\n AccSerIds: string | null;\r\n Repeat_Period: number | null;\r\n}\r\nexport interface ReservationDetailsResponseModel extends IResponseType {\r\n Id: number | null;\r\n IsValid: boolean;\r\n model: IReservationDto;\r\n insertedModel: ReservationInsertModel;\r\n warnOnTrainingSession: boolean;\r\n ReservationIds: number[];\r\n FirstEquipmentId: number;\r\n userTrainingsApprovalData: UserTrainingReservationData | null;\r\n EquipmentChangeResult: ReservationEquipmentsChangeResult | null;\r\n credit: number | null;\r\n balance: number | null;\r\n}\r\nexport interface ReservationGlobalState {\r\n details: ReservationDetailsState;\r\n settings: ReservationSettingsState;\r\n customFormFiles: IFormFileValue[];\r\n RepetitiveOptions: IRepetitiveDto | null;\r\n offlineServices: IOtherServices[];\r\n}\r\nexport interface ServiceSettingsState {\r\n HasHideProjects: boolean;\r\n HasConflictProjects: boolean;\r\n HasMultipleProjects: boolean;\r\n HasPartialSingleProject: boolean;\r\n TrainingSignUpApproval?: number;\r\n HideTrainingSession: boolean;\r\n HasAttendance: boolean;\r\n ForceTutoring: boolean;\r\n ForceFullDayReservations: boolean;\r\n IsEquipmentTutoring: boolean;\r\n NotAllowReservations: boolean;\r\n AllowOneAccSerOnly: boolean;\r\n AllowReservationCollaborators: boolean;\r\n IsAllAdmin: boolean;\r\n AllOffServicesAllowed: boolean | null;\r\n\r\n RestrictReservationToTimeSlots: boolean;\r\n MinOrderHours: number;\r\n DefaultReservationDuration: number;\r\n DefaultAccServiceId: number | null;\r\n BudgetsTurnedOn: boolean;\r\n Billable: boolean;\r\n CustomForms: ICustomFormDto[];\r\n IsLoanDesc: boolean;\r\n AllowModification: boolean;\r\n AllowExtendReservation: boolean;\r\n AllowUsersToShortenReservations: boolean;\r\n AllowedToTransfer: boolean;\r\n AllowedToTransferAll: boolean;\r\n StartSlots: Date | string | null;\r\n EndSlots: Date | string | null;\r\n BudgetVisible: boolean;\r\n OfflineServicesVisible: boolean;\r\n Groups: number[];\r\n HasAccServices: boolean;\r\n MaxOrderHours: number;\r\n MinOrderGap: number;\r\n RestrictDurationUnitsAmount: number | null;\r\n RestrictDurationUnitType: number | null;\r\n StaffUserVisibleAllways: boolean;\r\n StaffUserVisibleOnPending: boolean;\r\n StaffUserRequiredAlwais: boolean;\r\n StaffUserRequiredOnPending: boolean;\r\n StaffUserSelection: IUserFilterDto[];\r\n RequireUserGroupCoordApproval: boolean;\r\n DraftForAll: boolean;\r\n DraftApprovalRequred: boolean;\r\n DraftSaveForLater: boolean;\r\n budgetExperimentVisible: boolean;\r\n EnforceReservationRestrictions: boolean;\r\n LimitlessReservationAllowed: boolean;\r\n OfflineServiceTypes: IEquipmentOfflineServiceTypeDto[];\r\n}\r\nexport interface EquipmentsChangeStateParameters {\r\n Equipments: number[];\r\n AccServices: number[];\r\n ReservationId: number | null;\r\n Start: Date | string;\r\n End: Date | string;\r\n BookedBy: string | null;\r\n ADGroup: string | null;\r\n Tutoring: boolean;\r\n FullDayReservation: boolean;\r\n Status: number;\r\n TrainingSignUp: boolean;\r\n FundingTypeId: number;\r\n TrainingSessionId: number | null;\r\n BudgetId: number | null;\r\n Remarks: string | null;\r\n CheckStatus: boolean;\r\n CheckSession: boolean;\r\n}\r\nexport interface EquipmentSlotParameters {\r\n EquipmentId: number;\r\n Start: Date | string;\r\n End: Date | string;\r\n}\r\n\r\nexport interface ReservationEquipmentsChangeResult {\r\n CustomForms?: CustomFormsResult;\r\n ErrorMessages: string[];\r\n WarningMessages: string[];\r\n DefaultBudget: IBudgetFilterDto | null;\r\n StatusChange: StatusChangeResult | null;\r\n TrainingSessionData: TrainingSessionResult | null;\r\n}\r\nexport interface ReservationValidationResult {\r\n ErrorMessages: string[];\r\n WarningMessages: string[];\r\n PermissionErrors: string[];\r\n PrerequisiteTrainings?: PrerequisitsResult;\r\n UserCanRequestApproval?: boolean;\r\n}\r\nexport interface AsyncEquipmentsChangeResult {\r\n StartSlots: Date | string | null;\r\n EndSlots: Date | string | null;\r\n}\r\nexport interface StatusChangeResult {\r\n Status: number;\r\n Tutoring: boolean;\r\n IsForceTutoring: boolean;\r\n ForceFullDayReservations: boolean;\r\n FullDayReservation: boolean;\r\n}\r\nexport interface TrainingSessionResult {\r\n TrainingSessionId: number | null;\r\n Start: Date | string;\r\n End: Date | string;\r\n HasTrainingSession: boolean;\r\n StaffUser: string | null;\r\n}\r\nexport interface PrerequisitsResult {\r\n PrerequisiteTrainings: Entity[];\r\n ErrorMessage: string;\r\n IsValid: boolean;\r\n}\r\nexport interface CustomFormsResult {\r\n CustomForms: ICustomFormDto[];\r\n ErrorMessages: string[];\r\n IsValid: boolean;\r\n}\r\nexport interface UserTrainingEquipments {\r\n ReservationId: number | null;\r\n EquipmentId: number;\r\n EquipmentName: string;\r\n TrainingRecordId: number | null;\r\n RequiresAdminApproval: boolean;\r\n NotShowPopup: boolean;\r\n}\r\nexport interface UserTrainingReservationData {\r\n UserName: string;\r\n StartTime: Date | string;\r\n EndTime: Date | string;\r\n Equipments: UserTrainingEquipments[];\r\n FatherId: number | null;\r\n ReservationId: number | null;\r\n Tutoring: boolean;\r\n}\r\nexport interface HasUsageEndRresult {\r\n HasUsage: boolean;\r\n OfflineServiceTypeIds: number[];\r\n}\r\nexport interface TransferToReservation {\r\n User: Entity;\r\n ReservtionId: number;\r\n}\r\nexport interface TransferState {\r\n User: Entity | null;\r\n ReservtionId?: number;\r\n WaitingTransferApproval?: boolean;\r\n transferProcessing?: boolean;\r\n transferStepCompleted?: boolean;\r\n}\r\nexport interface RequestReservations {\r\n RequestId: number | null;\r\n TotalRowsCount: number | null;\r\n AssociatedRowsCount: number | null;\r\n}\r\nexport interface TerminationState {\r\n terminatProcessing?: boolean;\r\n terminateCompleted?: boolean;\r\n}\r\nexport const getSingleReservationStatus = (val: number): Entity => {\r\n return enumToEntityArray(ReservationStatus).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\nexport type createReservation_Success_Action = PayloadAction<{\r\n hasErrors: boolean;\r\n reservationIds: number[];\r\n insertModel?: ReservationInsertModel;\r\n}>;\r\nexport interface PricingState {\r\n credit: number;\r\n balance: number | null;\r\n}\r\n","import { useState, useMemo, SetStateAction } from 'react';\r\n\r\nexport type AsyncSetState = (\r\n nextState: SetStateAction | Promise>,\r\n cancelToken?: { mounted: boolean },\r\n) => void;\r\n\r\nexport type AsyncExtendState = (\r\n partialState:\r\n | SetStateAction>\r\n | Promise>>,\r\n) => void;\r\n\r\n/**\r\n * A hook similar to React's `useState` which allows you to also pass promises which resolve to the next state.\r\n *\r\n * Also returns an extra method which extends the current state, synchronously and/or asynchronously.\r\n * For the current state to be extended, it must first be a non-null value.\r\n *\r\n * Example:\r\n * ```ts\r\n * interface State {\r\n * foo: string\r\n * bar: string\r\n * }\r\n *\r\n * const [ state, setState, extendState ] = useAsyncExtendedState({\r\n * foo: 'foo',\r\n * bar: 'bar'\r\n * })\r\n *\r\n * // This works as usual.\r\n * setState({ foo: 'Hello', bar: 'World!' })\r\n * setState(state => ({ foo: 'Hello', bar: 'World!' }))\r\n *\r\n * // This also works.\r\n * const fetchState = () => API.client.get('data').then(response => {\r\n * return response.data\r\n *\r\n * // or return (state: State) => {\r\n * // return response.data\r\n * // }\r\n * })\r\n *\r\n * // The state will eventually be set to the asynchronously resolved value.\r\n * setState(fetchState())\r\n *\r\n * // Or extend the state immediately.\r\n * extendState({ foo: 'Hello' })\r\n * extendState(state => ({ bar: 'World!' }))\r\n *\r\n * // Or extend the state asynchronously.\r\n * const fetchPartialState = () => API.client.get>('data').then(response => {\r\n * return response.data\r\n *\r\n * // or return (state: State) => {\r\n * // return response.data\r\n * // }\r\n * })\r\n *\r\n * // The state will eventually be extended by the asynchronously resolved value.\r\n * extendState(fetchPartialState())\r\n * ```\r\n */\r\nexport const useAsyncExtendedState = (\r\n initialState: State,\r\n): [State, AsyncSetState, AsyncExtendState] => {\r\n const [state, setState] = useState(initialState);\r\n\r\n const asyncSetState: AsyncSetState = useMemo(\r\n () => async (nextState, cancelToken) => {\r\n const initialNextState = nextState;\r\n\r\n try {\r\n if (nextState instanceof Promise) {\r\n nextState = await nextState;\r\n\r\n if (nextState === initialNextState) {\r\n // there was an error but it was caught by something else - i.e., nextState.catch()\r\n throw new Error(`Uncatchable error.`);\r\n }\r\n }\r\n if (cancelToken && !cancelToken.mounted) return;\r\n\r\n setState(state => {\r\n if (typeof nextState === `function`) {\r\n nextState = (nextState as (state: State) => State)(state);\r\n }\r\n\r\n return nextState as State;\r\n });\r\n } catch (error) {}\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [],\r\n );\r\n\r\n const asyncExtendState: AsyncExtendState = useMemo(\r\n () => async partialState => {\r\n const initialExtendState = partialState;\r\n\r\n try {\r\n if (partialState instanceof Promise) {\r\n partialState = await partialState;\r\n\r\n if (partialState === initialExtendState) {\r\n // there was an error but it was caught by something else - i.e., partialState.catch()\r\n throw new Error(`Uncatchable error.`);\r\n }\r\n }\r\n\r\n setState(state => {\r\n if (typeof partialState === `function`) {\r\n partialState = (partialState as (state: State) => Partial)(\r\n state,\r\n );\r\n }\r\n\r\n return { ...state, ...partialState } as State;\r\n });\r\n } catch (err) {}\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [],\r\n );\r\n\r\n return [state, asyncSetState, asyncExtendState];\r\n};\r\n","/**\r\n *\r\n * ExternalLink\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n Link as MuiLink,\r\n LinkBaseProps as MuiLinkProps,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { IPathAndQuery, toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { makeStyles } from '@material-ui/styles';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nexport interface ExternalLinkProps extends Omit {\r\n href: string | IPathAndQuery;\r\n /**\r\n * Show external URL icon with copy url functionality\r\n */\r\n showIcon?: boolean;\r\n /**\r\n * used in case when need to use URL without adding root of the installation so to avoid toRootedURL() method.\r\n */\r\n useInlineUrl?: boolean;\r\n to?: string | IPathAndQuery;\r\n}\r\n\r\n/**\r\n * External link - opens in a new tab/window\r\n * This should be used for all external links and should be clear that it leads to a resource outside of the system\r\n * @param props\r\n * @returns\r\n */\r\nexport const ExternalLink = React.forwardRef(function ExternalLink(\r\n props: ExternalLinkProps,\r\n ref,\r\n) {\r\n return ;\r\n});\r\n\r\n/**\r\n * Link to a resource inside the larger system but external to the React app\r\n * Renders ;\r\n}\r\n\r\n/**\r\n * Link that can accept forwarded ref prop. Usefull in the \"override component\" in the material ui\r\n * Usage example: (\r\n function LinkBehavior(props, ref) {\r\n const { href, to, useInlineUrl, ...rest } = props;\r\n const history = useHistory();\r\n const classes = useStyles();\r\n const emptyLink = href === '';\r\n const absolutePath =\r\n typeof href === 'string'\r\n ? useInlineUrl === true\r\n ? href\r\n : toRootedURL(href)\r\n : toRootedURL(\r\n (href as IPathAndQuery).path,\r\n (href as IPathAndQuery).search,\r\n );\r\n const localPath =\r\n to !== undefined\r\n ? typeof to === 'string'\r\n ? to\r\n : (to as IPathAndQuery).path +\r\n '?' +\r\n toQueryString((to as IPathAndQuery).search)\r\n : to;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const handleLocalPathClick = React.useCallback(() => {\r\n if (localPath !== undefined) {\r\n history.push('');\r\n history.replace(localPath);\r\n }\r\n }, [history, localPath]);\r\n const handleIconClick = () => {\r\n clipboardWrite(absolutePath).then(() =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: `${t(translations.URLCopied)} - ${absolutePath}`,\r\n }),\r\n ),\r\n );\r\n };\r\n if (props.showIcon === true) {\r\n return (\r\n \r\n {\r\n if (to !== undefined) {\r\n handleLocalPathClick();\r\n }\r\n if (!!props.onClick) {\r\n props.onClick(event);\r\n }\r\n }}\r\n {...rest}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n {\r\n if (to !== undefined) {\r\n handleLocalPathClick();\r\n }\r\n if (!!props.onClick) {\r\n props.onClick(event);\r\n }\r\n }}\r\n {...rest}\r\n />\r\n );\r\n }\r\n },\r\n);\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n externalLinkRoot: {\r\n whiteSpace: 'nowrap',\r\n },\r\n link: { cursor: 'pointer' },\r\n externalLinkIcon: {\r\n display: 'inline',\r\n },\r\n}));\r\n\r\nconst permissionName = 'clipboard-write' as PermissionName;\r\nconst clipboardWriteEnabled = async () => {\r\n const result = await navigator.permissions.query({ name: permissionName });\r\n return result.state === 'granted' || result.state === 'prompt';\r\n};\r\nconst clipboardWrite = async (text: string) => {\r\n const enabled = await clipboardWriteEnabled();\r\n if (enabled) {\r\n const copyResult = await navigator.clipboard.writeText(text);\r\n return copyResult;\r\n }\r\n};\r\n","import { selectAppTimeZone } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport React from 'react';\r\n\r\nexport interface ISystemDate {\r\n newDate: () => Date;\r\n getOffsetDate: (date: Date | string | undefined | null) => Date;\r\n getOffset: (date: Date | undefined) => Date;\r\n systemOffset: number;\r\n currentTimezoneOffser: number;\r\n withoutOffset: (date: Date | string | undefined | null) => Date;\r\n getOffsetDateOrNull: (\r\n date: Date | string | number | object | undefined | null,\r\n ) => Date | null;\r\n}\r\n\r\nexport const useSystemDate = (): ISystemDate => {\r\n const appTimeZone = useSelector(selectAppTimeZone);\r\n const systemOffset = appTimeZone?.TimezoneOffsetMinutes ?? 0;\r\n const currentTimezoneOffser = new Date().getTimezoneOffset();\r\n const getOffset = React.useCallback(\r\n (date: Date | undefined): Date => {\r\n const currentDateOffset = (date || new Date()).getTimezoneOffset();\r\n const appNow = dateUtils.addMinutes(\r\n date || new Date(),\r\n systemOffset + currentDateOffset,\r\n );\r\n return appNow;\r\n },\r\n [systemOffset],\r\n );\r\n const newDate = React.useCallback(() => {\r\n return getOffset(undefined);\r\n }, [getOffset]);\r\n const getOffsetDate = React.useCallback(\r\n (date: Date | string | undefined | null) => {\r\n if (date === null || date === undefined) {\r\n return newDate();\r\n } else {\r\n let parsedDate = dateUtils.dateOrStringToDate(date);\r\n return getOffset(parsedDate);\r\n }\r\n },\r\n [getOffset, newDate],\r\n );\r\n const getOffsetDateOrNull = React.useCallback(\r\n (date: Date | string | number | object | undefined | null) => {\r\n if (date === null || date === undefined) {\r\n return null;\r\n } else {\r\n let localDate = dateUtils.dateFnsUtils.date(date);\r\n if (localDate === null) return null;\r\n let parsedDate = dateUtils.dateOrStringToDate(localDate);\r\n return getOffset(parsedDate);\r\n }\r\n },\r\n [getOffset],\r\n );\r\n const withoutOffset = React.useCallback(\r\n (date: Date | string | undefined | null) => {\r\n const withOffset =\r\n date === null || date === undefined\r\n ? newDate()\r\n : dateUtils.dateOrStringToDate(date);\r\n return dateUtils.addMinutes(\r\n withOffset,\r\n (withOffset.getTimezoneOffset() + systemOffset) * -1,\r\n );\r\n },\r\n [newDate, systemOffset],\r\n );\r\n return {\r\n newDate,\r\n getOffsetDate,\r\n getOffset,\r\n systemOffset,\r\n currentTimezoneOffser,\r\n withoutOffset,\r\n getOffsetDateOrNull,\r\n };\r\n};\r\n","import { Dialog } from '@material-ui/core';\r\nimport { ReactNode } from 'react';\r\nimport clsx from 'clsx';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectIsCoverExpanded } from '../../slice/selectors';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useLayoutSlice } from '../../slice';\r\n\r\nexport interface CoverWrapperProps {\r\n children: ReactNode;\r\n open: boolean;\r\n onClose?: (e: any) => void;\r\n}\r\n\r\nexport const CoverWrapper = ({\r\n children,\r\n open,\r\n onClose,\r\n}: CoverWrapperProps) => {\r\n const isMobile = DetectIsMobile();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const coverExpanded = useSelector(selectIsCoverExpanded);\r\n useEffectOnMount(() => {\r\n dispatch(actions.setIsCoverOpen(open));\r\n });\r\n return (\r\n
e.stopPropagation()}>\r\n {\r\n // console.log('cover backdrop click', e);\r\n // !!onClose && onClose(e);\r\n // }}\r\n >\r\n {children}\r\n \r\n
\r\n );\r\n};\r\n","/**\r\n *\r\n * LinearProgress\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n LinearProgress as MuiLinearProgress,\r\n LinearProgressProps as MuiLinearProgressProps,\r\n} from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\nexport interface LinearProgressProps\r\n extends MuiLinearProgressProps,\r\n AdditionalProps {}\r\ninterface AdditionalProps {\r\n /**\r\n * Show/hide the progress bar preventing layout shift.\r\n */\r\n visible: boolean | undefined;\r\n}\r\n\r\nfunction LinearProgress1({ visible = false, ...props }: LinearProgressProps) {\r\n return ;\r\n}\r\n\r\n/**\r\n * MUI's LinearProgress extension that helps to prevent layout shift when component is added/removed from the tree.\r\n */\r\nexport const LinearProgress = styled(LinearProgress1)`\r\n visibility: ${props => (props.visible === true ? 'visible' : 'hidden')};\r\n`;\r\n","import * as React from 'react';\r\nimport { LinearProgress } from 'app/components/LinearProgress';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TitlePage } from './TitlePage';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport {\r\n SwitchActions,\r\n SwitchActionsProps,\r\n} from '../PageActions/SwitchActions';\r\nimport { SkeletonIfLoading } from './SkeletonIfLoading';\r\nimport { useTheme } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface HeadProps {\r\n closable: boolean | undefined;\r\n useSidePanel: boolean;\r\n closePanel: () => void;\r\n pageName: React.ReactNode;\r\n titlePage: string | undefined;\r\n pageLink: string | undefined;\r\n toPageLink?: string;\r\n titleTooltip: string | undefined;\r\n isMobile: boolean;\r\n disableExpandToggle: boolean | undefined;\r\n expandPanel: () => void;\r\n subTitlePage?: React.ReactNode;\r\n leftTopActions?: ActionRenderer[];\r\n rightTopActions?: ActionRenderer[];\r\n onSubmit?: () => void;\r\n switchState?: SwitchActionsProps;\r\n useSwithActions?: boolean;\r\n showProcessing?: boolean;\r\n loading: boolean;\r\n isCover?: boolean;\r\n rightTopActionsLength?: number;\r\n rightActionsLoading?: boolean;\r\n}\r\nconst TitleRoot = styled('div')(({ theme }) => ({\r\n '&.page-wrapper-title-root': {\r\n paddingTop: '24px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n width: '100%',\r\n gap: '24px',\r\n '.topIcons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n alignSelf: 'end',\r\n padding: 0,\r\n gap: theme.spacing(1.25),\r\n '.topRightIcons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n position: 'absolute',\r\n padding: 0,\r\n gap: '12px',\r\n top: theme.spacing(2),\r\n },\r\n },\r\n '.titleContainer': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n //justifyContent: 'space-between',\r\n //alignItems: 'flex-end',\r\n alignItems: 'center',\r\n gap: '24px',\r\n padding: '0px 32px',\r\n width: '100%',\r\n alignSelf: 'stretch',\r\n //gap: theme.spacing(4.5),\r\n '.titleSubtitle': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n // flexDirection: 'column',\r\n // alignItems: 'flex-start',\r\n // padding: 0,\r\n '& .titleAndDescription': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '4px',\r\n flex: '1 0 0',\r\n '& .titleContent': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'flex-start',\r\n gap: '8px',\r\n alignSelf: 'stretch',\r\n '& .iconAdjustment': {\r\n display: 'flex',\r\n paddingTop: '2px',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n '& .textButton': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n },\r\n },\r\n '& .pageDescription': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n },\r\n '& .subPageDescription': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '4px',\r\n flex: '1 0 0',\r\n },\r\n },\r\n },\r\n },\r\n '.rightControls': {\r\n display: 'flex',\r\n //flexDirection: 'row',\r\n alignItems: 'center',\r\n //padding: 0,\r\n gap: '8px',\r\n },\r\n },\r\n },\r\n}));\r\nexport function Head(props: HeadProps) {\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n const {\r\n closable,\r\n useSidePanel,\r\n closePanel,\r\n pageName,\r\n titlePage,\r\n pageLink,\r\n titleTooltip,\r\n isMobile,\r\n disableExpandToggle,\r\n expandPanel,\r\n subTitlePage,\r\n leftTopActions,\r\n rightTopActions,\r\n onSubmit,\r\n showProcessing,\r\n loading,\r\n useSwithActions,\r\n switchState,\r\n isCover,\r\n rightTopActionsLength,\r\n rightActionsLoading,\r\n } = props;\r\n const actionsLength = React.useMemo(() => {\r\n if (rightTopActions !== undefined && rightTopActions.length > 0) {\r\n let res = rightTopActionsLength !== undefined ? rightTopActionsLength : 1;\r\n if (res > rightTopActions.length) {\r\n res = rightTopActions.length;\r\n }\r\n return res;\r\n } else return 0;\r\n }, [rightTopActions, rightTopActionsLength]);\r\n return (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {pageName && (\r\n
\r\n
\r\n \r\n ) : undefined\r\n }\r\n onClick={() =>\r\n !isMobile &&\r\n useSidePanel &&\r\n !disableExpandToggle &&\r\n expandPanel()\r\n }\r\n >\r\n {pageName}\r\n \r\n {/* \r\n {pageName}\r\n */}\r\n
\r\n
\r\n )}\r\n
\r\n {titlePage ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n {subTitlePage && (\r\n
\r\n {subTitlePage}\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n <>\r\n {!!leftTopActions &&\r\n leftTopActions?.length > 0 &&\r\n leftTopActions?.map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n {rightActionsLoading &&\r\n (!rightTopActions ||\r\n (!!rightTopActions && rightTopActions?.length === 0)) && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {!!rightTopActions && rightTopActions?.length > 0 && (\r\n \r\n {rightTopActions\r\n .filter((t, index) => index < actionsLength)\r\n .map(f => (\r\n {f(onSubmit)}\r\n ))}\r\n ind >= actionsLength)\r\n .map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n keepOpen={false}\r\n >\r\n \r\n )}\r\n {useSwithActions && switchState && (\r\n \r\n \r\n \r\n )}\r\n {closable && useSidePanel && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n {showProcessing && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n
\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TitlePage } from './TitlePage';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport {\r\n SwitchActions,\r\n SwitchActionsProps,\r\n} from '../PageActions/SwitchActions';\r\nimport styled from 'styled-components';\r\nimport { useTheme } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { LinearProgress } from 'app/components/LinearProgress';\r\nimport { useAbsolute } from 'utils/url-utils';\r\n\r\nexport interface ShortHeadProps {\r\n closable: boolean | undefined;\r\n useSidePanel: boolean;\r\n closePanel: () => void;\r\n pageName: React.ReactNode;\r\n titlePage: string | undefined;\r\n pageLink: string | undefined;\r\n toPageLink?: string;\r\n titleTooltip: string | undefined;\r\n isMobile: boolean;\r\n disableExpandToggle: boolean | undefined;\r\n expandPanel: () => void;\r\n subTitlePage?: React.ReactNode;\r\n leftTopActions?: ActionRenderer[];\r\n rightTopActions?: ActionRenderer[];\r\n rightTopActionsAsMenu?: boolean;\r\n switchState?: SwitchActionsProps;\r\n useSwithActions?: boolean;\r\n onSubmit?: () => void;\r\n showProcessing?: boolean;\r\n loading: boolean;\r\n isCover?: boolean;\r\n useShortView?: boolean;\r\n hideMenu?: boolean;\r\n}\r\nconst ShortTitleRoot = styled('div')(({ theme }) => ({\r\n '&.page-wrapper-short-title-root': {\r\n padding: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n width: '100%',\r\n gap: theme.spacing(1.25),\r\n '.shortTitleContainer': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n padding: theme.spacing(2, 2, 1.5),\r\n alignItems: 'flex-start',\r\n width: '100%',\r\n gap: theme.spacing(0.5),\r\n '.iconAndTitle': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n width: '100%',\r\n gap: theme.spacing(1.5),\r\n alignSelf: 'center',\r\n },\r\n '.shortRightIcons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: '8px',\r\n },\r\n },\r\n '.shortSwithContainer': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n width: '100%',\r\n gap: 10,\r\n padding: theme.spacing(1, 3, 2),\r\n // '.shortSwithButtons': {\r\n // display: 'flex',\r\n // flexDirection: 'row',\r\n // alignItems: 'center',\r\n // width: '100%',\r\n // height: '32px',\r\n // border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n // background: bookitColors.base.white,\r\n // borderRadius: '6px',\r\n // //padding: theme.spacing(0.25, 0.25),\r\n // //gap: '12px',\r\n // justifyContent: 'stretch',\r\n // },\r\n },\r\n },\r\n}));\r\nexport function ShortHead(props: ShortHeadProps) {\r\n const { t } = useTranslation();\r\n const {\r\n closable,\r\n useSidePanel,\r\n closePanel,\r\n titlePage,\r\n pageLink,\r\n toPageLink,\r\n titleTooltip,\r\n isMobile,\r\n disableExpandToggle,\r\n expandPanel,\r\n rightTopActions,\r\n rightTopActionsAsMenu,\r\n onSubmit,\r\n useSwithActions,\r\n switchState,\r\n showProcessing,\r\n loading,\r\n isCover,\r\n useShortView,\r\n hideMenu,\r\n } = props;\r\n const theme = useTheme();\r\n const topIconsLength = React.useMemo(() => {\r\n return (\r\n (!isMobile && useSidePanel && !disableExpandToggle ? 1 : 0) +\r\n (closable && useSidePanel ? 1 : 0) +\r\n (rightTopActions !== undefined && rightTopActions.length > 0\r\n ? rightTopActions.length === 1 && !rightTopActionsAsMenu\r\n ? 1\r\n : rightTopActions.length === 2 && !rightTopActionsAsMenu\r\n ? 2\r\n : 1\r\n : 0)\r\n );\r\n }, [\r\n closable,\r\n disableExpandToggle,\r\n isMobile,\r\n rightTopActions,\r\n rightTopActionsAsMenu,\r\n useSidePanel,\r\n ]);\r\n const absolutePageLink = useAbsolute(pageLink, toPageLink);\r\n return (\r\n \r\n
\r\n
\r\n {loading ? (\r\n \r\n ) : (\r\n \r\n {titlePage && (\r\n \r\n )}\r\n \r\n )}\r\n
\r\n
\r\n {loading ? (\r\n \r\n ) : (\r\n \r\n {rightTopActions !== undefined && rightTopActions.length > 0 && (\r\n <>\r\n {rightTopActions.length === 1 && !rightTopActionsAsMenu ? (\r\n {rightTopActions[0](onSubmit)}\r\n ) : rightTopActions.length === 2 && !rightTopActionsAsMenu ? (\r\n \r\n {rightTopActions[0](onSubmit)}\r\n {rightTopActions[1](onSubmit)}\r\n \r\n ) : (\r\n (\r\n {item(onSubmit)}\r\n )),\r\n ].filter(v => !!v) as JSX.Element[]\r\n }\r\n >\r\n )}\r\n \r\n )}\r\n \r\n {!isMobile &&\r\n absolutePageLink !== undefined &&\r\n (useSidePanel || isCover) &&\r\n !disableExpandToggle && (\r\n {\r\n if (isCover) {\r\n if (!!absolutePageLink) {\r\n window.open(absolutePageLink, '_blank');\r\n }\r\n } else {\r\n expandPanel();\r\n }\r\n }}\r\n >\r\n \r\n \r\n )}\r\n {closable && useSidePanel && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )}\r\n
\r\n
\r\n {useSwithActions && switchState && !loading && (\r\n
\r\n \r\n
\r\n )}\r\n {showProcessing && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const TopButtonsContainer = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n '.leftButtons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n width: 'auto',\r\n gap: theme.spacing(1),\r\n },\r\n '.rightButtons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n width: 'auto',\r\n gap: theme.spacing(1),\r\n },\r\n}));\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { TopButtonsContainer } from '../styled';\r\n\r\nexport interface ButtonsPanelProps {\r\n leftActions?: ActionRenderer[];\r\n rightActions?: ActionRenderer[];\r\n isMobile: boolean;\r\n sidePanelExpanded: boolean;\r\n disableExpandToggle: boolean | undefined;\r\n useSidePanel: boolean;\r\n onSubmit?: () => void;\r\n expandPanel: () => void;\r\n leftActionsMaxLength?: number;\r\n}\r\n\r\nexport function ButtonsPanel(props: ButtonsPanelProps) {\r\n const { t } = useTranslation();\r\n const {\r\n leftActions,\r\n rightActions,\r\n isMobile,\r\n sidePanelExpanded,\r\n disableExpandToggle,\r\n useSidePanel,\r\n onSubmit,\r\n expandPanel,\r\n leftActionsMaxLength = 1,\r\n } = props;\r\n const theme = useTheme();\r\n return (\r\n \r\n
\r\n \r\n {!!leftActions && leftActions?.length > 0 && (\r\n \r\n {leftActions.length > leftActionsMaxLength ? (\r\n \r\n {[...Array(leftActionsMaxLength).keys()].map(x => (\r\n {leftActions[x](onSubmit)}\r\n ))}\r\n {!isMobile && useSidePanel && !disableExpandToggle && (\r\n \r\n \r\n {sidePanelExpanded\r\n ? t(translations.ShowLess)\r\n : t(translations.MoreOptionsMobile)}\r\n \r\n \r\n )}\r\n index > leftActionsMaxLength - 1)\r\n .filter(item => item !== undefined)\r\n .map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n >\r\n \r\n ) : (\r\n \r\n {leftActions?.map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n {!isMobile && useSidePanel && !disableExpandToggle && (\r\n \r\n \r\n {sidePanelExpanded\r\n ? t(translations.ShowLess)\r\n : t(translations.MoreOptionsMobile)}\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n )}\r\n \r\n
\r\n
\r\n <>\r\n {!!rightActions &&\r\n rightActions?.length > 0 &&\r\n rightActions?.map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport styled from 'styled-components';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TopButtonsPanelProps {\r\n rightTopActions?: ActionRenderer[];\r\n leftTopActions?: ActionRenderer[];\r\n maxLeftTopButtonsLength?: number;\r\n showShortView: boolean;\r\n onSubmit?: () => void;\r\n expandPanel: () => void;\r\n leftActionsLoading?: boolean;\r\n}\r\n\r\nconst TopButtonsContainer = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n paddingInline: theme.spacing(2, 0),\r\n '.leftButtons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n width: 'auto',\r\n gap: theme.spacing(1),\r\n },\r\n}));\r\nexport function TopButtonsPanel(props: TopButtonsPanelProps) {\r\n const {\r\n leftTopActions,\r\n showShortView,\r\n onSubmit,\r\n maxLeftTopButtonsLength = 2,\r\n leftActionsLoading,\r\n } = props;\r\n const theme = useTheme();\r\n return (\r\n \r\n
\r\n \r\n {leftActionsLoading &&\r\n (!leftTopActions ||\r\n (!!leftTopActions && leftTopActions?.length === 0)) && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {!!leftTopActions && leftTopActions?.length > 0 && (\r\n \r\n {showShortView ? (\r\n \r\n {leftTopActions.length > maxLeftTopButtonsLength ? (\r\n \r\n {leftTopActions\r\n .filter((f, i) => i < maxLeftTopButtonsLength)\r\n .map((f, i) => (\r\n {f(onSubmit)}\r\n ))}\r\n {/* {leftTopActions[0](onSubmit)}\r\n {leftTopActions[1](onSubmit)} */}\r\n index >= maxLeftTopButtonsLength,\r\n )\r\n .map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n >\r\n \r\n ) : (\r\n \r\n {leftTopActions?.map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n \r\n )}\r\n \r\n ) : (\r\n \r\n {leftTopActions?.map((item, index) => (\r\n {item(onSubmit)}\r\n ))}\r\n \r\n )}\r\n \r\n )}\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport {\r\n FormLeftSection,\r\n FormRightSection,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport React from 'react';\r\nimport { TopButtonsContainer } from '../styled';\r\n\r\nexport interface FormSkeletonProps {\r\n fullPage: boolean;\r\n}\r\nconst thingsCount = 15;\r\nconst getRandomWidth = () => {\r\n return (Math.random() * 40 + 50).toFixed(0).toString() + '%';\r\n};\r\nexport const ButtonsSkeleton = () => {\r\n const theme = useTheme();\r\n return (\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\nexport const FormSkeleton = (props: FormSkeletonProps) => {\r\n return (\r\n \r\n \r\n {[...Array(thingsCount).keys()].map(i => (\r\n 0.5 ? 'h1' : 'p'}\r\n />\r\n ))}\r\n \r\n \r\n {props.fullPage &&\r\n [...Array(thingsCount).keys()].map(i => (\r\n 0.5 ? 'h1' : 'p'}\r\n />\r\n ))}\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { ActionRenderer } from './PageActions/ActionRender';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectHideNavigation,\r\n selectIsCoverExpanded,\r\n selectIsCoverOpen,\r\n} from '../../slice/selectors';\r\nimport clsx from 'clsx';\r\nimport { CoverWrapper } from '../CoverWrapper';\r\nimport { Head } from './components/Head';\r\nimport { ShortHead } from './components/ShortHead';\r\nimport { ButtonsPanel } from './components/ButtonsPanel';\r\nimport { TopButtonsPanel } from './components/TopButtonsPanel';\r\nimport { SwitchActionsProps } from './PageActions/SwitchActions';\r\nimport { ButtonsSkeleton, FormSkeleton } from './components/FormSkeleton';\r\nimport styled from 'styled-components';\r\nimport { useTheme } from '@material-ui/styles';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport {\r\n selectIsSubBarCollapsed,\r\n selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nexport type PageContentRenderer = () => React.ReactNode;\r\n\r\nexport interface PageWrapperProps extends CoverProps {\r\n children: React.ReactNode;\r\n pageName?: React.ReactNode;\r\n titlePage?: string;\r\n subTitlePage?: React.ReactNode;\r\n leftActions?: ActionRenderer[];\r\n rightActions?: ActionRenderer[];\r\n rightTopActions?: ActionRenderer[];\r\n leftTopActions?: ActionRenderer[];\r\n onSubmit?: () => void;\r\n onClose?: () => void;\r\n closeSidePanel?: () => void;\r\n closable?: boolean;\r\n useSidePanel: boolean;\r\n loading?: boolean;\r\n confirm?: JSX.Element;\r\n pageLink?: string;\r\n toPageLink?: string;\r\n cover?: React.ReactNode;\r\n disableExpandToggle?: boolean;\r\n titleTooltip?: string;\r\n switchState?: SwitchActionsProps;\r\n useSwitchActions?: boolean;\r\n topProcessing?: boolean;\r\n maxLeftTopButtonsLength?: number;\r\n rightTopActionsAsMenu?: boolean;\r\n hideTitleBar?: boolean;\r\n leftActionsMaxLength?: number;\r\n rightTopActionsLength?: number;\r\n leftActionsLoading?: boolean;\r\n rightActionsLoading?: boolean;\r\n useShortView?: boolean;\r\n hideMenu?: boolean;\r\n id?: string;\r\n}\r\n\r\nexport interface CoverProps {\r\n isCover?: boolean;\r\n closeCover?: () => void;\r\n coverClosed?: boolean;\r\n}\r\n\r\nconst PageWrapperRoot = styled('div')(({ theme }) => ({\r\n '&.page-wrapper-root': {\r\n background: bookitColors.grayscale.grayBackground,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n //minWidth: '360px',\r\n gap: 8,\r\n '.sidePanelRoot &': {\r\n background: bookitColors.base.white,\r\n },\r\n '&.covered': {\r\n filter: 'brightness(30%)',\r\n },\r\n '&.cover:not(.covered)': {\r\n // height: '95vh',\r\n height: 'calc(100dvh - 50px)',\r\n //height: '100vh',\r\n '& [class*=\"tableButtonsRootShort\"]': {\r\n maxWidth: '320px',\r\n },\r\n },\r\n '&.baseNavigationHeight': {\r\n height: '97dvh',\r\n },\r\n '&.baseRootUsePanelHeight': {\r\n height: '99.9dvh',\r\n },\r\n '&.baseRootUsePanelShortHeight': {\r\n // height: '97vh',\r\n height: 'calc(100dvh - 50px)',\r\n minWidth: 'unset',\r\n },\r\n '&.baseRootHeight': {\r\n height: '91dvh',\r\n '&.subBarExpanded': {\r\n height: '85dvh',\r\n },\r\n },\r\n '.content': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n width: '100%',\r\n padding: '8px 0 0',\r\n '&.contentRoot': {\r\n justifyContent: 'space-between',\r\n height: '100%',\r\n overflow: 'hidden',\r\n },\r\n '&.contentMobRoot': {\r\n justifyContent: 'space-between',\r\n padding: theme.spacing(1, 0, 0, 0),\r\n height: '100%',\r\n //height: '90%',\r\n //gap: theme.spacing(2),\r\n flex: '0 1 calc(100% - 50px)',\r\n overflow: 'hidden',\r\n '&.hideTitleBar': {\r\n padding: '0px',\r\n flex: '0 1 100%',\r\n },\r\n },\r\n '&.hideTitleBar': {\r\n padding: '0px',\r\n },\r\n '.contentContainer': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n padding: 0,\r\n width: '100%',\r\n height: '100%',\r\n position: 'relative',\r\n overflowY: 'auto',\r\n gap: '32px',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n // '&&': {\r\n // background: 'yelow',\r\n // },\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n '&.showShortView': {\r\n gap: '16px',\r\n marginBottom: '16px',\r\n },\r\n },\r\n //TO DO: find a way to add a box-shadow to bottom toolbar in case when content is scrollable so it match to the Figma.\r\n '.bottomToolbar': {\r\n position: 'static',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n width: '100%',\r\n background: bookitColors.base.white,\r\n borderRadius: 'unset',\r\n padding: theme.spacing(2, 3, 2, 3),\r\n boxShadow: bookitShadows.shadowBorderTop,\r\n marginBottom: 'env(safe-area-inset-bottom, 50px)',\r\n flexShrink: 0,\r\n flexGrow: 0,\r\n '&.showShortView': {\r\n gap: '8px',\r\n boxShadow: bookitShadows.shadowBorderTop,\r\n },\r\n },\r\n },\r\n },\r\n}));\r\n\r\nexport const PageWrapper = React.memo(function PageWrapper(\r\n props: PageWrapperProps,\r\n) {\r\n const {\r\n pageName,\r\n titlePage,\r\n subTitlePage,\r\n children,\r\n leftActions,\r\n rightActions,\r\n rightTopActions,\r\n leftTopActions,\r\n loading,\r\n onSubmit,\r\n onClose,\r\n closeSidePanel,\r\n closable,\r\n useSidePanel,\r\n confirm,\r\n pageLink,\r\n toPageLink,\r\n cover,\r\n closeCover,\r\n disableExpandToggle,\r\n titleTooltip,\r\n isCover,\r\n switchState,\r\n useSwitchActions: useSwithActions,\r\n topProcessing,\r\n maxLeftTopButtonsLength,\r\n rightTopActionsAsMenu,\r\n hideTitleBar,\r\n leftActionsMaxLength,\r\n rightTopActionsLength,\r\n leftActionsLoading,\r\n rightActionsLoading,\r\n useShortView,\r\n coverClosed,\r\n hideMenu,\r\n id,\r\n } = props;\r\n // const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const coverExpanded = useSelector(selectIsCoverExpanded);\r\n const hideNavigation = useSelector(selectHideNavigation);\r\n const isCoverOpen = useSelector(selectIsCoverOpen);\r\n const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n const isCovered = !!cover;\r\n const [isCoverClosed, setIsCoverClosed] = React.useState(\r\n coverClosed,\r\n );\r\n const showShortView = React.useMemo(() => {\r\n return (\r\n isMobile ||\r\n (useSidePanel && !sidePanelExpanded) ||\r\n (isCover && !coverExpanded) ||\r\n useShortView\r\n );\r\n }, [\r\n coverExpanded,\r\n isCover,\r\n isMobile,\r\n sidePanelExpanded,\r\n useShortView,\r\n useSidePanel,\r\n ]);\r\n\r\n const closePanel = () => {\r\n if (isCover) {\r\n closeCover?.();\r\n dispatch(actions.setIsCoverOpen(false));\r\n return;\r\n }\r\n if (closeSidePanel) {\r\n closeSidePanel();\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n if (onClose) {\r\n onClose();\r\n }\r\n };\r\n const expandPanel = () => {\r\n if (isCover) {\r\n dispatch(actions.setIsCoverExpanded(!coverExpanded));\r\n } else {\r\n dispatch(actions.setExpanded(!sidePanelExpanded));\r\n }\r\n };\r\n const onCoveredClick = event => {\r\n if (\r\n isCovered &&\r\n isCoverOpen &&\r\n !!event.target.id &&\r\n event.target.id.indexOf('page-wrapper-root') > -1\r\n ) {\r\n closeCover?.();\r\n dispatch(actions.setIsCoverOpen(false));\r\n }\r\n };\r\n const theme = useTheme();\r\n React.useEffect(() => {\r\n setIsCoverClosed(coverClosed);\r\n }, [coverClosed]);\r\n React.useEffect(() => {\r\n if (isCoverOpen && isCover && isCoverClosed) {\r\n closeCover?.();\r\n dispatch(actions.setIsCoverOpen(false));\r\n setIsCoverClosed(undefined);\r\n }\r\n }, [actions, closeCover, isCoverClosed, dispatch, isCover, isCoverOpen]);\r\n return (\r\n \r\n \r\n {!hideTitleBar && (\r\n \r\n {showShortView ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n {loading ? (\r\n \r\n ) : (\r\n \r\n {showShortView &&\r\n ((leftTopActions && leftTopActions.length > 0) ||\r\n leftActionsLoading) && (\r\n \r\n )}\r\n {children}\r\n \r\n )}\r\n \r\n \r\n {confirm}\r\n {leftActions && leftActions?.length > 0 && (\r\n \r\n {/* {showShortView &&\r\n !isMobile &&\r\n useSidePanel &&\r\n !disableExpandToggle &&\r\n leftActions &&\r\n leftActions?.length > 1 && (\r\n \r\n {loading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n \r\n \r\n {sidePanelExpanded\r\n ? t(translations.ShowLess)\r\n : t(translations.ShowMore)}\r\n \r\n \r\n
\r\n )}\r\n
\r\n )} */}\r\n {loading ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n
\r\n
\r\n \r\n {useSidePanel && !!cover && (\r\n \r\n {cover}\r\n \r\n )}\r\n \r\n
\r\n );\r\n});\r\n","/**\r\n * Compile time guard on Union Type switch\r\n * Usage example:\r\n * ```\r\n * type Union = 'apple' | 'banana' | 'orange';\r\n * function test(arg: Union) {\r\n * switch (arg) {\r\n * case 'apple':\r\n * ...\r\n * case 'banana':\r\n * ...\r\n * default:\r\n * // this will generate a comiple warning since 'orange' is not handled in the switch\r\n * assertExhaustive(arg);\r\n * }\r\n * }\r\n */\r\nexport function assertExhaustive(value: never, message?: string): never {\r\n throw new Error(\r\n message ?? `Reached unexpected case in exhaustive switch: ${value}`,\r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.offlineServiceState || initialState;\r\n\r\nexport const selectProcessing = createSelector(\r\n [selectSlice],\r\n state => state.processing,\r\n);\r\nexport const selectInitConsumablesProcessing = createSelector(\r\n [selectSlice],\r\n state => state.consumablesProcessing,\r\n);\r\nexport const selectService = createSelector(\r\n [selectSlice],\r\n state => state.detailsState,\r\n);\r\nexport const selectServiceProcessing = createSelector(\r\n [selectService],\r\n state => state.processing,\r\n);\r\nexport const selectServicenError = createSelector(\r\n [selectService],\r\n state => state.error,\r\n);\r\nexport const selectServiceHasError = createSelector(\r\n [selectService],\r\n state => state.hasErrors,\r\n);\r\nexport const selectServiceCompleted = createSelector(\r\n [selectService],\r\n state => state.completed,\r\n);\r\nexport const selectServiceData = createSelector(\r\n [selectService],\r\n state => state.data,\r\n);\r\nexport const selectConnectedInitState = createSelector(\r\n [selectSlice],\r\n state => state.connectedDataState,\r\n);\r\nexport const selectServiceChangeState = createSelector(\r\n [selectSlice],\r\n state => state.serviceChangeResultState,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n [selectSlice],\r\n state => state.valueHandler,\r\n);\r\nexport const selectCreditState = createSelector(\r\n [selectSlice],\r\n state => state.creditState,\r\n);\r\nexport const selectCredit = createSelector(\r\n [selectCreditState],\r\n state => state.data,\r\n);\r\nexport const selectCreditProcessing = createSelector(\r\n [selectCreditState],\r\n state => state.processing,\r\n);\r\nexport const selectCreditCompleted = createSelector(\r\n [selectCreditState],\r\n state => state.completed,\r\n);\r\nexport const selectHasCharges = createSelector(\r\n [selectSlice],\r\n state => state.hasCharges,\r\n);\r\nexport const selectConsumablesState = createSelector(\r\n [selectSlice],\r\n state => state.consumablesState,\r\n);\r\nexport const selectSavedReservationService = createSelector(\r\n [selectSlice],\r\n state => state.savedReservationService,\r\n);\r\nexport const selectConsumablesProcessing = createSelector(\r\n [selectConsumablesState],\r\n state => state.processing,\r\n);\r\nexport const selectConsumablesData = createSelector(\r\n [selectConsumablesState],\r\n state => state.data,\r\n);\r\nexport const selectConsumablesError = createSelector(\r\n [selectConsumablesState],\r\n state => state.error,\r\n);\r\nexport const selectConsumablesHasErrors = createSelector(\r\n [selectConsumablesState],\r\n state => state.hasErrors,\r\n);\r\nexport const selectConsumablesCompleted = createSelector(\r\n [selectConsumablesState],\r\n state => state.completed,\r\n);\r\nexport const selectConsumablesValueHandler = createSelector(\r\n [selectSlice],\r\n state => state.consumablesValueHandler,\r\n);\r\nexport const selectSelectedServiceType = createSelector(\r\n [selectSlice],\r\n state => state.selectedServiceTypes,\r\n);\r\nexport const selectEditCreatableService = createSelector(\r\n [selectSlice],\r\n state => state.editCreatableService,\r\n);\r\nexport const selectBarcodeScanned = createSelector(\r\n [selectSlice],\r\n state => state.barcodeScanned,\r\n);\r\nexport const selectRefreshConsumableServices = createSelector(\r\n [selectSlice],\r\n state => state.refeshOfflineServices,\r\n);\r\nexport const selectStockRenewalsState = createSelector(\r\n [selectSlice],\r\n state => state.stockRenewalState,\r\n);\r\nexport const selectStockRenewalProcessing = createSelector(\r\n [selectStockRenewalsState],\r\n state => state.processing,\r\n);\r\nexport const selectStockRenewalData = createSelector(\r\n [selectStockRenewalsState],\r\n state => state.data,\r\n);\r\nexport const selectStockRenewalError = createSelector(\r\n [selectStockRenewalsState],\r\n state => state.error,\r\n);\r\nexport const selectStockRenewalHasErrors = createSelector(\r\n [selectStockRenewalsState],\r\n state => state.hasErrors,\r\n);\r\nexport const selectStockRenewalCompleted = createSelector(\r\n [selectStockRenewalsState],\r\n state => state.completed,\r\n);\r\nexport const selectStockRenewalValueHandler = createSelector(\r\n [selectSlice],\r\n state => state.stockRenewalValueHandler,\r\n);\r\nexport const selectRenewStockState = createSelector(\r\n [selectSlice],\r\n state => state.renewStockState,\r\n);\r\nexport const selectRenewStockProcessing = createSelector(\r\n [selectRenewStockState],\r\n state => state.processing,\r\n);\r\nexport const selectRenewStockData = createSelector(\r\n [selectRenewStockState],\r\n state => state.data,\r\n);\r\nexport const selectRenewStockError = createSelector(\r\n [selectRenewStockState],\r\n state => state.error,\r\n);\r\nexport const selectRenewStockHasErrors = createSelector(\r\n [selectRenewStockState],\r\n state => state.hasErrors,\r\n);\r\nexport const selectRenewStockCompleted = createSelector(\r\n [selectRenewStockState],\r\n state => state.completed,\r\n);\r\nexport const selectRenewStockValueHandler = createSelector(\r\n [selectSlice],\r\n state => state.renewStockValueHandler,\r\n);\r\nexport const selectIsEdit = createSelector(\r\n [selectSlice],\r\n state => state.isEdit,\r\n);\r\n\r\nexport const selectInventoryBatchState = createSelector(\r\n [selectSlice],\r\n state => state.inventoryBatchState,\r\n);\r\nexport const selectInventoryBatchProcessing = createSelector(\r\n [selectInventoryBatchState],\r\n state => state.processing,\r\n);\r\nexport const selectInventoryBatchData = createSelector(\r\n [selectInventoryBatchState],\r\n state => state.data,\r\n);\r\nexport const selectInventoryBatchError = createSelector(\r\n [selectInventoryBatchState],\r\n state => state.error,\r\n);\r\nexport const selectInventoryBatchHasErrors = createSelector(\r\n [selectInventoryBatchState],\r\n state => state.hasErrors,\r\n);\r\nexport const selectInventoryBatchCompleted = createSelector(\r\n [selectInventoryBatchState],\r\n state => state.completed,\r\n);\r\nexport const selectInventoryBatchValueHandler = createSelector(\r\n [selectSlice],\r\n state => state.inventoryBatchValueHandler,\r\n);\r\nexport const selectInventoryBatchIsEdit = createSelector(\r\n [selectSlice],\r\n state => state.batchIsEdit,\r\n);\r\nexport const selectInventoryBatchEditable = createSelector(\r\n [selectSlice],\r\n state => state.inventoryBatchEditable,\r\n);\r\nexport const selectCreatableService = createSelector(\r\n [selectSlice],\r\n state => state.getCreatableService,\r\n);\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.reservation || initialState;\r\n\r\nexport const selectReservationState = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\nexport const selectProcessing = createSelector(\r\n [selectReservationState],\r\n state => state.processing,\r\n);\r\nexport const selectReservation = createSelector(\r\n [selectReservationState],\r\n state => state.detailsState,\r\n);\r\nexport const selectReservationProcessing = createSelector(\r\n [selectReservation],\r\n state => state.processing,\r\n);\r\nexport const selectReservationError = createSelector(\r\n [selectReservation],\r\n state => state.error,\r\n);\r\nexport const selectReservationHasError = createSelector(\r\n [selectReservation],\r\n state => state.hasErrors,\r\n);\r\nexport const selectReservationCompleted = createSelector(\r\n [selectReservation],\r\n state => state.completed,\r\n);\r\nexport const selectReservationData = createSelector(\r\n [selectReservation],\r\n state => state.data,\r\n);\r\nexport const selectReservationSettings = createSelector(\r\n [selectReservationState],\r\n state => state.reservationSettingsState,\r\n);\r\nexport const selectEquipmentsSettings = createSelector(\r\n [selectReservationState],\r\n state => state.equipmentsSettingsState,\r\n);\r\nexport const selectConfirmAssistedReservations = createSelector(\r\n [selectReservationState],\r\n state => state.confirmAssistedReservations,\r\n);\r\nexport const selectUserTrainingData = createSelector(\r\n [selectReservationState],\r\n state => state.trainingsData,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n [selectReservationState],\r\n state => state.valueHandler,\r\n);\r\nexport const selectRequestedValueFor = createSelector(\r\n [selectReservationState],\r\n state => state.requestedValueFor,\r\n);\r\nexport const selectRequestedValue = createSelector(\r\n [selectReservationState],\r\n state => state.requestedValue,\r\n);\r\nexport const selectEquipmentChangeState = createSelector(\r\n [selectReservationState],\r\n state => state.equipmentChangeResultState,\r\n);\r\nexport const selectEquipmentChangeCompleted = createSelector(\r\n [selectReservationState],\r\n state => state.isChangeCompleted,\r\n);\r\nexport const selectAsyncChangeLoading = createSelector(\r\n [selectReservationState],\r\n state => state.asyncChangeLoading,\r\n);\r\n\r\nexport const selectTransferState = createSelector(\r\n [selectReservationState],\r\n state => state.transferState,\r\n);\r\nexport const selectTransferProcessing = createSelector(\r\n [selectTransferState],\r\n state => state.transferProcessing,\r\n);\r\nexport const selectTransferStepCompleted = createSelector(\r\n [selectTransferState],\r\n state => state.transferStepCompleted,\r\n);\r\nexport const selectTransferToUser = createSelector(\r\n [selectTransferState],\r\n state => state.User,\r\n);\r\nexport const selectTransferReservation = createSelector(\r\n [selectTransferState],\r\n state => state.ReservtionId,\r\n);\r\nexport const selectTransferWaitingApproval = createSelector(\r\n [selectTransferState],\r\n state => state.WaitingTransferApproval,\r\n);\r\nexport const selectCalculateCreditState = createSelector(\r\n [selectSlice],\r\n state => state.caluclateCreditState,\r\n);\r\nexport const selectСalculateCredit = createSelector(\r\n [selectCalculateCreditState],\r\n state => state.data,\r\n);\r\nexport const selectCalculateCreditProcessing = createSelector(\r\n [selectCalculateCreditState],\r\n state => state.processing,\r\n);\r\nexport const selectCalculateCreditCompleted = createSelector(\r\n [selectCalculateCreditState],\r\n state => state.completed,\r\n);\r\nexport const selectShowConfirmPricing = createSelector(\r\n [selectSlice],\r\n state => state.showConfirmPricing ?? false,\r\n);\r\nexport const selectHasCharges = createSelector(\r\n [selectSlice],\r\n state => state.hasCharges,\r\n);\r\nexport const selectSavedOfflineServices = createSelector(\r\n [selectSlice],\r\n state => state.savedOfflineServices,\r\n);\r\nexport const selectRefreshOfflineServices = createSelector(\r\n [selectSlice],\r\n state => state.refeshOfflineService,\r\n);\r\nexport const selectTerminateState = createSelector(\r\n [selectSlice],\r\n state => state.terminationState,\r\n);\r\nexport const selectTerminateProcessing = createSelector(\r\n [selectTerminateState],\r\n state => state.terminatProcessing,\r\n);\r\nexport const selectTerminateCompleted = createSelector(\r\n [selectTerminateState],\r\n state => state.terminateCompleted,\r\n);\r\nexport const selectCloneReservations = createSelector(\r\n [selectSlice],\r\n state => state.cloneReservation,\r\n);\r\nexport const selectReservationDtoState = createSelector(\r\n [selectSlice],\r\n state => state.reservationDtoState,\r\n);\r\nexport const selectIsEdit = createSelector(\r\n [selectSlice],\r\n state => state.isEdit,\r\n);\r\nexport const selectSavedForLater = createSelector(\r\n [selectReservationSettings],\r\n state => state?.SaveForLater,\r\n);\r\nexport const selectSubmitCalculateCredit = createSelector(\r\n [selectSlice],\r\n state => state.submitCalculateCredit,\r\n);\r\nexport const selectByApprovalErrors = createSelector(\r\n [selectSlice],\r\n state => state.ByApprovalErrors,\r\n);\r\nexport const selectUserCanRequestApproval = createSelector(\r\n [selectSlice],\r\n state => state.userCanRequestApproval,\r\n);\r\nexport const selectRefreshWorkOrderLink = createSelector(\r\n [selectSlice],\r\n state => state.refreshWorkOrderLink,\r\n);\r\nexport const selectReservationNotFound = createSelector(\r\n [selectSlice],\r\n state => state.notFound,\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { TextFieldProps } from '../TextField';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\n\r\nexport const FormTextField = ({\r\n label,\r\n onChange,\r\n onBlur,\r\n value,\r\n name,\r\n error,\r\n helperText,\r\n ...props\r\n}: FieldHookConfig &\r\n Omit &\r\n IFieldProps) => {\r\n const [field, meta] = useField({ name, ...props });\r\n const handleChange = e => {\r\n if (onChange !== undefined) {\r\n onChange(e);\r\n }\r\n field.onChange(e);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n {props.info ? : null}\r\n {props.InputProps?.endAdornment}\r\n \r\n ),\r\n }}\r\n {...props}\r\n />\r\n );\r\n};\r\n","export enum ConfigurableTypes {\r\n ColumnScreenConfig = 1,\r\n ColumnExportConfig = 2,\r\n ColumnFinExportConfig = 3,\r\n}\r\nexport enum ExportTypes {\r\n CSV = 1,\r\n XLS = 2,\r\n XLSX = 3,\r\n}\r\nexport enum ScreensId {\r\n // \"~/UsageHistory.aspx\"\r\n UsageHistory = 1,\r\n // \"~/History.aspx\"\r\n ReservationHistory = 2,\r\n // \"~/UsagePaymentReport.aspx\"\r\n UsagePaymentReport = 3,\r\n // \"~/Budgets.aspx\"\r\n Budgets = 4,\r\n // \"~/ServiceRequests.aspx\"\r\n ServiceRequests = 5,\r\n // \"~/UserTraining.aspx\"\r\n UserTraining = 6,\r\n // \"~/Alerts/default.aspx\"\r\n Alerts = 7,\r\n // \"~/Invoices/Default.aspx\"\r\n Invoices = 8,\r\n // \"~/Invoices/Default.aspx\"\r\n InvoicesList = 9,\r\n // \"~/ProjectPlanningReport.aspx\"\r\n ProjectPlanningReport = 10,\r\n // \"~/Assets/Default.aspx\"\r\n AssetSearch = 11,\r\n // \"~/Admin/Assets/Default.aspx\"\r\n AssetsList = 12,\r\n // \"~/Invoices/Create.aspx\"\r\n EstimatedInvoices = 13,\r\n // \"~/Alerts/UserTickets.aspx\"\r\n AlertsTickets = 14,\r\n // \"~/Alerts/AssignedToMe.aspx\"\r\n AlertsAssignedTo = 15,\r\n // \"~/Alerts/MyAssets.aspx\"\r\n MyAssets = 16,\r\n // \"~/TrainingProgramsList.aspx\"\r\n UpcomingTrainingSessions = 17,\r\n // \"~/CoresDirectory.aspx\"\r\n CoresDirectory = 18,\r\n // \"~/Maps/Buildings.aspx\"\r\n Buildings = 19,\r\n // \"~/Maps/Rooms.aspx\"\r\n Rooms = 20,\r\n // \"~/Reports/Default.aspx\"\r\n AdHocReports = 21,\r\n // \"~/Documents.aspx\"\r\n Documents = 22,\r\n // \"~/Messages.aspx\"\r\n CalendarMessages = 23,\r\n // \"~/TrainingWaitingList\"\r\n TrainingWaitingList = 24,\r\n // \"~/Users\"\r\n Users = 25,\r\n //~/EmailNotifications\r\n Email = 26,\r\n //~/Experiments/experimenttemplates\r\n ExperimentTemplate = 27,\r\n //~/UsersHistory\r\n UsersHistory = 28,\r\n // ~/Assets/Details.aspx?id=\r\n ShortAssetsList = 29,\r\n //~/Quizzes\r\n Quizzes = 30,\r\n //~/Submissions\r\n Submissions = 31,\r\n //~/UserTrainingHistory\r\n UserTrainingHistory = 32,\r\n //~/OtherServices\r\n OtherServices = 33,\r\n //~/Invoices/InvoiceLetterTemplates.aspx\r\n InvoiceLetters = 34,\r\n //~/Charges\r\n Charges = 35,\r\n //~/Locations\r\n Locations = 36,\r\n //~/Locations/Building\r\n BuildingRooms = 37,\r\n //~/Campuses.aspx\r\n Campuses = 38,\r\n //~/Areas.aspx\r\n Areas = 39,\r\n //~/LocationList.aspx\r\n LocationList = 40,\r\n //~/Categories.aspx\r\n Categories = 41,\r\n //~/CategoryGroups.aspx\r\n CategoryGroups = 42,\r\n //~/SendEmailToUsers\r\n SendEmailToUsers = 43,\r\n //~/OnlineBudgetsStatus\r\n OnlineBudgetsStatus = 366659,\r\n //~/InvoiceBatches\r\n InvoiceBatches = 44,\r\n //\"~/Invoices/Details\"\r\n InvoiceCharges = 45,\r\n //~/BillingActions\r\n BillingActions = 46,\r\n //~/LocationTypes\r\n LocationTypes = 47,\r\n //~/mylists\r\n SavedViews = 48,\r\n SubLocationList = 49,\r\n SubLocationTypes = 50,\r\n Schedule = 51,\r\n PricePeriod = 52,\r\n InvoiceTemplates = 53,\r\n Articles = 54,\r\n Expenses = 55,\r\n UserAttributes = 56,\r\n SampleRunsDetails = 57,\r\n SamplesList = 58,\r\n SampleRequests = 59,\r\n OfflineServiceTypes = 60,\r\n SampelsRunsList = 61,\r\n SamplesPlates = 62,\r\n SamplesModifications = 63,\r\n PublicAssets = 64,\r\n //~/Assets/Inventory/Log\r\n BarcodeScanLog = 65,\r\n ServiceRequestAuditTrailHistory = 66,\r\n // \"~/Maps/Areas/Default.aspx\"\r\n Floors = 67,\r\n // ~/Invoices/SubscriptionTypes/Default.aspx\r\n SubscriptionTypes = 68,\r\n // \"~/Experiments/Default.aspx\"\r\n BudgetExperiments = 69,\r\n Regions = 70,\r\n SuperGroup = 71,\r\n}\r\n","import { RootStateKeyType } from '../types/injector-typings';\r\nimport {\r\n createSlice as createSliceOriginal,\r\n SliceCaseReducers,\r\n CreateSliceOptions,\r\n} from '@reduxjs/toolkit';\r\n\r\n/* Wrap createSlice with stricter Name options */\r\n\r\n/* istanbul ignore next */\r\nexport const createSlice = <\r\n State,\r\n CaseReducers extends SliceCaseReducers,\r\n Name extends RootStateKeyType\r\n>(\r\n options: CreateSliceOptions,\r\n) => {\r\n return createSliceOriginal(options);\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport * as Yup from 'yup';\r\n\r\nexport const EntityNumberSchema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.number().required(),\r\n Name: Yup.string().ensure(),\r\n});\r\nexport const EntityStringSchema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.string().required(),\r\n Name: Yup.string().ensure(),\r\n});\r\nexport const IdentifiableNumberSchema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.number().required(),\r\n});\r\nexport const IdentifiableStringSchema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.string().required(),\r\n});\r\nexport const CheckEntityShema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().defined(),\r\n Name: Yup.string().ensure(),\r\n checked: Yup.boolean().default(false),\r\n disabled: Yup.boolean().default(undefined),\r\n});\r\nconst inventoryBatchesSchema = Yup.array().of(\r\n Yup.mixed() as Yup.SchemaOf,\r\n);\r\nexport const OfflineServiceTypeShema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().defined(),\r\n Name: Yup.string().ensure(),\r\n ServiceGroupId: Yup.number().defined(),\r\n ServiceTypeId: Yup.number().defined().default(2),\r\n Active: Yup.boolean().default(true),\r\n HideProjects: Yup.boolean().default(false),\r\n IntQuantityOnly: Yup.boolean().default(false),\r\n UnitTypeID: Yup.number().nullable().default(null),\r\n UnitTypeName: Yup.string().ensure(),\r\n AllowToUser: Yup.boolean().default(false),\r\n Inventory: Yup.number().defined().default(1),\r\n DefaultQuantity: Yup.number().nullable().notRequired().default(null),\r\n ReservationOverlappingInventory: Yup.number()\r\n .nullable()\r\n .notRequired()\r\n .default(null),\r\n IsAdmin: Yup.boolean().default(false),\r\n AllowedBudgets: Yup.array().of(Yup.number().required()),\r\n StaffOnly: Yup.boolean().default(false),\r\n BudgetsTurnedOn: Yup.boolean().default(false),\r\n NotLessThanZero: Yup.boolean().default(false),\r\n TrackInventory: Yup.boolean().default(false),\r\n InventoryBatchesEnabled: Yup.boolean().default(false),\r\n InventoryBatches: inventoryBatchesSchema,\r\n },\r\n);\r\nexport const ServiceGroupEntitySchema = EntityNumberSchema;\r\nexport const BudgetEntitySechema = EntityNumberSchema;\r\nexport const BudgetExperimentEntitySechema = EntityNumberSchema;\r\nexport const InstituteProjectEntitySechema = EntityNumberSchema;\r\nexport const PaymentMethodEntitySchema = EntityNumberSchema;\r\nexport const UserEntitySchema = EntityStringSchema;\r\nexport const OnlineServiceEntitySchema = EntityNumberSchema;\r\nexport const OfflineServiceTypeEntitySchema = EntityNumberSchema;\r\nexport const FeeTypeEntitySchema = EntityNumberSchema;\r\nexport const UserGroupEntitySchema = EntityStringSchema;\r\nexport const ServiceTypeSchema = EntityNumberSchema;\r\n","import { IconProp } from 'app/AllIcons';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ActionButton } from '../ActionButton';\r\nimport { ActionIconButton } from '../ActionIconButton';\r\nimport { ButtonsVariant } from '../Button';\r\n\r\nexport interface TopActionButtonProps {\r\n onClick?: React.MouseEventHandler;\r\n disabled?: boolean;\r\n startIcon?: IconProp;\r\n endIcon?: IconProp;\r\n icon: IconProp;\r\n text: string;\r\n title?: string;\r\n variant?: ButtonsVariant;\r\n size?: 'large' | 'medium' | 'small' | 'xs';\r\n shape?: 'circle' | 'square';\r\n customIcon?: React.ReactNode;\r\n href?: string | IPathAndQuery;\r\n to?: string;\r\n noChangeOnMobile?: boolean;\r\n target?: string;\r\n id?: string;\r\n fullWidth?: boolean;\r\n isIconButton?: boolean;\r\n processing?: boolean;\r\n}\r\n\r\nexport function TopActionButton(props: TopActionButtonProps) {\r\n const {\r\n onClick,\r\n disabled,\r\n startIcon,\r\n endIcon,\r\n icon,\r\n text,\r\n title,\r\n variant,\r\n size,\r\n shape,\r\n customIcon,\r\n noChangeOnMobile,\r\n id,\r\n isIconButton,\r\n fullWidth,\r\n processing,\r\n ...other\r\n } = props;\r\n const isMobile = DetectIsMobile();\r\n const action =\r\n (isMobile || isIconButton) && !noChangeOnMobile ? (\r\n \r\n ) : (\r\n \r\n );\r\n return action;\r\n}\r\n","import { SidePanelRenderer } from 'app/Layout/FrontendLayout/components/SidePanel/SidePanelRenderer';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n PageTypeProps,\r\n RenderPageType,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport interface SidePanelOpenState {\r\n renderPageType?: RenderPageType;\r\n renderPageProps?: PageTypeProps;\r\n useSidePanel?: boolean;\r\n isCover?: boolean;\r\n expanded?: boolean;\r\n}\r\nexport interface SidePanelCloseState {\r\n useSidePanel?: boolean;\r\n isCover?: boolean;\r\n onClose?: () => void;\r\n showConfirm?: boolean;\r\n}\r\n\r\nfunction useSidePanelState(\r\n onConfirm?: () => boolean,\r\n onReject?: () => void,\r\n isCover?: boolean,\r\n useSidePanel?: boolean,\r\n onClose?: () => void,\r\n) {\r\n const dispatch = useDispatch();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const continueToOther = useSelector(selectContinueState);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const [cover, setCover] = React.useState(\r\n undefined,\r\n );\r\n const [coverClosed, setCoverClosed] = React.useState(\r\n undefined,\r\n );\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n const onCloseCover = React.useCallback(() => {\r\n return closeCover();\r\n }, []);\r\n const closePanel = React.useCallback(\r\n (state: SidePanelCloseState) => {\r\n if (state.showConfirm) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n if (state.isCover) {\r\n setCover(undefined);\r\n setCoverClosed(true);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!state.onClose) {\r\n state.onClose();\r\n }\r\n }\r\n },\r\n [dispatch, layoutActions],\r\n );\r\n const openPanel = React.useCallback(\r\n (state: SidePanelOpenState) => {\r\n state.useSidePanel || state.isCover\r\n ? setCover(\r\n ,\r\n )\r\n : dispatch(\r\n layoutActions.openSidePanel({\r\n type: state.renderPageType,\r\n props: Object.assign({}, state.renderPageProps, {\r\n useSidePanel: true,\r\n }),\r\n expanded: state.expanded,\r\n }),\r\n );\r\n },\r\n [dispatch, layoutActions],\r\n );\r\n React.useEffect(() => {\r\n if (confirmApproved) {\r\n if (!!onConfirm) {\r\n let confirmed = onConfirm();\r\n if (confirmed) {\r\n if (continueToOther.continueOnApprove) {\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n setTimeout(() => {\r\n useSidePanel || isCover\r\n ? setCover(\r\n ,\r\n )\r\n : dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 100);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n } else {\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n }\r\n } else {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n } else {\r\n if (continueToOther.continueOnApprove) {\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n setTimeout(() => {\r\n useSidePanel || isCover\r\n ? setCover(\r\n ,\r\n )\r\n : dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 100);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n } else {\r\n if (isCover) {\r\n setCover(undefined);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (!!onClose) {\r\n onClose();\r\n }\r\n }\r\n }\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n if (!!onReject) {\r\n onReject();\r\n }\r\n }\r\n\r\n return () => undefined;\r\n }, [\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther.continueOnApprove,\r\n continueToOther.expanded,\r\n continueToOther.pageProps,\r\n continueToOther.pageType,\r\n dispatch,\r\n isCover,\r\n layoutActions,\r\n onClose,\r\n onConfirm,\r\n onReject,\r\n useSidePanel,\r\n ]);\r\n\r\n return { cover, openPanel, closePanel, coverClosed, onCloseCover };\r\n}\r\nexport default useSidePanelState;\r\n","/**\r\n *\r\n * DialogConfirm\r\n *\r\n */\r\nimport { DialogProps } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ActionButton } from '../BasicButtons/ActionButton';\r\nimport { BasicDialog } from '../BasicDialog';\r\nimport { DialogActionsRenderer } from '../BasicDialog/DialogActionsRender';\r\n\r\nexport interface DialogConfirmProps\r\n extends Omit {\r\n title?: string | React.ReactNode;\r\n subtitle?: React.ReactNode;\r\n body: React.ReactNode;\r\n confirmButtonLabel?: string;\r\n cancelButtonLabel?: string;\r\n onConfirm?: React.MouseEventHandler;\r\n onCancel?: () => void;\r\n onClose?: () => void;\r\n processing?: boolean;\r\n disabled?: boolean;\r\n isOpen: boolean;\r\n maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n actions?: DialogActionsRenderer[];\r\n confirmTitle?: string;\r\n managedState?: boolean;\r\n dialogRootClassName?: string;\r\n disableBackdropClick?: boolean;\r\n}\r\n\r\nexport function DialogConfirm({\r\n title,\r\n body,\r\n confirmButtonLabel,\r\n cancelButtonLabel,\r\n onConfirm,\r\n onCancel,\r\n processing,\r\n isOpen,\r\n maxWidth,\r\n subtitle,\r\n disabled,\r\n actions,\r\n onClose,\r\n confirmTitle,\r\n managedState,\r\n dialogRootClassName,\r\n disableBackdropClick,\r\n ...props\r\n}: DialogConfirmProps) {\r\n const { t } = useTranslation();\r\n const [open, setOpen] = React.useState(isOpen);\r\n\r\n React.useEffect(() => {\r\n setOpen(isOpen);\r\n }, [isOpen]);\r\n\r\n const handleClose = () => {\r\n onCancel?.();\r\n onClose?.();\r\n if (!managedState) {\r\n setOpen(false);\r\n }\r\n };\r\n const handleConfirm = event => {\r\n if (!!onConfirm) {\r\n onConfirm(event);\r\n }\r\n };\r\n const btnActions: DialogActionsRenderer[] = [];\r\n if (actions && actions.length > 0) {\r\n actions.forEach(a => btnActions.push(a));\r\n }\r\n if (!!onConfirm) {\r\n btnActions.push(() => (\r\n \r\n ));\r\n }\r\n if (!!onCancel) {\r\n btnActions.push(() => (\r\n \r\n ));\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport interface InfoIconProps {\r\n title: NonNullable;\r\n className?: string;\r\n error?: boolean;\r\n}\r\n\r\nconst styles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n cursor: 'pointer',\r\n zIndex: 1,\r\n '&.tableInfo': {\r\n position: 'absolute',\r\n top: '15%',\r\n left: '0px',\r\n '&>svg': {\r\n width: 13,\r\n height: 13,\r\n },\r\n },\r\n },\r\n }),\r\n);\r\n// const StyledTooltip = styled(Tooltip)`\r\n// cursor: pointer;\r\n// z-index: 1;\r\n// &.tableInfo {\r\n// position: absolute;\r\n// top: 20%;\r\n// left: 0px;\r\n// }\r\n// `;\r\nexport const InfoIcon = (props: InfoIconProps) => {\r\n const { title, className, error } = props;\r\n const classes = styles();\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { TableState } from 'react-table';\r\nimport { Entity, IAsyncValue, Identifiable } from 'types/common';\r\nimport { PartialRecord } from 'types/PartialRecord';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ServiceRequestMilestoneChargeType } from '../../components/ServiceRequestMilestoneChargeDetails';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { IOpenSidePanelPayload } from 'app/Layout/FrontendLayout/slice';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport { PromiseStatus } from 'app/hooks/usePromise';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { Dictionary } from 'lodash';\r\nimport { CustomFormValueType } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { SpecialColumnTypesUnion } from 'api/odata/generated/enums/SpecialColumnTypes';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\n\r\n/* --- STATE --- */\r\nexport type ISampleListTableState = Partial<\r\n TableState & {\r\n searchColumns?: Array;\r\n customFilters: Array<\r\n Pick, 'fieldName' | 'operator' | 'value'>\r\n >;\r\n }\r\n>;\r\nexport type IFieldState = {\r\n status: PromiseStatus;\r\n};\r\n\r\nexport type ControlledTableState = Partial<\r\n TableState & {\r\n searchColumns?: Array;\r\n }\r\n>;\r\nexport type ServiceRequestRowsTableState = ControlledTableState<\r\n IServiceRequestRowDto\r\n>;\r\nexport interface RowsWithTotalCount {\r\n rows: TRow[];\r\n dataLength: number;\r\n}\r\nexport interface IControlledTableState {\r\n tableState: ControlledTableState;\r\n selectedRows: Array;\r\n data: IAsyncValue>;\r\n}\r\nexport interface IServiceRequestRowsTableState {}\r\nexport interface IRequestDetailsModel\r\n extends Omit,\r\n IServiceRequestDetailsFormModel {}\r\n/**\r\n * Represents interface to service request form data values.\r\n */\r\nexport interface IServiceRequestDetailsFormModel {\r\n Rows?: Array;\r\n FormValues?: Record;\r\n}\r\nexport interface IRequestSamplesState {\r\n RequestSamples: IAsyncValue<{ data: ISample[]; dataLength: number }>;\r\n RequestDetails: IAsyncValue;\r\n ServiceRequestStatuses: IAsyncValue>;\r\n ServiceRequestRowStatuses?: Array;\r\n SamplesTableState: ISampleListTableState;\r\n SamplesSelected: any[];\r\n ServiceRequestRows: IAsyncValue;\r\n serviceRequestId?: number;\r\n ImportState: {\r\n open: boolean;\r\n processing: boolean;\r\n };\r\n fieldsState: PartialRecord;\r\n milestoneProcessing?: boolean;\r\n milestoneChargeProcessing?: boolean;\r\n submitting?: boolean;\r\n SidePanel?: IOpenSidePanelPayload;\r\n createServiceRequestRowStatus?: PromiseStatus;\r\n}\r\n\r\nexport interface ISample extends Record {\r\n Id: number;\r\n ServiceRequestId: number;\r\n BudgetName: string | null;\r\n BudgetId: number | null;\r\n SourceRunIds: Array | null;\r\n TargetRunIds: Array | null;\r\n Status: number;\r\n StatusName: string | null;\r\n AnalyticalSampleId: string | null;\r\n BiologicalSampleId: string | null;\r\n TMT_Type: string | null;\r\n TMT_Label: string | null;\r\n TMT_Set: string | null;\r\n SubjectId: string | null;\r\n Concentration: number | null;\r\n Volume: number | null;\r\n SamplePlateId: string | null;\r\n Position: string | null;\r\n SampleType: string | null;\r\n TaxaId: string | null;\r\n}\r\n\r\nexport interface ITableState {\r\n pageIndex: number;\r\n pageSize: number;\r\n columnOrder: any;\r\n filters: any;\r\n globalFilter: any;\r\n}\r\n\r\nexport interface ISampleRun\r\n extends Record,\r\n ISampleTarget,\r\n ISample {\r\n Id: number;\r\n ServiceRequestId: number;\r\n Status: number;\r\n BudgetName: string | null;\r\n AnalyticalSampleId: string | null;\r\n RunId: number | null;\r\n\r\n TMT_Type: string | null;\r\n TMT_Label: string | null;\r\n TMT_Set: string | null;\r\n\r\n Concentration: number | null;\r\n Volume: number | null;\r\n SamplePlateId: string | null;\r\n Position: string | null;\r\n\r\n TargetConcentration: number | null;\r\n TargetVolume: number | null;\r\n TargetPlateId: string | null;\r\n TargetPosition: string | null;\r\n TargetTubeLabel: string | null;\r\n TargetSampleType: string | null;\r\n}\r\n\r\nexport interface IRunDetails {\r\n Id?: number;\r\n RunType: RunTypesUnion;\r\n Samples: ISampleTarget[];\r\n}\r\n\r\nexport interface ISampleTarget extends ISample {\r\n TargetConcentration: number | null;\r\n TargetVolume: number | null;\r\n TargetPlateId: string | null;\r\n TargetPosition: string | null;\r\n TargetTubeLabel: string | null;\r\n TargetSampleType: string | null;\r\n}\r\n\r\nexport interface ISamplesFilter {\r\n ServiceRequestId?: number;\r\n}\r\n\r\nexport type IServiceRequestUpdateStatusAction = PayloadAction<\r\n Pick & IReason\r\n>;\r\nexport type IServiceRequestUpdateBudgetAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type IServiceRequestUpdateFundingTypeAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type IServiceRequestUpdatePurchaseOrderAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type IServiceRequestUpdateExternalInternalNumberAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type IServiceRequestPatchAction = PayloadAction<\r\n Pick & Partial>\r\n>;\r\nexport type IServiceRequestUpdateGradientAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type IServiceRequestUpdateOverheadAction = PayloadAction<\r\n Pick\r\n>;\r\nexport type ILoadServiceRequestMilestonesAction = PayloadAction<\r\n Identifiable\r\n>;\r\nexport type ILoadServiceRequestMilestonesSuccessAction = PayloadAction<\r\n Array\r\n>;\r\nexport type ILoadServiceRequestRowsAction = PayloadAction<{\r\n serviceRequestId: number;\r\n state: Partial>;\r\n}>;\r\nexport type ICancelServiceRequestPayloadAction = PayloadAction<\r\n {\r\n serviceRequestId: number;\r\n } & IReason\r\n>;\r\nexport type UpdateServiceRequestRowValueAction = PayloadAction<{\r\n serviceRequestId: number;\r\n serviceRequestValue: Pick<\r\n IServiceRequestRowValueDto,\r\n 'ColumnId' | 'RowId' | 'Value' | 'DisplayValue'\r\n >;\r\n}>;\r\n\r\nexport interface IRequestMilestoneManualChargeUserModel {\r\n Id: string;\r\n Title: string;\r\n display: string;\r\n}\r\n\r\nexport interface IRequestMilestoneManualChargeModel {\r\n OfflineServiceType: IConsumableServiceDto | null;\r\n Unit: Entity | null;\r\n Id: number;\r\n Name: string | null;\r\n Quantity: number | null;\r\n Rate: number | null;\r\n Remarks: string | null;\r\n Date: Timestamp | null;\r\n UpdatedBy: IRequestMilestoneManualChargeUserModel | null;\r\n}\r\n\r\nexport type InsertServiceRequestMilestoneChargeAction = PayloadAction<\r\n Partial & {\r\n ServiceRequestId: number;\r\n ServiceRequestMilestoneId: number;\r\n }\r\n>;\r\nexport type UpdateServiceRequestMilestoneChargeAction = PayloadAction<\r\n Pick &\r\n Partial & {\r\n ServiceRequestId: number;\r\n ServiceRequestMilestoneId: number;\r\n }\r\n>;\r\nexport interface IServiceRequestMilestoneChargeForm {\r\n Id?: number;\r\n Type?: ServiceRequestMilestoneChargeType;\r\n Name?: string;\r\n Service?: IConsumableServiceDto;\r\n Rate?: number;\r\n Date?: Date | null;\r\n Unit?: Entity;\r\n Quantity?: number;\r\n Remarks?: string;\r\n}\r\nexport interface IServiceRequestMilestoneForm {\r\n Id?: number;\r\n Name?: string;\r\n Assignees?: IUserBaseDto[];\r\n CompletionDate?: Date | null;\r\n TargetDate?: Date | null;\r\n Description?: string;\r\n Status?: ServiceRequestMilestoneStatusesUnion;\r\n}\r\n/** WebApi interface */\r\nexport interface ServiceRequestMilestoneInsertModel {\r\n Id?: number;\r\n ServiceRequestId: number;\r\n\r\n Name: string | null;\r\n Assignees: string | null;\r\n CompletionDate: Timestamp | null;\r\n TargetDate: Timestamp | null;\r\n Description: string | null;\r\n StatusId: number | null;\r\n}\r\n/** WebApi interface */\r\nexport type RequestMilestoneModel = Pick<\r\n ServiceRequestMilestoneInsertModel,\r\n 'CompletionDate' | 'StatusId'\r\n>;\r\nexport interface IReason {\r\n Reason?: string;\r\n}\r\n\r\n/**\r\n * UI column obj\r\n */\r\nexport interface IServiceRequestTableColumnModel\r\n extends Pick<\r\n IFormFieldDto,\r\n | 'Id'\r\n | 'Label'\r\n //| 'ColumnType'\r\n | 'Index'\r\n // | 'Options'\r\n // | 'OptionsSourceType'\r\n | 'Required'\r\n | 'ParentId'\r\n | 'SizeLimit'\r\n // | 'Active'\r\n | 'Description'\r\n | 'DisplayType'\r\n | 'IsMultiple'\r\n | 'CopyPrevValues'\r\n | 'CustomRoles'\r\n | 'UserSelectionType'\r\n | 'FixedRoles'\r\n > {\r\n IsColumn: true;\r\n Options?: IFormFieldOptionDto[];\r\n ColumnType: CustomFormColumnTypes;\r\n isRequired: boolean;\r\n}\r\n/**\r\n * UI interface of the service request row value\r\n * CustomFormValueType narrowed to include types supported on the custom form table\r\n */\r\nexport type IServiceRequestTableRowValueModel = Extract<\r\n CustomFormValueType,\r\n string | Date | number | boolean | Entity\r\n>;\r\n\r\n/**\r\n * UI interface of the service request table model\r\n */\r\nexport interface IServiceRequestTableRowModel\r\n extends Omit {\r\n Values: Dictionary;\r\n}\r\n\r\n// case 'Disclaimer':\r\n// case 'Dictionary':\r\n// case 'Index1':\r\n// case 'Index2':\r\n// case 'Label':\r\n// case 'Lane':\r\n// case 'Plate':\r\n// case 'PlateCell':\r\n// case 'RunLane':\r\n// case 'SequencingModes':\r\n// case 'Name':\r\n// case 'SourceAndLabel':\r\n// case 'Source':\r\n// case 'UserSelection':\r\n\r\ntype Extends = U;\r\n\r\n/**\r\n * List of the column types (SpecialColumnTypes) currently supported on the custom form table\r\n */\r\nexport type CustomFormColumnTypes = Extends<\r\n SpecialColumnTypesUnion,\r\n | 'CheckBox'\r\n | 'Date'\r\n | 'DropDownList'\r\n | 'ShortText'\r\n | 'Serial'\r\n | 'Email'\r\n | 'PositiveInteger'\r\n | 'Number'\r\n | 'PositiveDecimal'\r\n | 'UserSelection'\r\n>;\r\nexport const ColumnTypesArray: Array = [\r\n 'CheckBox',\r\n 'Date',\r\n 'DropDownList',\r\n 'ShortText',\r\n 'Serial',\r\n 'Email',\r\n 'PositiveInteger',\r\n 'Number',\r\n 'PositiveDecimal',\r\n 'UserSelection',\r\n];\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { DisplayTypes } from 'api/odata/generated/enums/DisplayTypes';\r\nimport { UserSelectionTypeUnion } from 'api/odata/generated/enums/UserSelectionType';\r\nimport { createOptions } from 'app/components/CustomForm/CustomFormFields/CustomFormDropDown';\r\nimport { Dictionary, keyBy, orderBy } from 'lodash';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n ColumnTypesArray,\r\n CustomFormColumnTypes,\r\n IServiceRequestTableColumnModel,\r\n} from '../types';\r\n\r\nexport class ServiceRequestTableColumn\r\n implements IServiceRequestTableColumnModel {\r\n AssignParent(result: Dictionary): void {\r\n const parentFieldName = this.getParentFieldName();\r\n if (parentFieldName !== null) {\r\n const parent = result[parentFieldName];\r\n if (parent !== undefined) {\r\n this.Parent = parent;\r\n (parent.Children = parent.Children ?? []).push(this);\r\n }\r\n }\r\n }\r\n\r\n IsColumn: true = true;\r\n Options?: IFormFieldOptionDto[] | undefined;\r\n ColumnType: CustomFormColumnTypes;\r\n isRequired: boolean;\r\n Id: number;\r\n Label: string;\r\n Index: number;\r\n Required: 'Optional' | 'User' | 'Admin' | 'Conditional';\r\n ParentId: number | null;\r\n SizeLimit: number;\r\n Description: string | null;\r\n DisplayType: DisplayTypes;\r\n IsMultiple: boolean;\r\n CopyPrevValues: boolean;\r\n CustomRoles: string | null;\r\n UserSelectionType: UserSelectionTypeUnion | null;\r\n FixedRoles: string | null;\r\n\r\n Parent: ServiceRequestTableColumn | null = null;\r\n Children: Array | null = null;\r\n\r\n constructor(columnDto: IFormFieldDto, isAdmin?: boolean) {\r\n this.Id = columnDto.Id;\r\n // see null check above in filter\r\n this.ColumnType = (columnDto.ColumnType as CustomFormColumnTypes)!;\r\n this.Description = columnDto.Description;\r\n this.DisplayType = columnDto.DisplayType;\r\n this.Index = columnDto.Index;\r\n this.IsColumn = true;\r\n this.IsMultiple = columnDto.IsMultiple;\r\n this.Label = columnDto.Label;\r\n this.ParentId = columnDto.ParentId;\r\n this.Required = columnDto.Required;\r\n this.SizeLimit = columnDto.SizeLimit;\r\n this.Options =\r\n columnDto.ColumnType === 'DropDownList'\r\n ? createOptions(columnDto)\r\n : undefined;\r\n this.isRequired = this.isColumnRequired({\r\n Required: columnDto.Required,\r\n isAdmin: isAdmin ?? false,\r\n });\r\n this.CopyPrevValues = columnDto.CopyPrevValues;\r\n this.CustomRoles = columnDto.CustomRoles;\r\n this.UserSelectionType = columnDto.UserSelectionType;\r\n this.FixedRoles = columnDto.FixedRoles;\r\n }\r\n\r\n static getFieldName(columnId: number) {\r\n return `column_${String(columnId)}`;\r\n }\r\n getFieldName() {\r\n return ServiceRequestTableColumn.getFieldName(this.Id);\r\n }\r\n getParentFieldName() {\r\n if (this.ParentId === null) {\r\n return null;\r\n }\r\n return ServiceRequestTableColumn.getFieldName(this.ParentId);\r\n }\r\n\r\n private isColumnRequired = (\r\n props: Pick & { isAdmin: boolean },\r\n ) => {\r\n switch (props.Required) {\r\n case 'Optional': //optional\r\n return false;\r\n case 'User': //required for user (all users)\r\n return true;\r\n case 'Admin': //required for admin\r\n return props.isAdmin;\r\n case 'Conditional':\r\n // not supported on columns/table\r\n return false;\r\n default:\r\n assertExhaustive(props.Required);\r\n }\r\n };\r\n}\r\n\r\nexport class ServiceRequestTableColumnsCollection {\r\n columnsObj: Dictionary;\r\n constructor(columnsData, isAdmin: boolean, VisibleToAdminOnly?: boolean) {\r\n if (VisibleToAdminOnly === true && isAdmin !== true) {\r\n this.columnsObj = {};\r\n return;\r\n }\r\n const columns =\r\n columnsData\r\n ?.filter(f => f.Active === true)\r\n ?.filter(\r\n column =>\r\n column.IsColumn === true &&\r\n column.ColumnType !== null &&\r\n (ColumnTypesArray as string[]).includes(column.ColumnType),\r\n )\r\n ?.map(columnDto => new ServiceRequestTableColumn(columnDto, isAdmin)) ??\r\n [];\r\n const result = keyBy(\r\n orderBy(columns, f => f.Index),\r\n column => column.getFieldName(),\r\n );\r\n columns.forEach(column => column.AssignParent(result));\r\n this.columnsObj = result;\r\n }\r\n\r\n getArray() {\r\n return Object.values(this.columnsObj);\r\n }\r\n get(columnId: number) {\r\n return this.columnsObj[ServiceRequestTableColumn.getFieldName(columnId)];\r\n }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { SpecialColumnTypesUnion } from 'api/odata/generated/enums/SpecialColumnTypes';\r\nimport { tryParseBool, tryParseFloat, tryParseInt } from 'utils/string-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n isEmptyOrWhitespace,\r\n toUndefinedIfEmptyOrWhitespace,\r\n} from 'utils/typeUtils';\r\nimport { ServiceRequestTableColumnsCollection } from './utils/ServiceRequestTableColumn';\r\nimport { IServiceRequestDetailsFormModel } from './types';\r\n\r\nconst selectSlice = (state: RootState) => state.requestSamples || initialState;\r\n\r\nexport const selectRequestSamples = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\nexport const selectServiceRequestStatuses = createSelector(\r\n [selectSlice],\r\n state => state.ServiceRequestStatuses,\r\n);\r\nexport const selectServiceRequestRowStatues = createSelector(\r\n [selectSlice],\r\n state => state.ServiceRequestRowStatuses,\r\n);\r\nexport const selectSubmitting = createSelector(\r\n [selectSlice],\r\n state => state.submitting,\r\n);\r\n\r\nexport const selectServiceRequestStatusesByInternalId = createSelector(\r\n [\r\n selectServiceRequestStatuses,\r\n (\r\n state,\r\n serviceRequestInternalStatus: InternalServiceRequestStatusesUnion,\r\n ) => serviceRequestInternalStatus,\r\n ],\r\n (state, serviceRequestInternalStatus: InternalServiceRequestStatusesUnion) =>\r\n state.value?.filter(\r\n status => status.InternalStatusId === serviceRequestInternalStatus,\r\n ),\r\n);\r\nexport const selectServiceRequestId = createSelector(\r\n [selectRequestSamples],\r\n state => state.serviceRequestId,\r\n);\r\nexport const selectRequestDetails = createSelector(\r\n [selectRequestSamples],\r\n state => state.RequestDetails,\r\n);\r\nexport const selectCommentIsInternal = createSelector(\r\n [selectRequestDetails],\r\n state => state.value?.CommentIsInternal,\r\n);\r\nexport const selectRequestDetailsData = createSelector(\r\n [selectRequestSamples],\r\n state => state.RequestDetails?.value,\r\n);\r\nexport const selectServiceRequestCustomForm = createSelector(\r\n [selectRequestDetailsData],\r\n state => state?.FormValues,\r\n);\r\nexport const selectServiceRequestCustomTable = createSelector(\r\n [selectRequestDetailsData],\r\n state => state?.Rows,\r\n);\r\nexport const selectServiceRequestFormData = createSelector(\r\n [selectServiceRequestCustomForm, selectServiceRequestCustomTable],\r\n (formValues, rows) => {\r\n const result: IServiceRequestDetailsFormModel = {\r\n FormValues: formValues,\r\n Rows: rows,\r\n };\r\n return result;\r\n },\r\n);\r\nexport const selectRequestDetailsFieldsState = createSelector(\r\n [selectRequestSamples],\r\n state => state.fieldsState,\r\n);\r\nexport const selectServiceRequestDetailsFieldState = createSelector(\r\n [\r\n selectRequestDetailsFieldsState,\r\n (state, fieldName: keyof IServiceRequestDto) => fieldName,\r\n ],\r\n (state, fieldName) => state[fieldName],\r\n);\r\nconst selectService = createSelector([selectRequestDetailsData], state => {\r\n return state?.Service;\r\n});\r\nconst selectStatus = createSelector([selectRequestDetailsData], state => {\r\n return state?.Status;\r\n});\r\nconst selectCreatedFor = createSelector([selectRequestDetailsData], state => {\r\n return state?.CreatedFor;\r\n});\r\nexport const selectIsServiceRequestAdmin = createSelector(\r\n [selectService, selectCreatedFor, selectStatus, selectAuthenticatedUser],\r\n (Service, CreatedFor, Status, authenticatedUser) => {\r\n let isAdmin = false;\r\n let isOwner = false;\r\n let isEditable = false;\r\n if (Service === undefined) {\r\n return { isAdmin, isOwner, isEditable };\r\n }\r\n if (authenticatedUser === undefined) {\r\n return { isAdmin, isOwner, isEditable };\r\n }\r\n if (authenticatedUser.Roles.includes(Roles.Administrators)) {\r\n return { isAdmin: true, isOwner: false, isEditable: true };\r\n }\r\n\r\n isAdmin = authenticatedUser.IsAdminOf({\r\n ServiceGroupId: Service.ServiceGroup.Id,\r\n ServiceId: Service.Id,\r\n ServiceTypeId: ServiceType.Sample,\r\n });\r\n\r\n isOwner = CreatedFor?.Id === authenticatedUser?.Id;\r\n const userEditableStatuses: Array = [\r\n 'Draft',\r\n 'ReturnedToUser',\r\n 'QuoteSendToUser',\r\n ];\r\n const internalStatusId = Status?.InternalStatusId;\r\n // todo: check equipment administrator permissions\r\n isEditable =\r\n isAdmin ||\r\n (isOwner &&\r\n internalStatusId !== undefined &&\r\n userEditableStatuses.includes(internalStatusId));\r\n return { isAdmin, isOwner, isEditable };\r\n },\r\n);\r\nexport const selectSamplesTableState = createSelector(\r\n [selectSlice],\r\n state => state.SamplesTableState,\r\n);\r\nexport const selectSamplesData = createSelector(\r\n [selectRequestSamples],\r\n state => state.RequestSamples,\r\n);\r\nexport const selectImportState = createSelector(\r\n [selectRequestSamples],\r\n state => state.ImportState,\r\n);\r\nexport const selectSelectedSamples = createSelector(\r\n [selectRequestSamples],\r\n state => state.SamplesSelected,\r\n);\r\nconst selectCustomForm = createSelector(\r\n [selectService],\r\n state => state?.CustomForm,\r\n);\r\nconst selectCustomFormFields = createSelector(\r\n [selectRequestDetailsData],\r\n state => state?.Service.CustomForm.FormFields,\r\n);\r\nexport const selectServiceRequestCustomFormColumns = createSelector(\r\n [selectCustomForm, selectCustomFormFields, selectIsServiceRequestAdmin],\r\n (customForm, state, isAdmin) => {\r\n return new ServiceRequestTableColumnsCollection(\r\n state,\r\n isAdmin.isAdmin,\r\n customForm?.VisibleToAdminOnly,\r\n );\r\n },\r\n);\r\n\r\nexport const selectServiceRequestCustomFormFields = createSelector(\r\n [selectRequestDetails],\r\n state =>\r\n state.value?.Service?.CustomForm?.FormFields?.filter(\r\n f => f.Active === true,\r\n )?.filter(column => column.IsColumn === false) ?? [],\r\n);\r\n\r\nexport const selectServiceRequestMilestones = createSelector(\r\n [selectRequestDetails],\r\n state => state.value?.Milestones,\r\n);\r\nexport const selectServiceRequestMilestoneProcessing = createSelector(\r\n [selectSlice],\r\n state => state.milestoneProcessing,\r\n);\r\n\r\nexport const selectServiceRequestSidePanel = createSelector(\r\n [selectSlice],\r\n state => state.SidePanel,\r\n);\r\n\r\nexport const selectServiceRequestRows = createSelector(\r\n [selectSlice],\r\n state => state.ServiceRequestRows,\r\n);\r\n\r\nexport function fromDtoValue(\r\n type: SpecialColumnTypesUnion,\r\n formValueDto:\r\n | Pick\r\n | null\r\n | undefined,\r\n) {\r\n if (formValueDto === null) {\r\n return null;\r\n }\r\n if (formValueDto === undefined) {\r\n return undefined;\r\n }\r\n switch (type) {\r\n case 'CheckBox':\r\n return tryParseBool(formValueDto.Value);\r\n case 'Date':\r\n return dateUtils.tryFormatIso(dateUtils.tryParse(formValueDto.Value));\r\n case 'Disclaimer':\r\n case 'Dictionary':\r\n case 'Index1':\r\n case 'Index2':\r\n case 'Label':\r\n case 'Lane':\r\n case 'Plate':\r\n case 'PlateCell':\r\n case 'RunLane':\r\n case 'SequencingModes':\r\n case 'Name':\r\n case 'SourceAndLabel':\r\n case 'Source':\r\n return undefined;\r\n case 'UserSelection':\r\n case 'DropDownList':\r\n if (isEmptyOrWhitespace(formValueDto.Value)) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: formValueDto.Value,\r\n Name:\r\n toUndefinedIfEmptyOrWhitespace(formValueDto.DisplayValue) ??\r\n formValueDto.Value,\r\n };\r\n }\r\n case 'ShortText':\r\n case 'Serial':\r\n case 'Email':\r\n return formValueDto.Value;\r\n case 'PositiveInteger':\r\n return tryParseInt(formValueDto.Value);\r\n case 'Number':\r\n case 'PositiveDecimal':\r\n return tryParseFloat(formValueDto.Value);\r\n\r\n default:\r\n assertExhaustive(type);\r\n }\r\n}\r\n\r\nexport const selectServiceRequestRowsForm = createSelector(\r\n [selectSlice],\r\n state => state.ServiceRequestRows?.value,\r\n);\r\n\r\nexport const selectServiceRequestRowInsertStatus = createSelector(\r\n [selectSlice],\r\n state => state.createServiceRequestRowStatus,\r\n);\r\n","import { useTranslation } from 'react-i18next';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { WorkWeekDays } from './WorkWeekDays';\r\n\r\nexport enum RepetitiveOptions {\r\n DoNotRepeat,\r\n RepeatDaily,\r\n RepeatWeeklyOn,\r\n RepeatMonthlyOn,\r\n RepeatEveryWeekDay,\r\n RepeatCustom,\r\n}\r\nexport enum RepeatPeriod {\r\n Days = 1,\r\n Weeks = 2,\r\n Months = 3,\r\n}\r\nexport enum RepeatMonthlyBy {\r\n RepeatsBy_DayOfMonth = 1,\r\n RepeatsBy_DayOfWeek = 2,\r\n}\r\nexport function GetRepetitiveOptions(\r\n startDate: Date | null,\r\n firstDayOfWeek: number,\r\n) {\r\n let items = enumToEntityArray(RepetitiveOptions);\r\n let date = dateUtils.dateOrStringToDate(startDate ?? new Date());\r\n let dayName = dateUtils.getDayText(date);\r\n\r\n const { t } = useTranslation();\r\n let weekName = enumToEntityArray(WorkWeekDays, t).filter(\r\n f =>\r\n dateUtils.getWeekNumberOfMonth(date, firstDayOfWeek as WeekStartsOn) ===\r\n f.Id,\r\n )[0].Name;\r\n\r\n let weekDays = `${dateUtils.getLongDaysArray()[firstDayOfWeek]} - ${\r\n dateUtils.getLongDaysArray()[dateUtils.getLongDaysArray().length - 2]\r\n }`;\r\n\r\n items.forEach(item => {\r\n if (item.Id === RepetitiveOptions.RepeatWeeklyOn) {\r\n item.Name = item.Name.replace('{0}', dayName);\r\n }\r\n if (item.Id === RepetitiveOptions.RepeatMonthlyOn) {\r\n item.Name = item.Name.replace('{0}', weekName).replace('{1}', dayName);\r\n }\r\n if (item.Id === RepetitiveOptions.RepeatEveryWeekDay) {\r\n item.Name = item.Name.replace('{0}', weekDays);\r\n }\r\n });\r\n return items;\r\n}\r\n","export enum AllowedSettings {\r\n 'DefaultQuickAssetSearchAction',\r\n 'UserFormatResult',\r\n 'InstrumentOptionsInCalender',\r\n 'CalendarPublicIntegrationFeed',\r\n 'AllowUsersToOpt_Out',\r\n 'InternalUserIdFieldLength',\r\n 'InternalUserId2FieldLength',\r\n 'ServiceGroupAdminsCanManageUsers',\r\n 'EnableServiceGroupAffilationManagment',\r\n 'FavIconImg',\r\n 'FavIconTitle',\r\n 'TopMenuBorder',\r\n 'TopCustomerLogo',\r\n 'TopCustomerLogoLink',\r\n 'DeleteEmailNotficationsMonth',\r\n\r\n 'AssetCatEnabled',\r\n 'TrainingActivationAllowedBySGAOnly',\r\n 'TrainingCreatedAsNotActiveByDefault',\r\n 'HideInstrumentRestrictions',\r\n 'EnableReservationSidePanel',\r\n 'PriceSheetBy',\r\n 'SGACreateProjects',\r\n 'UGFCreateProjects',\r\n 'HideRoomFloorTextBoxes',\r\n 'EnableInvoicePartialEvents',\r\n 'ISOCurrencySymbol',\r\n 'AccumulateNewChargesToExistingInvoice',\r\n 'CreateInovicesBy',\r\n 'CreateInvoiceSyncLimit',\r\n 'AllowMultiServiceGroupInvoices',\r\n 'ReservationUserGroupGroupByBudgetUserGroup',\r\n 'AllowedFeeTypes',\r\n 'InvoiceFromBatchScreenOnly',\r\n 'AllowExternalFundingInvoiceFinExport',\r\n 'AllowExternalFundingInvoicePdfExport',\r\n 'EnableFinAccountManagment',\r\n 'AllowUsersToViewCharges',\r\n 'GlobalInvoiceVAT',\r\n 'NamePrefixMandatory',\r\n 'AssetCatGroupEnabled',\r\n 'FinSystemInvoicesEnviroment',\r\n 'HideDymoPrinterMenu',\r\n 'WarnDefaultBudgetEnabled',\r\n 'DymoPrinterSupported',\r\n 'ZebraPrinterSupported',\r\n 'ShowDefaultBudgetOnUserProfile',\r\n 'BudgetLimited_ByUsers',\r\n 'AllowPartialMultipleProjectCharges',\r\n 'AllowPartialSingleProjectCharges',\r\n 'HideTrainingSessionsSettings',\r\n 'HideAssistedReservationsSettings',\r\n 'HideCalcPriceOnOfflineService',\r\n 'CrossInstrumentTraining',\r\n 'HideReferenceFieldInReservationDetails',\r\n 'MultipleInstrumentReservations',\r\n 'InstrumentAvailabilityDropDown',\r\n 'MinBarcodeLength',\r\n 'ShowDashboardAnnouncement',\r\n 'DashboardAnnouncement',\r\n 'RoomUserRoleEnabled',\r\n 'GlobalPriceSheetPeriods',\r\n 'AdvancedAssetSearchFilterAttributes',\r\n 'AdvancedAssetPublicSearchFilterAttributes',\r\n 'WarrantyEndDateVisibleAllUsers',\r\n 'OnlyAdminCanImportAssets',\r\n 'Help_Dashboard',\r\n 'AllowWorkflowBooking',\r\n 'ProjectsAreOptional',\r\n 'MultipleTentativeReservationsUnderWorkflowBooking',\r\n 'CalendarTimelineEmptySlotClickSettings',\r\n 'NoDashboardRedirectOnCoreSelection',\r\n 'HideTopServiceGroupFilter',\r\n 'TerminateReservation',\r\n 'CalendarServicesPickerCapacity',\r\n 'MaximumTimelineRowsLimit',\r\n 'IntervalRefreshingCalendar',\r\n 'ShouldAllowCustomDashboards',\r\n 'EnableLegacyScheduler',\r\n 'EnableTwoDaysTimelineButton',\r\n 'AutomaticAssetNamings',\r\n 'EnableCustomDaysTimelineButton',\r\n 'DefaultCustomDaysTimelineValue',\r\n 'SkipCoreSelectionScreen',\r\n 'SchedulerReservationBodyTemplate',\r\n 'SchedulerReservationTooltipTemplate',\r\n 'IncludeCustomFormInSchedulerReservationTooltip',\r\n 'AllowToRemoveFromMultipleReservation',\r\n 'DraftReservationsEnabled',\r\n 'UserReservationsRestricted',\r\n 'UsageKioskRoleEnabled',\r\n 'RequestMilestones',\r\n 'MandatoryOfflineServicesOnTrainingSignUps',\r\n 'NewUsersSignupForm',\r\n 'PurchaseOrderLengthSetting',\r\n 'HideLinkToRegistrationForm',\r\n 'SessionTimeout_Persistent',\r\n 'Help_Login',\r\n 'HideReservationCollaborators',\r\n 'LoginScreenCompanyLogo',\r\n 'LoginScreenCompanyLogoLink',\r\n 'LoginScreenCompanyLogoHeight',\r\n 'ShowForgotPassword',\r\n 'BrowseByUnit',\r\n 'MaxRecordsAllowedAssetImport',\r\n 'DoNotAllowReservationUserChangeByStaff',\r\n 'AssetImageSizeType',\r\n 'AllowToSwitchToOtherSites',\r\n 'ExternalSwitchTitle1',\r\n 'ExternalSwitchUrl1',\r\n 'ExternalSwitchTitle2',\r\n 'ExternalSwitchUrl2',\r\n 'ExternalSitesIcon',\r\n 'RequireSupplierExternalId',\r\n 'MaximumImagesPerOneUpload',\r\n 'MaxLoadedAssetImageMbSize',\r\n 'ModifyReservationNameForUsers',\r\n 'HideCommentSharingForAllUsers',\r\n 'AllowLargeFilesUpload',\r\n 'AssetInventoryDaysWithoutVerification',\r\n 'QRCodeBaseLength', // Asset Related\r\n 'SideBarQuickActions',\r\n 'LimitServiceGroupLicenses',\r\n 'Help_ReservationHistory',\r\n 'Help_UsageHistory',\r\n 'Help_OtherServices',\r\n 'Help_Training',\r\n 'Help_Incidents',\r\n 'Help_ServiceGroupRegistration',\r\n 'SSOuserFirstLogin',\r\n 'SSOuserFirstLoginWithOrWithoutUG',\r\n 'ServiceRequestReservations',\r\n /**\r\n * Returns True if the bool setting is turned on explicitly, otherwise returns false.\r\n * @param key\r\n * @returns boolean\r\n */\r\n 'ConfirmPricing',\r\n}\r\n","import * as React from 'react';\r\nimport { EntityType } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from '../AutocompletePicker';\r\nimport { createFilterOptions } from '@material-ui/lab';\r\n\r\nexport interface BaseOptionsPickerProps\r\n extends Omit, 'loadData'> {\r\n getOptions: (searchTerm: string | null) => T[];\r\n}\r\n\r\nexport function BaseOptionsPicker(\r\n props: BaseOptionsPickerProps,\r\n) {\r\n const { getOptions, ...other } = props;\r\n const loadData = async (searchTerm: string | null): Promise =>\r\n new Promise(resolve => {\r\n const opts = getOptions(searchTerm);\r\n resolve(opts);\r\n });\r\n return (\r\n option.Name,\r\n trim: true,\r\n })\r\n }\r\n {...other}\r\n />\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { FormValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { FieldHookConfig, useFormikContext } from 'formik';\r\nimport { useDispatch } from 'react-redux';\r\nimport { FormFieldsSection, FormRow } from '../FormsLayout';\r\nimport {\r\n FormListenerProps,\r\n IFieldProps,\r\n IFormFieldSetting,\r\n} from './IFormFieldSetting';\r\nexport type IFieldRender = (item: JSX.Element) => React.ReactNode;\r\nexport type IFieldSectionRender = () => React.ReactNode;\r\nexport interface FieldsRendererProps {\r\n fields: FormFieldProps[];\r\n row?: T;\r\n}\r\nexport interface FormFieldProps extends IFormFieldSetting {\r\n component: React.FC & IFieldProps & any>;\r\n order: number;\r\n}\r\nexport interface IFieldRendererProps {\r\n fieldRow: React.FC>;\r\n row?: T;\r\n}\r\nexport interface IFieldSection {\r\n title?: string;\r\n fields: (FormFieldProps | JSX.Element)[];\r\n order: number;\r\n avoidRenderSection?: boolean;\r\n item: T;\r\n}\r\n\r\nexport function FormikField(props: FormFieldProps) {\r\n //const { component } = props;\r\n // const Field = React.memo(function Field(props: FormFieldProps) => {\r\n // return React.createElement(component, props);\r\n // });\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\nexport function FormikSection(props: IFieldSection) {\r\n const { title, fields, order, avoidRenderSection } = props;\r\n\r\n return fields.length > 0 ? (\r\n \r\n {avoidRenderSection ? (\r\n \r\n {fields.map((field, index) => (\r\n \r\n {'component' in field ? (\r\n \r\n ) : (\r\n field\r\n )}\r\n \r\n ))}\r\n \r\n ) : (\r\n \r\n {fields.map((field, index) => (\r\n \r\n {'component' in field ? (\r\n \r\n ) : (\r\n field\r\n )}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n ) : (\r\n <>\r\n );\r\n}\r\nexport function FormListener({\r\n onFormChange,\r\n fields,\r\n}: FormListenerProps) {\r\n const {\r\n values,\r\n setFieldValue,\r\n isValid,\r\n dirty,\r\n setFieldTouched,\r\n validateField,\r\n setFieldError,\r\n validate,\r\n } = useFormikContext();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n React.useEffect(() => {\r\n onFormChange(\r\n values,\r\n isValid,\r\n dirty,\r\n setFieldValue,\r\n setFieldTouched,\r\n validateField,\r\n setFieldError,\r\n validate,\r\n );\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n ...fields.map(field => values[field]),\r\n isValid,\r\n dirty,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n dispatch(actions.setNotSavedChanges(dirty));\r\n }, [actions, dirty, dispatch]);\r\n\r\n return null;\r\n}\r\nexport interface FieldChangeHandlerProps {\r\n key?: keyof T;\r\n value: any;\r\n shouldValidate?: boolean;\r\n}\r\nexport interface FieldHandlerProps {\r\n run?: boolean;\r\n fieldKey?: keyof T;\r\n fieldValue?: any;\r\n shouldValidate?: boolean;\r\n resetFieldState?: () => void;\r\n additionalFunc?: (value: any) => void;\r\n}\r\nexport function useFieldChangeHandler() {\r\n const { setFieldValue } = useFormikContext();\r\n const changeField = React.useCallback(\r\n (key, value, shouldValidate) => {\r\n if (key !== undefined) {\r\n setFieldValue(key.toString(), value, shouldValidate);\r\n }\r\n },\r\n [setFieldValue],\r\n );\r\n return [changeField];\r\n}\r\nexport function SubmittingHandler({\r\n value,\r\n resetSubmitting,\r\n}: {\r\n value: boolean;\r\n resetSubmitting: () => void;\r\n}) {\r\n const { setSubmitting } = useFormikContext();\r\n React.useEffect(() => {\r\n if (value) {\r\n setSubmitting(!value);\r\n resetSubmitting();\r\n }\r\n\r\n return () => {};\r\n }, [resetSubmitting, setSubmitting, value]);\r\n return null;\r\n}\r\ntype useFooProps = {\r\n value: T;\r\n sync: (value: T) => void;\r\n};\r\n\r\nexport function useFoo({ value, sync }: useFooProps) {\r\n React.useEffect(() => {\r\n sync(value);\r\n }, [value, sync]);\r\n}\r\nexport function FooListender(props: useFooProps) {\r\n useFoo(props);\r\n return null;\r\n}\r\nexport function FieldHandler({\r\n run,\r\n fieldKey,\r\n fieldValue,\r\n shouldValidate,\r\n resetFieldState,\r\n additionalFunc,\r\n}: FieldHandlerProps) {\r\n const [changeField] = useFieldChangeHandler();\r\n //const [doChange, setDoChange] = React.useState(run);\r\n React.useEffect(() => {\r\n if (run && fieldKey !== undefined) {\r\n changeField(fieldKey, fieldValue, shouldValidate);\r\n if (!!additionalFunc) additionalFunc({ [fieldKey]: fieldValue });\r\n if (!!resetFieldState) resetFieldState();\r\n //setDoChange(undefined);\r\n }\r\n return () => {};\r\n }, [\r\n changeField,\r\n run,\r\n fieldKey,\r\n shouldValidate,\r\n fieldValue,\r\n resetFieldState,\r\n additionalFunc,\r\n ]);\r\n return null;\r\n}\r\nexport interface SetValueProps {\r\n setValue?: (value: any) => void;\r\n resetValueKey?: () => void;\r\n fieldKey?: keyof T;\r\n}\r\nexport function FieldValue({\r\n setValue,\r\n resetValueKey,\r\n fieldKey,\r\n}: SetValueProps) {\r\n const { getFieldMeta } = useFormikContext();\r\n\r\n React.useEffect(() => {\r\n if (fieldKey !== undefined) {\r\n const meta = getFieldMeta(fieldKey.toString());\r\n if (!!setValue) setValue(meta.value);\r\n if (!!resetValueKey) resetValueKey();\r\n }\r\n return () => {};\r\n }, [fieldKey, getFieldMeta, setValue, resetValueKey]);\r\n return null;\r\n}\r\n","/**\r\n *\r\n * DatePeriods\r\n *\r\n */\r\nimport { Select, MenuItem, FormControl } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport StandardInput from '../BasicInputs/BaseInputs/StandardInput';\r\nimport { getPeriods } from '../pickers/DatePeriodsPicker';\r\n\r\n/**\r\n * The order of the values in this array does matter for backwards compatibility since there periods type picker used Integer Ids stored in a duplicate array and these might be saved in the saved query string filters for some users.\r\n *\r\n */\r\nexport const ALL_PERIOD_TYPES = [\r\n 'CustomDate',\r\n 'Today',\r\n 'TodayTomorrow',\r\n 'ThisWeek',\r\n 'NextWeek',\r\n 'ThisMonth',\r\n 'NextMonth',\r\n 'ThisQuarter',\r\n 'NextQuarter',\r\n 'ThisYear',\r\n 'NextYear',\r\n 'LastWeek',\r\n 'LastMonth',\r\n 'LastQuarter',\r\n 'LastYear',\r\n 'Tomorrow',\r\n 'Yesterday',\r\n] as const;\r\ntype PeriodTypesTyple = typeof ALL_PERIOD_TYPES;\r\nexport type PeriodTypes = PeriodTypesTyple[number];\r\nexport interface PeriodTypesEntity extends Entity {}\r\nexport const getPeriodTypesEntity = (\r\n valueType: PeriodTypes,\r\n): PeriodTypesEntity => {\r\n return getPeriods()\r\n .map(item => {\r\n return {\r\n Id: item.Id,\r\n Name: translations[item.Name],\r\n type: item.Name as PeriodTypes,\r\n };\r\n })\r\n .filter(value => {\r\n return value.type === valueType;\r\n })[0];\r\n};\r\nexport const getPeriodTypesEntityById = (\r\n id: PeriodTypes | number | undefined,\r\n): PeriodTypesEntity | undefined => {\r\n if (id === undefined) {\r\n return undefined;\r\n }\r\n const periodType: PeriodTypes | undefined =\r\n typeof id === 'number' ? ALL_PERIOD_TYPES[id] : id;\r\n\r\n return getPeriods()\r\n .map(item => {\r\n return {\r\n Id: item.Id,\r\n Name: translations[item.Name],\r\n type: item.Name as PeriodTypes,\r\n };\r\n })\r\n .filter(value => {\r\n return value.Id === periodType;\r\n })[0];\r\n};\r\nexport interface DatePeriodsProps {\r\n value: PeriodTypes;\r\n onChange: (value: PeriodTypes) => void;\r\n size?: 'medium' | 'small' | undefined;\r\n}\r\n\r\nexport function DatePeriods(props: DatePeriodsProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n }\r\n value={props.value}\r\n onChange={e => props.onChange(e.target.value as PeriodTypes)}\r\n >\r\n {ALL_PERIOD_TYPES.map(key => (\r\n \r\n {t(key)}\r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n","import {\r\n DownloadFileProps,\r\n ListMessagesProps,\r\n OpenDetailsProps,\r\n} from './Actions';\r\n\r\nexport enum SnackBarActionType {\r\n refreshTable = 1,\r\n}\r\nexport enum SnackBarMessageType {\r\n openSidepanelDetails = 1,\r\n showLinkMessage = 2,\r\n HTML = 3,\r\n messageList = 4,\r\n fileDownload = 5,\r\n}\r\nexport type SnackBarMessageProps =\r\n | OpenDetailsProps\r\n | ListMessagesProps\r\n | DownloadFileProps;\r\n","import * as Handlebar from 'handlebars';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport sanitizeHtml from 'sanitize-html';\r\n\r\nHandlebar.registerHelper('formatDate', (date, format) => {\r\n try {\r\n return dateUtils.format(date, format);\r\n } catch (error) {\r\n return error;\r\n }\r\n});\r\nHandlebar.registerHelper('sanitize', value => {\r\n try {\r\n return sanitizeHtml(value);\r\n } catch (error) {\r\n return error;\r\n }\r\n});\r\n\r\nconst customFormAst = Handlebar.parse(\r\n '{{#each CustomForm}}

{{Id}}: {{Value}}

{{/each}}',\r\n);\r\nexport const parse = (template: string | undefined) =>\r\n Handlebar.parse(template ?? '');\r\n/**\r\n * Compiles Handlebars template to be used in scheduler text templates.\r\n * * adds formatDate support\r\n * * adds support for {{CustomForm}} - by replacing it with the custom form - specific template\r\n * @param template user-input template text\r\n * @returns\r\n */\r\nexport const compileHandlebarsTemplate = (template?: string) => {\r\n if (template === undefined) {\r\n return undefined;\r\n }\r\n\r\n // first parse the template\r\n const ast = Handlebar.parse(template);\r\n\r\n // mutate - replace the CustomForm placeholder by expanding it using another AST\r\n new ReplaceMutatingVisitor('CustomForm', customFormAst).accept(ast);\r\n\r\n // finally compile the resulting AST\r\n const result = Handlebar.compile(ast);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Mutates AST tree by replacing a given node.\r\n */\r\nclass ReplaceMutatingVisitor extends Handlebar.Visitor {\r\n _replacementStatement = null;\r\n _path = null;\r\n mutating = true;\r\n /**\r\n * Initializes the Visitor\r\n * @param path original Path name to replace the node at\r\n * @param replacementStatement replacement expression\r\n */\r\n constructor(path, replacementStatement) {\r\n super();\r\n this._path = path;\r\n this._replacementStatement = replacementStatement;\r\n }\r\n MustacheStatement(mustache: hbs.AST.MustacheStatement) {\r\n if ((mustache.path as hbs.AST.PathExpression)?.original === this._path) {\r\n return this._replacementStatement;\r\n }\r\n }\r\n}\r\n","import * as Handlebar from 'handlebars';\r\n\r\n/**\r\n * Extracts paths used in handlebars ast\r\n */\r\nexport class ExtractPathsVisitor extends Handlebar.Visitor {\r\n paths: string[] = [];\r\n MustacheStatement(mustache: hbs.AST.MustacheStatement) {\r\n // for our purpose the path can be either a direct property path or a handlebars helper function with property as a parameter\r\n const isHelperPath = mustache.params.length > 0;\r\n if (isHelperPath) {\r\n // extract all parameters that are PathExpression only (e.g. ignore LiteralExpression, etc.)\r\n const paths = mustache.params\r\n .filter(f => f.type === 'PathExpression')\r\n .map(f => (f as hbs.AST.PathExpression)?.original);\r\n this.paths.push(...paths);\r\n } else {\r\n this.paths.push((mustache.path as hbs.AST.PathExpression)?.original);\r\n }\r\n }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { allowedToViewAlert } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectglobalSettings,\r\n selectKnownModule,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { RootState } from 'types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { initialState } from '.';\r\nimport { getViewEndDate, getViewStartDate } from '../utils';\r\nimport { EventType, SchedulerState } from './types';\r\nimport { selectGlobalSetting } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { MultipleInstrumentReservations } from 'enums/MultipleInstrumentReservations';\r\nimport { selectSelectedSavedView } from 'app/pages/SavedViewsPage/SavedViewPage/slice/selectors';\r\nimport { selectIsMobileView } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n compileHandlebarsTemplate,\r\n parse,\r\n} from '../components/event_text/handlebars';\r\nimport { ExtractPathsVisitor } from '../components/event_text/ExtractPathsVisitor';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { union } from 'lodash';\r\nimport { Identifiable } from 'types/common';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { canEditReservation } from 'app/permissions/Reservations/reservationPermissions';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { mapEvents } from '../utils/syncSchedulerEvents';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { tryParseBool } from 'utils/string-utils';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n (state.scheduler || initialState) as SchedulerState;\r\n\r\nexport const selectScheduler = createSelector([selectSlice], state => state);\r\n\r\nconst selectEvents = createSelector([selectScheduler], state => state.events);\r\n\r\nexport const selectSchedulerEvents = createSelector([selectScheduler], state =>\r\n state.viewState?.date === undefined\r\n ? undefined\r\n : state.events[state.viewState?.date],\r\n);\r\n\r\nexport const selectSchedulerOfflineHours = createSelector(\r\n [selectScheduler],\r\n state => state.offlineHours,\r\n);\r\nexport const selectTrainingSessions = createSelector(\r\n [selectScheduler],\r\n state => state.trainingSessions,\r\n);\r\n\r\nexport const selectSchedulerViewState = createSelector(\r\n [selectSlice],\r\n state => state.viewState,\r\n);\r\nexport const selectSchedulerDateTs = createSelector(\r\n [selectSchedulerViewState],\r\n state => state?.date,\r\n);\r\nexport const selectSchedulerViewType = createSelector(\r\n [selectSchedulerViewState],\r\n state => state?.viewType,\r\n);\r\n\r\nexport const selectSchedulerDate = createSelector(\r\n [selectSchedulerDateTs],\r\n state => (state === undefined ? undefined : dateUtils.parseISO(state)),\r\n);\r\n\r\nexport const selectNonWorkingHours = createSelector(\r\n [selectScheduler],\r\n state => state.nonWorkingHours,\r\n);\r\nexport const selectSchedulerTempEvents = createSelector(\r\n [selectSlice],\r\n state => state.tempReservations,\r\n);\r\n\r\nexport const selectLoadedServices = createSelector(\r\n [selectScheduler],\r\n state => state.selectedServices,\r\n);\r\nexport const selectSchedulerServicesLimit = createSelector(\r\n [selectLoadedServices, selectglobalSettings, selectSchedulerViewState],\r\n (services, globalSettings, viewState) => {\r\n const limitKey =\r\n viewState?.viewType === 'calendar'\r\n ? 'CalendarServicesPickerCapacity'\r\n : viewState?.viewType === 'timeline'\r\n ? 'MaximumTimelineRowsLimit'\r\n : undefined;\r\n const limitString =\r\n limitKey === undefined ? undefined : globalSettings.TryGet(limitKey);\r\n const limitNumber =\r\n limitString === undefined || limitString === null\r\n ? undefined\r\n : parseInt(limitString);\r\n return limitNumber;\r\n },\r\n);\r\nexport const selectSchedulerFilters = createSelector(\r\n [selectSlice],\r\n state => state.filters,\r\n);\r\nexport const selectWithReservationsOnly = createSelector(\r\n [selectSchedulerFilters],\r\n state =>\r\n (state?.['WithReservationsOnly']?.value as Identifiable)?.Id,\r\n);\r\nexport const selectSchedulerServicesLimitReached = createSelector(\r\n [selectLoadedServices, selectSchedulerServicesLimit],\r\n (services, limitNumber) =>\r\n services !== undefined &&\r\n limitNumber !== undefined &&\r\n services?.length > limitNumber,\r\n);\r\nexport const selectSchedulerSelectedServices = createSelector(\r\n [selectLoadedServices, selectSchedulerServicesLimit],\r\n (services, limitNumber) => {\r\n if (services === undefined) {\r\n return undefined;\r\n }\r\n if (limitNumber !== undefined && !isNaN(limitNumber)) {\r\n return services.slice(0, limitNumber);\r\n } else {\r\n return services;\r\n }\r\n },\r\n);\r\nexport const selectSchedulerDerivedServices = createSelector(\r\n [selectScheduler],\r\n state => state.derivedServices,\r\n);\r\n/**\r\n * map reservations in scheduler prasable format\r\n */\r\nconst selectMappedReservations = createSelector(\r\n [selectEvents, selectSchedulerDateTs],\r\n (items, date) =>\r\n date === undefined\r\n ? undefined\r\n : mapEvents('reservation', items[date], f => ({\r\n id: String(f.Id),\r\n reservation_id: f.Id,\r\n start_date: f.StartTime,\r\n end_date: f.EndTime,\r\n color: f.EquipmentColor ?? undefined,\r\n service_id: f.EquipmentId,\r\n service_name: f.EquipmentName,\r\n })),\r\n);\r\n/**\r\n * map offline hours in scheduler prasable format\r\n */\r\nconst selectMappedOfflineHours = createSelector(\r\n [selectSchedulerOfflineHours, selectSchedulerDateTs],\r\n (items, date) =>\r\n date === undefined\r\n ? undefined\r\n : mapEvents('offline', items[date], offline => ({\r\n id: `offline_${offline.Id}`,\r\n alert_id: offline.AlertId ?? undefined,\r\n\r\n start_date: offline.StartTime,\r\n end_date: offline.EndTime,\r\n service_id: offline.EquipmentId,\r\n service_name: offline.EquipmentName,\r\n offline_id: offline.Id,\r\n })),\r\n);\r\n/**\r\n * map training session in scheduler prasable format\r\n */\r\nconst selectMappedTrainingSessions = createSelector(\r\n [selectTrainingSessions, selectSchedulerDateTs],\r\n (items, date) =>\r\n date === undefined\r\n ? undefined\r\n : mapEvents('trainingsession', items[date], item => {\r\n const x = {\r\n id: `trainingsession_${item.Id}`,\r\n reservation_id: item.ReservationId ?? undefined,\r\n start_date: item.StartTime,\r\n end_date: item.EndTime,\r\n service_id: item.EquipmentId,\r\n service_name: item.EquipmentName,\r\n color: item.EquipmentColor ?? undefined,\r\n trainingsession_id: item.Id,\r\n };\r\n return x;\r\n }),\r\n);\r\n/**\r\n * combine all items shown as events\r\n */\r\nconst selectMapped = createSelector(\r\n [\r\n selectMappedReservations,\r\n selectMappedOfflineHours,\r\n selectMappedTrainingSessions,\r\n ],\r\n (a, b, c) =>\r\n a === undefined && b === undefined && c === undefined\r\n ? undefined\r\n : [...(a ?? []), ...(b ?? []), ...(c ?? [])],\r\n);\r\n/**\r\n * Selects combined reservations, training sessions & offline hours used to be parsed by the dhtmlx scheduler\r\n */\r\nexport const selectSchedulerParseEvents = createSelector(\r\n [selectMapped, selectAuthenticatedUser, selectSchedulerViewType],\r\n (mappedEvents, authenticatedUser, viewType) => {\r\n var items =\r\n viewType === 'calendar'\r\n ? mappedEvents?.filter(\r\n f =>\r\n !(\r\n f.type === 'reservation' &&\r\n (f.original as ICalendarReservationDto).TrainingSignUp === true\r\n ),\r\n )\r\n : mappedEvents;\r\n return items?.map(item => {\r\n const viewType = item.type;\r\n\r\n let readonly = true;\r\n let notClickable = false;\r\n switch (viewType) {\r\n case 'reservation':\r\n readonly =\r\n !canEditReservation(authenticatedUser, {\r\n ServiceId: item.original.EquipmentId ?? 0,\r\n ServiceTypeId: ServiceType.Online,\r\n ServiceGroupId: item.original.ServiceGroupId ?? 0,\r\n UserId: (item.original as ICalendarReservationDto).BookedById,\r\n }) ||\r\n (item.original as ICalendarReservationDto).Restricted === true ||\r\n (item.original as ICalendarReservationDto).TrainingSignUp === true;\r\n notClickable =\r\n !canEditReservation(authenticatedUser, {\r\n ServiceId: item.original.EquipmentId ?? 0,\r\n ServiceTypeId: ServiceType.Online,\r\n ServiceGroupId: item.original.ServiceGroupId ?? 0,\r\n UserId: (item.original as ICalendarReservationDto).BookedById,\r\n }) ||\r\n (item.original as ICalendarReservationDto).Restricted === true;\r\n break;\r\n case 'offline':\r\n readonly = notClickable = !allowedToViewAlert(authenticatedUser, {\r\n ReportedBy: (item.original as IWorkingHoursDto).BookedById,\r\n ServiceGroupId: (item.original as IWorkingHoursDto).ServiceGroupId,\r\n ServiceId: item.original.EquipmentId ?? 0,\r\n ServiceTypeId: ServiceType.Online,\r\n });\r\n }\r\n\r\n return {\r\n ...item,\r\n readonly: readonly,\r\n notClickable: notClickable,\r\n // disables start event resize on timeline view\r\n _no_resize_end: readonly,\r\n // disabled end event drag on timelene view\r\n _no_resize_start: readonly,\r\n // disables drag on matrix view\r\n _no_drag_move: readonly,\r\n };\r\n });\r\n },\r\n);\r\nexport const selectSchedulerServices = createSelector(\r\n [\r\n selectSchedulerSelectedServices,\r\n selectSchedulerDerivedServices,\r\n selectGlobalServiceGroupFilter,\r\n selectWithReservationsOnly,\r\n\r\n selectMapped,\r\n ],\r\n (\r\n selectedServices,\r\n derivedServices,\r\n serviceGroups,\r\n WithReservationsOnly,\r\n events,\r\n ) => {\r\n // use selectedServices if case a service have been selected\r\n // if no service was selected use the services of reservations returned by the filter\r\n const services =\r\n (selectedServices ?? []).length > 0 ? selectedServices : derivedServices;\r\n\r\n // show only services of the selected top service group filter if it has been applied\r\n const intermediate1 = filterServicesByServiceGroups(\r\n serviceGroups,\r\n services,\r\n );\r\n\r\n // applies WithReservationsOnly filter to the services\r\n const intermediate2 = filterServicesByEvents(\r\n events,\r\n intermediate1,\r\n WithReservationsOnly,\r\n );\r\n\r\n return intermediate2;\r\n },\r\n);\r\nexport const selectSchedulerPreviousViewState = createSelector(\r\n [selectSlice],\r\n state => state.previousViewState,\r\n);\r\nconst instrumentMultipleEnabled = state =>\r\n selectGlobalSetting(state, AllowedSettings.MultipleInstrumentReservations);\r\n\r\nexport const selectMultipleModeState = createSelector(\r\n [\r\n instrumentMultipleEnabled,\r\n selectSelectedSavedView,\r\n selectUserProfileSettings,\r\n ],\r\n (multipleInstrumentsSetting, currentSelected, userProfile) => {\r\n if (\r\n multipleInstrumentsSetting !== undefined &&\r\n MultipleInstrumentReservations[multipleInstrumentsSetting] !==\r\n MultipleInstrumentReservations.NotAllowed\r\n ) {\r\n // todo:\r\n\r\n const instrumentMultipleEnabled =\r\n userProfile.GetSettingValueBy(\r\n (f: { Key: string }) =>\r\n f.Key.toLowerCase() === 'BookMultipleInstruments'.toLowerCase(),\r\n )?.IsMultiple ?? undefined;\r\n if (!!currentSelected) {\r\n return currentSelected.Multiple;\r\n } else if (instrumentMultipleEnabled !== undefined) {\r\n return instrumentMultipleEnabled;\r\n } else {\r\n return (\r\n MultipleInstrumentReservations[multipleInstrumentsSetting] ===\r\n MultipleInstrumentReservations.AllowedDefaultMultiple\r\n );\r\n }\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n);\r\n\r\nexport const selectSchedulerViewStartDate = createSelector(\r\n [selectSchedulerViewState],\r\n state =>\r\n state === undefined\r\n ? undefined\r\n : getViewStartDate(state.viewLength, state.date, state.customStart),\r\n);\r\nexport const selectSchedulerViewEndDate = createSelector(\r\n [selectSchedulerViewState],\r\n state =>\r\n state === undefined\r\n ? undefined\r\n : getViewEndDate(\r\n state.viewLength,\r\n state.date,\r\n state.customDays,\r\n state.customStart,\r\n ),\r\n);\r\nexport const selectSchedulerViewCustomDays = createSelector(\r\n [selectSchedulerViewState],\r\n state => state?.customDays,\r\n);\r\nexport const selectSchedulerViewCustomStart = createSelector(\r\n [selectSchedulerViewState],\r\n state => state?.customStart,\r\n);\r\nexport const selectNotUseLocation = createSelector(\r\n [selectSlice],\r\n state => state.notUseLocation,\r\n);\r\nexport const selectEmptySlotAdminClick = createSelector(\r\n [selectScheduler],\r\n state => state.emptySlotAdminClick,\r\n);\r\nexport const selectSchedulerNewEventServices = createSelector(\r\n [\r\n selectSchedulerViewState,\r\n selectSchedulerTempEvents,\r\n selectSchedulerSelectedServices,\r\n selectSchedulerDerivedServices,\r\n selectIsMobileView,\r\n ],\r\n (\r\n viewState,\r\n tempReservation,\r\n selectedServices,\r\n derivedServices,\r\n isMobileView,\r\n ) => {\r\n // timeline + daily calendar (unit) has separate row/column for each service\r\n // so in this state new event is placed directly on an instrument\r\n const singleServiceEvent =\r\n viewState?.viewType === 'timeline' ||\r\n (viewState?.viewType === 'calendar' &&\r\n viewState.viewLength === 'day' &&\r\n !isMobileView);\r\n\r\n const getSingleServiceEventServices = () => {\r\n // try looking up both directly selected services and services derived from the events shown on the calendar when no service is directly selected\r\n const s =\r\n selectedServices?.find(f => f.Id === tempReservation?.service_id) ??\r\n derivedServices?.find(f => f.Id === tempReservation?.service_id);\r\n if (s === undefined) {\r\n return [];\r\n } else {\r\n return [s];\r\n }\r\n };\r\n const services =\r\n (singleServiceEvent\r\n ? getSingleServiceEventServices()\r\n : selectedServices) ?? [];\r\n\r\n return services;\r\n },\r\n);\r\nexport const selectTwoDaysTimelineButtonEnabled = createSelector(\r\n [selectglobalSettings],\r\n globalSettings => {\r\n return globalSettings.GetBoolean('EnableTwoDaysTimelineButton');\r\n },\r\n);\r\nexport const selectCustomDaysTimelineButtonEnabled = createSelector(\r\n [selectglobalSettings],\r\n globalSettings => {\r\n return globalSettings.GetBoolean('EnableCustomDaysTimelineButton');\r\n },\r\n);\r\nexport const selectSelectedReservationEvents = createSelector(\r\n [selectSlice],\r\n state => state.selectedReservationEvents,\r\n);\r\n\r\nexport const selectDefaultCustomDaysTimelineValue = createSelector(\r\n [selectglobalSettings],\r\n globalSettings => {\r\n const daysString = globalSettings.TryGet('DefaultCustomDaysTimelineValue');\r\n const daysNumber =\r\n daysString === undefined || daysString === null\r\n ? undefined\r\n : parseInt(daysString);\r\n return daysNumber;\r\n },\r\n);\r\n\r\nexport const selectIncludeCustomFormInSchedulerReservationTooltip = createSelector(\r\n [\r\n (state: RootState) =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.IncludeCustomFormInSchedulerReservationTooltip,\r\n ),\r\n ],\r\n f => tryParseBool(f),\r\n);\r\n\r\nexport const selectSchedulerReservationBodyTemplate = createSelector(\r\n [\r\n (state: RootState) =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.SchedulerReservationBodyTemplate,\r\n ),\r\n ],\r\n f => compileHandlebarsTemplate(f),\r\n);\r\n\r\nexport const selectSchedulerReservationTooltipTemplate = createSelector(\r\n [\r\n (state: RootState) =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.SchedulerReservationTooltipTemplate,\r\n ),\r\n ],\r\n f => compileHandlebarsTemplate(f),\r\n);\r\n\r\nexport const selectCalendarReservationColumns = createSelector(\r\n [\r\n (state: RootState) =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.SchedulerReservationBodyTemplate,\r\n ),\r\n\r\n (state: RootState) =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.SchedulerReservationTooltipTemplate,\r\n ),\r\n (state: RootState) =>\r\n selectKnownModule(state, KnownModules.EquipmentAssemblies),\r\n (state: RootState) =>\r\n selectGlobalSetting(state, AllowedSettings.AllowWorkflowBooking),\r\n selectIncludeCustomFormInSchedulerReservationTooltip,\r\n ],\r\n (\r\n schedulerReservationBodyTemplate,\r\n schedulerReservationTooltipTemplate,\r\n equipmentAssemblies,\r\n allowWorkflowBooking,\r\n includeCustomFormInSchedulerReservationTooltip,\r\n ) => {\r\n const pathExtractor = new ExtractPathsVisitor();\r\n pathExtractor.accept(parse(schedulerReservationBodyTemplate));\r\n pathExtractor.accept(parse(schedulerReservationTooltipTemplate));\r\n const reservationHistorySelectArray: Array<\r\n keyof ICalendarReservationDto\r\n > = [\r\n 'Id',\r\n 'StartTime',\r\n 'EndTime',\r\n 'EquipmentId',\r\n 'EquipmentName',\r\n 'ServiceGroupId',\r\n 'EquipmentColor',\r\n 'BookedBy',\r\n 'BookedById',\r\n 'StatusId',\r\n 'Tutoring',\r\n 'Restricted',\r\n 'TrainingSignUp',\r\n 'FullDayReservation',\r\n ];\r\n if (equipmentAssemblies) {\r\n reservationHistorySelectArray.push('TopAssemblyReservationId');\r\n }\r\n if (allowWorkflowBooking) {\r\n reservationHistorySelectArray.push('WorkFlowBookingName');\r\n }\r\n if (includeCustomFormInSchedulerReservationTooltip === true) {\r\n reservationHistorySelectArray.push('CustomForm');\r\n }\r\n const p = union(reservationHistorySelectArray, pathExtractor.paths);\r\n return p;\r\n },\r\n);\r\nfunction filterServicesByServiceGroups(\r\n serviceGroups?: Identifiable[],\r\n services?: IServiceFilterDto[],\r\n) {\r\n const serviceGroupIds = (serviceGroups ?? [])?.map(f => f.Id);\r\n return serviceGroupIds.length === 0\r\n ? services\r\n : services?.filter(\r\n service =>\r\n service.ServiceGroupId === undefined ||\r\n serviceGroupIds.includes(service.ServiceGroupId),\r\n );\r\n}\r\n\r\nfunction filterServicesByEvents(\r\n events: Array<{ type: EventType; service_id: number }> | undefined,\r\n services: IServiceFilterDto[] | undefined,\r\n WithReservationsOnly: boolean | undefined,\r\n) {\r\n if (WithReservationsOnly === true) {\r\n const servicesWithEvents = new Set(\r\n events\r\n ?.filter(f => f.type === 'reservation' || f.type === 'trainingsession')\r\n .map(f => f.service_id),\r\n );\r\n\r\n const xx = services?.filter(service => servicesWithEvents.has(service.Id));\r\n return xx;\r\n } else {\r\n return services;\r\n }\r\n}\r\n\r\nexport const selectSchedulerLoadingEvents = createSelector(\r\n [selectSlice],\r\n state => state.loadingEvents,\r\n);\r\n\r\nexport const selectTimelineGroupBy = createSelector(\r\n [selectSchedulerViewState],\r\n state => state?.groupBy,\r\n);\r\n\r\nexport const selectExportToPDF = createSelector(\r\n [selectSlice],\r\n state => state.exportToPDF,\r\n);\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.RequiredTypes\r\n *\r\n */\r\n\r\nexport enum RequiredTypes {\r\n Optional = 0,\r\n User = 1,\r\n Admin = 2,\r\n Conditional = 3,\r\n}\r\nexport type RequiredTypesUnion = keyof typeof RequiredTypes;\r\nexport const RequiredTypesUnionArray: Array = [\r\n 'Optional',\r\n 'User',\r\n 'Admin',\r\n 'Conditional',\r\n];\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.DisplayTypes\r\n *\r\n */\r\n\r\nexport enum DisplayTypes {\r\n AlwaysVisible = 0,\r\n VisibleToAdminOnly = 1,\r\n VisibleToUserOnDoneRequest = 2,\r\n}\r\nexport type DisplayTypesUnion = keyof typeof DisplayTypes;\r\nexport const DisplayTypesUnionArray: Array = [\r\n 'AlwaysVisible',\r\n 'VisibleToAdminOnly',\r\n 'VisibleToUserOnDoneRequest',\r\n];\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n createOptions,\r\n getDropDownInitValue,\r\n} from './CustomFormFields/CustomFormDropDown';\r\nimport * as Yup from 'yup';\r\nimport * as React from 'react';\r\nimport { ObjectShape } from 'yup/lib/object';\r\nimport { RequiredTypes } from 'api/odata/generated/enums/RequiredTypes';\r\nimport { Entity } from 'types/common';\r\nimport { DisplayTypes } from 'api/odata/generated/enums/DisplayTypes';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\nimport { lookup } from 'mime-types';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectForbiddenFileExtensions,\r\n selectUploadFileSizeLimit,\r\n} from 'app/slice/selectors';\r\nimport { differenceWith } from 'lodash';\r\nimport {\r\n IServiceRequestTableColumnModel,\r\n IServiceRequestTableRowValueModel,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport interface IFormFileValue {\r\n Id: number;\r\n Value: string | null;\r\n DisplayValue?: string | null;\r\n Size: number | null;\r\n PostedFile: File | null;\r\n}\r\nexport function instanceOfIFormValueType(\r\n objects: any,\r\n): objects is IFormFileValue[] {\r\n const members = ['Id', 'Value', 'DisplayValue', 'Size', 'PostedFile'];\r\n return (\r\n Array.isArray(objects) &&\r\n objects.every(object => members.every(member => member in object))\r\n );\r\n}\r\nexport const formFileSchema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().default(-1),\r\n Value: Yup.string().nullable().default(null),\r\n DisplayValue: Yup.string().nullable(),\r\n Size: Yup.number().nullable(true).default(0),\r\n PostedFile: Yup.mixed().nullable(true).default(null),\r\n});\r\nexport const formValueSchema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().default(-1),\r\n Value: Yup.string().default('').nullable(),\r\n DisplayValue: Yup.string().nullable().default(null),\r\n FormFieldId: Yup.number().default(-1),\r\n Readonly: Yup.boolean().default(false),\r\n SourceValueId: Yup.number().nullable(true).notRequired().default(null),\r\n AlertId: Yup.number().nullable(true).notRequired().default(null),\r\n AlertTypeId: Yup.number().nullable(true).notRequired().default(null),\r\n CustomFormId: Yup.number().nullable().default(null),\r\n CustomFormName: Yup.string().nullable().default(null),\r\n RequestId: Yup.number().nullable().default(null),\r\n ReservationId: Yup.number().nullable().default(null),\r\n ExperimentItemId: Yup.number().nullable().default(null),\r\n BudgetExperimentId: Yup.number().nullable().default(null),\r\n ServiceGroupUserId: Yup.number().nullable().default(null),\r\n ServiceGroupId: Yup.number().nullable().default(null),\r\n});\r\n\r\nexport const ParseFormFieldEnums = (formFields: IFormFieldDto[]) =>\r\n formFields.forEach(ff => {\r\n ff.Required = RequiredTypes[ff.Required.toString()];\r\n });\r\nexport const DeserializeValue = (\r\n formField: IFormFieldDto,\r\n formValue: IFormValueDto | null,\r\n) => {\r\n switch (formField.Type) {\r\n case 'ShortText':\r\n case 'Email':\r\n case 'Number':\r\n case 'PositiveNumber':\r\n case 'RichText':\r\n case 'MultipleAnswersQuestion':\r\n case 'RadioButtons':\r\n if (\r\n formValue &&\r\n formValue.Value &&\r\n !isEmptyOrWhitespace(formValue.Value)\r\n ) {\r\n return formValue.Value;\r\n }\r\n return null;\r\n case 'Date':\r\n if (\r\n formValue &&\r\n formValue.Value &&\r\n !isEmptyOrWhitespace(formValue.Value)\r\n ) {\r\n return dateUtils.tryParse(formValue.Value);\r\n }\r\n return null;\r\n // case 'AlphanumericWithDashes':\r\n // return getAlphaNumericValue(formValue);\r\n case 'CheckBox':\r\n case 'Disclaimer':\r\n if (\r\n formValue &&\r\n formValue.Value &&\r\n !isEmptyOrWhitespace(formValue.Value)\r\n ) {\r\n return formValue.Value.toLowerCase() === 'true';\r\n }\r\n return false;\r\n case 'DropDownList':\r\n case 'UserSelection':\r\n if (\r\n formValue &&\r\n formValue.Value &&\r\n !isEmptyOrWhitespace(formValue.Value)\r\n ) {\r\n const options = createOptions(formField);\r\n let ddlValue = getDropDownInitValue(\r\n formValue.Value ?? undefined,\r\n formField.IsMultiple,\r\n options,\r\n );\r\n return formField.IsMultiple ? ddlValue : ddlValue[0];\r\n } else {\r\n return formField.IsMultiple ? [] : null;\r\n }\r\n case 'FormSection':\r\n return null;\r\n default:\r\n return null;\r\n }\r\n};\r\nexport type CustomFormValueType =\r\n | string\r\n | Date\r\n | number\r\n | boolean\r\n | IFormFileValue\r\n | Entity\r\n | Array>;\r\nexport const SerializeValue = (\r\n formField: IFormFieldDto,\r\n formValue: CustomFormValueType,\r\n): string | null => {\r\n if (formValue === null || formValue === undefined) {\r\n return null;\r\n }\r\n switch (formField.Type) {\r\n case 'CheckBox':\r\n case 'Disclaimer':\r\n return (formValue as boolean).toString();\r\n case 'Date':\r\n return (\r\n dateUtils.tryFormatIso(formValue, {\r\n format: 'basic',\r\n representation: 'date',\r\n }) ?? null\r\n );\r\n\r\n case 'Email':\r\n case 'Number':\r\n case 'PositiveNumber':\r\n case 'RichText':\r\n case 'ShortText':\r\n case 'MultipleAnswersQuestion':\r\n case 'RadioButtons':\r\n return typeof formValue === 'string' && isEmptyOrWhitespace(formValue)\r\n ? ''\r\n : formValue.toString();\r\n case 'File':\r\n if (instanceOfIFormValueType(formValue)) {\r\n let fileValue = formValue as IFormFileValue[];\r\n if (fileValue.length > 0) {\r\n return formField.IsMultiple\r\n ? fileValue\r\n .filter(f => f.Value !== null)\r\n .map(v => v.Value)\r\n .join(',')\r\n : fileValue[0].Value ?? '';\r\n } else {\r\n return '';\r\n }\r\n }\r\n break;\r\n case 'FormSection':\r\n return '';\r\n case 'DropDownList':\r\n case 'UserSelection':\r\n if (formValue === null || formValue === undefined) {\r\n return '';\r\n } else {\r\n if (Array.isArray(formValue)) {\r\n return (formValue as Entity[]).map(f => f.Id).join(',');\r\n } else {\r\n return (formValue as Entity).Id.toString();\r\n }\r\n }\r\n default:\r\n return '';\r\n }\r\n return null;\r\n};\r\nexport const getSerializableIsRequired = (\r\n formField: IFormFieldDto,\r\n formValue: CustomFormValueType,\r\n) => {\r\n const val = SerializeValue(formField, formValue);\r\n return (\r\n val === null ||\r\n val === undefined ||\r\n isEmptyOrWhitespace(val) ||\r\n val === 'false'\r\n );\r\n};\r\n\r\nexport function getFieldSchema(\r\n formField: IFormFieldDto,\r\n isAdmin: boolean,\r\n fileSize: number,\r\n notAllowedExt: string[],\r\n) {\r\n switch (formField.Type) {\r\n case 'MultipleAnswersQuestion':\r\n let result = Yup.string()\r\n .nullable()\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.string()\r\n\r\n .required(`${formField.Label} answer is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: 'required',\r\n message: `${formField.Label} answer is required.`,\r\n test: (value, context) => {\r\n if (isEmptyOrWhitespace(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return result;\r\n case 'RadioButtons':\r\n let radioButtons = Yup.string()\r\n .nullable()\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.string()\r\n\r\n .required(`${formField.Label} radio is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: 'required',\r\n message: `${formField.Label} radio is required.`,\r\n test: (value, context) => {\r\n if (isEmptyOrWhitespace(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return radioButtons;\r\n case 'File':\r\n let resultFile = Yup.array()\r\n .nullable()\r\n .of(formFileSchema)\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.array()\r\n .of(formFileSchema)\r\n .required(`${formField.Label} file is required.`)\r\n .min(1, `${formField.Label} file is required.`),\r\n },\r\n )\r\n .test({\r\n name: 'required',\r\n message: `${formField.Label} file is required.`,\r\n test: (value, context) => {\r\n if (value === undefined || value === null || value.length === 0) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: true,\r\n })\r\n .test({\r\n name: 'size',\r\n message: `${formField.Label} file is to large.`,\r\n test: (value, context) => {\r\n if (value !== undefined && value !== null && value.length > 0) {\r\n let files = value as IFormFileValue[];\r\n if (files.length > 0) {\r\n return files.every(f => f.Size == null || f.Size <= fileSize);\r\n }\r\n }\r\n return true;\r\n },\r\n exclusive: true,\r\n })\r\n .test({\r\n name: 'type',\r\n message: `${formField.Label} file type is forbidden.`,\r\n test: (value, context) => {\r\n if (value !== undefined && value !== null && value.length > 0) {\r\n let files = value as IFormFileValue[];\r\n if (files.length > 0) {\r\n let blockedTypes = notAllowedExt.map(f => lookup(f));\r\n let allowedExt =\r\n formField.Options === null\r\n ? []\r\n : formField.Options.split(',').map(f => lookup(f));\r\n return files.every(f => {\r\n if (f.PostedFile !== null) {\r\n return (\r\n !blockedTypes.includes(f.PostedFile.type) &&\r\n (allowedExt.length === 0 ||\r\n allowedExt.includes(f.PostedFile.type))\r\n );\r\n } else {\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n return true;\r\n },\r\n exclusive: true,\r\n });\r\n return resultFile;\r\n case 'Date':\r\n let resultDate = getCustomFormDateSchema(formField, isAdmin);\r\n return resultDate;\r\n case 'Email':\r\n let resultEmail = Yup.string()\r\n .nullable()\r\n .email(`${formField.Label} - Email format is not valid`)\r\n .max(\r\n formField.SizeLimit,\r\n `Maximum length of this field is ${formField.SizeLimit}`,\r\n )\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.string()\r\n .max(\r\n formField.SizeLimit,\r\n `Maximum length of this field is ${formField.SizeLimit}`,\r\n )\r\n .required(`${formField.Label} email is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} email is required.`,\r\n test: (value, context) => {\r\n if (isEmptyOrWhitespace(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return resultEmail;\r\n case 'ShortText':\r\n let resultText = Yup.string()\r\n .nullable()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n )\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.string()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n )\r\n .required(`${formField.Label} text is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} text is required.`,\r\n test: (value, context) => {\r\n if (isEmptyOrWhitespace(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n // if (formField.Required === 'Conditional') {\r\n // if (formField.RequiredFieldToCompare !== null) {\r\n // resultText.when((formField.RequiredFieldToCompare ?? formField.DependencyFieldId ?? 'N/A').toString(), {\r\n // is: value => isRequired(formField, isAdmin, groupAdmin, value),\r\n // then: Yup.string()\r\n // .max(\r\n // formField.SizeLimit,\r\n // `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n // )\r\n // .required(`${formField.Label} text is required.`),\r\n // });\r\n // }\r\n // } else if (isRequired(formField, isAdmin, groupAdmin, null)) {\r\n // resultText = resultText.required(\r\n // `${formField.Label} text is required.`,\r\n // );\r\n // } else if (\r\n // formField.DependencyFieldId !== null &&\r\n // formField.DependencyValue !== null\r\n // ) {\r\n // resultText.when(formField.DependencyFieldId.toString(), {\r\n // is: value => requiredByDependency(formField, value),\r\n // then: Yup.string()\r\n // .max(\r\n // formField.SizeLimit,\r\n // `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n // )\r\n // .required(`${formField.Label} text is required.`),\r\n // otherwise: Yup.string()\r\n // .nullable()\r\n // .max(\r\n // formField.SizeLimit,\r\n // `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n // ),\r\n // });\r\n // } else {\r\n // resultText = resultText.notRequired();\r\n // }\r\n return resultText;\r\n case 'RichText':\r\n let resultRichText = Yup.string()\r\n .nullable()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n )\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.string()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n )\r\n .required(`${formField.Label} rich text is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} rich text is required.`,\r\n test: (value, context) => {\r\n if (isEmptyOrWhitespace(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return resultRichText;\r\n case 'Number':\r\n let resultNumber = Yup.number()\r\n .nullable()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n )\r\n .min(\r\n -formField.SizeLimit,\r\n `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n )\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.number()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n )\r\n .min(\r\n -formField.SizeLimit,\r\n `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n )\r\n .required(`${formField.Label} number is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} number is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value) || isNaN(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return resultNumber;\r\n case 'PositiveNumber':\r\n let resultPosNumber = Yup.number()\r\n .nullable()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n )\r\n .min(\r\n 0,\r\n `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n )\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.number()\r\n .max(\r\n formField.SizeLimit,\r\n `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n )\r\n .min(\r\n 0,\r\n `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n )\r\n .required(`${formField.Label} number is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} number is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value) || isNaN(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return resultPosNumber;\r\n case 'Disclaimer':\r\n let resultDesc = Yup.boolean()\r\n .default(false)\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} check is required`,\r\n test: (value, context) => value === true,\r\n exclusive: true,\r\n });\r\n return resultDesc;\r\n case 'CheckBox':\r\n let resultCheck = Yup.boolean()\r\n .default(false)\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.boolean()\r\n .default(false)\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} check is required`,\r\n test: (value, context) => value === true,\r\n exclusive: true,\r\n }),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} rich text is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value) || value === false) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n return resultCheck;\r\n case 'DropDownList':\r\n case 'UserSelection':\r\n let singleResult = Yup.mixed()\r\n .nullable()\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.mixed()\r\n .required(`${formField.Label} select option is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} select option is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n let multipleResult = Yup.array()\r\n .of(Yup.mixed())\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.array()\r\n .of(Yup.mixed())\r\n .min(1)\r\n .required(`${formField.Label} select option is required.`),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} select option is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value) || value.length === 0) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n // if (formField.Required === 'Conditional') {\r\n // if (formField.RequiredFieldToCompare !== null) {\r\n // if (formField.IsMultiple) {\r\n // multipleResult.when(formField.RequiredFieldToCompare.toString(), {\r\n // is: value =>\r\n // value !== null &&\r\n // value !== undefined &&\r\n // (value as Entity[]).some(\r\n // f => f.Id === formField.RequiredValueToCompare ?? '',\r\n // ),\r\n // then: Yup.array()\r\n // .of(Yup.mixed())\r\n // .required(`${formField.Label} select option is required.`),\r\n // otherwise: Yup.array()\r\n // .of(Yup.mixed())\r\n // .nullable(true)\r\n // .notRequired(),\r\n // });\r\n // } else {\r\n // singleResult.when(formField.RequiredFieldToCompare.toString(), {\r\n // is: value =>\r\n // value !== null &&\r\n // value !== undefined &&\r\n // ((value as Entity).Id ===\r\n // formField.RequiredValueToCompare ??\r\n // ''),\r\n // then: Yup.mixed().required(\r\n // `${formField.Label} select option is required.`,\r\n // ),\r\n // otherwise: Yup.mixed().nullable(true).notRequired(),\r\n // });\r\n // }\r\n // }\r\n // } else if (isRequired(formField, isAdmin, null)) {\r\n // if (formField.IsMultiple) {\r\n // multipleResult = multipleResult.required(\r\n // `${formField.Label} select option is required.`,\r\n // );\r\n // } else {\r\n // singleResult = singleResult.required(\r\n // `${formField.Label} select option is required.`,\r\n // );\r\n // }\r\n // } else if (\r\n // formField.DependencyFieldId !== null &&\r\n // formField.DependencyValue !== null\r\n // ) {\r\n // if (formField.IsMultiple) {\r\n // multipleResult.when(formField.DependencyFieldId.toString(), {\r\n // is: value => isDependencyVisible(formField, value),\r\n // then: Yup.array()\r\n // .of(Yup.mixed())\r\n // .required(`${formField.Label} select option is required.`),\r\n // otherwise: Yup.array().of(Yup.mixed()).nullable(true).notRequired(),\r\n // });\r\n // } else {\r\n // singleResult.when(formField.DependencyFieldId.toString(), {\r\n // is: value => isDependencyVisible(formField, value),\r\n // then: Yup.mixed().required(\r\n // `${formField.Label} select option is required.`,\r\n // ),\r\n // otherwise: Yup.mixed().nullable(true).notRequired(),\r\n // });\r\n // }\r\n // } else {\r\n // if (formField.IsMultiple) {\r\n // multipleResult = multipleResult.nullable(true).notRequired();\r\n // } else {\r\n // singleResult = singleResult.nullable(true).notRequired();\r\n // }\r\n // }\r\n if (formField.IsMultiple) {\r\n return multipleResult;\r\n } else {\r\n return singleResult;\r\n }\r\n }\r\n let def = Yup.string().nullable().default(null);\r\n return def;\r\n}\r\n\r\nfunction getCustomFormDateSchema(\r\n formField: Pick<\r\n IFormFieldDto,\r\n | 'Id'\r\n | 'Label'\r\n | 'Required'\r\n | 'DependencyFieldId'\r\n | 'DependencyValue'\r\n | 'DependencyMultiple'\r\n | 'DependencyVisibility'\r\n | 'RequiredFieldToCompare'\r\n | 'RequiredValueToCompare'\r\n >,\r\n isAdmin: boolean,\r\n) {\r\n return Yup.date()\r\n .nullable()\r\n .when(\r\n [\r\n (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n (formField.DependencyFieldId ?? 'NA').toString(),\r\n ],\r\n {\r\n is: value => isRequired(formField, isAdmin, value),\r\n then: Yup.date()\r\n .required(`${formField.Label} date is required.`)\r\n .nullable(),\r\n },\r\n )\r\n .test({\r\n name: formField.Id.toString(),\r\n message: `${formField.Label} date is required.`,\r\n test: (value, context) => {\r\n if (isNullOrUndefined(value)) {\r\n return isRequired(formField, isAdmin, null) === false;\r\n }\r\n return true;\r\n },\r\n exclusive: false,\r\n });\r\n}\r\n\r\nexport function isRequired(\r\n formField: Pick<\r\n IFormFieldDto,\r\n | 'Required'\r\n | 'DependencyFieldId'\r\n | 'DependencyValue'\r\n | 'DependencyMultiple'\r\n | 'DependencyVisibility'\r\n | 'RequiredFieldToCompare'\r\n | 'RequiredValueToCompare'\r\n >,\r\n isAdmin: boolean,\r\n value: any,\r\n): boolean {\r\n let required = false;\r\n let requiredType =\r\n typeof formField.Required === 'number'\r\n ? RequiredTypes[formField.Required].toString()\r\n : formField.Required;\r\n switch (requiredType) {\r\n case 'Optional':\r\n required = false;\r\n break;\r\n case 'User':\r\n required = true;\r\n break;\r\n case 'Admin':\r\n required = isAdmin;\r\n break;\r\n case 'Conditional':\r\n if (\r\n formField.RequiredFieldToCompare !== null &&\r\n formField.RequiredValueToCompare !== null &&\r\n !isNullOrUndefined(value)\r\n ) {\r\n let comparedValue = getParentValue(value);\r\n return formField.RequiredValueToCompare === comparedValue;\r\n }\r\n break;\r\n default:\r\n required = false;\r\n break;\r\n }\r\n if (required && formField.DependencyFieldId !== null) {\r\n required = isDependencyVisible(formField, value);\r\n }\r\n return required;\r\n}\r\nexport function isVisible(\r\n formField: IFormFieldDto,\r\n isAdmin: boolean,\r\n visibleOnComletion?: () => boolean,\r\n) {\r\n let visible = true;\r\n switch (formField.DisplayType) {\r\n case DisplayTypes.AlwaysVisible:\r\n visible = true;\r\n break;\r\n case DisplayTypes.VisibleToAdminOnly:\r\n visible = isAdmin;\r\n break;\r\n case DisplayTypes.VisibleToUserOnDoneRequest:\r\n if (visibleOnComletion) {\r\n visible = visibleOnComletion();\r\n }\r\n break;\r\n default:\r\n visible = true;\r\n }\r\n return visible;\r\n}\r\nexport function isDependencyVisible(\r\n formField: Pick<\r\n IFormFieldDto,\r\n | 'DependencyFieldId'\r\n | 'DependencyValue'\r\n | 'DependencyMultiple'\r\n | 'DependencyVisibility'\r\n | 'RequiredFieldToCompare'\r\n | 'RequiredValueToCompare'\r\n >,\r\n value: any,\r\n): boolean {\r\n if (\r\n formField.DependencyFieldId === null ||\r\n formField.DependencyValue === null\r\n ) {\r\n return true;\r\n }\r\n let valueTocompare = formField.DependencyValue;\r\n let parentValue = getParentValue(value);\r\n if (formField.DependencyMultiple) {\r\n if (parentValue === null) {\r\n return !(formField.DependencyVisibility === true);\r\n }\r\n let vp = valueTocompare.split(',');\r\n let pv = parentValue.split(',');\r\n let comparedRes = vp.filter(f => pv.filter(vf => vf === f).length > 0);\r\n let valid = comparedRes.length === vp.length;\r\n if (valid) {\r\n return formField.DependencyVisibility === true;\r\n } else {\r\n return !(formField.DependencyVisibility === true);\r\n }\r\n } else {\r\n if (valueTocompare === parentValue) {\r\n return formField.DependencyVisibility === true;\r\n } else {\r\n return !(formField.DependencyVisibility === true);\r\n }\r\n }\r\n}\r\nexport function getParentValue(value: any): string | null {\r\n if (\r\n value === null ||\r\n value === undefined ||\r\n (Array.isArray(value) && value.length === 0)\r\n ) {\r\n return null;\r\n } else if (typeof value === 'string') {\r\n return value;\r\n } else if (Array.isArray(value)) {\r\n return (value as Entity[]).map(f => f.Id).join(',');\r\n } else if (value.hasOwnProperty('Id')) {\r\n return (value as Entity).Id;\r\n } else {\r\n return value.toString();\r\n }\r\n}\r\nexport const getFieldsVisibilities = (\r\n formFields: IFormFieldDto[],\r\n isAdmin: boolean,\r\n values: Record | undefined,\r\n visibleOnCompletion?: () => boolean,\r\n): Record | undefined => {\r\n if (values) {\r\n const visibilities: Record = {};\r\n formFields.forEach(field => {\r\n if (field.Active) {\r\n visibilities[field.Id] =\r\n isVisible(field, isAdmin, visibleOnCompletion) &&\r\n (field.DependencyFieldId === null ||\r\n (field.DependencyFieldId !== null &&\r\n isDependencyVisible(\r\n field,\r\n values[field.DependencyFieldId.toString()],\r\n )));\r\n }\r\n });\r\n return visibilities;\r\n }\r\n return undefined;\r\n};\r\nexport const useCustomFormSchema = (\r\n formFields: IFormFieldDto[],\r\n isAdmin: boolean,\r\n): Yup.SchemaOf => {\r\n const ForbiddenFileExtensions = useSelector(selectForbiddenFileExtensions);\r\n const UploadFileSizeLimit = useSelector(selectUploadFileSizeLimit);\r\n return React.useMemo(() => {\r\n const shape: ObjectShape = {};\r\n formFields.forEach(field => {\r\n if (field.Active) {\r\n shape[field.Id] = getFieldSchema(\r\n field,\r\n isAdmin,\r\n UploadFileSizeLimit,\r\n ForbiddenFileExtensions,\r\n );\r\n }\r\n });\r\n return Yup.object(shape);\r\n }, [ForbiddenFileExtensions, UploadFileSizeLimit, formFields, isAdmin]);\r\n};\r\nexport const getCustomFormInitialValues = (\r\n formFields: IFormFieldDto[],\r\n formValues?: IFormValueDto[],\r\n startQuiz?: boolean,\r\n): Record | undefined => {\r\n if (\r\n formValues === undefined &&\r\n (startQuiz === undefined || startQuiz === false)\r\n ) {\r\n return undefined;\r\n }\r\n const xx = formFields\r\n .map(formField => ({\r\n formField: formField,\r\n formValue: formValues?.find(\r\n formValue => formValue.FormFieldId === formField.Id,\r\n ),\r\n }))\r\n .map(item => ({\r\n formField: item.formField,\r\n value:\r\n item.formField.Type === 'File'\r\n ? item.formValue === null || item.formValue === undefined\r\n ? null\r\n : [item.formValue]\r\n : DeserializeValue(item.formField, item.formValue ?? null),\r\n }));\r\n\r\n const result =\r\n xx.reduce((initialValues, item) => {\r\n initialValues[item.formField.Id.toString()] = item.value ?? null;\r\n\r\n return initialValues;\r\n }, {}) ?? {};\r\n return result;\r\n};\r\nexport const orderFields = (item: IFormFieldDto, next: IFormFieldDto) => {\r\n return item.Index! - next.Index!;\r\n};\r\nexport const serializeValues = (\r\n formFields: IFormFieldDto[],\r\n value: Record,\r\n) => {\r\n const serialized: Record = {};\r\n let files: IFormFileValue[] = [];\r\n formFields.forEach(field => {\r\n if (field.Active) {\r\n serialized[field.Id] = SerializeValue(\r\n field,\r\n value[field.Id] as CustomFormValueType,\r\n );\r\n\r\n if (field.Type === 'File') {\r\n files = [...files, ...(value[field.Id] as IFormFileValue[])];\r\n }\r\n }\r\n });\r\n return { serialized, files };\r\n};\r\nexport const toFormValuesArray = (\r\n serialized: Record,\r\n formValues: IFormValueDto[],\r\n formFields: IFormFieldDto[],\r\n): IFormValueDto[] => {\r\n const ffs = RecordToFormValuesArray(formFields, formValues, serialized);\r\n const diff = differenceWith(\r\n ffs,\r\n formValues,\r\n (a, b) => a.FormFieldId === b.FormFieldId && a.Value === b.Value,\r\n ).filter(f => !(f.Value === null && f.Id === 0));\r\n return diff;\r\n};\r\nfunction RecordToFormValuesArray(\r\n formFields: IFormFieldDto[],\r\n formValues: IFormValueDto[],\r\n serialized: Record,\r\n): IFormValueDto[] {\r\n return formFields.map(formField => {\r\n const result = formValues.find(\r\n formValue => formValue.FormFieldId === formField.Id,\r\n ) ?? {\r\n Id: 0,\r\n FormFieldId: formField.Id,\r\n Value: null,\r\n DisplayValue: null,\r\n RequestId: null,\r\n ReservationId: null,\r\n ExperimentItemId: null,\r\n SourceValueId: null,\r\n Readonly: false,\r\n BudgetExperimentId: null,\r\n AlertId: null,\r\n AlertTypeId: null,\r\n ServiceGroupUserId: null,\r\n ServiceGroupId: null,\r\n CustomFormId: null,\r\n CustomFormName: null,\r\n };\r\n return { ...result, ...{ Value: serialized[formField.Id.toString()] } };\r\n });\r\n}\r\n\r\nexport function serializeCustomFormRowValue(\r\n value: IServiceRequestTableRowValueModel,\r\n): Pick {\r\n if (value == null) {\r\n return { Value: null, DisplayValue: null };\r\n } else if (typeof value === 'string') {\r\n return { Value: value, DisplayValue: null };\r\n } else if (typeof value === 'number') {\r\n return { Value: value.toString(), DisplayValue: null };\r\n } else if (typeof value === 'boolean') {\r\n return { Value: value.toString(), DisplayValue: null };\r\n } else if (value instanceof Date) {\r\n return {\r\n Value:\r\n dateUtils.tryFormatIso(value, {\r\n format: 'basic',\r\n representation: 'date',\r\n }) ?? null,\r\n DisplayValue: null,\r\n };\r\n } else {\r\n return {\r\n Value: value.Id,\r\n DisplayValue: value.Name,\r\n };\r\n }\r\n}\r\n\r\nexport function getCustomFormRowDisplay(\r\n value: IServiceRequestTableRowValueModel,\r\n) {\r\n if (value == null) {\r\n return '';\r\n } else if (typeof value === 'string') {\r\n return value;\r\n } else if (typeof value === 'number') {\r\n return value.toString();\r\n } else if (typeof value === 'boolean') {\r\n return value.toString();\r\n } else if (value instanceof Date) {\r\n return dateUtils.shortDateFormat(value);\r\n } else {\r\n return value.Name;\r\n }\r\n}\r\n\r\nexport function getCustomFormColumnSchema(\r\n props: Pick<\r\n IServiceRequestTableColumnModel,\r\n 'Label' | 'ColumnType' | 'isRequired' | 'Options' | 'SizeLimit'\r\n >,\r\n) {\r\n const baseSchema = getCustomFormColumnBaseSchema(props).label(props.Label);\r\n const result = props.isRequired ? baseSchema.required() : baseSchema;\r\n return result;\r\n}\r\nfunction getCustomFormColumnBaseSchema(\r\n props: Pick<\r\n IServiceRequestTableColumnModel,\r\n 'Label' | 'ColumnType' | 'Options' | 'SizeLimit'\r\n >,\r\n) {\r\n switch (props.ColumnType) {\r\n case 'CheckBox':\r\n return Yup.boolean().label(props.Label);\r\n case 'Date':\r\n return Yup.date().label(props.Label);\r\n case 'DropDownList':\r\n //TODO: validate selected option is present in the column options\r\n return Yup.mixed().label(props.Label);\r\n case 'UserSelection':\r\n return Yup.mixed>().label(props.Label);\r\n case 'Email':\r\n return Yup.string().label(props.Label).email();\r\n case 'Number':\r\n return Yup.number()\r\n .label(props.Label)\r\n .min(-props.SizeLimit)\r\n .max(props.SizeLimit);\r\n case 'PositiveDecimal':\r\n return Yup.number().label(props.Label).min(0).max(props.SizeLimit);\r\n case 'PositiveInteger':\r\n return Yup.number()\r\n .integer()\r\n .label(props.Label)\r\n .min(0)\r\n .max(props.SizeLimit);\r\n case 'ShortText':\r\n return Yup.string();\r\n case 'Serial':\r\n return Yup.string();\r\n\r\n default:\r\n assertExhaustive(props.ColumnType);\r\n }\r\n}\r\n","/**\r\n *\r\n * UserPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type UserUrl =\r\n | 'restricted'\r\n | 'full'\r\n | 'admin'\r\n | 'relevant'\r\n | 'budgetExperiments';\r\nexport interface UserPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n selectArray?: Array;\r\n urlType?: UserUrl;\r\n withGroupFilter?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}\r\n\r\nconst noExpandURlTypes: (UserUrl | undefined)[] = ['relevant'];\r\n\r\nconst url = '/api/odata/v4/UserFilter';\r\nconst fullActiveUrl = '/api/odata/v4/UserFilter/GetUserSelections';\r\nconst adminsUrl = '/api/odata/v4/UserFilter/GetAdminUsers';\r\nexport const relevantUrl = '/api/odata/v4/UserFilter/GetRelevantUsers';\r\nconst budgetExperimentsUrl =\r\n '/api/odata/v4/UserFilter/GetBudgetExperimentsUsers';\r\nexport const initUserData = (id: string, urlType?: UserUrl) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n urlType === 'full'\r\n ? fullActiveUrl\r\n : urlType === 'admin'\r\n ? adminsUrl\r\n : urlType === 'budgetExperiments'\r\n ? budgetExperimentsUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport function UserPicker(props: UserPickerProps) {\r\n const { t } = useTranslation();\r\n const servicegroups = useSelector(selectGlobalServiceGroupFilter);\r\n const serviceGroups = props.serviceGroups ?? servicegroups;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const loadData = React.useCallback(\r\n getAutoCompleteLoadDataFn({\r\n url:\r\n props.urlType === 'full'\r\n ? fullActiveUrl\r\n : props.urlType === 'admin'\r\n ? adminsUrl\r\n : props.urlType === 'relevant'\r\n ? relevantUrl\r\n : props.urlType === 'budgetExperiments'\r\n ? budgetExperimentsUrl\r\n : url,\r\n predicates: props.predicates,\r\n globalServiceGroupFilter:\r\n !props.withGroupFilter || !serviceGroups?.length\r\n ? undefined\r\n : [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n serviceGroups,\r\n 'Id',\r\n ),\r\n ],\r\n select: props.selectArray ?? [\r\n 'Id',\r\n 'Name',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'UserGroups',\r\n 'Budgets',\r\n 'IsAdminPanel',\r\n 'IsEquipmentAdmin',\r\n 'IsGroupAdmin',\r\n 'IsLabTech',\r\n 'ServiceGroupIds',\r\n 'Services',\r\n 'CustomRoles',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'UserRoles',\r\n 'StaffEquipmentId',\r\n 'DefaultBudgetId',\r\n ],\r\n expand: noExpandURlTypes.includes(props.urlType)\r\n ? ''\r\n : 'Services,UserGroups',\r\n }),\r\n [serviceGroups, props.withGroupFilter],\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport function ServicesFilter(\r\n services: IServiceTypeFilterDto[],\r\n budgetExperimentEnabled: boolean,\r\n userGroupId?: string,\r\n budgetId?: number,\r\n defaultBudgetEnabled?: boolean,\r\n isDefaultSelected?: boolean,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (userGroupId !== undefined) {\r\n predicates.push(\r\n `(${new Condition(\r\n 'UserGroups',\r\n ODataOperators.Any,\r\n userGroupId,\r\n 'Id',\r\n )} or ${new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n userGroupId,\r\n )})`,\r\n );\r\n }\r\n if (budgetId !== undefined && !isDefaultSelected) {\r\n if (defaultBudgetEnabled) {\r\n predicates.push(\r\n `(${new Condition(\r\n 'Budgets',\r\n ODataOperators.Any,\r\n budgetId,\r\n ).toString()} or ${new Condition(\r\n 'DefaultBudgetId',\r\n ODataOperators.Equals,\r\n budgetId,\r\n ).toString()})`,\r\n );\r\n } else {\r\n predicates.push(\r\n new Condition('Budgets', ODataOperators.Any, budgetId),\r\n );\r\n }\r\n }\r\n if (\r\n services.length > 0 &&\r\n budgetExperimentEnabled &&\r\n !services.some(f => f.HideProject)\r\n ) {\r\n //TODO: add filter by selected services\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\nexport function AdminServicesFilter(\r\n serviceItems: IServiceFilterDto[],\r\n): (string | Condition)[] {\r\n if (!serviceItems.length || serviceItems.length < 1) {\r\n return [];\r\n }\r\n let groups = [...new Set(serviceItems.map(f => f.ServiceGroupId))];\r\n let groupIds = groups.map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n let services = serviceItems\r\n .map(f => {\r\n return {\r\n ServiceId: f.Id ?? 0,\r\n ServiceTypeId: f.ServiceTypeId ?? 0,\r\n };\r\n })\r\n .filter(f => f.ServiceId !== 0 && f.ServiceTypeId !== 0);\r\n let groupsF = `(${new Condition(\r\n 'ServiceGroupIds',\r\n ODataOperators.AnyIn,\r\n groupIds,\r\n ).toString()})`;\r\n // let groupsF = `(${groups\r\n // .map(a => new Condition('ServiceGroupIds', ODataOperators.AnyIn, groupIds).toString())\r\n // .join(' and ')})`;\r\n let servF = `(Services/any(s: s/Id in ${quoteODataValue(\r\n services.map(f => f.ServiceId),\r\n )}))`;\r\n\r\n return [`${groupsF} or ${servF}`];\r\n}\r\nexport const initAssigneeAdminUsers = (\r\n type: IWorkOrderTypeDto,\r\n serviceItems: IServiceFilterDto[],\r\n) => {\r\n const predicates: (string | Condition)[] = [];\r\n if (type.AssignedToCoreAdmin) {\r\n predicates.push(\r\n new Condition(\r\n 'IsGroupAdmin',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n if (type.AssignedToInstrumentAdmin) {\r\n predicates.push(\r\n new Condition(\r\n 'IsEquipmentAdmin',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n if (type.AssignedToLabTech) {\r\n predicates.push(\r\n new Condition('IsLabTech', ODataOperators.Equals, true),\r\n );\r\n }\r\n if (serviceItems.length < 1 || predicates.length < 1) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: `${\r\n AdminServicesFilter(serviceItems)[0]\r\n } and (${predicates.map(f => f.toString()).join(' or ')})`,\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n","/**\r\n * Represents Date with representation info - e.g. representation: 'complete' | 'date' | 'time'\r\n */\r\nexport class CustomDate extends Date {\r\n representation: DateType = 'date';\r\n constructor(value?: number | string | Date, type?: DateType) {\r\n super(value ?? new Date());\r\n this.representation = type ?? 'complete';\r\n }\r\n}\r\n\r\nexport type DateType = 'complete' | 'date' | 'time';\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { useState, useMemo, useEffect, useRef } from 'react';\r\n\r\nexport type PromiseStatus = `pending` | `resolved` | `rejected`;\r\nexport type CancelPromise = (message?: string) => void;\r\nexport type ResetPromiseState = (\r\n keys?: keyof PromiseState | Array>,\r\n) => void;\r\n\r\nexport interface PromiseState {\r\n status?: PromiseStatus;\r\n promise?: Promise;\r\n value?: T;\r\n error?: Error;\r\n cancel?: CancelPromise;\r\n}\r\n\r\nexport type PromiseStateWithReset = PromiseState & {\r\n reset: ResetPromiseState;\r\n};\r\n\r\n/**\r\n * A hook which accepts an asynchronous function (i.e., a function which returns a promise).\r\n *\r\n * Returns a new asynchronous function wrapping the original to be called as necessary,\r\n * along with the state of the promise as `status`, `promise`, `value`, `error`, `cancel()`,\r\n * and a `reset()` method to reset the state.\r\n *\r\n * Pairs well with the {@link hooks.useAsyncExtendedState | `useAsyncExtendedState`} hook.\r\n *\r\n * Example:\r\n * ```ts\r\n * interface State {\r\n * foo: string\r\n * bar: string\r\n * }\r\n *\r\n * const [ state, setState, extendState ] = useAsyncExtendedState({\r\n * foo: 'foo',\r\n * bar: 'bar'\r\n * })\r\n *\r\n * const read = (id: string) => API.client.get>(`things/${id}`).then(response => {\r\n * return response.data\r\n * })\r\n *\r\n * const [ readThingRequest, readThing ] = usePromise(read)\r\n *\r\n * const isPending = readThingRequest.status === 'pending'\r\n *\r\n * return (\r\n * <>\r\n *
\r\n * foo: {state.foo}\r\n *
\r\n *\r\n *
\r\n * bar: {state.bar}\r\n *
\r\n *\r\n * extendState(readThing('someId'))} disabled={isPending}>\r\n * \r\n * {isPending\r\n * ? 'Reading thing...'\r\n * : 'Read thing'\r\n * }\r\n * \r\n * \r\n *\r\n * \r\n * {readThingRequest.error}\r\n * \r\n * \r\n * )\r\n * ```\r\n */\r\nexport const usePromise = any>(\r\n asyncFunction: T,\r\n initialState?: PromiseState>,\r\n): [\r\n PromiseStateWithReset>,\r\n (...asyncFuncArgs: Parameters) => ReturnType,\r\n] => {\r\n const [state, setState] = useState>>(\r\n initialState || {},\r\n );\r\n const isCancelled = useRef(false);\r\n const isUnmounted = useRef(false);\r\n\r\n const callAsyncFunction = useMemo(\r\n () => (...args: Parameters): ReturnType => {\r\n const promise = asyncFunction(...args);\r\n const cancel: CancelPromise = message => {\r\n isCancelled.current = true;\r\n\r\n if (!isUnmounted.current) {\r\n setState(({ value }) => ({\r\n status: `rejected`,\r\n value,\r\n error: message ? new Error(message) : undefined,\r\n }));\r\n }\r\n };\r\n\r\n isCancelled.current = false;\r\n\r\n if (promise instanceof Promise) {\r\n return new Promise(resolve => {\r\n const fulfillPromise = async () => {\r\n try {\r\n const value: ReturnType = await promise;\r\n\r\n if (!isCancelled.current && !isUnmounted.current) {\r\n setState({ status: `resolved`, value });\r\n resolve(value);\r\n }\r\n } catch (error) {\r\n if (!isCancelled.current && !isUnmounted.current) {\r\n setState(({ value }) => ({\r\n status: `rejected`,\r\n value,\r\n error:\r\n error instanceof Error ? error : new Error(error as string),\r\n }));\r\n }\r\n }\r\n };\r\n\r\n setState(({ value }) => ({\r\n status: `pending`,\r\n value,\r\n promise,\r\n cancel,\r\n }));\r\n fulfillPromise();\r\n }) as ReturnType;\r\n } else {\r\n setState({ status: `resolved`, value: promise });\r\n return promise;\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [asyncFunction],\r\n );\r\n\r\n const reset: ResetPromiseState = useMemo(\r\n () => keys =>\r\n setState(state => {\r\n if (!keys) {\r\n return {};\r\n }\r\n\r\n const nextState = { ...state };\r\n\r\n if (Array.isArray(keys)) {\r\n for (const key of keys) {\r\n delete nextState[key];\r\n }\r\n } else {\r\n delete nextState[keys];\r\n }\r\n\r\n return nextState;\r\n }),\r\n [],\r\n );\r\n\r\n const stateWithReset: PromiseStateWithReset> = useMemo(\r\n () => ({ ...state, reset }),\r\n [state, reset],\r\n );\r\n\r\n useEffect(() => {\r\n return () => {\r\n isCancelled.current = true;\r\n isUnmounted.current = true;\r\n };\r\n }, []);\r\n\r\n return [stateWithReset, callAsyncFunction];\r\n};\r\n","import {\r\n getPeriodTypesEntity,\r\n PeriodTypes,\r\n PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { IPresetDatesRange } from './IPresetDatesRange';\r\nimport { DatesRange } from './DatesRange';\r\nimport { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport class PresetDatesRange extends DatesRange implements IPresetDatesRange {\r\n constructor(t?: IPresetDatesRange) {\r\n super(t as IPresetDatesRange);\r\n this.type = (t as IPresetDatesRange)?.type ?? {\r\n Id: 'CustomDate',\r\n Name: `${translations.CustomDate}`,\r\n type: 'CustomDate',\r\n };\r\n }\r\n type: PeriodTypesEntity = {\r\n Id: 'CustomDate',\r\n Name: `${translations.CustomDate}`,\r\n };\r\n\r\n GetPresetDatesRangeDisplayString(t: TFunction): string {\r\n switch (this.type?.Id) {\r\n default:\r\n return t(this.type.Id);\r\n case 'CustomDate':\r\n return `${\r\n this.start === null\r\n ? t(translations.NA)\r\n : dateUtils.shortDateTimeFormat(this.start)\r\n } - ${\r\n this.end === null\r\n ? t(translations.NA)\r\n : dateUtils.shortDateTimeFormat(this.end)\r\n }`;\r\n }\r\n }\r\n static fromPreset(t: PeriodTypesEntity) {\r\n return new PresetDatesRange({\r\n type: t,\r\n ...DatesRange.fromPreset(t, null, null),\r\n });\r\n }\r\n static fromInitPreset(\r\n t: PeriodTypesEntity,\r\n start: Date | null,\r\n end: Date | null,\r\n ) {\r\n return new PresetDatesRange({\r\n type: t,\r\n ...DatesRange.fromPreset(t, start, end),\r\n });\r\n }\r\n static fromType(t: PeriodTypes, st: Date | null, et: Date | null) {\r\n const x = getPeriodTypesEntity(t);\r\n const y = DatesRange.fromPreset(x as PeriodTypesEntity, st, et);\r\n const z: IPresetDatesRange = {\r\n type: x,\r\n start: y.start,\r\n end: y.end,\r\n };\r\n return new PresetDatesRange(z);\r\n }\r\n\r\n static Custom(\r\n start: Date | undefined | null,\r\n end: Date | undefined | null,\r\n ): PresetDatesRange | undefined {\r\n return new PresetDatesRange({\r\n type: getPeriodTypesEntity('CustomDate'),\r\n start: start ?? null,\r\n end: end ?? null,\r\n });\r\n }\r\n}\r\n","import {\r\n call,\r\n put,\r\n select,\r\n debounce,\r\n takeLeading,\r\n takeLatest,\r\n takeEvery,\r\n} from 'redux-saga/effects';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { requestSamplesActions as actions } from '.';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n InsertServiceRequestMilestoneChargeAction,\r\n ILoadServiceRequestMilestonesAction,\r\n IRequestMilestoneManualChargeModel,\r\n ISample,\r\n IServiceRequestPatchAction,\r\n IServiceRequestUpdateBudgetAction,\r\n IServiceRequestUpdateStatusAction,\r\n UpdateServiceRequestMilestoneChargeAction,\r\n ServiceRequestMilestoneInsertModel,\r\n UpdateServiceRequestRowValueAction,\r\n IServiceRequestTableRowModel,\r\n IRequestDetailsModel,\r\n IServiceRequestUpdatePurchaseOrderAction,\r\n IServiceRequestUpdateFundingTypeAction,\r\n IServiceRequestUpdateExternalInternalNumberAction,\r\n IServiceRequestUpdateGradientAction,\r\n IServiceRequestUpdateOverheadAction,\r\n ILoadServiceRequestRowsAction,\r\n} from './types';\r\nimport { TableState } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n selectRequestDetailsData,\r\n selectSamplesTableState,\r\n selectServiceRequestCustomFormColumns,\r\n selectServiceRequestCustomFormFields,\r\n selectServiceRequestId,\r\n} from './selectors';\r\nimport { AxiosError, AxiosResponse } from 'axios';\r\nimport fileDownload from 'js-file-download';\r\nimport { deleteSamples, IDeleteSamplesResult } from 'api/SamplesApi';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { Entity } from 'types/common';\r\nimport { takeLatestByKey } from 'utils/redux-saga';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalSettingBool,\r\n selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport {\r\n ServiceRequestMilestoneStatuses,\r\n ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport {\r\n IOpenSidePanelPayload,\r\n layoutActions,\r\n} from 'app/Layout/FrontendLayout/slice';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectSidePanelState } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n RenderPageType,\r\n SidePanelState,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { push } from 'connected-react-router';\r\nimport { GetServiceRequestDetailsPath } from './path';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { getLogger } from 'loglevel';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport {\r\n prepareServiceRequestRowModel,\r\n serviceRequestModelToDto,\r\n} from './prepareServiceRequestRowModel';\r\nimport { omit } from 'lodash';\r\nimport { getCustomFormInitialValues } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\n\r\nconst log = getLogger('ServiceRequestDetails');\r\n\r\nfunction* doInit(action: PayloadAction) {\r\n try {\r\n const statuses: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/ServiceRequestStatusFilter',\r\n );\r\n yield put(actions.initServiceRequestStatuses_Success(statuses.value));\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n yield* doLoadServiceRequestRowStatuses();\r\n}\r\nfunction* doLoadRequestDetails(action: PayloadAction) {\r\n try {\r\n const SampleManagementTablesEnabled = yield select(state =>\r\n selectKnownModule(state, KnownModules.SampleManagementTables),\r\n );\r\n const requestDetails: IServiceRequestDto = yield call(\r\n httpClient.get,\r\n `api/odata/v4/ServiceRequests/${action.payload}`,\r\n {\r\n $expand: [\r\n 'Status',\r\n 'Service($expand=ServiceGroup,CustomForm)',\r\n 'CreatedBy($select=Id,Name)',\r\n 'CreatedFor($expand=UserGroup)',\r\n 'UpdatedBy($select=Id,Name)',\r\n 'SubmittedBy($select=Id,Name)',\r\n 'UserGroup($select=Id,Name)',\r\n 'Budget($select=Id,Name,FundingTypeId,PurchaseOrderOptionId)',\r\n 'UnitType($select=Id,Name)',\r\n 'Gradient($select=Id,Name,ServiceGroupId,EstimatedRuntimeMinutes)',\r\n ].join(','),\r\n },\r\n );\r\n yield put(\r\n actions.loadRequestDetails_Success(\r\n omit(requestDetails, 'Rows', 'FormValues'),\r\n ),\r\n );\r\n\r\n if (\r\n requestDetails.Service.CustomForm.FormFields.some(\r\n f => f.Active && f.IsColumn === false,\r\n )\r\n ) {\r\n yield put(actions.loadFormValues(action.payload));\r\n }\r\n\r\n if (\r\n requestDetails.Service.CustomForm.FormFields.some(\r\n f => f.Active && f.IsColumn === true,\r\n ) ||\r\n SampleManagementTablesEnabled\r\n ) {\r\n yield* doLoadServiceRequestRows({\r\n type: action.type,\r\n payload: {\r\n serviceRequestId: requestDetails.Id,\r\n state: {\r\n pageIndex: 0,\r\n pageSize: 10,\r\n },\r\n },\r\n });\r\n }\r\n\r\n // trigger loading the milestones if the request milestones are enabled both in the global settings and on the service settings\r\n const requestMilestones: boolean = yield select(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.RequestMilestones),\r\n );\r\n if (requestDetails.Service.MilestonesAddonsType !== 'NA') {\r\n if (requestMilestones === true) {\r\n yield put(actions.loadMilestones({ Id: action.payload }));\r\n }\r\n }\r\n if (requestDetails.InvoiceId !== null) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: i18next.t(translations.requestblockedbyinvoice),\r\n }),\r\n );\r\n }\r\n } catch (error) {\r\n log.error(error);\r\n yield put(\r\n actions.loadRequestDetails_Error({\r\n response: {\r\n status: (error as AxiosError)?.response?.status,\r\n },\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doRefreshRequestDetails(action: PayloadAction) {\r\n try {\r\n const requestDetails = yield call(\r\n httpClient.get,\r\n `api/odata/v4/ServiceRequests/${action.payload}`,\r\n {\r\n $expand: [\r\n 'Status',\r\n 'Service($expand=ServiceGroup,CustomForm)',\r\n 'CreatedBy($select=Id,Name)',\r\n 'CreatedFor($expand=UserGroup)',\r\n 'UpdatedBy($select=Id,Name)',\r\n 'SubmittedBy($select=Id,Name)',\r\n 'UserGroup($select=Id,Name)',\r\n 'Budget($select=Id,Name,FundingTypeId,PurchaseOrderOptionId)',\r\n 'UnitType($select=Id,Name)',\r\n 'Gradient($select=Id,Name,ServiceGroupId,EstimatedRuntimeMinutes)',\r\n ].join(','),\r\n },\r\n );\r\n yield put(actions.refreshRequestDetails_Success(requestDetails));\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\nfunction* doLoadFormValues(action: PayloadAction) {\r\n const url = `api/odata/v4/ServiceRequests(${action.payload})/FormValues`;\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n url,\r\n );\r\n\r\n const formFields = yield select(selectServiceRequestCustomFormFields);\r\n const valuesObject = getCustomFormInitialValues(formFields, data.value);\r\n if (valuesObject !== undefined) {\r\n yield put(actions.loadFormValues_Success(valuesObject));\r\n }\r\n}\r\nfunction* doSaveFormValue(\r\n action: PayloadAction<\r\n Pick &\r\n Pick & { Value: any }\r\n >,\r\n) {\r\n if (action.payload.RequestId === null) {\r\n log.warn('doSaveFormValue: requestId is empty');\r\n }\r\n try {\r\n if (action.payload.Type === 'File' && action.payload.Value?.length === 0) {\r\n action.payload.Value = null;\r\n }\r\n if (action.payload.Type === 'File' && action.payload.Value !== null) {\r\n const formData = new FormData();\r\n formData.append(\r\n 'file',\r\n action.payload.Value[0].PostedFile,\r\n action.payload.Value[0].DisplayName,\r\n );\r\n yield call(\r\n httpClient.post,\r\n `/api/requests/${action.payload.RequestId}/formvalues/${action.payload.FormFieldId}/file`,\r\n formData,\r\n {\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n Accept: 'application/json',\r\n },\r\n },\r\n );\r\n } else {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.RequestId})/FormValues`;\r\n const payload = action.payload;\r\n yield call(httpClient.post, url, omit(payload, 'Type'));\r\n }\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\nfunction* doLoadSamples(\r\n action: PayloadAction<\r\n Partial<\r\n Partial<\r\n TableState & {\r\n customFilters: IFilterSettings[];\r\n searchColumns: string[];\r\n }\r\n >\r\n >\r\n >,\r\n) {\r\n // todo: switch to odata v4: const url = `/api/odata/v4/ServiceRequests(${id})`;\r\n\r\n const serviceRequestId = yield select(selectServiceRequestId);\r\n const url = '/api/odata/v4/samples';\r\n\r\n const currentTableState = yield select(selectSamplesTableState);\r\n const filters = [\r\n '(not SourceRunIds/any())',\r\n new Condition(\r\n 'ServiceRequestId',\r\n ODataOperators.Equals,\r\n serviceRequestId,\r\n ),\r\n ];\r\n const params = {\r\n $count: true,\r\n $top: currentTableState.pageSize,\r\n $skip:\r\n (currentTableState.pageIndex ?? 1) * (currentTableState.pageSize ?? 5),\r\n $orderby:\r\n currentTableState.sortBy\r\n ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n .join(',') || undefined,\r\n\r\n $filter: TableFilterBuilder(\r\n currentTableState.customFilters,\r\n currentTableState.globalFilter,\r\n undefined,\r\n currentTableState.searchColumns,\r\n filters,\r\n ),\r\n };\r\n try {\r\n const data = yield call(httpClient.get, url, params);\r\n yield put(actions.loadSamples_Success(data));\r\n } catch (error) {\r\n yield put(\r\n actions.loadSamples_Error(i18next.t(translations.AnErrorOccurred)),\r\n );\r\n const forbidden = (error as AxiosError)?.response?.status === 403;\r\n if (forbidden) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.Forbidden),\r\n }),\r\n );\r\n }\r\n }\r\n}\r\nfunction* doLoadServiceRequestRows(action: ILoadServiceRequestRowsAction) {\r\n const url = `api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows`;\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n url,\r\n //TODO: bring back server side paging?\r\n //params,\r\n );\r\n const columns = yield select(selectServiceRequestCustomFormColumns);\r\n const model = prepareServiceRequestRowModel(data.value, columns);\r\n yield put(actions.loadServiceRequestRows_Success(model ?? []));\r\n}\r\nfunction* doLoadMilestones(action: ILoadServiceRequestMilestonesAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Milestones`;\r\n const params = {\r\n $expand: [\r\n 'Assignees($select=Id,Name)',\r\n `ServiceRequestMilestoneCharges($expand=${[\r\n 'Service($select=Id,Name,Rate;$expand=UnitType($select=Id,Name))',\r\n 'UpdatedBy($select=Id,Name)',\r\n 'UnitType($select=Id,Name)',\r\n ].join(',')})`,\r\n ].join(','),\r\n };\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n url,\r\n params,\r\n );\r\n yield put(actions.loadMilestones_Success(data.value));\r\n}\r\nfunction* doCreateSample(action: PayloadAction) {\r\n try {\r\n const url = `/api/odata/v4/samples`;\r\n const response = yield call(httpClient.post, url, action.payload);\r\n yield put(actions.createSample_Success(response));\r\n } catch (error) {\r\n log.error('doCreateSample', error);\r\n yield put(actions.createSample_Error());\r\n const forbidden = (error as AxiosError)?.response?.status === 403;\r\n if (forbidden) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.Forbidden),\r\n }),\r\n );\r\n }\r\n }\r\n}\r\nfunction* doUpdateServiceRequestSampleField(\r\n action: PayloadAction>,\r\n) {\r\n const url = `/api/odata/v4/samples(${action.payload.Id})`;\r\n const payload: Omit, 'Id'> = action.payload;\r\n try {\r\n yield call(httpClient.patch, url, payload);\r\n yield put(actions.updateServiceRequestSampleField_Success());\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateServiceRequestSampleField_Error());\r\n const forbidden = (error as AxiosError)?.response?.status === 403;\r\n if (forbidden) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.Forbidden),\r\n }),\r\n );\r\n return;\r\n }\r\n const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n ?.message;\r\n if (msg !== undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplesListPage.saga.updateField',\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n yield put(actions.updateServiceRequestSampleField_Error());\r\n }\r\n}\r\n\r\nfunction* doUpdateServiceRequestRowValue(\r\n action: UpdateServiceRequestRowValueAction,\r\n) {\r\n // TODO: migrate value updates to the new api\r\n // const url = `/api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows(${action.payload.serviceRequestValue.RowId})/Values`;\r\n const url = `/api/requests/${action.payload.serviceRequestId}/tabledata/${action.payload.serviceRequestValue.RowId}/${action.payload.serviceRequestValue.ColumnId}`;\r\n const payload =\r\n action.payload.serviceRequestValue.DisplayValue === null\r\n ? action.payload.serviceRequestValue.Value\r\n : {\r\n id: action.payload.serviceRequestValue.Value,\r\n text: action.payload.serviceRequestValue.DisplayValue,\r\n };\r\n\r\n try {\r\n yield call(httpClient.post, url, JSON.stringify(payload), {\r\n headers: { 'Content-Type': 'application/json' },\r\n });\r\n yield put(actions.updateServiceRequestRowValue_Success());\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateServiceRequestRowValue_Error());\r\n const forbidden = (error as AxiosError)?.response?.status === 403;\r\n if (forbidden) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.Forbidden),\r\n }),\r\n );\r\n return;\r\n }\r\n const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n ?.message;\r\n if (msg !== undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplesListPage.saga.updateField',\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n yield put(actions.updateServiceRequestSampleField_Error());\r\n }\r\n}\r\n\r\nfunction* doImport(action: PayloadAction) {\r\n const file = action.payload.file;\r\n const serviceRequestId = action.payload.serviceRequestId;\r\n const url = `/api/SamplesImport/import?serviceRequestId=${serviceRequestId}`;\r\n try {\r\n const response = yield call(httpClient.uploadFile, url, file);\r\n const allRowsImportedSuccessfully = response.data?.size === 0;\r\n if (allRowsImportedSuccessfully) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.AllRowsImportedSuccessfully),\r\n }),\r\n );\r\n } else {\r\n yield call(fileDownload, response.data, 'import-result.xlsx');\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: i18next.t(\r\n translations.OneOrMoreErrorOccurredDuringImportPleaseReviewOutputFile,\r\n ),\r\n }),\r\n );\r\n }\r\n yield put(actions.import_Success());\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.import_Error());\r\n const forbidden = (error as AxiosError)?.response?.status === 403;\r\n if (forbidden) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.Forbidden),\r\n }),\r\n );\r\n return;\r\n }\r\n }\r\n}\r\n\r\nfunction* doDeleteSamples(action: PayloadAction) {\r\n let r: IDeleteSamplesResult = yield call(deleteSamples, action.payload);\r\n\r\n for (const error of r.errors) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: error.message,\r\n }),\r\n );\r\n }\r\n if (r.successCount > 0) {\r\n // reload table data\r\n const tableState = yield select(selectSamplesTableState);\r\n yield put(actions.loadSamples(tableState));\r\n\r\n // post success notification of deleted records\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.XRecordsWereBeDeleted, {\r\n x: r.successCount,\r\n }),\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doPatchRequestDetails(action: IServiceRequestPatchAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})`;\r\n const payload = action.payload;\r\n try {\r\n const response = yield call(httpClient.patch, url, payload);\r\n yield put(actions.patch_Success({ ...response, ...action.payload }));\r\n //yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.patch_Error(action.payload));\r\n const axiosError = error as AxiosError;\r\n const reason =\r\n axiosError?.response?.data?.error?.innererror?.message ??\r\n axiosError?.response?.data?.error?.message ??\r\n axiosError?.response?.data?.statusText ??\r\n i18next.t(translations.NA);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: reason,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doUpdateStatus(action: IServiceRequestUpdateStatusAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Status`;\r\n const payload = action.payload;\r\n try {\r\n const response = yield call(httpClient.post, url, {\r\n ...payload.Status,\r\n ...{ Reason: action.payload.Reason },\r\n });\r\n yield put(\r\n actions.updateStatus_Success({\r\n ...response,\r\n // old API returns Status in old format, override it here with IServiceRequestStatusDto\r\n Status: action.payload.Status,\r\n }),\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.StatusUpdatedTo, action.payload.Status),\r\n variant: 'success',\r\n }),\r\n );\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateStatus_Error(action.payload));\r\n const axiosError = error as AxiosError;\r\n const reason =\r\n axiosError?.response?.data?.error?.innererror?.message ??\r\n axiosError?.response?.data?.error?.message ??\r\n axiosError?.response?.data?.statusText ??\r\n i18next.t(translations.NA);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.ServiceRequestStatusUpdate_Error, {\r\n reason: reason,\r\n }),\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doUpdateServiceRequestRowStatus(\r\n action: PayloadAction<{\r\n serviceRequestId: number;\r\n serviceRequestRowId: number;\r\n status: IServiceRequestRowStatusDto | null;\r\n }>,\r\n) {\r\n try {\r\n yield call(\r\n httpClient.post,\r\n `api/requests/${action.payload.serviceRequestId}/tabledata/rows/${action.payload.serviceRequestRowId}/Status`,\r\n JSON.stringify(action.payload.status?.Id),\r\n {\r\n headers: { 'Content-Type': 'application/json' },\r\n },\r\n );\r\n yield put(actions.updateServiceRequestRowStatus_Success(action.payload));\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\n\r\nfunction* doUpdateBudget(action: IServiceRequestUpdateBudgetAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Budget`;\r\n const payload = action.payload;\r\n try {\r\n const response: IServiceRequestDto = yield call(\r\n httpClient.post,\r\n url,\r\n payload.Budget,\r\n );\r\n yield put(actions.updateBudget_Success(response));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.BudgetUpdatedTo, {\r\n Name: action.payload.Budget.Name,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateBudget_Error(action.payload));\r\n }\r\n}\r\nfunction* doUpdateGradient(action: IServiceRequestUpdateGradientAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Gradient`;\r\n const payload = action.payload;\r\n try {\r\n yield call(httpClient.post, url, payload.Gradient);\r\n yield put(actions.updateGradient_Success(action.payload));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.GradientUpdatedTo, {\r\n Name: action.payload.Gradient?.Name,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n //yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateGradient_Error(action.payload));\r\n }\r\n}\r\nfunction* doUpdateOverheadMinutes(action: IServiceRequestUpdateOverheadAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/OverheadMinutes`;\r\n const payload = action.payload;\r\n try {\r\n const response: IServiceRequestDto = yield call(\r\n httpClient.post,\r\n url,\r\n payload.OverheadMinutes,\r\n );\r\n yield put(actions.updateOverheadMinutes_Success(response));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.OverheadTimeUpdatedTo, {\r\n Name: action.payload.OverheadMinutes,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateOverheadMinutes_Error(action.payload));\r\n }\r\n}\r\nfunction* doUpdatePurchaseOrder(\r\n action: IServiceRequestUpdatePurchaseOrderAction,\r\n) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/PurchaseOrder`;\r\n const payload = action.payload;\r\n try {\r\n const response: IServiceRequestDto = yield call(\r\n httpClient.post,\r\n url,\r\n payload.PurchaseOrder,\r\n );\r\n yield put(actions.updatePurchaseOrder_Success(response));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.PurchaseOrderUpdatedTo, {\r\n Name: action.payload.PurchaseOrder,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updatePurchaseOrder_Error(action.payload));\r\n }\r\n}\r\n\r\nfunction* doUpdateExternalInternalNumber(\r\n action: IServiceRequestUpdateExternalInternalNumberAction,\r\n) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/ExternalInternalNumber`;\r\n const payload = action.payload;\r\n try {\r\n const response: IServiceRequestDto = yield call(\r\n httpClient.post,\r\n url,\r\n payload.ExternalInternalNumber,\r\n );\r\n yield put(actions.updateExternalInternalNumber_Success(response));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.ExternalInternalNumberUpdatedTo, {\r\n Name: action.payload.ExternalInternalNumber,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateExternalInternalNumber_Error(action.payload));\r\n }\r\n}\r\n\r\nfunction* doUpdateFundingType(action: IServiceRequestUpdateFundingTypeAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/FundingType`;\r\n const payload = action.payload;\r\n try {\r\n const response: IServiceRequestDto = yield call(\r\n httpClient.post,\r\n url,\r\n payload.FundingTypeId,\r\n );\r\n yield put(actions.updateFundingType_Success(response));\r\n if (action.payload.FundingTypeId !== null) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.FundingTypeUpdatedTo, {\r\n Name: getSingleInvoiceFundingType(action.payload.FundingTypeId)\r\n .Name,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n console.debug(payload);\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateFundingType_Error(action.payload));\r\n }\r\n}\r\nfunction* doSubmit(action: PayloadAction) {\r\n const url = `api/ServiceRequests/${action.payload.Id}/SubmitStep`;\r\n try {\r\n yield call(httpClient.post, url);\r\n yield put(actions.submitStep_success(action.payload));\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.StepHasBeenSubmitted),\r\n variant: 'success',\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n const errorMessages = getErrorMessages(error);\r\n yield* putErrorMessages(errorMessages);\r\n yield put(actions.submitStep_Error());\r\n }\r\n}\r\n\r\nfunction* putErrorMessages(errorMessages: Array | undefined) {\r\n if (errorMessages !== undefined) {\r\n for (const message of errorMessages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: message,\r\n }),\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction getErrorMessages(error: unknown): Array | undefined {\r\n const axiosError = error as AxiosError;\r\n const isAxiosError = axiosError.isAxiosError;\r\n if (isAxiosError) {\r\n const dataErrorMessages = axiosError.response?.data?.ErrorMessages;\r\n if (\r\n Array.isArray(dataErrorMessages) &&\r\n dataErrorMessages.length > 0 &&\r\n typeof dataErrorMessages[0] === 'string'\r\n ) {\r\n return dataErrorMessages as Array;\r\n }\r\n }\r\n}\r\n\r\nfunction* doCancelServiceRequest(action: IServiceRequestUpdateStatusAction) {\r\n const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Status`;\r\n const payload = action.payload;\r\n try {\r\n yield call(httpClient.post, url, {\r\n ...payload.Status,\r\n ...{ Reason: action.payload.Reason },\r\n });\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.RequestCancelled),\r\n }),\r\n );\r\n yield put(actions.refreshRequestDetails(action.payload.Id));\r\n } catch (error) {\r\n log.error(error);\r\n //yield put(actions.updateStatus_Error(action.payload));\r\n const axiosError = error as AxiosError;\r\n const reason =\r\n axiosError?.response?.data?.error?.innererror?.message ??\r\n axiosError?.response?.data?.error?.message ??\r\n axiosError?.response?.data?.statusText ??\r\n i18next.t(translations.NA);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.ServiceRequestStatusUpdate_Error, {\r\n reason: reason,\r\n }),\r\n }),\r\n );\r\n }\r\n}\r\n\r\nfunction* doInsertMilestoneCharge(\r\n action: InsertServiceRequestMilestoneChargeAction,\r\n) {\r\n const serviceRequest: IServiceRequestDto = yield select(\r\n selectRequestDetailsData,\r\n );\r\n if (serviceRequest === undefined) {\r\n return;\r\n }\r\n try {\r\n const url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge`;\r\n\r\n const result: IRequestMilestoneManualChargeModel = yield call(\r\n httpClient.post,\r\n url,\r\n action.payload,\r\n );\r\n\r\n const charge: IServiceRequestMilestoneChargeDto = {\r\n Date: result.Date,\r\n Id: result.Id,\r\n Amount:\r\n (result.Rate ?? action.payload.OfflineServiceType?.Rate ?? 0) *\r\n (result.Quantity ?? 0),\r\n InvoiceId: null,\r\n Name: result.Name,\r\n //OfflineServiceTypeId: result.OfflineServiceType?.Id,\r\n Quantity: result.Quantity,\r\n OfflineServiceTypeId: result.OfflineServiceType?.Id ?? null,\r\n Rate: result.Rate,\r\n Remarks: result.Remarks,\r\n ServiceRequestMilestoneId: action.payload.ServiceRequestMilestoneId,\r\n Service:\r\n (action.payload.OfflineServiceType as IConsumableServiceDto) ?? null,\r\n UnitTypeId: null,\r\n\r\n UpdatedBy:\r\n result.UpdatedBy === null\r\n ? null\r\n : {\r\n Id: result.UpdatedBy?.Id,\r\n Name: result.UpdatedBy?.Title,\r\n },\r\n UnitType:\r\n (result.Unit as Entity) ??\r\n action.payload.OfflineServiceType?.UnitType ??\r\n null,\r\n };\r\n yield put(actions.insertMilestoneCharge_Success(charge));\r\n yield put(actions.closeSidePanel());\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.InsertSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.insertMilestoneCharge_Error());\r\n }\r\n}\r\nfunction* doDeleteServiceRequestMilestoneCharge(\r\n action: PayloadAction,\r\n) {\r\n const serviceRequest: IServiceRequestDto = yield select(\r\n selectRequestDetailsData,\r\n );\r\n if (serviceRequest === undefined) {\r\n return;\r\n }\r\n try {\r\n const url = `api/requests/${serviceRequest.Id}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge/${action.payload.Id}`;\r\n yield call(httpClient.delete, url);\r\n yield put(actions.deleteMilestoneCharge_Success(action.payload));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.DeleteSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\nfunction* doUpdateMilestoneCharge(\r\n action: UpdateServiceRequestMilestoneChargeAction,\r\n) {\r\n const serviceRequest: IServiceRequestDto = yield select(\r\n selectRequestDetailsData,\r\n );\r\n if (serviceRequest === undefined) {\r\n return;\r\n }\r\n try {\r\n const url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge`;\r\n const authenticatedUser: IAuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n\r\n const result: IRequestMilestoneManualChargeModel = yield call(\r\n httpClient.put,\r\n url,\r\n action.payload,\r\n );\r\n\r\n const charge: IServiceRequestMilestoneChargeDto = {\r\n Date: result.Date,\r\n Id: result.Id,\r\n Amount:\r\n (result.Rate ?? action.payload.OfflineServiceType?.Rate ?? 0) *\r\n (result.Quantity ?? 0),\r\n InvoiceId: null,\r\n Name: result.Name,\r\n //OfflineServiceTypeId: result.OfflineServiceType?.Id,\r\n Quantity: result.Quantity,\r\n OfflineServiceTypeId: result.OfflineServiceType?.Id ?? null,\r\n Rate: result.Rate,\r\n Remarks: result.Remarks,\r\n ServiceRequestMilestoneId: action.payload.ServiceRequestMilestoneId,\r\n Service: result.OfflineServiceType as IConsumableServiceDto,\r\n UnitTypeId: action.payload.Unit?.Id ?? null,\r\n UpdatedBy:\r\n action.payload.UpdatedBy === null\r\n ? null\r\n : action.payload.UpdatedBy === undefined\r\n ? null\r\n : {\r\n Id: action.payload.UpdatedBy.Id,\r\n Name: action.payload.UpdatedBy.Title,\r\n } ?? authenticatedUser,\r\n UnitType:\r\n (result.Unit as Entity) ??\r\n action.payload.OfflineServiceType?.UnitType ??\r\n null,\r\n };\r\n yield put(actions.closeSidePanel());\r\n yield put(actions.updateMilestoneCharge_Success(charge));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.UpdateSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n yield put(actions.updateMilestoneCharge_Error());\r\n }\r\n}\r\nfunction* doInsertMilestone(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n var url = `api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones`;\r\n var data: Partial = {\r\n Name: action.payload.Name,\r\n CompletionDate: action.payload.CompletionDate,\r\n Assignees: action.payload.Assignees?.map(function (u) {\r\n return u.Id;\r\n }).join(','),\r\n };\r\n const response = yield call(httpClient.post, url, data);\r\n\r\n const p: IServiceRequestMilestoneDto = {\r\n Assignees: action.payload.Assignees,\r\n Charged: false,\r\n Id: response.Id,\r\n ServiceRequestMilestoneCharges: [],\r\n CompletionDate: response.CompletionDate,\r\n Name: response.Name,\r\n Description: response.Description,\r\n InvoiceId: null,\r\n ServiceRequestId: action.payload.ServiceRequestId,\r\n Status: action.payload.Status,\r\n TargetDate: response.TargetDate,\r\n };\r\n yield put(actions.insertMilestone_Success(p));\r\n yield put(actions.closeSidePanel());\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'foo',\r\n variant: 'success',\r\n message: i18next.t(translations.InsertSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n const msg = (error as AxiosError)?.message;\r\n if (msg !== undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n key: 'foo',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n yield put(actions.insertMilestone_Error());\r\n }\r\n}\r\nfunction* doDeleteMilestone(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n var url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones/${action.payload.Id}`;\r\n yield call(httpClient.delete, url);\r\n yield put(actions.deleteMilestone_Success(action.payload));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.DeleteSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n //todo\r\n log.error(error);\r\n }\r\n}\r\nfunction* doUpdateMilestone(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n var url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones/${action.payload.Id}`;\r\n const requestPayload: ServiceRequestMilestoneInsertModel = {\r\n Assignees: action.payload.Assignees?.map(f => f.Id).join(','),\r\n\r\n Id: action.payload.Id,\r\n\r\n CompletionDate: action.payload.CompletionDate,\r\n Name: action.payload.Name,\r\n Description: action.payload.Description,\r\n ServiceRequestId: action.payload.ServiceRequestId,\r\n StatusId:\r\n ServiceRequestMilestoneStatuses[action.payload.Status ?? 'NotStarted'],\r\n TargetDate: action.payload.TargetDate,\r\n };\r\n const response: ServiceRequestMilestoneInsertModel = yield call(\r\n httpClient.put,\r\n url,\r\n requestPayload,\r\n );\r\n yield put(\r\n actions.updateMilestone_Success({\r\n ...action.payload,\r\n ...{\r\n Status:\r\n (response.StatusId === null\r\n ? undefined\r\n : (ServiceRequestMilestoneStatuses[\r\n response.StatusId\r\n ] as ServiceRequestMilestoneStatusesUnion)) ?? 'NotStarted',\r\n CompletionDate: response.CompletionDate,\r\n },\r\n }),\r\n );\r\n yield put(actions.closeSidePanel());\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.UpdateSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n //todo\r\n log.error(error);\r\n }\r\n}\r\nfunction* doOpenSidePanel(action: PayloadAction) {\r\n const sidePanelState: SidePanelState = yield select(selectSidePanelState);\r\n const isSidePanelOpen =\r\n sidePanelState.sidePanelOpen &&\r\n sidePanelState.pageType === RenderPageType.ServiceRequestDetails;\r\n if (!isSidePanelOpen) {\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: action.payload.type,\r\n props: Object.assign({}, action.payload.props, {\r\n useSidePanel: true,\r\n }),\r\n expanded: action.payload.expanded,\r\n }),\r\n );\r\n } else {\r\n yield put(\r\n actions.setCover({\r\n type: action.payload.type,\r\n props: Object.assign({}, action.payload.props, {\r\n isCover: true,\r\n useSidePanel: true,\r\n }),\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doCloseSidePanel(action: PayloadAction) {\r\n const sidePanelState: SidePanelState = yield select(selectSidePanelState);\r\n const isSidePanelOpen =\r\n sidePanelState.sidePanelOpen &&\r\n sidePanelState.pageType === RenderPageType.ServiceRequestDetails;\r\n if (isSidePanelOpen) {\r\n yield put(actions.setCover(undefined));\r\n } else {\r\n yield put(layoutActions.resetSidePanel());\r\n yield put(actions.resetRequestDetails);\r\n }\r\n}\r\nfunction* doCloneServiceRequest(action: PayloadAction) {\r\n try {\r\n const url = `api/ServiceRequests/${action.payload}/CopyStep`;\r\n const response: { NewRequestId: number } = yield call(httpClient.post, url);\r\n yield put(push(GetServiceRequestDetailsPath(response.NewRequestId)));\r\n } catch (error) {\r\n log.error(error);\r\n const axiosError = error as AxiosError;\r\n const messages = getv2ControllerErrorMessages(axiosError?.response);\r\n if (messages !== undefined && messages.length > 0) {\r\n appSettingsActions.addNotifications(\r\n messages.map(message => ({\r\n variant: 'error',\r\n message: message,\r\n })),\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction* doCreateServiceRequestRow(\r\n action: PayloadAction>,\r\n) {\r\n const messageKey = 'doCreateServiceRequestRow';\r\n try {\r\n if (action.payload.ServiceRequestId === undefined) {\r\n log.error(\r\n 'doCreateServiceRequestRow - ServiceRequestId is required',\r\n action.payload,\r\n );\r\n return;\r\n }\r\n const url = `api/odata/v4/ServiceRequests(${action.payload.ServiceRequestId})/Rows`;\r\n const columns = yield select(selectServiceRequestCustomFormColumns);\r\n const dto = serviceRequestModelToDto(action.payload, columns);\r\n const response: IServiceRequestRowDto = yield call(\r\n httpClient.post,\r\n url,\r\n dto,\r\n );\r\n yield put(\r\n actions.createServiceRequestRow_Success(\r\n prepareServiceRequestRowModel([response], columns),\r\n ),\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n key: messageKey,\r\n message: i18next.t(\r\n translations.ServiceRequestRow_InsertSuccess,\r\n response,\r\n ),\r\n }),\r\n );\r\n } catch (error) {\r\n log.error(error);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n key: messageKey,\r\n message: i18next.t(translations.ServiceRequestRow_InsertError),\r\n }),\r\n );\r\n }\r\n}\r\n\r\nconst getv2ControllerErrorMessages = (\r\n response?: AxiosResponse,\r\n): string[] | undefined => {\r\n if (response === undefined) {\r\n return undefined;\r\n }\r\n const message: string[] = [];\r\n\r\n if (typeof response.data == 'string') {\r\n message.push(response.data);\r\n } else if (response.data.ExceptionMessage !== undefined) {\r\n message.push(response.data.ExceptionMessage);\r\n } else if (response.data.Message !== undefined) {\r\n message.push(response.data.Message);\r\n } else if (response.data.message !== undefined) {\r\n message.push(response.data.message);\r\n } else if (response.data.ErrorMessages) {\r\n for (var i = 0; i < response.data.ErrorMessages.length; i++) {\r\n message.push(response.data.ErrorMessages[i] as string);\r\n }\r\n }\r\n\r\n return message;\r\n};\r\n\r\nfunction* doLoadServiceRequestRowStatuses() {\r\n try {\r\n const SampleManagementTablesEnabled = yield select(state =>\r\n selectKnownModule(state, KnownModules.SampleManagementTables),\r\n );\r\n if (SampleManagementTablesEnabled) {\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/ServiceRequestRowStatuses',\r\n );\r\n yield put(actions.loadServiceRequestRowStatuses_Success(data.value));\r\n }\r\n } catch (error) {\r\n log.error('Error loading service request row statuses');\r\n }\r\n}\r\n\r\nexport function* requestSamplesSaga() {\r\n yield takeLeading(actions.init.type, doInit);\r\n yield takeLatest(actions.loadRequestDetails.type, doLoadRequestDetails);\r\n yield takeLatest(actions.refreshRequestDetails.type, doRefreshRequestDetails);\r\n yield takeLatest(actions.loadFormValues.type, doLoadFormValues);\r\n yield takeLatest(actions.loadMilestones.type, doLoadMilestones);\r\n yield takeLatest(actions.insertMilestoneCharge.type, doInsertMilestoneCharge);\r\n yield takeLatest(actions.updateMilestoneCharge.type, doUpdateMilestoneCharge);\r\n yield takeLatest(\r\n actions.deleteMilestoneCharge.type,\r\n doDeleteServiceRequestMilestoneCharge,\r\n );\r\n yield takeLatest(actions.openSidePanel.type, doOpenSidePanel);\r\n yield takeLatest(actions.closeSidePanel.type, doCloseSidePanel);\r\n\r\n yield takeLatest(actions.insertMilestone.type, doInsertMilestone);\r\n yield takeLatest(actions.updateMilestone.type, doUpdateMilestone);\r\n yield takeLatest(actions.deleteMilestone.type, doDeleteMilestone);\r\n\r\n yield takeLatest(actions.loadSamples.type, doLoadSamples);\r\n yield takeLatest(actions.patch.type, doPatchRequestDetails);\r\n yield takeLatest(actions.updateStatus.type, doUpdateStatus);\r\n yield takeLatest(\r\n actions.updateServiceRequestRowStatus.type,\r\n doUpdateServiceRequestRowStatus,\r\n );\r\n yield takeLatest(actions.updateBudget.type, doUpdateBudget);\r\n yield takeLatest(actions.updatePurchaseOrder.type, doUpdatePurchaseOrder);\r\n yield takeLatest(\r\n actions.updateExternalInternalNumber.type,\r\n doUpdateExternalInternalNumber,\r\n );\r\n yield takeLatest(actions.updateFundingType.type, doUpdateFundingType);\r\n yield takeLatest(actions.updateGradient.type, doUpdateGradient);\r\n yield takeLatest(actions.updateOverheadMinutes.type, doUpdateOverheadMinutes);\r\n yield takeLatest(actions.submitStep.type, doSubmit);\r\n yield takeLatest(actions.cancelServiceRequest.type, doCancelServiceRequest);\r\n yield takeLatest(actions.createSample.type, doCreateSample);\r\n yield debounce(\r\n 100,\r\n actions.updateServiceRequestSampleField.type,\r\n doUpdateServiceRequestSampleField,\r\n );\r\n yield debounce(\r\n 100,\r\n actions.updateServiceRequestRowValue.type,\r\n doUpdateServiceRequestRowValue,\r\n );\r\n yield takeLatest(actions.import.type, doImport);\r\n yield takeLatest(actions.import_Success.type, doLoadSamples);\r\n yield takeLeading(actions.deleteSamples.type, doDeleteSamples);\r\n yield takeLeading(actions.cloneServiceRequest, doCloneServiceRequest);\r\n\r\n yield takeEvery(\r\n actions.createServiceRequestRow.type,\r\n doCreateServiceRequestRow,\r\n );\r\n\r\n yield takeLatest(\r\n actions.loadServiceRequestRows.type,\r\n doLoadServiceRequestRows,\r\n );\r\n\r\n yield takeLatestByKey(\r\n actions.saveFormValues.type,\r\n f => f?.FormFieldId,\r\n doSaveFormValue,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { requestSamplesSaga } from './saga';\r\nimport {\r\n ISample,\r\n ISampleListTableState,\r\n IRequestSamplesState,\r\n IServiceRequestPatchAction,\r\n IServiceRequestUpdateStatusAction,\r\n IServiceRequestUpdateBudgetAction,\r\n ILoadServiceRequestMilestonesAction,\r\n ILoadServiceRequestMilestonesSuccessAction,\r\n InsertServiceRequestMilestoneChargeAction,\r\n UpdateServiceRequestMilestoneChargeAction,\r\n UpdateServiceRequestRowValueAction,\r\n IServiceRequestTableRowModel,\r\n IRequestDetailsModel,\r\n IServiceRequestDetailsFormModel,\r\n IServiceRequestUpdatePurchaseOrderAction,\r\n IServiceRequestUpdateFundingTypeAction,\r\n IServiceRequestUpdateExternalInternalNumberAction,\r\n IServiceRequestUpdateGradientAction,\r\n IServiceRequestUpdateOverheadAction,\r\n ILoadServiceRequestRowsAction,\r\n} from './types';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { merge, remove } from 'lodash';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IOpenSidePanelPayload } from 'app/Layout/FrontendLayout/slice';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\n\r\nexport const initialState: IRequestSamplesState = {\r\n RequestSamples: {},\r\n ServiceRequestStatuses: {},\r\n ServiceRequestRows: {},\r\n fieldsState: {},\r\n SamplesTableState: {\r\n pageSize: 10,\r\n pageIndex: 0,\r\n sortBy: [{ id: 'Id', desc: true }],\r\n customFilters: [],\r\n globalFilter: '',\r\n },\r\n SamplesSelected: [],\r\n RequestDetails: {},\r\n ImportState: {\r\n open: false,\r\n processing: false,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'requestSamples',\r\n initialState,\r\n reducers: {\r\n init(state, action: PayloadAction) {},\r\n initServiceRequestStatuses_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.ServiceRequestStatuses = {\r\n status: 'resolved',\r\n value: action.payload,\r\n };\r\n },\r\n initServiceRequestStatuses_Error(state, action: PayloadAction) {\r\n state.ServiceRequestStatuses = {\r\n status: 'rejected',\r\n };\r\n },\r\n loadServiceRequestRowStatuses_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.ServiceRequestRowStatuses = action.payload;\r\n },\r\n loadRequestDetails(state, action: PayloadAction) {\r\n state.RequestDetails = { status: 'pending' };\r\n state.serviceRequestId = action.payload;\r\n },\r\n loadRequestDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.RequestDetails = {\r\n status: 'resolved',\r\n value: action.payload,\r\n };\r\n },\r\n loadRequestDetails_Error(state, action: PayloadAction) {\r\n state.RequestDetails = {\r\n status: 'rejected',\r\n error: action.payload,\r\n };\r\n },\r\n resetRequestDetails(state, action: PayloadAction) {\r\n state.RequestSamples = {};\r\n state.ServiceRequestStatuses = {};\r\n state.ServiceRequestRows = {};\r\n state.fieldsState = {};\r\n state.SamplesTableState = {\r\n pageSize: 10,\r\n pageIndex: 0,\r\n sortBy: [{ id: 'Id', desc: true }],\r\n customFilters: [],\r\n globalFilter: '',\r\n };\r\n state.SamplesSelected = [];\r\n state.RequestDetails = {};\r\n state.ImportState = {\r\n open: false,\r\n processing: false,\r\n };\r\n state.ServiceRequestRowStatuses = [];\r\n state.serviceRequestId = undefined;\r\n state.SidePanel = undefined;\r\n state.createServiceRequestRowStatus = undefined;\r\n state.milestoneProcessing = undefined;\r\n state.milestoneChargeProcessing = undefined;\r\n state.submitting = undefined;\r\n },\r\n refreshRequestDetails(state, action: PayloadAction) {\r\n state.RequestDetails.status = 'pending';\r\n },\r\n refreshRequestDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n if (state.RequestDetails.value !== undefined) {\r\n state.RequestDetails.value = {\r\n ...state.RequestDetails.value,\r\n ...action.payload,\r\n };\r\n }\r\n state.RequestDetails.status = 'resolved';\r\n },\r\n\r\n loadFormValues(state, action: PayloadAction) {},\r\n loadFormValues_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n state.RequestDetails.value.FormValues = action.payload;\r\n },\r\n\r\n updateStatus(state, action: IServiceRequestUpdateStatusAction) {\r\n state.fieldsState.Status = { status: 'pending' };\r\n },\r\n updateStatus_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n merge(state.RequestDetails.value, action.payload);\r\n if (state.fieldsState.Status !== undefined) {\r\n state.fieldsState.Status.status = 'resolved';\r\n }\r\n },\r\n updateStatus_Error(state, action: IServiceRequestUpdateStatusAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n state.RequestDetails.value.Status = {\r\n ...state.RequestDetails.value.Status,\r\n };\r\n delete state.fieldsState.Status;\r\n },\r\n\r\n updateBudget(state, action: IServiceRequestUpdateBudgetAction) {\r\n state.fieldsState.Budget = { status: 'pending' };\r\n },\r\n updateBudget_Success(state, action: IServiceRequestUpdateBudgetAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.Budget;\r\n },\r\n updateBudget_Error(state, action: IServiceRequestUpdateBudgetAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n state.RequestDetails.value.Budget = {\r\n ...state.RequestDetails.value.Budget,\r\n };\r\n delete state.fieldsState.Budget;\r\n },\r\n updateGradient(state, action: IServiceRequestUpdateGradientAction) {\r\n state.fieldsState.Gradient = { status: 'pending' };\r\n },\r\n updateGradient_Success(state, action: IServiceRequestUpdateGradientAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.Gradient;\r\n },\r\n updateGradient_Error(state, action: IServiceRequestUpdateGradientAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n if (state.RequestDetails.value.Gradient !== null) {\r\n state.RequestDetails.value.Gradient = {\r\n ...state.RequestDetails.value.Gradient,\r\n };\r\n }\r\n\r\n delete state.fieldsState.Gradient;\r\n },\r\n updateOverheadMinutes(state, action: IServiceRequestUpdateOverheadAction) {\r\n state.fieldsState.OverheadMinutes = { status: 'pending' };\r\n },\r\n updateOverheadMinutes_Success(\r\n state,\r\n action: IServiceRequestUpdateOverheadAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.OverheadMinutes;\r\n },\r\n updateOverheadMinutes_Error(\r\n state,\r\n action: IServiceRequestUpdateOverheadAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n delete state.fieldsState.OverheadMinutes;\r\n },\r\n updatePurchaseOrder(\r\n state,\r\n action: IServiceRequestUpdatePurchaseOrderAction,\r\n ) {\r\n state.fieldsState.PurchaseOrder = { status: 'pending' };\r\n },\r\n updatePurchaseOrder_Success(\r\n state,\r\n action: IServiceRequestUpdatePurchaseOrderAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.PurchaseOrder;\r\n },\r\n updatePurchaseOrder_Error(\r\n state,\r\n action: IServiceRequestUpdatePurchaseOrderAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n delete state.fieldsState.PurchaseOrder;\r\n },\r\n updateFundingType(state, action: IServiceRequestUpdateFundingTypeAction) {\r\n state.fieldsState.FundingTypeId = { status: 'pending' };\r\n },\r\n updateFundingType_Success(\r\n state,\r\n action: IServiceRequestUpdateFundingTypeAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.FundingTypeId;\r\n },\r\n updateFundingType_Error(\r\n state,\r\n action: IServiceRequestUpdateFundingTypeAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n // state.RequestDetails.value.FundingTypeId = {\r\n // ...state.RequestDetails.value.FundingTypeId,\r\n // };\r\n delete state.fieldsState.FundingTypeId;\r\n },\r\n updateExternalInternalNumber(\r\n state,\r\n action: IServiceRequestUpdateExternalInternalNumberAction,\r\n ) {\r\n state.fieldsState.ExternalInternalNumber = { status: 'pending' };\r\n },\r\n updateExternalInternalNumber_Success(\r\n state,\r\n action: IServiceRequestUpdateExternalInternalNumberAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n delete state.fieldsState.ExternalInternalNumber;\r\n },\r\n updateExternalInternalNumber_Error(\r\n state,\r\n action: IServiceRequestUpdateExternalInternalNumberAction,\r\n ) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n delete state.fieldsState.ExternalInternalNumber;\r\n },\r\n submitStep(state, action: PayloadAction) {\r\n state.submitting = true;\r\n },\r\n submitStep_success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.submitting = false;\r\n if (state.RequestDetails.value !== undefined) {\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n }\r\n },\r\n submitStep_Error(state, action: PayloadAction) {\r\n state.submitting = false;\r\n },\r\n cancelServiceRequest(state, action: IServiceRequestUpdateStatusAction) {},\r\n\r\n patch(state, action: IServiceRequestPatchAction) {\r\n // update state to processing of each field being updated\r\n const fields = (Object.keys(action.payload) as Array<\r\n keyof typeof action.payload\r\n >)\r\n .filter(f => f !== 'Id')\r\n .reduce((prev, current) => {\r\n prev[current] = { processing: true };\r\n return prev;\r\n }, {});\r\n Object.assign(state.fieldsState, fields);\r\n },\r\n patch_Success(state, action: IServiceRequestPatchAction) {\r\n if (state.RequestDetails.value === undefined) {\r\n return;\r\n }\r\n // release fields that were being processes\r\n Object.keys(action.payload).forEach(f => delete state.fieldsState[f]);\r\n //merge(state.RequestDetails.value, action.payload);\r\n Object.assign(state.RequestDetails.value, action.payload);\r\n },\r\n patch_Error(state, action: IServiceRequestPatchAction) {\r\n // release fields that were being processes\r\n Object.keys(action.payload).forEach(f => delete state.fieldsState[f]);\r\n },\r\n\r\n saveFormValues(\r\n state,\r\n action: PayloadAction<\r\n Pick &\r\n Pick & { Value: any }\r\n >,\r\n ) {},\r\n\r\n loadSamples(state, action: PayloadAction) {\r\n state.RequestSamples.status = 'pending';\r\n state.SamplesTableState = {\r\n pageSize: action.payload.pageSize,\r\n pageIndex: action.payload.pageIndex,\r\n sortBy: action.payload.sortBy,\r\n globalFilter: action.payload.globalFilter,\r\n searchColumns: action.payload.searchColumns,\r\n customFilters: action.payload.customFilters?.map(filter => ({\r\n fieldName: filter.fieldName,\r\n operator: filter.operator,\r\n value: filter.value,\r\n })),\r\n };\r\n },\r\n loadSamples_Success(state, action: PayloadAction) {\r\n state.RequestSamples = {\r\n status: 'resolved',\r\n value: {\r\n data: action.payload.value as ISample[],\r\n dataLength: action.payload['@odata.count'],\r\n },\r\n };\r\n },\r\n loadSamples_Error(state, action: PayloadAction) {\r\n state.RequestSamples.status = 'rejected';\r\n state.RequestSamples.error = action.payload;\r\n },\r\n\r\n loadServiceRequestRows(state, action: ILoadServiceRequestRowsAction) {\r\n state.ServiceRequestRows.status = 'pending';\r\n },\r\n loadServiceRequestRows_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.ServiceRequestRows = {\r\n value: action.payload,\r\n\r\n status: 'resolved',\r\n };\r\n\r\n Object.assign(state.RequestDetails.value, { Rows: action.payload });\r\n },\r\n loadServiceRequestRows_Error(state, error: PayloadAction) {\r\n state.ServiceRequestRows = { error: true };\r\n },\r\n\r\n deleteServiceRequestRows(\r\n state,\r\n action: PayloadAction>,\r\n ) {},\r\n deleteServiceRequestRows_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n const id = action.payload.map(item => item.Id);\r\n state.ServiceRequestRows.value = state.ServiceRequestRows.value?.filter(\r\n item => !id.includes(item.Id),\r\n );\r\n },\r\n\r\n createServiceRequestRow(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n //state.RequestServiceRequestRows.processing = true;\r\n state.createServiceRequestRowStatus = 'pending';\r\n },\r\n createServiceRequestRow_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.ServiceRequestRows.value?.push(...action.payload);\r\n state.createServiceRequestRowStatus = 'resolved';\r\n },\r\n createServiceRequestRow_Error(state, action: PayloadAction) {\r\n state.createServiceRequestRowStatus = 'rejected';\r\n },\r\n\r\n loadMilestones(state, action: ILoadServiceRequestMilestonesAction) {},\r\n loadMilestones_Success(\r\n state,\r\n action: ILoadServiceRequestMilestonesSuccessAction,\r\n ) {\r\n if (state.RequestDetails.value !== undefined) {\r\n state.RequestDetails.value.Milestones = action.payload;\r\n }\r\n },\r\n\r\n insertMilestone(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.milestoneProcessing = true;\r\n },\r\n insertMilestone_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n const serviceRequest = state.RequestDetails.value;\r\n if (serviceRequest !== undefined) {\r\n serviceRequest.Milestones.push(action.payload);\r\n }\r\n state.milestoneProcessing = false;\r\n },\r\n insertMilestone_Error(state, action: PayloadAction) {\r\n state.milestoneProcessing = false;\r\n },\r\n updateMilestone(\r\n state,\r\n action: PayloadAction>>,\r\n ) {\r\n state.milestoneProcessing = true;\r\n },\r\n updateMilestone_Success(\r\n state,\r\n action: PayloadAction<\r\n Partial & Pick\r\n >,\r\n ) {\r\n const serviceRequest = state.RequestDetails.value;\r\n if (serviceRequest !== undefined) {\r\n const milestone = serviceRequest.Milestones.find(\r\n f => f.Id === action.payload.Id,\r\n );\r\n if (milestone !== undefined) {\r\n Object.assign(milestone, action.payload);\r\n }\r\n }\r\n state.milestoneProcessing = false;\r\n },\r\n updateMilestone_Error(state, action: PayloadAction) {\r\n state.milestoneProcessing = false;\r\n },\r\n deleteMilestone(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n deleteMilestone_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n const serviceRequest = state.RequestDetails.value;\r\n if (serviceRequest !== undefined) {\r\n remove(serviceRequest.Milestones, f => f.Id === action.payload.Id);\r\n }\r\n },\r\n\r\n insertMilestoneCharge(\r\n state,\r\n action: InsertServiceRequestMilestoneChargeAction,\r\n ) {\r\n state.milestoneChargeProcessing = true;\r\n },\r\n insertMilestoneCharge_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n if (state.RequestDetails.value !== undefined) {\r\n const milestone = state.RequestDetails.value.Milestones.find(\r\n f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n );\r\n if (milestone !== undefined) {\r\n milestone.ServiceRequestMilestoneCharges.push(action.payload);\r\n }\r\n }\r\n state.milestoneChargeProcessing = false;\r\n },\r\n insertMilestoneCharge_Error(state, action: PayloadAction) {\r\n state.milestoneChargeProcessing = false;\r\n },\r\n openSidePanel(state, action: PayloadAction) {},\r\n closeSidePanel(state, action: PayloadAction) {},\r\n setCover(state, action: PayloadAction) {\r\n state.SidePanel = action.payload;\r\n },\r\n updateMilestoneCharge(\r\n state,\r\n action: UpdateServiceRequestMilestoneChargeAction,\r\n ) {\r\n state.milestoneChargeProcessing = true;\r\n },\r\n updateMilestoneCharge_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n if (state.RequestDetails.value !== undefined) {\r\n const milestone = state.RequestDetails.value.Milestones.find(\r\n f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n );\r\n if (milestone !== undefined) {\r\n const charge = milestone.ServiceRequestMilestoneCharges.find(\r\n f => f.Id === action.payload.Id,\r\n );\r\n if (charge !== undefined) {\r\n Object.assign(charge, action.payload);\r\n }\r\n }\r\n }\r\n state.milestoneChargeProcessing = false;\r\n },\r\n updateMilestoneCharge_Error(state, action: PayloadAction) {\r\n state.milestoneChargeProcessing = false;\r\n },\r\n deleteMilestoneCharge(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n deleteMilestoneCharge_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n if (state.RequestDetails.value !== undefined) {\r\n const milestone = state.RequestDetails.value.Milestones.find(\r\n f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n );\r\n if (milestone !== undefined) {\r\n remove(\r\n milestone.ServiceRequestMilestoneCharges,\r\n f => f.Id === action.payload.Id,\r\n );\r\n }\r\n }\r\n },\r\n setSelected(state, action: PayloadAction) {\r\n state.SamplesSelected = action.payload;\r\n },\r\n\r\n createSample(state, action: PayloadAction) {\r\n state.RequestSamples = { status: 'pending' };\r\n },\r\n createSample_Success(state, action: PayloadAction) {\r\n state.RequestSamples.value?.data?.push(action.payload);\r\n state.RequestSamples.status = 'resolved';\r\n if (state.RequestSamples.value !== undefined) {\r\n state.RequestSamples.value.dataLength =\r\n (state.RequestSamples.value.dataLength ?? 0) + 1;\r\n }\r\n },\r\n createSample_Error(state, action: PayloadAction) {\r\n state.RequestSamples.status = 'rejected';\r\n },\r\n\r\n updateServiceRequestSampleField(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n // update row in samples list\r\n const item = state.RequestSamples?.value?.data?.find(\r\n s => s.Id === action.payload.Id,\r\n );\r\n if (item !== undefined) {\r\n Object.assign(item, action.payload);\r\n }\r\n },\r\n updateServiceRequestSampleField_Success(state, action: PayloadAction) {},\r\n updateServiceRequestSampleField_Error(state, action: PayloadAction) {},\r\n\r\n updateServiceRequestRowValue(\r\n state,\r\n action: UpdateServiceRequestRowValueAction,\r\n ) {},\r\n updateServiceRequestRowValue_Success(state, action: PayloadAction) {\r\n // TODO: update internal state\r\n },\r\n updateServiceRequestRowValue_Error(state, action: PayloadAction) {\r\n // TODO: ??\r\n },\r\n\r\n updateServiceRequestRowStatus(\r\n state,\r\n action: PayloadAction<{\r\n serviceRequestId: number;\r\n serviceRequestRowId: number;\r\n status: IServiceRequestRowStatusDto | null;\r\n }>,\r\n ) {},\r\n updateServiceRequestRowStatus_Success(\r\n state,\r\n action: PayloadAction<{\r\n serviceRequestId: number;\r\n serviceRequestRowId: number;\r\n status: IServiceRequestRowStatusDto | null;\r\n }>,\r\n ) {\r\n if (action.payload.status !== null) {\r\n const row = state.ServiceRequestRows.value?.find(\r\n f => f.Id === action.payload.serviceRequestRowId,\r\n );\r\n if (row !== undefined) {\r\n row.Status = action.payload.status;\r\n row.StatusId = action.payload.status?.Id;\r\n }\r\n }\r\n },\r\n\r\n toggleImport(state, action: PayloadAction) {\r\n state.ImportState.open = action.payload;\r\n },\r\n\r\n import(state, action: PayloadAction) {\r\n state.ImportState.processing = true;\r\n },\r\n import_Success(state, action: PayloadAction) {\r\n state.ImportState.processing = false;\r\n state.ImportState.open = false;\r\n },\r\n import_Error(state, action: PayloadAction) {\r\n state.ImportState.processing = false;\r\n },\r\n\r\n setHasFiles(state, action: PayloadAction) {\r\n if (state.RequestDetails.value !== undefined) {\r\n state.RequestDetails.value.HasFiles = action.payload;\r\n }\r\n },\r\n\r\n deleteSamples(state, action: PayloadAction) {},\r\n cloneServiceRequest(state, action: PayloadAction) {},\r\n },\r\n});\r\n\r\nexport const { actions: requestSamplesActions } = slice;\r\n\r\nexport const useRequestSamplesSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: requestSamplesSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useRequestSamplesSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { Entity } from 'types/common';\r\n\r\n/**\r\n * Combines Id & Name into an object that represents an entity\r\n * @param id Entity Id\r\n * @param name Entity Name\r\n * @param otherData additional Data\r\n * @returns Entity with Id & Name populated\r\n */\r\nexport function toEntity(\r\n id: T | null | undefined,\r\n name?: string | null,\r\n otherData?: Record,\r\n): Entity | null {\r\n if (id == null || id === undefined || name == null || name === undefined) {\r\n return null;\r\n } else {\r\n return !!otherData\r\n ? Object.assign({}, { Id: id, Name: name ?? id }, otherData)\r\n : { Id: id, Name: name ?? id };\r\n }\r\n}\r\n","/**\r\n *\r\n * FundingTypeIdPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { InvoiceFundingType } from 'enums/InvoiceFundingType';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface FundingTypePickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSingleInvoiceFundingType = (val: number): Entity => {\r\n return enumToEntityArray(InvoiceFundingType).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initFundingTypeData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n const val = parseInt(initval ?? '');\r\n if (initval === undefined || isNaN(val)) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSingleInvoiceFundingType(val)]);\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(InvoiceFundingType);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function FundingTypeIdPicker(props: FundingTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport type avTypes =\r\n | 'bookable'\r\n | 'serviceRelated'\r\n | 'serviceGroup'\r\n | 'bookableAndnotbookable'\r\n | 'workOrderRelated'\r\n | 'all';\r\n\r\nexport interface AssetsPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n restrictByAvType?: avTypes;\r\n /**\r\n * Option to filter admin permissions. If set to true will return only the assets authenticated user is an admin of\r\n */\r\n admin?: boolean;\r\n /**\r\n * Fetches only Active assets/instruments if this property is set to true\r\n */\r\n showOnlyActiveAssets?: boolean;\r\n withoutServiceGroups?: boolean;\r\n}\r\nexport const bookable: Identifiable[] = [\r\n //{ Id: AvailabilityTypes.ApprovalRequiredBillable as number },\r\n //{ Id: AvailabilityTypes.BookableWApproval as number },\r\n { Id: AvailabilityTypes.FreelyBookable as number },\r\n //{ Id: AvailabilityTypes.FreelyBookableBillable as number },\r\n { Id: AvailabilityTypes.LectureRoom as number },\r\n { Id: AvailabilityTypes.LoanableEquipment as number },\r\n { Id: AvailabilityTypes.TrainingProgram as number },\r\n];\r\nexport const bookableAndnotbookable: Identifiable[] = bookable.concat([\r\n { Id: AvailabilityTypes.AvailableNotBookable as number },\r\n]);\r\nexport const servicesRelated: Identifiable[] = [\r\n //{ Id: AvailabilityTypes.ApprovalRequiredBillable as number },\r\n //{ Id: AvailabilityTypes.BookableWApproval as number },\r\n { Id: AvailabilityTypes.FreelyBookable as number },\r\n //{ Id: AvailabilityTypes.FreelyBookableBillable as number },\r\n { Id: AvailabilityTypes.LectureRoom as number },\r\n { Id: AvailabilityTypes.LoanableEquipment as number },\r\n { Id: AvailabilityTypes.TrainingProgram as number },\r\n { Id: AvailabilityTypes.AvailableNotBookable as number },\r\n { Id: AvailabilityTypes.NotAvailable as number },\r\n { Id: AvailabilityTypes.RequestRelated as number },\r\n { Id: AvailabilityTypes.ServiceRelated as number },\r\n];\r\nexport const initAssetsData = (\r\n initval: string | undefined,\r\n byService?: boolean,\r\n serviceTypes?: Identifiable[],\r\n admin?: boolean,\r\n) => {\r\n const url =\r\n admin === true\r\n ? '/api/odata/v4/AssetNames/AdminAssets'\r\n : '/api/odata/v4/AssetNames';\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids = (initval.indexOf(',') !== -1\r\n ? initval.split(',')\r\n : initval.indexOf('|') !== -1\r\n ? initval.split('|')\r\n : [initval]\r\n ).map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n let filters: string | undefined = undefined;\r\n if (ids.length > 0) {\r\n const predicates: string | Condition[] = [];\r\n\r\n if (byService) {\r\n predicates.push(\r\n new Condition('ServiceId', ODataOperators.Includes, ids),\r\n );\r\n let types =\r\n !!serviceTypes && serviceTypes.length > 0\r\n ? serviceTypes\r\n : [{ Id: 1 }];\r\n\r\n predicates.push(\r\n new Condition('ServiceTypeId', ODataOperators.Includes, types),\r\n );\r\n } else {\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n }\r\n filters = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filters,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function AssetsFilterForWorkOrder(\r\n orederType: IWorkOrderTypeDto | undefined,\r\n): Condition[] {\r\n const predicates: Condition[] = [];\r\n if (orederType !== undefined) {\r\n if (orederType.Groups && orederType.Groups.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n orederType.Groups.map(f => f.Id),\r\n ),\r\n );\r\n }\r\n if (orederType.AssetCats && orederType.AssetCats.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'AssetCatId',\r\n ODataOperators.Includes,\r\n orederType.AssetCats.map(f => f.Id),\r\n ),\r\n );\r\n }\r\n }\r\n\r\n predicates.push(\r\n new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n { Id: 1 },\r\n { Id: 2 },\r\n // { Id: 3 },\r\n ]),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n } else {\r\n return [];\r\n }\r\n}\r\nexport function AssetsFilterForCalibrationWorkOrder(\r\n orederType: IWorkOrderTypeDto | undefined,\r\n selectedIds: number[],\r\n): Condition[] {\r\n const predicates: Condition[] = [];\r\n if (orederType !== undefined) {\r\n if (orederType.Groups && orederType.Groups.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n orederType.Groups,\r\n ),\r\n );\r\n }\r\n if (orederType.AssetCats && orederType.AssetCats.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'AssetCatId',\r\n ODataOperators.Includes,\r\n orederType.AssetCats,\r\n ),\r\n );\r\n }\r\n }\r\n if (selectedIds.length > 0) {\r\n predicates.push(\r\n new Condition('Id', ODataOperators.Excludes, selectedIds),\r\n );\r\n }\r\n\r\n predicates.push(\r\n new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n { Id: 1 },\r\n { Id: 2 },\r\n { Id: 3 },\r\n ]),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n } else {\r\n return [];\r\n }\r\n}\r\nexport function AssetsFilterForSavedView(\r\n topServiceGroups: Entity[] | undefined,\r\n): Condition[] {\r\n const predicates: Condition[] = [];\r\n if (topServiceGroups !== undefined) {\r\n if (topServiceGroups.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n topServiceGroups,\r\n ),\r\n );\r\n }\r\n }\r\n predicates.push(\r\n new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n { Id: 1 },\r\n //{ Id: 2 },\r\n //{ Id: 3 },\r\n ]),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n } else {\r\n return [];\r\n }\r\n}\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n admin?: boolean,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n const url =\r\n admin === true\r\n ? '/api/odata/v4/AssetNames/AdminAssets'\r\n : '/api/odata/v4/AssetNames';\r\n return getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'AssetCatId',\r\n 'Availability',\r\n // BookableAsset is not mapped (AssetNamesController)\r\n // 'BookableAsset',\r\n 'Image',\r\n 'ServiceGroupId',\r\n 'ServiceId',\r\n 'ServiceTypeId',\r\n 'ServiceGroupName',\r\n 'ServiceGroupAssetId',\r\n 'Color',\r\n ],\r\n globalServiceGroupFilter:\r\n (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n !!globalServiceGroupFilter &&\r\n globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\nexport function AssetsPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n restrictByAvType,\r\n showOnlyActiveAssets,\r\n admin,\r\n withoutServiceGroups,\r\n ...props\r\n}: AssetsPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n\r\n let avFilter =\r\n restrictByAvType === undefined ? undefined : getAvFilter(restrictByAvType);\r\n\r\n let filters =\r\n avFilter !== undefined\r\n ? predicates !== undefined\r\n ? [...predicates, avFilter]\r\n : [avFilter]\r\n : predicates;\r\n if (showOnlyActiveAssets === true) {\r\n filters?.push(\r\n new Condition('Active', ODataOperators.Equals, true),\r\n );\r\n }\r\n const innerLoadData = loadData(\r\n filters,\r\n globalServiceGroupFilter || [],\r\n admin,\r\n withoutServiceGroups,\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport function ServiceGroupAssetsPicker(\r\n props: Omit,\r\n) {\r\n return ;\r\n}\r\nexport function InstrumentAssetsPicker(\r\n props: Omit,\r\n) {\r\n return ;\r\n}\r\nexport function getAvFilter(restrictByAvType: avTypes) {\r\n switch (restrictByAvType) {\r\n case 'bookable':\r\n return `(${new Condition(\r\n 'Availability/Id',\r\n ODataOperators.Includes,\r\n bookable,\r\n ).toString()})`;\r\n case 'bookableAndnotbookable':\r\n return `(${new Condition(\r\n 'Availability/Id',\r\n ODataOperators.Includes,\r\n bookableAndnotbookable,\r\n ).toString()})`;\r\n case 'serviceRelated':\r\n return `(${new Condition(\r\n 'Availability/Id',\r\n ODataOperators.Includes,\r\n servicesRelated,\r\n ).toString()})`;\r\n case 'workOrderRelated':\r\n return `(${new Condition(\r\n 'Availability/Id',\r\n ODataOperators.Includes,\r\n servicesRelated.filter(\r\n f => f.Id !== (AvailabilityTypes.RequestRelated as number),\r\n ),\r\n ).toString()})`;\r\n case 'serviceGroup':\r\n return `(${new Condition(\r\n 'Availability/Id',\r\n ODataOperators.Equals,\r\n AvailabilityTypes.ServiceGroup,\r\n ).toString()})`;\r\n case 'all':\r\n return undefined;\r\n default:\r\n assertExhaustive(restrictByAvType);\r\n }\r\n}\r\n","import { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { LoginTypes, Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport { enumToArray, enumToDescriptedArray } from 'utils/enumKeys';\r\nimport { Entity } from './common';\r\n\r\nexport interface IAuthenticatedUser extends Entity {\r\n Language?: string;\r\n CultureName?: string;\r\n Roles: number[];\r\n LoginType: LoginTypes;\r\n UserGroups: Entity[];\r\n ActiveUserGroup?: Entity;\r\n DisplayName?: string;\r\n AdminEquipments?: AuthServiceDto[];\r\n AdminServiceGroups?: AuthServiceGroupDto[];\r\n InstrumentEventsGroups?: AuthServiceGroupDto[];\r\n CreatableGroups?: Entity[];\r\n HasRegisterableServiceGroups?: boolean;\r\n FormatedName?: string;\r\n HasNotifications?: boolean;\r\n HasOptOutCoreSelection: boolean;\r\n CalendarType: number;\r\n RequireUserGroupCoordApproval: boolean;\r\n HasSignedTermsOfUse: boolean;\r\n IsActiveDirectory: boolean;\r\n JoinStatus?: number;\r\n CustomRoleUrls?: CustomRoleData;\r\n}\r\nexport interface AuthServiceDto extends Entity {\r\n Id: number;\r\n Name: string;\r\n ServiceTypeId: number;\r\n ServiceGroupId: number;\r\n IsLabTech: boolean;\r\n}\r\nexport interface AuthServiceGroupDto extends Entity {\r\n Id: number;\r\n Name: string;\r\n IsLabTech: boolean;\r\n}\r\nexport interface IIsAdminOfParams {\r\n ServiceTypeId: ServiceType;\r\n ServiceId: number;\r\n ServiceGroupId: number;\r\n}\r\nexport interface IIsAdminOrOwnerOfParams extends IIsAdminOfParams {\r\n UserId: string | null;\r\n}\r\nexport enum CustomRolePermissionLevel {\r\n AdminWriteLevel = 0,\r\n ReadOnlyLevel = 1,\r\n}\r\nexport type CustomRoleData = {\r\n [key: string]: CustomRolePermissionLevel;\r\n};\r\n\r\nexport enum CustomRoleAllowePages {\r\n Users = '/Users.aspx?module=main',\r\n UsersList = '/Users.aspx?list=',\r\n AddUser = '/NewUser.aspx',\r\n EditUser = '/NewUser.aspx?un=',\r\n UsersHistory = '/UsersHistory',\r\n UsersImport = '/UsersImport.aspx',\r\n UserGroups = '/AllowedAdGroups.aspx',\r\n AddUserGroup = '/AllowedAdGroup.aspx',\r\n EditUserGroup = '/AllowedAdGroup.aspx?ID=',\r\n Departments = '/Departments.aspx',\r\n Institutes = '/Institutes.aspx',\r\n InstituteTypes = '/InstituteTypes.aspx',\r\n AddInsituteType = '/InstituteType.aspx',\r\n EditInstituteType = '/InstituteType.aspx?ID=',\r\n Disciplines = '/Disciplines.aspx',\r\n BillingPreview = '/Invoices/Create.aspx',\r\n InvoiceBatches = '/Invoices/Batches.aspx',\r\n Invoices = '/Invoices/Default.aspx',\r\n InvoiceDetails = '/Invoices/Details.aspx',\r\n InvoicePayments = '/Invoices/InvoicePayments.aspx',\r\n Charges = '/Invoices/InvoiceUserRows.aspx',\r\n SubscriptionTypes = '/Invoices/SubscriptionTypes/Default.aspx',\r\n SubscriptionTypesList = '/Invoices/SubscriptionTypes/Default.aspx?list=',\r\n AddSubscriptionType = '/Invoices/SubscriptionTypes/AddNew.aspx',\r\n EditSubscriptionType = '/Invoices/SubscriptionTypes/Edit.aspx',\r\n Subscriptions = '/Invoices/Subscriptions/Default.aspx',\r\n SubscriptionsList = '/Invoices/Subscriptions/Default.aspx?list=',\r\n AddSubscription = '/Invoices/Subscriptions/Create.aspx',\r\n EditSubscription = '/Invoices/Subscriptions/Edit.aspx',\r\n}\r\nexport class AuthenticatedUser implements IAuthenticatedUser {\r\n // Entity members\r\n Id: string;\r\n Name: string;\r\n // IAuthenticatedUser members\r\n Language?: string;\r\n CultureName?: string;\r\n Roles: number[];\r\n LoginType: LoginTypes;\r\n UserGroups: Entity[];\r\n ActiveUserGroup?: Entity;\r\n DisplayName?: string;\r\n AdminEquipments: AuthServiceDto[];\r\n AdminServiceGroups: AuthServiceGroupDto[];\r\n InstrumentEventsGroups: AuthServiceGroupDto[];\r\n CreatableGroups: Entity[];\r\n HasRegisterableServiceGroups?: boolean;\r\n FormatedName?: string;\r\n HasNotifications?: boolean;\r\n HasOptOutCoreSelection: boolean;\r\n CalendarType: number;\r\n RequireUserGroupCoordApproval: boolean;\r\n HasSignedTermsOfUse: boolean;\r\n IsActiveDirectory: boolean;\r\n JoinStatus?: number;\r\n CustomRoleUrls?: CustomRoleData;\r\n\r\n //constructor\r\n constructor(data: IAuthenticatedUser) {\r\n this.Id = data.Id;\r\n this.Name = data.Name;\r\n this.Language = data.Language;\r\n this.CultureName = data.CultureName;\r\n this.Roles = data.Roles;\r\n this.LoginType = data.LoginType;\r\n this.UserGroups = data.UserGroups;\r\n this.ActiveUserGroup = data.ActiveUserGroup;\r\n this.DisplayName = data.DisplayName;\r\n this.AdminEquipments = data.AdminEquipments ?? [];\r\n this.AdminServiceGroups = data.AdminServiceGroups ?? [];\r\n this.InstrumentEventsGroups = data.InstrumentEventsGroups ?? [];\r\n this.CreatableGroups = data.CreatableGroups ?? [];\r\n this.HasRegisterableServiceGroups = data.HasRegisterableServiceGroups;\r\n this.FormatedName = data.FormatedName;\r\n this.HasNotifications = data.HasNotifications;\r\n this.HasOptOutCoreSelection = data.HasOptOutCoreSelection;\r\n this.CalendarType = data.CalendarType;\r\n this.RequireUserGroupCoordApproval = data.RequireUserGroupCoordApproval;\r\n this.HasSignedTermsOfUse = data.HasSignedTermsOfUse;\r\n this.IsActiveDirectory = data.IsActiveDirectory;\r\n this.JoinStatus = data.JoinStatus;\r\n this.CustomRoleUrls = data.CustomRoleUrls;\r\n }\r\n /**\r\n * Generic permissions check on a partial DTO:\r\n * either it is a user created object\r\n * @param row Dto partial object\r\n * @returns true if current user has permissions\r\n */\r\n public IsAdminOf(row: IIsAdminOfParams) {\r\n return (\r\n this.HasAdminGroupPermissions(row?.ServiceGroupId) ||\r\n this.HasLabTechGroupPermissions(row?.ServiceGroupId) ||\r\n this.HasAdminServicePermissions(row.ServiceTypeId, row.ServiceId) ||\r\n this.HasLabTechServicePermissions(row.ServiceTypeId, row.ServiceId)\r\n );\r\n }\r\n /**\r\n * Determines if current user is an Admin or Owner of an object\r\n * @param row some partial DTO\r\n * @returns\r\n */\r\n public IsAdminOrOwnerOf(row: IIsAdminOrOwnerOfParams) {\r\n const result = this.IsAdminOf(row) || row.UserId === this.Id;\r\n return result;\r\n }\r\n\r\n public HasCustomRolesPermission(\r\n pages: CustomRoleAllowePages[],\r\n level?: CustomRolePermissionLevel,\r\n ): boolean {\r\n if (this.Roles.includes(Roles.CustomRole)) {\r\n if (this.CustomRoleUrls !== undefined) {\r\n let result = false;\r\n let rootedPages = pages.map(\r\n page => process.env.PUBLIC_URL.toLowerCase() + page.toLowerCase(),\r\n );\r\n rootedPages.forEach(page => {\r\n if (\r\n Object.entries(this.CustomRoleUrls ?? {}).some(\r\n item =>\r\n item[0].toLowerCase() === page && (!level || level === item[1]),\r\n )\r\n ) {\r\n result = true;\r\n return;\r\n }\r\n });\r\n return result;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n public HasCustomRolePermission(\r\n page: CustomRoleAllowePages,\r\n level?: CustomRolePermissionLevel,\r\n ): boolean {\r\n if (this.Roles.includes(Roles.CustomRole)) {\r\n if (this.CustomRoleUrls !== undefined) {\r\n let rootedPage =\r\n process.env.PUBLIC_URL.toLowerCase() + page.toLowerCase();\r\n if (\r\n Object.entries(this.CustomRoleUrls ?? {}).some(\r\n item =>\r\n item[0].toLowerCase() === rootedPage &&\r\n (!level || level === item[1]),\r\n )\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n public HasCustomRoleUrlPermission(\r\n url: string,\r\n level?: CustomRolePermissionLevel,\r\n ): boolean {\r\n if (this.Roles.includes(Roles.CustomRole)) {\r\n if (this.CustomRoleUrls !== undefined) {\r\n let rootedPage = url.toLowerCase();\r\n if (\r\n Object.entries(this.CustomRoleUrls ?? {}).some(\r\n item =>\r\n (item[0].toLowerCase() === rootedPage ||\r\n (item[0].toLowerCase().indexOf('?list=') > 0 &&\r\n item[0].toLowerCase().indexOf(rootedPage) >= 0)) &&\r\n (!level || level === item[1]),\r\n )\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n public HasAdminGroupPermissions(serviceGroupId?: number): boolean {\r\n if (serviceGroupId === undefined) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n return this.AdminServiceGroups.some(\r\n f => f.Id === serviceGroupId && f.IsLabTech === false,\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n public isAdmin(): boolean {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n\r\n public isGroupAdmin(): boolean {\r\n return this.isAdmin() || this.Roles.includes(Roles.GroupAdministrators);\r\n }\r\n\r\n public isLabTech(): boolean {\r\n return this.isAdmin() || this.Roles.includes(Roles.LabTech);\r\n }\r\n\r\n public HasAdminServicePermissions(\r\n serviceTypeId: number,\r\n serviceId?: number,\r\n ): boolean {\r\n if (serviceId === undefined) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (\r\n this.Roles.includes(Roles.GroupAdministrators) ||\r\n this.Roles.includes(Roles.EquipmentAdministrator)\r\n ) {\r\n return this.AdminEquipments.some(\r\n item =>\r\n item.Id === serviceId &&\r\n item.ServiceTypeId === serviceTypeId &&\r\n item.IsLabTech === false,\r\n );\r\n }\r\n return false;\r\n }\r\n public HasCreateAdminGroupPermissions(serviceGroupId?: number): boolean {\r\n if (serviceGroupId === undefined) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (this.Roles.includes(Roles.CreateNewAssetsAdmin)) {\r\n return this.CreatableGroups.map(item => item.Id).includes(serviceGroupId);\r\n }\r\n return false;\r\n }\r\n public HasAdminGroupOnlyPermissions(serviceGroupId?: number): boolean {\r\n if (serviceGroupId === undefined) {\r\n return false;\r\n }\r\n if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n return this.AdminServiceGroups.some(\r\n f => f.Id === serviceGroupId && f.IsLabTech === false,\r\n );\r\n }\r\n return false;\r\n }\r\n public HasAdminServiceOnlyPermissions(\r\n serviceTypeId: number,\r\n serviceId?: number,\r\n ): boolean {\r\n if (serviceId === undefined) {\r\n return false;\r\n }\r\n if (\r\n this.Roles.includes(Roles.GroupAdministrators) ||\r\n this.Roles.includes(Roles.EquipmentAdministrator)\r\n ) {\r\n return this.AdminEquipments.some(\r\n item =>\r\n item.Id === serviceId &&\r\n item.ServiceTypeId === serviceTypeId &&\r\n item.IsLabTech === false,\r\n );\r\n } else {\r\n return false;\r\n }\r\n }\r\n public HasLabTechGroupPermissions(serviceGroupId?: number): boolean {\r\n if (serviceGroupId === undefined) {\r\n return false;\r\n }\r\n if (!this.Roles.includes(Roles.LabTech)) {\r\n return false;\r\n } else {\r\n return this.AdminServiceGroups.some(\r\n f => f.Id === serviceGroupId && f.IsLabTech === true,\r\n );\r\n }\r\n }\r\n public HasLabTechServicePermissions(\r\n serviceTypeId: number,\r\n serviceId?: number,\r\n ): boolean {\r\n if (serviceId === undefined) {\r\n return false;\r\n }\r\n if (!this.Roles.includes(Roles.LabTech)) {\r\n return false;\r\n } else {\r\n return this.AdminEquipments.some(\r\n item =>\r\n item.Id === serviceId &&\r\n item.ServiceTypeId === serviceTypeId &&\r\n item.IsLabTech === true,\r\n );\r\n }\r\n }\r\n public HasInstrumentEventsGroupPermissions(serviceGroupId?: number): boolean {\r\n if (serviceGroupId === undefined) {\r\n return false;\r\n }\r\n if (!this.Roles.includes(Roles.InventoryAdmin)) {\r\n return false;\r\n } else {\r\n return this.InstrumentEventsGroups.some(f => f.Id === serviceGroupId);\r\n }\r\n }\r\n public IsAllAdminGroupPermissions(serviceGroups?: number[]): boolean {\r\n if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n return serviceGroups.every(f =>\r\n this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === false),\r\n );\r\n }\r\n return false;\r\n }\r\n public IsAllServicesAdmin(services?: IServiceTypeFilterDto[]): boolean {\r\n if (services === undefined || services.length < 1) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (\r\n this.Roles.includes(Roles.GroupAdministrators) ||\r\n this.Roles.includes(Roles.EquipmentAdministrator)\r\n ) {\r\n return services.every(f =>\r\n this.AdminEquipments.some(\r\n s =>\r\n s.Id === f.Id &&\r\n s.ServiceTypeId === f.ServiceTypeId &&\r\n s.IsLabTech === false,\r\n ),\r\n );\r\n }\r\n return false;\r\n }\r\n public HasSomeAdminGroupPermissions(serviceGroups?: number[]): boolean {\r\n if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n return serviceGroups.some(f =>\r\n this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === false),\r\n );\r\n }\r\n return false;\r\n }\r\n public HasSomeAdminServicesPermissions(\r\n services?: IServiceTypeFilterDto[],\r\n ): boolean {\r\n if (services === undefined || services.length < 1) {\r\n return this.Roles.includes(Roles.Administrators);\r\n }\r\n if (this.Roles.includes(Roles.Administrators)) {\r\n return true;\r\n }\r\n if (\r\n this.Roles.includes(Roles.GroupAdministrators) ||\r\n this.Roles.includes(Roles.EquipmentAdministrator)\r\n ) {\r\n return services.some(f =>\r\n this.AdminEquipments.some(\r\n s =>\r\n s.Id === f.Id &&\r\n s.ServiceTypeId === f.ServiceTypeId &&\r\n s.IsLabTech === false,\r\n ),\r\n );\r\n }\r\n return false;\r\n }\r\n public HasSomeLabTechGroupPermissions(serviceGroups?: number[]): boolean {\r\n if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n return false;\r\n }\r\n if (this.Roles.includes(Roles.LabTech)) {\r\n return serviceGroups.some(f =>\r\n this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === true),\r\n );\r\n }\r\n return false;\r\n }\r\n public HasSomeLabTechServicesPermissions(\r\n services?: IServiceTypeFilterDto[],\r\n ): boolean {\r\n if (services === undefined || services.length < 1) {\r\n return false;\r\n }\r\n if (this.Roles.includes(Roles.LabTech)) {\r\n return services.some(f =>\r\n this.AdminEquipments.some(\r\n s =>\r\n s.Id === f.Id &&\r\n s.ServiceTypeId === f.ServiceTypeId &&\r\n s.IsLabTech === true,\r\n ),\r\n );\r\n }\r\n return false;\r\n }\r\n public IsAllLabTechGroupPermissions(serviceGroups?: number[]): boolean {\r\n if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n return false;\r\n }\r\n if (this.Roles.includes(Roles.LabTech)) {\r\n return serviceGroups.every(f =>\r\n this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === true),\r\n );\r\n }\r\n return false;\r\n }\r\n public IsAllServicesLabTech(services?: IServiceTypeFilterDto[]): boolean {\r\n if (services === undefined || services.length < 1) {\r\n return false;\r\n }\r\n if (this.Roles.includes(Roles.LabTech)) {\r\n return services.every(f =>\r\n this.AdminEquipments.some(\r\n s =>\r\n s.Id === f.Id &&\r\n s.ServiceTypeId === f.ServiceTypeId &&\r\n s.IsLabTech === true,\r\n ),\r\n );\r\n }\r\n return false;\r\n }\r\n public IsAllGroupOrLabTechAdmin(\r\n serviceGroups?: number[],\r\n services?: IServiceTypeFilterDto[],\r\n ): boolean {\r\n return (\r\n this.IsAllAdminGroupPermissions(serviceGroups) ||\r\n this.IsAllServicesAdmin(services) ||\r\n this.IsAllLabTechGroupPermissions(serviceGroups) ||\r\n this.IsAllServicesLabTech(services)\r\n );\r\n }\r\n public IsAllInstrumentEventsGroupPermissions(\r\n serviceGroups?: number[],\r\n ): boolean {\r\n if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n return false;\r\n }\r\n\r\n if (this.Roles.includes(Roles.InventoryAdmin)) {\r\n return serviceGroups.every(f =>\r\n this.InstrumentEventsGroups.some(g => g.Id === f),\r\n );\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport function isInRole(\r\n user: IAuthenticatedUser | undefined,\r\n role: string | Roles,\r\n): boolean {\r\n if (user && user.Roles.length > 0) {\r\n let baseRoles = enumToArray(Roles);\r\n let odjRoles = enumToDescriptedArray(Roles);\r\n if (intersection(user.Roles, baseRoles).length > 0) {\r\n if (typeof role === 'string') {\r\n return (\r\n odjRoles.filter(\r\n item =>\r\n item.description.toLowerCase() === (role as string).toLowerCase(),\r\n ).length > 0\r\n );\r\n } else {\r\n return user.Roles.includes(role as Roles);\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n// export function isServiseGroupAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// ServiceGroups: Identifiable[] | undefined,\r\n// ): boolean {\r\n// if (\r\n// user &&\r\n// ServiceGroups &&\r\n// ServiceGroups.length > 0 &&\r\n// user.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n// ) {\r\n// const sg = user.AdminServiceGroups;\r\n// if (sg) {\r\n// for (var i = 0; i < sg.length; i++) {\r\n// const Id = sg[i].Id;\r\n// if (ServiceGroups.some(item => item.Id === Id)) {\r\n// return true;\r\n// }\r\n// }\r\n// return false;\r\n// } else {\r\n// return false;\r\n// }\r\n// } else {\r\n// return false;\r\n// }\r\n// }\r\n// export function isAllServiseGroupAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// ServiceGroups: Entity[] | undefined,\r\n// ): boolean {\r\n// if (\r\n// user &&\r\n// ServiceGroups &&\r\n// ServiceGroups.length > 0 &&\r\n// user.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n// ) {\r\n// const sg = user.AdminServiceGroups;\r\n// if (sg) {\r\n// if (ServiceGroups.every(item => sg.some(g => g.Id === item.Id))) {\r\n// return true;\r\n// }\r\n// return false;\r\n// } else {\r\n// return false;\r\n// }\r\n// } else {\r\n// return false;\r\n// }\r\n// }\r\n// export function isServiceGroupOrLabTechAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// Services: number[] | undefined,\r\n// ServiceGroups: number[] | undefined,\r\n// ): boolean {\r\n// let result = false;\r\n// if (user !== undefined) {\r\n// if (\r\n// ServiceGroups !== undefined &&\r\n// user.Roles.includes(Roles.GroupAdministrators)\r\n// ) {\r\n// const sg = user.AdminServiceGroups;\r\n// if (\r\n// sg !== undefined &&\r\n// ServiceGroups.every(item => sg.some(g => g.Id === item))\r\n// ) {\r\n// result = true;\r\n// }\r\n// } else if (user.Roles.includes(Roles.LabTech)) {\r\n// const sg = user.AdminServiceGroups;\r\n// const eqs = user.AdminEquipments;\r\n// let isLabAdmin = false;\r\n// let isEqAdmin = false;\r\n// if (ServiceGroups !== undefined) {\r\n// if (\r\n// sg !== undefined &&\r\n// ServiceGroups.every(item => sg.some(g => g.Id === item))\r\n// ) {\r\n// isLabAdmin = true;\r\n// }\r\n// }\r\n// if (Services !== undefined) {\r\n// if (\r\n// eqs !== undefined &&\r\n// Services.every(item => eqs.some(eq => eq === item))\r\n// ) {\r\n// isEqAdmin = true;\r\n// }\r\n// }\r\n// result = isLabAdmin || isEqAdmin;\r\n// } else if (user.Roles.includes(Roles.EquipmentAdministrator)) {\r\n// if (Services !== undefined) {\r\n// const eqs = user.AdminEquipments;\r\n// if (\r\n// eqs !== undefined &&\r\n// Services.every(item => eqs.some(eq => eq === item))\r\n// ) {\r\n// result = true;\r\n// }\r\n// }\r\n// }\r\n// }\r\n// return result;\r\n// }\r\n// export function isOnlineServicesAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// Services: Entity[] | undefined,\r\n// ): boolean {\r\n// if (\r\n// user &&\r\n// Services &&\r\n// Services.length > 0 &&\r\n// (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n// user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n// ) {\r\n// const eqs: IServiceTypeFilterDto[] | undefined = user.AllAdminEquipments;\r\n// if (!!eqs && eqs.length > 0) {\r\n// let result = eqs\r\n// .filter(f => f.ServiceTypeId === 1)\r\n// .filter(f => Services.some(item => item.Id === f.Id));\r\n// return result.length > 0;\r\n// } else {\r\n// return false;\r\n// }\r\n// } else {\r\n// return false;\r\n// }\r\n// }\r\n// export function isServiceAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// Service: number | undefined,\r\n// ServiceTypeId: ServiceType,\r\n// ): boolean {\r\n// if (\r\n// user &&\r\n// Service &&\r\n// (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n// user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n// ) {\r\n// if (\r\n// user.AllAdminEquipments?.some(\r\n// item => item.Id === Service && item.ServiceTypeId === ServiceTypeId,\r\n// )\r\n// ) {\r\n// return true;\r\n// }\r\n// return false;\r\n// } else {\r\n// return false;\r\n// }\r\n// }\r\n// export function isAllServiceAdmin(\r\n// user: IAuthenticatedUser | undefined,\r\n// Services: IServiceTypeFilterDto[],\r\n// ): boolean {\r\n// if (\r\n// user &&\r\n// Services.length > 0 &&\r\n// (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n// user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n// user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n// ) {\r\n// if (\r\n// user.AllAdminEquipments?.some(item =>\r\n// Services.some(\r\n// f => f.Id === item.Id && f.ServiceTypeId === item.ServiceTypeId,\r\n// ),\r\n// )\r\n// ) {\r\n// return true;\r\n// }\r\n// return false;\r\n// } else {\r\n// return false;\r\n// }\r\n// }\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { Entity } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { samplePlatesSaga } from './saga';\r\nimport {\r\n IBulkSamplePlateCreate,\r\n ISamplePlateCreate,\r\n SamplePlatesState,\r\n SamplePlatesTableState,\r\n} from './types';\r\n\r\nexport const initialState: SamplePlatesState = {\r\n data: { processing: false },\r\n create: { processing: false },\r\n bulckCreate: { processing: false },\r\n update: { processing: false },\r\n delete: { processing: false },\r\n tableState: {\r\n pageSize: 10,\r\n pageIndex: 0,\r\n sortBy: [{ id: 'Id', desc: true }],\r\n customFilters: [],\r\n globalFilter: '',\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'samplePlates',\r\n initialState,\r\n reducers: {\r\n get(state, action: PayloadAction) {\r\n state.data.processing = true;\r\n state.tableState = {\r\n pageSize: action.payload.pageSize,\r\n pageIndex: action.payload.pageIndex,\r\n sortBy: action.payload.sortBy,\r\n globalFilter: action.payload.globalFilter,\r\n serviceGroups:\r\n action.payload.serviceGroups?.length !== 0\r\n ? action.payload.serviceGroups\r\n : undefined,\r\n visibleColumns: action.payload.visibleColumns,\r\n customFilters: action.payload.customFilters?.map(filter => ({\r\n fieldName: filter.fieldName,\r\n operator: filter.operator,\r\n value: filter.value,\r\n })),\r\n };\r\n },\r\n get_Success(state, action: PayloadAction) {\r\n state.data.processing = false;\r\n state.data.error = undefined;\r\n state.data.data = action.payload.value;\r\n state.data.dataLength = action.payload['@odata.count'];\r\n },\r\n get_Error(state, action: PayloadAction) {},\r\n\r\n export(state, action: PayloadAction) {},\r\n\r\n getPlateTypes_Success(state, action: PayloadAction[]>) {\r\n state.plateTypes = action.payload;\r\n },\r\n\r\n showCreate(\r\n state,\r\n action: PayloadAction<{ serviceGroups: Entity[] }>,\r\n ) {\r\n state.create.open = true;\r\n state.create.initialValues = {\r\n IsRack: false,\r\n ServiceGroup:\r\n action.payload.serviceGroups.length === 1\r\n ? action.payload.serviceGroups[0]\r\n : undefined,\r\n SamplePlateType: state.plateTypes?.[0],\r\n Active: true,\r\n };\r\n },\r\n showBulkCreate(\r\n state,\r\n action: PayloadAction<{ serviceGroups: Entity[] }>,\r\n ) {\r\n state.bulckCreate.open = true;\r\n state.bulckCreate.initialValues = {\r\n IsRack: false,\r\n ServiceGroup:\r\n action.payload.serviceGroups.length === 1\r\n ? action.payload.serviceGroups[0]\r\n : undefined,\r\n SamplePlateType: state.plateTypes?.[0],\r\n Active: true,\r\n };\r\n },\r\n hideCreate(state, action: PayloadAction) {\r\n state.create.processing = false;\r\n state.create.open = false;\r\n },\r\n hideBulkCreate(state, action: PayloadAction) {\r\n state.bulckCreate.processing = false;\r\n state.bulckCreate.open = false;\r\n },\r\n create(state, action: PayloadAction) {\r\n state.create.processing = true;\r\n },\r\n bulkCreate(state, action: PayloadAction) {\r\n state.bulckCreate.processing = true;\r\n },\r\n bulkCreate_SetProgress(state, action: PayloadAction) {\r\n state.bulckCreate.progress = action.payload;\r\n },\r\n create_Success(state, action: PayloadAction) {\r\n state.create.processing = false;\r\n state.create.open = false;\r\n },\r\n bulkCreate_Success(state, action: PayloadAction) {\r\n state.bulckCreate.processing = false;\r\n state.bulckCreate.open = false;\r\n },\r\n create_Error(state, action: PayloadAction) {},\r\n bulkCreate_Error(state, action: PayloadAction) {},\r\n\r\n hideUpdate(state, action: PayloadAction) {\r\n state.update.processing = false;\r\n state.update.open = false;\r\n },\r\n edit(state, action: PayloadAction) {\r\n state.update.processing = false;\r\n state.update.open = true;\r\n state.update.initialValues = {\r\n Id: action.payload.Id,\r\n Location: toEntity(\r\n action.payload.LocationId,\r\n action.payload.LocationName,\r\n ),\r\n Room: toEntity(action.payload.RoomId, action.payload.RoomName),\r\n SamplePlateType: toEntity(\r\n action.payload.SamplePlateTypeId,\r\n action.payload.SamplePlateTypeName,\r\n ),\r\n ServiceGroup: toEntity(\r\n action.payload.ServiceGroupId,\r\n action.payload.ServiceGroupName,\r\n ),\r\n IsRack: action.payload.IsRack,\r\n Active: action.payload.Active,\r\n };\r\n },\r\n update(\r\n state,\r\n action: PayloadAction<{\r\n original: ISamplePlateCreate;\r\n current: Partial;\r\n }>,\r\n ) {\r\n state.update.processing = true;\r\n },\r\n update_Success(state, action: PayloadAction>) {\r\n state.update.processing = false;\r\n state.update.open = false;\r\n state.update.initialValues = undefined;\r\n },\r\n update_Error(state, action: PayloadAction) {},\r\n\r\n delete(state, action: PayloadAction) {\r\n state.delete.processing = true;\r\n },\r\n delete_Success(state, action: PayloadAction) {},\r\n delete_Error(state, action: PayloadAction) {},\r\n\r\n deactivatePlates(state, action: PayloadAction) {},\r\n deactivatePlates_Success(state, action: PayloadAction) {},\r\n deactivatePlates_Error(state, action: PayloadAction) {},\r\n\r\n deletePlates(state, action: PayloadAction) {},\r\n deletePlates_Success(state, action: PayloadAction) {},\r\n deletePlates_Error(state, action: PayloadAction) {},\r\n },\r\n});\r\n\r\nexport const { actions: samplePlatesActions } = slice;\r\n\r\nexport const useSamplePlatesSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: samplePlatesSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useSamplePlatesSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import {\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n InputLabel,\r\n} from '@material-ui/core';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { RichTextEditor, RichTextEditorProps } from '../RichTextEditor';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { FormControlProps } from './FormControls/FormControl';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport const FormRichTextField = ({\r\n onChange,\r\n onBlur,\r\n value,\r\n hasMentions,\r\n onChangeMentions,\r\n autoFocus,\r\n additionalButtons,\r\n isInvoiceTemplateEditor,\r\n extendedMode,\r\n labelOnTop,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps &\r\n Omit) => {\r\n const [field, meta, helpers] = useField({ ...props });\r\n const handleChange = (value: string | undefined | null) => {\r\n // formik is not happy with neither undefined nor null\r\n const formikValue = value ?? '';\r\n field.onChange(formikValue);\r\n helpers.setValue(formikValue, true);\r\n onChange?.(value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\nexport interface RichTextFieldProps\r\n extends RichTextEditorProps,\r\n Pick {\r\n error?: string;\r\n label?: string;\r\n info?: string;\r\n\r\n helperText?: string;\r\n}\r\nexport function RichTextField({\r\n className,\r\n error,\r\n fullWidth,\r\n disabled,\r\n label,\r\n info,\r\n variant = 'outlined',\r\n helperText,\r\n labelOnTop,\r\n ...props\r\n}: RichTextFieldProps) {\r\n const [controlsVisible, setControlsVisible] = React.useState(false);\r\n return (\r\n <>\r\n \r\n {label && (\r\n <>\r\n {labelOnTop ? (\r\n \r\n {label}\r\n \r\n ) : (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n )}\r\n\r\n \r\n {error !== undefined ||\r\n (!!helperText && (\r\n \r\n {error || helperText}\r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { AssetIdentifier } from 'app/pages/AssetPopUp/components/Utils';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ServiceTypeUnion } from 'enums/ServiceTypes';\r\nimport { Row } from 'react-table';\r\nimport { AssetPopUpProps } from 'app/pages/AssetPopUp/index';\r\nimport { pick } from 'lodash';\r\n\r\ninterface AssetLinkIdentifierProps {\r\n id?: number;\r\n serviceId?: number;\r\n serviceType?: ServiceTypeUnion;\r\n}\r\nexport type AssetLinkProps = AssetIdentifier & {\r\n children: React.ReactNode;\r\n title?: string;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n};\r\n\r\nexport const AssetLink = (props: AssetLinkProps) => {\r\n const { t } = useTranslation();\r\n const openAsset = useOpenAssetPopUp();\r\n\r\n const open = () => {\r\n openAsset(\r\n pick(props, 'id', 'serviceId', 'serviceType') as AssetIdentifier,\r\n props.openPanelWithCover,\r\n );\r\n };\r\n return (\r\n \r\n open()}\r\n color=\"textPrimary\"\r\n >\r\n {props.children}\r\n \r\n \r\n );\r\n};\r\n\r\nexport type UseOpenAssetPopUpProps = AssetIdentifier & {\r\n useSidePanel?: boolean;\r\n};\r\nexport const useOpenAssetPopUp = () => {\r\n const { openPanel } = useSidePanelState();\r\n\r\n return React.useCallback(\r\n (\r\n props: UseOpenAssetPopUpProps,\r\n openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n ) => {\r\n const identifier = props;\r\n if (identifier !== undefined) {\r\n const assetPopupProps: AssetPopUpProps = {\r\n identifier: identifier,\r\n useSidePanel: props.useSidePanel ?? false,\r\n };\r\n if (!!openPanelWithCover) {\r\n openPanelWithCover({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: assetPopupProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n });\r\n } else {\r\n openPanel({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: assetPopupProps,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState);\r\n }\r\n }\r\n },\r\n [openPanel],\r\n );\r\n};\r\n\r\ninterface PrimaryActionDynamicRow extends IRow {\r\n Id?: number;\r\n serviceId?: number;\r\n serviceType?: ServiceTypeUnion;\r\n}\r\n\r\n//used for Dashboard tadles\r\nexport const OpenAssetPrimaryAction: PrimaryActionDynamic = (\r\n openPanel,\r\n row,\r\n toggle,\r\n user,\r\n useSidePanel,\r\n) => {\r\n const identifier = getAssetIdentifier(row);\r\n if (identifier === undefined) {\r\n console.error('no asset identifier found for row ', row);\r\n } else {\r\n const props: AssetPopUpProps = {\r\n identifier: identifier,\r\n useSidePanel: useSidePanel ?? false,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: props,\r\n useSidePanel: useSidePanel,\r\n expanded: false,\r\n isCover: useSidePanel,\r\n });\r\n }\r\n};\r\nfunction getAssetIdentifier(\r\n row: Row,\r\n): AssetIdentifier | undefined {\r\n return getAssetLinkIdentifier({\r\n id: row.original.Id,\r\n serviceId: row.original.serviceId,\r\n serviceType: row.original.serviceType,\r\n });\r\n}\r\n\r\nfunction getAssetLinkIdentifier(\r\n row: AssetLinkIdentifierProps,\r\n): AssetIdentifier | undefined {\r\n if (row.id !== undefined) {\r\n return {\r\n id: row.id,\r\n };\r\n } else if (row.serviceId !== undefined && row.serviceType !== undefined) {\r\n return {\r\n serviceId: row.serviceId,\r\n serviceType: row.serviceType,\r\n };\r\n }\r\n}\r\n","export enum RestrictDurationUnitTypes {\r\n LimitMinutes = 1,\r\n LimitHours = 2,\r\n LimitDays = 3,\r\n LimitWeeks = 4,\r\n LimitMonths = 5,\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { IViewState, ViewLengths, ViewModes, ViewTypes } from '../slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n getPeriodTypesEntity,\r\n getPeriodTypesEntityById,\r\n PeriodTypes,\r\n PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport {\r\n SchedulerDatePositionArray,\r\n SchedulerDatePositionUnion,\r\n} from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { serializeSchedulerDate } from './formatSchedulerDateOrUndefined';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { isSameMonth, isSameYear } from 'date-fns';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IEquipmentWorkingHoursDto } from 'api/odata/generated/entities/IEquipmentWorkingHoursDto';\r\nimport { orderBy } from 'lodash';\r\n\r\n/**\r\n * Returns view length (day/week/etc.) for a given view mode\r\n * @param viewMode scheduler viewMode\r\n * @returns view length\r\n */\r\nexport function getViewLength(viewMode: ViewModes) {\r\n return viewMode.split('_')[0] as ViewLengths;\r\n}\r\n\r\n/**\r\n * Returns the view type part of the viewmode e.g. week_timeline -> timeline\r\n * @param viewMode scheduler viewMode\r\n * @returns view type\r\n */\r\nexport function getViewType(viewMode: ViewModes) {\r\n const parts = viewMode.split('_');\r\n if (parts.length === 1) {\r\n return 'calendar';\r\n } else if (parts[1] === 'unit') {\r\n return 'calendar';\r\n } else {\r\n return parts[1] as ViewTypes;\r\n }\r\n}\r\n\r\n/**\r\n * Returns parsed viewMode\r\n * @param viewMode scheduler viewmode\r\n * @returns\r\n */\r\nexport function parseViewMode(viewMode: ViewModes) {\r\n return {\r\n viewType: getViewType(viewMode),\r\n viewLength: getViewLength(viewMode),\r\n };\r\n}\r\nexport function getNextViewLength(\r\n length: ViewLengths,\r\n customDaysEnabled?: boolean,\r\n twoDaysEnabled?: boolean,\r\n): ViewLengths {\r\n switch (length) {\r\n case 'day':\r\n return twoDaysEnabled\r\n ? 'twodays'\r\n : customDaysEnabled\r\n ? 'customdays'\r\n : 'week';\r\n case 'twodays':\r\n return customDaysEnabled ? 'customdays' : 'week';\r\n case 'customdays':\r\n return 'week';\r\n case 'week':\r\n return 'month';\r\n case 'month':\r\n return 'quarter';\r\n case 'quarter':\r\n return 'year';\r\n default:\r\n return length;\r\n }\r\n}\r\nexport function getPrevViewLength(\r\n length: ViewLengths,\r\n customDaysEnabled?: boolean,\r\n twoDaysEnabled?: boolean,\r\n): ViewLengths {\r\n switch (length) {\r\n case 'twodays':\r\n return 'day';\r\n case 'customdays':\r\n return twoDaysEnabled ? 'twodays' : 'day';\r\n case 'week':\r\n return customDaysEnabled\r\n ? 'customdays'\r\n : twoDaysEnabled\r\n ? 'twodays'\r\n : 'day';\r\n case 'month':\r\n return 'week';\r\n case 'quarter':\r\n return 'month';\r\n case 'year':\r\n return 'quarter';\r\n default:\r\n return length;\r\n }\r\n}\r\n/**\r\n * Combines view mode and view type into scheduler view mode e.g. 'weekly' & 'calendar' -> 'weekly'\r\n * @param param0 view mode and view type\r\n * @returns\r\n */\r\nexport const getSchedulerViewMode = (\r\n viewType: 'calendar' | 'timeline',\r\n viewlength: ViewLengths,\r\n isMobile: boolean,\r\n): ViewModes => {\r\n switch (viewType) {\r\n case 'calendar':\r\n switch (viewlength) {\r\n case 'day':\r\n case 'twodays':\r\n case 'customdays':\r\n return isMobile ? 'day' : 'day_unit';\r\n case 'week':\r\n return 'week';\r\n case 'month':\r\n return 'month';\r\n case 'quarter':\r\n return 'quarter';\r\n case 'year':\r\n return 'year';\r\n case 'customPeriod':\r\n return 'day_unit';\r\n default:\r\n assertExhaustive(viewlength);\r\n }\r\n break;\r\n case 'timeline':\r\n return `${viewlength}_${viewType}`;\r\n default:\r\n assertExhaustive(viewType);\r\n }\r\n};\r\n/**\r\n * Gets the schedulr view type\r\n * @param viewType view type\r\n * @param viewlength view length\r\n * @param isMobile mobile\r\n * @returns\r\n */\r\nexport const getSchedulerViewType = (\r\n viewType: 'calendar' | 'timeline',\r\n viewlength: ViewLengths,\r\n isMobile: boolean,\r\n): 'calendar' | 'unit' | 'timeline' => {\r\n switch (viewType) {\r\n case 'calendar':\r\n switch (viewlength) {\r\n case 'day':\r\n case 'twodays':\r\n case 'customdays':\r\n return isMobile ? 'calendar' : 'unit';\r\n case 'week':\r\n case 'month':\r\n return viewType;\r\n case 'quarter':\r\n case 'year':\r\n return 'timeline';\r\n case 'customPeriod':\r\n return viewType === 'calendar' ? 'unit' : 'timeline';\r\n default:\r\n assertExhaustive(viewlength);\r\n }\r\n break;\r\n case 'timeline':\r\n return viewType;\r\n default:\r\n assertExhaustive(viewType);\r\n }\r\n};\r\n/**\r\n * Gets the start of the displayed period\r\n * @param viewLength view length\r\n * @param datets date\r\n * @returns start of the period\r\n */\r\nexport const getViewStartDate = (\r\n viewLength: ViewLengths,\r\n datets?: Timestamp,\r\n customStart?: boolean,\r\n) => {\r\n const date = datets === undefined ? undefined : dateUtils.parseISO(datets);\r\n if (date === undefined) {\r\n return undefined;\r\n }\r\n\r\n switch (viewLength) {\r\n case 'day':\r\n case 'twodays':\r\n case 'customdays':\r\n return dateUtils.startOfDay(date);\r\n case 'week':\r\n return customStart\r\n ? dateUtils.startOfDay(date)\r\n : dateUtils.startOfWeek(date);\r\n case 'month':\r\n return customStart\r\n ? dateUtils.startOfDay(date)\r\n : dateUtils.startOfMonth(date);\r\n case 'quarter':\r\n return customStart\r\n ? dateUtils.startOfDay(date)\r\n : dateUtils.startOfQuarter(date);\r\n case 'year':\r\n return customStart\r\n ? dateUtils.startOfDay(date)\r\n : dateUtils.startOfYear(date);\r\n }\r\n};\r\n/**\r\n * Gets the view end date\r\n * @param viewLength\r\n * @param datets\r\n * @returns\r\n */\r\nexport const getViewEndDate = (\r\n viewLength: ViewLengths,\r\n datets?: Timestamp,\r\n days?: number,\r\n customStart?: boolean,\r\n) => {\r\n const date = datets === undefined ? undefined : dateUtils.parseISO(datets);\r\n if (date === undefined) {\r\n return undefined;\r\n }\r\n switch (viewLength) {\r\n case 'day':\r\n return dateUtils.endOfDay(date);\r\n case 'twodays':\r\n return dateUtils.addDays(dateUtils.endOfDay(date), 1);\r\n case 'customdays':\r\n return dateUtils.addDays(dateUtils.endOfDay(date), !!days ? days - 1 : 2);\r\n case 'week':\r\n return customStart\r\n ? dateUtils.addDays(dateUtils.startOfDay(date), 6)\r\n : dateUtils.endOfWeek(date);\r\n case 'month':\r\n return customStart\r\n ? dateUtils.addMonths(date, 1)\r\n : dateUtils.endOfMonth(date);\r\n case 'quarter':\r\n return customStart\r\n ? dateUtils.addQuarters(date, 1)\r\n : dateUtils.endOfQuarter(date);\r\n case 'year':\r\n return customStart\r\n ? dateUtils.addYears(date, 1)\r\n : dateUtils.endOfYear(date);\r\n }\r\n};\r\n/**\r\n * Returns a display label for the dates period display\r\n * @param viewLength view length\r\n * @param date view date\r\n * @returns display label\r\n */\r\nexport const getPeriodDisplayLabel = (\r\n viewLength: ViewLengths,\r\n date: Timestamp,\r\n compact: boolean,\r\n customDays?: number,\r\n customStart?: boolean,\r\n) => {\r\n const start = getViewStartDate(viewLength, date, customStart);\r\n const end = getViewEndDate(viewLength, date, customDays, customStart);\r\n if (start === undefined || end === undefined) {\r\n return undefined;\r\n }\r\n switch (viewLength) {\r\n case 'year':\r\n return `${dateUtils.format(start, 'yyyy')}`;\r\n case 'quarter':\r\n if (isSameYear(start, end)) {\r\n return `${dateUtils.format(start, 'MMM')} - ${dateUtils.format(\r\n end,\r\n 'MMM yyyy',\r\n )}`;\r\n } else {\r\n return `${dateUtils.format(start, 'MMM yyyy')} - ${dateUtils.format(\r\n end,\r\n 'MMM yyyy',\r\n )}`;\r\n }\r\n case 'month':\r\n if (isSameYear(start, end)) {\r\n if (isSameMonth(start, end)) {\r\n return dateUtils.format(date, 'MMM');\r\n } else {\r\n return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n end,\r\n 'MMM dd yyyy',\r\n )}`;\r\n }\r\n } else {\r\n return `${dateUtils.format(start, 'MMM dd yyyy')} - ${dateUtils.format(\r\n end,\r\n 'MMM dd yyyy',\r\n )}`;\r\n }\r\n case 'day':\r\n return dateUtils.format(date, compact ? 'MMM dd' : 'MMM dd, yyyy');\r\n case 'week':\r\n if (isSameMonth(start, end)) {\r\n return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n end,\r\n 'dd',\r\n )}`;\r\n } else {\r\n return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n end,\r\n 'MMM dd',\r\n )}`;\r\n }\r\n case 'twodays':\r\n case 'customdays':\r\n case 'customPeriod':\r\n return `${dateUtils.format(\r\n start,\r\n compact ? 'MMM dd' : 'MMM dd, yyyy',\r\n )} - ${dateUtils.format(end, compact ? 'dd' : 'MMM dd')}`;\r\n default:\r\n assertExhaustive(viewLength);\r\n }\r\n};\r\n\r\nexport const periodTypeToLengthType = (\r\n periodType: PeriodTypes,\r\n): ViewLengths | undefined => {\r\n switch (periodType) {\r\n case 'Today':\r\n case 'Yesterday':\r\n case 'Tomorrow':\r\n return 'day';\r\n case 'TodayTomorrow':\r\n return 'twodays';\r\n case 'ThisWeek':\r\n case 'LastWeek':\r\n case 'NextWeek':\r\n return 'week';\r\n case 'LastMonth':\r\n case 'ThisMonth':\r\n case 'NextMonth':\r\n return 'month';\r\n case 'LastQuarter':\r\n case 'ThisQuarter':\r\n case 'NextQuarter':\r\n return 'quarter';\r\n case 'LastYear':\r\n case 'ThisYear':\r\n case 'NextYear':\r\n return 'year';\r\n default:\r\n return undefined;\r\n }\r\n};\r\nexport const lengthTypeToPeriodType = (\r\n lengthType: ViewLengths,\r\n): PeriodTypes | undefined => {\r\n switch (lengthType) {\r\n case 'day':\r\n return 'Today';\r\n case 'twodays':\r\n return 'TodayTomorrow';\r\n case 'week':\r\n return 'ThisWeek';\r\n case 'month':\r\n return 'ThisMonth';\r\n case 'customdays':\r\n return 'CustomDate';\r\n case 'quarter':\r\n return 'ThisQuarter';\r\n case 'year':\r\n return 'ThisYear';\r\n default:\r\n return undefined;\r\n }\r\n};\r\nexport const viewStateFromFilter = (\r\n periodType: PeriodTypesEntity | SchedulerDatePositionUnion,\r\n): Pick | undefined => {\r\n const periodTypeUnion =\r\n (periodType as PeriodTypesEntity)?.Id ??\r\n (periodType as SchedulerDatePositionUnion);\r\n const schedulerPreset:\r\n | SchedulerDatePositionUnion\r\n | undefined = SchedulerDatePositionArray.find(\r\n f => f.toLowerCase() === periodTypeUnion.toLowerCase(),\r\n );\r\n if (schedulerPreset === undefined) {\r\n return undefined;\r\n }\r\n const x = DatesRange.fromPreset(\r\n { Id: schedulerPreset as PeriodTypes, Name: '' },\r\n null,\r\n null,\r\n );\r\n\r\n if (x.start === null) {\r\n return undefined;\r\n }\r\n const length = periodTypeToLengthType(periodTypeUnion);\r\n if (length === undefined) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n preset: schedulerPreset,\r\n viewLength: length,\r\n date: serializeSchedulerDate(x.start),\r\n };\r\n};\r\nexport const getPeriodFromViewLength = (\r\n length: ViewLengths,\r\n date: Date,\r\n customDays?: number,\r\n) => {\r\n let value = Object.assign(\r\n new PresetDatesRange(),\r\n {\r\n type:\r\n (getPeriodTypesEntityById(\r\n lengthTypeToPeriodType(length),\r\n ) as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n },\r\n DatesRange.fromPreset(\r\n (getPeriodTypesEntityById(\r\n lengthTypeToPeriodType(length),\r\n ) as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n length === 'customdays' ? date : date,\r\n length === 'customdays'\r\n ? dateUtils.addDays(date, (customDays ?? 3) - 1)\r\n : dateUtils.parseISO(date),\r\n ),\r\n );\r\n return value;\r\n};\r\nexport function timelineColumnWidth(isMobile: boolean) {\r\n return isMobile ? 100 : 300;\r\n}\r\nexport const MatchUnitSlotToEnd = (\r\n startTime: Timestamp,\r\n endTime: Timestamp,\r\n unitType: RestrictDurationUnitTypes,\r\n amount: number,\r\n) => {\r\n const start = dateUtils.parseISO(startTime);\r\n const end = dateUtils.parseISO(endTime);\r\n let dateSt = start;\r\n let slotLength = 0;\r\n let lastCorrectEnd = new Date();\r\n let diffDuration = amount;\r\n switch (unitType) {\r\n case RestrictDurationUnitTypes.LimitMinutes:\r\n while (dateSt < end) {\r\n dateSt = dateUtils.addMinutes(dateSt, amount);\r\n slotLength++;\r\n }\r\n lastCorrectEnd = dateUtils.addMinutes(dateSt, -amount);\r\n diffDuration = dateUtils.getMinutesDiff(end, dateSt);\r\n let newMinutesEnd =\r\n slotLength > 1\r\n ? diffDuration <= amount / 2\r\n ? dateSt\r\n : lastCorrectEnd\r\n : dateSt;\r\n return newMinutesEnd;\r\n case RestrictDurationUnitTypes.LimitHours:\r\n while (dateSt < end) {\r\n dateSt = dateUtils.addHours(dateSt, amount);\r\n slotLength++;\r\n }\r\n lastCorrectEnd = dateUtils.addHours(dateSt, -amount);\r\n diffDuration = dateUtils.getHoursDiff(end, dateSt);\r\n let newHoursEnd =\r\n slotLength > 1\r\n ? diffDuration <= amount / 2\r\n ? dateSt\r\n : lastCorrectEnd\r\n : dateSt;\r\n return newHoursEnd;\r\n case RestrictDurationUnitTypes.LimitDays:\r\n while (dateSt < end) {\r\n dateSt = dateUtils.addDays(dateSt, amount);\r\n slotLength++;\r\n }\r\n lastCorrectEnd = dateUtils.addDays(dateSt, -amount);\r\n diffDuration = dateUtils.getDaysDiff(end, dateSt);\r\n let newDaysEnd =\r\n slotLength > 1\r\n ? diffDuration <= amount / 2\r\n ? dateSt\r\n : lastCorrectEnd\r\n : dateSt;\r\n return newDaysEnd;\r\n case RestrictDurationUnitTypes.LimitWeeks:\r\n while (dateSt < end) {\r\n dateSt = dateUtils.addWeeks(dateSt, amount);\r\n slotLength++;\r\n }\r\n lastCorrectEnd = dateUtils.addWeeks(dateSt, -amount);\r\n diffDuration = dateUtils.differenceInWeeks(end, dateSt);\r\n let newWeekEnd =\r\n slotLength > 1\r\n ? diffDuration <= amount / 2\r\n ? dateSt\r\n : lastCorrectEnd\r\n : dateSt;\r\n return newWeekEnd;\r\n case RestrictDurationUnitTypes.LimitMonths:\r\n while (dateSt < end) {\r\n dateSt = dateUtils.addMonths(dateSt, amount);\r\n slotLength++;\r\n }\r\n lastCorrectEnd = dateUtils.addMonths(dateSt, -amount);\r\n diffDuration = dateUtils.getMonthDiff(end, dateSt);\r\n let newMonthEnd =\r\n slotLength > 1\r\n ? diffDuration <= amount / 2\r\n ? dateSt\r\n : lastCorrectEnd\r\n : dateSt;\r\n return newMonthEnd;\r\n }\r\n};\r\nexport const fix_date = (date: Timestamp, duration: number) => {\r\n let start = dateUtils.parseISO(date);\r\n return dateUtils.addHours(start, duration);\r\n};\r\nexport function adjustToTimeSlot(\r\n startTime: Date,\r\n endTime: Date,\r\n workingHours: Array,\r\n minDuration?: number,\r\n) {\r\n let result = {\r\n start: startTime,\r\n end: endTime,\r\n };\r\n if (workingHours.length > 0) {\r\n // let correctEnd = endTime > correctStart ? endTime : correctStart;\r\n let weekStartDay = dateUtils.getDay(startTime);\r\n let slots = workingHours.map(f => {\r\n return {\r\n StartTime: dateUtils.dateFnsUtils.mergeDateAndTime(\r\n startTime,\r\n dateUtils.parseISO(f.StartTime),\r\n ),\r\n EndTime: dateUtils.dateFnsUtils.mergeDateAndTime(\r\n endTime,\r\n dateUtils.parseISO(f.EndTime),\r\n ),\r\n DayOfWeek: f.DayOfWeek,\r\n };\r\n });\r\n // .filter(f => f.StartTime < correctEnd && f.EndTime > startTime);\r\n let startSlots = slots.filter(\r\n s => s.DayOfWeek === weekStartDay && s.StartTime <= startTime,\r\n );\r\n if (startSlots.length > 0) {\r\n let startOrdered = orderBy(startSlots, f => f.StartTime, 'desc');\r\n result.start = startOrdered[0].StartTime;\r\n }\r\n let correctEnd =\r\n !!minDuration &&\r\n minDuration > 0 &&\r\n dateUtils.differenceInMinutes(endTime, result.start) < minDuration\r\n ? dateUtils.addMinutes(result.start, minDuration)\r\n : endTime;\r\n let weekEndDay = dateUtils.getDay(correctEnd);\r\n let endSlots = slots.filter(\r\n s => s.DayOfWeek === weekEndDay && s.EndTime >= correctEnd,\r\n );\r\n if (endSlots.length > 0) {\r\n let endOrdered = orderBy(endSlots, f => f.EndTime, 'asc');\r\n result.end = endOrdered[0].EndTime;\r\n }\r\n return result;\r\n } else {\r\n return result;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { CircularProgress } from '@material-ui/core';\r\n\r\nexport interface ProgressProps {\r\n inProgress: boolean;\r\n size: number;\r\n}\r\nexport function Progress({ inProgress, size }: ProgressProps) {\r\n return (\r\n \r\n {inProgress ? (\r\n \r\n ) : null}\r\n \r\n );\r\n}\r\n","import { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { PricingState } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\n\r\n/* --- STATE --- */\r\n\r\nexport interface OfflineServiceState {\r\n detailsState: AsyncDataState;\r\n connectedDataState: IConnectedFiltersDto;\r\n processing: boolean;\r\n consumablesProcessing: boolean;\r\n valueHandler?: FieldHandlerProps;\r\n serviceChangeResultState?: OfflineServiceTypeChangeResult;\r\n creditState: AsyncDataState;\r\n hasCharges?: boolean;\r\n savedReservationService?: IOtherServices;\r\n consumablesState: AsyncDataState;\r\n consumablesValueHandler?: FieldHandlerProps;\r\n selectedServiceTypes: Array;\r\n editCreatableService?: IOtherServices;\r\n barcodeScanned?: boolean;\r\n refeshOfflineServices?: boolean;\r\n stockRenewalState: AsyncDataState;\r\n stockRenewalValueHandler?: FieldHandlerProps;\r\n renewStockState: AsyncDataState;\r\n renewStockValueHandler?: FieldHandlerProps;\r\n inventoryBatchState: AsyncDataState;\r\n inventoryBatchValueHandler?: FieldHandlerProps;\r\n inventoryBatchEditable?: IInventoryBatchDto;\r\n isEdit?: boolean;\r\n batchIsEdit?: boolean;\r\n getCreatableService?: IOtherServices;\r\n}\r\nexport interface OfflineServiceQueryStringParameters {\r\n id?: string;\r\n ipid?: string;\r\n user?: string;\r\n bid?: string;\r\n be?: string;\r\n ecid?: string;\r\n po?: string;\r\n reference?: string;\r\n remarks?: string;\r\n factor?: string;\r\n amount?: string;\r\n adg?: string;\r\n stid?: string;\r\n ReservationId?: string;\r\n UsageId?: string;\r\n servicedate?: string;\r\n batchId?: string;\r\n}\r\nexport interface StockRenewalParams {\r\n stid?: string;\r\n servicedate?: string;\r\n}\r\nexport interface RenewStockParams {\r\n id?: string;\r\n stid?: string;\r\n servicedate?: string;\r\n remarks?: string;\r\n amount?: string;\r\n batchId?: string;\r\n}\r\nexport interface InventoryBatchParams {\r\n id?: string;\r\n name?: string;\r\n stid?: string;\r\n purchasedate?: string;\r\n lot?: string;\r\n inventory?: string;\r\n}\r\nexport interface OtherServiceDetailsState {\r\n Id: number;\r\n ServiceType: IOfflineServiceFilterDto | null;\r\n DiscountFactor?: number | null;\r\n Quantity?: number | null;\r\n ReservationId?: number | null;\r\n UsageId?: number | null;\r\n Remarks?: string | null;\r\n SyncReservation?: boolean | null;\r\n SyncUsage?: boolean | null;\r\n InventoryBatch?: IInventoryBatchDto | null;\r\n\r\n // ServiceDate: Date | string;\r\n // BookedBy: Entity | null;\r\n // UserGroup: Entity | null;\r\n // Budget: Entity | null;\r\n // InstituteProject: Entity | null;\r\n // ExternalCustomer?: Entity | null;\r\n // FundingType?: Entity | null;\r\n // PurchaseOrder?: string | null;\r\n // Reference?: string | null;\r\n // BudgetExperiment?: Entity | null;\r\n}\r\nexport interface ReportConsumablesState {\r\n Services: IOtherServices[];\r\n}\r\nexport interface RenewStockState {\r\n Id: number;\r\n ServiceType: IOfflineServiceFilterDto | null;\r\n DateReceived: Date | string;\r\n InventoryBatch?: IInventoryBatchDto | null;\r\n Quantity?: number | null;\r\n Remarks?: string | null;\r\n}\r\nexport interface InventoryBatchState {\r\n Id: number;\r\n Name: string;\r\n ServiceType: IOfflineServiceFilterDto | null;\r\n PurchaseDate?: Date | string | null;\r\n ExpirationDate?: Date | string | null;\r\n Inventory: number;\r\n Lot?: string | null;\r\n PurchasePricePerUnit: number | null;\r\n}\r\nexport interface StockRenewalState {\r\n Services: IOtherServices[];\r\n DateReceived: Date | string;\r\n AutoGenerateNewBatches?: boolean | null;\r\n}\r\nexport interface OfflineServicesResponse extends IResponseType {\r\n Id: number | null;\r\n data: IOtherServices | null;\r\n serviceType: Entity;\r\n IsValid: boolean;\r\n}\r\nexport interface InventoryBatchResponse extends IResponseType {\r\n Id: number | null;\r\n data: IInventoryBatchDto | null;\r\n serviceType: Entity;\r\n IsValid: boolean;\r\n}\r\nexport interface ConsumableServicesResponse extends IResponseType {\r\n Id: number[];\r\n data: IOtherServices[];\r\n IsValid: boolean;\r\n}\r\n\r\nexport interface ServiceChangeStateParameters {\r\n ServiceTypes: number[];\r\n ReservationId: number | null;\r\n UsageId: number | null;\r\n Start: Date | string;\r\n BookedBy: string | null;\r\n ADGroup: string | null;\r\n BudgetId: number | null;\r\n FundingTypeId: number;\r\n}\r\nexport interface ErrorServices {\r\n id: number;\r\n error?: string;\r\n}\r\nexport interface OfflineServiceTypeChangeResult {\r\n ErrorMessages: string[];\r\n DefaultBudget: IBudgetFilterDto | null;\r\n DefaultExperiment: IBudgetExperimentsFilterDto | null;\r\n}\r\nexport const ConvertDtoToModel = (\r\n service: IOtherServices,\r\n serviceType: IOfflineServiceFilterDto | null,\r\n): OtherServiceDetailsState => {\r\n let model = {\r\n Id: service.Id,\r\n ServiceType: serviceType,\r\n ServiceTypeId: ServiceType.Offline,\r\n DiscountFactor: service.DiscountFactor,\r\n Quantity: service.Quantity ?? service.DefaultQuantity,\r\n Remarks: service.Remarks,\r\n ReservationId: service.ReservationId,\r\n UsageId: service.UsageId,\r\n InventoryBatch:\r\n service.InventoryBatchId === null\r\n ? null\r\n : ({\r\n Id: service.InventoryBatchId,\r\n Name: service.InventoryBatchName,\r\n Inventory: service.InventoryBatchAmount,\r\n } as IInventoryBatchDto),\r\n } as OtherServiceDetailsState;\r\n return model;\r\n};\r\nexport const ConvertConsumablesToModel = (\r\n services: IOtherServices[],\r\n): ReportConsumablesState => {\r\n return {\r\n Services: services,\r\n DiscountFactor: 1,\r\n Remarks: null,\r\n } as ReportConsumablesState;\r\n};\r\nexport const ConvertConsumablesToRenewalModel = (\r\n services: IOtherServices[],\r\n date: Date | string,\r\n): StockRenewalState => {\r\n return {\r\n Services: services,\r\n DateReceived: dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n AutoGenerateNewBatches: true,\r\n } as StockRenewalState;\r\n};\r\nexport const ConvertRenewStockToModel = (\r\n service: IOtherServices,\r\n serviceType: IOfflineServiceFilterDto | null,\r\n): RenewStockState => {\r\n let model = {\r\n Id: service.Id,\r\n ServiceType: serviceType,\r\n // service.ServiceTypeID > 0\r\n // ? ({\r\n // Id: service.ServiceTypeID,\r\n // Name: service.ServiceType,\r\n // Active: true,\r\n // AllowToUser: service.AllowToUser,\r\n // DefaultQuantity: service.DefaultQuantity,\r\n // HideProjects: service.HideProjects,\r\n // IntQuantityOnly: service.IntQuantityOnly,\r\n // Inventory: service.Inventory,\r\n // ReservationOverlappingInventory:\r\n // service.ReservationOverlappingInventory,\r\n // ServiceGroupId: service.ServiceGroupId,\r\n // ServiceTypeId: 2,\r\n // StaffOnly: service.StaffOnly,\r\n // UnitTypeID: service.UnitTypeId,\r\n // UnitTypeName: service.Units,\r\n // NotLessThanZero: service.NotLessThanZero,\r\n // TrackInventory: service.TrackInventory,\r\n // InventoryBatchesEnabled: service.InventoryBatchesEnabled,\r\n // } as IOfflineServiceFilterDto)\r\n // : null,\r\n Quantity: service.Quantity ?? service.DefaultQuantity,\r\n Remarks: service.Remarks,\r\n InventoryBatch:\r\n service.InventoryBatchId === null\r\n ? null\r\n : ({\r\n Id: service.InventoryBatchId,\r\n Name: service.InventoryBatchName,\r\n Inventory: service.InventoryBatchAmount,\r\n } as IInventoryBatchDto),\r\n DateReceived: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(service.ServiceDate),\r\n ),\r\n } as RenewStockState;\r\n return model;\r\n};\r\nexport const ConvertInventoryBatchToModel = (\r\n batch: IInventoryBatchDto,\r\n serviceType: IOfflineServiceFilterDto | null,\r\n newDate: Date | string,\r\n): InventoryBatchState => {\r\n let model = {\r\n Id: batch.Id,\r\n ServiceType: serviceType,\r\n Inventory: batch.Inventory,\r\n Name: batch.Name,\r\n PurchasePricePerUnit: batch.PurchasePricePerUnit,\r\n ExpirationDate: batch.ExpirationDate,\r\n Lot: batch.Lot,\r\n PurchaseDate: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(batch.PurchaseDate || newDate),\r\n ),\r\n } as InventoryBatchState;\r\n return model;\r\n};\r\nexport const ConvertDtoToConnectedModel = (\r\n service: IOtherServices,\r\n): IConnectedFiltersDto => {\r\n let model = {\r\n User: toEntity(service.BookedBy, service.UserDisplayName),\r\n UserGroup: toEntity(service.UserGroup, service.UserGroupName),\r\n Budget: toEntity(service.BudgetID, service.Budget),\r\n InstituteProject: toEntity(\r\n service.InstituteProjectId,\r\n service.InstituteProjectName,\r\n ),\r\n StartTime: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(service.ServiceDate),\r\n ),\r\n BudgetExperiment: toEntity(\r\n service.BudgetExperimentId,\r\n service.BudgetExperimentName,\r\n ),\r\n ExternalCustomer: toEntity(\r\n service.ExternalCustomerId,\r\n service.ExternalCustomerName,\r\n ),\r\n FundingType: getSingleInvoiceFundingType(service.FundingType ?? 0),\r\n PurchaseOrder: service.PurchaseOrder,\r\n Reference: service.Reference,\r\n } as IConnectedFiltersDto;\r\n return model;\r\n};\r\nexport const ConvertModelToInsertEntity = (\r\n model: OtherServiceDetailsState,\r\n connectedModel: IConnectedFiltersDto,\r\n) => {\r\n let data = {\r\n Id: model.Id,\r\n BudgetID: connectedModel.Budget?.Id || null,\r\n Budget: connectedModel.Budget?.Name,\r\n UserGroup: connectedModel.UserGroup?.Id || null,\r\n UserGroupName: connectedModel.UserGroup?.Name,\r\n BookedBy: connectedModel.User?.Id,\r\n UserDisplayName: connectedModel.User?.Name,\r\n ServiceTypeID: model.ServiceType?.Id,\r\n ServiceType: model.ServiceType?.Name,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n ),\r\n Quantity: +(model.Quantity ?? 0).toString(),\r\n DiscountFactor: Number(model.DiscountFactor ?? 1),\r\n Remarks: model.Remarks,\r\n FundingType: connectedModel.FundingType?.Id,\r\n BudgetExperimentId: connectedModel.BudgetExperiment?.Id,\r\n BudgetExperimentName: connectedModel.BudgetExperiment?.Name,\r\n ReservationId: model.ReservationId,\r\n UsageId: model.UsageId,\r\n ExternalCustomerId: connectedModel.ExternalCustomer?.Id,\r\n ExternalCustomerName: connectedModel.ExternalCustomer?.Name,\r\n SyncReservation: false,\r\n SyncUsage: false,\r\n StaffOnly: model.ServiceType?.StaffOnly || false,\r\n InstituteProjectId: connectedModel.InstituteProject?.Id,\r\n InstituteProjectName: connectedModel.InstituteProject?.Name,\r\n PurchaseOrder: connectedModel.PurchaseOrder,\r\n Reference: connectedModel.Reference,\r\n BudgetsTurnedOn: model.ServiceType?.BudgetsTurnedOn,\r\n DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n HideProjects: model.ServiceType?.HideProjects,\r\n IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n AllowToUser: model.ServiceType?.AllowToUser,\r\n UnitTypeId: model.ServiceType?.UnitTypeID,\r\n Units: model.ServiceType?.UnitTypeName,\r\n TrackInventory: model.ServiceType?.TrackInventory,\r\n InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n InventoryBatchId: model.InventoryBatch?.Id,\r\n InventoryBatchName: model.InventoryBatch?.Name,\r\n InventoryBatchAmount: model.InventoryBatch?.Inventory,\r\n NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n } as IOtherServices;\r\n return data;\r\n};\r\nexport const ConvertModelToUpdateEntity = (\r\n model: OtherServiceDetailsState,\r\n original: OtherServiceDetailsState,\r\n connectedModel: IConnectedFiltersDto,\r\n) => {\r\n let data = {\r\n Id: original.Id,\r\n BudgetID: connectedModel.Budget?.Id || null,\r\n Budget: connectedModel.Budget?.Name,\r\n UserGroup: connectedModel.UserGroup?.Id || null,\r\n UserGroupName: connectedModel.UserGroup?.Name,\r\n BookedBy: connectedModel.User?.Id,\r\n UserDisplayName: connectedModel.User?.Name,\r\n ServiceTypeID: model.ServiceType?.Id,\r\n ServiceType: model.ServiceType?.Name,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n ),\r\n Quantity: +(model.Quantity ?? 0).toString(),\r\n DiscountFactor: Number(model.DiscountFactor ?? 1),\r\n Remarks: model.Remarks,\r\n FundingType: connectedModel.FundingType?.Id,\r\n BudgetExperimentId: connectedModel.BudgetExperiment?.Id,\r\n BudgetExperimentName: connectedModel.BudgetExperiment?.Name,\r\n ReservationId: model.ReservationId,\r\n UsageId: model.UsageId,\r\n ExternalCustomerId: connectedModel.ExternalCustomer?.Id,\r\n ExternalCustomerName: connectedModel.ExternalCustomer?.Name,\r\n SyncReservation: false,\r\n SyncUsage: false,\r\n StaffOnly: model.ServiceType?.StaffOnly || false,\r\n InstituteProjectId: connectedModel.InstituteProject?.Id,\r\n InstituteProjectName: connectedModel.InstituteProject?.Name,\r\n PurchaseOrder: connectedModel.PurchaseOrder,\r\n Reference: connectedModel.Reference,\r\n BudgetsTurnedOn: model.ServiceType?.BudgetsTurnedOn,\r\n DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n HideProjects: model.ServiceType?.HideProjects,\r\n IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n AllowToUser: model.ServiceType?.AllowToUser,\r\n UnitTypeId: model.ServiceType?.UnitTypeID,\r\n Units: model.ServiceType?.UnitTypeName,\r\n TrackInventory: model.ServiceType?.TrackInventory,\r\n InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n InventoryBatchId: model.InventoryBatch?.Id,\r\n InventoryBatchName: model.InventoryBatch?.Name,\r\n InventoryBatchAmount: model.InventoryBatch?.Inventory,\r\n NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n } as IOtherServices;\r\n return data;\r\n};\r\nexport const ConvertModelToUpdateRenewStockEntity = (\r\n model: RenewStockState,\r\n original: RenewStockState,\r\n autoGenerateBatch?: boolean,\r\n) => {\r\n let data = {\r\n Id: original.Id,\r\n ServiceTypeID: model.ServiceType?.Id,\r\n ServiceType: model.ServiceType?.Name,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.DateReceived),\r\n ),\r\n Quantity: +(model.Quantity ?? 0).toString(),\r\n Remarks: model.Remarks,\r\n DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n InventoryBatchId: model.InventoryBatch?.Id,\r\n InventoryBatchName: model.InventoryBatch?.Name,\r\n InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n RenewStockInventory: true,\r\n TrackInventory: model.ServiceType?.TrackInventory,\r\n NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n AutoGenerateNewBatches: autoGenerateBatch,\r\n } as IOtherServices;\r\n return data;\r\n};\r\nexport const getDefaultService = (\r\n user: AuthenticatedUser | undefined,\r\n date: Date | string,\r\n) => {\r\n return {\r\n Id: 0,\r\n BookedBy: user?.Id,\r\n UserDisplayName: user?.Name,\r\n BudgetID: null,\r\n Budget: null,\r\n BudgetExperimentId: null,\r\n BudgetExperimentName: null,\r\n AllowToUser: true,\r\n DiscountFactor: 1,\r\n Quantity: null,\r\n DefaultQuantity: null,\r\n ExternalCustomerId: null,\r\n ExternalCustomerName: null,\r\n FundingType: 0,\r\n HideProjects: false,\r\n InstituteProjectId: null,\r\n InstituteProjectName: null,\r\n IntQuantityOnly: true,\r\n Mandatory: false,\r\n Remarks: null,\r\n ReservationId: null,\r\n ServiceDate: date,\r\n ServiceTypeID: 0,\r\n ServiceType: null,\r\n ServiceGroupId: 0,\r\n Units: null,\r\n UnitTypeId: null,\r\n UserGroup: null,\r\n UserGroupName: null,\r\n StaffOnly: false,\r\n Reference: null,\r\n PurchaseOrder: null,\r\n UsageId: null,\r\n HasCharges: false,\r\n TrackInventory: false,\r\n InventoryBatchesEnabled: false,\r\n NotLessThanZero: true,\r\n ReservationOverlappingInventory: null,\r\n BudgetsTurnedOn: false,\r\n InventoryBatchId: null,\r\n InventoryBatchName: null,\r\n ServiceGroup: null,\r\n } as IOtherServices;\r\n};\r\nexport const getDefaultBatch = (date: Date | string) => {\r\n return {\r\n Id: 0,\r\n Name: dateUtils.shortDateFormat(date) ?? '',\r\n ExpirationDate: null,\r\n Inventory: 0,\r\n Lot: null,\r\n OfflineServiceTypeId: 0,\r\n OfflineServiceTypeName: '',\r\n PurchaseDate: date,\r\n PurchasePricePerUnit: null,\r\n } as IInventoryBatchDto;\r\n};\r\nexport const ConvertConsumablesToInsertEntity = (\r\n services: IOtherServices[],\r\n connectedModel: IConnectedFiltersDto,\r\n discountFactor?: number | null,\r\n remarks?: string | null,\r\n) => {\r\n return services.map(f => {\r\n let savedData: IOtherServices = {\r\n Id: f.Id,\r\n BudgetID: connectedModel.Budget?.Id || null,\r\n Budget: connectedModel.Budget?.Name ?? null,\r\n UserGroup: connectedModel.UserGroup?.Id || null,\r\n UserGroupName: connectedModel.UserGroup?.Name ?? null,\r\n BookedBy: connectedModel.User?.Id ?? null,\r\n UserDisplayName: connectedModel.User?.Name ?? null,\r\n ServiceTypeID: f.ServiceTypeID,\r\n ServiceType: f.ServiceType,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n ),\r\n Quantity: Number(f.Quantity),\r\n DiscountFactor: Number(f.DiscountFactor),\r\n Remarks: f.Remarks,\r\n FundingType: connectedModel.FundingType?.Id ?? null,\r\n BudgetExperimentId: connectedModel.BudgetExperiment?.Id ?? null,\r\n BudgetExperimentName: connectedModel.BudgetExperiment?.Name ?? null,\r\n ReservationId: f.ReservationId,\r\n UsageId: f.UsageId,\r\n ExternalCustomerId: connectedModel.ExternalCustomer?.Id ?? null,\r\n ExternalCustomerName: connectedModel.ExternalCustomer?.Name ?? null,\r\n SyncReservation: false,\r\n SyncUsage: false,\r\n StaffOnly: f.StaffOnly || false,\r\n InstituteProjectId: connectedModel.InstituteProject?.Id ?? null,\r\n InstituteProjectName: connectedModel.InstituteProject?.Name ?? null,\r\n PurchaseOrder: connectedModel.PurchaseOrder ?? null,\r\n Reference: connectedModel.Reference ?? null,\r\n BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n DefaultQuantity: f.DefaultQuantity,\r\n HideProjects: f.HideProjects,\r\n IntQuantityOnly: f.IntQuantityOnly,\r\n ServiceGroupId: f.ServiceGroupId,\r\n AllowToUser: f.AllowToUser,\r\n UnitTypeId: f.UnitTypeId,\r\n Units: f.Units,\r\n TrackInventory: f.TrackInventory,\r\n InventoryBatchesEnabled: f.InventoryBatchesEnabled,\r\n InventoryBatchId: f.InventoryBatchId,\r\n InventoryBatchName: f.InventoryBatchName,\r\n InventoryBatchAmount: f.InventoryBatchAmount,\r\n NotLessThanZero: f.NotLessThanZero,\r\n AutoGenerateNewBatches: false,\r\n InsertedAt: null,\r\n ServiceGroup: null,\r\n ServiceRate: 0,\r\n DepartmentId: null,\r\n HasCharges: false,\r\n InsertedBy: null,\r\n Institute: null,\r\n InstituteId: null,\r\n InstituteTypeId: null,\r\n Inventory: -1,\r\n Mandatory: false,\r\n RenewStockInventory: false,\r\n ReservationOverlappingInventory: null,\r\n };\r\n if (!isNullOrUndefined(discountFactor)) {\r\n let globalFactor = Number(discountFactor);\r\n let serviceFactor = Number(f.DiscountFactor);\r\n if (globalFactor !== serviceFactor) {\r\n if (serviceFactor === 0 || serviceFactor === 1) {\r\n savedData.DiscountFactor = globalFactor;\r\n }\r\n }\r\n }\r\n if (!isEmptyOrWhitespace(remarks)) {\r\n if (isEmptyOrWhitespace(f.Remarks)) {\r\n savedData.Remarks = remarks ?? null;\r\n }\r\n }\r\n\r\n return savedData;\r\n });\r\n};\r\nexport const ConvertRenewStockToInsertEntity = (\r\n model: RenewStockState,\r\n autoGenerateBatch?: boolean,\r\n) => {\r\n let data = {\r\n Id: model.Id,\r\n ServiceTypeID: model.ServiceType?.Id,\r\n ServiceType: model.ServiceType?.Name,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.DateReceived),\r\n ),\r\n Quantity: +(model.Quantity ?? 0).toString(),\r\n Remarks: model.Remarks,\r\n InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n InventoryBatchId: model.InventoryBatch?.Id,\r\n InventoryBatchName: model.InventoryBatch?.Name,\r\n DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n TrackInventory: model.ServiceType?.TrackInventory,\r\n NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n AutoGenerateNewBatches: autoGenerateBatch,\r\n RenewStockInventory: true,\r\n } as IOtherServices;\r\n return data;\r\n};\r\nexport const ConvertInventoryBatchToEntity = (model: InventoryBatchState) => {\r\n let data = {\r\n Id: model.Id,\r\n Name: model.Name,\r\n OfflineServiceTypeId: model.ServiceType?.Id,\r\n OfflineServiceTypeName: model.ServiceType?.Name,\r\n PurchaseDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.PurchaseDate ?? new Date()),\r\n ),\r\n ExpirationDate:\r\n model.ExpirationDate === null || model.ExpirationDate === undefined\r\n ? null\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.ExpirationDate),\r\n ),\r\n Inventory: 0, // model.Inventory,\r\n Lot: model.Lot,\r\n PurchasePricePerUnit: model.PurchasePricePerUnit,\r\n } as IInventoryBatchDto;\r\n return data;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { offlineServiceStateActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { OtherServicesApi as api } from 'api/OtherServicesApi';\r\nimport {\r\n ConsumableServicesResponse,\r\n ConvertConsumablesToInsertEntity,\r\n ConvertDtoToConnectedModel,\r\n ConvertInventoryBatchToEntity,\r\n ConvertModelToInsertEntity,\r\n ConvertModelToUpdateEntity,\r\n ConvertModelToUpdateRenewStockEntity,\r\n ConvertRenewStockToInsertEntity,\r\n getDefaultBatch,\r\n getDefaultService,\r\n InventoryBatchParams,\r\n InventoryBatchResponse,\r\n InventoryBatchState,\r\n OfflineServiceQueryStringParameters,\r\n OfflineServicesResponse,\r\n OfflineServiceTypeChangeResult,\r\n OtherServiceDetailsState,\r\n RenewStockParams,\r\n RenewStockState,\r\n ReportConsumablesState,\r\n ServiceChangeStateParameters,\r\n StockRenewalParams,\r\n StockRenewalState,\r\n} from './types';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { OtherServiceDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport {\r\n ConnectedFiltersInit,\r\n IConnectedFiltersDto,\r\n} from 'types/IConnectedFiltersDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { connectedFiltersActions } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { selectConnectedFiltersData } from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectBarcodeScanTarget,\r\n selectGlobalSetting,\r\n selectOffsetDate,\r\n} from 'app/slice/selectors';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { MultiDetailsProps } from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { parseBarcode, ScanTarget } from 'app/slice/types';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { InventoryBatchProps } from '../../InventoryBatch';\r\nimport { RenewStockProps } from '../../RenewStock';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { getModelStateErrors } from 'api/utils';\r\n\r\nfunction* doInitDetails(\r\n action: PayloadAction<{\r\n query: OfflineServiceQueryStringParameters;\r\n service?: IOtherServices;\r\n globalSettings: GlobalSettingsType;\r\n editCreatable?: boolean;\r\n }>,\r\n) {\r\n try {\r\n let data: IOtherServices | null = action.payload.service || null;\r\n const date = yield select(state => selectOffsetDate(state, new Date()));\r\n let hasError: boolean = false;\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n let serviceType: IOfflineServiceFilterDto | null = null;\r\n if (data === null) {\r\n const result = yield call(api.initOfflineService, action.payload.query);\r\n console.debug('service result: ', result);\r\n let response = result as OfflineServicesResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: `initOfflineErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `initOfflineWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: `initOfflineSucc_${uuid()}`,\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data =\r\n response.data ??\r\n getDefaultService(\r\n user,\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n );\r\n hasError = !response.IsValid;\r\n serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n }\r\n if (serviceType === null && data.ServiceTypeID > 0) {\r\n serviceType = yield call(\r\n api.getServiceType,\r\n data.ServiceTypeID,\r\n 'public',\r\n );\r\n }\r\n yield put(\r\n connectedFiltersActions.extendSettingsState({\r\n services:\r\n data.ServiceTypeID > 0\r\n ? [\r\n {\r\n Id: data.ServiceTypeID,\r\n Name: data.ServiceType,\r\n ServiceGroupId: data.ServiceGroupId,\r\n ServiceTypeId: ServiceType.Offline,\r\n Active: true,\r\n BudgetsTurnedOn: data.BudgetsTurnedOn,\r\n HideProject: data.HideProjects,\r\n } as IServiceTypeFilterDto,\r\n ]\r\n : [],\r\n globalSettings: action.payload.globalSettings,\r\n isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n settings: {},\r\n data: ConvertDtoToConnectedModel(data),\r\n }),\r\n );\r\n yield put(\r\n connectedFiltersActions.saveState(ConvertDtoToConnectedModel(data)),\r\n );\r\n yield put(\r\n actions.initDetails_Success({\r\n hasErrors: hasError,\r\n hasCharges: data.HasCharges,\r\n data: data,\r\n isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n serviceType: serviceType,\r\n }),\r\n );\r\n if (\r\n data.ServiceTypeID > 0 &&\r\n !(data.Id > 0) &&\r\n !action.payload.editCreatable\r\n ) {\r\n const parameters = {\r\n ServiceTypes: [data.ServiceTypeID],\r\n ReservationId: data.ReservationId,\r\n UsageId: data.UsageId,\r\n BookedBy: data.BookedBy,\r\n ADGroup: data.UserGroup,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(data.ServiceDate),\r\n ),\r\n BudgetId: data.BudgetID,\r\n FundingTypeId: data.FundingType ?? 0,\r\n } as ServiceChangeStateParameters;\r\n yield put(actions.initServiceChangeStateData(parameters));\r\n }\r\n } catch (error: unknown) {\r\n yield put(actions.initDetails_Error(error));\r\n }\r\n}\r\nfunction* doInitServiceChangeStateData(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n let res = yield call(api.getServiceChangeState, action.payload);\r\n let response = res as OfflineServiceTypeChangeResult;\r\n\r\n yield put(actions.initServiceChangeStateData_Success(response));\r\n } catch (error: unknown) {\r\n yield put(actions.initServiceChangeStateData_Error());\r\n }\r\n}\r\nfunction* doCreate(\r\n action: PayloadAction<{\r\n model: OtherServiceDetailsState;\r\n saveCreatable?: boolean;\r\n }>,\r\n) {\r\n const connectedModel: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n const httpPayloads: IOtherServices = ConvertModelToInsertEntity(\r\n action.payload.model,\r\n connectedModel,\r\n );\r\n try {\r\n const result = yield call(api.insertOtherService, httpPayloads);\r\n let response = result as OfflineServicesResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: `serviceInsertError_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceInsertSuccess_${uuid()}`,\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.OfflineService),\r\n detailsType: RenderPageType.OtherServiceDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialService: response.data,\r\n } as OtherServiceDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: `serviceInsertWarning_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n if (action.payload.saveCreatable === true && !hasErrors) {\r\n yield put(actions.setReservationService(response.data ?? undefined));\r\n }\r\n yield put(\r\n actions.createService_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceInsert_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createService_Error(Error));\r\n }\r\n}\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: OtherServiceDetailsState;\r\n original: OtherServiceDetailsState;\r\n saveCreatable?: boolean;\r\n }>,\r\n) {\r\n const connectedModel: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n let updatedService = ConvertModelToUpdateEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n connectedModel,\r\n );\r\n let hasErrors = false;\r\n try {\r\n if (action.payload.saveCreatable) {\r\n yield put(actions.setReservationService(updatedService));\r\n } else {\r\n const results = yield call(\r\n api.updateOtherService,\r\n updatedService,\r\n action.payload.current.Id,\r\n );\r\n let response = results as OfflineServicesResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: `serviceUpdateErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceUpdateSuccess_${uuid()}`,\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.OfflineService),\r\n detailsType: RenderPageType.OtherServiceDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialService: response.data,\r\n } as OtherServiceDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `serviceUpdateWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n hasErrors = response.ErrorMessages.length > 0;\r\n }\r\n yield put(\r\n actions.updateService_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const modelState = getModelStateErrors(error);\r\n\r\n if (modelState !== undefined) {\r\n const messages = Object.values(modelState).flat();\r\n for (const message of messages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: message,\r\n }),\r\n );\r\n }\r\n } else {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceUpdateErr_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n yield put(actions.updateService_Error(Error));\r\n }\r\n}\r\nfunction* doSetAnyValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof OtherServiceDetailsState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doSetConsumableValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof ReportConsumablesState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setConsumableValueSuccess(action.payload));\r\n}\r\nfunction* doSetRenewalValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof StockRenewalState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setStockRenewalValueSuccess(action.payload));\r\n}\r\nfunction* doGetCredit(action: PayloadAction) {\r\n const connectedModel: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n const httpPayloads: IOtherServices = ConvertModelToInsertEntity(\r\n action.payload,\r\n connectedModel,\r\n );\r\n try {\r\n const result = yield call(api.calculateCredit, httpPayloads);\r\n yield put(\r\n actions.getCredit_Success({\r\n credit: result.TotalCost,\r\n balance: result.Balance,\r\n }),\r\n );\r\n } catch {\r\n yield put(actions.getCredit_Success({ credit: 0, balance: null }));\r\n }\r\n}\r\nfunction* doGetTotalCredit(action: PayloadAction) {\r\n const connectedModel: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n const httpPayloads: IOtherServices[] = ConvertConsumablesToInsertEntity(\r\n action.payload,\r\n connectedModel,\r\n );\r\n try {\r\n const result = yield call(api.calculateTotalCredit, httpPayloads);\r\n yield put(\r\n actions.getTotalCredit_Success({\r\n credit: result.TotalCost,\r\n balance: result.Balance,\r\n }),\r\n );\r\n } catch {\r\n yield put(actions.getTotalCredit_Success({ credit: 0, balance: null }));\r\n }\r\n}\r\nfunction* doInitConsumables(\r\n action: PayloadAction<{\r\n query: OfflineServiceQueryStringParameters;\r\n globalSettings: GlobalSettingsType;\r\n services?: IOtherServices[];\r\n }>,\r\n) {\r\n try {\r\n let data: IOtherServices[] = !!action.payload.services\r\n ? action.payload.services\r\n : [];\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n if (data.length < 1) {\r\n const result = yield call(\r\n api.initConsumableServices,\r\n action.payload.query,\r\n );\r\n let response = result as ConsumableServicesResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: `initOfflineErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `initOfflineWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: `initOfflineSucc_${uuid()}`,\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data = response.data;\r\n }\r\n yield put(\r\n connectedFiltersActions.extendSettingsState({\r\n services:\r\n data.length > 0\r\n ? data.map(f => {\r\n return {\r\n Id: f.ServiceTypeID,\r\n Name: f.ServiceType,\r\n ServiceGroupId: f.ServiceGroupId,\r\n ServiceTypeId: ServiceType.Offline,\r\n Active: true,\r\n BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n })\r\n : [],\r\n globalSettings: action.payload.globalSettings,\r\n isEdit: false,\r\n settings: {},\r\n data:\r\n data.length > 0\r\n ? ConvertDtoToConnectedModel(data[0])\r\n : ConnectedFiltersInit(\r\n undefined,\r\n undefined,\r\n toEntity(user?.Id, user?.Name),\r\n action.payload.globalSettings\r\n .reservationUserGroupGroupByBudgetUserGroup\r\n ? undefined\r\n : toEntity(\r\n user?.ActiveUserGroup?.Id,\r\n user?.ActiveUserGroup?.Name,\r\n ),\r\n undefined,\r\n undefined,\r\n undefined,\r\n getSingleInvoiceFundingType(0),\r\n undefined,\r\n undefined,\r\n undefined,\r\n ),\r\n }),\r\n );\r\n yield put(\r\n connectedFiltersActions.saveState(\r\n data.length > 0\r\n ? ConvertDtoToConnectedModel(data[0])\r\n : ConnectedFiltersInit(\r\n undefined,\r\n undefined,\r\n toEntity(user?.Id, user?.Name),\r\n action.payload.globalSettings\r\n .reservationUserGroupGroupByBudgetUserGroup\r\n ? undefined\r\n : toEntity(\r\n user?.ActiveUserGroup?.Id,\r\n user?.ActiveUserGroup?.Name,\r\n ),\r\n undefined,\r\n undefined,\r\n undefined,\r\n getSingleInvoiceFundingType(0),\r\n undefined,\r\n undefined,\r\n undefined,\r\n ),\r\n ),\r\n );\r\n yield put(\r\n actions.initConsumables_Success({\r\n data: data,\r\n user: toEntity(user?.Id, user?.Name),\r\n userGroup: action.payload.globalSettings\r\n .reservationUserGroupGroupByBudgetUserGroup\r\n ? undefined\r\n : toEntity(user?.ActiveUserGroup?.Id, user?.ActiveUserGroup?.Name),\r\n }),\r\n );\r\n if (data.length > 0) {\r\n const parameters = {\r\n ServiceTypes: data.map(f => f.ServiceTypeID),\r\n ReservationId: null,\r\n UsageId: null,\r\n BookedBy: data[0].BookedBy,\r\n ADGroup: data[0].UserGroup,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(data[0].ServiceDate),\r\n ),\r\n BudgetId: data[0].BudgetID,\r\n FundingTypeId: data[0].FundingType ?? 0,\r\n } as ServiceChangeStateParameters;\r\n yield put(actions.initServiceChangeStateData(parameters));\r\n }\r\n } catch (error: unknown) {\r\n yield put(actions.initConsumables_Error(error));\r\n }\r\n}\r\nfunction* doCreateConsumables(\r\n action: PayloadAction<{\r\n Services: IOtherServices[];\r\n DiscountFactor?: number | null;\r\n Remarks?: string | null;\r\n }>,\r\n) {\r\n const connectedModel: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n const httpPayloads: IOtherServices[] = ConvertConsumablesToInsertEntity(\r\n action.payload.Services,\r\n connectedModel,\r\n action.payload.DiscountFactor,\r\n action.payload.Remarks,\r\n );\r\n try {\r\n const result = yield call(api.insertConsumableServices, httpPayloads);\r\n let response = result as ConsumableServicesResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: `serviceInsertError_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceInsertSuccess_${uuid()}`,\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: undefined,\r\n created: true,\r\n multiple: true,\r\n itemName: i18next.t(translations.OfflineService),\r\n itemEndName: 'logged',\r\n multiDetails: response.data.map(f => {\r\n return {\r\n Id: f.Id,\r\n detailsType: RenderPageType.OtherServiceDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + f.Id ?? -1,\r\n },\r\n initialService: f,\r\n } as OtherServiceDetailsProps,\r\n } as MultiDetailsProps;\r\n }),\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: `serviceInsertWarning_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n yield put(\r\n actions.createConsumables_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceInsert_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createConsumables_Error(Error));\r\n }\r\n}\r\nasync function getAssetByInternalCode(barcode: string) {\r\n try {\r\n var response: IODataQueryResponse = await httpClient.get(\r\n '/api/odata/v4/MyAssets',\r\n {\r\n $top: 1,\r\n $select: 'ServiceId',\r\n $filter: `${new Condition(\r\n 'InternalCode',\r\n ODataOperators.Equals,\r\n barcode,\r\n ).toString()} and ${new Condition(\r\n 'ServiceTypeId',\r\n ODataOperators.Equals,\r\n 2,\r\n ).toString()}`,\r\n },\r\n );\r\n var serviceTypeId = response.value[0]?.ServiceId;\r\n return serviceTypeId;\r\n } catch (error) {}\r\n}\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n const MIN_LENGTH_DEFAULT = 6;\r\n const minBarcodeLengthString: string | undefined = yield select(state =>\r\n selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n );\r\n const MinBarcodeLength =\r\n tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n // prevent accidental barcode detection on fast user input\r\n if (action.payload.data.length < MinBarcodeLength) {\r\n return;\r\n }\r\n const scannTarget: ScanTarget | undefined = yield select(\r\n selectBarcodeScanTarget,\r\n );\r\n if (scannTarget === undefined || scannTarget !== ScanTarget.Consumables) {\r\n return;\r\n }\r\n const appSettings: AppSettings = yield select(selectAppSettings);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'info',\r\n message:\r\n i18next.t(translations.BarcodeScanModalBody) +\r\n ' ' +\r\n action.payload.data,\r\n }),\r\n );\r\n try {\r\n // in case and the barcode is a valid internal url - get InternalCode\r\n let scanedBarcode = parseBarcode(action.payload.data, appSettings);\r\n\r\n let internalId = action.payload.data;\r\n if (scanedBarcode !== undefined) {\r\n internalId = scanedBarcode.InternalCode ?? action.payload.data;\r\n }\r\n if (internalId === undefined || internalId === null) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.BarcodeNotFoundEx),\r\n }),\r\n );\r\n } else {\r\n const serviceId = yield call(getAssetByInternalCode, internalId);\r\n if (serviceId !== undefined) {\r\n yield put(actions.setSelectedServiceType([serviceId]));\r\n yield put(actions.setBarcodeScanned(true));\r\n\r\n return;\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.BarcodeNotFoundEx),\r\n }),\r\n );\r\n }\r\n } catch (error) {\r\n console.error(`${action.type}`, action.payload, error);\r\n }\r\n}\r\nfunction* doSetIsBarcodeScanned(action: PayloadAction) {\r\n yield put(actions.setBarcodeScanned_Success(action.payload));\r\n}\r\nfunction* doInitStockRenewal(\r\n action: PayloadAction<{\r\n query: StockRenewalParams;\r\n services?: IOtherServices[];\r\n }>,\r\n) {\r\n try {\r\n let data: IOtherServices[] = !!action.payload.services\r\n ? action.payload.services\r\n : [];\r\n const date = yield select(state => selectOffsetDate(state, new Date()));\r\n if (data.length < 1) {\r\n const result = yield call(\r\n api.initStockRenewalServices,\r\n action.payload.query,\r\n );\r\n let response = result as ConsumableServicesResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: `initOfflineErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `initOfflineWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: `initOfflineSucc_${uuid()}`,\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data = response.data;\r\n }\r\n yield put(\r\n actions.initStockRenewal_Success({\r\n data: data,\r\n date: dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n yield put(actions.initStockRenewal_Error(error));\r\n }\r\n}\r\nfunction* doCreateStockRenewals(action: PayloadAction) {\r\n const httpPayloads: IOtherServices[] = action.payload.Services;\r\n try {\r\n const result = yield call(api.insertStockRenewalServices, httpPayloads);\r\n let response = result as ConsumableServicesResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: `stockrenewalInsertError_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `stockrenewalInsertSuccess_${uuid()}`,\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: undefined,\r\n created: true,\r\n multiple: true,\r\n itemName: i18next.t(translations.RenewStock),\r\n multiDetails: response.data.map(f => {\r\n return {\r\n Id: f.Id,\r\n detailsType: RenderPageType.RenewStock,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + f.Id ?? -1,\r\n },\r\n initialService: f,\r\n } as RenewStockProps,\r\n } as MultiDetailsProps;\r\n }),\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: `stockrenewalInsertWarning_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n yield put(\r\n actions.createStockRenewals_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `stockrenewalInsert_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createStockRenewals_Error(Error));\r\n }\r\n}\r\nfunction* doInitRenewStock(\r\n action: PayloadAction<{\r\n query: RenewStockParams;\r\n service?: IOtherServices;\r\n }>,\r\n) {\r\n try {\r\n let data: IOtherServices | null = action.payload.service || null;\r\n let hasError: boolean = false;\r\n const date = yield select(state => selectOffsetDate(state, new Date()));\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n let serviceType: IOfflineServiceFilterDto | null = null;\r\n if (data === null) {\r\n const result = yield call(\r\n api.initRenewStockService,\r\n action.payload.query,\r\n );\r\n console.debug('service result: ', result);\r\n let response = result as OfflineServicesResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: `initOfflineErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `initOfflineWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: `initOfflineSucc_${uuid()}`,\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data =\r\n response.data ??\r\n getDefaultService(\r\n user,\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n );\r\n hasError = !response.IsValid;\r\n serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n }\r\n if (serviceType === null && data.ServiceTypeID > 0) {\r\n serviceType = yield call(api.getServiceType, data.ServiceTypeID);\r\n }\r\n yield put(\r\n actions.initRenewStock_Success({\r\n hasErrors: hasError,\r\n data: data,\r\n isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n serviceType: serviceType,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n yield put(actions.initRenewStock_Error(error));\r\n }\r\n}\r\nfunction* doCreateRenewStock(\r\n action: PayloadAction<{\r\n model: RenewStockState;\r\n editCreatable: boolean;\r\n preventRefreshTable?: boolean;\r\n autoGenerateBatch?: boolean;\r\n saveCreatable?: boolean;\r\n }>,\r\n) {\r\n const httpPayloads: IOtherServices = ConvertRenewStockToInsertEntity(\r\n action.payload.model,\r\n action.payload.autoGenerateBatch,\r\n );\r\n if (action.payload.editCreatable) {\r\n yield put(actions.setEditCreatableService(httpPayloads));\r\n yield put(\r\n actions.createRenewStock_Success({\r\n hasErrors: false,\r\n }),\r\n );\r\n } else {\r\n try {\r\n const result = yield call(api.insertOtherService, httpPayloads);\r\n let response = result as OfflineServicesResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: `RenewStockInsertError_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `RenewStockInsertSuccess_${uuid()}`,\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.RenewStock),\r\n detailsType: RenderPageType.RenewStock,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialService: response.data,\r\n } as RenewStockProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: `RenewStockInsertWarning_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (!action.payload.preventRefreshTable) {\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n yield put(\r\n actions.createRenewStock_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n if (action.payload.saveCreatable) {\r\n yield put(actions.getCreatableService(response.data ?? undefined));\r\n }\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `RenewStockInsert_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createRenewStock_Error(Error));\r\n }\r\n }\r\n}\r\nfunction* doUpdateRenewStock(\r\n action: PayloadAction<{\r\n current: RenewStockState;\r\n original: RenewStockState;\r\n editCreatable: boolean;\r\n autoGenerateBatch?: boolean;\r\n }>,\r\n) {\r\n let updatedService = ConvertModelToUpdateRenewStockEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n action.payload.autoGenerateBatch,\r\n );\r\n if (action.payload.editCreatable) {\r\n yield put(actions.setEditCreatableService(updatedService));\r\n yield put(\r\n actions.updateRenewStock_Success({\r\n hasErrors: false,\r\n }),\r\n );\r\n } else {\r\n try {\r\n const results = yield call(\r\n api.updateOtherService,\r\n updatedService,\r\n action.payload.current.Id,\r\n );\r\n let response = results as OfflineServicesResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: `serviceUpdateErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceUpdateSuccess_${uuid()}`,\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.RenewStock),\r\n detailsType: RenderPageType.RenewStock,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialService: response.data,\r\n } as RenewStockProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `serviceUpdateWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateRenewStock_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceUpdateErr_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateRenewStock_Error(Error));\r\n }\r\n }\r\n}\r\nfunction* doInitInventoryBatch(\r\n action: PayloadAction<{\r\n query: InventoryBatchParams;\r\n batch?: IInventoryBatchDto;\r\n }>,\r\n) {\r\n try {\r\n let data: IInventoryBatchDto | null = action.payload.batch || null;\r\n let hasError: boolean = false;\r\n const newDate = yield select(state => selectOffsetDate(state, new Date()));\r\n let serviceType: IOfflineServiceFilterDto | null = null;\r\n if (data === null) {\r\n const result = yield call(api.initInventoryBatch, action.payload.query);\r\n let response = result as InventoryBatchResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: `initBatchErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `initBatchWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: `initBatchSucc_${uuid()}`,\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data =\r\n response.data ??\r\n getDefaultBatch(\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n );\r\n hasError = !response.IsValid;\r\n serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n }\r\n if (serviceType === null && data.OfflineServiceTypeId > 0) {\r\n serviceType = yield call(api.getServiceType, data.OfflineServiceTypeId);\r\n }\r\n yield put(\r\n actions.initInventoryBatch_Success({\r\n hasErrors: hasError,\r\n data: data,\r\n isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n serviceType: serviceType,\r\n newDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n yield put(actions.initInventoryBatch_Error(error));\r\n }\r\n}\r\nfunction* doCreateInventoryBatch(\r\n action: PayloadAction<{\r\n model: InventoryBatchState;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n }>,\r\n) {\r\n const httpPayloads: IInventoryBatchDto = ConvertInventoryBatchToEntity(\r\n action.payload.model,\r\n );\r\n\r\n try {\r\n const result = yield call(api.insertInventoryBatch, httpPayloads);\r\n let response = result as InventoryBatchResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: `batchInsertError_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `batchInsertSuccess_${uuid()}`,\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.InventoryBatch),\r\n detailsType: RenderPageType.InventoryBatch,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialBatch: response.data,\r\n } as InventoryBatchProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: `batchInsertWarning_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n if (action.payload.saveCreatable === true) {\r\n yield put(actions.setInventoryBatchEditable(response.data ?? undefined));\r\n } else {\r\n if (!action.payload.preventRefreshTable) {\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n yield put(\r\n actions.createInventoryBatch_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `batchInsert_err_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createInventoryBatch_Error(Error));\r\n }\r\n}\r\nfunction* doUpdateInventoryBatch(\r\n action: PayloadAction<{\r\n current: InventoryBatchState;\r\n original: InventoryBatchState;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n }>,\r\n) {\r\n let updatedService = ConvertInventoryBatchToEntity(action.payload.current);\r\n\r\n try {\r\n const results = yield call(\r\n api.updateInventoryBatch,\r\n updatedService,\r\n action.payload.current.Id,\r\n );\r\n let response = results as InventoryBatchResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: `batchUpdateErr_${uuid()}`,\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `batchUpdateSuccess_${uuid()}`,\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.InventoryBatch),\r\n detailsType: RenderPageType.InventoryBatch,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialBatch: response.data,\r\n } as InventoryBatchProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: `batchUpdateWarn_${uuid()}`,\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n //yield put(layoutActions.setRefreshTable(true));\r\n }\r\n if (action.payload.saveCreatable === true) {\r\n yield put(actions.setInventoryBatchEditable(response.data ?? undefined));\r\n } else {\r\n if (!action.payload.preventRefreshTable) {\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateInventoryBatch_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `serviceUpdateErr_${uuid()}`,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateInventoryBatch_Error(Error));\r\n }\r\n}\r\nfunction* doSetRenewStockValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof RenewStockState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setRenewStockValueSuccess(action.payload));\r\n}\r\nfunction* doSetInventoryBatchValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof InventoryBatchState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setInventoryBatchValueSuccess(action.payload));\r\n}\r\nexport function* offlineServiceStateSaga() {\r\n yield takeLatest(actions.initDetails.type, doInitDetails);\r\n yield takeLatest(actions.createService.type, doCreate);\r\n yield takeLatest(actions.updateService.type, doUpdate);\r\n yield takeLatest(actions.setAnyValue.type, doSetAnyValue);\r\n yield takeLatest(actions.setConsumableValue.type, doSetConsumableValue);\r\n yield takeLatest(actions.createConsumables.type, doCreateConsumables);\r\n yield takeLatest(actions.getCredit.type, doGetCredit);\r\n yield takeLatest(actions.getTotalCredit.type, doGetTotalCredit);\r\n yield takeLatest(\r\n actions.initServiceChangeStateData.type,\r\n doInitServiceChangeStateData,\r\n );\r\n yield takeLatest(actions.initConsumables.type, doInitConsumables);\r\n yield takeLatest(actions.setStockRenewalValue.type, doSetRenewalValue);\r\n yield takeLatest(actions.setRenewStockValue.type, doSetRenewStockValue);\r\n yield takeLatest(\r\n actions.setInventoryBatchValue.type,\r\n doSetInventoryBatchValue,\r\n );\r\n yield takeLatest(actions.initStockRenewal.type, doInitStockRenewal);\r\n yield takeLatest(actions.createStockRenewals.type, doCreateStockRenewals);\r\n yield takeLatest(actions.initRenewStock.type, doInitRenewStock);\r\n yield takeLatest(actions.createRenewStock.type, doCreateRenewStock);\r\n yield takeLatest(actions.updateRenewStock.type, doUpdateRenewStock);\r\n yield takeLatest(actions.initInventoryBatch.type, doInitInventoryBatch);\r\n yield takeLatest(actions.createInventoryBatch.type, doCreateInventoryBatch);\r\n yield takeLatest(actions.updateInventoryBatch.type, doUpdateInventoryBatch);\r\n yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n yield takeLatest(actions.setBarcodeScanned.type, doSetIsBarcodeScanned);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { PricingState } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport { ConnectedFiltersInit } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { offlineServiceStateSaga } from './saga';\r\nimport {\r\n ConvertConsumablesToRenewalModel,\r\n ConvertConsumablesToModel,\r\n ConvertDtoToConnectedModel,\r\n ConvertDtoToModel,\r\n OfflineServiceQueryStringParameters,\r\n OfflineServiceState,\r\n OfflineServiceTypeChangeResult,\r\n OtherServiceDetailsState,\r\n ReportConsumablesState,\r\n ServiceChangeStateParameters,\r\n StockRenewalState,\r\n StockRenewalParams,\r\n RenewStockState,\r\n RenewStockParams,\r\n ConvertRenewStockToModel,\r\n InventoryBatchState,\r\n InventoryBatchParams,\r\n ConvertInventoryBatchToModel,\r\n} from './types';\r\n\r\nexport const initialState: OfflineServiceState = {\r\n detailsState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n },\r\n processing: false,\r\n consumablesProcessing: false,\r\n valueHandler: undefined,\r\n connectedDataState: ConnectedFiltersInit(),\r\n serviceChangeResultState: undefined,\r\n creditState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n },\r\n hasCharges: undefined,\r\n savedReservationService: undefined,\r\n consumablesState: {\r\n data: {\r\n Services: [],\r\n },\r\n completed: undefined,\r\n dataLength: undefined,\r\n error: undefined,\r\n hasErrors: undefined,\r\n processing: undefined,\r\n },\r\n consumablesValueHandler: undefined,\r\n selectedServiceTypes: [],\r\n editCreatableService: undefined,\r\n barcodeScanned: undefined,\r\n refeshOfflineServices: undefined,\r\n stockRenewalState: {\r\n data: undefined,\r\n completed: undefined,\r\n dataLength: undefined,\r\n error: undefined,\r\n hasErrors: undefined,\r\n processing: undefined,\r\n },\r\n stockRenewalValueHandler: undefined,\r\n renewStockState: {\r\n data: undefined,\r\n completed: undefined,\r\n dataLength: undefined,\r\n error: undefined,\r\n hasErrors: undefined,\r\n processing: undefined,\r\n },\r\n renewStockValueHandler: undefined,\r\n inventoryBatchState: {\r\n data: undefined,\r\n completed: undefined,\r\n dataLength: undefined,\r\n error: undefined,\r\n hasErrors: undefined,\r\n processing: undefined,\r\n },\r\n inventoryBatchValueHandler: undefined,\r\n isEdit: undefined,\r\n batchIsEdit: undefined,\r\n inventoryBatchEditable: undefined,\r\n getCreatableService: undefined,\r\n};\r\nconst slice = createSlice({\r\n name: 'offlineServiceState',\r\n initialState,\r\n reducers: {\r\n initDetails(\r\n state,\r\n action: PayloadAction<{\r\n query: OfflineServiceQueryStringParameters;\r\n globalSettings: GlobalSettingsType;\r\n service?: IOtherServices;\r\n editCreatable?: boolean;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.valueHandler = undefined;\r\n if (!action.payload.editCreatable) {\r\n state.connectedDataState = ConnectedFiltersInit();\r\n }\r\n state.serviceChangeResultState = undefined;\r\n },\r\n initDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n hasCharges: boolean;\r\n data: IOtherServices;\r\n isEdit: boolean;\r\n serviceType: IOfflineServiceFilterDto | null;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.detailsState.data = ConvertDtoToModel(\r\n action.payload.data,\r\n action.payload.serviceType,\r\n );\r\n state.connectedDataState = ConvertDtoToConnectedModel(\r\n action.payload.data,\r\n );\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.hasCharges = action.payload.hasCharges;\r\n state.isEdit = action.payload.isEdit;\r\n },\r\n initDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n resetDetailsState(state, action: PayloadAction) {\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.processing = false;\r\n state.valueHandler = undefined;\r\n if (action.payload !== true) {\r\n state.connectedDataState = ConnectedFiltersInit();\r\n state.serviceChangeResultState = undefined;\r\n }\r\n state.isEdit = undefined;\r\n },\r\n createService(\r\n state,\r\n action: PayloadAction<{\r\n model: OtherServiceDetailsState;\r\n saveCreatable?: boolean;\r\n }>,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n createService_Success(\r\n state,\r\n action: PayloadAction<{ hasErrors: boolean }>,\r\n ) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n createService_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n updateService(\r\n state,\r\n action: PayloadAction<{\r\n current: OtherServiceDetailsState;\r\n original: OtherServiceDetailsState;\r\n saveCreatable?: boolean;\r\n }>,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n updateService_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n updateService_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n setAnyValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof OtherServiceDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setAnyValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof OtherServiceDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.valueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetValueHandler(state, action: PayloadAction) {\r\n state.valueHandler = undefined;\r\n },\r\n initServiceChangeStateData(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n initServiceChangeStateData_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.serviceChangeResultState = action.payload;\r\n },\r\n initServiceChangeStateData_Error(state, action: PayloadAction) {\r\n state.serviceChangeResultState = undefined;\r\n },\r\n resetServiceChangeState(state, action: PayloadAction) {\r\n state.serviceChangeResultState = undefined;\r\n },\r\n getCredit(state, action: PayloadAction) {\r\n state.creditState.processing = true;\r\n state.creditState.completed = undefined;\r\n state.creditState.hasErrors = undefined;\r\n },\r\n getCredit_Success(state, action: PayloadAction) {\r\n state.creditState.processing = false;\r\n state.creditState.completed = true;\r\n state.creditState.data = action.payload;\r\n },\r\n getCredit_Error(state, action: PayloadAction) {\r\n state.creditState.processing = false;\r\n state.creditState.completed = true;\r\n state.creditState.data = undefined;\r\n },\r\n resetCreditState(state, action: PayloadAction) {\r\n state.creditState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n getTotalCredit(state, action: PayloadAction) {\r\n state.creditState.processing = true;\r\n state.creditState.completed = undefined;\r\n state.creditState.hasErrors = undefined;\r\n },\r\n getTotalCredit_Success(state, action: PayloadAction) {\r\n state.creditState.processing = false;\r\n state.creditState.completed = true;\r\n state.creditState.data = action.payload;\r\n },\r\n getTotalCredit_Error(state, action: PayloadAction) {\r\n state.creditState.processing = false;\r\n state.creditState.completed = true;\r\n state.creditState.data = undefined;\r\n },\r\n resetTotalCreditState(state, action: PayloadAction) {\r\n state.creditState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n setReservationService(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.savedReservationService = action.payload;\r\n },\r\n setConsumableValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof ReportConsumablesState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setConsumableValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof ReportConsumablesState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.consumablesValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetConsumableValueHandler(state, action: PayloadAction) {\r\n state.consumablesValueHandler = undefined;\r\n },\r\n initConsumables(\r\n state,\r\n action: PayloadAction<{\r\n query: OfflineServiceQueryStringParameters;\r\n globalSettings: GlobalSettingsType;\r\n services?: IOtherServices[];\r\n }>,\r\n ) {\r\n state.consumablesProcessing = true;\r\n state.consumablesState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.consumablesValueHandler = undefined;\r\n },\r\n initConsumables_Success(\r\n state,\r\n action: PayloadAction<{\r\n data: IOtherServices[];\r\n user?: Entity | null;\r\n userGroup?: Entity | null;\r\n }>,\r\n ) {\r\n state.consumablesProcessing = false;\r\n state.consumablesState.data = ConvertConsumablesToModel(\r\n action.payload.data,\r\n );\r\n state.connectedDataState =\r\n action.payload.data.length > 0\r\n ? ConvertDtoToConnectedModel(action.payload.data[0])\r\n : ConnectedFiltersInit(\r\n undefined,\r\n undefined,\r\n action.payload.user,\r\n action.payload.userGroup,\r\n undefined,\r\n undefined,\r\n undefined,\r\n getSingleInvoiceFundingType(0),\r\n undefined,\r\n undefined,\r\n undefined,\r\n );\r\n },\r\n initConsumables_Error(state, action: PayloadAction) {\r\n state.consumablesProcessing = false;\r\n },\r\n extendConsumablesData(state, action: PayloadAction) {\r\n state.consumablesState.data = { Services: action.payload };\r\n },\r\n createConsumables(\r\n state,\r\n action: PayloadAction<{\r\n Services: IOtherServices[];\r\n DiscountFactor?: number | null;\r\n Remarks?: string | null;\r\n }>,\r\n ) {\r\n state.consumablesState.processing = true;\r\n state.consumablesState.completed = undefined;\r\n state.consumablesState.hasErrors = undefined;\r\n },\r\n createConsumables_Success(\r\n state,\r\n action: PayloadAction<{ hasErrors: boolean }>,\r\n ) {\r\n state.consumablesState.processing = false;\r\n state.consumablesState.hasErrors = action.payload.hasErrors;\r\n state.consumablesState.completed = true;\r\n },\r\n createConsumables_Error(state, action: PayloadAction) {\r\n state.consumablesState.processing = false;\r\n state.consumablesState.completed = true;\r\n state.consumablesState.hasErrors = true;\r\n },\r\n resetConsumablesState(state, action: PayloadAction) {\r\n state.consumablesState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n dataLength: undefined,\r\n };\r\n state.consumablesProcessing = false;\r\n state.consumablesValueHandler = undefined;\r\n state.connectedDataState = ConnectedFiltersInit();\r\n state.serviceChangeResultState = undefined;\r\n state.selectedServiceTypes = [];\r\n state.barcodeScanned = undefined;\r\n state.refeshOfflineServices = undefined;\r\n },\r\n resetSelectedServiceType(state, action: PayloadAction) {\r\n state.selectedServiceTypes = [];\r\n },\r\n setSelectedServiceType(state, action: PayloadAction>) {\r\n state.selectedServiceTypes = action.payload;\r\n },\r\n setEditCreatableService(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.editCreatableService = action.payload;\r\n },\r\n getCreatableService(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.getCreatableService = action.payload;\r\n },\r\n setBarcodeScanned(state, action: PayloadAction) {},\r\n setBarcodeScanned_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.barcodeScanned = action.payload;\r\n },\r\n setRefreshConsumableOfflineServices(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.refeshOfflineServices = action.payload;\r\n },\r\n\r\n setStockRenewalValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof StockRenewalState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setStockRenewalValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof StockRenewalState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.stockRenewalValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetStockRenewalValueHandler(state, action: PayloadAction) {\r\n state.stockRenewalValueHandler = undefined;\r\n },\r\n initStockRenewal(\r\n state,\r\n action: PayloadAction<{\r\n query: StockRenewalParams;\r\n services?: IOtherServices[];\r\n }>,\r\n ) {\r\n state.stockRenewalState = {\r\n data: undefined,\r\n processing: true,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.stockRenewalValueHandler = undefined;\r\n },\r\n initStockRenewal_Success(\r\n state,\r\n action: PayloadAction<{\r\n data: IOtherServices[];\r\n date: Date | string;\r\n }>,\r\n ) {\r\n state.stockRenewalState.processing = false;\r\n state.stockRenewalState.data = ConvertConsumablesToRenewalModel(\r\n action.payload.data,\r\n action.payload.date,\r\n );\r\n },\r\n initStockRenewal_Error(state, action: PayloadAction) {\r\n state.stockRenewalState.processing = false;\r\n },\r\n createStockRenewals(state, action: PayloadAction) {\r\n state.stockRenewalState.processing = true;\r\n state.stockRenewalState.completed = undefined;\r\n state.stockRenewalState.hasErrors = undefined;\r\n },\r\n createStockRenewals_Success(\r\n state,\r\n action: PayloadAction<{ hasErrors: boolean }>,\r\n ) {\r\n state.stockRenewalState.processing = false;\r\n state.stockRenewalState.hasErrors = action.payload.hasErrors;\r\n state.stockRenewalState.completed = true;\r\n },\r\n createStockRenewals_Error(state, action: PayloadAction) {\r\n state.stockRenewalState.processing = false;\r\n state.stockRenewalState.completed = true;\r\n state.stockRenewalState.hasErrors = true;\r\n },\r\n resetStockRenewalState(state, action: PayloadAction) {\r\n state.stockRenewalState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n dataLength: undefined,\r\n };\r\n state.processing = false;\r\n state.stockRenewalValueHandler = undefined;\r\n state.selectedServiceTypes = [];\r\n state.barcodeScanned = undefined;\r\n state.refeshOfflineServices = undefined;\r\n },\r\n\r\n setRenewStockValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof RenewStockState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setRenewStockValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof RenewStockState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.renewStockValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetRenewStockValueHandler(state, action: PayloadAction) {\r\n state.renewStockValueHandler = undefined;\r\n },\r\n initRenewStock(\r\n state,\r\n action: PayloadAction<{\r\n query: RenewStockParams;\r\n service?: IOtherServices;\r\n }>,\r\n ) {\r\n state.renewStockState = {\r\n data: undefined,\r\n processing: true,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n };\r\n state.renewStockValueHandler = undefined;\r\n },\r\n initRenewStock_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n data: IOtherServices;\r\n isEdit: boolean;\r\n serviceType: IOfflineServiceFilterDto | null;\r\n }>,\r\n ) {\r\n state.renewStockState.processing = false;\r\n state.renewStockState.data = ConvertRenewStockToModel(\r\n action.payload.data,\r\n action.payload.serviceType,\r\n );\r\n state.isEdit = action.payload.isEdit;\r\n },\r\n initRenewStock_Error(state, action: PayloadAction) {\r\n state.renewStockState.processing = false;\r\n },\r\n createRenewStock(\r\n state,\r\n action: PayloadAction<{\r\n model: RenewStockState;\r\n editCreatable: boolean;\r\n preventRefreshTable?: boolean;\r\n autoGenerateBatch?: boolean;\r\n saveCreatable?: boolean;\r\n }>,\r\n ) {\r\n state.renewStockState.processing = true;\r\n state.renewStockState.completed = undefined;\r\n state.renewStockState.hasErrors = undefined;\r\n },\r\n createRenewStock_Success(\r\n state,\r\n action: PayloadAction<{ hasErrors: boolean }>,\r\n ) {\r\n state.renewStockState.processing = false;\r\n state.renewStockState.hasErrors = action.payload.hasErrors;\r\n state.renewStockState.completed = true;\r\n },\r\n createRenewStock_Error(state, action: PayloadAction) {\r\n state.renewStockState.processing = false;\r\n state.renewStockState.completed = true;\r\n state.renewStockState.hasErrors = true;\r\n },\r\n updateRenewStock(\r\n state,\r\n action: PayloadAction<{\r\n current: OtherServiceDetailsState;\r\n original: OtherServiceDetailsState;\r\n editCreatable: boolean;\r\n autoGenerateBatch?: boolean;\r\n }>,\r\n ) {\r\n state.renewStockState.processing = true;\r\n state.renewStockState.completed = undefined;\r\n state.renewStockState.hasErrors = undefined;\r\n },\r\n updateRenewStock_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.renewStockState.processing = false;\r\n state.renewStockState.hasErrors = action.payload.hasErrors;\r\n state.renewStockState.completed = true;\r\n },\r\n updateRenewStock_Error(state, action: PayloadAction) {\r\n state.renewStockState.processing = false;\r\n state.renewStockState.completed = true;\r\n state.renewStockState.hasErrors = true;\r\n },\r\n resetRenewStockState(state, action: PayloadAction) {\r\n state.renewStockState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n dataLength: undefined,\r\n };\r\n state.processing = false;\r\n state.renewStockValueHandler = undefined;\r\n state.isEdit = undefined;\r\n },\r\n setInventoryBatchValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof InventoryBatchState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setInventoryBatchValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof InventoryBatchState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.inventoryBatchValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetInventoryBatchValueHandler(state, action: PayloadAction) {\r\n state.inventoryBatchValueHandler = undefined;\r\n },\r\n initInventoryBatch(\r\n state,\r\n action: PayloadAction<{\r\n query: InventoryBatchParams;\r\n batch?: IInventoryBatchDto;\r\n }>,\r\n ) {\r\n state.inventoryBatchState = {\r\n data: undefined,\r\n processing: true,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n };\r\n state.inventoryBatchValueHandler = undefined;\r\n },\r\n initInventoryBatch_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n data: IInventoryBatchDto;\r\n isEdit: boolean;\r\n serviceType: IOfflineServiceFilterDto | null;\r\n newDate: Date | string;\r\n }>,\r\n ) {\r\n state.inventoryBatchState.processing = false;\r\n state.inventoryBatchState.data = ConvertInventoryBatchToModel(\r\n action.payload.data,\r\n action.payload.serviceType,\r\n action.payload.newDate,\r\n );\r\n state.batchIsEdit = action.payload.isEdit;\r\n },\r\n initInventoryBatch_Error(state, action: PayloadAction) {\r\n state.inventoryBatchState.processing = false;\r\n },\r\n createInventoryBatch(\r\n state,\r\n action: PayloadAction<{\r\n model: InventoryBatchState;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n }>,\r\n ) {\r\n state.inventoryBatchState.processing = true;\r\n state.inventoryBatchState.completed = undefined;\r\n state.inventoryBatchState.hasErrors = undefined;\r\n },\r\n createInventoryBatch_Success(\r\n state,\r\n action: PayloadAction<{ hasErrors: boolean }>,\r\n ) {\r\n state.inventoryBatchState.processing = false;\r\n state.inventoryBatchState.hasErrors = action.payload.hasErrors;\r\n state.inventoryBatchState.completed = true;\r\n },\r\n createInventoryBatch_Error(state, action: PayloadAction) {\r\n state.inventoryBatchState.processing = false;\r\n state.inventoryBatchState.completed = true;\r\n state.inventoryBatchState.hasErrors = true;\r\n },\r\n updateInventoryBatch(\r\n state,\r\n action: PayloadAction<{\r\n current: InventoryBatchState;\r\n original: InventoryBatchState;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n }>,\r\n ) {\r\n state.inventoryBatchState.processing = true;\r\n state.inventoryBatchState.completed = undefined;\r\n state.inventoryBatchState.hasErrors = undefined;\r\n },\r\n updateInventoryBatch_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.inventoryBatchState.processing = false;\r\n state.inventoryBatchState.hasErrors = action.payload.hasErrors;\r\n state.inventoryBatchState.completed = true;\r\n },\r\n updateInventoryBatch_Error(state, action: PayloadAction) {\r\n state.inventoryBatchState.processing = false;\r\n state.inventoryBatchState.completed = true;\r\n state.inventoryBatchState.hasErrors = true;\r\n },\r\n resetInventoryBatchState(state, action: PayloadAction) {\r\n state.inventoryBatchState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n dataLength: undefined,\r\n };\r\n state.processing = false;\r\n state.inventoryBatchValueHandler = undefined;\r\n state.batchIsEdit = undefined;\r\n },\r\n setInventoryBatchEditable(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.inventoryBatchEditable = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: offlineServiceStateActions } = slice;\r\n\r\nexport const useOfflineServiceStateSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: offlineServiceStateSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useOfflineServiceStateSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicTableRefreshEventHandler } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\nimport { Identifiable } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\nimport { RUN_TYPES } from '../../components/RunTypePicker';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { samplesListSaga } from './saga';\r\nimport {\r\n IRunDetails,\r\n ISample,\r\n ISampleListTableState,\r\n ISampleRun,\r\n ISampleRunUpdate,\r\n ISampleRunUpdateResponse,\r\n ISamplesListState,\r\n ISampleTarget,\r\n} from './types';\r\n\r\nexport const initialState: ISamplesListState = {\r\n SamplesList: {\r\n processing: false,\r\n },\r\n SamplesListTableState: {\r\n pageSize: 10,\r\n pageIndex: 0,\r\n sortBy: [{ id: 'Id', desc: true }],\r\n customFilters: [],\r\n globalFilter: '',\r\n },\r\n EditMode: false,\r\n SamplesSelected: [],\r\n ShowRunDialog: false,\r\n ImportStarted: false,\r\n ImportFinished: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'samplesList',\r\n initialState,\r\n reducers: {\r\n loadSamplesList(state, action: PayloadAction) {\r\n state.SamplesList.processing = true;\r\n state.SamplesListTableState = {\r\n pageSize: action.payload.pageSize,\r\n pageIndex: action.payload.pageIndex,\r\n sortBy: action.payload.sortBy,\r\n globalFilter: action.payload.globalFilter,\r\n searchColumns: action.payload.searchColumns,\r\n customFilters: action.payload.customFilters?.map(filter => ({\r\n fieldName: filter.fieldName,\r\n operator: filter.operator,\r\n value: filter.value,\r\n })),\r\n serviceGroups:\r\n action.payload.serviceGroups?.length !== 0\r\n ? action.payload.serviceGroups\r\n : undefined,\r\n };\r\n },\r\n export(state, action: PayloadAction) {},\r\n loadSamplesList_Success(state, action: PayloadAction) {\r\n state.SamplesList.processing = false;\r\n state.SamplesList.error = undefined;\r\n state.SamplesList.data = action.payload.value as ISample[];\r\n state.SamplesList.dataLength = action.payload['@odata.count'];\r\n },\r\n loadSamplesList_Error(state, action: PayloadAction) {\r\n state.SamplesList.processing = false;\r\n state.SamplesList.error = action.payload;\r\n },\r\n setSelectedSamples(state, action: PayloadAction) {\r\n state.SamplesSelected = action.payload;\r\n },\r\n loadAllFilteredSamples(state, action: PayloadAction) {},\r\n loadAllFilteredSamples_Success(state, action: PayloadAction) {},\r\n\r\n deleteSamples(\r\n state,\r\n action: PayloadAction<{\r\n selectedRows: ISample[];\r\n refresh: BasicTableRefreshEventHandler | undefined;\r\n }>,\r\n ) {},\r\n\r\n updateField(state, action: PayloadAction>) {\r\n // update row in samples list\r\n const item = state.SamplesList?.data?.find(\r\n s => s.Id === action.payload.Id,\r\n );\r\n if (item !== undefined) {\r\n Object.assign(item, action.payload);\r\n }\r\n },\r\n updateField_Success(state, action: PayloadAction) {},\r\n updateField_Error(state, action: PayloadAction) {},\r\n\r\n loadRunDetqails(\r\n state,\r\n action: PayloadAction<{\r\n id: number;\r\n columns: Array | undefined;\r\n }>,\r\n ) {},\r\n loadRunDetqails_Success(state, action: PayloadAction) {\r\n state.RunDetails = action.payload;\r\n },\r\n\r\n runSelectedSamples(\r\n state,\r\n action: PayloadAction<{\r\n runType?: RunTypesUnion;\r\n samples: ISample[] | undefined;\r\n }>,\r\n ) {\r\n state.SelectedRunType = action.payload.runType;\r\n },\r\n runSelectedSamples_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n updateRunSampleValue(state, action: PayloadAction>) {\r\n const item = state.RunDetails?.Samples?.find(\r\n s => s.Id === action.payload.Id,\r\n );\r\n if (item !== undefined) {\r\n // set updated properties on original row\r\n Object.assign(item, action.payload);\r\n\r\n // in case of the Labeling run all of the Target* properties should be the same\r\n // for all of the samples with the same ServiceRequest and same TMT_Set\r\n // as these are combined into a singel sample upon run completionc\r\n const rt = Object.keys(RUN_TYPES).find(k => k === 'Labeling');\r\n if (state.RunDetails?.RunType === rt) {\r\n const props: (keyof ISampleTarget)[] = [\r\n 'TargetConcentration',\r\n 'TargetPlateId',\r\n 'TargetPosition',\r\n 'TargetVolume',\r\n 'TargetTubeLabel',\r\n 'TargetSampleType',\r\n ];\r\n props.forEach(prop => {\r\n if (action.payload[prop] !== undefined) {\r\n const payloadWithoutId = {};\r\n payloadWithoutId[prop] = item[prop];\r\n state.RunDetails?.Samples?.filter(\r\n s =>\r\n s.TMT_Set === item.TMT_Set &&\r\n s.ServiceRequestId === item.ServiceRequestId,\r\n ).forEach(s => Object.assign(s, payloadWithoutId));\r\n }\r\n });\r\n }\r\n }\r\n },\r\n\r\n setShowRunDialog(state, action: PayloadAction) {\r\n state.ShowRunDialog = action.payload;\r\n },\r\n setRunType(state, action: PayloadAction) {\r\n state.SelectedRunType = action.payload;\r\n if (action.payload === undefined) {\r\n return;\r\n }\r\n const runType = RUN_TYPES[action.payload];\r\n switch (runType) {\r\n case RUN_TYPES.StandardRun:\r\n break;\r\n case RUN_TYPES.MassSpec:\r\n break;\r\n case RUN_TYPES.Labeling:\r\n break;\r\n }\r\n },\r\n setShowImportDialog(state, action: PayloadAction) {\r\n state.ImportStarted = action.payload;\r\n state.ImportFinished = false;\r\n },\r\n readImportFile(\r\n state,\r\n action: PayloadAction<{ file: File; plate: ISampleCreateBase | null }>,\r\n ) {},\r\n readImportFile_Success(\r\n state,\r\n action: PayloadAction & ISampleTarget>>,\r\n ) {\r\n action.payload.forEach(record => {\r\n const sample = state.RunDetails?.Samples?.find(\r\n sample => sample.Id === record.Id,\r\n );\r\n if (sample !== undefined) {\r\n sample.TargetPosition = record.TargetPosition;\r\n sample.TargetPlateId = record.TargetPlateId;\r\n\r\n sample.TargetTubeLabel = record.TargetTubeLabel;\r\n sample.TargetSampleType = record.TargetSampleType;\r\n\r\n sample.TargetConcentration = record.TargetConcentration;\r\n sample.TargetVolume = record.TargetVolume;\r\n }\r\n });\r\n state.ImportStarted = false;\r\n state.ImportFinished = true;\r\n },\r\n\r\n completeRun(state, aciton: PayloadAction>) {},\r\n completeRun_Success(state, aciton: PayloadAction) {},\r\n completeRun_Error(state, aciton: PayloadAction) {},\r\n updateRun(state, aciton: PayloadAction) {},\r\n updateRun_Success(\r\n state,\r\n aciton: PayloadAction,\r\n ) {\r\n if (state.RunDetails !== undefined && aciton.payload !== undefined) {\r\n state.RunDetails.Gradient = aciton.payload.Gradient;\r\n state.RunDetails.Instrument = aciton.payload.Instrument;\r\n state.RunDetails.SecondaryInstrument =\r\n aciton.payload.SecondaryInstrument;\r\n state.RunDetails.ACQUISITION_TYPE = aciton.payload.ACQUISITION_TYPE;\r\n }\r\n },\r\n updateRun_Error(state, aciton: PayloadAction) {},\r\n\r\n exportRun(state, action: PayloadAction) {},\r\n toggleEditMode(state, action: PayloadAction) {\r\n state.EditMode = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: samplesListActions } = slice;\r\n\r\nexport const useSamplesListSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: samplesListSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useSamplesListSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport {\r\n BasicTableProps,\r\n IBasicTableState,\r\n IRow,\r\n} from 'app/components/BasicTable';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useMemo } from 'react';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport {\r\n defaultSerializer,\r\n findIsfilterInversed,\r\n setisInversedForUrl,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { GetPageFilters } from './BasicFilter/GetPageFilters';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { parseInt, trimEnd } from 'lodash';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { FilterValueType } from './BasicFilter/FilterValueType';\r\nimport { getDependencyFilters } from './BasicFilter';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TableSavedListSettings } from './BasicTableProps';\r\nimport { useProfileSetting } from './useProfileSetting';\r\nimport { parseProfileUrl } from './useProfileSetting/parseProfileUrl';\r\nimport { getNextFilter } from './getNextFilter';\r\nimport { getFilterValue } from './getFilterValue';\r\nimport { SAVEDVIEW_SEARCH_KEY } from './BasicFilter/SavedListsDropDown';\r\nimport { useSavedViewSlice } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { initFilterData } from './initFilterData';\r\n\r\nexport function toURLSearchParams(\r\n items: Array<\r\n Pick<\r\n IFilterSettings,\r\n 'queryStringSerializer' | 'value' | 'isInversed'\r\n >\r\n >,\r\n) {\r\n var result = new URLSearchParams();\r\n const serializableItems = items.filter(\r\n element => element.queryStringSerializer !== undefined,\r\n );\r\n serializableItems.forEach(element => {\r\n var value = element.value;\r\n\r\n if (value !== undefined) {\r\n const serializer =\r\n typeof element.queryStringSerializer == 'string'\r\n ? defaultSerializer(element.queryStringSerializer)\r\n : element.queryStringSerializer;\r\n const stringValue = serializer?.(value);\r\n if (stringValue !== undefined) {\r\n if (stringValue instanceof URLSearchParams) {\r\n (stringValue as URLSearchParams).forEach((v, n) =>\r\n result.set(n, setisInversedForUrl(v, !!element.isInversed)),\r\n );\r\n }\r\n }\r\n }\r\n });\r\n return result;\r\n}\r\n/**\r\n *\r\n * @param savedFilterKey a key to save/load \"saved filters\" by\r\n * @param GetFiltersDefinition filters settings provider\r\n * @param getDefaultFilter default filters settlings\r\n * @param reservedQueryStringParameterNames query string parameter names to ignore\r\n * @param getRequiredFilter required filter settings provider\r\n * @param getSelectedViewFilter ??? something to do with ListId,AssetId\r\n * @param enableSavedLists adds a dropdown with \"saved list\" of instruments\r\n * @param useSyncSearch controls syncing of the filters state into the url's search parameter\r\n * @returns\r\n */\r\nexport function useFilters(\r\n savedFilterKey: string,\r\n GetFiltersDefinition: GetPageFilters,\r\n getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams,\r\n reservedQueryStringParameterNames?: string[],\r\n getRequiredFilter?: (\r\n search: string,\r\n appSettings?: AppSettings | null,\r\n ) => string | undefined,\r\n getSelectedViewFilter?: (\r\n search: string,\r\n view: SavedViewSelected,\r\n ) => string | undefined,\r\n enableSavedLists?: boolean,\r\n savedListSettings?: TableSavedListSettings,\r\n useCardsByDefault?: boolean,\r\n /**\r\n * Indicates wether filters should return partial results or only return fully loaded filters.\r\n * By default this will first return Identifiable e.g. {Id:1} and after that the full entity e.g. {Id:1,Name:'Name'} when it'll be ready\r\n */\r\n getPartialResults?: boolean,\r\n useSyncSearch: boolean = true,\r\n) {\r\n const dispatch = useDispatch();\r\n const { actions: savedViewActions } = useSavedViewSlice();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const location = useLocation();\r\n const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n const rowsKey = savedFilterKey + '_rows';\r\n const useCardsKey = savedFilterKey + '_useCardsMode';\r\n const {\r\n savedValue: savedUrl,\r\n updateValue: updateSavedFilterValue,\r\n } = useProfileSetting({\r\n profileSettingKey: (savedFilterKey ?? location.pathname).toLowerCase(),\r\n });\r\n const { search: savedFilterValue } = parseProfileUrl(savedUrl);\r\n const [filterChange, setFilterChange] = React.useState(false);\r\n React.useEffect(\r\n () => {\r\n if (authenticatedUser === undefined) {\r\n return;\r\n }\r\n if (filterChange) {\r\n setFilterChange(false);\r\n return;\r\n }\r\n const defaultSearch = getPresetFilter(\r\n savedFilterValue,\r\n authenticatedUser,\r\n );\r\n const isDefault =\r\n defaultSearch === undefined || (savedFilterValue ?? '') === '';\r\n\r\n let search = isEmptyOrWhitespace(location.search)\r\n ? defaultSearch ?? ''\r\n : location.search;\r\n const requiredSearch =\r\n getRequiredFilter !== null && getRequiredFilter !== undefined\r\n ? getRequiredFilter(search, appSettings)\r\n : undefined;\r\n search = requiredSearch === undefined ? search : requiredSearch ?? '';\r\n\r\n const savedViewId = tryParseInt(\r\n new URLSearchParamsCI(search).get(SAVEDVIEW_SEARCH_KEY),\r\n );\r\n dispatch(savedViewActions.selectSavedView(savedViewId));\r\n\r\n // get the filters\r\n const localizedFilters = getLocalizedFilters(search);\r\n let visibleFilters = localizedFilters\r\n ?.map(f =>\r\n isDefault\r\n ? mapDefaultFilters({\r\n ...f,\r\n isInversed: findIsfilterInversed(\r\n search,\r\n f.urlKey ??\r\n (typeof f.queryStringSerializer === 'string'\r\n ? f.queryStringSerializer\r\n : undefined),\r\n ),\r\n })\r\n : {\r\n ...f,\r\n isInversed: findIsfilterInversed(\r\n search,\r\n f.urlKey ??\r\n (typeof f.queryStringSerializer === 'string'\r\n ? f.queryStringSerializer\r\n : undefined),\r\n ),\r\n },\r\n )\r\n .filter(showFiltersFn);\r\n let depFilters = getDependencyFilters(visibleFilters);\r\n if (getPartialResults !== true) {\r\n setAppliedFilters(depFilters);\r\n }\r\n setAppliedFilters(initFilterData(depFilters, globalServiceGroupFilter));\r\n if (!isEmptyOrWhitespace(search) && search !== location.search) {\r\n dispatch(\r\n routerActions.replace({\r\n pathname: trimEnd(location.pathname, '?'),\r\n search: search,\r\n }),\r\n );\r\n }\r\n\r\n const defaultRows = parseInt(\r\n userProfileSettings.GetSettingByKeyOrDefault(rowsKey).Value ?? '',\r\n );\r\n setPageSize(isNaN(defaultRows) ? 10 : defaultRows);\r\n if (useCardsByDefault !== undefined) {\r\n const defaultCardsMode =\r\n userProfileSettings.GetSettingByKeyOrDefault(useCardsKey).Value ?? '';\r\n setCardsMode(\r\n defaultCardsMode === ''\r\n ? !!useCardsByDefault\r\n : defaultCardsMode === true.toString(),\r\n );\r\n }\r\n },\r\n // globalServiceGroupFilter dependency has been added to reload the filters after globalServiceGroupFilter change. This is needed to remove/add service group related filter items from already loaded filters. e.g. a service that does not belong to newly selected service group/s\r\n // other dependencies are excluded for backwards compatibility (this was previously executed in useEffectOnMount). This should probably changed some time later when there's no prod release around the corner\r\n // location.pathname, location.search are needed to react for their changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [globalServiceGroupFilter, location.pathname, location.search],\r\n );\r\n\r\n const userProfileSettings = useSelector(selectUserProfileSettings);\r\n\r\n const removeEmptyFilters = (\r\n filter: string | undefined,\r\n ): string | undefined => {\r\n if (filter === undefined && filter === null) {\r\n return undefined;\r\n } else {\r\n const params = new URLSearchParams(filter);\r\n let newParams = new URLSearchParams();\r\n for (const [name, value] of params) {\r\n if (value !== undefined) {\r\n newParams.append(name, value);\r\n }\r\n }\r\n return newParams.toString();\r\n }\r\n };\r\n function getPresetFilter(\r\n savedFilter: string | undefined | null,\r\n user: IAuthenticatedUser,\r\n ): string | undefined {\r\n const result =\r\n savedFilter !== undefined && savedFilter !== null\r\n ? removeEmptyFilters(savedFilter)\r\n : getDefaultFilter !== undefined && getDefaultFilter !== null\r\n ? getDefaultFilter(user)?.toString()\r\n : undefined;\r\n return result;\r\n }\r\n\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const getLocalizedFilters = useMemo(() => {\r\n const result = GetFiltersDefinition(\r\n t,\r\n appSettings,\r\n authenticatedUser ?? null,\r\n settings,\r\n );\r\n return result;\r\n }, [GetFiltersDefinition, appSettings, authenticatedUser, settings, t]);\r\n\r\n const allFilters = useMemo(() => {\r\n var result = isEmptyOrWhitespace(location.search)\r\n ? getLocalizedFilters('')\r\n : getLocalizedFilters(location.search);\r\n return result;\r\n }, [getLocalizedFilters, location.search]);\r\n\r\n const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n IFilterSettings[] | undefined\r\n >(undefined);\r\n\r\n const [pageSize, setPageSize] = React.useState();\r\n const [pageIndex, setPageIndex] = React.useState();\r\n\r\n const [cardsMode, setCardsMode] = React.useState(\r\n !!useCardsByDefault,\r\n );\r\n\r\n const syncSearch = React.useCallback(\r\n (newState: Array>) => {\r\n const currentSearch = getNextFilter(\r\n newState,\r\n location.search,\r\n reservedQueryStringParameterNames,\r\n );\r\n const originalSearch = new URLSearchParamsCI(location.search);\r\n\r\n // clear saved view selection when instrument selection changes\r\n if (enableSavedLists && savedListSettings !== undefined) {\r\n if (savedListSettings?.savedListSerializedKey !== undefined) {\r\n const currentInstrumentSelection = currentSearch.get(\r\n savedListSettings?.savedListSerializedKey,\r\n );\r\n const originalInstrumentSelection = originalSearch.get(\r\n savedListSettings?.savedListSerializedKey,\r\n );\r\n if (currentInstrumentSelection !== originalInstrumentSelection) {\r\n // remove the selection from the search\r\n currentSearch.delete(SAVEDVIEW_SEARCH_KEY);\r\n // clear redux state\r\n dispatch(savedViewActions.selectMyList());\r\n }\r\n }\r\n }\r\n\r\n // push current filter state to the URL search if it's not equivalent\r\n if (!originalSearch.equals(currentSearch)) {\r\n const currentSearchString = currentSearch.toString();\r\n // trim the question mark in case and for any reason the double question marks ended up saved in the \"saved filter\"\r\n // in this case the search part will be OK, but the pathname will end with the question mark\r\n // e.g. /reservations??eid=2 => pathName = \"/reservations?\"\r\n const pathName = trimEnd(location.pathname, '?');\r\n const url = pathName + '?' + currentSearchString;\r\n updateSavedFilterValue(url);\r\n dispatch(\r\n routerActions.push({\r\n pathname: location.pathname,\r\n search: currentSearchString,\r\n }),\r\n );\r\n }\r\n },\r\n [\r\n dispatch,\r\n enableSavedLists,\r\n location.pathname,\r\n location.search,\r\n reservedQueryStringParameterNames,\r\n savedListSettings,\r\n savedViewActions,\r\n updateSavedFilterValue,\r\n ],\r\n );\r\n\r\n const handleFilterChange: (\r\n items: IFilterSettings[],\r\n ) => void = React.useCallback(\r\n items => {\r\n const newState = [...items.filter(showFiltersFn)];\r\n\r\n setAppliedFilters(getDependencyFilters(newState));\r\n if (useSyncSearch) {\r\n syncSearch(newState);\r\n }\r\n setFilterChange(true);\r\n },\r\n [setAppliedFilters, showFiltersFn, syncSearch, useSyncSearch],\r\n );\r\n const setFilterValueCallback = React.useCallback(\r\n (id: string, value: FilterValueType) => {\r\n if (allFilters === undefined) {\r\n return;\r\n }\r\n const filter = allFilters?.find(f => f.id === id);\r\n // in cases when applied filter is not defined call to setAppliedFilters will just only mutate appliedFilters array and cause duplicate/unnecessary invocation of hooks that have appliedFilters as a dependency\r\n if (filter !== undefined) {\r\n filter.value = value;\r\n const x = allFilters\r\n .map(f => (f === filter ? { ...filter, ...{ value: value } } : f))\r\n .filter(showFiltersFn);\r\n handleFilterChange(x);\r\n }\r\n },\r\n [allFilters, handleFilterChange, showFiltersFn],\r\n );\r\n const getFilterValueCallback = React.useCallback(\r\n (id: string) => {\r\n const f = getFilterValue(appliedFilters, id);\r\n return f;\r\n },\r\n [appliedFilters],\r\n );\r\n\r\n const handelPageSizeChange = (size: number) => {\r\n if (!isNaN(size) && pageSize !== size && size > 0) {\r\n setPageSize(size);\r\n dispatch(appActions.savePageSize({ key: rowsKey, value: size }));\r\n }\r\n };\r\n const handelPageIndexChange = (index: number) => {\r\n if (!isNaN(index) && pageIndex !== index && index >= 0) {\r\n setPageIndex(index);\r\n }\r\n };\r\n\r\n const handleCardsModeChange = (isCardsMode: boolean) => {\r\n if (cardsMode !== isCardsMode) {\r\n setCardsMode(isCardsMode);\r\n dispatch(\r\n appActions.saveCardsMode({ key: useCardsKey, value: isCardsMode }),\r\n );\r\n }\r\n };\r\n const [defaultFilters, setDefaultFilters] = useAsyncExtendedState<\r\n IFilterSettings[]\r\n >([]);\r\n React.useEffect(() => {\r\n const defaults = getDependencyFilters(\r\n getLocalizedFilters(\r\n getDefaultFilter?.(\r\n authenticatedUser as IAuthenticatedUser,\r\n )?.toString() ?? '',\r\n )\r\n .map(mapDefaultFilters)\r\n .filter(showFiltersFn),\r\n );\r\n setDefaultFilters(defaults);\r\n setDefaultFilters(initFilterData(defaults, globalServiceGroupFilter));\r\n }, [\r\n authenticatedUser,\r\n getDefaultFilter,\r\n getLocalizedFilters,\r\n globalServiceGroupFilter,\r\n setDefaultFilters,\r\n showFiltersFn,\r\n ]);\r\n const getDefaultFilters = React.useCallback(() => {\r\n return defaultFilters;\r\n }, [defaultFilters]);\r\n\r\n return {\r\n allfilters: allFilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n handelPageSizeChange,\r\n pageSize,\r\n handelPageIndexChange,\r\n pageIndex,\r\n getFilterValue: getFilterValueCallback,\r\n setFilterValue: setFilterValueCallback,\r\n cardsMode,\r\n onModeChange: handleCardsModeChange,\r\n getDefaultFilters,\r\n };\r\n}\r\n/**\r\n * Filter function to determine if the filter is needs to be shown\r\n * @param item\r\n * @returns\r\n */\r\nexport function visibleFiltersFilter(item: IFilterSettings) {\r\n return item.value !== undefined || item.notNullable; //|| item.visible === true,\r\n}\r\n\r\nexport function mapDefaultFilters(\r\n item: IFilterSettings,\r\n): IFilterSettings {\r\n return { ...item, value: !item.notDefault ? item.value ?? null : item.value };\r\n}\r\nexport interface IWithSavedHistoryComponentProps {\r\n /**\r\n * Innitial State of the filters container (close / open)\r\n */\r\n filterOpen?: boolean;\r\n /**\r\n * List of applicable filters\r\n */\r\n availableFilters?: IFilterSettings[];\r\n\r\n /**\r\n * List of applicable filters\r\n */\r\n appliedFilters?: IFilterSettings[];\r\n /**\r\n * Enables data export. On by default.\r\n */\r\n onFilterChange?: (items: IFilterSettings[]) => void;\r\n\r\n /**\r\n * Initial table state. Part of the react-table API\r\n * Example: \r\n * {\r\n sortBy: [{ id: 'Name', desc: false }],\r\n }\r\n */\r\n initialState?: IBasicTableState;\r\n /**\r\n * Id of the screen that table related to. Required!\r\n */\r\n screenId?: ScreensId;\r\n /**\r\n * Saved List settings\r\n */\r\n savedListSettings?: TableSavedListSettings;\r\n /**\r\n * Retrieves curent value set in a filter\r\n */\r\n getFilterValue?: (id: string) => FilterValueType | undefined;\r\n /**\r\n * Updates the value of a filter\r\n */\r\n setFilterValue?: (id: string, value: FilterValueType) => void;\r\n /**\r\n * should use cards mode by default\r\n */\r\n useCardsByDefault?: boolean;\r\n /**\r\n * updates the card mode\r\n */\r\n onModeChange?: (isCardsMode: boolean) => void;\r\n /**\r\n * gets this pages default filters\r\n */\r\n getDefaultFilters?: () => IFilterSettings[];\r\n}\r\n/**\r\n *\r\n * @param Component\r\n * @param savedFilterKey\r\n * @returns\r\n */\r\nexport function withSavedHistoryT<\r\n TRow extends IRow,\r\n TProps extends IWithSavedHistoryComponentProps = BasicTableProps\r\n>(\r\n Component: React.FC,\r\n savedFilterKey: string,\r\n GetFiltersDefinition: GetPageFilters,\r\n getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams,\r\n reservedQueryStringParameterNames?: string[],\r\n getRequiredFilter?: (\r\n search: string,\r\n appSettings?: AppSettings | null,\r\n ) => string | undefined,\r\n getSelectedViewFilter?: (\r\n search: string,\r\n view: SavedViewSelected,\r\n ) => string | undefined,\r\n enableSavedLists?: boolean,\r\n useCardsByDefault?: boolean,\r\n): React.FC {\r\n return ({\r\n onFilterChange,\r\n availableFilters,\r\n initialState,\r\n ...props\r\n }: TProps) => {\r\n const {\r\n allfilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n handelPageSizeChange,\r\n pageSize,\r\n handelPageIndexChange,\r\n pageIndex,\r\n getFilterValue,\r\n setFilterValue,\r\n cardsMode,\r\n onModeChange,\r\n getDefaultFilters,\r\n } = useFilters(\r\n savedFilterKey,\r\n GetFiltersDefinition,\r\n getDefaultFilter,\r\n reservedQueryStringParameterNames,\r\n getRequiredFilter,\r\n getSelectedViewFilter,\r\n enableSavedLists,\r\n props.savedListSettings,\r\n useCardsByDefault,\r\n );\r\n return (\r\n <>\r\n {appliedFilters !== undefined && (\r\n \r\n )}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport function getIgnoredSearch(search: string, ignore: string[]) {\r\n var p = new URLSearchParams(search);\r\n [...p.keys()].forEach(key => {\r\n if (!ignore.includes(key)) {\r\n p.delete(key);\r\n }\r\n });\r\n\r\n return p;\r\n}\r\nexport function combineSearch(search: string, other?: string) {\r\n if (other === undefined) {\r\n return search;\r\n } else {\r\n let p = new URLSearchParams(search);\r\n let o = new URLSearchParams(other);\r\n for (const key of o.keys()) {\r\n if (!p.has(key)) {\r\n const val = o.get(key);\r\n if (val !== null) {\r\n p.set(key, val);\r\n }\r\n }\r\n }\r\n return p.toString();\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { StandardInput } from '../BaseInputs/StandardInput';\r\nimport clsx from 'clsx';\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n InputLabel,\r\n Select,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport { BaseFieldProps } from './BaseFieldDefinition';\r\nimport FilledInput from '../BaseInputs/FilledInput';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport const styles = {\r\n /* Styles applied to the root element. */\r\n root: {\r\n '&.startIcon': {\r\n '& > label': {\r\n marginLeft: '24px',\r\n },\r\n },\r\n },\r\n};\r\nconst variantComponent = {\r\n standard: StandardInput,\r\n filled: FilledInput,\r\n outlined: StandardInput,\r\n};\r\nexport const BaseField = React.forwardRef(function (\r\n props,\r\n ref,\r\n) {\r\n const {\r\n autoComplete,\r\n autoFocus = false,\r\n children,\r\n classes,\r\n className,\r\n color = 'primary',\r\n defaultValue,\r\n disabled = false,\r\n error = false,\r\n FormHelperTextProps,\r\n fullWidth = false,\r\n helperText,\r\n hiddenLabel,\r\n id,\r\n InputLabelProps,\r\n inputProps,\r\n InputProps,\r\n inputRef,\r\n focused,\r\n label,\r\n multiline = false,\r\n name,\r\n onBlur,\r\n onChange,\r\n onFocus,\r\n placeholder,\r\n required = false,\r\n rows,\r\n rowsMax,\r\n rowsMin,\r\n select = false,\r\n SelectProps,\r\n type,\r\n value,\r\n variant = 'filled',\r\n info,\r\n size = 'large',\r\n ...other\r\n } = props;\r\n\r\n let inputMore: any = {};\r\n if (variant === 'outlined') {\r\n if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {\r\n inputMore.notched = InputLabelProps.shrink;\r\n }\r\n if (label) {\r\n const displayRequired = InputLabelProps?.required ?? required;\r\n inputMore.label = (\r\n \r\n {label}\r\n {displayRequired && '\\u00a0*'}\r\n \r\n );\r\n }\r\n }\r\n // if (info) {\r\n // InputProps?.endAdornment = ;\r\n // }\r\n if (select) {\r\n // unset defaults from textbox inputs\r\n if (!SelectProps || !SelectProps.native) {\r\n inputMore.id = undefined;\r\n }\r\n inputMore['aria-describedby'] = undefined;\r\n }\r\n const requiredPlaseholder = placeholder !== undefined && required && !label;\r\n const helperTextId = helperText && id ? `${id}-helper-text` : undefined;\r\n const inputLabelId = label && id ? `${id}-label` : undefined;\r\n const InputComponent = variantComponent[variant];\r\n const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n const InputElement = (\r\n \r\n );\r\n const LabelElement = (\r\n \r\n {label}\r\n \r\n );\r\n return (\r\n \r\n {label && LabelElement}\r\n\r\n {select ? (\r\n \r\n {children}\r\n \r\n ) : (\r\n InputElement\r\n )}\r\n\r\n {helperText && (\r\n \r\n {typeof helperText === 'string'\r\n ? helperText\r\n : JSON.stringify(helperText, null, 2)}\r\n \r\n )}\r\n \r\n );\r\n});\r\nexport default withStyles(styles, { name: 'BaseTextField' })(BaseField);\r\n//export default function BaseField(props: BaseFieldProps): JSX.Element;\r\n","import { Menu, MenuProps } from '@material-ui/core';\r\nimport { ReactNode, useState } from 'react';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\n\r\nexport interface DropDownProps extends ButtonProps {\r\n menuChildren: (onClose: () => void) => ReactNode | ReactNode[];\r\n addChevron?: boolean;\r\n menuProps?: Omit;\r\n id?: string;\r\n onOpen?: () => void;\r\n onHandleClose?: () => void;\r\n iconButton?: boolean;\r\n disablePortal?: boolean;\r\n}\r\n\r\nexport const DropDown = ({\r\n onClick,\r\n onMouseDown,\r\n children,\r\n menuChildren,\r\n menuProps,\r\n addChevron,\r\n id,\r\n title,\r\n onOpen,\r\n onHandleClose,\r\n iconButton,\r\n disablePortal,\r\n endIcon,\r\n ...other\r\n}: DropDownProps) => {\r\n const [open, setOpen] = useState(false);\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const { marginThreshold, anchorOrigin, onClose, ...rest } = menuProps ?? {};\r\n const handleOpen = e => {\r\n setAnchorEl(e.currentTarget);\r\n setOpen(!open);\r\n if (!!onOpen) {\r\n onOpen();\r\n }\r\n };\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n setOpen(false);\r\n if (onHandleClose) {\r\n onHandleClose();\r\n }\r\n };\r\n return (\r\n <>\r\n \r\n {iconButton ? (\r\n {\r\n handleOpen(e);\r\n onClick?.(e);\r\n }}\r\n onMouseDown={e => {\r\n handleOpen(e);\r\n onMouseDown?.(e);\r\n }}\r\n aria-haspopup=\"true\"\r\n // endIcon={\r\n // addChevron ? (\r\n // \r\n // ) : undefined\r\n // }\r\n {...other}\r\n >\r\n {children}\r\n \r\n ) : (\r\n {\r\n handleOpen(e);\r\n onClick?.(e);\r\n }}\r\n onMouseDown={e => {\r\n handleOpen(e);\r\n onMouseDown?.(e);\r\n }}\r\n aria-haspopup=\"true\"\r\n endIcon={\r\n \r\n {addChevron && !!endIcon ? (\r\n \r\n \r\n {endIcon}\r\n \r\n ) : (\r\n \r\n {addChevron && (\r\n \r\n )}\r\n {!!endIcon && endIcon}\r\n \r\n )}\r\n \r\n }\r\n {...other}\r\n >\r\n {children}\r\n \r\n )}\r\n \r\n\r\n {\r\n handleClose();\r\n onClose && onClose(e, r);\r\n }}\r\n anchorOrigin={\r\n anchorOrigin ?? {\r\n vertical: 'bottom',\r\n horizontal: 'right',\r\n }\r\n }\r\n transformOrigin={{ vertical: 'top', horizontal: 'center' }}\r\n {...rest}\r\n >\r\n {open && menuChildren(handleClose)}\r\n \r\n \r\n );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const DateRenderer: Renderer>> = ({\r\n value,\r\n}) => {\r\n const { t } = useTranslation();\r\n return value === null || value === undefined ? (\r\n <>{t(translations.NA)}\r\n ) : (\r\n <>{dateUtils.shortDateFormat(value)}\r\n );\r\n};\r\nexport default DateRenderer;\r\n","/**\r\n * Defines what the comment is referencing.\r\n * Keep synchronized with enum in backend when changing.\r\n */\r\nexport enum CommentReferenceTypes {\r\n Alerts = 1,\r\n Invoice = 2,\r\n UserTraining = 3,\r\n Budget = 4,\r\n ServiceRequest = 5,\r\n ServiceRequestTicket = 6,\r\n ServiceRequestRow = 7,\r\n batches = 8,\r\n Article = 9,\r\n Assets = 10,\r\n}\r\n","export enum ArticleStatus {\r\n AwaitingApproval,\r\n Approved,\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.connectedFilters || initialState;\r\n\r\nexport const selectConnectedFilters = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectConnectedFiltersProcessing = createSelector(\r\n [selectConnectedFilters],\r\n state => state.processing,\r\n);\r\n\r\nexport const selectConnectedFiltersError = createSelector(\r\n [selectConnectedFilters],\r\n state => state.error,\r\n);\r\n\r\nexport const selectConnectedFiltersData = createSelector(\r\n [selectConnectedFilters],\r\n state => state.data,\r\n);\r\nexport const selectConnectedFieldHandler = createSelector(\r\n [selectConnectedFilters],\r\n state => state.connectedValueHandler,\r\n);\r\nexport const selectConnectedSettings = createSelector(\r\n [selectConnectedFilters],\r\n state => state.connectedSettings,\r\n);\r\n","/**\r\n *\r\n * OnlineServicePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { splitFilterValue } from 'app/components/BasicTable/types/FilterParam';\r\nexport type ServiceUrl = 'base' | 'admin' | 'reserved';\r\nexport interface OnlineServicePickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n urlType?: ServiceUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/ServiceFilter';\r\nconst adminUrl = '/api/odata/v4/ServiceFilter/AdminEquipments';\r\nconst reservableUrl = '/api/odata/v4/ServiceFilter/ReservableEquipments';\r\nexport const initOnlineServicesData = (\r\n initval: string | undefined,\r\n sourceurl?: ServiceUrl,\r\n separator?: string,\r\n serviceGroups?: Identifiable[],\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids = splitFilterValue(initval).map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n\r\n let foo: string | undefined = undefined;\r\n const predicates: string | Condition[] = [];\r\n if (ids.length > 0) {\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n }\r\n // apply only global service group filter related items filter\r\n // items not related to one of the selected cores are discarded\r\n if (serviceGroups !== undefined && serviceGroups?.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n serviceGroups.map(f => f.Id),\r\n ),\r\n );\r\n }\r\n foo = predicates.map(f => f.toString()).join(' and ');\r\n\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n $expand: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: foo,\r\n $skip: 0,\r\n $top: 10,\r\n $expand: 'WorkingHours',\r\n };\r\n let initUrl =\r\n sourceurl === undefined\r\n ? url\r\n : sourceurl === 'reserved'\r\n ? reservableUrl\r\n : sourceurl === 'admin'\r\n ? adminUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n urlType: ServiceUrl | undefined,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url:\r\n urlType === 'reserved'\r\n ? reservableUrl\r\n : urlType === 'admin'\r\n ? adminUrl\r\n : url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'ServiceTypeId',\r\n 'UseServiceGroupTrainingLevels',\r\n 'Color',\r\n 'ImageName',\r\n 'ServiceGroupName',\r\n 'RestrictDurationUnitsAmount',\r\n 'RestrictDurationUnitType',\r\n 'DefaultDuration',\r\n 'ForceFullDayReservations',\r\n 'AssemblyId',\r\n 'TopAssemblyId',\r\n 'AssetCatId',\r\n 'AssetCatName',\r\n 'RestrictReservationToTimeSlots',\r\n 'MinOrderHours',\r\n 'WorkingHours',\r\n ],\r\n expand: 'WorkingHours',\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n\r\nexport function OnlineServiceMultiPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n urlType,\r\n ...props\r\n}: OnlineServicePickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n predicates,\r\n globalServiceGroupFilter || [],\r\n urlType,\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport function OnlineServiceSinglePicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n urlType,\r\n ...props\r\n}: OnlineServicePickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n predicates,\r\n globalServiceGroupFilter || [],\r\n urlType,\r\n );\r\n return (\r\n {\r\n if (!!onChange) {\r\n if (value !== null) {\r\n return onChange([value]);\r\n } else {\r\n return onChange([]);\r\n }\r\n }\r\n }}\r\n disabled={disabled}\r\n info={info}\r\n id={id || 'online-service-single-filter'}\r\n helperText={helperText}\r\n required={required}\r\n className={className}\r\n onBlur={props.onBlur}\r\n placeholder={placeholder}\r\n defaultValue={\r\n !!defaultValue\r\n ? defaultValue.length > 0\r\n ? (defaultValue[0] as IServiceFilterDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n label={label}\r\n value={\r\n !!value\r\n ? value.length > 0\r\n ? (value[0] as IServiceFilterDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n ariaLabel={'Equipment search'}\r\n {...props}\r\n error={props.error}\r\n />\r\n );\r\n}\r\n\r\nexport function RestrictedByAdminFilter(\r\n admin?: IUserFilterDto,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!admin) {\r\n if (!!admin.ServiceGroupIds && admin.ServiceGroupIds.length > 0) {\r\n let ids = admin.ServiceGroupIds.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (!!admin.Services && admin.Services.length > 0) {\r\n let ids = admin.Services.filter(\r\n f => f.ServiceTypeId === (ServiceType.Online as number),\r\n ).map(f => {\r\n return { Id: f.Id } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition('Id', ODataOperators.Includes, ids),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return [predicates.map(f => f.toString()).join(' or ')];\r\n } else {\r\n if (admin.IsAdminPanel) {\r\n return [];\r\n } else {\r\n return [\r\n new Condition('Id', ODataOperators.Equals, 0),\r\n ];\r\n }\r\n }\r\n } else {\r\n return [];\r\n }\r\n}\r\nexport function ServiceGroupFilter(\r\n serviceGroupId?: number,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!serviceGroupId) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n serviceGroupId,\r\n ),\r\n );\r\n return predicates;\r\n } else {\r\n return [];\r\n }\r\n}\r\n","import { FormControl, FormLabel, styled } from '@material-ui/core';\r\nimport { FieldHookConfig } from 'formik';\r\nimport * as React from 'react';\r\nimport { Body } from '../Typography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormLabelTextProps {\r\n text?: React.ReactNode;\r\n id?: string;\r\n}\r\nexport function FormLabelText({\r\n label,\r\n text,\r\n html,\r\n info,\r\n fullWidth = true,\r\n ...props\r\n}: FieldHookConfig & IFieldProps & FormLabelTextProps) {\r\n const StyledInfo = styled(InfoIcon)(({ theme }) => ({\r\n marginLeft: theme.spacing(1),\r\n }));\r\n return (\r\n \r\n {label && (\r\n \r\n <>\r\n {label} {info && }\r\n \r\n \r\n )}\r\n {text && (\r\n \r\n {text}\r\n \r\n )}\r\n {html}\r\n \r\n );\r\n}\r\n// const StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n// color: theme.palette.common.graySubtitle,\r\n// fontFamily: `'Lato', sans-serif`,\r\n// fontStyle: 'normal',\r\n// fontWeight: 400,\r\n// fontSize: '12px',\r\n// lineHeight: '141%',\r\n// letterSpacing: '0.2px',\r\n// '.Mui-focused &': {\r\n// color: theme.palette.common.graySubtitle,\r\n// },\r\n// }));\r\n","export enum TrainingState {\r\n SignedUp = 1,\r\n UnderMinimum = 2,\r\n Available = 3,\r\n Maximum = 4,\r\n}\r\n\r\nexport type TrainingStateUnion = keyof typeof TrainingState;\r\n","import {\r\n OfflineServiceTypeUrl,\r\n loadOfflineServiceData,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport {\r\n InventoryBatchParams,\r\n InventoryBatchResponse,\r\n OfflineServiceQueryStringParameters,\r\n OfflineServicesResponse,\r\n RenewStockParams,\r\n ServiceChangeStateParameters,\r\n StockRenewalParams,\r\n} from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { IInventoryBatchDto } from './odata/generated/entities/IInventoryBatchDto';\r\nimport { quoteODataValue } from './odata/ODataFilter';\r\n\r\nexport const OtherServicesApi = {\r\n initOfflineService: (payload: OfflineServiceQueryStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/OtherServices/InitService`;\r\n return httpClient.post(url, data);\r\n },\r\n insertOtherService: (otherService: IOtherServices) => {\r\n const url = '/api/odata/v4/OtherServices';\r\n return httpClient.post(url, otherService);\r\n },\r\n insertConsumableServices: (otherServices: IOtherServices[]) => {\r\n const url = '/api/odata/v4/OtherServices/CreateConsumables';\r\n const data = {\r\n params: otherServices,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n insertStockRenewalServices: (otherServices: IOtherServices[]) => {\r\n const url = '/api/odata/v4/OtherServices/CreateStockRenewals';\r\n const data = {\r\n params: otherServices,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n updateOtherService: (otherService: IOtherServices, rowId: number) => {\r\n const url = '/api/odata/v4/OtherServices';\r\n return httpClient.put(\r\n url + '(' + rowId + ')',\r\n otherService,\r\n );\r\n },\r\n deleteService: (Id: number) => {\r\n const url = `/api/odata/v4/OtherServices/${Id}`;\r\n return httpClient.deleteCustom(url);\r\n },\r\n isBudgetsTurnedOn: (offlineServiceTypeId: number) => {\r\n const url = '/api/odata/v4/OtherServices/IsBudgetsTurnedOn';\r\n const data = {\r\n offlineServiceTypeId,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n calculateCredit: (calculateCreditModel: IOtherServices) => {\r\n const url = '/api/odata/v4/OtherServices/CalculateCredit';\r\n const data = {\r\n params: calculateCreditModel,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n calculateTotalCredit: (calculateCreditModel: IOtherServices[]) => {\r\n const url = '/api/odata/v4/OtherServices/CalculateTotalCredit';\r\n const data = {\r\n params: calculateCreditModel,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n getServiceChangeState: (payload: ServiceChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/OtherServices/GetServiceChangeState`;\r\n return httpClient.post(url, data);\r\n },\r\n getReservationOfflineServices: (reservationId: number, repeat?: boolean) => {\r\n const url =\r\n repeat === true\r\n ? `/api/odata/v4/OtherServices/ReservationOfflineServices(key=${reservationId})`\r\n : `/api/odata/v4/OtherServices/ReservationOfflineServicesWithParts(key=${reservationId})`;\r\n return httpClient.get(url);\r\n },\r\n initConsumableServices: (payload: OfflineServiceQueryStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/OtherServices/InitConsumableServices`;\r\n return httpClient.post(url, data);\r\n },\r\n initStockRenewalServices: (payload: StockRenewalParams) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/OtherServices/InitStockRenewalServices`;\r\n return httpClient.post(url, data);\r\n },\r\n initRenewStockService: (payload: RenewStockParams) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/OtherServices/InitRenewStock`;\r\n return httpClient.post(url, data);\r\n },\r\n initInventoryBatch: (payload: InventoryBatchParams) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/InventoryBatches/InitInventoryBatch`;\r\n return httpClient.post(url, data);\r\n },\r\n insertInventoryBatch: (batch: IInventoryBatchDto) => {\r\n const url = '/api/odata/v4/InventoryBatches';\r\n return httpClient.post(url, batch);\r\n },\r\n updateInventoryBatch: (batch: IInventoryBatchDto, rowId: number) => {\r\n const url = '/api/odata/v4/InventoryBatches';\r\n return httpClient.put(url + '(' + rowId + ')', batch);\r\n },\r\n deleteInventoryBatch: (batch: IInventoryBatchDto) => {\r\n const url = `/api/odata/v4/InventoryBatches/${batch.Id}`;\r\n return httpClient.deleteCustom(url);\r\n },\r\n getServiceType: (\r\n payload: number | null,\r\n urlType?: OfflineServiceTypeUrl,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n if (payload === null || payload < 1) {\r\n resolve(null);\r\n } else {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n [`Id eq ${quoteODataValue(payload)}`],\r\n 'public',\r\n [],\r\n undefined,\r\n 'InventoryBatches',\r\n )(null, undefined);\r\n resolve(data.value[0] || null);\r\n } catch (error) {\r\n resolve(null);\r\n }\r\n }\r\n });\r\n },\r\n};\r\n","import { InputAdornment, InputBaseComponentProps } from '@material-ui/core';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport BaseTextField from '../BaseTextField';\r\nimport { BaseInputFieldProps } from '../BaseTextField/BaseFieldDefinition';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TextControlFieldProps extends BaseInputFieldProps {\r\n info?: string;\r\n onBlur?: React.FocusEventHandler;\r\n onChange?: React.ChangeEventHandler;\r\n onFocus?: React.FocusEventHandler;\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n autoFocus?: boolean;\r\n variant?: 'standard' | 'outlined' | 'filled';\r\n type?: React.InputHTMLAttributes['type'];\r\n min?: number;\r\n max?: number;\r\n className?: string;\r\n inputProps?: InputBaseComponentProps;\r\n}\r\n\r\nexport function TextControlField({\r\n info,\r\n startIcon,\r\n endIcon,\r\n onBlur,\r\n onChange,\r\n onFocus,\r\n autoFocus,\r\n variant,\r\n type,\r\n inputProps,\r\n className,\r\n ...props\r\n}: TextControlFieldProps) {\r\n const startIconComponent = startIcon && (\r\n {startIcon}\r\n );\r\n\r\n const endIconComponent = (\r\n {endIcon}\r\n );\r\n return (\r\n ) || (endIcon && endIconComponent),\r\n }}\r\n className={clsx(className, {\r\n startIcon: !!startIcon,\r\n endIcon: !!endIcon,\r\n })}\r\n {...omit(props, 'DialogProps')}\r\n >\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\nimport { BaseFieldProps } from '../BasicInputs/BaseTextField/BaseFieldDefinition';\r\n\r\nexport const FormNumberField = ({\r\n label,\r\n onChange,\r\n onBlur,\r\n value,\r\n name,\r\n helperText,\r\n noWarnOnNuN,\r\n ...props\r\n}: FieldHookConfig &\r\n BaseFieldProps &\r\n IFieldProps & {\r\n noWarnOnNuN?: boolean;\r\n customChange?: (val: string) => void;\r\n }) => {\r\n const [field, meta] = useField({ name, ...props });\r\n // const handleChange = e => {\r\n // var number = parseFloat(e.target.value);\r\n // if (isNaN(number)) {\r\n // if (noWarnOnNuN) {\r\n // onChange?.(e);\r\n // field.onChange(e);\r\n // } else {\r\n // console.warn(\r\n // `NaN value (\"${e.target.value}\") encountered in FormNumberField`,\r\n // );\r\n // }\r\n // } else {\r\n // onChange?.(e);\r\n // field.onChange(e);\r\n // }\r\n // };\r\n const handleChange = e => {\r\n if (onChange !== undefined) {\r\n onChange(e);\r\n }\r\n field.onChange(e);\r\n props.customChange?.(e.target.value);\r\n };\r\n return (\r\n \r\n {props.info ? : null}\r\n {props.InputProps?.endAdornment}\r\n \r\n ),\r\n }}\r\n variant=\"filled\"\r\n fullWidth\r\n autoFocus={props.autoFocus}\r\n inputProps={{\r\n ...props.inputProps,\r\n type: 'number',\r\n min: 0,\r\n 'aria-label': `${label ? undefined : 'number input'}`,\r\n }}\r\n value={field.value || ''}\r\n onChange={handleChange}\r\n onBlur={field?.onBlur}\r\n id={props.id || 'numberfieldId'}\r\n label={label}\r\n name={name}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error ?? helperText}\r\n {...props}\r\n />\r\n );\r\n};\r\n","export interface ImportData {\r\n ScreenId: number;\r\n Columns: ImportColumn[];\r\n AddOnly: boolean;\r\n BudgetType?: number;\r\n Iad?: ImportAdditionalData;\r\n ImportAssetImageFiles: boolean;\r\n AutoGenerateAssetNamesBasedOn?: number;\r\n UpdateQRCode: boolean;\r\n}\r\nexport enum ImportAdditionalData {\r\n none,\r\n AssetRanges,\r\n OfflineServiceTypes,\r\n SampleTypes,\r\n}\r\nexport interface ImportColumn {\r\n Include: boolean;\r\n ExcelName: string | undefined;\r\n Name: string | undefined;\r\n}\r\n\r\nexport enum ImportResult {\r\n success,\r\n error,\r\n failed,\r\n default,\r\n}\r\n\r\nexport interface ImportResponseData {\r\n Result: number;\r\n Rows: number;\r\n InsertedRows: number;\r\n UpdatedRows: number;\r\n Errors: number;\r\n}\r\n\r\nexport interface TemplateColumns {\r\n Id: string;\r\n DisplayName: string;\r\n}\r\n","export enum PurchaseOrderOptions {\r\n Hidden = 0,\r\n Optional = 1,\r\n Mandatory = 2,\r\n}\r\n","import { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport {\r\n initUnitTypeData,\r\n UnitType,\r\n UnitTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/UnitTypePicker';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { translations } from 'locales/translations';\r\nimport { debounce } from 'lodash';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { valOrNull } from 'utils/typeUtils';\r\nimport { FilterValueType } from '../../BasicFilter/FilterValueType';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport interface AssetRangeType {\r\n value: number | null;\r\n unitType: UnitType | null;\r\n}\r\n\r\nexport function isAssetRangeType(\r\n entity: FilterValueType | undefined,\r\n): entity is AssetRangeType {\r\n if (valOrNull(entity) === null) return false;\r\n return (\r\n valOrNull((entity as AssetRangeType).value) !== null &&\r\n valOrNull((entity as AssetRangeType).unitType) !== null\r\n );\r\n}\r\n\r\nexport const initAssetRangeData = async (item: FilterValueType) => {\r\n if (!isAssetRangeType(item) || valOrNull(item.unitType) === null) {\r\n return Promise.resolve(item);\r\n }\r\n const id = item.unitType?.Id;\r\n const val = item.value;\r\n try {\r\n const data = await initUnitTypeData(id?.toString());\r\n return {\r\n value: val,\r\n unitType: data.length > 0 ? data[0] : null,\r\n } as AssetRangeType;\r\n } catch (error) {\r\n return { value: val, unitType: null } as AssetRangeType;\r\n }\r\n};\r\n\r\nexport const assetRangeCustomFilter = (\r\n value: FilterValueType,\r\n settings: IFilterSettings,\r\n) => {\r\n if (!isAssetRangeType(value)) return '';\r\n const name = settings.fieldName;\r\n const val = value.value ?? 1;\r\n let predicates: string[] = [];\r\n let filterBySelectedUnit = `${name}/any(g: g/UnitTypeId eq ${\r\n value.unitType!.Id\r\n } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n predicates.push(filterBySelectedUnit);\r\n if (value.unitType!.SourceUnits.length > 0) {\r\n let sourceFilter = `${name}/any(g: ${value\r\n .unitType!.SourceUnits.map(unit => {\r\n const rate =\r\n val / (unit.ConversionRate === 0 ? 1 : unit.ConversionRate);\r\n return `(g/UnitTypeId eq ${unit.TargetId} and g/MinValue le ${rate} and g/MaxValue ge ${rate})`;\r\n })\r\n .join(' or ')})`;\r\n predicates.push(sourceFilter);\r\n }\r\n if (value.unitType!.TargetUnits.length > 0) {\r\n let targetFilter = `${name}/any(g: ${value\r\n .unitType!.TargetUnits.map(unit => {\r\n const rate =\r\n val * (unit.ConversionRate === 0 ? 1 : unit.ConversionRate);\r\n return `(g/UnitTypeId eq ${unit.TargetId} and g/MinValue le ${rate} and g/MaxValue ge ${rate})`;\r\n })\r\n .join(' or ')})`;\r\n predicates.push(targetFilter);\r\n }\r\n // if (value.unitType!.SourceUnits.length === 0) {\r\n // res = `${name}/any(g: g/UnitTypeId eq ${\r\n // value.unitType!.Id\r\n // } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n // } else {\r\n // const sourceConvert1 = value.unitType!.SourceUnits[0];\r\n // const unitId1 = sourceConvert1.TargetId;\r\n // const convert1 = sourceConvert1.ConversionRate || 1;\r\n // const sourceConvert2 = value.unitType!.SourceUnits[1] ?? sourceConvert1;\r\n // const unitId2 = sourceConvert2.TargetId;\r\n // const convert2 = sourceConvert2.ConversionRate || 1;\r\n // res = `${name}/any(g: (g/UnitTypeId eq ${\r\n // value.unitType!.Id\r\n // } and g/MinValue le ${val} and g/MaxValue ge ${val}) or (g/UnitTypeId eq ${unitId1} and g/MinValue le ${\r\n // val / convert1\r\n // } and g/MaxValue ge ${\r\n // val / convert1\r\n // }) or (g/UnitTypeId eq ${unitId2} and g/MinValue le ${\r\n // val / convert2\r\n // } and g/MaxValue ge ${val * convert2}))`;\r\n // }\r\n\r\n // res += ') or (';\r\n\r\n // if (value.unitType!.TargetUnits.length === 0) {\r\n // res += `${name}/any(g: g/UnitTypeId eq ${\r\n // value.unitType!.Id\r\n // } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n // } else {\r\n // const targetConvert1 = value.unitType!.TargetUnits[0];\r\n // const unitId1 = targetConvert1.TargetId;\r\n // const convert1 = targetConvert1.ConversionRate || 1;\r\n // const sourceConvert2 = value.unitType!.TargetUnits[1] ?? targetConvert1;\r\n // const unitId2 = sourceConvert2.TargetId;\r\n // const convert2 = sourceConvert2.ConversionRate || 1;\r\n // res += `${name}/any(g: (g/UnitTypeId eq ${\r\n // value.unitType!.Id\r\n // } and g/MinValue le ${val} and g/MaxValue ge ${val}) or (g/UnitTypeId eq ${unitId1} and g/MinValue le ${\r\n // val * convert1\r\n // } and g/MaxValue ge ${\r\n // val * convert1\r\n // }) or (g/UnitTypeId eq ${unitId2} and g/MinValue le ${\r\n // val * convert2\r\n // } and g/MaxValue ge ${val * convert2}))`;\r\n // }\r\n\r\n return '(' + predicates.join(' or ') + ')';\r\n};\r\n\r\nexport const assetRangeDisplay = (val: FilterValueType | undefined) => {\r\n if (!isAssetRangeType(val)) return null;\r\n return `${val.value} ${val.unitType?.Name}`;\r\n};\r\n\r\n/**\r\n * must recieve CustomData as number else wont work\r\n */\r\nexport const AssetRangeFilter = ({\r\n value,\r\n onChange,\r\n customData,\r\n ...props\r\n}: IFilterComponentProps) => {\r\n const { t } = useTranslation();\r\n const [stateValue, setValue] = useState(value);\r\n const handleValChange: React.ChangeEventHandler<\r\n HTMLTextAreaElement | HTMLInputElement\r\n > = event => {\r\n const newState = {\r\n unitType: stateValue?.unitType ?? null,\r\n value: +event.target.value ?? null,\r\n };\r\n setValue(newState);\r\n if (\r\n valOrNull(newState.unitType) !== null &&\r\n valOrNull(newState.value) !== null\r\n ) {\r\n handleOnChange(newState);\r\n }\r\n // setValue(oldValue => {\r\n // const newState = {\r\n // unitType: oldValue?.unitType ?? null,\r\n // value: +event.target.value ?? null,\r\n // };\r\n // handleOnChange(newState);\r\n // return newState;\r\n // });\r\n };\r\n const handleTypeChange = (val: UnitType | null) => {\r\n const newState = {\r\n unitType: val,\r\n value: stateValue?.value ?? null,\r\n };\r\n setValue(newState);\r\n if (\r\n valOrNull(newState.unitType) !== null &&\r\n valOrNull(newState.value) !== null\r\n ) {\r\n handleOnChange(newState);\r\n }\r\n // setValue(oldVal => {\r\n // const newState = {\r\n // unitType: val,\r\n // value: stateValue?.value ?? null,\r\n // };\r\n // handleOnChange(newState);\r\n // return newState;\r\n // });\r\n };\r\n const handleOnChange = debounce(onChange, 250);\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n};\r\n","import { Column } from 'react-table';\r\nimport { IRow } from '../IRow';\r\n\r\nexport type ColumnWithDep = Column & {\r\n deps?: (keyof TRow)[];\r\n notShowTitle?: boolean;\r\n};\r\n\r\nexport const hasDeps = (\r\n column: Column,\r\n): column is ColumnWithDep => {\r\n return column['deps'] !== undefined && Array.isArray(column['deps']);\r\n};\r\n","import { Column, SortingRule } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { IRow } from '..';\r\n\r\nexport function SortByComparer(\r\n prev: readonly [SortingRule[] | undefined],\r\n next: readonly [SortingRule[] | undefined],\r\n) {\r\n if (prev[0] === undefined && next[0] === undefined) {\r\n return true;\r\n } else if (prev[0] === undefined && next[0] !== undefined) {\r\n return false;\r\n } else if (next[0] === undefined && prev[0] !== undefined) {\r\n return false;\r\n } else {\r\n if (prev[0]?.length === next[0]?.length) {\r\n if (prev[0]?.length === 0 && next[0]?.length === 0) {\r\n return true;\r\n } else {\r\n if (\r\n prev[0]?.some(\r\n f => !next[0]?.some(n => n.id === f.id && n.desc === f.desc),\r\n )\r\n ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n}\r\nexport function ServiceGroupsComparer(\r\n prev: readonly [Entity[]],\r\n next: readonly [Entity[]],\r\n) {\r\n if (!!prev[0]) {\r\n if (prev[0].length === next[0].length) {\r\n if (prev[0].length === 0 && next[0].length === 0) {\r\n return true;\r\n } else {\r\n if (prev[0].some(f => !next[0].some(n => n.Id === f.Id))) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function columnsComparer(\r\n prev: readonly [Column[]],\r\n next: readonly [Column[]],\r\n) {\r\n if (!!prev[0]) {\r\n if (prev[0].length === next[0].length) {\r\n if (prev[0].length === 0 && next[0].length === 0) {\r\n return true;\r\n } else {\r\n if (prev[0].some(f => !next[0].some(n => n.accessor === f.accessor))) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function ColumnAccesorsComparer(\r\n prev: readonly [(keyof TRow)[] | undefined],\r\n next: readonly [(keyof TRow)[] | undefined],\r\n) {\r\n if (prev[0] === undefined && next[0] === undefined) {\r\n return true;\r\n } else if (prev[0] === undefined && next[0] !== undefined) {\r\n return false;\r\n } else if (next[0] === undefined && prev[0] !== undefined) {\r\n return false;\r\n } else {\r\n if (prev[0]?.length === next[0]?.length) {\r\n if (prev[0]?.length === 0 && next[0]?.length === 0) {\r\n return true;\r\n } else {\r\n if (prev[0]?.some(f => !next[0]?.some(n => n === f))) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n}\r\n","/**\r\n *\r\n * BasicTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n UseSortByState,\r\n UsePaginationState,\r\n SortingRule,\r\n TableState,\r\n UseGroupByState,\r\n Column,\r\n UseRowSelectState,\r\n UseGlobalFiltersState,\r\n} from 'react-table';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { CancelToken } from 'axios';\r\nimport { BasicTableProps } from './BasicTableProps';\r\nimport { IRow } from './IRow';\r\nimport { IFilterSettings } from './BasicFilter/IFilterSettings';\r\nimport {\r\n getExportParameters,\r\n buildURL,\r\n openExportLink,\r\n IPathAndQuery,\r\n getExportForImportParameters,\r\n} from 'utils/url-utils';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { useConfigurableColumns } from './useConfigurableColumns';\r\nimport { ControlledTable } from './ControlledTable';\r\nimport { useMemoFilters } from './useMemoFilters';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { TableSkeleton } from './components/TableSkeleton';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { hasDeps } from './types/ColumnWithDeps';\r\nimport { notUndefined } from 'utils/typeUtils';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { getColumnAccessors, TryGetExportColumns } from './ConfigurableColumns';\r\nimport { BasicTableRefreshEventHandler } from './ControlledTable/ControlledTableProps';\r\nimport { useCustomCompareMemo } from 'use-custom-compare';\r\nimport {\r\n ColumnAccesorsComparer,\r\n columnsComparer,\r\n ServiceGroupsComparer,\r\n SortByComparer,\r\n} from './Comparers';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\n\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState = Partial<\r\n UseSortByState &\r\n UsePaginationState &\r\n UseGroupByState &\r\n UseRowSelectState &\r\n UseGlobalFiltersState\r\n>;\r\n\r\nconst REQUEST_CANCELLED_MESSAGE = 'Request cancelled (race condition)';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IBasicTableState\r\n extends IPartialTableState {}\r\n\r\ninterface IDataState {\r\n data?: TRow[];\r\n dataLength?: number;\r\n controlledPageCount?: number;\r\n loading?: boolean;\r\n initComplete: boolean;\r\n}\r\n\r\nconst defaultRowIdAccessor = (row: TRow): string =>\r\n row.Id?.toString();\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function BasicTable({\r\n id,\r\n columns,\r\n initialState,\r\n api,\r\n additionalColumns,\r\n getRowId = defaultRowIdAccessor,\r\n searchColumns,\r\n useExport = true,\r\n rowActions,\r\n inlineRowActions,\r\n pageActions,\r\n screenName,\r\n selectedRowsActions,\r\n filterOpen = false,\r\n screenId,\r\n serviceGroups = [],\r\n customParams,\r\n useImportLink,\r\n importLink,\r\n importHandler,\r\n needRefresh,\r\n ServiceGroupsOptional,\r\n topAlertMessage,\r\n expandedColumns,\r\n onPageSizeChanged,\r\n onPageIndexChanged,\r\n savedListSettings,\r\n floatingTabSettings,\r\n useExportForImport,\r\n customEmptyTableSettings,\r\n exportForImportFilterKey,\r\n printing,\r\n tableContainerSyles,\r\n ...props\r\n}: BasicTableProps) {\r\n const isMobile = DetectIsMobile();\r\n\r\n // data received from the server and displayed on the table\r\n const [dataState, setDataState, extendDataState] = useAsyncExtendedState<\r\n IDataState\r\n >({ initComplete: false });\r\n // reference to the show/hide filters button\r\n // data length - total number of the records\r\n //const [dataLength, setDataLength] = React.useState(0);\r\n // page count derived from total number of the records\r\n // this is passed to the react-table hook\r\n //const [controlledPageCount, setControlledPageCount] = React.useState(0);\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const dispatch = useDispatch();\r\n const doRefresh = useSelector(selectDoRefreshTable);\r\n\r\n const [tableState, setTableState] = React.useState>>(\r\n {\r\n pageIndex: initialState?.pageIndex ?? 0,\r\n pageSize:\r\n printing !== undefined && printing.printing === true\r\n ? 10000\r\n : initialState?.pageSize ?? 10,\r\n //sortBy, which is set to undefined, is subsequently changed to [], causing re-rendering.\r\n //Assigning sortBy a value equal to [] is preventing re-rendering.\r\n sortBy: initialState?.sortBy !== undefined ? initialState?.sortBy : [],\r\n globalFilter: initialState?.globalFilter,\r\n },\r\n );\r\n const handleChangeState = React.useCallback(state => {\r\n setTableState(state);\r\n }, []);\r\n // custom useMemo Hook with deps comparision, the service groups array is changed even their contant is the same;\r\n // to do: make a generic comparer.\r\n const serviceGroupsCompared = useCustomCompareMemo(\r\n () => {\r\n return serviceGroups;\r\n },\r\n [serviceGroups],\r\n ServiceGroupsComparer,\r\n );\r\n const additionalColumnsCompared = useCustomCompareMemo(\r\n () => {\r\n return additionalColumns;\r\n },\r\n [additionalColumns],\r\n ColumnAccesorsComparer,\r\n );\r\n const columnsCompared = useCustomCompareMemo(\r\n () => {\r\n return columns;\r\n },\r\n [columns],\r\n columnsComparer,\r\n );\r\n // take care of configurable columns\r\n const {\r\n configurableColumns,\r\n handleConfigurableColumns,\r\n configCompleted,\r\n refreshConfigurableColumns,\r\n } = useConfigurableColumns({\r\n screenId: screenId,\r\n columns: columnsCompared,\r\n });\r\n\r\n const getDisplayColumns = React.useCallback(\r\n ({\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n }): Column[] | undefined => {\r\n if (screenId === undefined) {\r\n return columns;\r\n } else if (configCompleted) {\r\n return configurableColumns;\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n [],\r\n );\r\n\r\n //columnAccessors is changed several times on load Effect, so transformed to a function to control their content changed.\r\n // const columnAccessors = React.useMemo(() => {\r\n // if (!configCompleted) {\r\n // return undefined;\r\n // }\r\n // const columnAccessors = getDisplayColumns({\r\n // screenId,\r\n // configurableColumns,\r\n // configCompleted,\r\n // columns,\r\n // });\r\n // const result =\r\n // columnAccessors === undefined\r\n // ? undefined\r\n // : getColumnAccessors(columnAccessors);\r\n // return result;\r\n // // eslint-disable-next-line react-hooks/exhaustive-deps\r\n // }, [configCompleted, screenId, configurableColumns, columns]);\r\n const calculateColumnAccessors = React.useCallback(\r\n (\r\n columns: Column[],\r\n completed?: boolean,\r\n screenId?: ScreensId,\r\n configurableColumns?: Column[],\r\n ) => {\r\n if (!completed) {\r\n return undefined;\r\n }\r\n const columnAccessors = getDisplayColumns({\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n });\r\n const result =\r\n columnAccessors === undefined\r\n ? undefined\r\n : getColumnAccessors(columnAccessors);\r\n return result;\r\n },\r\n [configCompleted, getDisplayColumns],\r\n );\r\n const getAllAdditionalColumns = React.useCallback(\r\n (\r\n columns: Column[],\r\n additionalColumns?: (keyof TRow)[],\r\n completed?: boolean,\r\n screenId?: ScreensId,\r\n configurableColumns?: Column[],\r\n ) => {\r\n if (!completed) {\r\n return undefined;\r\n }\r\n const res = getDisplayColumns({\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n })\r\n ?.filter(hasDeps)\r\n .flatMap(c => c.deps)\r\n .filter(notUndefined);\r\n return [...(additionalColumns ?? []), ...(res ?? [])];\r\n },\r\n [configCompleted, getDisplayColumns],\r\n );\r\n //allAdditionalColumns is changed several times on load Effect, so transformed to a function to control their content changed.\r\n // const allAdditionalColumns = React.useMemo(() => {\r\n // // early return in case and the config is not ready yet to prevent unnecessary fires of effects below that depend on this\r\n // if (!configCompleted) {\r\n // return undefined;\r\n // }\r\n // const res = getDisplayColumns({\r\n // screenId,\r\n // configurableColumns,\r\n // configCompleted,\r\n // columns,\r\n // })\r\n // ?.filter(hasDeps)\r\n // .flatMap(c => c.deps)\r\n // .filter(notUndefined);\r\n // return [...(additionalColumns ?? []), ...(res ?? [])];\r\n // }, [\r\n // additionalColumns,\r\n // columns,\r\n // configCompleted,\r\n // configurableColumns,\r\n // getDisplayColumns,\r\n // screenId,\r\n // ]);\r\n\r\n // memo cleaned up filters without the Name which is loaded independently of the filter value and only affects appearance of the filter\r\n const customFilter = useMemoFilters({ appliedFilters: props.appliedFilters });\r\n\r\n const handleFilterChange = React.useCallback(\r\n items => {\r\n if (props.onFilterChange !== undefined) {\r\n props.onFilterChange(items);\r\n }\r\n },\r\n [props],\r\n );\r\n\r\n /**\r\n * Fetch data method that retrieves the data according to the current table state\r\n */\r\n const fetchData = React.useCallback(\r\n async (\r\n state: {\r\n api: string | IPathAndQuery;\r\n predicates: Array | string>;\r\n pageSize: number;\r\n pageIndex: number;\r\n sortBy?: SortingRule[] | null;\r\n globalFilterValue?: string;\r\n customFilter: IFilterSettings[];\r\n serviceGroups: Entity[];\r\n isOptionalServiceGroup: boolean;\r\n columns: Array;\r\n additionalColumns: Array;\r\n },\r\n cancelToken: CancelToken,\r\n ) => {\r\n extendDataState({ loading: true });\r\n try {\r\n // todo: add support for object notation accessors like 'foo.bar'\r\n // todo: add support for accessor of type Function(originalRow, rowIndex) => any\r\n const oDataParams = buildParams(\r\n {\r\n ...state,\r\n select: state.columns,\r\n serviceGroups: state.serviceGroups,\r\n expandedColumns: expandedColumns,\r\n },\r\n searchColumns,\r\n customParams,\r\n );\r\n var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n const response = await httpClient.get(url, params, cancelToken);\r\n\r\n const newState: IDataState = {\r\n loading: false,\r\n initComplete: true,\r\n data: response.value,\r\n dataLength: response['@odata.count'],\r\n controlledPageCount: Math.ceil(\r\n response['@odata.count'] / state.pageSize,\r\n ),\r\n };\r\n setDataState(newState);\r\n } catch (error: unknown) {\r\n // todo: show error message\r\n const requestCancelled =\r\n (error as any)?.message === REQUEST_CANCELLED_MESSAGE;\r\n if (!requestCancelled) {\r\n // console.error(error);\r\n extendDataState({ loading: false, initComplete: true });\r\n }\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [httpClient],\r\n );\r\n\r\n const pageIndex = React.useMemo(() => {\r\n return tableState.pageIndex!;\r\n }, [tableState.pageIndex]);\r\n const pageSize = React.useMemo(() => {\r\n return tableState.pageSize!;\r\n }, [tableState.pageSize]);\r\n // const sortBy = React.useMemo(() => {\r\n // return tableState.sortBy!;\r\n // }, [tableState.sortBy]);\r\n const sortBy = useCustomCompareMemo(\r\n () => {\r\n return tableState.sortBy!;\r\n },\r\n [tableState.sortBy],\r\n SortByComparer,\r\n );\r\n const globalFilter = React.useMemo(() => {\r\n return tableState.globalFilter;\r\n }, [tableState.globalFilter]);\r\n const titleKey = React.useMemo(() => {\r\n const columnAccessors = calculateColumnAccessors(\r\n columnsCompared,\r\n configCompleted,\r\n screenId,\r\n configurableColumns,\r\n );\r\n return props.titleKey ?? columnAccessors?.[0] ?? '';\r\n }, [\r\n calculateColumnAccessors,\r\n columnsCompared,\r\n configCompleted,\r\n configurableColumns,\r\n props.titleKey,\r\n screenId,\r\n ]);\r\n // connect table state changes to server data fetch side effect\r\n\r\n React.useEffect(() => {\r\n const cancelTokenSource = httpClient.cancelToken.source();\r\n const allAdditionalColumns = getAllAdditionalColumns(\r\n columnsCompared,\r\n additionalColumnsCompared,\r\n configCompleted,\r\n screenId,\r\n configurableColumns,\r\n );\r\n const columnAccessors = calculateColumnAccessors(\r\n columnsCompared,\r\n configCompleted,\r\n screenId,\r\n configurableColumns,\r\n );\r\n const columnsConfig = isFetchReady(\r\n columnAccessors,\r\n allAdditionalColumns,\r\n configCompleted,\r\n );\r\n if (columnsConfig === false) {\r\n return;\r\n }\r\n try {\r\n fetchData(\r\n {\r\n api,\r\n predicates: props.predicates ?? [],\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n serviceGroups: serviceGroupsCompared,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n ...columnsConfig,\r\n },\r\n cancelTokenSource.token,\r\n );\r\n } catch (error) {\r\n } finally {\r\n }\r\n return () => {\r\n cancelTokenSource.cancel(REQUEST_CANCELLED_MESSAGE);\r\n };\r\n }, [\r\n ServiceGroupsOptional,\r\n additionalColumnsCompared,\r\n api,\r\n calculateColumnAccessors,\r\n columnsCompared,\r\n configCompleted,\r\n configurableColumns,\r\n customFilter,\r\n fetchData,\r\n getAllAdditionalColumns,\r\n globalFilter,\r\n pageIndex,\r\n pageSize,\r\n props.predicates,\r\n screenId,\r\n serviceGroupsCompared,\r\n sortBy,\r\n ]);\r\n const handleExportClick = async () => {\r\n try {\r\n /**\r\n * export configurable columns should have been preloaded at this point and available immediately\r\n * otherwise this could take a bit of the time to refetch columns data from the server\r\n * */\r\n const exportColumnAccessors = await TryGetExportColumns(\r\n screenId,\r\n columnsCompared,\r\n // isAuthenticated,\r\n );\r\n\r\n const { $top, $skip, ...tableParams } = buildParams(\r\n {\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n select: exportColumnAccessors ?? [],\r\n additionalColumns: additionalColumnsCompared,\r\n serviceGroups: serviceGroupsCompared,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n expandedColumns: expandedColumns,\r\n predicates: props.predicates ?? [],\r\n },\r\n undefined,\r\n undefined,\r\n true,\r\n );\r\n\r\n //BKT-7579\r\n if (tableParams.$filter?.startsWith('() and ')) {\r\n tableParams.$filter = tableParams.$filter.replace('() and ', '');\r\n }\r\n\r\n var oDataParams = getExportParameters(tableParams);\r\n var { url, params } = getUrlAndParams(api, oDataParams);\r\n if (screenId === undefined) {\r\n params['unConfigured'] = true;\r\n }\r\n const exporturl = buildURL(url, params);\r\n await openExportLink(exporturl);\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n };\r\n const getAllFilteredRows = async (prop: keyof TRow) => {\r\n return new Promise((resolve, reject) => {\r\n const { $top, $skip, ...tableParams } = buildParams(\r\n {\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n select: [prop],\r\n additionalColumns: additionalColumnsCompared,\r\n serviceGroups: serviceGroupsCompared,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n expandedColumns: undefined,\r\n predicates: props.predicates ?? [],\r\n },\r\n undefined,\r\n undefined,\r\n true,\r\n );\r\n if (tableParams.$filter?.startsWith('() and ')) {\r\n tableParams.$filter = tableParams.$filter.replace('() and ', '');\r\n }\r\n\r\n var oDataParams = getExportForImportParameters(tableParams);\r\n var { url, params } = getUrlAndParams(api, oDataParams);\r\n httpClient.get(url, params).then(response => {\r\n resolve(response.value);\r\n });\r\n // try {\r\n // const response = await httpClient.get(url, params);\r\n // const rows: TRow[] = response.value;\r\n // resolve(rows.map(f => f.Id as number));\r\n // } catch (error: unknown) {\r\n // resolve([]);\r\n // }\r\n });\r\n };\r\n\r\n const [allRowsSelected, setAllRowsSelected] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const toggleAllRowsSelected = React.useCallback((value?: boolean) => {\r\n setAllRowsSelected(value);\r\n\r\n //resets to undefined if false so that the useEffect will notice a change when next changed to false\r\n // if (!value) {\r\n // setAllRowsSelected(undefined);\r\n // }\r\n }, []);\r\n\r\n /**\r\n * Reloads the table and unselects all rows\r\n */\r\n const handleRefresh = React.useCallback(\r\n event => {\r\n const allAdditionalColumns = getAllAdditionalColumns(\r\n columnsCompared,\r\n additionalColumnsCompared,\r\n configCompleted,\r\n screenId,\r\n configurableColumns,\r\n );\r\n const columnAccessors = calculateColumnAccessors(\r\n columnsCompared,\r\n configCompleted,\r\n screenId,\r\n configurableColumns,\r\n );\r\n const columnsConfig = isFetchReady(\r\n columnAccessors,\r\n allAdditionalColumns,\r\n configCompleted,\r\n );\r\n if (columnsConfig === false) {\r\n return;\r\n }\r\n if (event?.reloadConfigurableColumns === true && screenId !== undefined) {\r\n refreshConfigurableColumns();\r\n return;\r\n }\r\n if (props.useRowSelect && !initialState?.selectedRowIds) {\r\n toggleAllRowsSelected(false);\r\n }\r\n fetchData(\r\n {\r\n api,\r\n predicates: props.predicates ?? [],\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n serviceGroups: serviceGroupsCompared,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n ...columnsConfig,\r\n },\r\n httpClient.cancelToken.source().token,\r\n );\r\n },\r\n [\r\n ServiceGroupsOptional,\r\n additionalColumnsCompared,\r\n api,\r\n calculateColumnAccessors,\r\n columnsCompared,\r\n configCompleted,\r\n configurableColumns,\r\n customFilter,\r\n fetchData,\r\n getAllAdditionalColumns,\r\n globalFilter,\r\n initialState?.selectedRowIds,\r\n pageIndex,\r\n pageSize,\r\n props.predicates,\r\n props.useRowSelect,\r\n refreshConfigurableColumns,\r\n screenId,\r\n serviceGroupsCompared,\r\n sortBy,\r\n toggleAllRowsSelected,\r\n ],\r\n );\r\n\r\n const refreshFromState = React.useCallback(() => {\r\n dispatch(layoutActions.setRefreshTable(false));\r\n handleRefresh();\r\n }, [dispatch, layoutActions, handleRefresh]);\r\n\r\n React.useEffect(() => {\r\n if (needRefresh !== undefined && needRefresh === true) {\r\n handleRefresh();\r\n }\r\n if (doRefresh === true) {\r\n refreshFromState();\r\n }\r\n }, [doRefresh, needRefresh, handleRefresh, refreshFromState]);\r\n\r\n React.useEffect(() => {\r\n onPageSizeChanged?.(pageSize);\r\n }, [onPageSizeChanged, pageSize]);\r\n\r\n React.useEffect(() => {\r\n onPageIndexChanged?.(pageIndex);\r\n }, [onPageIndexChanged, pageIndex]);\r\n\r\n const loading = dataState?.loading ?? true;\r\n\r\n if (dataState.initComplete !== true) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n return (\r\n \r\n );\r\n}\r\nfunction getUrlAndParams(\r\n api: string | IPathAndQuery,\r\n oDataParams: {\r\n $skip?: number;\r\n $top?: number;\r\n $count?: boolean;\r\n $select?: string;\r\n $orderby?: string | undefined;\r\n $filter?: string | undefined;\r\n $format?: string;\r\n $expand?: string;\r\n },\r\n) {\r\n var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n var search = (api as IPathAndQuery).search;\r\n const params = { ...oDataParams, ...search };\r\n return { url, params };\r\n}\r\n\r\n/**\r\n * Determines if fetchData function is ready to be called\r\n * @param configCompleted configCompleted - sourced from the configurable columns\r\n * @param columnAccessors column accessors used to fetch data\r\n * @param allAdditionalColumns additional column accessors used to fetch data\r\n * @returns returns either false in the case and configurable columns will return a bit later, or non-undefined accessors that can be used in the fetchData function\r\n */\r\nfunction isFetchReady(\r\n columnAccessors: Array | undefined,\r\n allAdditionalColumns: Array | undefined,\r\n configCompleted: boolean,\r\n):\r\n | false\r\n | {\r\n columns: Array;\r\n additionalColumns: Array;\r\n } {\r\n if (!configCompleted) {\r\n return false;\r\n } else if (columnAccessors === undefined) {\r\n return false;\r\n } else if (allAdditionalColumns === undefined) {\r\n return false;\r\n } else {\r\n return {\r\n columns: columnAccessors,\r\n additionalColumns: allAdditionalColumns,\r\n };\r\n }\r\n}\r\n","import React from 'react';\r\nimport { isMobile, useMobileOrientation } from 'react-device-detect';\r\nimport { Theme, useTheme } from '@material-ui/core';\r\nexport interface IMobileDetector {\r\n checkIsMobile: () => boolean;\r\n orientation: 'portrait' | 'landscape';\r\n isLandscape: boolean;\r\n isPortrait: boolean;\r\n isMobile: boolean;\r\n}\r\nexport const useIsMobile = (): IMobileDetector => {\r\n const theme: Theme = useTheme();\r\n const { orientation, isLandscape, isPortrait } = useMobileOrientation();\r\n //const [mobile, setMobile] = React.useState(false);\r\n\r\n const checkIsMobile = React.useCallback((): boolean => {\r\n return (\r\n (isMobile && window.innerWidth < theme.breakpoints.values.md) ||\r\n window.innerWidth < theme.breakpoints.values.md\r\n );\r\n }, [theme.breakpoints.values.md]);\r\n\r\n // React.useEffect(() => {\r\n // console.log('deviceDetect: ', data);\r\n // setMobile(() => {\r\n // return (\r\n // (isMobile && window.innerWidth < theme.breakpoints.values.sm) ||\r\n // window.innerWidth < theme.breakpoints.values.sm\r\n // );\r\n // });\r\n // }, [data, theme.breakpoints.values.sm]);\r\n return { checkIsMobile, orientation, isLandscape, isPortrait, isMobile };\r\n};\r\n","import {\r\n EquipmentsChangeStateParameters,\r\n EquipmentSlotParameters,\r\n ReservationInsertModel,\r\n ReservationModel,\r\n ReservationQueryStringParameters,\r\n TransferToReservation,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { IStatusReservations } from 'app/pages/ReservationHistoryPage/IStatusReservations';\r\nimport { ITrainingReservations } from 'app/pages/ReservationHistoryPage/ITrainingReservations';\r\nimport { GroupedEquipments } from 'types/Equipments/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nimport { ISharedReservations } from 'app/pages/ReservationHistoryPage/ISharedReservations';\r\nimport { EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport const ReservationsApi = {\r\n initReservation: (payload: ReservationQueryStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/InitReservation`;\r\n return httpClient.post(url, data);\r\n },\r\n insertReservation: (payload: ReservationInsertModel) => {\r\n const url = `/api/odata/v4/Reservations`;\r\n return httpClient.post(url, payload);\r\n },\r\n updateReservation: (payload: ReservationModel) => {\r\n const url = `/api/odata/v4/Reservations(${payload.Id})`;\r\n return httpClient.put(url, payload);\r\n },\r\n getReservation: (id: number, params: object) => {\r\n const url = `/api/odata/v4/reservations/${id}`;\r\n return httpClient.get(url, params);\r\n },\r\n getReservationUserTrainingEquipments: (id: number, params?: object) => {\r\n const url = `/api/odata/v4/reservations/${id}/UserTrainingEquipments`;\r\n return httpClient.get(url, params);\r\n },\r\n hasAnyFirstReservations: (\r\n ids: string,\r\n user: string,\r\n reservationId: number,\r\n ) => {\r\n const url = `/api/odata/v4/Reservations/HasAnyFirstReservation`;\r\n return httpClient.post(url, { ids: ids, user: user, id: reservationId });\r\n },\r\n getEquipmentsChangeState: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = '/api/odata/v4/Reservations/GetEquipmentsChangeState';\r\n return httpClient.post(url, data);\r\n },\r\n getValidationState: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/GetReservationValidationState`;\r\n return httpClient.post(url, data);\r\n },\r\n getReservationSlots: (payload: EquipmentSlotParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/GetReservationSlots`;\r\n return httpClient.post(url, data);\r\n },\r\n validateDuration: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/ValidateDuration`;\r\n return httpClient.post(url, data);\r\n },\r\n validatePrerequisite: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/ValidatePrerequisite`;\r\n return httpClient.post(url, data);\r\n },\r\n validatePermissions: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/ValidatePermissions`;\r\n return httpClient.post(url, data);\r\n },\r\n changeStatus: (payload: EquipmentsChangeStateParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/ChangeStatus`;\r\n return httpClient.post(url, data);\r\n },\r\n getEquipmentsData: (payload: {\r\n q?: string;\r\n value?: string;\r\n ids?: string;\r\n sgid?: string;\r\n avaEqu: boolean;\r\n resStart?: string;\r\n resEnd?: string;\r\n budgetId?: number;\r\n budgetExperimentId?: number;\r\n mandatoryIds?: string;\r\n init?: boolean;\r\n }) => {\r\n const url = '/api/scheduler/reservationEquipments';\r\n return httpClient.get(url, payload);\r\n },\r\n createTraining: (payload: ITrainingReservations[]) => {\r\n const data = {\r\n reservations: payload,\r\n };\r\n const url = '/api/odata/v4/ReservationHistory/CreateTraining';\r\n return httpClient.post(url, data);\r\n },\r\n updateStatus: (payload: IStatusReservations[]) => {\r\n const data = {\r\n reservations: payload,\r\n };\r\n const url = '/api/odata/v4/ReservationHistory/UpdateStatus';\r\n return httpClient.post(url, data);\r\n },\r\n HasFutureReservationsHttp: (equipmentNames: ISharedReservations[]) => {\r\n const data = {\r\n reservations: equipmentNames,\r\n };\r\n // '/api/odata/v4/ReservationHistory/HasEquipmentFutureReservations'\r\n // /api/ICalController/HasFutureReservations\r\n const url = '/api/odata/v4/ReservationHistory/HasFutureReservations';\r\n return httpClient.get(url, data);\r\n },\r\n transferReservation: (payload: TransferToReservation) => {\r\n const data = {\r\n params: {\r\n User: payload.User.Id,\r\n ReservationId: payload.ReservtionId,\r\n },\r\n };\r\n const url = `/api/odata/v4/Reservations/TransferReservation`;\r\n return httpClient.post(url, data);\r\n },\r\n sendTransferNotification: (payload: TransferToReservation) => {\r\n const data = {\r\n params: {\r\n User: payload.User.Id,\r\n ReservationId: payload.ReservtionId,\r\n },\r\n };\r\n const url = `/api/odata/v4/Reservations/SendTranserNotification`;\r\n return httpClient.post(url, data);\r\n },\r\n sendCancelTransferNotification: (payload: TransferToReservation) => {\r\n const data = {\r\n params: {\r\n User: payload.User.Id,\r\n ReservationId: payload.ReservtionId,\r\n },\r\n };\r\n const url = `/api/odata/v4/Reservations/SendCancelTranserNotification`;\r\n return httpClient.post(url, data);\r\n },\r\n cancelTransferReservation: (payload: number) => {\r\n const url = `/api/odata/v4/Reservations/CancelTranser`;\r\n return httpClient.post(url, { id: payload });\r\n },\r\n sendTerminateNotification: (payload: number[]) => {\r\n const data = {\r\n ReservationIds: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/SendTerminateNotification`;\r\n return httpClient.post(url, data);\r\n },\r\n hasUsage: (payload: { resId: number; eqId: number }) => {\r\n const url = `/api/odata/v4/Reservations/HasUsage`;\r\n return httpClient.post(url, { id: payload.resId, eqid: payload.eqId });\r\n },\r\n endUsage: (id: number, data: EndUsageData): Promise => {\r\n const url = `/api/odata/v4/Reservations/EndReservationUsage`;\r\n const params = {\r\n id: id,\r\n remarks: data.remarks ?? '',\r\n sids:\r\n data.services.map(s => s.service?.Id + ':' + s.quantity).join(',') ??\r\n '',\r\n };\r\n return httpClient.post(url, params);\r\n },\r\n userCanBookEquipment: (payload: number) => {\r\n const data = {\r\n equipmentid: payload,\r\n };\r\n const url = `/api/odata/v4/Reservations/UserCanBookEquipment`;\r\n return httpClient.post(url, data);\r\n },\r\n\r\n // calculateCredit: (payload: ReservationCreditModel) => {\r\n // const url = `/api/odata/v4/Reservations/CalculateReservationCredit`;\r\n // // const data = {\r\n // // Id: payload.Id,\r\n // // Services: payload.Services,\r\n // // //AccServices: payload.AccServices,\r\n // // Username: payload.Username,\r\n // // UserGroupId: payload.UserGroupId,\r\n // // BudgetId: payload.BudgetId,\r\n // // Tutoring: payload.Tutoring,\r\n // // TrainingSignUp: payload.TrainingSignUp,\r\n // // BudgetPercent: payload.BudgetPercent,\r\n // // };\r\n // return httpClient.post(url, payload);\r\n // },\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport enum RenderTypes {\r\n AddToList = 0,\r\n AddWorkOrder,\r\n DownWorkOrder,\r\n BringBackUp,\r\n OpenCalendar,\r\n OpenTimeline,\r\n OpenWorkOrder,\r\n OpenWorkOrders,\r\n NewReservation,\r\n CloneEquipments,\r\n DownloadImages,\r\n ExportQRCodes,\r\n PrintAssetLabels,\r\n ExportForImport,\r\n}\r\n\r\nexport const AllowedToRender = (\r\n user: AuthenticatedUser | undefined,\r\n renderType: RenderTypes,\r\n asset: IAssetDto,\r\n) => {\r\n return (\r\n AllowedByRolePermissions(user, renderType, asset) &&\r\n AvailableByServiceType(asset.ServiceTypeId ?? -1, renderType) &&\r\n AvailableByAvailabilityType(\r\n asset.Availability !== undefined ? asset.Availability.Id : -1,\r\n renderType,\r\n )\r\n );\r\n};\r\nexport const AllowedByRolePermissions = (\r\n user: AuthenticatedUser | undefined,\r\n renderType: RenderTypes,\r\n asset: IAssetDto,\r\n) => {\r\n switch (renderType) {\r\n case RenderTypes.AddToList:\r\n case RenderTypes.AddWorkOrder:\r\n case RenderTypes.OpenCalendar:\r\n case RenderTypes.OpenTimeline:\r\n case RenderTypes.OpenWorkOrder:\r\n case RenderTypes.OpenWorkOrders:\r\n case RenderTypes.NewReservation:\r\n return true;\r\n case RenderTypes.DownWorkOrder:\r\n case RenderTypes.BringBackUp:\r\n case RenderTypes.ExportQRCodes:\r\n case RenderTypes.PrintAssetLabels:\r\n if (!user) {\r\n return false;\r\n }\r\n return (\r\n user.HasAdminGroupPermissions(asset.ServiceGroupId ?? undefined) ||\r\n user.HasAdminServicePermissions(\r\n asset.ServiceTypeId ?? 0,\r\n asset.ServiceId ?? undefined,\r\n ) ||\r\n user.HasLabTechGroupPermissions(asset.ServiceGroupId ?? undefined)\r\n );\r\n case RenderTypes.CloneEquipments:\r\n case RenderTypes.DownloadImages:\r\n case RenderTypes.ExportForImport:\r\n if (!user) {\r\n return false;\r\n }\r\n return (\r\n user.HasAdminGroupPermissions(asset.ServiceGroupId ?? undefined) ||\r\n user.HasAdminServicePermissions(\r\n asset.ServiceTypeId ?? 0,\r\n asset.ServiceId ?? 0,\r\n )\r\n );\r\n default:\r\n return false;\r\n }\r\n};\r\n\r\nexport const AvailableByServiceType = (\r\n serviceType: number,\r\n renderType: RenderTypes,\r\n) => {\r\n if (serviceType === -1) {\r\n return false;\r\n }\r\n let serType = serviceType as ServiceType;\r\n switch (renderType) {\r\n case RenderTypes.AddToList:\r\n case RenderTypes.AddWorkOrder:\r\n case RenderTypes.BringBackUp:\r\n case RenderTypes.OpenCalendar:\r\n case RenderTypes.OpenTimeline:\r\n case RenderTypes.OpenWorkOrder:\r\n case RenderTypes.OpenWorkOrders:\r\n case RenderTypes.DownWorkOrder:\r\n case RenderTypes.NewReservation:\r\n case RenderTypes.CloneEquipments:\r\n return serType === ServiceType.Online;\r\n case RenderTypes.DownloadImages:\r\n case RenderTypes.ExportForImport:\r\n return (\r\n serType === ServiceType.Online ||\r\n serType === ServiceType.Offline ||\r\n serType === ServiceType.Sample\r\n );\r\n case RenderTypes.ExportQRCodes:\r\n case RenderTypes.PrintAssetLabels:\r\n return serType === ServiceType.Online || serType === ServiceType.Offline;\r\n default:\r\n return false;\r\n }\r\n};\r\nexport const AvailableByAvailabilityType = (\r\n availabilityType: number,\r\n renderType: RenderTypes,\r\n) => {\r\n if (availabilityType === -1) {\r\n return false;\r\n }\r\n let avType = availabilityType as AvailabilityTypes;\r\n switch (renderType) {\r\n case RenderTypes.AddToList:\r\n case RenderTypes.AddWorkOrder:\r\n case RenderTypes.BringBackUp:\r\n case RenderTypes.OpenWorkOrder:\r\n case RenderTypes.OpenWorkOrders:\r\n case RenderTypes.DownWorkOrder:\r\n case RenderTypes.ExportQRCodes:\r\n case RenderTypes.PrintAssetLabels:\r\n return [\r\n //AvailabilityTypes.FreelyBookableBillable,\r\n //AvailabilityTypes.ApprovalRequiredBillable,\r\n AvailabilityTypes.FreelyBookable,\r\n //AvailabilityTypes.BookableWApproval,\r\n AvailabilityTypes.TrainingProgram,\r\n AvailabilityTypes.LoanableEquipment,\r\n AvailabilityTypes.LectureRoom,\r\n AvailabilityTypes.AvailableNotBookable,\r\n AvailabilityTypes.NotAvailable,\r\n ].includes(avType);\r\n case RenderTypes.OpenCalendar:\r\n case RenderTypes.OpenTimeline:\r\n case RenderTypes.NewReservation:\r\n case RenderTypes.CloneEquipments:\r\n return [\r\n //AvailabilityTypes.FreelyBookableBillable,\r\n //AvailabilityTypes.ApprovalRequiredBillable,\r\n AvailabilityTypes.FreelyBookable,\r\n //AvailabilityTypes.BookableWApproval,\r\n AvailabilityTypes.TrainingProgram,\r\n AvailabilityTypes.LoanableEquipment,\r\n AvailabilityTypes.LectureRoom,\r\n ].includes(avType);\r\n case RenderTypes.DownloadImages:\r\n return true;\r\n case RenderTypes.ExportForImport:\r\n return [\r\n //AvailabilityTypes.FreelyBookableBillable,\r\n //AvailabilityTypes.ApprovalRequiredBillable,\r\n AvailabilityTypes.FreelyBookable,\r\n //AvailabilityTypes.BookableWApproval,\r\n AvailabilityTypes.TrainingProgram,\r\n AvailabilityTypes.LoanableEquipment,\r\n AvailabilityTypes.LectureRoom,\r\n AvailabilityTypes.AvailableNotBookable,\r\n AvailabilityTypes.NotAvailable,\r\n AvailabilityTypes.ServiceRelated,\r\n AvailabilityTypes.RequestRelated,\r\n ].includes(avType);\r\n default:\r\n return false;\r\n }\r\n};\r\n","import { Theme } from '@material-ui/core/styles';\r\nimport { makeStyles } from '@material-ui/styles';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n}));\r\n","import { Theme } from '@material-ui/core/styles';\r\nimport { MenuItem, MenuItemProps } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\n// export const StyledMenuItem = withStyles({\r\n// root: {\r\n// '&:hover': {\r\n// backgroundColor: 'transparent',\r\n// },\r\n// },\r\n// })(MenuItem);\r\nexport const StyledMenuItem = styled(\r\n ({\r\n button,\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n button: true | false;\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & MenuItemProps) => (\r\n \r\n {children}\r\n \r\n ),\r\n)`\r\n &:hover {\r\n background-color: 'transparent';\r\n }\r\n &.hidden-if-empty:empty {\r\n display: none;\r\n }\r\n`;\r\n","import * as React from 'react';\r\nimport {\r\n bindHover,\r\n bindMenu,\r\n usePopupState,\r\n anchorRef,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport HoverMenu from 'material-ui-popup-state/HoverMenu';\r\nimport { ReactActionsProps } from '.';\r\nimport { useStyles } from './useStyles';\r\nimport { StyledMenuItem } from './StyledMenuItem';\r\nimport { useTheme } from '@material-ui/core';\r\n\r\nexport const HoverActions = React.forwardRef(\r\n function HoverActions(props, ref) {\r\n const { id, items, size, iconVariant } = props;\r\n const classes = useStyles();\r\n const popupState = usePopupState({\r\n variant: 'popover',\r\n popupId: id,\r\n });\r\n const theme = useTheme();\r\n const buttons = items.filter(a => a !== undefined);\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {buttons.map((item, index) => {\r\n return (\r\n popupState.close()}\r\n {...props}\r\n >\r\n {item}\r\n \r\n );\r\n })}\r\n \r\n
\r\n
\r\n );\r\n },\r\n);\r\n","import {\r\n bindMenu,\r\n usePopupState,\r\n bindTrigger,\r\n anchorRef,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { Menu, useTheme } from '@material-ui/core';\r\nimport { useStyles } from './useStyles';\r\nimport { StyledMenuItem } from './StyledMenuItem';\r\nimport { ReactActionsProps } from './index';\r\n\r\nexport const ClickableActions = React.forwardRef(\r\n function ClickableActions(props, ref) {\r\n const { id, items, size, iconVariant, icon } = props;\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const popupState = usePopupState({\r\n variant: 'popper',\r\n popupId: id,\r\n });\r\n const buttons = React.useMemo(() => {\r\n return items.filter(\r\n f =>\r\n f !== null &&\r\n f !== false &&\r\n f !== undefined &&\r\n f !== true &&\r\n f !== '',\r\n );\r\n }, [items]);\r\n return (\r\n
\r\n \r\n \r\n \r\n\r\n popupState.close()}\r\n >\r\n {buttons.map((item, index) => {\r\n return !!item ? (\r\n {\r\n if (!props.keepOpen) {\r\n popupState.close();\r\n }\r\n }}\r\n >\r\n {item}\r\n \r\n ) : (\r\n <>\r\n );\r\n })}\r\n \r\n
\r\n );\r\n },\r\n);\r\n","import * as React from 'react';\r\nimport { ButtonsVariant } from '../BasicButtons/Button';\r\nimport { HoverActions } from './HoverActions';\r\nimport { ClickableActions } from './ClickableActions';\r\nimport { IconProp } from 'app/AllIcons';\r\n\r\nexport interface ReactActionsProps {\r\n id: string;\r\n items: Array;\r\n size?: 'large' | 'medium' | 'small' | 'xs';\r\n iconVariant?: ButtonsVariant;\r\n hoverMenu?: boolean;\r\n icon?: IconProp;\r\n /**\r\n * Keeps menu open after clicking the menu item.\r\n */\r\n keepOpen?: boolean;\r\n /**\r\n * Disables ripple on all menu items. Useful for menu items containing more advanced components like drop down.\r\n */\r\n disableRipple?: boolean;\r\n}\r\nexport function ReactActions(props: ReactActionsProps) {\r\n const { hoverMenu, items } = props;\r\n // filter items that will render something\r\n const nonEmptyItems = React.useMemo(() => {\r\n return items.filter(\r\n f =>\r\n f !== null && f !== false && f !== undefined && f !== true && f !== '',\r\n );\r\n }, [items]);\r\n // if there's nothing to show in the menu then there's no point to show the menu itself\r\n if (nonEmptyItems.length === 0) {\r\n return <>;\r\n }\r\n return (\r\n \r\n {hoverMenu ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.workOrder || initialState;\r\n\r\nexport const selectWorkOrder = createSelector([selectSlice], state => state);\r\n\r\nexport const selectWorkOrderProcessing = createSelector(\r\n [selectWorkOrder],\r\n state => state.processing,\r\n);\r\nexport const selectCreateWorkOrderProcessing = createSelector(\r\n [selectWorkOrder],\r\n state => state.createState.processing,\r\n);\r\nexport const selectUpdateWorkOrderProcessing = createSelector(\r\n [selectWorkOrder],\r\n state => state.updateState.processing,\r\n);\r\n\r\nexport const selectCreateWorkOrder = createSelector(\r\n [selectWorkOrder],\r\n state => state.createState.data,\r\n);\r\nexport const selectUpdateWorkOrder = createSelector(\r\n [selectWorkOrder],\r\n state => state.updateState.data,\r\n);\r\nexport const selectCreateWorkOrderCompleted = createSelector(\r\n [selectWorkOrder],\r\n state => state.createState.completed,\r\n);\r\nexport const selectUpdateWorkOrderCompleted = createSelector(\r\n [selectWorkOrder],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectCreateWorkOrderHasError = createSelector(\r\n [selectWorkOrder],\r\n state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateWorkOrderHasError = createSelector(\r\n [selectWorkOrder],\r\n state => state.updateState.hasErrors,\r\n);\r\nexport const selectSendEmailOnResOffline = createSelector(\r\n [selectWorkOrder],\r\n state => state.sendEmailOnOffline,\r\n);\r\nexport const selectReservationOffline = createSelector(\r\n [selectWorkOrder],\r\n state => state.reservationOffline,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n [selectWorkOrder],\r\n state => state.valueHandler,\r\n);\r\nexport const selectReservationOfflineData = createSelector(\r\n [selectReservationOffline],\r\n state => state.data,\r\n);\r\nexport const selectReservationOfflineProcessing = createSelector(\r\n [selectReservationOffline],\r\n state => state.processing,\r\n);\r\nexport const selectReservationOfflineCompleted = createSelector(\r\n [selectReservationOffline],\r\n state => state.completed,\r\n);\r\nexport const selectReservationOfflineHasErrors = createSelector(\r\n [selectReservationOffline],\r\n state => state.hasErrors,\r\n);\r\nexport const selectReadonlyWorkOrder = createSelector(\r\n [selectWorkOrder],\r\n state => state.readonlyState,\r\n);\r\nexport const selectUpdateAllRecurrent = createSelector(\r\n [selectWorkOrder],\r\n state => state.updateAllRecurrent,\r\n);\r\nexport const selectOfflineEventStart = createSelector(\r\n [selectWorkOrder],\r\n state => state.OfflineEventStart,\r\n);\r\nexport const selectOfflineEventEnd = createSelector(\r\n [selectWorkOrder],\r\n state => state.OfflineEventEnd,\r\n);\r\nexport const selectSaveNewComments = createSelector(\r\n [selectWorkOrder],\r\n state => state.doSaveNewComments,\r\n);\r\nexport const selectCreatedOrders = createSelector(\r\n [selectWorkOrder],\r\n state => state.createdOrders,\r\n);\r\nexport const selectSavedLinkedOrders = createSelector(\r\n [selectWorkOrder],\r\n state => state.savedLinkedOrders,\r\n);\r\n\r\nexport const selectCalibrationsChanged = createSelector(\r\n [selectWorkOrder],\r\n state => state.calibrationsChanged,\r\n);\r\nexport const selectLinksProcessing = createSelector(\r\n [selectWorkOrder],\r\n state => state.linksProcessing,\r\n);\r\nexport const selectDowntimeOverlaps = createSelector(\r\n [selectWorkOrder],\r\n state => state.downtimeOverlaps,\r\n);\r\n","/**\r\n *\r\n * SelectedRowsActionIconButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useState } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { ActionIconButton } from '../../../BasicButtons/ActionIconButton';\r\nimport { DialogConfirm } from '../../../DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { DialogTypeVariants } from 'app/components/DialogComponents/DialogTypes';\r\nimport { IResponseType, IResponseTypeWithLink } from 'types/ResponseType';\r\nimport { Notification } from 'types/Notification';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface IRowsActionComponent {\r\n rows: TRow[];\r\n}\r\nexport interface SelectedRowsActionIconButtonProps\r\n extends IRowsActionComponent,\r\n ICanRaiseBasicTableRefreshEvent {\r\n icon?: IconProp;\r\n title: string;\r\n subtitle?: React.ReactNode;\r\n text?: string;\r\n action: () => Promise;\r\n snackBarMessageType?: SnackBarMessageType;\r\n confirm?: boolean;\r\n update?: boolean;\r\n confirmTitle?: string | React.ReactNode;\r\n confirmBody?: React.ReactNode;\r\n confirmButtonLabel?: string;\r\n cancelButtonLabel?: string;\r\n variantButton?: 'button' | 'icon';\r\n updateDialogVariant?: DialogTypeVariants;\r\n validConfirm?: boolean;\r\n maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n onHandleClose?: () => void;\r\n disabled?: boolean;\r\n toggleAllRowsSelected?: (value?: boolean) => void;\r\n}\r\n\r\nexport function SelectedRowsActionIconButton({\r\n rows,\r\n title,\r\n action,\r\n snackBarMessageType,\r\n onRefresh,\r\n confirm,\r\n confirmTitle,\r\n confirmBody,\r\n confirmButtonLabel,\r\n cancelButtonLabel,\r\n variantButton,\r\n icon,\r\n text,\r\n updateDialogVariant,\r\n subtitle,\r\n validConfirm,\r\n maxWidth,\r\n onHandleClose,\r\n disabled,\r\n toggleAllRowsSelected,\r\n ...rest\r\n}: SelectedRowsActionIconButtonProps) {\r\n const { t } = useTranslation();\r\n const [busy, setBusy] = useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const [showConfirm, setShowConfirm] = React.useState(false);\r\n\r\n const handleAction = async () => {\r\n setBusy(true);\r\n try {\r\n const response = await action();\r\n setShowConfirm(false);\r\n if (onHandleClose !== undefined) {\r\n onHandleClose();\r\n }\r\n if (response?.Id !== undefined && response.link !== undefined) {\r\n let resp = response as IResponseTypeWithLink;\r\n const key = response.link;\r\n var Notification = {\r\n key: key,\r\n persist: true,\r\n variant:\r\n resp.ErrorMessages.length > 0\r\n ? 'error'\r\n : resp.WarningMessages.length > 0\r\n ? 'warning'\r\n : resp.SuccessMessages.length > 0\r\n ? 'success'\r\n : 'default',\r\n message:\r\n resp.ErrorMessages.length > 0\r\n ? resp.ErrorMessages[0]\r\n : resp.WarningMessages.length > 0\r\n ? resp.WarningMessages[0]\r\n : resp.SuccessMessages.length > 0\r\n ? resp.SuccessMessages[0]\r\n : '',\r\n messageType: SnackBarMessageType.showLinkMessage,\r\n messageTypeProps: {\r\n Id: 0,\r\n created: true,\r\n itemName:\r\n resp.ErrorMessages.length > 0\r\n ? resp.ErrorMessages[0]\r\n : resp.WarningMessages.length > 0\r\n ? resp.WarningMessages[0]\r\n : resp.SuccessMessages.length > 0\r\n ? resp.SuccessMessages[0]\r\n : '',\r\n linkUrl: resp.link,\r\n linkText: resp.Id?.toString(),\r\n detailsType: undefined,\r\n detailsTypeProps: undefined,\r\n },\r\n } as Notification;\r\n if (key !== undefined) {\r\n Notification = Object.assign(Notification, { key: key });\r\n }\r\n dispatch(actions.addNotification(Notification));\r\n } else {\r\n let respm = response as IResponseType;\r\n if (respm.ErrorMessages.length > 0) {\r\n respm.ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n messageType: snackBarMessageType,\r\n }),\r\n ),\r\n );\r\n }\r\n if (respm.SuccessMessages.length > 0) {\r\n respm.SuccessMessages.forEach(sccmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: sccmsg,\r\n messageType: snackBarMessageType,\r\n }),\r\n ),\r\n );\r\n }\r\n if (respm.WarningMessages.length > 0) {\r\n respm.WarningMessages.forEach(wrnmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'warning',\r\n message: wrnmsg,\r\n messageType: snackBarMessageType,\r\n }),\r\n ),\r\n );\r\n }\r\n }\r\n setBusy(false);\r\n toggleAllRowsSelected?.(false);\r\n onRefresh?.();\r\n } catch (error) {\r\n setShowConfirm(false);\r\n if (onHandleClose !== undefined) {\r\n onHandleClose();\r\n }\r\n\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message:\r\n typeof error === 'string' ? error : t(translations.AnErrorOccurred),\r\n }),\r\n );\r\n\r\n setBusy(false);\r\n }\r\n };\r\n const handleClick = () => {\r\n if (confirm) {\r\n setShowConfirm(() => true);\r\n } else {\r\n handleAction();\r\n }\r\n };\r\n const handleConfirmClick = () => {\r\n handleAction();\r\n };\r\n const handleCloseClick = () => {\r\n setShowConfirm(false);\r\n if (onHandleClose !== undefined) {\r\n onHandleClose();\r\n }\r\n };\r\n\r\n return (\r\n \r\n {showConfirm && (\r\n {'Are you sure?'}\r\n }\r\n confirmButtonLabel={confirmButtonLabel || 'Ok'}\r\n cancelButtonLabel={cancelButtonLabel || 'Cancel'}\r\n onConfirm={handleConfirmClick}\r\n onCancel={handleCloseClick}\r\n isOpen={showConfirm}\r\n processing={busy}\r\n disabled={busy || !validConfirm}\r\n />\r\n )}\r\n {variantButton === 'icon' && icon ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n * This function has two roles:\r\n * 1) If the `id` is empty it assings something so does i18next doesn't throw error. Typescript should prevent this anyway\r\n * 2) It has a hand-picked name `_t` (to be short) and should only be used while using objects instead of strings for translation keys\r\n * `internals/extractMessages/stringfyTranslations.js` script converts this to `t('a.b.c')` style before `i18next-scanner` scans the file contents\r\n * so that our json objects can also be recognized by the scanner.\r\n */\r\nexport const _t = (id: string, ...rest: any[]): [string, ...any[]] => {\r\n if (!id) {\r\n id = '_NOT_TRANSLATED_';\r\n }\r\n return [id, ...rest];\r\n};\r\n","import * as React from 'react';\r\nimport { Box, MenuItem } from '@material-ui/core';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IFilterSettings } from './IFilterSettings';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { FilterValueType } from './FilterValueType';\r\n//hide for now all the expressions between the field name and its value (mainly “is”) ? We will go back to these once we implement additional expressions and not just one per each filter\r\n//import { operatorToString } from 'api/odata/ODataFilter';\r\nimport { ButtonLabel } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Entity, EntityType } from 'types/common';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { isArray } from 'lodash';\r\nimport {\r\n Directions,\r\n FilterBox,\r\n} from 'app/components/BasicTable/BasicFilter/FilterBox';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { BasicTypography } from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface AppliedFilterComponentProps {\r\n item: IFilterSettings;\r\n onRemove: (item: IFilterSettings) => void;\r\n onApply: (item: IFilterSettings) => void;\r\n direction: Directions;\r\n}\r\n\r\nexport function IsEntity(\r\n entity: FilterValueType | undefined,\r\n): entity is Entity {\r\n if (entity === undefined || entity === null) {\r\n return false;\r\n }\r\n if ((entity as Entity).Id !== undefined) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport function IsEntityType(\r\n entity: FilterValueType | undefined,\r\n): entity is EntityType {\r\n if (entity === undefined || entity === null) {\r\n return false;\r\n }\r\n return (entity as EntityType).Id !== undefined;\r\n}\r\n\r\nexport function IsEntityArray(entity: FilterValueType | undefined) {\r\n if (entity === undefined || entity === null) {\r\n return false;\r\n }\r\n if (!isArray(entity)) {\r\n return false;\r\n }\r\n if ((entity as Entity[])?.some(f => f.Id !== undefined)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport function IsEntityString(\r\n entity: FilterValueType | undefined,\r\n): entity is Entity {\r\n if (entity === undefined || entity === null) {\r\n return false;\r\n }\r\n if ((entity as Entity).Id !== undefined) {\r\n return typeof (entity as Entity).Id == 'string';\r\n }\r\n return false;\r\n}\r\n\r\nexport function IsEmptyArray(entity: FilterValueType | undefined): boolean {\r\n return Array.isArray(entity) && !entity.length;\r\n}\r\n\r\nexport function IsNotEmptyArray(\r\n entity: FilterValueType | undefined,\r\n): entity is Extract {\r\n return Array.isArray(entity) && !!entity.length;\r\n}\r\n\r\nfunction PureAppliedFilterComponent({\r\n item,\r\n onRemove,\r\n onApply,\r\n direction = 'vertical',\r\n}: AppliedFilterComponentProps) {\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView = React.useMemo(() => {\r\n return isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n }, [isMobile, sidePanelExpanded, sidePanelOpen]);\r\n const { t } = useTranslation();\r\n const [value, setValue] = React.useState(\r\n item.value,\r\n );\r\n React.useEffect(() => {\r\n setValue(item.value);\r\n }, [item.value]);\r\n\r\n const [open, setOpen] = React.useState(item.open);\r\n const [predict, setPredict] = React.useState<(string | Condition)[]>(\r\n !!item.filterData && item.filterData.length > 0 && !!item.filterPredicates\r\n ? item.filterData.map(f =>\r\n !!item.filterPredicates\r\n ? item.filterPredicates(f.depValue, f.depKey)[0]\r\n : '',\r\n )\r\n : [],\r\n );\r\n const onOpen = () => {\r\n setPredict(() =>\r\n !!item.filterData && item.filterData.length > 0 && !!item.filterPredicates\r\n ? item.filterData.map(f =>\r\n !!item.filterPredicates\r\n ? item.filterPredicates(f.depValue, f.depKey)[0]\r\n : '',\r\n )\r\n : [],\r\n );\r\n };\r\n\r\n const handleChange = value => {\r\n setValue(value);\r\n applyItem(value);\r\n };\r\n\r\n const applyItem = value => {\r\n setOpen(false);\r\n onApply({\r\n ...item,\r\n ...{ value: value },\r\n ...{ open: false },\r\n });\r\n };\r\n\r\n const handleRemoveClick = () => {\r\n onRemove(item);\r\n };\r\n //const handleClickAway = () => {};\r\n\r\n const labelFunc =\r\n value instanceof PresetDatesRange\r\n ? (date: MaterialUiPickersDate, invalidLabel: string) => {\r\n const res = dateUtils.shortDateTimeFormat(date);\r\n return res === null ? invalidLabel : res;\r\n }\r\n : undefined;\r\n const canHaveInversed = React.useMemo(() => {\r\n return !item.customFilter && !item.inversionDisabled;\r\n }, [item.customFilter, item.inversionDisabled]);\r\n const toggleInversed = React.useCallback(\r\n (isInversed: boolean) => {\r\n if (!!item.isInversed === isInversed) return;\r\n onApply({ ...item, isInversed: !item.isInversed });\r\n },\r\n [item, onApply],\r\n );\r\n return (isMobile || showShortView) && !isLandscape ? (\r\n \r\n \r\n \r\n \r\n {item.displayName}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n [\r\n {\r\n toggleInversed(false);\r\n close();\r\n }}\r\n selected={!item.isInversed}\r\n >\r\n {'Is'}\r\n ,\r\n {\r\n toggleInversed(true);\r\n close();\r\n }}\r\n selected={!!item.isInversed}\r\n >\r\n {'Is not'}\r\n ,\r\n ]}\r\n >\r\n {item.isInversed ? 'Is not' : 'Is'}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n {/* */}\r\n \r\n \r\n \r\n {item.displayName}\r\n \r\n \r\n \r\n [\r\n {\r\n toggleInversed(false);\r\n close();\r\n }}\r\n selected={!item.isInversed}\r\n >\r\n {'Is'}\r\n ,\r\n {\r\n toggleInversed(true);\r\n close();\r\n }}\r\n selected={!!item.isInversed}\r\n >\r\n {'Is not'}\r\n ,\r\n ]}\r\n >\r\n {item.isInversed ? 'Is not' : 'Is'}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* */}\r\n \r\n );\r\n}\r\n\r\nexport const AppliedFilterComponent = React.memo(\r\n PureAppliedFilterComponent,\r\n (prevProps, nextProps) => {\r\n const x = props =>\r\n JSON.stringify({\r\n fieldName: props.item.fieldName,\r\n fieldName1: props.item.fieldName1,\r\n value: props.item.value,\r\n predicates: props.item.predicetes,\r\n isInversed: props.item.isInversed,\r\n });\r\n var result = x(prevProps) === x(nextProps);\r\n\r\n return result;\r\n },\r\n) as typeof PureAppliedFilterComponent;\r\n","/**\r\n *\r\n * EditableCell\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { FieldProps } from 'formik';\r\n\r\nexport interface EditableCellProps {\r\n value: TValue;\r\n row: Row;\r\n column: TColumn;\r\n updateMyData: any; // This is a custom function that we supplied to our table instance\r\n}\r\n\r\nexport interface BaseInputProps {\r\n onChange: (value: TValue) => void;\r\n name?: string;\r\n value: TValue;\r\n onBlur: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n}\r\n\r\nexport function withPPP(\r\n Component: React.FunctionComponent>,\r\n) {\r\n return ({\r\n field,\r\n form,\r\n meta,\r\n ...props\r\n }: React.PropsWithChildren & FieldProps>) => {\r\n const {\r\n onChange: formikOnChange,\r\n multiple,\r\n checked,\r\n ...fieldProps\r\n } = field;\r\n const { onChange: componentOnChange, ...compProps } = props;\r\n const handleChange = value => {\r\n componentOnChange?.(value);\r\n formikOnChange?.({\r\n target: {\r\n name: field.name,\r\n value: value,\r\n },\r\n });\r\n };\r\n return ;\r\n };\r\n}\r\n\r\nexport interface EditorProps {\r\n value: TValue;\r\n onChange: (value: TValue) => void;\r\n onBlur: (event: React.FocusEvent) => void;\r\n id?: string;\r\n label?: string;\r\n name: string;\r\n error?: boolean;\r\n helperText?: string;\r\n parentValue?: any;\r\n info?: string;\r\n autoFocus?: boolean;\r\n}\r\n\r\nexport function EditableCell(\r\n WrappedComponent: React.FunctionComponent>,\r\n) {\r\n return function Comp({\r\n value: initialValue,\r\n row,\r\n column: { id },\r\n updateMyData, // This is a custom function that we supplied to our table instance\r\n ...props\r\n }: EditableCellProps) {\r\n const [value, setValue] = React.useState(initialValue);\r\n const onChange = event => {\r\n const value = event.target.value;\r\n setValue(value);\r\n const payload = { Id: row.original.Id };\r\n payload[id] = value;\r\n updateMyData(payload);\r\n };\r\n\r\n // We'll only update the external data when the input is blurred\r\n const onBlur = React.useCallback(() => {\r\n if (value !== initialValue) {\r\n const payload = { Id: row.original.Id };\r\n payload[id] = value;\r\n // updateMyData(payload);\r\n }\r\n }, [id, initialValue, row.original.Id, value]);\r\n // If the initialValue is changed external, sync it up with our state\r\n React.useEffect(() => {\r\n setValue(initialValue);\r\n }, [initialValue]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n );\r\n };\r\n}\r\n","/**\r\n *\r\n * BooleanPickerFilter\r\n *\r\n */\r\nimport { BooleanPicker } from 'app/components/BooleanPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport function BooleanPickerFilter(\r\n props: IFilterComponentProps & {\r\n trueName?: string;\r\n falseName?: string;\r\n info?: string;\r\n },\r\n) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\nexport default BooleanPickerFilter;\r\n","/**\r\n *\r\n * ActionButton\r\n *\r\n */\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { Button, ButtonsVariant } from '../Button';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { PropTypes } from '@material-ui/core';\r\nimport * as rdd from 'react-device-detect';\r\n\r\nexport interface ActionButtonProps {\r\n onClick?: React.MouseEventHandler;\r\n disabled?: boolean;\r\n starticon?: IconProp;\r\n endicon?: IconProp;\r\n text: string;\r\n title?: string;\r\n variant?: ButtonsVariant;\r\n size?: 'large' | 'medium' | 'small';\r\n autoFocus?: boolean;\r\n processing?: boolean;\r\n type?: 'button' | 'submit' | 'reset';\r\n target?: string;\r\n id?: string;\r\n href?: string | IPathAndQuery;\r\n color?: PropTypes.Color;\r\n fullWidth?: boolean;\r\n}\r\nexport function ActionButton({\r\n disabled,\r\n onClick,\r\n title,\r\n starticon,\r\n endicon,\r\n text,\r\n variant,\r\n size,\r\n processing,\r\n fullWidth,\r\n id,\r\n ...other\r\n}: ActionButtonProps) {\r\n const isSafary = rdd.isSafari || rdd.isIOS;\r\n return title ? (\r\n \r\n \r\n }\r\n endIcon={endicon && }\r\n id={id}\r\n fullWidth={fullWidth}\r\n processing={processing}\r\n {...other}\r\n >\r\n <>{text}\r\n \r\n \r\n \r\n ) : (\r\n }\r\n endIcon={endicon && }\r\n id={id}\r\n processing={processing}\r\n fullWidth={fullWidth}\r\n {...other}\r\n >\r\n <>{text}\r\n \r\n );\r\n}\r\n","import { DependencyList, useEffect, useState } from 'react';\r\n\r\nexport const useAsyncGetWthEffect = (\r\n load: () => Promise,\r\n defaultVal: T,\r\n deps?: DependencyList,\r\n setBusy?: (busy: boolean) => void,\r\n) => {\r\n const [val, setVal] = useState(defaultVal);\r\n useEffect(() => {\r\n let mounted = true;\r\n setBusy?.(true);\r\n (async () => {\r\n try {\r\n const res = await load();\r\n if (mounted) {\r\n setVal(() => res);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n if (mounted) {\r\n setBusy?.(false);\r\n }\r\n } finally {\r\n if (mounted) {\r\n setBusy?.(false);\r\n }\r\n }\r\n })();\r\n return () => {\r\n mounted = false;\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, deps);\r\n return val;\r\n};\r\n","import { Roles } from 'app/slice/types';\r\n\r\nexport const allowedroles = [\r\n Roles.Administrators,\r\n Roles.InstrumentEventsAdmin,\r\n Roles.GroupAdministrators,\r\n Roles.LabTech,\r\n];\r\n","import * as React from 'react';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { intersection } from 'lodash';\r\nimport { useSelector } from 'react-redux';\r\nimport { allowedroles } from './allowedroles';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport function useWorkOrdersPermissions() {\r\n const user = useSelector(selectAuthenticatedUser);\r\n const roles: number[] | undefined = user?.Roles;\r\n\r\n const callback = React.useCallback(\r\n (row: IAlertPermissionCheckRecord): boolean =>\r\n allowedToViewAlert(user, row),\r\n [user],\r\n );\r\n\r\n const hasPermissions: boolean = intersection(roles, allowedroles).length > 0;\r\n const isMainOrInstrumentEventsAdmin: boolean =\r\n (user?.Roles.includes(Roles.Administrators) ?? false) ||\r\n (user?.Roles.includes(Roles.InstrumentEventsAdmin) ?? false);\r\n return {\r\n hasPermissions,\r\n allowedToView: callback,\r\n isMainOrInstrumentEventsAdmin,\r\n };\r\n}\r\n\r\nexport type IAlertPermissionCheckRecord = Pick<\r\n IWorkOrderDetailsDto,\r\n 'ServiceGroupId' | 'ReportedBy' | 'ServiceId' | 'ServiceTypeId'\r\n>;\r\nexport const allowedToViewAlert = (\r\n user: AuthenticatedUser | undefined,\r\n row: IAlertPermissionCheckRecord,\r\n) => {\r\n if (!user) return false;\r\n return (\r\n user.HasAdminGroupOnlyPermissions(row.ServiceGroupId ?? undefined) ||\r\n user.HasAdminServiceOnlyPermissions(\r\n row.ServiceTypeId ?? 1,\r\n row.ServiceId ?? undefined,\r\n ) ||\r\n user.HasLabTechGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n user.HasLabTechServicePermissions(\r\n row.ServiceTypeId ?? 1,\r\n row.ServiceId ?? undefined,\r\n ) ||\r\n (user.Roles.includes(Roles.InventoryAdmin) &&\r\n user.HasInstrumentEventsGroupPermissions(\r\n row.ServiceGroupId ?? undefined,\r\n )) ||\r\n user.Roles.includes(Roles.InstrumentEventsAdmin) ||\r\n user.Id === (row.ReportedBy ?? '')\r\n );\r\n};\r\n\r\nexport const IsReadOnlyUser = (user: AuthenticatedUser | undefined) => {\r\n if (!user) return true;\r\n return (\r\n user.Roles.includes(Roles.Readonly) ||\r\n user.Roles.includes(Roles.CalendarOnly)\r\n );\r\n};\r\n","/**\r\n *\r\n * BudgetPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n IBudgetFilterDto,\r\n IBudgetMembersDto,\r\n} from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\n\r\nexport interface BudgetPickerProps\r\n extends Omit, 'loadData'> {\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n allActiveBudgets?: boolean;\r\n useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Budgets';\r\nexport const initBudgetData = (\r\n initval: string | undefined,\r\n select?: (keyof IBudgetFilterDto)[],\r\n expand?: (keyof Pick<\r\n IBudgetFilterDto,\r\n | 'AllowedServices'\r\n | 'AdGroupUsers'\r\n | 'ApprovedUsers'\r\n | 'DefaultBudgetsUsers'\r\n | 'ServiceGroupIds'\r\n >)[],\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n $select: string;\r\n $expand?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n $select: !!select\r\n ? select.join(',')\r\n : [\r\n 'Id',\r\n 'Name',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'Active',\r\n 'IsDefault',\r\n 'HideExperiments',\r\n 'FundingTypeId',\r\n 'PurchaseOrderOptionId',\r\n 'ServiceGroupServicesAllowed',\r\n 'UserGroupBudgetMembersAllowed',\r\n 'StartDate',\r\n 'EndDate',\r\n 'Type',\r\n 'ApprovedUsers',\r\n 'DefaultBudgetsUsers',\r\n 'ServiceGroupIds',\r\n 'AllowedServices',\r\n 'AdGroupUsers',\r\n 'Confidential',\r\n ].join(','),\r\n $expand: !!expand ? expand.join(',') : 'AllowedServices,ApprovedUsers',\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n queryUrl?: string,\r\n useSearchOrPredicate?: boolean,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url ?? queryUrl,\r\n predicates: predicates,\r\n maxTop: 20,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'Active',\r\n 'IsDefault',\r\n 'HideExperiments',\r\n 'FundingTypeId',\r\n 'PurchaseOrderOptionId',\r\n 'ServiceGroupServicesAllowed',\r\n 'UserGroupBudgetMembersAllowed',\r\n 'StartDate',\r\n 'EndDate',\r\n 'Type',\r\n 'ApprovedUsers',\r\n 'DefaultBudgetsUsers',\r\n 'ServiceGroupIds',\r\n 'AllowedServices',\r\n 'AdGroupUsers',\r\n 'Confidential',\r\n ],\r\n expand: 'AllowedServices,ApprovedUsers',\r\n useSearchOrPredicate: useSearchOrPredicate,\r\n });\r\nexport function BudgetPicker(props: BudgetPickerProps) {\r\n const innerLoadData = (predicates, queryUrl) =>\r\n loadData(\r\n !!predicates ? ['Active eq true', ...predicates] : ['Active eq true'],\r\n queryUrl,\r\n props.useSearchOrPredicate,\r\n );\r\n const queryUrl = props.allActiveBudgets\r\n ? '/api/odata/v4/Budgets/AllBudgets'\r\n : '/api/odata/v4/Budgets';\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport const BudgetByUserGroupFilter = (value: FilterValueType) => {\r\n if (value !== undefined && value !== null) {\r\n return [\r\n `${new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n null,\r\n ).toString()} or ${new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n (value as Entity).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n return [];\r\n};\r\nconst memberTimeFilter = (start?: Date, end?: Date): string => {\r\n let query = '';\r\n if (start === undefined && end === undefined) {\r\n return query;\r\n } else {\r\n if (start !== undefined) {\r\n query += ` and (u/${new Condition(\r\n 'ExpairedDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or u/${new Condition(\r\n 'ExpairedDate',\r\n ODataOperators.GreaterThanEqual,\r\n new CustomDate(new Date(start), 'date'),\r\n )})`;\r\n }\r\n if (end !== undefined) {\r\n query += ` and (u/${new Condition(\r\n 'ExpairedDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or u/${new Condition(\r\n 'ExpairedDate',\r\n ODataOperators.GreaterThanEqual,\r\n new CustomDate(new Date(end), 'date'),\r\n )})`;\r\n }\r\n }\r\n return query;\r\n};\r\nexport const loadBudgets = loadData;\r\nexport interface restrictedBudgetFilterProps {\r\n budgetLimitedByUsers: boolean;\r\n isBudgetsWithoutUserGroup: boolean;\r\n userGroupId?: string;\r\n serviceGroupId?: number;\r\n services?: IServiceTypeFilterDto[];\r\n startTime?: Date;\r\n endTime?: Date;\r\n user?: string;\r\n defaultBudgetEnabled?: boolean;\r\n userDefaultBudgetEnabled?: boolean;\r\n hideNonDefaultBudgets?: boolean;\r\n fundingType?: Entity | null;\r\n}\r\nexport function restrictedBudgetFilter({\r\n budgetLimitedByUsers,\r\n isBudgetsWithoutUserGroup,\r\n userGroupId,\r\n serviceGroupId,\r\n services,\r\n startTime,\r\n endTime,\r\n user,\r\n defaultBudgetEnabled,\r\n userDefaultBudgetEnabled,\r\n hideNonDefaultBudgets,\r\n fundingType,\r\n}: restrictedBudgetFilterProps): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!budgetLimitedByUsers && user !== undefined) {\r\n /**\r\n * when UserGroupBudgetMembersAllowed, it should give a pass for:\r\n * - all users in case and budget/usergroup field is turned off\r\n * - budgets/s user group users if the field is turned on and populated, all users otherwise\r\n * */\r\n\r\n let UserGroupBudgetMembersAllowed = new Condition(\r\n 'UserGroupBudgetMembersAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString();\r\n\r\n const budgetUserGroupMembers = isBudgetsWithoutUserGroup\r\n ? undefined\r\n : `(${new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n null,\r\n )} or ${new Condition(\r\n 'AdGroupUsers',\r\n ODataOperators.Any,\r\n user,\r\n )})`;\r\n const u = [UserGroupBudgetMembersAllowed, budgetUserGroupMembers]\r\n .filter(f => f !== undefined)\r\n .join(' and ');\r\n\r\n let usrFilter = `((${u}) or (ApprovedUsers/any(u: u/UserName eq ${quoteODataValue(\r\n user,\r\n )} ${memberTimeFilter(startTime, endTime)})))`;\r\n predicates.push(usrFilter);\r\n }\r\n if (!isBudgetsWithoutUserGroup && userGroupId !== undefined) {\r\n predicates.push(\r\n new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n userGroupId,\r\n ),\r\n );\r\n }\r\n const fundingTypeId = fundingType?.Id ?? undefined;\r\n if (fundingTypeId !== undefined) {\r\n predicates.push(\r\n new Condition(\r\n 'FundingTypeId',\r\n ODataOperators.Equals,\r\n fundingTypeId,\r\n ),\r\n );\r\n }\r\n\r\n if (startTime !== undefined || (endTime !== undefined && false)) {\r\n let startFilter = start =>\r\n `(${new Condition(\r\n 'StartDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or ${new Condition(\r\n 'StartDate',\r\n ODataOperators.LessThanEqual,\r\n start,\r\n )}) and (${new Condition(\r\n 'EndDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or ${new Condition(\r\n 'EndDate',\r\n ODataOperators.GreaterThanEqual,\r\n start,\r\n )})`;\r\n let endFilter = end =>\r\n `(${new Condition(\r\n 'StartDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or ${new Condition(\r\n 'StartDate',\r\n ODataOperators.LessThanEqual,\r\n end,\r\n )}) and (${new Condition(\r\n 'EndDate',\r\n ODataOperators.Equals,\r\n null,\r\n )} or ${new Condition(\r\n 'EndDate',\r\n ODataOperators.GreaterThanEqual,\r\n end,\r\n )})`;\r\n if (!!startTime && endTime === undefined) {\r\n predicates.push(startFilter(new CustomDate(new Date(startTime), 'date')));\r\n } else if (!!endTime && startTime === undefined) {\r\n predicates.push(endFilter(new CustomDate(new Date(endTime), 'date')));\r\n } else if (!!startTime && !!endTime) {\r\n predicates.push(\r\n `(${startFilter(\r\n new CustomDate(new Date(startTime), 'date'),\r\n )} and ${endFilter(new CustomDate(new Date(endTime), 'date'))})`,\r\n );\r\n }\r\n }\r\n if (serviceGroupId !== undefined) {\r\n let groupFilter = `${new Condition(\r\n 'ServiceGroupServicesAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString()} or ${new Condition(\r\n 'ServiceGroupIds',\r\n ODataOperators.Any,\r\n serviceGroupId,\r\n ).toString()}`;\r\n predicates.push(groupFilter);\r\n }\r\n if (services !== undefined && services.length > 0) {\r\n let list = services\r\n .map(f => {\r\n return `(AllowedServices/any(s: s/Id eq ${quoteODataValue(\r\n f.Id,\r\n )} and s/ServiceTypeId eq ${\r\n f.ServiceTypeId\r\n }) or ServiceGroupIds/any(g: g eq ${quoteODataValue(\r\n f.ServiceGroupId,\r\n )}))`;\r\n })\r\n .join(' and ');\r\n let servFilter = `(${new Condition(\r\n 'ServiceGroupServicesAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString()} or (${list}))`;\r\n predicates.push(servFilter);\r\n }\r\n // if (isDefault) {\r\n // predicates.push(\r\n // new Condition('IsDefault', ODataOperators.Equals, true),\r\n // );\r\n // }\r\n if (hideNonDefaultBudgets) {\r\n let deffFilter: (string | Condition)[] = [];\r\n if (defaultBudgetEnabled) {\r\n deffFilter.push(\r\n new Condition(\r\n 'IsDefault',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n if (userDefaultBudgetEnabled && user !== undefined) {\r\n deffFilter.push(\r\n new Condition(\r\n 'DefaultBudgetsUsers',\r\n ODataOperators.Any,\r\n user,\r\n ),\r\n );\r\n }\r\n if (deffFilter.length > 0) {\r\n predicates.push(deffFilter.map(f => f.toString()).join(' or '));\r\n }\r\n }\r\n predicates.push(\r\n new Condition('Active', ODataOperators.Equals, true),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","import * as React from 'react';\r\n\r\nexport interface BooleanRenderProps {\r\n value?: boolean | null;\r\n}\r\n\r\nexport const BooleanRender = (props: BooleanRenderProps) => {\r\n return {props.value === true ? 'Yes' : 'No'};\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n BookitDatePicker,\r\n BookitDatePickerProps,\r\n} from 'app/components/BookitDatePicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\n/**\r\n * TODO:\r\n * A non-serializable value was detected in an action, in the path: `payload.ReceivedAt`. Value: \r\nDate Sun May 02 2021 14:58:00 GMT+0300 (Israel Daylight Time)\r\n \r\nTake a look at the logic that dispatched this action: \r\nObject { type: \"animals/insertItem\", payload: {…} }\r\n \r\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string…t-least-serializable-why-should-my-action-types-be-constants) \r\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\r\n * */\r\n\r\nexport const FormBookitDatePicker = ({\r\n label,\r\n disableFuture,\r\n disablePast,\r\n ...props\r\n}: FieldHookConfig &\r\n Pick<\r\n BookitDatePickerProps,\r\n | 'endTime'\r\n | 'truncateTime'\r\n | 'minDate'\r\n | 'maxDate'\r\n | 'labelFunc'\r\n | 'clearable'\r\n | 'fullScreen'\r\n > &\r\n IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n fullWidth={true}\r\n helperText={meta.error}\r\n labelFunc={props.labelFunc}\r\n info={props.info}\r\n disabled={props.disabled}\r\n clearable={props.clearable}\r\n fullScreen={props.fullScreen}\r\n endTime={props.endTime}\r\n truncateTime={props.truncateTime}\r\n variant=\"date\"\r\n autoFocus={props.autoFocus}\r\n minDate={props.minDate}\r\n maxDate={props.maxDate}\r\n required={props.required}\r\n />\r\n );\r\n};\r\n","import {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { UserReservationsRestricted } from 'enums/enums';\r\nimport { MultipleInstrumentReservations } from 'enums/MultipleInstrumentReservations';\r\nimport { intersection } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings/AllowedSettings';\r\nexport interface GlobalSettingsType {\r\n loadCompleted: boolean;\r\n reservationRestricted: boolean;\r\n reservationUserGroupGroupByBudgetUserGroup: boolean;\r\n userGroupReservationRestricted: boolean;\r\n onlyOwnUserGroupsAllowed: boolean;\r\n userDefaultBudgetEnabled: boolean;\r\n defaultBudgetEnabled: boolean;\r\n hideNonDefaultBudgets: boolean;\r\n isBudgetsWithoutUserGroup: boolean;\r\n budgetModuleEnabled: boolean;\r\n priceSheetPricing: boolean;\r\n billingModuleEnabled: boolean;\r\n budgetLimitedByUsers: boolean;\r\n budgetExperimentModuleEnabled: boolean;\r\n fundingTypeBudgetEnabled: boolean;\r\n purchaseOrderBudgetEnabled: boolean;\r\n purchaseOrderLengthSetting: number | undefined;\r\n allowPartialProjectCharges: boolean;\r\n allowPartialSingleProjectCharges: boolean;\r\n trainingSessionEnabled: boolean;\r\n assistedReservationsEnabled: boolean;\r\n resCustomFormEnabled: boolean;\r\n resMultipleFormsEnabled: boolean;\r\n multipleInstrumentsEnabled: boolean;\r\n reservationTerminationEnabled: boolean;\r\n crossInstrumentTrainingEnabled: boolean;\r\n userAndGroupPermissionsEnabled: boolean;\r\n tutoringModulesEnabled: boolean;\r\n offlineServiceWithReservation: boolean;\r\n userIsMainAdmin: boolean;\r\n instituteProjectsEnabled: boolean;\r\n projectsAreOptional: boolean;\r\n showReferenceFieldInReservationDetails: boolean;\r\n accServicesEnabled: boolean;\r\n showCalcPriceOnOfflineService: boolean;\r\n allowUsersToViewTheirCharges: boolean;\r\n allowOngoingReservationModificationEnabled: boolean;\r\n showCalculatePrice: boolean;\r\n allowAddRemoveOnEditReservation: boolean;\r\n allowToRemoveFromMultipleReservation: boolean;\r\n draftReservationsEnabled: boolean;\r\n hideReservationCollaborators: boolean;\r\n MandatoryOfflineServicesOnTrainingSignUps: boolean;\r\n DoNotAllowReservationUserChangeByStaff: boolean;\r\n AssemblyPartsEnabled: boolean;\r\n confidentialBudgetsEnabled: boolean;\r\n AllowWorkflowBooking: boolean;\r\n ModifyReservationNameForUsers: boolean;\r\n ServiceRequestReservationEnabled: boolean;\r\n}\r\n\r\nfunction useGlobalSettingsHook(): GlobalSettingsType {\r\n const adminRoles = React.useMemo(\r\n () => [\r\n Roles.Administrators,\r\n Roles.EquipmentAdministrator,\r\n Roles.GroupAdministrators,\r\n Roles.LabTech,\r\n Roles.InstituteCoord,\r\n ],\r\n [],\r\n );\r\n const privateBudgetsRoles = React.useMemo(\r\n () => [Roles.Administrators, Roles.HeadOfLab],\r\n [],\r\n );\r\n const User = useSelector(selectAuthenticatedUser);\r\n const userRoles: number[] | undefined = User?.Roles;\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const [reservationRestricted, setReservationRestricted] = React.useState<\r\n boolean\r\n >(false);\r\n const [budgetModuleEnabled, setBudgetModuleEnabled] = React.useState(\r\n false,\r\n );\r\n const [priceSheetPricing, setPriceSheetPricing] = React.useState(\r\n false,\r\n );\r\n const [billingEnabled, setBillingEnabled] = React.useState(false);\r\n const [\r\n purchaseOrderLengthSetting,\r\n setPurchaseOrderLengthSetting,\r\n ] = React.useState();\r\n const [userIsMainAdmin, setUserIsMainAdmin] = React.useState(false);\r\n const userSettings = useSelector(selectUserProfileSettings);\r\n const [\r\n allowOngoingReservationModificationEnabled,\r\n setAllowOngoingReservationModificationEnabled,\r\n ] = React.useState(false);\r\n const [\r\n doNotAllowReservationUserChangeByStaff,\r\n setDoNotAllowReservationUserChangeByStaff,\r\n ] = React.useState(false);\r\n const [\r\n instituteProjectsEnabled,\r\n setInstituteProjectsEnabled,\r\n ] = React.useState(false);\r\n const [projectsAreOptional, setProjectsAreOptional] = React.useState(\r\n false,\r\n );\r\n const [\r\n reservationTerminationEnabled,\r\n setReservationTerminationEnabled,\r\n ] = React.useState(false);\r\n const [\r\n draftReservationsEnabled,\r\n setDraftReservationsEnabled,\r\n ] = React.useState(false);\r\n const [\r\n MandatoryOfflineServicesOnTrainingSignUps,\r\n setMandatoryOfflineServicesOnTrainingSignUps,\r\n ] = React.useState(false);\r\n const [\r\n crossInstrumentTrainingEnabled,\r\n setCrossInstrumentTrainingEnabled,\r\n ] = React.useState(false);\r\n const [\r\n userAndGroupPermissionsEnabled,\r\n setUserAndGroupPermissionsEnabled,\r\n ] = React.useState(false);\r\n const [tutoringModulesEnabled, setTutoringModulesEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [accServicesEnabled, setAccServicesEnabled] = React.useState(\r\n false,\r\n );\r\n const [\r\n allowUsersToViewTheirCharges,\r\n setAllowUsersToViewTheirCharges,\r\n ] = React.useState(false);\r\n\r\n const [\r\n showReferenceFieldInReservationDetails,\r\n setShowReferenceFieldInReservationDetails,\r\n ] = React.useState(false);\r\n\r\n const [\r\n offlineServiceWithReservation,\r\n setOfflineServiceWithReservation,\r\n ] = React.useState(false);\r\n const [\r\n multipleInstrumentsEnabled,\r\n setMultipleInstrumentsEnabled,\r\n ] = React.useState(false);\r\n const [trainingSessionEnabled, setTrainingSessionEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [reservationFormEnabled, setReservationFormEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [resMultipleFormsEnabled, setResMultipleFormsEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [\r\n assistedReservationsEnabled,\r\n setAssistedReservationsEnabled,\r\n ] = React.useState(false);\r\n const [\r\n showCalcPriceOnOfflineService,\r\n setShowCalcPriceOnOfflineService,\r\n ] = React.useState(false);\r\n const [showCalculatePrice, setShowCalculatePrice] = React.useState(\r\n false,\r\n );\r\n const [\r\n allowPartialProjectCharges,\r\n setAllowPartialProjectCharges,\r\n ] = React.useState(false);\r\n const [\r\n allowPartialSingleProjectCharges,\r\n setAllowPartialSingleProjectCharges,\r\n ] = React.useState(false);\r\n\r\n const [\r\n budgetExperimentModuleEnabled,\r\n setBudgetExperimentModuleEnabled,\r\n ] = React.useState(false);\r\n const [\r\n fundingTypeBudgetEnabled,\r\n setFundingTypeBudgetEnabled,\r\n ] = React.useState(false);\r\n const [\r\n purchaseOrderBudgetEnabled,\r\n setPurchaseOrderBudgetEnabled,\r\n ] = React.useState(false);\r\n const [\r\n isBudgetsWithoutUserGroup,\r\n setIsBudgetsWithoutUserGroup,\r\n ] = React.useState(false);\r\n const [\r\n requestReservationEnabled,\r\n setRequestReservationEnabled,\r\n ] = React.useState(false);\r\n const [budgetLimitedByUsers, setIsBudgetLimitedByUsers] = React.useState<\r\n boolean\r\n >(false);\r\n const [hideNonDefaultBudgets, setHideNonDefaultBudgets] = React.useState<\r\n boolean\r\n >(false);\r\n const [assemblyPartsEnabled, setAssemblyPartsEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [\r\n userDefaultBudgetEnabled,\r\n setUserDefaultBudgetEnabled,\r\n ] = React.useState(false);\r\n const [defaultBudgetEnabled, setDefaultBudgetEnabled] = React.useState<\r\n boolean\r\n >(false);\r\n const [\r\n userGroupReservationRestricted,\r\n setUserGroupReservationRestricted,\r\n ] = React.useState(false);\r\n const [\r\n reservationUserGroupGroupByBudgetUserGroup,\r\n setReservationUserGroupGroupByBudgetUserGroup,\r\n ] = React.useState(false);\r\n const [\r\n onlyOwnUserGroupsAllowed,\r\n setOnlyOwnUserGroupsAllowed,\r\n ] = React.useState(false);\r\n const [\r\n allowAddRemoveOnEditReservation,\r\n setAllowAddRemoveOnEditReservation,\r\n ] = React.useState(false);\r\n const [\r\n allowToRemoveFromMultipleReservation,\r\n setAllowToRemoveFromMultipleReservation,\r\n ] = React.useState(false);\r\n const [\r\n hideReservationCollaborators,\r\n setHideReservationCollaborators,\r\n ] = React.useState(false);\r\n const [\r\n isConfidentialBudgetsEnabled,\r\n setIsConfidentialBudgetsEnabled,\r\n ] = React.useState(false);\r\n const [\r\n allowWorkflowBookingEnabled,\r\n setAllowWorkflowBookingEnabled,\r\n ] = React.useState(false);\r\n const [\r\n modifyReservationNameForUsers,\r\n setModifyReservationNameForUsers,\r\n ] = React.useState(false);\r\n const [loadCompleted, setLoadCompleted] = React.useState(false);\r\n React.useEffect(() => {\r\n setIsBudgetsWithoutUserGroup(() => {\r\n return !IsBudgetFieldEnabled(appSettings, BudgetFields.UserGroup);\r\n });\r\n setIsConfidentialBudgetsEnabled(() => {\r\n return IsBudgetFieldEnabled(appSettings, BudgetFields.Confidential);\r\n });\r\n setUserIsMainAdmin(() => {\r\n return isInRole(User, Roles.Administrators);\r\n });\r\n setAllowAddRemoveOnEditReservation(() => {\r\n return IsModuleEnabled(\r\n appSettings,\r\n KnownModules.MultipleInstruments_AddRemoveOnEditReservation,\r\n );\r\n });\r\n setAllowToRemoveFromMultipleReservation(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AllowToRemoveFromMultipleReservation],\r\n ) === true\r\n );\r\n });\r\n setTrainingSessionEnabled(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideTrainingSessionsSettings],\r\n ) === false\r\n );\r\n });\r\n setAllowWorkflowBookingEnabled(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AllowWorkflowBooking],\r\n ) === true\r\n );\r\n });\r\n setModifyReservationNameForUsers(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.ModifyReservationNameForUsers],\r\n ) === true\r\n );\r\n });\r\n setInstituteProjectsEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.InstituteProjects);\r\n });\r\n setProjectsAreOptional(\r\n settings.GetBooleanByKey(AllowedSettings.ProjectsAreOptional),\r\n );\r\n setMultipleInstrumentsEnabled(() => {\r\n const multipleInstrumentsSetting:\r\n | string\r\n | null = settings.GetNullableByKey(\r\n AllowedSettings.MultipleInstrumentReservations,\r\n );\r\n return (\r\n multipleInstrumentsSetting !== null &&\r\n MultipleInstrumentReservations[multipleInstrumentsSetting] !==\r\n MultipleInstrumentReservations.NotAllowed\r\n );\r\n });\r\n setReservationTerminationEnabled(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.TerminateReservation],\r\n );\r\n });\r\n setAccServicesEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.AccServices);\r\n });\r\n setAllowOngoingReservationModificationEnabled(() => {\r\n return IsModuleEnabled(\r\n appSettings,\r\n KnownModules.AllowOngoingReservationModification,\r\n );\r\n });\r\n setDoNotAllowReservationUserChangeByStaff(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.DoNotAllowReservationUserChangeByStaff],\r\n );\r\n });\r\n setShowReferenceFieldInReservationDetails(() => {\r\n return !settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideReferenceFieldInReservationDetails],\r\n );\r\n });\r\n setAllowUsersToViewTheirCharges(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AllowUsersToViewCharges],\r\n );\r\n });\r\n setAssistedReservationsEnabled(() => {\r\n return !settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideAssistedReservationsSettings],\r\n );\r\n });\r\n setIsBudgetLimitedByUsers(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.BudgetLimited_ByUsers],\r\n );\r\n });\r\n setBudgetModuleEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.Budgets);\r\n });\r\n setPriceSheetPricing(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.PriceSheetPricing);\r\n });\r\n setBillingEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.Billing);\r\n });\r\n setPurchaseOrderLengthSetting(() => {\r\n const stringValue = settings.TryGet(\r\n AllowedSettings[AllowedSettings.PurchaseOrderLengthSetting],\r\n );\r\n if (stringValue === null) {\r\n return undefined;\r\n }\r\n const intValue = parseInt(stringValue);\r\n if (isNaN(intValue)) {\r\n return undefined;\r\n }\r\n return intValue;\r\n });\r\n\r\n setDraftReservationsEnabled(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.DraftReservationsEnabled],\r\n );\r\n });\r\n setMandatoryOfflineServicesOnTrainingSignUps(() => {\r\n return settings.GetBoolean(\r\n AllowedSettings[\r\n AllowedSettings.MandatoryOfflineServicesOnTrainingSignUps\r\n ],\r\n );\r\n });\r\n setOfflineServiceWithReservation(() => {\r\n return IsModuleEnabled(\r\n appSettings,\r\n KnownModules.OfflineServiceWithReservation,\r\n );\r\n });\r\n setReservationRestricted(() => {\r\n const resRestrictedSetting: string | null = settings.GetNullableByKey(\r\n AllowedSettings.UserReservationsRestricted,\r\n );\r\n return (\r\n resRestrictedSetting !== null &&\r\n UserReservationsRestricted[resRestrictedSetting] ===\r\n UserReservationsRestricted.UserOwnRestricted\r\n );\r\n });\r\n setUserGroupReservationRestricted(() => {\r\n const resUserGroupRestrictedSetting:\r\n | string\r\n | null = settings.GetNullableByKey(\r\n AllowedSettings.UserReservationsRestricted,\r\n );\r\n return (\r\n resUserGroupRestrictedSetting !== null &&\r\n UserReservationsRestricted[resUserGroupRestrictedSetting] ===\r\n UserReservationsRestricted.UserGroupRestricted\r\n );\r\n });\r\n setUserAndGroupPermissionsEnabled(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.UserPermission) ||\r\n IsModuleEnabled(appSettings, KnownModules.GroupPermissions)\r\n );\r\n });\r\n\r\n setReservationUserGroupGroupByBudgetUserGroup(\r\n () =>\r\n IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n settings.GetBoolean(\r\n AllowedSettings[\r\n AllowedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n ],\r\n ),\r\n );\r\n setCrossInstrumentTrainingEnabled(() =>\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.CrossInstrumentTraining],\r\n ),\r\n );\r\n\r\n setOnlyOwnUserGroupsAllowed(() => {\r\n return !(intersection(userRoles, adminRoles).length > 0);\r\n // return (\r\n // !(intersection(userRoles, adminRoles).length > 0) ||\r\n // userGroupReservationRestricted\r\n // );\r\n });\r\n setUserDefaultBudgetEnabled(() =>\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.ShowDefaultBudgetOnUserProfile],\r\n ),\r\n );\r\n setShowCalcPriceOnOfflineService(\r\n () =>\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideCalcPriceOnOfflineService],\r\n ) !== true,\r\n );\r\n setShowCalculatePrice(\r\n () =>\r\n IsModuleEnabled(appSettings, KnownModules.Billing) ||\r\n (IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n IsModuleEnabled(appSettings, KnownModules.PriceSheetPricing)),\r\n );\r\n setDefaultBudgetEnabled(() => {\r\n return IsBudgetFieldEnabled(appSettings, BudgetFields.Default);\r\n });\r\n setFundingTypeBudgetEnabled(() => {\r\n return IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType);\r\n });\r\n setPurchaseOrderBudgetEnabled(() => {\r\n return IsBudgetFieldEnabled(\r\n appSettings,\r\n BudgetFields.PurchaseOrderOption,\r\n );\r\n });\r\n\r\n setTutoringModulesEnabled(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.Tutoring) ||\r\n IsModuleEnabled(appSettings, KnownModules.TutoringHours)\r\n );\r\n });\r\n setAssemblyPartsEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.EquipmentAssemblies);\r\n });\r\n setHideNonDefaultBudgets(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.HideNonDefaultBudgets) &&\r\n !(\r\n intersection(userRoles, privateBudgetsRoles).length > 0 ||\r\n (isInRole(User, Roles.GroupAdministrators) &&\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.SGACreateProjects],\r\n ))\r\n )\r\n );\r\n });\r\n setBudgetExperimentModuleEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.BudgetExperiments);\r\n });\r\n\r\n setAllowPartialProjectCharges(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AllowPartialMultipleProjectCharges],\r\n ) &&\r\n budgetModuleEnabled\r\n );\r\n });\r\n setAllowPartialSingleProjectCharges(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AllowPartialSingleProjectCharges],\r\n ) &&\r\n budgetModuleEnabled\r\n );\r\n });\r\n setReservationFormEnabled(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.ReservationsCustomForm);\r\n });\r\n setResMultipleFormsEnabled(() => {\r\n return (\r\n reservationFormEnabled &&\r\n IsModuleEnabled(appSettings, KnownModules.MultipleCustomForms)\r\n );\r\n });\r\n setHideReservationCollaborators(\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideReservationCollaborators],\r\n ),\r\n );\r\n setRequestReservationEnabled(\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.ServiceRequestReservations],\r\n ),\r\n );\r\n console.debug('Global Settings Called');\r\n setLoadCompleted(() => true);\r\n }, [\r\n User,\r\n adminRoles,\r\n appSettings,\r\n budgetModuleEnabled,\r\n privateBudgetsRoles,\r\n reservationFormEnabled,\r\n reservationRestricted,\r\n settings,\r\n userGroupReservationRestricted,\r\n userRoles,\r\n userSettings,\r\n ]);\r\n\r\n const r: GlobalSettingsType = {\r\n loadCompleted,\r\n reservationRestricted,\r\n reservationUserGroupGroupByBudgetUserGroup,\r\n userGroupReservationRestricted,\r\n onlyOwnUserGroupsAllowed,\r\n projectsAreOptional,\r\n userDefaultBudgetEnabled,\r\n defaultBudgetEnabled,\r\n hideNonDefaultBudgets,\r\n isBudgetsWithoutUserGroup,\r\n budgetModuleEnabled,\r\n priceSheetPricing,\r\n billingModuleEnabled: billingEnabled,\r\n purchaseOrderLengthSetting,\r\n budgetLimitedByUsers,\r\n budgetExperimentModuleEnabled: budgetExperimentModuleEnabled,\r\n fundingTypeBudgetEnabled,\r\n purchaseOrderBudgetEnabled,\r\n allowPartialProjectCharges,\r\n allowPartialSingleProjectCharges,\r\n trainingSessionEnabled,\r\n assistedReservationsEnabled,\r\n resCustomFormEnabled: reservationFormEnabled,\r\n resMultipleFormsEnabled,\r\n multipleInstrumentsEnabled,\r\n reservationTerminationEnabled,\r\n crossInstrumentTrainingEnabled,\r\n userAndGroupPermissionsEnabled: userAndGroupPermissionsEnabled,\r\n tutoringModulesEnabled,\r\n offlineServiceWithReservation,\r\n userIsMainAdmin,\r\n instituteProjectsEnabled,\r\n showReferenceFieldInReservationDetails,\r\n accServicesEnabled,\r\n showCalcPriceOnOfflineService,\r\n allowUsersToViewTheirCharges,\r\n allowOngoingReservationModificationEnabled,\r\n showCalculatePrice,\r\n allowAddRemoveOnEditReservation,\r\n allowToRemoveFromMultipleReservation,\r\n draftReservationsEnabled,\r\n hideReservationCollaborators,\r\n MandatoryOfflineServicesOnTrainingSignUps,\r\n DoNotAllowReservationUserChangeByStaff: doNotAllowReservationUserChangeByStaff,\r\n AssemblyPartsEnabled: assemblyPartsEnabled,\r\n confidentialBudgetsEnabled: isConfidentialBudgetsEnabled,\r\n AllowWorkflowBooking: allowWorkflowBookingEnabled,\r\n ModifyReservationNameForUsers: modifyReservationNameForUsers,\r\n ServiceRequestReservationEnabled: requestReservationEnabled,\r\n };\r\n return r;\r\n}\r\n\r\nexport default useGlobalSettingsHook;\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\n\r\nexport type OfflineServiceTypeUrl = 'base' | 'public';\r\nexport interface OfflineServiceTypePickerProps\r\n extends Omit, 'loadData'> {\r\n urlType: OfflineServiceTypeUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst publicUrl = '/api/odata/v4/OfflineServiceFilter/AllOfflineServices';\r\n\r\nexport const loadOfflineServiceData = (\r\n predicates: (string | Condition)[] | undefined,\r\n urlType: OfflineServiceTypeUrl,\r\n globalServiceGroupFilter: Entity[],\r\n select?: (keyof IOfflineServiceFilterDto)[],\r\n expand?: keyof Pick,\r\n) => {\r\n const sourceUrl = urlType === 'public' ? publicUrl : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // TODO: narrow down used properties list\r\n select:\r\n !!select && select.length > 0\r\n ? select\r\n : [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'ServiceTypeId',\r\n 'Active',\r\n 'IntQuantityOnly',\r\n 'HideProjects',\r\n 'UnitTypeID',\r\n 'UnitTypeName',\r\n 'AllowToUser',\r\n 'Inventory',\r\n 'DefaultQuantity',\r\n 'ReservationOverlappingInventory',\r\n 'BudgetsTurnedOn',\r\n 'IsAdmin',\r\n 'StaffOnly',\r\n 'NotLessThanZero',\r\n 'TrackInventory',\r\n 'InventoryBatchesEnabled',\r\n ],\r\n expand: expand,\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function OfflineServiceTypePicker(props: OfflineServiceTypePickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadOfflineServiceData(\r\n props.predicates,\r\n props.urlType,\r\n globalServiceGroupFilter || [],\r\n );\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport function UsageRelatedFilter(\r\n Ids: number[],\r\n excludedIds: number[],\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (Ids.length > 0) {\r\n let ids = Ids.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (excludedIds.length > 0) {\r\n let ids = excludedIds.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Excludes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n // predicates.push(\r\n // new Condition(\r\n // 'AllowToUser',\r\n // ODataOperators.Equals,\r\n // true,\r\n // ),\r\n // );\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport function ReservationsRelatedFilter(\r\n equipmentGroups: number[],\r\n optionalServiceTypes: Array>,\r\n hideProject?: boolean,\r\n allServicesAllowed?: boolean,\r\n budgetId?: number,\r\n budgetServiceGroupServicesAllowed?: boolean,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n if (equipmentGroups.length > 0) {\r\n let ids = equipmentGroups.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (!!hideProject) {\r\n predicates.push(\r\n new Condition(\r\n 'HideProjects',\r\n ODataOperators.Equals,\r\n hideProject,\r\n ),\r\n );\r\n }\r\n let byAdmin = new Condition(\r\n 'IsAdmin',\r\n ODataOperators.Equals,\r\n true,\r\n );\r\n let byUser = new Condition(\r\n 'StaffOnly',\r\n ODataOperators.Equals,\r\n false,\r\n );\r\n predicates.push(`(${byAdmin} or ${byUser})`);\r\n if (!!budgetId && budgetId > 0 && !budgetServiceGroupServicesAllowed) {\r\n predicates.push(\r\n new Condition(\r\n 'AllowedBudgets',\r\n ODataOperators.Any,\r\n budgetId,\r\n ),\r\n );\r\n }\r\n if (!allServicesAllowed) {\r\n if (optionalServiceTypes.length > 0) {\r\n let ids = optionalServiceTypes.map(f => {\r\n return { Id: f.Id } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport function OfflineServiceRelatedFilter(\r\n relatedGroups: number[],\r\n hideProject?: boolean,\r\n budgetId?: number,\r\n budgetServiceGroupServicesAllowed?: boolean,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'ServiceTypeId',\r\n ODataOperators.Equals,\r\n 2,\r\n ),\r\n );\r\n if (relatedGroups.length > 0) {\r\n let ids = relatedGroups.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (!!hideProject) {\r\n predicates.push(\r\n new Condition(\r\n 'HideProjects',\r\n ODataOperators.Equals,\r\n hideProject,\r\n ),\r\n );\r\n }\r\n let byAdmin = new Condition(\r\n 'IsAdmin',\r\n ODataOperators.Equals,\r\n true,\r\n );\r\n let byUser = `(${new Condition(\r\n 'StaffOnly',\r\n ODataOperators.Equals,\r\n false,\r\n )} and ${new Condition(\r\n 'AllowToUser',\r\n ODataOperators.Equals,\r\n true,\r\n )})`;\r\n predicates.push(`(${byAdmin} or ${byUser})`);\r\n if (!!budgetId && budgetId > 0 && !budgetServiceGroupServicesAllowed) {\r\n predicates.push(\r\n new Condition(\r\n 'AllowedBudgets',\r\n ODataOperators.Any,\r\n budgetId,\r\n ),\r\n );\r\n }\r\n\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport function RenewStockRelatedFilter(): (\r\n | string\r\n | Condition\r\n)[] {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'ServiceTypeId',\r\n ODataOperators.Equals,\r\n 2,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'TrackInventory',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport function InventoryBatchRelatedFilter(): (\r\n | string\r\n | Condition\r\n)[] {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'ServiceTypeId',\r\n ODataOperators.Equals,\r\n 2,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'TrackInventory',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'InventoryBatchesEnabled',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","/**\r\n *\r\n * DatesRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport {\r\n getPeriodTypesEntity,\r\n PeriodTypes,\r\n PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport { DatePeriodsPicker } from 'app/components/pickers/DatePeriodsPicker';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nconst allPeriods: Array = [\r\n 'CustomDate',\r\n 'Today',\r\n 'TodayTomorrow',\r\n 'ThisWeek',\r\n 'NextWeek',\r\n 'ThisMonth',\r\n 'NextMonth',\r\n 'ThisQuarter',\r\n 'NextQuarter',\r\n 'ThisYear',\r\n 'NextYear',\r\n 'LastWeek',\r\n 'LastMonth',\r\n 'LastQuarter',\r\n 'LastYear',\r\n];\r\nconst noFuturePeriods: Array = [\r\n 'CustomDate',\r\n 'ThisWeek',\r\n 'ThisMonth',\r\n 'ThisQuarter',\r\n 'ThisYear',\r\n 'LastWeek',\r\n 'LastMonth',\r\n 'LastQuarter',\r\n 'LastYear',\r\n];\r\n\r\nexport interface DatesRangeFilterProps extends IFilterComponentProps {\r\n noFuturePeriods?: boolean;\r\n}\r\nexport const DatesRangeFilter = (props: DatesRangeFilterProps) => {\r\n const { t } = useTranslation();\r\n const [value, setValue] = React.useState(\r\n props.value !== undefined ? props.value : new PresetDatesRange(),\r\n );\r\n const handleStartOnChange = (date: MaterialUiPickersDate) => {\r\n const changedValue = Object.assign(new PresetDatesRange(), value, {\r\n start: date,\r\n });\r\n setValue(changedValue);\r\n if (props.onChange !== undefined) {\r\n props.onChange(changedValue);\r\n }\r\n };\r\n const handleEndOnChange = (date: MaterialUiPickersDate) => {\r\n const changedValue = Object.assign(new PresetDatesRange(), value, {\r\n end: date,\r\n });\r\n setValue(changedValue);\r\n if (props.onChange !== undefined) {\r\n props.onChange(changedValue);\r\n }\r\n };\r\n\r\n const handleTypeChange = (periodValue: PeriodTypesEntity | null) => {\r\n let changedValue = Object.assign(\r\n new PresetDatesRange(),\r\n {\r\n type:\r\n (periodValue as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n },\r\n DatesRange.fromPreset(\r\n (periodValue as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n null,\r\n null,\r\n ),\r\n );\r\n setValue(state => changedValue);\r\n props.onChange(changedValue);\r\n };\r\n return (\r\n <>\r\n {value !== undefined && (\r\n \r\n \r\n {/* */}\r\n {value !== undefined &&\r\n value !== null &&\r\n value?.type !== undefined &&\r\n value.type.Id === 'CustomDate' && (\r\n <>\r\n \r\n\r\n {/* */}\r\n\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default DatesRangeFilter;\r\n","import {\r\n CircularProgress,\r\n ListItemIcon,\r\n ListItemText,\r\n Menu,\r\n MenuItem,\r\n} from '@material-ui/core';\r\nimport { Theme, withStyles } from '@material-ui/core/styles';\r\nimport { makeStyles } from '@material-ui/styles';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { TFunctionResult } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n bindMenu,\r\n usePopupState,\r\n bindTrigger,\r\n anchorRef,\r\n PopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PluginHook } from 'react-table';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport { IRow } from '.';\r\nimport { RouterLink } from '../BasicLinks/RouterLink';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { CellRenderer } from './BasicTableProps';\r\nimport { ButtonsVariant } from '../BasicButtons/Button';\r\nimport { omit } from 'lodash';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nexport interface RowActionsProps {\r\n href?: string | IPathAndQuery;\r\n to?: string;\r\n text: string;\r\n icon: IconProp;\r\n title?: string;\r\n target?: string;\r\n renderAsTitle?: boolean;\r\n localizedText?: string;\r\n onClick?: () => Promise;\r\n withLoading?: boolean;\r\n}\r\nexport interface RowActionsMenuProps {\r\n id: string;\r\n items: RowActionsProps[];\r\n icon?: IconProp;\r\n tooltip?: React.ReactNode | TFunctionResult;\r\n variant?: ButtonsVariant;\r\n onClick?: (event: React.MouseEvent) => void;\r\n getIsOpen?: () => boolean;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n}));\r\nconst StyledItemIcon = withStyles({\r\n root: {\r\n minWidth: 'unset',\r\n },\r\n})(ListItemIcon);\r\nconst RowMenuActions = React.forwardRef(\r\n function RowMenuActions(props, ref) {\r\n const { id, items, variant, icon, tooltip, onClick } = props;\r\n const classes = useStyles();\r\n const popupState = usePopupState({\r\n variant: 'popper',\r\n popupId: id,\r\n });\r\n const [tooltipOpen, setTooltipOpen] = React.useState(false);\r\n React.useEffect(() => {\r\n if (popupState.isOpen) {\r\n setTooltipOpen(false);\r\n }\r\n }, [popupState.isOpen]);\r\n const popupProps = { ...bindTrigger(popupState) };\r\n return (\r\n
\r\n {!!tooltip ? (\r\n {\r\n setTooltipOpen(!popupState.isOpen);\r\n }}\r\n onClose={() => setTooltipOpen(false)}\r\n >\r\n \r\n {\r\n popupProps.onClick(event);\r\n if (!!onClick) {\r\n onClick(event);\r\n }\r\n }}\r\n {...omit(popupProps, 'onClick')}\r\n >\r\n \r\n \r\n \r\n \r\n ) : (\r\n {\r\n popupProps.onClick(event);\r\n if (!!onClick) {\r\n onClick(event);\r\n }\r\n }}\r\n {...omit(popupProps, 'onClick')}\r\n >\r\n \r\n \r\n )}\r\n\r\n \r\n {items.map((item, index) => (\r\n \r\n ))}\r\n \r\n
\r\n );\r\n },\r\n);\r\n\r\nconst toAbsolutePath = (href: string | IPathAndQuery) => {\r\n return typeof href === 'string'\r\n ? toRootedURL(href)\r\n : toRootedURL((href as IPathAndQuery).path, (href as IPathAndQuery).search);\r\n};\r\n\r\nconst RowAction = ({\r\n ref,\r\n popupState,\r\n ...item\r\n}: RowActionsProps & {\r\n ref: React.ForwardedRef;\r\n popupState: PopupState;\r\n}) => {\r\n const { t } = useTranslation();\r\n const [loading, setLoading] = React.useState(false);\r\n const setProcessing = React.useCallback(\r\n (processing: boolean) => {\r\n if (!item.withLoading) return;\r\n setLoading(processing);\r\n },\r\n [item.withLoading],\r\n );\r\n if (item.renderAsTitle)\r\n return (\r\n \r\n {/* \r\n \r\n */}\r\n \r\n {!!item.localizedText ? t(item.localizedText) : item.text}\r\n \r\n {/* \r\n {!!item.localizedText ? t(item.localizedText) : item.text}\r\n */}\r\n \r\n );\r\n if (item.href)\r\n return (\r\n {\r\n if (item.href !== undefined) {\r\n let url = toAbsolutePath(item.href);\r\n window.open(url, '_blank');\r\n }\r\n popupState.close();\r\n }}\r\n >\r\n \r\n \r\n \r\n {item.text}\r\n \r\n );\r\n if (item.to) {\r\n return (\r\n \r\n \r\n \r\n \r\n {item.text}\r\n \r\n );\r\n }\r\n return (\r\n {\r\n if (!item.withLoading) popupState.close();\r\n if (item.onClick) {\r\n setProcessing(true);\r\n await item.onClick();\r\n setProcessing(false);\r\n if (item.withLoading) popupState.close();\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n {item.text}\r\n {loading && }\r\n \r\n );\r\n};\r\n\r\nexport function RowActionsMenu(props: RowActionsMenuProps) {\r\n return ;\r\n}\r\nexport function useRowActionsColumn(\r\n rowActions: CellRenderer[] | undefined,\r\n tablePlugins: PluginHook[],\r\n) {\r\n const { t } = useTranslation();\r\n if (rowActions !== undefined) {\r\n if (rowActions.length > 0) {\r\n const actionColumns = rowActions?.map((column, index) => ({\r\n id: `ActionColumn_${index}`,\r\n Header: t(translations.Action),\r\n disableSortBy: true,\r\n Cell: column,\r\n }));\r\n tablePlugins.push(hooks => {\r\n hooks.visibleColumns.push(columns => [...columns, ...actionColumns]);\r\n });\r\n }\r\n }\r\n}\r\nexport function useInlineRowActionsColumn(\r\n inlineRowActions: CellRenderer[] | undefined,\r\n tablePlugins: PluginHook[],\r\n) {\r\n const { t } = useTranslation();\r\n if (inlineRowActions !== undefined) {\r\n if (inlineRowActions.length > 0) {\r\n const actionColumns = inlineRowActions?.map((column, index) => ({\r\n id: `InlineActionColumn_${index}`,\r\n Header: t(translations.Action),\r\n disableSortBy: true,\r\n Cell: column,\r\n }));\r\n tablePlugins.push(hooks => {\r\n hooks.visibleColumns.push(columns => [...columns, ...actionColumns]);\r\n });\r\n }\r\n }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.articles || initialState;\r\n\r\nexport const selectArticles = createSelector([selectSlice], state => state);\r\n\r\nexport const selectArticlesExternalSearchResults = createSelector(\r\n [selectArticles],\r\n state => state.externalSearchResults,\r\n);\r\n\r\nexport const selectArticlesExternalSearchForm = createSelector(\r\n [selectArticles],\r\n state => state.externalSearchFormDetails,\r\n);\r\nexport const selectArticlesExternalSearchPageIndex = createSelector(\r\n [selectArticles],\r\n state => state.externalSearchPageIndex,\r\n);\r\nexport const selectArticlesExternalSearchPageSize = createSelector(\r\n [selectArticles],\r\n state => state.externalSearchPageSize,\r\n);\r\nexport const selectArticlesExternalSearchPageData = createSelector(\r\n [selectArticlesExternalSearchResults, selectArticlesExternalSearchPageIndex],\r\n (results, page) => results.data?.[page],\r\n);\r\nexport const selectArticleDetails = createSelector(\r\n [selectArticles],\r\n state => state.articleDetails,\r\n);\r\nexport const selectRefreshEditArticleAssociation = createSelector(\r\n [selectArticles],\r\n state => state.refreshEditArticleAssociation,\r\n);\r\nexport const selectArticleDetailsBusy = createSelector(\r\n [selectArticles],\r\n state => state.articleDetailsBusy,\r\n);\r\nexport const selectEditArticleAssociationBusy = createSelector(\r\n [selectArticles],\r\n state => state.editArticleAssociationBusy,\r\n);\r\n\r\nexport const selectArticleDetailsForm = createSelector(\r\n [selectArticleDetails],\r\n state => ({\r\n ...state,\r\n ...{\r\n ServiceGroupAssets:\r\n state?.Assets?.filter(\r\n f => f.Availability?.Id === AvailabilityTypes.ServiceGroup,\r\n ) ?? [],\r\n InstrumentAssets:\r\n state?.Assets?.filter(f => f.ServiceTypeId === ServiceType.Online) ??\r\n [],\r\n },\r\n }),\r\n);\r\n","import { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n EquipmentsChangeStateParameters,\r\n IReservationEquipmentDto,\r\n ReservationDetailsState,\r\n StatusChangeResult,\r\n} from '../slice/types';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport * as Yup from 'yup';\r\nimport { debounce } from 'lodash';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { TFunction } from 'i18next';\r\nimport { PrintPDFItem } from 'app/components/PrintToPDF/slice/types';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const updateFormValues = (\r\n original: IFormValueDto[],\r\n coming: IFormValueDto[],\r\n) => {\r\n const result = coming.map(v => {\r\n let orn = original.find(o => o.FormFieldId === v.FormFieldId);\r\n if (!!orn) {\r\n return Object.assign({}, orn, {\r\n Value: v.Value,\r\n });\r\n } else {\r\n return v;\r\n }\r\n });\r\n return result;\r\n};\r\nexport const getEnd = (\r\n start: Date,\r\n equipments: IReservationEquipmentDto[],\r\n): Date => {\r\n const ForceFullDayReservations = equipments.some(\r\n f => f.ForceFullDayReservations,\r\n );\r\n if (ForceFullDayReservations) {\r\n return dateUtils.addDays(dateUtils.startOfDay(start), 1);\r\n }\r\n let defEnd = dateUtils.addHours(\r\n start,\r\n equipments\r\n .map(f => f.DefaultReservationDuration)\r\n .sort((a, b) => a - b)[0] || 1,\r\n );\r\n let minEnd = dateUtils.addHours(\r\n start,\r\n equipments.map(f => f.MinOrderHours).sort((a, b) => a - b)[\r\n equipments.length - 1\r\n ] || 1,\r\n );\r\n return defEnd < minEnd ? minEnd : defEnd;\r\n};\r\nexport const validateReservation = async (\r\n parameters: EquipmentsChangeStateParameters,\r\n) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let results = await ReservationsApi.getValidationState(parameters);\r\n resolve(results);\r\n } catch (e) {\r\n resolve(undefined);\r\n }\r\n });\r\n};\r\nexport const validateDuration = async (\r\n value: Date | undefined,\r\n context: Yup.TestContext,\r\n) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let parent = context.parent as ReservationDetailsState;\r\n let results = await ReservationsApi.validateDuration({\r\n Equipments: parent.EquipmentsData.map(f => f.Id),\r\n AccServices: parent.AccServices.map(f => f.Id),\r\n ReservationId: parent.Id > 0 ? parent.Id : null,\r\n Start: parent.StartTime,\r\n End: parent.EndTime,\r\n Status: parent.Status?.Id || 1,\r\n TrainingSignUp: parent.TrainingSignUp,\r\n Tutoring: parent.Tutoring,\r\n FullDayReservation: parent.FullDayReservation,\r\n ADGroup: parent.ADGroup?.Id || null,\r\n BookedBy: parent.BookedBy?.Id || null,\r\n FundingTypeId: parent.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: parent.TrainingSession?.Id || null,\r\n Remarks: parent.Remarks || null,\r\n BudgetId: parent.Budget?.Id || null,\r\n CheckSession: false,\r\n });\r\n resolve(results.value);\r\n } catch (e) {\r\n resolve([]);\r\n }\r\n });\r\n};\r\nexport const validateYupPermissions = async (\r\n value: Entity | null,\r\n context: Yup.TestContext,\r\n) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let parent = context.parent as ReservationDetailsState;\r\n let results = await ReservationsApi.validatePermissions({\r\n Equipments: parent.EquipmentsData.map(f => f.Id),\r\n AccServices: parent.AccServices.map(f => f.Id),\r\n ReservationId: parent.Id > 0 ? parent.Id : null,\r\n Start: parent.StartTime,\r\n End: parent.EndTime,\r\n Status: parent.Status?.Id || 1,\r\n TrainingSignUp: parent.TrainingSignUp,\r\n Tutoring: parent.Tutoring,\r\n FullDayReservation: parent.FullDayReservation,\r\n ADGroup: parent.ADGroup?.Id || null,\r\n BookedBy: parent.BookedBy?.Id || null,\r\n FundingTypeId: parent.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: parent.TrainingSession?.Id || null,\r\n Remarks: parent.Remarks || null,\r\n BudgetId: parent.Budget?.Id || null,\r\n CheckSession: false,\r\n });\r\n resolve(results);\r\n } catch (e) {\r\n resolve([]);\r\n }\r\n });\r\n};\r\nexport const validatePermissions = async (values: ReservationDetailsState) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let parent = values;\r\n let results = await ReservationsApi.validatePermissions({\r\n Equipments: parent.EquipmentsData.map(f => f.Id),\r\n AccServices: parent.AccServices.map(f => f.Id),\r\n ReservationId: parent.Id > 0 ? parent.Id : null,\r\n Start: parent.StartTime,\r\n End: parent.EndTime,\r\n Status: parent.Status?.Id || 1,\r\n TrainingSignUp: parent.TrainingSignUp,\r\n Tutoring: parent.Tutoring,\r\n FullDayReservation: parent.FullDayReservation,\r\n ADGroup: parent.ADGroup?.Id || null,\r\n BookedBy: parent.BookedBy?.Id || null,\r\n FundingTypeId: parent.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: parent.TrainingSession?.Id || null,\r\n Remarks: parent.Remarks || null,\r\n BudgetId: parent.Budget?.Id || null,\r\n CheckSession: false,\r\n });\r\n resolve(results.value);\r\n } catch (e) {\r\n resolve(false);\r\n }\r\n });\r\n};\r\nexport const validateMinEnd = async (\r\n value: any,\r\n context: Yup.TestContext,\r\n) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let val = value as Date;\r\n if (!!val) {\r\n resolve(context.parent.StartTime < val);\r\n } else {\r\n resolve(true);\r\n }\r\n } catch (e) {\r\n resolve(true);\r\n }\r\n });\r\n};\r\nexport const validatePrerequisite = async (values: ReservationDetailsState) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let parent = values;\r\n let results = await ReservationsApi.validatePrerequisite({\r\n Equipments: parent.EquipmentsData.map(f => f.Id),\r\n AccServices: parent.AccServices.map(f => f.Id),\r\n ReservationId: parent.Id > 0 ? parent.Id : null,\r\n Start: parent.StartTime,\r\n End: parent.EndTime,\r\n Status: parent.Status?.Id || 1,\r\n TrainingSignUp: parent.TrainingSignUp,\r\n Tutoring: parent.Tutoring,\r\n FullDayReservation: parent.FullDayReservation,\r\n ADGroup: parent.ADGroup?.Id || null,\r\n BookedBy: parent.BookedBy?.Id || null,\r\n FundingTypeId: parent.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: parent.TrainingSession?.Id || null,\r\n Remarks: parent.Remarks || null,\r\n BudgetId: parent.Budget?.Id || null,\r\n CheckSession: false,\r\n });\r\n resolve(results);\r\n } catch (e) {\r\n resolve(false);\r\n }\r\n });\r\n};\r\n\r\nexport const validateAccServices = (\r\n allEquipments: IReservationEquipmentDto[],\r\n): string[] => {\r\n let allAcc = allEquipments.reduce((acc, next) => {\r\n let services: IEquipmentAccServiceDto[] = [];\r\n acc.forEach(c => {\r\n if (next.AccServices.some(n => n.Id === c.Id)) {\r\n services.push(c);\r\n }\r\n });\r\n return services;\r\n }, allEquipments.filter(f => f.AccServices.length > 0)[0].AccServices);\r\n if (\r\n allEquipments.some(f => f.AccServices.length > 0) &&\r\n allEquipments.some(f => f.AccServices.length < 1)\r\n ) {\r\n return allEquipments.filter(f => f.AccServices.length > 0).map(f => f.Name);\r\n } else if (allAcc.length !== allEquipments.length) {\r\n let wrongEqs = allEquipments.filter(\r\n f => !allAcc.some(a => a.EquipmentId === f.Id),\r\n );\r\n return wrongEqs.map(f => f.Name);\r\n } else {\r\n return [];\r\n }\r\n};\r\nexport const getStatus = async (\r\n values: ReservationDetailsState,\r\n trainingSessionOnly: boolean,\r\n): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n if (trainingSessionOnly) {\r\n let status = {\r\n Status: (values.EquipmentsData as IReservationEquipmentDto[])[0]\r\n .TrainingSignUpApproval,\r\n Tutoring: false,\r\n } as StatusChangeResult;\r\n resolve(status);\r\n } else {\r\n try {\r\n let parent = values;\r\n let result = await ReservationsApi.changeStatus({\r\n Equipments: parent.EquipmentsData.map(f => f.Id),\r\n AccServices: parent.AccServices.map(f => f.Id),\r\n ReservationId: parent.Id > 0 ? parent.Id : null,\r\n Start: parent.StartTime,\r\n End: parent.EndTime,\r\n Status: parent.Status?.Id || 1,\r\n TrainingSignUp: parent.TrainingSignUp,\r\n Tutoring: parent.Tutoring,\r\n FullDayReservation: parent.FullDayReservation,\r\n ADGroup: parent.ADGroup?.Id || null,\r\n BookedBy: parent.BookedBy?.Id || null,\r\n FundingTypeId: parent.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: parent.TrainingSession?.Id || null,\r\n Remarks: parent.Remarks || null,\r\n BudgetId: parent.Budget?.Id || null,\r\n CheckSession: false,\r\n });\r\n resolve(result);\r\n } catch (e) {\r\n resolve({\r\n Status: values.Status?.Id || 1,\r\n Tutoring: values.Tutoring,\r\n } as StatusChangeResult);\r\n }\r\n }\r\n });\r\n};\r\nexport const formatedToString = (date: Date | string) => {\r\n return dateUtils.formatISO(dateUtils.dateOrStringToDate(date));\r\n};\r\nexport const toDate = (date: Date | string) => {\r\n return dateUtils.dateOrStringToDate(date);\r\n};\r\nexport const newDate = (date: Date | string | undefined | null) => {\r\n if (!date) {\r\n return new CustomDate(new Date(), 'complete');\r\n } else {\r\n return new CustomDate(toDate(date), 'complete');\r\n }\r\n};\r\nexport const greaterThanDate = (\r\n compared: Date | string,\r\n toCompare: Date | string,\r\n) => {\r\n let first = newDate(compared);\r\n let second = newDate(toCompare);\r\n if (first.getTime() > second.getTime()) {\r\n return true;\r\n }\r\n return false;\r\n};\r\nexport const lessThanDate = (\r\n compared: Date | string,\r\n toCompare: Date | string,\r\n) => {\r\n let first = newDate(compared);\r\n let second = newDate(toCompare);\r\n if (first.getTime() < second.getTime()) {\r\n return true;\r\n }\r\n return false;\r\n};\r\nexport const getWorkFlowName = (userName: string) => {\r\n return {\r\n Id: -1,\r\n Name: `${userName} ${dateUtils.shortDateTimeFormat(newDate(undefined))}`,\r\n } as Entity;\r\n};\r\nexport const debounceValidateMinEnd = debounce(validateMinEnd, 300);\r\nexport function getPrintPDFDefaultSections(\r\n t: TFunction,\r\n serviceRequestEnabled: boolean,\r\n hasCustomForm?: boolean,\r\n): PrintPDFItem[] {\r\n let sections = [\r\n {\r\n id: 'ReservationDetails',\r\n label: t(translations.ReservationDetails),\r\n checked: true,\r\n },\r\n {\r\n id: 'OfflineServicesDetails',\r\n label: t(translations.ReservationConsumables),\r\n checked: false,\r\n },\r\n ];\r\n if (hasCustomForm) {\r\n sections.push({\r\n id: 'CustomFormDetails',\r\n label: t(translations.CustomFormDetails),\r\n checked: true,\r\n });\r\n }\r\n if (serviceRequestEnabled) {\r\n sections.push({\r\n id: 'ServiceRequest',\r\n label: t(translations.AssociatedServiceRequestDetails),\r\n checked: false,\r\n });\r\n }\r\n return sections;\r\n}\r\n","import { IUtils } from '@date-io/core/IUtils';\r\nimport { validate } from '@material-ui/pickers';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { DateDropDownValidationProps } from 'app/components/BookitDatePicker/DateDropDown';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const validateError = (\r\n date: MaterialUiPickersDate | ParsableDate,\r\n propss: any,\r\n utils: IUtils,\r\n) => {\r\n let error = validate(date, utils, propss);\r\n if (error === '') {\r\n return undefined;\r\n }\r\n return error;\r\n};\r\nexport const validateDate = (\r\n day: number,\r\n month: number,\r\n year: number,\r\n props: DateDropDownValidationProps,\r\n utils: IUtils,\r\n currentDate?: Date | string | null,\r\n): React.ReactNode | undefined => {\r\n if (currentDate !== null && currentDate !== undefined) {\r\n let date = dateUtils.truncateTime(\r\n dateUtils.dateOrStringToDate(currentDate),\r\n );\r\n let opDate = dateUtils.set(date, {\r\n year: year,\r\n month: month,\r\n });\r\n let maxMonthDays = dateUtils.getDaysInMonth(opDate);\r\n if (day > maxMonthDays) {\r\n return `Invalid Date: The day can not be longer than ${maxMonthDays}.`;\r\n } else {\r\n let finalDate = dateUtils.set(opDate, { date: day });\r\n return validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n }\r\n } else {\r\n return undefined;\r\n }\r\n};\r\nexport const validateTime = (\r\n hours: number,\r\n minutes: number,\r\n props: DateDropDownValidationProps,\r\n utils: IUtils,\r\n currentDate?: Date | string | null,\r\n ampm?: boolean,\r\n): React.ReactNode | undefined => {\r\n if (currentDate !== null && currentDate !== undefined) {\r\n let date = dateUtils.dateOrStringToDate(currentDate);\r\n let opDate = dateUtils.set(date, {\r\n hours: hours,\r\n minutes: minutes,\r\n });\r\n let finalDate = dateUtils.convertToMeridiem(\r\n opDate,\r\n dateUtils.getMeridiem(date),\r\n ampm ?? false,\r\n );\r\n return validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\nexport const checkDateInput = (\r\n dateStart: 'day' | 'month' | 'year',\r\n val?: string | null,\r\n) => {\r\n if (val === null || val === undefined) {\r\n return true;\r\n }\r\n //eslint-disable-next-line\r\n const regexDDMMYYYY = RegExp(\r\n //eslint-disable-next-line\r\n '^(((0[1-9]|[12][0-9]|30)[-/]?(0[13-9]|1[012])|31[-/]?(0[13578]|1[02])|(0[1-9]|1[0-9]|2[0-8])[-/]?02)[-/]?[0-9]{4}|29[-/]?02[-/]?([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$',\r\n );\r\n const regexYYYYMMdd = RegExp(\r\n //eslint-disable-next-line\r\n '^([0-9]{4}[-/]?((0[13-9]|1[012])[-/]?(0[1-9]|[12][0-9]|30)|(0[13578]|1[02])[-/]?31|02[-/]?(0[1-9]|1[0-9]|2[0-8]))|([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00)[-/]?02[-/]?29)$',\r\n );\r\n const regexMMDDYYYY = RegExp(\r\n //eslint-disable-next-line\r\n `^(((0[13-9]|1[012])[-/]?(0[1-9]|[12][0-9]|30)|(0[13578]|1[02])[-/]?31|02[-/]?(0[1-9]|1[0-9]|2[0-8]))[-/]?[0-9]{4}|02[-/]?29[-/]?([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$`,\r\n );\r\n let res =\r\n dateStart === 'day'\r\n ? regexDDMMYYYY.test(val)\r\n : dateStart === 'month'\r\n ? regexMMDDYYYY.test(val)\r\n : regexYYYYMMdd.test(val);\r\n return res;\r\n};\r\n","/**\r\n *\r\n * DateTimeLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface DateTimeLabelProps {\r\n value: Date | string | null;\r\n}\r\n\r\nexport function DateTimeLabel(props: DateTimeLabelProps) {\r\n return <>{dateUtils.shortDateTimeFormat(props.value)};\r\n}\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { CheckColor } from '.';\r\n\r\nexport const useStyles = makeStyles<\r\n Theme,\r\n {\r\n size?: 'medium' | 'small';\r\n color?: CheckColor;\r\n withPadding?: boolean;\r\n danger?: boolean;\r\n }\r\n>((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n '&[class*=\"PrivateSwitchBase-root\"]': {\r\n padding: props => (props.withPadding ? 9 : 0),\r\n },\r\n '&:hover': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n icon: {\r\n borderRadius: 4,\r\n width: props => (props.size === 'medium' ? 20 : 16),\r\n height: props => (props.size === 'medium' ? 20 : 16),\r\n boxShadow: props =>\r\n props.danger\r\n ? `inset 0 0 0 1px ${bookitColors.danger.borders}, inset 0 -1px 0 ${bookitColors.danger.borders}`\r\n : `inset 0 0 0 1px ${bookitColors.grayscale.grayBorders}, inset 0 -1px 0 ${bookitColors.grayscale.grayBorders}`,\r\n //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n backgroundColor: bookitColors.base.white,\r\n backgroundImage:\r\n 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',\r\n '$root.Mui-focusVisible &': {\r\n // outline: `1px auto ${blackGray.colorGrayComponentsLight}`,\r\n // outlineOffset: 1,\r\n boxShadow: props =>\r\n props.danger\r\n ? `inset 0 0 0 2px ${bookitColors.danger.componentsLight}, inset 0 -1px 0 ${bookitColors.danger.componentsLight}`\r\n : `inset 0 0 0 2px ${bookitColors.grayscale.grayComponentsLight}, inset 0 -1px 0 ${bookitColors.grayscale.grayComponentsLight}`,\r\n },\r\n 'input:hover ~ &': {\r\n // backgroundColor: '#ebf1f5',\r\n //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n boxShadow: props =>\r\n props.danger\r\n ? `inset 0 0 0 1px ${bookitColors.danger.borders}, inset 0 -1px 0 ${bookitColors.danger.borders}`\r\n : `inset 0 0 0 1px ${bookitColors.grayscale.grayBorders}, inset 0 -1px 0 ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n 'input:disabled ~ &': {\r\n boxShadow: props =>\r\n props.danger\r\n ? `inset 0 0 0 1px ${bookitColors.danger.disabled}, inset 0 -1px 0 ${bookitColors.danger.disabled}`\r\n : `inset 0 0 0 1px ${bookitColors.grayscale.graySelection}, inset 0 -1px 0 ${bookitColors.grayscale.graySelection}`,\r\n background: props =>\r\n props.danger\r\n ? bookitColors.danger.background\r\n : bookitColors.grayscale.grayBackground,\r\n },\r\n },\r\n checkedIcon: {\r\n boxShadow: 'unset',\r\n backgroundColor: props =>\r\n props.danger\r\n ? bookitColors.danger.regular\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.regular\r\n bookitColors.primary.regular,\r\n backgroundImage:\r\n 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',\r\n '&:before': {\r\n display: 'block',\r\n width: props => (props.size === 'medium' ? 20 : 16),\r\n height: props => (props.size === 'medium' ? 20 : 16),\r\n backgroundImage:\r\n \"url(\\\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath\" +\r\n \" fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 \" +\r\n \"1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E\\\")\",\r\n content: '\"\"',\r\n },\r\n 'input:hover ~ &': {\r\n backgroundColor: props =>\r\n props.danger\r\n ? bookitColors.danger.hover\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.hover\r\n bookitColors.primary.hover,\r\n boxShadow: 'unset',\r\n },\r\n 'input:disabled ~ &': {\r\n boxShadow: 'unset', //`inset 0 0 0 1px ${blackGray.colorDividers}, inset 0 -1px 0 ${blackGray.colorDividers}`,\r\n background: props =>\r\n props.danger\r\n ? bookitColors.danger.disabled\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.disabled\r\n bookitColors.primary.disabled,\r\n },\r\n },\r\n indeterminateIcon: {\r\n boxShadow: 'unset',\r\n backgroundColor: props =>\r\n props.danger\r\n ? bookitColors.danger.regular\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.regular\r\n bookitColors.primary.regular,\r\n backgroundImage:\r\n 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',\r\n '&:before': {\r\n display: 'block',\r\n width: props => (props.size === 'medium' ? 20 : 16),\r\n height: props => (props.size === 'medium' ? 20 : 16),\r\n backgroundImage:\r\n \"url(\\\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-54 -24 516 560'%3E%3Cpath\" +\r\n \" fill-rule='evenodd' clip-rule='evenodd' d='M400 288h-352c-17.69 \" +\r\n \"0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z' fill='%23fff'/%3E%3C/svg%3E\\\")\",\r\n content: '\"\"',\r\n },\r\n 'input:hover ~ &': {\r\n backgroundColor: props =>\r\n props.danger\r\n ? bookitColors.danger.hover\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.hover\r\n bookitColors.primary.hover,\r\n boxShadow: 'unset',\r\n },\r\n 'input:disabled ~ &': {\r\n boxShadow: 'unset', //`inset 0 0 0 1px ${blackGray.colorDividers}, inset 0 -1px 0 ${blackGray.colorDividers}`,\r\n background: props =>\r\n props.danger\r\n ? bookitColors.danger.disabled\r\n : // : props.color === 'secondary'\r\n // ? bookitColors.success.disabled\r\n bookitColors.primary.disabled,\r\n },\r\n },\r\n }),\r\n);\r\n","import { Checkbox, CheckboxProps } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { useStyles } from './styles';\r\n\r\nexport type CheckColor = 'primary';\r\n\r\nexport interface CheckProps extends Omit {\r\n color?: CheckColor;\r\n checkicon?: React.ReactNode;\r\n uncheckicon?: React.ReactNode;\r\n indetermicon?: React.ReactNode;\r\n withPadding?: boolean;\r\n danger?: boolean;\r\n label?: string;\r\n}\r\n\r\nexport function Check(props: CheckProps) {\r\n const {\r\n color,\r\n checkicon,\r\n uncheckicon,\r\n indetermicon,\r\n label,\r\n withPadding = true,\r\n danger,\r\n size = 'medium',\r\n ...other\r\n } = props;\r\n const classes = useStyles({\r\n size: size,\r\n color: color,\r\n withPadding: withPadding,\r\n danger: danger,\r\n });\r\n return (\r\n \r\n )\r\n }\r\n icon={!!uncheckicon ? uncheckicon : }\r\n indeterminateIcon={\r\n !!indetermicon ? (\r\n indetermicon\r\n ) : (\r\n \r\n )\r\n }\r\n inputProps={{ 'aria-label': !!label ? label : 'decorative checkbox' }}\r\n size={size}\r\n color={'default'}\r\n {...other}\r\n />\r\n );\r\n}\r\n","export enum PriceSheetBy {\r\n InstrumentsAndServices = 1,\r\n InstrumentCategoryAndProjectCategory = 2,\r\n}\r\n\r\nexport enum BudgetType {\r\n Regular = 1,\r\n Expanses = 2,\r\n}\r\nexport enum UserRegistersToSpecificCoresType {\r\n UserRegistersToSpecificCores_NA = 1,\r\n UserRegistersToSpecificCores_Optional = 2,\r\n UserRegistersToSpecificCores_Mandatory = 3,\r\n}\r\n\r\nexport enum AutomaticAssetNamings {\r\n No,\r\n Cat,\r\n Nick,\r\n}\r\nexport enum UserReservationsRestricted {\r\n NotRestricted = 0,\r\n UserGroupRestricted = 1,\r\n UserOwnRestricted = 2,\r\n}\r\nexport enum SideBarQuickActionsEnum {\r\n NA = 0,\r\n CreateReservation = 1,\r\n CreateWorkOrder = 2,\r\n}\r\n","import {\r\n IComment,\r\n NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { httpClient } from './HttpClient';\r\nconst url = '/api/odata/v4/Comments';\r\nexport const CommentsApi = {\r\n GetComments: (type: number, reference: number, Id?: number) => {\r\n return httpClient\r\n .get(url, {\r\n reference,\r\n type,\r\n $filter: Id !== undefined ? 'Id eq ' + Id?.toString() : undefined,\r\n $expand: ['Files', 'CreatedBy'].join(','),\r\n })\r\n .then(v => v.value as IComment[]);\r\n },\r\n SendComment: (\r\n typeId: number,\r\n referenceId: number,\r\n { Files, Text, IsInternal }: Omit,\r\n ) => {\r\n const form = new FormData();\r\n for (let i = 0; !!Files && i < Files?.length; i++) {\r\n let item = Files?.item(i);\r\n if (!!item) {\r\n form.append('file' + i, item);\r\n }\r\n }\r\n form.append('TypeId', typeId as any);\r\n form.append('ReferenceId', referenceId as any);\r\n form.append('Text', Text ?? '');\r\n form.append('IsInternal', !!IsInternal as any);\r\n\r\n return httpClient.post(url, form);\r\n },\r\n removeFile: (id: string) => {\r\n const delteUrl = `/odata.svc/Files(guid'${id}')`;\r\n return httpClient.delete(delteUrl);\r\n },\r\n};\r\n","export enum DraftReservationTypes {\r\n DraftReservationTypes_SaveForLater = 0,\r\n DraftReservationTypes_ApprovalRequired = 1,\r\n DraftReservationTypes_AllUser = 2,\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.Enums.AllowReservationCollaboratorsTypes\r\n *\r\n */\r\n\r\nexport enum AllowReservationCollaboratorsTypes {\r\n None = 1,\r\n NotAllowedToStartUsage = 0,\r\n AllowedToStartUsage = 2,\r\n}\r\nexport const AllowReservationCollaboratorsTypesArray = [\r\n 'None',\r\n 'NotAllowedToStartUsage',\r\n 'AllowedToStartUsage',\r\n];\r\nexport type AllowReservationCollaboratorsTypesUnion = keyof typeof AllowReservationCollaboratorsTypes;\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { DraftReservationTypes } from 'enums/DraftReservationTypes';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport {\r\n IMandatoryEquipmentsDto,\r\n IReservationEquipmentDto,\r\n ServiceSettingsState,\r\n} from './types';\r\nimport { combineOfflineServiceTypes } from './combineOfflineServiceTypes';\r\nimport { AllowReservationCollaboratorsTypes } from 'api/odata/generated/enums/AllowReservationCollaboratorsTypes';\r\nimport { getBudgetVisible } from './getBudgetVisible';\r\nimport { groupBy, values } from 'lodash';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nexport function mapSettingsFromServices(\r\n equipments: IReservationEquipmentDto[],\r\n accServices: IEquipmentAccServiceDto[],\r\n globalSettings: GlobalSettingsType,\r\n authenticatedUser: AuthenticatedUser,\r\n settings?: ServiceSettingsState,\r\n): ServiceSettingsState {\r\n const p: Partial = {\r\n HasHideProjects: equipments.every(f => f.HideProjects),\r\n HasConflictProjects:\r\n equipments.some(f => f.HideProjects === true) &&\r\n equipments.some(f => f.HideProjects === false),\r\n HasMultipleProjects:\r\n globalSettings.allowPartialProjectCharges &&\r\n equipments.every(f => f.AllowPartialProjectCharges === true),\r\n HasPartialSingleProject:\r\n globalSettings.allowPartialSingleProjectCharges &&\r\n equipments.every(f => f.AllowPartialSingleProjectCharges === true),\r\n AllOffServicesAllowed: equipments.every(\r\n f => f.ReservationOfflineServicesEnabled === null,\r\n ),\r\n OfflineServicesVisible: equipments.every(\r\n f =>\r\n f.ReservationOfflineServicesEnabled === true ||\r\n f.ReservationOfflineServicesEnabled === null,\r\n ),\r\n AllowReservationCollaborators:\r\n globalSettings.hideReservationCollaborators !== true &&\r\n equipments.every(f =>\r\n [\r\n AllowReservationCollaboratorsTypes.AllowedToStartUsage,\r\n AllowReservationCollaboratorsTypes.NotAllowedToStartUsage,\r\n ].includes(f.AllowReservationCollaborators),\r\n ),\r\n budgetExperimentVisible:\r\n globalSettings.budgetExperimentModuleEnabled &&\r\n equipments.some(f => f.BudgetExperimentSettings),\r\n TrainingSignUpApproval:\r\n equipments.length === 1\r\n ? equipments[0].TrainingSignUpApproval ?? 1\r\n : undefined,\r\n HideTrainingSession: equipments.every(f => f.HideTrainingSession === true),\r\n HasAttendance: equipments.every(f => f.HasAttendance === true),\r\n ForceTutoring: equipments.some(\r\n f =>\r\n f.ForceTutoring === true &&\r\n authenticatedUser.IsAdminOf({\r\n ServiceGroupId: f.ServiceGroupId,\r\n ServiceId: f.Id,\r\n ServiceTypeId: ServiceType.Online,\r\n }) === false,\r\n ),\r\n ForceFullDayReservations: equipments.some(f => f.ForceFullDayReservations),\r\n IsEquipmentTutoring: equipments.some(f => f.IsEquipmentTutoring === true),\r\n NotAllowReservations: equipments.some(f => f.NotAllowReservations === true),\r\n AllowOneAccSerOnly: equipments.some(f => f.AllowOneAccSerOnly === true),\r\n IsAllAdmin: equipments.every(\r\n f =>\r\n authenticatedUser.IsAdminOf({\r\n ServiceGroupId: f.ServiceGroupId,\r\n ServiceId: f.Id,\r\n ServiceTypeId: ServiceType.Online,\r\n }) === true,\r\n ),\r\n RestrictReservationToTimeSlots: equipments.every(\r\n f => f.RestrictReservationToTimeSlots === true,\r\n ),\r\n DefaultReservationDuration:\r\n equipments.length > 0\r\n ? equipments\r\n .map(f => f.DefaultReservationDuration)\r\n .sort((a, b) => a - b)[0]\r\n : 1,\r\n MinOrderHours:\r\n equipments.length > 0\r\n ? equipments.map(f => f.MinOrderHours).sort((a, b) => a - b)[\r\n equipments.length - 1\r\n ]\r\n : 1,\r\n MaxOrderHours:\r\n equipments.length > 0\r\n ? accServices.length > 0 &&\r\n accServices.some(f => f.MaxOrderDuration !== null)\r\n ? accServices\r\n .map(f => f.MaxOrderDuration ?? 0)\r\n .sort((a, b) => a - b)[0]\r\n : equipments.map(f => f.MaxOrderHours).sort((a, b) => a - b)[0]\r\n : equipments.map(f => f.MaxOrderHours).sort((a, b) => a - b)[0],\r\n\r\n MinOrderGap:\r\n equipments.length > 0\r\n ? accServices.length > 0 &&\r\n accServices.some(f => f.MinOrderGap !== null)\r\n ? accServices.map(f => f.MinOrderGap ?? 0).sort((a, b) => a - b)[0]\r\n : equipments.map(f => f.MinOrderGap).sort((a, b) => a - b)[0]\r\n : equipments.map(f => f.MinOrderGap).sort((a, b) => a - b)[0],\r\n RestrictDurationUnitsAmount:\r\n equipments.length > 0\r\n ? equipments\r\n .map(f => f.RestrictDurationUnitsAmount ?? 0)\r\n .filter(f => f !== 0)\r\n .sort((a, b) => a - b)[equipments.length - 1]\r\n : null,\r\n RestrictDurationUnitType:\r\n equipments.length > 0\r\n ? equipments\r\n .map(f => f.RestrictDurationUnitType ?? 0)\r\n .filter(f => f !== 0)\r\n .sort((a, b) => a - b)[equipments.length - 1]\r\n : null,\r\n DefaultAccServiceId:\r\n equipments.length > 0\r\n ? equipments.every(\r\n f =>\r\n f.DefaultAccServiceId === equipments[0].DefaultAccServiceId ?? -1,\r\n )\r\n ? equipments[0].DefaultAccServiceId || null\r\n : null\r\n : null,\r\n BudgetsTurnedOn: equipments.some(f => f.BudgetsTurnedOn === true),\r\n Billable: equipments.some(f => f.Billable === true),\r\n IsLoanDesc: equipments.some(f => f.LoanTypeId === 1),\r\n AllowModification: globalSettings.allowOngoingReservationModificationEnabled\r\n ? equipments\r\n .filter(f => f.NotAllowReservations === false)\r\n .every(f => f.AllowModification === true)\r\n : false,\r\n AllowExtendReservation: globalSettings.allowOngoingReservationModificationEnabled\r\n ? equipments\r\n .filter(f => f.NotAllowReservations === false)\r\n .every(f => f.AllowExtendReservation === true)\r\n : false,\r\n AllowUsersToShortenReservations: equipments.every(\r\n f => f.AllowUsersToShortenReservations === true,\r\n ),\r\n AllowedToTransfer: equipments.every(f => f.AllowedToTransfer === true),\r\n AllowedToTransferAll: equipments.every(\r\n f => f.AllowedToTransferAll === true,\r\n ),\r\n EnforceReservationRestrictions: equipments.every(\r\n f => f.EnforceReservationRestrictions === true,\r\n ),\r\n LimitlessReservationAllowed: equipments.every(\r\n f => f.LimitlessReservationAllowed === true,\r\n ),\r\n BudgetVisible: getBudgetVisible(\r\n globalSettings,\r\n equipments.map(service => ({\r\n Billable: service.Billable,\r\n BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n HideProjects: service.HideProjects,\r\n ServiceTypeId: ServiceType.Online,\r\n })),\r\n ),\r\n OfflineServiceTypes: combineOfflineServiceTypes(equipments),\r\n\r\n Groups:\r\n equipments.length > 0\r\n ? equipments\r\n .filter((item, index, arr) => {\r\n return (\r\n arr.findIndex(t => t.ServiceGroupId === item.ServiceGroupId) ===\r\n index\r\n );\r\n })\r\n .map(f => f.ServiceGroupId)\r\n : [],\r\n HasAccServices:\r\n equipments.length > 0 && equipments.some(f => f.AccServices?.length > 0),\r\n StaffUserVisibleAllways:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.StaffUserSelectionVisible === true),\r\n StaffUserVisibleOnPending:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.StaffUserSelectionVisible === false),\r\n StaffUserRequiredAlwais:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.StaffUserSelectionRequired === true),\r\n StaffUserRequiredOnPending:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.StaffUserSelectionRequired === false),\r\n StaffUserSelection:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.StaffUserSelection?.length > 0)\r\n ? equipments\r\n .filter(d => d.StaffUserSelection?.length > 0)\r\n .reduce((acc, next) => {\r\n return acc.concat(\r\n next.StaffUserSelection?.filter(\r\n f => !acc.some(c => c.Id === f.Id),\r\n ),\r\n );\r\n }, equipments.filter(d => d.StaffUserSelection?.length > 0)[0].StaffUserSelection)\r\n : [],\r\n RequireUserGroupCoordApproval:\r\n equipments.length > 0 &&\r\n equipments.some(f => f.RequireUserGroupCoordApproval === true),\r\n DraftForAll:\r\n equipments.length > 0 &&\r\n equipments.every(\r\n f =>\r\n f.DraftReservationsTypeId ===\r\n DraftReservationTypes.DraftReservationTypes_AllUser,\r\n ),\r\n DraftApprovalRequred:\r\n equipments.length > 0 &&\r\n equipments.every(\r\n f =>\r\n f.DraftReservationsTypeId ===\r\n DraftReservationTypes.DraftReservationTypes_ApprovalRequired,\r\n ),\r\n DraftSaveForLater:\r\n equipments.length > 0 &&\r\n equipments.every(\r\n f =>\r\n f.DraftReservationsTypeId ===\r\n DraftReservationTypes.DraftReservationTypes_SaveForLater,\r\n ),\r\n };\r\n const result = Object.assign({}, settings, p);\r\n return result;\r\n}\r\nexport function combineOptionalEquipments(\r\n services: IMandatoryEquipmentsDto[] | undefined,\r\n): IMandatoryEquipmentsDto[] | undefined {\r\n if (services === undefined) {\r\n return undefined;\r\n }\r\n return values(groupBy(services, f => f.Id)).map(f => {\r\n return f[0];\r\n });\r\n}\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n ReservationDetailsState,\r\n ReservationSettingsState,\r\n ReservationEquipment,\r\n CustomFormValueModel,\r\n ReservationUpdateModel,\r\n OfflineservicesModel,\r\n} from './types';\r\n\r\nexport function ConvertModelToUpdateEntity(\r\n original: ReservationDetailsState,\r\n current: ReservationDetailsState,\r\n settings: ReservationSettingsState | undefined,\r\n offlineServices: IOtherServices[],\r\n user: AuthenticatedUser | undefined,\r\n terminate?: boolean,\r\n) {\r\n let entity = {\r\n Id: original.Id,\r\n Services: current.EquipmentsData.map(item => {\r\n return {\r\n EquipmentId: item.Id,\r\n EquipmentName: item.Name,\r\n AccServiceIds:\r\n current.AccServices.length > 0\r\n ? current.AccServices.filter(\r\n a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n ).map(a => a.Id)\r\n : [],\r\n AssemblyId: null,\r\n ReservationId: original.Id,\r\n } as ReservationEquipment;\r\n }),\r\n StartTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(current.StartTime),\r\n ),\r\n EndTime: dateUtils.formatISO(dateUtils.dateOrStringToDate(current.EndTime)),\r\n Remarks: current.Remarks || null,\r\n SampleRunId: current.SampleRunId,\r\n SampleIds: current.SampleIds,\r\n BudgetId: current.Budget?.Id,\r\n BudgetExperimentId: current.BudgetExperiment?.Id,\r\n Collaborators: current.CollaboratedUsers.map(f => f.Id),\r\n ExternalCustomerId: current.ExternalCustomer?.Id,\r\n FundingTypeId: current.FundingType?.Id ?? 0,\r\n InstituteProjectId: current.InstituteProject?.Id,\r\n Name: current.DisplayName,\r\n PartialAttendance: current.PartialAttendance,\r\n PartialAttendanceStart: current.PartialAttendanceStart || null,\r\n PartialAttendanceEnd: current.PartialAttendanceEnd || null,\r\n Tutoring: current.Tutoring,\r\n FullDayReservation: current.FullDayReservation,\r\n Username: current.BookedBy?.Id,\r\n StaffUser: current.StaffUser?.Id,\r\n UserGroupId: current.ADGroup?.Id,\r\n TrainingSignUp: current.TrainingSignUp,\r\n TrainingSessionId: current.TrainingSession?.Id,\r\n PurchaseOrder: current.PurchaseOrder,\r\n Reference: current.Reference,\r\n Status: current.Status?.Id,\r\n TransferFromId: current.TransferFromId,\r\n UserRequestedByApproval: settings?.UserRequestedByApproval,\r\n TransferredTo: current.TransferredTo?.Id,\r\n WorkflowBooking: current.WorkflowBooking || null,\r\n RecurringUpdateOption: settings?.RecurringUpdateOption || 1,\r\n AllStartTimes: [],\r\n BudgetIds: [],\r\n OfflineServices: offlineServices.map(f => {\r\n return {\r\n OfflineServiceTypeId: f.ServiceTypeID,\r\n ServiceTypeName: f.ServiceType,\r\n UnitsName: f.Units,\r\n Factor: f.DiscountFactor,\r\n Quantity: f.Quantity,\r\n Remarks: f.Remarks,\r\n InventoryBatchId: f.InventoryBatchId,\r\n BudgetId: f.BudgetID,\r\n BudgetExperimentId: f.BudgetExperimentId,\r\n UserGroup: f.UserGroup,\r\n } as OfflineservicesModel;\r\n }),\r\n TransferInProgress: settings?.TransferInProgress,\r\n WaitingTransferApproval: current.WaitingTransferApproval,\r\n InsertedAt: settings?.Entered,\r\n InsertedBy: settings?.RecordDate,\r\n UpdatedAt: new Date(),\r\n UpdatedBy: user?.Id,\r\n CancelledAt: settings?.Cancelled,\r\n CustomFormValues: current.FormValues.map(f => {\r\n return {\r\n FieldId: f.FormFieldId,\r\n Value: f.Value,\r\n DisplayValue: f.DisplayValue,\r\n } as CustomFormValueModel;\r\n }),\r\n Parts: [],\r\n TutorName: settings?.TutorName,\r\n Terminated: terminate ?? false,\r\n TotalCost: settings?.TotalCost ?? 0,\r\n SavedForLater: settings?.SaveForLater,\r\n } as ReservationUpdateModel;\r\n return entity;\r\n}\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n ReservationGlobalState,\r\n ReservationEquipment,\r\n ReservationStatus,\r\n RecurringReservationUpdateOptions,\r\n ReservationBudgetModel,\r\n CustomFormValueModel,\r\n OfflineservicesModel,\r\n ReservationRepeatModel,\r\n ReservationInsertModel,\r\n} from './types';\r\n\r\nexport function ConvertModelToInsertEntity(\r\n state: ReservationGlobalState,\r\n user: AuthenticatedUser | undefined,\r\n) {\r\n const entity = {\r\n Id: state.details.Id,\r\n Services: state.details.EquipmentsData.map(item => {\r\n return {\r\n EquipmentId: item.Id,\r\n EquipmentName: item.Name,\r\n AccServiceIds:\r\n state.details.AccServices.length > 0\r\n ? state.details.AccServices.filter(\r\n a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n ).map(a => a.Id)\r\n : [],\r\n AssemblyId: null,\r\n ReservationId: state.details.Id,\r\n } as ReservationEquipment;\r\n }),\r\n StartTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n state.details.TrainingSession !== null\r\n ? (state.details.TrainingSession as ITrainingSessionDto).StartDate ??\r\n state.details.StartTime\r\n : state.details.StartTime,\r\n ),\r\n ),\r\n EndTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n state.details.TrainingSession !== null\r\n ? (state.details.TrainingSession as ITrainingSessionDto).EndDate ??\r\n state.details.EndTime\r\n : state.details.EndTime,\r\n ),\r\n ),\r\n Remarks: state.details.Remarks || null,\r\n SampleRunId: state.details.SampleRunId,\r\n BudgetId: state.details.Budget?.Id,\r\n BudgetExperimentId: state.details.BudgetExperiment?.Id,\r\n Collaborators: state.details.CollaboratedUsers.map(f => f.Id),\r\n ExternalCustomerId: state.details.ExternalCustomer?.Id,\r\n FundingTypeId: state.details.FundingType?.Id ?? 0,\r\n InstituteProjectId: state.details.InstituteProject?.Id,\r\n Name: state.details.DisplayName,\r\n PartialAttendance: state.details.PartialAttendance,\r\n PartialAttendanceStart: state.details.PartialAttendanceStart || null,\r\n PartialAttendanceEnd: state.details.PartialAttendanceEnd || null,\r\n Tutoring: state.details.Tutoring,\r\n FullDayReservation: state.details.FullDayReservation,\r\n Username: state.details.BookedBy?.Id,\r\n StaffUser: state.details.StaffUser?.Id,\r\n UserGroupId: state.details.ADGroup?.Id,\r\n TrainingSignUp: state.details.TrainingSignUp,\r\n TrainingSessionId: state.details.TrainingSession?.Id,\r\n PurchaseOrder: state.details.PurchaseOrder,\r\n Reference: state.details.Reference,\r\n Status: (state.details.Status?.Id || 1) as ReservationStatus,\r\n TransferFromId: state.details.TransferFromId,\r\n UserRequestedByApproval: state.settings.UserRequestedByApproval,\r\n TransferredTo: state.details.TransferredTo?.Id,\r\n WorkflowBooking: state.details.WorkflowBooking || null,\r\n RecurringUpdateOption: (state.settings.RecurringUpdateOption ||\r\n 1) as RecurringReservationUpdateOptions,\r\n AllStartTimes: [],\r\n BudgetIds: state.settings.PartReservations?.map(f => {\r\n return {\r\n id: f.BudgetID,\r\n text: f.BudgetName,\r\n ReservationId: f.Id,\r\n } as ReservationBudgetModel;\r\n }),\r\n TransferInProgress: false,\r\n WaitingTransferApproval: state.details.WaitingTransferApproval,\r\n InsertedAt: dateUtils.formatISO(new Date()),\r\n InsertedBy: user?.Id,\r\n UpdatedAt: dateUtils.formatISO(new Date()),\r\n UpdatedBy: user?.Id,\r\n CancelledAt: null,\r\n CustomFormValues: state.details.FormValues.map(f => {\r\n return {\r\n FieldId: f.FormFieldId,\r\n Value: f.Value,\r\n DisplayValue: f.DisplayValue,\r\n } as CustomFormValueModel;\r\n }),\r\n Parts: [],\r\n OfflineServices: state.offlineServices.map(f => {\r\n return {\r\n OfflineServiceTypeId: f.ServiceTypeID,\r\n ServiceTypeName: f.ServiceType,\r\n UnitsName: f.Units,\r\n Factor: f.DiscountFactor,\r\n Quantity: f.Quantity,\r\n Remarks: f.Remarks,\r\n InventoryBatchId: f.InventoryBatchId,\r\n BudgetId: f.BudgetID,\r\n BudgetExperimentId: f.BudgetExperimentId,\r\n UserGroup: f.UserGroup,\r\n } as OfflineservicesModel;\r\n }),\r\n TutorName: state.settings.TutorName,\r\n AssignToServiceRequestId: state.settings.AssignToServiceRequestId,\r\n AssignToServiceRequestRowIds: state.settings.AssignToServiceRequestRowIds,\r\n AssignToServiceRequestSampleIds:\r\n state.settings.AssignToServiceRequestSampleIds,\r\n Repeat:\r\n state?.RepetitiveOptions?.RecurringEvents?.Id &&\r\n state?.RepetitiveOptions?.RecurringEvents?.Id !==\r\n (RepetitiveOptions.DoNotRepeat as number)\r\n ? ({\r\n RepeatsEveryType: state.RepetitiveOptions?.RepeatsEveryPeriod?.Id,\r\n RepeatsEveryNum: state.RepetitiveOptions?.RepeatsEveryDay?.Id,\r\n RepeatEndTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n state.RepetitiveOptions?.RecurringEndDate ??\r\n dateUtils.addDays(new Date(), 7),\r\n ),\r\n ),\r\n RepeatOption: state.RepetitiveOptions?.RecurringEvents?.Id || 0,\r\n Repeat_Period: state.settings.Repeat_Period,\r\n RepeatsBy: state.RepetitiveOptions?.RepeatsMonthlyBy?.Id,\r\n RepeatsOn: state.RepetitiveOptions?.RepeatsOnDays.filter(\r\n d => d.checked === true,\r\n ).map(f => f.Id),\r\n } as ReservationRepeatModel)\r\n : null,\r\n Terminated: false,\r\n TotalCost: state.settings.TotalCost ?? 0,\r\n SavedForLater: state.settings.SaveForLater,\r\n } as ReservationInsertModel;\r\n if ((state.settings.MandatoriesEquipments?.length ?? 0) > 0) {\r\n entity.Services = [\r\n ...entity.Services,\r\n ...state.settings.MandatoriesEquipments.map(item => {\r\n return {\r\n EquipmentId: item.Id,\r\n EquipmentName: item.Name,\r\n AccServiceIds:\r\n state.details.AccServices.length > 0\r\n ? state.details.AccServices.filter(\r\n a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n ).map(a => a.Id)\r\n : [],\r\n } as ReservationEquipment;\r\n }),\r\n ];\r\n }\r\n if ((state.details.OptionalsEquipments?.length ?? 0) > 0) {\r\n if (state.details.OptionalsEquipments.some(f => f.checked === true)) {\r\n entity.Services = [\r\n ...entity.Services,\r\n ...state.details.OptionalsEquipments.filter(\r\n f => f.checked === true,\r\n ).map(item => {\r\n return {\r\n EquipmentId: item.Id,\r\n EquipmentName: item.Name,\r\n AccServiceIds:\r\n state.details.AccServices.length > 0\r\n ? state.details.AccServices.filter(\r\n a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n ).map(a => a.Id)\r\n : [],\r\n } as ReservationEquipment;\r\n }),\r\n ];\r\n }\r\n }\r\n return entity;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n fork,\r\n call,\r\n put,\r\n take,\r\n select,\r\n takeLatest,\r\n takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { reservationActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { ReservationsApi as api } from 'api/ReservationsApi';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n EquipmentsChangeStateParameters,\r\n IMandatoryEquipmentsDto,\r\n IReservationDto,\r\n IReservationEquipmentDto,\r\n ReservationDetailsResponseModel,\r\n ReservationDetailsState,\r\n ReservationEquipmentsChangeResult,\r\n ReservationInsertModel,\r\n ReservationQueryStringParameters,\r\n ReservationSettingsState,\r\n ReservationUpdateModel,\r\n ServiceSettingsState,\r\n TransferToReservation,\r\n UserTrainingReservationData,\r\n} from './types';\r\nimport { mapSettingsFromServices } from './mapSettingsFromServices';\r\nimport { ConvertModelToUpdateEntity } from './ConvertModelToUpdateEntity';\r\nimport { ConvertModelToInsertEntity } from './ConvertModelToInsertEntity';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectGlobalSettingBool,\r\n selectOffsetDate,\r\n selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { ReservationDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { FileTypes } from 'api/odata/generated/enums/FileTypes';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileStoreApi } from 'api/fileStoreApi';\r\nimport { getFilesModel, UpdateFilesModel } from 'utils/fileStoreHelper';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { Entity } from 'types/common';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n selectCloneReservations,\r\n selectReservationDtoState,\r\n} from './selectors';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { ConsumableServicesResponse } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { tryParseBool, tryParseInt } from 'utils/string-utils';\r\nimport { repetitiveActions } from 'app/components/Forms/FormRepetitive/slice';\r\nimport { newDate } from '../components/utils';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { CreateReservationActionPayloadType } from './CreateReservationActionPayloadType';\r\nimport { UpdateReservationActionPayloadType } from './UpdateReservationActionPayloadType';\r\nimport { GetIsNotBillable } from './getBudgetVisible';\r\nimport { ServiceType } from 'api/odata/generated/enums/ServiceType';\r\n\r\nfunction* doInitReservation(\r\n action: PayloadAction<{\r\n query: ReservationQueryStringParameters;\r\n globalSettings: GlobalSettingsType;\r\n prevState?: ReservationDetailsState;\r\n }>,\r\n) {\r\n try {\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n if (action.payload.query.id !== undefined) {\r\n yield* doInitReservationEdit({\r\n type: action.type,\r\n payload: {\r\n id: parseInt(action.payload.query.id),\r\n globalSettings: action.payload.globalSettings,\r\n UpdateToNow: tryParseBool(action.payload.query.UpdateToNow) ?? false,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n const result = yield call(api.initReservation, action.payload.query);\r\n console.debug('reseration result: ', result);\r\n let isChange = action.payload.query.resourceChanged === 'true';\r\n let response = result as ReservationDetailsResponseModel;\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: 'initReservationSucc',\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n let equipments =\r\n response.model.EquipmentsData.length > 0\r\n ? response.model.EquipmentsData\r\n : !!response.model.BaseEquipment\r\n ? [response.model.BaseEquipment]\r\n : [];\r\n if (equipments.length > 0) {\r\n yield put(\r\n actions.extendEquipmentSettingsState({\r\n equipments: equipments,\r\n mandatories: response.model.MandatoriesEquipments,\r\n accServices: response.model.AccServices,\r\n globalSettings: action.payload.globalSettings,\r\n settings: {} as ServiceSettingsState,\r\n }),\r\n );\r\n }\r\n if (!isChange) {\r\n if (action.payload.query.Start !== undefined) {\r\n response.model.StartTime = dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(action.payload.query.Start),\r\n {\r\n format: 'basic',\r\n representation: 'complete',\r\n },\r\n );\r\n // dateUtils.formatQueryStringDate(\r\n // dateUtils.parseISO(action.payload.query.Start),\r\n // );\r\n }\r\n if (action.payload.query.End !== undefined) {\r\n response.model.EndTime = dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(action.payload.query.End),\r\n {\r\n format: 'basic',\r\n representation: 'complete',\r\n },\r\n );\r\n // dateUtils.formatQueryStringDate(\r\n // dateUtils.parseISO(action.payload.query.End),\r\n // );\r\n }\r\n // copy query options to the model\r\n if (action.payload.query.id === undefined) {\r\n // set reservation's sample run id to requested value so that it will be later sent to the server during reservation insert\r\n const sampleRunId = tryParseInt(action.payload.query.sampleRunId);\r\n if (sampleRunId !== undefined) {\r\n response.model.SampleRunId = sampleRunId;\r\n }\r\n }\r\n }\r\n\r\n yield put(\r\n actions.initReservation_Success({\r\n hasErrors: response.ErrorMessages.length > 0,\r\n model: response.model,\r\n isChanged: isChange,\r\n isEdit: response.model.Id > 0,\r\n globalSettings: action.payload.globalSettings,\r\n userTrainigData: response.userTrainingsApprovalData,\r\n }),\r\n );\r\n if (equipments.length > 0 && !(response.model.Id > 0)) {\r\n let allEquipments = [\r\n ...response.model.EquipmentsData,\r\n ...((response.model.MandatoriesEquipments as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ];\r\n const parameters: EquipmentsChangeStateParameters = {\r\n AccServices:\r\n response.model.AccServices.length > 0\r\n ? response.model.AccServices.map(f => f.Id)\r\n : [],\r\n Equipments: allEquipments.map(f => f.Id),\r\n ReservationId: (response.model.Id ?? 0) > 0 ? response.model.Id : null,\r\n Start:\r\n // preserve requested start time\r\n dateUtils.tryFormatIso(action.payload.query.Start) ??\r\n // use the server value if time was not requested\r\n dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(response.model.StartTime),\r\n { representation: 'complete' },\r\n ),\r\n End:\r\n // preserve requested end time\r\n dateUtils.tryFormatIso(action.payload.query.End) ??\r\n // use the server value if time was not requested\r\n dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(response.model.EndTime),\r\n { representation: 'complete' },\r\n ),\r\n BookedBy: response.model.BookedBy?.Id || user?.Id || null,\r\n Status: response.model.StatusId,\r\n TrainingSignUp: response.model.TrainingSignUp,\r\n Tutoring: response.model.Tutoring,\r\n ADGroup:\r\n response.model.ADGroup?.Id || user?.ActiveUserGroup?.Id || null,\r\n FundingTypeId: response.model.FundingTypeId || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: response.model.TrainingSession?.Id || null,\r\n Remarks: response.model.Remarks || null,\r\n BudgetId:\r\n response.model.Budget?.Id ||\r\n (isChange &&\r\n !!action.payload.prevState &&\r\n !!action.payload.prevState.Budget)\r\n ? action.payload?.prevState?.Budget?.Id ?? null\r\n : action.payload.query.bid ?? null,\r\n CheckSession: false,\r\n FullDayReservation: response.model.FullDayReservation,\r\n } as EquipmentsChangeStateParameters;\r\n yield put(\r\n actions.initValidationData({\r\n parameters: parameters,\r\n warnings: response.WarningMessages,\r\n errors: response.ErrorMessages,\r\n }),\r\n );\r\n }\r\n } catch (error: unknown) {\r\n yield put(actions.initReservation_Error(error));\r\n }\r\n}\r\nfunction* doInitReservationEdit(\r\n action: PayloadAction<{\r\n id: number;\r\n globalSettings: GlobalSettingsType;\r\n UpdateToNow: boolean;\r\n }>,\r\n) {\r\n try {\r\n var s: AppSettings = yield select(selectAppSettings);\r\n\r\n const AllowWorkflowBooking = yield select(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.AllowWorkflowBooking),\r\n );\r\n const expand: Array = [\r\n action.payload.globalSettings.budgetModuleEnabled && 'Budget',\r\n action.payload.globalSettings.trainingSessionEnabled && 'TrainingSession',\r\n 'StaffUser',\r\n 'BookedBy',\r\n 'ADGroup',\r\n action.payload.globalSettings.instituteProjectsEnabled &&\r\n 'InstituteProject',\r\n // 'WorkflowBooking',\r\n //ExternalCustomer\r\n action.payload.globalSettings.budgetExperimentModuleEnabled &&\r\n 'BudgetExperiment',\r\n 'TransferredTo',\r\n !action.payload.globalSettings.hideReservationCollaborators &&\r\n 'CollaboratedUsers',\r\n s.Modules.includes(KnownModules.SamplesAutomation) && 'SampleIds',\r\n 'LastUpdateAdmin',\r\n 'FormValues',\r\n action.payload.globalSettings.accServicesEnabled && 'AccServices',\r\n //'BaseEquipment',\r\n `EquipmentsData($expand=${[\r\n action.payload.globalSettings.accServicesEnabled && 'AccServices',\r\n 'OfflineServices',\r\n 'CustomForms',\r\n 'StaffUserSelection',\r\n ]\r\n .filter(f => typeof f === 'string')\r\n .join(',')})`,\r\n AllowWorkflowBooking && 'WorkflowBooking',\r\n ];\r\n const result: IReservationDto = yield call(\r\n api.getReservation,\r\n action.payload.id,\r\n {\r\n $expand: expand.filter(f => typeof f === 'string').join(','),\r\n },\r\n );\r\n console.debug('reseration result: ', result);\r\n\r\n result.TerminateReservation = action.payload.UpdateToNow;\r\n if (result.TerminateReservation) {\r\n result.EndTime = dateUtils.formatISO(newDate(null));\r\n }\r\n\r\n result.OfflineMandatory = [];\r\n\r\n yield put(\r\n actions.initReservation_Success({\r\n hasErrors: false,\r\n model: result,\r\n isChanged: false,\r\n isEdit: true,\r\n globalSettings: action.payload.globalSettings,\r\n userTrainigData: null,\r\n }),\r\n );\r\n\r\n const equipments: IReservationEquipmentDto[] =\r\n result.EquipmentsData.length > 0\r\n ? result.EquipmentsData\r\n : !!result.BaseEquipment\r\n ? [result.BaseEquipment]\r\n : [];\r\n if (equipments.length > 0) {\r\n yield put(\r\n actions.extendEquipmentSettingsState({\r\n equipments: equipments,\r\n mandatories: result.MandatoriesEquipments ?? [],\r\n accServices: result.AccServices ?? [],\r\n globalSettings: action.payload.globalSettings,\r\n settings: {} as ServiceSettingsState,\r\n }),\r\n );\r\n }\r\n\r\n // if (\r\n // action.payload.globalSettings.accServicesEnabled &&\r\n // (result.AccServiceId !== null ||\r\n // !isEmptyOrWhitespace(result.AccServiceId))\r\n // ) {\r\n // try {\r\n // var AccServices: Array = yield call(\r\n // getReservationProperty,\r\n // result.Id,\r\n // 'AccServices',\r\n // );\r\n // if (AccServices.length > 0) {\r\n // yield put(\r\n // actions.setAnyValue({\r\n // fieldKey: 'AccServices',\r\n // fieldValue: AccServices,\r\n // }),\r\n // );\r\n // yield put(\r\n // actions.extendEquipmentSettingsState({\r\n // equipments: equipments,\r\n // mandatories: result.MandatoriesEquipments ?? [],\r\n // accServices: result.AccServices ?? [],\r\n // globalSettings: action.payload.globalSettings,\r\n // settings: {} as ServiceSettingsState,\r\n // }),\r\n // );\r\n // }\r\n // } catch (error) {\r\n // console.error(error);\r\n // }\r\n // }\r\n try {\r\n if (result.BookedBy !== null) {\r\n const userTrainingEquipments = yield call(\r\n api.getReservationUserTrainingEquipments,\r\n result.Id,\r\n );\r\n const trainingsData: UserTrainingReservationData = {\r\n StartTime: result.StartTime,\r\n EndTime: result.EndTime,\r\n FatherId: result.FatherId,\r\n ReservationId: result.Id,\r\n Tutoring: result.Tutoring,\r\n UserName: result.BookedBy.Id,\r\n Equipments: userTrainingEquipments.value,\r\n };\r\n yield put(actions.setTrainingsData(trainingsData));\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n\r\n if (s.Modules.includes(KnownModules.OfflineServices)) {\r\n yield fork(doInitReservationEdit_Load_OfflineMandatory, result);\r\n }\r\n } catch (error: unknown) {\r\n console.error(error);\r\n if ((error as AxiosError)?.response?.status === 404) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'reservationInit',\r\n message: 'Reservation Not Found',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n yield put(actions.initReservation_Error(error));\r\n }\r\n\r\n function* doInitReservationEdit_Load_OfflineMandatory(\r\n result: IReservationDto,\r\n ) {\r\n try {\r\n var OfflineMandatory = yield call(\r\n getReservationProperty,\r\n result.Id,\r\n 'OfflineMandatory',\r\n );\r\n yield put(\r\n actions.extendReservationSettings({\r\n OfflineMandatory: OfflineMandatory,\r\n }),\r\n );\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n}\r\n\r\nfunction* getReservationProperty(\r\n result: number,\r\n fieldName: keyof IReservationDto,\r\n) {\r\n return yield call(\r\n httpClient.get,\r\n `/api/odata/v4/reservations/${result}/${fieldName}`,\r\n );\r\n}\r\nfunction* selectConfirmPricingEnabled(\r\n action: PayloadAction,\r\n) {\r\n const confirmPricingEnabled = yield select(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.ConfirmPricing),\r\n );\r\n const budgetModuleEnabled = yield select(state =>\r\n selectKnownModule(state, KnownModules.Budgets),\r\n );\r\n const priceSheetPricing = yield select(state =>\r\n selectKnownModule(state, KnownModules.PriceSheetPricing),\r\n );\r\n const billingModuleEnabled = yield select(state =>\r\n selectKnownModule(state, KnownModules.Billing),\r\n );\r\n const x = (action.payload.state.details\r\n .EquipmentsData as IReservationEquipmentDto[])?.map(\r\n (f: IReservationEquipmentDto) => ({\r\n HideProjects: f.HideProjects,\r\n BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n Billable: f.Billable,\r\n ServiceTypeId: ServiceType.Online,\r\n }),\r\n );\r\n var result =\r\n GetIsNotBillable(\r\n {\r\n billingModuleEnabled: billingModuleEnabled,\r\n priceSheetPricing: priceSheetPricing,\r\n budgetModuleEnabled: budgetModuleEnabled,\r\n },\r\n x,\r\n ) ?? confirmPricingEnabled;\r\n return result;\r\n}\r\n/**\r\n * Handles create reservation request. \"CalculateCredit\" also bundled inside.\r\n * @param action\r\n * @returns\r\n */\r\nfunction* doCreateReservation(\r\n action: PayloadAction,\r\n) {\r\n // caluclate credit requests also go through here\r\n if (action.payload.calcCredit !== true) {\r\n const confirmPricingEnabled = yield selectConfirmPricingEnabled(action);\r\n if (confirmPricingEnabled) {\r\n yield put(actions.showConfirmPricing(true));\r\n yield put(\r\n actions.createReservationInternal({\r\n ...action.payload,\r\n calcCredit: true,\r\n }),\r\n );\r\n\r\n const confirmAction = yield take(actions.сonfirmPricing.type);\r\n const confirm = confirmAction.payload === true;\r\n if (confirm !== true) {\r\n return;\r\n }\r\n }\r\n }\r\n yield put(actions.createReservationInternal(action.payload));\r\n yield take([\r\n actions.createReservation_Success,\r\n actions.createReservation_Error,\r\n actions.initReservation,\r\n ]);\r\n yield put(actions.showConfirmPricing(false));\r\n}\r\n\r\nfunction* doCreateReservationInternal(\r\n action: PayloadAction,\r\n) {\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const newDate = yield select(state => selectOffsetDate(state, new Date()));\r\n const isCloned = yield select(selectCloneReservations);\r\n const httpPayloads: ReservationInsertModel = ConvertModelToInsertEntity(\r\n action.payload.state,\r\n user,\r\n );\r\n if (action.payload.calcCredit === true) {\r\n httpPayloads.Remarks = 'CalculateCredit';\r\n }\r\n const customFormFiles = action.payload.state.customFormFiles;\r\n try {\r\n const result = yield call(api.insertReservation, httpPayloads);\r\n let response = result as ReservationDetailsResponseModel;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length === 0 && !action.payload.calcCredit) {\r\n if (customFormFiles.length > 0) {\r\n let data = getFilesModel(\r\n [],\r\n customFormFiles,\r\n FileTypes.ReservationFile,\r\n response.Id || -1,\r\n CustomFormTypeEnum.Reservation,\r\n httpPayloads.RecurringUpdateOption,\r\n null,\r\n null,\r\n null,\r\n );\r\n const fileRes = yield call(FileStoreApi.saveFormFiles, data);\r\n let fileResponse = fileRes as IResponseType;\r\n if (fileResponse.ErrorMessages.length > 0) {\r\n responseErrors = [...responseErrors, ...fileResponse.ErrorMessages];\r\n }\r\n }\r\n }\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors\r\n .filter((value, index, self) => self.indexOf(value) === index)\r\n .map(item => {\r\n return {\r\n key: 'reservationInsertError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n if (isCloned) {\r\n yield put(actions.setCloneReservation(false));\r\n }\r\n if (action.payload.calcCredit) {\r\n yield put(\r\n actions.caluclateCredit_Success({ credit: 0, balance: null }),\r\n );\r\n }\r\n } else {\r\n if (action.payload.calcCredit) {\r\n yield put(\r\n actions.caluclateCredit_Success({\r\n credit: response.credit ?? 0,\r\n balance: response.balance,\r\n }),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: responseSuccess[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'reservationInsertSuccess',\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.ReservationDetails),\r\n detailsType: RenderPageType.ReservationDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n } as ReservationDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: 'reservationInsertWarning',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.warnOnTrainingSession) {\r\n let linkUrl = `/trainingsessions?eqid=${response.FirstEquipmentId}&nextonly=true`;\r\n let linkText = i18next.t(translations.ClickHere) as string;\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'warnOnTrainingSession',\r\n persist: true,\r\n message: '',\r\n messageType: SnackBarMessageType.showLinkMessage,\r\n messageTypeProps: {\r\n Id: 0,\r\n created: true,\r\n itemName: i18next.t(translations.UpcomingTrainingSessions),\r\n linkUrl: linkUrl,\r\n linkText: linkText,\r\n afterLinkText: i18next.t(\r\n translations.res_futureTrainingSession_LinkTitle,\r\n ),\r\n detailsType: undefined,\r\n detailsTypeProps: undefined,\r\n },\r\n variant: 'warning',\r\n }),\r\n );\r\n }\r\n yield put(\r\n repetitiveActions.resetState(\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n ),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n if (!action.payload.calcCredit) {\r\n let hasErrors = responseErrors.length > 0;\r\n if (!isCloned) {\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n }\r\n\r\n yield put(\r\n actions.createReservation_Success({\r\n hasErrors: hasErrors,\r\n reservationIds: response.ReservationIds,\r\n insertModel: response.insertedModel,\r\n }),\r\n );\r\n }\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'reservationInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createReservation_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doUpdateReservation(\r\n action: PayloadAction,\r\n) {\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const isCloned = yield select(selectCloneReservations);\r\n const reservationDto = yield select(selectReservationDtoState);\r\n const reccurentUpdateOption =\r\n action.payload.settings?.RecurringUpdateOption || 1;\r\n const httpPayloads: ReservationUpdateModel = ConvertModelToUpdateEntity(\r\n action.payload.original,\r\n action.payload.current,\r\n action.payload.settings,\r\n action.payload.offlineServices,\r\n user,\r\n action.payload.terminate,\r\n );\r\n let filesData: UpdateFilesModel[] = [];\r\n if (\r\n action.payload.originalCustomFormFiles.length > 0 ||\r\n action.payload.currentCustomFormFiles.length > 0\r\n ) {\r\n filesData = getFilesModel(\r\n action.payload.originalCustomFormFiles,\r\n action.payload.currentCustomFormFiles,\r\n FileTypes.ReservationFile,\r\n action.payload.current.Id,\r\n CustomFormTypeEnum.Reservation,\r\n reccurentUpdateOption,\r\n null,\r\n null,\r\n null,\r\n );\r\n }\r\n try {\r\n const results = yield call(api.updateReservation, httpPayloads);\r\n let response = results as ReservationDetailsResponseModel;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length === 0) {\r\n if (filesData.length > 0) {\r\n let fileRes = yield call(FileStoreApi.updateFormFiles, filesData);\r\n let fileResponses = fileRes as IResponseType;\r\n if (fileResponses.ErrorMessages.length > 0) {\r\n respErrors = [...respErrors, ...fileResponses.ErrorMessages];\r\n }\r\n }\r\n }\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'reservationUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n if (isCloned) {\r\n yield put(actions.setCloneReservation(false));\r\n }\r\n if (action.payload.terminate) {\r\n yield put(actions.terminateReservation_error());\r\n }\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'reservationUpdateSuccess',\r\n message:\r\n action.payload.terminate === true\r\n ? i18next.t(translations.Succes_ReservationTerminated)\r\n : response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.ReservationDetails),\r\n detailsType: RenderPageType.ReservationDetails,\r\n itemEndName: action.payload.terminate\r\n ? ' end time updated'\r\n : undefined,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id,\r\n },\r\n } as ReservationDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n if (action.payload.terminate === true) {\r\n yield call(api.sendTerminateNotification, response.ReservationIds);\r\n yield put(actions.terminateReservation_success());\r\n }\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'reservationUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.userTrainingsApprovalData === null) {\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n if (\r\n action.payload.offlineServices.length > 0 &&\r\n action.payload.offlineServices.some(f => f.Id < 1)\r\n ) {\r\n const offRes = yield call(\r\n OtherServicesApi.insertConsumableServices,\r\n action.payload.offlineServices.filter(f => f.Id < 1),\r\n );\r\n let offResponse = offRes as ConsumableServicesResponse;\r\n let offErrors = offResponse.ErrorMessages;\r\n let offWarnings = offResponse.WarningMessages;\r\n if (offErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n offErrors.map(item => {\r\n return {\r\n key: 'serviceInsertError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (offWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n offWarnings.map(item => {\r\n return {\r\n key: 'serviceInsertWarning',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n }\r\n }\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n\r\n if (isCloned) {\r\n yield put(\r\n actions.initClonedReservation_Success({\r\n model: reservationDto,\r\n reservation: action.payload.current,\r\n settings: action.payload.settings,\r\n }),\r\n );\r\n }\r\n yield put(\r\n actions.updateReservation_Success({\r\n hasErrors: hasErrors,\r\n userTrainigData: response.userTrainingsApprovalData,\r\n insertModel: response.insertedModel,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'reservationUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateReservation_Error(Error));\r\n if (action.payload.terminate) {\r\n yield put(actions.terminateReservation_error());\r\n }\r\n }\r\n}\r\nfunction* doUpdateSettigs(action: PayloadAction) {\r\n yield put(actions.updateReservationSettings(action.payload));\r\n}\r\nfunction* doUpdateEquipmentSettigs(\r\n action: PayloadAction<{\r\n equipments: IReservationEquipmentDto[];\r\n mandatories: IMandatoryEquipmentsDto[];\r\n accServices: IEquipmentAccServiceDto[];\r\n globalSettings: GlobalSettingsType;\r\n settings?: ServiceSettingsState;\r\n }>,\r\n) {\r\n try {\r\n let allEquipments = [\r\n ...action.payload.equipments,\r\n ...((action.payload.mandatories as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ];\r\n const authenticatedUser = yield select(selectAuthenticatedUser);\r\n let newSettings = mapSettingsFromServices(\r\n allEquipments,\r\n action.payload.accServices,\r\n action.payload.globalSettings,\r\n authenticatedUser,\r\n action.payload.settings,\r\n );\r\n yield put(actions.updateEquipmentSettingsState(newSettings));\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\nfunction* doLoadValidationData(\r\n action: PayloadAction<{\r\n parameters: EquipmentsChangeStateParameters;\r\n warnings: string[];\r\n errors: string[];\r\n }>,\r\n) {\r\n try {\r\n let res = yield call(\r\n api.getEquipmentsChangeState,\r\n action.payload.parameters,\r\n );\r\n let response = res as ReservationEquipmentsChangeResult;\r\n if (!!response?.CustomForms) {\r\n if (response?.CustomForms?.IsValid) {\r\n yield put(\r\n actions.extendReservationSettings({\r\n CustomForms: response.CustomForms.CustomForms || [],\r\n }),\r\n );\r\n }\r\n }\r\n if (!!response.StatusChange && response.StatusChange !== null) {\r\n yield put(\r\n actions.extendReservationSettings({\r\n IsForceTutoring: response.StatusChange.IsForceTutoring,\r\n }),\r\n );\r\n }\r\n response.WarningMessages = [\r\n ...response.WarningMessages,\r\n ...action.payload.warnings,\r\n ];\r\n response.ErrorMessages = [\r\n ...response.ErrorMessages,\r\n ...action.payload.errors,\r\n ];\r\n yield put(actions.initValidationData_Success(response));\r\n } catch (error: unknown) {\r\n yield put(actions.initValidationData_Error());\r\n }\r\n}\r\nfunction* doSetStart(action: PayloadAction) {\r\n yield put(\r\n actions.setStartSuccess(\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(action.payload), {\r\n format: 'basic',\r\n representation: 'complete',\r\n }),\r\n //dateUtils.formatQueryStringDate(dateUtils.parseISO(action.payload)),\r\n ),\r\n );\r\n}\r\nfunction* doSetEnd(action: PayloadAction) {\r\n yield put(\r\n actions.setEndSuccess(\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(action.payload), {\r\n format: 'basic',\r\n representation: 'complete',\r\n }),\r\n //dateUtils.formatQueryStringDate(dateUtils.parseISO(action.payload)),\r\n ),\r\n );\r\n}\r\nfunction* doSetAny(\r\n action: PayloadAction<{\r\n fieldKey: keyof ReservationDetailsState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doTransferReservation(action: PayloadAction) {\r\n try {\r\n let res = yield call(api.transferReservation, action.payload);\r\n let response = res as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'transferError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n yield put(actions.transferReservation_Error(response.ErrorMessages[0]));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'transferSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield* doSetAny({\r\n payload: {\r\n fieldKey: 'WaitingTransferApproval',\r\n fieldValue: true,\r\n },\r\n type: action.type,\r\n });\r\n yield* doSetAny({\r\n payload: {\r\n fieldKey: 'TransferredTo',\r\n fieldValue: action.payload.User,\r\n },\r\n type: action.type,\r\n });\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n yield put(actions.transferReservation_Success(action.payload));\r\n yield call(api.sendTransferNotification, action.payload);\r\n }\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'transferError',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.transferReservation_Error(Error));\r\n }\r\n}\r\nfunction* doCancelTransferReservation(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n let res = yield call(\r\n api.cancelTransferReservation,\r\n action.payload.ReservtionId,\r\n );\r\n let response = res as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'transferError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n yield put(actions.cancelTransfer_Error(response.ErrorMessages[0]));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'transferSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield* doSetAny({\r\n payload: {\r\n fieldKey: 'WaitingTransferApproval',\r\n fieldValue: false,\r\n },\r\n type: action.type,\r\n });\r\n yield* doSetAny({\r\n payload: {\r\n fieldKey: 'TransferredTo',\r\n fieldValue: null,\r\n },\r\n type: action.type,\r\n });\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n yield put(actions.cancelTransfer_Success());\r\n yield call(api.sendCancelTransferNotification, action.payload);\r\n }\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'transferError',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.cancelTransfer_Error(Error));\r\n }\r\n}\r\nfunction* doTerminateReservation(\r\n action: PayloadAction<{\r\n current: ReservationDetailsState;\r\n original: ReservationDetailsState;\r\n currentCustomFormFiles: IFormFileValue[];\r\n originalCustomFormFiles: IFormFileValue[];\r\n settings: ReservationSettingsState | undefined;\r\n }>,\r\n) {\r\n yield* doUpdateReservation({\r\n payload: {\r\n current: action.payload.current,\r\n original: action.payload.original,\r\n currentCustomFormFiles: action.payload.currentCustomFormFiles,\r\n originalCustomFormFiles: action.payload.originalCustomFormFiles,\r\n offlineServices: [],\r\n settings: action.payload.settings,\r\n terminate: true,\r\n },\r\n type: action.type,\r\n });\r\n}\r\nexport function* reservationSaga() {\r\n yield takeLeading(actions.initReservation.type, doInitReservation);\r\n yield takeLatest(actions.createReservation.type, doCreateReservation);\r\n yield takeLatest(\r\n actions.createReservationInternal.type,\r\n doCreateReservationInternal,\r\n );\r\n yield takeLatest(actions.updateReservation.type, doUpdateReservation);\r\n yield takeLatest(actions.extendReservationSettings.type, doUpdateSettigs);\r\n yield takeLatest(\r\n actions.extendEquipmentSettingsState.type,\r\n doUpdateEquipmentSettigs,\r\n );\r\n yield takeLatest(actions.initValidationData.type, doLoadValidationData);\r\n yield takeLatest(actions.setStartDate.type, doSetStart);\r\n yield takeLatest(actions.setEndDate.type, doSetEnd);\r\n yield takeLatest(actions.setAnyValue.type, doSetAny);\r\n yield takeLatest(actions.transferReservation.type, doTransferReservation);\r\n yield takeLatest(actions.cancelTransfer.type, doCancelTransferReservation);\r\n yield takeLatest(actions.terminateReservation.type, doTerminateReservation);\r\n}\r\n","import { IReservationEquipmentDto } from './types';\r\n\r\nexport function TryDisableRemoveableEquipments(\r\n equipments: IReservationEquipmentDto[],\r\n condition: (item: IReservationEquipmentDto) => boolean,\r\n title?: string,\r\n): IReservationEquipmentDto[] {\r\n let disabled = equipments\r\n .filter(f => condition(f) === true)\r\n .map(f =>\r\n Object.assign({}, f, {\r\n noremoved: true,\r\n titleInfo: title,\r\n }),\r\n );\r\n let other = equipments.filter(f => condition(f) === false);\r\n return [...disabled, ...other];\r\n}\r\n","import { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { generateTrainingSessionName } from 'app/components/pickers/AutocompletePickers/TrainingSessionPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { Entity } from 'types/common';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { combineOptionalEquipments } from './mapSettingsFromServices';\r\nimport { TryDisableRemoveableEquipments } from './TryDisableRemoveableEquipments';\r\nimport {\r\n IReservationDto,\r\n getSingleReservationStatus,\r\n ReservationDetailsState,\r\n} from './types';\r\n\r\nexport function ConvertDtoToModel(\r\n dto: IReservationDto,\r\n globalSettings?: GlobalSettingsType,\r\n) {\r\n let equipments =\r\n dto.EquipmentsData.length > 0\r\n ? dto.EquipmentsData\r\n : dto.BaseEquipment === null\r\n ? []\r\n : [dto.BaseEquipment];\r\n if (dto.Id > 0) {\r\n if (dto.StaffMandatoryEquipment !== null) {\r\n equipments = TryDisableRemoveableEquipments(\r\n equipments,\r\n f => f.Id === dto.StaffMandatoryEquipment?.Id,\r\n `Mandatory instrument for ${dto.StaffUser?.Name}`,\r\n );\r\n }\r\n if (!globalSettings?.allowToRemoveFromMultipleReservation) {\r\n equipments = TryDisableRemoveableEquipments(\r\n equipments,\r\n f => f.Id > 0,\r\n `Not removeable service`,\r\n );\r\n }\r\n }\r\n let model: ReservationDetailsState = {\r\n Id: dto.Id,\r\n FatherId: dto.FatherId,\r\n BookedBy: (dto.BookedBy as Entity) || null,\r\n AccServices: (dto.AccServices as Entity[]) || [],\r\n Budget: (dto.Budget as Entity) || null,\r\n CollaboratedUsers: (dto.CollaboratedUsers as Entity[]) || [],\r\n EndTime: dto.EndTime,\r\n EquipmentsData: equipments as Entity[],\r\n FormValues: dto.FormValues,\r\n InstituteProject: (dto.InstituteProject as Entity) || null,\r\n PartialAttendance: dto.PartialAttendance,\r\n SampleIds: dto.SampleIds,\r\n StaffUser: (dto.StaffUser as Entity) || null,\r\n StartTime: dto.StartTime,\r\n TrainingSession:\r\n dto.TrainingSession === null\r\n ? null\r\n : generateTrainingSessionName(dto.TrainingSession),\r\n TrainingSignUp: dto.TrainingSignUp,\r\n TransferredTo: (dto.TransferredTo as Entity) || null,\r\n WaitingTransferApproval: dto.WaitingTransferApproval,\r\n TransferFromId: dto.TransferFromId,\r\n Tutoring: dto.Tutoring,\r\n FullDayReservation: dto.FullDayReservation,\r\n ADGroup: (dto.ADGroup as Entity) || null,\r\n BudgetExperiment: (dto.BudgetExperiment as Entity) || null,\r\n DisplayName: dto.DisplayName,\r\n ExternalCustomer: (dto.ExternalCustomer as Entity) || null,\r\n FundingType: getSingleInvoiceFundingType(dto.FundingTypeId || 0),\r\n PartialAttendanceEnd: dto.PartialAttendanceEnd,\r\n PartialAttendanceStart: dto.PartialAttendanceStart,\r\n PurchaseOrder: dto.PurchaseOrder,\r\n Reference: dto.Reference,\r\n Remarks: dto.Remarks,\r\n SampleRunId: dto.SampleRunId,\r\n Status: getSingleReservationStatus(dto.StatusId),\r\n WorkflowBooking: (dto.WorkflowBooking as Entity) || null,\r\n OptionalsEquipments: (\r\n combineOptionalEquipments(dto.OptionalsEquipments) ?? []\r\n ).map(op => {\r\n if (dto.EquipmentsData.some(f => f.Id === op.Id)) {\r\n return Object.assign({}, op, { disabled: true, checked: false });\r\n } else {\r\n return Object.assign({}, op, { disabled: false, checked: false });\r\n }\r\n }) as CheckEntity[],\r\n AssemblyParts: dto.AssemblyParts,\r\n };\r\n return model;\r\n}\r\n","import {\r\n IReservationDto,\r\n RecurringReservationUpdateOptions,\r\n ReservationSettingsState,\r\n} from './types';\r\n\r\nexport function getReservationSettings(dto: IReservationDto) {\r\n let settings = {\r\n BaseEquipment: dto.BaseEquipment,\r\n FatherId: dto.FatherId,\r\n Repeat_Period: dto.Repeat_Period,\r\n TrainingSessionOnly: dto.TrainingSessionOnly,\r\n SessionId: dto.SessionId,\r\n RecordDate: dto.RecordDate,\r\n LastUpdateDate: dto.LastUpdateDate,\r\n Entered: dto.Entered,\r\n Cancelled: dto.Cancelled,\r\n LastUpdateAdmin: dto.LastUpdateAdmin,\r\n RepeatEndTime: dto.RepeatEndTime,\r\n Repeat: dto.Repeat,\r\n HasCharges: dto.HasCharges,\r\n FundingTypeId: dto.FundingTypeId,\r\n ParentAssemblyReservationId: dto.ParentAssemblyReservationId,\r\n TopAssemblyReservationId: dto.TopAssemblyReservationId,\r\n TransferInProgress: dto.TransferInProgress,\r\n HasOfflineServices: dto.HasOfflineServices,\r\n HasTrainingSession: dto.HasTrainingSession,\r\n NextReservationTime: dto.NextReservationTime,\r\n PartReservations: dto.PartReservations,\r\n AssignToServiceRequestId: dto.AssignToServiceRequestId,\r\n AssignToServiceRequestRowIds: dto.AssignToServiceRequestRowIds,\r\n AssignToServiceRequestSampleIds: dto.AssignToServiceRequestSampleIds,\r\n TutorName: dto.TutorName,\r\n UserRequestedByApproval: false,\r\n RecurringUpdateOption: RecurringReservationUpdateOptions.CurrentReservation,\r\n CustomForms: dto.CustomForms,\r\n MandatoriesEquipments: dto.MandatoriesEquipments,\r\n OptionalsEquipments: dto.OptionalsEquipments,\r\n TerminateReservation: dto.TerminateReservation,\r\n FirstInitEquipments: dto.FirstInitEquipments,\r\n OfflineMandatory: dto.OfflineMandatory,\r\n IsForceTutoring: dto.IsForceTutoring,\r\n ForceFullDayReservations: dto.ForceFullDayReservations,\r\n FutureReservation: dto.IsFuture,\r\n Ongoing: dto.IsOngoing,\r\n PastReservation: dto.IsPast,\r\n StaffMandatoryEquipment: dto.StaffMandatoryEquipment,\r\n } as ReservationSettingsState;\r\n\r\n return settings;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { reservationSaga } from './saga';\r\nimport {\r\n createReservation_Success_Action,\r\n EquipmentsChangeStateParameters,\r\n IMandatoryEquipmentsDto,\r\n IReservationDto,\r\n IReservationEquipmentDto,\r\n PricingState,\r\n ReservationDetailsState,\r\n ReservationEquipmentsChangeResult,\r\n ReservationGlobalState,\r\n ReservationInsertModel,\r\n ReservationQueryStringParameters,\r\n ReservationSettingsState,\r\n ReservationState,\r\n ServiceSettingsState,\r\n TransferToReservation,\r\n UserTrainingReservationData,\r\n} from './types';\r\nimport { ConvertDtoToModel } from './ConvertDtoToModel';\r\nimport { getReservationSettings } from './getReservationSettings';\r\nimport { AxiosError } from 'axios';\r\nimport { CreateReservationActionPayloadType } from './CreateReservationActionPayloadType';\r\nimport { UpdateReservationActionPayloadType } from './UpdateReservationActionPayloadType';\r\n\r\nexport const initialState: ReservationState = {\r\n detailsState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n isEdit: false,\r\n confirmAssistedReservations: undefined,\r\n processing: false,\r\n reservationSettingsState: undefined,\r\n equipmentsSettingsState: undefined,\r\n trainingsData: null,\r\n valueHandler: undefined,\r\n requestedValueFor: undefined,\r\n requestedValue: undefined,\r\n equipmentChangeResultState: undefined,\r\n isChangeCompleted: undefined,\r\n transferState: {\r\n User: null,\r\n ReservtionId: undefined,\r\n WaitingTransferApproval: undefined,\r\n transferProcessing: undefined,\r\n transferStepCompleted: undefined,\r\n },\r\n caluclateCreditState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n },\r\n hasCharges: undefined,\r\n savedOfflineServices: [],\r\n refeshOfflineService: undefined,\r\n terminationState: {\r\n terminatProcessing: undefined,\r\n terminateCompleted: undefined,\r\n },\r\n cloneReservation: undefined,\r\n reservationDtoState: undefined,\r\n asyncChangeLoading: undefined,\r\n\r\n showConfirmPricing: false,\r\n refreshWorkOrderLink: undefined,\r\n notFound: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'reservation',\r\n initialState,\r\n reducers: {\r\n /**\r\n * Resets reservation details to it's initial state\r\n * @param state\r\n * @param action\r\n */\r\n reset(state, action: PayloadAction) {\r\n Object.assign(state, initialState);\r\n },\r\n initReservation(\r\n state,\r\n action: PayloadAction<{\r\n query: ReservationQueryStringParameters;\r\n globalSettings: GlobalSettingsType;\r\n prevState?: ReservationDetailsState;\r\n }>,\r\n ) {\r\n let isChange = action.payload.query.resourceChanged === 'true';\r\n state.processing = isChange ? false : true;\r\n if (isChange) {\r\n state.detailsState = Object.assign(state.detailsState, {\r\n processing: true,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n });\r\n state.isChangeCompleted = false;\r\n } else {\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.equipmentsSettingsState = undefined;\r\n }\r\n state.confirmAssistedReservations = undefined;\r\n state.reservationSettingsState = undefined;\r\n state.trainingsData = null;\r\n },\r\n initReservation_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n model: IReservationDto;\r\n isChanged: boolean;\r\n isEdit: boolean;\r\n globalSettings: GlobalSettingsType;\r\n userTrainigData: UserTrainingReservationData | null;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.detailsState.data = ConvertDtoToModel(\r\n action.payload.model,\r\n action.payload.globalSettings,\r\n );\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.reservationSettingsState = getReservationSettings(\r\n action.payload.model,\r\n );\r\n state.isChangeCompleted =\r\n action.payload.isChanged === true ? true : undefined;\r\n state.transferState.WaitingTransferApproval =\r\n action.payload.model.WaitingTransferApproval;\r\n state.transferState.ReservtionId = action.payload.model.Id;\r\n state.transferState.User = action.payload.model.TransferredTo;\r\n state.reservationDtoState = action.payload.model;\r\n state.isEdit = action.payload.isEdit;\r\n state.trainingsData = action.payload.userTrainigData;\r\n if (action.payload.isEdit) {\r\n state.savedOfflineServices = [];\r\n }\r\n },\r\n setTrainingsData(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.trainingsData = action.payload;\r\n },\r\n initClonedReservation_Success(\r\n state,\r\n action: PayloadAction<{\r\n model: IReservationDto;\r\n reservation: ReservationDetailsState;\r\n settings?: ReservationSettingsState;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.detailsState.data = ConvertDtoToModel(action.payload.model); //action.payload.reservation;\r\n state.detailsState.processing = false;\r\n state.reservationSettingsState = getReservationSettings(\r\n action.payload.model,\r\n );\r\n state.isEdit = false;\r\n state.refeshOfflineService = true;\r\n },\r\n initReservation_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.isChangeCompleted = undefined;\r\n if ((action.payload as AxiosError)?.response?.status === 404) {\r\n state.detailsState.hasErrors = true;\r\n state.notFound = true;\r\n }\r\n },\r\n initValidationData(\r\n state,\r\n action: PayloadAction<{\r\n parameters: EquipmentsChangeStateParameters;\r\n warnings: string[];\r\n errors: string[];\r\n }>,\r\n ) {\r\n state.asyncChangeLoading = true;\r\n },\r\n initValidationData_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.equipmentChangeResultState = action.payload;\r\n state.asyncChangeLoading = undefined;\r\n },\r\n initValidationData_Error(state, action: PayloadAction) {\r\n state.equipmentChangeResultState = undefined;\r\n state.asyncChangeLoading = undefined;\r\n },\r\n resetDetailsState(state, action: PayloadAction) {\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.reservationSettingsState = undefined;\r\n state.confirmAssistedReservations = undefined;\r\n state.equipmentsSettingsState = undefined;\r\n state.trainingsData = null;\r\n state.transferState = {\r\n User: null,\r\n ReservtionId: undefined,\r\n WaitingTransferApproval: undefined,\r\n transferProcessing: undefined,\r\n };\r\n state.reservationDtoState = undefined;\r\n state.savedOfflineServices = [];\r\n state.submitCalculateCredit = undefined;\r\n delete state.showConfirmPricing;\r\n state.ByApprovalErrors = undefined;\r\n state.userCanRequestApproval = undefined;\r\n state.refreshWorkOrderLink = undefined;\r\n state.notFound = undefined;\r\n },\r\n resetDetailsErrorsState(state, action: PayloadAction) {\r\n state.detailsState.hasErrors = false;\r\n state.detailsState.completed = false;\r\n },\r\n createReservationInternal(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n createReservation(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n if (action.payload.calcCredit === true) {\r\n state.caluclateCreditState.processing = true;\r\n state.caluclateCreditState.completed = undefined;\r\n state.caluclateCreditState.hasErrors = undefined;\r\n } else {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = false;\r\n state.detailsState.hasErrors = false;\r\n }\r\n },\r\n createReservation_Success(state, action: createReservation_Success_Action) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n if (!action.payload.hasErrors) {\r\n state.savedOfflineServices = [];\r\n }\r\n },\r\n createReservation_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n state.cloneReservation = false;\r\n },\r\n updateReservation(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n updateReservation_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n userTrainigData: UserTrainingReservationData | null;\r\n insertModel: ReservationInsertModel;\r\n }>,\r\n ) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n state.confirmAssistedReservations =\r\n action.payload.userTrainigData !== null;\r\n state.trainingsData = action.payload.userTrainigData;\r\n if (!action.payload.hasErrors) {\r\n state.savedOfflineServices = [];\r\n }\r\n },\r\n updateReservation_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n extendReservationSettings(\r\n state,\r\n action: PayloadAction>,\r\n ) {},\r\n updateReservationSettings(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.reservationSettingsState = Object.assign(\r\n {},\r\n state.reservationSettingsState,\r\n action.payload,\r\n );\r\n },\r\n extendEquipmentSettingsState(\r\n state,\r\n action: PayloadAction<{\r\n equipments: IReservationEquipmentDto[];\r\n mandatories: IMandatoryEquipmentsDto[];\r\n accServices: IEquipmentAccServiceDto[];\r\n globalSettings: GlobalSettingsType;\r\n settings?: ServiceSettingsState;\r\n }>,\r\n ) {\r\n state.asyncChangeLoading = true;\r\n },\r\n updateEquipmentSettingsState(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.equipmentsSettingsState = action.payload;\r\n state.asyncChangeLoading = undefined;\r\n },\r\n resetAssisteTrainingData(state, action: PayloadAction) {\r\n state.confirmAssistedReservations = undefined;\r\n state.trainingsData = null;\r\n },\r\n resetEquipmentChangeState(state, action: PayloadAction) {\r\n state.equipmentChangeResultState = undefined;\r\n },\r\n setStartDate(state, action: PayloadAction) {},\r\n setStartSuccess(state, action: PayloadAction) {\r\n state.valueHandler = {\r\n run: true,\r\n fieldKey: 'StartTime',\r\n fieldValue: action.payload,\r\n shouldValidate: true,\r\n };\r\n },\r\n setEndDate(state, action: PayloadAction) {},\r\n setEndSuccess(state, action: PayloadAction) {\r\n state.valueHandler = {\r\n run: true,\r\n fieldKey: 'EndTime',\r\n fieldValue: action.payload,\r\n shouldValidate: true,\r\n };\r\n },\r\n setAnyValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof ReservationDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setAnyValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof ReservationDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.valueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetValueHandler(state, action: PayloadAction) {\r\n state.valueHandler = undefined;\r\n },\r\n getAnyValue(state, action: PayloadAction) {\r\n state.requestedValueFor = action.payload;\r\n },\r\n getAnyValueSuccess(state, action: PayloadAction) {\r\n state.requestedValue = action.payload;\r\n },\r\n resetRequestedFor(state, action: PayloadAction) {\r\n state.requestedValueFor = undefined;\r\n },\r\n transferReservation(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = true;\r\n state.transferState.transferStepCompleted = undefined;\r\n },\r\n transferReservation_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.transferState.transferProcessing = false;\r\n state.transferState.User = action.payload.User;\r\n state.transferState.ReservtionId = action.payload.ReservtionId;\r\n state.transferState.WaitingTransferApproval = true;\r\n state.transferState.transferStepCompleted = true;\r\n },\r\n transferReservation_Error(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = false;\r\n state.transferState.transferStepCompleted = false;\r\n },\r\n resetTransferState(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = undefined;\r\n state.transferState.User = null;\r\n state.transferState.ReservtionId = undefined;\r\n state.transferState.WaitingTransferApproval = undefined;\r\n state.transferState.transferStepCompleted = undefined;\r\n },\r\n cancelTransfer(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = true;\r\n state.transferState.transferStepCompleted = undefined;\r\n },\r\n cancelTransfer_Success(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = false;\r\n state.transferState.User = null;\r\n state.transferState.WaitingTransferApproval = false;\r\n state.transferState.ReservtionId = undefined;\r\n state.transferState.transferStepCompleted = true;\r\n },\r\n cancelTransfer_Error(state, action: PayloadAction) {\r\n state.transferState.transferProcessing = false;\r\n state.transferState.transferStepCompleted = false;\r\n },\r\n calculateCredit(state, action: PayloadAction) {\r\n state.caluclateCreditState = {\r\n processing: true,\r\n };\r\n },\r\n caluclateCredit_Success(state, action: PayloadAction) {\r\n state.caluclateCreditState = {\r\n data: action.payload,\r\n completed: true,\r\n processing: false,\r\n };\r\n },\r\n calculateCredit_Error(state, action: PayloadAction) {\r\n state.caluclateCreditState = {\r\n completed: true,\r\n processing: false,\r\n };\r\n },\r\n setSubmitCalculateCredit(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.submitCalculateCredit = action.payload;\r\n },\r\n resetCreditState(state, action: PayloadAction) {\r\n state.caluclateCreditState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.submitCalculateCredit = undefined;\r\n },\r\n showConfirmPricing(state, action: PayloadAction) {\r\n state.showConfirmPricing = action.payload;\r\n state.detailsState.processing = action.payload;\r\n },\r\n сonfirmPricing(state, action: PayloadAction) {\r\n if (action.payload === false) {\r\n state.caluclateCreditState = {};\r\n state.detailsState.processing = action.payload;\r\n }\r\n state.showConfirmPricing = false;\r\n },\r\n setSavedOfflineServices(state, action: PayloadAction) {\r\n state.savedOfflineServices = action.payload;\r\n },\r\n setRefreshOfflineServices(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.refeshOfflineService = action.payload;\r\n },\r\n terminateReservation(\r\n state,\r\n action: PayloadAction<{\r\n current: ReservationDetailsState;\r\n original: ReservationDetailsState;\r\n currentCustomFormFiles: IFormFileValue[];\r\n originalCustomFormFiles: IFormFileValue[];\r\n settings: ReservationSettingsState | undefined;\r\n }>,\r\n ) {\r\n state.terminationState.terminatProcessing = true;\r\n state.terminationState.terminateCompleted = undefined;\r\n },\r\n terminateReservation_success(state, action: PayloadAction) {\r\n state.terminationState.terminatProcessing = false;\r\n state.terminationState.terminateCompleted = true;\r\n },\r\n terminateReservation_error(state, action: PayloadAction) {\r\n state.terminationState.terminatProcessing = false;\r\n state.terminationState.terminateCompleted = true;\r\n },\r\n resetTerminateState(state, action: PayloadAction) {\r\n state.terminationState = {\r\n terminatProcessing: undefined,\r\n terminateCompleted: undefined,\r\n };\r\n },\r\n setCloneReservation(state, action: PayloadAction) {\r\n state.cloneReservation = action.payload;\r\n },\r\n setAsyncChangeLoading(state, action: PayloadAction) {\r\n state.asyncChangeLoading = action.payload;\r\n },\r\n\r\n setByApprovalErrors(\r\n state,\r\n action: PayloadAction | undefined>,\r\n ) {\r\n state.ByApprovalErrors = action.payload;\r\n },\r\n setUserCanRequestApproval(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.userCanRequestApproval = action.payload;\r\n },\r\n setRefreshWorkOrderLink(state, action: PayloadAction) {\r\n state.refreshWorkOrderLink = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: reservationActions } = slice;\r\n\r\nexport const useReservationSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: reservationSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useReservationSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import {\r\n SendEmailOnOffline,\r\n WorkOrderQueryStringParameters,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { httpClient } from './HttpClient';\r\nimport { IWorkOrderDetailsDto } from './odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\n\r\nexport const WorkOrderApi = {\r\n initCreateData: (payload: WorkOrderQueryStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/workorders/InitWorkOrder`;\r\n return httpClient.post(url, data);\r\n },\r\n initUpdateData: (payload: WorkOrderQueryStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/workorders/InitWorkOrder`;\r\n return httpClient.post(url, data);\r\n },\r\n insertWorkOrder: (payload: IWorkOrderDetailsDto) => {\r\n const url = `/api/odata/v4/workorders`;\r\n return httpClient.post(url, payload);\r\n },\r\n updateWorkOrder: (payload: IWorkOrderDetailsDto) => {\r\n const url = `/api/odata/v4/workorders(${payload.Id})`;\r\n return httpClient.put(url, payload);\r\n },\r\n sendEmailOnOffline: (payload: SendEmailOnOffline) => {\r\n const data = {\r\n offData: payload,\r\n };\r\n console.debug('offlinedata', payload);\r\n const url = `/api/odata/v4/workorders/SendEmailOnResOffline`;\r\n return httpClient.post(url, data);\r\n },\r\n getNewWorkOrderStatus: (payload: number) => {\r\n const url = '/api/odata/v4/WorkOrderStatus';\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Order asc',\r\n $filter: `(WorkOrderTypeId eq ${payload} and New eq true)`,\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params).then(response => response.value);\r\n },\r\n deleteOrders: (payload: { Id: number; all: boolean | null }) => {\r\n const url = '/api/odata/v4/WorkOrders/DeleteWorkOrder';\r\n return httpClient.post(url, payload);\r\n },\r\n deleteTempComments: (commentIds: number[] | undefined) => {\r\n if (!commentIds?.length) return;\r\n const url = odataUrlPrefix + 'WorkOrders/DeleteTempComments';\r\n return httpClient.post(url, { commentIds }).catch(e => console.error(e));\r\n },\r\n DowntimeOrders: (payload: number[]) => {\r\n const filters = (assetIds: number[]) => {\r\n const predicates: string | Condition[] = [];\r\n let foo: string | undefined = undefined;\r\n if (assetIds.length > 0) {\r\n let ids = assetIds.map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n let nowDate = new CustomDate(new Date(), 'complete');\r\n predicates.push(new Condition('AssetId', ODataOperators.Includes, ids));\r\n predicates.push(\r\n new Condition('OfflineEventStart', ODataOperators.LessThan, nowDate),\r\n );\r\n predicates.push(\r\n new Condition('OfflineEventEnd', ODataOperators.GreaterThan, nowDate),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'DoneDate',\r\n ODataOperators.Equals,\r\n null,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'WorkingHoursId',\r\n ODataOperators.NotEquals,\r\n null,\r\n ),\r\n );\r\n predicates.push(\r\n new Condition(\r\n 'IsClosed',\r\n ODataOperators.Equals,\r\n false,\r\n ),\r\n );\r\n foo = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n return foo;\r\n };\r\n const url = '/api/odata/v4/WorkOrders';\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: filters(payload),\r\n };\r\n return httpClient.get(url, params).then(response => response.value);\r\n },\r\n removefromLinks: (id: number) => {\r\n const url = '/api/odata/v4/workorders/RemoveFromLinks';\r\n const params = { linkedId: id };\r\n return httpClient.post(url, params).then(v => v.value);\r\n },\r\n addToLinked: (data: { id: number; link: number }) => {\r\n const params = { params: { Id: data.id, Link: data.link } };\r\n const url = '/api/odata/v4/workorders/AddToLinked';\r\n return httpClient.post(url, params);\r\n },\r\n removeLinkedCalibration: (data: { id: number; link: number }) => {\r\n const url = '/api/odata/v4/workorders/RemoveLinkedCalibr';\r\n const params = { params: { Id: data.id, Link: data.link } };\r\n return httpClient.post(url, params);\r\n },\r\n addLinkedToCalibration: (data: { id: number; link: number }) => {\r\n const params = { params: { Id: data.id, Link: data.link } };\r\n const url = '/api/odata/v4/workorders/AddLinkedCalibr';\r\n return httpClient.post(url, params);\r\n },\r\n getLinkedToCalibration: (id: number) => {\r\n const params = { key: id };\r\n const url = '/api/odata/v4/workorders/InitLinkedCalibrations';\r\n return httpClient.post(url, params);\r\n },\r\n getOverlappingDowntimes: (id: number) => {\r\n const params = { id: id };\r\n const url = '/api/odata/v4/workorders/GetOverlappingDowntimes';\r\n return httpClient.post(url, params);\r\n },\r\n updateWorkOrdersStatus: (\r\n rows: IWorkOrderDetailsDto[],\r\n workOrderStatus: Entity | null,\r\n ) => {\r\n const workOrdersIds: number[] = rows.map(item => item.Id);\r\n const statusId: number = !!workOrderStatus ? workOrderStatus?.Id : 0;\r\n const data = { workOrdersIds, statusId };\r\n const url = '/api/odata/v4/WorkOrderStatus/UpdateWorkOrdersStatus';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { FormLabel } from '@material-ui/core';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface GhostInputProps {\r\n label?: React.ReactNode;\r\n valueHtml?: React.ReactNode;\r\n valueText?: React.ReactNode;\r\n id?: string;\r\n fullWidth?: boolean;\r\n info?: string;\r\n labelBolder?: boolean;\r\n}\r\nexport function GhostInput(props: GhostInputProps) {\r\n const {\r\n label,\r\n valueHtml,\r\n valueText,\r\n info,\r\n labelBolder,\r\n fullWidth = true,\r\n } = props;\r\n\r\n return (\r\n \r\n \r\n {label && (\r\n \r\n {label} {info && }\r\n \r\n )}\r\n {valueText && (\r\n \r\n {valueText}\r\n \r\n )}\r\n {valueHtml}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n * A copy of local\\Bookit.Data\\Enums\\BudgetFields.cs\r\n * replace attributes: ^ *\\[[^\\]]+\\]\\n\r\n */\r\nexport enum BudgetFields {\r\n Active = 1,\r\n\r\n Number = 2,\r\n\r\n BudgetManager = 3,\r\n\r\n UserGroup = 4,\r\n\r\n BudgetCat = 5,\r\n\r\n HideExperiments = 6,\r\n\r\n StartDate = 7,\r\n\r\n EndDate = 8,\r\n\r\n Confidential = 9,\r\n\r\n FundingType = 10,\r\n\r\n AllowJoinRequests = 11,\r\n\r\n DefaultExperimentTemplate = 12,\r\n\r\n Default = 13,\r\n\r\n BudgetIsOnline = 14,\r\n\r\n BudgetFund = 15,\r\n\r\n FacilityProject = 16,\r\n\r\n BudgetInternalId = 17,\r\n\r\n BudgetStatus = 18,\r\n\r\n ExternalEndDate = 19,\r\n\r\n ExternalUpdatedAt = 20,\r\n\r\n BudgetLeader = 21,\r\n\r\n BudgetInitialCost = 22,\r\n\r\n BudgetBudget = 23,\r\n\r\n BudgetOwner = 24,\r\n\r\n BdmUsername = 25,\r\n\r\n SubsidyProfit = 26,\r\n\r\n SubsProfProjectNumber = 27,\r\n\r\n SubsProfCostCenter = 28,\r\n SubsProfActivity = 29,\r\n\r\n SubsProfAccountNumber = 30,\r\n SubsidyFinAccountType = 31,\r\n BudgetRemarks = 32,\r\n\r\n Company = 33,\r\n\r\n BudgetManagerCanApproveExperiment = 34,\r\n\r\n BudgetAmount = 35,\r\n\r\n HardLimit = 36,\r\n\r\n SoftLimit = 37,\r\n\r\n BudgetLimitsNotificationSettings = 38,\r\n\r\n BudgetExtraTextField1 = 39,\r\n\r\n BudgetExtraTextField2 = 40,\r\n\r\n BudgetExtraTextField3 = 41,\r\n\r\n BudgetExtraTextField4 = 42,\r\n\r\n BudgetExtraTextField5 = 43,\r\n\r\n BudgetExtraBoolField1 = 44,\r\n\r\n BudgetExtraBoolField2 = 45,\r\n\r\n BudgetExtraBoolField3 = 46,\r\n\r\n BudgetExtraBoolField4 = 47,\r\n\r\n BudgetExtraBoolField5 = 48,\r\n\r\n BudgetExtraDateField1 = 49,\r\n\r\n BudgetExtraDateField2 = 50,\r\n\r\n BudgetExtraDateField3 = 51,\r\n\r\n BudgetExtraDateField4 = 52,\r\n\r\n BudgetExtraDateField5 = 53,\r\n\r\n BudgetExtraNumField1 = 54,\r\n\r\n BudgetExtraNumField2 = 55,\r\n\r\n BudgetExtraNumField3 = 56,\r\n\r\n BudgetExtraNumField4 = 57,\r\n\r\n BudgetExtraNumField5 = 58,\r\n\r\n InvoicingRemarks = 59,\r\n ProjectBilingEmail = 60,\r\n PendingProjectAmount = 61,\r\n SecondaryCoordinators = 62,\r\n PurchaseOrderOption = 63,\r\n}\r\n","import {\r\n Chip,\r\n ChipProps,\r\n darken,\r\n fade,\r\n Theme,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { WithStylesOptions } from '@material-ui/styles';\r\nimport { inputLabelM, inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Check } from '../BasicInputs/Check';\r\n\r\nexport interface BookitChipProps extends ChipProps {\r\n customcolor?: string;\r\n custombgcolor?: string;\r\n customiconcolor?: string;\r\n fullwidth?: boolean;\r\n customwidth?: number | string;\r\n shape?: 'squar' | 'circle';\r\n customsize?: 'xs' | 'small' | 'medium';\r\n notremoved?: boolean;\r\n}\r\nexport interface BookitChipWithInfoProps extends BookitChipProps {\r\n info?: React.ReactNode;\r\n}\r\nconst StyledChip = withStyles<\r\n | 'root'\r\n | 'disabled'\r\n | 'label'\r\n | 'labelSmall'\r\n | 'clickable'\r\n | 'sizeSmall'\r\n | 'deleteIcon',\r\n WithStylesOptions,\r\n {\r\n shape?: 'squar' | 'circle';\r\n custombgcolor?: string;\r\n customsize?: 'xs' | 'small' | 'medium';\r\n customcolor?: string;\r\n customiconcolor?: string;\r\n fullwidth?: boolean;\r\n customwidth?: number | string;\r\n notremoved?: boolean;\r\n size?: 'small' | 'medium';\r\n disabled?: boolean;\r\n }\r\n>((theme: Theme) => ({\r\n root: {\r\n justifyContent: 'space-around',\r\n borderRadius: props =>\r\n props.shape === 'squar' ? 4 : props.shape === 'circle' ? 50 : 4,\r\n backgroundColor: props => props.custombgcolor ?? theme.palette.primary.main,\r\n height: props =>\r\n props.customsize === 'xs'\r\n ? 20\r\n : props.customsize === 'small'\r\n ? 24\r\n : props.customsize === 'medium'\r\n ? 32\r\n : 24,\r\n color: props => props.customcolor ?? theme.palette.common.white,\r\n gap: 4,\r\n paddingBlock: props =>\r\n props.customsize === 'xs'\r\n ? '2px'\r\n : props.customsize === 'small'\r\n ? '6px'\r\n : props.customsize === 'medium'\r\n ? '8px'\r\n : '4px',\r\n '&$disabled': {\r\n opacity: 1,\r\n backgroundColor: theme.palette.common.grayComponents,\r\n color: theme.palette.common.white,\r\n pointerEvents: 'visible',\r\n },\r\n '&:hover, &:focus': {\r\n backgroundColor: props =>\r\n props.custombgcolor === undefined\r\n ? theme.palette.primary.dark\r\n : darken(props.custombgcolor, 0.2),\r\n color: props =>\r\n props.customcolor === undefined\r\n ? theme.palette.common.white\r\n : props.customcolor,\r\n },\r\n width: props =>\r\n props.fullwidth\r\n ? '100%'\r\n : props.customwidth\r\n ? props.customwidth\r\n : undefined,\r\n maxWidth: props => (props.notremoved ? '100%' : 'calc(100% - 6px)'),\r\n },\r\n disabled: {\r\n backgroundColor: theme.palette.common.grayComponents,\r\n color: theme.palette.common.white,\r\n },\r\n label: inputLabelM,\r\n labelSmall: inputLabelXS,\r\n clickable: {\r\n backgroundColor: props => props.custombgcolor ?? theme.palette.primary.main,\r\n color: props => props.customcolor ?? theme.palette.common.white,\r\n },\r\n sizeSmall: {\r\n height: 20,\r\n },\r\n deleteIcon: {\r\n color: props =>\r\n props.customiconcolor === undefined\r\n ? theme.palette.primary.contrastText\r\n : props.customiconcolor,\r\n height: 16,\r\n width: 16,\r\n margin: props =>\r\n props.size === 'small' ? '0 4px 0 -4px' : '0 12px 0 -12px',\r\n display: props => (props.notremoved ? 'none' : 'inline-block'),\r\n '&:hover': {\r\n color: props =>\r\n props.customiconcolor === undefined\r\n ? fade(theme.palette.primary.contrastText, 0.8)\r\n : fade(props.customiconcolor, 0.8),\r\n },\r\n pointerEvents: props => (props.disabled ? 'none' : 'auto'),\r\n },\r\n}))(Chip);\r\n\r\nexport const BookitChip = (props: BookitChipProps) => {\r\n const {\r\n deleteIcon,\r\n notremoved,\r\n fullwidth,\r\n disabled,\r\n customcolor,\r\n custombgcolor,\r\n customiconcolor,\r\n customwidth,\r\n shape,\r\n customsize,\r\n ...other\r\n } = props;\r\n return (\r\n \r\n )\r\n }\r\n onDelete={event => {\r\n notremoved\r\n ? event.preventDefault()\r\n : !!props.onDelete && props.onDelete(event);\r\n }}\r\n fullwidth={fullwidth}\r\n custombgcolor={custombgcolor}\r\n customiconcolor={customiconcolor}\r\n shape={shape}\r\n customsize={customsize}\r\n customwidth={customwidth}\r\n customcolor={customcolor}\r\n disabled={disabled}\r\n notremoved={notremoved}\r\n {...other}\r\n />\r\n );\r\n};\r\nexport interface BookitChipWithCheckProps extends BookitChipProps {\r\n onChange?: (event: React.ChangeEvent) => void;\r\n color?: 'primary' | 'secondary' | 'default';\r\n checked?: boolean;\r\n checkid?: string;\r\n checkname?: string;\r\n label?: string;\r\n info?: string;\r\n}\r\nexport const BookitChipWithCheck = (props: BookitChipWithCheckProps) => {\r\n return (\r\n \r\n }\r\n label={props.label}\r\n fullwidth={props.fullwidth}\r\n info={props.info}\r\n notremoved={props.notremoved}\r\n custombgcolor={props.custombgcolor}\r\n customcolor={props.customcolor}\r\n customiconcolor={props.customiconcolor}\r\n customsize={props.customsize}\r\n customwidth={props.customwidth}\r\n {...props}\r\n />\r\n );\r\n};\r\n\r\nexport const BookitChipWithInfo = (props: BookitChipWithInfoProps) => {\r\n const {\r\n info,\r\n fullwidth,\r\n customcolor,\r\n custombgcolor,\r\n customiconcolor,\r\n customwidth,\r\n shape,\r\n customsize,\r\n notremoved,\r\n ...other\r\n } = props;\r\n return info ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n }\r\n fullwidth={fullwidth}\r\n customcolor={customcolor}\r\n custombgcolor={custombgcolor}\r\n customiconcolor={customiconcolor}\r\n customwidth={customwidth}\r\n shape={shape}\r\n customsize={customsize}\r\n notremoved={notremoved}\r\n {...other}\r\n />\r\n );\r\n};\r\n","export function* largeFilesUploadSaga() {}\r\n","import { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { LargeFilesUploadState } from './types';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { largeFilesUploadSaga } from './saga';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\n\r\nexport const initialState: LargeFilesUploadState = {\r\n selectedFiles: 0,\r\n canUpload: false,\r\n uploading: false,\r\n targetId: 0,\r\n startedToUpload: false,\r\n files: [],\r\n currentNumberOfUploadedFiles: 0,\r\n numberOfUploadedFiles: 0,\r\n commentType: undefined,\r\n referenceId: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'largeFilesUpload',\r\n initialState,\r\n reducers: {\r\n setSeletedFiles(state, action: PayloadAction) {\r\n state.selectedFiles = action.payload;\r\n },\r\n setCommentProperties(\r\n state,\r\n action: PayloadAction<{\r\n commentType: CommentReferenceTypes;\r\n referenceId: number;\r\n }>,\r\n ) {\r\n state.commentType = action.payload.commentType;\r\n state.referenceId = action.payload.referenceId;\r\n },\r\n setCanUpload(state, action: PayloadAction) {\r\n if (action.payload > 0) {\r\n state.targetId = action.payload;\r\n state.canUpload = true;\r\n state.startedToUpload = false;\r\n state.uploading = false;\r\n state.currentNumberOfUploadedFiles = 0;\r\n state.numberOfUploadedFiles = 0;\r\n } else {\r\n state.canUpload = false;\r\n state.startedToUpload = false;\r\n state.uploading = false;\r\n state.targetId = 0;\r\n state.files = [];\r\n state.currentNumberOfUploadedFiles = 0;\r\n state.numberOfUploadedFiles = 0;\r\n }\r\n },\r\n addFile(state, action: PayloadAction) {\r\n state.files.push(action.payload);\r\n if (state.canUpload && state.files.length === 1) {\r\n state.startedToUpload = true;\r\n state.currentNumberOfUploadedFiles = 0;\r\n state.numberOfUploadedFiles = 0;\r\n state.selectedFiles = 0;\r\n }\r\n state.uploading = state.canUpload && state.files.length > 0;\r\n },\r\n removeFile(state, action: PayloadAction) {\r\n const index = state.files.findIndex(item => item === action.payload);\r\n if (index >= 0) {\r\n state.files.splice(index, 1);\r\n state.currentNumberOfUploadedFiles++;\r\n }\r\n if (state.files.length === 0 && state.uploading) {\r\n state.numberOfUploadedFiles = state.currentNumberOfUploadedFiles;\r\n state.currentNumberOfUploadedFiles = 0;\r\n state.uploading = false;\r\n }\r\n },\r\n resetNumberOfUploadedFiles(state) {\r\n state.selectedFiles = 0;\r\n state.numberOfUploadedFiles = 0;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: largeFilesUploadActions } = slice;\r\n\r\nexport const useLargeFilesUploadSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: largeFilesUploadSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { FundingTypes } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AsyncDataState } from 'types/common';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { FieldHandlerProps } from '../../FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface ConnectedFiltersState\r\n extends AsyncDataState {\r\n connectedValueHandler?: FieldHandlerProps;\r\n connectedSettings: ConnectedFiltersSettings;\r\n}\r\nexport interface ConnectedFiltersSettings {\r\n startTimeVisible?: boolean;\r\n endTimeVisible?: boolean;\r\n budgetVisible?: boolean;\r\n userVisible?: boolean;\r\n userGroupVisible?: boolean;\r\n fundingTypeVisible?: boolean;\r\n budgetExpirementVisible?: boolean;\r\n instProjVisible?: boolean;\r\n extCustomerVisible?: boolean;\r\n purchaseOrderVisible?: boolean;\r\n referenceVisible?: boolean;\r\n onlyOwnUserGroupsAllowed?: boolean;\r\n ReservationUserGroupGroupByBudgetUserGroup?: boolean;\r\n budgetLimitedByUsers?: boolean;\r\n isBudgetsWithoutUserGroup?: boolean;\r\n hideProject?: boolean;\r\n isServiceAdmin?: boolean;\r\n isUserGroupCoordinator?: boolean;\r\n chargesViewAllowed?: boolean;\r\n hasConflictProjects?: boolean;\r\n}\r\nexport function mapSettings(\r\n services: IServiceTypeFilterDto[],\r\n globalSettings: GlobalSettingsType,\r\n settings: ConnectedFiltersSettings,\r\n isEditMode: boolean,\r\n user: AuthenticatedUser | undefined,\r\n data?: IConnectedFiltersDto,\r\n): ConnectedFiltersSettings {\r\n let budgetEnabled = getOfflineBudgetVisible(globalSettings, services);\r\n\r\n let resUGEnabled =\r\n services.length > 0\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n budgetEnabled\r\n : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n let isServiceAdmin = user?.IsAllGroupOrLabTechAdmin(\r\n services.map(f => f.ServiceGroupId ?? 0),\r\n services,\r\n );\r\n let isRoleAdmin =\r\n user?.Roles.includes(Roles.Administrators) ||\r\n user?.Roles.includes(Roles.GroupAdministrators) ||\r\n user?.Roles.includes(Roles.LabTech);\r\n let isUserGroupCoordinator =\r\n user &&\r\n user.Roles.includes(Roles.UserGroupCoord) &&\r\n (isEditMode ? !!data && data.UserGroup?.Id === user.ActiveUserGroup : true);\r\n let btExpEnabled =\r\n globalSettings.budgetExperimentModuleEnabled && budgetEnabled;\r\n let chargesViewAllowed =\r\n (user && user.Roles.includes(Roles.FinAdmin)) ||\r\n isServiceAdmin ||\r\n (user &&\r\n user.Roles.includes(Roles.InvoicesReader) &&\r\n user.ActiveUserGroup?.Id === data?.UserGroup?.Id);\r\n const result = Object.assign({}, settings, {\r\n hideProject:\r\n services.length > 0 ? services.every(f => f.HideProject) : undefined,\r\n isUserGroupCoordinator: isUserGroupCoordinator,\r\n hasConflictProjects:\r\n services.some(f => f.HideProject === true) &&\r\n services.some(f => f.HideProject === false),\r\n budgetVisible: budgetEnabled,\r\n fundingTypeVisible:\r\n globalSettings.fundingTypeBudgetEnabled &&\r\n budgetEnabled &&\r\n // funding type is not needed unless the PurchaseOrder is also enabled\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n ReservationUserGroupGroupByBudgetUserGroup: resUGEnabled,\r\n userGroupVisible:\r\n (isServiceAdmin || isRoleAdmin) &&\r\n !isEditMode &&\r\n !isUserGroupCoordinator &&\r\n !resUGEnabled,\r\n userVisible:\r\n isServiceAdmin || isUserGroupCoordinator || (!isEditMode && isRoleAdmin),\r\n budgetExpirementVisible: btExpEnabled,\r\n instProjVisible: globalSettings.instituteProjectsEnabled,\r\n // looks like the external customers are being deprecated\r\n extCustomerVisible: false,\r\n purchaseOrderVisible:\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n ((data?.Budget as IBudgetFilterDto)?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden,\r\n referenceVisible:\r\n globalSettings.showReferenceFieldInReservationDetails && !!data\r\n ? data.FundingType?.Id === FundingTypes.External\r\n : false,\r\n onlyOwnUserGroupsAllowed: globalSettings.onlyOwnUserGroupsAllowed,\r\n projectsAreOptional: globalSettings.projectsAreOptional,\r\n budgetLimitedByUsers: globalSettings.budgetLimitedByUsers,\r\n isBudgetsWithoutUserGroup: globalSettings.isBudgetsWithoutUserGroup,\r\n isServiceAdmin: isServiceAdmin,\r\n endTimeVisible: false,\r\n startTimeVisible: true,\r\n chargesViewAllowed:\r\n globalSettings.allowUsersToViewTheirCharges || chargesViewAllowed,\r\n });\r\n return result;\r\n}\r\nexport function getOfflineBudgetVisible(\r\n globalSettings: Pick<\r\n GlobalSettingsType,\r\n | 'billingModuleEnabled'\r\n | 'budgetModuleEnabled'\r\n | 'priceSheetPricing'\r\n | 'projectsAreOptional'\r\n >,\r\n equipments: Array<\r\n Pick\r\n >,\r\n): boolean {\r\n if (!globalSettings.budgetModuleEnabled) {\r\n return false;\r\n }\r\n\r\n if (globalSettings.billingModuleEnabled) {\r\n // budgets turned off on service group level\r\n if (equipments.every(f => f.BudgetsTurnedOn === false)) {\r\n return false;\r\n }\r\n }\r\n\r\n // HideProjects is enabled only when ProjectsAreOptional is turned on in the system settings\r\n if (globalSettings.projectsAreOptional) {\r\n if (equipments.every(f => f.HideProject)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { connectedFiltersActions as actions } from '.';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ConnectedFiltersSettings, mapSettings } from './types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectConnectedFiltersData } from './selectors';\r\n\r\nfunction* doSetConnectedValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof IConnectedFiltersDto;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setConnectedValueSuccess(action.payload));\r\n}\r\nfunction* doUpdateEquipmentSettigs(\r\n action: PayloadAction<{\r\n services: IServiceTypeFilterDto[];\r\n globalSettings: GlobalSettingsType;\r\n settings: ConnectedFiltersSettings;\r\n isEdit: boolean;\r\n data?: IConnectedFiltersDto;\r\n }>,\r\n) {\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const currentData: IConnectedFiltersDto = yield select(\r\n selectConnectedFiltersData,\r\n );\r\n let newSettings = mapSettings(\r\n action.payload.services,\r\n action.payload.globalSettings,\r\n action.payload.settings,\r\n action.payload.isEdit,\r\n user,\r\n action.payload.data || currentData,\r\n );\r\n\r\n yield put(actions.updateSettingsState(newSettings));\r\n}\r\nfunction* doResetState(action: PayloadAction) {\r\n yield put(actions.resetConnectedState_success());\r\n}\r\nexport function* connectedFiltersSaga() {\r\n yield takeLatest(actions.setConnectedValue.type, doSetConnectedValue);\r\n yield takeLatest(actions.extendSettingsState.type, doUpdateEquipmentSettigs);\r\n yield takeLatest(actions.resetConnectedState.type, doResetState);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport {\r\n ConnectedFiltersInit,\r\n IConnectedFiltersDto,\r\n} from 'types/IConnectedFiltersDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { connectedFiltersSaga } from './saga';\r\nimport { ConnectedFiltersSettings, ConnectedFiltersState } from './types';\r\n\r\nexport const initialState: ConnectedFiltersState = {\r\n processing: false,\r\n data: {\r\n StartTime: new CustomDate(new Date()).toISOString(),\r\n EndTime: undefined,\r\n User: null,\r\n UserGroup: null,\r\n Budget: null,\r\n BudgetExperiment: null,\r\n InstituteProject: null,\r\n ExternalCustomer: null,\r\n FundingType: getSingleInvoiceFundingType(0),\r\n PurchaseOrder: undefined,\r\n Reference: undefined,\r\n },\r\n connectedValueHandler: undefined,\r\n connectedSettings: {\r\n budgetExpirementVisible: undefined,\r\n budgetLimitedByUsers: undefined,\r\n budgetVisible: undefined,\r\n endTimeVisible: undefined,\r\n extCustomerVisible: undefined,\r\n fundingTypeVisible: undefined,\r\n hideProject: undefined,\r\n instProjVisible: undefined,\r\n isBudgetsWithoutUserGroup: undefined,\r\n isServiceAdmin: undefined,\r\n onlyOwnUserGroupsAllowed: undefined,\r\n purchaseOrderVisible: undefined,\r\n referenceVisible: undefined,\r\n ReservationUserGroupGroupByBudgetUserGroup: undefined,\r\n startTimeVisible: undefined,\r\n userGroupVisible: undefined,\r\n userVisible: undefined,\r\n isUserGroupCoordinator: undefined,\r\n chargesViewAllowed: undefined,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'connectedFilters',\r\n initialState,\r\n reducers: {\r\n resetState(state, action: PayloadAction) {\r\n state.data = ConnectedFiltersInit();\r\n },\r\n saveState(state, action: PayloadAction) {\r\n state.data = {\r\n StartTime: action.payload.StartTime,\r\n EndTime: action.payload.EndTime,\r\n User: action.payload.User,\r\n UserGroup: action.payload.UserGroup,\r\n Budget: action.payload.Budget,\r\n BudgetExperiment: action.payload.BudgetExperiment,\r\n InstituteProject: action.payload.InstituteProject,\r\n ExternalCustomer: action.payload.ExternalCustomer,\r\n FundingType: action.payload.FundingType,\r\n PurchaseOrder: action.payload.PurchaseOrder,\r\n Reference: action.payload.PurchaseOrder,\r\n };\r\n },\r\n setSubmit(state, action: PayloadAction) {\r\n state.processing = action.payload;\r\n },\r\n resetConnectedState(state, action: PayloadAction) {},\r\n resetConnectedState_success(state, action: PayloadAction) {\r\n state.connectedSettings = {\r\n budgetExpirementVisible: undefined,\r\n budgetLimitedByUsers: undefined,\r\n budgetVisible: undefined,\r\n endTimeVisible: undefined,\r\n extCustomerVisible: undefined,\r\n fundingTypeVisible: undefined,\r\n hideProject: undefined,\r\n instProjVisible: undefined,\r\n isBudgetsWithoutUserGroup: undefined,\r\n isServiceAdmin: undefined,\r\n onlyOwnUserGroupsAllowed: undefined,\r\n purchaseOrderVisible: undefined,\r\n referenceVisible: undefined,\r\n ReservationUserGroupGroupByBudgetUserGroup: undefined,\r\n startTimeVisible: undefined,\r\n userGroupVisible: undefined,\r\n userVisible: undefined,\r\n isUserGroupCoordinator: undefined,\r\n chargesViewAllowed: undefined,\r\n };\r\n state.data = {\r\n StartTime: new CustomDate(new Date()).toISOString(),\r\n EndTime: undefined,\r\n User: null,\r\n UserGroup: null,\r\n Budget: null,\r\n BudgetExperiment: null,\r\n InstituteProject: null,\r\n ExternalCustomer: null,\r\n FundingType: getSingleInvoiceFundingType(0),\r\n PurchaseOrder: undefined,\r\n Reference: undefined,\r\n };\r\n state.connectedValueHandler = undefined;\r\n state.completed = undefined;\r\n state.processing = undefined;\r\n state.hasErrors = undefined;\r\n },\r\n setConnectedValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof IConnectedFiltersDto;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setConnectedValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof IConnectedFiltersDto;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.connectedValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetConnectedHandler(state, action: PayloadAction) {\r\n state.connectedValueHandler = undefined;\r\n },\r\n extendSettingsState(\r\n state,\r\n action: PayloadAction<{\r\n services: IServiceTypeFilterDto[];\r\n globalSettings: GlobalSettingsType;\r\n settings: ConnectedFiltersSettings;\r\n isEdit: boolean;\r\n data?: IConnectedFiltersDto;\r\n }>,\r\n ) {},\r\n updateSettingsState(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.connectedSettings = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: connectedFiltersActions } = slice;\r\n\r\nexport const useConnectedFiltersSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: connectedFiltersSaga });\r\n return { actions: slice.actions };\r\n};\r\n","export const DRAWER_WIDTH: number = 240;\r\nexport const DRAWER_MOBILE_WIDTH: number = 350;\r\nexport const SIDE_PANEL_WIDTH: number = 370;\r\nexport const COVER_WIDTH: number = 360;\r\n","/**\r\n *\r\n * ExtraDDLPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IExtraDDLDto } from 'api/odata/generated/entities/IExtraDDLDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nexport type CatUrl = 'base' | 'assetBase' | 'public';\r\nexport interface ExtraDDLPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: any;\r\n}\r\n\r\nconst url = '/api/odata/v4/ExtraDDL';\r\nexport const initExtraDDLData = (\r\n initval: string | undefined,\r\n sourceUrl?: string,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IExtraDDLDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,Active,ExtraDdlId',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl = `${url}?key=${sourceUrl ?? ''}`;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IExtraDDLDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n urlType?: string,\r\n) => {\r\n const sourceUrl = `${url}?key=${urlType ?? ''}`;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'Active', 'ExtraDdlId'],\r\n globalServiceGroupFilter: [],\r\n });\r\n};\r\n\r\nexport function ExtraDDLPicker(props: ExtraDDLPickerProps) {\r\n const { predicates, urlType, ...other } = props;\r\n\r\n const innerLoadData = loadData(predicates, urlType);\r\n return (\r\n \r\n );\r\n}\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n Autocomplete,\r\n AutocompleteGetTagProps,\r\n AutocompleteProps,\r\n AutocompleteRenderOptionState,\r\n} from '@material-ui/lab';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { autocompleteStyles } from 'styles/MUIExtend/autocompleteStyles';\r\nimport { Entity } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport interface AutocompleteMultiPickerProps<\r\n TKey,\r\n TValue extends Entity = Entity\r\n> extends Omit<\r\n AutocompleteProps,\r\n | 'multiple'\r\n | 'loading'\r\n | 'open'\r\n | 'options'\r\n | 'renderInput'\r\n | 'onChange'\r\n | 'classes'\r\n | 'renderTags'\r\n | 'renderOptionLabel'\r\n | 'renderOptions'\r\n > {\r\n value?: TValue[];\r\n label?: string;\r\n loadData: (searchTerm: string | null) => Promise;\r\n size?: 'medium' | 'small';\r\n mini?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n isOpen?: boolean;\r\n style?: CSSProperties;\r\n name?: string;\r\n placeholder?: string;\r\n error?: boolean;\r\n helperText?: string;\r\n onChange: (value: TValue[]) => void;\r\n required?: boolean;\r\n info?: string;\r\n id?: string;\r\n renderTags?: (\r\n value: TValue[],\r\n getTagProps: AutocompleteGetTagProps,\r\n ) => React.ReactNode | undefined;\r\n renderOptionLabel?: (value: TValue) => string | undefined;\r\n renderOptions?: (\r\n option: TValue,\r\n state: AutocompleteRenderOptionState,\r\n ) => React.ReactNode | undefined;\r\n onBlur?: React.FocusEventHandler;\r\n onChipClick?: (chip: TValue) => void;\r\n ariaLabel?: string;\r\n /**\r\n * Controls width of selected option chips. If true, every selected option will occupy full width of the picker, otherwise width will depend on option text content length\r\n */\r\n fullWdithOptions?: boolean;\r\n onPickerOpen?: () => void;\r\n}\r\n\r\nexport function AutocompleteMultiPicker<\r\n TKey,\r\n TValue extends Entity = Entity\r\n>({\r\n isOpen,\r\n size,\r\n mini,\r\n onOpen,\r\n onClose,\r\n label,\r\n fullWidth,\r\n fullWdithOptions,\r\n variant,\r\n name,\r\n placeholder,\r\n error,\r\n helperText,\r\n required,\r\n renderTags,\r\n loadData,\r\n disableClearable,\r\n onChange,\r\n onInputChange,\r\n getOptionSelected,\r\n getOptionLabel,\r\n renderOptionLabel,\r\n renderOptions,\r\n onBlur,\r\n value,\r\n defaultValue,\r\n info,\r\n id,\r\n onChipClick,\r\n ariaLabel,\r\n inputValue,\r\n onPickerOpen,\r\n ...props\r\n}: AutocompleteMultiPickerProps) {\r\n const classes = autocompleteStyles();\r\n let firstOpen = isOpen;\r\n const [open, setOpen] = React.useState(firstOpen);\r\n const [options, setOptions] = React.useState(null);\r\n const [searchTerm, setSearchTerm] = React.useState(null);\r\n const [hasSelected, setSelected] = React.useState(\r\n defaultValue && defaultValue.length > 0,\r\n );\r\n const [newInputValue, setInputValue] = React.useState(inputValue || '');\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n const loading = open && options === null;\r\n useEffectOnMount(() => {\r\n setSelected((value || []).length > 0);\r\n });\r\n React.useEffect(() => {\r\n let active = true;\r\n if (!loading) return undefined;\r\n\r\n (async () => {\r\n try {\r\n const data = await loadData(searchTerm);\r\n active && setOptions(data as TValue[]);\r\n } catch {}\r\n })();\r\n\r\n return () => {\r\n active = false;\r\n };\r\n }, [loading, loadData, searchTerm]);\r\n\r\n React.useEffect(() => {\r\n if (!open) setOptions(null);\r\n }, [open]);\r\n\r\n const handleRenderTags = (\r\n value: TValue[],\r\n getTagProps: AutocompleteGetTagProps,\r\n ) => {\r\n if (renderTags === undefined) {\r\n return value.map((option: TValue, index: number) => {\r\n const color = ((option as unknown) as IServiceFilterDto).Color;\r\n return (\r\n onChipClick?.(option)}\r\n variant=\"default\"\r\n size=\"small\"\r\n label={option.Name}\r\n custombgcolor={color ?? undefined}\r\n fullwidth={fullWdithOptions}\r\n {...getTagProps({ index })}\r\n />\r\n );\r\n });\r\n } else {\r\n return renderTags(value, getTagProps);\r\n }\r\n };\r\n const handleRenderOptionLabel = (option: TValue) => {\r\n return renderOptionLabel === undefined\r\n ? option.Name\r\n : (renderOptionLabel(option) as string);\r\n };\r\n return (\r\n {\r\n //onOpen && onOpen(e);\r\n !disableClearable && setOptions(null);\r\n setSearchTerm(null);\r\n setOpen(true);\r\n !!onPickerOpen && onPickerOpen();\r\n }}\r\n onClose={(e, r) => {\r\n //onClose && onClose(e, r);\r\n setSearchTerm(null);\r\n setOpen(false);\r\n }}\r\n onChange={(e, v, r, d) => {\r\n setSearchTerm(null);\r\n setInputValue('');\r\n setSelected(v.length > 0);\r\n onChange(v);\r\n }}\r\n onInputChange={(event, newValue, reason) => {\r\n if (reason === 'reset') return;\r\n setOptions(null);\r\n setInputValue(newValue);\r\n if (reason === 'input') setSearchTerm(newValue);\r\n //onInputChange && onInputChange(event, newValue, reason);\r\n }}\r\n getOptionSelected={\r\n getOptionSelected ?? ((option, value) => option.Id === value.Id)\r\n }\r\n getOptionLabel={handleRenderOptionLabel}\r\n renderTags={handleRenderTags}\r\n size={size}\r\n fullWidth={fullWidth}\r\n disableClearable={disableClearable}\r\n value={value ?? []}\r\n inputValue={newInputValue}\r\n popupIcon={}\r\n closeIcon={}\r\n selectOnFocus={isMobile ? false : true}\r\n renderInput={params => (\r\n \r\n {loading ? (\r\n \r\n ) : info ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ),\r\n startAdornment: params.InputProps.startAdornment,\r\n }}\r\n />\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, EntityType } from 'types/common';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from '../AutocompletePicker';\r\n\r\nexport interface BaseURLPickerProps\r\n extends Omit, 'loadData'> {\r\n url: string;\r\n queryfilter?: string | undefined;\r\n}\r\n\r\nexport function BaseURLPicker(\r\n props: BaseURLPickerProps,\r\n) {\r\n const { url, queryfilter, ...other } = props;\r\n const loadData = async (searchTerm: string | null) => {\r\n const params: { $orderby: string; $top: number; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n $top: 100,\r\n };\r\n const predicates: string[] = [];\r\n if (queryfilter !== undefined && queryfilter !== '') {\r\n predicates.push(queryfilter);\r\n }\r\n if (searchTerm !== null || predicates.length > 0) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm ?? undefined,\r\n }).toString();\r\n }\r\n const response = await httpClient.get(url, params);\r\n return response.value;\r\n };\r\n return ;\r\n}\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\n/* --- STATE --- */\r\nexport interface SavedViewState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n processing: boolean;\r\n selectedSavedView?: ISavedViewDto;\r\n savedViewUserName?: string;\r\n SavedViewExtraData?: SavedViewExtraData;\r\n}\r\nexport interface SavedViewSelected {\r\n listId: number | undefined;\r\n ids: string | undefined;\r\n assetIds: string | undefined;\r\n multiple: boolean;\r\n}\r\nexport interface SavedViewResponse extends IResponseType {\r\n Id?: number;\r\n}\r\nexport interface SavedViewDetailsState {\r\n Id: number;\r\n Name: string;\r\n Assets: Entity[];\r\n Shared?: boolean;\r\n Multiple?: boolean;\r\n // SharedTo: Entity | null;\r\n // SharedUsers: Entity[];\r\n // SharedCores: Entity[];\r\n}\r\nexport function ConvertEntityToModel(\r\n entity: ISavedViewDto,\r\n): SavedViewDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: entity.Id,\r\n Name: entity.Name,\r\n Assets: entity.Assets,\r\n Shared: entity.Shared,\r\n Multiple: entity.Multiple,\r\n // SharedTo: getSingleSharedTo(entity.SharedTo),\r\n // SharedUsers: entity.SharedUsers,\r\n // SharedCores: entity.SharedCores,\r\n } as SavedViewDetailsState;\r\n }\r\n}\r\nexport function ConvertModelToEntity(\r\n model: SavedViewDetailsState,\r\n original: SavedViewDetailsState | undefined,\r\n): ISavedViewDto {\r\n let entity = {\r\n Id: original?.Id === undefined ? model.Id : original.Id,\r\n Name: model.Name,\r\n Shared: model.Shared,\r\n Multiple: model.Multiple,\r\n Assets: model.Assets,\r\n // SharedTo: model.SharedTo?.Id ?? 0,\r\n // SharedUsers: model.SharedUsers as IUserFilterDto[],\r\n // SharedCores: model.SharedCores as IServiceGroupDto[],\r\n } as ISavedViewDto;\r\n return entity;\r\n}\r\n\r\nexport function GetExtraData(model: ISavedViewDto): SavedViewExtraData {\r\n return {\r\n userName: model.UserNameDisplay,\r\n createdAt: model.CreatedAt,\r\n usages: model.UsageCount,\r\n };\r\n}\r\n\r\nexport interface SavedViewExtraData {\r\n userName: string;\r\n createdAt: Date | null;\r\n usages: number;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest, select } from 'redux-saga/effects';\r\nimport { savedViewActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport {\r\n ConvertModelToEntity,\r\n SavedViewDetailsState,\r\n SavedViewResponse,\r\n} from './types';\r\nimport { savedViewsApi as api, savedViewsApi } from 'api/savedViewsApi';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { SavedViewDetailsProps } from '../Details';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { Entity } from 'types/common';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\n\r\nconst loadNew = async (eid?: string): Promise => {\r\n if (!!eid && eid !== '') {\r\n return initAssetsData(eid, true).then(data => {\r\n return {\r\n Id: -1,\r\n Name: '',\r\n Assets: data,\r\n Shared: false,\r\n Multiple: false,\r\n // SharedTo: null,\r\n // SharedUsers: [] as Entity[],\r\n // SharedCores: [] as Entity[],\r\n } as SavedViewDetailsState;\r\n });\r\n } else {\r\n return new Promise(resolve => {\r\n resolve({\r\n Id: -1,\r\n Name: '',\r\n Assets: [] as Entity[],\r\n Shared: false,\r\n Multiple: false,\r\n // SharedTo: null,\r\n // SharedUsers: [] as Entity[],\r\n // SharedCores: [] as Entity[],\r\n } as SavedViewDetailsState);\r\n });\r\n }\r\n};\r\n\r\nfunction* doInitNewDetails(action: PayloadAction) {\r\n try {\r\n const data = yield call(loadNew, action.payload);\r\n yield put(actions.initNewDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initNewDetails_Error(Error));\r\n }\r\n}\r\nfunction* doInitDetails(action: PayloadAction) {\r\n try {\r\n const data = yield call(api.initUpdateData, action.payload);\r\n console.log(data);\r\n yield put(actions.initDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initDetails_Error(Error));\r\n }\r\n}\r\nfunction* doCreate(action: PayloadAction) {\r\n const httpPayload: ISavedViewDto = ConvertModelToEntity(\r\n action.payload,\r\n undefined,\r\n );\r\n try {\r\n let responses: SavedViewResponse[] = [];\r\n const result = yield call(api.createSavedView, httpPayload);\r\n responses.push(result);\r\n\r\n let responseErrors = responses\r\n .filter(err => err.ErrorMessages.length > 0)\r\n .flatMap(f => f.ErrorMessages);\r\n\r\n let responseWarnings = responses\r\n .filter(err => err.WarningMessages.length > 0)\r\n .flatMap(f => f.WarningMessages);\r\n let responseSuccess = responses\r\n .filter(err => err.SuccessMessages.length > 0)\r\n .flatMap(f => f.SuccessMessages);\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: 'savedViewInsert',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: 'savedViewInsert',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (responseSuccess.length > 0) {\r\n let res = responses[0];\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewInsert',\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: res.Id,\r\n created: true,\r\n itemName: i18next.t(translations.MyInstrumentList),\r\n detailsType: RenderPageType.SavedViewDetails,\r\n detailsTypeProps: {\r\n id: '' + res.Id,\r\n useSidePanel: true,\r\n } as SavedViewDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors =\r\n responses.filter(f => f.ErrorMessages.length > 0).length > 0;\r\n yield put(\r\n actions.createView_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createView_Error(Error));\r\n }\r\n}\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: SavedViewDetailsState;\r\n original: SavedViewDetailsState | undefined;\r\n }>,\r\n) {\r\n const httpPayload: ISavedViewDto = ConvertModelToEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n // const currentSelected = yield select(selectMyListSelected);\r\n // const userProfileSettings = yield select(selectUserProfileSettings);\r\n // let listViewSelected = currentSelected;\r\n // if (!listViewSelected) {\r\n // let proffSettings = userProfileSettings.GetSettingValueBy(\r\n // f => f.Key.toLowerCase() === 'myListSelected'.toLowerCase(),\r\n // );\r\n // listViewSelected = !!proffSettings\r\n // ? {\r\n // listId:\r\n // proffSettings.Name === null\r\n // ? undefined\r\n // : parseInt(proffSettings.Name),\r\n // ids: proffSettings.Value ?? undefined,\r\n // assetIds: proffSettings.DefaultGroups ?? undefined,\r\n // }\r\n // : undefined;\r\n // }\r\n try {\r\n const results = yield call(api.updateSavedView, httpPayload);\r\n let response = results as SavedViewResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'savedViewUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'savedViewUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewUpdate',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: i18next.t(translations.MyInstrumentList),\r\n detailsType: RenderPageType.SavedViewDetails,\r\n detailsTypeProps: {\r\n id: '' + response.Id,\r\n useSidePanel: true,\r\n } as SavedViewDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n // if (!!listViewSelected && !!listViewSelected.listId) {\r\n // if (listViewSelected.listId === action.payload.original?.Id) {\r\n // yield call(doSelectView, {\r\n // payload: httpPayload,\r\n // type: actions.selectMyList.type,\r\n // });\r\n // }\r\n // }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateView_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateView_Error(Error));\r\n }\r\n}\r\nfunction* doUpdateViewAssets(\r\n action: PayloadAction<{ assets: Entity[]; view: ISavedViewDto }>,\r\n) {\r\n const newAssets: Entity[] = [];\r\n // const currentSelected = yield select(selectMyListSelected);\r\n // const userProfileSettings = yield select(selectUserProfileSettings);\r\n // let listViewSelected = currentSelected;\r\n // if (!listViewSelected) {\r\n // let proffSettings = userProfileSettings.GetSettingValueBy(\r\n // f => f.Key.toLowerCase() === 'myListSelected'.toLowerCase(),\r\n // );\r\n // listViewSelected = !!proffSettings\r\n // ? {\r\n // listId:\r\n // proffSettings.Name === null\r\n // ? undefined\r\n // : parseInt(proffSettings.Name),\r\n // ids: proffSettings.Value ?? undefined,\r\n // assetIds: proffSettings.DefaultGroups ?? undefined,\r\n // }\r\n // : undefined;\r\n // }\r\n action.payload.assets.forEach(el => {\r\n let a = action.payload.view.Assets.find(a => a.Id === el.Id);\r\n if (a === undefined) {\r\n newAssets.push(el);\r\n }\r\n });\r\n let groupId = (newAssets[0] as IAssetDto).ServiceGroupId;\r\n const shared =\r\n action.payload.view.Shared === true\r\n ? !newAssets.some(f => (f as IAssetDto).ServiceGroupId !== groupId)\r\n : false;\r\n const httpPayload: ISavedViewDto = Object.assign({}, action.payload.view, {\r\n Assets: newAssets.concat(action.payload.view.Assets),\r\n Shared: shared,\r\n });\r\n\r\n try {\r\n const results = yield call(api.updateSavedView, httpPayload);\r\n let response = results as SavedViewResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'savedViewUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'savedViewUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewUpdate',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n // if (!!listViewSelected && !!listViewSelected.listId) {\r\n // if (listViewSelected.listId === action.payload.view.Id) {\r\n // yield call(doSelectView, {\r\n // payload: httpPayload,\r\n // type: actions.selectMyList.type,\r\n // });\r\n // }\r\n // }\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateViewAssets_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'savedViewUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateViewAssets_Error(Error));\r\n }\r\n}\r\nfunction* doSelectSavedView(action: PayloadAction) {\r\n try {\r\n if (action.payload === undefined) {\r\n yield put(actions.selectSavedView_Success());\r\n return;\r\n }\r\n\r\n const x: ISavedViewDto = yield call(\r\n savedViewsApi.initUpdateData,\r\n action.payload,\r\n );\r\n // check if the saved view belongs to current service groups selection\r\n const serviceGroups: Array> | undefined = yield select(\r\n selectGlobalServiceGroupFilter,\r\n );\r\n const serviceGroupIds = serviceGroups?.map(f => f.Id);\r\n const belongsToServiceGroupsSelection =\r\n serviceGroups === undefined ||\r\n serviceGroups?.length === 0 ||\r\n x.Assets.every(\r\n asset => serviceGroupIds?.includes(asset.ServiceGroupId ?? 0) === true,\r\n );\r\n if (belongsToServiceGroupsSelection) {\r\n yield put(actions.selectSavedView_Success(x));\r\n } else {\r\n yield put(actions.selectSavedView_Success());\r\n }\r\n } catch (error) {\r\n yield put(actions.selectSavedView_Success());\r\n }\r\n}\r\nfunction* doPatch(action: PayloadAction>) {\r\n try {\r\n yield call(savedViewsApi.patch, action.payload);\r\n yield put(actions.patch_success(action.payload));\r\n } catch (error) {\r\n //noop\r\n console.log(error);\r\n }\r\n}\r\n\r\nfunction* doUseSavedView(action: PayloadAction) {\r\n try {\r\n const res = yield call(api.useSavedView, action.payload);\r\n if (!res) return;\r\n yield put(actions.useSavedView_success(res.value));\r\n } catch (error) {}\r\n}\r\n\r\nexport function* savedViewSaga() {\r\n yield takeLatest(actions.initNewDetails.type, doInitNewDetails);\r\n yield takeLatest(actions.initDetails.type, doInitDetails);\r\n yield takeLatest(actions.createView.type, doCreate);\r\n yield takeLatest(actions.updateView.type, doUpdate);\r\n yield takeLatest(actions.updateViewAssets.type, doUpdateViewAssets);\r\n yield takeLatest(actions.selectSavedView.type, doSelectSavedView);\r\n yield takeLatest(actions.patch.type, doPatch);\r\n yield takeLatest(actions.useSavedView.type, doUseSavedView);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { Entity } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { savedViewSaga } from './saga';\r\nimport {\r\n ConvertEntityToModel,\r\n GetExtraData,\r\n SavedViewDetailsState,\r\n SavedViewState,\r\n} from './types';\r\n\r\nexport const initialState: SavedViewState = {\r\n processing: false,\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'savedView',\r\n initialState,\r\n reducers: {\r\n initNewDetails(state, action: PayloadAction) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initNewDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.createState.data = action.payload;\r\n },\r\n initNewDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.createState.data = {\r\n Id: -1,\r\n Name: '',\r\n Assets: [] as Entity[],\r\n Shared: false,\r\n Multiple: false,\r\n // SharedTo: null,\r\n // SharedUsers: [] as Entity[],\r\n // SharedCores: [] as Entity[],\r\n } as SavedViewDetailsState;\r\n },\r\n initDetails(state, action: PayloadAction) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initDetails_Success(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.updateState.data = ConvertEntityToModel(action.payload);\r\n state.savedViewUserName = action.payload?.UserName;\r\n state.SavedViewExtraData = GetExtraData(action.payload);\r\n },\r\n initDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n createView(state, action: PayloadAction) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createView_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.createState.processing = false;\r\n state.createState.hasErrors = action.payload.hasErrors;\r\n state.createState.completed = true;\r\n },\r\n createView_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n state.createState.hasErrors = true;\r\n },\r\n updateView(\r\n state,\r\n action: PayloadAction<{\r\n current: SavedViewDetailsState;\r\n original: SavedViewDetailsState | undefined;\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateView_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n },\r\n updateView_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n updateViewAssets(\r\n state,\r\n action: PayloadAction<{ assets: Entity[]; view: ISavedViewDto }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateViewAssets_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n },\r\n updateViewAssets_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n resetCreateSavedViewState(state, action: PayloadAction) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n resetUpdateSavedViewState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n selectMyList(state, action: PayloadAction) {},\r\n\r\n selectSavedView(state, action: PayloadAction) {\r\n state.selectedSavedView = undefined;\r\n },\r\n selectSavedView_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.selectedSavedView = action.payload;\r\n },\r\n selectSavedView_Error(state, action: PayloadAction) {\r\n state.selectedSavedView = undefined;\r\n },\r\n patch(state, action: PayloadAction>) {},\r\n patch_success(state, action: PayloadAction>) {\r\n state.selectedSavedView = Object.assign(\r\n state.selectedSavedView,\r\n action.payload,\r\n );\r\n },\r\n useSavedView(state, action: PayloadAction) {},\r\n useSavedView_success(state, action: PayloadAction) {\r\n if (state.SavedViewExtraData?.usages !== undefined) {\r\n state.SavedViewExtraData.usages = action.payload;\r\n }\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: savedViewActions } = slice;\r\n\r\nexport const useSavedViewSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: savedViewSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useSavedViewSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","export enum EmptySlotAdminClick {\r\n WhatToAdd = 0,\r\n ReservationsOnly = 1,\r\n DownTimeOnly = 2,\r\n}\r\n","import * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport interface IUseProfileProps {\r\n profileSettingKey: string;\r\n}\r\nexport const useProfileSetting = (\r\n props: IUseProfileProps,\r\n): {\r\n savedValue: string | undefined;\r\n updateValue: (value: string) => void;\r\n savedEnabled: boolean | undefined;\r\n updateEnabled: (enabled: boolean) => void;\r\n} => {\r\n const { actions } = useAppSettingsSlice();\r\n const dispatch = useDispatch();\r\n const userProfileSettings = useSelector(selectUserProfileSettings);\r\n const key = props.profileSettingKey.toLowerCase();\r\n const userProfileSetting = userProfileSettings.GetSettingValueBy(\r\n f => f.Key.toLowerCase() === key,\r\n );\r\n\r\n const savedValue = userProfileSetting?.Value ?? undefined;\r\n const savedEnabled = userProfileSetting?.Enabled ?? undefined;\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n const updateValue = React.useCallback(\r\n (value: string) => {\r\n if (authenticatedUser === undefined) {\r\n return;\r\n }\r\n dispatch(\r\n actions.saveUserProfileSetting({\r\n Key: props.profileSettingKey,\r\n Value: value,\r\n UserName: authenticatedUser?.Id,\r\n Enabled: true,\r\n }),\r\n );\r\n },\r\n [actions, authenticatedUser, dispatch, props.profileSettingKey],\r\n );\r\n const updateEnabled = React.useCallback(\r\n (value: boolean) => {\r\n if (authenticatedUser === undefined) {\r\n return;\r\n }\r\n if (value === savedEnabled) {\r\n return;\r\n }\r\n dispatch(\r\n actions.saveUserProfileSetting({\r\n Key: props.profileSettingKey,\r\n Value: savedValue || null,\r\n UserName: authenticatedUser?.Id,\r\n Enabled: value,\r\n }),\r\n );\r\n },\r\n [\r\n actions,\r\n authenticatedUser,\r\n dispatch,\r\n props.profileSettingKey,\r\n savedEnabled,\r\n savedValue,\r\n ],\r\n );\r\n return { savedValue, updateValue, savedEnabled, updateEnabled };\r\n};\r\n","import { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\nimport { useCallback } from 'react';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const useUploadToNewComment = () => {\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const onCommentAdded = useCallback(\r\n (comment: Identifiable) => {\r\n dispatch(largeFileActions.setCanUpload(comment.Id));\r\n },\r\n [dispatch, largeFileActions],\r\n );\r\n return { onCommentAdded };\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { SwitchProps } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { BasicToggle } from '../BasicToggle';\r\n\r\nexport interface FormSwitchProps extends SwitchProps {\r\n label?: string;\r\n helperText?: string;\r\n boldLebel?: boolean;\r\n maxLabelWidth?: string | number;\r\n boxed?: boolean;\r\n}\r\nexport const FormSwitch = ({\r\n label,\r\n name,\r\n onBlur,\r\n onChange,\r\n boldLebel,\r\n maxLabelWidth,\r\n ...props\r\n}: FormSwitchProps & FieldHookConfig & IFieldProps) => {\r\n const [field, meta] = useField({ name, ...props });\r\n const handleChange = (value, event) => {\r\n if (onChange !== undefined) {\r\n onChange(event);\r\n }\r\n field.onChange(event);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.savedView || initialState;\r\n\r\nexport const selectSavedView = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSavedViewProcessing = createSelector(\r\n [selectSavedView],\r\n state => state.processing,\r\n);\r\nexport const selectCreateSavedViewProcessing = createSelector(\r\n [selectSavedView],\r\n state => state.createState.processing,\r\n);\r\nexport const selectUpdateSavedViewProcessing = createSelector(\r\n [selectSavedView],\r\n state => state.updateState.processing,\r\n);\r\nexport const selectCreateSavedView = createSelector(\r\n [selectSavedView],\r\n state => state.createState.data,\r\n);\r\nexport const selectUpdateSavedView = createSelector(\r\n [selectSavedView],\r\n state => state.updateState.data,\r\n);\r\nexport const selectUpdateUserName = createSelector(\r\n [selectSavedView],\r\n state => state.savedViewUserName,\r\n);\r\nexport const selectExtraData = createSelector(\r\n [selectSavedView],\r\n state => state.SavedViewExtraData,\r\n);\r\nexport const selectCreateSavedViewCompleted = createSelector(\r\n [selectSavedView],\r\n state => state.createState.completed,\r\n);\r\nexport const selectUpdateSavedViewCompleted = createSelector(\r\n [selectSavedView],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectCreateSavedViewHasError = createSelector(\r\n [selectSavedView],\r\n state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateSavedViewHasError = createSelector(\r\n [selectSavedView],\r\n state => state.updateState.hasErrors,\r\n);\r\nexport const selectSelectedSavedView = createSelector(\r\n [selectSavedView],\r\n state => state.selectedSavedView,\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BookitDatePickerProps } from 'app/components/BookitDatePicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\n/**\r\n * TODO:\r\n * A non-serializable value was detected in an action, in the path: `payload.ReceivedAt`. Value: \r\nDate Sun May 02 2021 14:58:00 GMT+0300 (Israel Daylight Time)\r\n \r\nTake a look at the logic that dispatched this action: \r\nObject { type: \"animals/insertItem\", payload: {…} }\r\n \r\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string…t-least-serializable-why-should-my-action-types-be-constants) \r\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\r\n * */\r\n\r\nexport const FormBookitDateTimePicker = ({\r\n label,\r\n disableFuture,\r\n disablePast,\r\n ...props\r\n}: FieldHookConfig &\r\n Pick<\r\n BookitDatePickerProps,\r\n | 'endTime'\r\n | 'truncateTime'\r\n | 'minDate'\r\n | 'maxDate'\r\n | 'labelFunc'\r\n | 'clearable'\r\n | 'fullScreen'\r\n | 'minutesStep'\r\n | 'dateLabel'\r\n | 'timeLabel'\r\n | 'maskIfEmpty'\r\n | 'saveOnSelect'\r\n > & { labelInline?: boolean } & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n fullWidth={true}\r\n helperText={meta.error}\r\n dateLabel={props.dateLabel}\r\n timeLabel={props.timeLabel}\r\n labelFunc={props.labelFunc}\r\n info={props.info}\r\n disabled={props.disabled}\r\n clearable={props.clearable}\r\n fullScreen={props.fullScreen}\r\n endTime={props.endTime}\r\n truncateTime={props.truncateTime}\r\n autoFocus={props.autoFocus}\r\n minDate={props.minDate}\r\n maxDate={props.maxDate}\r\n minutesStep={props.minutesStep || 15}\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * ExtraDDLFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ExtraDDLPicker } from 'app/components/pickers/AutocompletePickers/ExtraddlPicker';\r\n\r\nexport const ExtraDDLFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n );\r\n};\r\nexport default ExtraDDLFilter;\r\n","/**\r\n *\r\n * UserGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserGroupPickerProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/UserGroupFilter';\r\nconst restrictedUrl = '/api/odata/v4/UserGroupFilter/Restricted';\r\nexport const initUserGroupData = (initval: string) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition>(\r\n 'Id',\r\n ODataOperators.Equals,\r\n initval,\r\n ).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport function UserGroupPicker(props: UserGroupPickerProps) {\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: props.predicates,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'DepartmentId',\r\n 'DepartmentName',\r\n 'InstituteId',\r\n 'InstituteName',\r\n 'InstituteTypeId',\r\n 'InstituteTypeName',\r\n 'AffiliatedGroups',\r\n 'IsUserOwneGroup',\r\n ],\r\n });\r\n return (\r\n \r\n );\r\n}\r\nexport function RestrictedUserGroupPicker(props: UserGroupPickerProps) {\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url: restrictedUrl,\r\n predicates: props.predicates,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'DepartmentId',\r\n 'DepartmentName',\r\n 'InstituteId',\r\n 'InstituteName',\r\n 'InstituteTypeId',\r\n 'InstituteTypeName',\r\n 'AffiliatedGroups',\r\n 'IsUserOwneGroup',\r\n ],\r\n });\r\n return (\r\n \r\n );\r\n}\r\nexport function RestrictedFilter(\r\n departmentId?: number,\r\n instituteId?: number,\r\n instituteTypeId?: number,\r\n restricted?: boolean,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!departmentId) {\r\n predicates.push(\r\n new Condition(\r\n 'DepartmentId',\r\n ODataOperators.Equals,\r\n departmentId,\r\n ),\r\n );\r\n }\r\n if (!!instituteId) {\r\n predicates.push(\r\n new Condition(\r\n 'InstituteId',\r\n ODataOperators.Equals,\r\n instituteId,\r\n ),\r\n );\r\n }\r\n if (!!instituteTypeId) {\r\n predicates.push(\r\n new Condition(\r\n 'InstituteTypeId',\r\n ODataOperators.Equals,\r\n instituteTypeId,\r\n ),\r\n );\r\n }\r\n if (restricted) {\r\n predicates.push(\r\n new Condition(\r\n 'IsUserOwneGroup',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n Autocomplete,\r\n AutocompleteGetTagProps,\r\n AutocompleteProps,\r\n AutocompleteRenderOptionState,\r\n} from '@material-ui/lab';\r\nimport { BookitChip, BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { autocompleteStyles } from 'styles/MUIExtend/autocompleteStyles';\r\nimport { EntityType } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n ColoredOption,\r\n extractDataFromResponse,\r\n IDisableable,\r\n InfoOption,\r\n loadDataAndPrepareOptions,\r\n NonRemoveableOption,\r\n NonSelectableOption,\r\n OptionType,\r\n} from '../Utils/autoCompletePickerUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\n\r\nexport interface AutocompleteMultiPickerExProps\r\n extends Omit<\r\n AutocompleteProps, true, boolean | undefined, false>,\r\n | 'multiple'\r\n | 'loading'\r\n | 'open'\r\n | 'options'\r\n | 'renderInput'\r\n | 'onChange'\r\n | 'classes'\r\n | 'renderTags'\r\n | 'renderOptionLabel'\r\n | 'renderOptions'\r\n > {\r\n value?: TEntity[];\r\n label?: string;\r\n loadData: (\r\n searchTerm: string | null,\r\n predicates?: (string | Condition)[],\r\n expandedColumns?: string,\r\n ) => Promise;\r\n size?: 'medium' | 'small';\r\n mini?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n isOpen?: boolean;\r\n style?: CSSProperties;\r\n name?: string;\r\n placeholder?: string;\r\n error?: boolean;\r\n helperText?: string;\r\n onChange?: (value: TEntity[]) => void;\r\n required?: boolean;\r\n info?: string;\r\n id?: string;\r\n renderTags?: (\r\n value: TEntity[],\r\n getTagProps: AutocompleteGetTagProps,\r\n ) => React.ReactNode | undefined;\r\n renderOptionLabel?: (value: TEntity) => string | undefined;\r\n renderOptions?: (\r\n option: TEntity,\r\n state: AutocompleteRenderOptionState,\r\n ) => React.ReactNode | undefined;\r\n onBlur?: React.FocusEventHandler;\r\n onChipClick?: (chip: TEntity) => void;\r\n ariaLabel?: string;\r\n predicates?: (string | Condition)[];\r\n additionalItem?: TEntity | null;\r\n expandedColumns?: string;\r\n onPickerOpen?: () => void;\r\n}\r\n\r\n/**\r\n * A copy of AutocompleteMultiPicker with addition of limiting the length of options shown\r\n * TODO: merge with AutocompleteMultiPicker + apply to BaseURLMultiPicker\r\n */\r\nexport function AutocompleteMultiPickerEx({\r\n isOpen,\r\n size,\r\n mini,\r\n onOpen,\r\n onClose,\r\n label,\r\n fullWidth,\r\n variant,\r\n name,\r\n placeholder,\r\n error,\r\n helperText,\r\n required,\r\n renderTags,\r\n loadData,\r\n disableClearable,\r\n onChange,\r\n onInputChange,\r\n getOptionSelected,\r\n getOptionLabel,\r\n renderOptionLabel,\r\n renderOptions,\r\n onBlur,\r\n value,\r\n defaultValue,\r\n info,\r\n id,\r\n onChipClick,\r\n ariaLabel,\r\n predicates,\r\n additionalItem,\r\n expandedColumns,\r\n onPickerOpen,\r\n ...props\r\n}: AutocompleteMultiPickerExProps) {\r\n const { t } = useTranslation();\r\n const classes = autocompleteStyles();\r\n let firstOpen = isOpen;\r\n const [open, setOpen] = React.useState(firstOpen);\r\n const [options, setOptions] = React.useState[] | null>(\r\n null,\r\n );\r\n const [searchTerm, setSearchTerm] = React.useState(null);\r\n const [hasSelected, setSelected] = React.useState(\r\n defaultValue && defaultValue.length > 0,\r\n );\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n const loading = open && options === null;\r\n useEffectOnMount(() => {\r\n setSelected((value || []).length > 0);\r\n });\r\n React.useEffect(() => {\r\n let active = true;\r\n if (!loading) return undefined;\r\n\r\n (async () => {\r\n try {\r\n const rawResponse = await loadData(\r\n searchTerm,\r\n predicates,\r\n expandedColumns,\r\n );\r\n const response = extractDataFromResponse(rawResponse);\r\n const optionsData = loadDataAndPrepareOptions({\r\n response,\r\n additionalItem,\r\n t,\r\n });\r\n active && setOptions(optionsData);\r\n } catch {}\r\n })();\r\n\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n loading,\r\n loadData,\r\n searchTerm,\r\n t,\r\n predicates,\r\n additionalItem,\r\n expandedColumns,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (!open) setOptions(null);\r\n }, [open]);\r\n\r\n const handleRenderTags = (\r\n value: OptionType[],\r\n getTagProps: AutocompleteGetTagProps,\r\n ) => {\r\n const selectable = value.filter(\r\n option => (option as NonSelectableOption)?.disabled !== true,\r\n );\r\n if (renderTags === undefined) {\r\n return selectable.map((option: OptionType, index: number) =>\r\n !!(option as InfoOption).titleInfo ? (\r\n onChipClick?.(option as TEntity)}\r\n variant=\"default\"\r\n size=\"small\"\r\n label={option.Name}\r\n custombgcolor={\r\n undefinedIfIsEmpty((option as ColoredOption)?.Color) ?? undefined\r\n }\r\n info={(option as InfoOption).titleInfo}\r\n notremoved={(option as NonRemoveableOption)?.noremoved}\r\n {...getTagProps({ index })}\r\n />\r\n ) : (\r\n onChipClick?.(option as TEntity)}\r\n variant=\"default\"\r\n size=\"small\"\r\n label={option.Name}\r\n custombgcolor={\r\n undefinedIfIsEmpty((option as ColoredOption)?.Color) ?? undefined\r\n }\r\n notremoved={(option as NonRemoveableOption)?.noremoved}\r\n {...getTagProps({ index })}\r\n />\r\n ),\r\n );\r\n } else {\r\n return renderTags(selectable as TEntity[], getTagProps);\r\n }\r\n };\r\n const handleRenderOptionLabel = (option: OptionType) => {\r\n return renderOptionLabel === undefined\r\n ? option.Name\r\n : (renderOptionLabel(option as TEntity) as string);\r\n };\r\n const getIsOptionSelected_Internal = (\r\n option: OptionType,\r\n value: OptionType,\r\n ) => {\r\n if ((option as NonSelectableOption).disabled !== undefined) {\r\n return false;\r\n }\r\n var id = (option as TEntity)?.Id;\r\n var selectable = id !== undefined;\r\n\r\n if (!selectable) {\r\n return false;\r\n } else if (getOptionSelected !== undefined) {\r\n return getOptionSelected(option as TEntity, value as TEntity);\r\n } else {\r\n return id === (value as TEntity)?.Id;\r\n }\r\n };\r\n const getOptionDisabled = (option: OptionType) =>\r\n (option as IDisableable)?.disabled ?? false;\r\n\r\n return (\r\n []) ?? []}\r\n open={open || false}\r\n onOpen={e => {\r\n //onOpen && onOpen(e);\r\n !disableClearable && setOptions(null);\r\n setSearchTerm(null);\r\n setOpen(true);\r\n !!onPickerOpen && onPickerOpen();\r\n }}\r\n onClose={(e, r) => {\r\n //onClose && onClose(e, r);\r\n setSearchTerm(null);\r\n setOpen(false);\r\n }}\r\n onChange={(e, v, r, d) => {\r\n setSearchTerm(null);\r\n setSelected(v.length > 0);\r\n if (onChange) {\r\n onChange(v as TEntity[]);\r\n }\r\n }}\r\n onInputChange={(event, newValue, reason) => {\r\n setOptions(null);\r\n if (reason === 'input') setSearchTerm(newValue);\r\n //onInputChange && onInputChange(event, newValue, reason);\r\n }}\r\n getOptionSelected={getIsOptionSelected_Internal}\r\n getOptionDisabled={getOptionDisabled}\r\n getOptionLabel={handleRenderOptionLabel}\r\n renderTags={handleRenderTags}\r\n size={size}\r\n fullWidth={fullWidth}\r\n disableClearable={disableClearable}\r\n value={value || undefined}\r\n popupIcon={}\r\n closeIcon={}\r\n selectOnFocus={isMobile ? false : true}\r\n renderInput={params => (\r\n \r\n {loading ? (\r\n \r\n ) : info ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ),\r\n startAdornment: params.InputProps.startAdornment,\r\n }}\r\n />\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import { generatePath } from 'react-router';\r\n\r\nexport const ServiceRequestDetailsPath = '/requests/:id';\r\nexport const GetServiceRequestDetailsPath = (serviceRequestId: number) =>\r\n generatePath(ServiceRequestDetailsPath, {\r\n id: serviceRequestId,\r\n });\r\n","import { toRootedURL } from 'utils/url-utils';\r\nexport type ImageSize =\r\n | 'full'\r\n | 'thumb'\r\n | 'thumbSmall'\r\n | 'thumbLarge'\r\n | 'horizontal'\r\n | 'horizontalLarge'\r\n | 'vertical'\r\n | 'verticalLarge';\r\n\r\nexport function getAssetImageThumbSrc(\r\n imageName: string | null,\r\n imageSize?: ImageSize,\r\n imageExist?: boolean,\r\n defaultImage?: string,\r\n): string | undefined {\r\n if (imageName === null || imageExist === false) {\r\n return toRootedURL(defaultImage ?? getDefaultImage(imageSize));\r\n }\r\n switch (imageSize) {\r\n case 'full':\r\n return toRootedURL(`/uploads/assets/${imageName}`);\r\n case 'horizontal':\r\n return toRootedURL(`/uploads/assets/cardhorizontal/${imageName}`);\r\n case 'horizontalLarge':\r\n return toRootedURL(`/uploads/assets/cardhorizontallarge/${imageName}`);\r\n case 'vertical':\r\n return toRootedURL(`/uploads/assets/cardvertical/${imageName}`);\r\n case 'verticalLarge':\r\n return toRootedURL(`/uploads/assets/cardverticallarge/${imageName}`);\r\n case 'thumbSmall':\r\n return toRootedURL(`/uploads/assets/thumbsSmall/${imageName}`);\r\n case 'thumbLarge':\r\n return toRootedURL(`/uploads/assets/thumbsLarge/${imageName}`);\r\n case 'thumb':\r\n default:\r\n return toRootedURL(`/uploads/assets/thumbs/${imageName}`);\r\n }\r\n}\r\nexport function getDefaultImage(size?: ImageSize) {\r\n switch (size) {\r\n case 'full':\r\n return `/images/200x150.png`;\r\n case 'thumb':\r\n return `/images/64x64.png`;\r\n case 'thumbSmall':\r\n return `/images/64x38.png`;\r\n case 'thumbLarge':\r\n return `/images/80x80.png`;\r\n case 'vertical':\r\n return `/images/278x174.png`;\r\n case 'verticalLarge':\r\n return `/images/457x240.png`;\r\n case 'horizontal':\r\n return `/images/180x201.png`;\r\n case 'horizontalLarge':\r\n return `/images/207x201.png`;\r\n case undefined:\r\n default:\r\n return `/images/64x64.png`;\r\n }\r\n}\r\nexport function getAssetImageSrc(\r\n imageName: string | null,\r\n imageExist?: boolean,\r\n defaultImage?: string,\r\n): string | undefined {\r\n if (imageName === null || imageExist === false) {\r\n return toRootedURL(defaultImage ?? `/images/200x150.png`);\r\n }\r\n return toRootedURL(`/uploads/assets/${imageName}`);\r\n}\r\n","/**\r\n * Parses the stored relative HRef without in a way to match how URL is parsed to produce the pathName + search\r\n * Used to save the stored filters/pathnames in the pages with the filters.\r\n * Has to be backward compatible with the aspx filters where only the search without the path was stored (e.g. foo=bar&baz=...)\r\n * @param value stored \"saved url\" value\r\n * @returns pathName + search\r\n */\r\nexport const parseProfileUrl = (\r\n value?: string,\r\n): {\r\n pathName?: string;\r\n search?: string;\r\n} => {\r\n if (value === undefined || value === null) {\r\n return {\r\n pathName: undefined,\r\n search: undefined,\r\n };\r\n }\r\n const i = value.indexOf('?');\r\n if (i < 0) {\r\n return {\r\n pathName: undefined,\r\n search: '?' + value,\r\n };\r\n }\r\n\r\n const part1 = value.slice(0, i);\r\n const part2 = value.slice(i + 1);\r\n\r\n return {\r\n pathName: undefinedIfIsEmpty(part1),\r\n search: undefinedIfIsEmpty(part2),\r\n };\r\n};\r\n\r\nexport const undefinedIfIsEmpty = (\r\n s: string | null | undefined,\r\n): string | undefined => (isEmpty(s) ? undefined : s ?? undefined);\r\n\r\nexport const isEmpty = (s: string | null | undefined): boolean => {\r\n if (s === null || s === undefined) {\r\n return true;\r\n }\r\n if (s.trim() === '') {\r\n return true;\r\n }\r\n return false;\r\n};\r\n","export enum PartOfDay {\r\n Undefined = -1,\r\n /// \r\n /// Combines what was perviously named as Day/Night. Replaced by the TimeSlotTypes\r\n /// \r\n BusinessHours = 0,\r\n OffLine = 2,\r\n Tutoring = 3,\r\n NoTutoring = 4,\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n call,\r\n put,\r\n select,\r\n takeEvery,\r\n takeLatest,\r\n debounce,\r\n all,\r\n} from 'redux-saga/effects';\r\nimport { schedulerActions as actions } from '.';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n ReservationDetailsState,\r\n ReservationQueryStringParameters,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n ChangeServicesAction,\r\n ChangeViewModeAction,\r\n GetServicesAction,\r\n IEditEvent,\r\n INewEvent,\r\n ISchedulerService,\r\n ISerializableFilterSettings,\r\n IViewState,\r\n SetFilterAction,\r\n} from './types';\r\nimport { BatchResponses, httpClient } from 'api/HttpClient';\r\nimport {\r\n selectSchedulerViewStartDate,\r\n selectSchedulerViewEndDate,\r\n selectSchedulerPreviousViewState,\r\n selectSchedulerFilters,\r\n selectMultipleModeState,\r\n selectNotUseLocation,\r\n selectEmptySlotAdminClick,\r\n selectSchedulerNewEventServices,\r\n selectLoadedServices,\r\n selectCalendarReservationColumns,\r\n selectWithReservationsOnly,\r\n selectSchedulerViewState,\r\n} from './selectors';\r\n\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n withisInversed,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n RenderPageType,\r\n SidePanelState,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectGlobalSetting,\r\n selectglobalSettings,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { getLogger } from 'loglevel';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { isArray, isEqual, omit, uniq } from 'lodash';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { selectSidePanelState } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectReservationData } from 'app/pages/ReservationDetails/Details/slice/selectors';\r\nimport { reservationActions } from 'app/pages/ReservationDetails/Details/slice';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { PartOfDay } from 'enums/WorkingHoursTypes';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport {\r\n WorkOrderDetailsState,\r\n WorkOrderQueryStringParameters,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetCalendarPagePath } from '../../GetCalendarPagePath';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { Entity } from 'types/common';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { workOrderActions } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { selectSelectedSavedView } from 'app/pages/SavedViewsPage/SavedViewPage/slice/selectors';\r\nimport { savedViewActions } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\nimport { FilterValue } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n groupByFilterFieldName,\r\n periodFilterFieldName,\r\n} from '../../parseCalendarPageParams';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\n\r\nconst log = getLogger('SchedulerSaga');\r\nfunction* doChangeViewMode(action: ChangeViewModeAction) {\r\n const previous: IViewState | undefined = yield select(\r\n selectSchedulerPreviousViewState,\r\n );\r\n const { current } = action.payload;\r\n log.debug('doChangeViewMode', previous, current);\r\n const notUseLocation = yield select(selectNotUseLocation);\r\n if (!notUseLocation) {\r\n yield* changeLocation(current, previous);\r\n }\r\n // skip unnecessary data reload during calendar/timeline switch\r\n // fool proofing against duplicate calls to change view state of the scheduler\r\n const isSameState = isStateEqual(previous, current);\r\n if (!isSameState || action.payload.forceEvents) {\r\n yield put(actions.getEvents());\r\n }\r\n yield put(actions.setPreviousViewState(current));\r\n}\r\n\r\nfunction* doChangeViewModePartial(action: PayloadAction>) {\r\n const current: IViewState = yield select(selectSchedulerViewState);\r\n yield* doChangeViewMode({\r\n type: action.type,\r\n payload: {\r\n current,\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Determines if the viewstate have changed from the perspective of the scheduler saga\r\n * Used in order to fool proof the doChangeViewMode from rouge duplicate calls to change the viewstate causing to duplicate calls to fetch events\r\n * @param previous\r\n * @param current\r\n * @returns\r\n */\r\nfunction isStateEqual(previous: IViewState | undefined, current: IViewState) {\r\n try {\r\n const pickViewState = (a?: IViewState) => ({\r\n viewLength: a?.viewLength,\r\n // guards from one second changes to the viewstate regardless of their origin\r\n // lowest denominator for the purpose of fetching events is one day currently\r\n // in future, if the scheduler resolution will be lowered to > 1 day, this will need to be adjusted accordingly\r\n date:\r\n a?.date === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.startOfDay(dateUtils.parseISO(a.date)),\r\n ),\r\n });\r\n const isSameState = isEqual(\r\n pickViewState(previous),\r\n pickViewState(current),\r\n );\r\n return isSameState;\r\n } catch (error) {\r\n return false;\r\n }\r\n}\r\nexport function applyStateSearchParams(current: IViewState) {\r\n const params = new URLSearchParamsCI(current.search);\r\n if (current.preset === null) {\r\n params.delete(periodFilterFieldName);\r\n } else {\r\n params.set(periodFilterFieldName, current.preset);\r\n }\r\n\r\n params.set(groupByFilterFieldName, current.groupBy);\r\n\r\n return params.toString();\r\n}\r\n\r\nfunction* changeLocation(\r\n current: IViewState,\r\n previous: IViewState | undefined,\r\n) {\r\n const currentMode = {\r\n groupBy: current.groupBy,\r\n type: current.viewType,\r\n search: current.search,\r\n };\r\n const previousMode = {\r\n groupBy: previous?.groupBy,\r\n type: previous?.viewType,\r\n search: previous?.search,\r\n };\r\n\r\n if (!isEqual(previousMode, currentMode)) {\r\n const path = GetCalendarPagePath(current);\r\n\r\n yield put(\r\n routerActions.push({ pathname: path, search: currentMode.search }),\r\n );\r\n }\r\n}\r\n\r\nconst reservationHistoryAPIURL = '/api/odata/v4/CalendarReservations';\r\n\r\nfunction eventsParams({\r\n start,\r\n end,\r\n allFilters,\r\n selectedServices,\r\n serviceGroups,\r\n}: {\r\n start: Date | undefined;\r\n end: Date | undefined;\r\n allFilters: ISerializableFilterSettings | undefined;\r\n selectedServices: Array | undefined;\r\n serviceGroups: Array> | undefined;\r\n}) {\r\n const { events: eventFilters, training } = splitFilter(allFilters);\r\n const ReservationOrDowntime =\r\n allFilters?.['ReservationOrDowntime']?.value?.Id;\r\n\r\n // filters shared across all type of events reservations/working hours/training sessions/etc.\r\n // this filter can be sources either from the \"Filter\" or from scheduler state\r\n const sharedFilter: Array> = [\r\n new Condition(\r\n 'StartTime',\r\n ODataOperators.LessThan,\r\n end as FilterValue,\r\n ),\r\n new Condition(\r\n 'EndTime',\r\n ODataOperators.GreaterThan,\r\n start as FilterValue,\r\n ),\r\n ];\r\n\r\n const servicesFilter: Array> = [];\r\n\r\n if (selectedServices !== undefined && selectedServices.length > 0) {\r\n const equipmentIdArray = selectedServices.map(f => f.Id);\r\n servicesFilter.push(\r\n new Condition(\r\n 'EquipmentId',\r\n ODataOperators.Includes,\r\n equipmentIdArray,\r\n ),\r\n );\r\n }\r\n\r\n if (serviceGroups !== undefined && serviceGroups.length > 0) {\r\n servicesFilter.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n serviceGroups,\r\n ),\r\n );\r\n }\r\n return {\r\n ReservationOrDowntime,\r\n training,\r\n sharedFilter,\r\n servicesFilter,\r\n eventFilters,\r\n };\r\n}\r\n\r\nfunction* doGetEvents(action: PayloadAction) {\r\n const start = yield select(selectSchedulerViewStartDate);\r\n const end = yield select(selectSchedulerViewEndDate);\r\n const allFilters: ISerializableFilterSettings | undefined = yield select(\r\n selectSchedulerFilters,\r\n );\r\n const selectedServices: Array | undefined = yield select(\r\n selectLoadedServices,\r\n );\r\n const serviceGroups: Array> | undefined = yield select(\r\n selectGlobalServiceGroupFilter,\r\n );\r\n const withReservationsOnly = yield select(selectWithReservationsOnly);\r\n const {\r\n ReservationOrDowntime,\r\n training,\r\n sharedFilter,\r\n servicesFilter,\r\n eventFilters,\r\n } = eventsParams({\r\n start,\r\n end,\r\n allFilters,\r\n selectedServices,\r\n serviceGroups,\r\n });\r\n\r\n // track fetched services\r\n const fetchedServices: number[] = [];\r\n\r\n const reservations_fields = yield select(selectCalendarReservationColumns);\r\n const effects: Array = [\r\n fetchEvents(\r\n ReservationOrDowntime,\r\n sharedFilter,\r\n servicesFilter,\r\n eventFilters,\r\n reservations_fields,\r\n ),\r\n fetchTrainingSessions(\r\n ReservationOrDowntime,\r\n training,\r\n sharedFilter,\r\n servicesFilter,\r\n selectedServices,\r\n fetchedServices,\r\n ),\r\n ];\r\n const noServicesSelected =\r\n selectedServices === undefined || selectedServices.length === 0;\r\n const loadWorkingHoursForFetchedEvents = !(\r\n noServicesSelected && withReservationsOnly\r\n );\r\n\r\n // working hours can be fetched early if they don't depend on fetched events\r\n if (loadWorkingHoursForFetchedEvents) {\r\n effects.push(\r\n fetchWorkingHours(\r\n ReservationOrDowntime,\r\n sharedFilter,\r\n servicesFilter,\r\n eventFilters,\r\n ),\r\n );\r\n }\r\n try {\r\n const [\r\n fetchedEventsEffect,\r\n fetchedTrainingSessionsEffect,\r\n fetchWorkingHoursEffect,\r\n ] = yield all(effects);\r\n const fetchedEvents = fetchedEventsEffect as IODataQueryResponse<\r\n ICalendarReservationDto\r\n > | null;\r\n if (noServicesSelected && fetchedEvents != null) {\r\n fetchedServices.push(\r\n ...uniq(fetchedEvents.value.map(f => f.EquipmentId)),\r\n );\r\n }\r\n\r\n const fetchedTrainingSessions = fetchedTrainingSessionsEffect as IODataQueryResponse<\r\n ITrainingSessionSlotDto\r\n > | null;\r\n if (noServicesSelected && fetchedTrainingSessions != null) {\r\n fetchedServices.push(\r\n ...uniq(fetchedTrainingSessions.value.map(f => f.EquipmentId)),\r\n );\r\n }\r\n\r\n const fetchedWorkingHours = fetchWorkingHoursEffect as IODataQueryResponse<\r\n IWorkingHoursDto\r\n > | null;\r\n\r\n yield put(\r\n actions.getEvents_Success({\r\n reservations: fetchedEvents?.value ?? [],\r\n trainingSessions: fetchedTrainingSessions?.value ?? [],\r\n offlineHours: fetchedWorkingHours?.value ?? [],\r\n }),\r\n );\r\n\r\n if (loadWorkingHoursForFetchedEvents) {\r\n if (noServicesSelected && fetchedWorkingHours != null) {\r\n fetchedServices.push(\r\n ...uniq(fetchedWorkingHours.value.map(f => f.EquipmentId)),\r\n );\r\n }\r\n } else {\r\n const offlineServicesFilter =\r\n withReservationsOnly === true\r\n ? [\r\n new Condition(\r\n 'EquipmentId',\r\n ODataOperators.Includes,\r\n [\r\n ...new Set(\r\n (fetchedEvents?.value ?? []).map(f => f.EquipmentId),\r\n ),\r\n ],\r\n ),\r\n ]\r\n : servicesFilter;\r\n // fetch offline hours (alerts) for all displayed services\r\n var result: IODataQueryResponse = yield fetchWorkingHours(\r\n ReservationOrDowntime,\r\n sharedFilter,\r\n offlineServicesFilter,\r\n eventFilters,\r\n );\r\n fetchedServices.push(...uniq(result.value.map(f => f.EquipmentId)));\r\n yield put(actions.getOfflineHours_Success(result.value));\r\n }\r\n\r\n if (noServicesSelected) {\r\n const distinctEquipmentIds = uniq(fetchedServices);\r\n yield put(actions.getDerivedServices(distinctEquipmentIds));\r\n }\r\n\r\n // fetch non working hours only if a service has been selected\r\n if (selectedServices !== undefined && selectedServices.length > 0) {\r\n try {\r\n const nonWorking = yield call(\r\n getNonWorkingHours,\r\n selectedServices.map(f => f.Id),\r\n start,\r\n end,\r\n );\r\n yield put(actions.getNonWorkingHours_Success(nonWorking));\r\n } catch {\r\n yield put(actions.getNonWorkingHours_Success([]));\r\n }\r\n }\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\n\r\nfunction fetchWorkingHours(\r\n ReservationOrDowntime: any,\r\n sharedFilter: Condition[],\r\n offlineServicesFilter:\r\n | Condition[]\r\n | Condition[],\r\n eventFilters: string[],\r\n) {\r\n if (ReservationOrDowntime === ReservationOrDowntimeEnum.ReservationsOnly) {\r\n return call(() => null);\r\n } else {\r\n const url = `/api/odata/v4/WorkingHours`;\r\n // when the \"With reservations only\" is enabled - the offline hours need to be fetched only for those services that have reservations on them\r\n // so in this case reservations fetched here are used to extract the service ids and filter by them\r\n // otherwise the standard shared servicesFilter is used so that offline hours & reservations will be fetched on the same services\r\n const b = new ODataFilterBuilder({\r\n predicates: [\r\n new Condition(\r\n 'PeriodTypeId',\r\n ODataOperators.Equals,\r\n PartOfDay.OffLine,\r\n ).toString() || '',\r\n ...sharedFilter,\r\n ...offlineServicesFilter.map(f => f.toString()),\r\n ...Object.entries(eventFilters ?? {})\r\n // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n .filter(([key]) => !['service', 'period'].includes(key))\r\n // exclude filters not applicable to the offline hours like the BudgetManager\r\n .filter(([key]) => {\r\n const value = eventFilters[key];\r\n return (\r\n !value.includes('BudgetManager') && !value.includes('BudgetId')\r\n );\r\n })\r\n .map(([, value]) => value),\r\n ],\r\n stringColumns: [],\r\n globalServiceGroupFilter: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n return call(httpClient.get, url, { $filter: b.toString() });\r\n }\r\n}\r\n\r\nfunction fetchTrainingSessions(\r\n ReservationOrDowntime: any,\r\n training: string[],\r\n sharedFilter: Condition[],\r\n servicesFilter: Condition[],\r\n selectedServices: IServiceFilterDto[] | undefined,\r\n fetchedServices: number[],\r\n) {\r\n if (ReservationOrDowntime !== ReservationOrDowntimeEnum.DownTimeOnly) {\r\n const ff = Object.keys(training || {}).includes('BudgetManager');\r\n if (ff) {\r\n return call(() => null);\r\n } else {\r\n const trainingFilterBuilder = new ODataFilterBuilder<\r\n ICalendarReservationDto\r\n >({\r\n predicates: [\r\n ...sharedFilter,\r\n ...servicesFilter,\r\n ...Object.entries(training ?? {})\r\n // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n .filter(([key]) => !['service', 'period'].includes(key))\r\n .map(([, value]) => value),\r\n ],\r\n stringColumns: [],\r\n globalServiceGroupFilter: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n return call(httpClient.get, '/api/odata/v4/TrainingSessionSlots', {\r\n $filter: trainingFilterBuilder.toString(),\r\n });\r\n }\r\n }\r\n}\r\n\r\nfunction fetchEvents(\r\n ReservationOrDowntime: any,\r\n sharedFilter: Condition[],\r\n servicesFilter: Condition[],\r\n eventFilters: string[],\r\n reservations_fields: Array,\r\n) {\r\n if (ReservationOrDowntime !== ReservationOrDowntimeEnum.DownTimeOnly) {\r\n const b = new ODataFilterBuilder({\r\n predicates: [\r\n ...sharedFilter,\r\n ...servicesFilter,\r\n ...Object.entries(eventFilters ?? {})\r\n // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n .filter(([key]) => !['service', 'period'].includes(key))\r\n .map(([, value]) => value),\r\n ],\r\n stringColumns: [],\r\n globalServiceGroupFilter: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n\r\n return call(httpClient.get, reservationHistoryAPIURL, {\r\n $filter: b.toString(),\r\n $select: reservations_fields.join(','),\r\n });\r\n }\r\n return call(() => null);\r\n}\r\n\r\nasync function getNonWorkingHours(\r\n selectedServices: Array,\r\n start: Timestamp,\r\n end: Timestamp,\r\n) {\r\n const serviceIdParameter = selectedServices;\r\n const prepareDateParameter = date =>\r\n dateUtils.formatISO(date, { format: 'basic', representation: 'date' });\r\n const startParameter = prepareDateParameter(start);\r\n const endParameter = prepareDateParameter(\r\n dateUtils.addDays(dateUtils.startOfDay(dateUtils.parseISO(end)), 1),\r\n );\r\n var url = `/api/odata/v4/WorkingHours/GetNonWorking(ServiceId=${JSON.stringify(\r\n serviceIdParameter,\r\n )},Start=${startParameter},End=${endParameter})`;\r\n\r\n // use batch POST instead of GET to overcome 400 response for long urls\r\n const batchResponse: BatchResponses = await httpClient.batch([\r\n {\r\n method: 'GET',\r\n pathName: url,\r\n },\r\n ]);\r\n const result = batchResponse.responses[0].body as IODataQueryResponse<\r\n IEquipmentTimeSlot\r\n >;\r\n return result.value;\r\n}\r\n\r\nasync function getServiceDetails(ids: Array) {\r\n const result: IODataQueryResponse = await httpClient.get(\r\n '/api/odata/v4/ServiceFilter/ReservableEquipments',\r\n {\r\n $filter: new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n ids.filter(f => f !== undefined),\r\n ).toString(),\r\n $expand: 'WorkingHours',\r\n },\r\n );\r\n return result.value;\r\n}\r\n\r\nfunction* doGetServices(action: GetServicesAction) {\r\n try {\r\n if (action.payload === undefined) {\r\n yield put(actions.getServices_Success([]));\r\n return;\r\n }\r\n if (action.payload.length === 0) {\r\n yield put(actions.getServices_Success([]));\r\n return;\r\n }\r\n const needMoreProps = needMoreServiceProps({ services: action.payload });\r\n if (!needMoreProps) {\r\n yield put(\r\n actions.getServices_Success(action.payload as Array),\r\n );\r\n } else {\r\n try {\r\n // fetch service details only for services that haven't been loaded previously\r\n\r\n const servicesResponse: Array = yield call(\r\n getServiceDetails,\r\n action.payload.map(f => f.Id),\r\n );\r\n\r\n yield put(actions.getServices_Success(servicesResponse));\r\n } catch (error) {\r\n log.error('doGetServices', action, error);\r\n }\r\n }\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n yield put(actions.getEvents());\r\n}\r\n\r\nfunction needMoreServiceProps(props: {\r\n services: IServiceFilterDto[] | undefined;\r\n}) {\r\n const requiredProps: Array = [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'ServiceTypeId',\r\n 'Color',\r\n 'UseServiceGroupTrainingLevels',\r\n 'ServiceGroupName',\r\n 'RestrictDurationUnitsAmount',\r\n 'RestrictDurationUnitType',\r\n 'ImageName',\r\n 'DefaultDuration',\r\n 'AssemblyId',\r\n 'TopAssemblyId',\r\n 'AssetCatId',\r\n 'AssetCatName',\r\n 'RestrictReservationToTimeSlots',\r\n 'MinOrderHours',\r\n 'WorkingHours',\r\n ];\r\n const needMoreProps = props.services?.some(f => {\r\n const actualProps = Object.keys(f).sort();\r\n const iss = isEqual(actualProps, requiredProps.sort());\r\n return !iss;\r\n });\r\n return needMoreProps;\r\n}\r\n\r\nfunction* doGetDerivedServices(action: ChangeServicesAction) {\r\n try {\r\n if (action.payload === undefined) {\r\n return undefined;\r\n }\r\n const servicesResponse: Array = yield call(\r\n getServiceDetails,\r\n action.payload,\r\n );\r\n\r\n yield put(actions.getDerivedServices_Success(servicesResponse));\r\n } catch (error) {\r\n log.error('doGetServices', action, error);\r\n }\r\n}\r\nfunction* doEdit(action: PayloadAction) {\r\n if (action.payload.type === undefined) {\r\n return;\r\n }\r\n switch (action.payload.type) {\r\n case 'offline':\r\n if (action.payload.alert_id !== undefined) {\r\n yield* doEditAlert(action);\r\n }\r\n break;\r\n case 'reservation':\r\n yield* doEditReservation(action);\r\n break;\r\n case 'trainingsession':\r\n if (action.payload.reservation_id === undefined) {\r\n yield* doEditTrainingSession(action);\r\n } else {\r\n yield doEditReservation(action);\r\n }\r\n break;\r\n default:\r\n assertExhaustive(action.payload.type);\r\n }\r\n}\r\nfunction* doEditTrainingSession(action: PayloadAction) {\r\n const trainingSession = action.payload.original as ITrainingSessionSlotDto;\r\n const authenticatedUser: AuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n\r\n const queryParams: ReservationQueryStringParameters = {\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(trainingSession.StartTime),\r\n ),\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(trainingSession.EndTime),\r\n ),\r\n selectedIds: String(action.payload.service_id),\r\n un: authenticatedUser.Id,\r\n tsid: String((action.payload as any).trainingsession_id),\r\n };\r\n // undefined can't be processed by the reservation details\r\n if (action.payload.reservation_id !== undefined) {\r\n queryParams.id = String(action.payload.reservation_id);\r\n }\r\n // const x: SidePanelState | undefined = yield select(selectSidePanelState);\r\n // const reservationSidePanelOpened =\r\n // x?.sidePanelOpen && x?.pageType === RenderPageType.ReservationDetails;\r\n\r\n // if (reservationSidePanelOpened) {\r\n // if (action.payload.start_date !== undefined) {\r\n // yield put(reservationActions.setStartDate(action.payload.start_date));\r\n // }\r\n // if (action.payload.end_date !== undefined) {\r\n // yield put(reservationActions.setEndDate(action.payload.end_date));\r\n // }\r\n // } else {\r\n\r\n // }\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.ReservationDetails,\r\n props: {\r\n useSidePanel: true,\r\n queryParams,\r\n } as ReservationDetailsProps,\r\n }),\r\n );\r\n}\r\nfunction* doEditReservation(action: PayloadAction) {\r\n if (action.payload.reservation_id === undefined) {\r\n log.error('doEditReservation: ReservationId not found', action.payload);\r\n return;\r\n }\r\n const queryParams: ReservationQueryStringParameters = {\r\n id: String(action.payload.reservation_id),\r\n Start: action.payload.start_date,\r\n End: action.payload.end_date,\r\n };\r\n const sidePanelState: SidePanelState | undefined = yield select(\r\n selectSidePanelState,\r\n );\r\n const reservationDetailsState:\r\n | ReservationDetailsState\r\n | undefined = yield select(selectReservationData);\r\n const reservationSidePanelOpened =\r\n sidePanelState?.sidePanelOpen &&\r\n sidePanelState?.pageType === RenderPageType.ReservationDetails;\r\n if (reservationSidePanelOpened) {\r\n if (action.payload.reservation_id !== reservationDetailsState?.Id) {\r\n if (reservationDetailsState?.Id !== undefined) {\r\n // reset previously opened reservation/alert details before showing new one\r\n yield put(layoutActions.resetSidePanel());\r\n }\r\n }\r\n }\r\n\r\n if (\r\n reservationSidePanelOpened &&\r\n action.payload.reservation_id === reservationDetailsState?.Id\r\n ) {\r\n if (action.payload.start_date !== undefined) {\r\n yield put(reservationActions.setStartDate(action.payload.start_date));\r\n }\r\n if (action.payload.end_date !== undefined) {\r\n yield put(reservationActions.setEndDate(action.payload.end_date));\r\n }\r\n } else {\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.ReservationDetails,\r\n props: {\r\n useSidePanel: true,\r\n queryParams,\r\n } as ReservationDetailsProps,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doEditAlert(action: PayloadAction) {\r\n const queryParams: WorkOrderQueryStringParameters = {\r\n id: String(action.payload.alert_id),\r\n offStart: action.payload.start_date,\r\n offEnd: action.payload.end_date,\r\n };\r\n const props: WorkOrderDetailsProps = {\r\n queryParams: queryParams,\r\n\r\n useSidePanel: true,\r\n };\r\n\r\n const sidePanelState: SidePanelState | undefined = yield select(\r\n selectSidePanelState,\r\n );\r\n\r\n if (sidePanelState?.sidePanelOpen && action.payload.alert_id === undefined) {\r\n yield put(\r\n workOrderActions.setOfflineEventStart(\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.start_date),\r\n ),\r\n ),\r\n );\r\n\r\n yield put(\r\n workOrderActions.setOfflineEventEnd(\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.end_date),\r\n ),\r\n ),\r\n );\r\n } else {\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.WorkOrderDetails,\r\n props: props,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doCreate(action: PayloadAction) {\r\n if (action.payload === undefined) {\r\n return;\r\n }\r\n const authenticatedUser: AuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const requestedServices = yield select(selectSchedulerNewEventServices);\r\n const defaultMulti: boolean | undefined = yield select(\r\n selectMultipleModeState,\r\n );\r\n const defaultMultiModeBehavior = action.payload.defaultMulti ?? defaultMulti;\r\n const emptySlotAdminClick: EmptySlotAdminClick = yield select(\r\n selectEmptySlotAdminClick,\r\n );\r\n const isAdmin = authenticatedUser.IsAllGroupOrLabTechAdmin(\r\n requestedServices.map(f => f.ServiceGroupId),\r\n requestedServices.map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: f.ServiceTypeId,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n );\r\n const sidePanelState: SidePanelState | undefined = yield select(\r\n selectSidePanelState,\r\n );\r\n const reservationDetailsState:\r\n | ReservationDetailsState\r\n | undefined = yield select(selectReservationData);\r\n const reservationSidePanelOpened =\r\n sidePanelState?.sidePanelOpen &&\r\n sidePanelState?.pageType === RenderPageType.ReservationDetails;\r\n if (reservationSidePanelOpened) {\r\n if (reservationDetailsState?.Id !== 0) {\r\n // reset previously opened reservation/alert details before showing new one\r\n yield put(layoutActions.resetSidePanel());\r\n }\r\n }\r\n\r\n // equipment is changed here when a new reservation is dragged to another service on the timeline\r\n const equipmentChanged =\r\n action.payload.service_id !== undefined &&\r\n reservationDetailsState?.EquipmentsData?.some(\r\n equipment => equipment.Id === action.payload?.service_id,\r\n ) === false;\r\n\r\n if (\r\n reservationSidePanelOpened &&\r\n reservationDetailsState?.Id === 0 &&\r\n !equipmentChanged\r\n ) {\r\n if (action.payload.start_date !== undefined) {\r\n yield put(reservationActions.setStartDate(action.payload.start_date));\r\n }\r\n if (action.payload.end_date !== undefined) {\r\n yield put(reservationActions.setEndDate(action.payload.end_date));\r\n }\r\n return;\r\n }\r\n const settings: AppSettings = yield select(selectAppSettings);\r\n if (settings.Modules.includes(KnownModules.EquipmentAssemblies)) {\r\n }\r\n\r\n /**\r\n * service_id from the payload might be:\r\n * * number if reservation is placed on the service slot (timeline/unit view)\r\n * * or an array of numbers (where from?)\r\n * */\r\n\r\n const payloadServiceIds = isArray(action.payload.service_id)\r\n ? action.payload.service_id\r\n : [action.payload.service_id];\r\n\r\n var requestedServicesAssemblyIds = uniq(\r\n requestedServices.map(\r\n (f: Pick) =>\r\n f.TopAssemblyId ?? f.Id,\r\n ),\r\n );\r\n\r\n const useRequestedServices = requestedServices.length > 0;\r\n\r\n if (useRequestedServices) {\r\n if (\r\n requestedServices.some(\r\n (service: IServiceFilterDto) => service.AssemblyId !== null,\r\n ) &&\r\n settings.Modules.includes(KnownModules.EquipmentAssemblies)\r\n ) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'Scheduler_AssemblyPartSelected_InfoMessage',\r\n variant: 'info',\r\n message: i18next.t(\r\n translations.Scheduler_AssemblyPartSelected_InfoMessage,\r\n ),\r\n }),\r\n );\r\n }\r\n }\r\n\r\n // push all selected services if event was not created on dedicated service strip, e.g. on weekly calendar with no separate headers for each service\r\n const serviceIds = useRequestedServices\r\n ? requestedServicesAssemblyIds\r\n : payloadServiceIds;\r\n\r\n /**\r\n * Reservation side panel expects the service ids to be a csv e.g. \"1,2,3\"\r\n */\r\n const reservationSidePanelServiceId = String(serviceIds.join(','));\r\n const queryParams: ReservationQueryStringParameters = {\r\n selectedIds: reservationSidePanelServiceId,\r\n bid:\r\n action.payload.bid !== undefined ? String(action.payload.bid) : undefined,\r\n srid:\r\n action.payload.srid !== undefined\r\n ? String(action.payload.srid)\r\n : undefined,\r\n srrid:\r\n action.payload.srrid !== undefined\r\n ? String(action.payload.srrid)\r\n : undefined,\r\n un: action.payload.un ?? authenticatedUser?.Id,\r\n ug:\r\n action.payload.un !== undefined\r\n ? undefined\r\n : authenticatedUser?.ActiveUserGroup?.Id,\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.start_date),\r\n ),\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.end_date),\r\n ),\r\n defaultMulti:\r\n defaultMultiModeBehavior === undefined\r\n ? undefined\r\n : defaultMultiModeBehavior.toString(),\r\n sampleRunId: action.payload.sample_run_id?.toString(),\r\n };\r\n const alertQueryParams: WorkOrderQueryStringParameters = {\r\n eqid: reservationSidePanelServiceId,\r\n down: 'true',\r\n offH: 'true',\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n eStart: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.start_date),\r\n ),\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n offStart: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.start_date),\r\n ),\r\n // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n offEnd: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(action.payload.end_date),\r\n ),\r\n defaultMulti:\r\n defaultMultiModeBehavior === undefined\r\n ? undefined\r\n : defaultMultiModeBehavior.toString(),\r\n aType:\r\n action.payload.alert_type === undefined\r\n ? undefined\r\n : action.payload.alert_type.toString(),\r\n };\r\n // workaround to skip side panel close confirmation\r\n // otherwise a reset is called after confirmation causing the reservation/event to disappear from the scheduler\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n if (\r\n isAdmin &&\r\n EmptySlotAdminClick[emptySlotAdminClick.toString()] ===\r\n EmptySlotAdminClick.DownTimeOnly\r\n ) {\r\n let params = {\r\n useSidePanel: true,\r\n useSwithButtons: true,\r\n queryParams: alertQueryParams,\r\n } as WorkOrderDetailsProps;\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.WorkOrderDetails,\r\n props: params,\r\n }),\r\n );\r\n } else {\r\n let params = {\r\n useSidePanel: true,\r\n useSwitchButtons: isAdmin,\r\n queryParams,\r\n } as ReservationDetailsProps;\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.ReservationDetails,\r\n props: params,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doReset(action: PayloadAction) {\r\n yield put(actions.create());\r\n}\r\nfunction* doUpdateMultipleMode(action: PayloadAction) {\r\n const authenticatedUser: AuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const selectedSavedView: ISavedViewDto | undefined = yield select(\r\n selectSelectedSavedView,\r\n );\r\n if (selectedSavedView === undefined) {\r\n yield put(\r\n appSettingsActions.updateUserProfileSettings({\r\n key: 'BookMultipleInstruments',\r\n model: {\r\n UserName: authenticatedUser?.Id,\r\n Key: 'BookMultipleInstruments',\r\n IsMultiple: action.payload === undefined ? null : action.payload,\r\n } as UserProfileSettings,\r\n }),\r\n );\r\n } else {\r\n yield put(\r\n savedViewActions.patch({\r\n Id: selectedSavedView.Id,\r\n Multiple: action.payload,\r\n }),\r\n );\r\n }\r\n yield put(actions.updateMultiMode_Success(action.payload));\r\n}\r\n\r\nfunction* doUpdateEmptySlotClick(action: PayloadAction) {\r\n const authenticatedUser: AuthenticatedUser = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n yield put(\r\n appSettingsActions.updateUserProfileSettings({\r\n key: 'EmptySlotAdminClick',\r\n model: {\r\n UserName: authenticatedUser?.Id,\r\n Key: 'EmptySlotAdminClick',\r\n Value: action.payload.toString(),\r\n } as UserProfileSettings,\r\n }),\r\n );\r\n yield put(actions.updateEmptySlotSettings_success(action.payload));\r\n}\r\nfunction* doGetEmptySlotAdminClick() {\r\n const sett: UserProfile = yield select(selectUserProfileSettings);\r\n const gsettings: GlobalSettings = yield select(selectglobalSettings);\r\n const defaultEmptySlotSetting = gsettings.GetNullableByKey(\r\n AllowedSettings.CalendarTimelineEmptySlotClickSettings,\r\n );\r\n const defaultEmptySlotClick =\r\n defaultEmptySlotSetting === null\r\n ? EmptySlotAdminClick.ReservationsOnly\r\n : EmptySlotAdminClick[defaultEmptySlotSetting] ===\r\n EmptySlotAdminClick.WhatToAdd\r\n ? EmptySlotAdminClick.ReservationsOnly\r\n : EmptySlotAdminClick[defaultEmptySlotSetting];\r\n const userEmptySlotAdminClick = sett.GetSettingValueBy(\r\n (f: { Key: string }) =>\r\n f.Key.toLowerCase() === 'EmptySlotAdminClick'.toLowerCase(),\r\n )?.Value;\r\n const userSetting =\r\n userEmptySlotAdminClick === undefined || userEmptySlotAdminClick === null\r\n ? defaultEmptySlotClick\r\n : isNaN(parseInt(userEmptySlotAdminClick))\r\n ? EmptySlotAdminClick[userEmptySlotAdminClick]\r\n : EmptySlotAdminClick[parseInt(userEmptySlotAdminClick)];\r\n yield put(actions.updateEmptySlotSettings_success(userSetting));\r\n}\r\n\r\n/**\r\n * Splits scheduler filters into 2 groups - one to be applied to the services the other one - to the events\r\n * @param filters scheduler filters\r\n * @returns\r\n */\r\nfunction splitFilter(filters?: ISerializableFilterSettings) {\r\n const result: {\r\n events: Array;\r\n service: Array;\r\n training: Array;\r\n } = {\r\n service: [],\r\n events: [],\r\n training: [],\r\n };\r\n if (filters === undefined) {\r\n return result;\r\n }\r\n const getPredicate = (filters: ISerializableFilterSettings, key: string) =>\r\n withisInversed(\r\n String(filters[key].predicate),\r\n filters[key].predicate['isInversed'],\r\n );\r\n return Object.keys(filters).reduce((acc, key) => {\r\n switch (key) {\r\n case 'BudgetManager':\r\n case 'BookedById':\r\n case 'BudgetId':\r\n acc.events.push(getPredicate(filters, key));\r\n acc.events.push(getPredicate(filters, key));\r\n break;\r\n\r\n case 'service':\r\n case 'campus':\r\n case 'AssetRoomId':\r\n case 'AssetBuildingId':\r\n case 'AssetGroupId':\r\n case 'AssetCatId':\r\n case 'AvailabilityTypeId':\r\n acc.service.push(getPredicate(filters, key));\r\n break;\r\n case 'TrainingStateId':\r\n acc.training.push(getPredicate(filters, key));\r\n break;\r\n case 'WithReservationsOnly':\r\n // noop - WithReservationsOnly is not applied to any API and only affects the services displayed based on the fetched services and reservations\r\n break;\r\n default:\r\n log.warn(`splitFilter: missing case for ${key}`, filters[key]);\r\n break;\r\n }\r\n return acc;\r\n }, result);\r\n}\r\nfunction* doSetFilters(action: SetFilterAction) {\r\n try {\r\n const serviceGroups: Array> | undefined = yield select(\r\n selectGlobalServiceGroupFilter,\r\n );\r\n // handle the global service groups filter\r\n const predicates: Array> = [];\r\n if (serviceGroups !== undefined && serviceGroups.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n serviceGroups,\r\n ),\r\n );\r\n }\r\n // apply the rest of the \"filters\" applicable to the services here\r\n if (action.payload !== undefined) {\r\n // The Service filter can't be applied directly as it filters by the EquipmentId column instead of the Id\r\n const serviceRelatedFilters = splitFilter(\r\n omit(action.payload, 'service'),\r\n );\r\n predicates.push(...serviceRelatedFilters.service);\r\n\r\n // service selected in the main filter need some special treatment\r\n if (action.payload.service !== undefined) {\r\n const filteredServices = action.payload?.service?.value?.map(f => f.Id);\r\n if (filteredServices?.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n filteredServices,\r\n ),\r\n );\r\n }\r\n }\r\n }\r\n\r\n var serviceFilterValue = action.payload?.['service']?.value;\r\n const servicesLoaded =\r\n Array.isArray(serviceFilterValue) &&\r\n needMoreServiceProps({ services: serviceFilterValue }) === true;\r\n\r\n if (!servicesLoaded) {\r\n const currentView: IViewState = yield select(selectSchedulerViewState);\r\n if (currentView.groupBy !== 'GroupByAssemblyPart') {\r\n predicates.push(\r\n new Condition(\r\n 'AssemblyId',\r\n ODataOperators.Equals,\r\n null,\r\n ),\r\n );\r\n }\r\n // max number of services allowed to be shown on the timeline\r\n const maxTimelineServices = yield select(state =>\r\n selectGlobalSetting(state, AllowedSettings.MaximumTimelineRowsLimit),\r\n );\r\n // max number of services allowed to be shown on the calendar\r\n const maxCalendarServices = yield select(state =>\r\n selectGlobalSetting(\r\n state,\r\n AllowedSettings.CalendarServicesPickerCapacity,\r\n ),\r\n );\r\n // take max + 1 in order to determine that the maximum limit has been reached for calendar/timeline\r\n const maxServices =\r\n Math.max(\r\n tryParseInt(maxTimelineServices) ?? 50,\r\n tryParseInt(maxCalendarServices) ?? 10,\r\n ) + 1;\r\n\r\n const x: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/ServiceFilter/ReservableEquipments',\r\n {\r\n $filter: undefinedIfIsEmpty(predicates.join(' and ')),\r\n $orderby: 'Name',\r\n $top: maxServices + 1,\r\n },\r\n );\r\n\r\n yield put(actions.getServices_Success(x.value));\r\n } else {\r\n yield put(actions.getServices_Success(serviceFilterValue));\r\n }\r\n\r\n yield put(actions.getEvents());\r\n } catch (error) {\r\n log.error(error);\r\n }\r\n}\r\nfunction* doResetWorkOrder(\r\n action: PayloadAction,\r\n) {\r\n // todo: use the payload/state to reset the start/end time of the offline/alert that was edited by drag/resize instead of refetching all events\r\n yield put(actions.create());\r\n yield put(actions.getEvents());\r\n}\r\nexport function* schedulerSaga() {\r\n yield debounce(100, actions.getEvents.type, doGetEvents);\r\n yield takeLatest(actions.changeViewMode.type, doChangeViewMode);\r\n yield takeLatest(actions.changeViewModePartial.type, doChangeViewModePartial);\r\n yield takeLatest(actions.setDate.type, doGetEvents);\r\n yield takeLatest(actions.edit.type, doEdit);\r\n\r\n yield takeLatest(actions.create.type, doCreate);\r\n // refresh after reservation has been created\r\n yield takeEvery(\r\n reservationActions.createReservation_Success.type,\r\n doGetEvents,\r\n );\r\n // refresh after reservation has been updated\r\n yield takeEvery(\r\n reservationActions.updateReservation_Success.type,\r\n doGetEvents,\r\n );\r\n\r\n // process change in the service groups global filter - refresh events shown\r\n yield takeLatest(\r\n appSettingsActions.saveGlobalServiceGroupFilter.type,\r\n doGetEvents,\r\n );\r\n // removes temporary \"new event\" from the scheduler on workorder creation\r\n yield takeEvery(workOrderActions.createWorkOrder_Success.type, doReset);\r\n // refresh after alert was created\r\n yield takeEvery(workOrderActions.createWorkOrder_Success.type, doGetEvents);\r\n // refresh after alert was updated\r\n yield takeEvery(workOrderActions.updateWorkOrder_Success.type, doGetEvents);\r\n\r\n yield takeLatest(reservationActions.resetDetailsState, doReset);\r\n yield takeLatest(\r\n workOrderActions.resetUpdateWorkOrderState.type,\r\n doResetWorkOrder,\r\n );\r\n yield takeLatest(\r\n workOrderActions.resetCreateWorkOrderState.type,\r\n doResetWorkOrder,\r\n );\r\n\r\n yield takeLatest(actions.getDerivedServices.type, doGetDerivedServices);\r\n yield takeLatest(actions.getServices.type, doGetServices);\r\n yield takeLatest(actions.setFilters.type, doSetFilters);\r\n\r\n yield takeLatest(actions.updateMultiMode.type, doUpdateMultipleMode);\r\n\r\n yield takeLatest(\r\n actions.updateEmptySlotSettings.type,\r\n doUpdateEmptySlotClick,\r\n );\r\n yield takeLatest(\r\n actions.getEmptySlotAdminClick.type,\r\n doGetEmptySlotAdminClick,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { applyStateSearchParams, schedulerSaga } from './saga';\r\n\r\nimport {\r\n SchedulerState,\r\n IViewState,\r\n INewEvent,\r\n ChangeServicesAction,\r\n ChangeViewModeAction,\r\n ISchedulerService,\r\n GetServicesAction,\r\n SetFilterAction,\r\n IEditEvent,\r\n} from './types';\r\n\r\nexport const initialState: SchedulerState = {\r\n events: {},\r\n offlineHours: {},\r\n trainingSessions: {},\r\n emptySlotAdminClick: EmptySlotAdminClick.ReservationsOnly,\r\n selectedReservationEvents: [],\r\n TimelineGroupBy: 'NoTimelineGrouped',\r\n exportToPDF: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'scheduler',\r\n initialState,\r\n reducers: {\r\n init(state, action: PayloadAction) {\r\n const result = { ...initialState, ...{ viewState: action.payload } };\r\n return result;\r\n },\r\n changeViewModePartial(state, action: PayloadAction>) {\r\n state.viewState = Object.assign({}, state.viewState, action.payload);\r\n state.viewState.search = applyStateSearchParams(state.viewState);\r\n },\r\n changeViewMode(state, action: ChangeViewModeAction) {\r\n state.notUseLocation = action.payload.withNoChangeLocation;\r\n state.viewState = Object.assign({}, state.viewState, {\r\n preset: action.payload.current.preset,\r\n viewType: action.payload.current.viewType,\r\n viewLength: action.payload.current.viewLength,\r\n date: action.payload.current.date,\r\n search: applyStateSearchParams(action.payload.current),\r\n customDays: action.payload.current.customDays,\r\n customStart: action.payload.current.customStart,\r\n });\r\n },\r\n setPreviousViewState(state, action: PayloadAction) {\r\n state.previousViewState = action.payload;\r\n },\r\n changeGroupBy(state, action: PayloadAction) {},\r\n setDate(state, action: PayloadAction) {\r\n if (state.viewState !== undefined) {\r\n state.viewState.date = action.payload;\r\n }\r\n },\r\n\r\n getServices(state, action: GetServicesAction) {\r\n state.selectedServices = undefined;\r\n },\r\n getServices_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.selectedServices = action.payload;\r\n },\r\n\r\n getDerivedServices(state, action: ChangeServicesAction) {},\r\n getDerivedServices_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.derivedServices = action.payload;\r\n },\r\n\r\n getEvents(state, action: PayloadAction) {\r\n state.loadingEvents = true;\r\n },\r\n getEvents_Success(\r\n state,\r\n action: PayloadAction<{\r\n reservations: Array;\r\n trainingSessions: Array;\r\n offlineHours: Array;\r\n }>,\r\n ) {\r\n if (state?.viewState?.date !== undefined) {\r\n state.events[state.viewState.date] = action.payload.reservations;\r\n state.trainingSessions[state.viewState.date] =\r\n action.payload.trainingSessions;\r\n state.offlineHours[state.viewState.date] = action.payload.offlineHours;\r\n }\r\n state.loadingEvents = false;\r\n },\r\n getEvents_Error(state, action: PayloadAction) {},\r\n\r\n getOfflineHours_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n if (state?.viewState?.date !== undefined) {\r\n state.offlineHours[state.viewState.date] = action.payload;\r\n }\r\n },\r\n getNonWorkingHours_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.nonWorkingHours = action.payload;\r\n },\r\n getTrainingSessions_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n if (state?.viewState?.date !== undefined) {\r\n state.trainingSessions[state.viewState.date] = action.payload;\r\n }\r\n },\r\n\r\n setFilters(state, action: SetFilterAction) {\r\n // reset the events\r\n state.events = {};\r\n state.offlineHours = {};\r\n state.trainingSessions = {};\r\n state.loadingEvents = true;\r\n state.filters = action.payload;\r\n },\r\n\r\n edit(state, action: PayloadAction) {\r\n switch (action.payload.type) {\r\n case 'offline':\r\n // store the updated start/end of the offline event in the state\r\n // this might prevent event jumping back after it's been dragged for the first time after the scheduler has been loaded\r\n const entity = Object.values(state.offlineHours)\r\n ?.flat()\r\n ?.find(f => f.AlertId === action.payload.alert_id);\r\n if (entity !== undefined) {\r\n entity.StartTime = action.payload.start_date;\r\n entity.EndTime = action.payload.end_date;\r\n }\r\n }\r\n },\r\n create(state, action: PayloadAction) {\r\n state.tempReservations = action.payload;\r\n },\r\n updateMultiMode(state, action: PayloadAction) {},\r\n updateMultiMode_Success(state, action: PayloadAction) {\r\n state.multipleInstrumentsMode = action.payload;\r\n },\r\n updateEmptySlotSettings(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n updateEmptySlotSettings_success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.emptySlotAdminClick = action.payload;\r\n },\r\n getEmptySlotAdminClick(state, action: PayloadAction) {},\r\n setNotUseLocation(state, action: PayloadAction) {\r\n state.notUseLocation = action.payload;\r\n },\r\n setSelectedReservationEvents(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.selectedReservationEvents = action.payload;\r\n },\r\n exportToPDF(state, action: PayloadAction) {\r\n state.exportToPDF = true;\r\n },\r\n resetExportToPDF(state, action: PayloadAction) {\r\n state.exportToPDF = false;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: schedulerActions } = slice;\r\n\r\nexport const useSchedulerSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: schedulerSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useSchedulerSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { IsEmptyArray } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n findIsfilterInversed,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { initFilterData } from 'app/components/BasicTable/initFilterData';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { savedViewActions } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useEffect, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { SAVEDVIEW_SEARCH_KEY } from '../BasicFilter/SavedListsDropDown';\r\nimport { getDependencyFilters } from '../BasicFilter';\r\nimport { BasicTableProps, IRow } from './UnconfigurableTable';\r\nimport React from 'react';\r\n\r\nfunction visibleFiltersFilter(item: IFilterSettings) {\r\n return (\r\n (item.value !== undefined && !IsEmptyArray(item.value)) || item.notNullable\r\n );\r\n}\r\n\r\nexport function filterHandler(\r\n Component: React.ComponentType<\r\n BasicTableProps & { exportNotConfigurable?: boolean }\r\n >,\r\n GetFiltersDefinition: GetPageFilters,\r\n other?: {\r\n getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams;\r\n reservedQueryStringParameterNames?: string[];\r\n isSidePanel?: boolean;\r\n setFilters?: (appliedFilters: IFilterSettings[] | undefined) => void;\r\n getRequiredFilter?: (\r\n search: string,\r\n appSettings?: AppSettings | null,\r\n ) => string | undefined;\r\n getSelectedViewFilter?: (\r\n search: string,\r\n view: SavedViewSelected,\r\n ) => string | undefined;\r\n enableSavedLists?: boolean;\r\n },\r\n): React.FC

& { exportNotConfigurable?: boolean }> {\r\n return ({\r\n onFilterChange,\r\n availableFilters,\r\n savedListSettings,\r\n ...props\r\n }: BasicTableProps & { exportNotConfigurable?: boolean }) => {\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n const {\r\n isSidePanel,\r\n getDefaultFilter,\r\n setFilters,\r\n reservedQueryStringParameterNames,\r\n getRequiredFilter,\r\n // getSelectedViewFilter,\r\n enableSavedLists,\r\n } = useMemo(() => other ?? {}, []);\r\n if (authenticatedUser === undefined) {\r\n return <>not authenticated;\r\n }\r\n\r\n useEffectOnMount(() => {\r\n const cancelToken = { mounted: true };\r\n const preset = getPresetFilter(\r\n isSidePanel\r\n ? undefined\r\n : withoutReserved(location.search, reservedQueryStringParameterNames),\r\n authenticatedUser,\r\n );\r\n const defaultSearch =\r\n getDefaultFilter !== undefined && getDefaultFilter !== null\r\n ? getDefaultFilter(authenticatedUser)?.toString()\r\n : undefined;\r\n let search =\r\n isSidePanel || isEmptyOrWhitespace(preset)\r\n ? defaultSearch ?? ''\r\n : location.search;\r\n const requiredSearch =\r\n getRequiredFilter !== null && getRequiredFilter !== undefined\r\n ? getRequiredFilter(search, appSettings)\r\n : undefined;\r\n search = requiredSearch === undefined ? search : requiredSearch ?? '';\r\n\r\n const savedViewId = tryParseInt(\r\n new URLSearchParamsCI(search).get(SAVEDVIEW_SEARCH_KEY),\r\n );\r\n dispatch(savedViewActions.selectSavedView(savedViewId));\r\n // const savedViewSearch = !!getSelectedViewFilter ? getSelectedViewFilter()\r\n\r\n const localizedFilters = getLocalizedFilters(search);\r\n // let fooFilters = foo?.filter(\r\n // item => item.value !== undefined && !IsEmptyArray(item.value),\r\n // );\r\n // let depFilters = getDependencyFilters(fooFilters);\r\n let visibleFilters = localizedFilters\r\n ?.map(f => {\r\n return {\r\n ...f,\r\n isInversed: findIsfilterInversed(\r\n search,\r\n f.urlKey ??\r\n (typeof f.queryStringSerializer === 'string'\r\n ? f.queryStringSerializer\r\n : undefined),\r\n ),\r\n };\r\n })\r\n .filter(showFiltersFn);\r\n let depFilters = getDependencyFilters(visibleFilters);\r\n\r\n setAppliedFilters(depFilters);\r\n setAppliedFilters(initFilterData(depFilters), cancelToken);\r\n if (!isSidePanel) {\r\n if (\r\n isEmptyOrWhitespace(\r\n withoutReserved(location.search, reservedQueryStringParameterNames),\r\n )\r\n ) {\r\n if (defaultSearch !== undefined) {\r\n const withReserved = addReserved(\r\n new URLSearchParams(defaultSearch),\r\n location.search,\r\n reservedQueryStringParameterNames,\r\n ).toString();\r\n dispatch(\r\n routerActions.replace({\r\n pathname: location.pathname,\r\n search: withReserved,\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n return () => {\r\n cancelToken.mounted = false;\r\n };\r\n });\r\n\r\n const location = useLocation();\r\n const removeEmptyFilters = (\r\n filter: string | undefined,\r\n ): string | undefined => {\r\n if (filter === undefined || filter === null) {\r\n return undefined;\r\n } else {\r\n const params = new URLSearchParams(filter);\r\n let newParams = new URLSearchParams();\r\n for (const [name, value] of params) {\r\n if (value !== undefined && value !== null && value !== '') {\r\n newParams.append(name, value);\r\n }\r\n }\r\n return newParams.toString();\r\n }\r\n };\r\n\r\n function getPresetFilter(\r\n savedFilter: string | undefined | null,\r\n user: IAuthenticatedUser,\r\n ): string | undefined {\r\n const saved =\r\n savedFilter !== undefined &&\r\n savedFilter !== null &&\r\n !isEmptyOrWhitespace(savedFilter)\r\n ? removeEmptyFilters(savedFilter)\r\n : undefined;\r\n const result = saved === undefined || saved === '' ? undefined : saved;\r\n\r\n return result;\r\n }\r\n\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const getLocalizedFilters = useMemo(() => {\r\n const result = GetFiltersDefinition(\r\n t,\r\n appSettings,\r\n authenticatedUser,\r\n settings,\r\n );\r\n return result;\r\n }, [appSettings, authenticatedUser, settings, t]);\r\n const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n IFilterSettings[] | undefined\r\n >(undefined);\r\n\r\n const allfilters = useMemo(() => {\r\n var result = !appliedFilters\r\n ? getLocalizedFilters('')\r\n : getLocalizedFilters(\r\n toURLSearchParams(appliedFilters).toString(),\r\n );\r\n return result;\r\n }, [getLocalizedFilters, appliedFilters]);\r\n\r\n useEffect(() => {\r\n setFilters?.(appliedFilters);\r\n }, [appliedFilters, setFilters]);\r\n\r\n const handleFilterChange: (\r\n items: IFilterSettings[],\r\n ) => void = items => {\r\n const currentSearch = toURLSearchParams(appliedFilters ?? []);\r\n if (!isSidePanel && reservedQueryStringParameterNames) {\r\n const p = new URLSearchParams(location.search);\r\n [...p.keys()].forEach(key => {\r\n if (reservedQueryStringParameterNames.includes(key)) {\r\n const val = p.get(key);\r\n if (val !== null) {\r\n currentSearch.set(key, val);\r\n }\r\n }\r\n });\r\n }\r\n const filterSearch = toURLSearchParams(items);\r\n for (const key of filterSearch.keys()) {\r\n const filterValue = filterSearch.get(key);\r\n if (filterValue !== null) {\r\n currentSearch.set(key, filterValue);\r\n }\r\n }\r\n const originalSearch = new URLSearchParamsCI(location.search);\r\n\r\n // clear saved view selection when instrument selection changes\r\n if (enableSavedLists && savedListSettings !== undefined) {\r\n if (savedListSettings?.savedListSerializedKey !== undefined) {\r\n const currentInstrumentSelection = currentSearch.get(\r\n savedListSettings?.savedListSerializedKey,\r\n );\r\n const originalInstrumentSelection = originalSearch.get(\r\n savedListSettings?.savedListSerializedKey,\r\n );\r\n if (currentInstrumentSelection !== originalInstrumentSelection) {\r\n // remove the selection from the search\r\n currentSearch.delete(SAVEDVIEW_SEARCH_KEY);\r\n // clear redux state\r\n dispatch(savedViewActions.selectMyList());\r\n }\r\n }\r\n }\r\n\r\n setAppliedFilters(getDependencyFilters([...items]));\r\n // push current filter state to the URL search if it's not equivalent\r\n if (!originalSearch.equals(currentSearch) && !isSidePanel) {\r\n dispatch(\r\n routerActions.replace({\r\n pathname: location.pathname,\r\n search: currentSearch.toString(),\r\n }),\r\n );\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n {appliedFilters !== undefined && (\r\n & {\r\n exportNotConfigurable?: boolean;\r\n })}\r\n />\r\n )}\r\n \r\n );\r\n };\r\n}\r\n\r\nconst withoutReserved = (\r\n search: string,\r\n reserved: string[] | undefined,\r\n): string => {\r\n if (reserved === undefined || reserved.length === 0) return search;\r\n const originalSearch = new URLSearchParamsCI(search);\r\n reserved.forEach(f => originalSearch.delete(f));\r\n return originalSearch.toString();\r\n};\r\n\r\nconst addReserved = (\r\n current: URLSearchParams,\r\n search: string,\r\n reserved: string[] | undefined,\r\n) => {\r\n if (reserved === undefined || reserved.length === 0) return current;\r\n const p = new URLSearchParams(search);\r\n [...p.keys()].forEach(key => {\r\n if (reserved.includes(key)) {\r\n const val = p.get(key);\r\n if (val !== null) {\r\n current.set(key, val);\r\n }\r\n }\r\n });\r\n return current;\r\n};\r\n\r\n// function getIgnoredSearch(search: string, ignore: string[]) {\r\n// var p = new URLSearchParams(search);\r\n// [...p.keys()].forEach(key => {\r\n// if (!ignore.includes(key)) {\r\n// p.delete(key);\r\n// }\r\n// });\r\n\r\n// return p;\r\n// }\r\n","/**\r\n *\r\n * FormUserPicker\r\n *\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { UserPicker, UserUrl } from '../pickers/AutocompletePickers/UserPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const FormUserPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & {\r\n selectArray?: Array;\r\n urlType?: UserUrl;\r\n} & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n disabled={props.disabled}\r\n predicates={props.predicates}\r\n selectArray={props.selectArray}\r\n urlType={props.urlType}\r\n />\r\n \r\n );\r\n};\r\n","import { Collapse } from '@material-ui/core';\r\nimport { Alert } from '@material-ui/lab';\r\nimport * as React from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { Caption } from '../Typography';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport type AlertVariant = 'success' | 'info' | 'warning' | 'error';\r\nexport type AlertContentType = {\r\n message?: string;\r\n type: AlertVariant;\r\n closable: boolean;\r\n children?: React.ReactNode;\r\n variant?: 'outlined' | 'filled' | 'standard';\r\n};\r\n\r\nexport interface BasicAlertProps {\r\n content: AlertContentType;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n className?: string;\r\n showMore?: boolean;\r\n style?: React.CSSProperties;\r\n collapsedMinHeight?: number;\r\n onClose?: (event: React.SyntheticEvent) => void;\r\n}\r\n\r\nconst MessageText = styled.div`\r\n ${(props: { showMore: boolean; minHeight: number }) => {\r\n return css`\r\n display: block;\r\n overflow: ${props.showMore ? 'auto' : 'hidden'};\r\n text-overflow: ellipsis;\r\n white-space: normal;\r\n word-wrap: normal;\r\n -webkit-box-orient: horizontal;\r\n max-height: ${props.showMore ? '300px' : props.minHeight + 'px'};\r\n `;\r\n }}\r\n`;\r\nconst defaultIconMapping = {\r\n success: ,\r\n warning: (\r\n \r\n ),\r\n error: (\r\n \r\n ),\r\n info: (\r\n \r\n ),\r\n};\r\nexport function BasicAlert(props: BasicAlertProps) {\r\n const {\r\n content,\r\n variant,\r\n className,\r\n showMore,\r\n collapsedMinHeight,\r\n style,\r\n onClose,\r\n } = props;\r\n const [isShowMore, setIsShowMore] = React.useState(false);\r\n const toggleReadMore = () => setIsShowMore(show => !show);\r\n const [open, setOpen] = React.useState(true);\r\n return (\r\n \r\n \r\n {content.closable && (\r\n {\r\n setOpen(false);\r\n }}\r\n >\r\n \r\n \r\n )}\r\n {showMore && (\r\n {\r\n toggleReadMore();\r\n }}\r\n >\r\n \r\n \r\n )}\r\n \r\n }\r\n >\r\n {showMore ? (\r\n \r\n {!!content.message && {content.message}}\r\n {!!content.children && (\r\n {content.children}\r\n )}\r\n \r\n ) : (\r\n \r\n {!!content.message && {content.message}}\r\n {!!content.children && (\r\n {content.children}\r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n","import { InputAdornment } from '@material-ui/core';\r\nimport { TextField as BasicTextField } from 'app/components/TextField';\r\nimport * as React from 'react';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { EditorProps } from '../../EditableCell';\r\n\r\n// 'ShortText':\r\n\r\nexport function TextField({\r\n parentValue,\r\n error,\r\n helperText,\r\n info,\r\n autoFocus,\r\n ...props\r\n}: EditorProps) {\r\n const handleChange: React.ChangeEventHandler<\r\n HTMLInputElement | HTMLTextAreaElement\r\n > = e => {\r\n props.onChange(e.target.value);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n {!!info && info !== '' && }\r\n {error && helperText && (\r\n \r\n )}\r\n \r\n ),\r\n }}\r\n variant=\"standard\"\r\n fullWidth\r\n error={error}\r\n inputProps={{\r\n type: 'text',\r\n }}\r\n value={props.value || ''}\r\n onChange={handleChange}\r\n onBlur={props.onBlur}\r\n id={props.id}\r\n label={props.label}\r\n autoFocus={autoFocus}\r\n name={props.name}\r\n />\r\n {/* */}\r\n \r\n );\r\n}\r\n","import { Entity } from 'types/common';\r\n\r\nexport enum messageType {\r\n Announcment,\r\n reservationStarted,\r\n usageReservation,\r\n loadDesk,\r\n removableAnnouncment,\r\n calendar,\r\n}\r\n\r\nexport interface StartedReservation {\r\n Id: number;\r\n Asset: Entity;\r\n AllowModification: boolean;\r\n AllowExtendReservation: boolean;\r\n AllowUsersToShortenReservations: boolean;\r\n Tutoring: boolean;\r\n AllUsagesEnded: boolean;\r\n}\r\n\r\nexport interface LoanDesk {\r\n Id: number;\r\n AssetDetails: Entity;\r\n}\r\n\r\nexport interface UsageReservation extends Entity {}\r\n\r\nexport interface CalendarMessageProps {\r\n Id: number;\r\n ServiceGroupId: number | null;\r\n EquipmentId: number | null;\r\n Title: string | null;\r\n Body: string | null;\r\n StartDate: Date | null;\r\n EndDate: Date | null;\r\n}\r\n\r\ntype Messageprops =\r\n | StartedReservation\r\n | UsageReservation\r\n | LoanDesk\r\n | string\r\n | CalendarMessageProps;\r\n\r\nexport interface Message {\r\n type: messageType;\r\n props?: Messageprops;\r\n key: string;\r\n}\r\n\r\nexport interface MessagesState {\r\n messages: Message[];\r\n initialized: number;\r\n processing?: boolean;\r\n}\r\n","import { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { IMyAssetsRow } from '../MyAssetsPage/IMyAssetsRow';\r\n\r\nexport type IAsset = IAssetDetails2Dto;\r\n\r\nexport interface AlertInfo {\r\n show: boolean;\r\n hasActive: boolean;\r\n hasDownActive: boolean;\r\n noAlerts: boolean;\r\n assetId?: number;\r\n alertId?: number;\r\n isAdmin: boolean;\r\n}\r\n\r\nexport interface AssetUser extends Entity {\r\n DisplayName: string;\r\n Email: string;\r\n OfficeTel: string;\r\n}\r\n\r\nexport interface IRestrictions {\r\n Id: number;\r\n Name: string;\r\n AssetId: number | null;\r\n ServiceGroupId: number;\r\n LimitlessReservationAllowed: boolean | null;\r\n PrerequisiteEquipments: IAssetDto[];\r\n ForceTutoring: boolean;\r\n RestrictionsOverview: string | null;\r\n ReservationRestrictions: string | null;\r\n MinReservationOrder: number | null;\r\n MaxReservationOrder: number | null;\r\n ReservationMinimumGap: number | null;\r\n MinTimeAheadPeriodValue: number | null;\r\n MinTimeAheadPeriodType: number | null;\r\n MinTimeAheadMinutesSinceMidnight: number | null;\r\n BypassQuotas: boolean;\r\n BypassUserQuotasAndGaps: boolean;\r\n BypassMinResDurationD: boolean;\r\n BypassMinResDurationT: number | null;\r\n BypassUserQuotasAndGapsD: number | null;\r\n MinReservationOrderGap: number;\r\n UserReservationGap: number;\r\n UserGroupReservationGap: number;\r\n InstituteReservationGap: number;\r\n CarryOverTimeSlotGap: number | null;\r\n CarryOverTimeSlotTypeId: number | null;\r\n CarryOverTimeSlotTypeName: string | null;\r\n}\r\nexport const mapToAssetDto = (myAsset: IMyAssetsRow): IAssetDto => {\r\n return {\r\n Id: myAsset.Id,\r\n Name: myAsset.Name,\r\n AssetCatId: myAsset.AssetCatId,\r\n Availability: {\r\n Id: myAsset.AvailabilityTypeId,\r\n Name: myAsset.AvailabilityTypeName,\r\n },\r\n ServiceGroupId: myAsset.ServiceGroupId,\r\n ServiceGroupName: myAsset.ServiceGroupName,\r\n ServiceId: myAsset.ServiceId,\r\n ServiceTypeId: myAsset.ServiceTypeId,\r\n ServiceGroupAssetId: myAsset.ServiceGroupAssetId,\r\n } as IAssetDto;\r\n};\r\n","import Box from '@material-ui/core/Box';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface UserProfileLinkProps {\r\n UserId: string | null;\r\n DisplayName?: string | null;\r\n twoRows?: boolean;\r\n isAdmin?: boolean;\r\n}\r\n\r\nexport const UserProfileLink = React.forwardRef(\r\n function UserProfileLink(props, ref) {\r\n const { t } = useTranslation();\r\n const { UserId, DisplayName, isAdmin, twoRows = true, ...rest } = props;\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const settings = useSelector(selectglobalSettings);\r\n const isServiceAdmin: boolean = React.useMemo(\r\n () =>\r\n authenticatedUser !== undefined &&\r\n ((authenticatedUser.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n isAdmin) ??\r\n false),\r\n [authenticatedUser, isAdmin],\r\n );\r\n const format = settings.GetString(AllowedSettings.UserFormatResult);\r\n const url = `/userprofile.aspx?id=${UserId}`;\r\n if ((DisplayName ?? null) == null) {\r\n return <>;\r\n }\r\n\r\n const text =\r\n format === 'DisplayNameUserName' && DisplayName !== undefined ? (\r\n \r\n {DisplayName}\r\n {UserId === 'undefined' ? (\r\n <>\r\n ) : (\r\n <>\r\n {twoRows &&
}\r\n {' (' + UserId + ') '}\r\n \r\n )}\r\n
\r\n ) : (\r\n \r\n {DisplayName || UserId}\r\n \r\n );\r\n return isServiceAdmin && UserId !== 'undefined' ? (\r\n \r\n \r\n \r\n \r\n {text}\r\n \r\n \r\n \r\n ) : (\r\n {text}\r\n );\r\n },\r\n);\r\n","import { ConfigurableColumns } from 'app/components/BasicTable/ConfigurableColumns';\r\nimport { ExportImportApi } from './Api';\r\nimport { ImportAdditionalData, ImportData, TemplateColumns } from './Types';\r\n\r\nconst Api = new ExportImportApi();\r\nexport const ExportImportActions = {\r\n Export: (url: string, data?: any) => {\r\n return Api.export(url, data);\r\n },\r\n Import: (url: string, file, data?: ImportData) => {\r\n return Api.import(url, file, data);\r\n },\r\n TemplateColumns: (\r\n screenId: number,\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n return Api.TemplateColumns(screenId, Iad);\r\n },\r\n ConfigurableColumns: (\r\n url: string,\r\n listId: number,\r\n configurableType: number,\r\n ) => {\r\n return Api.ConfigurableColumns(\r\n url,\r\n listId,\r\n configurableType,\r\n );\r\n },\r\n ImportTemplate: (\r\n screenId: number,\r\n ext: string,\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n return Api.ImportTemplate(screenId, ext, Iad);\r\n },\r\n ExportForImport: (\r\n ScreenId: number,\r\n Ids: number[],\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n return Api.ExportForImport(ScreenId, Ids, Iad);\r\n },\r\n ImportImages: (files: File[], ScreenId: number) => {\r\n return Api.importImages(files, ScreenId);\r\n },\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport axios from 'axios';\r\nimport { ImportAdditionalData, ImportData } from './Types';\r\n\r\nexport class ExportImportApi {\r\n export = (url: string, data?: any) => {\r\n return axios.post(url, data, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n });\r\n };\r\n import = async (url: string, file, data?: ImportData) => {\r\n const formData = new FormData();\r\n formData.append('File', file);\r\n if (data !== undefined) {\r\n formData.append('importData', JSON.stringify(data));\r\n }\r\n try {\r\n const response = await axios.post(url, formData, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n },\r\n });\r\n return response;\r\n } catch (error: unknown) {\r\n throw error;\r\n }\r\n };\r\n ConfigurableColumns = (\r\n url: string,\r\n listId: number,\r\n configurableType: number,\r\n ) => {\r\n return httpClient.get(url, {\r\n ListID: listId,\r\n ConfigurableType: configurableType,\r\n });\r\n };\r\n TemplateColumns = (\r\n ScreenId: number,\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n const url = 'api/GenericImport/TemplateNames';\r\n return httpClient.get(url, {\r\n screenId: ScreenId,\r\n iad: Iad,\r\n });\r\n };\r\n ImportTemplate = (\r\n ScreenId: number,\r\n Ext: string,\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n const url = 'api/GenericImport/ImportTemplate';\r\n return axios.get(url, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n },\r\n params: { screenId: ScreenId, ext: Ext, iad: Iad },\r\n });\r\n };\r\n // Ids count may be too large.\r\n // Therefore, Ids are sent in the request body.\r\n ExportForImport = (\r\n ScreenId: number,\r\n Ids: number[],\r\n Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n ) => {\r\n const data = { ScreenId: ScreenId, Ids: Ids, Iad: Iad };\r\n const formData = new FormData();\r\n formData.append('importData', JSON.stringify(data));\r\n const url = 'api/GenericImport/ExportForImport';\r\n return axios.post(url, formData, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n },\r\n });\r\n };\r\n importImages = (files: File[], ScreenId: number) => {\r\n const url = 'api/GenericImport/ImportImages';\r\n const formData = new FormData();\r\n for (const file of files) {\r\n formData.append(file.name, file);\r\n }\r\n return axios.post(url, formData, {\r\n responseType: 'blob',\r\n timeout: undefined,\r\n maxContentLength: 50000000,\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n },\r\n params: { screenId: ScreenId },\r\n });\r\n };\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.samplesList || initialState;\r\n\r\nexport const selectSamplesList = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSamplesTableState = createSelector(\r\n [selectSlice],\r\n state => state.SamplesListTableState,\r\n);\r\nexport const selectSamplesData = createSelector(\r\n [selectSamplesList],\r\n state => state.SamplesList,\r\n);\r\nexport const selectSelectedRunType = createSelector(\r\n [selectSlice],\r\n state => state.SelectedRunType,\r\n);\r\nexport const selectRunDetails = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails,\r\n);\r\nexport const selectShowRunDialog = createSelector(\r\n [selectSamplesList],\r\n state => state.ShowRunDialog,\r\n);\r\nexport const selectSelectedSamples = createSelector(\r\n [selectSamplesList],\r\n state => state.SamplesSelected,\r\n);\r\nexport const selectSamplesListEditMode = createSelector(\r\n [selectSamplesList],\r\n state => state.EditMode,\r\n);\r\nexport const selectImportingRunDetails = createSelector(\r\n [selectSamplesList],\r\n state => state.ImportStarted,\r\n);\r\nexport const selectImportingRunDetailsFinished = createSelector(\r\n [selectSamplesList],\r\n state => state.ImportFinished,\r\n);\r\nexport const selectRunDetailsInstrument = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails?.Instrument?.Name,\r\n);\r\nexport const selectRunDetailsSecondaryInstrument = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails?.SecondaryInstrument?.Name,\r\n);\r\nexport const selectRunDetailsGradient = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails?.Gradient?.Name,\r\n);\r\nexport const selectRunDetailsCreatedDate = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails?.CreateDate,\r\n);\r\nexport const selectRunDetailsAcquision_type = createSelector(\r\n [selectSamplesList],\r\n state => state.RunDetails?.ACQUISITION_TYPE,\r\n);\r\n","export * from './CampusPickerFilter';\r\nexport * from './DatePickerFilter';\r\nexport * from './TextFieldFilter';\r\nexport * from './IFilterComponentProps';\r\n","/**\r\n *\r\n * TextField\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n TextField as MatTextField,\r\n TextFieldProps as MatTextFieldProps,\r\n Theme,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport { omit } from 'lodash';\r\n//import styled from 'styled-components/macro';\r\nexport interface TextFieldProps\r\n extends Omit {\r\n variant?: 'outlined' | 'filled' | 'standard';\r\n color?: 'primary' | 'secondary';\r\n autoComplete?: string;\r\n mini?: string;\r\n}\r\nexport function TextField(props: TextFieldProps) {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n/* only bottom border should have accent when focused according to figma design */\r\n/* TODO: override default theme instead of this mess */\r\nconst StyledTextField = withStyles((theme: Theme) => ({\r\n root: {\r\n margin: theme.spacing(0),\r\n },\r\n}))(MatTextField);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { BasicCheckBox, BasicCheckBoxProps } from '../BasicCheckBox';\r\n\r\nexport interface FormCheckboxProps extends BasicCheckBoxProps {\r\n label?: string;\r\n helperText?: string;\r\n}\r\nexport const FormCheckbox = ({\r\n label,\r\n onChange,\r\n onBlur,\r\n value,\r\n name,\r\n color,\r\n helperText,\r\n required,\r\n ...props\r\n}: FormCheckboxProps & FieldHookConfig & IFieldProps) => {\r\n const [field, meta] = useField({ name, ...props });\r\n const handleChange = (value, event) => {\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n field.onChange(event);\r\n };\r\n return (\r\n <>\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { MenuList, MenuItem, makeStyles, Theme, Box } from '@material-ui/core';\r\nimport { IFilterSettings } from './IFilterSettings';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Popper } from 'app/components/Popper';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AddFilterButtonProps {\r\n availableFilters: IFilterSettings[];\r\n onChange: (value: IFilterSettings) => void;\r\n filtersSelectionOpen: boolean;\r\n title: string;\r\n disabled?: boolean;\r\n disabledTitle?: string;\r\n}\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n // root: {\r\n // width: `${props.winWidth}px`,\r\n // height: 'calc(100% - 90px)',\r\n // },\r\n selectPaper: {\r\n height: '100%',\r\n },\r\n selectRoot: {\r\n padding: theme.spacing(2),\r\n },\r\n selectTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '8px 8px',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n '&>label': {\r\n width: '100%',\r\n textAlign: 'center',\r\n },\r\n },\r\n selectContent: {\r\n marginTop: theme.spacing(2),\r\n boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n overflow: 'auto',\r\n height: 'calc(100% - 96px)',\r\n // aim to show 10 top items in the list, with rest hidden behind scrollbar\r\n // maxHeight: '385px',\r\n // '&.mobHorizontal': {\r\n // maxHeight: '200px',\r\n // },\r\n '&.mobHorizontal': {\r\n height: 'calc(100% - 96px)',\r\n },\r\n },\r\n addButtonRoot: {\r\n width: '100%',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: 8,\r\n marginTop: 'unset',\r\n '&.isMobile': {\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n //marginTop: '16px',\r\n },\r\n },\r\n addCollapsContainer: {\r\n width: '100%',\r\n },\r\n}));\r\nexport function AddFilterButton({\r\n filtersSelectionOpen,\r\n ...props\r\n}: AddFilterButtonProps) {\r\n const [open, setOpen] = React.useState(filtersSelectionOpen);\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n React.useEffect(() => setOpen(filtersSelectionOpen), [filtersSelectionOpen]);\r\n\r\n const anchorRef = React.useRef(null);\r\n const [anchorEl, setAnchorEl] = React.useState<\r\n EventTarget & HTMLDivElement\r\n >();\r\n React.useEffect(() => {\r\n setAnchorEl(anchorRef.current ?? undefined);\r\n }, [anchorRef]);\r\n const handleAddFilterClick = e => {\r\n setOpen(c => !c);\r\n setAnchorEl(e.currentTarget);\r\n };\r\n // const winWidth = window.innerWidth;\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n // close popover on click anywhere outside the menu\r\n\r\n // control field search text value\r\n const [input, setInnput] = React.useState();\r\n\r\n // manually filter the items and take first 10\r\n const options = props.availableFilters.filter((item, index) =>\r\n item.displayName.toLowerCase().includes((input || '').toLowerCase()),\r\n );\r\n\r\n // handle selected filter event\r\n const handleFilterSelect = item => {\r\n props.onChange(item);\r\n setOpen(false);\r\n setInnput(undefined);\r\n };\r\n\r\n return (\r\n \r\n {/* TODO: user localization on button */}\r\n }\r\n disabled={props.disabled}\r\n title={props.disabled ? props.disabledTitle : undefined}\r\n >\r\n {props.title}\r\n \r\n {anchorEl !== undefined && (\r\n <>\r\n {/* {isMobile ? (\r\n \r\n \r\n }\r\n value={input || ''}\r\n onChange={e => setInnput(e.target.value)}\r\n aria-label={t(translations.SearchFilter)}\r\n autoFocus\r\n inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n fullWidth\r\n />\r\n\r\n \r\n {options.map((item, index) => (\r\n handleFilterSelect(item)}\r\n >\r\n {item.displayName}\r\n \r\n ))}\r\n \r\n \r\n ) : ( */}\r\n setOpen(false)}\r\n title={t(translations.SelectFieldToFilterBy)}\r\n minWidth=\"auto\"\r\n >\r\n \r\n }\r\n value={input || ''}\r\n aria-label={t(translations.SearchFilter)}\r\n inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n onChange={e => setInnput(e.target.value)}\r\n autoFocus\r\n fullWidth\r\n />\r\n\r\n \r\n {options.map((item, index) => (\r\n handleFilterSelect(item)}\r\n >\r\n {item.displayName}\r\n \r\n ))}\r\n \r\n \r\n {/* )} */}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AppliedFiltersContainer\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Directions } from '../FilterBox';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AppliedFiltersContainerProps {\r\n direction: Directions;\r\n}\r\n\r\nexport function AppliedFiltersContainer({\r\n children,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const classes = useStyles();\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n // maxHeight was taken to contain 3 AppliedFilterComponents vertically\r\n maxHeight: theme.spacing(54),\r\n height: 'auto',\r\n overflowY: 'auto',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: 12,\r\n width: '100%',\r\n },\r\n horizontal: {\r\n maxHeight: theme.spacing(21),\r\n },\r\n mobileRoot: {\r\n height: 'calc(100% - 48px)',\r\n maxHeight: '100%',\r\n gap: 'unset',\r\n margin: '-12px 0px 0px 0px',\r\n },\r\n mobileHorizontalRoot: {\r\n height: 'calc(100% - 48px)',\r\n maxHeight: '100%',\r\n gap: 'unset',\r\n margin: '-12px 0px 0px 0px',\r\n },\r\n }),\r\n);\r\n","import * as React from 'react';\r\nimport { AddFilterButton } from './AddFilterButton';\r\nimport { FilterDependencyData, IFilterSettings } from './IFilterSettings';\r\nimport { AppliedFilterComponent } from './AppliedFilterComponent';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { Box, styled } from '@material-ui/core';\r\nimport { areSameFilter } from './utils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Directions } from 'app/components/BasicTable/BasicFilter/FilterBox';\r\nimport { AppliedFiltersContainer } from 'app/components/BasicTable/BasicFilter/AppliedFiltersContainer';\r\nimport { SavedListsDropDown } from './SavedListsDropDown';\r\nimport { TableSavedListSettings } from '../BasicTableProps';\r\nimport { FilterValueType } from './FilterValueType';\r\n\r\nexport interface SingleFilterProps {}\r\n\r\nexport interface IBasicFilterGroupProps {\r\n availableFilters: IFilterSettings[];\r\n appliedFilters: IFilterSettings[];\r\n appliedFiltersDirection?: Directions;\r\n onClose: () => void;\r\n onChange: (items: IFilterSettings[]) => void;\r\n getDefaultFilters?: () => IFilterSettings[];\r\n autoOpenAddFilter: boolean;\r\n showFooter: boolean;\r\n savedListSettings?: TableSavedListSettings;\r\n filterDefaultOpen?: boolean;\r\n}\r\nexport function updateDepValues(\r\n filterValues: FilterDependencyData[],\r\n depKey: keyof TRow,\r\n depValue?: FilterValueType,\r\n) {\r\n if (depValue === null || depValue === undefined) {\r\n if (\r\n filterValues.length > 0 &&\r\n filterValues.some(f => f.depKey === depKey)\r\n ) {\r\n return filterValues.filter(f => f.depKey !== depKey);\r\n } else return filterValues;\r\n } else {\r\n if (\r\n filterValues.length > 0 &&\r\n filterValues.some(f => f.depKey === depKey)\r\n ) {\r\n return filterValues.map(f => {\r\n if (f.depKey === depKey) {\r\n let item = {\r\n depKey: f.depKey,\r\n depValue: depValue,\r\n };\r\n return Object.assign({}, f, item);\r\n } else {\r\n return f;\r\n }\r\n });\r\n } else {\r\n let item = {\r\n depKey: depKey,\r\n depValue: depValue,\r\n };\r\n return [...filterValues, item];\r\n }\r\n }\r\n}\r\nexport function getDependencyFilters(\r\n filters: IFilterSettings[],\r\n): IFilterSettings[] {\r\n if (filters.length > 0) {\r\n if (\r\n filters.some(\r\n f =>\r\n !!f.dependencyProp &&\r\n f.dependencyProp.length > 0 &&\r\n !!f.filterPredicates,\r\n )\r\n ) {\r\n let depFilters = filters.filter(\r\n f =>\r\n !!f.dependencyProp &&\r\n f.dependencyProp.length > 0 &&\r\n !!f.filterPredicates,\r\n );\r\n depFilters.forEach(item => {\r\n let depFiltered = filters.filter(f =>\r\n item.dependencyProp?.includes(f.fieldName),\r\n );\r\n if (depFiltered.length > 0) {\r\n depFiltered.forEach(filt => {\r\n let depValue = filt?.value ?? filt?.defaultValue;\r\n item.filterData = updateDepValues(\r\n item.filterData ?? [],\r\n filt.fieldName,\r\n depValue,\r\n );\r\n });\r\n }\r\n });\r\n return filters.map(item => {\r\n if (depFilters.some(d => d.fieldName === item.fieldName)) {\r\n return depFilters.filter(d => d.fieldName === item.fieldName)[0];\r\n } else {\r\n return item;\r\n }\r\n });\r\n }\r\n }\r\n return filters;\r\n}\r\nexport function BasicFilterGroup({\r\n onChange,\r\n onClose,\r\n appliedFiltersDirection = 'vertical',\r\n savedListSettings,\r\n getDefaultFilters,\r\n filterDefaultOpen,\r\n ...props\r\n}: IBasicFilterGroupProps) {\r\n const { t } = useTranslation();\r\n // save provided applied filters to be used in change callbacks\r\n const [visibleFilters, setVisibleFilters] = React.useState<\r\n IFilterSettings[]\r\n >(props.appliedFilters);\r\n\r\n // refresh applied filters if they were changed from outside\r\n React.useEffect(() => {\r\n setVisibleFilters(props.appliedFilters);\r\n }, [props.appliedFilters]);\r\n\r\n // handle addition of a new filter\r\n const handleAddFilter = (item: IFilterSettings) => {\r\n item.value = null;\r\n setVisibleFilters(currentState => {\r\n const newState = [\r\n ...currentState,\r\n { ...item, ...{ open: filterDefaultOpen ?? true } },\r\n ];\r\n onChange(newState);\r\n return newState;\r\n });\r\n };\r\n const handleAddFilterWithValue = (item: IFilterSettings) => {\r\n setVisibleFilters(currentState => {\r\n const newState = [\r\n ...currentState,\r\n { ...item, ...{ open: filterDefaultOpen ?? true } },\r\n ];\r\n onChange(newState);\r\n return newState;\r\n });\r\n };\r\n const handleClearClick = () => {\r\n setVisibleFilters(currentState => {\r\n const newState =\r\n getDefaultFilters?.() ??\r\n currentState.map(f => ({\r\n ...f,\r\n ...{ value: null, open: false },\r\n }));\r\n onChange([...newState]);\r\n return newState;\r\n });\r\n };\r\n\r\n // handle apply (change) of the applied filter\r\n const handleApply = item => {\r\n if (item.value === undefined) {\r\n item.value = null;\r\n }\r\n item.visible = true;\r\n item.open = false;\r\n setVisibleFilters(currentState => {\r\n const newState = currentState.map(f =>\r\n areSameFilter({ f, item }) ? item : f,\r\n );\r\n onChange(newState);\r\n return newState;\r\n });\r\n };\r\n\r\n // handle removal of applied filter\r\n const handleRemoveFitler = (item: IFilterSettings) => {\r\n setVisibleFilters(currentState => {\r\n const newState = currentState.filter(f => !areSameFilter({ f, item }));\r\n onChange(newState);\r\n return newState;\r\n });\r\n };\r\n\r\n /**\r\n * Filters available in \"Add filter\" - to be added to the displayed fitlers list\r\n */\r\n const availableFilters = props.availableFilters.filter(available => {\r\n const unavailable = visibleFilters;\r\n const isApplied = unavailable.some(applied =>\r\n areSameFilter({ f: available, item: applied }),\r\n );\r\n return !isApplied;\r\n });\r\n\r\n const appliedFitltersCount = visibleFilters.length;\r\n const [open, setOpen] = React.useState(props.autoOpenAddFilter ?? false);\r\n useEffectOnMount(() =>\r\n props.autoOpenAddFilter ? setOpen(appliedFitltersCount === 0) : void 0,\r\n );\r\n\r\n return (\r\n <>\r\n {visibleFilters.length > 0 && (\r\n \r\n {visibleFilters.map((item, index) => {\r\n return (\r\n \r\n );\r\n })}\r\n {savedListSettings && savedListSettings.enableSavedLists && (\r\n \r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n ).length === 1\r\n ? visibleFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n )[0]\r\n : props.availableFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n )[0]\r\n }\r\n hasInVisibleFilters={\r\n visibleFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n ).length === 1\r\n }\r\n onApply={handleApply}\r\n onRemove={handleRemoveFitler}\r\n addFilter={handleAddFilterWithValue}\r\n serializedKey={savedListSettings.savedListSerializedKey || 'eid'}\r\n listViewbyAsset={savedListSettings.listViewbyAsset}\r\n />\r\n )}\r\n \r\n )}\r\n\r\n {savedListSettings &&\r\n savedListSettings.enableSavedLists &&\r\n visibleFilters.length < 1 && (\r\n \r\n \r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n ).length === 1\r\n ? visibleFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n )[0]\r\n : props.availableFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n )[0]\r\n }\r\n hasInVisibleFilters={\r\n visibleFilters.filter(\r\n f =>\r\n f.fieldName ===\r\n savedListSettings.savedListRelatedPickerName,\r\n ).length === 1\r\n }\r\n onApply={handleApply}\r\n onRemove={handleRemoveFitler}\r\n addFilter={handleAddFilterWithValue}\r\n serializedKey={savedListSettings.savedListSerializedKey || 'eid'}\r\n listViewbyAsset={savedListSettings.listViewbyAsset}\r\n />\r\n \r\n )}\r\n {/* {!isMobile && (\r\n \r\n )} */}\r\n\r\n \r\n \r\n onClose()}\r\n >\r\n {t(translations.apply)}\r\n \r\n \r\n {t(translations.ResetFilters)}\r\n \r\n \r\n \r\n );\r\n}\r\nexport const ButtonsContainer = styled(Box)(theme => ({\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '8px 0px 0px',\r\n gap: 8,\r\n}));\r\n","import {\r\n FormControlProps as MuiFormControlProps,\r\n FormControl as MuiFormControl,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport * as React from 'react';\r\nexport interface FormControlProps extends MuiFormControlProps {\r\n boxed?: boolean;\r\n}\r\nconst FormControl = (props: FormControlProps) => {\r\n const { boxed, className, ...other } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormControl;\r\n","import { BaseTextFieldProps, InputAdornment } from '@material-ui/core';\r\nimport { PureDateInputProps } from '@material-ui/pickers/_shared/PureDateInput';\r\nimport React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\nimport { DatePopupVariants } from './utils/types';\r\n\r\nexport interface DateInputProps\r\n extends PureDateInputProps,\r\n Pick<\r\n BaseTextFieldProps,\r\n | 'autoFocus'\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'placeholder'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'margin'\r\n > {\r\n info?: string;\r\n ariaLabel?: string;\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n togglePicker: () => void;\r\n variant?: DatePopupVariants;\r\n}\r\n\r\nexport function DateInput(props: DateInputProps) {\r\n const {\r\n inputValue,\r\n openPicker,\r\n InputProps,\r\n TextFieldComponent,\r\n inputProps,\r\n onBlur,\r\n onFocus,\r\n validationError,\r\n inputVariant,\r\n togglePicker,\r\n info,\r\n ariaLabel,\r\n startIcon,\r\n endIcon,\r\n variant,\r\n ...other\r\n } = props;\r\n const TextComponent = !!TextFieldComponent\r\n ? TextFieldComponent\r\n : BaseTextField;\r\n const innerInputProps = React.useMemo(() => {\r\n return Object.assign({}, InputProps, { readOnly: true });\r\n }, [InputProps]);\r\n return (\r\n \r\n // \r\n // \r\n // ),\r\n endAdornment: (\r\n <>\r\n {(info && ) ||\r\n (endIcon && (\r\n {endIcon}\r\n ))}\r\n \r\n togglePicker()}\r\n disabled={props.disabled}\r\n size=\"xs\"\r\n variant=\"ghost\"\r\n >\r\n \r\n \r\n \r\n \r\n ),\r\n style: { minWidth: 80 },\r\n }}\r\n InputLabelProps={{\r\n shrink:\r\n props.inputVariant === 'filled'\r\n ? !isNullOrUndefined(inputValue)\r\n ? true\r\n : false\r\n : undefined,\r\n }}\r\n helperText={validationError || props.helperText}\r\n onClick={ev => {\r\n const target = ev.target as HTMLInputElement;\r\n if (!!target && target.nodeName === 'INPUT') openPicker();\r\n }}\r\n value={inputValue}\r\n variant={inputVariant}\r\n onKeyDown={(event: React.KeyboardEvent) => {\r\n if (event.key === 'Enter') {\r\n event.stopPropagation();\r\n openPicker();\r\n }\r\n }}\r\n onBlur={onBlur}\r\n onFocus={onFocus}\r\n {...other}\r\n />\r\n );\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { truncateTime } from './truncateTime';\r\nimport { DatePickerValueProps } from '../index';\r\n\r\n/**\r\n * Handles date-only period end date conversions\r\n * @param props\r\n * @returns\r\n */\r\n\r\nexport const toEndDateDisplayValue = (\r\n props: DatePickerValueProps & { direction: 'toDisplay' | 'fromDisplay' },\r\n) => {\r\n if (props.value === null) {\r\n return null;\r\n }\r\n if (props.value === undefined) {\r\n return null;\r\n }\r\n // first truncate the time part if required\r\n const truncatedDate = truncateTime({\r\n value: dateUtils.dateOrStringToDate(props.value),\r\n truncateTime: props.variant === 'date',\r\n });\r\n\r\n // then either move to one day forward for the underlying value or backward for the display value\r\n // for example, the actual stored value is '2010-11-12T00:00:00' is displayed as 'November 10th 2010' (note that 10th is inclusive till the midnight)\r\n const dir = props.direction === 'toDisplay' ? -1 : 1;\r\n const result = props.endTime\r\n ? dateUtils.addDays(truncatedDate, dir)\r\n : truncatedDate;\r\n return result;\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { DatePickerValueProps } from '../index';\r\n\r\n/**\r\n * Optionally truncates time part to be used in date-only picker\r\n * @param props\r\n * @returns\r\n */\r\nexport function truncateTime(\r\n props: Pick & { value: Date },\r\n) {\r\n return props.truncateTime ? dateUtils.truncateTime(props.value) : props.value;\r\n}\r\n","function dateLongFormatter(pattern, formatLong) {\r\n switch (pattern) {\r\n case 'P':\r\n return formatLong.date({\r\n width: 'short',\r\n });\r\n\r\n case 'PP':\r\n return formatLong.date({\r\n width: 'medium',\r\n });\r\n\r\n case 'PPP':\r\n return formatLong.date({\r\n width: 'long',\r\n });\r\n\r\n case 'PPPP':\r\n default:\r\n return formatLong.date({\r\n width: 'full',\r\n });\r\n }\r\n}\r\n\r\nfunction timeLongFormatter(pattern, formatLong) {\r\n switch (pattern) {\r\n case 'p':\r\n return formatLong.time({\r\n width: 'short',\r\n });\r\n\r\n case 'pp':\r\n return formatLong.time({\r\n width: 'medium',\r\n });\r\n\r\n case 'ppp':\r\n return formatLong.time({\r\n width: 'long',\r\n });\r\n\r\n case 'pppp':\r\n default:\r\n return formatLong.time({\r\n width: 'full',\r\n });\r\n }\r\n}\r\n\r\nfunction dateTimeLongFormatter(pattern, formatLong) {\r\n var matchResult = pattern.match(/(P+)(p+)?/) || [];\r\n var datePattern = matchResult[1];\r\n var timePattern = matchResult[2];\r\n\r\n if (!timePattern) {\r\n return dateLongFormatter(pattern, formatLong);\r\n }\r\n\r\n var dateTimeFormat;\r\n\r\n switch (datePattern) {\r\n case 'P':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'short',\r\n });\r\n break;\r\n\r\n case 'PP':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'medium',\r\n });\r\n break;\r\n\r\n case 'PPP':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'long',\r\n });\r\n break;\r\n\r\n case 'PPPP':\r\n default:\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'full',\r\n });\r\n break;\r\n }\r\n\r\n return dateTimeFormat\r\n .replace('{{date}}', dateLongFormatter(datePattern, formatLong))\r\n .replace('{{time}}', timeLongFormatter(timePattern, formatLong));\r\n}\r\n\r\nvar longFormatters = {\r\n p: timeLongFormatter,\r\n P: dateTimeLongFormatter,\r\n};\r\nexport default longFormatters;\r\n","// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\r\n// (one of the certain letters followed by `o`)\r\n// - (\\w)\\1* matches any sequences of the same letter\r\n// - '' matches two quote characters in a row\r\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\r\n// except a single quote symbol, which ends the sequence.\r\n// Two quote characters do not end the sequence.\r\n// If there is no matching single quote\r\n// then the sequence will continue until the end of the string.\r\n// - . matches any single character unmatched by previous parts of the RegExps\r\n// This RegExp catches symbols escaped by quotes, and also\r\n\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport longFormatters from './longFormatters';\r\n\r\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\r\nconst formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\r\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\r\n// const escapedStringRegExp = /^'([^]*?)'?$/;\r\n// const doubleQuoteRegExp = /''/g;\r\n// const notWhitespaceRegExp = /\\S/;\r\n// const unescapedLatinCharacterRegExp = /[a-zA-Z]/;\r\n//returns RegExpMatchArray\r\nexport default function getFormatTokens(formatString: string): string[] | null {\r\n // if(formatString === null ) return null;\r\n let tokens = formatString\r\n .match(longFormattingTokensRegExp)\r\n ?.map(function (substring) {\r\n var firstCharacter = substring[0];\r\n\r\n if (firstCharacter === 'p' || firstCharacter === 'P') {\r\n var longFormatter = longFormatters[firstCharacter];\r\n return longFormatter(\r\n substring,\r\n dateUtils.dateFnsUtils.locale.formatLong,\r\n // dateUtils.subFnOptions(),\r\n );\r\n }\r\n\r\n return substring;\r\n })\r\n .join('')\r\n .match(formattingTokensRegExp);\r\n if (tokens === undefined || tokens === null) {\r\n return null;\r\n }\r\n return tokens;\r\n}\r\n","import { IUtils } from '@date-io/core/IUtils';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { toEndDateDisplayValue } from 'app/components/DatePicker/utils/toEndDateDisplayValue';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport getFormatTokens from 'utils/DateFormattingUtils/getFormatTokens';\r\n\r\nexport type DateStartWith = 'day' | 'month' | 'year';\r\nexport type DatePopupVariants = 'date' | 'datetime' | 'time' | 'separated';\r\nexport interface DateTimeMask {\r\n day: string;\r\n month: string;\r\n year: string;\r\n hour: string;\r\n minute: string;\r\n meridiem: string;\r\n dateSeparator: string;\r\n dateStartFrom: DateStartWith;\r\n}\r\nexport interface FormatedResult {\r\n value: string;\r\n stayOnSelection: boolean;\r\n zeroPress: boolean;\r\n}\r\nexport const getInputViewDate = (\r\n variant: DatePopupVariants,\r\n value?: Date | string | null,\r\n endTime?: boolean,\r\n truncateTime?: boolean,\r\n): string | undefined => {\r\n if (variant === 'date') {\r\n return (\r\n dateUtils.shortDateFormat(\r\n toEndDateDisplayValue({\r\n value,\r\n endTime,\r\n truncateTime,\r\n direction: 'toDisplay',\r\n }),\r\n ) ?? undefined\r\n );\r\n } else if (variant === 'time') {\r\n return dateUtils.timeFormat(value) ?? undefined;\r\n } else if (variant === 'datetime') {\r\n return dateUtils.shortDateTimeFormat(value) ?? undefined;\r\n } else {\r\n return dateUtils.shortDateTimeFormat(value) ?? undefined;\r\n }\r\n};\r\nexport const setInputViewDate = (\r\n variant: DatePopupVariants,\r\n value?: Date | string | null,\r\n endTime?: boolean,\r\n truncateTime?: boolean,\r\n): MaterialUiPickersDate | null => {\r\n if (value === null) {\r\n return null;\r\n }\r\n if (value === undefined) {\r\n return null;\r\n } else if (variant === 'date') {\r\n let ddd =\r\n toEndDateDisplayValue({\r\n value,\r\n endTime,\r\n truncateTime,\r\n direction: 'fromDisplay',\r\n }) ?? value;\r\n return new CustomDate(ddd, 'date');\r\n } else if (variant === 'time') {\r\n return new CustomDate(value, 'time');\r\n } else if (variant === 'datetime') {\r\n return new CustomDate(value, 'complete');\r\n } else {\r\n return new CustomDate(value, 'complete');\r\n }\r\n};\r\nexport const getValueDateOrTruncat = (\r\n variant: DatePopupVariants,\r\n value?: Date | string | null,\r\n endTime?: boolean,\r\n truncateTime?: boolean,\r\n): Date | string | null | undefined => {\r\n if (value === null || value === undefined) {\r\n return value;\r\n }\r\n\r\n if (variant === 'date') {\r\n return toEndDateDisplayValue({\r\n value,\r\n endTime,\r\n truncateTime,\r\n direction: 'toDisplay',\r\n });\r\n } else {\r\n return value;\r\n }\r\n};\r\nexport const maskFormats = {\r\n date: '__/__/____',\r\n time: '__:__',\r\n timeMeridiem: '__:__ _M',\r\n dateTime: '__/__/____ __:__',\r\n dateTimeMeridiem: '__/__/____ __:__ _M',\r\n};\r\nexport const defaultDateTimeMask = (\r\n format: string,\r\n variant?: 'date' | 'time',\r\n): DateTimeMask => {\r\n const tokens = getFormatTokens(format);\r\n if (tokens === null) {\r\n let defTokens = getFormatTokens(dateUtils.DateIOFormats.keyboardDateTime); //full fate time\r\n if (defTokens === null) {\r\n return {\r\n day: 'dd',\r\n month: 'MM',\r\n year: 'yyyy',\r\n hour: 'HH',\r\n minute: 'mm',\r\n meridiem: 'a',\r\n dateSeparator: '/',\r\n dateStartFrom: 'day',\r\n };\r\n } else {\r\n let first = defTokens[0].toLowerCase();\r\n let dateStartWith = first.startsWith('d')\r\n ? 'day'\r\n : first.startsWith('m')\r\n ? 'month'\r\n : 'year';\r\n return {\r\n day:\r\n dateStartWith === 'day'\r\n ? defTokens[0]\r\n : dateStartWith === 'month'\r\n ? defTokens[2]\r\n : defTokens[4],\r\n month:\r\n dateStartWith === 'day'\r\n ? defTokens[2]\r\n : dateStartWith === 'month'\r\n ? defTokens[0]\r\n : defTokens[4],\r\n year:\r\n dateStartWith === 'day'\r\n ? defTokens[4]\r\n : dateStartWith === 'month'\r\n ? defTokens[4]\r\n : defTokens[0],\r\n hour: defTokens[6],\r\n minute: defTokens[8],\r\n meridiem: defTokens.length > 8 ? defTokens[10] : 'aa',\r\n dateSeparator: defTokens[1],\r\n dateStartFrom:\r\n dateStartWith === 'day'\r\n ? 'day'\r\n : dateStartWith === 'month'\r\n ? 'month'\r\n : 'year',\r\n };\r\n }\r\n } else {\r\n if (variant === undefined) {\r\n if (tokens[0].toLowerCase().startsWith('h')) {\r\n //time\r\n let dateTokens = getFormatTokens(\r\n dateUtils.DateIOFormats.keyboardDate,\r\n ) ?? ['dd', '/', 'MM', '/', 'yyyy']; //full date\r\n let first = dateTokens[0].toLowerCase();\r\n let dateStartWith = first.startsWith('d')\r\n ? 'day'\r\n : first.startsWith('m')\r\n ? 'month'\r\n : 'year';\r\n return {\r\n day:\r\n dateStartWith === 'day'\r\n ? dateTokens[0]\r\n : dateStartWith === 'month'\r\n ? dateTokens[2]\r\n : dateTokens[4],\r\n month:\r\n dateStartWith === 'day'\r\n ? dateTokens[2]\r\n : dateStartWith === 'month'\r\n ? dateTokens[0]\r\n : dateTokens[4],\r\n year:\r\n dateStartWith === 'day'\r\n ? dateTokens[4]\r\n : dateStartWith === 'month'\r\n ? dateTokens[4]\r\n : dateTokens[0],\r\n hour: tokens[0],\r\n minute: tokens[2],\r\n meridiem: tokens.length > 2 ? tokens[4] : 'aa',\r\n dateSeparator: dateTokens[1],\r\n dateStartFrom:\r\n dateStartWith === 'day'\r\n ? 'day'\r\n : dateStartWith === 'month'\r\n ? 'month'\r\n : 'year',\r\n };\r\n } else {\r\n //date\r\n let first = tokens[0].toLowerCase();\r\n let dateStartWith = first.startsWith('d')\r\n ? 'day'\r\n : first.startsWith('m')\r\n ? 'month'\r\n : 'year';\r\n let timeTokens = getFormatTokens(dateUtils.DateIOFormats.fullTime) ?? [\r\n 'HH',\r\n ':',\r\n 'mm',\r\n ];\r\n return {\r\n day:\r\n dateStartWith === 'day'\r\n ? tokens[0]\r\n : dateStartWith === 'month'\r\n ? tokens[2]\r\n : tokens[4],\r\n month:\r\n dateStartWith === 'day'\r\n ? tokens[2]\r\n : dateStartWith === 'month'\r\n ? tokens[0]\r\n : tokens[4],\r\n year:\r\n dateStartWith === 'day'\r\n ? tokens[4]\r\n : dateStartWith === 'month'\r\n ? tokens[4]\r\n : tokens[0],\r\n hour: timeTokens[0],\r\n minute: timeTokens[2],\r\n meridiem: timeTokens.length > 2 ? timeTokens[4] : 'a',\r\n dateSeparator: tokens[1],\r\n dateStartFrom:\r\n dateStartWith === 'day'\r\n ? 'day'\r\n : dateStartWith === 'month'\r\n ? 'month'\r\n : 'year',\r\n };\r\n }\r\n } else {\r\n if (variant === 'time') {\r\n let dateTokens = getFormatTokens(\r\n dateUtils.DateIOFormats.keyboardDate,\r\n ) ?? ['dd', '/', 'MM', '/', 'yyyy']; //full date\r\n let first = dateTokens[0].toLowerCase();\r\n let dateStartWith = first.startsWith('d')\r\n ? 'day'\r\n : first.startsWith('m')\r\n ? 'month'\r\n : 'year';\r\n return {\r\n day:\r\n dateStartWith === 'day'\r\n ? dateTokens[0]\r\n : dateStartWith === 'month'\r\n ? dateTokens[2]\r\n : dateTokens[4],\r\n month:\r\n dateStartWith === 'day'\r\n ? dateTokens[2]\r\n : dateStartWith === 'month'\r\n ? dateTokens[0]\r\n : dateTokens[4],\r\n year:\r\n dateStartWith === 'day'\r\n ? dateTokens[4]\r\n : dateStartWith === 'month'\r\n ? dateTokens[4]\r\n : dateTokens[0],\r\n hour: tokens[0],\r\n minute: tokens[2],\r\n meridiem: tokens.length > 2 ? tokens[4] : 'a',\r\n dateSeparator: dateTokens[1],\r\n dateStartFrom:\r\n dateStartWith === 'day'\r\n ? 'day'\r\n : dateStartWith === 'month'\r\n ? 'month'\r\n : 'year',\r\n };\r\n } else {\r\n let first = tokens[0].toLowerCase();\r\n let dateStartWith = first.startsWith('d')\r\n ? 'day'\r\n : first.startsWith('m')\r\n ? 'month'\r\n : 'year';\r\n let timeTokens = getFormatTokens(dateUtils.DateIOFormats.fullTime) ?? [\r\n 'HH',\r\n ':',\r\n 'mm',\r\n ];\r\n return {\r\n day:\r\n dateStartWith === 'day'\r\n ? tokens[0]\r\n : dateStartWith === 'month'\r\n ? tokens[2]\r\n : tokens[4],\r\n month:\r\n dateStartWith === 'day'\r\n ? tokens[2]\r\n : dateStartWith === 'month'\r\n ? tokens[0]\r\n : tokens[4],\r\n year:\r\n dateStartWith === 'day'\r\n ? tokens[4]\r\n : dateStartWith === 'month'\r\n ? tokens[4]\r\n : tokens[0],\r\n hour: timeTokens[0],\r\n minute: timeTokens[2],\r\n meridiem: timeTokens.length > 2 ? timeTokens[4] : 'a',\r\n dateSeparator: tokens[1],\r\n dateStartFrom:\r\n dateStartWith === 'day'\r\n ? 'day'\r\n : dateStartWith === 'month'\r\n ? 'month'\r\n : 'year',\r\n };\r\n }\r\n }\r\n }\r\n};\r\n\r\nexport const maskFormat = (\r\n dateVariant: Omit,\r\n ampm: boolean,\r\n): string => {\r\n switch (dateVariant) {\r\n case 'date':\r\n return maskFormats.date;\r\n case 'time':\r\n return ampm ? maskFormats.timeMeridiem : maskFormats.time;\r\n case 'datetime':\r\n return ampm ? maskFormats.dateTimeMeridiem : maskFormats.dateTime;\r\n default:\r\n return maskFormats.date;\r\n }\r\n};\r\nexport function makeMaskFromFormat(format, numberMaskChar) {\r\n return format.replace(/[a-z]/gi, numberMaskChar);\r\n}\r\n//MUI-4 dateFormatter\r\nexport const maskedDateFormatter = function (mask, numberMaskChar, refuse) {\r\n return function (value) {\r\n var result = '';\r\n var parsed = value.replace(refuse, '');\r\n if (parsed === '') {\r\n return parsed;\r\n }\r\n var i = 0;\r\n var n = 0;\r\n while (i < mask.length) {\r\n var maskChar = mask[i];\r\n if (maskChar === numberMaskChar && n < parsed.length) {\r\n var parsedChar = parsed[n];\r\n result += parsedChar;\r\n n += 1;\r\n } else {\r\n result += maskChar;\r\n }\r\n i += 1;\r\n }\r\n return result;\r\n };\r\n};\r\n\r\nexport const parseDigits = (input: string) =>\r\n (input.match(/\\d+/g) || []).join('');\r\n\r\nexport const formatDate = (input: string) => {\r\n const digits = parseDigits(input);\r\n const chars = digits.split('');\r\n let res = chars\r\n .reduce((r, v, index) => {\r\n return index === 2 || index === 4 ? `${r}/${v}` : `${r}${v}`;\r\n }, '')\r\n .substr(0, 10);\r\n return res;\r\n};\r\n\r\nexport const formatDateWithAppend = (input: string) => {\r\n const res = formatDate(input);\r\n\r\n if (input.endsWith('/')) {\r\n if (res.length === 2) {\r\n return `${res}/`;\r\n }\r\n\r\n if (res.length === 5) {\r\n return `${res}/`;\r\n }\r\n }\r\n return res;\r\n};\r\n\r\nexport const appendHyphen = v =>\r\n v.length === 2 || v.length === 5 ? `${v}/` : v;\r\nexport const addMask = string => {\r\n const digits = parseDigits(string);\r\n const days = digits.slice(0, 2).padEnd(2, '_');\r\n const months = digits.slice(2, 4).padEnd(2, '_');\r\n const years = digits.slice(4, 8).padEnd(4, '_');\r\n return `${days}-${months}-${years}`;\r\n};\r\n\r\nexport const dateStart: DateStartWith = dateUtils.dateFnsUtils.dateFormat\r\n .toLowerCase()\r\n .startsWith('m')\r\n ? 'month'\r\n : dateUtils.dateFnsUtils.dateFormat.toLowerCase().startsWith('d')\r\n ? 'day'\r\n : dateUtils.dateFnsUtils.dateFormat.toLowerCase().startsWith('y')\r\n ? 'year'\r\n : 'day';\r\n\r\nexport const dateSelection = (\r\n event: React.MouseEvent,\r\n maskFormats: DateTimeMask,\r\n) => {\r\n const target = event.target as HTMLInputElement;\r\n let dateStartFrom = maskFormats.dateStartFrom;\r\n // let selectionDirection = target.selectionDirection;\r\n let selectionStart = target.selectionStart;\r\n let selectionEnd = target.selectionEnd;\r\n if (!!target.value && target.value !== '') {\r\n if (dateStartFrom === 'year') {\r\n if (selectionEnd !== null) {\r\n if (selectionEnd <= 4) {\r\n if (selectionStart === 0 && selectionEnd === 4) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(0, 4);\r\n } else if (selectionEnd <= 7) {\r\n if (selectionStart === 5 && selectionEnd === 7) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(5, 7);\r\n } else {\r\n if (selectionStart === 8 && selectionEnd === 10) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(8, 10);\r\n }\r\n // target.setRangeText(target.value.substring(0, 2));\r\n }\r\n } else {\r\n if (selectionEnd !== null) {\r\n if (selectionEnd <= 2) {\r\n if (selectionStart === 0 && selectionEnd === 2) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(0, 2);\r\n } else if (selectionEnd <= 5) {\r\n if (selectionStart === 3 && selectionEnd === 5) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(3, 5);\r\n } else {\r\n if (selectionStart === 6 && selectionEnd === 10) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(6, 10);\r\n }\r\n // target.setRangeText(target.value.substring(0, 2));\r\n }\r\n }\r\n }\r\n};\r\nexport const timeSelection = (\r\n event: React.MouseEvent,\r\n maskFormats: DateTimeMask,\r\n) => {\r\n const target = event.target as HTMLInputElement;\r\n // let selectionDirection = target.selectionDirection;\r\n let selectionStart = target.selectionStart ?? 0;\r\n let selectionEnd = target.selectionEnd ?? 0;\r\n let oneLetterHour =\r\n maskFormats.hour.length === 1 && target.value.split(':')[0].length === 1;\r\n\r\n if (!!target.value && target.value !== '') {\r\n if (selectionEnd <= (oneLetterHour ? 1 : 2)) {\r\n if (selectionStart === 0 && selectionEnd === (oneLetterHour ? 1 : 2)) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n } else if (selectionEnd <= (oneLetterHour ? 4 : 5)) {\r\n if (\r\n selectionStart > (oneLetterHour ? 1 : 2) &&\r\n selectionEnd === (oneLetterHour ? 4 : 5)\r\n ) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(oneLetterHour ? 2 : 3, oneLetterHour ? 4 : 5);\r\n } else {\r\n if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n if (\r\n selectionStart === (oneLetterHour ? 5 : 6) &&\r\n selectionEnd === (oneLetterHour ? 7 : 8)\r\n ) {\r\n event.preventDefault();\r\n }\r\n target.setSelectionRange(oneLetterHour ? 5 : 6, oneLetterHour ? 7 : 8);\r\n } else {\r\n target.setSelectionRange(3, 5);\r\n }\r\n }\r\n }\r\n};\r\nexport const dateArrowSelection = (\r\n event: React.KeyboardEvent,\r\n arrows: 'left' | 'right',\r\n variant: 'date' | 'time',\r\n maskFormats: DateTimeMask,\r\n) => {\r\n const target = event.target as HTMLInputElement;\r\n let selectionStart = target.selectionStart ?? 0;\r\n let selectionEnd = target.selectionEnd ?? 0;\r\n let oneLetterHour =\r\n variant === 'time' &&\r\n maskFormats.hour.length === 1 &&\r\n target.value.split(':')[0].length === 1;\r\n let dateStartFrom = maskFormats.dateStartFrom;\r\n if (arrows === 'left') {\r\n if (!!target.value && target.value !== '') {\r\n if (variant === 'time') {\r\n if (selectionStart <= (oneLetterHour ? 2 : 3)) {\r\n target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n } else if (\r\n selectionStart <= (oneLetterHour ? 5 : 6) &&\r\n selectionStart > (oneLetterHour ? 2 : 3)\r\n ) {\r\n target.setSelectionRange(\r\n oneLetterHour ? 2 : 3,\r\n oneLetterHour ? 4 : 5,\r\n );\r\n } else {\r\n if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n target.setSelectionRange(\r\n oneLetterHour ? 5 : 6,\r\n oneLetterHour ? 7 : 8,\r\n );\r\n } else {\r\n target.setSelectionRange(3, 5);\r\n }\r\n }\r\n } else {\r\n if (dateStartFrom === 'year') {\r\n if (selectionStart <= 6 && selectionStart > 4) {\r\n target.setSelectionRange(0, 4);\r\n } else if (selectionStart <= 8 && selectionStart > 5) {\r\n target.setSelectionRange(5, 7);\r\n } else {\r\n target.setSelectionRange(8, 10);\r\n }\r\n } else {\r\n if (selectionStart <= 3) {\r\n target.setSelectionRange(0, 2);\r\n } else if (selectionStart <= 6 && selectionStart > 3) {\r\n target.setSelectionRange(3, 5);\r\n } else {\r\n target.setSelectionRange(6, 10);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (arrows === 'right') {\r\n if (!!target.value && target.value !== '') {\r\n if (variant === 'time') {\r\n if (\r\n selectionEnd >= (oneLetterHour ? 1 : 2) &&\r\n selectionEnd < (oneLetterHour ? 4 : 5)\r\n ) {\r\n target.setSelectionRange(\r\n oneLetterHour ? 2 : 3,\r\n oneLetterHour ? 4 : 5,\r\n );\r\n } else if (selectionEnd >= (oneLetterHour ? 4 : 5)) {\r\n if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n target.setSelectionRange(\r\n oneLetterHour ? 5 : 6,\r\n oneLetterHour ? 7 : 8,\r\n );\r\n } else {\r\n target.setSelectionRange(3, 5);\r\n }\r\n } else {\r\n target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n }\r\n } else {\r\n if (dateStartFrom === 'year') {\r\n if (selectionEnd >= 4 && selectionEnd < 7) {\r\n target.setSelectionRange(5, 7);\r\n } else if (selectionEnd >= 7) {\r\n target.setSelectionRange(8, 10);\r\n } else {\r\n target.setSelectionRange(0, 2);\r\n }\r\n } else {\r\n if (selectionEnd >= 2 && selectionEnd < 5) {\r\n target.setSelectionRange(3, 5);\r\n } else if (selectionEnd >= 5) {\r\n target.setSelectionRange(6, 10);\r\n } else {\r\n target.setSelectionRange(0, 2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport const getMaskedDateValue = (mask: DateTimeMask, value?: string) => {\r\n let singleValue = !!value && value.length === 1 ? value : undefined;\r\n return mask.dateStartFrom === 'day'\r\n ? `${!!singleValue ? singleValue : mask.day}${mask.dateSeparator}${\r\n mask.month\r\n }${mask.dateSeparator}${mask.year}`\r\n : mask.dateStartFrom === 'month'\r\n ? `${!!singleValue ? singleValue : mask.month}${mask.dateSeparator}${\r\n mask.day\r\n }${mask.dateSeparator}${mask.year}`\r\n : `${!!singleValue ? singleValue : mask.year}${mask.dateSeparator}${\r\n mask.month\r\n }${mask.dateSeparator}${mask.day}`;\r\n};\r\nexport const getMaskedTimeValue = (\r\n mask: DateTimeMask,\r\n ampm?: boolean,\r\n value?: string,\r\n) => {\r\n let separator = ':';\r\n // value only used when is a single character\r\n let hour = !!value && value.length === 1 ? value : undefined;\r\n return ampm\r\n ? `${!!hour ? hour : mask.hour}${separator}${mask.minute} ${mask.meridiem}`\r\n : `${!!hour ? hour : mask.hour}${separator}${mask.minute}`;\r\n};\r\nexport const formatingDate = (\r\n text: string,\r\n partChanged: 'day' | 'month' | 'year',\r\n maskFormat: DateTimeMask,\r\n prevValue: string,\r\n increment?: 'increase' | 'decrease',\r\n isPrevZero?: boolean,\r\n isSelectionChanged?: boolean,\r\n): FormatedResult => {\r\n let result = {\r\n value: prevValue,\r\n stayOnSelection: false,\r\n zeroPress: false,\r\n };\r\n let stayOnSelection = false;\r\n let newDate = prevValue;\r\n let separator = maskFormat.dateSeparator;\r\n let startedFrom = maskFormat.dateStartFrom;\r\n let zeroPress = false;\r\n if (text === '') {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${maskFormat.day}${separator}${maskFormat.month}${separator}${maskFormat.year}`\r\n : maskFormat.dateStartFrom === 'month'\r\n ? `${maskFormat.month}${separator}${maskFormat.day}${separator}${maskFormat.year}`\r\n : `${maskFormat.year}${separator}${maskFormat.month}${separator}${maskFormat.day}`;\r\n } else {\r\n let parts = text.split(separator);\r\n let prevParts = prevValue.split(separator);\r\n if (partChanged === 'day') {\r\n let dayVal =\r\n startedFrom === 'day'\r\n ? parts[0]\r\n : startedFrom === 'month'\r\n ? parts[1]\r\n : parts[2];\r\n let prevDayVal =\r\n startedFrom === 'day'\r\n ? prevParts[0]\r\n : startedFrom === 'month'\r\n ? prevParts[1]\r\n : prevParts[2];\r\n if (dayVal === '') {\r\n stayOnSelection = true;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${maskFormat.day}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${maskFormat.day}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.day}`;\r\n } else {\r\n if (\r\n dayVal.match(/[^\\d]+/gi) ||\r\n (dayVal === '0' &&\r\n !isNaN(parseInt(prevDayVal)) &&\r\n (parseInt(prevDayVal) > 3 || isSelectionChanged)) ||\r\n isNaN(parseInt(dayVal))\r\n ) {\r\n stayOnSelection = true;\r\n zeroPress = dayVal === '0';\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${prevDayVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${prevDayVal}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${prevDayVal}`;\r\n } else {\r\n let newVal = '';\r\n let dayInt = parseInt(dayVal);\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n dayInt = increment === 'increase' ? dayInt + 1 : dayInt - 1;\r\n dayVal = dayInt.toString();\r\n if (dayInt <= 0) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${'31'}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${'31'}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${'31'}`;\r\n } else if (dayInt > 31) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${'01'}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${'01'}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${'01'}`;\r\n } else {\r\n newVal = dayInt < 10 ? `0${dayVal}` : dayVal;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${newVal}`;\r\n }\r\n } else {\r\n if (prevDayVal === '' || prevDayVal === maskFormat.day) {\r\n newVal = `0${dayVal}`;\r\n stayOnSelection = dayInt <= 3;\r\n } else {\r\n let prevInt = parseInt(isPrevZero ? '0' : prevDayVal);\r\n if (prevInt.toString().length > 1) {\r\n newVal = `0${dayVal}`;\r\n stayOnSelection = dayInt <= 3;\r\n } else {\r\n if (prevInt > 3) {\r\n newVal = `0${dayVal}`;\r\n stayOnSelection = dayInt <= 3;\r\n } else {\r\n let comb = `${prevInt}${dayInt}`;\r\n if (parseInt(comb) > 31) {\r\n newVal = `0${dayVal}`;\r\n stayOnSelection = dayInt <= 3;\r\n } else {\r\n newVal = comb;\r\n }\r\n }\r\n }\r\n }\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${parts[1]}${separator}${newVal}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newDate,\r\n stayOnSelection: stayOnSelection,\r\n zeroPress: zeroPress,\r\n };\r\n } else if (partChanged === 'month') {\r\n let monthVal =\r\n startedFrom === 'day'\r\n ? parts[1]\r\n : startedFrom === 'month'\r\n ? parts[0]\r\n : parts[1];\r\n let prevMonthVal =\r\n startedFrom === 'day'\r\n ? prevParts[1]\r\n : startedFrom === 'month'\r\n ? prevParts[0]\r\n : prevParts[1];\r\n\r\n // let monthArray = monthEntityArray;\r\n if (monthVal === '') {\r\n stayOnSelection = true;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${maskFormat.month}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${maskFormat.month}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${maskFormat.month}${separator}${parts[2]}`;\r\n } else {\r\n if (\r\n monthVal.match(/[^\\d]+/gi) ||\r\n (monthVal === '0' &&\r\n !isNaN(parseInt(prevMonthVal)) &&\r\n (parseInt(prevMonthVal) > 1 || isSelectionChanged)) ||\r\n isNaN(parseInt(monthVal))\r\n ) {\r\n stayOnSelection = true;\r\n zeroPress = monthVal === '0';\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${prevMonthVal}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${prevMonthVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${prevMonthVal}${separator}${parts[2]}`;\r\n } else {\r\n let newVal = '';\r\n let monthInt = parseInt(monthVal);\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n monthInt = increment === 'increase' ? monthInt + 1 : monthInt - 1;\r\n monthVal = monthInt.toString();\r\n\r\n if (monthInt <= 0) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${'12'}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${'12'}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${'12'}${separator}${parts[2]}`;\r\n } else if (monthInt > 12) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${'01'}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${'01'}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${'01'}${separator}${parts[2]}`;\r\n } else {\r\n newVal = monthInt < 10 ? `0${monthVal}` : monthVal;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${newVal}${separator}${parts[2]}`;\r\n }\r\n } else {\r\n if (prevMonthVal === '' || prevMonthVal === maskFormat.month) {\r\n newVal = `0${monthVal}`;\r\n stayOnSelection = monthInt <= 1;\r\n } else {\r\n let prevMonthInt = parseInt(isPrevZero ? '0' : prevMonthVal);\r\n if (prevMonthInt.toString().length > 1) {\r\n newVal = `0${monthVal}`;\r\n stayOnSelection = monthInt <= 1;\r\n } else {\r\n let comb = `${prevMonthInt}${monthInt}`;\r\n if (parseInt(comb) > 12) {\r\n newVal = `0${monthVal}`;\r\n stayOnSelection = monthInt <= 1;\r\n } else {\r\n newVal = comb;\r\n }\r\n // if (prevMonthInt === 1) {\r\n // let comb = `${prevMonthInt}${monthInt}`;\r\n // if (parseInt(comb) > 12) {\r\n // newVal = `0${monthVal}`;\r\n // stayOnSelection = monthInt <= 1;\r\n // } else {\r\n // newVal = comb;\r\n // }\r\n // } else {\r\n // newVal = `0${monthVal}`;\r\n // stayOnSelection = monthInt <= 1;\r\n // }\r\n }\r\n }\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n : startedFrom === 'month'\r\n ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n : `${parts[0]}${separator}${newVal}${separator}${parts[2]}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newDate,\r\n stayOnSelection: stayOnSelection,\r\n zeroPress: zeroPress,\r\n };\r\n } else if (partChanged === 'year') {\r\n let yearVal =\r\n startedFrom === 'day'\r\n ? parts[2]\r\n : startedFrom === 'month'\r\n ? parts[2]\r\n : parts[0];\r\n let prevYearVal =\r\n startedFrom === 'day'\r\n ? prevParts[2]\r\n : startedFrom === 'month'\r\n ? prevParts[2]\r\n : prevParts[0];\r\n if (yearVal === '') {\r\n stayOnSelection = true;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.year}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.year}`\r\n : `${maskFormat.year}${separator}${parts[1]}${separator}${parts[2]}`;\r\n } else {\r\n if (\r\n yearVal.match(/[^\\d]+/gi) ||\r\n // yearVal === '0' ||\r\n isNaN(parseInt(yearVal))\r\n ) {\r\n stayOnSelection = true;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${prevYearVal}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${prevYearVal}`\r\n : `${prevYearVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n } else {\r\n let newVal = '';\r\n let yearInt = parseInt(yearVal);\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n yearInt = increment === 'increase' ? yearInt + 1 : yearInt - 1;\r\n yearVal = yearInt.toString();\r\n if (yearInt < 0) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${'9999'}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${'9999'}`\r\n : `${'9999'}${separator}${parts[1]}${separator}${parts[2]}`;\r\n } else if (yearInt > 9999) {\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${'0000'}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${'0000'}`\r\n : `${'0000'}${separator}${parts[1]}${separator}${parts[2]}`;\r\n } else {\r\n newVal =\r\n yearInt > 1000\r\n ? yearVal\r\n : yearInt > 100\r\n ? `0${yearVal}`\r\n : yearInt > 10\r\n ? `00${yearVal}`\r\n : `000${yearVal}`;\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n : `${newVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n }\r\n } else {\r\n if (prevYearVal === undefined) {\r\n newVal =\r\n yearVal.length === 4\r\n ? yearVal\r\n : yearVal.length === 3\r\n ? `0${yearVal}`\r\n : yearVal.length === 2\r\n ? `00${yearVal}`\r\n : `000${yearVal}`;\r\n } else if (prevYearVal === '' || prevYearVal === maskFormat.year) {\r\n newVal = `000${yearVal}`;\r\n } else if (prevYearVal.startsWith('0')) {\r\n newVal = prevYearVal.padEnd(5, yearVal).slice(1, 5);\r\n } else {\r\n newVal = `000${yearVal}`;\r\n }\r\n newDate =\r\n startedFrom === 'day'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n : startedFrom === 'month'\r\n ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n : `${newVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newDate,\r\n stayOnSelection: true,\r\n zeroPress: false,\r\n };\r\n } else {\r\n return result;\r\n }\r\n }\r\n\r\n return result;\r\n};\r\nexport const formatingTime = (\r\n text: string,\r\n partChanged: 'hour' | 'minute' | 'meridiem',\r\n maskFormat: DateTimeMask,\r\n prevValue: string,\r\n increment?: 'increase' | 'decrease',\r\n ampm?: boolean,\r\n) => {\r\n let result = {\r\n value: prevValue,\r\n stayOnSelection: false,\r\n };\r\n let stayOnSelection = false;\r\n let newTime = prevValue;\r\n let separator = ':';\r\n if (text === '') {\r\n newTime = ampm\r\n ? `${maskFormat.hour}${separator}${maskFormat.minute} ${maskFormat.meridiem}`\r\n : `${maskFormat.hour}${separator}${maskFormat.minute}`;\r\n } else {\r\n let parts = text.split(separator);\r\n let hour = parts[0];\r\n let minute = ampm ? parts[1].split(' ')[0] : parts[1];\r\n let meridiem = ampm ? parts[1].split(' ')[1] : '';\r\n let prevParts = prevValue.split(separator);\r\n let prevHour = prevParts[0];\r\n let prevMinute = ampm ? prevParts[1].split(' ')[0] : prevParts[1];\r\n let prevMeridiem = ampm ? prevParts[1].split(' ')[1] : '';\r\n if (partChanged === 'hour') {\r\n if (hour === '') {\r\n stayOnSelection = true;\r\n newTime = ampm\r\n ? `${maskFormat.hour}${separator}${minute} ${meridiem}`\r\n : `${maskFormat.hour}${separator}${minute}`;\r\n } else {\r\n if (\r\n hour.match(/[^\\d]+/gi) ||\r\n (ampm &&\r\n ((hour === '0' &&\r\n !isNaN(parseInt(prevHour)) &&\r\n parseInt(prevHour) > 1) ||\r\n isNaN(parseInt(hour))))\r\n ) {\r\n stayOnSelection = true;\r\n newTime = ampm\r\n ? `${prevHour}${separator}${minute} ${meridiem}`\r\n : `${prevHour}${separator}${minute}`;\r\n } else {\r\n let newVal = '';\r\n let hourInt = parseInt(hour);\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n hourInt = increment === 'increase' ? hourInt + 1 : hourInt - 1;\r\n hour = hourInt.toString();\r\n\r\n if (hourInt < 0 || (ampm && hourInt === 0)) {\r\n newTime = ampm\r\n ? `${'12'}${separator}${minute} ${meridiem}`\r\n : `${'23'}${separator}${minute}`;\r\n } else if (hourInt > (ampm ? 12 : 23)) {\r\n newTime = ampm\r\n ? `${\r\n maskFormat.hour.length === 1 ? '1' : '01'\r\n }${separator}${minute} ${meridiem}`\r\n : `${'00'}${separator}${minute}`;\r\n } else {\r\n newVal =\r\n hourInt < 10\r\n ? ampm\r\n ? maskFormat.hour.length === 1\r\n ? hour\r\n : `0${hour}`\r\n : `0${hour}`\r\n : hour;\r\n newTime = ampm\r\n ? `${newVal}${separator}${minute} ${meridiem}`\r\n : `${newVal}${separator}${minute}`;\r\n }\r\n } else {\r\n if (prevHour === '' || prevHour === maskFormat.hour) {\r\n newVal = ampm\r\n ? maskFormat.hour.length === 1\r\n ? `${hour}`\r\n : `0${hour}`\r\n : `0${hour}`;\r\n stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n } else {\r\n let prevHourInt = parseInt(prevHour);\r\n if (prevHourInt.toString().length > 1) {\r\n newVal = ampm\r\n ? maskFormat.hour.length === 1\r\n ? `${hour}`\r\n : `0${hour}`\r\n : `0${hour}`;\r\n stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n } else {\r\n if (\r\n (ampm && prevHourInt === 1) ||\r\n (!ampm && prevHourInt <= 2)\r\n ) {\r\n let comb = `${prevHourInt}${hourInt}`;\r\n if (ampm && parseInt(comb) > 12) {\r\n newVal =\r\n maskFormat.hour.length === 1 ? `${hour}` : `0${hour}`;\r\n stayOnSelection = hourInt <= 1;\r\n } else if (!ampm && parseInt(comb) > 23) {\r\n newVal = `0${hour}`;\r\n stayOnSelection = hourInt <= 2;\r\n } else {\r\n newVal = comb;\r\n }\r\n } else {\r\n newVal = ampm\r\n ? maskFormat.hour.length === 1\r\n ? `${hour}`\r\n : `0${hour}`\r\n : `0${hour}`;\r\n stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n }\r\n }\r\n }\r\n newTime = ampm\r\n ? `${newVal}${separator}${minute} ${meridiem}`\r\n : `${newVal}${separator}${minute}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newTime,\r\n stayOnSelection: stayOnSelection,\r\n };\r\n }\r\n if (partChanged === 'minute') {\r\n if (minute === '') {\r\n stayOnSelection = true;\r\n newTime = ampm\r\n ? `${hour}${separator}${maskFormat.minute} ${meridiem}`\r\n : `${hour}${separator}${maskFormat.minute}`;\r\n } else {\r\n if (minute.match(/[^\\d]+/gi)) {\r\n stayOnSelection = true;\r\n newTime = ampm\r\n ? `${hour}${separator}${prevMinute} ${meridiem}`\r\n : `${hour}${separator}${prevMinute}`;\r\n } else {\r\n let newVal = '';\r\n let minuteInt = parseInt(minute);\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n minuteInt =\r\n increment === 'increase' ? minuteInt + 1 : minuteInt - 1;\r\n minute = minuteInt.toString();\r\n\r\n if (minuteInt < 0) {\r\n newTime = ampm\r\n ? `${hour}${separator}${'59'} ${meridiem}`\r\n : `${hour}${separator}${'59'}`;\r\n } else if (minuteInt > 59) {\r\n newTime = ampm\r\n ? `${hour}${separator}${'00'} ${meridiem}`\r\n : `${hour}${separator}${'00'}`;\r\n } else {\r\n newVal = minuteInt < 10 ? `0${minute}` : minute;\r\n newTime = ampm\r\n ? `${hour}${separator}${newVal} ${meridiem}`\r\n : `${hour}${separator}${newVal}`;\r\n }\r\n } else {\r\n if (prevMinute === '' || prevMinute === maskFormat.minute) {\r\n newVal = `0${minute}`;\r\n stayOnSelection = minuteInt <= 5;\r\n } else {\r\n let prevMinuteInt = parseInt(prevMinute);\r\n if (prevMinuteInt.toString().length > 1) {\r\n newVal = `0${minute}`;\r\n stayOnSelection = minuteInt <= 5;\r\n } else {\r\n if (prevMinuteInt <= 5) {\r\n let comb = `${prevMinuteInt}${minuteInt}`;\r\n if (parseInt(comb) > 59) {\r\n newVal = `0${minute}`;\r\n stayOnSelection = minuteInt <= 5;\r\n } else {\r\n newVal = comb;\r\n }\r\n } else {\r\n newVal = `0${minute}`;\r\n stayOnSelection = minuteInt <= 5;\r\n }\r\n }\r\n }\r\n newTime = ampm\r\n ? `${hour}${separator}${newVal} ${meridiem}`\r\n : `${hour}${separator}${newVal}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newTime,\r\n stayOnSelection: stayOnSelection,\r\n };\r\n }\r\n if (ampm && partChanged === 'meridiem') {\r\n if (meridiem === '') {\r\n stayOnSelection = true;\r\n newTime = `${hour}${separator}${minute} ${maskFormat.meridiem}`;\r\n } else {\r\n if (meridiem.match(/[\\dap]+/gi) === null) {\r\n stayOnSelection = true;\r\n newTime = `${hour}${separator}${minute} ${prevMeridiem}`;\r\n } else {\r\n let newVal = '';\r\n if (!!increment) {\r\n stayOnSelection = true;\r\n newVal = prevMeridiem.toLowerCase().startsWith('p') ? 'AM' : 'PM';\r\n newTime = `${hour}${separator}${minute} ${newVal}`;\r\n } else {\r\n stayOnSelection = true;\r\n newVal = meridiem.toLowerCase().startsWith('p') ? 'PM' : 'AM';\r\n newTime = `${hour}${separator}${minute} ${newVal}`;\r\n }\r\n }\r\n }\r\n return {\r\n value: newTime,\r\n stayOnSelection: stayOnSelection,\r\n };\r\n }\r\n }\r\n return result;\r\n};\r\n\r\nexport const getDisplayDate = (\r\n value: ParsableDate,\r\n format: string,\r\n utils: IUtils,\r\n isEmpty: boolean,\r\n props: Pick<\r\n BaseKeyboardPickerProps,\r\n 'invalidLabel' | 'emptyLabel' | 'labelFunc'\r\n >,\r\n) => {\r\n const { invalidLabel, emptyLabel, labelFunc } = props;\r\n var date =\r\n value === null || value === undefined\r\n ? ''\r\n : typeof value === 'object'\r\n ? new Date(value as Date)\r\n : typeof value === 'number'\r\n ? new Date(value)\r\n : dateUtils.dateOrStringToDate(value);\r\n let t = dateUtils.dateOrStringToDate(date);\r\n if (labelFunc) {\r\n return labelFunc(isEmpty ? null : t, invalidLabel || '');\r\n }\r\n if (isEmpty) {\r\n return emptyLabel || '';\r\n }\r\n return utils.isValid(date) ? utils.format(t, format) : invalidLabel;\r\n};\r\nexport const getParsableDate = (date: ParsableDate): Date | null => {\r\n var resDate =\r\n date === null || date === undefined\r\n ? null\r\n : typeof date === 'object'\r\n ? new Date(date as Date)\r\n : typeof date === 'number'\r\n ? new Date(date)\r\n : dateUtils.dateOrStringToDate(date);\r\n return resDate;\r\n};\r\n","import { PopperProps, Theme, Popper } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n// import { bookitColors } from 'styles/colors/bookitColors';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\n\r\nexport const StyledPicker = styled('div')(({ theme }) => ({\r\n '&.picker-root': {\r\n width: '100%',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n '& .picker-date-input': {},\r\n // '& .picker-popper': {\r\n // zIndex: 1300,\r\n // '& .picker-paper': {\r\n // padding: '16px',\r\n // maxWidth: '360px',\r\n // borderRadius: '12px',\r\n // boxShadow: bookitShadows.shadowXL,\r\n // // background: bookitColors.grayscale.grayBackground,\r\n // '& .picker-header': {\r\n // // minHeight: '20px',\r\n // '& .picker-header-title': {},\r\n // },\r\n // '& .picker-content': {\r\n // display: 'flex',\r\n // flexDirection: 'column',\r\n // alignItems: 'center',\r\n // gap: '8px',\r\n // '& .picker-content-date': {\r\n // height: '56px',\r\n // width: '100%',\r\n // // padding: '12px',\r\n // },\r\n // '& .picker-buttons': {\r\n // display: 'flex',\r\n // flexDirection: 'row',\r\n // alignItems: 'center',\r\n // alignSelf: 'flex-start',\r\n // gap: '16px',\r\n // // paddingTop: '16px',\r\n // },\r\n // },\r\n // },\r\n // },\r\n },\r\n}));\r\n\r\nexport const PickerPopper = styled(\r\n ({\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & PopperProps) => {children},\r\n)({\r\n '&.picker-popper': {\r\n zIndex: 1300,\r\n '& .picker-paper': {\r\n padding: '16px',\r\n maxWidth: '360px',\r\n borderRadius: '12px',\r\n boxShadow: bookitShadows.shadowXL,\r\n // background: bookitColors.grayscale.grayBackground,\r\n '& .picker-header': {\r\n // minHeight: '20px',\r\n '& .picker-header-title': {},\r\n },\r\n '& .picker-content': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n gap: '8px',\r\n '& .picker-content-date': {\r\n height: '56px',\r\n width: '100%',\r\n // padding: '12px',\r\n },\r\n '& .picker-buttons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n alignSelf: 'flex-start',\r\n gap: '16px',\r\n // paddingTop: '16px',\r\n },\r\n },\r\n },\r\n },\r\n});\r\n\r\n// `\r\n// z-index: ${props => props.theme.zIndex.modal};\r\n// height: 100vh;\r\n// border-left: 1px solid ${bookitColors.grayscale.grayBorders};\r\n// &.rootopen {\r\n// width: 100%;\r\n// transform: unset;\r\n// &.mobileroot {\r\n// padding-top: 0px;\r\n// }\r\n// }\r\n// &.rootclose {\r\n// width: 100vw;\r\n// &.mobileroot {\r\n// inset-block: 50px auto;\r\n// height: calc(100% - 50px);\r\n// padding-top: 0px;\r\n// }\r\n// }\r\n// @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n// &.rootclose {\r\n// width: 100%;\r\n// min-width: 600px;\r\n// }\r\n// }\r\n// @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n// &.rootclose {\r\n// width: 100%;\r\n// min-width: 370px;\r\n// }\r\n// }\r\n// @media (min-width: ${props => props.theme.breakpoints.values.md}px) {\r\n// &.rootclose {\r\n// width: ${props => props.sidePanelWidth}px;\r\n// }\r\n// }\r\n// & .paper {\r\n// background: ${props => props.theme.palette.common.background};\r\n// border-radius: 0;\r\n// max-height: 100vh;\r\n// height: auto;\r\n// margin: 0;\r\n// box-shadow: unset;\r\n// }\r\n// @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n// & .paper {\r\n// max-width: 100%;\r\n// }\r\n// }\r\n// `;\r\n","/**\r\n *\r\n * DaysByMonthPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface DaysByMonthPickerProps\r\n extends Omit>, 'getOptions'> {\r\n month?: number | null;\r\n date?: Date | string | null;\r\n}\r\nexport const daysEntityArray = Array.from({ length: 31 }, (_, i) => {\r\n const x = i + 1;\r\n return {\r\n Id: x,\r\n Name: x.toString(),\r\n } as Entity;\r\n});\r\n\r\nexport const defaultDayValue =\r\n daysEntityArray.find(f => f.Id === dateUtils.getDate(new Date())) ??\r\n ({\r\n Id: dateUtils.getDate(new Date()),\r\n Name: dateUtils.getDate(new Date()).toString(),\r\n } as Entity);\r\nexport const getDayEntityFromDate = (date?: Date | string | null) => {\r\n if (date === null || date === undefined) {\r\n return daysEntityArray[0];\r\n } else {\r\n let toDate = dateUtils.dateOrStringToDate(date);\r\n return (\r\n daysEntityArray.find(f => f.Id === toDate.getDate()) ?? daysEntityArray[0]\r\n );\r\n }\r\n};\r\n\r\nexport const initDaysData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n daysEntityArray.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function DaysByMonthPicker(props: DaysByMonthPickerProps) {\r\n const getOptions = React.useMemo(() => {\r\n let maxDay = 31;\r\n if (props.month !== null && props.month !== undefined) {\r\n let monthDate = dateUtils.setMonth(new Date(), props.month);\r\n maxDay = dateUtils.lastDayOfMonth(monthDate).getDate();\r\n } else if (props.date !== null && props.date !== undefined) {\r\n let monthDate = dateUtils.dateOrStringToDate(props.date);\r\n maxDay = dateUtils.lastDayOfMonth(monthDate).getDate();\r\n }\r\n let items = daysEntityArray.filter(f => f.Id <= maxDay);\r\n return GetOptionsFilterFunction(items);\r\n }, [props.date, props.month]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * MonthOfYearPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface MonthEntity extends Entity {\r\n FullName: string;\r\n MonthId: number;\r\n}\r\nexport interface MonthOfYearPickerProps\r\n extends Omit>, 'getOptions'> {\r\n date?: Date | string | null;\r\n}\r\nexport const monthEntityArray = Array.from({ length: 12 }, (_, i) => {\r\n const x = i;\r\n return {\r\n Id: x,\r\n Name: dateUtils.format(\r\n dateUtils.setMonth(new Date(), x),\r\n dateUtils.DateIOFormats.monthShort,\r\n ),\r\n FullName: dateUtils.format(\r\n dateUtils.setMonth(new Date(), x),\r\n dateUtils.DateIOFormats.month,\r\n ),\r\n MonthId: x + 1,\r\n } as Entity;\r\n});\r\n\r\nexport const defaultMonthValue =\r\n monthEntityArray.find(f => f.Id === dateUtils.getMonth(new Date())) ??\r\n ({\r\n Id: dateUtils.getMonth(new Date()),\r\n Name: dateUtils.format(new Date(), dateUtils.DateIOFormats.monthShort),\r\n FullName: dateUtils.format(new Date(), dateUtils.DateIOFormats.month),\r\n MonthId: dateUtils.getMonth(new Date()) + 1,\r\n } as Entity);\r\nexport const getMonthEntityFromDate = (date?: Date | string | null) => {\r\n if (date === null || date === undefined) {\r\n return defaultMonthValue;\r\n } else {\r\n let toDate = dateUtils.dateOrStringToDate(date);\r\n return (\r\n monthEntityArray.find(f => f.Id === toDate.getMonth()) ??\r\n defaultMonthValue\r\n );\r\n }\r\n};\r\nexport const initMonthData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n monthEntityArray.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function MonthOfYearPicker(props: MonthOfYearPickerProps) {\r\n const getOptions = React.useMemo(() => {\r\n let items = monthEntityArray;\r\n\r\n return GetOptionsFilterFunction(items, (f, search) =>\r\n (f as MonthEntity).MonthId.toString()\r\n .toLowerCase()\r\n .startsWith(search.toLowerCase()),\r\n );\r\n }, []);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * YearsPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface YearsPickerProps\r\n extends Omit>, 'getOptions'> {\r\n date?: Date | string | null;\r\n}\r\nexport const MIN_YEAR: number = 2001;\r\nexport const MAX_YEAR: number = dateUtils.getYear(\r\n dateUtils.addYears(new Date(), 10),\r\n);\r\nexport const yearsEntityArray = Array.from(\r\n { length: MAX_YEAR - MIN_YEAR },\r\n (_, i) => {\r\n const x = MIN_YEAR + i;\r\n return {\r\n Id: x,\r\n Name: x.toString(),\r\n } as Entity;\r\n },\r\n);\r\n\r\nexport const initYearsData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n yearsEntityArray.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\nexport const defaultYearValue =\r\n yearsEntityArray.find(f => f.Id === dateUtils.getYear(new Date())) ??\r\n ({\r\n Id: dateUtils.getYear(new Date()),\r\n Name: dateUtils.getYear(new Date()).toString(),\r\n } as Entity);\r\nexport const getYearEntityFromDate = (date?: Date | string | null) => {\r\n if (date === null || date === undefined) {\r\n return defaultYearValue;\r\n } else {\r\n let toDate = dateUtils.dateOrStringToDate(date);\r\n return (\r\n yearsEntityArray.find(f => f.Id === dateUtils.getYear(toDate)) ??\r\n defaultYearValue\r\n );\r\n }\r\n};\r\nexport function YearsPicker(props: YearsPickerProps) {\r\n const getOptions = React.useMemo(() => {\r\n let items = yearsEntityArray;\r\n return GetOptionsFilterFunction(items);\r\n }, []);\r\n return (\r\n \r\n );\r\n}\r\n","import { BaseTextFieldProps, capitalize } from '@material-ui/core';\r\nimport { BaseDatePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport {\r\n DaysByMonthPicker,\r\n defaultDayValue,\r\n getDayEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/DaysByMonthPicker';\r\nimport {\r\n defaultMonthValue,\r\n getMonthEntityFromDate,\r\n MonthOfYearPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/MonthOfYearPicker';\r\nimport {\r\n defaultYearValue,\r\n getYearEntityFromDate,\r\n YearsPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/YearsPicker';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DateValidationProps } from '@material-ui/pickers/_helpers/text-field-helper';\r\nimport { validateDate } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\n\r\nexport interface DateDropDownValidationProps\r\n extends DateValidationProps,\r\n Pick<\r\n BaseDatePickerProps,\r\n | 'minDate'\r\n | 'maxDate'\r\n | 'disablePast'\r\n | 'disableFuture'\r\n | 'strictCompareDates'\r\n > {}\r\nexport interface DateDropDownProps\r\n extends DateDropDownValidationProps,\r\n Pick<\r\n BaseTextFieldProps,\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'error'\r\n | 'size'\r\n > {\r\n value?: Date | string | null;\r\n onChange: (\r\n date: MaterialUiPickersDate | null,\r\n withCompletion?: boolean,\r\n ) => void;\r\n inputVariant?: 'filled' | 'standard' | 'outlined';\r\n info?: string;\r\n className?: string;\r\n dayDisabled?: boolean;\r\n monthDisabled?: boolean;\r\n yearDisabled?: boolean;\r\n onError?: (\r\n error: React.ReactNode,\r\n value: MaterialUiPickersDate | ParsableDate,\r\n ) => void;\r\n}\r\n\r\nexport function DateDropDown(props: DateDropDownProps) {\r\n const {\r\n value,\r\n onChange,\r\n inputVariant,\r\n id,\r\n name,\r\n fullWidth,\r\n helperText,\r\n disabled,\r\n label,\r\n error,\r\n size,\r\n dayDisabled,\r\n monthDisabled,\r\n yearDisabled,\r\n onError,\r\n } = props;\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n const utils = useUtils();\r\n const inputLabelId = label && id ? `${id}-label` : undefined;\r\n const helperTextId = id ? `${id}-helper-text` : undefined;\r\n const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n const dateTimeValue = React.useMemo(() => {\r\n return value;\r\n }, [value]);\r\n const [dateSelected, setDateSelected] = React.useState<\r\n Date | string | null | undefined\r\n >(value);\r\n const [daySelected, setDaySelected] = React.useState(\r\n getDayEntityFromDate(dateTimeValue),\r\n );\r\n const [monthSelected, setMonthSelected] = React.useState(\r\n getMonthEntityFromDate(dateTimeValue),\r\n );\r\n const [yearSelected, setYearSelected] = React.useState(\r\n getYearEntityFromDate(dateTimeValue),\r\n );\r\n const [innerError, setInnerError] = React.useState<\r\n React.ReactNode | undefined\r\n >(undefined);\r\n const [isYearOpen, setIsYearOpen] = React.useState(false);\r\n const [isMonthOpen, setIsMonthOpen] = React.useState(false);\r\n const [isDayOpen, setIsDayOpen] = React.useState(false);\r\n const someOpen = React.useMemo(() => {\r\n return isYearOpen || isMonthOpen || isDayOpen;\r\n }, [isDayOpen, isMonthOpen, isYearOpen]);\r\n // const dateStart = React.useMemo(() => {\r\n // return utils.dateFormat.toLowerCase().startsWith('m')\r\n // ? 'fromMonth'\r\n // : utils.dateFormat.toLowerCase().startsWith('d')\r\n // ? 'fromDay'\r\n // : utils.dateFormat.toLowerCase().startsWith('y')\r\n // ? 'fromYear'\r\n // : 'fromDay';\r\n // }, [utils.dateFormat]);\r\n React.useEffect(() => {\r\n setDaySelected(() => getDayEntityFromDate(dateTimeValue));\r\n setMonthSelected(() => getMonthEntityFromDate(dateTimeValue));\r\n setYearSelected(() => getYearEntityFromDate(dateTimeValue));\r\n }, [dateTimeValue]);\r\n\r\n React.useEffect(() => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let error = validateDate(\r\n daySelected.Id,\r\n monthSelected.Id,\r\n yearSelected.Id,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n dateSelected,\r\n );\r\n if (!!error) {\r\n setInnerError(error);\r\n if (onError) {\r\n onError(error, dateSelected);\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', dateSelected);\r\n }\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', null);\r\n }\r\n }\r\n }, [\r\n dateSelected,\r\n daySelected.Id,\r\n monthSelected.Id,\r\n onError,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n props.strictCompareDates,\r\n utils,\r\n yearSelected.Id,\r\n ]);\r\n const handleChange = React.useCallback(\r\n (day: number, month: number, year: number, withCompletion?: boolean) => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let date = dateUtils.dateOrStringToDate(dateSelected);\r\n let finalDate = dateUtils.set(getOffsetDate(date), {\r\n year: year,\r\n month: month,\r\n date: day,\r\n });\r\n let hasError = validateDate(\r\n day,\r\n month,\r\n year,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n finalDate,\r\n );\r\n if (!hasError) {\r\n onChange(finalDate, withCompletion);\r\n }\r\n } else {\r\n let finalDate = dateUtils.set(newDate(), {\r\n year: year,\r\n month: month,\r\n date: day,\r\n });\r\n setDateSelected(finalDate);\r\n let hasError = validateDate(\r\n day,\r\n month,\r\n year,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n finalDate,\r\n );\r\n if (!hasError) {\r\n onChange(finalDate, withCompletion);\r\n }\r\n }\r\n },\r\n [\r\n dateSelected,\r\n getOffsetDate,\r\n newDate,\r\n onChange,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n props.strictCompareDates,\r\n utils,\r\n ],\r\n );\r\n const handleDayChange = React.useCallback(\r\n (val: Entity) => {\r\n setDaySelected(val);\r\n handleChange(val.Id, monthSelected.Id, yearSelected.Id);\r\n },\r\n [handleChange, monthSelected.Id, yearSelected.Id],\r\n );\r\n const handleMonthChange = React.useCallback(\r\n (val: Entity) => {\r\n setMonthSelected(val);\r\n handleChange(daySelected.Id, val.Id, yearSelected.Id);\r\n },\r\n [daySelected.Id, handleChange, yearSelected.Id],\r\n );\r\n const handleYearChange = React.useCallback(\r\n (val: Entity) => {\r\n setYearSelected(val);\r\n handleChange(daySelected.Id, monthSelected.Id, val.Id);\r\n },\r\n [daySelected.Id, handleChange, monthSelected.Id],\r\n );\r\n return (\r\n \r\n ) => {\r\n const target = event.target as any; // as HTMLInputElement;\r\n\r\n if (event.key === 'Enter') {\r\n if (!!target && target.nodeName === 'INPUT') {\r\n if (!someOpen && !innerError) {\r\n handleChange(\r\n daySelected.Id,\r\n monthSelected.Id,\r\n yearSelected.Id,\r\n true,\r\n );\r\n }\r\n }\r\n }\r\n }}\r\n >\r\n {label && (\r\n \r\n {label}\r\n \r\n )}\r\n

\r\n handleDayChange(day ?? defaultDayValue)}\r\n id={`${id ?? 'dayId'}_day`}\r\n name={`${name ?? 'dayName'}_day`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || dayDisabled}\r\n ariaLabel={`${label ?? 'day'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n autoFocus={true}\r\n setSomeOpen={setIsDayOpen}\r\n />\r\n handleMonthChange(month ?? defaultMonthValue)}\r\n id={`${id ?? 'monthId'}_month`}\r\n name={`${name ?? 'monthName'}_month`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || monthDisabled}\r\n ariaLabel={`${label ?? 'month'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n setSomeOpen={setIsMonthOpen}\r\n //autoFocus={dateStart === 'fromMonth'}\r\n />\r\n handleYearChange(year ?? defaultYearValue)}\r\n id={`${id ?? 'yearId'}_year`}\r\n name={`${name ?? 'yearName'}_year`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || yearDisabled}\r\n ariaLabel={`${label ?? 'year'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n setSomeOpen={setIsYearOpen}\r\n //autoFocus={dateStart === 'fromYear'}\r\n />\r\n
\r\n {/*
\r\n {dateStart === 'fromYear' ? (\r\n \r\n handleYearChange(year ?? defaultYearValue)}\r\n id={`${id ?? 'yearId'}_year`}\r\n name={`${name ?? 'yearName'}_year`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || yearDisabled}\r\n ariaLabel={`${label ?? 'year'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n autoFocus={true}\r\n />\r\n \r\n handleMonthChange(month ?? defaultMonthValue)\r\n }\r\n id={`${id ?? 'monthId'}_month`}\r\n name={`${name ?? 'monthName'}_month`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || monthDisabled}\r\n ariaLabel={`${label ?? 'month'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n handleDayChange(day ?? defaultDayValue)}\r\n id={`${id ?? 'dayId'}_day`}\r\n name={`${name ?? 'dayName'}_day`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || dayDisabled}\r\n ariaLabel={`${label ?? 'day'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n \r\n ) : dateStart === 'fromMonth' ? (\r\n \r\n \r\n handleMonthChange(month ?? defaultMonthValue)\r\n }\r\n id={`${id ?? 'monthId'}_month`}\r\n name={`${name ?? 'monthName'}_month`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || monthDisabled}\r\n ariaLabel={`${label ?? 'month'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n autoFocus={true}\r\n />\r\n handleDayChange(day ?? defaultDayValue)}\r\n id={`${id ?? 'dayId'}_day`}\r\n name={`${name ?? 'dayName'}_day`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || dayDisabled}\r\n ariaLabel={`${label ?? 'day'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n handleYearChange(year ?? defaultYearValue)}\r\n id={`${id ?? 'yearId'}_year`}\r\n name={`${name ?? 'yearName'}_year`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || yearDisabled}\r\n ariaLabel={`${label ?? 'year'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n \r\n ) : (\r\n \r\n handleDayChange(day ?? defaultDayValue)}\r\n id={`${id ?? 'dayId'}_day`}\r\n name={`${name ?? 'dayName'}_day`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || dayDisabled}\r\n ariaLabel={`${label ?? 'day'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n autoFocus={true}\r\n />\r\n \r\n handleMonthChange(month ?? defaultMonthValue)\r\n }\r\n id={`${id ?? 'monthId'}_month`}\r\n name={`${name ?? 'monthName'}_month`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || monthDisabled}\r\n ariaLabel={`${label ?? 'month'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n handleYearChange(year ?? defaultYearValue)}\r\n id={`${id ?? 'yearId'}_year`}\r\n name={`${name ?? 'yearName'}_year`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || yearDisabled}\r\n ariaLabel={`${label ?? 'year'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n />\r\n \r\n )}\r\n
*/}\r\n {(!!helperText || Boolean(innerError)) && (\r\n \r\n {helperText || innerError}\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * HoursPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface HoursPickerProps\r\n extends Omit>, 'getOptions'> {\r\n useAmPm?: boolean;\r\n}\r\nexport const hoursEntityArray12 = Array.from({ length: 12 }, (_, i) => {\r\n const x = i + 1;\r\n return {\r\n Id: x,\r\n Name: x.toString(),\r\n } as Entity;\r\n});\r\nexport const hoursEntityArray24 = Array.from({ length: 24 }, (_, i) => {\r\n const x = i;\r\n return {\r\n Id: x,\r\n Name: x.toString(),\r\n } as Entity;\r\n});\r\n\r\nexport const defaultHourValue12 =\r\n hoursEntityArray12.find(\r\n f => f.Id === dateUtils.getMeridiemHours(new Date()),\r\n ) ??\r\n ({\r\n Id: dateUtils.getMeridiemHours(new Date()),\r\n Name: dateUtils.getMeridiemHours(new Date()).toString(),\r\n } as Entity);\r\nexport const defaultHourValue24 =\r\n hoursEntityArray24.find(f => f.Id === dateUtils.getHours(new Date())) ??\r\n ({\r\n Id: dateUtils.getHours(new Date()),\r\n Name: dateUtils.getHours(new Date()).toString(),\r\n } as Entity);\r\nexport const getHoursEntityFromDate = (\r\n ampm: boolean,\r\n date?: Date | string | null,\r\n) => {\r\n if (date === null || date === undefined) {\r\n return ampm ? defaultHourValue12 : defaultHourValue24;\r\n } else {\r\n let toDate = dateUtils.dateOrStringToDate(date);\r\n return ampm\r\n ? hoursEntityArray12.find(\r\n f => f.Id === dateUtils.getMeridiemHours(toDate),\r\n ) ?? defaultHourValue12\r\n : hoursEntityArray24.find(f => f.Id === toDate.getHours()) ??\r\n defaultHourValue24;\r\n }\r\n};\r\nexport const initHoursData = (\r\n initval: number | string | undefined,\r\n ampm?: boolean,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n ampm\r\n ? hoursEntityArray12.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n })\r\n : hoursEntityArray24.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function HoursPicker(props: HoursPickerProps) {\r\n const getOptions = React.useMemo(() => {\r\n let items = props.useAmPm ? hoursEntityArray12 : hoursEntityArray24;\r\n return GetOptionsFilterFunction(items);\r\n }, [props.useAmPm]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * MinutesPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface MinutesPickerProps\r\n extends Omit>, 'getOptions'> {\r\n minutesStep?: number;\r\n}\r\nexport const minutesEntityArray = Array.from({ length: 60 }, (_, i) => {\r\n const x = i;\r\n return {\r\n Id: x,\r\n Name: x.toString(),\r\n } as Entity;\r\n});\r\n\r\nexport const defaultMinutes =\r\n minutesEntityArray.find(f => f.Id === dateUtils.getMinutes(new Date())) ??\r\n ({\r\n Id: dateUtils.getMinutes(new Date()),\r\n Name: dateUtils.getMinutes(new Date()).toString(),\r\n } as Entity);\r\n\r\nexport const getMinutesEntityFromDate = (\r\n date?: Date | string | null,\r\n minutesStep?: number,\r\n) => {\r\n if (date === null || date === undefined) {\r\n return defaultMinutes;\r\n } else {\r\n let toDate = dateUtils.dateOrStringToDate(date);\r\n return (\r\n minutesEntityArray.find(f => f.Id === toDate.getMinutes()) ??\r\n defaultMinutes\r\n );\r\n }\r\n};\r\nexport const initMinutesData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n minutesEntityArray.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function MinutesPicker(props: MinutesPickerProps) {\r\n const { minutesStep, mini, size, id, value, ...other } = props;\r\n const getOptions = React.useMemo(() => {\r\n let items =\r\n !!minutesStep && minutesStep > 0 && minutesStep <= 30\r\n ? minutesEntityArray.filter(f => f.Id % minutesStep === 0)\r\n : minutesEntityArray;\r\n return GetOptionsFilterFunction(items);\r\n }, [minutesStep]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AmPmPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface AmPmPickerProps\r\n extends Omit>, 'getOptions'> {}\r\nexport const AmPmEntityArray = [\r\n {\r\n Id: 'am',\r\n Name: 'AM',\r\n },\r\n {\r\n Id: 'pm',\r\n Name: 'PM',\r\n },\r\n] as Entity[];\r\n\r\nexport const defaultAmPm = AmPmEntityArray[0];\r\n// AmPmEntityArray.find(f => f.Id === dateUtils.getMinutes(new Date())) ??\r\n// ({\r\n// Id: dateUtils.getMinutes(new Date()),\r\n// Name: dateUtils.getMinutes(new Date()).toString(),\r\n// } as Entity);\r\n\r\nexport const getAmPmEntityFromDate = (date?: Date | string | null) => {\r\n if (date === null || date === undefined) {\r\n return AmPmEntityArray[0];\r\n } else {\r\n let meridiem = dateUtils.getMeridiem(date);\r\n return AmPmEntityArray.find(f => f.Id === meridiem) ?? AmPmEntityArray[0];\r\n }\r\n};\r\nexport const initAmPmData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n AmPmEntityArray.filter(item => {\r\n return item.Id.toString() === initval.toString();\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function AmPmPicker(props: AmPmPickerProps) {\r\n const getOptions = React.useMemo(() => {\r\n let items = AmPmEntityArray;\r\n return GetOptionsFilterFunction(items);\r\n }, []);\r\n return (\r\n \r\n );\r\n}\r\n","import { BaseTextFieldProps, capitalize } from '@material-ui/core';\r\nimport { BaseTimePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { validateError } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { DateDropDownValidationProps } from '../DateDropDown';\r\nimport {\r\n defaultHourValue12,\r\n defaultHourValue24,\r\n getHoursEntityFromDate,\r\n HoursPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/HoursPicker';\r\nimport {\r\n defaultMinutes,\r\n getMinutesEntityFromDate,\r\n MinutesPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/MinutesPicker';\r\nimport {\r\n AmPmPicker,\r\n defaultAmPm,\r\n getAmPmEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/AmPmPicker';\r\n\r\nexport interface TimeDropDownProps\r\n extends DateDropDownValidationProps,\r\n BaseTimePickerProps,\r\n Pick<\r\n BaseTextFieldProps,\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'error'\r\n | 'size'\r\n > {\r\n value?: Date | string | null;\r\n onChange: (\r\n date: MaterialUiPickersDate | null,\r\n withCompletion?: boolean,\r\n ) => void;\r\n inputVariant?: 'filled' | 'standard' | 'outlined';\r\n info?: string;\r\n className?: string;\r\n hoursDisabled?: boolean;\r\n minutesDisabled?: boolean;\r\n onError?: (\r\n error: React.ReactNode,\r\n value: MaterialUiPickersDate | ParsableDate,\r\n ) => void;\r\n}\r\n\r\nexport function TimeDropDown(props: TimeDropDownProps) {\r\n const {\r\n value,\r\n onChange,\r\n inputVariant,\r\n id,\r\n name,\r\n fullWidth,\r\n helperText,\r\n disabled,\r\n label,\r\n error,\r\n size,\r\n hoursDisabled,\r\n minutesDisabled,\r\n ampm,\r\n minutesStep,\r\n onError,\r\n } = props;\r\n const { newDate } = useSystemDate();\r\n const utils = useUtils();\r\n const inputLabelId = label && id ? `${id}-label` : undefined;\r\n const helperTextId = id ? `${id}-helper-text` : undefined;\r\n const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n const dateTimeValue = React.useMemo(() => {\r\n return value;\r\n }, [value]);\r\n const [dateSelected, setDateSelected] = React.useState<\r\n Date | string | null | undefined\r\n >(value);\r\n const [hoursSelected, setHoursSelected] = React.useState(\r\n getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n );\r\n const [minutesSelected, setMinutesSelected] = React.useState(\r\n getMinutesEntityFromDate(dateTimeValue),\r\n );\r\n const [ampmSelected, setAmpmSelected] = React.useState(\r\n getAmPmEntityFromDate(dateTimeValue),\r\n );\r\n const [isHourOpen, setIsHourOpen] = React.useState(false);\r\n const [isMinuteOpen, setIsMinuteOpen] = React.useState(false);\r\n const [isAmPmOpen, setIsAmPmOpen] = React.useState(false);\r\n const someOpen = React.useMemo(() => {\r\n return isHourOpen || isMinuteOpen || isAmPmOpen;\r\n }, [isHourOpen, isMinuteOpen, isAmPmOpen]);\r\n const [innerError, setInnerError] = React.useState<\r\n React.ReactNode | undefined\r\n >(undefined);\r\n\r\n React.useEffect(() => {\r\n setHoursSelected(() =>\r\n getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n );\r\n setMinutesSelected(() => getMinutesEntityFromDate(dateTimeValue));\r\n setAmpmSelected(() => getAmPmEntityFromDate(dateTimeValue));\r\n }, [ampm, dateTimeValue]);\r\n\r\n React.useEffect(() => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n hours: hoursSelected.Id,\r\n minutes: minutesSelected.Id,\r\n });\r\n let validateDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n ampm ?? false,\r\n );\r\n let error = validateError(\r\n validateDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!!error) {\r\n setInnerError(error);\r\n if (onError) {\r\n onError(error, validateDate);\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', validateDate);\r\n }\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', null);\r\n }\r\n }\r\n }, [\r\n ampm,\r\n ampmSelected.Id,\r\n dateSelected,\r\n hoursSelected.Id,\r\n minutesSelected.Id,\r\n onError,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n props.strictCompareDates,\r\n utils,\r\n ]);\r\n const handleChange = React.useCallback(\r\n (\r\n hour: number,\r\n minute: number,\r\n ampmValue: 'am' | 'pm',\r\n withCompletion?: boolean,\r\n ) => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n hours: hour,\r\n minutes: minute,\r\n });\r\n let finalDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmValue,\r\n ampm ?? false,\r\n );\r\n let hasError = validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!hasError || hasError === '') {\r\n onChange(finalDate, withCompletion);\r\n }\r\n } else {\r\n let time = dateUtils.set(newDate(), { hours: hour, minutes: minute });\r\n let finalDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmValue,\r\n ampm ?? false,\r\n );\r\n setDateSelected(finalDate);\r\n let hasError = validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!hasError || hasError === '') {\r\n onChange(finalDate, withCompletion);\r\n }\r\n }\r\n },\r\n [\r\n ampm,\r\n dateSelected,\r\n newDate,\r\n onChange,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n props.strictCompareDates,\r\n utils,\r\n ],\r\n );\r\n const handleHoursChange = React.useCallback(\r\n (val: Entity) => {\r\n setHoursSelected(val);\r\n handleChange(\r\n val.Id,\r\n minutesSelected.Id,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [ampmSelected.Id, handleChange, minutesSelected.Id],\r\n );\r\n const handleMinutesChange = React.useCallback(\r\n (val: Entity) => {\r\n setMinutesSelected(val);\r\n handleChange(\r\n hoursSelected.Id,\r\n val.Id,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [ampmSelected.Id, handleChange, hoursSelected.Id],\r\n );\r\n const handleAmPmChange = React.useCallback(\r\n (val: Entity) => {\r\n setAmpmSelected(val);\r\n handleChange(\r\n hoursSelected.Id,\r\n minutesSelected.Id,\r\n val.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [handleChange, hoursSelected.Id, minutesSelected.Id],\r\n );\r\n return (\r\n \r\n ) => {\r\n const target = event.target as any; // as HTMLInputElement;\r\n\r\n if (event.key === 'Enter') {\r\n if (!!target && target.nodeName === 'INPUT') {\r\n if (!someOpen && !innerError) {\r\n handleChange(\r\n hoursSelected.Id,\r\n minutesSelected.Id,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n true,\r\n );\r\n }\r\n }\r\n }\r\n }}\r\n >\r\n {label && (\r\n \r\n {label}\r\n \r\n )}\r\n
\r\n \r\n handleHoursChange(\r\n hour ?? (ampm ? defaultHourValue12 : defaultHourValue24),\r\n )\r\n }\r\n id={`${id ?? 'hourId'}_hour`}\r\n name={`${name ?? 'hourName'}_hour`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || hoursDisabled}\r\n ariaLabel={`${label ?? 'hour'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n disableClearable\r\n autoFocus={true}\r\n placeholder={'HH'}\r\n setSomeOpen={setIsHourOpen}\r\n // disableListWrap\r\n // disableCloseOnSelect\r\n // ListboxProps={{\r\n // style: { maxHeight: '20vh' },\r\n // }}\r\n // isOpen={true}\r\n />\r\n handleMinutesChange(minute ?? defaultMinutes)}\r\n id={`${id ?? 'minuteId'}_minute`}\r\n name={`${name ?? 'minuteName'}_minute`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled || minutesDisabled}\r\n ariaLabel={`${label ?? 'minute'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n minutesStep={minutesStep}\r\n disableClearable\r\n placeholder={'mm'}\r\n setSomeOpen={setIsMinuteOpen}\r\n // disableCloseOnSelect\r\n // ListboxProps={{\r\n // style: { maxHeight: '20vh' },\r\n // }}\r\n // isOpen={true}\r\n />\r\n {ampm && (\r\n handleAmPmChange(ampmVal ?? defaultAmPm)}\r\n id={`${id ?? 'ampmId'}_ampm`}\r\n name={`${name ?? 'ampmName'}_ampm`}\r\n variant={inputVariant ?? 'standard'}\r\n disabled={disabled}\r\n ariaLabel={`${label ?? 'ampm'} select`}\r\n error={error}\r\n size={size || 'small'}\r\n placeholder={'AM/PM'}\r\n disableClearable\r\n setSomeOpen={setIsAmPmOpen}\r\n // disableCloseOnSelect\r\n // ListboxProps={{\r\n // style: { maxHeight: '20vh' },\r\n // }}\r\n // isOpen={true}\r\n />\r\n )}\r\n
\r\n {(!!helperText || Boolean(innerError)) && (\r\n \r\n {helperText || innerError}\r\n \r\n )}\r\n \r\n
\r\n );\r\n}\r\n","import { useEffect, useLayoutEffect } from 'react';\r\n\r\nconst useIsomorphicLayoutEffect =\r\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\r\n\r\nexport default useIsomorphicLayoutEffect;\r\n","import { RefObject, useEffect, useRef } from 'react';\r\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\r\n\r\n// Window Event based useEventListener interface\r\nfunction useEventListener(\r\n eventName: K,\r\n handler: (event: WindowEventMap[K]) => void,\r\n element?: undefined,\r\n options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\n// Element Event based useEventListener interface\r\nfunction useEventListener<\r\n K extends keyof HTMLElementEventMap,\r\n T extends HTMLElement = HTMLDivElement\r\n>(\r\n eventName: K,\r\n handler: (event: HTMLElementEventMap[K]) => void,\r\n element: RefObject,\r\n options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\n// Document Event based useEventListener interface\r\nfunction useEventListener(\r\n eventName: K,\r\n handler: (event: DocumentEventMap[K]) => void,\r\n element: RefObject,\r\n options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\nfunction useEventListener<\r\n KW extends keyof WindowEventMap,\r\n KH extends keyof HTMLElementEventMap,\r\n T extends HTMLElement | void = void\r\n>(\r\n eventName: KW | KH,\r\n handler: (\r\n event: WindowEventMap[KW] | HTMLElementEventMap[KH] | Event,\r\n ) => void,\r\n element?: RefObject,\r\n options?: boolean | AddEventListenerOptions,\r\n) {\r\n // Create a ref that stores handler\r\n const savedHandler = useRef(handler);\r\n\r\n useIsomorphicLayoutEffect(() => {\r\n savedHandler.current = handler;\r\n }, [handler]);\r\n\r\n useEffect(() => {\r\n // Define the listening target\r\n const targetElement: T | Window = element?.current || window;\r\n if (!(targetElement && targetElement.addEventListener)) {\r\n return;\r\n }\r\n\r\n // Create event listener that calls handler function stored in ref\r\n const eventListener: typeof handler = event => savedHandler.current(event);\r\n\r\n targetElement.addEventListener(eventName, eventListener, options);\r\n\r\n // Remove event listener on cleanup\r\n return () => {\r\n targetElement.removeEventListener(eventName, eventListener);\r\n };\r\n }, [eventName, element, options]);\r\n}\r\n\r\nexport default useEventListener;\r\n","/* @flow */\r\n\r\nimport useIsomorphicLayoutEffect from 'app/hooks/useIsomorphicLayoutEffect';\r\nimport * as React from 'react';\r\nimport {\r\n DateStartWith,\r\n DateTimeMask,\r\n formatingDate,\r\n formatingTime,\r\n getMaskedDateValue,\r\n getMaskedTimeValue,\r\n} from './types';\r\n\r\nexport interface DateChangeProps {\r\n value: string;\r\n onChange: (text: string) => void;\r\n onSelectionChange: () => boolean;\r\n variant: 'date' | 'time';\r\n maskFormats: DateTimeMask;\r\n inputMask: string;\r\n ampm?: boolean;\r\n // format: (str: string) => string;\r\n mask?: boolean;\r\n maskIfEmpty?: boolean;\r\n // replace?: string => string,\r\n // append?: string => string,\r\n // accept?: RegExp,\r\n selectionChanged?: boolean;\r\n}\r\n\r\ntype RenderProps = {\r\n value: string;\r\n onChange: (\r\n evt: React.ChangeEvent,\r\n increment?: 'increase' | 'decrease',\r\n ) => void;\r\n};\r\n\r\nexport type ResolverProps = {\r\n props: DateChangeProps;\r\n children: (props: RenderProps) => React.ReactNode;\r\n};\r\n\r\nexport const useDateTimeChange = (props: DateChangeProps): RenderProps => {\r\n const [, refresh] = React.useReducer(c => c + 1, 0);\r\n const valueRef = React.useRef(null);\r\n\r\n const dateTimeMask = props.maskFormats;\r\n const dateStartOf: DateStartWith = React.useMemo(() => {\r\n return dateTimeMask.dateStartFrom;\r\n }, [dateTimeMask.dateStartFrom]);\r\n // const { replace, append } = props;\r\n // const { variant } = props;\r\n // const userValue = replace\r\n // ? replace(props.format(props.value))\r\n // : props.format(props.value);\r\n const userValue = props.value;\r\n // state of delete button see comments below about inputType support\r\n const isDeleleteButtonDownRef = React.useRef(false);\r\n const wasZeroBefore = React.useRef(false);\r\n const selectionStateChanged = React.useRef(false);\r\n const onChange = (\r\n evt: React.ChangeEvent,\r\n increment?: 'increase' | 'decrease',\r\n ) => {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (evt.target.type === 'number') {\r\n console.error(\r\n 'Rifm does not support input type=number, use type=tel instead.',\r\n );\r\n return;\r\n }\r\n if (evt.target.type === 'date') {\r\n console.error('Rifm does not support input type=date.');\r\n return;\r\n }\r\n }\r\n\r\n const eventValue = evt.target.value;\r\n const target = evt.target as HTMLInputElement;\r\n const oneLetterHour =\r\n props.variant === 'time' &&\r\n props.ampm &&\r\n dateTimeMask.hour.length === 1 &&\r\n (eventValue === '' || eventValue.split(':')[0].length === 1);\r\n const hasSingleChar =\r\n eventValue.length === 1 && (target.selectionStart ?? 0) <= 1;\r\n const maskedValue = hasSingleChar\r\n ? props.variant === 'time'\r\n ? getMaskedTimeValue(props.maskFormats, props.ampm, eventValue)\r\n : getMaskedDateValue(props.maskFormats, eventValue)\r\n : undefined;\r\n selectionStateChanged.current = props.onSelectionChange();\r\n valueRef.current = [\r\n hasSingleChar ? maskedValue : eventValue, // eventValue\r\n target, // input\r\n // eventValue.length > userValue.length, // isSizeIncreaseOperation\r\n // eventValue.length < userValue.length, // isSizeDecraseOperation\r\n increment, //'increase' | 'decrease' by keyboard\r\n props.variant === 'time' &&\r\n (target.selectionStart ?? 0) <= (oneLetterHour ? 1 : 2), //isHourChanged\r\n props.variant === 'time' &&\r\n (target.selectionStart ?? 0) > (oneLetterHour ? 1 : 2) &&\r\n (target.selectionEnd ?? 0) <= (oneLetterHour ? 4 : 5), //isMinutesChanged\r\n props.variant === 'time' &&\r\n props.ampm &&\r\n (target.selectionStart ?? 0) >= 5, //isAmPmChanged\r\n dateStartOf === 'day'\r\n ? (target.selectionStart ?? 0) <= 2\r\n : dateStartOf === 'month'\r\n ? (target.selectionStart ?? 0) > 2 && (target.selectionEnd ?? 0) <= 5\r\n : (target.selectionStart ?? 0) >= 8, //isDayChanged\r\n dateStartOf === 'day'\r\n ? (target.selectionStart ?? 0) > 2 && (target.selectionEnd ?? 0) <= 5\r\n : dateStartOf === 'month'\r\n ? (target.selectionStart ?? 0) <= 2\r\n : (target.selectionStart ?? 0) > 4 && (target.selectionEnd ?? 0) < 7, //isMonthChanged\r\n\r\n dateStartOf === 'day' || dateStartOf === 'month'\r\n ? (target.selectionStart ?? 0) > 5\r\n : (target.selectionStart ?? 0) <= 4, //isYearChanged\r\n isDeleleteButtonDownRef.current, // isDeleleteButtonDown\r\n props.variant === 'time' ? false : userValue === eventValue, // isNoOperation\r\n selectionStateChanged.current,\r\n ];\r\n // if (process.env.NODE_ENV !== 'production') {\r\n // const formattedEventValue = props.format(eventValue);\r\n // if (\r\n // eventValue !== formattedEventValue &&\r\n // eventValue.toLowerCase() === formattedEventValue.toLowerCase()\r\n // ) {\r\n // console.warn(\r\n // 'Case enforcement does not work with format. Please use replace={value => value.toLowerCase()} instead',\r\n // );\r\n // }\r\n // }\r\n\r\n // The main trick is to update underlying input with non formatted value (= eventValue)\r\n // that allows us to calculate right cursor position after formatting (see getCursorPosition)\r\n // then we format new value and call props.onChange with masked/formatted value\r\n // and finally we are able to set cursor position into right place\r\n refresh();\r\n };\r\n // React prints warn on server in non production mode about useLayoutEffect usage\r\n // in both cases it's noop\r\n useIsomorphicLayoutEffect(() => {\r\n if (valueRef.current == null) return;\r\n\r\n let [\r\n eventValue,\r\n input,\r\n increment,\r\n isHourChanged,\r\n isMinutesChanged,\r\n isAmPmChanged,\r\n isDayChanged,\r\n isMonthChanged,\r\n isYearChanged,\r\n isDeleleteButtonDown,\r\n // No operation means that value itself hasn't been changed, BTW cursor, selection etc can be changed\r\n isNoOperation,\r\n selectionChanged,\r\n ] = valueRef.current;\r\n valueRef.current = null;\r\n let formattedValue = eventValue;\r\n let moveSelectionForward = true;\r\n if (eventValue === '' || eventValue === undefined) {\r\n formattedValue = props.maskIfEmpty\r\n ? props.variant === 'time'\r\n ? getMaskedTimeValue(dateTimeMask, props.ampm)\r\n : getMaskedDateValue(dateTimeMask)\r\n : '';\r\n } else {\r\n if (!isNoOperation) {\r\n if (props.variant === 'time') {\r\n if (isHourChanged || isMinutesChanged || isAmPmChanged) {\r\n let finalTime = formatingTime(\r\n eventValue,\r\n isHourChanged ? 'hour' : isMinutesChanged ? 'minute' : 'meridiem',\r\n dateTimeMask,\r\n userValue,\r\n increment,\r\n props.ampm,\r\n );\r\n formattedValue = finalTime.value;\r\n moveSelectionForward = !finalTime.stayOnSelection;\r\n }\r\n } else {\r\n if (isDayChanged || isMonthChanged || isYearChanged) {\r\n let finalValue = formatingDate(\r\n eventValue,\r\n isDayChanged ? 'day' : isMonthChanged ? 'month' : 'year',\r\n dateTimeMask,\r\n userValue,\r\n increment,\r\n wasZeroBefore.current,\r\n selectionChanged,\r\n );\r\n formattedValue = finalValue.value;\r\n moveSelectionForward = !finalValue.stayOnSelection;\r\n wasZeroBefore.current = finalValue.zeroPress;\r\n }\r\n }\r\n }\r\n }\r\n if (isDeleleteButtonDown) {\r\n }\r\n if (userValue === formattedValue || isNoOperation) {\r\n // if nothing changed for formatted value, just refresh so userValue will be used at render\r\n refresh();\r\n } else {\r\n props.onChange(formattedValue);\r\n }\r\n // const replacedValue = replace ? replace(formattedValue) : formattedValue;\r\n // const replacedValue = formattedValue;\r\n // if (userValue === formattedValue || isNoOperation) {\r\n // // if nothing changed for formatted value, just refresh so userValue will be used at render\r\n // refresh();\r\n // } else {\r\n // props.onChange(formattedValue);\r\n // }\r\n\r\n return () => {\r\n if (\r\n (eventValue === '' || eventValue === undefined) &&\r\n props.maskIfEmpty\r\n ) {\r\n if (props.variant === 'time') {\r\n if (props.ampm) {\r\n let oneLetterHour = dateTimeMask.hour.length === 1;\r\n input.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n } else {\r\n input.setSelectionRange(0, 2);\r\n }\r\n } else {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(0, 4);\r\n } else {\r\n input.setSelectionRange(0, 2);\r\n }\r\n }\r\n } else {\r\n if (props.variant === 'time') {\r\n let oneLetterHour =\r\n props.ampm &&\r\n dateTimeMask.hour.length === 1 &&\r\n formattedValue.split(':')[0].length === 1;\r\n if (isHourChanged) {\r\n if (moveSelectionForward) {\r\n input.setSelectionRange(\r\n oneLetterHour ? 2 : 3,\r\n oneLetterHour ? 4 : 5,\r\n );\r\n } else {\r\n input.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n }\r\n }\r\n if (isMinutesChanged) {\r\n if (props.ampm) {\r\n if (moveSelectionForward) {\r\n input.setSelectionRange(\r\n oneLetterHour ? 5 : 6,\r\n oneLetterHour ? 7 : 8,\r\n );\r\n } else {\r\n input.setSelectionRange(\r\n oneLetterHour ? 2 : 3,\r\n oneLetterHour ? 4 : 5,\r\n );\r\n }\r\n } else {\r\n input.setSelectionRange(3, 5);\r\n }\r\n }\r\n if (isAmPmChanged) {\r\n input.setSelectionRange(\r\n oneLetterHour ? 5 : 6,\r\n oneLetterHour ? 7 : 8,\r\n );\r\n }\r\n } else {\r\n if (isDayChanged) {\r\n if (moveSelectionForward) {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(8, 10);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(6, 10);\r\n } else {\r\n input.setSelectionRange(3, 5);\r\n }\r\n } else {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(8, 10);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(3, 5);\r\n } else {\r\n input.setSelectionRange(0, 2);\r\n }\r\n }\r\n }\r\n if (isMonthChanged) {\r\n if (moveSelectionForward) {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(8, 10);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(3, 5);\r\n } else {\r\n input.setSelectionRange(6, 10);\r\n }\r\n } else {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(3, 5);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(0, 2);\r\n } else {\r\n input.setSelectionRange(3, 5);\r\n }\r\n }\r\n }\r\n if (isYearChanged) {\r\n if (moveSelectionForward) {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(5, 7);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(6, 10);\r\n } else {\r\n input.setSelectionRange(6, 10);\r\n }\r\n } else {\r\n if (dateStartOf === 'year') {\r\n input.setSelectionRange(0, 4);\r\n } else if (dateStartOf === 'month') {\r\n input.setSelectionRange(6, 10);\r\n } else {\r\n input.setSelectionRange(6, 10);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n selectionStateChanged.current = false;\r\n // let start = getCursorPosition(formattedValue);\r\n // // Visually improves working with masked values,\r\n // // like cursor jumping over refused symbols\r\n // // as an example date mask: was \"5|1-24-3\" then user pressed \"6\"\r\n // // it becomes \"56-|12-43\" with this code, and \"56|-12-43\" without\r\n // if (\r\n // props.mask != null &&\r\n // (isSizeIncreaseOperation ||\r\n // isSizeDecraseOperation ||\r\n // (isDeleleteButtonDown && !deleteWasNoOp))\r\n // ) {\r\n // while (formattedValue[start] && clean(formattedValue[start]) === '') {\r\n // start += 1;\r\n // }\r\n // }\r\n // input.selectionStart = input.selectionEnd =\r\n // start + (deleteWasNoOp ? 1 + charsToSkipAfterDelete : 0);\r\n };\r\n });\r\n\r\n React.useEffect(() => {\r\n // until https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported\r\n // by all major browsers (now supported by: +chrome, +safari, ?edge, !firefox)\r\n // there is no way I found to distinguish in onChange\r\n // backspace or delete was called in some situations\r\n // firefox track https://bugzilla.mozilla.org/show_bug.cgi?id=1447239\r\n const handleKeyDown = (evt: KeyboardEvent) => {\r\n if (evt.code === 'Delete') {\r\n isDeleleteButtonDownRef.current = true;\r\n }\r\n };\r\n\r\n const handleKeyUp = (evt: KeyboardEvent) => {\r\n if (evt.code === 'Delete') {\r\n isDeleleteButtonDownRef.current = false;\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', handleKeyDown);\r\n document.addEventListener('keyup', handleKeyUp);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', handleKeyDown);\r\n document.removeEventListener('keyup', handleKeyUp);\r\n };\r\n }, []);\r\n\r\n return {\r\n value: valueRef.current != null ? valueRef.current[0] : userValue,\r\n onChange,\r\n };\r\n};\r\n\r\nexport const DateTimeResolver = (props: ResolverProps) => {\r\n const renderProps = useDateTimeChange(props.props);\r\n\r\n return props.children(renderProps);\r\n};\r\n","import {\r\n BaseTextFieldProps,\r\n InputAdornment,\r\n InputAdornmentProps,\r\n TextFieldProps,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport {\r\n dateArrowSelection,\r\n DatePopupVariants,\r\n dateSelection,\r\n DateTimeMask,\r\n defaultDateTimeMask,\r\n getMaskedDateValue,\r\n getMaskedTimeValue,\r\n timeSelection,\r\n} from '../utils/types';\r\nimport { useDateTimeChange } from '../utils/useDateTimeChange';\r\n\r\nexport interface KeyboardRifmInputProps\r\n extends Pick<\r\n BaseTextFieldProps,\r\n | 'autoFocus'\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'placeholder'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'margin'\r\n | 'error'\r\n | 'size'\r\n > {\r\n format: string;\r\n onChange: (value: string | null, withCompletion?: boolean) => void;\r\n openPicker: () => void;\r\n validationError?: React.ReactNode;\r\n inputValue: string;\r\n inputProps?: TextFieldProps['inputProps'];\r\n InputProps?: TextFieldProps['InputProps'];\r\n onBlur?: TextFieldProps['onBlur'];\r\n onFocus?: TextFieldProps['onFocus'];\r\n InputAdornmentProps?: Partial;\r\n /** Override input component */\r\n TextFieldComponent?: React.ComponentType;\r\n /** Icon displaying for open picker button */\r\n keyboardIcon?: React.ReactNode;\r\n /** Pass material-ui text field variant down, bypass internal variant prop */\r\n inputVariant?: TextFieldProps['variant'];\r\n info?: string;\r\n ariaLabel?: string;\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n togglePicker: () => void;\r\n variant: Omit;\r\n ampm?: boolean;\r\n isPickerOpen?: boolean;\r\n maskIfEmpty?: boolean;\r\n clearable?: boolean;\r\n}\r\n\r\nexport function KeyboardRifmInput({\r\n inputValue,\r\n openPicker,\r\n InputProps,\r\n TextFieldComponent,\r\n inputProps,\r\n inputVariant,\r\n togglePicker,\r\n info,\r\n ariaLabel,\r\n startIcon,\r\n endIcon,\r\n variant,\r\n format,\r\n ampm,\r\n onChange,\r\n isPickerOpen,\r\n maskIfEmpty,\r\n // refuse = /[^\\d]+/gi, //props.ampm ? /[^\\dap]+/gi : /[^\\d]+/gi\r\n // maskChar = '_',\r\n ...props\r\n}: KeyboardRifmInputProps) {\r\n const TextComponent = !!TextFieldComponent\r\n ? TextFieldComponent\r\n : BaseTextField;\r\n\r\n // const keyDownRef = React.useRef({\r\n // selectionStart: 0,\r\n // selectionEnd: 0,\r\n // });\r\n // used to show mask for each part of the Date - e.g. MM, DD, YYYY\r\n const dateTimeMask: DateTimeMask = React.useMemo(() => {\r\n return defaultDateTimeMask(format, variant === 'time' ? 'time' : 'date');\r\n }, [format, variant]);\r\n\r\n // //indicator of start date based on dateUtils dateFrmat definition per local time zone - is date is start form day/month/year;\r\n // const dateStartWith = React.useMemo(() => {\r\n // return dateStartFrom ?? dateStart;\r\n // }, [dateStartFrom]);\r\n\r\n //generated mask for date, so will be replaced when value is null\r\n const inputMask = React.useMemo(() => {\r\n return variant === 'time'\r\n ? getMaskedTimeValue(dateTimeMask, ampm)\r\n : getMaskedDateValue(dateTimeMask);\r\n }, [ampm, dateTimeMask, variant]);\r\n const [hasError, setHasError] = React.useState(\r\n props.error || Boolean(props.validationError),\r\n );\r\n\r\n const [errorMessage, setErrorMessage] = React.useState(\r\n hasError ? props.validationError || props.helperText : undefined,\r\n );\r\n React.useEffect(() => {\r\n setHasError(props.error || Boolean(props.validationError));\r\n setErrorMessage(props.validationError || props.helperText);\r\n }, [props.error, props.helperText, props.validationError]);\r\n const [selectionChanged, setSelectionChanged] = React.useState(false);\r\n const handleChange = (text: string, withCompletion?: boolean) => {\r\n let finalString =\r\n text === '' || text === inputMask\r\n ? maskIfEmpty\r\n ? inputMask\r\n : null\r\n : text;\r\n onChange(finalString, withCompletion);\r\n };\r\n const dateChange = useDateTimeChange({\r\n mask: true,\r\n // format: val => val,\r\n value: inputValue || (maskIfEmpty ? inputMask : ''),\r\n onChange: handleChange,\r\n variant: variant === 'time' ? 'time' : 'date',\r\n maskFormats: dateTimeMask,\r\n ampm: ampm,\r\n inputMask: inputMask,\r\n maskIfEmpty: maskIfEmpty,\r\n onSelectionChange: () => selectionChanged,\r\n });\r\n return (\r\n {\r\n if (variant === 'time') {\r\n timeSelection(event, dateTimeMask);\r\n } else {\r\n dateSelection(event, dateTimeMask);\r\n }\r\n setSelectionChanged(true);\r\n },\r\n onMouseDown: event => {\r\n const target = event.target as HTMLInputElement;\r\n if (!!target.value && target.value !== '') {\r\n target.selectionStart = target.selectionEnd = target.value.length;\r\n }\r\n },\r\n onKeyUp: event => {\r\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\r\n dateArrowSelection(\r\n event,\r\n event.key === 'ArrowLeft' ? 'left' : 'right',\r\n variant === 'time' ? 'time' : 'date',\r\n dateTimeMask,\r\n );\r\n setSelectionChanged(true);\r\n console.log(event.key, {\r\n selStart: (event.target as any).selectionStart,\r\n selEnd: (event.target as any).selectionEnd,\r\n });\r\n }\r\n if (event.key === 'ArrowUp') {\r\n // keyDownRef.current = {\r\n // selectionStart: (event.target as any).selectionStart,\r\n // selectionEnd: (event.target as any).selectionEnd,\r\n // };\r\n dateChange.onChange(event as any, 'increase');\r\n console.log('ArrowUp', {\r\n selectionStart: (event.target as any).selectionStart,\r\n selectionEnd: (event.target as any).selectionEnd,\r\n });\r\n }\r\n if (event.key === 'ArrowDown') {\r\n dateChange.onChange(event as any, 'decrease');\r\n // keyDownRef.current = {\r\n // selectionStart: (event.target as any).selectionStart,\r\n // selectionEnd: (event.target as any).selectionEnd,\r\n // };\r\n console.log('ArrowUp', {\r\n selStart: (event.target as any).selectionStart,\r\n selEnd: (event.target as any).selectionEnd,\r\n });\r\n }\r\n if (event.key === 'Enter' || event.key === 'Tab') {\r\n handleChange(dateChange.value, true);\r\n }\r\n },\r\n onKeyDown: event => {\r\n switch (event.key) {\r\n case 'ArrowLeft':\r\n case 'ArrowRight':\r\n case 'ArrowUp':\r\n case 'ArrowDown':\r\n event.preventDefault();\r\n event.nativeEvent.stopImmediatePropagation();\r\n }\r\n },\r\n }}\r\n error={hasError}\r\n onChange={event => {\r\n dateChange.onChange(event);\r\n }}\r\n InputProps={{\r\n ...InputProps,\r\n disableUnderline: inputVariant === 'standard',\r\n autoComplete: 'off',\r\n // startAdornment: (\r\n // \r\n // \r\n // \r\n // ),\r\n endAdornment: (\r\n <>\r\n {(info && ) ||\r\n (endIcon && (\r\n \r\n {endIcon}\r\n \r\n ))}\r\n \r\n togglePicker()}\r\n disabled={props.disabled}\r\n size=\"xs\"\r\n variant=\"ghost\"\r\n >\r\n \r\n \r\n \r\n {props.clearable &&\r\n Boolean(inputValue || (maskIfEmpty ? inputMask : '')) && (\r\n \r\n handleChange('', true)}\r\n >\r\n \r\n \r\n \r\n )}\r\n \r\n ),\r\n // style: { minWidth: 80 },\r\n }}\r\n InputLabelProps={{\r\n shrink:\r\n inputVariant === 'filled'\r\n ? !isNullOrUndefined(inputValue)\r\n ? true\r\n : false\r\n : undefined,\r\n }}\r\n helperText={errorMessage || props.helperText}\r\n onClick={ev => {\r\n if (!isPickerOpen) {\r\n const target = ev.target as HTMLInputElement;\r\n if (!!target && target.nodeName === 'INPUT') openPicker();\r\n }\r\n }}\r\n onMouseDown={ev => {\r\n if (!isPickerOpen) {\r\n const target = ev.target as HTMLInputElement;\r\n if (!!target && target.nodeName === 'INPUT') openPicker();\r\n }\r\n }}\r\n value={dateChange.value}\r\n variant={inputVariant}\r\n // onKeyUp={(event: React.KeyboardEvent) => {\r\n // if (event.key === 'Enter') {\r\n // event.stopPropagation();\r\n // openPicker();\r\n // }\r\n // }}\r\n autoFocus={props.autoFocus}\r\n size={props.size}\r\n fullWidth={props.fullWidth}\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n disabled={props.disabled}\r\n name={props.name}\r\n id={props.id}\r\n label={props.label}\r\n margin={props.margin}\r\n onBlur={props.onBlur}\r\n onFocus={props.onFocus}\r\n />\r\n );\r\n}\r\n","import { BaseTextFieldProps } from '@material-ui/core';\r\nimport { BaseDatePickerProps, BaseTimePickerProps } from '@material-ui/pickers';\r\nimport { DateValidationProps } from '@material-ui/pickers/_helpers/text-field-helper';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { KeyboardRifmInput } from './KeyboardRifmInput';\r\nimport * as React from 'react';\r\nimport { IUtils } from '@date-io/core/IUtils';\r\nimport { validateError } from '../DatePicker/utils/pickerDateValidate';\r\nimport { KeyboardDateInputProps } from '@material-ui/pickers/_shared/KeyboardDateInput';\r\nimport { DatePopupVariants, getDisplayDate } from './utils/types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\n\r\nexport interface KeyboardInputProps\r\n extends DateValidationProps,\r\n Pick,\r\n Pick<\r\n BaseDatePickerProps,\r\n | 'disableFuture'\r\n | 'disablePast'\r\n | 'minDate'\r\n | 'maxDate'\r\n | 'strictCompareDates'\r\n >,\r\n Omit<\r\n KeyboardDateInputProps,\r\n | 'maskChar'\r\n | 'mask'\r\n | 'refuse'\r\n | 'KeyboardButtonProps'\r\n | 'rifmFormatter'\r\n | 'onChange'\r\n | 'format'\r\n >,\r\n Pick<\r\n BaseKeyboardPickerProps,\r\n | 'onChange'\r\n | 'format'\r\n | 'value'\r\n | 'invalidLabel'\r\n | 'emptyLabel'\r\n | 'labelFunc'\r\n | 'onError'\r\n | 'onChange'\r\n >,\r\n Pick<\r\n BaseTextFieldProps,\r\n | 'autoFocus'\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'placeholder'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'margin'\r\n > {\r\n info?: string;\r\n ariaLabel?: string;\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n togglePicker: () => void;\r\n variant: Omit;\r\n isPickerOpen?: boolean;\r\n onChange: (\r\n date: MaterialUiPickersDate | null,\r\n value?: string | null,\r\n withCompletion?: boolean,\r\n ) => void;\r\n maskIfEmpty?: boolean;\r\n clearable?: boolean;\r\n}\r\nexport function parseInputString(\r\n value: string,\r\n utils: IUtils,\r\n format: string,\r\n) {\r\n try {\r\n return utils.parse(value, format);\r\n } catch {\r\n return null;\r\n }\r\n}\r\nexport function KeyboardInput({\r\n format = dateUtils.DateIOFormats.keyboardDate,\r\n inputValue,\r\n onChange,\r\n value,\r\n onError,\r\n maxDate,\r\n minDate,\r\n disablePast,\r\n disableFuture,\r\n maxDateMessage,\r\n minDateMessage,\r\n invalidDateMessage,\r\n strictCompareDates,\r\n variant,\r\n size,\r\n maskIfEmpty,\r\n clearable,\r\n ...props\r\n}: KeyboardInputProps) {\r\n const utils = dateUtils.dateFnsUtils;\r\n const displayDate = getDisplayDate(\r\n value,\r\n format,\r\n utils,\r\n value === null || value === '',\r\n {\r\n invalidLabel: props.invalidLabel,\r\n emptyLabel: props.emptyLabel,\r\n labelFunc: props.labelFunc,\r\n },\r\n );\r\n const [innerInputValue, setInnerInputValue] = React.useState(displayDate);\r\n // const dateValue = inputValue\r\n // ? parseInputString(inputValue, utils, format)\r\n // : value;\r\n const changedValueRef = React.useRef(innerInputValue);\r\n React.useEffect(() => {\r\n if (value === null || utils.isValid(value)) {\r\n setInnerInputValue(displayDate);\r\n }\r\n }, [displayDate, setInnerInputValue, utils, value]);\r\n React.useEffect(() => {\r\n let val = innerInputValue;\r\n if (!!val && val !== '') {\r\n let date = val === null ? null : utils.parse(val, format);\r\n\r\n if (!(date?.toString() === 'Invalid Date')) {\r\n if (value !== null || utils.isValid(value)) {\r\n let dateVal = dateUtils.getParsableDate(value);\r\n if (dateVal !== null && date !== null) {\r\n if (variant === 'time') {\r\n date = dateUtils.dateFnsUtils.mergeDateAndTime(dateVal, date);\r\n } else {\r\n date = dateUtils.dateFnsUtils.mergeDateAndTime(date, dateVal);\r\n }\r\n }\r\n }\r\n }\r\n\r\n let error = validateError(\r\n date,\r\n {\r\n maxDate: maxDate,\r\n minDate: minDate,\r\n disablePast: disablePast,\r\n disableFuture: disableFuture,\r\n maxDateMessage: maxDateMessage,\r\n minDateMessage: minDateMessage,\r\n invalidDateMessage: invalidDateMessage,\r\n strictCompareDates: strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!!error) {\r\n setValidationError(error);\r\n if (!!onError) {\r\n onError(error, null);\r\n }\r\n } else {\r\n setValidationError('');\r\n if (!!onError) {\r\n onError('', null);\r\n }\r\n }\r\n } else {\r\n setValidationError('');\r\n if (!!onError) {\r\n onError('', null);\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [format, innerInputValue, maxDate, minDate]);\r\n const [innerValidationError, setValidationError] = React.useState<\r\n React.ReactNode | undefined\r\n >(undefined);\r\n const errorMessage = React.useMemo(() => {\r\n return innerValidationError;\r\n }, [innerValidationError]);\r\n // const handleKeyboardChange = React.useCallback(\r\n // (date: MaterialUiPickersDate) => {\r\n // onChange(date, date === null ? null : utils.format(date, format));\r\n // },\r\n // [format, onChange, utils],\r\n // );\r\n\r\n // const inputProps = React.useMemo(\r\n // () => ({\r\n // ...innerInputProps, // reuse validation and open/close logic\r\n // format: format,\r\n // inputValue: inputValue || innerInputValue,\r\n // onChange: (value: string | null) => {\r\n // setInnerInputValue(value || '');\r\n // const date =\r\n // value === null ? null : utils.parse(value, wrapperProps.format);\r\n\r\n // onChange(date, value);\r\n // },\r\n // }),\r\n // [\r\n // innerInputProps,\r\n // innerInputValue,\r\n // inputValue,\r\n // onChange,\r\n // utils,\r\n // wrapperProps.format,\r\n // ],\r\n // );\r\n return (\r\n {\r\n setInnerInputValue(textValue ?? '');\r\n changedValueRef.current = textValue ?? '';\r\n\r\n let date = textValue === null ? null : utils.parse(textValue, format);\r\n\r\n if (!(date?.toString() === 'Invalid Date')) {\r\n if (value !== null || utils.isValid(value)) {\r\n let dateVal = dateUtils.getParsableDate(value);\r\n if (dateVal !== null && date !== null) {\r\n if (variant === 'time') {\r\n date = dateUtils.dateFnsUtils.mergeDateAndTime(dateVal, date);\r\n } else {\r\n date = dateUtils.dateFnsUtils.mergeDateAndTime(date, dateVal);\r\n }\r\n }\r\n }\r\n }\r\n let error = validateError(\r\n date,\r\n {\r\n maxDate: maxDate,\r\n minDate: minDate,\r\n disablePast: disablePast,\r\n disableFuture: disableFuture,\r\n maxDateMessage: maxDateMessage,\r\n minDateMessage: minDateMessage,\r\n invalidDateMessage: invalidDateMessage,\r\n strictCompareDates: strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!!error) {\r\n setValidationError(error);\r\n if (!!onError) {\r\n onError(error, date);\r\n }\r\n } else {\r\n setValidationError('');\r\n if (!!onError) {\r\n onError('', date);\r\n }\r\n // if (!(date?.toString() === 'Invalid Date')) {\r\n // setTimeout(() => {\r\n // if (textValue === changedValueRef.current) {\r\n // onChange(date, textValue);\r\n // }\r\n // }, 1500);\r\n // }\r\n if (!(date?.toString() === 'Invalid Date')) {\r\n onChange(date, textValue, withCompletion);\r\n }\r\n }\r\n }}\r\n isPickerOpen={props.isPickerOpen}\r\n info={props.info}\r\n ariaLabel={props.ariaLabel}\r\n format={format}\r\n validationError={errorMessage || props.validationError}\r\n helperText={errorMessage || props.helperText}\r\n error={Boolean(errorMessage)}\r\n InputProps={props.InputProps}\r\n startIcon={props.startIcon}\r\n endIcon={props.endIcon}\r\n inputVariant={props.inputVariant}\r\n onFocus={props.onFocus}\r\n onBlur={props.onBlur}\r\n ampm={props.ampm}\r\n variant={variant}\r\n size={size}\r\n maskIfEmpty={maskIfEmpty}\r\n clearable={clearable}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import {\r\n BaseTextFieldProps,\r\n capitalize,\r\n Divider,\r\n List,\r\n ListItem,\r\n useTheme,\r\n} from '@material-ui/core';\r\nimport { BaseTimePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { validateError } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { DateDropDownValidationProps } from '../DateDropDown';\r\nimport {\r\n getHoursEntityFromDate,\r\n hoursEntityArray12,\r\n hoursEntityArray24,\r\n} from 'app/components/pickers/StaticOptionsPickers/HoursPicker';\r\nimport {\r\n getMinutesEntityFromDate,\r\n minutesEntityArray,\r\n} from 'app/components/pickers/StaticOptionsPickers/MinutesPicker';\r\nimport {\r\n AmPmEntityArray,\r\n getAmPmEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/AmPmPicker';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TimeOptionPickerProps\r\n extends DateDropDownValidationProps,\r\n BaseTimePickerProps,\r\n Pick<\r\n BaseTextFieldProps,\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'error'\r\n | 'size'\r\n > {\r\n value?: Date | string | null;\r\n onChange: (\r\n date: MaterialUiPickersDate | null,\r\n withCompletion?: boolean,\r\n ) => void;\r\n inputVariant?: 'filled' | 'standard' | 'outlined';\r\n info?: string;\r\n className?: string;\r\n hoursDisabled?: boolean;\r\n minutesDisabled?: boolean;\r\n onError?: (\r\n error: React.ReactNode,\r\n value: MaterialUiPickersDate | ParsableDate,\r\n ) => void;\r\n}\r\n\r\nexport function TimeOptionPicker(props: TimeOptionPickerProps) {\r\n const {\r\n value,\r\n onChange,\r\n inputVariant,\r\n id,\r\n fullWidth,\r\n helperText,\r\n disabled,\r\n label,\r\n error,\r\n size,\r\n ampm,\r\n minutesStep,\r\n strictCompareDates = true,\r\n onError,\r\n } = props;\r\n const { newDate } = useSystemDate();\r\n const utils = useUtils();\r\n const theme = useTheme();\r\n const inputLabelId = label && id ? `${id}-label` : undefined;\r\n const helperTextId = id ? `${id}-helper-text` : undefined;\r\n const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n const dateTimeValue = React.useMemo(() => {\r\n return value;\r\n }, [value]);\r\n const [dateSelected, setDateSelected] = React.useState<\r\n Date | string | null | undefined\r\n >(value);\r\n const [hoursSelected, setHoursSelected] = React.useState(\r\n getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n );\r\n const [minutesSelected, setMinutesSelected] = React.useState(\r\n getMinutesEntityFromDate(dateTimeValue),\r\n );\r\n const [ampmSelected, setAmpmSelected] = React.useState(\r\n getAmPmEntityFromDate(dateTimeValue),\r\n );\r\n // const [isHourOpen, setIsHourOpen] = React.useState(false);\r\n // const [isMinuteOpen, setIsMinuteOpen] = React.useState(false);\r\n // const [isAmPmOpen, setIsAmPmOpen] = React.useState(false);\r\n // const someOpen = React.useMemo(() => {\r\n // return isHourOpen || isMinuteOpen || isAmPmOpen;\r\n // }, [isHourOpen, isMinuteOpen, isAmPmOpen]);\r\n const [innerError, setInnerError] = React.useState<\r\n React.ReactNode | undefined\r\n >(undefined);\r\n\r\n const hoursItems = React.useMemo(() => {\r\n return ampm ? hoursEntityArray12 : hoursEntityArray24;\r\n }, [ampm]);\r\n const minutesItems = React.useMemo(() => {\r\n return !!minutesStep && minutesStep > 0 && minutesStep <= 30\r\n ? minutesEntityArray.filter(f => f.Id % minutesStep === 0)\r\n : minutesEntityArray;\r\n }, [minutesStep]);\r\n const ampmItems = React.useMemo(() => {\r\n return AmPmEntityArray;\r\n }, []);\r\n const hourRef = React.useRef(null);\r\n const minuteRef = React.useRef(null);\r\n const hourScroll = (selectedId: number, useAmPm?: boolean) => {\r\n if (!!hourRef.current) {\r\n let top = (useAmPm ? selectedId - 1 : selectedId) * 50;\r\n hourRef.current.scrollTo(0, top);\r\n }\r\n };\r\n const minuteScroll = (selectedId: number, step?: number) => {\r\n if (!!minuteRef.current) {\r\n let top = selectedId * 50;\r\n if (step !== undefined) {\r\n top = top / step;\r\n }\r\n minuteRef.current.scrollTo(0, top);\r\n }\r\n };\r\n React.useEffect(() => {\r\n setHoursSelected(() =>\r\n getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n );\r\n setMinutesSelected(() => getMinutesEntityFromDate(dateTimeValue));\r\n setAmpmSelected(() => getAmPmEntityFromDate(dateTimeValue));\r\n }, [ampm, dateTimeValue]);\r\n\r\n React.useEffect(() => {\r\n if (!!hourRef.current) {\r\n hourScroll(hoursSelected.Id, ampm);\r\n }\r\n if (!!minuteRef.current) {\r\n minuteScroll(minutesSelected.Id, minutesStep);\r\n }\r\n }, [ampm, hoursSelected.Id, minutesSelected.Id, minutesStep]);\r\n React.useEffect(() => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n hours: hoursSelected.Id,\r\n minutes: minutesSelected.Id,\r\n });\r\n let validateDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n ampm ?? false,\r\n );\r\n let error = validateError(\r\n validateDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!!error) {\r\n setInnerError(error);\r\n if (onError) {\r\n onError(error, validateDate);\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', validateDate);\r\n }\r\n }\r\n } else {\r\n setInnerError('');\r\n if (onError) {\r\n onError('', null);\r\n }\r\n }\r\n }, [\r\n ampm,\r\n ampmSelected.Id,\r\n dateSelected,\r\n hoursSelected.Id,\r\n minutesSelected.Id,\r\n onError,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n strictCompareDates,\r\n utils,\r\n ]);\r\n const handleChange = React.useCallback(\r\n (\r\n hour: number,\r\n minute: number,\r\n ampmValue: 'am' | 'pm',\r\n withCompletion?: boolean,\r\n ) => {\r\n if (dateSelected !== null && dateSelected !== undefined) {\r\n let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n hours: hour,\r\n minutes: minute,\r\n });\r\n let finalDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmValue,\r\n ampm ?? false,\r\n );\r\n let hasError = validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!hasError || hasError === '') {\r\n onChange(finalDate, withCompletion);\r\n }\r\n } else {\r\n let time = dateUtils.set(newDate(), { hours: hour, minutes: minute });\r\n let finalDate = dateUtils.convertToMeridiem(\r\n time,\r\n ampmValue,\r\n ampm ?? false,\r\n );\r\n setDateSelected(finalDate);\r\n let hasError = validateError(\r\n finalDate,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!hasError || hasError === '') {\r\n onChange(finalDate, withCompletion);\r\n }\r\n }\r\n },\r\n [\r\n ampm,\r\n dateSelected,\r\n newDate,\r\n onChange,\r\n props.disableFuture,\r\n props.disablePast,\r\n props.invalidDateMessage,\r\n props.maxDate,\r\n props.maxDateMessage,\r\n props.minDate,\r\n props.minDateMessage,\r\n strictCompareDates,\r\n utils,\r\n ],\r\n );\r\n const handleHoursChange = React.useCallback(\r\n (val: Entity) => {\r\n setHoursSelected(val);\r\n handleChange(\r\n val.Id,\r\n minutesSelected.Id,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [ampmSelected.Id, handleChange, minutesSelected.Id],\r\n );\r\n const handleMinutesChange = React.useCallback(\r\n (val: Entity) => {\r\n setMinutesSelected(val);\r\n handleChange(\r\n hoursSelected.Id,\r\n val.Id,\r\n ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [ampmSelected.Id, handleChange, hoursSelected.Id],\r\n );\r\n const handleAmPmChange = React.useCallback(\r\n (val: Entity) => {\r\n setAmpmSelected(val);\r\n handleChange(\r\n hoursSelected.Id,\r\n minutesSelected.Id,\r\n val.Id === 'am' ? 'am' : 'pm',\r\n );\r\n },\r\n [handleChange, hoursSelected.Id, minutesSelected.Id],\r\n );\r\n\r\n return (\r\n \r\n ) => {\r\n // const target = event.target as any; // as HTMLInputElement;\r\n\r\n // if (event.key === 'Enter') {\r\n // if (!!target && target.nodeName === 'INPUT') {\r\n // if (!someOpen && !innerError) {\r\n // handleChange(\r\n // hoursSelected.Id,\r\n // minutesSelected.Id,\r\n // ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n // true,\r\n // );\r\n // }\r\n // }\r\n // }\r\n // }}\r\n >\r\n {label && (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n
\r\n
\r\n \r\n {hoursItems.map(hour => (\r\n {\r\n handleHoursChange(hour);\r\n }}\r\n onKeyDown={event => {\r\n if (event.key === 'Enter') {\r\n handleHoursChange(hour);\r\n }\r\n }}\r\n selected={hoursSelected.Id === hour.Id}\r\n >\r\n {hour.Name}\r\n \r\n ))}\r\n \r\n \r\n \r\n {minutesItems.map(minute => (\r\n {\r\n handleMinutesChange(minute);\r\n }}\r\n onKeyDown={event => {\r\n if (event.key === 'Enter') {\r\n handleMinutesChange(minute);\r\n }\r\n }}\r\n selected={minutesSelected.Id === minute.Id}\r\n >\r\n {minute.Name}\r\n \r\n ))}\r\n \r\n {ampm && (\r\n \r\n \r\n \r\n {ampmItems.map(ap => (\r\n {\r\n handleAmPmChange(ap);\r\n }}\r\n onKeyDown={event => {\r\n if (event.key === 'Enter') {\r\n handleAmPmChange(ap);\r\n }\r\n }}\r\n selected={ampmSelected.Id === ap.Id}\r\n >\r\n {ap.Name}\r\n \r\n ))}\r\n \r\n \r\n )}\r\n
\r\n
\r\n
\r\n {(!!helperText || Boolean(innerError)) && (\r\n \r\n {helperText || innerError}\r\n \r\n )}\r\n \r\n
\r\n );\r\n}\r\nconst PickerOptions = styled('div')(({ theme }) => ({\r\n '&.time-options-picker-root': {\r\n display: 'grid',\r\n gridAutoColumns: 'max-content auto max-content',\r\n gridAutoRows: 'max-content auto max-content',\r\n '& .time-options-picker-wrap': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gridColumn: 1,\r\n gridRow: 1,\r\n '& .time-options-picker-section': {\r\n overflow: 'hidden',\r\n maxHeight: '334px',\r\n margin: '0px auto',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n width: '100%',\r\n borderBottom: '1px solid rgba(0, 0, 0, 0.12)',\r\n borderTop: '1px solid rgba(0, 0, 0, 0.12)',\r\n gap: '8px',\r\n padding: '8px 0px',\r\n '& .time-options-picker-list': {\r\n listStyle: 'none',\r\n margin: '0px',\r\n position: 'relative',\r\n maxHeight: '232px',\r\n width: '56px',\r\n padding: '0px',\r\n overflow: 'hidden',\r\n '&.time-options-hours, &.time-options-minutes': {\r\n '&::after': {\r\n display: 'block',\r\n content: '\"\"',\r\n height: 'calc((100% - 40px) - 6px)',\r\n },\r\n '@media (prefers-reduced-motion: no-preference)': {\r\n scrollBehavior: 'auto',\r\n },\r\n '&:hover': {\r\n overflowY: 'auto',\r\n },\r\n '&::-webkit-scrollbar': {\r\n width: '4px',\r\n boxShadow: `inset 0px 0px 1px 1px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '2px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n '& .time-options-picker-list-item': {\r\n display: 'flex',\r\n minHeight: '48px',\r\n whiteSpace: 'nowrap',\r\n padding: '8px',\r\n margin: '2px 4px',\r\n width: '48px',\r\n borderRadius: '8px',\r\n justifyContent: 'center',\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '16px',\r\n fontStyle: 'normal',\r\n lineHeight: '20px' /* 125% */,\r\n fontWeight: 600,\r\n letterSpacing: '0.2px',\r\n '&.selected': {\r\n backgroundColor: bookitColors.primary.components,\r\n color: bookitColors.base.white,\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n },\r\n },\r\n },\r\n '& .time-options-minutes': {\r\n // borderLeft: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n // marginLeft: '12px',\r\n },\r\n '& .time-options-ampm': {\r\n // borderLeft: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n // marginLeft: '12px',\r\n },\r\n '& .time-options-hours': {\r\n // marginRight: '12px',\r\n },\r\n },\r\n },\r\n },\r\n}));\r\n","import { ClickAwayListener, Fade, Paper, useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DateInput, DateInputProps } from './DateInput';\r\nimport {\r\n DatePopupVariants,\r\n getInputViewDate,\r\n getValueDateOrTruncat,\r\n setInputViewDate,\r\n} from './utils/types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport {\r\n BaseDatePickerProps,\r\n BaseTimePickerProps,\r\n DatePicker,\r\n KeyboardDatePickerProps,\r\n TimePicker,\r\n useUtils,\r\n} from '@material-ui/pickers';\r\nimport { DatePickerValueProps } from '../DatePicker';\r\nimport { PickerPopper, StyledPicker } from './StyledPicker';\r\nimport { SeparatedPickerProps } from '../KeyBoardDatePicker';\r\nimport { KeyboardDateInputProps } from '@material-ui/pickers/_shared/KeyboardDateInput';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DateDropDown } from './DateDropDown';\r\nimport { TimeDropDown } from './TimeDropDown';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectUseAmPm } from 'app/slice/selectors';\r\nimport {\r\n validateDate,\r\n validateTime,\r\n} from '../DatePicker/utils/pickerDateValidate';\r\nimport { useKeyUpOutside } from 'app/hooks/useKeyUpOutside';\r\nimport { KeyboardInput } from './KeyboardInput';\r\nimport { TimeOptionPicker } from './TimeOptionPicker';\r\n\r\nexport interface BookitDatePickerProps\r\n extends BaseDatePickerProps,\r\n Pick,\r\n SeparatedPickerProps,\r\n Pick,\r\n Pick<\r\n KeyboardDateInputProps,\r\n | 'validationError'\r\n | 'keyboardIcon'\r\n | 'mask'\r\n | 'maskChar'\r\n | 'KeyboardButtonProps'\r\n | 'rifmFormatter'\r\n | 'refuse'\r\n >,\r\n Pick<\r\n KeyboardDatePickerProps,\r\n | 'labelFunc'\r\n | 'clearable'\r\n | 'maxDateMessage'\r\n | 'minDateMessage'\r\n | 'invalidDateMessage'\r\n | 'onError'\r\n >,\r\n Pick,\r\n Pick<\r\n DateInputProps,\r\n | 'autoFocus'\r\n | 'fullWidth'\r\n | 'helperText'\r\n | 'placeholder'\r\n | 'error'\r\n | 'required'\r\n | 'disabled'\r\n | 'name'\r\n | 'id'\r\n | 'label'\r\n | 'margin'\r\n | 'inputProps'\r\n | 'InputProps'\r\n | 'TextFieldComponent'\r\n | 'onBlur'\r\n | 'onFocus'\r\n > {\r\n inputVariant?: 'filled' | 'standard' | 'outlined';\r\n closablePicker?: boolean;\r\n closeTitle?: React.ReactNode;\r\n onClose?: () => void;\r\n onOpen?: () => void;\r\n variant?: DatePopupVariants;\r\n info?: string;\r\n ariaLabel?: string;\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n size?: 'medium' | 'small' | undefined;\r\n className?: string;\r\n fullScreen?: boolean;\r\n readonlyInput?: boolean;\r\n useTimeClockPicker?: boolean;\r\n useTimeDropDowns?: boolean;\r\n useDateDropDowns?: boolean;\r\n useDateCalendarPicker?: boolean;\r\n saveOnSelect?: boolean;\r\n maskIfEmpty?: boolean;\r\n clearable?: boolean;\r\n}\r\n\r\nexport function BookitDatePicker(props: BookitDatePickerProps) {\r\n const isMobile = DetectIsMobile();\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n const useAmPm = useSelector(selectUseAmPm);\r\n const utils = useUtils();\r\n const elementRef = React.useRef(null);\r\n const {\r\n inputVariant,\r\n closablePicker = true,\r\n closeTitle = 'Close',\r\n onClose,\r\n onOpen,\r\n value,\r\n endTime,\r\n truncateTime,\r\n variant = 'date',\r\n info,\r\n startIcon,\r\n endIcon,\r\n ariaLabel,\r\n minDateMessage = 'Date should not be before minimal date',\r\n maxDateMessage = 'Date should not be after maximal date',\r\n invalidDateMessage = 'Invalid Date Format',\r\n onChange,\r\n labelFunc,\r\n readonlyInput,\r\n useTimeClockPicker,\r\n useTimeDropDowns,\r\n useDateDropDowns,\r\n saveOnSelect,\r\n maskIfEmpty = true,\r\n clearable,\r\n ...other\r\n } = props;\r\n\r\n const dateInputProps = React.useMemo(() => {\r\n return {\r\n autoFocus: props.autoFocus,\r\n fullWidth: props.fullWidth,\r\n helperText: props.helperText,\r\n placeholder: props.placeholder,\r\n error: props.error,\r\n required: props.required,\r\n disabled: props.disabled,\r\n name: props.name || 'dateInputName',\r\n id: props.id || 'dateInputId',\r\n label: props.label,\r\n margin: props.margin,\r\n inputProps: props.inputProps,\r\n InputProps: props.InputProps,\r\n TextFieldComponent: props.TextFieldComponent,\r\n onBlur: props.onBlur,\r\n onFocus: props.onFocus,\r\n };\r\n }, [\r\n props.InputProps,\r\n props.TextFieldComponent,\r\n props.autoFocus,\r\n props.disabled,\r\n props.error,\r\n props.fullWidth,\r\n props.helperText,\r\n props.id,\r\n props.inputProps,\r\n props.label,\r\n props.margin,\r\n props.name,\r\n props.onBlur,\r\n props.onFocus,\r\n props.placeholder,\r\n props.required,\r\n ]);\r\n const keyboardInputProps = React.useMemo(() => {\r\n return {\r\n ...dateInputProps,\r\n minDateMessage: minDateMessage,\r\n maxDateMessage: maxDateMessage,\r\n invalidDateMessage: invalidDateMessage,\r\n ariaLabel: ariaLabel,\r\n startIcon: startIcon,\r\n endIcon: endIcon,\r\n info: info,\r\n labelFunc: labelFunc,\r\n minDate: other.minDate,\r\n maxDate: other.maxDate,\r\n disableFuture: other.disableFuture,\r\n disablePast: other.disablePast,\r\n strictCompareDates: other.strictCompareDates,\r\n };\r\n }, [\r\n ariaLabel,\r\n dateInputProps,\r\n endIcon,\r\n info,\r\n invalidDateMessage,\r\n labelFunc,\r\n maxDateMessage,\r\n minDateMessage,\r\n other.disableFuture,\r\n other.disablePast,\r\n other.maxDate,\r\n other.minDate,\r\n other.strictCompareDates,\r\n startIcon,\r\n ]);\r\n const [dateValue, setDateValue] = React.useState<\r\n Date | string | null | undefined\r\n >(getValueDateOrTruncat(variant, value, endTime, truncateTime));\r\n const [open, setOpen] = React.useState(undefined);\r\n const [validationError, setValidationError] = React.useState<\r\n React.ReactNode | undefined\r\n >(undefined);\r\n const dateTimeValue = React.useMemo(() => {\r\n return getValueDateOrTruncat(variant, value, endTime, truncateTime);\r\n }, [endTime, truncateTime, value, variant]);\r\n React.useEffect(() => {\r\n setDateValue(() => {\r\n if (dateTimeValue === null || dateTimeValue === undefined) {\r\n return null;\r\n } else {\r\n return dateUtils.dateOrStringToDate(dateTimeValue);\r\n }\r\n });\r\n }, [dateTimeValue]);\r\n useKeyUpOutside(\r\n elementRef,\r\n () => {\r\n if (open) {\r\n if (!validationError || validationError === '') {\r\n handleSave();\r\n }\r\n handleClose();\r\n }\r\n },\r\n 'keyup',\r\n 'Tab',\r\n );\r\n // useGlobalDOMEvents({\r\n // keyup(ev) {\r\n // if ((ev as KeyboardEvent).key === 'Tab') {\r\n // console.log('tab event target', ev.target);\r\n // console.log('tab event currentTarget', ev.currentTarget);\r\n // }\r\n // },\r\n // });\r\n // manually trigger rerender using a useless usState hook\r\n // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n const countState = React.useState(0);\r\n React.useEffect(() => {\r\n countState[1](c => c + 1);\r\n // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementRef.current]);\r\n\r\n const handleClickAway = (event: React.MouseEvent) => {\r\n if (open) {\r\n if (!validationError || validationError === '') {\r\n handleSave();\r\n }\r\n handleClose();\r\n }\r\n };\r\n const handleSave = React.useCallback(() => {\r\n onChange(setInputViewDate(variant, dateValue, endTime, truncateTime));\r\n setOpen(false);\r\n onClose?.();\r\n }, [dateValue, endTime, onChange, onClose, truncateTime, variant]);\r\n const handleClose = React.useCallback(() => {\r\n setOpen(false);\r\n onClose?.();\r\n }, [onClose]);\r\n const handleOpen = React.useCallback(() => {\r\n setOpen(true);\r\n onOpen?.();\r\n }, [onOpen]);\r\n const togglePicker = React.useCallback(() => {\r\n if (open) {\r\n if (!validationError || validationError === '') {\r\n handleClose();\r\n }\r\n } else {\r\n handleOpen();\r\n }\r\n }, [handleClose, handleOpen, open, validationError]);\r\n const inputDisplayValue = React.useMemo(() => {\r\n return getInputViewDate(variant, dateValue, endTime, truncateTime);\r\n }, [endTime, truncateTime, dateValue, variant]);\r\n\r\n const onError = React.useCallback(\r\n (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n setValidationError(error);\r\n if (!!props.onError) {\r\n props.onError(error, value);\r\n }\r\n },\r\n [props],\r\n );\r\n return (\r\n handleClickAway(event)}\r\n >\r\n \r\n {readonlyInput || isMobile ? (\r\n \r\n ) : (\r\n {\r\n setDateValue(date);\r\n if (withCompletion) {\r\n if (!validationError || validationError === '') {\r\n onChange(\r\n setInputViewDate(variant, date, endTime, truncateTime),\r\n inpValue,\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n // onChange(date, inpValue);\r\n // if (open) {\r\n // setOpen(false);\r\n // onClose?.();\r\n // }\r\n //onChange(setInputViewDate(variant, dateValue, endTime, truncateTime));\r\n }}\r\n onError={(error, date) => {\r\n if (\r\n !!error &&\r\n !!date &&\r\n date !== null &&\r\n dateUtils.dateFnsUtils.isValid(date)\r\n ) {\r\n let setDate = dateUtils.getParsableDate(date);\r\n setDateValue(setDate);\r\n }\r\n\r\n onError(error, date);\r\n }}\r\n ampm={useAmPm}\r\n format={\r\n variant === 'time'\r\n ? dateUtils.DateIOFormats.fullTime\r\n : dateUtils.DateIOFormats.keyboardDate\r\n }\r\n validationError={\r\n keyboardInputProps.error\r\n ? keyboardInputProps.helperText\r\n : undefined\r\n }\r\n {...keyboardInputProps}\r\n />\r\n )}\r\n\r\n ) => {\r\n const target = event.target as any; // as HTMLInputElement;\r\n\r\n if (event.key === 'Enter') {\r\n if (!!target && target.nodeName === 'INPUT') {\r\n // if (!validationError || validationError === '') {\r\n // handleSave();\r\n // }\r\n } else {\r\n if (!validationError || validationError === '') {\r\n handleSave();\r\n } else {\r\n handleClose();\r\n }\r\n }\r\n }\r\n }}\r\n // onBlur={event => {\r\n // console.log('blur event', event.target);\r\n // }}\r\n // modifiers={{\r\n // keepTogether: { enabled: true },\r\n // flip: { enabled: false },\r\n // preventOverflow: {\r\n // enabled: true,\r\n // boundariesElement: 'viewport',\r\n // },\r\n // // offset: {\r\n // // offset: '-15,0',\r\n // // },\r\n // }}\r\n >\r\n {({ TransitionProps }) => (\r\n \r\n \r\n \r\n {closablePicker && (\r\n {\r\n handleClose();\r\n }}\r\n disabled={!!validationError && validationError !== ''}\r\n style={{ position: 'absolute', right: 8, top: 8 }}\r\n >\r\n {!!closeTitle ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n {variant === 'time' ? (\r\n \r\n {useTimeClockPicker ? (\r\n {\r\n if (timeValue !== null) {\r\n // let validateDate = dateUtils.convertToMeridiem(\r\n // timeValue,\r\n // dateUtils.getMeridiem(timeValue),\r\n // useAmPm ?? false,\r\n // );\r\n let error = validateTime(\r\n timeValue.getHours(),\r\n timeValue.getMinutes(),\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: maxDateMessage,\r\n minDateMessage: minDateMessage,\r\n invalidDateMessage: invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n timeValue,\r\n useAmPm ?? false,\r\n );\r\n if (!!error) {\r\n onError(error, validateDate);\r\n } else {\r\n setDateValue(timeValue);\r\n if (saveOnSelect) {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n timeValue,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n } else {\r\n setDateValue(timeValue);\r\n if (saveOnSelect) {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n timeValue,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n }}\r\n ampm={useAmPm}\r\n />\r\n ) : (\r\n {\r\n setDateValue(val);\r\n if (withCompletion) {\r\n if (!validationError || validationError === '') {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n val,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n }}\r\n onBlur={props.onBlur}\r\n error={props.error}\r\n onError={onError}\r\n fullWidth={props.fullWidth || true}\r\n helperText={props.helperText}\r\n disabled={props.disabled}\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n size={props.size}\r\n maxDateMessage={maxDateMessage}\r\n minDateMessage={minDateMessage}\r\n invalidDateMessage={invalidDateMessage}\r\n strictCompareDates={true}\r\n // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n // dateInputProps={props.dateInputProps}\r\n // timeInputProps={props.timeInputProps}\r\n autoFocus={true}\r\n ampm={useAmPm}\r\n minutesStep={props.minutesStep}\r\n {...other}\r\n />\r\n )}\r\n \r\n ) : (\r\n {\r\n if (dateVal !== null) {\r\n let error = validateDate(\r\n dateVal.getDate(),\r\n dateVal.getMonth(),\r\n dateVal.getFullYear(),\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: maxDateMessage,\r\n minDateMessage: minDateMessage,\r\n invalidDateMessage: invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n dateVal,\r\n );\r\n if (!!error) {\r\n onError(error, dateVal);\r\n } else {\r\n setDateValue(dateVal);\r\n if (saveOnSelect) {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n dateVal,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n } else {\r\n setDateValue(dateVal);\r\n if (saveOnSelect) {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n dateVal,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n }}\r\n />\r\n )}\r\n {((variant === 'time' && useTimeDropDowns) ||\r\n (variant === 'date' && useDateDropDowns)) && (\r\n
\r\n {variant === 'time' && useTimeDropDowns && (\r\n {\r\n setDateValue(val);\r\n if (withCompletion) {\r\n if (!validationError || validationError === '') {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n val,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n }}\r\n onBlur={props.onBlur}\r\n error={props.error}\r\n onError={onError}\r\n fullWidth={props.fullWidth || true}\r\n helperText={props.helperText}\r\n disabled={props.disabled}\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n size={props.size}\r\n maxDateMessage={maxDateMessage}\r\n minDateMessage={minDateMessage}\r\n invalidDateMessage={invalidDateMessage}\r\n // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n // dateInputProps={props.dateInputProps}\r\n // timeInputProps={props.timeInputProps}\r\n autoFocus={true}\r\n ampm={useAmPm}\r\n minutesStep={props.minutesStep}\r\n {...other}\r\n />\r\n )}\r\n {variant === 'date' && useDateDropDowns && (\r\n {\r\n setDateValue(val);\r\n if (withCompletion) {\r\n if (!validationError || validationError === '') {\r\n onChange(\r\n setInputViewDate(\r\n variant,\r\n val,\r\n endTime,\r\n truncateTime,\r\n ),\r\n );\r\n setOpen(false);\r\n onClose?.();\r\n }\r\n }\r\n }}\r\n onBlur={props.onBlur}\r\n error={props.error}\r\n onError={onError}\r\n fullWidth={props.fullWidth || true}\r\n helperText={props.helperText}\r\n disabled={props.disabled}\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n size={props.size}\r\n maxDateMessage={maxDateMessage}\r\n minDateMessage={minDateMessage}\r\n invalidDateMessage={invalidDateMessage}\r\n // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n // dateInputProps={props.dateInputProps}\r\n // timeInputProps={props.timeInputProps}\r\n autoFocus={true}\r\n {...other}\r\n />\r\n )}\r\n
\r\n )}\r\n\r\n
\r\n {\r\n if (!validationError || validationError === '') {\r\n handleSave();\r\n }\r\n }}\r\n >\r\n {t(translations.Save)}\r\n \r\n {\r\n handleClose();\r\n }}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n {(clearable || isMobile) && (\r\n {\r\n setDateValue(null);\r\n onChange(null);\r\n setOpen(false);\r\n onClose?.();\r\n }}\r\n >\r\n {t(translations.Clear)}\r\n \r\n )}\r\n
\r\n \r\n \r\n
\r\n )}\r\n \r\n
\r\n \r\n );\r\n}\r\n","import { RefObject } from 'react';\r\nimport useEventListener from './useEventListener';\r\n\r\ntype Handler = (event: KeyboardEvent) => void;\r\n\r\nexport function useKeyUpOutside(\r\n ref: RefObject,\r\n handler: Handler,\r\n keyboardEvent: 'keyup',\r\n key: string,\r\n): void {\r\n useEventListener(keyboardEvent, event => {\r\n if ((event as KeyboardEvent).key === key) {\r\n const el = ref?.current;\r\n\r\n // Do nothing if clicking ref's element or descendent elements\r\n if (!el || el.contains(event.target as Node)) {\r\n return;\r\n }\r\n\r\n handler(event);\r\n }\r\n });\r\n}\r\n","import * as log from 'loglevel';\r\nimport * as prefix from 'loglevel-plugin-prefix';\r\n\r\nlog.enableAll();\r\n\r\nprefix.apply(log, {\r\n template: '[%t] %l (%n):',\r\n levelFormatter(level) {\r\n return level.toUpperCase();\r\n },\r\n nameFormatter(name) {\r\n return name || 'global';\r\n },\r\n timestampFormatter(date) {\r\n return date.toISOString();\r\n },\r\n});\r\n\r\nlog.setLevel(process.env.NODE_ENV === 'development' ? 'DEBUG' : 'INFO');\r\nlog.info('%s prefix', 'template');\r\n\r\nexport const getLogger = log.getLogger;\r\n","import { PeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IDatesRange } from './IDatesRange';\r\n\r\nfunction createPeriod(\r\n now: Date,\r\n startFn: (d: Date) => Date,\r\n endFn: (d: Date) => Date,\r\n addFn: (d: Date, n: number) => Date,\r\n offset: number,\r\n): DatesRange {\r\n const d = addFn(now, offset);\r\n return new DatesRange({ start: startFn(d), end: endFn(d) });\r\n}\r\nexport class DatesRange implements IDatesRange {\r\n public start: Date | null = null;\r\n public end: Date | null = null;\r\n constructor(t?: IDatesRange) {\r\n this.start = t?.start ?? null;\r\n this.end = t?.end ?? null;\r\n }\r\n public static fromPreset(\r\n type: PeriodTypesEntity,\r\n st: Date | null,\r\n et: Date | null,\r\n ): { start: Date | null; end: Date | null } {\r\n const now = new Date();\r\n switch (type.Id) {\r\n case 'CustomDate':\r\n return { start: st, end: et };\r\n case 'ThisMonth':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfMonth,\r\n dateUtils.endOfMonth,\r\n dateUtils.addMonths,\r\n 0,\r\n );\r\n case 'LastMonth':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfMonth,\r\n dateUtils.endOfMonth,\r\n dateUtils.addMonths,\r\n -1,\r\n );\r\n case 'NextMonth':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfMonth,\r\n dateUtils.endOfMonth,\r\n dateUtils.addMonths,\r\n 1,\r\n );\r\n case 'ThisQuarter':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfQuarter,\r\n dateUtils.endOfQuarter,\r\n dateUtils.addQuarters,\r\n 0,\r\n );\r\n case 'LastQuarter':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfQuarter,\r\n dateUtils.endOfQuarter,\r\n dateUtils.addQuarters,\r\n -1,\r\n );\r\n case 'NextQuarter':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfQuarter,\r\n dateUtils.endOfQuarter,\r\n dateUtils.addQuarters,\r\n 1,\r\n );\r\n case 'ThisWeek':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfWeek,\r\n dateUtils.endOfWeek,\r\n dateUtils.addWeeks,\r\n 0,\r\n );\r\n case 'LastWeek':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfWeek,\r\n dateUtils.endOfWeek,\r\n dateUtils.addWeeks,\r\n -1,\r\n );\r\n case 'NextWeek':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfWeek,\r\n dateUtils.endOfWeek,\r\n dateUtils.addWeeks,\r\n 1,\r\n );\r\n case 'ThisYear':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfYear,\r\n dateUtils.endOfYear,\r\n dateUtils.addYears,\r\n 0,\r\n );\r\n case 'LastYear':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfYear,\r\n dateUtils.endOfYear,\r\n dateUtils.addYears,\r\n -1,\r\n );\r\n case 'NextYear':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfYear,\r\n dateUtils.endOfYear,\r\n dateUtils.addYears,\r\n 1,\r\n );\r\n case 'Today':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfDay,\r\n dateUtils.endOfDay,\r\n dateUtils.addDays,\r\n 0,\r\n );\r\n case 'TodayTomorrow':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfDay,\r\n dateUtils.endOfTomorrow,\r\n dateUtils.addDays,\r\n 0,\r\n );\r\n case 'Tomorrow':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfDay,\r\n dateUtils.endOfDay,\r\n dateUtils.addDays,\r\n 1,\r\n );\r\n case 'Yesterday':\r\n return createPeriod(\r\n now,\r\n dateUtils.startOfDay,\r\n dateUtils.endOfDay,\r\n dateUtils.addDays,\r\n -1,\r\n );\r\n default:\r\n assertExhaustive(type.Id);\r\n }\r\n }\r\n}\r\n","import { useAppSettingsSlice } from 'app/slice';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { useIsMobile } from './useIsMobile';\r\ninterface ExpandedType {\r\n expand: (value: boolean) => void;\r\n expandLocal: (value: boolean) => void;\r\n toggle: () => void;\r\n}\r\nexport function userProfileComparer(\r\n prev: readonly [UserProfile],\r\n next: readonly [UserProfile],\r\n) {\r\n if (!!prev[0] && !!prev[0].savedSettings) {\r\n if (prev[0].savedSettings.length === next[0].savedSettings.length) {\r\n let prevExpanded = prev[0].GetSideBarExpanded('SideBarExpanded');\r\n let nextExpanded = next[0].GetSideBarExpanded('SideBarExpanded');\r\n if (prevExpanded !== nextExpanded) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction useExpandedSideBarState(defaultValue?: boolean): ExpandedType {\r\n const { checkIsMobile } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const isExpanded = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n //const userProfileSett = useSelector(selectUserProfileSettings);\r\n // const [expanded, setExpanded] = React.useState(\r\n // !!defaultValue ? defaultValue : isExpanded,\r\n // );\r\n // const [lastExpandedTime, setLastExpandedTime] = React.useState<\r\n // number | undefined\r\n // >(undefined);\r\n // const userProfileSettCompared = useCustomCompareMemo(\r\n // () => {\r\n // return userProfileSett;\r\n // },\r\n // [userProfileSett],\r\n // userProfileComparer,\r\n // );\r\n // const userProfExpanded = React.useMemo(() => {\r\n // return userProfileSettCompared?.GetSideBarExpanded('SideBarExpanded');\r\n // }, [userProfileSettCompared]);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n // useEffectOnMount(() => {\r\n // let defaultval = isMobile\r\n // ? !!defaultValue\r\n // ? defaultValue\r\n // : isExpanded\r\n // : userProfExpanded ?? true;\r\n // dispatch(actions.updateExpandedState_Local(defaultval));\r\n // // if (isMobile) {\r\n // // setExpanded(isExpanded);\r\n // // } else {\r\n // // setExpanded(userProfExpanded ?? true);\r\n // // }\r\n // });\r\n // React.useEffect(() => {\r\n // if (isMobile) {\r\n // setExpanded(isExpanded);\r\n // } else {\r\n // setExpanded(userProfExpanded ?? true);\r\n // }\r\n // }, [isExpanded, isMobile, userProfExpanded]);\r\n\r\n const expand = React.useCallback(\r\n (value: boolean) => {\r\n dispatch(actions.updateExpandedState_Local(value));\r\n if (!isMobile) {\r\n dispatch(actions.updateExpandedState(value));\r\n }\r\n // if (value === true) {\r\n // setLastExpandedTime(new Date().getTime());\r\n // }\r\n },\r\n [actions, dispatch, isMobile],\r\n );\r\n const expandLocal = React.useCallback(\r\n (value: boolean) => {\r\n dispatch(actions.updateExpandedState_Local(value));\r\n // if (value === true) {\r\n // setLastExpandedTime(new Date().getTime());\r\n // }\r\n },\r\n [actions, dispatch],\r\n );\r\n const toggle = React.useCallback(() => {\r\n dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n if (!isMobile) {\r\n dispatch(actions.updateExpandedState(!isExpanded));\r\n }\r\n // if (!lastExpandedTime) {\r\n // dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n // if (!isMobile) {\r\n // dispatch(actions.updateExpandedState(!isExpanded));\r\n // }\r\n // if (isExpanded === true) {\r\n // setLastExpandedTime(new Date().getTime());\r\n // }\r\n // } else {\r\n // if (!!lastExpandedTime && new Date().getTime() - lastExpandedTime > 500) {\r\n // dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n // if (!isMobile) {\r\n // dispatch(actions.updateExpandedState(!isExpanded));\r\n // }\r\n // }\r\n // }\r\n }, [actions, dispatch, isExpanded, isMobile]);\r\n\r\n return { expand, expandLocal, toggle };\r\n}\r\n\r\nexport default useExpandedSideBarState;\r\n","/* eslint-disable prettier/prettier */\r\nimport { RowActionsProps } from 'app/components/BasicTable/RowActions';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { isEmptyOrWhitespace, toLowerCaseSafely } from 'utils/typeUtils';\r\nimport {\r\n AuthenticatedUser,\r\n IAuthenticatedUser,\r\n isInRole,\r\n} from './AuthenticatedUser';\r\n\r\nexport interface SiteMapSettings {\r\n userNodes: SiteMapNode[];\r\n rootNode: SiteMapNode;\r\n}\r\nexport enum MainTabs {\r\n Dashboard = 1,\r\n Cores = 2,\r\n Assets = 3,\r\n RoomMap = 4,\r\n Reservations = 5,\r\n Trainings = 6,\r\n Consumables = 7,\r\n Samples = 8,\r\n WorkOrders = 9,\r\n LoanDesk = 10,\r\n Eln = 11,\r\n Colonies = 12,\r\n Budgets = 13,\r\n Billing = 14,\r\n Messages = 15,\r\n Users = 16,\r\n Suppliers = 17,\r\n Expenses = 18,\r\n LargeAnimals = 19,\r\n Reports = 20,\r\n SystemSettings = 21,\r\n}\r\nexport type MainTabsUnion = keyof typeof MainTabs;\r\nexport const MainTabsUnionArray: Array = [\r\n 'Dashboard',\r\n 'Cores',\r\n 'Assets',\r\n 'RoomMap',\r\n 'Reservations',\r\n 'Trainings',\r\n 'Consumables',\r\n 'Samples',\r\n 'WorkOrders',\r\n 'LoanDesk',\r\n 'Eln',\r\n 'Colonies',\r\n 'Budgets',\r\n 'Billing',\r\n 'Messages',\r\n 'Users',\r\n 'Suppliers',\r\n 'Expenses',\r\n 'LargeAnimals',\r\n 'Reports',\r\n 'SystemSettings',\r\n];\r\nexport enum AssetsSubTab {\r\n AssetsTabSetting = 1,\r\n InstrumentsTabSettings = 2,\r\n LocationsTabSettings = 3,\r\n}\r\nexport type AssetsSubTabUnion = keyof typeof AssetsSubTab;\r\nexport const AssetsSubTabUnionArray: Array = [\r\n 'AssetsTabSetting',\r\n 'InstrumentsTabSettings',\r\n 'LocationsTabSettings',\r\n];\r\nexport interface SiteMapNode {\r\n Roles?: string[];\r\n HasChildNodes: boolean;\r\n Key?: string;\r\n ResourceKey?: string;\r\n Title: string;\r\n Description?: string;\r\n RootNode: SiteMapNode | null;\r\n Url: string;\r\n ChildNodes: SiteMapNode[];\r\n icon?: string;\r\n reactUrl: string;\r\n HideReact: boolean;\r\n isAdminNode: boolean;\r\n ParentNode: SiteMapNode | null;\r\n Hide: boolean;\r\n LinkWithChildren?: string | null;\r\n MainTab?: string;\r\n SubTab?: string;\r\n IsAdminSettings?: boolean;\r\n GroupTab?: number;\r\n IsLastTab?: boolean;\r\n}\r\nexport const NoAuthNodes = (t: TFunction): SiteMapNode[] => {\r\n return [\r\n {\r\n Roles: [],\r\n HasChildNodes: false,\r\n Key: undefined,\r\n ResourceKey: undefined,\r\n Title: t(translations.reg_NewUserRegistration) as string,\r\n Description: undefined,\r\n RootNode: null,\r\n Url: '/RegisterAccount',\r\n ChildNodes: [],\r\n icon: undefined,\r\n reactUrl: '/RegisterAccount',\r\n HideReact: false,\r\n isAdminNode: false,\r\n ParentNode: null,\r\n Hide: false,\r\n MainTab: undefined,\r\n SubTab: undefined,\r\n IsAdminSettings: false,\r\n GroupTab: undefined,\r\n },\r\n {\r\n Roles: [],\r\n HasChildNodes: false,\r\n Key: undefined,\r\n ResourceKey: undefined,\r\n Title: t(translations.reg_NewUserRegistration) as string,\r\n Description: undefined,\r\n RootNode: null,\r\n Url: '/Assets/Public',\r\n ChildNodes: [],\r\n icon: undefined,\r\n reactUrl: '/Assets/Public',\r\n HideReact: false,\r\n isAdminNode: false,\r\n ParentNode: null,\r\n Hide: false,\r\n MainTab: undefined,\r\n SubTab: undefined,\r\n IsAdminSettings: false,\r\n GroupTab: undefined,\r\n },\r\n {\r\n Roles: [],\r\n HasChildNodes: false,\r\n Key: undefined,\r\n ResourceKey: undefined,\r\n Title: t(translations.reg_NewUserRegistration) as string,\r\n Description: undefined,\r\n RootNode: null,\r\n Url: '/Assets/Details',\r\n ChildNodes: [],\r\n icon: undefined,\r\n reactUrl: '/Assets/Details',\r\n HideReact: false,\r\n isAdminNode: false,\r\n ParentNode: null,\r\n Hide: false,\r\n MainTab: undefined,\r\n SubTab: undefined,\r\n IsAdminSettings: false,\r\n GroupTab: undefined,\r\n },\r\n ] as SiteMapNode[];\r\n};\r\n\r\nexport class SiteMapProvider {\r\n settings: SiteMapSettings | null;\r\n constructor(sett: SiteMapSettings | null) {\r\n this.settings = sett;\r\n }\r\n // public getAdminNodes(): SiteMapNode[] {\r\n // if (\r\n // !!this.settings &&\r\n // this.settings !== null &&\r\n // !!this.settings.adminNodes\r\n // ) {\r\n // //console.log('adminNodes', this.settings.adminNodes);\r\n // return this.settings.adminNodes;\r\n // } else {\r\n // //console.log('empty admin nodes');\r\n // return [] as SiteMapNode[];\r\n // }\r\n // }\r\n public getUserNodes(): SiteMapNode[] {\r\n if (\r\n !!this.settings &&\r\n this.settings !== null &&\r\n !!this.settings.userNodes\r\n ) {\r\n //console.log('userNodes', this.settings.userNodes);\r\n return this.settings.userNodes;\r\n } else {\r\n //console.log('empty user nodes');\r\n return [] as SiteMapNode[];\r\n }\r\n }\r\n public getCurrentMainNode(pathname: string): SiteMapNode | undefined {\r\n let node: SiteMapNode[] | undefined = undefined;\r\n let searchItem = pathname;\r\n if (!!this.settings && this.settings != null) {\r\n node = this.settings.userNodes\r\n .filter(f => f.Hide === false)\r\n .filter((item, index) => {\r\n if (item.ChildNodes.length > 0) {\r\n let irurl = toLowerCaseSafely(item.reactUrl);\r\n\r\n return (\r\n item.ChildNodes.filter(chitem => {\r\n let rurl = toLowerCaseSafely(chitem.reactUrl);\r\n if (rurl !== null) {\r\n let rpath = rurl.split('?')[0] ?? rurl;\r\n return searchItem.toLowerCase().indexOf(rpath) > -1;\r\n } else {\r\n return chitem.Url.toLowerCase().indexOf(searchItem) > -1;\r\n }\r\n }).length > 0 ||\r\n (irurl !== null\r\n ? searchItem\r\n .toLowerCase()\r\n .indexOf(irurl.split('?')[0] ?? irurl) > -1\r\n : item.Url.toLowerCase().indexOf(searchItem) > -1) === true\r\n );\r\n } else {\r\n let irurl = toLowerCaseSafely(item.reactUrl);\r\n let prurl =\r\n item.ParentNode !== null\r\n ? toLowerCaseSafely(item.ParentNode.reactUrl)\r\n : null;\r\n let purl = item.ParentNode !== null ? item.ParentNode.Url : null;\r\n return (\r\n (irurl !== null\r\n ? searchItem\r\n .toLowerCase()\r\n .indexOf(irurl.split('?')[0] ?? irurl) > -1\r\n : item.Url.toLowerCase().indexOf(searchItem) > -1) === true ||\r\n (item.ParentNode !== null && prurl !== null\r\n ? searchItem\r\n .toLowerCase()\r\n .indexOf(prurl.split('?')[0] ?? prurl) > -1\r\n : purl !== null\r\n ? purl.toLowerCase().indexOf(searchItem) > -1\r\n : false)\r\n );\r\n }\r\n });\r\n }\r\n // There may be multiple results.\r\n // This happens when the react page is selected.\r\n // It is necessary to choose the result whose reactUrl length is longer.\r\n if (node !== undefined && node.length > 0) {\r\n let res: SiteMapNode | undefined = node[0];\r\n if (node.length > 1) {\r\n var rurl = '';\r\n node.forEach(item => {\r\n item.ChildNodes.forEach(chitem => {\r\n let rurl1 = toLowerCaseSafely(chitem.reactUrl);\r\n if (rurl1 !== null) {\r\n let rpath = rurl1.split('?')[0] ?? rurl1;\r\n if (searchItem.toLowerCase().indexOf(rpath) > -1) {\r\n if (rpath.length > rurl.length) {\r\n res = item;\r\n rurl = rpath;\r\n }\r\n }\r\n }\r\n });\r\n });\r\n }\r\n //console.log('getCurrentNode', node);\r\n return res;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n public currentMainNodeIsAdmin(pathname: string): boolean | undefined {\r\n let isAdmin = this.getCurrentMainNode(pathname)?.isAdminNode;\r\n //console.log('isAdmin', isAdmin);\r\n return isAdmin;\r\n }\r\n public getCurrentNodes(pathname: string): SiteMapNode[] {\r\n return this.getUserNodes().filter(f => f.Hide === false);\r\n // let isAdmin = this.currentMainNodeIsAdmin(pathname);\r\n // if (isAdmin) {\r\n // return this.getAdminNodes().filter(f => f.Hide === false);\r\n // } else {\r\n // return this.getUserNodes().filter(f => f.Hide === false);\r\n // }\r\n }\r\n public findNode(pathname: string): SiteMapNode | undefined {\r\n let node: SiteMapNode | undefined = undefined;\r\n if (!!this.settings && this.settings != null) {\r\n let parentNodes = this.settings.userNodes;\r\n let childNodes = this.settings.userNodes.map(f => f.ChildNodes).flat();\r\n const currentPathNameLowered = pathname.toLowerCase();\r\n // first try exact match node\r\n node = childNodes.find(element => {\r\n const elementURL = element.reactUrl ?? element.Url;\r\n const [elementPathName] = elementURL.split('?');\r\n return currentPathNameLowered === elementPathName?.toLowerCase();\r\n });\r\n // then if no exact match was found - try the indexOf for whatever reason it was done originally\r\n if (!node) {\r\n childNodes.find(element => {\r\n if (element !== undefined) {\r\n const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n\r\n if (reactUrl !== null) {\r\n let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n //return pathname.toLowerCase() === rpath;\r\n return pathname.toLowerCase().indexOf(rpath) > -1;\r\n } else {\r\n return (\r\n element.Url.toLowerCase().indexOf(pathname.toLowerCase()) > -1\r\n );\r\n }\r\n }\r\n return undefined;\r\n });\r\n }\r\n if (!node) {\r\n node = parentNodes.find(element => {\r\n if (element !== undefined) {\r\n const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n if (reactUrl !== null) {\r\n let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n //return pathname.toLowerCase() === rpath;\r\n return pathname.toLowerCase().indexOf(rpath) > -1;\r\n } else {\r\n return (\r\n element.Url.toLowerCase().indexOf(pathname.toLowerCase()) > -1\r\n );\r\n }\r\n }\r\n return undefined;\r\n });\r\n }\r\n }\r\n return node;\r\n }\r\n public updatePath(pathname: string | undefined, newSearch: string) {\r\n if (!!this.settings && this.settings != null && pathname) {\r\n this.getCurrentNodes(pathname)\r\n .map(f => f.ChildNodes)\r\n .flat()\r\n .forEach(element => {\r\n if (element !== undefined) {\r\n const reactUrl = element.reactUrl;\r\n if (reactUrl !== undefined && reactUrl !== null) {\r\n const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n if (elementPath === pathname) {\r\n element.reactUrl = `${pathname}?${newSearch}`;\r\n element.Url = `${pathname}?${newSearch}`;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n public accesibleByRole(pathname: string, user?: IAuthenticatedUser): boolean {\r\n if (user) {\r\n let currentNode = this.findNode(pathname);\r\n if (currentNode) {\r\n if (currentNode.Roles && currentNode.Roles.length > 0) {\r\n return (\r\n currentNode.Roles.filter(item => isInRole(user, item)).length > 0\r\n );\r\n } else if (\r\n currentNode.ParentNode !== null &&\r\n currentNode.ParentNode.Roles &&\r\n currentNode.ParentNode.Roles.length > 0\r\n ) {\r\n return (\r\n currentNode.ParentNode.Roles.filter(item => isInRole(user, item))\r\n .length > 0\r\n );\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n public nodeAccesibleByRole(\r\n node: SiteMapNode,\r\n user?: AuthenticatedUser,\r\n ): boolean {\r\n if (user) {\r\n if (node) {\r\n if (node.Roles && node.Roles.length > 0) {\r\n if(user?.Roles.includes(Roles.CustomRole) && node.Roles.filter(item => isInRole(user, item)).length > 0){\r\n return user?.HasCustomRoleUrlPermission(node.Url);\r\n }\r\n return node.Roles.filter(item => isInRole(user, item)).length > 0;\r\n } else if (\r\n node.ParentNode !== null &&\r\n node.ParentNode.Roles &&\r\n node.ParentNode.Roles.length > 0\r\n ) {\r\n if(user?.Roles.includes(Roles.CustomRole) && node.ParentNode.Roles.filter(item => isInRole(user, item)).length > 0){\r\n return user?.HasCustomRoleUrlPermission(node.ParentNode.Url);\r\n }\r\n return (\r\n node.ParentNode.Roles.filter(item => isInRole(user, item)).length > 0\r\n );\r\n } else {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n public findMainTabNode(menuTab: MainTabsUnion) {\r\n let filtered = this.getUserNodes().filter(\r\n f => f.Hide === false && !!f.MainTab && f.MainTab === menuTab,\r\n );\r\n if (!!filtered && filtered.length > 0) {\r\n return filtered[0];\r\n }\r\n return undefined;\r\n }\r\n public adminSettingsNodes(node: SiteMapNode, user?: AuthenticatedUser) {\r\n let result: SiteMapNode[] = [];\r\n const isAdmin =\r\n isInRole(user, Roles.Administrators) ||\r\n isInRole(user, Roles.GroupAdministrators) ||\r\n isInRole(user, Roles.EquipmentAdministrator) ||\r\n isInRole(user, Roles.CustomRole);\r\n if (\r\n isAdmin &&\r\n node.ChildNodes.length > 0 &&\r\n !!node.MainTab &&\r\n node.ChildNodes.some(f => f.IsAdminSettings)\r\n ) {\r\n let filtered = node.ChildNodes.filter(\r\n f => f.IsAdminSettings && this.nodeAccesibleByRole(f, user),\r\n ).map((it, index) => {\r\n return it;\r\n });\r\n return filtered;\r\n }\r\n return result;\r\n }\r\n public adminSettingsActions(\r\n menuTab: MainTabsUnion,\r\n user?: AuthenticatedUser,\r\n subTab?: any,\r\n action?: (link: string) => void,\r\n ) {\r\n let result: RowActionsProps[] = [];\r\n const isAdmin =\r\n isInRole(user, Roles.Administrators) ||\r\n isInRole(user, Roles.GroupAdministrators) ||\r\n isInRole(user, Roles.EquipmentAdministrator) ||\r\n isInRole(user, Roles.CustomRole);\r\n let node = this.findMainTabNode(menuTab);\r\n if (\r\n isAdmin &&\r\n !!node &&\r\n node.ChildNodes.length > 0 &&\r\n !!node.MainTab &&\r\n node.ChildNodes.some(f => f.IsAdminSettings)\r\n ) {\r\n let filtered = node.ChildNodes.filter(\r\n f =>\r\n f.IsAdminSettings &&\r\n this.nodeAccesibleByRole(f, user) &&\r\n (!subTab || (!isEmptyOrWhitespace(subTab) && subTab === f.SubTab)),\r\n ).map((it, index) => {\r\n return it;\r\n });\r\n if (!!filtered && filtered.length > 0) {\r\n let subTabTitle =\r\n filtered.filter(f => !!f.SubTab).length > 0\r\n ? filtered.filter(f => !!f.SubTab)[0].SubTab\r\n : 'Settings';\r\n result.push({\r\n localizedText: subTabTitle === 'Settings' ? undefined : subTabTitle,\r\n text: subTabTitle === 'Settings' ? subTabTitle : '',\r\n icon: 'circle',\r\n renderAsTitle: true,\r\n });\r\n filtered.forEach((item, index) => {\r\n result.push({\r\n href:\r\n !action && isEmptyOrWhitespace(item.reactUrl)\r\n ? item.Url\r\n : undefined,\r\n to: !isEmptyOrWhitespace(item.reactUrl) ? item.reactUrl : undefined,\r\n text: item.Title,\r\n icon: 'circle-small',\r\n onClick:\r\n !!action && isEmptyOrWhitespace(item.reactUrl)\r\n ? () => action(item.Url)\r\n : undefined,\r\n } as RowActionsProps);\r\n });\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n","import { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport {\r\n RepeatMonthlyBy,\r\n RepeatPeriod,\r\n RepetitiveOptions,\r\n} from 'enums/RepetitiveOptions';\r\nimport { WorkWeekDays } from 'enums/WorkWeekDays';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { Entity } from './common';\r\nimport { Timestamp } from './Timestamp';\r\n\r\nexport interface IRepetitiveDto {\r\n StartDate?: Date | string;\r\n RecurringEvents?: Entity | null;\r\n RecurringEndDate?: Date | string;\r\n RepeatsEveryDay?: Entity | null;\r\n RepeatsEveryPeriod?: Entity | null;\r\n RepeatsMonthlyBy?: Entity | null;\r\n RepeatsOnDays: CheckEntity[];\r\n}\r\nexport interface RepetitiveIntervals {\r\n start: Date;\r\n end: Date;\r\n}\r\nexport const ShortWeekDays = (): CheckEntity[] => {\r\n return dateUtils.getShortDaysArray().map((day, index) => {\r\n return {\r\n Id: index + 1,\r\n Name: day,\r\n checked: false,\r\n } as CheckEntity;\r\n });\r\n};\r\nexport const LongWeekDays = (): CheckEntity[] => {\r\n return dateUtils.getLongDaysArray().map((day, index) => {\r\n return {\r\n Id: index + 1,\r\n Name: day,\r\n checked: false,\r\n } as CheckEntity;\r\n });\r\n};\r\nexport const RepetitiveInit = (\r\n date?: Date | string,\r\n option?: number,\r\n): IRepetitiveDto => {\r\n const startDate = dateUtils.dateOrStringToDate(date || new Date());\r\n const untilDate = dateUtils.dateFnsUtils.addDays(startDate, 7);\r\n return {\r\n StartDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(startDate)),\r\n RecurringEvents: enumToEntityArray(RepetitiveOptions)[option ?? 0],\r\n RepeatsOnDays: ShortWeekDays().map(f => {\r\n if (f.Id === 1) f.checked = true;\r\n return f;\r\n }),\r\n RecurringEndDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(untilDate),\r\n ),\r\n RepeatsEveryDay: { Id: 1, Name: '1' } as Entity,\r\n RepeatsEveryPeriod: enumToEntityArray(RepeatPeriod)[1],\r\n RepeatsMonthlyBy: enumToEntityArray(RepeatMonthlyBy)[0],\r\n };\r\n};\r\nexport const GetAutoCreateTitle = (\r\n type: IWorkOrderTypeDto,\r\n eventStart: Date | Timestamp | null,\r\n firstDayOfWeek: WeekStartsOn,\r\n): string | undefined => {\r\n let title: string | undefined = undefined;\r\n if (type.AutoCreateEvent && type.AutoCreateFor !== 0) {\r\n if (type.RepetitiveOptions > 0) {\r\n switch (type.RepetitiveOptions) {\r\n case RepetitiveOptions.RepeatCustom:\r\n let periodName = enumToEntityArray(RepeatPeriod).filter(\r\n f => f.Id === type.RepeatsEveryType,\r\n )[0].Name;\r\n if (type.RepeatsEveryType === RepeatPeriod.Days) {\r\n title = `Repeats every ${type.RepeatsEveryNum} - ${periodName}`;\r\n } else if (type.RepeatsEveryType === RepeatPeriod.Weeks) {\r\n title = `Repeats every ${type.RepeatsEveryNum} - ${periodName} on ${\r\n LongWeekDays().filter(f => f.Id.toString() === type.RepeatsOn)[0]\r\n .Name\r\n }`;\r\n } else {\r\n title = `Repeats every ${type.RepeatsEveryNum} - ${periodName} by ${\r\n enumToEntityArray(RepeatMonthlyBy).filter(\r\n f => f.Id === type.RepeatsBy,\r\n )[0].Name\r\n }`;\r\n }\r\n break;\r\n case RepetitiveOptions.RepeatDaily:\r\n title = 'Repeats Daily';\r\n break;\r\n case RepetitiveOptions.RepeatWeeklyOn:\r\n title = `Repeats ${i18next\r\n .t(translations.RepeatWeeklyOn)\r\n .replace(\r\n '{0}',\r\n dateUtils.getDayText(\r\n dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n ),\r\n )}`;\r\n break;\r\n case RepetitiveOptions.RepeatMonthlyOn:\r\n let weekName = i18next.t(\r\n enumToEntityArray(WorkWeekDays).filter(\r\n f =>\r\n dateUtils.getWeekNumberOfMonth(\r\n dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n firstDayOfWeek,\r\n ) === f.Id,\r\n )[0].Name,\r\n );\r\n title = `Repeats ${i18next\r\n .t(translations.RepeatMonthlyOn)\r\n .replace('{0}', weekName)\r\n .replace(\r\n '{1}',\r\n dateUtils.getDayText(\r\n dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n ),\r\n )}`;\r\n break;\r\n case RepetitiveOptions.RepeatEveryWeekDay:\r\n let weekDays = `${\r\n dateUtils.getLongDaysArray()[firstDayOfWeek as number]\r\n } - ${\r\n dateUtils.getLongDaysArray()[\r\n dateUtils.getLongDaysArray().length - 2\r\n ]\r\n }`;\r\n title = `Repeats ${i18next\r\n .t(translations.RepeatEveryWeekDay)\r\n .replace('{0}', weekDays)}`;\r\n break;\r\n }\r\n }\r\n }\r\n return title;\r\n};\r\nexport const GetIntervals = (\r\n start: Date,\r\n data: IRepetitiveDto,\r\n firstDayOfWeek?: number,\r\n): Date[] => {\r\n let dates: Date[] = [];\r\n if (start && data.RecurringEndDate) {\r\n let originStart = dateUtils.dateOrStringToDate(start);\r\n let originalEnd = dateUtils.dateOrStringToDate(data.RecurringEndDate);\r\n if (data.RecurringEvents && data.RecurringEvents !== null) {\r\n if (\r\n data.RecurringEvents.Id !== (RepetitiveOptions.DoNotRepeat as number)\r\n ) {\r\n switch (data.RecurringEvents.Id) {\r\n case RepetitiveOptions.RepeatDaily as number:\r\n let days = dateUtils.differenceInCalendarDays(\r\n originalEnd,\r\n originStart,\r\n );\r\n dates = [...Array(days + 1).keys()].map(i =>\r\n dateUtils.addDays(originStart, i),\r\n );\r\n break;\r\n case RepetitiveOptions.RepeatWeeklyOn as number:\r\n dates.push(originStart);\r\n let nextWeek = dateUtils.addWeeks(originStart, 1);\r\n while (nextWeek < originalEnd) {\r\n dates.push(nextWeek);\r\n nextWeek = dateUtils.addWeeks(nextWeek, 1);\r\n }\r\n break;\r\n case RepetitiveOptions.RepeatMonthlyOn as number:\r\n // let week = dateUtils.getWeekNumberOfMonth(\r\n // originStart,\r\n // firstDayOfWeek,\r\n // );\r\n dates.push(originStart);\r\n let dayWeek = dateUtils.getDay(originStart);\r\n let newMonthDate = dateUtils.addMonths(originStart, 1);\r\n let newDayWeek = dateUtils.getDay(newMonthDate);\r\n let calcDay =\r\n dayWeek >= newDayWeek\r\n ? dayWeek - newDayWeek\r\n : 7 - (newDayWeek - dayWeek);\r\n let checkDate = dateUtils.addDays(newMonthDate, calcDay);\r\n if (checkDate.getMonth() > newMonthDate.getMonth()) {\r\n newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n } else if (checkDate.getMonth() === newMonthDate.getMonth()) {\r\n if (\r\n checkDate.getDate() > newMonthDate.getDate() &&\r\n (dateUtils.addDays(newMonthDate, calcDay - 7).getFullYear() ===\r\n checkDate.getFullYear()\r\n ? !(\r\n dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n checkDate.getMonth()\r\n )\r\n : dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n checkDate.getMonth())\r\n ) {\r\n newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n } else {\r\n newMonthDate = checkDate;\r\n }\r\n } else {\r\n newMonthDate = checkDate;\r\n }\r\n //newMonth = dateUtils.setWeek(newMonth, week, firstDayOfWeek);\r\n //newMonth = dateUtils.setDay(newMonth, dayWeek, firstDayOfWeek);\r\n let counter = 1;\r\n while (newMonthDate <= originalEnd) {\r\n dates.push(newMonthDate);\r\n counter++;\r\n newMonthDate = dateUtils.addMonths(originStart, counter);\r\n let newDayWeek = dateUtils.getDay(newMonthDate);\r\n let calcDay =\r\n dayWeek >= newDayWeek\r\n ? dayWeek - newDayWeek\r\n : 7 - (newDayWeek - dayWeek);\r\n let checkDate = dateUtils.addDays(newMonthDate, calcDay);\r\n if (checkDate.getMonth() > newMonthDate.getMonth()) {\r\n newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n } else if (checkDate.getMonth() === newMonthDate.getMonth()) {\r\n if (\r\n checkDate.getDate() > newMonthDate.getDate() &&\r\n (dateUtils\r\n .addDays(newMonthDate, calcDay - 7)\r\n .getFullYear() === checkDate.getFullYear()\r\n ? !(\r\n dateUtils\r\n .addDays(newMonthDate, calcDay - 7)\r\n .getMonth() < checkDate.getMonth()\r\n )\r\n : dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n checkDate.getMonth())\r\n ) {\r\n newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n } else {\r\n newMonthDate = checkDate;\r\n }\r\n } else {\r\n newMonthDate = checkDate;\r\n }\r\n }\r\n break;\r\n case RepetitiveOptions.RepeatEveryWeekDay as number:\r\n dates.push(originStart);\r\n let theDay = dateUtils.getDay(originStart);\r\n let firstDay = dateUtils.getDay(\r\n dateUtils.startOfWeek(originStart, firstDayOfWeek),\r\n );\r\n let lastDay = firstDay + 4;\r\n\r\n let day =\r\n (theDay > firstDay && theDay < lastDay) || theDay === firstDay\r\n ? 1\r\n : 3;\r\n let newDay = dateUtils.addDays(originStart, day);\r\n while (newDay <= originalEnd) {\r\n dates.push(newDay);\r\n let theDay = dateUtils.getDay(newDay);\r\n let day =\r\n (theDay > firstDay && theDay < lastDay) || theDay === firstDay\r\n ? 1\r\n : 3;\r\n newDay = dateUtils.addDays(newDay, day);\r\n }\r\n break;\r\n case RepetitiveOptions.RepeatCustom as number:\r\n if (\r\n data.RepeatsEveryDay !== null &&\r\n data.RepeatsEveryPeriod !== null\r\n ) {\r\n let period =\r\n (data.RepeatsEveryPeriod?.Id as RepeatPeriod) ||\r\n RepeatPeriod.Weeks;\r\n let everyDayNum = data.RepeatsEveryDay?.Id || 1;\r\n switch (period) {\r\n case RepeatPeriod.Days:\r\n dates.push(originStart);\r\n let newDay = dateUtils.addDays(originStart, everyDayNum);\r\n while (newDay <= originalEnd) {\r\n dates.push(newDay);\r\n newDay = dateUtils.addDays(newDay, everyDayNum);\r\n }\r\n break;\r\n case RepeatPeriod.Weeks:\r\n dates.push(originStart);\r\n let days = data.RepeatsOnDays.filter(f => f.checked === true)\r\n .map(m => m.Id - 1)\r\n .sort((a, b) => a - b);\r\n let theDay = dateUtils.getDay(originStart);\r\n let nextDay =\r\n days.filter(f => f > theDay).length > 0\r\n ? days.filter(f => f > theDay)[0]\r\n : days[0];\r\n let daysToAdd =\r\n nextDay >= theDay\r\n ? nextDay - theDay === 0\r\n ? 7 * everyDayNum\r\n : nextDay - theDay\r\n : 7 * everyDayNum - (theDay - nextDay);\r\n\r\n let newDayDate = dateUtils.addDays(originStart, daysToAdd);\r\n while (newDayDate <= originalEnd) {\r\n dates.push(newDayDate);\r\n let mtheDay = dateUtils.getDay(newDayDate);\r\n let mnextDay =\r\n days.filter(f => f > mtheDay).length > 0\r\n ? days.filter(f => f > mtheDay)[0]\r\n : days[0];\r\n let mdaysToAdd =\r\n mnextDay >= mtheDay\r\n ? mnextDay - mtheDay === 0\r\n ? 7 * everyDayNum\r\n : mnextDay - mtheDay\r\n : 7 * everyDayNum - (mtheDay - mnextDay);\r\n\r\n newDayDate = dateUtils.addDays(newDayDate, mdaysToAdd);\r\n }\r\n break;\r\n case RepeatPeriod.Months:\r\n let monthlyBy =\r\n (data.RepeatsMonthlyBy?.Id as RepeatMonthlyBy) ||\r\n RepeatMonthlyBy.RepeatsBy_DayOfMonth;\r\n switch (monthlyBy) {\r\n case RepeatMonthlyBy.RepeatsBy_DayOfMonth:\r\n dates.push(originStart);\r\n let monthDay = dateUtils.getDate(originStart);\r\n let newMonthDate = dateUtils.addMonths(\r\n originStart,\r\n everyDayNum,\r\n );\r\n dateUtils.setDate(newMonthDate, monthDay);\r\n while (newMonthDate <= originalEnd) {\r\n dates.push(newMonthDate);\r\n newMonthDate = dateUtils.addMonths(\r\n newMonthDate,\r\n everyDayNum,\r\n );\r\n dateUtils.setDate(newMonthDate, monthDay);\r\n }\r\n break;\r\n case RepeatMonthlyBy.RepeatsBy_DayOfWeek:\r\n dates.push(originStart);\r\n let dayWeek = dateUtils.getDay(originStart);\r\n let newMonth = dateUtils.addMonths(\r\n originStart,\r\n everyDayNum,\r\n );\r\n let newDayWeek = dateUtils.getDay(newMonth);\r\n let calcDay =\r\n dayWeek >= newDayWeek\r\n ? dayWeek - newDayWeek\r\n : 7 - (newDayWeek - dayWeek);\r\n let checkDate = dateUtils.addDays(newMonth, calcDay);\r\n if (checkDate.getMonth() > newMonth.getMonth()) {\r\n newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n } else if (checkDate.getMonth() === newMonth.getMonth()) {\r\n if (\r\n checkDate.getDate() > newMonth.getDate() &&\r\n (dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getFullYear() === checkDate.getFullYear()\r\n ? !(\r\n dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getMonth() < checkDate.getMonth()\r\n )\r\n : dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getMonth() < checkDate.getMonth())\r\n ) {\r\n newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n } else {\r\n newMonth = checkDate;\r\n }\r\n } else {\r\n newMonth = checkDate;\r\n }\r\n let counter = everyDayNum;\r\n while (newMonth <= originalEnd) {\r\n dates.push(newMonth);\r\n counter += everyDayNum;\r\n newMonth = dateUtils.addMonths(originStart, counter);\r\n let newDayWeek = dateUtils.getDay(newMonth);\r\n let calcDay =\r\n dayWeek >= newDayWeek\r\n ? dayWeek - newDayWeek\r\n : 7 - (newDayWeek - dayWeek);\r\n let checkDate = dateUtils.addDays(newMonth, calcDay);\r\n if (checkDate.getMonth() > newMonth.getMonth()) {\r\n newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n } else if (\r\n checkDate.getMonth() === newMonth.getMonth()\r\n ) {\r\n if (\r\n checkDate.getDate() > newMonth.getDate() &&\r\n (dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getFullYear() === checkDate.getFullYear()\r\n ? !(\r\n dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getMonth() < checkDate.getMonth()\r\n )\r\n : dateUtils\r\n .addDays(newMonth, calcDay - 7)\r\n .getMonth() < checkDate.getMonth())\r\n ) {\r\n newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n } else {\r\n newMonth = checkDate;\r\n }\r\n } else {\r\n newMonth = checkDate;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return dates;\r\n};\r\n","export const box_shadow_xs: React.CSSProperties['boxShadow'] =\r\n '0px 1px 2px 0px rgba(16, 24, 40, 0.10), 0px 1px 3px 0px rgba(16, 24, 40, 0.10)';\r\nexport const box_shadow_s: React.CSSProperties['boxShadow'] =\r\n '0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)';\r\nexport const box_shadow_m: React.CSSProperties['boxShadow'] =\r\n '0px 4px 4px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)';\r\nexport const box_shadow_l: React.CSSProperties['boxShadow'] =\r\n '0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)';\r\nexport const box_shadow_xl: React.CSSProperties['boxShadow'] =\r\n '0px 24px 48px -12px rgba(16, 24, 40, 0.18)';\r\nexport const box_shadow_border_top: React.CSSProperties['boxShadow'] =\r\n '0px 1px 0px 0px #E3E8EF inset';\r\n\r\nexport const bookitShadows = {\r\n shadowXS: box_shadow_xs,\r\n shadowS: box_shadow_s,\r\n shadowM: box_shadow_m,\r\n shadowL: box_shadow_l,\r\n shadowXL: box_shadow_xl,\r\n shadowBorderTop: box_shadow_border_top,\r\n};\r\n","import { omit } from 'lodash';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { ISavedViewDto } from './odata/generated/entities/ISavedViewDto';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\n\r\nexport const savedViewsApi = {\r\n initUpdateData: (payload: number) => {\r\n const url = `/api/odata/v4/savedviews(${payload})`;\r\n return httpClient.get(url);\r\n },\r\n deleteSavedViews: (rows: ISavedViewDto[]): Promise => {\r\n const viewIds: number[] = rows.map(item => item.Id);\r\n const data = { viewIds };\r\n const url = '/api/odata/v4/SavedViews/DeleteViews';\r\n return httpClient.post(url, data);\r\n },\r\n createSavedView: (payload: ISavedViewDto) => {\r\n const url = `/api/odata/v4/savedviews`;\r\n return httpClient.post(url, payload);\r\n },\r\n updateSavedView: (payload: ISavedViewDto) => {\r\n const url = `/api/odata/v4/savedviews(${payload.Id})`;\r\n return httpClient.put(url, payload);\r\n },\r\n patch: (payload: Partial) => {\r\n const url = `/api/odata/v4/savedviews(${payload.Id})`;\r\n return httpClient.patch(url, omit(payload, 'Id'));\r\n },\r\n useSavedView: (id: number | undefined) => {\r\n if (!id) return;\r\n return httpClient.post(odataUrlPrefix + 'savedviews/UseSavedView', { id });\r\n },\r\n getMySavedViews: (payload: {\r\n user: AuthenticatedUser | undefined;\r\n serviceGroups: Entity[] | undefined;\r\n isAdmin: boolean;\r\n onlyMyView: boolean | undefined;\r\n }) => {\r\n const url = '/api/odata/v4/SavedViews';\r\n const filters = mySavedViewFilter(\r\n payload.serviceGroups,\r\n payload.user,\r\n payload.isAdmin,\r\n );\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $expand: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter:\r\n payload.onlyMyView === true\r\n ? new Condition(\r\n 'UserName',\r\n ODataOperators.Equals,\r\n payload.user?.Id || '',\r\n ).toString()\r\n : filters.toString(),\r\n $expand: 'Assets',\r\n $skip: 0,\r\n $top: 100,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as ISavedViewDto[]);\r\n },\r\n};\r\nconst mySavedViewFilter = (\r\n topServiceGroups: Entity[] | undefined,\r\n user: AuthenticatedUser | undefined,\r\n isAdmin: boolean,\r\n): string => {\r\n const predicates: (string | Condition)[] = [];\r\n let result = '';\r\n const byUser: string[] = [];\r\n if (user) {\r\n byUser.push(\r\n new Condition('UserName', ODataOperators.Equals, user.Id).toString() ||\r\n '',\r\n );\r\n // byUser.push(\r\n // '(' +\r\n // (new Condition(\r\n // 'Shared',\r\n // ODataOperators.Equals,\r\n // true,\r\n // ).toString() || '') +\r\n // ' and ' +\r\n // (new Condition(\r\n // 'SharedUsers',\r\n // ODataOperators.Any,\r\n // user.Id,\r\n // 'Name',\r\n // ).toString() || '') +\r\n // ')',\r\n // );\r\n // if (isAdmin && user.AdminServiceGroups.length > 0) {\r\n // let ids = user.AdminServiceGroups.map(item => {\r\n // return { Id: item.Id };\r\n // }) as Identifiable[];\r\n // byUser.push(\r\n // '(' +\r\n // (new Condition(\r\n // 'Shared',\r\n // ODataOperators.Equals,\r\n // true,\r\n // ).toString() || '') +\r\n // ' and ' +\r\n // '(' +\r\n // new Condition(\r\n // 'Assets',\r\n // ODataOperators.AllIn,\r\n // ids,\r\n // 'ServiceGroupId',\r\n // ).toString() +\r\n // '))',\r\n // );\r\n // }\r\n // if (isAdmin && user.AdminEquipments.length > 0) {\r\n // let ids = user.AdminEquipments.map(item => {\r\n // return { Id: item };\r\n // }) as Identifiable[];\r\n // byUser.push(\r\n // '(' +\r\n // (new Condition(\r\n // 'Shared',\r\n // ODataOperators.Equals,\r\n // true,\r\n // ).toString() || '') +\r\n // ' and ' +\r\n // '(' +\r\n // new Condition(\r\n // 'Assets',\r\n // ODataOperators.AllIn,\r\n // ids,\r\n // 'ServiceId',\r\n // ).toString() +\r\n // '))',\r\n // );\r\n // }\r\n byUser.push(\r\n new Condition(\r\n 'Shared',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString() || '',\r\n );\r\n predicates.push(byUser.filter(f => f !== '').join(' or '));\r\n result = '(' + predicates.map(f => f.toString()).join(' or ') + ')';\r\n if (topServiceGroups !== undefined) {\r\n if (topServiceGroups.length > 0) {\r\n let ids = topServiceGroups.map(item => {\r\n return { Id: item.Id };\r\n }) as Identifiable[];\r\n result +=\r\n ' and (' +\r\n new Condition(\r\n 'Assets',\r\n ODataOperators.AllIn,\r\n ids,\r\n 'ServiceGroupId',\r\n ).toString() +\r\n ')';\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity, Identifiable } from 'types/common';\r\nexport interface IWorkOrderTypeParamsPicker {\r\n assets?: IAssetDto[];\r\n groupIds?: number[];\r\n downtime?: boolean;\r\n}\r\nexport interface WorkOrderTypePickerProps\r\n extends Omit, 'loadData'> {\r\n useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/WorkOrderType';\r\nexport const initWOTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport const initWOTypeDataParams = (\r\n assets: IAssetDto[] | undefined,\r\n groupIds: number[] | undefined,\r\n downtime: boolean | undefined,\r\n) => {\r\n if (assets === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IWorkOrderTypeDto[]);\r\n });\r\n } else {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n $select?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $skip: 0,\r\n $top: 10,\r\n $select: 'Id,Name,AssetAlertType',\r\n };\r\n const predicates: (\r\n | string\r\n | Condition\r\n )[] = filteredWorkOrderTypes(assets, groupIds, downtime);\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: undefined,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IWorkOrderTypeDto[]);\r\n }\r\n};\r\nexport const filteredWorkOrderTypes = (\r\n assets: IAssetDto[] | undefined,\r\n groupIds: number[] | undefined,\r\n downtime: boolean | undefined,\r\n calibration?: boolean,\r\n): (string | Condition)[] => {\r\n const predicates: (string | Condition)[] = [];\r\n if (assets !== undefined && assets.length > 0) {\r\n const grp = assets\r\n .map(f => f.ServiceGroupId)\r\n .filter((elem, index, self) => {\r\n return (\r\n elem !== null && elem !== undefined && index === self.indexOf(elem)\r\n );\r\n })\r\n .map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n const cts = assets\r\n .map(f => f.AssetCatId)\r\n .filter((elem, index, self) => {\r\n return (\r\n elem !== null && elem !== undefined && index === self.indexOf(elem)\r\n );\r\n })\r\n .map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n const byGroups: string[] = [];\r\n byGroups.push(\r\n new Condition('Groups', ODataOperators.HasNoAny, 0).toString() || '',\r\n );\r\n byGroups.push(\r\n `(${grp\r\n .map(\r\n g =>\r\n new Condition('Groups', ODataOperators.Any, g.Id).toString() || '',\r\n )\r\n .filter(f => f !== '')\r\n .join(' and ')})`,\r\n );\r\n predicates.push(\r\n '(' + byGroups.filter(f => f !== '' && f !== '()').join(' or ') + ')',\r\n );\r\n const byCats: string[] = [];\r\n byCats.push(\r\n new Condition('AssetCats', ODataOperators.HasNoAny, 0).toString() || '',\r\n );\r\n byCats.push(\r\n `(${cts\r\n .map(\r\n g =>\r\n new Condition('AssetCats', ODataOperators.Any, g.Id).toString() ||\r\n '',\r\n )\r\n .filter(f => f !== '')\r\n .join(' and ')})`,\r\n );\r\n predicates.push(\r\n '(' + byCats.filter(f => f !== '' && f !== '()').join(' or ') + ')',\r\n );\r\n }\r\n if (groupIds !== undefined && groupIds.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'Groups',\r\n ODataOperators.Includes,\r\n groupIds.map(g => {\r\n return { Id: g } as Identifiable;\r\n }),\r\n ).toString() || '',\r\n );\r\n }\r\n if (downtime) {\r\n predicates.push(\r\n new Condition('AssetAlertType', ODataOperators.Equals, true),\r\n );\r\n }\r\n if (calibration === true) {\r\n predicates.push(\r\n new Condition('ShowOnCalibrationHistory', ODataOperators.Equals, true),\r\n );\r\n }\r\n predicates.push(new Condition('Statuses', ODataOperators.Any, true, 'New'));\r\n return predicates || [];\r\n};\r\nexport function withParamsFilter(\r\n assets: IAssetDto[] | undefined,\r\n groupIds: number[] | undefined,\r\n downtime: boolean | undefined,\r\n) {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: (\r\n | string\r\n | Condition\r\n )[] = filteredWorkOrderTypes(assets, groupIds, downtime);\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n };\r\n}\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n queryUrl?: string,\r\n useSearchOrPredicate?: boolean,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url ?? queryUrl,\r\n predicates: predicates,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'UserInquiry',\r\n 'AssetAlertType',\r\n 'QuickCreation',\r\n 'ReportSymptoms',\r\n 'UserCreated',\r\n 'NotifySGA',\r\n 'NotifyCreator',\r\n 'NotifyInstrumentAdmin',\r\n 'NotifyLabTech',\r\n 'Active',\r\n 'StaffOnly',\r\n 'AutoCreateEvent',\r\n 'RepairCodesEnabled',\r\n 'AssignedToCoreAdmin',\r\n 'AssignedToInstrumentAdmin',\r\n 'AssignedToLabTech',\r\n 'AssignedToCreator',\r\n 'ShowOnCalibrationHistory',\r\n 'NotifyAdditionalEmails',\r\n 'UserInquiryGuidance',\r\n 'RepeatsOn',\r\n 'DefaultSubject',\r\n 'DefaultCreatedBy',\r\n 'CustomFormId',\r\n 'RepeatsEveryNum',\r\n 'RepeatsEveryType',\r\n 'RepeatsBy',\r\n 'AutoCreateFor',\r\n 'DefaultRemaindBefore',\r\n 'RepetitiveOptions',\r\n 'DowntimeReasonTypeId',\r\n 'DowntimeDuration',\r\n 'CreatedDate',\r\n 'UpdateDate',\r\n 'DefaultEventTime',\r\n 'AssignedUsers',\r\n 'AssetCats',\r\n 'Groups',\r\n 'FormValues',\r\n 'Statuses',\r\n 'NotEditable',\r\n ],\r\n useSearchOrPredicate: useSearchOrPredicate,\r\n });\r\nexport function WorkOrderTypePicker(props: WorkOrderTypePickerProps) {\r\n const innerLoadData = (predicates, queryUrl) =>\r\n loadData(props.predicates, queryUrl, props.useSearchOrPredicate);\r\n // const loadData = withParamsFilter(\r\n // props.assets,\r\n // props.groupIds,\r\n // props.downtime,\r\n // );\r\n return (\r\n \r\n );\r\n}\r\nexport const loadWorkOrderTypes = loadData;\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nexport interface InventoryBatchPickerProps\r\n extends Omit, 'loadData'> {}\r\nconst url = '/api/odata/v4/InventoryBatches';\r\nexport const generateInventoryBatchName = (\r\n dto: IInventoryBatchDto,\r\n): IInventoryBatchDto => {\r\n let name = `Batch: #${dto?.Id} - ${dto.Name} - ${dto?.Inventory}`;\r\n return Object.assign({}, dto, { Name: name });\r\n};\r\nexport const convertInventoryBatchName = (\r\n Id: number,\r\n Name: string,\r\n Inventory: number,\r\n): string => {\r\n let name = `Batch: #${Id} - ${Name} - ${Inventory}`;\r\n return name;\r\n};\r\nconst loadBaseData = (\r\n predicates: (string | Condition)[] | undefined,\r\n select?: (keyof IInventoryBatchDto)[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n //transformModel: generateInventoryBatchName,\r\n // TODO: narrow down used properties list\r\n select:\r\n !!select && select.length > 0\r\n ? select\r\n : [\r\n 'Id',\r\n 'Name',\r\n 'OfflineServiceTypeId',\r\n 'OfflineServiceTypeName',\r\n 'Inventory',\r\n 'Lot',\r\n 'CreatedAt',\r\n 'CreatedBy',\r\n 'ExpirationDate',\r\n 'PurchaseDate',\r\n 'PurchasePricePerUnit',\r\n 'InventoryUsed',\r\n 'StokRenewed',\r\n ],\r\n globalServiceGroupFilter: undefined,\r\n });\r\n\r\nexport function InventoryBatchPicker(props: InventoryBatchPickerProps) {\r\n const innerLoadData = loadBaseData(props.predicates);\r\n return (\r\n \r\n convertInventoryBatchName(\r\n (option as IInventoryBatchDto).Id,\r\n (option as IInventoryBatchDto).Name,\r\n (option as IInventoryBatchDto).Inventory,\r\n )\r\n }\r\n renderOptionName={option =>\r\n convertInventoryBatchName(\r\n (option as IInventoryBatchDto).Id,\r\n (option as IInventoryBatchDto).Name,\r\n (option as IInventoryBatchDto).Inventory,\r\n )\r\n }\r\n {...props}\r\n />\r\n );\r\n}\r\nexport const loadInventoryBatchesData = loadBaseData;\r\nexport function BatchesByServiceTypeFilter(\r\n serviceTypeId: number,\r\n withStockRenewed?: boolean,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'OfflineServiceTypeId',\r\n ODataOperators.Equals,\r\n serviceTypeId,\r\n ),\r\n );\r\n if (!!withStockRenewed) {\r\n predicates.push(\r\n new Condition(\r\n 'StokRenewed',\r\n ODataOperators.Equals,\r\n withStockRenewed,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","import { ViewTypes } from '../slice/types';\r\n\r\nexport const parseType = (s?: ViewTypes) => {\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n switch (s) {\r\n case 'calendar':\r\n case 'timeline':\r\n return s;\r\n default:\r\n return undefined;\r\n }\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Default.TimelineGroupBy\r\n *\r\n */\r\n\r\nexport enum TimelineGroupBy {\r\n NoTimelineGrouped = 0,\r\n GroupByAssemblyPart = 1,\r\n GroupByAssetCat = 2,\r\n}\r\nexport type TimelineGroupByUnion = keyof typeof TimelineGroupBy;\r\nexport const TimelineGroupByUnionArray: Array = [\r\n 'NoTimelineGrouped',\r\n 'GroupByAssemblyPart',\r\n 'GroupByAssetCat',\r\n];\r\n","import { IViewState } from './Scheduler/slice/types';\r\nimport { match } from 'react-router';\r\nimport { parseType } from './Scheduler/utils/parseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CalendarPageParams } from './index';\r\nimport { presetPeriodToViewLength } from './Scheduler/utils/parseLength';\r\nimport {\r\n getPeriodTypeNameOrUndefined,\r\n GetRawValue,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { TimelineGroupByUnionArray } from 'api/odata/generated/enums/TimelineGroupBy';\r\n\r\n/** the name of the filter/search/querystring field storing the selected period value */\r\nexport const periodFilterFieldName = 'period';\r\n/**\r\n * the name of the filter/search/querystring field storing the selected period value\r\n */\r\nexport const groupByFilterFieldName = 'groupBy';\r\n/**\r\n * Parse and sanitize scheduler viewstate provided in the URL\r\n * @param match current route match\r\n * @param search route search\r\n * @returns scheduler view state\r\n */\r\nexport const parseCalendarPageParams = (\r\n match: match,\r\n search: string,\r\n isMobile: boolean,\r\n date: Date,\r\n dashView?: boolean,\r\n): IViewState => {\r\n const params = new URLSearchParamsCI(search);\r\n let periodType =\r\n getPeriodTypeNameOrUndefined(GetRawValue(params, periodFilterFieldName)) ??\r\n match.params.period;\r\n const defaultviewType =\r\n isMobile && !dashView\r\n ? 'calendar'\r\n : parseType(match.params.type) ?? 'timeline';\r\n const defaultviewLength = isMobile\r\n ? 'day'\r\n : periodType === undefined\r\n ? 'week'\r\n : presetPeriodToViewLength(periodType, defaultviewType);\r\n const result: IViewState = {\r\n viewType: defaultviewType,\r\n search: search,\r\n preset: null,\r\n viewLength: defaultviewLength,\r\n date: dateUtils.formatISO(date),\r\n groupBy: getTimelineGroupBy(params),\r\n //...parsePosition(match.params.length, match.params.date),\r\n };\r\n return result;\r\n};\r\n\r\nconst getTimelineGroupBy = function (params: URLSearchParamsCI) {\r\n const rawValue = GetRawValue(params, groupByFilterFieldName);\r\n if (rawValue === null || rawValue === undefined) {\r\n return undefined;\r\n }\r\n var result = TimelineGroupByUnionArray.find(\r\n item => item.toLowerCase() === rawValue.toLowerCase(),\r\n );\r\n return result;\r\n};\r\n","import { styled } from '@material-ui/core';\r\n\r\nexport const AlignRight = styled('div')(props => ({\r\n textAlign: 'right',\r\n}));\r\n","export enum CustomFormTypeEnum {\r\n Reservation = 0,\r\n Request = 1,\r\n Experiment = 2,\r\n Alert = 3,\r\n AlertType = 4,\r\n ServiceGroup = 5,\r\n Quiz = 6,\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { workOrderActions as actions } from '.';\r\nimport { WorkOrderApi as api } from 'api/WorkOrderApi';\r\nimport { FileStoreApi } from 'api/fileStoreApi';\r\nimport {\r\n ConvertModelToEntity,\r\n ConvertNewWorkOrdersToModel,\r\n DowntimeOverlaps,\r\n ReservationsOfflineData,\r\n SendEmailOnOffline,\r\n WorkOrderDetailsState,\r\n WorkOrderGlobalState,\r\n WorkOrderQueryStringParameters,\r\n WorkOrderResponse,\r\n} from './types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from '..';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { selectSavedLinkedOrders, selectUpdateAllRecurrent } from './selectors';\r\nimport { FileTypes } from 'api/odata/generated/enums/FileTypes';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { getFilesModel, UpdateFilesModel } from 'utils/fileStoreHelper';\r\nimport { IsEntity } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { routerActions } from 'connected-react-router';\r\n\r\nfunction* doInitCreate(action: PayloadAction) {\r\n try {\r\n const data = yield call(api.initCreateData, action.payload);\r\n yield put(actions.initWorkOrder_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initWorkOrder_Error(error));\r\n }\r\n}\r\nfunction* doInitUpdate(action: PayloadAction) {\r\n try {\r\n const data: IWorkOrderDetailsDto = yield call(\r\n api.initUpdateData,\r\n action.payload,\r\n );\r\n if (!data || data === null) {\r\n yield put(routerActions.push({ pathname: '/notallowed', search: '' }));\r\n } else {\r\n // set the offline event start to value provided through the params\r\n // for example, if an alert is edited from the scheduler, params will have an alert id and new start/end dates\r\n // these dates should override current alert offline event start/end\r\n // the values have to pass through formatQueryStringDate since alert details does not accept ISO properly and will shift the dates otherwise\r\n if (action.payload.offStart !== undefined) {\r\n data.OfflineEventStart = action.payload.offStart;\r\n }\r\n if (action.payload.offEnd !== undefined) {\r\n data.OfflineEventEnd = action.payload.offEnd;\r\n }\r\n\r\n yield put(actions.initUpdateWorkOrder_Success(data));\r\n }\r\n } catch (error: unknown) {\r\n yield put(actions.initUpdateWorkOrder_Error(Error));\r\n }\r\n}\r\nfunction* doCreate(action: PayloadAction) {\r\n const user: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n const httpPayloads: IWorkOrderDetailsDto[] = ConvertNewWorkOrdersToModel(\r\n action.payload,\r\n user,\r\n );\r\n const submissionFormFiles =\r\n action.payload.workOrderDetails.SubmissionFormFiles;\r\n const savedLinkeCalibrations = yield select(selectSavedLinkedOrders);\r\n try {\r\n let responses: WorkOrderResponse[] = [];\r\n for (let idx = 0; idx < httpPayloads.length; idx++) {\r\n const result = yield call(api.insertWorkOrder, httpPayloads[idx]);\r\n responses.push(result);\r\n }\r\n yield call(api.deleteTempComments, action.payload.commmentIds);\r\n let fileResponses: IResponseType[] = [];\r\n if (submissionFormFiles.length > 0) {\r\n let resp = responses.filter(f => f.Id !== undefined);\r\n for (let i = 0; i < resp.length; i++) {\r\n let data = getFilesModel(\r\n [],\r\n submissionFormFiles,\r\n FileTypes.AlertTypeFile,\r\n resp[i].Id || -1,\r\n CustomFormTypeEnum.AlertType,\r\n 1,\r\n null,\r\n null,\r\n resp[i].WorkOrderTypeId || null,\r\n );\r\n let fileRes = yield call(FileStoreApi.saveFormFiles, data);\r\n fileResponses.push(fileRes);\r\n }\r\n }\r\n\r\n let responseErrors = responses\r\n .filter(err => err.ErrorMessages.length > 0)\r\n .flatMap(f => f.ErrorMessages);\r\n\r\n if (fileResponses.length > 0) {\r\n fileResponses.forEach(f => {\r\n if (f.ErrorMessages.length > 0) {\r\n responseErrors = [...responseErrors, ...f.ErrorMessages];\r\n }\r\n });\r\n }\r\n let responseWarnings = responses\r\n .filter(err => err.WarningMessages.length > 0)\r\n .flatMap(f => f.WarningMessages);\r\n let responseSuccess = responses\r\n .filter(err => err.SuccessMessages.length > 0)\r\n .flatMap(f => f.SuccessMessages);\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: 'workOrderInsertError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: 'workOrderInsertWarning',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n\r\n if (responseSuccess.length > 0) {\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n yield put(actions.setSaveNewComments(true));\r\n yield put(\r\n actions.setOrderNumbers(\r\n responses.map(f => f.Id ?? 0).filter(f => f !== 0),\r\n ),\r\n );\r\n for (let i = 0; i < responseSuccess.length; i++) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'workOrderInsertSuccess_' + i,\r\n message: responseSuccess[i],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: responses[i].Id,\r\n created: true,\r\n itemName: i18next.t(translations.WorkOrdersPageName),\r\n detailsType: RenderPageType.WorkOrderDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + responses[i].Id,\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n if (savedLinkeCalibrations.length > 0) {\r\n for (let idx = 0; idx < savedLinkeCalibrations.length; idx++) {\r\n for (let widx = 0; widx < responses.length; widx++) {\r\n yield put(\r\n actions.addLinkedCalibration({\r\n id: responses[widx].Id ?? 0,\r\n link: savedLinkeCalibrations[idx].Id,\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n }\r\n yield put(\r\n appSettingsActions.updateUserProfileSettings({\r\n key: 'LastUsedDowntimeType',\r\n model: {\r\n UserName: user?.Id,\r\n Key: 'LastUsedDowntimeType',\r\n Value:\r\n action.payload.workOrderDetails.WorkOrderType?.Id?.toString(),\r\n } as UserProfileSettings,\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n //REPLACED WITH THIS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n //TO SHOW MULTIPLE NOTIFICATIONS FOR EACH CREATED WORK ORDER\r\n /* if (responseSuccess.length > 0) {\r\n let res = responses[0];\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'workOrderInsertSuccess',\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: res.Id,\r\n created: true,\r\n itemName: i18next.t(translations.WorkOrdersPageName),\r\n detailsType: RenderPageType.workOrderDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + res.Id,\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } */\r\n let hasErrors =\r\n responses.filter(f => f.ErrorMessages.length > 0).length > 0;\r\n let hasResOffline =\r\n responses.filter(f => f.sendEmailOnOffline === true).length > 0;\r\n let offData = responses\r\n .map(m => {\r\n return isNullOrUndefined(\r\n m.ReservationOffline[0],\r\n )\r\n ? undefined\r\n : {\r\n AlertId: m.ReservationOffline[0]?.AlertId,\r\n offStart: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(m.ReservationOffline[0]?.offStart),\r\n ),\r\n offEnd: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(m.ReservationOffline[0]?.offEnd),\r\n ),\r\n ReasonName: m.ReservationOffline[0].ReasonName,\r\n Remarks: m.ReservationOffline[0].Remarks,\r\n reservationIds: m.ReservationOffline[0].reservationIds,\r\n };\r\n })\r\n .filter(f => f !== undefined) as ReservationsOfflineData[];\r\n yield put(\r\n actions.createWorkOrder_Success({\r\n hasErrors: hasErrors,\r\n sendEmailOnOffline: hasResOffline,\r\n reservationOffline: offData,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'workOrderInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createWorkOrder_Error(Error));\r\n }\r\n}\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: WorkOrderDetailsState;\r\n original: WorkOrderDetailsState | undefined;\r\n originalSubFormFiles: IFormFileValue[];\r\n originalStaffFormFiles: IFormFileValue[];\r\n }>,\r\n) {\r\n const httpPayloads: IWorkOrderDetailsDto = ConvertModelToEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n const submissionFormFiles = action.payload.current.SubmissionFormFiles;\r\n const staffFormFiles = action.payload.current.StaffFormFiles;\r\n const updateAll = yield select(selectUpdateAllRecurrent);\r\n httpPayloads.UpdateAll = updateAll;\r\n let filesData: UpdateFilesModel[] = [];\r\n if (\r\n submissionFormFiles.length > 0 ||\r\n action.payload.originalSubFormFiles.length > 0\r\n ) {\r\n filesData = getFilesModel(\r\n action.payload.originalSubFormFiles,\r\n submissionFormFiles,\r\n FileTypes.AlertTypeFile,\r\n action.payload.current.Id,\r\n CustomFormTypeEnum.AlertType,\r\n updateAll === true ? 3 : 1,\r\n action.payload.current.RecurringAssetId,\r\n action.payload.current.RecurringGroupId,\r\n action.payload.current.WorkOrderType?.Id || null,\r\n );\r\n }\r\n if (\r\n staffFormFiles.length > 0 ||\r\n action.payload.originalStaffFormFiles.length > 0\r\n ) {\r\n filesData = [\r\n ...filesData,\r\n ...getFilesModel(\r\n action.payload.originalStaffFormFiles,\r\n staffFormFiles,\r\n FileTypes.AlertFile,\r\n action.payload.current.Id,\r\n CustomFormTypeEnum.Alert,\r\n updateAll === true ? 3 : 1,\r\n action.payload.current.RecurringAssetId,\r\n action.payload.current.RecurringGroupId,\r\n null,\r\n ),\r\n ];\r\n }\r\n try {\r\n const results = yield call(api.updateWorkOrder, httpPayloads);\r\n let response = results as WorkOrderResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (filesData.length > 0) {\r\n let fileRes = yield call(FileStoreApi.updateFormFiles, filesData);\r\n let fileResponses = fileRes as IResponseType;\r\n if (fileResponses.ErrorMessages.length > 0) {\r\n respErrors = [...respErrors, ...fileResponses.ErrorMessages];\r\n }\r\n }\r\n\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'workOrderUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'workOrderUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'workOrderUpdate',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: i18next.t(translations.WorkOrdersPageName),\r\n detailsType: RenderPageType.WorkOrderDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n yield put(layoutActions.setNotSavedChanges(false));\r\n if (response.AutoCreatedOrders.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: `workOrderUpdateAuto-${response.AutoCreatedOrders[0].AlertId}`,\r\n message: response.SuccessMessages[0],\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: 'The following next Work Order',\r\n itemEndName: `has been created and set to start at ${\r\n dateUtils.longDateTimeFormat(\r\n response.AutoCreatedOrders[0].Date,\r\n ) ?? ''\r\n }`,\r\n detailsType: RenderPageType.WorkOrderDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.AutoCreatedOrders[0].AlertId,\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n let hasResOffline = response.sendEmailOnOffline === true;\r\n let offData =\r\n response.ReservationOffline.length > 0\r\n ? response.ReservationOffline.map(m => {\r\n return {\r\n AlertId: m.AlertId,\r\n offStart: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(m.offStart),\r\n ),\r\n offEnd: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(m.offEnd),\r\n ),\r\n ReasonName: m.ReasonName,\r\n Remarks: m.Remarks,\r\n reservationIds: m.reservationIds,\r\n };\r\n })\r\n : ([] as ReservationsOfflineData[]);\r\n yield put(\r\n actions.updateWorkOrder_Success({\r\n hasErrors: hasErrors,\r\n sendEmailOnOffline: hasResOffline,\r\n reservationOffline: offData,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'workOrderUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateWorkOrder_Error(Error));\r\n }\r\n}\r\nfunction* doSendReservationsOfflineEmail(\r\n action: PayloadAction<{\r\n cancel: boolean;\r\n deleted: boolean;\r\n insert: boolean;\r\n doNotNotifyUsers: boolean;\r\n allAffectedUsers: boolean;\r\n reservationOffline: ReservationsOfflineData[];\r\n }>,\r\n) {\r\n try {\r\n const paload = {\r\n cancel: action.payload.cancel,\r\n deleted: action.payload.deleted,\r\n insert: action.payload.insert,\r\n doNotNotifyUsers: action.payload.doNotNotifyUsers,\r\n allAffectedUsers: action.payload.allAffectedUsers,\r\n sendData: action.payload.reservationOffline,\r\n } as SendEmailOnOffline;\r\n const result = yield call(api.sendEmailOnOffline, paload);\r\n let response = result as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'sendOfflineEmail',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'sendOfflineEmail',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: 'sendOfflineEmail',\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(\r\n actions.sendReservationsOfflineEmail_Success(\r\n response.ErrorMessages.length > 0,\r\n ),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'sendOfflineEmail',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.sendReservationsOfflineEmail_Error(Error));\r\n }\r\n}\r\nfunction* doRemoveFromLinked(action: PayloadAction) {\r\n const res = yield call(api.removefromLinks, action.payload);\r\n if (typeof res === 'number') {\r\n yield put(actions.removeFromLinked_success(res));\r\n return;\r\n }\r\n const response = res as IResponseType;\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n ),\r\n );\r\n}\r\nfunction* doAddToLinked(action: PayloadAction<{ id: number; link: number }>) {\r\n try {\r\n const res = yield call(api.addToLinked, action.payload);\r\n if (IsEntity(res)) {\r\n yield put(actions.addToLink_success(res));\r\n return;\r\n }\r\n const response = res.value as IResponseType;\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n ),\r\n );\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doRemoveLinkedCalibration(\r\n action: PayloadAction<{ id: number; link: number }>,\r\n) {\r\n const res = yield call(api.removeLinkedCalibration, action.payload);\r\n const response = res as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n ),\r\n );\r\n }\r\n yield put(actions.removeLinkedCalibration_success());\r\n}\r\nfunction* doaddLinkedCalibration(\r\n action: PayloadAction<{ id: number; link: number }>,\r\n) {\r\n try {\r\n const res = yield call(api.addLinkedToCalibration, action.payload);\r\n const response = res as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n ),\r\n );\r\n }\r\n yield put(actions.addLinkedCalibration_success());\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doSetAny(\r\n action: PayloadAction<{\r\n fieldKey: keyof WorkOrderDetailsState;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doSetCreatedOrders(action: PayloadAction) {\r\n yield put(actions.setOrderNumbers_success(action.payload));\r\n}\r\nfunction* doCheckDowntimeOverlaps(action: PayloadAction) {\r\n try {\r\n const res = yield call(api.getOverlappingDowntimes, action.payload);\r\n const response = res as DowntimeOverlaps[];\r\n yield put(actions.checkDowntimeOverlaps_Success(response));\r\n } catch (error) {\r\n yield put(actions.checkDowntimeOverlaps_Success(undefined));\r\n }\r\n}\r\nfunction* doRemoveTempComments(action: PayloadAction) {\r\n yield call(api.deleteTempComments, action.payload);\r\n}\r\n\r\nexport function* workOrderSaga() {\r\n yield takeLatest(actions.initWorkOrder.type, doInitCreate);\r\n yield takeLatest(actions.initUpdateWorkOrder.type, doInitUpdate);\r\n yield takeLatest(actions.createWorkOrder.type, doCreate);\r\n yield takeLatest(actions.updateWorkOrder.type, doUpdate);\r\n yield takeLatest(\r\n actions.sendReservationsOfflineEmail.type,\r\n doSendReservationsOfflineEmail,\r\n );\r\n yield takeLatest(actions.removeFromLinked.type, doRemoveFromLinked);\r\n yield takeLatest(actions.addToLinked.type, doAddToLinked);\r\n yield takeLatest(\r\n actions.removeLinkedCalibration.type,\r\n doRemoveLinkedCalibration,\r\n );\r\n yield takeLatest(actions.addLinkedCalibration.type, doaddLinkedCalibration);\r\n yield takeLatest(actions.setAnyValue.type, doSetAny);\r\n yield takeLatest(actions.setOrderNumbers.type, doSetCreatedOrders);\r\n yield takeLatest(actions.checkDowntimeOverlaps.type, doCheckDowntimeOverlaps);\r\n yield takeLatest(\r\n actions.resetCreateWorkOrderState.type,\r\n doRemoveTempComments,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { Entity } from 'types/common';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { workOrderSaga } from './saga';\r\nimport {\r\n ConvertEntityToModel,\r\n DowntimeOverlaps,\r\n ReservationsOfflineData,\r\n WorkOrderDetailsState,\r\n WorkOrderGlobalState,\r\n WorkOrderQueryStringParameters,\r\n WorkOrderReadonlyState,\r\n WorkOrderState,\r\n} from './types';\r\n\r\nexport const initialState: WorkOrderState = {\r\n processing: false,\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n reservationOffline: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n sendEmailOnOffline: false,\r\n readonlyState: undefined,\r\n updateAllRecurrent: false,\r\n valueHandler: undefined,\r\n doSaveNewComments: undefined,\r\n createdOrders: [],\r\n savedLinkedOrders: [],\r\n calibrationsChanged: undefined,\r\n linksProcessing: undefined,\r\n downtimeOverlaps: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'workOrder',\r\n initialState,\r\n reducers: {\r\n initWorkOrder(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.downtimeOverlaps = undefined;\r\n },\r\n initWorkOrder_Success(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.createState.data = ConvertEntityToModel(\r\n action.payload,\r\n action.payload.ToDown,\r\n );\r\n },\r\n initWorkOrder_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n initUpdateWorkOrder(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateWorkOrder_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.updateState.data = ConvertEntityToModel(action.payload, undefined);\r\n state.readonlyState = action.payload as WorkOrderReadonlyState;\r\n },\r\n initUpdateWorkOrder_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n // state.updateState.data = undefined;\r\n // state.readonlyState = undefined;\r\n },\r\n createWorkOrder(state, action: PayloadAction) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createWorkOrder_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n sendEmailOnOffline: boolean;\r\n reservationOffline: ReservationsOfflineData[];\r\n }>,\r\n ) {\r\n state.createState.processing = false;\r\n state.createState.hasErrors = action.payload.hasErrors;\r\n state.createState.completed = true;\r\n\r\n state.reservationOffline.data = action.payload.reservationOffline;\r\n state.sendEmailOnOffline = action.payload.sendEmailOnOffline;\r\n },\r\n createWorkOrder_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n state.createState.hasErrors = true;\r\n },\r\n updateWorkOrder(\r\n state,\r\n action: PayloadAction<{\r\n current: WorkOrderDetailsState;\r\n original: WorkOrderDetailsState | undefined;\r\n originalSubFormFiles: IFormFileValue[];\r\n originalStaffFormFiles: IFormFileValue[];\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateWorkOrder_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n sendEmailOnOffline: boolean;\r\n reservationOffline: ReservationsOfflineData[];\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n state.reservationOffline.data = action.payload.reservationOffline;\r\n state.sendEmailOnOffline = action.payload.sendEmailOnOffline;\r\n },\r\n updateWorkOrder_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n resetCreateWorkOrderState(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.OfflineEventStart = undefined;\r\n state.OfflineEventEnd = undefined;\r\n state.savedLinkedOrders = [];\r\n state.downtimeOverlaps = undefined;\r\n },\r\n resetUpdateWorkOrderState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.readonlyState = undefined;\r\n state.savedLinkedOrders = [];\r\n state.downtimeOverlaps = undefined;\r\n },\r\n resetReservationsOfflineState(state, action: PayloadAction) {\r\n state.sendEmailOnOffline = false;\r\n state.reservationOffline = {\r\n data: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n processing: false,\r\n };\r\n state.OfflineEventStart = undefined;\r\n state.OfflineEventEnd = undefined;\r\n },\r\n sendReservationsOfflineEmail(\r\n state,\r\n action: PayloadAction<{\r\n cancel: boolean;\r\n deleted: boolean;\r\n insert: boolean;\r\n doNotNotifyUsers: boolean;\r\n allAffectedUsers: boolean;\r\n reservationOffline: ReservationsOfflineData[];\r\n }>,\r\n ) {\r\n state.reservationOffline.processing = true;\r\n state.reservationOffline.completed = undefined;\r\n state.reservationOffline.hasErrors = undefined;\r\n },\r\n sendReservationsOfflineEmail_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.reservationOffline.processing = false;\r\n state.reservationOffline.hasErrors = action.payload;\r\n state.reservationOffline.completed = true;\r\n },\r\n sendReservationsOfflineEmail_Error(state, action: PayloadAction) {\r\n state.reservationOffline.processing = false;\r\n state.reservationOffline.completed = true;\r\n state.reservationOffline.hasErrors = true;\r\n },\r\n setUpdateAllRecurrent(state, action: PayloadAction) {\r\n state.updateAllRecurrent = action.payload;\r\n },\r\n removeFromLinked(state, action: PayloadAction) {\r\n state.processing = true;\r\n },\r\n removeFromLinked_success(state, action: PayloadAction) {\r\n state.processing = false;\r\n if (state.readonlyState === undefined) return;\r\n state.readonlyState.LinkedAlerts =\r\n state.readonlyState.LinkedAlerts.filter(f => f.Id !== action.payload);\r\n },\r\n addToLinked(state, action: PayloadAction<{ id: number; link: number }>) {\r\n state.processing = true;\r\n },\r\n addToLink_success(state, action: PayloadAction>) {\r\n state.processing = false;\r\n if (state.readonlyState === undefined) return;\r\n state.readonlyState.LinkedAlerts.push(action.payload);\r\n },\r\n setAnyValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof WorkOrderDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setAnyValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof WorkOrderDetailsState;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.valueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetValueHandler(state, action: PayloadAction) {\r\n state.valueHandler = undefined;\r\n },\r\n /**\r\n * Sets the offline event start\r\n * @param state\r\n * @param action\r\n */\r\n setOfflineEventStart(state, action: PayloadAction) {\r\n state.OfflineEventStart = action.payload;\r\n },\r\n /**\r\n * Sets the offline event end\r\n * @param state\r\n * @param action\r\n */\r\n setOfflineEventEnd(state, action: PayloadAction) {\r\n state.OfflineEventEnd = action.payload;\r\n },\r\n setSaveNewComments(state, action: PayloadAction) {\r\n state.doSaveNewComments = action.payload;\r\n },\r\n setOrderNumbers(state, action: PayloadAction) {},\r\n setOrderNumbers_success(state, action: PayloadAction) {\r\n state.createdOrders = action.payload;\r\n },\r\n setSavedLinkedOrders(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.savedLinkedOrders = action.payload;\r\n },\r\n resetSavedLinkedOrders(state, action: PayloadAction) {\r\n state.savedLinkedOrders = [];\r\n },\r\n removeLinkedCalibration(\r\n state,\r\n action: PayloadAction<{ id: number; link: number }>,\r\n ) {\r\n state.linksProcessing = true;\r\n },\r\n removeLinkedCalibration_success(state, action: PayloadAction) {\r\n state.linksProcessing = false;\r\n state.calibrationsChanged = true;\r\n },\r\n addLinkedCalibration(\r\n state,\r\n action: PayloadAction<{ id: number; link: number }>,\r\n ) {\r\n state.linksProcessing = true;\r\n },\r\n addLinkedCalibration_success(state, action: PayloadAction) {\r\n state.linksProcessing = false;\r\n state.calibrationsChanged = true;\r\n },\r\n setCalibrationChanged(state, action: PayloadAction) {\r\n state.calibrationsChanged = action.payload;\r\n },\r\n checkDowntimeOverlaps(state, action: PayloadAction) {},\r\n checkDowntimeOverlaps_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.downtimeOverlaps = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: workOrderActions } = slice;\r\n\r\nexport const useWorkOrderSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: workOrderSaga });\r\n return { actions: slice.actions };\r\n};\r\n","/**\r\n *\r\n * UserFilter\r\n *\r\n */\r\nimport { UserPicker } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default UserFilter;\r\n","/**\r\n *\r\n * DescriptionCell\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Description, DescriptionProps } from 'app/components/Description';\r\n\r\nexport interface DescriptonCellProps\r\n extends Pick<\r\n DescriptionProps,\r\n 'width' | 'interactive' | 'leaveDelay' | 'leaveTouchDelay'\r\n > {}\r\n/**\r\n * Renders a long text Cell - truncates long text with a popup\r\n * @param c react-table renderprop params - see https://react-table.tanstack.com/docs/api/useTable\r\n * @returns\r\n */\r\nexport const DescriptionCell = (p?: DescriptonCellProps) => (c: {\r\n value: string | null;\r\n}) => {\r\n if (p?.width === 'auto') {\r\n return String(c.value);\r\n }\r\n return (\r\n \r\n );\r\n};\r\n","import { IViewState, ViewTypes } from './Scheduler/slice/types';\r\nimport { generatePath } from 'react-router';\r\nimport { calendarPageFullPath } from './index';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Generates path of the scheduler (calendar/timeline) page\r\n * @param params\r\n * @returns\r\n */\r\nexport const GetCalendarPagePath = (params: IViewState) =>\r\n GetSchedulerPagePath(params.viewType);\r\n\r\nexport const GetSchedulerPagePath = (viewType: ViewTypes) =>\r\n generatePath(calendarPageFullPath, {\r\n type: viewType,\r\n });\r\n\r\nexport const useCalendarLink = (props?: {\r\n equipments?: Array;\r\n start?: string | Date;\r\n openToBook?: boolean;\r\n viewType: ViewTypes;\r\n defaultMulti?: boolean;\r\n}): string => {\r\n const EnableLegacyScheduler = useSelector(\r\n selectGlobalDbSetting_EnableLegacyScheduler,\r\n );\r\n if (EnableLegacyScheduler) {\r\n switch (props?.viewType) {\r\n case 'calendar':\r\n const params = {\r\n id: props?.equipments\r\n ?.filter(f => f !== undefined)\r\n ?.map(r => `os${r}`)\r\n ?.join(','),\r\n Start:\r\n props?.start === undefined\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(props?.start),\r\n ),\r\n openToBook: props?.openToBook,\r\n };\r\n\r\n return `/Weekly.aspx?${toQueryString(params)}`;\r\n case 'timeline':\r\n return `/Timeline.aspx?${toQueryString({\r\n services: props?.equipments?.filter(f => f !== undefined)?.join(','),\r\n Start:\r\n props?.start === undefined\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(props?.start),\r\n ),\r\n openToBook: props?.openToBook,\r\n })}`;\r\n }\r\n }\r\n return `/schedule/${props?.viewType.toLowerCase()}?${toQueryString({\r\n eid: props?.equipments\r\n ?.filter(f => f !== undefined)\r\n ?.map(r => `${r}`)\r\n ?.join(','),\r\n Start:\r\n props?.start === undefined\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(dateUtils.parseISO(props?.start)),\r\n openToBook: props?.openToBook,\r\n defaultMulti: props?.defaultMulti,\r\n })}`;\r\n};\r\n","import { EditorProps } from '../../EditableCell';\r\nimport { tryParseFloat } from 'utils/string-utils';\r\nimport { TextField as BasicTextField } from 'app/components/TextField';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { InputAdornment } from '@material-ui/core';\r\n\r\n/* Project Name */\r\n// 'Number':\r\n\r\nexport function NumberField({\r\n value,\r\n onChange,\r\n parentValue,\r\n min,\r\n max,\r\n step,\r\n helperText,\r\n info,\r\n error,\r\n autoFocus,\r\n ...props\r\n}: EditorProps & MinMaxProps) {\r\n return (\r\n // onChange(tryParseFloat(e.target.value) ?? null)}\r\n // {...props}\r\n // />\r\n \r\n {!!info && info !== '' && }\r\n {error && }\r\n \r\n ),\r\n }}\r\n variant=\"standard\"\r\n error={error}\r\n fullWidth\r\n autoFocus={autoFocus}\r\n inputProps={{\r\n type: 'number',\r\n min: min,\r\n max: max,\r\n step: step,\r\n }}\r\n value={value || ''}\r\n onChange={e => onChange(tryParseFloat(e.target.value) ?? null)}\r\n onBlur={props.onBlur}\r\n id={props.id}\r\n label={props.label}\r\n name={props.name}\r\n />\r\n );\r\n}\r\n\r\ninterface MinMaxProps {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n}\r\n\r\nexport function withMinMax(Component, withProps: MinMaxProps) {\r\n return (props: EditorProps) => (\r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\nimport { Dto, ISection } from './types';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.serviceRequestsKanban || initialState;\r\n\r\nexport const selectServiceRequestsKanban = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectServiceRequestsKanbanProcessingUpdate = createSelector(\r\n [selectSlice],\r\n state => state.processingUpdate,\r\n);\r\nexport const selectServiceRequestsKanbanProcessingInsert = createSelector(\r\n [selectSlice],\r\n state => state.processingInsert,\r\n);\r\n\r\nexport const selectServiceRequestsKanbanTickets = createSelector(\r\n [selectServiceRequestsKanban],\r\n state => state.data,\r\n);\r\nexport const selectServiceRequestsKanbanSelectedStatuses = createSelector(\r\n [selectSlice],\r\n state => state.selectedStatuses,\r\n);\r\nexport const selectServiceRequestsKanbanData = createSelector(\r\n [\r\n selectServiceRequestsKanbanSelectedStatuses,\r\n selectServiceRequestsKanbanTickets,\r\n ],\r\n (selectedStatuses, tickets) => {\r\n if (selectedStatuses !== undefined) {\r\n if (selectedStatuses.some(f => f.Name !== undefined)) {\r\n return selectedStatuses.map(status => {\r\n const dataList = tickets[status.Id.toString()];\r\n const b: ISection = {\r\n id: status.Id,\r\n section: status,\r\n data: dataList,\r\n };\r\n return b;\r\n });\r\n }\r\n }\r\n },\r\n);\r\n\r\nexport const selectShowAddSubTicket = createSelector(\r\n [selectSlice],\r\n state => state.showAddSubTicket,\r\n);\r\nexport const selectParentTicket = createSelector(\r\n [selectSlice],\r\n state => state.parentTicket,\r\n);\r\nexport const selectEdit = createSelector([selectSlice], state => state.ticket);\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Identifiable } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\n\r\nexport type GroupUrl =\r\n | 'base'\r\n | 'admin'\r\n | 'regpublic'\r\n | 'public'\r\n | 'billableAdminUrl';\r\n\r\nexport interface ServiceGroupPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType: GroupUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/servicegroups';\r\nconst adminUrl = '/api/odata/v4/servicegroups/GetAdminServiceGroups';\r\nconst publicUrl = '/api/odata/v4/servicegroups/GetPublicServiceGroups';\r\nconst regPublicUrl = '/api/odata/v4/servicegroups/GetRegistrationServiceGroups';\r\nconst billableAdminUrl =\r\n '/api/odata/v4/servicegroups/GetBillableAdminServiceGroups';\r\n\r\nexport const initServiceGroupsData = (\r\n initval: string | undefined,\r\n urlType: GroupUrl | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IServiceGroupDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,DivisionId,DivisionName',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n urlType === undefined\r\n ? url\r\n : urlType === 'public'\r\n ? publicUrl\r\n : urlType === 'regpublic'\r\n ? regPublicUrl\r\n : urlType === 'admin'\r\n ? adminUrl\r\n : urlType === 'billableAdminUrl'\r\n ? billableAdminUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IServiceGroupDto[]);\r\n }\r\n};\r\n\r\nexport function ServiceGroupPicker(props: ServiceGroupPickerProps) {\r\n const urlt =\r\n props.urlType === 'public'\r\n ? publicUrl\r\n : props.urlType === 'regpublic'\r\n ? regPublicUrl\r\n : props.urlType === 'admin'\r\n ? adminUrl\r\n : props.urlType === 'billableAdminUrl'\r\n ? billableAdminUrl\r\n : url;\r\n let filters: (string | Condition)[] = [];\r\n if (urlt === url) {\r\n if (!!props.predicates && props.predicates.length > 0) {\r\n filters = [...props.predicates, ...['Active eq true']];\r\n } else {\r\n filters = ['Active eq true'];\r\n }\r\n }\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url:\r\n props.urlType === 'public'\r\n ? publicUrl\r\n : props.urlType === 'regpublic'\r\n ? regPublicUrl\r\n : props.urlType === 'admin'\r\n ? adminUrl\r\n : props.urlType === 'billableAdminUrl'\r\n ? billableAdminUrl\r\n : url,\r\n select: ['Id', 'Name', 'DivisionId', 'DivisionName'],\r\n predicates: filters,\r\n });\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const ServiceGroupByDivisionFilter = (value: FilterValueType) => {\r\n if (value !== undefined && value !== null) {\r\n return [\r\n `${new Condition(\r\n 'DivisionId',\r\n ODataOperators.Equals,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n return [];\r\n};\r\n\r\nexport const serviceGroupFilterUrl = url;\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { GroupUrl, ServiceGroupPicker } from '../pickers/ServiceGroupPicker';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\n\r\nexport const FormServiceGroupPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & {\r\n label?: string;\r\n fullWidth?: boolean;\r\n urlType: GroupUrl;\r\n autoFocus?: boolean;\r\n name: string;\r\n placeholder: string;\r\n disabled?: boolean;\r\n predicates?: (string | Condition>)[];\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(props.value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value as IServiceGroupDto}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n predicates={props.predicates}\r\n variant={props.variant === undefined ? 'filled' : props.variant}\r\n />\r\n );\r\n};\r\n","import {\r\n FormControlLabelProps as MuiFormControlLabelProps,\r\n FormControlLabel as MuiFormControlLabel,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport * as React from 'react';\r\n\r\nexport interface FormControlLabelProps extends MuiFormControlLabelProps {\r\n boldLabel?: boolean;\r\n withInfo?: boolean;\r\n boxed?: boolean;\r\n boxedChecked?: boolean;\r\n boxedError?: boolean;\r\n}\r\nconst FormControlLabel = (props: FormControlLabelProps) => {\r\n const {\r\n boldLabel,\r\n withInfo,\r\n boxed,\r\n boxedChecked,\r\n boxedError,\r\n ...other\r\n } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormControlLabel;\r\n","import {\r\n FormHelperTextProps as MuiFormHelperTextProps,\r\n FormHelperText as MuiFormHelperText,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FormHelperTextProps extends MuiFormHelperTextProps {\r\n boxed?: boolean;\r\n shiftRight?: boolean;\r\n}\r\nconst FormHelperText = (props: FormHelperTextProps) => {\r\n const { shiftRight, boxed, ...other } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormHelperText;\r\n","export function roundTwoPlacesAfterDecimalPoint(value: any) {\r\n return (Math.round((Number(value) ?? 0) * 100) / 100).toFixed(2);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { articlesActions as actions } from '.';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IExternalArticlesSearchResponse } from 'api/odata/generated/entities/IExternalArticlesSearchResponse';\r\nimport { IExternalArticleSearchPayload } from './types';\r\nimport { selectArticlesExternalSearchPageData } from 'app/pages/ArticlesPage/slice/selectors';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { omit } from 'lodash';\r\n\r\nfunction* doShowDetails(\r\n action: PayloadAction<{\r\n Id?: number;\r\n externalId?: string;\r\n externalIdSource?: string;\r\n article?: IArticleDto;\r\n }>,\r\n) {\r\n // const props: ArticleDetailsProps = {\r\n // useSidePanel: true,\r\n // value: action.payload,\r\n // };\r\n\r\n try {\r\n const url = '/api/odata/v4/articles';\r\n let params = {};\r\n let articleDetails;\r\n if (!!action.payload.Id && action.payload.Id > 0) {\r\n params = { key: action.payload.Id };\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n url,\r\n params,\r\n );\r\n articleDetails = omit(data, '@odata.context');\r\n } else {\r\n if (\r\n action.payload.externalId !== undefined &&\r\n action.payload.externalIdSource !== undefined\r\n ) {\r\n const filter = new ODataFilterBuilder({\r\n predicates: [\r\n new Condition(\r\n 'ExternalId',\r\n ODataOperators.Equals,\r\n action.payload.externalId,\r\n ),\r\n new Condition(\r\n 'ExternalIdSource',\r\n ODataOperators.Equals,\r\n action.payload.externalIdSource,\r\n ),\r\n ],\r\n stringColumns: [],\r\n });\r\n params = { $filter: filter.toString(), $top: 1 };\r\n const data: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n url,\r\n params,\r\n );\r\n articleDetails = data.value[0];\r\n }\r\n }\r\n yield put(actions.showDetails_Success(articleDetails));\r\n } catch (error) {}\r\n\r\n // yield put(\r\n // layoutActions.openSidePanel({\r\n // type: RenderPageType.Article,\r\n // props: props,\r\n // }),\r\n // );\r\n}\r\n\r\nfunction* doExternalSearch(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n // skip fetching already loaded items\r\n const page = yield select(selectArticlesExternalSearchPageData);\r\n if (page !== undefined) {\r\n yield put(actions.externalSearch_Skip());\r\n return;\r\n }\r\n if (action.payload.searchForm.Source === undefined) {\r\n return;\r\n }\r\n const url = `/api/odata/v4/Articles/ExternalSearch(source='${action.payload.searchForm.Source}')`;\r\n const params = new URLSearchParams(\r\n action.payload.searchForm as Record,\r\n );\r\n params.set(\r\n '$skip',\r\n String(action.payload.pageIndex * action.payload.pageSize),\r\n );\r\n params.set('$top', String(action.payload.pageSize));\r\n const results: IExternalArticlesSearchResponse = yield call(\r\n httpClient.get,\r\n url,\r\n params,\r\n );\r\n yield put(\r\n actions.externalSearch_Success({\r\n count: results.Count,\r\n items: results.Items,\r\n pageIndex: action.payload.pageIndex,\r\n }),\r\n );\r\n } catch (error) {\r\n if ((error as AxiosError).isAxiosError) {\r\n var errorCode = (error as AxiosError).response?.status;\r\n if (errorCode === StatusCodes.TOO_MANY_REQUESTS) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.TooManyRequests),\r\n }),\r\n );\r\n }\r\n }\r\n yield put(actions.externalSearch_Error('Error searching external source'));\r\n }\r\n}\r\nfunction* doSaveArticleAssociation(action: PayloadAction) {\r\n try {\r\n const isNew = (action.payload.Id ?? 0) === 0;\r\n const url = isNew\r\n ? '/api/odata/v4/articles'\r\n : `/api/odata/v4/articles(${action.payload.Id})`;\r\n const fn = isNew ? httpClient.post : httpClient.put;\r\n const result = yield call(fn, url, action.payload);\r\n yield put(layoutActions.setRefreshTable(true));\r\n if (result.Queryable[0].Status === ArticleStatus.AwaitingApproval) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.PublicationAwaitingApproval),\r\n }),\r\n );\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.Success),\r\n }),\r\n );\r\n }\r\n yield put(actions.saveArticleAssociation_Success(result.Queryable[0]));\r\n } catch (error) {\r\n const mes = (error as AxiosError)?.response?.data.error.message;\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message:\r\n mes !== undefined ? mes : i18next.t(translations.AnErrorOccurred),\r\n }),\r\n );\r\n yield put(actions.saveArticleAssociation_Error(action.payload));\r\n }\r\n}\r\n\r\nexport function* articlesSaga() {\r\n yield takeLatest(actions.showDetails.type, doShowDetails);\r\n yield takeLatest(actions.externalSearch.type, doExternalSearch);\r\n yield takeLatest(actions.chnagePage.type, doExternalSearch);\r\n\r\n yield takeLatest(\r\n actions.saveArticleAssociation.type,\r\n doSaveArticleAssociation,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { articlesSaga } from './saga';\r\nimport {\r\n ArticlesState,\r\n IExternalArticleSearchPayload,\r\n IExternalArticleSearchSuccessPayload,\r\n} from './types';\r\n\r\nexport const initialState: ArticlesState = {\r\n externalSearchResults: {},\r\n externalSearchPageIndex: 0,\r\n externalSearchPageSize: 10,\r\n refreshEditArticleAssociation: undefined,\r\n articleDetailsBusy: undefined,\r\n editArticleAssociationBusy: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'articles',\r\n initialState,\r\n reducers: {\r\n showDetails(\r\n state,\r\n action: PayloadAction<{\r\n Id?: number;\r\n externalId?: string;\r\n externalIdSource?: string;\r\n article?: IArticleDto;\r\n }>,\r\n ) {\r\n state.articleDetailsBusy = true;\r\n state.editArticleAssociationBusy = undefined;\r\n state.articleDetails = action.payload.article;\r\n },\r\n showDetails_Success(state, action: PayloadAction) {\r\n state.articleDetailsBusy = false;\r\n if (action.payload !== undefined) {\r\n if (state.articleDetails !== undefined) {\r\n state.articleDetails.Id = action.payload.Id;\r\n state.articleDetails.Assets = action.payload.Assets;\r\n }\r\n }\r\n },\r\n refreshEditArticleAssociation(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.refreshEditArticleAssociation = action.payload;\r\n },\r\n saveArticleAssociation(state, action: PayloadAction) {\r\n state.editArticleAssociationBusy = true;\r\n state.refreshEditArticleAssociation = undefined;\r\n },\r\n saveArticleAssociation_Success(state, action: PayloadAction) {\r\n state.articleDetails = action.payload;\r\n state.refreshEditArticleAssociation = true;\r\n state.editArticleAssociationBusy = false;\r\n },\r\n saveArticleAssociation_Error(state, action: PayloadAction) {\r\n state.editArticleAssociationBusy = false;\r\n },\r\n resetArticleAssociationState(state, action: PayloadAction) {\r\n state.editArticleAssociationBusy = undefined;\r\n //delete state.articleDetails;\r\n },\r\n externalSearch(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.externalSearchFormDetails = action.payload.searchForm;\r\n state.externalSearchPageIndex = action.payload.pageIndex;\r\n state.externalSearchPageSize = action.payload.pageSize;\r\n state.externalSearchResults = {\r\n processing: true,\r\n };\r\n },\r\n chnagePage(state, action: PayloadAction) {\r\n state.externalSearchResults.processing = true;\r\n if (state.externalSearchPageSize !== action.payload.pageSize) {\r\n state.externalSearchResults.data = {};\r\n }\r\n state.externalSearchPageIndex = action.payload.pageIndex;\r\n state.externalSearchPageSize = action.payload.pageSize;\r\n },\r\n externalSearch_Skip(state, action: PayloadAction) {\r\n state.externalSearchResults.processing = false;\r\n },\r\n externalSearch_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.externalSearchResults.processing = false;\r\n state.externalSearchResults.dataLength = action.payload.count;\r\n if (state.externalSearchResults.data === undefined) {\r\n state.externalSearchResults.data = {};\r\n }\r\n state.externalSearchResults.data[action.payload.pageIndex] =\r\n action.payload.items;\r\n },\r\n externalSearch_Error(state, action: PayloadAction) {\r\n state.externalSearchResults = { error: action.payload };\r\n },\r\n someAction(state, action: PayloadAction) {},\r\n clearArticleDetails(state) {\r\n state.articleDetails = undefined;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: articlesActions } = slice;\r\n\r\nexport const useArticlesSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: articlesSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useArticlesSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { PrintPDFItem } from './types';\r\nimport { printPDFActions as actions } from '.';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { selectPrintPDFSections } from './selectors';\r\n\r\nfunction* doUpdateSections(action: PayloadAction) {}\r\nfunction* doSaveSections(action: PayloadAction) {\r\n const sections: PrintPDFItem[] = yield select(selectPrintPDFSections);\r\n const value = sections.filter(s => s.checked === true).map(f => f.id);\r\n const user = yield select(selectAuthenticatedUser);\r\n yield put(\r\n appSettingsActions.updateUserProfileSettings({\r\n key: '/RequestSamples.pdf',\r\n model: {\r\n UserName: user.Id,\r\n Key: '/RequestSamples.pdf',\r\n Value: value.join(','),\r\n Id: 0,\r\n AdGroup: null,\r\n DefaultGroups: null,\r\n Enabled: true,\r\n IsMultiple: null,\r\n Name: null,\r\n Selected: false,\r\n StaffEnabled: false,\r\n },\r\n }),\r\n );\r\n}\r\nexport function* printPDFSaga() {\r\n yield takeLatest(actions.updateSections.type, doUpdateSections);\r\n yield takeLatest(actions.saveSections.type, doSaveSections);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { printPDFSaga } from './saga';\r\nimport { PrintPDFItem, PrintPDFState } from './types';\r\n\r\nexport const initialState: PrintPDFState = {\r\n printing: false,\r\n isLoading: false,\r\n useSections: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'printPDF',\r\n initialState,\r\n reducers: {\r\n setPrinting(state, action: PayloadAction) {\r\n state.printing = action.payload;\r\n },\r\n setUseSections(state, action: PayloadAction) {\r\n state.useSections = action.payload;\r\n },\r\n updateSections(state, action: PayloadAction) {\r\n state.Sections = action.payload;\r\n },\r\n updateSection(\r\n state,\r\n action: PayloadAction<{\r\n id: string;\r\n checked: boolean;\r\n }>,\r\n ) {\r\n if (state.Sections !== undefined) {\r\n const section = state.Sections.find(f => f.id === action.payload.id);\r\n if (section !== undefined) {\r\n section.checked = action.payload.checked;\r\n }\r\n }\r\n },\r\n saveSections(state, action: PayloadAction) {},\r\n clearLoading(state, action: PayloadAction) {\r\n state.tables = undefined;\r\n },\r\n setLoading(state, action: PayloadAction<{ id: string; loading: boolean }>) {\r\n if (state.tables === undefined) {\r\n state.tables = [action.payload];\r\n state.isLoading = action.payload.loading;\r\n } else {\r\n const table = state.tables.find(t => t.id === action.payload.id);\r\n if (table !== undefined) {\r\n table.loading = action.payload.loading;\r\n } else {\r\n state.tables.push(action.payload);\r\n }\r\n state.isLoading = state.tables.some(t => t.loading === true);\r\n }\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: printPDFActions } = slice;\r\n\r\nexport const usePrintPDFSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: printPDFSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n call,\r\n put,\r\n take,\r\n select,\r\n takeLatest,\r\n takeLeading,\r\n takeEvery,\r\n all,\r\n} from 'redux-saga/effects';\r\nimport { serviceRequestsKanbanActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport {\r\n selectServiceRequestsKanbanData,\r\n selectServiceRequestsKanbanTickets,\r\n} from './selectors';\r\nimport { Dto, IDataList, ISection, ReorderPayload } from './types';\r\nimport { omit } from 'lodash';\r\nimport { takeLatestByKey } from 'utils/redux-saga';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\nimport { extractErrorMessages, getModelStateErrors } from 'api/utils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ServiceRequestTicketDetailsProps } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\n\r\nconst ENTITY_SET_URL = '/api/odata/v4/ServiceRequestTickets';\r\n\r\nconst fetchTicketsByStatusId = async (params: {\r\n statusId: number;\r\n top: number;\r\n skip: number;\r\n}) => {\r\n const response: IODataQueryResponse = await httpClient.get(\r\n ENTITY_SET_URL,\r\n fetchTicketsParams({\r\n statusId: params.statusId,\r\n top: params.top + 1,\r\n skip: params.skip,\r\n }),\r\n );\r\n const count = response['@odata.count'];\r\n const result: IDataList = {\r\n id: params.statusId,\r\n items: response.value.slice(0, params.top),\r\n count: count ?? 0,\r\n more: response.value.length > params.top,\r\n };\r\n return result;\r\n};\r\nconst fetchTicketById = async (params: { Id: number | null }) => {\r\n if (params.Id === null) {\r\n return Promise.resolve(undefined);\r\n } else {\r\n const response = await httpClient.get(\r\n `${ENTITY_SET_URL}(${params.Id})`,\r\n FETCH_SELECT_EXPAND,\r\n );\r\n return response;\r\n }\r\n};\r\n\r\nconst FETCH_SELECT_EXPAND = {\r\n $select: [\r\n 'Id',\r\n 'Index',\r\n 'SubSamplesCount',\r\n 'TotalSamplesCount',\r\n 'SamplesCount',\r\n 'Priority',\r\n 'ParentTicketId',\r\n 'ServiceRequestId',\r\n ].join(','),\r\n $expand: [\r\n 'Status($select=Id,Name)',\r\n //'Service($select=Id,Name)',\r\n //'ServiceRequestStatus($select=Id,Name)',\r\n 'AssignedTo($select=Id,Name)',\r\n 'ServiceRequest($select=CreatedFor,Service;$expand=CreatedFor($select=Id,Name),Service($select=Id,Name;$expand=ServiceGroup($select=Id,Name)),Budget($select=Id,Name))',\r\n ].join(','),\r\n};\r\nfunction fetchTicketsParams(params: {\r\n statusId: number;\r\n top: number;\r\n skip: number;\r\n}): any {\r\n return {\r\n ...FETCH_SELECT_EXPAND,\r\n $filter: `Status/Id eq ${params.statusId}`,\r\n $top: params.top,\r\n $skip: params.skip,\r\n $count: true,\r\n $orderBy: 'Index',\r\n };\r\n}\r\n/**\r\n * Number of initially fetched tickets per each status\r\n */\r\nconst INITIAL_TOP = 10;\r\nconst notificationMessageKey_getItems = 'getItems';\r\nfunction* doGetItems(action: PayloadAction) {\r\n try {\r\n const bar: Array> = yield all(\r\n action.payload.map(statusId =>\r\n call(fetchTicketsByStatusId, { statusId, top: INITIAL_TOP, skip: 0 }),\r\n ),\r\n );\r\n\r\n yield put(actions.getItems_Success(bar));\r\n } catch (error: unknown) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey_getItems,\r\n message: i18next.t(translations.errormessage),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.getItems_Error(Error));\r\n }\r\n}\r\nfunction* doGetMoreItems(action: PayloadAction) {\r\n const tickets: Record<\r\n string,\r\n IDataList\r\n > = yield select(selectServiceRequestsKanbanTickets);\r\n\r\n try {\r\n const section = tickets[action.payload.toString()];\r\n const bar: IDataList = yield call(\r\n fetchTicketsByStatusId,\r\n {\r\n statusId: action.payload,\r\n top: INITIAL_TOP,\r\n skip: section.items.length,\r\n },\r\n );\r\n\r\n yield put(actions.getMoreItems_Success(bar));\r\n } catch (error: unknown) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey_getItems,\r\n message: i18next.t(translations.errormessage),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.getItems_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doSetSelectedStatuses(\r\n action: PayloadAction,\r\n) {\r\n if (action.payload !== undefined) {\r\n const original: Record = yield select(\r\n selectServiceRequestsKanbanTickets,\r\n );\r\n const loadedIds = Object.keys(original);\r\n const currentStatusIdentifiers = action.payload\r\n .map(f => f.Id)\r\n .filter(statusId => !loadedIds.includes(statusId.toString()));\r\n\r\n if (currentStatusIdentifiers.length > 0) {\r\n yield put(actions.getItems(currentStatusIdentifiers));\r\n }\r\n }\r\n}\r\nfunction* doReorder(action: PayloadAction) {\r\n try {\r\n const data: ISection<\r\n IServiceRequestStatusDto,\r\n IServiceRequestTicketDto\r\n >[] = yield select(selectServiceRequestsKanbanData);\r\n\r\n const indexChanges = data\r\n .flatMap(section => {\r\n return (\r\n section.data?.items?.map((item, index) => {\r\n return {\r\n Id: item.Id,\r\n Index: item.Index === index ? undefined : index,\r\n Status:\r\n item.Status.Id === section.id ? undefined : section.section,\r\n };\r\n }) ?? []\r\n );\r\n })\r\n .filter(item => item.Status !== undefined);\r\n\r\n const payload = {\r\n Id: action.payload.Id,\r\n ServiceRequestStatusId: action.payload.destinationSectionId,\r\n Index: action.payload.destinationIndex,\r\n };\r\n\r\n yield call(\r\n httpClient.patch,\r\n `${ENTITY_SET_URL}(${payload.Id})`,\r\n omit(payload, 'Id'),\r\n );\r\n yield put(actions.reorder_Success(indexChanges));\r\n } catch (error) {\r\n yield put(\r\n actions.reorder_Error({\r\n destinationIndex: action.payload.sourceIndex,\r\n destinationSectionId: action.payload.sourceSectionId,\r\n Id: action.payload.Id,\r\n sourceIndex: action.payload.destinationIndex,\r\n sourceSectionId: action.payload.destinationSectionId,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doInsert(action: PayloadAction>) {\r\n const url = ENTITY_SET_URL;\r\n const notificationMessageKey = 'serviceRequestTicektsInsert';\r\n try {\r\n const payload: Partial = {\r\n AssignedTo_Id: action.payload.AssignedTo?.Id,\r\n Index: action.payload.Index,\r\n Priority: action.payload.Priority,\r\n SamplesCount: action.payload.SamplesCount,\r\n ServiceRequestId: action.payload.ParentTicket?.ServiceRequestId,\r\n ServiceRequestStatusId: action.payload.Status?.Id,\r\n ParentTicketId: action.payload.ParentTicketId,\r\n };\r\n const response = yield call(httpClient.post, url, payload);\r\n const p: Dto = {\r\n ...action.payload.ParentTicket,\r\n ...response,\r\n ...action.payload,\r\n };\r\n yield put(actions.insert_Success(p));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey,\r\n variant: 'success',\r\n message: i18next.t(translations.GenericInsertSuccessMessage),\r\n }),\r\n );\r\n } catch (error) {\r\n yield put(actions.insert_Error());\r\n const modelState = getModelStateErrors(error);\r\n console.error(error);\r\n if (modelState !== undefined) {\r\n const messages = Object.values(modelState).flat();\r\n for (const message of messages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey,\r\n variant: 'error',\r\n message: message,\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n}\r\nfunction* doUpdate(\r\n action: PayloadAction>,\r\n) {\r\n const url = `${ENTITY_SET_URL}(${action.payload.Id})`;\r\n const notificationMessageKey = 'serviceRequestTicketUpdate';\r\n try {\r\n const payload: Partial = {\r\n AssignedTo_Id: action.payload.AssignedTo?.Id,\r\n Priority: action.payload.Priority,\r\n Index: action.payload.Index,\r\n ServiceRequestStatusId: action.payload.Status?.Id,\r\n SamplesCount: action.payload.SamplesCount,\r\n };\r\n yield call(httpClient.patch, url, payload);\r\n yield put(actions.update_Success(action.payload));\r\n yield put(layoutActions.resetSidePanel());\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey,\r\n variant: 'success',\r\n message: i18next.t(translations.GenericUpdateSuccessMessage),\r\n }),\r\n );\r\n //yield put(layoutActions.resetSidePanel());\r\n } catch (error) {\r\n yield put(actions.update_Error());\r\n const messages = extractErrorMessages(error);\r\n if (messages !== undefined) {\r\n for (const message of messages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: notificationMessageKey,\r\n variant: 'error',\r\n message: message,\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Runs a monitor on a given selector\r\n * @param selector selector to monitor\r\n */\r\nfunction* selectorChangeSaga(selector, pattern) {\r\n let previousValue;\r\n while (true) {\r\n const currentValue = yield* monitorSelector(\r\n selector,\r\n previousValue,\r\n pattern,\r\n );\r\n if (previousValue !== currentValue) {\r\n //yield spawn(loadRowSaga, focusType, focusId);\r\n }\r\n previousValue = currentValue;\r\n }\r\n}\r\n\r\nfunction* monitorSelector(selector, previousValue, takePattern = '*') {\r\n while (true) {\r\n const nextValue = yield select(selector);\r\n if (nextValue !== previousValue) {\r\n return nextValue;\r\n }\r\n yield take(takePattern);\r\n }\r\n}\r\nfunction* doShowEdit(action: PayloadAction) {\r\n // const data = yield select(s)\r\n\r\n const openSidePanelProps: ServiceRequestTicketDetailsProps = {\r\n item: action.payload,\r\n useSidePanel: true,\r\n };\r\n const parent = yield call(fetchTicketById, {\r\n Id: action.payload.ParentTicketId,\r\n });\r\n yield put(\r\n actions.showEdit_Success({\r\n ...action.payload,\r\n ParentTicket: parent,\r\n }),\r\n );\r\n yield put(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.ServiceRequestTicketDetails,\r\n props: openSidePanelProps,\r\n }),\r\n );\r\n}\r\nfunction* doShowEditParent(action: PayloadAction) {\r\n try {\r\n const ticket = yield call(fetchTicketById, {\r\n Id: action.payload.ParentTicketId,\r\n });\r\n yield put(actions.showEdit(ticket));\r\n } catch (error) {\r\n yield put(actions.showEdit_Error());\r\n }\r\n}\r\nexport function* serviceRequestsKanbanSaga() {\r\n yield takeLatest(actions.getItems.type, doGetItems);\r\n yield takeLatestByKey(\r\n actions.getMoreItems.type,\r\n f => f,\r\n doGetMoreItems,\r\n );\r\n yield takeLatest(actions.setSelectedStatuses.type, doSetSelectedStatuses);\r\n yield takeEvery(actions.reorder.type, doReorder);\r\n yield takeLeading(actions.insert.type, doInsert);\r\n yield takeLeading(actions.update.type, doUpdate);\r\n yield takeLeading(actions.showEdit.type, doShowEdit);\r\n yield takeLeading(actions.showEditParent.type, doShowEditParent);\r\n yield selectorChangeSaga(\r\n selectServiceRequestsKanbanTickets,\r\n actions.setSelectedStatuses.type,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { serviceRequestsKanbanSaga } from './saga';\r\nimport {\r\n Dto,\r\n IDataList,\r\n ServiceRequestsKanbanState,\r\n ReorderPayload,\r\n} from './types';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { isEqual, orderBy } from 'lodash';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\n\r\nexport const initialState: ServiceRequestsKanbanState = {\r\n data: {},\r\n selectedStatuses: [],\r\n selectedStatusIds: [],\r\n fetchCount: 2,\r\n processingUpdate: false,\r\n processingInsert: false,\r\n ticket: {},\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'serviceRequestsKanban',\r\n initialState,\r\n reducers: {\r\n setSelectedStatuses(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n const ids = orderBy(action.payload?.map(f => f.Id));\r\n const p = orderBy(state.selectedStatuses.map(f => f.Id));\r\n if (!isEqual(ids, p)) {\r\n state.selectedStatusIds = ids;\r\n }\r\n state.selectedStatuses = action.payload ?? [];\r\n },\r\n getItems(state, action: PayloadAction) {},\r\n\r\n getItems_Success(state, action: PayloadAction>>) {\r\n action.payload.forEach(item => {\r\n state.data[item.id.toString()] = item;\r\n });\r\n },\r\n getItems_Error(state, action: PayloadAction) {\r\n // state.processing = false;\r\n // state.error = 'ERROR';\r\n },\r\n getMoreItems(state, action: PayloadAction) {},\r\n getMoreItems_Success(state, action: PayloadAction>) {\r\n const section = state.data[action.payload.id.toString()];\r\n section.items.push(...action.payload.items);\r\n section.more = action.payload.more;\r\n },\r\n reorder(state, action: PayloadAction) {\r\n const sourceSection =\r\n state.data[action.payload.sourceSectionId.toString()];\r\n if (sourceSection === undefined) {\r\n return;\r\n }\r\n const destinationSection =\r\n state.data[action.payload.destinationSectionId.toString()];\r\n if (destinationSection === undefined) {\r\n return;\r\n }\r\n const [removed] = sourceSection?.items?.splice(\r\n action.payload.sourceIndex,\r\n 1,\r\n );\r\n\r\n destinationSection?.items?.splice(\r\n action.payload.destinationIndex,\r\n 0,\r\n removed,\r\n );\r\n },\r\n reorder_Success(\r\n state,\r\n action: PayloadAction<\r\n Array & Partial>>\r\n >,\r\n ) {\r\n action.payload.forEach(item => {\r\n Object.values(state.data).forEach(section => {\r\n const { Id, ...props } = item;\r\n const ticket = section.items.find(f => f.Id === Id);\r\n if (ticket !== undefined) {\r\n if (props.Index !== undefined) ticket.Index = props.Index;\r\n if (props.Status !== undefined) ticket.Status = props.Status;\r\n }\r\n });\r\n });\r\n },\r\n //todo reuse update & updateError function bodies\r\n reorder_Error(state, action: PayloadAction) {\r\n const sourceSection =\r\n state.data[action.payload.sourceSectionId.toString()];\r\n if (sourceSection === undefined) {\r\n return;\r\n }\r\n const destinationSection =\r\n state.data[action.payload.destinationSectionId.toString()];\r\n if (destinationSection === undefined) {\r\n return;\r\n }\r\n const [removed] = sourceSection?.items?.splice(\r\n action.payload.sourceIndex,\r\n 1,\r\n );\r\n\r\n destinationSection?.items?.splice(\r\n action.payload.destinationIndex,\r\n 0,\r\n removed,\r\n );\r\n },\r\n\r\n showAddSubTicket(state, action: PayloadAction | undefined>) {\r\n state.showAddSubTicket = action.payload !== undefined;\r\n state.parentTicket = action.payload;\r\n },\r\n showEdit(state, action: PayloadAction) {\r\n state.ticket.status = 'pending';\r\n },\r\n showEditParent(state, action: PayloadAction) {\r\n state.ticket.status = 'pending';\r\n },\r\n showEdit_Success(state, action: PayloadAction) {\r\n state.ticket.status = 'resolved';\r\n state.ticket.value = action.payload;\r\n },\r\n showEdit_Error(state, action: PayloadAction) {\r\n state.ticket.status = 'rejected';\r\n },\r\n insert(state, action: PayloadAction>) {\r\n state.processingInsert = true;\r\n },\r\n insert_Success(state, action: PayloadAction) {\r\n // subtract number of samples from the samples count on the main ticket - for sub tickets only\r\n updateSamplesCount(action.payload, state);\r\n\r\n // insert newly created ticket into corresponding section based on the status\r\n // and push the index on the tickets that come after the newly inserted ticket\r\n const statusId = action.payload.Status?.Id;\r\n if (statusId !== undefined) {\r\n const index = action.payload.Index;\r\n if (index !== undefined) {\r\n const section = state.data[statusId.toString()];\r\n const items = section.items;\r\n if (items !== undefined) {\r\n items.slice(index).forEach(ticket => (ticket.Index += 1));\r\n items.splice(index, 0, action.payload);\r\n }\r\n }\r\n }\r\n state.parentTicket = undefined;\r\n state.showAddSubTicket = false;\r\n state.processingInsert = false;\r\n },\r\n insert_Error(state, action: PayloadAction) {\r\n state.processingInsert = false;\r\n },\r\n\r\n update(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.processingUpdate = true;\r\n },\r\n update_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n Object.keys(state.data).forEach(key => {\r\n const item = Object.values(state.data)\r\n .flatMap(section => section.items)\r\n .find(f => f.Id === action.payload.Id);\r\n if (item !== undefined) {\r\n //item = {...item, ...action.payload};\r\n Object.assign(item, action.payload);\r\n }\r\n });\r\n updateSamplesCount(\r\n action.payload,\r\n state,\r\n state.ticket.value?.SamplesCount ?? undefined,\r\n );\r\n state.processingUpdate = false;\r\n },\r\n update_Error(state, action: PayloadAction) {\r\n state.processingUpdate = false;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: serviceRequestsKanbanActions } = slice;\r\n\r\nexport const useServiceRequestsKanbanSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: serviceRequestsKanbanSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\nfunction updateSamplesCount(\r\n payload: Partial,\r\n\r\n state,\r\n originalSamplesCount?: number,\r\n) {\r\n if (payload.SamplesCount !== undefined) {\r\n if (payload.ParentTicket !== undefined) {\r\n const parent = state.data[\r\n payload.ParentTicket.Status.Id.toString()\r\n ].items.find(f => f.Id === payload.ParentTicket?.Id);\r\n if (parent !== undefined) {\r\n parent.SamplesCount -=\r\n (payload.SamplesCount ?? 0) - (originalSamplesCount ?? 0);\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useServiceRequestsKanbanSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.largeFilesUpload || initialState;\r\n\r\nexport const selectLargeFilesUpload = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\nexport const selectLargeFilesCanUpload = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.canUpload,\r\n);\r\nexport const selectLargeFilesUploading = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.uploading,\r\n);\r\nexport const selectLargeFilesStartedToUpload = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.startedToUpload,\r\n);\r\nexport const selectLargeFilesUploadTargetId = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.targetId,\r\n);\r\nexport const selectLargeFilesUploadFilesNumber = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.numberOfUploadedFiles,\r\n);\r\nexport const selectLargeFilesUploadSelectedFiles = createSelector(\r\n [selectLargeFilesUpload],\r\n state => state.selectedFiles,\r\n);\r\n","import { IOfflineServiceTypeDto } from 'api/odata/generated/entities/IOfflineServiceTypeDto';\r\nimport { IAsset } from 'app/pages/AssetPopUp/IAsset';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\n\r\nexport function useAdminPermissions() {\r\n const user = useSelector(selectAuthenticatedUser);\r\n const roles: number[] | undefined = user?.Roles;\r\n\r\n const allowedToEdit = React.useCallback(\r\n (\r\n row: Pick,\r\n ): boolean => {\r\n if (!user) return false;\r\n return (\r\n user.HasAdminGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n (row.ServiceType !== null &&\r\n row.ServiceId !== null &&\r\n user.HasAdminServicePermissions(\r\n ServiceType[row.ServiceType],\r\n row.ServiceId,\r\n ))\r\n );\r\n },\r\n [user],\r\n );\r\n const allowedToAdd = React.useCallback(\r\n (row: Pick): boolean => {\r\n if (!user) return false;\r\n return (\r\n user.HasCreateAdminGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n user.HasAdminGroupPermissions(row.ServiceGroupId ?? undefined)\r\n );\r\n },\r\n [user],\r\n );\r\n const allowedToEditOffline = React.useCallback(\r\n (row: Pick): boolean => {\r\n if (!user) return false;\r\n return (\r\n user.HasAdminGroupPermissions(row.ServiceGroupId) ||\r\n user.HasAdminServicePermissions(ServiceType.Offline, row.Id)\r\n );\r\n },\r\n [user],\r\n );\r\n const allowedToAddOffline = React.useCallback(\r\n (row: Pick): boolean => {\r\n if (!user) return false;\r\n return (\r\n user.HasCreateAdminGroupPermissions(row.ServiceGroupId) ||\r\n user.HasAdminGroupPermissions(row.ServiceGroupId)\r\n );\r\n },\r\n [user],\r\n );\r\n const allowedToEditBatch = React.useCallback(\r\n (row: Pick): boolean => {\r\n if (!user) return false;\r\n return (\r\n user.HasAdminGroupPermissions(row.ServiceGroupId) ||\r\n user.HasAdminServicePermissions(ServiceType.Offline, row.Id) ||\r\n user.HasLabTechGroupPermissions(row.ServiceGroupId) ||\r\n user.HasLabTechServicePermissions(ServiceType.Offline, row.Id)\r\n );\r\n },\r\n [user],\r\n );\r\n const allowedToEditGroup = React.useCallback(\r\n (row: Pick): boolean => {\r\n if (!user) return false;\r\n return user.HasAdminGroupOnlyPermissions(row.Id);\r\n },\r\n [user],\r\n );\r\n const allowedRoles = [\r\n Roles.Administrators,\r\n Roles.EquipmentAdministrator,\r\n Roles.GroupAdministrators,\r\n Roles.CreateNewAssetsAdmin,\r\n ];\r\n const hasRolePermissions: boolean =\r\n intersection(roles, allowedRoles).length > 0;\r\n return {\r\n hasRolePermissions,\r\n allowedToEdit,\r\n allowedToAdd,\r\n allowedToEditOffline,\r\n allowedToAddOffline,\r\n allowedToEditBatch,\r\n allowedToEditGroup,\r\n };\r\n}\r\n","export function sum(values, aggregatedValues) {\r\n // It's faster to just add the aggregations together instead of\r\n // process leaf nodes individually\r\n return aggregatedValues.reduce(\r\n (sum, next) => sum + (typeof next === 'number' ? next : 0),\r\n 0,\r\n );\r\n}\r\n\r\nexport function min(values) {\r\n let min = values[0] || 0;\r\n\r\n values.forEach(value => {\r\n if (typeof value === 'number') {\r\n min = Math.min(min, value);\r\n }\r\n });\r\n\r\n return min;\r\n}\r\n\r\nexport function max(values) {\r\n let max = values[0] || 0;\r\n\r\n values.forEach(value => {\r\n if (typeof value === 'number') {\r\n max = Math.max(max, value);\r\n }\r\n });\r\n\r\n return max;\r\n}\r\n\r\nexport function minMax(values) {\r\n let min = values[0] || 0;\r\n let max = values[0] || 0;\r\n\r\n values.forEach(value => {\r\n if (typeof value === 'number') {\r\n min = Math.min(min, value);\r\n max = Math.max(max, value);\r\n }\r\n });\r\n\r\n return `${min}..${max}`;\r\n}\r\n\r\nexport function average(values) {\r\n return sum(null, values) / values.length;\r\n}\r\n\r\nexport function median(values) {\r\n if (!values.length) {\r\n return null;\r\n }\r\n\r\n const mid = Math.floor(values.length / 2);\r\n const nums = [...values].sort((a, b) => a - b);\r\n return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;\r\n}\r\n\r\nexport function unique(values) {\r\n return Array.from(new Set(values).values());\r\n}\r\n\r\nexport function uniqueCount(values) {\r\n return new Set(values).size;\r\n}\r\n\r\nexport function count(values) {\r\n return values.length;\r\n}\r\n","import { defaultColumn, emptyRenderer } from 'react-table';\r\n\r\n// Find the depth of the columns\r\nexport function findMaxDepth(columns, depth = 0) {\r\n return columns.reduce((prev, curr) => {\r\n if (curr.columns) {\r\n return Math.max(prev, findMaxDepth(curr.columns, depth + 1));\r\n }\r\n return depth;\r\n }, 0);\r\n}\r\n\r\n// Build the visible columns, headers and flat column list\r\nexport function linkColumnStructure(columns, parent, depth = 0) {\r\n return columns.map(column => {\r\n column = {\r\n ...column,\r\n parent,\r\n depth,\r\n };\r\n\r\n assignColumnAccessor(column);\r\n\r\n if (column.columns) {\r\n column.columns = linkColumnStructure(column.columns, column, depth + 1);\r\n }\r\n return column;\r\n });\r\n}\r\n\r\nexport function flattenColumns(columns) {\r\n return flattenBy(columns, 'columns');\r\n}\r\n\r\nexport function assignColumnAccessor(column) {\r\n // First check for string accessor\r\n let { id, accessor, Header } = column;\r\n\r\n if (typeof accessor === 'string') {\r\n id = id || accessor;\r\n const accessorPath = accessor.split('.');\r\n accessor = row => getBy(row, accessorPath);\r\n }\r\n\r\n if (!id && typeof Header === 'string' && Header) {\r\n id = Header;\r\n }\r\n\r\n if (!id && column.columns) {\r\n console.error(column);\r\n throw new Error('A column ID (or unique \"Header\" value) is required!');\r\n }\r\n\r\n if (!id) {\r\n console.error(column);\r\n throw new Error('A column ID (or string accessor) is required!');\r\n }\r\n\r\n Object.assign(column, {\r\n id,\r\n accessor,\r\n });\r\n\r\n return column;\r\n}\r\n\r\nexport function decorateColumn(column, userDefaultColumn) {\r\n if (!userDefaultColumn) {\r\n throw new Error();\r\n }\r\n Object.assign(column, {\r\n // Make sure there is a fallback header, just in case\r\n Header: emptyRenderer,\r\n Footer: emptyRenderer,\r\n ...defaultColumn,\r\n ...userDefaultColumn,\r\n ...column,\r\n });\r\n\r\n Object.assign(column, {\r\n originalWidth: column.width,\r\n });\r\n\r\n return column;\r\n}\r\n\r\n// Build the header groups from the bottom up\r\nexport function makeHeaderGroups(\r\n allColumns,\r\n defaultColumn,\r\n additionalHeaderProperties = () => ({}),\r\n) {\r\n const headerGroups = [];\r\n\r\n let scanColumns = allColumns;\r\n\r\n let uid = 0;\r\n const getUID = () => uid++;\r\n\r\n while (scanColumns.length) {\r\n // The header group we are creating\r\n const headerGroup = {\r\n headers: [],\r\n };\r\n\r\n // The parent columns we're going to scan next\r\n const parentColumns = [];\r\n\r\n const hasParents = scanColumns.some(d => d.parent);\r\n\r\n // Scan each column for parents\r\n scanColumns.forEach(column => {\r\n // What is the latest (last) parent column?\r\n let latestParentColumn = [...parentColumns].reverse()[0];\r\n\r\n let newParent;\r\n\r\n if (hasParents) {\r\n // If the column has a parent, add it if necessary\r\n if (column.parent) {\r\n newParent = {\r\n ...column.parent,\r\n originalId: column.parent.id,\r\n id: `${column.parent.id}_${getUID()}`,\r\n headers: [column],\r\n ...additionalHeaderProperties(column),\r\n };\r\n } else {\r\n // If other columns have parents, we'll need to add a place holder if necessary\r\n const originalId = `${column.id}_placeholder`;\r\n newParent = decorateColumn(\r\n {\r\n originalId,\r\n id: `${column.id}_placeholder_${getUID()}`,\r\n placeholderOf: column,\r\n headers: [column],\r\n ...additionalHeaderProperties(column),\r\n },\r\n defaultColumn,\r\n );\r\n }\r\n\r\n // If the resulting parent columns are the same, just add\r\n // the column and increment the header span\r\n if (\r\n latestParentColumn &&\r\n latestParentColumn.originalId === newParent.originalId\r\n ) {\r\n latestParentColumn.headers.push(column);\r\n } else {\r\n parentColumns.push(newParent);\r\n }\r\n }\r\n\r\n headerGroup.headers.push(column);\r\n });\r\n\r\n headerGroups.push(headerGroup);\r\n\r\n // Start scanning the parent columns\r\n scanColumns = parentColumns;\r\n }\r\n\r\n return headerGroups.reverse();\r\n}\r\n\r\nconst pathObjCache = new Map();\r\n\r\nexport function getBy(obj, path, def) {\r\n if (!path) {\r\n return obj;\r\n }\r\n const cacheKey = typeof path === 'function' ? path : JSON.stringify(path);\r\n\r\n const pathObj =\r\n pathObjCache.get(cacheKey) ||\r\n (() => {\r\n const pathObj = makePathArray(path);\r\n pathObjCache.set(cacheKey, pathObj);\r\n return pathObj;\r\n })();\r\n\r\n let val;\r\n\r\n try {\r\n val = pathObj.reduce((cursor, pathPart) => cursor[pathPart], obj);\r\n } catch (e) {\r\n // continue regardless of error\r\n }\r\n return typeof val !== 'undefined' ? val : def;\r\n}\r\n\r\nexport function getFirstDefined(...args) {\r\n for (let i = 0; i < args.length; i += 1) {\r\n if (typeof args[i] !== 'undefined') {\r\n return args[i];\r\n }\r\n }\r\n}\r\n\r\nexport function getElementDimensions(element) {\r\n const rect = element.getBoundingClientRect();\r\n const style = window.getComputedStyle(element);\r\n const margins = {\r\n left: parseInt(style.marginLeft),\r\n right: parseInt(style.marginRight),\r\n };\r\n const padding = {\r\n left: parseInt(style.paddingLeft),\r\n right: parseInt(style.paddingRight),\r\n };\r\n return {\r\n left: Math.ceil(rect.left),\r\n width: Math.ceil(rect.width),\r\n outerWidth: Math.ceil(\r\n rect.width + margins.left + margins.right + padding.left + padding.right,\r\n ),\r\n marginLeft: margins.left,\r\n marginRight: margins.right,\r\n paddingLeft: padding.left,\r\n paddingRight: padding.right,\r\n scrollWidth: element.scrollWidth,\r\n };\r\n}\r\n\r\nexport function isFunction(a) {\r\n if (typeof a === 'function') {\r\n return a;\r\n }\r\n}\r\n\r\nexport function flattenBy(arr, key) {\r\n const flat = [];\r\n\r\n const recurse = arr => {\r\n arr.forEach(d => {\r\n if (!d[key]) {\r\n flat.push(d);\r\n } else {\r\n recurse(d[key]);\r\n }\r\n });\r\n };\r\n\r\n recurse(arr);\r\n\r\n return flat;\r\n}\r\n\r\nexport function expandRows(\r\n rows,\r\n { manualExpandedKey, expanded, expandSubRows = true },\r\n) {\r\n const expandedRows = [];\r\n\r\n const handleRow = (row, addToExpandedRows = true) => {\r\n row.isExpanded =\r\n (row.original && row.original[manualExpandedKey]) || expanded[row.id];\r\n\r\n row.canExpand = row.subRows && !!row.subRows.length;\r\n\r\n if (addToExpandedRows) {\r\n expandedRows.push(row);\r\n }\r\n\r\n if (row.subRows && row.subRows.length && row.isExpanded) {\r\n row.subRows.forEach(row => handleRow(row, expandSubRows));\r\n }\r\n };\r\n\r\n rows.forEach(row => handleRow(row));\r\n\r\n return expandedRows;\r\n}\r\n\r\nexport function getFilterMethod(filter, userFilterTypes, filterTypes) {\r\n return (\r\n isFunction(filter) ||\r\n userFilterTypes[filter] ||\r\n filterTypes[filter] ||\r\n filterTypes.text\r\n );\r\n}\r\n\r\nexport function shouldAutoRemoveFilter(autoRemove, value, column) {\r\n return autoRemove ? autoRemove(value, column) : typeof value === 'undefined';\r\n}\r\n\r\nexport function unpreparedAccessWarning() {\r\n throw new Error(\r\n 'React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.',\r\n );\r\n}\r\n\r\nlet passiveSupported = null;\r\nexport function passiveEventSupported() {\r\n // memoize support to avoid adding multiple test events\r\n if (typeof passiveSupported === 'boolean') return passiveSupported;\r\n\r\n let supported = false;\r\n try {\r\n const options = {\r\n get passive() {\r\n supported = true;\r\n return false;\r\n },\r\n };\r\n\r\n window.addEventListener('test', null, options);\r\n window.removeEventListener('test', null, options);\r\n } catch (err) {\r\n supported = false;\r\n }\r\n passiveSupported = supported;\r\n return passiveSupported;\r\n}\r\n\r\n//\r\n\r\nconst reOpenBracket = /\\[/g;\r\nconst reCloseBracket = /\\]/g;\r\n\r\nfunction makePathArray(obj) {\r\n return (\r\n flattenDeep(obj)\r\n // remove all periods in parts\r\n .map(d => String(d).replace('.', '_'))\r\n // join parts using period\r\n .join('.')\r\n // replace brackets with periods\r\n .replace(reOpenBracket, '.')\r\n .replace(reCloseBracket, '')\r\n // split it back out on periods\r\n .split('.')\r\n );\r\n}\r\n\r\nfunction flattenDeep(arr, newArr = []) {\r\n if (!Array.isArray(arr)) {\r\n newArr.push(arr);\r\n } else {\r\n for (let i = 0; i < arr.length; i += 1) {\r\n flattenDeep(arr[i], newArr);\r\n }\r\n }\r\n return newArr;\r\n}\r\n","import React from 'react';\r\n\r\nimport * as aggregations from './aggregations';\r\n\r\nimport { getFirstDefined, flattenBy } from './utils';\r\n\r\nimport {\r\n actions,\r\n ensurePluginOrder,\r\n useMountedLayoutEffect,\r\n useGetLatest,\r\n} from 'react-table';\r\n\r\nconst emptyArray = [];\r\nconst emptyObject = {};\r\n\r\n// Actions\r\nactions.resetGroupBy = 'resetGroupBy';\r\nactions.setGroupBy = 'setGroupBy';\r\n\r\nexport const useSummary = hooks => {\r\n hooks.stateReducers.push(reducer);\r\n hooks.visibleColumnsDeps.push((deps, { instance }) => [\r\n ...deps,\r\n instance.state.groupBy,\r\n ]);\r\n hooks.visibleColumns.push(visibleColumns);\r\n hooks.useInstance.push(useInstance);\r\n hooks.prepareRow.push(prepareRow);\r\n};\r\n\r\nuseSummary.pluginName = 'useSummary';\r\n\r\n// Reducer\r\nfunction reducer(state, action, previousState, instance) {\r\n if (action.type === actions.init) {\r\n return {\r\n groupBy: [],\r\n ...state,\r\n };\r\n }\r\n\r\n if (action.type === actions.resetGroupBy) {\r\n return {\r\n ...state,\r\n groupBy: instance.initialState.groupBy || [],\r\n };\r\n }\r\n\r\n if (action.type === actions.setGroupBy) {\r\n const { value } = action;\r\n return {\r\n ...state,\r\n groupBy: value,\r\n };\r\n }\r\n}\r\n\r\nfunction visibleColumns(\r\n columns,\r\n {\r\n instance: {\r\n state: { groupBy },\r\n },\r\n },\r\n) {\r\n // Sort grouped columns to the start of the column list\r\n // before the headers are built\r\n\r\n const groupByColumns = groupBy\r\n .map(g => columns.find(col => col.id === g))\r\n .filter(Boolean);\r\n\r\n const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id));\r\n\r\n columns = [...groupByColumns, ...nonGroupByColumns];\r\n\r\n columns.forEach(column => {\r\n column.isGrouped = groupBy.includes(column.id);\r\n column.groupedIndex = groupBy.indexOf(column.id);\r\n });\r\n\r\n return columns;\r\n}\r\n\r\nconst defaultUserAggregations = {};\r\n\r\nfunction useInstance(instance) {\r\n const {\r\n data,\r\n rows,\r\n flatRows,\r\n rowsById,\r\n allColumns,\r\n groupByFn = defaultGroupByFn,\r\n manualGroupBy,\r\n aggregations: userAggregations = defaultUserAggregations,\r\n plugins,\r\n state: { groupBy },\r\n dispatch,\r\n autoResetGroupBy = true,\r\n disableGroupBy,\r\n defaultCanGroupBy,\r\n } = instance;\r\n\r\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useSummary');\r\n\r\n allColumns.forEach(column => {\r\n const {\r\n accessor,\r\n defaultGroupBy: defaultColumnGroupBy,\r\n disableGroupBy: columnDisableGroupBy,\r\n } = column;\r\n\r\n column.canGroupBy = accessor\r\n ? getFirstDefined(\r\n column.canGroupBy,\r\n columnDisableGroupBy === true ? false : undefined,\r\n disableGroupBy === true ? false : undefined,\r\n true,\r\n )\r\n : getFirstDefined(\r\n column.canGroupBy,\r\n defaultColumnGroupBy,\r\n defaultCanGroupBy,\r\n false,\r\n );\r\n\r\n column.Aggregated = column.Aggregated || column.Cell;\r\n });\r\n const setGroupBy = React.useCallback(\r\n value => {\r\n dispatch({ type: actions.setGroupBy, value });\r\n },\r\n [dispatch],\r\n );\r\n\r\n const [\r\n groupedRows,\r\n groupedFlatRows,\r\n groupedRowsById,\r\n onlyGroupedFlatRows,\r\n onlyGroupedRowsById,\r\n nonGroupedFlatRows,\r\n nonGroupedRowsById,\r\n summaryRows,\r\n ] = React.useMemo(() => {\r\n if (manualGroupBy || !groupBy.length) {\r\n return [\r\n rows,\r\n flatRows,\r\n rowsById,\r\n emptyArray,\r\n emptyObject,\r\n flatRows,\r\n rowsById,\r\n ];\r\n }\r\n\r\n // Ensure that the list of filtered columns exist\r\n const existingGroupBy = groupBy.filter(g =>\r\n allColumns.find(col => col.id === g),\r\n );\r\n\r\n // Find the columns that can or are aggregating\r\n // Uses each column to aggregate rows into a single value\r\n const aggregateRowsToValues = (leafRows, groupedRows, depth) => {\r\n const values = {};\r\n\r\n allColumns.forEach(column => {\r\n // Don't aggregate columns that are in the groupBy\r\n if (existingGroupBy.includes(column.id)) {\r\n values[column.id] = groupedRows[0]\r\n ? groupedRows[0].values[column.id]\r\n : null;\r\n return;\r\n }\r\n\r\n // Aggregate the values\r\n let aggregateFn =\r\n typeof column.aggregate === 'function'\r\n ? column.aggregate\r\n : userAggregations[column.aggregate] ||\r\n aggregations[column.aggregate];\r\n\r\n if (aggregateFn) {\r\n // Get the columnValues to aggregate\r\n const groupedValues = groupedRows.map(row => row.values[column.id]);\r\n\r\n // Get the columnValues to aggregate\r\n const leafValues = leafRows.map(row => {\r\n let columnValue = row.values[column.id];\r\n\r\n if (!depth && column.aggregateValue) {\r\n const aggregateValueFn =\r\n typeof column.aggregateValue === 'function'\r\n ? column.aggregateValue\r\n : userAggregations[column.aggregateValue] ||\r\n aggregations[column.aggregateValue];\r\n\r\n if (!aggregateValueFn) {\r\n console.info({ column });\r\n throw new Error(\r\n `React Table: Invalid column.aggregateValue option for column listed above`,\r\n );\r\n }\r\n\r\n columnValue = aggregateValueFn(columnValue, row, column);\r\n }\r\n return columnValue;\r\n });\r\n\r\n values[column.id] = aggregateFn(leafValues, groupedValues);\r\n } else if (column.aggregate) {\r\n console.info({ column });\r\n throw new Error(\r\n `React Table: Invalid column.aggregate option for column listed above`,\r\n );\r\n } else {\r\n values[column.id] = null;\r\n }\r\n });\r\n\r\n return values;\r\n };\r\n\r\n let groupedFlatRows = [];\r\n const groupedRowsById = {};\r\n const onlyGroupedFlatRows = [];\r\n const onlyGroupedRowsById = {};\r\n const nonGroupedFlatRows = [];\r\n const nonGroupedRowsById = {};\r\n\r\n // Recursively group the data\r\n const groupUpRecursively = (rows, depth = 0, parentId) => {\r\n // This is the last level, just return the rows\r\n if (depth === existingGroupBy.length) {\r\n return rows;\r\n }\r\n\r\n const columnId = existingGroupBy[depth];\r\n\r\n // Group the rows together for this level\r\n let rowGroupsMap = groupByFn(rows, columnId);\r\n\r\n // Peform aggregations for each group\r\n const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\r\n ([groupByVal, groupedRows], index) => {\r\n let id = `${columnId}:${groupByVal}`;\r\n id = parentId ? `${parentId}>${id}` : id;\r\n\r\n // First, Recurse to group sub rows before aggregation\r\n const subRows = groupUpRecursively(groupedRows, depth + 1, id);\r\n\r\n // Flatten the leaf rows of the rows in this group\r\n const leafRows = depth\r\n ? flattenBy(groupedRows, 'leafRows')\r\n : groupedRows;\r\n\r\n const values = aggregateRowsToValues(leafRows, groupedRows, depth);\r\n\r\n const row = {\r\n id,\r\n isGrouped: true,\r\n groupByID: columnId,\r\n groupByVal,\r\n values,\r\n subRows,\r\n leafRows,\r\n depth,\r\n index,\r\n };\r\n\r\n subRows.forEach(subRow => {\r\n groupedFlatRows.push(subRow);\r\n groupedRowsById[subRow.id] = subRow;\r\n if (subRow.isGrouped) {\r\n onlyGroupedFlatRows.push(subRow);\r\n onlyGroupedRowsById[subRow.id] = subRow;\r\n } else {\r\n nonGroupedFlatRows.push(subRow);\r\n nonGroupedRowsById[subRow.id] = subRow;\r\n }\r\n });\r\n\r\n return row;\r\n },\r\n );\r\n\r\n return aggregatedGroupedRows;\r\n };\r\n\r\n const groupedRows = groupUpRecursively(rows);\r\n const summaryRows = [\r\n {\r\n id: 'summary',\r\n isGrouped: true,\r\n values: aggregateRowsToValues(rows, rows, 0),\r\n },\r\n ];\r\n groupedRows.forEach(subRow => {\r\n groupedFlatRows.push(subRow);\r\n groupedRowsById[subRow.id] = subRow;\r\n if (subRow.isGrouped) {\r\n onlyGroupedFlatRows.push(subRow);\r\n onlyGroupedRowsById[subRow.id] = subRow;\r\n } else {\r\n nonGroupedFlatRows.push(subRow);\r\n nonGroupedRowsById[subRow.id] = subRow;\r\n }\r\n });\r\n\r\n // Assign the new data\r\n return [\r\n groupedRows,\r\n groupedFlatRows,\r\n groupedRowsById,\r\n onlyGroupedFlatRows,\r\n onlyGroupedRowsById,\r\n nonGroupedFlatRows,\r\n nonGroupedRowsById,\r\n summaryRows,\r\n ];\r\n }, [\r\n manualGroupBy,\r\n groupBy,\r\n rows,\r\n flatRows,\r\n rowsById,\r\n allColumns,\r\n userAggregations,\r\n groupByFn,\r\n ]);\r\n\r\n const getAutoResetGroupBy = useGetLatest(autoResetGroupBy);\r\n\r\n useMountedLayoutEffect(() => {\r\n if (getAutoResetGroupBy()) {\r\n dispatch({ type: actions.resetGroupBy });\r\n }\r\n }, [dispatch, manualGroupBy ? null : data]);\r\n\r\n Object.assign(instance, {\r\n preGroupedRows: rows,\r\n preGroupedFlatRow: flatRows,\r\n preGroupedRowsById: rowsById,\r\n groupedRows,\r\n groupedFlatRows,\r\n groupedRowsById,\r\n onlyGroupedFlatRows,\r\n onlyGroupedRowsById,\r\n nonGroupedFlatRows,\r\n nonGroupedRowsById,\r\n rows: groupedRows,\r\n flatRows: groupedFlatRows,\r\n rowsById: groupedRowsById,\r\n setGroupBy,\r\n summaryRows,\r\n });\r\n}\r\n\r\nfunction prepareRow(row) {\r\n row.allCells.forEach(cell => {\r\n // Grouped cells are in the groupBy and the pivot cell for the row\r\n cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID;\r\n // Placeholder cells are any columns in the groupBy that are not grouped\r\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped;\r\n // Aggregated cells are not grouped, not repeated, but still have subRows\r\n cell.isAggregated =\r\n !cell.isGrouped && !cell.isPlaceholder && row.subRows?.length;\r\n });\r\n}\r\n\r\nexport function defaultGroupByFn(rows, columnId) {\r\n return rows.reduce((prev, row, i) => {\r\n // TODO: Might want to implement a key serializer here so\r\n // irregular column values can still be grouped if needed?\r\n const resKey = `${row.values[columnId]}`;\r\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : [];\r\n prev[resKey].push(row);\r\n return prev;\r\n }, {});\r\n}\r\n","import React from 'react';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../../IRow';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n getAssetImageThumbSrc,\r\n ImageSize,\r\n} from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport {\r\n BasicCardWithInfo,\r\n CardPosition,\r\n CardSize,\r\n} from 'app/components/BasicCards';\r\nimport { PrimaryAction } from './PrimaryAction';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser, selectImageExist } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface TableCardProps {\r\n row: Row;\r\n imageSrcKey?: keyof TRow;\r\n titleKey: keyof TRow;\r\n primaryAction?: PrimaryAction;\r\n someSelected: boolean;\r\n viewCheckBox?: boolean;\r\n useSelect: boolean;\r\n hasAdditionalActions: boolean;\r\n hasInlineRowActions: boolean;\r\n toggleAllRowsSelected?: (value?: boolean) => void;\r\n isRowSelectable: (row: Row) => boolean;\r\n active: boolean;\r\n cardSize?: CardSize;\r\n showTitleCell?: boolean;\r\n preventInnerClicks?: boolean;\r\n compact?: boolean;\r\n contentEditable?: boolean;\r\n cardPosition?: CardPosition;\r\n loading?: boolean;\r\n}\r\n\r\nexport function TableCard({\r\n row,\r\n imageSrcKey,\r\n titleKey,\r\n primaryAction,\r\n viewCheckBox = true,\r\n useSelect,\r\n hasAdditionalActions,\r\n hasInlineRowActions,\r\n toggleAllRowsSelected,\r\n isRowSelectable,\r\n someSelected,\r\n active,\r\n cardSize = 'small',\r\n showTitleCell,\r\n compact,\r\n contentEditable,\r\n cardPosition,\r\n loading,\r\n ...props\r\n}: TableCardProps) {\r\n const isMobile = DetectIsMobile() || compact === true;\r\n const user = useSelector(selectAuthenticatedUser);\r\n const { t } = useTranslation();\r\n const useButtons = React.useMemo(() => {\r\n return (\r\n hasInlineRowActions &&\r\n row.cells.filter(c => c.column.id.startsWith('InlineActionColumn'))\r\n .length > 0\r\n );\r\n }, [hasInlineRowActions, row.cells]);\r\n\r\n const sizeOfMobileCard = React.useMemo(() => {\r\n return isMobile ? (cardSize === undefined ? 'small' : cardSize) : undefined;\r\n }, [cardSize, isMobile]);\r\n const position = React.useMemo(() => {\r\n return isMobile\r\n ? 'horizontal'\r\n : cardPosition === undefined\r\n ? 'vertical'\r\n : cardPosition;\r\n }, [cardPosition, isMobile]);\r\n const img = React.useMemo(() => {\r\n return row.original[imageSrcKey ?? ''];\r\n }, [imageSrcKey, row.original]);\r\n const hasImg = React.useMemo(() => {\r\n return (img ?? null) !== null && typeof img === 'string';\r\n }, [img]);\r\n const imageExist = useSelector(state =>\r\n selectImageExist(state, hasImg ? img : null),\r\n );\r\n const imageSize = React.useMemo(() => {\r\n if (position === 'horizontal') {\r\n if (!!sizeOfMobileCard) {\r\n return sizeOfMobileCard === 'medium' ? 'thumbLarge' : 'thumb';\r\n } else {\r\n return cardSize === 'medium' ? 'horizontalLarge' : 'horizontal';\r\n }\r\n } else {\r\n return cardSize === 'medium' ? 'verticalLarge' : 'vertical';\r\n }\r\n }, [cardSize, position, sizeOfMobileCard]);\r\n const imgSrc = React.useMemo(() => {\r\n return getAssetImageThumbSrc(img, imageSize, imageExist);\r\n }, [imageExist, imageSize, img]);\r\n const [showSelect, setShowSelect] = React.useState(\r\n isMobile ? viewCheckBox === true : someSelected || viewCheckBox === true,\r\n );\r\n\r\n React.useEffect(() => {\r\n setShowSelect(\r\n isMobile ? viewCheckBox === true : someSelected || viewCheckBox === true,\r\n );\r\n }, [isMobile, someSelected, viewCheckBox]);\r\n const title = React.useMemo(() => {\r\n return row.cells.find(c => c.column.id === titleKey);\r\n }, [row.cells, titleKey]);\r\n const select = React.useMemo(() => {\r\n return row.cells.find(c => c.column.id === 'selection');\r\n }, [row.cells]);\r\n const isDisabled = React.useMemo(() => {\r\n return !isRowSelectable(row);\r\n }, [isRowSelectable, row]);\r\n const cells = React.useMemo(() => {\r\n return row.cells\r\n .filter(\r\n c =>\r\n c.column.id !== titleKey &&\r\n c.column.id !== imageSrcKey &&\r\n c.column.id !== 'selection',\r\n )\r\n .filter(f => f.value !== null && f.value !== undefined && f.value !== '')\r\n .slice(0, 3);\r\n }, [imageSrcKey, row.cells, titleKey]);\r\n\r\n return (\r\n {!!select && select.render('Cell')}\r\n }\r\n showBullet={true}\r\n cardSize={cardSize}\r\n mobileSize={sizeOfMobileCard}\r\n position={position}\r\n primaryAction={() => {\r\n if (!!primaryAction) {\r\n primaryAction(row, toggleAllRowsSelected, user, undefined, isMobile);\r\n } else if (useSelect && !isDisabled) {\r\n row.toggleRowSelected();\r\n }\r\n }}\r\n useSelect={useSelect} //&& viewCheckBox\r\n useButtons={useButtons}\r\n useImage={imageSrcKey !== undefined}\r\n topActions={\r\n hasAdditionalActions\r\n ? row.cells\r\n .filter(c => c.column.id.startsWith('ActionColumn'))\r\n .map(c => {\r\n return {\r\n key: c.column.id,\r\n action: c.render('Cell'),\r\n };\r\n })\r\n : undefined\r\n }\r\n hasTopActions={hasAdditionalActions}\r\n cardContentRows={\r\n cells.length > 0\r\n ? cells\r\n .filter(\r\n f =>\r\n !(\r\n f.column.id.startsWith('ActionColumn') ||\r\n f.column.id.startsWith('InlineActionColumn')\r\n ),\r\n )\r\n .map(c => {\r\n return {\r\n key: c.column.id,\r\n label: c.render('Header'),\r\n text: c.render('Cell'),\r\n };\r\n })\r\n : undefined\r\n }\r\n buttons={\r\n hasInlineRowActions\r\n ? row.cells\r\n .filter(c => c.column.id.startsWith('InlineActionColumn'))\r\n .map(c => {\r\n return {\r\n key: c.column.id,\r\n button: c.render('Cell'),\r\n };\r\n })\r\n : undefined\r\n }\r\n preventInnerClicks={props.preventInnerClicks}\r\n contentEditable={contentEditable}\r\n loading={loading}\r\n />\r\n );\r\n}\r\n","import { Grow, Tabs, useTheme } from '@material-ui/core';\r\nimport { TabsActionRenderer } from './TabsActionRender';\r\nimport * as React from 'react';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../..';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TabsToolbarProps\r\n extends ICanRaiseBasicTableRefreshEvent {\r\n rowsCount: number;\r\n rows: Row[];\r\n leftTabs?: TabsActionRenderer[];\r\n rightTabActions?: TabsActionRenderer[];\r\n selectedValue?: number;\r\n selectedArray: TRow[];\r\n toggleAllRowsSelected: (value?: boolean) => void;\r\n appliedFilters?: IFilterSettings[];\r\n allRowsSelected?: boolean;\r\n isRowSelectable: (row: Row) => boolean;\r\n getMultiMode?: (mode: boolean) => void;\r\n onAllRowsSelected?: (rows: Row[], selected: boolean) => void;\r\n disableMultiMode?: boolean;\r\n defaultMultiMode?: boolean;\r\n showClear?: boolean;\r\n compact?: boolean;\r\n selectMultiLabel?: string;\r\n}\r\n\r\nexport const TabsToolbar = React.memo(function TabsToolbarFunc(\r\n props: TabsToolbarProps,\r\n) {\r\n const {\r\n leftTabs,\r\n selectedValue,\r\n onRefresh,\r\n selectedArray,\r\n toggleAllRowsSelected,\r\n appliedFilters,\r\n rowsCount,\r\n rows,\r\n allRowsSelected,\r\n isRowSelectable,\r\n getMultiMode,\r\n onAllRowsSelected,\r\n disableMultiMode,\r\n defaultMultiMode = true,\r\n rightTabActions,\r\n //showClear,\r\n compact,\r\n } = props;\r\n const [value, setValue] = React.useState(selectedValue || 0);\r\n const isMobile = DetectIsMobile();\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n const [multiMode, setMultiMode] = React.useState(\r\n (selectedArray.length > 0 && !disableMultiMode) ||\r\n defaultMultiMode === true,\r\n );\r\n // const handleChecked = React.useCallback(\r\n // ev => {\r\n // if (!multiMode) {\r\n // setMultiMode(true);\r\n // !!getMultiMode && getMultiMode(true);\r\n // } else {\r\n // let selectable = rows.filter(f => isRowSelectable(f));\r\n // selectable.forEach(f => {\r\n // f.isSelected && f.toggleRowSelected(false);\r\n // });\r\n // if (!!onAllRowsSelected) {\r\n // onAllRowsSelected(selectable, false);\r\n // }\r\n // setMultiMode(false);\r\n // !!getMultiMode && getMultiMode(false);\r\n // }\r\n // },\r\n // [getMultiMode, isRowSelectable, multiMode, onAllRowsSelected, rows],\r\n // );\r\n const handleChange = (event: any, newValue: number) => {\r\n setValue(newValue);\r\n };\r\n React.useEffect(() => {\r\n if (selectedArray.length > 1 || defaultMultiMode === true) {\r\n //!multiMode &&\r\n setMultiMode(true);\r\n } else {\r\n setMultiMode(false);\r\n }\r\n }, [defaultMultiMode, multiMode, selectedArray.length]);\r\n return (\r\n \r\n {!isMobile && !compact && (\r\n
\r\n {!!leftTabs && leftTabs.length > 0 && (\r\n \r\n ref?.updateIndicator()}\r\n selectionFollowsFocus={false}\r\n indicatorColor=\"primary\"\r\n value={value}\r\n onChange={(ev, value) => handleChange(ev, value)}\r\n aria-label=\"nav tabs example\"\r\n >\r\n {leftTabs.map((tab, index) =>\r\n tab(\r\n rowsCount,\r\n rows,\r\n toggleAllRowsSelected,\r\n selectedArray,\r\n allRowsSelected,\r\n onRefresh,\r\n appliedFilters,\r\n ),\r\n )}\r\n \r\n \r\n )}\r\n
\r\n )}\r\n \r\n {/* selectedArray.length > 0 && (multiMode || showClear) && */}\r\n {!disableMultiMode && (\r\n }\r\n disabled={!(selectedArray.length > 0)}\r\n onClick={event => {\r\n event.stopPropagation();\r\n let selectable = rows.filter(f => isRowSelectable(f));\r\n selectable.forEach(f => {\r\n f.toggleRowSelected(false);\r\n });\r\n if (!!onAllRowsSelected) {\r\n onAllRowsSelected(selectable, false);\r\n }\r\n let allPagesUnselected = selectedArray.length > selectable.length;\r\n setMultiMode(allPagesUnselected);\r\n !!getMultiMode && getMultiMode(allPagesUnselected);\r\n }}\r\n >\r\n {compact || isMobile\r\n ? t(translations.Unselect)\r\n : t(translations.ClearSelection)}\r\n \r\n )}\r\n {/* (multiMode === true || selectedArray.length > 0) && */}\r\n {!disableMultiMode && (\r\n }\r\n onClick={() => {\r\n setMultiMode(true);\r\n !!getMultiMode && getMultiMode(true);\r\n let selectable = rows.filter(f => isRowSelectable(f));\r\n selectable.forEach(f => {\r\n f.toggleRowSelected(true);\r\n });\r\n if (!!onAllRowsSelected) {\r\n onAllRowsSelected(selectable, true);\r\n }\r\n }}\r\n >\r\n {t(translations.CoreSelectAll)}\r\n \r\n )}\r\n {/* */}\r\n\r\n {/* {tabRightActions\r\n .filter(f => f !== undefined)\r\n .map((tab, index) => (\r\n {tab(rowsCount, rows)}\r\n ))} */}\r\n \r\n {!!rightTabActions && rightTabActions.length > 0 && (\r\n <>\r\n {rightTabActions\r\n .filter(f => f !== undefined)\r\n .map((tab, index) => (\r\n {tab(rowsCount, rows)}\r\n ))}\r\n \r\n )}\r\n \r\n );\r\n});\r\nconst TabsContainer = styled('div')(({ theme }) => ({\r\n width: '100%',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n padding: '8px 32px',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n '&.shortView': {\r\n flexDirection: 'column',\r\n padding: '8px 8px 16px',\r\n alignItems: 'start',\r\n },\r\n '& .tabsContent': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n gap: 16,\r\n },\r\n '& .buttonsContent': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n //flexWrap: isMobile ? 'wrap' : 'nowrap',\r\n gap: 16,\r\n '&.shortView': {\r\n gap: 0,\r\n },\r\n },\r\n}));\r\n","import { useTheme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { SelectedRowsActionExtRenderer } from '../SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport * as React from 'react';\r\nimport { IdType, Row } from 'react-table';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { IRow } from '..';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../ControlledTable/ControlledTableProps';\r\nimport styled from 'styled-components';\r\n\r\nconst genericMemo: (component: T) => T = React.memo;\r\n\r\nexport interface FloatingActionsProps\r\n extends ICanRaiseBasicTableRefreshEvent {\r\n selectedActions: SelectedRowsActionExtRenderer[];\r\n rows: Row[];\r\n useSidePanel?: boolean;\r\n buttonActions?: SelectedRowsActionExtRenderer[];\r\n\r\n selectedArray: TRow[];\r\n toggleAllRowsSelected: (value?: boolean) => void;\r\n toggleRowSelected: (rowId: IdType, set?: boolean | undefined) => void;\r\n totalRows: number;\r\n compact?: boolean;\r\n}\r\n\r\nexport const FloatingContainer = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: 8,\r\n height: 72,\r\n background: '#ffffff',\r\n borderRadius: 8,\r\n boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n '&.fixedContainer': {\r\n position: 'fixed',\r\n insetBlock: 'auto 80px',\r\n insetInline: 'auto 160px',\r\n zIndex: 1070,\r\n width: '70%',\r\n padding: 16,\r\n '&.fullWidth': {\r\n width: '80%',\r\n },\r\n },\r\n '&.fixedContainerMobile': {\r\n //position: 'absolute',\r\n zIndex: 1070, //zIndex: 1500,\r\n width: '100%',\r\n padding: '16px 8px',\r\n //bottom: 'unset',\r\n position: 'fixed',\r\n bottom: '50px',\r\n '&.isPopup': {\r\n position: 'absolute',\r\n bottom: '50px',\r\n },\r\n },\r\n '& .buttonsContent': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: 8,\r\n width: 'calc(100% - 200px)',\r\n '&.mobile': {\r\n width: 'calc(100% - 115px)',\r\n },\r\n '&.compact': {\r\n width: 'auto',\r\n },\r\n '& .actions': {\r\n display: 'inline-flex',\r\n flex: '1 1 auto',\r\n position: 'relative',\r\n whiteSpace: 'nowrap',\r\n overflow: 'auto hidden',\r\n alignItems: 'center',\r\n gap: 8,\r\n '&.compactActions': {\r\n flex: '0 1 auto',\r\n },\r\n '& .rowsCount': {\r\n display: 'inline-flex',\r\n },\r\n },\r\n },\r\n '& .buttonActions': {\r\n display: 'inline-flex',\r\n flex: '1 1 auto',\r\n position: 'relative',\r\n whiteSpace: 'nowrap',\r\n overflow: 'auto hidden',\r\n gap: 8,\r\n },\r\n}));\r\n\r\nfunction FloatingActionsFunc(props: FloatingActionsProps) {\r\n const {\r\n selectedActions: actions,\r\n onRefresh,\r\n selectedArray,\r\n toggleAllRowsSelected,\r\n totalRows,\r\n buttonActions,\r\n useSidePanel,\r\n toggleRowSelected,\r\n compact,\r\n rows,\r\n } = props;\r\n const isMobile = DetectIsMobile() === true;\r\n const hideNavigation = useSelector(selectHideNavigation);\r\n\r\n const maxButtons = React.useMemo(() => {\r\n return isMobile || compact === true ? 1 : 6;\r\n }, [compact, isMobile]);\r\n const baseActions = React.useMemo(() => {\r\n return actions.length > maxButtons\r\n ? actions.slice(0, maxButtons - 1)\r\n : actions;\r\n }, [actions, maxButtons]);\r\n const sperActions = React.useMemo(() => {\r\n return actions.length > maxButtons ? actions.slice(maxButtons - 1) : [];\r\n }, [actions, maxButtons]);\r\n const theme = useTheme();\r\n // const toggleSingleSelected = (\r\n // rowId: IdType,\r\n // set?: boolean | undefined,\r\n // ) => {\r\n // let selectable = rows.filter(f => f.id === rowId).length > 0;\r\n // if (selectable) {\r\n // return toggleRowSelected(rowId, set);\r\n // }\r\n // };\r\n return (\r\n \r\n \r\n \r\n
\r\n {`${selectedArray.length} of ${totalRows} Items`}\r\n
\r\n {sperActions.length > 0 ? (\r\n \r\n {baseActions.map((item, index) =>\r\n item(\r\n selectedArray,\r\n rows,\r\n onRefresh,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n ),\r\n )}\r\n \r\n \r\n ) : (\r\n \r\n {actions.map((item, index) => (\r\n \r\n {item(\r\n selectedArray,\r\n rows,\r\n onRefresh,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n )}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n \r\n {!!buttonActions && buttonActions.length > 0 && (\r\n
\r\n {buttonActions.map((item, index) => (\r\n \r\n {item(\r\n selectedArray,\r\n rows,\r\n onRefresh,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n )}\r\n \r\n ))}\r\n
\r\n )}\r\n \r\n );\r\n}\r\nexport interface SperActionsProps\r\n extends ICanRaiseBasicTableRefreshEvent {\r\n actions: SelectedRowsActionExtRenderer[];\r\n selectedArray: TRow[];\r\n rows: Row[];\r\n toggleAllRowsSelected: (value?: boolean) => void;\r\n toggleRowSelected: (rowId: IdType, set?: boolean | undefined) => void;\r\n isMobile: boolean;\r\n}\r\nfunction SperActionsFunc(props: SperActionsProps) {\r\n const {\r\n actions,\r\n onRefresh,\r\n selectedArray,\r\n rows,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n isMobile,\r\n } = props;\r\n return (\r\n {}}\r\n deleteIcon={\r\n (\r\n \r\n {item(\r\n selectedArray,\r\n rows,\r\n onRefresh,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n )}\r\n \r\n )),\r\n ].filter(v => !!v) as JSX.Element[]\r\n }\r\n >\r\n }\r\n variant=\"default\"\r\n customsize=\"medium\"\r\n label={`and ${actions.length} more`}\r\n customwidth={isMobile ? 150 : 180}\r\n custombgcolor={bookitColors.primary.disabled}\r\n customcolor={bookitColors.grayscale.blackComponents}\r\n customiconcolor={bookitColors.primary.regular}\r\n shape=\"circle\"\r\n key={'sper_actions'}\r\n />\r\n );\r\n}\r\nexport const SperActions = genericMemo(SperActionsFunc);\r\nexport const FloatingActions = genericMemo(FloatingActionsFunc);\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../..';\r\n\r\nexport interface ICustomToolbar extends Record {\r\n rowsCount: number;\r\n rows: Row[];\r\n}\r\nexport interface CustomToolbarProps {\r\n Component: React.ReactNode;\r\n compact?: boolean;\r\n}\r\n\r\nfunction CustomToolbarFunc(props: CustomToolbarProps) {\r\n const { Component, compact } = props;\r\n const isMobile = DetectIsMobile() || compact === true;\r\n const classes = useStyles({ isMobile })();\r\n return {Component};\r\n}\r\nconst useStyles = ({ isMobile }: { isMobile: boolean }) =>\r\n makeStyles((theme: Theme) =>\r\n createStyles({\r\n customRoot: {\r\n width: '100%',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: isMobile ? '8px 8px 16px' : '8px 32px',\r\n },\r\n tabsContant: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n gap: 16,\r\n },\r\n buttonsContant: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n //flexWrap: isMobile ? 'wrap' : 'nowrap',\r\n gap: isMobile ? 0 : 16,\r\n },\r\n }),\r\n );\r\nexport const CustomToolbar = React.memo(CustomToolbarFunc);\r\n","import * as React from 'react';\r\nimport { TableCell, TableRow } from '@material-ui/core';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ICanRaiseBasicTableRefreshEvent } from './ControlledTableProps';\r\n\r\nexport interface RenderRowProps\r\n extends ICanRaiseBasicTableRefreshEvent {\r\n row: Row;\r\n\r\n onRowClicked?: (row: TRow) => void;\r\n children?: (cell) => React.ReactNode;\r\n}\r\nexport function RenderRow({\r\n row,\r\n onRefresh,\r\n onRowClicked,\r\n children = cell =>\r\n cell.render('Cell', {\r\n onRefresh: onRefresh,\r\n }),\r\n}: RenderRowProps) {\r\n const canClickRow = onRowClicked !== undefined;\r\n return (\r\n \r\n onRowClicked?.(row.original)}\r\n {...row.getRowProps()}\r\n >\r\n {\r\n // Loop over the rows cells\r\n row.cells.map(cell => {\r\n // Apply the cell props\r\n return (\r\n \r\n {\r\n if (canClickRow) {\r\n e.stopPropagation();\r\n }\r\n }}\r\n >\r\n {\r\n // Render the cell contents\r\n children(cell)\r\n }\r\n
\r\n \r\n );\r\n })\r\n }\r\n \r\n \r\n );\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport React from 'react';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface CustomEmptyTableProps {\r\n id?: string;\r\n headTitle?: string;\r\n title?: string;\r\n shortView?: boolean;\r\n}\r\n\r\nexport function CustomEmptyTable(props: CustomEmptyTableProps) {\r\n const { headTitle, title } = props;\r\n return (\r\n \r\n \r\n {props.shortView ? (\r\n \r\n {headTitle && (\r\n {headTitle}\r\n )}\r\n {title && (\r\n {title}\r\n )}\r\n \r\n ) : (\r\n \r\n {headTitle &&

{headTitle}

}\r\n {title &&

{title}

}\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const TableHeaderCellLabel = styled('span')`\r\n white-space: break-spaces;\r\n word-break: normal;\r\n`;\r\n\r\n// export const TableCell = withStyles({\r\n// root: {\r\n// height: '32px',\r\n// },\r\n// head: {},\r\n// body: {\r\n// padding: '10px 12px',\r\n// },\r\n// })(MuiTableCell);\r\n","import * as React from 'react';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { RenderRow, RenderRowProps } from './RenderRow';\r\n\r\nexport interface RenderGroupedRowProps\r\n extends RenderRowProps {}\r\n\r\nexport function RenderGroupedRow({\r\n row,\r\n onRefresh,\r\n onRowClicked,\r\n children = cell =>\r\n cell.isAggregated\r\n ? // If the cell is aggregated, use the Aggregated\r\n // renderer for cell\r\n cell.render('Aggregated')\r\n : cell.isPlaceholder\r\n ? null // For cells with repeated values, render null\r\n : // Otherwise, just render the regular cell\r\n cell.render('Cell', {\r\n onRefresh: onRefresh,\r\n }),\r\n}: RenderGroupedRowProps) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ImportButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Menu } from '@material-ui/core';\r\n\r\nexport interface ImportButtonProps {\r\n onClick: () => void;\r\n importLink?: string;\r\n importHandler?: () => void;\r\n menuItems?: (onClose: () => void) => React.ReactNode[] | undefined;\r\n}\r\n\r\nexport function ImportButton(props: ImportButtonProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const handleClick = event => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n const handleImport = async () => {\r\n handleClose();\r\n props.onClick();\r\n };\r\n const menuItems = React.useMemo(() => {\r\n const result = props.menuItems ? props.menuItems(handleClose) : undefined;\r\n return result;\r\n }, [props]);\r\n const showSingleImportButton =\r\n menuItems === undefined || menuItems.length === 0;\r\n\r\n return (\r\n \r\n }\r\n onClick={showSingleImportButton ? handleImport : handleClick}\r\n >\r\n {t(translations.Import)}\r\n \r\n {!showSingleImportButton && (\r\n <>\r\n \r\n {menuItems}\r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ControlledTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n LinearProgress,\r\n TableBody,\r\n TableCell,\r\n TableHead,\r\n TablePagination,\r\n TableRow,\r\n TableSortLabel,\r\n} from '@material-ui/core';\r\nimport Table from '@material-ui/core/Table';\r\nimport {\r\n useTable,\r\n usePagination,\r\n useSortBy,\r\n UseSortByState,\r\n UseSortByInstanceProps,\r\n UsePaginationState,\r\n PluginHook,\r\n useGlobalFilter,\r\n useExpanded,\r\n Row,\r\n HeaderGroup,\r\n SortingRule,\r\n} from 'react-table';\r\nimport TablePaginationActions from 'app/components/BasicTable/TablePaginationActions';\r\nimport { TableContainer } from '@material-ui/core';\r\nimport { GlobalFilter } from 'app/components/BasicTable/GlobalFilter';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicFilterGroup } from 'app/components/BasicTable/BasicFilter';\r\nimport { useState } from 'react';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Button } from 'app/components//BasicButtons/Button';\r\nimport { TableHeaderIcon } from 'app/components//BasicIcons/SvgIcons';\r\nimport { Icon } from 'app/components//BasicIcons/FontAwesome';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { useEffect } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { BasicTableProps } from '..';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { ExportButton } from 'app/components/BasicTable/ExportButton';\r\nimport { orderBy, sortedUniq } from 'lodash';\r\nimport { FilterContainer } from '../FilterContainer';\r\nimport { PageActionRenderer2 } from '../PageActions/PageActionsRenderer';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { TableRowsSkeleton } from '../components/TableSkeleton';\r\nimport { AlertContentType, BasicAlert } from 'app/components/BasicAlert';\r\nimport { ControlledTableProps } from './ControlledTableProps';\r\nimport { SelectedActions } from '../SelectedActions';\r\nimport { FiltersGroupDisplay } from '../BasicFilter/FiltersGroupDisplay';\r\nimport { NoTableData } from '../components/NoTableData';\r\nimport { useMemoFilters } from '../useMemoFilters';\r\nimport { useInlineRowActionsColumn, useRowActionsColumn } from '../RowActions';\r\nimport { useSummary } from '../Hooks/useSummary';\r\nimport { TableError } from '../components/TableError';\r\nimport { FiltersButton } from '../BasicFilter/FiltersButton';\r\nimport { TableCardGrid } from '../components/TableCardGrid';\r\nimport { TableCard } from '../components/TableCard';\r\nimport { ConfigureColumnsButton } from '../components/ConfigureColumnsButton';\r\nimport { TabsToolbar } from '../components/TabsToolbar';\r\nimport { selectActionTableProcessing } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { FloatingActions } from '../components/FloatingActions';\r\nimport clsx from 'clsx';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { CustomToolbar } from '../components/CustomTableToolbar';\r\nimport { RenderRow } from './RenderRow';\r\nimport { CustomEmptyTable } from '../components/CustomEmptyTable';\r\nimport DefaultRenderer from '../CellRenderers/DefaultRenderer';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TableHeaderCellLabel } from './TableCell';\r\nimport { RenderGroupedRow } from './RenderGroupedRow';\r\nimport { selectGlobalSearchOpen } from 'app/pages/PublicAssets/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { ImportButton } from '../ImportButton';\r\nimport { Notification } from 'types/Notification';\r\nimport { addRowSelect } from './addRowSelect';\r\n\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState = Partial<\r\n UseSortByState & UsePaginationState & UseSortByInstanceProps\r\n>;\r\nexport type TableMode = 'card' | 'table';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IControlledTableState\r\n extends IPartialTableState {}\r\n\r\n// todo: enable row accessor for rowActions\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nconst defaultRowIdAccessor = (row: TRow): string =>\r\n row.Id?.toString();\r\n\r\nconst defaultGetSubRows = original =>\r\n original.Rows && original.Rows.length > 1 ? original.Rows : [];\r\nexport const defaultCheckIfRowIsSelectable = (\r\n row: TRow,\r\n): boolean => true;\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function ControlledTable({\r\n columns,\r\n initialState,\r\n getRowId = defaultRowIdAccessor,\r\n searchColumns,\r\n useExport = true,\r\n onDownloadTemplate,\r\n rowActions,\r\n inlineRowActions,\r\n pageActions,\r\n screenName,\r\n screenNameVariant = 'H1',\r\n selectedRowsActions,\r\n filterOpen = false,\r\n screenId,\r\n serviceGroups,\r\n customParams,\r\n useImportLink,\r\n importLink,\r\n importHandler,\r\n ServiceGroupsOptional,\r\n topAlertMessage,\r\n onChangeState,\r\n onSelectedRowsChange,\r\n onExport,\r\n compact = true,\r\n updateMyData,\r\n loading,\r\n tableRowsSize = 'small',\r\n getSubRows = defaultGetSubRows,\r\n savedListSettings,\r\n withToolBar = true,\r\n allowCards,\r\n useCardsByDefault,\r\n onModeChange,\r\n viewCardsCheck,\r\n floatingTabSettings,\r\n tabSectionSettings,\r\n isRowSelectable,\r\n onSelectedChange,\r\n hideMenuOnMobile,\r\n useConfigurable = true,\r\n customToolbarSettings,\r\n showTitleCell,\r\n getAllFilteredRowsCallback,\r\n useExportForImport,\r\n exportForImportFilterKey,\r\n customEmptyTableSettings,\r\n manualPagination = true,\r\n manualSorting = true,\r\n enablePagination = true,\r\n onRowClicked,\r\n printing,\r\n alwaysShowTableHeader,\r\n hideFilters,\r\n baseTableActionsOnToolbar,\r\n baseSortBy,\r\n showGlobalSearchIconOnToolbar,\r\n toggleGlobalSearchIcon,\r\n customExpandMenu,\r\n customScreenName,\r\n getDefaultFilters,\r\n importMenuItems,\r\n isContentEditable,\r\n cardPosition = 'vertical',\r\n tablePaddingVariant = 'regular',\r\n minCardHeight = 80,\r\n ...props\r\n}: ControlledTableProps) {\r\n const classes = useStyles();\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const dispatch = useDispatch();\r\n const { actions: globalActions } = useAppSettingsSlice();\r\n // collapsed state of the filters\r\n // reference to the show/hide filters button\r\n const [filtersButtonAnchorEl, setFiltersButtonAnchorEl] = React.useState(\r\n null,\r\n );\r\n // collapsed state of the filters\r\n const [open, setOpen] = React.useState(false);\r\n // data length - total number of the records\r\n const dataLength = React.useMemo(() => {\r\n return props.dataLength ?? 0;\r\n }, [props.dataLength]);\r\n // table Plugins array assembly\r\n const tablePlugins: PluginHook[] = [\r\n useSummary,\r\n useGlobalFilter,\r\n useSortBy,\r\n useExpanded,\r\n ];\r\n if (enablePagination) {\r\n tablePlugins.push(usePagination);\r\n }\r\n if (searchColumns !== undefined && searchColumns?.length > 0) {\r\n tablePlugins.unshift(useGlobalFilter);\r\n }\r\n\r\n if (props.useRowSelect) {\r\n addRowSelect(tablePlugins, isRowSelectable, onSelectedChange);\r\n }\r\n useInlineRowActionsColumn(inlineRowActions, tablePlugins);\r\n useRowActionsColumn(rowActions, tablePlugins);\r\n const columnsDefinition = React.useMemo(() => {\r\n const columnDefaults = {\r\n Cell: DefaultRenderer,\r\n };\r\n return columns.map(column => ({\r\n ...columnDefaults,\r\n ...column,\r\n }));\r\n }, [columns]);\r\n\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n prepareRow,\r\n rows: reactTableRows,\r\n page: reactTablePage,\r\n gotoPage,\r\n setPageSize,\r\n setGlobalFilter,\r\n // todo: make use of the selectedRowIds\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n state: { pageIndex, pageSize, sortBy, selectedRowIds, globalFilter },\r\n selectedFlatRows,\r\n toggleAllRowsSelected,\r\n toggleRowSelected,\r\n isAllRowsSelected,\r\n summaryRows,\r\n setSortBy,\r\n } = useTable(\r\n {\r\n columns: columnsDefinition,\r\n data: props.data,\r\n updateMyData,\r\n initialState,\r\n // server side controlled pagination\r\n manualPagination: manualPagination,\r\n // server side controlled sorting\r\n manualSortBy: manualSorting,\r\n // server side controlled global filter\r\n manualGlobalFilter: true,\r\n //When true, the selectedRowIds state will automatically reset if any of the following conditions are met:\r\n autoResetSelectedRows: false,\r\n //When true, the paging is always reset to initial pageIndex state.\r\n autoResetPage: false,\r\n // controlled page count (server sided pagination)\r\n pageCount: props.pageCount,\r\n getRowId: getRowId,\r\n getSubRows,\r\n },\r\n ...tablePlugins,\r\n );\r\n const rows = React.useMemo(() => {\r\n return enablePagination ? reactTablePage : reactTableRows;\r\n }, [enablePagination, reactTablePage, reactTableRows]);\r\n\r\n useEffect(() => {\r\n if (baseSortBy !== undefined) {\r\n setSortBy(baseSortBy);\r\n }\r\n }, [baseSortBy, setSortBy]);\r\n\r\n useEffect(() => {\r\n if (initialState?.pageSize !== undefined) {\r\n setPageSize(initialState.pageSize);\r\n }\r\n }, [initialState?.pageSize, setPageSize]);\r\n\r\n useEffect(() => {\r\n if (initialState?.globalFilter !== undefined) {\r\n setGlobalFilter(initialState.globalFilter);\r\n }\r\n }, [initialState?.globalFilter, setGlobalFilter]);\r\n // useEffect(() => {\r\n // if (initialState?.pageIndex !== undefined) {\r\n // gotoPage(initialState.pageIndex);\r\n // }\r\n // }, [gotoPage, initialState?.pageIndex]);\r\n\r\n /**\r\n * Track selected original row values. selectedRowIds only stores the row Ids.\r\n * selectedFlatRows only holds selected rows from the current page.\r\n */\r\n const isSomeSelected = React.useMemo(() => {\r\n return Object.keys(selectedRowIds || {}).length > 0;\r\n }, [selectedRowIds]);\r\n const [selected, setSelected] = useState>({});\r\n useEffect(() => {\r\n setSelected(state =>\r\n Object.keys(selectedRowIds || {}).reduce((accumulator, key) => {\r\n accumulator[key] =\r\n state[key] ??\r\n selectedFlatRows\r\n .filter(isRowSelectable || defaultCheckIfRowIsSelectable)\r\n .find(row => row.id === key)?.original;\r\n return accumulator;\r\n }, {}),\r\n );\r\n }, [selectedRowIds, selectedFlatRows, isRowSelectable]);\r\n const selectedArray = React.useMemo(() => {\r\n return Object.entries(selected).map(value => value[1]);\r\n }, [selected]);\r\n\r\n const appliedFiltersLength = React.useMemo(() => {\r\n return props.appliedFilters && props.appliedFilters.length > 0\r\n ? props.appliedFilters.filter(\r\n f => f.value !== null && f.value !== undefined && f.value !== '',\r\n ).length\r\n : 0;\r\n }, [props.appliedFilters]);\r\n\r\n const handleFilterChange = React.useCallback(\r\n (items: IFilterSettings[]) => {\r\n props.onFilterChange?.(items);\r\n if (items.length !== appliedFiltersLength) {\r\n gotoPage(0);\r\n }\r\n },\r\n [appliedFiltersLength, gotoPage, props],\r\n );\r\n const [alreadySelected, setAlreadySelected] = React.useState[]>(\r\n selectedFlatRows || [],\r\n );\r\n useEffect(() => {\r\n let active =\r\n onSelectedRowsChange !== undefined &&\r\n selectedFlatRows !== undefined &&\r\n selectedFlatRows.length !== alreadySelected.length;\r\n if (active) {\r\n !!onSelectedRowsChange &&\r\n onSelectedRowsChange(\r\n selectedFlatRows\r\n .filter(isRowSelectable || defaultCheckIfRowIsSelectable)\r\n .map(row => row.original),\r\n );\r\n setAlreadySelected(selectedFlatRows);\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n alreadySelected.length,\r\n isRowSelectable,\r\n onSelectedRowsChange,\r\n selectedFlatRows,\r\n ]);\r\n // page change handler\r\n const handlePageChange: (\r\n event: React.MouseEvent | null,\r\n page: number,\r\n ) => void = (e, page) => {\r\n gotoPage(page < 0 ? 0 : page);\r\n };\r\n const handlePageSizeChange = newPageSize => {\r\n // setControlledPageCount(Math.ceil(dataLength / newPageSize));\r\n setPageSize(newPageSize);\r\n };\r\n const filterRef = React.useRef(null);\r\n const handleFilterOpen = React.useCallback(() => {\r\n setFiltersButtonAnchorEl(filterRef.current);\r\n setOpen(!open);\r\n }, [open]);\r\n\r\n const AuthenticatedUser = useSelector(selectAuthenticatedUser);\r\n const customProcesing = useSelector(selectActionTableProcessing);\r\n const globalSearchOpen = useSelector(selectGlobalSearchOpen);\r\n const showGlobalFilter = React.useMemo(() => {\r\n return (\r\n searchColumns !== undefined && searchColumns?.length > 0 && !hideFilters\r\n );\r\n }, [hideFilters, searchColumns]);\r\n\r\n const defaultPageActions: PageActionRenderer2[] = React.useMemo(() => {\r\n const actions: PageActionRenderer2[] = [];\r\n if (compact && props.availableFilters !== undefined && !hideFilters) {\r\n actions.push((dataCount, refresh) => (\r\n \r\n ));\r\n }\r\n if (pageActions !== undefined) {\r\n if (pageActions.length > 0) {\r\n pageActions.forEach(element => {\r\n actions.push(element);\r\n });\r\n }\r\n }\r\n return actions;\r\n }, [\r\n appliedFiltersLength,\r\n compact,\r\n handleFilterOpen,\r\n hideFilters,\r\n pageActions,\r\n props.availableFilters,\r\n ]);\r\n\r\n const handleExportClick = React.useCallback(async () => {\r\n await onExport();\r\n }, [onExport]);\r\n\r\n const rowsPerPageOptions = sortedUniq(\r\n orderBy([5, 10, 25, 100].concat(initialState?.pageSize ?? [])),\r\n );\r\n const handleSortBy = React.useCallback(\r\n (event: any, column: HeaderGroup) => {\r\n const columnId = column.id;\r\n let sortAction = '';\r\n let newSortBy: SortingRule[] = [];\r\n let sortDescFirst = column.sortDescFirst;\r\n let desc = column.isSortedDesc;\r\n const existingSortBy = sortBy.find(d => d.id === columnId);\r\n const existingIndex = sortBy.findIndex(d => d.id === columnId);\r\n const hasDescDefined = typeof desc !== 'undefined' && desc !== null;\r\n if (existingIndex !== sortBy.length - 1 || sortBy.length !== 1) {\r\n sortAction = 'replace';\r\n } else if (existingSortBy) {\r\n sortAction = 'toggle';\r\n } else {\r\n sortAction = 'replace';\r\n }\r\n if (sortAction === 'replace') {\r\n newSortBy = [\r\n {\r\n id: columnId,\r\n desc: hasDescDefined ? desc : sortDescFirst,\r\n },\r\n ];\r\n } else if (sortAction === 'add') {\r\n newSortBy = [\r\n ...sortBy,\r\n {\r\n id: columnId,\r\n desc: hasDescDefined ? desc : sortDescFirst,\r\n },\r\n ];\r\n } else if (sortAction === 'toggle') {\r\n // This flips (or sets) the\r\n newSortBy = sortBy.map(d => {\r\n if (d.id === columnId) {\r\n return {\r\n ...d,\r\n desc: hasDescDefined ? !desc : !existingSortBy?.desc,\r\n };\r\n }\r\n return d;\r\n });\r\n } else if (sortAction === 'remove') {\r\n newSortBy = sortBy.filter(d => d.id !== columnId);\r\n }\r\n // Object.assign({}, sortBy, newSortBy)\r\n setSortBy(newSortBy);\r\n },\r\n [setSortBy, sortBy],\r\n );\r\n React.useEffect(() => {\r\n if (props.allRowsSelected !== undefined) {\r\n toggleAllRowsSelected?.(props.allRowsSelected);\r\n }\r\n }, [props.allRowsSelected, toggleAllRowsSelected]);\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const s = React.useMemo(() => searchColumns, []);\r\n const customFilters = useMemoFilters({\r\n appliedFilters: props.appliedFilters,\r\n });\r\n\r\n const sortByActual = React.useMemo(() => JSON.stringify(sortBy), [sortBy]);\r\n React.useEffect(() => {\r\n const state = {\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilter,\r\n customFilters: customFilters,\r\n searchColumns: s,\r\n };\r\n\r\n onChangeState(state);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [\r\n onChangeState,\r\n globalFilter,\r\n pageIndex,\r\n pageSize,\r\n\r\n sortByActual,\r\n customFilters,\r\n s,\r\n ]);\r\n\r\n //used to add top message as Alert on the page if needs\r\n const [topMessage, setTopMessage] = React.useState<\r\n AlertContentType | undefined\r\n >(undefined);\r\n const setGlobalMessage = React.useCallback(\r\n (message: Notification) => {\r\n dispatch(globalActions.addNotification(message));\r\n },\r\n [dispatch, globalActions],\r\n );\r\n React.useEffect(() => {\r\n if (ServiceGroupsOptional && !!serviceGroups && serviceGroups.length > 1) {\r\n setGlobalMessage({\r\n key: 'NotRelatedServiceGroups',\r\n message: t(translations.ShowNotRelatedServiceGroups_warning) as string,\r\n variant: 'warning',\r\n autoHideDuration: 30000,\r\n closable: true,\r\n });\r\n } else if (!!topAlertMessage) {\r\n setTopMessage(() => {\r\n return topAlertMessage;\r\n });\r\n }\r\n }, [\r\n ServiceGroupsOptional,\r\n serviceGroups,\r\n setGlobalMessage,\r\n t,\r\n topAlertMessage,\r\n ]);\r\n const [isCards, setIsCards] = useState(useCardsByDefault || isMobile);\r\n useEffect(() => {\r\n setIsCards(useCardsByDefault || isMobile);\r\n }, [isMobile, useCardsByDefault]);\r\n useEffect(() => {\r\n if (allowCards) {\r\n onModeChange?.(isCards === true);\r\n }\r\n }, [allowCards, isCards, onModeChange]);\r\n const print = React.useMemo(() => {\r\n return printing !== undefined && printing.printing === true;\r\n }, [printing]);\r\n useEffect(() => {\r\n if (printing !== undefined && print && printing.onLoading !== undefined) {\r\n printing.onLoading(printing.id, loading);\r\n }\r\n }, [loading, print, printing]);\r\n const error = React.useMemo(() => {\r\n return (props.error ?? false) === true;\r\n }, [props.error]);\r\n const baseTableActions: PageActionRenderer2[] = React.useMemo(() => {\r\n const actions: PageActionRenderer2[] = [];\r\n if (screenId && AuthenticatedUser && useConfigurable && !isMobile) {\r\n actions.push(dataCount => (\r\n \r\n ));\r\n }\r\n if (useExport && !isMobile) {\r\n actions.push(dataCount => (\r\n \r\n ));\r\n }\r\n if (\r\n useImportLink &&\r\n !isMobile &&\r\n !compact &&\r\n (importLink || importHandler || importMenuItems)\r\n ) {\r\n actions.push(dataCount => (\r\n {\r\n if (importHandler) {\r\n importHandler();\r\n } else {\r\n if (importLink) {\r\n window.open(toRootedURL(importLink), '_blank');\r\n }\r\n }\r\n }}\r\n />\r\n ));\r\n }\r\n if (allowCards && !isMobile) {\r\n //&& !compact\r\n actions.push(dataCount => (\r\n }\r\n onClick={() => setIsCards(false)}\r\n >\r\n {t(translations.Table)}\r\n \r\n ));\r\n actions.push(dataCount => (\r\n }\r\n onClick={() => setIsCards(true)}\r\n >\r\n {t(translations.Cards)}\r\n \r\n ));\r\n }\r\n return actions;\r\n }, [\r\n AuthenticatedUser,\r\n allowCards,\r\n compact,\r\n exportForImportFilterKey,\r\n getAllFilteredRowsCallback,\r\n handleExportClick,\r\n importHandler,\r\n importLink,\r\n importMenuItems,\r\n isCards,\r\n isMobile,\r\n onDownloadTemplate,\r\n props.onConfigurableColumns,\r\n screenId,\r\n t,\r\n useConfigurable,\r\n useExport,\r\n useExportForImport,\r\n useImportLink,\r\n ]);\r\n const table_id = React.useMemo(\r\n () =>\r\n props.id ??\r\n (screenId === undefined ? undefined : ScreensId[screenId]) ??\r\n 'table',\r\n [props.id, screenId],\r\n );\r\n const tableHead: React.ReactNode = React.useMemo(() => {\r\n let result: React.ReactNode = (\r\n \r\n {\r\n // loop over header groups\r\n headerGroups.map(headerGroup => (\r\n // apply header group props\r\n \r\n {\r\n // loop over headers\r\n headerGroup.headers.map((column, i) => (\r\n // apply header props\r\n // disableSortBy controls the sortability\r\n \r\n !column.disableSortBy &&\r\n column.id !== 'selection' &&\r\n handleSortBy(ev, column)\r\n }\r\n >\r\n \r\n // column.toggleSortBy(\r\n // !column.isSortedDesc,\r\n // undefined,\r\n // )\r\n !column.disableSortBy &&\r\n column.id !== 'selection' &&\r\n handleSortBy(ev, column)\r\n }\r\n // react-table has a unsorted state which is not treated here\r\n direction={column.isSortedDesc ? 'desc' : 'asc'}\r\n >\r\n \r\n {column.render('Header')}\r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n ))\r\n }\r\n \r\n );\r\n return result;\r\n }, [handleSortBy, headerGroups, props.useRowSelect, table_id]);\r\n return (\r\n \r\n \r\n {customProcesing !== undefined && customProcesing.processing === true && (\r\n \r\n \r\n \r\n )}\r\n\r\n \r\n {withToolBar && (\r\n \r\n {print === false &&\r\n defaultPageActions.length > 0 &&\r\n defaultPageActions.map((item, index) => (\r\n \r\n {item(\r\n dataLength,\r\n props.onRefresh,\r\n props.appliedFilters,\r\n selectedArray,\r\n )}\r\n \r\n ))}\r\n {baseTableActionsOnToolbar &&\r\n baseTableActions.length > 0 &&\r\n baseTableActions.map((item, index) => (\r\n \r\n {item(\r\n dataLength,\r\n props.onRefresh,\r\n props.appliedFilters,\r\n selectedArray,\r\n )}\r\n \r\n ))}\r\n \r\n )}\r\n {print === false ? (\r\n <>\r\n {props.subHeader !== undefined && (\r\n {props.subHeader}\r\n )}\r\n {!isMobile && !compact && topMessage !== undefined && (\r\n
\r\n \r\n
\r\n )}\r\n {props.availableFilters !== undefined && !hideFilters && (\r\n setOpen(false)}\r\n onChange={handleFilterChange}\r\n anchorEl={filtersButtonAnchorEl}\r\n appliedFilters={props.appliedFilters ?? []}\r\n compact={compact}\r\n >\r\n setOpen(false)}\r\n autoOpenAddFilter={true}\r\n showFooter={!isMobile && !compact}\r\n savedListSettings={savedListSettings}\r\n />\r\n \r\n )}\r\n {!error &&\r\n (showGlobalFilter || useExport || screenId) &&\r\n !baseTableActionsOnToolbar && (\r\n <>\r\n \r\n 0,\r\n [classes.tableButtonNoWrap]:\r\n (isSomeSelected &&\r\n selectedRowsActions !== undefined &&\r\n selectedRowsActions.length > 0) === false,\r\n })}\r\n >\r\n {isSomeSelected &&\r\n selectedRowsActions !== undefined &&\r\n selectedRowsActions.length > 0 ? (\r\n \r\n ) : (\r\n <>\r\n {(showGlobalSearchIconOnToolbar === true\r\n ? globalSearchOpen\r\n : showGlobalFilter) && (\r\n \r\n )}\r\n {!compact &&\r\n !hideFilters &&\r\n (props.availableFilters ?? []).length > 0 && (\r\n \r\n )}\r\n \r\n )}\r\n {(isMobile || compact) && (\r\n (\r\n \r\n {item(\r\n dataLength,\r\n props.onRefresh,\r\n props.appliedFilters,\r\n selectedArray,\r\n )}\r\n \r\n ))}\r\n >\r\n )}\r\n \r\n {!isMobile && !compact && (\r\n \r\n {!baseTableActionsOnToolbar &&\r\n baseTableActions.length > 0 &&\r\n baseTableActions.map((item, index) => (\r\n \r\n {item(\r\n dataLength,\r\n props.onRefresh,\r\n props.appliedFilters,\r\n selectedArray,\r\n )}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n {!isMobile &&\r\n !compact &&\r\n (props.appliedFilters ?? []).filter(\r\n f => f.value !== undefined,\r\n ).length > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n {!!customToolbarSettings &&\r\n customToolbarSettings.useCustomToolbar &&\r\n !!customToolbarSettings.CustomToolbar && (\r\n \r\n )}\r\n\r\n {((!!tabSectionSettings && tabSectionSettings.useTabsSection) ||\r\n (props.useRowSelect && isCards)) && (\r\n \r\n )}\r\n \r\n ) : (\r\n <>\r\n )}\r\n \r\n {error ? (\r\n \r\n ) : loading ? (\r\n \r\n ) : dataLength === 0 && !loading ? (\r\n \r\n {alwaysShowTableHeader && !isCards && (\r\n
\r\n \r\n {tableHead}\r\n \r\n \r\n
\r\n )}\r\n {!!customEmptyTableSettings ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n ) : (\r\n <>\r\n {/* {loading && (\r\n // \r\n // \r\n // \r\n \r\n )} */}\r\n {/* */}\r\n {!isCards ? (\r\n \r\n \r\n {tableHead}\r\n \r\n {\r\n // Loop over the table rows\r\n rows.map((row, rowIndex) => {\r\n // Prepare the row for display\r\n\r\n prepareRow(row);\r\n return (\r\n \r\n {row.isGrouped &&\r\n row.subRows?.map(subRow => {\r\n prepareRow(subRow);\r\n return (\r\n \r\n );\r\n })}\r\n \r\n
\r\n );\r\n })\r\n }\r\n {summaryRows !== undefined &&\r\n summaryRows.map(summaryRow => {\r\n prepareRow(summaryRow);\r\n return (\r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n ) : (\r\n \r\n {rows.map((r, ind) => {\r\n prepareRow(r);\r\n return (\r\n 0\r\n // (!!selectedRowsActions ||\r\n // (!!floatingTabSettings &&\r\n // floatingTabSettings.useFloatingActions ===\r\n // true &&\r\n // !!floatingTabSettings.selectedFloatingActions &&\r\n // floatingTabSettings.selectedFloatingActions\r\n // .length > 0)) &&\r\n // selectedFlatRows.filter(\r\n // isRowSelectable || defaultCheckIfRowIsSelectable,\r\n // ).length > 0\r\n }\r\n viewCheckBox={viewCardsCheck}\r\n useSelect={\r\n !!props.useRowSelect &&\r\n (!!isRowSelectable\r\n ? isRowSelectable(r)\r\n : defaultCheckIfRowIsSelectable(r))\r\n }\r\n primaryAction={props.primaryAction}\r\n row={r}\r\n titleKey={props.titleKey ?? sortBy![0].id}\r\n imageSrcKey={props.imageSrcKey}\r\n hasAdditionalActions={\r\n !!rowActions && rowActions.length > 0\r\n }\r\n hasInlineRowActions={\r\n !!inlineRowActions && inlineRowActions.length > 0\r\n }\r\n active={selectedFlatRows?.some(f => f.id === r.id)}\r\n toggleAllRowsSelected={toggleAllRowsSelected}\r\n isRowSelectable={\r\n isRowSelectable || defaultCheckIfRowIsSelectable\r\n }\r\n cardSize={props.cardSize}\r\n cardPosition={cardPosition}\r\n showTitleCell={showTitleCell}\r\n preventInnerClicks={props.preventInnerClicks}\r\n compact={compact}\r\n contentEditable={\r\n !!isContentEditable\r\n ? isContentEditable(r)\r\n : undefined\r\n }\r\n loading={loading}\r\n />\r\n );\r\n })}\r\n \r\n )}\r\n {print === false && enablePagination && (\r\n \r\n {/* {loading && (\r\n \r\n \r\n \r\n )} */}\r\n : <>{'Rows per Page'}\r\n }\r\n SelectProps={{\r\n label: 'Rows per Page',\r\n inputProps: {\r\n 'aria-label': `${pageSize || 'pagesize'}`,\r\n },\r\n native: true,\r\n MenuProps: {\r\n variant: 'menu',\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'right',\r\n },\r\n getContentAnchorEl: null,\r\n classes: { paper: classes.menuPaper },\r\n },\r\n 'aria-label': `${pageSize || 'pagesize'}`,\r\n }}\r\n onChangePage={handlePageChange}\r\n onChangeRowsPerPage={e =>\r\n handlePageSizeChange(Number(e.target.value))\r\n }\r\n ActionsComponent={TablePaginationActions}\r\n />\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n
\r\n {print === false &&\r\n !!floatingTabSettings &&\r\n floatingTabSettings.useFloatingActions && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Grid, Divider, Card, TableContainer } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport makeStyles from '@material-ui/styles/makeStyles';\r\nimport { TableCardGrid } from '../TableCardGrid';\r\nimport clsx from 'clsx';\r\n\r\n/* \r\nxs (for phones - screens less than 768px wide)\r\nsm (for tablets - screens equal to or greater than 768px wide)\r\nmd (for small laptops - screens equal to or greater than 992px wide)\r\nlg (for laptops and desktops - screens equal to or greater than 1200px wide) \r\n*/\r\n\r\nconst headerHeight = 48;\r\nconst toolbarHeight = 30;\r\nconst searchBarHeight = 30;\r\n//const tableHeaderHeight = 30;\r\n//const tableRowHeight = 30;\r\n//const tableColumnHeight = 438;\r\n//const tableFooterHeight = 30;\r\n\r\nconst numOfHeaderItems = 7;\r\nconst numOfColumns = 7;\r\nconst numOfRows = 11;\r\nconst numberOfCards = 12;\r\n\r\nconst useStyles = makeStyles({\r\n tableContainer: {\r\n boxShadow: '0 3px 5px 2px #D7D7D7',\r\n },\r\n tableHeaderCell: {\r\n position: 'relative',\r\n height: 48,\r\n backgroundColor: '#F5F5F5',\r\n borderRight: '1px solid #D7D7D7',\r\n borderBottom: '1px solid #D7D7D7',\r\n boxShadow: '0 3px 5px 2px #D7D7D7',\r\n color: 'white',\r\n },\r\n tableHeader: {\r\n position: 'absolute',\r\n top: '35%',\r\n left: '20%',\r\n height: 15,\r\n width: '60%',\r\n background: '#D7D7D7',\r\n color: 'white',\r\n },\r\n tableRowContainer: {\r\n height: 48,\r\n color: 'white',\r\n },\r\n tableRowCell: {\r\n position: 'relative',\r\n borderBottom: '1px solid #D7D7D7',\r\n },\r\n tableRow: {\r\n position: 'absolute',\r\n top: '37%',\r\n left: '20%',\r\n height: 15,\r\n width: '60%',\r\n color: 'white',\r\n },\r\n tableFooterContainer: {\r\n //display: 'block',\r\n //position: 'relative',\r\n height: 48,\r\n backgroundColor: 'green',\r\n justifyContent: 'center',\r\n //borderBottom: '1px solid black',\r\n //boxShadow: '0 3px 5px 2px #D7D7D7',\r\n color: 'white',\r\n },\r\n tableFooter: {\r\n //position: 'absolute',\r\n //top: '37%',\r\n //left: '20%',\r\n height: 15,\r\n //width: 'auto',\r\n backgroundColor: 'black', //'#F5F5F5',\r\n boxShadow: '0 3px 5px 2px #D7D7D7',\r\n color: 'white',\r\n },\r\n shadow: {\r\n boxShadow: '0 3px 5px 2px #D7D7D7',\r\n },\r\n});\r\nconst useTableCardsStyle = makeStyles({\r\n card: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'flex-start',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n },\r\n cardVertical: {\r\n maxHeight: 308,\r\n height: 220,\r\n },\r\n cardHorizontal: {\r\n maxHeight: 183,\r\n height: 110,\r\n },\r\n cardSkelet: {\r\n backgroundColor: '#e0e5ec',\r\n },\r\n});\r\nconst RenderTableRowsItems = classes => {\r\n return [...Array(numOfRows).keys()].map(key => (\r\n //Row item\r\n \r\n \r\n \r\n \r\n \r\n ));\r\n};\r\n\r\nconst RenderTableHeaderCells = classes => {\r\n return [...Array(numOfHeaderItems).keys()].map(key => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ));\r\n};\r\n\r\nconst RenderTableRows = classes => {\r\n return [...Array(numOfColumns).keys()].map(key => (\r\n //TableRow\r\n \r\n \r\n \r\n {RenderTableRowsItems(classes)}\r\n \r\n \r\n \r\n ));\r\n};\r\n\r\n/* const RenderFooter = classes => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}; */\r\nexport function TableCardsSkeleton({ isMobile }: { isMobile: boolean }) {\r\n const classes = useTableCardsStyle();\r\n return (\r\n \r\n {[...Array(numberOfCards).keys()].map(key => (\r\n \r\n \r\n \r\n ))}\r\n \r\n );\r\n}\r\nexport interface TableRowsSkeletonProps {\r\n id?: string;\r\n isMobile: boolean;\r\n isCards: boolean;\r\n style?: React.CSSProperties;\r\n}\r\nexport function TableRowsSkeleton(props: TableRowsSkeletonProps) {\r\n const { isMobile, isCards, style } = props;\r\n const classes = useStyles();\r\n //RENDER\r\n return (\r\n \r\n {/* Table */}\r\n {/* TableHeaders */}\r\n\r\n {isCards ? (\r\n \r\n ) : (\r\n \r\n \r\n {RenderTableHeaderCells(classes)}\r\n \r\n {/* TableBody */}\r\n \r\n {RenderTableRows(classes)}\r\n \r\n \r\n )}\r\n\r\n {/* TableFooter */}\r\n {/* {RenderFooter(classes)} */}\r\n \r\n );\r\n}\r\n\r\nexport function TableSkeleton(): JSX.Element {\r\n const classes = useStyles();\r\n //RENDER\r\n return (\r\n \r\n {/* Header */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* Toolbar */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* Search bar */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* Table */}\r\n {/* TableHeaders */}\r\n \r\n \r\n {RenderTableHeaderCells(classes)}\r\n \r\n {/* TableBody */}\r\n \r\n {RenderTableRows(classes)}\r\n \r\n {/* TableFooter */}\r\n {/* \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n );\r\n}\r\n","import { Switch, SwitchProps } from '@material-ui/core';\r\n\r\nexport interface ToggleProps extends SwitchProps {\r\n danger?: boolean;\r\n label?: string;\r\n}\r\n\r\nexport function Toggle(props: ToggleProps) {\r\n const {\r\n color = 'primary',\r\n label,\r\n danger,\r\n size = 'medium',\r\n className,\r\n ...other\r\n } = props;\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport FormGroup from '../Forms/FormControls/FormGroup';\r\nimport { Toggle, ToggleProps } from '../BasicInputs/Toggle';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BasicToggleProps\r\n extends Omit {\r\n label?: string;\r\n error?: string;\r\n helperText?: string;\r\n info?: React.ReactNode;\r\n fullWidth?: boolean;\r\n name?: string;\r\n boxed?: boolean;\r\n boldLabel?: boolean;\r\n maxLabelWidth?: string | number;\r\n onChange?: (\r\n value: boolean,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n}\r\n\r\nexport function BasicToggle(props: BasicToggleProps) {\r\n const {\r\n label,\r\n error,\r\n helperText,\r\n info,\r\n name,\r\n onChange,\r\n boxed,\r\n fullWidth,\r\n boldLabel,\r\n maxLabelWidth = 25,\r\n size,\r\n ...other\r\n } = props;\r\n const [isChecked, setIsChecked] = React.useState(\r\n props.checked ?? false,\r\n );\r\n const sizeClass = `toggleSize${capitalize(size ?? 'medium')}`;\r\n const handleChange = (event: React.ChangeEvent) => {\r\n const value = event.target.checked as boolean;\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n setIsChecked(value);\r\n };\r\n const withInfoLabel = React.useMemo(() => {\r\n return !!label && label.length > maxLabelWidth;\r\n }, [label, maxLabelWidth]);\r\n const Label = withInfoLabel ? (\r\n {label}}>\r\n {label}\r\n \r\n ) : (\r\n {label}\r\n );\r\n const baseLabelStyle: React.CSSProperties = React.useMemo(() => {\r\n return withInfoLabel\r\n ? { maxWidth: `${maxLabelWidth}ch`, gap: 12 }\r\n : { gap: 12 };\r\n }, [maxLabelWidth, withInfoLabel]);\r\n return (\r\n \r\n \r\n \r\n }\r\n />\r\n {info && }\r\n \r\n {((!!error && error !== '') || (!!helperText && helperText !== '')) && (\r\n \r\n {error || helperText}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const FlexRowDiv = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n`;\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.printPDF || initialState;\r\n\r\nexport const selectPrintPDF = createSelector([selectSlice], state => state);\r\nexport const selectPrintPDFPrinting = createSelector(\r\n [selectPrintPDF],\r\n state => state.printing,\r\n);\r\nexport const selectPrintPDFSections = createSelector([selectPrintPDF], state =>\r\n state.useSections ? state.Sections : [],\r\n);\r\nexport const selectPrintPDFisLoading = createSelector(\r\n [selectPrintPDF],\r\n state => state.isLoading,\r\n);\r\n","/**\r\n *\r\n * Comments\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport {\r\n CommentsContainer,\r\n EmailRelated,\r\n} from 'app/components/CommentsContainer';\r\nimport {\r\n IComment,\r\n NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from '../LargeFilesUpload/slice';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface CommentsProps\r\n extends Omit {\r\n /**\r\n * Type of the comments, e.g. Invoice, UserTraining, etc.\r\n */\r\n commentType: CommentReferenceTypes;\r\n /**\r\n * Controls permissions related functionality like internal comments available to admins only\r\n */\r\n isAdmin: boolean;\r\n /**\r\n * Entity identifier to attach comments to\r\n */\r\n referenceId: number;\r\n /**\r\n * Optional link that will be shown inside of comments\r\n */\r\n link?: string;\r\n /**\r\n * default initial value for added comment\r\n */\r\n defaultComment?: Partial;\r\n /**\r\n * set to true if user can not add comments\r\n */\r\n cannotComment?: boolean;\r\n\r\n /**\r\n * Event fired after a comment has been added successfully\r\n */\r\n onCommentAdded?: (comment: IComment) => void;\r\n\r\n onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n onDeleteComment?: (comment: IComment) => void;\r\n noTitle?: boolean;\r\n disableFileUpload?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}\r\n\r\n/**\r\n * Reusable comments component.\r\n * For example:\r\n * \r\n * @param param\r\n * @returns\r\n */\r\nexport const Comments = ({\r\n commentType,\r\n referenceId,\r\n isAdmin,\r\n link,\r\n defaultComment,\r\n cannotComment,\r\n pageName,\r\n emailType,\r\n disableFileUpload,\r\n ...props\r\n}: CommentsProps) => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const [changed, setChanged] = React.useState(false);\r\n\r\n const comments = useAsyncGetWthEffect(\r\n () => CommentsApi.GetComments(commentType, referenceId),\r\n [],\r\n [changed],\r\n );\r\n\r\n React.useEffect(() => {\r\n dispatch(\r\n largeFileActions.setCommentProperties({\r\n commentType: commentType,\r\n referenceId: referenceId,\r\n }),\r\n );\r\n }, [commentType, dispatch, largeFileActions, referenceId]);\r\n\r\n // const classes = useStyles();\r\n\r\n return (\r\n {\r\n CommentsApi.SendComment(commentType, referenceId, c)\r\n .then(res => props.onCommentAdded?.(res))\r\n .finally(() => setChanged(prev => !prev));\r\n }}\r\n isAdmin={isAdmin}\r\n withMentions\r\n pageName={pageName ?? t(translations.Invoice)}\r\n referenceName={referenceId.toString()}\r\n linkUrl={useAbsolute(link)}\r\n emailType={emailType ?? 'Invoice'}\r\n defaultComment={defaultComment}\r\n cannotComment={cannotComment}\r\n disableFileUpload={disableFileUpload}\r\n {...props}\r\n />\r\n );\r\n};\r\n// \r\n// \r\n// const useStyles = makeStyles((theme: Theme) => ({\r\n// base: {\r\n// paddingInline: theme.spacing(2),\r\n// },\r\n// }));\r\n","import { useCalendarLink } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { ViewTypes } from 'app/pages/CalendarPage/Scheduler/slice/types';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\n\r\nexport interface CalendarButtonProps extends Omit {\r\n equipments?: Array;\r\n start?: string | Date;\r\n openToBook?: boolean;\r\n viewType?: ViewTypes;\r\n defaultMulti?: boolean;\r\n target?: string;\r\n}\r\n\r\nexport function CalendarButton({\r\n equipments,\r\n start,\r\n openToBook,\r\n viewType = 'calendar',\r\n defaultMulti,\r\n target,\r\n ...props\r\n}: CalendarButtonProps) {\r\n const link = useCalendarLink({\r\n equipments,\r\n openToBook,\r\n start,\r\n viewType,\r\n defaultMulti,\r\n });\r\n return \r\n \r\n ) : (\r\n \r\n }\r\n onClick={() => openDetailsList()}\r\n >\r\n {t(translations.AddSavedView)}\r\n \r\n \r\n )}\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n\r\n {\r\n removeSelected();\r\n }}\r\n aria-label=\"Remove\"\r\n >\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport const SavedListsDropDown = React.memo(\r\n SavedLists,\r\n (prevProps, nextProps) => {\r\n const x = props =>\r\n JSON.stringify({\r\n value: props.serviceItem?.value,\r\n });\r\n var result = x(prevProps) === x(nextProps);\r\n\r\n return result;\r\n },\r\n) as typeof SavedLists;\r\n","/**\r\n *\r\n * EnumPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface EnumPickerProps\r\n extends Omit<\r\n BaseOptionsPickerProps>,\r\n 'getOptions' | 'value' | 'onChange'\r\n > {\r\n EnumNamesArray: Array;\r\n value: TKey | null;\r\n onChange: (value: TKey | null) => void;\r\n nameRender?: (value: TKey) => string;\r\n}\r\n\r\nexport function EnumPicker({\r\n value,\r\n onChange,\r\n nameRender,\r\n ...props\r\n}: EnumPickerProps) {\r\n const { t } = useTranslation();\r\n const options = React.useMemo(\r\n () =>\r\n props.EnumNamesArray.map(key => ({\r\n Id: key,\r\n Name: !!nameRender ? nameRender(key) : t(key) ?? key,\r\n })),\r\n [nameRender, props.EnumNamesArray, t],\r\n );\r\n\r\n const getOptions = React.useMemo(() => GetOptionsFilterFunction(options), [\r\n options,\r\n ]);\r\n const selectedOption = React.useMemo(\r\n () => options.find(f => f.Id === value) ?? null,\r\n [options, value],\r\n );\r\n const handleChange = (value: Entity | null) => {\r\n onChange?.(value?.Id ?? null);\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n/**\r\n * Provides a picker with the predefined options based on the array of the enum names\r\n * @param array Array of the Union type enum names\r\n * @returns\r\n */\r\nexport function withEnumOptions(array: Array) {\r\n return (Component: React.ComponentType>) => {\r\n return (props: Omit, 'EnumNamesArray'>) => (\r\n \r\n );\r\n };\r\n}\r\n","import { Entity } from './common';\r\nimport { CustomDate } from './CustomDate';\r\n\r\nexport interface IConnectedFiltersDto {\r\n StartTime: Date | string;\r\n EndTime?: Date | string;\r\n User?: Entity | null;\r\n UserGroup?: Entity | null;\r\n Budget?: Entity | null;\r\n BudgetExperiment?: Entity | null;\r\n InstituteProject?: Entity | null;\r\n FundingType?: Entity | null;\r\n ExternalCustomer?: Entity | null;\r\n PurchaseOrder?: string | null;\r\n Reference?: string | null;\r\n}\r\nexport const ConnectedFiltersInit = (\r\n StartTime?: Date | string,\r\n EndTime?: Date | string,\r\n User?: Entity | null,\r\n UserGroup?: Entity | null,\r\n Budget?: Entity | null,\r\n BudgetExperiment?: Entity | null,\r\n InstituteProject?: Entity | null,\r\n FundingType?: Entity | null,\r\n ExternalCustomer?: Entity | null,\r\n PurchaseOrder?: string | null,\r\n Reference?: string | null,\r\n): IConnectedFiltersDto => {\r\n return {\r\n StartTime: StartTime || new CustomDate(new Date()).toISOString(),\r\n EndTime: EndTime,\r\n User: User,\r\n UserGroup: UserGroup,\r\n Budget: Budget,\r\n BudgetExperiment: BudgetExperiment,\r\n InstituteProject: InstituteProject,\r\n ExternalCustomer: ExternalCustomer,\r\n FundingType: FundingType,\r\n PurchaseOrder: PurchaseOrder,\r\n Reference: Reference,\r\n };\r\n};\r\n","import React from 'react';\r\nimport { useRef } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport styled from 'styled-components';\r\nimport { selectPrintPDFSections } from './slice/selectors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface PrintPDFSectionProps {\r\n print: boolean;\r\n id: string;\r\n forceChecked?: boolean;\r\n fullWidth?: boolean;\r\n sectionClass?: string;\r\n}\r\nexport function PrintPDFSection(\r\n props: React.PropsWithChildren,\r\n) {\r\n const printPDFSections = useSelector(selectPrintPDFSections);\r\n const componentRef = useRef(null);\r\n const printClasses = React.useMemo(() => {\r\n const classes = ['print-section'];\r\n if (props.fullWidth) {\r\n classes.push('print-section-full-width');\r\n }\r\n let checked = printPDFSections?.some(\r\n f => f.id === props.id && (f.checked === true || props.forceChecked),\r\n );\r\n if (props.print && !checked) {\r\n classes.push('print-section-hidden');\r\n } else {\r\n classes.push('print-section-block');\r\n }\r\n return classes.join(' ');\r\n }, [\r\n printPDFSections,\r\n props.forceChecked,\r\n props.fullWidth,\r\n props.id,\r\n props.print,\r\n ]);\r\n // useEffect(() => {\r\n // if (componentRef.current !== null) {\r\n // if (props.print) {\r\n // const checked = printPDFSections?.some(\r\n // f => f.id === props.id && (f.checked === true || props.forceChecked),\r\n // );\r\n // if (checked) {\r\n // componentRef.current.style.display = 'block';\r\n // } else {\r\n // componentRef.current.style.display = 'none';\r\n // }\r\n // } else {\r\n // componentRef.current.style.display = 'initial';\r\n // }\r\n // }\r\n // }, [printPDFSections, props.forceChecked, props.id, props.print]);\r\n return (\r\n <>\r\n {props.print ? (\r\n \r\n {props.children}\r\n \r\n ) : (\r\n <>{props.children}\r\n )}\r\n \r\n );\r\n}\r\nconst PrintSection = styled.div`\r\n &.print-section {\r\n display: initial;\r\n &.print-section-hidden {\r\n display: none;\r\n }\r\n &.print-section-block {\r\n display: block;\r\n }\r\n &.print-section-full-width {\r\n width: 100%;\r\n }\r\n &.print-reservation {\r\n & .formsection {\r\n flex-direction: column;\r\n gap: 32px;\r\n & .rightsection {\r\n width: 100%;\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n","/**\r\n *\r\n * NumberFieldFilter\r\n *\r\n */\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const NumberFieldFilter = (props: IFilterComponentProps) => {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [value, setValue] = React.useState(null);\r\n const handleChange: React.ChangeEventHandler<\r\n HTMLInputElement | HTMLTextAreaElement\r\n > = event => {\r\n setValue(+event.target.value);\r\n props.onChange(+event.target.value);\r\n };\r\n\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default NumberFieldFilter;\r\n","/**\r\n *\r\n * BuildingPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IBuildingDto } from 'api/odata/generated/entities/IBuildingDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type BuildingsUrl = 'base' | 'assetBase' | 'public' | 'locations';\r\nexport interface BuildingPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: BuildingsUrl;\r\n withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Buildings';\r\nconst assetBuildingUrl = '/api/odata/v4/Buildings/BuildingsFilter';\r\nconst publicBuildingUrl = '/api/odata/v4/Buildings/PublicBuildingsFilter';\r\nconst LocationsUrl = '/api/odata/v4/Locations';\r\nexport const initBuildingData = (\r\n initval: string | undefined,\r\n sourceUrl?: BuildingsUrl,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IBuildingDto[]);\r\n });\r\n } else {\r\n if (sourceUrl === 'locations') {\r\n withoutServiceGroups = true;\r\n }\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n withoutServiceGroups === undefined || withoutServiceGroups === false\r\n ? 'Id,Name,ServiceGroups'\r\n : 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicBuildingUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetBuildingUrl\r\n : sourceUrl === 'locations'\r\n ? LocationsUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IBuildingDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: BuildingsUrl,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n if (urlType === 'locations') {\r\n withoutServiceGroups = true;\r\n }\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicBuildingUrl\r\n : urlType === 'assetBase'\r\n ? assetBuildingUrl\r\n : urlType === 'locations'\r\n ? LocationsUrl\r\n : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select:\r\n withoutServiceGroups === undefined || withoutServiceGroups === false\r\n ? ['Id', 'Name', 'ServiceGroups']\r\n : ['Id', 'Name'],\r\n globalServiceGroupFilter:\r\n (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n !!globalServiceGroupFilter &&\r\n globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n 'Id',\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function BuildingPicker(props: BuildingPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n props.urlType,\r\n props.withoutServiceGroups,\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport const BuildingByServiceGroupFilter = (\r\n value: FilterValueType,\r\n fieldName: any,\r\n) => {\r\n if (value !== undefined && value !== null) {\r\n if (fieldName === 'ServiceGroupId') {\r\n return [\r\n `${new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n [(value as Identifiable).Id],\r\n 'Id',\r\n ).toString()}`,\r\n ];\r\n }\r\n }\r\n return [];\r\n};\r\n","import { AxiosError } from 'axios';\r\nimport { IModelState } from 'types/Modelstate';\r\n\r\nexport function handleBadRequest(err: any): string[] | undefined {\r\n if (\r\n err.isAxiosError === true &&\r\n err.response &&\r\n err.response.status === 400 &&\r\n err.response.data &&\r\n err.response.data.ModelState\r\n ) {\r\n const ms = err.response.data.ModelState as IModelState;\r\n const messages = Object.keys(ms)\r\n .map(key => ms[key])\r\n .flat();\r\n return messages;\r\n }\r\n}\r\n\r\n/**\r\n * Extracts ModelState errors from odata responses\r\n * @param error http error\r\n * @returns\r\n */\r\nexport const getModelStateErrors = (\r\n error: unknown,\r\n): Record> | undefined => {\r\n const axiosError = error as AxiosError;\r\n const isAxiosError = axiosError.isAxiosError === true;\r\n if (!isAxiosError) {\r\n return undefined;\r\n }\r\n const message = axiosError.response?.data?.error?.innererror\r\n ?.message as string;\r\n if (message === undefined) {\r\n return axiosError.response?.data?.error?.message;\r\n }\r\n return message?.split('\\r\\n').reduce((accumulator, currentValue) => {\r\n const separator = currentValue.indexOf(':');\r\n const key = currentValue.substring(0, separator).trim();\r\n if (key.length > 0) {\r\n const message = currentValue.substring(separator + 1).trim();\r\n if (accumulator[key] === undefined) {\r\n accumulator[key] = [];\r\n }\r\n accumulator[key].push(message);\r\n }\r\n return accumulator;\r\n }, {});\r\n};\r\n\r\nexport function extractErrorMessages(error: unknown): string[] | undefined {\r\n if ((error as AxiosError).isAxiosError === true) {\r\n const response = (error as AxiosError).response;\r\n if (response?.data?.error?.message !== undefined) {\r\n return [response?.data?.error?.message];\r\n }\r\n if (response === undefined) {\r\n return [String(error)];\r\n }\r\n const status = (error as AxiosError)?.response?.status;\r\n switch (status) {\r\n case 400:\r\n return handleBadRequest(error);\r\n case 403:\r\n return ['NotAllowed'];\r\n default:\r\n return [String(error)];\r\n }\r\n } else if (typeof error === 'string') {\r\n return [error];\r\n } else if (error instanceof Error) {\r\n return [error.message];\r\n } else {\r\n return [String(error)];\r\n }\r\n}\r\n","/**\r\n *\r\n * CampusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ICampusDto } from 'api/odata/generated/entities/ICampusDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type CampusUrl = 'base' | 'assetBase' | 'public';\r\nexport interface CampusPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: CampusUrl;\r\n withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Campuses';\r\nconst assetCampusUrl = '/api/odata/v4/Campuses/CampusAssetFilter';\r\nconst publicCampusUrl = '/api/odata/v4/Campuses/PublicCampusAssetFilter';\r\nexport const initCampusData = (\r\n initval: string | undefined,\r\n sourceUrl?: CampusUrl,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as ICampusDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n withoutServiceGroups === undefined || withoutServiceGroups === false\r\n ? 'Id,Name,ServiceGroups'\r\n : 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicCampusUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetCampusUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as ICampusDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: CampusUrl,\r\n withoutServiceGroups?: boolean,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicCampusUrl\r\n : urlType === 'assetBase'\r\n ? assetCampusUrl\r\n : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select:\r\n withoutServiceGroups === undefined || withoutServiceGroups === false\r\n ? ['Id', 'Name', 'ServiceGroups']\r\n : ['Id', 'Name'],\r\n globalServiceGroupFilter:\r\n (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n !!globalServiceGroupFilter &&\r\n globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function CampusPicker(props: CampusPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n props.urlType,\r\n props.withoutServiceGroups,\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport const CampusByServiceGroupFilter = (\r\n value: FilterValueType,\r\n fieldName: any,\r\n) => {\r\n if (value !== undefined && value !== null) {\r\n if (fieldName === 'ServiceGroupId') {\r\n return [\r\n `${new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.In,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n }\r\n return [];\r\n};\r\n","/**\r\n *\r\n * RoomPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type RoomsUrl = 'base' | 'assetBase' | 'public' | 'locations';\r\nexport interface RoomPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: RoomsUrl;\r\n selectArray?: Array;\r\n withoutServiceGroups?: boolean;\r\n}\r\nexport const convertRoomWithBuildingName = (\r\n Name: string,\r\n BuildingName: string,\r\n): string => {\r\n let name = BuildingName !== '' ? `${Name} - ${BuildingName}` : Name;\r\n return name;\r\n};\r\nexport const modifyRoomName = (room: IRoomDto | null): IRoomDto | null => {\r\n if (room !== null && room !== undefined) {\r\n return Object.assign(\r\n {},\r\n {\r\n Name: convertRoomWithBuildingName(room.Name, room.BuildingName ?? ''),\r\n },\r\n room,\r\n );\r\n }\r\n return null;\r\n};\r\nconst url = '/api/odata/v4/Rooms/GetRoomsFilter';\r\nconst publicUrl = '/api/odata/v4/Rooms/GetPublicAssetsRoomsFilter';\r\nconst assetRoomUrl = '/api/odata/v4/Rooms/GetAssetsRoomsFilter';\r\nconst LocationsUrl = '/api/odata/v4/LocationsBuilding';\r\nexport const initRoomData = (\r\n initval: string | undefined,\r\n sourceUrl?: RoomsUrl,\r\n withoutServiceGroups?: boolean,\r\n selectArray?: Array,\r\n): Promise => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IRoomDto[]);\r\n });\r\n } else {\r\n if (sourceUrl === 'locations') {\r\n withoutServiceGroups = true;\r\n }\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: !!selectArray\r\n ? selectArray.join(',')\r\n : (withoutServiceGroups === undefined ||\r\n withoutServiceGroups === false) &&\r\n !!sourceUrl &&\r\n sourceUrl !== 'base'\r\n ? 'Id,Name,BuildingId,BuildingName,ServiceGroupsIds'\r\n : 'Id,Name,BuildingId,BuildingName',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetRoomUrl\r\n : sourceUrl === 'locations'\r\n ? LocationsUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IRoomDto[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: RoomsUrl,\r\n withoutServiceGroups?: boolean,\r\n selectArray?: Array,\r\n) => {\r\n if (urlType === 'locations') {\r\n withoutServiceGroups = true;\r\n }\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicUrl\r\n : urlType === 'assetBase'\r\n ? assetRoomUrl\r\n : urlType === 'locations'\r\n ? LocationsUrl\r\n : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select:\r\n selectArray ??\r\n ((withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n !!urlType &&\r\n urlType !== 'base'\r\n ? ['Id', 'Name', 'BuildingId', 'BuildingName', 'ServiceGroupsIds']\r\n : ['Id', 'Name', 'BuildingId', 'BuildingName']),\r\n maxTop: 100,\r\n globalServiceGroupFilter:\r\n (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n !!globalServiceGroupFilter &&\r\n globalServiceGroupFilter.length > 0 &&\r\n !!urlType &&\r\n urlType !== 'base'\r\n ? [\r\n new Condition(\r\n 'ServiceGroupsIds',\r\n ODataOperators.HasNoAny,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n new Condition(\r\n 'ServiceGroupsIds',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n isOptionalServiceGroup: true,\r\n });\r\n};\r\n\r\nexport function RoomPicker(props: RoomPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n props.urlType,\r\n props.withoutServiceGroups,\r\n props.selectArray,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const RoomByBuildingFilter = (\r\n value: FilterValueType,\r\n fieldName: any,\r\n) => {\r\n if (value !== undefined && value !== null) {\r\n if (fieldName === 'BuildingId') {\r\n return [\r\n `${new Condition(\r\n 'BuildingId',\r\n ODataOperators.Equals,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n if (fieldName === 'ServiceGroupId') {\r\n return [\r\n `${new Condition(\r\n 'ServiceGroupsIds',\r\n ODataOperators.AnyIn,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n }\r\n return [];\r\n};\r\n","import { ToolbarProps as MuiToolbarProps } from '@material-ui/core';\r\nimport React from 'react';\r\nimport { Body, H1 } from 'app/components/Typography';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\n\r\nexport interface TableToolbarHeaderProps\r\n extends Pick {\r\n isMobile: boolean;\r\n compact?: boolean;\r\n screenName: React.ReactNode;\r\n customScreenName?: React.ReactNode;\r\n /**\r\n * Controls the size of the table title. Defaults to H1 for list pages.\r\n */\r\n screenNameVariant?: 'H1' | 'section';\r\n}\r\n/**\r\n * Renders responsive page/table header.\r\n * Nothing fancy, just wraps the header content in different components for desktop/mobile. Using responsive styling might have been more appropriate here\r\n * @param props\r\n * @returns\r\n */\r\nexport function TableToolbarHeader({\r\n compact,\r\n isMobile,\r\n screenName,\r\n customScreenName,\r\n screenNameVariant,\r\n variant,\r\n}: React.PropsWithChildren) {\r\n if (compact || isMobile) {\r\n return {screenName};\r\n } else if (!!customScreenName) {\r\n return {customScreenName};\r\n } else if (screenNameVariant === 'section') {\r\n return ;\r\n } else {\r\n return

{screenName}

;\r\n }\r\n}\r\n","import { ToolbarProps as MuiToolbarProps, useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport MenuIcon from '@material-ui/icons/Menu';\r\nimport { AlertContentType, BasicAlert } from 'app/components/BasicAlert';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport { RefreshIcon } from './RefreshIcon';\r\nimport {\r\n TableToolbarHeader,\r\n TableToolbarHeaderProps,\r\n} from './TableToolbarHeader';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { StyledToolbar } from './styled';\r\n\r\nexport interface TableToolbarProps\r\n extends React.PropsWithChildren,\r\n Omit,\r\n ICanRaiseBasicTableRefreshEvent {\r\n alertContent?: AlertContentType;\r\n showAlert?: boolean;\r\n titleIcon?: React.ReactNode;\r\n showMenu?: boolean;\r\n loading?: boolean;\r\n compact?: boolean;\r\n /**\r\n * Make a title section render content as flex column (in case when need to show additional description under Title)\r\n */\r\n titleAsColumn?: boolean;\r\n customExpandMenu?: () => void;\r\n showGlobalSearchIcon?: boolean;\r\n toggleGlobalFilter?: () => void;\r\n}\r\n\r\nexport const TableToolbar = React.memo(function TableToolbar({\r\n screenName,\r\n screenNameVariant = 'H1',\r\n alertContent,\r\n showAlert,\r\n titleIcon,\r\n showMenu = true,\r\n variant = 'regular',\r\n onRefresh,\r\n compact,\r\n customExpandMenu,\r\n customScreenName,\r\n showGlobalSearchIcon,\r\n toggleGlobalFilter,\r\n titleAsColumn,\r\n ...props\r\n}: TableToolbarProps) {\r\n const { t } = useTranslation();\r\n const { checkIsMobile } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const { toggle } = useExpandedSideBarState();\r\n\r\n const handleSidebarOpen = () => {\r\n if (!!customExpandMenu) {\r\n customExpandMenu();\r\n } else {\r\n toggle();\r\n }\r\n };\r\n const handleRefresh = () => {\r\n const event = { reloadConfigurableColumns: true };\r\n onRefresh?.(event);\r\n };\r\n const theme = useTheme();\r\n return (\r\n \r\n {isMobile && showMenu && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n\r\n {onRefresh !== undefined && (\r\n \r\n )}\r\n
\r\n
{titleIcon}
\r\n \r\n {!isMobile && !compact && showAlert === true && alertContent && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n
\r\n {\r\n \r\n {showGlobalSearchIcon && (\r\n !!toggleGlobalFilter && toggleGlobalFilter()}\r\n >\r\n \r\n \r\n )}\r\n {props.children}\r\n \r\n }\r\n
\r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * AssetPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { avTypes, getAvFilter } from '../../MultiSelectPickers/AssetsPicker';\r\n\r\nexport interface AssetPickerProps\r\n extends Omit, 'loadData'> {\r\n restrictByAvType?: avTypes;\r\n /**\r\n * Option to filter admin permissions. If set to true will return only the assets authenticated user is an admin of\r\n */\r\n admin?: boolean;\r\n /**\r\n * Fetches only Active assets/instruments if this property is set to true\r\n */\r\n showOnlyActiveAssets?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetNames';\r\nexport const initAssetData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n admin?: boolean,\r\n) => {\r\n const url =\r\n admin === true\r\n ? '/api/odata/v4/AssetNames/AdminAssets'\r\n : '/api/odata/v4/AssetNames';\r\n return getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'AssetCatId',\r\n 'Availability',\r\n // BookableAsset is not mapped (AssetNamesController)\r\n // 'BookableAsset',\r\n 'Image',\r\n 'ServiceGroupId',\r\n 'ServiceId',\r\n 'ServiceTypeId',\r\n 'ServiceGroupName',\r\n 'ServiceGroupAssetId',\r\n ],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function AssetPicker({\r\n predicates,\r\n restrictByAvType,\r\n showOnlyActiveAssets,\r\n admin,\r\n ...props\r\n}: AssetPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n let avFilter =\r\n restrictByAvType === undefined ? undefined : getAvFilter(restrictByAvType);\r\n\r\n let filters =\r\n avFilter !== undefined\r\n ? predicates !== undefined\r\n ? [...predicates, avFilter]\r\n : [avFilter]\r\n : predicates;\r\n if (showOnlyActiveAssets === true) {\r\n filters?.push(\r\n new Condition('Active', ODataOperators.Equals, true),\r\n );\r\n }\r\n const innerLoadData = loadData(\r\n filters,\r\n globalServiceGroupFilter || [],\r\n admin,\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n UseSortByState,\r\n UsePaginationState,\r\n SortingRule,\r\n TableState,\r\n} from 'react-table';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { CancelToken } from 'axios';\r\nimport { BasicTableProps } from 'app/components/BasicTable/BasicTableProps';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n getExportParameters,\r\n buildURL,\r\n openExportLink,\r\n IPathAndQuery,\r\n} from 'utils/url-utils';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useMemoFilters } from 'app/components/BasicTable/useMemoFilters';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { BasicTableRefreshEventHandler } from '../ControlledTable/ControlledTableProps';\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState = Partial<\r\n UseSortByState & UsePaginationState\r\n>;\r\n\r\nconst REQUEST_CANCELLED_MESSAGE = 'Request cancelled (race condition)';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IBasicTableState\r\n extends IPartialTableState {}\r\n\r\nconst defaultRowIdAccessor = (row: TRow): string =>\r\n row.Id?.toString();\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function UnconfigurableTable({\r\n columns,\r\n initialState,\r\n api,\r\n additionalColumns,\r\n getRowId = defaultRowIdAccessor,\r\n searchColumns,\r\n useExport = true,\r\n onExportForImport,\r\n rowActions,\r\n pageActions,\r\n screenName,\r\n selectedRowsActions,\r\n filterOpen = false,\r\n serviceGroups,\r\n customParams,\r\n useImportLink,\r\n importLink,\r\n needRefresh,\r\n ServiceGroupsOptional,\r\n topAlertMessage,\r\n printing,\r\n exportNotConfigurable,\r\n ...props\r\n}: Omit, 'screenId'> & {\r\n // If the component has export, then this parameter should\r\n // be passed as true, otherwise the export .xlsx will be empty\r\n // has dependency to:\r\n // \"C:\\bookitlab\\bkt_webApp\\Api\\Infrastructure\\XlsxResultFormatter.cs\"\r\n // \"var unConfigured = !string.IsNullOrEmpty(Request.RequestUri.ParseQueryString()[\"unConfigured\"]);\"\r\n exportNotConfigurable?: boolean;\r\n}) {\r\n const isMobile = DetectIsMobile();\r\n // loading/processing indication\r\n const [loading, setLoading] = React.useState(false);\r\n // data received from the server and displayd on the table\r\n const [data, setData] = React.useState([]);\r\n // reference to the show/hide filters button\r\n // data length - total number of the records\r\n const [dataLength, setDataLength] = React.useState(0);\r\n // page count derrived from total number of the records\r\n // this is passed to the react-table hook\r\n const [controlledPageCount, setControlledPageCount] = React.useState(0);\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const dispatch = useDispatch();\r\n const doRefresh = useSelector(selectDoRefreshTable);\r\n\r\n const [tableState, setTableState] = React.useState>>(\r\n {\r\n pageIndex: initialState?.pageIndex ?? 0,\r\n pageSize:\r\n printing !== undefined && printing.printing === true\r\n ? 10000\r\n : initialState?.pageSize ?? 10,\r\n\r\n sortBy: initialState?.sortBy,\r\n },\r\n );\r\n const handleChangeState = React.useCallback(state => {\r\n setTableState(state);\r\n }, []);\r\n\r\n const configurableColumns = React.useMemo(() => columns, [columns]);\r\n\r\n const columnAccessors = React.useMemo(\r\n () =>\r\n configurableColumns\r\n ?.filter(c => typeof c.accessor === 'string')\r\n ?.filter(c => c.accessor !== undefined)\r\n ?.map(c => c.accessor as keyof TRow),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [configurableColumns],\r\n );\r\n\r\n // memo cleaned up filters without the Name which is loaded independently of the filter value and only affects appearance of the filter\r\n const customFilter = useMemoFilters({ appliedFilters: props.appliedFilters });\r\n // serialize the applied filters to be compatible with shallow comparison of the useEffect readonly array\r\n const serializedCustomFilter = JSON.stringify(customFilter);\r\n const handleFilterChange = React.useCallback(\r\n items => {\r\n if (props.onFilterChange !== undefined) {\r\n props.onFilterChange(items);\r\n }\r\n },\r\n [props],\r\n );\r\n\r\n /**\r\n * Fetch data method that retrieves the data according to the current table state\r\n */\r\n const fetchData = React.useCallback(\r\n async (\r\n state: {\r\n api: string | IPathAndQuery;\r\n pageSize: number;\r\n pageIndex: number;\r\n sortBy?: SortingRule[] | null;\r\n globalFilterValue?: string;\r\n customFilter: IFilterSettings[];\r\n serviceGroups?: Entity[];\r\n isOptionalServiceGroup: boolean;\r\n columns: Array;\r\n },\r\n cancelToken: CancelToken,\r\n ) => {\r\n setLoading(true);\r\n try {\r\n // todo: add support for object notation accessors like 'foo.bar'\r\n // todo: add support for accessor of type Function(originalRow, rowIndex) => any\r\n const oDataParams = buildParams(\r\n {\r\n ...state,\r\n select: state.columns,\r\n additionalColumns: additionalColumns,\r\n serviceGroups: state.serviceGroups ?? [],\r\n },\r\n searchColumns,\r\n customParams,\r\n );\r\n var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n const response = await httpClient.get(url, params, cancelToken);\r\n\r\n setData(response.value);\r\n setDataLength(response['@odata.count']);\r\n setControlledPageCount(\r\n Math.ceil(response['@odata.count'] / state.pageSize),\r\n );\r\n setLoading(false);\r\n } catch (error) {\r\n // todo: show error message\r\n\r\n if (\r\n error instanceof Error &&\r\n error.message === REQUEST_CANCELLED_MESSAGE\r\n ) {\r\n // noop - request was explicitly cancelled after a new one was issues to prevent race conditions between multiple requests\r\n } else {\r\n console.warn(error);\r\n }\r\n }\r\n // finally {\r\n // setLoading(false);\r\n // }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [],\r\n );\r\n\r\n const pageIndex = tableState.pageIndex!;\r\n const pageSize = tableState.pageSize!;\r\n const sortBy = tableState.sortBy!;\r\n const globalFilter = tableState.globalFilter;\r\n\r\n // connect table state changes to server data fetch side effect\r\n React.useEffect(() => {\r\n const cancelTokenSource = httpClient.cancelToken.source();\r\n if (columnAccessors === undefined) {\r\n return;\r\n }\r\n fetchData(\r\n {\r\n api,\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n serviceGroups: serviceGroups,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n columns: columnAccessors,\r\n },\r\n cancelTokenSource.token,\r\n );\r\n return () => {\r\n cancelTokenSource.cancel(REQUEST_CANCELLED_MESSAGE);\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [\r\n fetchData,\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilter,\r\n serializedCustomFilter,\r\n serviceGroups,\r\n ServiceGroupsOptional,\r\n columnAccessors,\r\n api,\r\n ]);\r\n\r\n const handleExportClick = (): Promise => {\r\n const { $top, $skip, ...tableParams } = buildParams({\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n select: columnAccessors,\r\n additionalColumns: additionalColumns,\r\n serviceGroups: serviceGroups ?? [],\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n });\r\n var oDataParams = getExportParameters(tableParams);\r\n var { url, params } = getUrlAndParams(api, oDataParams);\r\n if (exportNotConfigurable === true) {\r\n params['unConfigured'] = true;\r\n }\r\n const exporturl = buildURL(url, params);\r\n return openExportLink(exporturl);\r\n };\r\n\r\n const [allRowsSelected, setAllRowsSelected] = React.useState();\r\n const toggleAllRowsSelected = React.useCallback((value: boolean) => {\r\n setAllRowsSelected(value);\r\n }, []);\r\n\r\n /**\r\n * Reloads the table and unselects all rows\r\n */\r\n const handleRefresh: BasicTableRefreshEventHandler = React.useCallback(\r\n event => {\r\n if (columnAccessors === undefined) {\r\n return;\r\n }\r\n if (toggleAllRowsSelected !== undefined) {\r\n toggleAllRowsSelected(false);\r\n }\r\n fetchData(\r\n {\r\n api,\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilterValue: globalFilter as string,\r\n customFilter: customFilter ?? [],\r\n serviceGroups: serviceGroups,\r\n isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n columns: columnAccessors,\r\n },\r\n httpClient.cancelToken.source().token,\r\n );\r\n },\r\n [\r\n columnAccessors,\r\n toggleAllRowsSelected,\r\n fetchData,\r\n api,\r\n pageIndex,\r\n pageSize,\r\n sortBy,\r\n globalFilter,\r\n customFilter,\r\n serviceGroups,\r\n ServiceGroupsOptional,\r\n ],\r\n );\r\n\r\n const refreshFromState = React.useCallback(() => {\r\n dispatch(layoutActions.setRefreshTable(false));\r\n handleRefresh();\r\n }, [dispatch, layoutActions, handleRefresh]);\r\n\r\n React.useEffect(() => {\r\n if (needRefresh !== undefined && needRefresh) {\r\n handleRefresh();\r\n }\r\n if (doRefresh === true) {\r\n refreshFromState();\r\n }\r\n }, [doRefresh, needRefresh, handleRefresh, refreshFromState]);\r\n const handleSelectedRowsChange = React.useCallback(\r\n (rows: TRow[]) => {\r\n if (props.onSelectedRowsChange !== undefined) {\r\n props.onSelectedRowsChange(rows);\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [props.onSelectedRowsChange],\r\n );\r\n return (\r\n \r\n );\r\n}\r\nfunction getUrlAndParams(\r\n api: string | IPathAndQuery,\r\n oDataParams: {\r\n $skip?: number;\r\n $top?: number;\r\n $count?: boolean;\r\n $select?: string;\r\n $orderby?: string | undefined;\r\n $filter?: string | undefined;\r\n $format?: string;\r\n },\r\n) {\r\n var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n var search = (api as IPathAndQuery).search;\r\n const params = { ...oDataParams, ...search };\r\n return { url, params };\r\n}\r\n","import styled from 'styled-components';\r\nimport {\r\n Theme,\r\n AppBar,\r\n AppBarProps,\r\n MenuProps,\r\n Menu,\r\n Collapse,\r\n CollapseProps,\r\n} from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\n\r\nexport const StyledTopBar = styled(\r\n ({\r\n theme,\r\n drawerWidth,\r\n sidePanelWidth,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n drawerWidth: number;\r\n sidePanelWidth: number;\r\n children: React.ReactNode;\r\n } & AppBarProps) => {children},\r\n)`\r\n &.appBar {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: flex-start;\r\n align-self: stretch;\r\n background-color: ${bookitColors.base.white};\r\n z-index: ${props => props.theme.zIndex.drawer + 1};\r\n transition: ${props =>\r\n props.theme.transitions.create(['width', 'margin'], {\r\n easing: props.theme.transitions.easing.sharp,\r\n duration: props.theme.transitions.duration.leavingScreen,\r\n })};\r\n border-bottom: 1px solid ${bookitColors.grayscale.grayBorders};\r\n width: calc(100% - ${60 + 1}px);\r\n &.appBarShift {\r\n margin-left: ${props => props.drawerWidth}px;\r\n width: calc(100% - ${props => props.drawerWidth}px);\r\n transition: ${props =>\r\n props.theme.transitions.create(['width', 'margin'], {\r\n easing: props.theme.transitions.easing.sharp,\r\n duration: props.theme.transitions.duration.enteringScreen,\r\n })};\r\n }\r\n &.sidePanelShift {\r\n margin-right: ${props => props.sidePanelWidth}px;\r\n width: calc(100% - ${props => 60 + 1 + props.sidePanelWidth}px);\r\n &.appBarShift {\r\n width: calc(\r\n 100% - ${props => props.drawerWidth + props.sidePanelWidth}px\r\n );\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const CollapseBar = styled(\r\n ({\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & CollapseProps) => {children},\r\n)`\r\n &.subBar {\r\n display: flex;\r\n height: 56px;\r\n padding: 4px 16px 4px 32px;\r\n align-items: center;\r\n gap: 24px;\r\n align-self: stretch;\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(2)}px;\r\n border-top: 1px solid ${bookitColors.grayscale.grayBorders};\r\n background: ${bookitColors.primary.background};\r\n & .frame {\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n flex: 1 0 0;\r\n & .controls {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n flex: 1 0 0;\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const SubTopBar = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.subBar {\r\n display: flex;\r\n height: 56px;\r\n padding: 4px 16px 4px 32px;\r\n align-items: center;\r\n gap: 24px;\r\n align-self: stretch;\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(2)}px;\r\n border-top: 1px solid ${bookitColors.grayscale.grayBorders};\r\n background: ${bookitColors.primary.background};\r\n transition: ${transitions.create('height', {\r\n easing: transitions.easing.easeInOut,\r\n duration: 150,\r\n })};\r\n &.subBarCollapsed {\r\n height: 0;\r\n display: none;\r\n }\r\n & .frame {\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n flex: 1 0 0;\r\n & .controls {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n flex: 1 0 0;\r\n }\r\n }\r\n }\r\n`;\r\n// box-shadow: 0px 1px 1px -1px rgb(0 0 0 / 20%),\r\n// 0px 0px 2px 0px rgb(0 0 0 / 14%), 0px 1px 1px 0px rgb(0 0 0 / 12%);\r\nexport const ProfileSection = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.userProfile {\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\r\n gap: 8px;\r\n }\r\n`;\r\n// display: flex;\r\n// flex-direction: row;\r\n// align-items: center;\r\n// padding: 0px;\r\n// gap: ${props => props.theme.spacing(2)}px;\r\n// & span > a {\r\n// color: ${props => props.theme.palette.common.graySubtitle};\r\n// & > svg {\r\n// font-size: 20px;\r\n// }\r\n// }\r\n// @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n// gap: 12px;\r\n// }\r\n// & .mainMenu {\r\n// display: flex;\r\n// align-items: flex-start;\r\n// padding: 0px;\r\n// &.userMenu {\r\n// flex-direction: column;\r\n// flex: none;\r\n// order: 4;\r\n// flex-grow: 0;\r\n// }\r\n// &.menuIcon {\r\n// flex-direction: row;\r\n// flex: none;\r\n// flex-grow: 0;\r\n// }\r\n// &.menuCores {\r\n// flex-direction: row;\r\n// flex: none;\r\n// flex-grow: 0;\r\n// order: 1;\r\n// align-self: center;\r\n// }\r\n// &.menuSearch {\r\n// flex-direction: column;\r\n// flex: none;\r\n// flex-grow: 0;\r\n// order: 0;\r\n// align-self: stretch;\r\n// }\r\n// }\r\nexport const StyledUserMenu = styled(\r\n ({\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & MenuProps) => {children},\r\n)`\r\n & li {\r\n & a {\r\n margin-left: ${props => props.theme.spacing(2)}px;\r\n color: ${props => props.theme.palette.text.primary};\r\n }\r\n }\r\n`;\r\n","import styled from 'styled-components';\r\nimport { Theme } from '@material-ui/core/styles';\r\n\r\nexport const Section = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n sidePanelWidth: number;\r\n}>`\r\n &.formsection {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: flex-start;\r\n padding: 0px 32px;\r\n max-width: 100%;\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(17)}px;\r\n &.noPadding {\r\n padding: 0;\r\n }\r\n &.shortView {\r\n .sidePanelRoot & {\r\n .baseRootHeight & {\r\n flex-direction: row;\r\n padding: 0px 32px;\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(17)}px;\r\n }\r\n &.noPadding {\r\n padding: 0;\r\n }\r\n flex-direction: column;\r\n padding: 0px 16px 0px 24px;\r\n width: ${props => props.sidePanelWidth}px;\r\n gap: ${props => props.theme.spacing(2)}px;\r\n }\r\n }\r\n @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n &.shortView {\r\n width: 100%;\r\n }\r\n }\r\n }\r\n`;\r\nexport const LeftSection = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.leftsection {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n flex-grow: 1;\r\n padding: 0px;\r\n\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(6)}px;\r\n &.shortView {\r\n .sidePanelRoot & {\r\n gap: ${props => props.theme.spacing(3)}px;\r\n .baseRootHeight & {\r\n gap: ${props => props.theme.spacing(6)}px;\r\n }\r\n }\r\n }\r\n }\r\n`;\r\nexport const RightSection = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n flex-grow: 1;\r\n padding: 0px;\r\n width: 40%;\r\n gap: ${props => props.theme.spacing(6)}px;\r\n &.shortView {\r\n .sidePanelRoot & {\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(2)}px;\r\n padding-bottom: ${props => props.theme.spacing(3)}px;\r\n .baseRootHeight & {\r\n width: 40%;\r\n gap: ${props => props.theme.spacing(6)}px;\r\n padding-bottom: 0px;\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const RowSection = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n alignItems: 'center',\r\n width: '100%',\r\n gap: `${theme.spacing(2)}px`,\r\n flex: '1 1 49%',\r\n '&.hideRow': {\r\n display: 'none',\r\n },\r\n '&.shortView': {\r\n flex: '1 1 100%',\r\n },\r\n '&.fullRow': {\r\n flex: '1 1 100%',\r\n },\r\n '&.minRow': {\r\n flex: '1 1 25%',\r\n [theme.breakpoints.down('md')]: {\r\n flex: '1 1 40%',\r\n },\r\n [theme.breakpoints.down('sm')]: {\r\n flex: '1 1 40%',\r\n },\r\n [theme.breakpoints.down('xs')]: {\r\n flex: '1 1 100%',\r\n },\r\n // [theme.breakpoints.down('sm')]: {\r\n // flex: '1 1 100%',\r\n // },\r\n },\r\n '.shortView &': {\r\n flex: '1 1 100%',\r\n },\r\n '&.wrap': {\r\n flexWrap: 'wrap',\r\n },\r\n '&.shrink-1': {\r\n '& > *:first-child': {\r\n flexShrink: 1,\r\n },\r\n },\r\n '&.shrink-2': {\r\n '& > *:first-child': {\r\n flexShrink: 2,\r\n },\r\n },\r\n '&.shrink-3': {\r\n '& > *:first-child': {\r\n flexShrink: 3,\r\n },\r\n },\r\n}));\r\n\r\nexport const FormFieldsBox = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.fields-section {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n width: 100%;\r\n padding: 0px;\r\n gap: ${props => props.theme.spacing(1.5)}px;\r\n & .sectiontitle {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n // padding: ${props => props.theme.spacing(0, 0, 0.5)};\r\n gap: ${props => props.theme.spacing(2)}px;\r\n }\r\n & .fields {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: flex-start;\r\n padding: 0px;\r\n flex-wrap: wrap;\r\n box-sizing: border-box;\r\n width: 100%;\r\n gap: ${props => props.theme.spacing(1.5)}px;\r\n }\r\n }\r\n`;\r\n","import * as React from 'react';\r\nimport { Body } from 'app/components/Typography';\r\nimport styled from 'styled-components';\r\n\r\nexport interface FormSectionTitleProps {\r\n title: React.ReactNode;\r\n link?: React.ReactNode;\r\n}\r\nconst SectionTitle = styled('div')`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0px 0px 4px;\r\n gap: 16px;\r\n`;\r\nexport function FormSectionTitle(props: FormSectionTitleProps) {\r\n return (\r\n \r\n {props.title}\r\n {props.link !== undefined && props.link}\r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectglobalSettings } from './selectors';\r\n\r\nexport const selectGlobalDbSetting_EnableLegacyScheduler = createSelector(\r\n [selectglobalSettings],\r\n state =>\r\n state.GetBooleanByKey(AllowedSettings.EnableLegacyScheduler) ?? false,\r\n);\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n AssetsPicker,\r\n avTypes,\r\n} from '../pickers/MultiSelectPickers/AssetsPicker/index';\r\n\r\nexport const FormAssetsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig[] | null> &\r\n IFieldProps & {\r\n restrictByAvType?: avTypes;\r\n admin?: boolean;\r\n showOnlyActiveAssets?: boolean;\r\n withoutServiceGroups?: boolean;\r\n }) => {\r\n const [field, meta, helpers] = useField[] | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n restrictByAvType={props.restrictByAvType}\r\n admin={props.admin}\r\n showOnlyActiveAssets={props.showOnlyActiveAssets}\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n required={props.required}\r\n withoutServiceGroups={props.withoutServiceGroups}\r\n />\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport {\r\n BaseOptionsMultiPicker,\r\n BaseOptionsMultiPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectReservationStatuses } from 'app/slice/selectors';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface ReservationStatusMultiProps\r\n extends Omit, 'getOptions'> {}\r\n\r\nexport const initReservationStatusMultiData = (t: TFunction) => (\r\n initialValue: string | undefined,\r\n) => {\r\n const id =\r\n initialValue\r\n ?.split('|')\r\n ?.map(id => parseInt(id))\r\n ?.filter(id => !isNaN(id) && ReservationStatus[id] !== undefined)\r\n ?.map(id => ({ Id: id, Name: t(translations[ReservationStatus[id]]) })) ??\r\n [];\r\n return Promise.resolve(id);\r\n};\r\n\r\nexport function ReservationStatusMultiPicker(\r\n props: ReservationStatusMultiProps,\r\n) {\r\n const { t } = useTranslation();\r\n const options = useSelector(state => selectReservationStatuses(state, t));\r\n const getOptions = React.useCallback(() => options, [options]);\r\n return (\r\n \r\n );\r\n}\r\n","import { ReservationStatusMultiPicker } from 'app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ResrvationStatusMultiFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n []}\r\n ariaLabel={props.label}\r\n size=\"small\"\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default ResrvationStatusMultiFilter;\r\n","import { BaseOptionsMultiPicker } from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '..';\r\n\r\nconst getOptions: (t: TFunction) => Entity[] = (t: TFunction) => {\r\n return [\r\n {\r\n Id: 1,\r\n Name: t(translations.Future),\r\n },\r\n {\r\n Id: 2,\r\n Name: t(translations.Ongoing),\r\n },\r\n ];\r\n};\r\n\r\nexport const getInitUpcomingReservationfilterMultiData = (t: TFunction) => (\r\n initval: string | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return Promise.resolve([]);\r\n }\r\n return Promise.resolve(\r\n getOptions(t).filter(f =>\r\n initval\r\n .split('|')\r\n .map(s => parseInt(s))\r\n .includes(f.Id),\r\n ),\r\n );\r\n};\r\n\r\nexport const UpcomingReservationfilter = (props: IFilterComponentProps) => {\r\n const { t } = useTranslation();\r\n const handleChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n return (\r\n getOptions(t)}\r\n onChange={handleChange}\r\n value={props.value}\r\n placeholder={t(translations.AllReservations)}\r\n size=\"small\"\r\n id={props.id}\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * WorkflowBookingFilter\r\n *\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { WorkflowBookingPicker } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\n\r\nexport const WorkflowBookingFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default WorkflowBookingFilter;\r\n","/**\r\n *\r\n * ReservationByIdWithPartsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IReservationByIdFilterDto } from 'api/odata/generated/entities/IReservationByIdFilterDto';\r\n\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReservationByIdWithPartsPickerProps\r\n extends Omit<\r\n AutocompletePickerProps,\r\n 'loadData'\r\n > {}\r\n\r\nconst url = '/api/odata/v4/ReservationByIdFilter/WithParts';\r\nexport const initReservationByIdWithPartsData = (\r\n initval: string | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id desc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n 'Id,Name,FatherId,ParentAssemblyReservationId,TopAssemblyReservationId,Repeat_Period,Repeat,ReservationParts',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function ReservationByIdWithPartsPicker(\r\n props: ReservationByIdWithPartsPickerProps,\r\n) {\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: props.predicates,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'FatherId',\r\n 'ParentAssemblyReservationId',\r\n 'TopAssemblyReservationId',\r\n 'Repeat_Period',\r\n 'Repeat',\r\n 'ReservationParts',\r\n ],\r\n });\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ReservationByIdWithPartsFilter\r\n *\r\n */\r\n\r\nimport { ReservationByIdWithPartsPicker } from 'app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ReservationByIdWithPartsFilter = (\r\n props: IFilterComponentProps,\r\n) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\nexport default ReservationByIdWithPartsFilter;\r\n","import { Chip, ChipProps, Theme, useTheme } from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { BasicTypography } from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { FilterChip, FilterDisplayProps } from '..';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FilterValueType } from '../../FilterValueType';\r\n\r\nconst InstrumentFilterChip = styled(\r\n ({\r\n color,\r\n theme,\r\n ...other\r\n }: {\r\n color?: string;\r\n theme: Theme;\r\n } & ChipProps) => ,\r\n)`\r\n &.instrument-display-root {\r\n gap: ${props => props.theme.spacing(1)}px;\r\n max-width: 28ch;\r\n border-radius: 8px;\r\n color: white;\r\n background-color: ${props => (!!props.color ? props.color : '#ccc')};\r\n height: 28px;\r\n &::first-child {\r\n margin: 0;\r\n }\r\n }\r\n`;\r\nfunction IsNotEmptyArray(\r\n entity: FilterValueType | undefined,\r\n): entity is Extract {\r\n return Array.isArray(entity) && !!entity.length;\r\n}\r\nexport function InstrumentsFilterDisplay(\r\n props: FilterDisplayProps,\r\n) {\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n const isMobile = DetectIsMobile();\r\n const value = props.filter.value;\r\n const items = IsNotEmptyArray(value) ? (value as Array>) : [];\r\n\r\n const handleDelete = event => {\r\n props.onDelete(props.filter);\r\n };\r\n return items.length > 0 ? (\r\n 7 ? '6px 12px' : '0px 12px'}`,\r\n borderRadius: '8px',\r\n }}\r\n >\r\n \r\n {props.filter.displayName}\r\n {':'}\r\n {props.filter.isInversed ? ' Not' : ''}\r\n \r\n\r\n {items\r\n .filter(chip => chip.Name !== undefined)\r\n .map(chip => (\r\n \r\n {chip.Name !== undefined && chip.Name.length > 20 ? (\r\n \r\n \r\n \r\n {chip.Name}\r\n \r\n \r\n \r\n ) : (\r\n \r\n {chip.Name}\r\n \r\n )}\r\n \r\n }\r\n // onDelete={handleDelete}\r\n />\r\n ))}\r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n {props.filter.displayName}\r\n \r\n : \r\n \r\n {t(translations.NA)}\r\n \r\n \r\n }\r\n onDelete={handleDelete}\r\n />\r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getBudgetsFilterSettings } from 'app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings';\r\nimport { AssetCatGroupFilter } from 'app/components/BasicTable/Filters/AssetCatGroupFilter';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { InstituteFilter } from 'app/components/BasicTable/Filters/InstituteFilter';\r\nimport { AssetCatFilter } from 'app/components/BasicTable/Filters/AssetCatFilter';\r\nimport { CampusFilter } from 'app/components/BasicTable/Filters/CampusFilter';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { BooleanPickerFilter } from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport {\r\n formatQueryStringDateValue,\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n GetDateOrUndefined,\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n presetDatesRangeToQueryString,\r\n initPickerValue,\r\n URLSearchParamsCI,\r\n GetStringOrUndefined,\r\n arrayToQueryString,\r\n getNumberEntityArray,\r\n getDefaultFilterNumberPeriod,\r\n NumebersRangeToQueryString,\r\n initMultiPickerValue,\r\n initMultiExPickerValue,\r\n initExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { UserGroupFilter } from 'app/components/BasicTable/Filters/UserGroupFIlter';\r\nimport { initAssetCatGroupData } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport { initAssetCatData } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport { initInstituteData } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport { initUserGroupData } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { UserFilter } from 'app/components/BasicTable/Filters/UserFilter';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport {\r\n AppSettings,\r\n getOffsetDate,\r\n IsAssetFieldEnabled,\r\n IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { initReservationStatusMultiData } from 'app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker';\r\nimport ResrvationStatusMultiFilter from 'app/components/BasicTable/Filters/ResrvationStatusMultiFilter';\r\nimport ServiceGroupFilter from 'app/components/BasicTable/Filters/ServiceGroupFilter';\r\nimport NumbersRangeFilter from 'app/components/BasicTable/Filters/NumbersRangeFilter';\r\nimport DepartmentFilter from 'app/components/BasicTable/Filters/DepartmentFilter';\r\nimport { initDepartmentData } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { initInstituteTypeData } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport {\r\n DatePickerFilter,\r\n TextFieldFilter,\r\n} from 'app/components/BasicTable/Filters';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport UserDisciplineFilter from 'app/components/BasicTable/Filters/UserDisciplineFilter';\r\nimport { initUserDisciplineData } from 'app/components/pickers/AutocompletePickers/UserDisciplinePicker';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { initAvailabilityTypeData } from 'app/components/pickers/AutocompletePickers/AvailabilityTypePicker';\r\nimport { AvailabilityTypeBookableFilter } from 'app/components/BasicTable/Filters/AvailabilityTypeBookableFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n initOnlineServicesData,\r\n ServiceUrl,\r\n} from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport {\r\n ServiceAdminFilter,\r\n ServiceMultiFilter,\r\n ServiceReservationFilter,\r\n} from 'app/components/BasicTable/Filters/ServiceMultiFilter';\r\nimport { TFunction } from 'i18next';\r\nimport {\r\n getInitUpcomingReservationfilterMultiData,\r\n UpcomingReservationfilter,\r\n} from 'app/components/BasicTable/Filters/UpcomingReservationfilter';\r\nimport { isArray } from 'lodash';\r\nimport { IsEntity } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { initWorkflowBookingData } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\nimport WorkflowBookingFilter from 'app/components/BasicTable/Filters/WorkflowBookingFilter';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport InstituteTypeFilter from 'app/components/BasicTable/Filters/InstituteTypeFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { initServiceGroupsData } from 'app/components/pickers/ServiceGroupPicker';\r\nimport ReservationByIdWithPartsFilter from 'app/components/BasicTable/Filters/ReservationByIdWithPartsFilter';\r\nimport { InstrumentsFilterDisplay } from 'app/components/BasicTable/BasicFilter/FilterDisplay/InstrumentsFilterDisplay';\r\nimport { initReservationByIdWithPartsData } from 'app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker';\r\nimport { IReservationByIdFilterDto } from 'api/odata/generated/entities/IReservationByIdFilterDto';\r\n\r\nexport const GetFilters: GetPageFilters =\r\n (t, appSettings, user, settings) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n var result: IFilterSettings[] = [];\r\n result.push({\r\n id: 'period',\r\n fieldName: 'StartTime',\r\n fieldName1: 'EndTime',\r\n displayName: t(translations.RG_DatePeriod),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n notNullable: true,\r\n urlKey: 'period',\r\n });\r\n pushServicesFilter(result, t, params, true);\r\n result.push({\r\n fieldName: 'StatusId',\r\n displayName: t(translations.Status),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('stid'),\r\n value: getNumberEntityArray(params, 'stid'),\r\n initData: initMultiPickerValue(initReservationStatusMultiData(t)),\r\n component: ResrvationStatusMultiFilter,\r\n urlKey: 'stid',\r\n });\r\n pushBookedByFilter(result, t, params);\r\n const budgetsFilter = getBudgetsFilterSettings(\r\n params,\r\n 'BudgetId',\r\n t,\r\n appSettings,\r\n );\r\n if (budgetsFilter !== undefined) {\r\n result.push(budgetsFilter);\r\n }\r\n pushAssetCatGroupFilter(result, t, params, true);\r\n pushAssetCatFilter(result, t, params, true);\r\n pushAssetAvailabilityFilter(result, t, params, true);\r\n result.push({\r\n fieldName: 'InstituteId',\r\n displayName: t(translations.Institute),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'iid',\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'iid'))),\r\n initData: initPickerValue(initInstituteData),\r\n component: InstituteFilter,\r\n notDefault: true,\r\n urlKey: 'iid',\r\n });\r\n\r\n result.push({\r\n fieldName: 'StatusId',\r\n displayName: t(translations.ExcludeStatus),\r\n operator: ODataOperators.Excludes,\r\n queryStringSerializer: arrayToQueryString('stidx'),\r\n value: getNumberEntityArray(params, 'stidx'),\r\n initData: initMultiPickerValue(initReservationStatusMultiData(t)),\r\n component: ResrvationStatusMultiFilter,\r\n notDefault: true,\r\n urlKey: 'stidx',\r\n });\r\n\r\n result.push({\r\n customFilter: (value, setting) => {\r\n //To be able to display records when \"All My Managed Services\" option is selected\r\n if (!!value && setting.fieldName === 'EquipmentId') {\r\n if (\r\n isArray(value) &&\r\n (value as []).find(x => (x as Entity).Id === -999)\r\n ) {\r\n return new Condition(\r\n setting.fieldName,\r\n ODataOperators.NotEquals,\r\n -999,\r\n ).toString();\r\n } else {\r\n return new Condition(\r\n setting.fieldName,\r\n setting.operator,\r\n value,\r\n ).toString();\r\n }\r\n }\r\n },\r\n fieldName: 'ServiceGroupId',\r\n displayName: t(translations.ServiceGroup),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'ServiceGroupId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'ServiceGroupId')),\r\n ),\r\n initData: initExPickerValue(initServiceGroupsData),\r\n component: ServiceGroupFilter,\r\n notDefault: true,\r\n });\r\n result.push({\r\n fieldName: 'ADGroup',\r\n displayName: t(translations.UserGroup),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'adg'))),\r\n component: UserGroupFilter,\r\n queryStringSerializer: 'adg',\r\n initData: initPickerValue(initUserGroupData),\r\n notDefault: true,\r\n urlKey: 'adg',\r\n });\r\n result.push({\r\n fieldName: 'Id',\r\n displayName: t(translations.ReservationsRelatedToReservationId),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: 'relId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'relId')),\r\n ),\r\n component: ReservationByIdWithPartsFilter,\r\n initData: initExPickerValue(initReservationByIdWithPartsData),\r\n notDefault: true,\r\n urlKey: 'relId',\r\n refreshAfterInit: true,\r\n customFilter: (value, setting) => {\r\n if (!!value && setting.fieldName === 'Id') {\r\n let part = value as IReservationByIdFilterDto;\r\n if (!!part.ReservationParts && part.ReservationParts.length > 0) {\r\n let ids = part.ReservationParts.map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n\r\n return `${new Condition(\r\n setting.fieldName,\r\n ODataOperators.Includes,\r\n ids,\r\n ).toString()} or ${new Condition(\r\n 'TopAssemblyReservationId',\r\n ODataOperators.Includes,\r\n ids,\r\n ).toString()}`;\r\n } else {\r\n return `${new Condition(\r\n setting.fieldName,\r\n ODataOperators.Equals,\r\n part.Id,\r\n ).toString()} or ${new Condition(\r\n 'TopAssemblyReservationId',\r\n ODataOperators.Equals,\r\n part.Id,\r\n ).toString()}`;\r\n }\r\n }\r\n },\r\n });\r\n result.push({\r\n fieldName: 'LastUpdateAdminId',\r\n displayName: t(translations.LastUpdateAdmin),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'LastUpdateAdminId',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'LastUpdateAdminId')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n notDefault: true,\r\n });\r\n result.push({\r\n fieldName: 'InsertedById',\r\n displayName: t(translations.OrderedBy),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'InsertedById',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'InsertedById')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n notDefault: true,\r\n });\r\n result.push({\r\n id: 'StartTimeDate',\r\n fieldName: 'StartTime',\r\n queryStringSerializer: formatQueryStringDateValue('startsOn'),\r\n displayName: t(translations.ReservationStartsOn),\r\n operator: ODataOperators.Equals,\r\n defaultValue: new CustomDate(),\r\n value: GetDateOrUndefined(GetRawValue(params, 'startsOn'), 'date'),\r\n component: DatePickerFilter,\r\n notDefault: true,\r\n urlKey: 'startsOn',\r\n });\r\n result.push({\r\n id: 'EndTimeDate',\r\n fieldName: 'EndTime',\r\n queryStringSerializer: formatQueryStringDateValue('endsOn'),\r\n displayName: t(translations.ReservationEndsOn),\r\n operator: ODataOperators.Equals,\r\n defaultValue: new Date(),\r\n value: GetDateOrUndefined(GetRawValue(params, 'endsOn'), 'date'),\r\n component: DatePickerFilter,\r\n notDefault: true,\r\n urlKey: 'endsOn',\r\n });\r\n result.push({\r\n id: 'StartTime',\r\n fieldName: 'StartTime',\r\n displayName: t(translations.StartTime),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod(\r\n 'StartTime-period',\r\n 'StartTime-st',\r\n 'StartTime-et',\r\n params,\r\n ),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'StartTime-period',\r\n 'StartTime-st',\r\n 'StartTime-et',\r\n ),\r\n component: DatesRangeFilter,\r\n notDefault: true,\r\n urlKey: 'StartTime-period',\r\n });\r\n result.push({\r\n id: 'EndTime',\r\n fieldName: 'EndTime',\r\n displayName: t(translations.EndTime),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod(\r\n 'EndTime-period',\r\n 'EndTime-st',\r\n 'EndTime-et',\r\n params,\r\n ),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'EndTime-period',\r\n 'EndTime-st',\r\n 'EndTime-et',\r\n ),\r\n component: DatesRangeFilter,\r\n notDefault: true,\r\n urlKey: 'EndTime-period',\r\n });\r\n\r\n result.push({\r\n fieldName: 'Tutoring',\r\n displayName: t(translations.Tutoring),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'tr',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'tr')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n notDefault: true,\r\n urlKey: 'tr',\r\n });\r\n result.push({\r\n fieldName: 'Loanable',\r\n displayName: t(translations.Loanable),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'loan',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'loan')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n notDefault: true,\r\n urlKey: 'loan',\r\n });\r\n result.push({\r\n fieldName: 'TrainingSignUp',\r\n queryStringSerializer: 'TrainingSignUp',\r\n displayName: t(translations.TrainingSignUp),\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'TrainingSignUp')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n notDefault: true,\r\n });\r\n result.push({\r\n id: 'RecordDate',\r\n fieldName: 'RecordDate',\r\n displayName: t(translations.RecordDate),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod(\r\n 'RecordDate-period',\r\n 'RecordDate-st',\r\n 'RecordDate-et',\r\n params,\r\n ),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'RecordDate-period',\r\n 'RecordDate-st',\r\n 'RecordDate-et',\r\n ),\r\n component: DatesRangeFilter,\r\n notDefault: true,\r\n urlKey: 'RecordDate-period',\r\n });\r\n result.push({\r\n id: 'DurationH',\r\n fieldName: 'DurationH',\r\n displayName: t(translations.Duration),\r\n operator: ODataOperators.Between,\r\n value: getDefaultFilterNumberPeriod('DurationH', params),\r\n queryStringSerializer: NumebersRangeToQueryString('DurationH'),\r\n component: NumbersRangeFilter,\r\n notDefault: true,\r\n urlKey: 'DurationH',\r\n });\r\n result.push({\r\n id: 'DepartmentId',\r\n fieldName: 'DepartmentId',\r\n queryStringSerializer: 'DepartmentId',\r\n displayName: t(translations.Department),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'DepartmentId')),\r\n ),\r\n initData: initPickerValue(initDepartmentData),\r\n component: DepartmentFilter,\r\n notDefault: true,\r\n });\r\n result.push({\r\n notDefault: true,\r\n id: 'InstituteTypeId',\r\n fieldName: 'InstituteTypeId',\r\n queryStringSerializer: 'InstituteTypeId',\r\n displayName: t(translations.InstituteType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'InstituteTypeId')),\r\n ),\r\n initData: initPickerValue(initInstituteTypeData),\r\n component: InstituteTypeFilter,\r\n });\r\n result.push({\r\n id: 'AssetModel',\r\n fieldName: 'AssetModel',\r\n queryStringSerializer: 'AssetModel',\r\n displayName: t(translations.Model),\r\n operator: ODataOperators.Contains,\r\n value: GetRawValue(params, 'AssetModel'),\r\n component: TextFieldFilter,\r\n notDefault: true,\r\n });\r\n result.push({\r\n id: 'AssetModelNumber',\r\n fieldName: 'AssetModelNumber',\r\n queryStringSerializer: 'AssetModelNumber',\r\n displayName: t(translations.ModelNumber),\r\n operator: ODataOperators.Contains,\r\n value: GetRawValue(params, 'AssetModelNumber'),\r\n component: TextFieldFilter,\r\n notDefault: true,\r\n });\r\n pushRoomFilter(result, t, params, true);\r\n pushBuildingFilter(result, t, params, true);\r\n result.push({\r\n id: 'UserDisciplineId',\r\n fieldName: 'UserDisciplineId',\r\n displayName: t(translations.Discipline),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'UserDisciplineId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'UserDisciplineId')),\r\n ),\r\n component: UserDisciplineFilter,\r\n initData: initPickerValue(initUserDisciplineData),\r\n notDefault: true,\r\n });\r\n result.push({\r\n fieldName: 'StaffUser',\r\n displayName: t(translations.StaffUser),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'StaffUser',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'StaffUser')),\r\n ),\r\n initData: initPickerValue(initUserData),\r\n component: UserFilter,\r\n notDefault: true,\r\n });\r\n\r\n pushBudgetManagerFilter(appSettings, result, t, params, true);\r\n pushCampusFilter(appSettings, result, t, params, true);\r\n\r\n result.push({\r\n id: 'upcomingReservations',\r\n fieldName: 'StartTime',\r\n queryStringSerializer: arrayToQueryString('upcomingReservations'),\r\n operator: ODataOperators.Equals,\r\n displayName: t(translations.UpcomingReservations),\r\n value: getNumberEntityArray(params, 'upcomingReservations'),\r\n component: UpcomingReservationfilter,\r\n initData: initMultiPickerValue(\r\n getInitUpcomingReservationfilterMultiData(t),\r\n ),\r\n notDefault: true,\r\n urlKey: 'upcomingReservations',\r\n customFilter(value, settings) {\r\n if (!isArray(value) || (value ?? []).length === 0) {\r\n return undefined;\r\n }\r\n const now = getOffsetDate(appSettings, new Date());\r\n return (\r\n '(' +\r\n value\r\n .map(v => {\r\n if (!IsEntity(v)) return '';\r\n if (v.Id === 1) {\r\n return new Condition(\r\n 'StartTime',\r\n ODataOperators.GreaterThan,\r\n now,\r\n ).toString();\r\n }\r\n if (v.Id === 2) {\r\n return (\r\n '(' +\r\n new Condition(\r\n 'StartTime',\r\n ODataOperators.LessThanEqual,\r\n now,\r\n ).toString() +\r\n ' and ' +\r\n new Condition(\r\n 'EndTime',\r\n ODataOperators.GreaterThan,\r\n now,\r\n ).toString() +\r\n ')'\r\n );\r\n }\r\n return '';\r\n })\r\n .join(' or ') +\r\n ')'\r\n );\r\n },\r\n });\r\n pushWorkflowBookingFilter(settings, result, t, params, true);\r\n const HideTrainingSessionsSettings = settings?.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideTrainingSessionsSettings],\r\n );\r\n if (!HideTrainingSessionsSettings) {\r\n result.push({\r\n id: 'TrainingSessionId',\r\n fieldName: 'TrainingSessionId',\r\n queryStringSerializer: 'TrainingSessionId',\r\n displayName: t(translations.TrainingSessionId),\r\n operator: ODataOperators.Equals,\r\n value: GetNumberOrUndefined(GetRawValue(params, 'TrainingSessionId')),\r\n component: NumberFieldFilter,\r\n notDefault: true,\r\n });\r\n }\r\n return result;\r\n };\r\nexport function pushAssetCatGroupFilter<\r\n T extends { AssetGroupId: number | null },\r\n>(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'AssetGroupId',\r\n fieldName: 'AssetGroupId',\r\n queryStringSerializer: 'assetCatGroupId',\r\n displayName: t(translations.AssetCatGroupName),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'assetCatGroupId')),\r\n ),\r\n initData: initPickerValue(initAssetCatGroupData),\r\n component: AssetCatGroupFilter,\r\n urlType: 'assetBase',\r\n notDefault,\r\n urlKey: 'assetCatGroupId',\r\n });\r\n}\r\n\r\nexport function pushBookedByFilter(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'BookedById',\r\n fieldName: 'BookedById',\r\n displayName: t(translations.User),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'un',\r\n value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'un'))),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n notDefault,\r\n urlKey: 'un',\r\n });\r\n}\r\n\r\nexport function pushAssetAvailabilityFilter<\r\n T extends { AvailabilityTypeId: number | null },\r\n>(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'AvailabilityTypeId',\r\n fieldName: 'AvailabilityTypeId',\r\n queryStringSerializer: 'atid',\r\n displayName: t(translations.AvailabilityType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'atid'))),\r\n // TODO: set value directly instead of the initValue\r\n //initValue: getDefaultFilterValue('atid', params) as FilterValueType,\r\n initData: initPickerValue(initAvailabilityTypeData),\r\n component: AvailabilityTypeBookableFilter,\r\n notDefault,\r\n urlKey: 'atid',\r\n });\r\n}\r\n\r\nexport function pushBudgetManagerFilter<\r\n T extends { BudgetManager: string | null },\r\n>(\r\n appSettings: AppSettings | null,\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n if (IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n result.push({\r\n id: 'BudgetManager',\r\n fieldName: 'BudgetManager',\r\n displayName: t(translations.BudgetManager),\r\n operator: ODataOperators.Equals,\r\n // value: getDefaultFilterValue('bid', params),\r\n queryStringSerializer: 'BudgetManager',\r\n initData: initPickerValue(initUserData),\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'BudgetManager')),\r\n ),\r\n component: UserFilter,\r\n notDefault,\r\n });\r\n }\r\n}\r\n\r\nexport function pushAssetCatFilter(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'AssetCatId',\r\n fieldName: 'AssetCatId',\r\n displayName: t(translations.AssetCategory),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'assetCatID',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'assetCatID')),\r\n ),\r\n initData: initPickerValue(initAssetCatData),\r\n component: AssetCatFilter,\r\n urlType: 'assetBase',\r\n urlKey: 'assetCatID',\r\n notDefault,\r\n });\r\n}\r\n\r\nexport function pushRoomFilter(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n options?: Partial>,\r\n) {\r\n result.push({\r\n id: 'AssetRoomId',\r\n fieldName: 'AssetRoomId',\r\n queryStringSerializer: 'AssetRoomId',\r\n displayName: t(translations.Room),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'AssetRoomId')),\r\n ),\r\n initData: initPickerValue(initRoomData),\r\n component: RoomPickerFilter,\r\n notDefault,\r\n ...(options ?? {}),\r\n });\r\n}\r\n\r\n//not working\r\n/* export function pushRoomFilter<\r\n T extends {\r\n AssetRoomId: number | null;\r\n AssetBuildingId: number | null;\r\n ServiceGroupId: number | null;\r\n }\r\n>(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'AssetRoomId',\r\n fieldName: 'AssetRoomId',\r\n queryStringSerializer: 'AssetRoomId',\r\n displayName: t(translations.Room),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'AssetRoomId')),\r\n ),\r\n initData: initExPickerValue(initRoomData, undefined, 'base'),\r\n component: RoomPickerFilter,\r\n dependencyProp: ['AssetBuildingId', 'ServiceGroupId'],\r\n filterPredicates: RoomByBuildingFilter,\r\n urlType: 'base',\r\n notDefault,\r\n });\r\n} */\r\n\r\nexport function pushBuildingFilter<\r\n T extends { AssetBuildingId: number | null },\r\n>(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n result.push({\r\n id: 'AssetBuildingId',\r\n fieldName: 'AssetBuildingId',\r\n queryStringSerializer: 'AssetBuildingId',\r\n displayName: t(translations.Building),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'AssetBuildingId')),\r\n ),\r\n initData: initPickerValue(initBuildingData),\r\n component: BuildingPickerFilter,\r\n urlType: 'assetBase',\r\n notDefault,\r\n });\r\n}\r\n\r\nexport function pushServicesFilter(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n includeAllMyManagedServicesOption: boolean,\r\n fieldName?: keyof T,\r\n sourceUrl?: ServiceUrl,\r\n separator?: string,\r\n) {\r\n const allMyManagedServicesOption = {\r\n Id: -999,\r\n Name: t(translations.AllMyManagedServices),\r\n };\r\n result.push({\r\n id: 'service',\r\n fieldName: fieldName || 'EquipmentId',\r\n displayName: t(translations.InstrumentServiceName),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('eid'),\r\n urlKey: 'eid',\r\n value: getNumberEntityArray(params, 'eid'),\r\n component:\r\n sourceUrl === 'admin'\r\n ? ServiceAdminFilter\r\n : sourceUrl === 'reserved'\r\n ? ServiceReservationFilter\r\n : ServiceMultiFilter,\r\n additionalItem: includeAllMyManagedServicesOption\r\n ? allMyManagedServicesOption\r\n : undefined,\r\n initData: initMultiExPickerValue(\r\n initOnlineServicesData,\r\n [allMyManagedServicesOption],\r\n sourceUrl,\r\n separator,\r\n ),\r\n customFilter: (value, setting) => {\r\n if (!includeAllMyManagedServicesOption) {\r\n return new Condition(\r\n setting.fieldName,\r\n setting.operator,\r\n value,\r\n setting.fieldName1,\r\n ).toString();\r\n }\r\n //To be able to display records when \"All My Managed Services\" option is selected\r\n if (!!value && setting.fieldName === 'EquipmentId') {\r\n if (\r\n isArray(value) &&\r\n (value as []).find(x => (x as Entity).Id === -999)\r\n ) {\r\n return new Condition(\r\n setting.fieldName,\r\n ODataOperators.NotEquals,\r\n -999,\r\n ).toString();\r\n } else {\r\n return new Condition(\r\n setting.fieldName,\r\n setting.operator,\r\n value,\r\n ).toString();\r\n }\r\n }\r\n },\r\n });\r\n}\r\n\r\nexport function pushServicesCalendarFilter(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n includeAllMyManagedServicesOption: boolean,\r\n fieldName?: keyof T,\r\n sourceUrl?: ServiceUrl,\r\n separator?: string,\r\n) {\r\n const allMyManagedServicesOption = {\r\n Id: -999,\r\n Name: t(translations.AllMyManagedServices),\r\n };\r\n result.push({\r\n id: 'service',\r\n fieldName: fieldName || 'EquipmentId',\r\n displayName: t(translations.InstrumentServiceName),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('eid'),\r\n urlKey: 'eid',\r\n value: getNumberEntityArray(params, 'eid'),\r\n component:\r\n sourceUrl === 'admin'\r\n ? ServiceAdminFilter\r\n : sourceUrl === 'reserved'\r\n ? ServiceReservationFilter\r\n : ServiceMultiFilter,\r\n additionalItem: includeAllMyManagedServicesOption\r\n ? allMyManagedServicesOption\r\n : undefined,\r\n initData: initMultiExPickerValue(\r\n initOnlineServicesData,\r\n [allMyManagedServicesOption],\r\n sourceUrl,\r\n separator,\r\n ),\r\n renderFilterDisplay: InstrumentsFilterDisplay,\r\n });\r\n}\r\n\r\nexport function pushCampusFilter(\r\n appSettings: AppSettings | null,\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Campus)) {\r\n result.push({\r\n id: 'campus',\r\n fieldName: 'AssetCampusId',\r\n displayName: t(translations.Campus),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'campus',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'campus')),\r\n ),\r\n initData: initPickerValue(initCampusData),\r\n\r\n component: CampusFilter,\r\n notDefault,\r\n urlKey: 'campus',\r\n });\r\n }\r\n}\r\nexport function pushWorkflowBookingFilter(\r\n settings: GlobalSettings | null,\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n if (\r\n settings?.GetBoolean(AllowedSettings[AllowedSettings.AllowWorkflowBooking])\r\n ) {\r\n result.push({\r\n id: 'WorkflowBooking',\r\n fieldName: 'WorkflowBookingId',\r\n displayName: t(translations.WorkflowBooking),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'wbId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'wbId')),\r\n ),\r\n initData: initPickerValue(initWorkflowBookingData),\r\n component: WorkflowBookingFilter,\r\n notDefault,\r\n urlKey: 'wbId',\r\n });\r\n }\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, takeLatest } from 'redux-saga/effects';\r\nimport { repetitiveActions as actions } from '.';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\n\r\nfunction* doSaveState(action: PayloadAction) {\r\n yield put(actions.saveState_success(action.payload));\r\n}\r\nfunction* doSetRepetitiveValue(\r\n action: PayloadAction<{\r\n fieldKey: keyof IRepetitiveDto;\r\n fieldValue: any;\r\n }>,\r\n) {\r\n yield put(actions.setRepetitiveValueSuccess(action.payload));\r\n}\r\nexport function* repetitiveSaga() {\r\n yield takeLatest(actions.saveState.type, doSaveState);\r\n yield takeLatest(actions.setRepetitiveValue.type, doSetRepetitiveValue);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n IRepetitiveDto,\r\n RepetitiveInit,\r\n ShortWeekDays,\r\n} from 'types/IRepetitiveDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { repetitiveSaga } from './saga';\r\nimport { RepetitiveState } from './types';\r\n\r\nexport const initialState: RepetitiveState = {\r\n processing: false,\r\n data: {\r\n StartDate: undefined,\r\n RecurringEvents: null,\r\n RepeatsOnDays: ShortWeekDays().map(f => {\r\n if (f.Id === 0) f.checked = true;\r\n return f;\r\n }),\r\n RecurringEndDate: undefined,\r\n RepeatsEveryDay: null,\r\n RepeatsEveryPeriod: null,\r\n RepeatsMonthlyBy: null,\r\n },\r\n repetitiveValueHandler: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'repetitive',\r\n initialState,\r\n reducers: {\r\n resetState(state, action: PayloadAction) {\r\n state.data = RepetitiveInit(action.payload ?? new Date());\r\n },\r\n saveState(state, action: PayloadAction) {},\r\n saveState_success(state, action: PayloadAction) {\r\n state.data = {\r\n StartDate: action.payload.StartDate,\r\n RecurringEvents: action.payload.RecurringEvents,\r\n RepeatsOnDays: action.payload.RepeatsOnDays,\r\n RecurringEndDate: action.payload.RecurringEndDate,\r\n RepeatsEveryDay: action.payload.RepeatsEveryDay,\r\n RepeatsEveryPeriod: action.payload.RepeatsEveryPeriod,\r\n RepeatsMonthlyBy: action.payload.RepeatsMonthlyBy,\r\n };\r\n },\r\n setSubmit(state, action: PayloadAction) {\r\n state.processing = action.payload;\r\n },\r\n setRepetitiveValue(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof IRepetitiveDto;\r\n fieldValue: any;\r\n }>,\r\n ) {},\r\n setRepetitiveValueSuccess(\r\n state,\r\n action: PayloadAction<{\r\n fieldKey: keyof IRepetitiveDto;\r\n fieldValue: any;\r\n }>,\r\n ) {\r\n state.repetitiveValueHandler = {\r\n run: true,\r\n fieldKey: action.payload.fieldKey,\r\n fieldValue: action.payload.fieldValue,\r\n shouldValidate: true,\r\n };\r\n },\r\n resetRepetitiveHandler(state, action: PayloadAction) {\r\n state.repetitiveValueHandler = undefined;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: repetitiveActions } = slice;\r\n\r\nexport const useRepetitiveSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: repetitiveSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useRepetitiveSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","/**\r\n * Bookit.Data.ServiceGroupRegistrationStatus\r\n */\r\nexport enum ServiceGroupRegistrationStatus {\r\n Approved = 0,\r\n Rejected = 1,\r\n Pending = 2,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { ConfigurableTypes } from 'enums/ConfigurableTypes';\r\nimport { Column } from 'react-table';\r\nimport { IRow } from './IRow';\r\n\r\n/**\r\n * Simplest in memory cache of the configurable columns\r\n * TODO: replace this one with something a little bit capable (e.g. expiration, cache-control, etc.)\r\n */\r\nconst configurableColumnsCache: Record<\r\n string,\r\n Promise>\r\n> = {};\r\n\r\nexport interface ConfigurableColumns {\r\n Id: string;\r\n DisplayName: string;\r\n CustomName: string;\r\n hasCustomName: boolean;\r\n}\r\n\r\n/**\r\n * Returns cached configurable columns data. Can be also used for pre fetching screens that are likely will be visited.\r\n * Server request can be already resolved one which will return the data immediately.\r\n * If the request is pending, it will resolve for all callers on completion.\r\n * In case no calls were made yet with exact params, a new request will be issued and a pending promis will be returned.\r\n * @param listId listId aka screenId\r\n * @param configurableType screen/export\r\n * @param force forces reload of configurable column and ignores cache\r\n * @returns A promise of the configurable columns data.\r\n */\r\nexport async function GetCachedConfigurableColumnsData(\r\n listId: number,\r\n configurableType: number,\r\n isAuthenticated?: boolean,\r\n force?: boolean,\r\n) {\r\n const privateUrl = '/api/odata/v4/ConfigurableColumns';\r\n const publicUrl = '/api/odata/v4/ConfigurableColumns/PublicColumns';\r\n const url = isAuthenticated ? privateUrl : publicUrl;\r\n const param = { ListID: listId, ConfigurableType: configurableType };\r\n const key = JSON.stringify(param);\r\n\r\n // drops stored value so it will be reloaded later\r\n if (force === true) {\r\n delete configurableColumnsCache[key];\r\n }\r\n\r\n // load configurable columns data if it's not present yet\r\n if (configurableColumnsCache[key] === undefined) {\r\n configurableColumnsCache[key] = loadData(url, param);\r\n }\r\n return await configurableColumnsCache[key];\r\n}\r\n/**\r\n * Loads configurable columns from the server. Throws an error if there's no columns configured\r\n * @param url\r\n * @param param\r\n * @returns\r\n */\r\nasync function loadData(url, param) {\r\n try {\r\n const response = await httpClient.get<\r\n IODataQueryResponse\r\n >(url, param);\r\n if (!response || !response.value || response.value.length === 0) {\r\n throw new Error('Unexpected configurable columns response');\r\n }\r\n return response.value;\r\n } catch (error) {\r\n throw error;\r\n }\r\n}\r\n\r\nexport function getTableColumns({\r\n response,\r\n ConfigurableColumnsSetUp,\r\n}: {\r\n response: ConfigurableColumns[];\r\n ConfigurableColumnsSetUp: Column[];\r\n}) {\r\n var res: Column[] = [];\r\n\r\n if (!response || response.length === 0) {\r\n return ConfigurableColumnsSetUp;\r\n } else {\r\n for (var i = 0; i < response.length; i++) {\r\n for (var j = 0; j < ConfigurableColumnsSetUp.length; j++) {\r\n if (\r\n ConfigurableColumnsSetUp[j].accessor === response[i].Id ||\r\n ConfigurableColumnsSetUp[j].accessor === response[i].DisplayName ||\r\n // This is for dummy columns when no accessor is defined.\r\n ConfigurableColumnsSetUp[j].Header === response[i].DisplayName\r\n ) {\r\n if (response[i].hasCustomName) {\r\n ConfigurableColumnsSetUp[j].Header = response[i].CustomName;\r\n }\r\n res.push(ConfigurableColumnsSetUp[j]);\r\n break;\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n}\r\n\r\nexport async function TryGetExportColumns(\r\n listId: number | undefined,\r\n columns: Array>,\r\n): Promise | undefined> {\r\n try {\r\n if (listId === undefined) {\r\n return getColumnAccessors(columns);\r\n } else {\r\n const columnsData = await GetCachedConfigurableColumnsData(\r\n listId,\r\n ConfigurableTypes.ColumnExportConfig,\r\n );\r\n return columnsData.map(item => item.Id);\r\n }\r\n } catch (error) {\r\n return getColumnAccessors(columns);\r\n }\r\n}\r\n\r\nexport function getColumnAccessors(\r\n columns: Column[],\r\n): Array {\r\n const result: Array = columns\r\n .filter(c => typeof c.accessor === 'string')\r\n .filter(c => c.accessor !== undefined)\r\n .map(c => c.accessor as keyof TRow);\r\n return result;\r\n}\r\n","export enum RemindBefore {\r\n doNotNotify = 0,\r\n oneday = 1,\r\n twodays = 2,\r\n threedays = 3,\r\n oneweek = 4,\r\n onemonth = 5,\r\n custom = 6,\r\n}\r\n","/**\r\n *\r\n * UserMultiPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nimport * as React from 'react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { UserUrl } from '../UserPicker';\r\n\r\nexport interface UserPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n selectArray?: Array;\r\n urlType?: UserUrl;\r\n separator?: string;\r\n}\r\n\r\nconst defaultUrl = '/api/odata/v4/UserFilter';\r\nconst fullActiveUrl = '/api/odata/v4/UserFilter/GetUserSelections';\r\nconst adminsUrl = '/api/odata/v4/UserFilter/GetAdminUsers';\r\nexport const initUserMultiData = (\r\n initval: string | undefined,\r\n sourceUrl?: UserUrl,\r\n separator?: string,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids = (initval.indexOf(separator || '|') !== -1\r\n ? initval.split(separator || '|')\r\n : [initval]\r\n ).map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n let filters: string | undefined = undefined;\r\n if (ids.length > 0) {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n filters = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filters,\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'full'\r\n ? fullActiveUrl\r\n : sourceUrl === 'admin'\r\n ? adminsUrl\r\n : defaultUrl;\r\n\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function UserMultiPicker(props: UserPickerProps) {\r\n const { selectArray, predicates, urlType, ...other } = props;\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url:\r\n urlType === 'full'\r\n ? fullActiveUrl\r\n : urlType === 'admin'\r\n ? adminsUrl\r\n : defaultUrl,\r\n predicates: predicates,\r\n select: selectArray ?? [\r\n 'Id',\r\n 'Name',\r\n 'UserGroups',\r\n 'Budgets',\r\n 'IsAdminPanel',\r\n 'IsEquipmentAdmin',\r\n 'IsGroupAdmin',\r\n 'IsLabTech',\r\n 'ServiceGroupIds',\r\n 'Services',\r\n 'CustomRoles',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'UserRoles',\r\n ],\r\n expand: 'Services,UserGroups',\r\n });\r\n return (\r\n \r\n );\r\n}\r\n\r\n//PREDICATES FUNCTION\r\nexport function ContactsByAssetIdsFilter(\r\n AssetIds: number[],\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (AssetIds.length > 0) {\r\n let ids = AssetIds.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition('AssetIds', ODataOperators.Includes, ids),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","import { isEqual } from 'lodash';\r\nimport { IFilterSettings } from './IFilterSettings';\r\n\r\nexport function areSameFilter({\r\n f,\r\n item,\r\n}: {\r\n f: IFilterSettings | undefined;\r\n item: IFilterSettings | undefined;\r\n}): boolean {\r\n return (\r\n f !== undefined &&\r\n item !== undefined &&\r\n isEqual(filterKey(f), filterKey(item))\r\n );\r\n}\r\n\r\nexport const filterKey = (f: IFilterSettings) =>\r\n f.id !== undefined\r\n ? f.id\r\n : {\r\n fieldName: f.fieldName,\r\n fieldName1: f.fieldName1,\r\n displayName: f.displayName,\r\n };\r\n\r\nexport const filtersInQuery = (\r\n filters: IFilterSettings[],\r\n query: string,\r\n) => {\r\n return filters.filter(f => f.value !== undefined);\r\n};\r\n","/**\r\n *\r\n * FormOnlineServicesComboPicker - FormOnlineServicesSinglePicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n OnlineServiceMultiPicker,\r\n OnlineServicePickerProps,\r\n OnlineServiceSinglePicker,\r\n} from '../pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport const FormOnlineServicesComboPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & { multiple: boolean } & OnlineServicePickerProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n if (props.multiple) {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n urlType={props.urlType}\r\n />\r\n );\r\n } else {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n urlType={props.urlType}\r\n info={props.info}\r\n />\r\n );\r\n }\r\n};\r\nexport const FormOnlineServicesSinglePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps &\r\n OnlineServicePickerProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n\r\n return (\r\n {\r\n helpers.setValue(value[0], true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value === null ? undefined : [field.value]}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n urlType={props.urlType}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n );\r\n};\r\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity, Identifiable } from 'types/common';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { INamedEntity } from 'types/common';\r\nimport { IAssetAvailabilityDto } from './IAssetAvailabilityDto';\r\nimport { IServiceFilterDto } from './IServiceFilterDto';\r\nimport { IServiceTypeFilterDto } from './IServiceTypeFilterDto';\r\n\r\n/**\r\n *\r\n * auto generated interface for bkt_webApp.Api.OData.V4.Dto.AssetDto\r\n *\r\n */\r\nexport interface IAssetDto extends Entity {\r\n Id: number;\r\n Name: string;\r\n Active?: boolean;\r\n Availability?: IAssetAvailabilityDto;\r\n ServiceId?: number | null;\r\n ServiceTypeId?: number | null;\r\n ServiceGroupId?: number | null;\r\n ServiceGroupName?: string | null;\r\n Image?: string;\r\n AssetCatId?: number | null;\r\n PrerequisiteFor?: number | null;\r\n BookableAsset?: boolean;\r\n ServiceGroupAssetId?: number | null;\r\n Color?: string;\r\n}\r\nexport const mapAssetsToServiceFilterDto = (\r\n assets: IAssetDto[],\r\n): IServiceFilterDto[] => {\r\n return assets.map(a => {\r\n return {\r\n Id: a.ServiceId,\r\n Name: a.Name,\r\n ServiceGroupId: a.ServiceGroupId,\r\n ServiceTypeId: a.ServiceTypeId,\r\n } as IServiceFilterDto;\r\n });\r\n};\r\nexport const mapAssetsToServiceTypeFilterDto = (\r\n assets: IAssetDto[],\r\n): IServiceTypeFilterDto[] => {\r\n return assets.map(a => {\r\n return {\r\n Id: a.ServiceId ?? 0,\r\n Name: a.Name,\r\n ServiceGroupId: a.ServiceGroupId ?? 0,\r\n ServiceTypeId: a.ServiceTypeId ?? 1,\r\n } as IServiceTypeFilterDto;\r\n });\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BudgetPicker } from '../pickers/AutocompletePickers/BudgetPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormBudgetPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & { useSearchOrPredicate?: boolean }) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n {\r\n props.onChange?.(value);\r\n helpers.setValue(value, true);\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n variant=\"filled\"\r\n predicates={props.predicates}\r\n useSearchOrPredicate={props.useSearchOrPredicate}\r\n info={props.info}\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.ServiceRequestMilestoneStatuses\r\n *\r\n */\r\n\r\nexport enum ServiceRequestMilestoneStatuses {\r\n NotStarted = 0,\r\n Started = 1,\r\n Completed = 2,\r\n}\r\nexport type ServiceRequestMilestoneStatusesUnion = keyof typeof ServiceRequestMilestoneStatuses;\r\nexport const ServiceRequestMilestoneStatusesUnionArray: Array = [\r\n 'NotStarted',\r\n 'Started',\r\n 'Completed',\r\n];\r\n","import { IRepairCodeDto } from 'api/odata/generated/entities/IRepairCodeDto';\r\nimport { ISymptomCodeDto } from 'api/odata/generated/entities/ISymptomCodeDto';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { GetIntervals, IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { getSingleReminder } from 'app/components/pickers/StaticOptionsPickers/RemindBeforePicker';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { RemindBefore } from 'enums/RemindBefore';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Guid } from 'guid-typescript';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport {\r\n PageTypeProps,\r\n RenderPageType,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\n//import { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface WorkOrderState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n reservationOffline: AsyncDataState;\r\n processing: boolean;\r\n sendEmailOnOffline: boolean;\r\n readonlyState?: WorkOrderReadonlyState;\r\n updateAllRecurrent: boolean;\r\n valueHandler?: FieldHandlerProps;\r\n linksProcessing?: boolean;\r\n /**\r\n * Value used to change the offline event start from outside of the workorder details\r\n */\r\n OfflineEventStart?: Date | Timestamp | null;\r\n /**\r\n * Value used to change the offline event end from outside of the workorder details\r\n */\r\n OfflineEventEnd?: Date | Timestamp | null;\r\n doSaveNewComments?: boolean;\r\n createdOrders: number[];\r\n savedLinkedOrders: IWorkOrderDetailsDto[];\r\n calibrationsChanged?: boolean;\r\n downtimeOverlaps?: DowntimeOverlaps[];\r\n}\r\nexport interface WorkOrderResponse extends IResponseType {\r\n Id?: number;\r\n sendEmailOnOffline: boolean;\r\n RecurringAssetId: number | null;\r\n RecurringGroupId: number | null;\r\n WorkOrderTypeId: number | null;\r\n ReservationOffline: ReservationsOfflineData[];\r\n AutoCreatedOrders: AutoCreateResult[];\r\n}\r\nexport interface WorkOrderGlobalState {\r\n workOrderDetails: WorkOrderDetailsState;\r\n RepetitiveOptions: IRepetitiveDto | null;\r\n commmentIds?: number[];\r\n}\r\nexport interface WorkOrderDetailsState {\r\n Id: number;\r\n Assets: Entity[];\r\n WorkOrderType: Entity | null;\r\n WorkOrderTypeStatus: Entity | null;\r\n SymptomCodes: Entity[];\r\n RepairCodes: Entity[];\r\n RemindBefore: Entity | null;\r\n EventStart: Date | Timestamp;\r\n EventEnd?: Date | Timestamp | null;\r\n AlertStart?: Date | Timestamp | null;\r\n AssignUsers: Entity[];\r\n Description?: string | null;\r\n Downtime?: boolean;\r\n ToDown: boolean;\r\n OfflineEventStart?: Date | Timestamp | null;\r\n OfflineEventEnd?: Date | Timestamp | null;\r\n ReasonType?: Entity | null;\r\n OfflineRemarks?: string | null;\r\n AlertTitle?: string | null;\r\n AutoCreateTitle?: string | null;\r\n RecurringAssetId: number | null;\r\n RecurringGroupId: number | null;\r\n SubmissionFormValues: IFormValueDto[];\r\n StaffFormValues: IFormValueDto[];\r\n SubmissionFormFiles: IFormFileValue[];\r\n StaffFormFiles: IFormFileValue[];\r\n StuffCustomForm: Entity | null;\r\n HasAletForm: boolean;\r\n IsClosed: boolean;\r\n ClosedStatuses: Entity[];\r\n ReportedBy?: string | null;\r\n ShowOnCalibrationHistory: boolean;\r\n NotEditable: boolean;\r\n ReservationId: number | null;\r\n}\r\nexport interface SendEmailOnOffline {\r\n cancel: boolean;\r\n deleted: boolean;\r\n insert: boolean;\r\n sendData: ReservationsOfflineData[];\r\n}\r\nexport interface ReservationsOfflineData {\r\n AlertId: number;\r\n offStart: Date | string;\r\n offEnd: Date | string;\r\n ReasonName: string;\r\n Remarks: string;\r\n reservationIds: string;\r\n}\r\nexport interface AutoCreateResult {\r\n AlertId: number;\r\n Date: Date;\r\n}\r\nexport interface WorkOrderReadonlyState {\r\n AlertType: string | null;\r\n UpdateUser: IUserFilterDto;\r\n StatusName: string | null;\r\n ReportedBy: string | null;\r\n ReportedByDisplayName: string | null;\r\n LastUpdated: Date | Timestamp | null;\r\n Reservation: number | null;\r\n LastComment: string | null;\r\n LastCommentBy: string | null;\r\n AssetCatName: string | null;\r\n AssetCatGroupName: string | null;\r\n IsClosed: boolean | null;\r\n ReservationBookedBy: string;\r\n ReservationUserGroup: string;\r\n ReservationInstituteId: number | null;\r\n DoneDate: Date | Timestamp | null;\r\n DoneBy: string | null;\r\n InternalServiceAvaliable: boolean;\r\n CreateDate: Date | Timestamp | null;\r\n LinkedAlerts: Entity[];\r\n}\r\nexport interface WorkOrderQueryStringParameters {\r\n id?: string;\r\n aType?: string;\r\n down?: string;\r\n source?: string;\r\n Up?: string;\r\n title?: string;\r\n eStart?: string;\r\n sympt?: string;\r\n aStatus?: string;\r\n aStart?: string;\r\n desc?: string;\r\n assetId?: string;\r\n offH?: string;\r\n offStart?: string;\r\n offEnd?: string;\r\n reason?: string;\r\n eqid?: string;\r\n sid?: string;\r\n defaultMulti?: string;\r\n continueTo?: string;\r\n reservationId?: string;\r\n}\r\nexport interface WorkOrderDates {\r\n start: Date[];\r\n end: Date[];\r\n alert: Date[];\r\n offlineStart: Date[];\r\n offlineEnd: Date[];\r\n}\r\n\r\nexport interface ContinueToState {\r\n pageType?: RenderPageType;\r\n pageProps?: PageTypeProps;\r\n continueToLink?: string;\r\n}\r\nexport interface DowntimeOverlaps {\r\n Id: number;\r\n AssetId: number;\r\n ServiceId: number;\r\n}\r\nexport function ConvertEntityToModel(\r\n entity: IWorkOrderDetailsDto,\r\n toDown: boolean | undefined,\r\n): WorkOrderDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n const result: WorkOrderDetailsState = {\r\n Id: entity.Id,\r\n AlertStart: entity.AlertStart,\r\n Assets: entity.Assets,\r\n AssignUsers: entity.AssignedUsers,\r\n Description: entity.AlertDescription,\r\n Downtime: entity.InstrumentWasDown,\r\n EventEnd: entity.EventEnd,\r\n EventStart: entity.EventStart,\r\n // convert dates (timestamps) received from the API to Date objects\r\n OfflineEventEnd: entity.OfflineEventEnd,\r\n OfflineEventStart: entity.OfflineEventStart,\r\n OfflineRemarks: entity.OfflineRemarks,\r\n\r\n ReasonType: toEntity(entity.ReasonTypeId, entity.ReasonTypeName),\r\n RemindBefore: getSingleReminder(entity.RemindMeBefore),\r\n WorkOrderType: entity.WorkOrderType, //toEntity(entity.AlertTypeId, entity.AlertType),\r\n WorkOrderTypeStatus: toEntity(entity.StatusId, entity.StatusName),\r\n RepairCodes: entity.RepairCodes as IRepairCodeDto[],\r\n SymptomCodes: entity.SymptomCodes as ISymptomCodeDto[],\r\n AlertTitle: entity.AlertTitle,\r\n ToDown: toDown || false,\r\n RecurringAssetId: entity.RecurringAssetId,\r\n RecurringGroupId: entity.RecurringGroupId,\r\n AutoCreateTitle: entity.AutoCreateTitle,\r\n StaffFormValues: entity.FormValues.filter(\r\n fv => fv.AlertId !== null && fv.AlertTypeId === null,\r\n ),\r\n SubmissionFormValues: entity.FormValues.filter(\r\n fv => fv.AlertId !== null && fv.AlertTypeId !== null,\r\n ),\r\n StaffFormFiles: [] as IFormFileValue[],\r\n SubmissionFormFiles: [] as IFormFileValue[],\r\n StuffCustomForm: entity.CustomForm as Entity | null,\r\n HasAletForm: entity.HasAletForm,\r\n IsClosed: entity.IsClosed ?? false,\r\n ClosedStatuses: entity.ClosedStatuses,\r\n ReportedBy: entity.ReportedBy,\r\n ShowOnCalibrationHistory: (entity.WorkOrderType as IWorkOrderTypeDto)\r\n .ShowOnCalibrationHistory,\r\n NotEditable: (entity.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n ReservationId: entity.Reservation,\r\n } as WorkOrderDetailsState;\r\n return result;\r\n }\r\n}\r\nexport function parseRepetitive(\r\n model: WorkOrderDetailsState,\r\n repetitive: IRepetitiveDto,\r\n): WorkOrderDates {\r\n const dates: WorkOrderDates = {\r\n start: [],\r\n end: [],\r\n alert: [],\r\n offlineStart: [],\r\n offlineEnd: [],\r\n };\r\n let start = dateUtils.dateOrStringToDate(model.EventStart);\r\n dates.start = GetIntervals(start, repetitive);\r\n if (!isNullOrUndefined(model.EventEnd)) {\r\n let end = dateUtils.dateOrStringToDate(model.EventEnd);\r\n dates.end = dates.start.map(s => {\r\n if (s === start) {\r\n return end;\r\n } else {\r\n let dur = dateUtils.intervalToDuration({\r\n start: start,\r\n end: s,\r\n });\r\n return dateUtils.add(end, dur);\r\n }\r\n });\r\n }\r\n if (!isNullOrUndefined(model.AlertStart)) {\r\n // start = dateUtils.dateOrStringToDate(model.AlertStart);\r\n // dates.alert = GetIntervals(start, repetitive);\r\n let alertStart = dateUtils.dateOrStringToDate(model.AlertStart);\r\n // let alertDuration = dateUtils.intervalToDuration({\r\n // start: start,\r\n // end: alertStart,\r\n // });\r\n dates.alert = dates.start.map(s => {\r\n if (s === start) {\r\n return alertStart;\r\n } else {\r\n let dur = dateUtils.intervalToDuration({\r\n start: start,\r\n end: s,\r\n });\r\n return dateUtils.add(alertStart, dur);\r\n }\r\n });\r\n }\r\n if (!isNullOrUndefined(model.OfflineEventStart)) {\r\n // start = dateUtils.dateOrStringToDate(model.OfflineEventStart);\r\n // dates.offlineStart = GetIntervals(start, repetitive);\r\n let offStart = dateUtils.dateOrStringToDate(model.OfflineEventStart);\r\n dates.offlineStart = dates.start.map(s => {\r\n if (s === start) {\r\n return offStart;\r\n } else {\r\n let dur = dateUtils.intervalToDuration({\r\n start: start,\r\n end: s,\r\n });\r\n return dateUtils.add(offStart, dur);\r\n }\r\n });\r\n }\r\n if (!isNullOrUndefined(model.OfflineEventEnd)) {\r\n let offend = dateUtils.dateOrStringToDate(model.OfflineEventEnd);\r\n dates.offlineEnd = dates.start.map(s => {\r\n if (s === start) {\r\n return offend;\r\n } else {\r\n let dur = dateUtils.intervalToDuration({\r\n start: start,\r\n end: s,\r\n });\r\n return dateUtils.add(offend, dur);\r\n }\r\n });\r\n }\r\n return dates;\r\n}\r\nexport function ConvertNewWorkOrdersToModel(\r\n model: WorkOrderGlobalState,\r\n user: AuthenticatedUser | undefined,\r\n): IWorkOrderDetailsDto[] {\r\n let entities = [] as IWorkOrderDetailsDto[];\r\n let workModel = model.workOrderDetails;\r\n let repeat =\r\n model.RepetitiveOptions !== null &&\r\n model.RepetitiveOptions.RecurringEndDate !== null &&\r\n model.RepetitiveOptions.RecurringEvents != null &&\r\n model.RepetitiveOptions.RecurringEvents.Id !== RepetitiveOptions.DoNotRepeat\r\n ? model.RepetitiveOptions\r\n : null;\r\n let repeatAsset = workModel.Assets.length > 1;\r\n let times = repeat ? parseRepetitive(model.workOrderDetails, repeat) : null;\r\n let assetGuid: Guid | null =\r\n workModel.Assets.length > 1 ? Guid.create() : null;\r\n workModel.Assets.forEach(ass => {\r\n let asset = ass as IAssetDto;\r\n if (repeat !== null && times !== null) {\r\n let timesGuid = Guid.create();\r\n times.start.forEach((date, idx) => {\r\n entities.push({\r\n Id: -1,\r\n EventStart: dateUtils.formatISO(date),\r\n EventEnd: isNullOrUndefined(times?.end[idx])\r\n ? null\r\n : dateUtils.tryFormatIso(times?.end[idx]),\r\n AlertDescription: workModel.Description || null,\r\n AlertStart: isNullOrUndefined(times?.alert[idx])\r\n ? null\r\n : dateUtils.tryFormatIso(times?.alert[idx]),\r\n\r\n AlertTitle: workModel.AlertTitle,\r\n AlertTypeId: workModel.WorkOrderType?.Id ?? -1,\r\n StatusId: workModel.WorkOrderTypeStatus?.Id,\r\n AssetId: asset.Id,\r\n ServiceId: asset.ServiceId,\r\n ServiceTypeId: asset.ServiceTypeId,\r\n ServiceGroupId: asset.ServiceGroupId,\r\n AssignedUsers: workModel.AssignUsers as IUserFilterDto[],\r\n OfflineEventStart: isNullOrUndefined(times?.offlineStart[idx])\r\n ? null\r\n : dateUtils.tryFormatIso(times?.offlineStart[idx]),\r\n OfflineEventEnd:\r\n workModel.OfflineEventStart !== null &&\r\n workModel.Downtime &&\r\n isNullOrUndefined(workModel.OfflineEventEnd)\r\n ? dateUtils.formatISO(MaxDate)\r\n : dateUtils.tryFormatIso(times?.offlineEnd[idx]),\r\n OfflineRemarks: workModel.OfflineRemarks,\r\n ReasonTypeId: workModel.ReasonType?.Id,\r\n ReasonTypeName: workModel.ReasonType?.Name,\r\n InstrumentWasDown: workModel.Downtime ?? false,\r\n Repeat: true,\r\n RepeatAssets: repeatAsset,\r\n RepeatEndTime: repeat?.RecurringEndDate,\r\n RepairCodes: workModel.RepairCodes as IRepairCodeDto[],\r\n SymptomCodes: workModel.SymptomCodes as ISymptomCodeDto[],\r\n RecurringAssetUniq: assetGuid?.toString() ?? null,\r\n RecurringGroupUniq: timesGuid?.toString() ?? null,\r\n FormValues: workModel.SubmissionFormValues.concat(\r\n workModel.StaffFormValues,\r\n ),\r\n Reservation: workModel.ReservationId,\r\n ReportedBy: user?.Id,\r\n StaffOnly: (workModel.WorkOrderType as IWorkOrderTypeDto).StaffOnly,\r\n ShowOnCalibrationHistory: (\r\n workModel.WorkOrderType as IWorkOrderTypeDto\r\n ).ShowOnCalibrationHistory,\r\n NotEditable: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n .NotEditable,\r\n CommentIds: model.commmentIds ?? [],\r\n } as unknown as IWorkOrderDetailsDto);\r\n });\r\n } else {\r\n entities.push({\r\n Id: -1,\r\n EventStart: dateUtils.tryFormatIso(workModel.EventStart),\r\n AlertDescription: workModel.Description || null,\r\n AlertStart: isNullOrUndefined(workModel.AlertStart)\r\n ? null\r\n : dateUtils.tryFormatIso(workModel.AlertStart),\r\n AlertTitle: workModel.AlertTitle,\r\n AlertTypeId: workModel.WorkOrderType?.Id ?? -1,\r\n StatusId: workModel.WorkOrderTypeStatus?.Id,\r\n AssetId: ass.Id,\r\n ServiceId: asset.ServiceId,\r\n ServiceTypeId: asset.ServiceTypeId,\r\n ServiceGroupId: asset.ServiceGroupId,\r\n AssignedUsers: workModel.AssignUsers as IUserFilterDto[],\r\n OfflineEventStart: isNullOrUndefined(\r\n workModel.OfflineEventStart,\r\n )\r\n ? null\r\n : dateUtils.tryFormatIso(workModel.OfflineEventStart),\r\n OfflineEventEnd:\r\n workModel.OfflineEventStart !== null &&\r\n workModel.Downtime &&\r\n isNullOrUndefined(workModel.OfflineEventEnd)\r\n ? dateUtils.formatISO(MaxDate)\r\n : isNullOrUndefined(workModel.OfflineEventEnd)\r\n ? null\r\n : dateUtils.tryFormatIso(workModel.OfflineEventEnd),\r\n OfflineRemarks: workModel.OfflineRemarks,\r\n ReasonTypeId: workModel.ReasonType?.Id,\r\n ReasonTypeName: workModel.ReasonType?.Name,\r\n InstrumentWasDown: workModel.Downtime ?? false,\r\n Repeat: false,\r\n RepeatAssets: repeatAsset,\r\n RepairCodes: workModel.RepairCodes as IRepairCodeDto[],\r\n SymptomCodes: workModel.SymptomCodes as ISymptomCodeDto[],\r\n RecurringAssetUniq: assetGuid?.toString() ?? null,\r\n RecurringGroupUniq: null,\r\n FormValues: workModel.SubmissionFormValues.concat(\r\n workModel.StaffFormValues,\r\n ),\r\n Reservation: workModel.ReservationId,\r\n ReportedBy: user?.Id,\r\n StaffOnly: (workModel.WorkOrderType as IWorkOrderTypeDto).StaffOnly,\r\n ShowOnCalibrationHistory: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n .ShowOnCalibrationHistory,\r\n NotEditable: (workModel.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n CommentIds: model.commmentIds ?? [],\r\n } as IWorkOrderDetailsDto);\r\n }\r\n });\r\n return entities;\r\n}\r\nexport function ConvertModelToEntity(\r\n model: WorkOrderDetailsState,\r\n original: WorkOrderDetailsState | undefined,\r\n): IWorkOrderDetailsDto {\r\n let entity = {\r\n Id: original?.Id === undefined ? model.Id : original.Id,\r\n AlertDescription: model.Description,\r\n AlertStart: isNullOrUndefined(model.AlertStart)\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.AlertStart)),\r\n AlertTitle: model.AlertTitle,\r\n AlertTypeId: model.WorkOrderType?.Id ?? -1,\r\n AlertType: model.WorkOrderType?.Name,\r\n StatusId: model.WorkOrderTypeStatus?.Id,\r\n StatusName: model.WorkOrderTypeStatus?.Name,\r\n AssetId: model.Assets[0].Id,\r\n AssetName: model.Assets[0].Name,\r\n AssignedUsers: model.AssignUsers as IUserFilterDto[],\r\n EventStart: isNullOrUndefined(model.EventStart)\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EventStart)),\r\n OfflineEventStart: isNullOrUndefined(\r\n model.OfflineEventStart,\r\n )\r\n ? null\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.OfflineEventStart),\r\n ),\r\n OfflineEventEnd:\r\n !isNullOrUndefined(model.OfflineEventStart) &&\r\n model.Downtime\r\n ? isNullOrUndefined(model.OfflineEventEnd)\r\n ? dateUtils.formatISO(MaxDate)\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.OfflineEventEnd),\r\n )\r\n : null,\r\n OfflineRemarks: model.OfflineRemarks,\r\n RemindMeBefore: model.RemindBefore?.Id,\r\n InstrumentWasDown: model.Downtime || false,\r\n ReasonTypeId: model.ReasonType?.Id,\r\n ReasonTypeName: model.ReasonType?.Name,\r\n RepairCodes: model.RepairCodes as IRepairCodeDto[],\r\n SymptomCodes: model.SymptomCodes as ISymptomCodeDto[],\r\n ServiceGroupId: (model.Assets[0] as IAssetDto).ServiceGroupId,\r\n ServiceId: (model.Assets[0] as IAssetDto).ServiceId,\r\n ServiceTypeId: (model.Assets[0] as IAssetDto).ServiceTypeId,\r\n RecurringAssetId: model.RecurringAssetId,\r\n RecurringGroupId: model.RecurringGroupId,\r\n Repeat: model.RecurringGroupId !== null,\r\n RepeatAssets: model.RecurringAssetId !== null,\r\n FormValues: model.SubmissionFormValues.concat(model.StaffFormValues),\r\n ReportedBy: model.ReportedBy,\r\n Reservation: model.ReservationId,\r\n ShowOnCalibrationHistory: (model.WorkOrderType as IWorkOrderTypeDto)\r\n .ShowOnCalibrationHistory,\r\n NotEditable: (model.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n } as IWorkOrderDetailsDto;\r\n\r\n return entity;\r\n}\r\nexport const getAlertStart = (\r\n remindBefore: number,\r\n Start: Date | Timestamp,\r\n): Date | Timestamp | null => {\r\n let alertStart: Date | null = new Date();\r\n switch (remindBefore as RemindBefore) {\r\n case RemindBefore.doNotNotify:\r\n alertStart = null;\r\n break;\r\n case RemindBefore.oneday:\r\n alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -1);\r\n break;\r\n case RemindBefore.twodays:\r\n alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -2);\r\n break;\r\n case RemindBefore.threedays:\r\n alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -3);\r\n break;\r\n case RemindBefore.oneweek:\r\n alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -7);\r\n break;\r\n case RemindBefore.onemonth:\r\n alertStart = dateUtils.addMonths(dateUtils.dateOrStringToDate(Start), -1);\r\n break;\r\n default:\r\n alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -1);\r\n break;\r\n }\r\n return alertStart;\r\n};\r\n\r\nexport const MaxDate: Date = dateUtils.set(new Date(), {\r\n year: 9999,\r\n month: 11,\r\n date: 31,\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n});\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { SearchColumnType } from 'app/components/BasicTable/BasicTableProps';\r\nimport { isEmpty } from 'lodash';\r\nimport { SortingRule } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { getPredicates } from './getPredicates';\r\nimport { Condition, ODataFilterBuilder, ODataOperators } from './ODataFilter';\r\n\r\nexport const buildParams = (\r\n state: {\r\n pageSize: number;\r\n pageIndex: number;\r\n sortBy?: SortingRule[] | null;\r\n globalFilterValue?: string;\r\n customFilter: IFilterSettings[];\r\n select: Array;\r\n additionalColumns?: Array;\r\n serviceGroups: Entity[];\r\n isOptionalServiceGroup: boolean;\r\n expandedColumns?: Array;\r\n predicates?: Array | string>;\r\n },\r\n searchColumns?: Array>,\r\n customParams?: (fieldName: string, Id: number, fn: (p: {}) => void) => void,\r\n isExport?: boolean,\r\n) => {\r\n const params: {\r\n $skip: number;\r\n $top: number;\r\n $count: boolean;\r\n $select: string;\r\n $orderby?: string;\r\n $filter?: string;\r\n $expand?: string;\r\n } = {\r\n $skip: state.pageIndex * state.pageSize,\r\n $top: state.pageSize,\r\n // adds inline count of all records\r\n $count: true,\r\n // definition of columns required\r\n $select: isExport\r\n ? state.select.join(',')\r\n : [\r\n ...new Set([...state.select, ...(state.additionalColumns ?? [])]),\r\n ].join(','),\r\n };\r\n const expaneded = state.expandedColumns?.filter(\r\n c => state.select.includes(c) || state.additionalColumns?.includes(c),\r\n );\r\n\r\n if (expaneded && expaneded.length > 0) {\r\n params.$expand = expaneded.join(',');\r\n }\r\n const customparams = {};\r\n function cp(p: {}) {\r\n Object.assign(customparams, p);\r\n }\r\n\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: [\r\n ...(state.predicates ?? []),\r\n ...getPredicates(state.customFilter, customParams, cp),\r\n ],\r\n globalServiceGroupFilter:\r\n state.serviceGroups === undefined || state.serviceGroups.length === 0\r\n ? undefined\r\n : state.additionalColumns?.find(f => f === 'ServiceGroupId') !==\r\n undefined ||\r\n state.select.find(f => f === 'ServiceGroupId') !== undefined\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n state.serviceGroups,\r\n ),\r\n ]\r\n : state.additionalColumns?.find(f => f === 'ServiceGroups') !==\r\n undefined ||\r\n state.select.find(f => f === 'ServiceGroups') !== undefined\r\n ? state.isOptionalServiceGroup\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.HasNoAny,\r\n state.serviceGroups,\r\n ),\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n state.serviceGroups,\r\n 'Id',\r\n ),\r\n ]\r\n : [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n state.serviceGroups,\r\n 'Id',\r\n ),\r\n ]\r\n : undefined,\r\n stringColumns: searchColumns || [],\r\n stringSearch: state.globalFilterValue,\r\n isOptionalServiceGroup: state.isOptionalServiceGroup,\r\n }).toString();\r\n\r\n // sort parameter should be present only if sorting is defined\r\n // empty $orderby is considered a bad request\r\n if (!isEmpty(state?.sortBy)) {\r\n params.$orderby = state.sortBy\r\n ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n .join(',');\r\n }\r\n Object.assign(params, customparams);\r\n return params;\r\n};\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface BulletedListItem {\r\n key: React.Key | null | undefined;\r\n node: React.ReactNode;\r\n}\r\nexport interface BulletedListProps {\r\n items: BulletedListItem[];\r\n showBullet?: boolean;\r\n}\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n '&': {\r\n listStyle: 'none',\r\n },\r\n '& li:before': {\r\n content: \"'•'\",\r\n color: theme.palette.primary.main,\r\n fontWeight: 'bold',\r\n display: 'inline-block',\r\n width: '1em',\r\n marginLeft: '-1em',\r\n },\r\n },\r\n }),\r\n);\r\n\r\nconst bulletedStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n rows: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n margin: 0,\r\n gap: '8px',\r\n flexGrow: 1,\r\n overflowY: 'auto',\r\n overflowX: 'clip',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n height: 'auto', // isMobile ? '90px' : `${cardcurrentHeight - (84 + 64)}px`,\r\n maxHeight: 200,\r\n },\r\n row: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: 8,\r\n height: 25,\r\n // width: '100%',\r\n },\r\n rowOverRule: {\r\n display: 'flex',\r\n width: '100%',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '23ch',\r\n },\r\n }),\r\n);\r\nexport const StyledList = ({\r\n children,\r\n className,\r\n style,\r\n}: React.PropsWithChildren<{\r\n className?: string;\r\n style?: React.CSSProperties;\r\n}>) => {\r\n const classes = useStyles();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\nexport const SimpleList = ({\r\n children,\r\n className,\r\n style,\r\n}: React.PropsWithChildren<{\r\n className?: string;\r\n style?: React.CSSProperties;\r\n}>) => {\r\n return (\r\n
    \r\n {children}\r\n
\r\n );\r\n};\r\nexport const BulletedList = (props: BulletedListProps) => {\r\n const classes = bulletedStyles();\r\n const { items, showBullet = true } = props;\r\n return (\r\n \r\n {items.map(c => {\r\n return (\r\n
  • \r\n {showBullet && (\r\n \r\n )}\r\n \r\n {c.node}\r\n \r\n
  • \r\n );\r\n })}\r\n
    \r\n );\r\n};\r\n","import { cyan } from '@material-ui/core/colors';\r\n\r\ninterface InfoColors {\r\n colorInfoFull: string;\r\n colorInfoDark: string;\r\n colorInfoHover: string;\r\n colorInfoRegular: string;\r\n colorInfoComponents: string;\r\n colorInfoComponentsLight: string;\r\n colorInfoBorders: string;\r\n colorInfoDisabled: string;\r\n colorInfoBgHover: string;\r\n colorInfoBg: string;\r\n colorInfoBgLight: string;\r\n}\r\nconst infoColors: InfoColors = {\r\n colorInfoFull: cyan[900],\r\n colorInfoDark: cyan[900],\r\n colorInfoHover: cyan[800],\r\n colorInfoRegular: cyan[700],\r\n colorInfoComponents: cyan[600],\r\n colorInfoComponentsLight: cyan[500],\r\n colorInfoBorders: cyan[400],\r\n colorInfoDisabled: cyan[300],\r\n colorInfoBgHover: cyan[200],\r\n colorInfoBg: cyan[100],\r\n colorInfoBgLight: cyan[50],\r\n};\r\n\r\nexport default infoColors;\r\n","import { StyleRules } from '@material-ui/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { buttonS } from 'styles/typography/bookitTypography';\r\n\r\nexport const MuiButtonOverride = {\r\n root: {\r\n ...buttonS,\r\n textTransform: 'none',\r\n display: 'inline-flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '10px',\r\n flexShrink: 1,\r\n boxShadow: 'unset',\r\n lineHeight: 'normal',\r\n border: '1px solid transparent',\r\n padding: '4px 16px',\r\n minWidth: '40px',\r\n height: '40px',\r\n '&.variantMain': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.primary.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantText': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.regular,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantTextgray': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.graySubtitles,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantGray': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.regular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantAccent': {\r\n backgroundColor: bookitColors.grayscale.graySubtitles,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.blackRegular,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantDanger': {\r\n backgroundColor: bookitColors.danger.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.danger.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.danger.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantWhite': {\r\n backgroundColor: bookitColors.base.white,\r\n color: bookitColors.grayscale.blackRegular,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n border: '1px solid transparent',\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n border: '1px solid transparent',\r\n },\r\n },\r\n '&.variantGhostcolor': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.primary.regular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantGhost': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '& .buttonLabel': {\r\n height: '18px',\r\n whiteSpace: 'nowrap',\r\n },\r\n },\r\n contained: {\r\n borderRadius: '8px',\r\n boxShadow: 'none',\r\n color: bookitColors.grayscale.blackRegular,\r\n padding: '4px 16px',\r\n minWidth: '40px',\r\n height: '40px',\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 12px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 16px 4px 12px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 12px 4px 16px',\r\n },\r\n '&:hover': {\r\n backgroundColor: 'initial',\r\n boxShadow: 'unset',\r\n '@media (hover: none)': {\r\n boxShadow: 'unset',\r\n backgroundColor: 'initial',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'initial',\r\n },\r\n },\r\n '&$focusVisible': {\r\n boxShadow: 'unset',\r\n },\r\n '&:active': {\r\n boxShadow: 'unset',\r\n },\r\n '&$disabled': {\r\n boxShadow: 'unset',\r\n // color: theme.palette.action.disabled,\r\n // boxShadow: theme.shadows[0],\r\n // backgroundColor: theme.palette.action.disabledBackground\r\n },\r\n '&.variantMain': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.primary.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantText': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.regular,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantTextgray': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.graySubtitles,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantGray': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.regular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantAccent': {\r\n backgroundColor: bookitColors.grayscale.graySubtitles,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.blackRegular,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantDanger': {\r\n backgroundColor: bookitColors.danger.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.danger.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.danger.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantWhite': {\r\n backgroundColor: bookitColors.base.white,\r\n color: bookitColors.grayscale.blackRegular,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n border: '1px solid transparent',\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n border: '1px solid transparent',\r\n },\r\n },\r\n '&.variantGhostcolor': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.primary.regular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantGhost': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n },\r\n containedSizeSmall: {\r\n borderRadius: '6px',\r\n padding: '4px 12px',\r\n minWidth: '32px',\r\n height: '32px',\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 8px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 12px 4px 8px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 8px 4px 12px',\r\n },\r\n },\r\n containedSizeLarge: {\r\n minWidth: '48px',\r\n height: '48px',\r\n borderRadius: '8px',\r\n padding: '4px 20px',\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 16px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 20px 4px 16px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 16px 4px 20px',\r\n },\r\n },\r\n label: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n margin: 0,\r\n gap: '8px',\r\n },\r\n startIcon: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 0,\r\n flexGrow: 0,\r\n margin: 0,\r\n marginLeft: 0,\r\n marginRight: 0,\r\n '&$iconSizeSmall': {\r\n marginLeft: 0,\r\n },\r\n },\r\n endIcon: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 2,\r\n flexGrow: 0,\r\n margin: 0,\r\n marginLeft: 0,\r\n marginRight: 0,\r\n '&$iconSizeSmall': {\r\n marginRight: 0,\r\n },\r\n },\r\n text: {\r\n padding: '0px',\r\n height: '20px',\r\n },\r\n textSizeSmall: {\r\n fontSize: '14px',\r\n height: '17px',\r\n },\r\n textSizeLarge: {\r\n fontSize: '14px',\r\n height: '23px',\r\n },\r\n sizeSmall: {},\r\n sizeLarge: {\r\n '&>[class*=\"MuiButton-label\"]': {\r\n gap: '12px',\r\n },\r\n },\r\n iconSizeMedium: {\r\n fontSize: '16px',\r\n '&>:first-child': {\r\n fontSize: '16px',\r\n width: '16px',\r\n height: '16px',\r\n },\r\n },\r\n iconSizeLarge: {\r\n fontSize: '14px',\r\n '&>:first-child': {\r\n fontSize: '14px',\r\n width: '14px',\r\n height: '14px',\r\n },\r\n },\r\n iconSizeSmall: {\r\n fontSize: '14px',\r\n '&>:first-child': {\r\n fontSize: '14px',\r\n width: '14px',\r\n height: '14px',\r\n },\r\n },\r\n} as Partial;\r\nexport const MuiIconButtonOverride = {\r\n root: {\r\n display: 'inline-flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '10px',\r\n padding: '0px',\r\n border: '1px solid transparent',\r\n '&.variantMain': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.primary.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantText': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.regular,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantTextgray': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.graySubtitles,\r\n padding: '0px',\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantGray': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.regular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantAccent': {\r\n backgroundColor: bookitColors.grayscale.graySubtitles,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.blackRegular,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantDanger': {\r\n backgroundColor: bookitColors.danger.regular,\r\n color: bookitColors.base.white,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.danger.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.danger.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.absolute-close-button': {\r\n position: 'absolute',\r\n right: 8,\r\n top: 8,\r\n },\r\n '& .iconSizeLarge': {\r\n fontSize: '16px',\r\n '&>:first-child': {\r\n fontSize: '16px',\r\n width: '16px',\r\n height: '16px',\r\n },\r\n },\r\n '&.variantWhite': {\r\n backgroundColor: bookitColors.base.white,\r\n color: bookitColors.grayscale.blackRegular,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n border: '1px solid transparent',\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n border: '1px solid transparent',\r\n },\r\n },\r\n '&.variantGhostcolor': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.primary.regular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantGhost': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover, &:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'unset',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.iconSizeLarge': {\r\n width: '48px',\r\n height: '48px',\r\n fontSize: '16px',\r\n '&.shapeSquare': {\r\n borderRadius: '8px',\r\n },\r\n },\r\n '&.iconSizeMedium': {\r\n width: '40px',\r\n height: '40px',\r\n fontSize: '16px',\r\n '&.shapeSquare': {\r\n borderRadius: '8px',\r\n },\r\n },\r\n '&.iconSizeSmall': {\r\n width: '32px',\r\n height: '32px',\r\n fontSize: '14px',\r\n '&.shapeSquare': {\r\n borderRadius: '6px',\r\n },\r\n },\r\n '&.iconSizeXs': {\r\n width: '24px',\r\n height: '24px',\r\n fontSize: '14px',\r\n padding: '4px 11px 4px 11px',\r\n '&.shapeSquare': {\r\n borderRadius: '4px',\r\n },\r\n },\r\n '&.shapeCircle': {\r\n borderRadius: '50%',\r\n },\r\n },\r\n label: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: '12px',\r\n cursor: 'pointer',\r\n },\r\n} as Partial;\r\nexport const MuiToggleButtonGroupOverride = {\r\n root: {\r\n display: 'inline-flex',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n gap: '0px',\r\n backgroundColor: 'transparent',\r\n '&.variantMain': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n },\r\n '&.variantText': {\r\n padding: '0px',\r\n },\r\n '&.variantTextgray': {\r\n padding: '0px',\r\n },\r\n '&.variantGray': {\r\n backgroundColor: bookitColors.primary.bgLight,\r\n },\r\n '&.variantAccent': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n },\r\n '&.variantDanger': {\r\n backgroundColor: bookitColors.danger.background,\r\n },\r\n '&.variantWhite': {\r\n backgroundColor: bookitColors.base.white,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n '&.separated': {\r\n gap: '8px',\r\n },\r\n '&.variantGhostcolor': {\r\n '&.separated': {\r\n padding: '0px',\r\n },\r\n },\r\n '&.variantGhost': {\r\n '&.separated': {\r\n padding: '0px',\r\n },\r\n },\r\n '&.sizeLarge': {\r\n borderRadius: '12px',\r\n '&.separated': {\r\n padding: '4px',\r\n gap: '4px',\r\n },\r\n },\r\n '&.sizeMedium': {\r\n borderRadius: '10px',\r\n '&.separated': {\r\n padding: '3px',\r\n gap: '3px',\r\n },\r\n },\r\n '&.sizeSmall': {\r\n borderRadius: '8px',\r\n '&.separated': {\r\n padding: '1px',\r\n gap: '1px',\r\n },\r\n },\r\n '&.errorBorder': {\r\n borderColor: bookitColors.danger.regular,\r\n },\r\n '&.fullWidth': {\r\n width: '100%',\r\n },\r\n },\r\n grouped: {\r\n '&.fullWidthButton': {\r\n flex: '1',\r\n },\r\n },\r\n /* Styles applied to the children if `orientation=\"horizontal\"`. */\r\n groupedHorizontal: {\r\n '&:not(:first-child)': {\r\n marginLeft: '0px', //props => (props.variant === 'white' ? 0 : -1),\r\n borderLeft: '1px solid transparent',\r\n borderTopLeftRadius: 0,\r\n borderBottomLeftRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopLeftRadius: 8,\r\n borderBottomLeftRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopLeftRadius: 8,\r\n borderBottomLeftRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopLeftRadius: 6,\r\n borderBottomLeftRadius: 6,\r\n },\r\n },\r\n },\r\n '&:not(:last-child)': {\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopRightRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopRightRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopRightRadius: 6,\r\n borderBottomRightRadius: 6,\r\n },\r\n },\r\n },\r\n '&>[class*=\"withTitle\"]:not(:first-child)': {\r\n '&>button': {\r\n marginLeft: '0px', // props => (props.variant === 'white' ? 0 : -1),\r\n borderLeft: '1px solid transparent',\r\n borderTopLeftRadius: 0,\r\n borderBottomLeftRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopLeftRadius: 8,\r\n borderBottomLeftRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopLeftRadius: 8,\r\n borderBottomLeftRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopLeftRadius: 6,\r\n borderBottomLeftRadius: 6,\r\n },\r\n },\r\n },\r\n },\r\n '&>[class*=\"withTitle\"]:not(:last-child)': {\r\n '&>button': {\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopRightRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopRightRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopRightRadius: 6,\r\n borderBottomRightRadius: 6,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n /* Styles applied to the children if `orientation=\"vertical\"`. */\r\n groupedVertical: {\r\n '&:not(:first-child)': {\r\n marginTop: -1,\r\n borderTop: '1px solid transparent',\r\n borderTopLeftRadius: 0,\r\n borderTopRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopLeftRadius: 8,\r\n borderTopRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopLeftRadius: 8,\r\n borderTopRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopLeftRadius: 6,\r\n borderTopRightRadius: 6,\r\n },\r\n },\r\n },\r\n '&:not(:last-child)': {\r\n borderBottomLeftRadius: 0,\r\n borderBottomRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderBottomLeftRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderBottomLeftRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderBottomLeftRadius: 6,\r\n borderBottomRightRadius: 6,\r\n },\r\n },\r\n },\r\n '&>[class*=\"withTitle\"]:not(:first-child)': {\r\n '&>button': {\r\n marginTop: -1,\r\n borderTop: '1px solid transparent',\r\n borderTopLeftRadius: 0,\r\n borderTopRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderTopLeftRadius: 8,\r\n borderTopRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderTopLeftRadius: 8,\r\n borderTopRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderTopLeftRadius: 6,\r\n borderTopRightRadius: 6,\r\n },\r\n },\r\n },\r\n },\r\n '&>[class*=\"withTitle\"]:not(:last-child)': {\r\n '&>button': {\r\n borderBottomLeftRadius: 0,\r\n borderBottomRightRadius: 0,\r\n '&.separated': {\r\n '&.sizeLarge': {\r\n borderBottomLeftRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeMedium': {\r\n borderBottomLeftRadius: 8,\r\n borderBottomRightRadius: 8,\r\n },\r\n '&.sizeSmall': {\r\n borderBottomLeftRadius: 6,\r\n borderBottomRightRadius: 6,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n} as Partial;\r\nexport const MuiToggleButtonOverride = {\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '10px',\r\n textTransform: 'none',\r\n boxShadow: 'unset',\r\n boxSizing: 'border-box',\r\n border: '1px solid transparent',\r\n borderRadius: '8px',\r\n minWidth: '40px',\r\n height: '40px',\r\n ...buttonS,\r\n padding: '4px 16px',\r\n '&.hasMainIcon': {\r\n padding: '4px 10px',\r\n },\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 12px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 16px 4px 12px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 12px 4px 16px',\r\n },\r\n '&.fullWidth': {\r\n width: '100%',\r\n },\r\n '&.variantMain': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n '&$selected': {\r\n color: bookitColors.base.white,\r\n backgroundColor: bookitColors.primary.regular,\r\n border: `1px solid ${bookitColors.primary.borders}`,\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.hover,\r\n border: '1px solid transparent',\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.primary.regular,\r\n color: bookitColors.base.white,\r\n border: `1px solid ${bookitColors.primary.borders}`,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.primary.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantText': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.regular,\r\n padding: '0px',\r\n '&$selected': {\r\n color: bookitColors.primary.hover,\r\n backgroundColor: 'transparent',\r\n textDecoration: 'underline',\r\n '&:hover': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.hover,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantTextgray': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.graySubtitles,\r\n padding: '0px',\r\n '&$selected': {\r\n color: bookitColors.grayscale.blackComponents,\r\n backgroundColor: 'transparent',\r\n textDecoration: 'underline',\r\n '&:hover': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackComponents,\r\n textDecoration: 'underline',\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n '&.variantGray': {\r\n backgroundColor: bookitColors.primary.bgLight,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&$selected': {\r\n color: bookitColors.primary.regular,\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n color: bookitColors.primary.regular,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.primary.regular,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.primary.regular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantAccent': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&$selected': {\r\n color: bookitColors.base.white,\r\n backgroundColor: bookitColors.grayscale.graySubtitles,\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.blackRegular,\r\n color: bookitColors.base.white,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantDanger': {\r\n backgroundColor: bookitColors.danger.background,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&$selected': {\r\n color: bookitColors.base.white,\r\n backgroundColor: bookitColors.danger.regular,\r\n '&:hover': {\r\n backgroundColor: bookitColors.danger.hover,\r\n color: bookitColors.base.white,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.danger.background,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.danger.background,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.danger.disabled,\r\n color: bookitColors.base.white,\r\n },\r\n },\r\n '&.variantWhite': {\r\n backgroundColor: bookitColors.base.white,\r\n color: bookitColors.grayscale.blackRegular,\r\n '&$selected': {\r\n color: bookitColors.grayscale.blackRegular,\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantGhostcolor': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.primary.regular,\r\n '&$selected': {\r\n color: bookitColors.primary.hover,\r\n backgroundColor: bookitColors.primary.bgHover,\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '&.variantGhost': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.blackRegular,\r\n '&$selected': {\r\n color: bookitColors.primary.hover,\r\n backgroundColor: bookitColors.primary.bgHover,\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '& + &': {\r\n borderLeft: 0,\r\n marginLeft: 0,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&:active, &:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n color: bookitColors.primary.hover,\r\n },\r\n '&$disabled': {\r\n backgroundColor: 'transparent',\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n },\r\n sizeLarge: {\r\n padding: '4px 20px',\r\n borderRadius: '8px',\r\n minWidth: '48px',\r\n height: '48px',\r\n '&.hasMainIcon': {\r\n padding: '4px 14px',\r\n },\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 16px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 20px 4px 16px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 16px 4px 20px',\r\n },\r\n '&>$label': {\r\n gap: '12px',\r\n },\r\n },\r\n sizeSmall: {\r\n padding: '4px 12px',\r\n borderRadius: '8px',\r\n minWidth: '32px',\r\n height: '32px',\r\n '&.separated': {\r\n borderRadius: '6px',\r\n },\r\n '&.hasMainIcon': {\r\n padding: '4px 8px',\r\n },\r\n '&.hasStartIcon.hasEndIcon': {\r\n padding: '4px 8px',\r\n },\r\n '&.hasStartIcon': {\r\n padding: '4px 12px 4px 8px',\r\n },\r\n '&.hasEndIcon': {\r\n padding: '4px 8px 4px 12px',\r\n },\r\n },\r\n label: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n margin: 0,\r\n gap: '8px',\r\n '& .startIcon': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 0,\r\n flexGrow: 0,\r\n margin: 0,\r\n },\r\n '& .endIcon': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 2,\r\n flexGrow: 0,\r\n margin: 0,\r\n },\r\n '& .mainIcon': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n },\r\n '& .buttonLabel': {\r\n height: '18px',\r\n whiteSpace: 'nowrap',\r\n },\r\n '& .iconSizeSmall': {\r\n fontSize: '14px',\r\n '&>:first-child': {\r\n fontSize: '14px',\r\n width: '14px',\r\n height: '14px',\r\n },\r\n },\r\n '& .iconSizeMedium': {\r\n fontSize: '16px',\r\n '&>:first-child': {\r\n fontSize: '16px',\r\n width: '16px',\r\n height: '16px',\r\n },\r\n },\r\n '& .iconSizeLarge': {\r\n fontSize: '16px',\r\n '&>:first-child': {\r\n fontSize: '16px',\r\n width: '16px',\r\n height: '16px',\r\n },\r\n },\r\n },\r\n} as Partial;\r\n","import { fade, ThemeOptions } from '@material-ui/core';\r\nimport createBreakpoints from '@material-ui/core/styles/createBreakpoints';\r\nimport { unstable_createMuiStrictModeTheme as createMuiTheme } from '@material-ui/core';\r\n// import convertLength from 'convert-css-length';\r\nimport { grey, green } from '@material-ui/core/colors';\r\nimport { bookitColors } from './colors/bookitColors';\r\nimport infoColors from './colors/info';\r\nimport {\r\n bodyS,\r\n boldS,\r\n bookitTypography,\r\n buttonM,\r\n inputLabelXS,\r\n inputValueS,\r\n tipsRegular,\r\n} from './typography/bookitTypography';\r\nimport {\r\n MuiButtonOverride,\r\n MuiIconButtonOverride,\r\n MuiToggleButtonGroupOverride,\r\n MuiToggleButtonOverride,\r\n} from './MUIExtend/themeOverrides';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\nimport {\r\n COVER_WIDTH,\r\n //DRAWER_MOBILE_WIDTH,\r\n DRAWER_WIDTH,\r\n} from './constantVariables';\r\nimport { box_shadow_m, box_shadow_s } from './shadows/bookitShadow';\r\n\r\nconst breakpoints = createBreakpoints({});\r\n// xs: 0,\r\n// sm: 600,\r\n// md: 960,\r\n// lg: 1280,\r\n// xl: 1920\r\nconst lato_Light = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontStyle: 'normal',\r\n fontWeight: 300,\r\n src: `\r\n local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff2') format('woff2'),\r\n `,\r\n};\r\nconst lato_Regular = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontStyle: 'normal',\r\n fontWeight: 400,\r\n src: `\r\n local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n `,\r\n};\r\nconst lato_Bold = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontStyle: 'normal',\r\n fontWeight: 700,\r\n src: `\r\n local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff2') format('woff2'),\r\n `,\r\n};\r\nconst lato_Black = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontStyle: 'normal',\r\n fontWeight: 900,\r\n src: `\r\n local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff2') format('woff2'),\r\n `,\r\n};\r\nconst lato = {\r\n fontFamily: `'Lato', sans-serif`,\r\n fontStyle: 'normal',\r\n fontWeight: 400,\r\n src: `\r\n local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n `,\r\n unicodeRange:\r\n 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF',\r\n};\r\n//const convert = convertLength('16px');\r\nexport type BaseTheme = 'default' | 'animals' | 'bookit' | 'dark' | undefined;\r\n// customizes the mui theme defaults/overrides\r\n// colors: https://material-ui.com/customization/color/#color\r\nexport const DefaultThemeSettings: ThemeOptions = {\r\n typography: {\r\n fontFamily: `'Lato', sans-serif`,\r\n },\r\n overrides: {\r\n MuiCssBaseline: {\r\n '@global': {\r\n '@font-face': [lato],\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const BookitThemeSettings: ThemeOptions = {\r\n zIndex: {\r\n mobileStepper: 1000,\r\n speedDial: 1050,\r\n appBar: 1100,\r\n drawer: 1200,\r\n modal: 1300,\r\n snackbar: 1400,\r\n tooltip: 1500,\r\n },\r\n palette: {\r\n primary: {\r\n dark: bookitColors.primary.dark,\r\n main: bookitColors.primary.regular,\r\n light: bookitColors.primary.background,\r\n textHover: bookitColors.primary.hover,\r\n bgHover: bookitColors.primary.bgHover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n\r\n secondary: {\r\n dark: '#BFA44A',\r\n main: '#FFDB63',\r\n light: '#F4ECCE',\r\n textHover: '#E0BC40',\r\n bgHover: '#FFEBA9',\r\n contrastText: '#000',\r\n },\r\n info: {\r\n dark: infoColors.colorInfoDark,\r\n main: infoColors.colorInfoRegular,\r\n light: infoColors.colorInfoBg,\r\n textHover: infoColors.colorInfoBgHover,\r\n bgHover: infoColors.colorInfoHover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n accent: {\r\n dark: bookitColors.secondary.violet.dark,\r\n main: bookitColors.secondary.violet.regular,\r\n light: bookitColors.secondary.violet.background,\r\n bgHover: bookitColors.secondary.violet.bgHover,\r\n textHover: bookitColors.secondary.violet.hover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n danger: {\r\n dark: bookitColors.danger.dark,\r\n main: bookitColors.danger.regular,\r\n light: bookitColors.danger.background,\r\n textHover: bookitColors.danger.hover,\r\n bgHover: bookitColors.danger.bgHover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n success: {\r\n dark: bookitColors.success.dark,\r\n main: bookitColors.success.regular,\r\n light: bookitColors.success.background,\r\n textHover: bookitColors.success.hover,\r\n bgHover: bookitColors.success.bgHover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n error: {\r\n dark: bookitColors.danger.dark,\r\n main: bookitColors.danger.regular,\r\n light: bookitColors.danger.background,\r\n bgHover: bookitColors.danger.bgHover,\r\n textHover: bookitColors.danger.hover,\r\n contrastText: bookitColors.base.white,\r\n },\r\n default: {\r\n dark: bookitColors.grayscale.blackComponents,\r\n main: bookitColors.grayscale.graybgComponents,\r\n light: bookitColors.grayscale.grayBackground,\r\n bgHover: bookitColors.base.white,\r\n textHover: bookitColors.grayscale.graySubtitles,\r\n contrastText: bookitColors.base.black,\r\n },\r\n filters: {\r\n dark: bookitColors.primary.dark,\r\n main: bookitColors.grayscale.graySelection,\r\n textHover: bookitColors.primary.dark,\r\n bgHover: bookitColors.primary.bgHover,\r\n light: bookitColors.grayscale.grayComponents,\r\n contrastText: bookitColors.grayscale.blackRegular,\r\n },\r\n common: {\r\n black: bookitColors.base.black,\r\n blackRegular: bookitColors.grayscale.blackRegular,\r\n blackComponent: bookitColors.grayscale.blackComponents,\r\n graySubtitle: bookitColors.grayscale.graySubtitles,\r\n grayComponents: bookitColors.grayscale.grayComponents,\r\n grayComponentsLight: bookitColors.grayscale.grayComponentsLight,\r\n background: bookitColors.grayscale.grayBackground,\r\n backgroundHover: bookitColors.grayscale.graybgComponents,\r\n grayBorders: bookitColors.grayscale.grayBorders,\r\n grayDividers: bookitColors.grayscale.graySelection,\r\n white: bookitColors.base.white,\r\n },\r\n background: {\r\n default: bookitColors.grayscale.grayBackground,\r\n paper: bookitColors.base.white,\r\n },\r\n },\r\n shape: {\r\n borderRadius: 8,\r\n },\r\n typography: {\r\n fontFamily: ['Lato', 'sans-serif'].join(','),\r\n h1: bookitTypography.h1,\r\n h2: bookitTypography.h2,\r\n h3: bookitTypography.h3,\r\n h4: bookitTypography.h4,\r\n bodyL: bookitTypography.bodyL,\r\n bodyM: bookitTypography.bodyM,\r\n bodyS: bookitTypography.bodyS,\r\n boldL: bookitTypography.boldL,\r\n boldM: bookitTypography.boldM,\r\n boldS: bookitTypography.boldS,\r\n buttonM: bookitTypography.buttonM,\r\n buttonS: bookitTypography.buttonS,\r\n captionRegular: bookitTypography.captionRegular,\r\n captionBold: bookitTypography.captionBold,\r\n\r\n subtitle1: bookitTypography.subtitle1,\r\n subtitle2: bookitTypography.subtitle2,\r\n tipsRegular: bookitTypography.tipsRegular,\r\n tipsBold: bookitTypography.tipsBold,\r\n inputLabelM: bookitTypography.inputLabelM,\r\n inputLabelXS: bookitTypography.inputLabelXS,\r\n inputValueM: bookitTypography.inputValueM,\r\n inputValueS: bookitTypography.inputValueS,\r\n uppercase: bookitTypography.uppercase,\r\n },\r\n overrides: {\r\n MuiTypography: {\r\n root: {\r\n '&.variantH1': {\r\n ...bookitTypography.h1,\r\n },\r\n '&.variantH2': {\r\n ...bookitTypography.h2,\r\n },\r\n '&.variantH3': {\r\n ...bookitTypography.h3,\r\n },\r\n '&.variantH4': {\r\n ...bookitTypography.h4,\r\n },\r\n '&.variantSubtitle1': {\r\n ...bookitTypography.subtitle1,\r\n },\r\n '&.variantSubtitle2': {\r\n ...bookitTypography.subtitle2,\r\n },\r\n '&.variantBodyl': {\r\n ...bookitTypography.bodyL,\r\n },\r\n '&.variantBodym': {\r\n ...bookitTypography.bodyM,\r\n },\r\n '&.variantBodys': {\r\n ...bookitTypography.bodyS,\r\n },\r\n '&.variantBoldl': {\r\n ...bookitTypography.boldL,\r\n },\r\n '&.variantBoldm': {\r\n ...bookitTypography.boldM,\r\n },\r\n '&.variantBolds': {\r\n ...bookitTypography.boldS,\r\n },\r\n '&.variantCaptionbold': {\r\n ...bookitTypography.captionBold,\r\n },\r\n '&.variantCaptionregular': {\r\n ...bookitTypography.captionRegular,\r\n },\r\n '&.variantUppercase': {\r\n ...bookitTypography.uppercase,\r\n },\r\n '&.variantTipsbold': {\r\n ...bookitTypography.tipsBold,\r\n },\r\n '&.variantTipsregular': {\r\n ...bookitTypography.tipsRegular,\r\n },\r\n '&.variantInputlabelm': {\r\n ...bookitTypography.inputLabelM,\r\n },\r\n '&.variantInputlabelxs': {\r\n ...bookitTypography.inputLabelXS,\r\n },\r\n '&.variantInputvaluem': {\r\n ...bookitTypography.inputValueM,\r\n },\r\n '&.variantInputvalues': {\r\n ...bookitTypography.inputValueS,\r\n },\r\n '&.variantButtonm': {\r\n ...bookitTypography.buttonM,\r\n },\r\n '&.variantButtons': {\r\n ...bookitTypography.buttonS,\r\n },\r\n '&.italic': {\r\n fontStyle: 'italic',\r\n },\r\n },\r\n colorError: {\r\n color: bookitColors.danger.components,\r\n },\r\n colorPrimary: {\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n colorSecondary: { color: bookitColors.grayscale.grayComponents },\r\n colorTextPrimary: { color: bookitColors.primary.regular },\r\n colorTextSecondary: { color: bookitColors.success.regular },\r\n },\r\n MuiAppBar: {\r\n colorDefault: { backgroundColor: bookitColors.grayscale.grayBackground },\r\n },\r\n MuiLink: {\r\n root: {\r\n color: bookitColors.primary.regular,\r\n '&:hover': {\r\n textDecoration: 'underline',\r\n },\r\n '&:focus': {\r\n textDecoration: 'underline',\r\n },\r\n },\r\n },\r\n MuiCssBaseline: {\r\n '@global': {\r\n '@font-face': [lato_Light, lato_Regular, lato_Bold, lato_Black],\r\n ':root': {\r\n '--drawer-width': 240,\r\n },\r\n },\r\n },\r\n MuiSelect: {\r\n select: {\r\n '&:focus': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n MuiInputBase: {\r\n root: {\r\n ...inputValueS,\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n adornedStart: {\r\n paddingLeft: 12,\r\n },\r\n adornedEnd: {\r\n paddingRight: 12,\r\n },\r\n input: {\r\n '.textTable &': {\r\n minWidth: '80px',\r\n },\r\n },\r\n // marginDense: {\r\n // width: '100px',\r\n // }\r\n },\r\n MuiFilledInput: {\r\n root: {\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n backgroundColor: bookitColors.base.white,\r\n borderRadius: 8,\r\n borderTopLeftRadius: 8,\r\n borderTopRightRadius: 8,\r\n '&:hover': {\r\n backgroundColor: bookitColors.base.white,\r\n '@media (hover: none)': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n },\r\n },\r\n '&$focused': {\r\n backgroundColor: bookitColors.base.white,\r\n },\r\n '&$disabled': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n },\r\n },\r\n /* Styles applied to the root element if color secondary. */\r\n colorSecondary: {\r\n '&$underline:after': {\r\n borderBottomColor: bookitColors.danger.regular,\r\n },\r\n },\r\n underline: {\r\n '&:after': {\r\n borderBottom: `1px solid ${bookitColors.primary.regular}`,\r\n left: 0,\r\n bottom: -1,\r\n // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n content: '\"\"',\r\n position: 'absolute',\r\n right: 0,\r\n transform: 'scaleX(0)',\r\n pointerEvents: 'none', // Transparent to the hover style.\r\n transition: transitions.create('transform', {\r\n duration: transitions.duration.shorter,\r\n easing: transitions.easing.easeOut,\r\n }),\r\n marginInline: 8,\r\n },\r\n '&$focused:after': {\r\n transform: 'scaleX(1)',\r\n },\r\n '&$error:after': {\r\n borderBottomColor: bookitColors.danger.regular,\r\n transform: 'scaleX(1)', // error is always underlined in red\r\n },\r\n '&:before': {\r\n borderBottom: 'none',\r\n left: 0,\r\n bottom: -1,\r\n // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n content: '\"\\\\00a0\"',\r\n // content: '\"\"',\r\n position: 'absolute',\r\n right: 0,\r\n transition: transitions.create('border-bottom-color', {\r\n duration: transitions.duration.shorter,\r\n }),\r\n pointerEvents: 'none', // Transparent to the hover style.\r\n marginInline: 8,\r\n },\r\n '&:hover:before': {\r\n borderBottom: 'none',\r\n },\r\n '&$disabled:before': {\r\n borderBottomStyle: 'none',\r\n },\r\n '&$focused:before': {\r\n borderBottom: `1px solid ${bookitColors.primary.regular}`,\r\n transform: 'scaleX(1)',\r\n },\r\n '&$error:before': {\r\n borderBottom: `1px solid ${bookitColors.danger.regular}`,\r\n transform: 'scaleX(1)',\r\n },\r\n },\r\n /* Pseudo-class applied to the root element if the component is focused. */\r\n focused: {},\r\n\r\n /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n disabled: {},\r\n\r\n /* Styles applied to the root element if `startAdornment` is provided. */\r\n adornedStart: {\r\n paddingLeft: 12,\r\n },\r\n\r\n /* Styles applied to the root element if `endAdornment` is provided. */\r\n adornedEnd: {\r\n paddingRight: 12,\r\n },\r\n\r\n /* Pseudo-class applied to the root element if `error={true}`. */\r\n error: {},\r\n\r\n /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n marginDense: {},\r\n\r\n /* Styles applied to the root element if `multiline={true}`. */\r\n multiline: {\r\n padding: '27px 12px 10px',\r\n '&$marginDense': {\r\n paddingTop: 23,\r\n paddingBottom: 6,\r\n },\r\n },\r\n // input: {\r\n // height: '20px',\r\n // padding: '22px 12px 4px',\r\n // },\r\n // inputMarginDense: {\r\n // paddingTop: '16px',\r\n // paddingBottom: '6px',\r\n // },\r\n /* Styles applied to the `input` element. */\r\n input: {\r\n height: '20px',\r\n padding: '26px 12px 8px',\r\n '&:-webkit-autofill': {\r\n // WebkitBoxShadow:\r\n // theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset',\r\n // WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff',\r\n // caretColor: theme.palette.type === 'light' ? null : '#fff',\r\n borderTopLeftRadius: 'inherit',\r\n borderTopRightRadius: 'inherit',\r\n },\r\n '.inputSizeLarge &': {\r\n paddingTop: 22,\r\n paddingBottom: 4,\r\n },\r\n '.inputSizeLarge.noLabel &': {\r\n paddingTop: 14,\r\n paddingBottom: 12,\r\n },\r\n '.inputSizeMedium &': {\r\n paddingTop: 9,\r\n paddingBottom: 9,\r\n },\r\n '.inputSizeSmall &': {\r\n paddingTop: 5,\r\n paddingBottom: 5,\r\n },\r\n },\r\n\r\n /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n inputMarginDense: {\r\n paddingTop: 22,\r\n paddingBottom: 4,\r\n },\r\n\r\n /* Styles applied to the `input` if in ``. */\r\n inputHiddenLabel: {\r\n paddingTop: 17,\r\n paddingBottom: 17,\r\n '&$inputMarginDense': {\r\n paddingTop: 9,\r\n paddingBottom: 9,\r\n },\r\n },\r\n\r\n /* Styles applied to the `input` element if `multiline={true}`. */\r\n inputMultiline: {\r\n padding: 0,\r\n },\r\n\r\n /* Styles applied to the `input` element if `startAdornment` is provided. */\r\n inputAdornedStart: {\r\n paddingLeft: 0,\r\n },\r\n\r\n /* Styles applied to the `input` element if `endAdornment` is provided. */\r\n inputAdornedEnd: {\r\n paddingRight: 0,\r\n },\r\n },\r\n MuiFormHelperText: {\r\n /* Styles applied to the root element. */\r\n root: {\r\n display: 'flex',\r\n paddingLeft: '4px',\r\n alignItems: 'center',\r\n gap: 0,\r\n alignSelf: 'stretch',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...tipsRegular,\r\n textAlign: 'left',\r\n marginTop: 0,\r\n margin: 0,\r\n '&$disabled': {\r\n color: bookitColors.grayscale.graySelection,\r\n },\r\n '&$error': {\r\n color: bookitColors.danger.regular,\r\n },\r\n '&.boxed': {\r\n gap: 0,\r\n },\r\n '&.shiftRight': {\r\n gap: 28,\r\n },\r\n // '&.separate-picker': {\r\n // position: 'absolute',\r\n // top: 0,\r\n // left: 0,\r\n // '&.inputSizeLarge': {\r\n // transform: 'translate(0px, 54px) scale(1)',\r\n // },\r\n // '&.inputSizeMedium': {\r\n // transform: 'translate(0px, 46px) scale(1)',\r\n // },\r\n // '&.inputSizeSmall': {\r\n // transform: 'translate(0px, 38px) scale(1)',\r\n // },\r\n // },\r\n // empty helperText results in zero element height. So when field is validated the appearance of the\r\n // error message in the helperText causes the form element to increase in height and forces a redraw\r\n // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n '&::before': {\r\n content: '\"\\\\00a0\"',\r\n },\r\n // marginLeft: '6px',\r\n // ...tipsRegular,\r\n },\r\n\r\n /* Pseudo-class applied to the root element if `error={true}`. */\r\n error: {},\r\n\r\n /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n disabled: {},\r\n\r\n /* Styles applied to the root element if `margin=\"dense\"`. */\r\n marginDense: {\r\n marginTop: 4,\r\n },\r\n\r\n /* Styles applied to the root element if `variant=\"filled\"` or `variant=\"outlined\"`. */\r\n contained: {\r\n marginLeft: 0,\r\n marginRight: 0,\r\n },\r\n\r\n /* Pseudo-class applied to the root element if `focused={true}`. */\r\n focused: {},\r\n\r\n /* Pseudo-class applied to the root element if `filled={true}`. */\r\n filled: {},\r\n\r\n /* Pseudo-class applied to the root element if `required={true}`. */\r\n required: {},\r\n },\r\n MuiFormGroup: {\r\n /* Styles applied to the root element. */\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n flexWrap: 'wrap',\r\n gap: 8,\r\n '&.boxed': {\r\n display: 'flex',\r\n height: 'auto',\r\n minHeight: '56px',\r\n //justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '10px',\r\n alignSelf: 'stretch',\r\n padding: '16px',\r\n borderRadius: '8px',\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n background: bookitColors.base.white,\r\n '&.toggleSizeSmall': {\r\n minHeight: '48px',\r\n padding: '12px',\r\n },\r\n '&.boxedError': {\r\n border: `1px solid ${bookitColors.danger.borders}`,\r\n },\r\n '&.boxedChecked': {\r\n border: `1px solid ${bookitColors.primary.borders}`,\r\n background: bookitColors.primary.background,\r\n // '&.boxedSecondary': {\r\n // border: `1px solid ${bookitColors.success.borders}`,\r\n // background: bookitColors.success.background,\r\n // },\r\n '&.boxedError': {\r\n border: `1px solid ${bookitColors.danger.borders}`,\r\n background: bookitColors.danger.background,\r\n },\r\n },\r\n },\r\n '&.horizontal': {\r\n gap: '16px',\r\n },\r\n '&.vertical': {\r\n gap: '16px',\r\n alignItems: 'flex-start',\r\n width: '100%',\r\n },\r\n },\r\n /* Styles applied to the root element if `row={true}`. */\r\n row: {\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n },\r\n },\r\n MuiFormLabel: {\r\n root: {\r\n color: bookitColors.grayscale.graySubtitles,\r\n ...bodyS,\r\n '&$focused': {\r\n color: bookitColors.grayscale.graySubtitles,\r\n },\r\n '&.ghosInputLabel': {\r\n display: 'flex',\r\n height: '17px',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignSelf: 'stretch',\r\n color: bookitColors.grayscale.graySubtitles,\r\n ...bookitTypography.captionRegular,\r\n '&.ghosInputLabelBold': {\r\n fontWeight: '900',\r\n },\r\n },\r\n '&.radio-group-base-label': {\r\n marginBottom: '24px',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...buttonM,\r\n '&[class*=\"Mui-focused\"]': {\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&.withLabel': {\r\n marginBottom: '8px',\r\n },\r\n '&.boldLabel': {\r\n fontWeight: 700,\r\n },\r\n },\r\n },\r\n // focused: {\r\n // color: bookitColors.grayscale.graySubtitles,\r\n // },\r\n asterisk: {\r\n color: bookitColors.danger.regular,\r\n },\r\n },\r\n MuiInputLabel: {\r\n root: {\r\n color: bookitColors.grayscale.grayComponents,\r\n ...inputValueS,\r\n display: 'block',\r\n transformOrigin: 'top left',\r\n '&.datetime-picker': {\r\n position: 'relative',\r\n transform: 'unset',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n width: '13ch',\r\n display: 'inline-block',\r\n },\r\n '&.shrinkFile': {\r\n transform: 'translate(12px, -4px) scale(1)',\r\n },\r\n },\r\n /* Pseudo-class applied to the root element if `focused={true}`. */\r\n focused: {},\r\n\r\n /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n disabled: {},\r\n\r\n /* Pseudo-class applied to the root element if `error={true}`. */\r\n error: {},\r\n\r\n /* Pseudo-class applied to the root element if `required={true}`. */\r\n required: {},\r\n\r\n /* Pseudo-class applied to the asterisk element. */\r\n asterisk: {},\r\n /* Styles applied to the root element if the component is a descendant of `FormControl`. */\r\n formControl: {\r\n position: 'absolute',\r\n left: 0,\r\n top: 0,\r\n // slight alteration to spec spacing to match visual spec result\r\n transform: 'translate(0, 24px) scale(1)',\r\n '&.date-dropdown-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.time-options-picker': {\r\n transform: 'translate(0px, -26px) scale(1)',\r\n },\r\n '&.noLabelInline': {\r\n transform: 'translate(0px, 0px) scale(1)',\r\n },\r\n },\r\n /* Styles applied to the root element if `margin=\"dense\"`. */\r\n marginDense: {\r\n // Compensation for the `Input.inputDense` style.\r\n transform: 'translate(0, 21px) scale(1)',\r\n },\r\n /* Styles applied to the `input` element if `disableAnimation={false}`. */\r\n animated: {\r\n transition: transitions.create(['color', 'transform'], {\r\n duration: transitions.duration.shorter,\r\n easing: transitions.easing.easeOut,\r\n }),\r\n },\r\n /* Styles applied to the `input` element if `shrink={true}`. */\r\n shrink: {\r\n transform: 'translate(0, -2.5px) scale(1.1)',\r\n //transform: 'translate(0, 1.5px) scale(0.75)',\r\n transformOrigin: 'top left',\r\n ...inputLabelXS,\r\n },\r\n /* Styles applied to the root element if `variant=\"filled\"`. */\r\n filled: {\r\n // Chrome's autofill feature gives the input field a yellow background.\r\n // Since the input field is behind the label in the HTML tree,\r\n // the input field is drawn last and hides the label with an opaque background color.\r\n // zIndex: 1 will raise the label above opaque background-colors of input.\r\n zIndex: 1,\r\n pointerEvents: 'none',\r\n height: '16px',\r\n transform: 'translate(12px, 18px) scale(1)',\r\n '&.inputSizeLarge': {\r\n transform: 'translate(12px, 14px) scale(1)',\r\n '&.separate-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.date-dropdown-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.time-options-picker': {\r\n transform: 'translate(0px, -26px) scale(1)',\r\n },\r\n },\r\n '&.inputSizeMedium': {\r\n transform: 'translate(12px, 10px) scale(1)',\r\n '&.separate-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.date-dropdown-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.time-options-picker': {\r\n transform: 'translate(0px, -26px) scale(1)',\r\n },\r\n },\r\n '&.inputSizeSmall': {\r\n transform: 'translate(12px, 6px) scale(1)',\r\n '&.separate-picker,': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.date-dropdown-picker': {\r\n transform: 'translate(0px, -20px) scale(1)',\r\n },\r\n '&.time-options-picker': {\r\n transform: 'translate(0px, -26px) scale(1)',\r\n },\r\n },\r\n '&$marginDense': {\r\n transform: 'translate(12px, 8px) scale(1)',\r\n },\r\n '&$shrink': {\r\n // letterSpacing: '0.2px',\r\n ...inputLabelXS,\r\n '&.inputSizeLarge': {\r\n transform: 'translate(12px, 6px) scale(1)',\r\n },\r\n '&.inputSizeMedium': {\r\n transform: 'translate(12px, -18px) scale(1)',\r\n },\r\n '&.inputSizeSmall': {\r\n transform: 'translate(12px, -18px) scale(1)',\r\n },\r\n transform: 'translate(12px, 8px) scale(1)',\r\n '&$marginDense': {\r\n transform: 'translate(12px, 4px) scale(0.75)',\r\n },\r\n },\r\n '&.datetime-picker': {\r\n transform: 'unset',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n width: '13ch',\r\n display: 'inline-block',\r\n },\r\n '&.rich-text-input-label': {\r\n transform: 'translate(9px, 15px) scale(1)',\r\n '&.rich-text-input-label-focused': {\r\n transform: 'translate(9px, 38px) scale(0.8)',\r\n },\r\n },\r\n // transform: 'translate(12px, 20px) scale(1)',\r\n // '&$marginDense': {\r\n // transform: 'translate(12px, 17px) scale(1)',\r\n // },\r\n // '&$shrink': {\r\n // transform: 'translate(12px, 10px) scale(0.75)',\r\n // '&$marginDense': {\r\n // transform: 'translate(12px, 7px) scale(0.75)',\r\n // },\r\n // },\r\n },\r\n /* Styles applied to the root element if `variant=\"outlined\"`. */\r\n outlined: {\r\n // see comment above on filled.zIndex\r\n zIndex: 1,\r\n pointerEvents: 'none',\r\n transform: 'translate(14px, 20px) scale(1)',\r\n '&$marginDense': {\r\n transform: 'translate(14px, 12px) scale(1)',\r\n },\r\n '&$shrink': {\r\n transform: 'translate(14px, -6px) scale(0.75)',\r\n },\r\n },\r\n },\r\n MuiInputAdornment: {\r\n positionStart: {\r\n cursor: 'pointer',\r\n '& svg': {\r\n width: '16px',\r\n height: '16px',\r\n },\r\n },\r\n positionEnd: {\r\n '&.date-picker': {\r\n marginLeft: 0,\r\n },\r\n },\r\n filled: {\r\n '&$positionStart:not($hiddenLabel)': {\r\n marginTop: 0,\r\n },\r\n width: '18px',\r\n height: '20px',\r\n cursor: 'pointer',\r\n '& svg': {\r\n height: '16px',\r\n width: '16px',\r\n },\r\n },\r\n marginDense: {\r\n '& svg': {\r\n fontSize: '0.8rem',\r\n cursor: 'pointer',\r\n },\r\n },\r\n },\r\n MuiSvgIcon: {\r\n root: {\r\n cursor: 'auto',\r\n },\r\n fontSizeSmall: {\r\n fontSize: '0.8rem',\r\n },\r\n },\r\n MuiList: {\r\n root: {\r\n '&.sideBarList': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n '& .sideBarListGroup': {\r\n display: 'flex',\r\n padding: '12px 0px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n borderBottom: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n },\r\n '&.sideBarCollapsed': {\r\n alignSelf: 'stretch',\r\n },\r\n '&.sideBarExpanded': {\r\n width: '240px',\r\n '&.sideBarListMobile': {\r\n width: '100%',\r\n },\r\n },\r\n },\r\n '&.secondMenuItem': {\r\n display: 'flex',\r\n paddingBottom: '12px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n background: bookitColors.grayscale.graybgComponents,\r\n '.sideBarListMobile &': {\r\n width: '100%',\r\n },\r\n '& .menuItem': {\r\n display: 'flex',\r\n width: '240px',\r\n height: '32px',\r\n padding: '0px 8px 0px 16px',\r\n alignItems: 'center',\r\n gap: '8px',\r\n '.sideBarListMobile &': {\r\n width: '100%',\r\n },\r\n '&:hover, &:focus': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n },\r\n },\r\n },\r\n '&:active': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n },\r\n },\r\n },\r\n '&.Mui-selected': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n fontWeight: 600,\r\n },\r\n },\r\n },\r\n '& .menuItemContent': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n paddingLeft: '8px',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n '& .menuItemIcon': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n gap: '7.5px',\r\n width: 'auto',\r\n height: 12,\r\n color: bookitColors.grayscale.grayComponents,\r\n '& > svg': {\r\n width: '12px',\r\n },\r\n },\r\n '& .menuItemText': {\r\n flex: '1 0 0',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...bookitTypography.bodyS,\r\n cursor: 'pointer',\r\n whiteSpace: 'inherit',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n MuiListItem: {\r\n root: {\r\n '&.assetListItemLink': {\r\n display: 'flex',\r\n width: '100%',\r\n padding: '4px 8px',\r\n alignItems: 'center',\r\n gap: '12px',\r\n\r\n borderRadius: '4px',\r\n background: bookitColors.base.white,\r\n '&:hover, &:focus': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n },\r\n '&:active': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n },\r\n },\r\n '&.menuItem': {\r\n padding: 0,\r\n '&.mainTabMenu': {\r\n display: 'flex',\r\n height: '40px',\r\n padding: '0px 16px',\r\n alignItems: 'center',\r\n gap: '8px',\r\n alignSelf: 'stretch',\r\n backgroundColor: 'transparent',\r\n '& .menuItemContent': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n '& .menuItemIcon': {\r\n display: 'flex',\r\n paddingBottom: '1px',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n width: 'auto',\r\n height: 20,\r\n color: bookitColors.grayscale.grayComponents,\r\n '& > svg': {\r\n width: '19px',\r\n },\r\n },\r\n '& .menuItemText': {\r\n flex: '1 0 0',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...bookitTypography.buttonS,\r\n cursor: 'pointer',\r\n whiteSpace: 'initial',\r\n },\r\n },\r\n '&:hover, &:focus': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n },\r\n '&:active': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n },\r\n '&.mainTabExpanded': {\r\n '& .menuItemContent': {\r\n '& .menuItemIcon': {\r\n minWidth: 'initial',\r\n },\r\n },\r\n },\r\n '&.mainTabShort': {\r\n '& .menuItemContent': {\r\n '& .menuItemIcon': {\r\n minWidth: '60px',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n '.hoverItem &': {\r\n display: 'flex',\r\n width: '60px',\r\n height: '40px',\r\n padding: '0px 16px',\r\n alignItems: 'center',\r\n gap: '8px',\r\n backgroundColor: 'transparent',\r\n '& .menuItemHoverContent': {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n '& .menuItemIcon': {\r\n display: 'flex',\r\n paddingBottom: '1px',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n width: 'auto',\r\n height: 20,\r\n color: bookitColors.grayscale.grayComponents,\r\n '& > svg': {\r\n width: '19px',\r\n },\r\n },\r\n },\r\n '&:hover, &:focus': {\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n '& .menuItemHoverContent': {\r\n '& .menuItemIcon': {\r\n color: bookitColors.grayscale.grayComponents,\r\n },\r\n },\r\n },\r\n '&:focus': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n '& .menuItemHoverContent': {\r\n '& .menuItemIcon': {\r\n color: bookitColors.primary.components,\r\n },\r\n },\r\n },\r\n '&:active': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n '& .menuItemHoverContent': {\r\n '& .menuItemIcon': {\r\n color: bookitColors.primary.components,\r\n },\r\n },\r\n },\r\n '&.Mui-selected': {\r\n backgroundColor: bookitColors.primary.bgHover,\r\n '& .menuItemHoverContent': {\r\n '& .menuItemIcon': {\r\n color: bookitColors.primary.components,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n MuiListItemText: {\r\n root: {\r\n '.assetListItemLink &': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n margin: 0,\r\n },\r\n },\r\n primary: {\r\n '.assetListItemLink &': {\r\n display: 'inline-block',\r\n maxWidth: '50%',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n ...boldS,\r\n },\r\n },\r\n secondary: {\r\n '.assetListItemLink &': {\r\n display: 'flex',\r\n height: '20px',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n flex: '1 0 0',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...bodyS,\r\n },\r\n },\r\n },\r\n MuiListItemIcon: {\r\n root: {\r\n minWidth: 20,\r\n '.assetListItemLink &': {\r\n display: 'flex',\r\n width: '32px',\r\n height: '32px',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: '10px',\r\n flexShrink: 0,\r\n borderRadius: '4px',\r\n },\r\n },\r\n },\r\n MuiAvatar: {\r\n root: {\r\n '.assetListItemLink &': {\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n width: '32px',\r\n height: '32px',\r\n borderRadius: '4px',\r\n },\r\n },\r\n },\r\n MuiTableContainer: {\r\n root: {\r\n overflowX: 'unset',\r\n height: 'inherit',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n overflowY: 'hidden',\r\n },\r\n },\r\n MuiTable: {\r\n root: {\r\n //flex test -----\r\n // display: 'flex',\r\n // flexFlow: 'column nowrap',\r\n // flex: '1 1 auto',\r\n //---------------\r\n padding: 0,\r\n borderRadius: '8px',\r\n boxShadow: `inset 0px 0px 1px 1px ${bookitColors.grayscale.grayBorders}`,\r\n [breakpoints.down('md')]: {\r\n display: 'block',\r\n overflowX: 'auto',\r\n height: '100%',\r\n },\r\n },\r\n },\r\n MuiTableHead: {\r\n root: {\r\n //flex test -----\r\n // display: 'flex',\r\n // flexFlow: 'row nowrap',\r\n // alignItems: 'flex-start',\r\n //width: 'inherit',\r\n //---------------\r\n padding: 0,\r\n },\r\n },\r\n MuiTableBody: {\r\n root: {\r\n //flex test -----\r\n // display: 'flex',\r\n // flexFlow: 'row wrap',\r\n // width: 'inherit',\r\n //---------------\r\n padding: 0,\r\n },\r\n },\r\n MuiTableRow: {\r\n root: {\r\n //flex test -----\r\n // display: 'flex',\r\n // flex: '1 1 auto',\r\n // width: 'inherit',\r\n //---------------\r\n '& td:first-child ': {\r\n boxShadow: `0px 1px 0px 0px ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n '& th:first-child ': {\r\n boxShadow: `0px 1px 0px 0px ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n },\r\n },\r\n MuiTableCell: {\r\n root: {\r\n //flex test -----\r\n // display: 'flex',\r\n // flexFlow: 'row nowrap',\r\n // flexGrow: 1,\r\n // flexBasis: 0,\r\n //---------------\r\n //height: '32px',\r\n ...bodyS,\r\n boxShadow: `-1px 1px 0px ${bookitColors.grayscale.grayBorders}`,\r\n borderBottom: 'unset',\r\n height: '56px',\r\n color: bookitColors.grayscale.blackRegular,\r\n [breakpoints.down('md')]: {\r\n whiteSpace: 'nowrap',\r\n },\r\n },\r\n head: {\r\n lineHeight: '164%',\r\n fontWeight: 'bold',\r\n padding: '4px 12px',\r\n gap: '10px',\r\n whiteSpace: 'nowrap',\r\n },\r\n body: {\r\n fontWeight: 'normal',\r\n lineHeight: '141%',\r\n padding: '8px 12px',\r\n gap: '10px',\r\n '& > span a': {\r\n color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n },\r\n '& > span > button': {\r\n color: bookitColors.primary.regular, //accentColors.colorAccentRegular,\r\n },\r\n '& > a': {\r\n color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n },\r\n '& > button': {\r\n color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n },\r\n // '& > span': {\r\n // display: 'inline-block',\r\n // whiteSpace: 'break-spaces',\r\n // maxWidth: '25ch',\r\n // minWidth: '6ch',\r\n // //overflow: 'hidden',\r\n // //textOverflow: 'ellipsis',\r\n // },\r\n },\r\n sizeSmall: {\r\n height: '40px',\r\n padding: '0px 12px',\r\n gap: '10px',\r\n },\r\n footer: {\r\n lineHeight: '164%',\r\n fontWeight: 'bold',\r\n padding: '12px',\r\n },\r\n },\r\n MuiTableSortLabel: {\r\n root: {\r\n cursor: 'pointer',\r\n '&$active': {\r\n // && instead of & is a workaround for https://github.com/cssinjs/jss/issues/1045\r\n '&& $icon': {\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n },\r\n '&:focus': {\r\n '&& $icon': {\r\n fontSize: 16,\r\n opacity: 0.5,\r\n },\r\n },\r\n },\r\n icon: {\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n },\r\n MuiTablePagination: {\r\n root: {\r\n fontSize: '14px',\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n caption: {\r\n fontSize: '14px', // convert('14px', 'em'),\r\n fontWeight: 'bold',\r\n letterSpacing: '0.1px',\r\n lineHeight: '151%',\r\n },\r\n spacer: {\r\n flex: 'none',\r\n },\r\n input: {\r\n marginRight: 'auto',\r\n marginLeft: 0,\r\n },\r\n selectRoot: {\r\n fontWeight: 'bold',\r\n },\r\n select: {\r\n '&:focus': {\r\n border: `1px solid ${bookitColors.primary.hover}`,\r\n background: bookitColors.primary.background,\r\n borderRadius: '6px',\r\n fontWeight: 'bold',\r\n color: bookitColors.primary.dark,\r\n },\r\n },\r\n toolbar: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: '16px',\r\n fontWeight: 'bold',\r\n fontSize: '14px',\r\n minHeight: '40px',\r\n },\r\n menuItem: {\r\n padding: '10px 16px',\r\n gap: '12px',\r\n fontSize: '14px',\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n },\r\n MuiTextField: {\r\n root: {\r\n '&.startIcon': {\r\n '& > label': {\r\n marginLeft: '24px',\r\n },\r\n },\r\n // '&.textTable': {\r\n // minWidth: '80px',\r\n // },\r\n },\r\n },\r\n MuiChip: {\r\n root: {\r\n '&.recentItem': {\r\n display: 'flex',\r\n height: '32px',\r\n padding: '0px 8px',\r\n alignItems: 'center',\r\n gap: '12px',\r\n flexShrink: 0,\r\n justifyContent: 'flex-start',\r\n ...bodyS,\r\n borderRadius: '4px',\r\n background: bookitColors.base.white,\r\n '& [class*=\"MuiChip-avatar\"]': {\r\n margin: 0,\r\n width: 16,\r\n height: 16,\r\n color: bookitColors.grayscale.grayComponents,\r\n },\r\n '&$disabled': {\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n opacity: 1,\r\n },\r\n '&:hover, &:focus': {\r\n backgroundColor: bookitColors.grayscale.grayBackground,\r\n },\r\n '&:active': {\r\n backgroundColor: bookitColors.grayscale.graybgComponents,\r\n boxShadow: 'none',\r\n },\r\n '& [class*=\"MuiChip-label\"]': {\r\n flex: '1 0 0',\r\n padding: 0,\r\n },\r\n },\r\n },\r\n clickable: {\r\n '&:focus': {\r\n backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n color: bookitColors.base.black,\r\n },\r\n '&:hover': {\r\n backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n color: bookitColors.base.black,\r\n },\r\n },\r\n },\r\n MuiButton: MuiButtonOverride,\r\n MuiIconButton: MuiIconButtonOverride,\r\n MuiToggleButtonGroup: MuiToggleButtonGroupOverride,\r\n MuiToggleButton: MuiToggleButtonOverride,\r\n MuiSwitch: {\r\n //TO DO: set a padding: '0px' after Toggle component will replace a Switch component\r\n /* Styles applied to the root element. */\r\n root: {\r\n display: 'inline-flex',\r\n width: 36,\r\n height: 20,\r\n overflow: 'hidden',\r\n padding: '0px',\r\n boxSizing: 'border-box',\r\n position: 'relative',\r\n flexShrink: 0,\r\n zIndex: 0,\r\n // Reset the stacking context.\r\n verticalAlign: 'middle',\r\n // For correct alignment with the text.\r\n '@media print': {\r\n colorAdjust: 'exact',\r\n },\r\n // '&>[class*=\"PrivateSwitchBase-root\"]': {\r\n // padding: 2,\r\n // },\r\n },\r\n /* Styles applied to the internal `SwitchBase` component's `root` class. */\r\n switchBase: {\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n zIndex: 1,\r\n // Render above the focus ripple.\r\n color: bookitColors.grayscale.grayComponents,\r\n transition: transitions.create(['left', 'transform'], {\r\n duration: transitions.duration.shortest,\r\n }),\r\n padding: '2px',\r\n border: 0,\r\n '&$checked': {\r\n transform: 'translateX(16px)',\r\n },\r\n '&$disabled': {\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n '&$checked + $track': {\r\n opacity: 'unset',\r\n },\r\n '&$disabled + $track': {\r\n opacity: 'unset',\r\n },\r\n },\r\n /* Pseudo-class applied to the internal `SwitchBase` component's `checked` class. */\r\n checked: {},\r\n\r\n /* Pseudo-class applied to the internal SwitchBase component's disabled class. */\r\n disabled: {},\r\n\r\n /* Styles applied to the internal SwitchBase component's input element. */\r\n input: {\r\n left: '-100%',\r\n width: '300%',\r\n },\r\n /* Styles applied to the internal SwitchBase component's root element if `color=\"primary\"`. */\r\n colorPrimary: {\r\n '&$checked': {\r\n color: bookitColors.primary.components,\r\n '&:hover': {\r\n //backgroundColor: bookitColors.primary.componentsLight,\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.grayscale.graySelection,\r\n //backgroundColor: bookitColors.grayscale.graySelection,\r\n },\r\n '&$checked + $track': {\r\n backgroundColor: bookitColors.primary.components,\r\n },\r\n '&.Mui-checked.Mui-disabled + $track': {\r\n backgroundColor: bookitColors.primary.disabled,\r\n },\r\n '&$disabled + $track': {\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n },\r\n },\r\n /* Styles applied to the internal SwitchBase component's root element if `color=\"secondary\"`. */\r\n colorSecondary: {\r\n '&$checked': {\r\n color: bookitColors.danger.regular,\r\n '&:hover': {\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.danger.disabled,\r\n },\r\n '&$checked + $track': {\r\n backgroundColor: bookitColors.danger.regular,\r\n },\r\n '&.Mui-checked.Mui-disabled + $track': {\r\n backgroundColor: bookitColors.danger.disabled,\r\n },\r\n '&$disabled + $track': {\r\n backgroundColor: bookitColors.grayscale.graySelection,\r\n border: `1px solid ${bookitColors.danger.borders}`,\r\n },\r\n },\r\n /* Styles applied to the root element if `size=\"small\"`. */\r\n sizeSmall: {\r\n width: 36,\r\n height: 20,\r\n padding: 0,\r\n '& $thumb': {\r\n width: 16,\r\n height: 16,\r\n },\r\n '& $switchBase': {\r\n padding: 2,\r\n '&$checked': {\r\n transform: 'translateX(16px)',\r\n },\r\n },\r\n },\r\n /* Styles used to create the thumb passed to the internal `SwitchBase` component `icon` prop. */\r\n thumb: {\r\n backgroundColor: bookitColors.base.white,\r\n borderRadius: '8px',\r\n height: '16px',\r\n position: 'relative',\r\n width: '16px',\r\n boxShadow: box_shadow_s,\r\n },\r\n /* Styles applied to the track element. */\r\n track: {\r\n borderRadius: '100px',\r\n padding: '0px',\r\n height: '100%',\r\n width: '100%',\r\n zIndex: -1,\r\n transition: 'unset',\r\n backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n opacity: 'unset',\r\n },\r\n },\r\n MuiFormControl: {\r\n /* Styles applied to the root element. */\r\n root: {\r\n display: 'inline-flex',\r\n flexDirection: 'column',\r\n position: 'relative',\r\n // Reset fieldset default style.\r\n minWidth: 0,\r\n padding: 0,\r\n margin: 0,\r\n border: 0,\r\n verticalAlign: 'top', // Fix alignment issue on Safari.\r\n\r\n minHeight: '20px',\r\n // alignItems: 'center',\r\n gap: '8px',\r\n flexShrink: 0,\r\n '&.boxed': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'flex-start',\r\n gap: '8px',\r\n },\r\n '&.inputSizeMedium.withLabel': {\r\n marginTop: '16px',\r\n },\r\n '&.inputSizeSmall.withLabel': {\r\n marginTop: '16px',\r\n },\r\n '&.separate-picker': {\r\n // flexDirection: 'row',\r\n // flexShrink: 1,\r\n // marginBottom: '18px',\r\n '& .separate-picker-inputs': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flex: '1 1 auto',\r\n alignSelf: 'stretch',\r\n alignItems: 'center',\r\n gap: 8,\r\n },\r\n '&.withLabel': {\r\n marginTop: '16px',\r\n },\r\n },\r\n '&.separate-time-picker': {\r\n flexShrink: 1,\r\n },\r\n '&.separate-date-picker': {\r\n flexShrink: 1,\r\n },\r\n '&.datetime-picker': {\r\n // flexDirection: 'row',\r\n // flexShrink: 1,\r\n // marginBottom: '18px',\r\n '& .datetime-picker-inputs': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flex: '1 1 auto',\r\n alignSelf: 'stretch',\r\n alignItems: 'center',\r\n gap: 8,\r\n },\r\n // '&.withLabel': {\r\n // marginTop: '16px',\r\n // },\r\n },\r\n '&.datetime-time-picker': {\r\n flexShrink: 1,\r\n },\r\n '&.datetime-date-picker': {\r\n flexShrink: 1,\r\n },\r\n '&.date-dropdown-picker': {\r\n // flexDirection: 'row',\r\n // flexShrink: 1,\r\n // marginBottom: '18px',\r\n '& .date-dropdown-picker-inputs': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flex: '1 1 auto',\r\n alignSelf: 'stretch',\r\n alignItems: 'center',\r\n gap: 8,\r\n },\r\n '&.withLabel': {\r\n marginTop: '16px',\r\n },\r\n },\r\n '&.time-options-picker': {\r\n marginTop: '20px',\r\n '&.withLabel': {\r\n marginTop: '20px',\r\n },\r\n },\r\n '&.formLabelText': {\r\n gap: 0,\r\n },\r\n '&.ghostInput': {\r\n display: 'flex',\r\n minHeight: '48px',\r\n padding: '5px 0px',\r\n alignItems: 'center',\r\n gap: '10px',\r\n flexShrink: 0,\r\n borderRadius: '8px',\r\n '& .ghosInputText': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n flex: '1 1 0',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n width: '100%',\r\n },\r\n },\r\n '&.radio-group-base': {\r\n marginBottom: 0,\r\n },\r\n },\r\n\r\n /* Styles applied to the root element if `margin=\"normal\"`. */\r\n marginNormal: {\r\n marginTop: 16,\r\n marginBottom: 8,\r\n },\r\n\r\n /* Styles applied to the root element if `margin=\"dense\"`. */\r\n marginDense: {\r\n marginTop: 8,\r\n marginBottom: 4,\r\n },\r\n\r\n /* Styles applied to the root element if `fullWidth={true}`. */\r\n fullWidth: {\r\n width: '100%',\r\n },\r\n },\r\n MuiFormControlLabel: {\r\n /* Styles applied to the root element. */\r\n root: {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n cursor: 'pointer',\r\n // For correct alignment with the text.\r\n verticalAlign: 'middle',\r\n WebkitTapHighlightColor: 'transparent',\r\n marginLeft: 0,\r\n marginRight: 0,\r\n gap: 8,\r\n // used for row presentation of radio/checkbox\r\n '&$disabled': {\r\n cursor: 'default',\r\n },\r\n '&.boldLabel': {\r\n '& $label': {\r\n ...boldS,\r\n '&$disabled': {\r\n color: bookitColors.grayscale.graySubtitles,\r\n },\r\n },\r\n },\r\n '&.autoWrap': {\r\n '& $label': {\r\n whiteSpace: 'normal',\r\n overflow: 'visible',\r\n textOverflow: 'unset',\r\n },\r\n },\r\n },\r\n /* Styles applied to the root element if `labelPlacement=\"start\"`. */\r\n labelPlacementStart: {\r\n flexDirection: 'row-reverse',\r\n marginLeft: 16,\r\n // used for row presentation of radio/checkbox\r\n marginRight: -11,\r\n },\r\n\r\n /* Styles applied to the root element if `labelPlacement=\"top\"`. */\r\n labelPlacementTop: {\r\n flexDirection: 'column-reverse',\r\n marginLeft: 0,\r\n marginRight: 2,\r\n },\r\n\r\n /* Styles applied to the root element if `labelPlacement=\"bottom\"`. */\r\n labelPlacementBottom: {\r\n flexDirection: 'column',\r\n marginLeft: 16,\r\n },\r\n\r\n /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n disabled: {},\r\n\r\n /* Styles applied to the label's Typography component. */\r\n label: {\r\n ...bodyS,\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n // maxWidth: '25ch',\r\n '&$disabled': {\r\n color: bookitColors.grayscale.graySubtitles,\r\n },\r\n '&.boldLabel': {\r\n ...boldS,\r\n '&$disabled': {\r\n color: bookitColors.grayscale.graySubtitles,\r\n },\r\n },\r\n },\r\n },\r\n MuiCheckbox: {\r\n root: {\r\n color: bookitColors.grayscale.graySelection,\r\n // '&[class*=\"PrivateSwitchBase-root\"]': {\r\n // padding: 0,\r\n // },\r\n },\r\n colorPrimary: {\r\n color: bookitColors.primary.borders,\r\n '&$checked': {\r\n color: bookitColors.primary.regular,\r\n '&:hover': {\r\n backgroundColor: bookitColors.base.white,\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.primary.disabled,\r\n },\r\n },\r\n /* Styles applied to the root element if `color=\"secondary\"`. */\r\n colorSecondary: {\r\n color: bookitColors.danger.borders,\r\n '&$checked': {\r\n color: bookitColors.danger.regular,\r\n '&:hover': {\r\n backgroundColor: bookitColors.base.white,\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.danger.disabled,\r\n },\r\n },\r\n },\r\n MuiRadio: {\r\n /* Styles applied to the root element. */\r\n root: {\r\n color: bookitColors.base.white,\r\n },\r\n\r\n /* Pseudo-class applied to the root element if `checked={true}`. */\r\n checked: {},\r\n\r\n /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n disabled: {},\r\n\r\n /* Styles applied to the root element if `color=\"primary\"`. */\r\n colorPrimary: {\r\n '&$checked': {\r\n color: bookitColors.primary.components,\r\n '&:hover': {\r\n backgroundColor: bookitColors.primary.regular,\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n\r\n /* Styles applied to the root element if `color=\"secondary\"`. */\r\n colorSecondary: {\r\n '&$checked': {\r\n color: bookitColors.danger.components,\r\n '&:hover': {\r\n backgroundColor: bookitColors.danger.regular,\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n },\r\n '&$disabled': {\r\n color: bookitColors.danger.disabled,\r\n },\r\n },\r\n },\r\n PrivateSwitchBase: {\r\n root: {\r\n padding: 0,\r\n },\r\n checked: {},\r\n disabled: {},\r\n input: {\r\n cursor: 'inherit',\r\n position: 'absolute',\r\n opacity: 0,\r\n width: '100%',\r\n height: '100%',\r\n top: 0,\r\n left: 0,\r\n margin: 0,\r\n padding: 0,\r\n zIndex: 1,\r\n },\r\n },\r\n MuiBadge: {\r\n badge: {\r\n whiteSpace: 'nowrap',\r\n height: '14px',\r\n padding: '2px 0px',\r\n fontSize: '8px',\r\n minWidth: '14px',\r\n lineHeight: '168%',\r\n letterSpacing: '0.8px',\r\n },\r\n },\r\n MUIDataTableBodyCell: {\r\n root: {\r\n padding: '0px 8px 0px 8px',\r\n //textAlign: 'center',\r\n },\r\n // stackedCommon: {\r\n // display: 'flex',\r\n // // alignItems: 'center',\r\n // // flexWrap: 'nowrap',\r\n // // justifyContent: 'center',\r\n // },\r\n },\r\n MUIDataTableBody: {\r\n root: {\r\n border: '1px solid #ccc',\r\n },\r\n },\r\n MUIDataTableHeadCell: {\r\n root: {\r\n border: '1px solid #ccc',\r\n },\r\n contentWrapper: {\r\n //justifyContent: 'center',\r\n },\r\n data: {\r\n fontWeight: 'bold',\r\n },\r\n fixedHeader: {\r\n //textAlign: 'center',\r\n fontWeight: 'bold',\r\n border: '1px solid #ccc',\r\n },\r\n toolButton: {\r\n whiteSpace: 'nowrap',\r\n },\r\n },\r\n MUIDataTableToolbarSelect: {\r\n title: {\r\n paddingRight: '26px',\r\n paddingLe: '26px',\r\n fontSize: '1rem',\r\n fontWeight: 700,\r\n lineHeight: '1.5rem',\r\n },\r\n },\r\n MuiDialog: {\r\n root: {},\r\n paper: {\r\n //width: '100%',\r\n borderRadius: '12px',\r\n '.coverRoot &': {\r\n margin: '0px 4px',\r\n overflowY: 'hidden',\r\n borderRadius: '12px 12px 0px 0px',\r\n },\r\n },\r\n paperWidthXs: {\r\n maxWidth: '480px',\r\n },\r\n scrollPaper: {\r\n '.coverRoot &': {\r\n justifyContent: 'flex-end',\r\n alignItems: 'flex-end',\r\n },\r\n },\r\n paperWidthFalse: {\r\n '.coverRoot &': {\r\n maxWidth: COVER_WIDTH,\r\n width: '100%',\r\n },\r\n },\r\n paperScrollPaper: {\r\n '.coverRoot &': {\r\n maxHeight: 'calc(100% - 50px)',\r\n // height: '100vh',\r\n },\r\n },\r\n paperFullWidth: {\r\n '.coverRoot &': {\r\n width: '100%',\r\n },\r\n },\r\n },\r\n MuiBackdrop: {\r\n root: {\r\n '&.sidePanelBackdrop': {\r\n zIndex: 1201,\r\n },\r\n },\r\n },\r\n MuiAlert: {\r\n root: {\r\n padding: '0px 12px',\r\n '&.showMore': {\r\n alignItems: 'center',\r\n },\r\n },\r\n action: {\r\n flexDirection: 'column',\r\n justifyContent: 'space-between',\r\n },\r\n },\r\n MuiMenu: {\r\n paper: {\r\n '.hoverChildMenu &': {\r\n boxShadow: box_shadow_m,\r\n background: bookitColors.base.white,\r\n borderRadius: '8px',\r\n },\r\n },\r\n list: {\r\n '.hoverChildMenu &': {\r\n display: 'flex',\r\n padding: '8px 0px 12px 0px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n '& .menuItemName': {\r\n display: 'flex',\r\n padding: '4px 12px 8px 16px',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n alignSelf: 'stretch',\r\n cursor: 'unset',\r\n color: bookitColors.grayscale.blackRegular,\r\n '&:hover': {\r\n background: 'inherit',\r\n },\r\n },\r\n '& .menuItem': {\r\n display: 'flex',\r\n width: '240px',\r\n height: '32px',\r\n padding: '0px 8px',\r\n alignItems: 'center',\r\n gap: '8px',\r\n '& .menuItemContent': {\r\n display: 'flex',\r\n paddingLeft: '8px',\r\n alignItems: 'center',\r\n gap: '8px',\r\n flex: '1 0 0',\r\n '& .menuItemIcon': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n gap: '7.5px',\r\n width: 'auto',\r\n height: 16,\r\n color: bookitColors.grayscale.grayComponents,\r\n '& > svg': {\r\n width: '16px',\r\n },\r\n },\r\n '& .menuItemText': {\r\n flex: '1 0 0',\r\n color: bookitColors.grayscale.blackRegular,\r\n ...bookitTypography.bodyS,\r\n cursor: 'pointer',\r\n whiteSpace: 'initial',\r\n },\r\n },\r\n '&:hover, &:focus': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n },\r\n },\r\n },\r\n '&:active': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n },\r\n },\r\n },\r\n '&.Mui-selected': {\r\n background: bookitColors.primary.bgHover,\r\n '& .menuItemContent': {\r\n '& .menuItemText': {\r\n ...bookitTypography.bodyS,\r\n fontWeight: 600,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n MuiMenuItem: {\r\n root: {\r\n gap: 12,\r\n },\r\n dense: {\r\n paddingTop: '2px',\r\n paddingBottom: '2px',\r\n },\r\n },\r\n MuiPickersDatePickerRoot: {\r\n toolbar: {\r\n alignItems: 'flex-start',\r\n flexDirection: 'column',\r\n gap: '8px',\r\n },\r\n toolbarLandscape: {\r\n padding: 16,\r\n },\r\n dateLandscape: {\r\n marginRight: 16,\r\n },\r\n },\r\n MuiPickerDTToolbar: {\r\n toolbar: {\r\n paddingLeft: 16,\r\n paddingRight: 16,\r\n justifyContent: 'space-around',\r\n },\r\n separator: {\r\n margin: '0 4px 0 2px',\r\n cursor: 'default',\r\n ...buttonM,\r\n },\r\n },\r\n MuiDrawer: {\r\n root: {\r\n '&.sideBarDrawer': {\r\n gap: 8,\r\n width: DRAWER_WIDTH,\r\n flexShrink: 0,\r\n whiteSpace: 'nowrap',\r\n backgroundColor: bookitColors.base.white,\r\n zIndex: 1200,\r\n '&.sideBarMobile': {\r\n width: 'calc(100% - 48px)', //DRAWER_MOBILE_WIDTH,\r\n },\r\n '&.drawerOpen': {\r\n width: DRAWER_WIDTH,\r\n transition: transitions.create('width', {\r\n easing: transitions.easing.sharp,\r\n duration: transitions.duration.enteringScreen,\r\n }),\r\n '&.sideBarMobile': {\r\n width: 'calc(100% - 48px)', //DRAWER_MOBILE_WIDTH,\r\n },\r\n },\r\n '&.drawerClose': {\r\n transition: transitions.create('width', {\r\n easing: transitions.easing.sharp,\r\n duration: transitions.duration.leavingScreen,\r\n }),\r\n overflowX: 'hidden',\r\n width: 0,\r\n [breakpoints.up('sm')]: {\r\n width: '60px',\r\n },\r\n },\r\n },\r\n },\r\n paper: {\r\n '.sideBarDrawer &': {\r\n background: bookitColors.base.white,\r\n position: 'fixed',\r\n whiteSpace: 'nowrap',\r\n width: DRAWER_WIDTH,\r\n transition: transitions.create('width', {\r\n easing: transitions.easing.sharp,\r\n duration: transitions.duration.enteringScreen,\r\n }),\r\n gap: '16px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n paddingTop: '12px',\r\n '& .sideBarHeader': {\r\n // minHeight: '48px',\r\n // display: 'flex',\r\n // flexDirection: 'row',\r\n // justifyContent: 'space-between',\r\n // alignItems: 'center',\r\n // padding: props => (props.isOpen ? '0px 16px' : '0px 8px'),\r\n // gap: 16,\r\n display: 'flex',\r\n padding: '0px 8px 0px 16px',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n alignSelf: 'stretch',\r\n height: '32px',\r\n '&.sideBarHeaderMobile': {},\r\n '& .headerButtons': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n '& .headerButtonsMobile': {\r\n gap: '4px',\r\n },\r\n },\r\n '& .sideBarQickAction': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n padding: '0px 16px',\r\n gap: '10px',\r\n '&.sideBarQickActionMobile': {\r\n padding: '16px 16px 8px 16px',\r\n gap: '12px',\r\n },\r\n },\r\n },\r\n '.sideBarDrawer.sideBarMobile &': {\r\n width: 'calc(100% - 48px)', // DRAWER_MOBILE_WIDTH,\r\n gap: 0,\r\n },\r\n '.sideBarDrawer.drawerClose &': {\r\n overflowX: 'hidden',\r\n transition: transitions.create('width', {\r\n easing: transitions.easing.sharp,\r\n duration: transitions.duration.leavingScreen,\r\n }),\r\n width: '60px',\r\n '& .sideBarHeader': {\r\n padding: '0px 8px',\r\n },\r\n '& .sideBarQickAction': {\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n // [breakpoints.up('sm')]: {\r\n // width: 7 * 8 + 1,\r\n // },\r\n },\r\n },\r\n paperAnchorDockedLeft: {\r\n '.sideBarDrawer &': {\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n },\r\n },\r\n // MuiPickerDTTabs: {\r\n // tabs: {\r\n // color: theme.palette.getContrastText(tabsBackground),\r\n // backgroundColor: tabsBackground,\r\n // },\r\n // },\r\n MuiPickersToolbar: {\r\n toolbar: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n height: 100,\r\n backgroundColor: bookitColors.primary.regular,\r\n // theme.palette.type === 'light'\r\n // ? theme.palette.primary.main\r\n // : theme.palette.background.default,\r\n },\r\n toolbarLandscape: {\r\n height: 'auto',\r\n maxWidth: 150,\r\n padding: 8,\r\n justifyContent: 'flex-start',\r\n },\r\n },\r\n MuiPickersToolbarButton: {\r\n toolbarBtn: {\r\n padding: 0,\r\n minWidth: '32px',\r\n textTransform: 'none',\r\n },\r\n },\r\n MuiPickersToolbarText: {\r\n toolbarTxt: {\r\n color: fade(bookitColors.base.white, 0.54),\r\n ...buttonM,\r\n },\r\n toolbarBtnSelected: {\r\n color: bookitColors.base.white,\r\n // color: theme.palette.type === 'light'\r\n // ? theme.palette.primary.contrastText\r\n // : theme.palette.getContrastText(theme.palette.background.default);,\r\n },\r\n },\r\n MuiAutocomplete: {\r\n inputRoot: {\r\n flexWrap: 'wrap',\r\n '.atable &': {\r\n flexWrap: 'nowrap',\r\n },\r\n '& $input': {\r\n width: 'auto',\r\n minWidth: 56,\r\n },\r\n '.date-dropdown-picker-inputs &': {\r\n '& $input': {\r\n width: '100%',\r\n minWidth: 30,\r\n },\r\n },\r\n },\r\n },\r\n MuiTabs: {\r\n root: {\r\n minHeight: '40px',\r\n '&.sizeSmall': {\r\n minHeight: '32px',\r\n },\r\n },\r\n flexContainer: {\r\n '.tabsHorizontal &': {\r\n gap: 24,\r\n },\r\n '.sizeSmall &': {\r\n '.tabsHorizontal &': {\r\n gap: 20,\r\n },\r\n },\r\n },\r\n scrollable: {},\r\n indicator: {\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n backgroundColor: bookitColors.primary.regular,\r\n // '& > span': {\r\n // maxWidth: 40,\r\n // width: '100%',\r\n // backgroundColor: '#635ee7',\r\n // },\r\n },\r\n },\r\n MuiTab: {\r\n root: {\r\n textTransform: 'none',\r\n ...bookitTypography.boldM,\r\n '.tabsHorizontal &': {\r\n padding: '8px 0px 0px',\r\n minHeight: '40px',\r\n alignItems: 'flex-start',\r\n gap: '4px',\r\n '&.tabSizeSmall': {\r\n minHeight: '32px',\r\n padding: '4px 0px 0px',\r\n ...bookitTypography.boldS,\r\n },\r\n [breakpoints.up('sm')]: {\r\n minWidth: 'auto',\r\n },\r\n },\r\n },\r\n wrapper: {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n width: '100%',\r\n flexDirection: 'column',\r\n '.startIcon &': {\r\n flexDirection: 'row',\r\n gap: '8px',\r\n },\r\n '.endIcon &': {\r\n flexDirection: 'row',\r\n gap: '8px',\r\n },\r\n },\r\n textColorInherit: {\r\n color: bookitColors.grayscale.graySubtitles,\r\n opacity: 1,\r\n '&$selected': {\r\n color: bookitColors.grayscale.blackRegular,\r\n },\r\n '&$disabled': {\r\n color: bookitColors.grayscale.grayComponentsLight,\r\n },\r\n },\r\n },\r\n MuiTooltip: {\r\n tooltip: {\r\n display: 'flex',\r\n padding: 12,\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n color: bookitColors.base.white,\r\n backgroundColor: bookitColors.overlays.overlayBlack,\r\n flex: '1 0 0',\r\n ...bookitTypography.bodyS,\r\n '.colorDark &': {\r\n color: bookitColors.base.white,\r\n backgroundColor: bookitColors.overlays.overlayBlack,\r\n },\r\n '.colorLight &': {\r\n color: bookitColors.base.black,\r\n backgroundColor: bookitColors.base.white,\r\n boxShadow: box_shadow_s,\r\n },\r\n '& .content': {\r\n maxHeight: 360,\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: bookitColors.grayscale.grayBorders,\r\n '.colorDark &': {\r\n backgroundColor: bookitColors.overlays.overlayBlack,\r\n },\r\n },\r\n },\r\n },\r\n arrow: {\r\n color: bookitColors.overlays.overlayBlack,\r\n '.colorDark &': {\r\n color: bookitColors.overlays.overlayBlack,\r\n },\r\n '.colorLight &': {\r\n color: bookitColors.base.white,\r\n '&::before': {\r\n border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n};\r\nexport const darkTheme: ThemeOptions = {\r\n palette: {\r\n background: { default: grey[400], paper: grey[100] },\r\n primary: { main: green[100] },\r\n secondary: {\r\n main: '#4a4a4a',\r\n },\r\n text: {\r\n primary: '#e1dada',\r\n secondary: 'rgba(255, 255, 255, 0.54)',\r\n disabled: '#757575',\r\n },\r\n },\r\n};\r\nexport const animalsThemeSettings: ThemeOptions = {\r\n palette: {\r\n primary: {\r\n main: '#ffdc64',\r\n dark: '#c9ab33',\r\n light: '#ffff95',\r\n contrastText: '#000000',\r\n },\r\n secondary: {\r\n main: '#3247e1',\r\n dark: '#001fae',\r\n light: '#7673ff',\r\n contrastText: '#ffffff',\r\n },\r\n error: {\r\n main: '#E53F58',\r\n dark: '#AC2F42',\r\n light: '#F195A3',\r\n contrastText: '#ffffff',\r\n },\r\n background: {\r\n default: '#F3F3F3',\r\n paper: '#FFF',\r\n },\r\n default: {\r\n main: '#ffdc64',\r\n dark: '#c9ab33',\r\n light: '#ffff95',\r\n contrastText: '#000000',\r\n },\r\n },\r\n shape: {\r\n borderRadius: 12,\r\n },\r\n\r\n typography: {\r\n fontFamily: [\"'Open Sans Hebrew'\", 'system-ui'].join(','),\r\n h1: {\r\n //styleName: Bkt/Header 1;\r\n fontSize: '2.5rem',\r\n fontWeight: 700,\r\n lineHeight: '3rem',\r\n },\r\n h2: {\r\n //styleName: Bkt/Header 2;\r\n fontSize: '2rem',\r\n fontWeight: 700,\r\n lineHeight: '2.875rem', //46/16\r\n },\r\n h3: {\r\n //styleName: Bkt/Header 3;\r\n fontSize: '1.5rem',\r\n fontWeight: 700,\r\n lineHeight: '2.375rem', //46/16\r\n },\r\n h4: {\r\n //styleName: Bkt/Header 4:\r\n fontSize: '1.5rem',\r\n fontWeight: 700,\r\n lineHeight: '2rem',\r\n },\r\n h5: {\r\n fontSize: '1.25rem',\r\n fontWeight: 700,\r\n lineHeight: '1.5rem',\r\n },\r\n h6: {\r\n fontSize: '1rem',\r\n fontWeight: 700,\r\n lineHeight: '1.375rem',\r\n },\r\n subtitle1: {\r\n fontSize: '1.25rem',\r\n lineHeight: '2rem',\r\n fontWeight: 700,\r\n },\r\n subtitle2: {\r\n fontSize: '1.25rem',\r\n lineHeight: '2rem',\r\n fontWeight: 400,\r\n },\r\n body1: {\r\n fontSize: '1rem',\r\n lineHeight: '1.375rem',\r\n fontWeight: 400,\r\n },\r\n body2: {\r\n fontSize: '1rem',\r\n lineHeight: '1.375rem',\r\n fontWeight: 400,\r\n //color: grey[600],\r\n },\r\n },\r\n overrides: {\r\n MuiTextField: {},\r\n MuiAppBar: {},\r\n },\r\n};\r\n\r\nexport const CreateTheme = (direction, baseTheme: BaseTheme) =>\r\n createMuiTheme(getBaseTheme(baseTheme), { direction: direction }); //DefaultThemeSettings\r\n\r\nconst getBaseTheme = (type: BaseTheme) => {\r\n switch (type) {\r\n case 'bookit':\r\n return BookitThemeSettings;\r\n case 'animals':\r\n return animalsThemeSettings;\r\n case 'dark':\r\n return darkTheme;\r\n case 'default':\r\n default:\r\n return DefaultThemeSettings;\r\n }\r\n};\r\n","/**\r\n *\r\n * BuildingPickerFilter\r\n *\r\n */\r\nimport { BuildingPicker } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const BuildingPickerFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * LocationPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface LocationPickerProps\r\n extends Omit, 'loadData'> {\r\n withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/LocationList';\r\nexport const initLocationData = (\r\n initval: string | undefined,\r\n): Promise => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as ILocationListDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n 'Id,Name,LocationTypeId,LocationType,RoomId,RoomName,SubLocationListCount,ServiceGroups',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as ILocationListDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter?: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'LocationType',\r\n 'LocationTypeId',\r\n 'RoomId',\r\n 'RoomName',\r\n 'SubLocationListCount',\r\n 'ServiceGroups',\r\n ],\r\n globalServiceGroupFilter:\r\n globalServiceGroupFilter?.map(\r\n serviceGroup =>\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n serviceGroup.Id,\r\n 'Id',\r\n ),\r\n ) ?? [],\r\n isOptionalServiceGroup: true,\r\n });\r\nexport function LocationPicker(props: LocationPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n !props.withoutServiceGroups\r\n ? globalServiceGroupFilter || undefined\r\n : undefined,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ServiceGroupsPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { GroupUrl } from '../../ServiceGroupPicker';\r\nimport { splitFilterValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\n\r\nexport interface ServiceGroupsPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n selectArray?: Array;\r\n urlType?: GroupUrl;\r\n separator?: string;\r\n useSearchOrPredicate?: boolean;\r\n}\r\nconst url = '/api/odata/v4/servicegroups';\r\nconst adminUrl = '/api/odata/v4/servicegroups/GetAdminServiceGroups';\r\nconst publicUrl = '/api/odata/v4/servicegroups/GetPublicServiceGroups';\r\nconst regPublicUrl = '/api/odata/v4/servicegroups/GetRegistrationServiceGroups';\r\n\r\nexport const initServiceGroupsMultiData = (\r\n initval: string | undefined,\r\n sourceUrl?: GroupUrl,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IServiceGroupDto[]);\r\n });\r\n } else {\r\n let ids = splitFilterValue(initval).map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n let filters: string | undefined = undefined;\r\n if (ids.length > 0) {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n filters = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filters,\r\n $select: 'Id,Name,DivisionId,DivisionName',\r\n };\r\n let initUrl =\r\n sourceUrl === undefined\r\n ? url\r\n : sourceUrl === 'public'\r\n ? publicUrl\r\n : sourceUrl === 'regpublic'\r\n ? regPublicUrl\r\n : sourceUrl === 'admin'\r\n ? adminUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IServiceGroupDto[]);\r\n }\r\n};\r\n\r\nexport const initFiltersServiceGroupsData = (filter: string | undefined) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filter,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n isAuthenticated?: boolean,\r\n urlType?: GroupUrl,\r\n useSearchOrPredicate?: boolean,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicUrl\r\n : urlType === 'regpublic'\r\n ? regPublicUrl\r\n : urlType === 'admin'\r\n ? adminUrl\r\n : url;\r\n let filters: (string | Condition)[] = [];\r\n if (sourceUrl === url) {\r\n if (!!predicates && predicates.length > 0) {\r\n filters = [...predicates, ...['Active eq true']];\r\n } else {\r\n filters = ['Active eq true'];\r\n }\r\n }\r\n\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: filters,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'DivisionId', 'DivisionName'],\r\n useSearchOrPredicate: useSearchOrPredicate,\r\n });\r\n};\r\nexport const ServiceGroupByDivisionsFilter = (value: FilterValueType) => {\r\n if (value !== undefined && value !== null && Array.isArray(value)) {\r\n return [\r\n `${new Condition(\r\n 'DivisionId',\r\n ODataOperators.Includes,\r\n (value as Identifiable[]).map(f => f.Id),\r\n ).toString()}`,\r\n ];\r\n }\r\n return [];\r\n};\r\nexport function ServiceGroupsPicker(props: ServiceGroupsPickerProps) {\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const { predicates, urlType, useSearchOrPredicate, ...other } = props;\r\n const innerLoadData = loadData(\r\n predicates,\r\n isAuth,\r\n urlType,\r\n useSearchOrPredicate,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useEffectOnMount } from './useEffectOnMount';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport const useGlobalServiceGroupsFilter = (\r\n applyGlobalServiceGroupsFilter: boolean,\r\n) => {\r\n const dispatch = useDispatch();\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const gloabalSettings = useSelector(selectglobalSettings);\r\n const { actions } = useAppSettingsSlice();\r\n useEffectOnMount(() => {\r\n dispatch(\r\n actions.showGlobalServiceGroupFilter(\r\n !gloabalSettings.GetBooleanByKey(\r\n AllowedSettings.HideTopServiceGroupFilter,\r\n ) && applyGlobalServiceGroupsFilter,\r\n ),\r\n );\r\n });\r\n const serviceGroups = React.useMemo(() => {\r\n return applyGlobalServiceGroupsFilter ? selectedServiceGroups || [] : [];\r\n }, [applyGlobalServiceGroupsFilter, selectedServiceGroups]);\r\n return { serviceGroups };\r\n};\r\n","import { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { IAssetRelated } from 'types/IAssetRelated';\r\n\r\n/**\r\n * Renders an Asset Link (Popup/sidepanel)\r\n * Requires for the AssetId property to be present on the row, otherwise the value is rendered without the link\r\n * @param param0\r\n * @returns\r\n */\r\nconst AssetRenderer: Renderer> = ({\r\n row: { original },\r\n value,\r\n}) =>\r\n !!original.AssetId ? (\r\n {value}\r\n ) : (\r\n <>{value}\r\n );\r\nexport default AssetRenderer;\r\n","/**\r\n *\r\n * ButtonConfirm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nexport interface ButtonConfirmProps extends Omit {\r\n onClick: React.MouseEventHandler;\r\n confirmationDialogTitle?: string;\r\n confirmationDialogBody?: string;\r\n disabled?: boolean;\r\n}\r\n\r\n/**\r\n * Button with a confirmation dialog\r\n * @param param0 primary click handler\r\n * @returns\r\n */\r\nexport function ButtonConfirm({\r\n onClick,\r\n confirmationDialogTitle,\r\n confirmationDialogBody,\r\n ...props\r\n}: ButtonConfirmProps) {\r\n const { t } = useTranslation();\r\n const [open, setOpen] = React.useState(false);\r\n const title = confirmationDialogTitle ?? t(translations.Confirm);\r\n const body = confirmationDialogBody ?? t(translations.AreYouSure);\r\n const handleConfirmClick = e => {\r\n setOpen(false);\r\n onClick(e);\r\n };\r\n return (\r\n <>\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport function ArrayRenderer(\r\n callback: (value: T, original: IAsset | undefined) => ReactNode | undefined,\r\n) {\r\n const mapper = (props: AttributeValue) => {\r\n if (!!props.value && !!props.value.length) {\r\n return (\r\n //
      \r\n // {props.value.map(v => (\r\n //
    • {callback(v, props.original)}
    • \r\n // ))}\r\n //
    \r\n \r\n {props.value.map((v, indx) => (\r\n \r\n \r\n {callback(v, props.original)}\r\n \r\n \r\n ))}\r\n \r\n );\r\n }\r\n };\r\n return mapper;\r\n}\r\nexport const AssetDetailsImageRender = (\r\n props: AttributeValue,\r\n): ReactNode => {\r\n const theme = useTheme();\r\n const defaultImgSrc = process.env.PUBLIC_URL + `/images/400x300.png`;\r\n const defaultImgMobileSrc = process.env.PUBLIC_URL + `/images/200x150.png`;\r\n const defaultImg = React.useMemo(() => {\r\n return props.shortView ? defaultImgMobileSrc : defaultImgSrc;\r\n }, [defaultImgMobileSrc, defaultImgSrc, props.shortView]);\r\n\r\n const [pathSrc, setPathSrc] = React.useState(defaultImg);\r\n\r\n const [loadingImg, setLoadingImg] = React.useState(\r\n undefined,\r\n );\r\n const [imageDimensions, setImageDimensions] = React.useState<\r\n DemSize | undefined\r\n >(undefined);\r\n const checkImage = React.useCallback(\r\n async (path: any) =>\r\n new Promise<{\r\n path?: string;\r\n status: string;\r\n height: number;\r\n width: number;\r\n }>(resolve => {\r\n const img = new Image();\r\n img.src = props.value;\r\n img.onload = () =>\r\n resolve({ path, status: 'ok', height: img.height, width: img.width });\r\n img.onerror = () =>\r\n resolve({\r\n path,\r\n status: 'error',\r\n height: props.shortView ? 150 : 300,\r\n width: props.shortView ? 200 : 400,\r\n });\r\n }),\r\n [props.shortView, props.value],\r\n );\r\n React.useEffect(() => {\r\n let active = props.value !== undefined && loadingImg === undefined;\r\n if (active) {\r\n if (loadingImg) return;\r\n setLoadingImg(true);\r\n (async () => {\r\n try {\r\n const res = await checkImage(props.value);\r\n if (res.status === 'ok') {\r\n setPathSrc(res.path);\r\n setImageDimensions({\r\n height: res.height,\r\n width: res.width,\r\n });\r\n setLoadingImg(false);\r\n } else {\r\n setPathSrc(defaultImg);\r\n setImageDimensions({\r\n height: res.height,\r\n width: res.width,\r\n });\r\n setLoadingImg(false);\r\n }\r\n } catch {\r\n setPathSrc(defaultImg);\r\n setImageDimensions({\r\n height: props.shortView ? 150 : 300,\r\n width: props.shortView ? 200 : 400,\r\n });\r\n setLoadingImg(false);\r\n }\r\n })();\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [checkImage, defaultImg, loadingImg, props.shortView, props.value]);\r\n const backgroundSize = React.useMemo(() => {\r\n if (!!imageDimensions) {\r\n let horizontal = imageDimensions.width - imageDimensions.height > 0;\r\n if (\r\n imageDimensions.height === imageDimensions.width ||\r\n (horizontal && imageDimensions.width / 1.1 < imageDimensions.height) ||\r\n (!horizontal && imageDimensions.height / 1.1 < imageDimensions.width)\r\n ) {\r\n return 'contain';\r\n }\r\n if (!horizontal) {\r\n if (imageDimensions.height < (props.shortView ? 220 : 340) / 1.8) {\r\n return 'contain';\r\n } else {\r\n return imageDimensions.height / imageDimensions.width > 1.8\r\n ? 'cover'\r\n : 'contain';\r\n }\r\n } else {\r\n if (imageDimensions.width < (props.shortView ? 220 : 340) / 1.8) {\r\n return 'contain';\r\n } else {\r\n return imageDimensions.width / imageDimensions.height < 1.8\r\n ? 'cover'\r\n : 'contain';\r\n }\r\n }\r\n }\r\n return undefined;\r\n }, [imageDimensions, props.shortView]);\r\n return !!pathSrc && loadingImg === false ? (\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n {/* */}\r\n
    \r\n \r\n \r\n
    \r\n ) : (\r\n <>\r\n );\r\n};\r\nexport function UsersRenderer() {\r\n return ArrayRenderer(v => (\r\n
    \r\n \r\n {v.Name}\r\n \r\n {!!v.Email && (\r\n \r\n {v.Email}\r\n \r\n )}\r\n\r\n {!!v.OfficeTel && (\r\n \r\n {v.OfficeTel}\r\n \r\n )}\r\n
    \r\n ));\r\n}\r\n","import React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IAsset } from './IAsset';\r\n\r\nexport interface IAssetRow extends Entity {\r\n Cell?: (value: AttributeValue) => React.ReactNode | undefined;\r\n PropName?: keyof IAsset;\r\n NoHeader?: boolean;\r\n Header?: (value: AttributeValue) => React.ReactNode;\r\n dependencies?: string[];\r\n validToRender?: (value: AttributeValue) => boolean;\r\n State?: AssetRowState;\r\n}\r\n\r\nexport interface AttributeValue {\r\n original: T;\r\n value: any;\r\n shortView?: boolean;\r\n}\r\n\r\nexport enum AssetRowState {\r\n SectionName,\r\n Mandatory,\r\n}\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { IAssetBarcodeScanLogDto } from 'api/odata/generated/entities/IAssetBarcodeScanLogDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\n/**\r\n * Fetches & shows last location update details (user/date) for a given asset\r\n */\r\n\r\nexport function AssetLocationLastUpdate(props: { assetId: number }) {\r\n const f = React.useCallback(async (assetId: number) => {\r\n const url = `/api/odata/v4/AssetDetails2/${assetId}/BarcodeScanLog`;\r\n const result: IODataQueryResponse = await httpClient.get(url, {\r\n $select: 'Date,User',\r\n $expand: 'User($select=Id,Name)',\r\n $top: 1,\r\n $orderBy: 'Date desc',\r\n });\r\n return result.value[0];\r\n }, []);\r\n type IState = Pick;\r\n\r\n const [fetchState, fetch] = usePromise(f);\r\n const [state, setState] = useAsyncExtendedState(\r\n undefined,\r\n );\r\n useEffectOnMount(() => setState(fetch(props.assetId)));\r\n const { t } = useTranslation();\r\n\r\n if (fetchState.status === 'resolved' && state !== undefined) {\r\n return (\r\n <>\r\n  {t(translations.Updated)}:{' '}\r\n {dateUtils.shortDateFormat(state?.Date)} {state?.User?.Name}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n}\r\n","import * as React from 'react';\r\n\r\nexport interface DoubleRenderProps {\r\n value?: number | null;\r\n}\r\n\r\nexport const DoubleRender = (props: DoubleRenderProps) => {\r\n return {props.value};\r\n};\r\n","import { Comments } from 'app/components/Comments';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTheme } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport { Identifiable } from 'types/common';\r\nexport interface AssetCommentsprops {\r\n assetId: number;\r\n isAdmin: boolean;\r\n staffonly: boolean;\r\n serviceGroups?: Identifiable[];\r\n}\r\nexport const FloatingComments = styled('div')(({ theme }) => ({\r\n '&.floatingComments': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: 8,\r\n height: 'auto',\r\n maxHeight: '540px',\r\n zIndex: 1070, //zIndex: 1500,\r\n padding: '16px 8px',\r\n //bottom: 'unset',\r\n position: 'fixed',\r\n bottom: '0px',\r\n width: '100%',\r\n left: 0,\r\n background: bookitColors.grayscale.grayBackground,\r\n //borderRadius: 8,\r\n boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n },\r\n}));\r\nexport const AssetComments = ({\r\n assetId,\r\n isAdmin,\r\n staffonly,\r\n serviceGroups,\r\n}: AssetCommentsprops) => {\r\n const { onCommentAdded } = useUploadToNewComment();\r\n return (\r\n \r\n );\r\n};\r\nexport const AssetMobileComments = ({\r\n assetId,\r\n isAdmin,\r\n staffonly,\r\n}: AssetCommentsprops) => {\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n const { onCommentAdded } = useUploadToNewComment();\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { toRootedURL } from 'utils/url-utils';\r\nimport { AvailabilityTypesUnion } from 'api/odata/generated/enums/AvailabilityTypes';\r\n\r\nexport const getAssetEditLink = (\r\n availabilityType: AvailabilityTypesUnion,\r\n assetId?: number,\r\n serviceId?: number,\r\n serviceGroupId?: number,\r\n divisionId?: number,\r\n) => {\r\n switch (availabilityType) {\r\n case 'NotAvailable':\r\n case 'AvailableNotBookable':\r\n case 'FreelyBookable':\r\n case 'TrainingProgram':\r\n case 'LoanableEquipment':\r\n case 'LectureRoom':\r\n return toRootedURL(\r\n `/NewResource.aspx?Edit=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n );\r\n case 'ServiceRelated':\r\n return toRootedURL(\r\n `/OfflineServiceType.aspx?ID=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n );\r\n case 'RequestRelated':\r\n return toRootedURL(\r\n `/SampleType.aspx?ID=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n );\r\n case 'ServiceGroup':\r\n return toRootedURL(`/newgroup.aspx?edit=${serviceGroupId}`);\r\n case 'SuperGroup':\r\n return toRootedURL(`/newsupergroup.aspx?edit=${divisionId}`);\r\n default:\r\n return undefined;\r\n }\r\n};\r\n","import { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport * as React from 'react';\r\nimport { ExternalLink, Link } from 'app/components/ExternalLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport {\r\n ArrayRenderer,\r\n AssetDetailsImageRender,\r\n DateRenderer,\r\n HtmlRenderer,\r\n UsersRenderer,\r\n} from './AttributeRenderers';\r\nimport { AssetRowState, IAssetRow } from './IAssetRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { getAssetImageSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { AssetLocationLastUpdate } from './AssetLocationLastUpdate';\r\nimport { DoubleRender } from 'app/components/BasicTable/components/DoubleRenderer';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Tooltip } from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IAssetAssemblyStructure } from './IAssetAssemblyStructure';\r\nimport { AssetComments } from './components/AssetComments';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetsSelectionProps } from '../MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from '../MyAssetsPage/IMyAssetsRow';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { getAssetEditLink } from './getAssetEditLink';\r\nimport { AssetLink } from './OpenAssetDetails';\r\nimport { Skeleton } from '@material-ui/lab';\r\n\r\nexport const getRows = (\r\n t: TFunction,\r\n setting: GlobalSettings,\r\n openPanel: (state: SidePanelOpenState) => void,\r\n publicUrl?: string,\r\n isCover?: boolean,\r\n useSidePanel?: boolean,\r\n // setCover?: Dispatch>,\r\n isAdmin?: boolean,\r\n isMobile?: boolean,\r\n isAuthenticated?: boolean,\r\n): IAssetRow[] => {\r\n return [\r\n {\r\n Id: 'ImageName',\r\n PropName: 'ImageName',\r\n Name: t(translations.Image) as string,\r\n Cell: ({ value, original }) =>\r\n !!value &&\r\n AssetDetailsImageRender({\r\n value: getAssetImageSrc(\r\n value,\r\n undefined,\r\n (setting.GetNullableByKey(AllowedSettings.AssetImageSizeType) ??\r\n '2') === '1' && !isMobile\r\n ? '/images/400x300.png'\r\n : '/images/200x150.png',\r\n ),\r\n original: original,\r\n shortView: isMobile,\r\n }),\r\n\r\n // \r\n NoHeader: true,\r\n validToRender: ({ value }) => !!value,\r\n },\r\n {\r\n Id: 'ServiceGroup',\r\n Name: t(translations.ServiceGroup) as string,\r\n Cell: ({ value, original }) => {\r\n const editLink = getAssetEditLink(\r\n 'ServiceGroup',\r\n original.Id,\r\n original.ServiceId ?? undefined,\r\n original.ServiceGroup?.Id ?? undefined,\r\n original.ServiceGroup?.DivisionId ?? undefined,\r\n );\r\n return (\r\n \r\n openPanel({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: {\r\n identifier: {\r\n id: original.ServiceGroup.AssetId ?? undefined,\r\n },\r\n useSidePanel: true,\r\n },\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n })\r\n }\r\n >\r\n {value.Name}\r\n \r\n );\r\n },\r\n // Cell: ({ value, original }) => {\r\n // const editLink = getAssetEditLink(\r\n // 'ServiceGroup',\r\n // original.Id,\r\n // original.ServiceId ?? undefined,\r\n // original.ServiceGroup?.Id ?? undefined,\r\n // original.ServiceGroup?.DivisionId ?? undefined,\r\n // );\r\n // if (editLink !== undefined) {\r\n // return (\r\n // \r\n // {value.Name}\r\n // \r\n // );\r\n // }\r\n // },\r\n },\r\n {\r\n Id: 'AvailabilityType',\r\n PropName: 'AvailabilityType',\r\n Name: t(translations.Availability),\r\n Cell: ({ value, original }) => {\r\n return (\r\n \r\n {original.ApprovalRequired ? (\r\n \r\n {`${value.Name} - ${t(translations.ApprovalRequired)}`}\r\n \r\n ) : (\r\n {value.Name}\r\n )}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Id: 'ForceTutoring',\r\n Name: t(translations.TrainingMandatory) as string,\r\n validToRender: ({ value, original }) =>\r\n value === true && original.NotAllowReservations === false,\r\n Cell: ({ value }) => {\r\n return (\r\n \r\n {t(translations.ApprovalRequired)}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Id: 'minorder',\r\n Name: t(translations.MinimumReservationDurationH) as string,\r\n validToRender: ({ value, original }) =>\r\n !!value && value > 0 && original.NotAllowReservations === false,\r\n Cell: DoubleRender,\r\n },\r\n {\r\n Id: 'maxorder',\r\n Name: t(translations.MaximumReservationDurationH) as string,\r\n validToRender: ({ value, original }) =>\r\n !!value && value > 0 && original.NotAllowReservations === false,\r\n Cell: DoubleRender,\r\n },\r\n {\r\n Id: 'ReservationMinimumGap',\r\n Name: t(translations.ReservationMinimumGap) as string,\r\n validToRender: ({ value, original }) =>\r\n !!value && value > 0 && original.NotAllowReservations === false,\r\n Cell: DoubleRender,\r\n },\r\n {\r\n Id: 'CarryOverTimeSlotTypeId',\r\n Name: t(translations.CarryOverTimeSlotGap) as string,\r\n validToRender: ({ value, original }) =>\r\n !!value &&\r\n value !== null &&\r\n value > 0 &&\r\n original.NotAllowReservations === false,\r\n Cell: ({ value, original }) => {\r\n return (\r\n <>{`${original.CarryOverTimeSlotGap} hours over timeslot ${original.CarryOverTimeSlotTypeName}`}\r\n );\r\n },\r\n dependencies: ['CarryOverTimeSlotGap', 'CarryOverTimeSlotTypeName'],\r\n },\r\n // {\r\n // Id: 'MinimumTimeAhead',\r\n // Name: t(translations.MinimumTimeAhead) as string,\r\n // validToRender: ({ value, original }) => {\r\n // return (\r\n // original.ReservationEnabled &&\r\n // ((original.MinTimeAheadPeriodType !== undefined &&\r\n // !!original.MinTimeAheadPeriodValue) ||\r\n // !!original.MinTimeAheadMinutesSinceMidnight)\r\n // );\r\n // },\r\n // Cell: ({ value, original }) => {\r\n // let results = '';\r\n // if (!!original.MinTimeAheadPeriodValue) {\r\n // results = `${t(\r\n // translations.Before,\r\n // )}: ${original.MinTimeAheadPeriodValue.toFixed(2)}\r\n // ${(t(translations.AdvancedReservation) as string).replace(\r\n // '{0}',\r\n // enumToEntityArray(MinTimeAheadPeriodTypes).filter(\r\n // f => f.Id === original.MinTimeAheadPeriodType,\r\n // )[0].Name,\r\n // )}`;\r\n // } else if (!!original.MinTimeAheadMinutesSinceMidnight) {\r\n // results = `${t(translations.OnTheSameDay)}: ${(t(\r\n // translations.ToBeBookedBy,\r\n // ) as string).replace(\r\n // '{0}',\r\n // dateUtils.dateFnsUtils.format(\r\n // new Date(0, 0, 0, 0, original.MinTimeAheadMinutesSinceMidnight),\r\n // dateUtils.DateIOFormats.fullDateTime24h,\r\n // ),\r\n // )}`;\r\n // }\r\n // if (results !== '') {\r\n // return (\r\n // \r\n // {results}\r\n // \r\n // \r\n // \r\n // \r\n // \r\n // \r\n // );\r\n // }\r\n // },\r\n // },\r\n // {\r\n // Id: 'RestrictedReservationsOption',\r\n // Name: t(translations.InstrumentRestrictions) as string,\r\n // validToRender: ({ value, original }) => {\r\n // return (\r\n // (value !== null &&\r\n // value !== (RestrictedReservationsOptions.NoLimitations as number) &&\r\n // original.ReservationEnabled &&\r\n // original.ServiceType === 'Online' &&\r\n // !setting.GetBooleanByKey(\r\n // AllowedSettings.HideInstrumentRestrictions,\r\n // ) &&\r\n // original.AssemblyId === null) ||\r\n // original.PrerequisiteEquipments?.length > 0\r\n // );\r\n // },\r\n // //dependencies: ['PrerequisiteEquipments'],\r\n // Cell: ({ value, original }) => {\r\n // return (\r\n // \r\n // \r\n // !!setCover &&\r\n // setCover(() => {\r\n // return (\r\n // setCover(undefined)}\r\n // onClose={() => setCover(undefined)}\r\n // />\r\n // );\r\n // })\r\n // }\r\n // >\r\n // {t(translations.CheckTrainingStatus)}\r\n // \r\n // \r\n // );\r\n // },\r\n // },\r\n {\r\n Id: 'Division',\r\n Name: t(translations.AssetsInstituteBusiness) as string,\r\n Cell: ({ original }) => original.ServiceGroup.DivisionName,\r\n },\r\n {\r\n Id: 'AssetAccessories',\r\n Name: t(translations.Accessories) as string,\r\n Cell: ArrayRenderer>(v => <>{v.Name}),\r\n },\r\n {\r\n Id: 'AssetCatGroup',\r\n Name: t(translations.AssetCatGroupName) as string,\r\n Cell: ({ value, original }) => {\r\n if (\r\n !!value &&\r\n setting.GetBooleanByKey(AllowedSettings.AssetCatEnabled)\r\n ) {\r\n return (\r\n
    \r\n {value}\r\n {isAuthenticated && (\r\n \r\n \r\n {\r\n let setProps = {\r\n useSidePanel: true,\r\n actionType: 'AssetSearch',\r\n assetCatGroupId: original.AssetCat.GroupId,\r\n customPredicates: [\r\n `${new Condition(\r\n 'AssetCatGroupId',\r\n ODataOperators.Equals,\r\n original.AssetCat.GroupId,\r\n ).toString()}`,\r\n ],\r\n hideCoresToggle: true,\r\n } as AssetsSelectionProps;\r\n\r\n openPanel({\r\n renderPageType: RenderPageType.AssetsSelection,\r\n renderPageProps: setProps,\r\n expanded: !useSidePanel,\r\n isCover: isCover,\r\n useSidePanel: !isCover,\r\n } as SidePanelOpenState);\r\n }}\r\n // onClick={() =>\r\n // window.open(\r\n // toRootedURL(\r\n // '/AssetSearch?active=true&AssetCatGroupId=' +\r\n // original.AssetCat.GroupId,\r\n // ),\r\n // '_blank',\r\n // )\r\n // }\r\n >\r\n \r\n \r\n \r\n \r\n )}\r\n
    \r\n );\r\n }\r\n },\r\n },\r\n {\r\n Id: 'AssetCat',\r\n Name: t(translations.AssetCategory) as string,\r\n PropName: 'AssetCat',\r\n validToRender: ({ value }) => {\r\n return (\r\n !!value && setting.GetBooleanByKey(AllowedSettings.AssetCatEnabled)\r\n );\r\n },\r\n Cell: ({ original }) => {\r\n return (\r\n
    \r\n {original.AssetCat.Name}\r\n\r\n <>\r\n {!!original.AssetCat.InternalServiceAvaliable && (\r\n <>{t(translations.InternalServiceAvaliable)}\r\n )}\r\n \r\n {isAuthenticated && (\r\n \r\n \r\n {\r\n let setProps = {\r\n useSidePanel: true,\r\n actionType: 'AssetSearch',\r\n assetCatId: original.AssetCat.Id,\r\n customPredicates: [\r\n `${new Condition(\r\n 'AssetCatId',\r\n ODataOperators.Equals,\r\n original.AssetCat.Id,\r\n ).toString()}`,\r\n ],\r\n hideCoresToggle: true,\r\n } as AssetsSelectionProps;\r\n\r\n openPanel({\r\n renderPageType: RenderPageType.AssetsSelection,\r\n renderPageProps: setProps,\r\n expanded: !useSidePanel,\r\n isCover: isCover,\r\n useSidePanel: !isCover,\r\n } as SidePanelOpenState);\r\n }}\r\n // onClick={() =>\r\n // window.open(\r\n // toRootedURL(\r\n // '/AssetSearch?active=true&AssetCatId=' +\r\n // original.AssetCat.Id,\r\n // ),\r\n // '_blank',\r\n // )\r\n // }\r\n >\r\n \r\n \r\n \r\n \r\n )}\r\n
    \r\n );\r\n },\r\n },\r\n {\r\n Id: 'NickName',\r\n Name: t(translations.NickName) as string,\r\n },\r\n {\r\n Id: 'OtherNames',\r\n Name: t(translations.OtherNames) as string,\r\n },\r\n {\r\n Id: 'Brand',\r\n Name: t(translations.Brand),\r\n },\r\n {\r\n Id: 'Model',\r\n Name: t(translations.Model) as string,\r\n },\r\n {\r\n Id: 'ModelID',\r\n Name: t(translations.Model) as string,\r\n validToRender: ({ value }) => !!value,\r\n Cell: ({ original, value }) => (\r\n \r\n {value}\r\n \r\n ),\r\n },\r\n {\r\n Id: 'ModelNumber',\r\n Name: t(translations.ModelNumber) as string,\r\n },\r\n {\r\n Id: 'Campus',\r\n Name: t(translations.Campus) as string,\r\n validToRender: ({ value, original }) => !!value && value !== null,\r\n Cell: ({ value }) => {value.Name},\r\n },\r\n {\r\n Id: 'Building',\r\n Name: t(translations.Building) as string,\r\n },\r\n {\r\n Id: 'Room',\r\n Name: t(translations.RoomNumber) as string,\r\n validToRender: ({ value, original }) => !!value,\r\n Cell: ({ value, original }) => (\r\n <>\r\n {!!value && <>{value}}\r\n {isAdmin === true && (\r\n \r\n )}\r\n \r\n ),\r\n },\r\n {\r\n Id: 'LocationsList',\r\n Name: t(translations.LocationsList) as string,\r\n PropName: 'LocationsList',\r\n },\r\n {\r\n Id: 'SubLocationName',\r\n Name: t(translations.LocationsList) as string,\r\n PropName: 'SubLocationsList',\r\n },\r\n {\r\n Id: 'Experts',\r\n Name: t(translations.EquipmentExpert) as string,\r\n validToRender: ({ value }) => !!value && value.length > 0,\r\n Cell: UsersRenderer(),\r\n },\r\n {\r\n Id: 'Contacts',\r\n Name: t(translations.ContactsPersonForEquipment) as string,\r\n validToRender: ({ value }) => !!value && value.length > 0,\r\n Cell: UsersRenderer(),\r\n },\r\n {\r\n Id: 'Suppliers',\r\n Name: t(translations.ExternalCompany) as string,\r\n validToRender: ({ value }) => !!value && value.length > 0,\r\n Cell: ArrayRenderer>(v => <>{v.Name}),\r\n },\r\n {\r\n Id: 'MainSpecRange',\r\n Name: t(translations.MainSpecificationRange) as string,\r\n },\r\n {\r\n Id: 'ElectricalSpecs',\r\n Name: t(translations.ElectricalSpecs) as string,\r\n },\r\n {\r\n Id: 'FunctionalCharacteristics',\r\n Name: t(translations.FunctionalCharacteristics) as string,\r\n },\r\n {\r\n Id: 'Description',\r\n Name: t(translations.Description) as string,\r\n Cell: HtmlRenderer,\r\n },\r\n {\r\n Id: 'WebLink',\r\n Name: t(translations.WebLink) as string,\r\n Cell: ({ value }) => value && {value},\r\n },\r\n {\r\n Id: 'Raac',\r\n Name: t(translations.RoutineActiveAnalysisCapable) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'Tags',\r\n Name: t(translations.Tags) as string,\r\n validToRender: ({ value }) => !!value && value.length > 0,\r\n Cell: ArrayRenderer>(v => <>{v.Name}),\r\n },\r\n {\r\n Id: 'ExtraDate0',\r\n Name: t(translations.Asset_ExtraDate0) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate1',\r\n Name: t(translations.Asset_ExtraDate1) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate2',\r\n Name: t(translations.Asset_ExtraDate2) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate3',\r\n Name: t(translations.Asset_ExtraDate3) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate4',\r\n Name: t(translations.Asset_ExtraDate4) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate5',\r\n Name: t(translations.Asset_ExtraDate5) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate6',\r\n Name: t(translations.Asset_ExtraDate6) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate7',\r\n Name: t(translations.Asset_ExtraDate7) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate8',\r\n Name: t(translations.Asset_ExtraDate8) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraDate9',\r\n Name: t(translations.Asset_ExtraDate9) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'ExtraText0',\r\n Name: t(translations.Asset_ExtraText0) as string,\r\n },\r\n {\r\n Id: 'ExtraText1',\r\n Name: t(translations.Asset_ExtraText1) as string,\r\n },\r\n {\r\n Id: 'ExtraText2',\r\n Name: t(translations.Asset_ExtraText2) as string,\r\n },\r\n {\r\n Id: 'ExtraText3',\r\n Name: t(translations.Asset_ExtraText3) as string,\r\n },\r\n {\r\n Id: 'ExtraText4',\r\n Name: t(translations.Asset_ExtraText4) as string,\r\n },\r\n {\r\n Id: 'ExtraText5',\r\n Name: t(translations.Asset_ExtraText5) as string,\r\n },\r\n {\r\n Id: 'ExtraText6',\r\n Name: t(translations.Asset_ExtraText6) as string,\r\n },\r\n {\r\n Id: 'ExtraText7',\r\n Name: t(translations.Asset_ExtraText7) as string,\r\n },\r\n {\r\n Id: 'ExtraText8',\r\n Name: t(translations.Asset_ExtraText8) as string,\r\n },\r\n {\r\n Id: 'ExtraText9',\r\n Name: t(translations.Asset_ExtraText9) as string,\r\n },\r\n {\r\n Id: 'ExtraText10',\r\n Name: t(translations.Asset_ExtraText10) as string,\r\n },\r\n {\r\n Id: 'ExtraText11',\r\n Name: t(translations.Asset_ExtraText11) as string,\r\n },\r\n {\r\n Id: 'ExtraText12',\r\n Name: t(translations.Asset_ExtraText12) as string,\r\n },\r\n {\r\n Id: 'ExtraText13',\r\n Name: t(translations.Asset_ExtraText13) as string,\r\n },\r\n {\r\n Id: 'ExtraText14',\r\n Name: t(translations.Asset_ExtraText14) as string,\r\n },\r\n {\r\n Id: 'ExtraText15',\r\n Name: t(translations.Asset_ExtraText15) as string,\r\n },\r\n {\r\n Id: 'ExtraInt0',\r\n Name: t(translations.Asset_ExtraInt0) as string,\r\n },\r\n {\r\n Id: 'ExtraInt1',\r\n Name: t(translations.Asset_ExtraInt1) as string,\r\n },\r\n {\r\n Id: 'ExtraInt2',\r\n Name: t(translations.Asset_ExtraInt2) as string,\r\n },\r\n {\r\n Id: 'ExtraInt3',\r\n Name: t(translations.Asset_ExtraInt3) as string,\r\n },\r\n {\r\n Id: 'ExtraInt4',\r\n Name: t(translations.Asset_ExtraInt4) as string,\r\n },\r\n {\r\n Id: 'ExtraDec0',\r\n Name: t(translations.Asset_ExtraDec0) as string,\r\n },\r\n {\r\n Id: 'ExtraDec1',\r\n Name: t(translations.Asset_ExtraDec1) as string,\r\n },\r\n {\r\n Id: 'ExtraDec2',\r\n Name: t(translations.Asset_ExtraDec2) as string,\r\n },\r\n {\r\n Id: 'ExtraDec3',\r\n Name: t(translations.Asset_ExtraDec3) as string,\r\n },\r\n {\r\n Id: 'ExtraDec4',\r\n Name: t(translations.Asset_ExtraDec4) as string,\r\n },\r\n {\r\n Id: 'ExtraBool0',\r\n Name: t(translations.Asset_ExtraBool0) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'ExtraBool1',\r\n Name: t(translations.Asset_ExtraBool1) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'ExtraBool2',\r\n Name: t(translations.Asset_ExtraBool2) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'ExtraBool3',\r\n Name: t(translations.Asset_ExtraBool3) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'ExtraBool4',\r\n Name: t(translations.Asset_ExtraBool4) as string,\r\n Cell: BooleanRender,\r\n },\r\n {\r\n Id: 'ExtraUrl0',\r\n Name: t(translations.Asset_ExtraUrl0) as string,\r\n },\r\n {\r\n Id: 'ExtraUrl1',\r\n Name: t(translations.Asset_ExtraUrl1) as string,\r\n },\r\n {\r\n Id: 'ExtraUrl2',\r\n Name: t(translations.Asset_ExtraUrl2) as string,\r\n },\r\n {\r\n Id: 'ExtraUrl3',\r\n Name: t(translations.Asset_ExtraUrl3) as string,\r\n },\r\n {\r\n Id: 'ExtraUrl4',\r\n Name: t(translations.Asset_ExtraUrl4) as string,\r\n },\r\n {\r\n Id: 'ExtraRichText0',\r\n Name: t(translations.Asset_ExtraRichText0) as string,\r\n },\r\n {\r\n Id: 'ExtraRichText1',\r\n Name: t(translations.Asset_ExtraRichText1) as string,\r\n },\r\n {\r\n Id: 'ExtraRichText2',\r\n Name: t(translations.Asset_ExtraRichText2) as string,\r\n },\r\n {\r\n Id: 'ExtraRichText3',\r\n Name: t(translations.Asset_ExtraRichText3) as string,\r\n },\r\n {\r\n Id: 'ExtraRichText4',\r\n Name: t(translations.Asset_ExtraRichText4) as string,\r\n },\r\n {\r\n Id: 'ExtraDDL0',\r\n Name: t(translations.Asset_ExtraDDL0) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL0?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL1',\r\n Name: t(translations.Asset_ExtraDDL1) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL1?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL2',\r\n Name: t(translations.Asset_ExtraDDL2) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL2?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL3',\r\n Name: t(translations.Asset_ExtraDDL3) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL3?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL4',\r\n Name: t(translations.Asset_ExtraDDL4) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL4?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL5',\r\n Name: t(translations.Asset_ExtraDDL5) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL5?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL6',\r\n Name: t(translations.Asset_ExtraDDL6) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL6?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL7',\r\n Name: t(translations.Asset_ExtraDDL7) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL7?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL8',\r\n Name: t(translations.Asset_ExtraDDL8) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL8?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL9',\r\n Name: t(translations.Asset_ExtraDDL9) as string,\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL9?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL10',\r\n Name: t(translations.Asset_ExtraDDL10) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL10?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL11',\r\n Name: t(translations.Asset_ExtraDDL11) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL11?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL12',\r\n Name: t(translations.Asset_ExtraDDL12) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL12?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL13',\r\n Name: t(translations.Asset_ExtraDDL13) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL13?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL14',\r\n Name: t(translations.Asset_ExtraDDL14) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL14?.Name},\r\n },\r\n {\r\n Id: 'ExtraDDL15',\r\n Name: t(translations.Asset_ExtraDDL15) as string,\r\n Cell: ({ value, original }) =>\r\n !!value && <>{original.ExtraDDL15?.Name},\r\n },\r\n {\r\n Id: 'BrandCode',\r\n Name: t(translations.BrandBarcodeNumber) as string,\r\n },\r\n {\r\n Id: 'ServiceContract',\r\n Name: t(translations.ServiceContract) as string,\r\n },\r\n {\r\n Id: 'POnumber',\r\n Name: t(translations.PurchaseOrder) as string,\r\n },\r\n {\r\n Id: 'WarrantyEndDate',\r\n Name: t(translations.WarrantyEndDate) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Id: 'LifeDate',\r\n Name: t(translations.LifeDateView) as string,\r\n validToRender: ({ value }) => !!value,\r\n Cell: ({ value, original }) =>\r\n value !== null && <>{dateUtils.formatDistanceToNow(value)},\r\n },\r\n {\r\n Id: 'ExportLicense',\r\n Name: t(translations.ExportLicense) as string,\r\n },\r\n {\r\n Id: 'InternalCode',\r\n Name: t(translations.InternalEquipmentBarcodeNumber) as string,\r\n },\r\n {\r\n Id: 'AccountingId',\r\n Name: t(translations.AccountingId) as string,\r\n },\r\n {\r\n Id: 'Active',\r\n Name: t(translations.Active) as string,\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Id: 'Details',\r\n Name: t(translations.AssetDetails) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetDetails')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'Classification',\r\n Name: t(translations.AssetClassification) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetClassification')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'Location',\r\n Name: t(translations.AssetLocation) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetLocation')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'SectionContacts',\r\n Name: t(translations.AssetContacts) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetContacts')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'Identifiers',\r\n Name: t(translations.AssetIdentifiers) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetIdentifiers')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'AdditionalInfo',\r\n Name: t(translations.AssetAdditionalInfo) as string,\r\n State: AssetRowState.SectionName,\r\n Cell: ({ value, original }) => (\r\n

    \r\n {t('AssetAdditionalInfo')}\r\n

    \r\n ),\r\n },\r\n {\r\n Id: 'SectionLabel7',\r\n Name: t(translations.AssetSectionLabel7) as string,\r\n State: AssetRowState.SectionName,\r\n },\r\n {\r\n Id: 'SectionLabel8',\r\n Name: t(translations.AssetSectionLabel8) as string,\r\n State: AssetRowState.SectionName,\r\n },\r\n {\r\n Id: 'SectionLabel9',\r\n Name: t(translations.AssetSectionLabel9) as string,\r\n State: AssetRowState.SectionName,\r\n },\r\n {\r\n Id: 'SectionLabel10',\r\n Name: t(translations.AssetSectionLabel10) as string,\r\n State: AssetRowState.SectionName,\r\n },\r\n {\r\n Id: 'DOI',\r\n Name: t(translations.Doi) as string,\r\n Cell: ({ value, original }) => {\r\n const doiURL = `https://doi.org/${value}`;\r\n return (\r\n \r\n \r\n \r\n {value}\r\n \r\n \r\n \r\n );\r\n },\r\n },\r\n {\r\n Id: 'Status',\r\n Name: t(translations.Status) as string,\r\n Cell: ({ value, original }) => {\r\n let color = bookitColors.base.black;\r\n let backgroundColor = bookitColors.base.white;\r\n switch (original.StatusId) {\r\n case 1:\r\n color = bookitColors.success.dark;\r\n backgroundColor = bookitColors.success.background;\r\n break;\r\n case 2:\r\n color = bookitColors.warning.dark;\r\n backgroundColor = bookitColors.warning.background;\r\n break;\r\n case 3:\r\n color = bookitColors.danger.dark;\r\n backgroundColor = bookitColors.danger.background;\r\n break;\r\n default:\r\n color = bookitColors.base.black;\r\n backgroundColor = bookitColors.base.white;\r\n }\r\n const RenderStatus = (props: {}) => {\r\n return (\r\n <>\r\n \r\n {value !== ' ' ? (\r\n <>{value}\r\n ) : (\r\n \r\n )}\r\n \r\n }\r\n custombgcolor={backgroundColor}\r\n customcolor={color}\r\n shape=\"squar\"\r\n key={'status'}\r\n notremoved={true}\r\n />\r\n \r\n );\r\n };\r\n return ;\r\n },\r\n },\r\n {\r\n Id: 'AssetAssemblyStructure',\r\n Name: t(translations.AssemblyStructure) as string,\r\n Cell: ({ value, original }) => {\r\n const AssetDetailsLink = (props: { name: string; id: number }) => {\r\n // const history = useHistory();\r\n // const dispatch = useDispatch();\r\n // const { actions: layoutActions } = useLayoutSlice();\r\n return (\r\n \r\n {props.name}\r\n \r\n // {\r\n // history.push(`/Assets/Details?id=${props.id}`);\r\n // dispatch(layoutActions.resetSidePanel());\r\n // }}\r\n // >\r\n // {props.name}\r\n // \r\n );\r\n };\r\n const renderItem = (item: IAssetAssemblyStructure) => {\r\n if (item.Children.length > 0) {\r\n let res: React.ReactNode[] = [];\r\n for (const v of item.Children) {\r\n res.push(\r\n
  • \r\n \r\n {v.Name}\r\n \r\n
  • ,\r\n );\r\n let childRes = renderItem(v);\r\n if (childRes !== undefined && childRes.length > 0) {\r\n res.push(\r\n
      {childRes.map((v, i) => v)}
    ,\r\n );\r\n }\r\n }\r\n return res;\r\n } else return undefined;\r\n };\r\n return (\r\n <>\r\n
  • \r\n \r\n
  • \r\n
      {renderItem(value)}
    \r\n \r\n );\r\n },\r\n },\r\n {\r\n Id: 'Range',\r\n Name: t(translations.Range) as string,\r\n Cell: ({ value, original }) => {\r\n return (\r\n <>\r\n {value.map(v => {\r\n if (v.MinValue !== undefined) {\r\n if (v.MaxValue !== undefined) {\r\n return (\r\n
    \r\n {v.MinValue} {' - '}\r\n {v.MaxValue} {' '}\r\n {v.UnitTypeName}\r\n
    \r\n );\r\n } else {\r\n return (\r\n
    \r\n {v.MinValue} {' '}\r\n {v.UnitTypeName} {'(Min)'}\r\n
    \r\n );\r\n }\r\n } else {\r\n if (v.MaxValue !== undefined) {\r\n return (\r\n
    \r\n {v.MaxValue} {' '}\r\n {v.UnitTypeName} {'(Max)'}\r\n
    \r\n );\r\n } else {\r\n return <>;\r\n }\r\n }\r\n })}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Id: 'Comments',\r\n Name: t(translations.CommentsAndAttachments) as string,\r\n validToRender: val => {\r\n return (\r\n isAuthenticated === true &&\r\n (!val.original.CommentsAreStaffonly || !!isAdmin)\r\n );\r\n },\r\n State: AssetRowState.Mandatory,\r\n Cell(value) {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n // stub, could be used when full screen asset details will be migrated to react https://prog4biz.atlassian.net/browse/BKT-6902\r\n // {\r\n // Id: 'Articles',\r\n // PropName: 'Articles',\r\n // Name: t(translations.RelatedPublications),\r\n // Cell: ({ value }: { value?: IArticleDto[] }) => {\r\n // return ;\r\n // },\r\n // },\r\n ];\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nimport { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport {\r\n AvailabilityTypes,\r\n AvailabilityTypesUnion,\r\n} from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { AutoMode } from 'enums/GlobalEnums';\r\nimport { ServiceTypeUnion } from 'enums/ServiceTypes';\r\nimport { IAsset } from '../IAsset';\r\nimport { AssetRowState, IAssetRow } from '../IAssetRow';\r\nimport {\r\n AssetDetailsAdditionalData,\r\n RawSection,\r\n Section,\r\n Sections,\r\n} from './types';\r\n\r\nexport const isBookable = (availabilityType?: AvailabilityTypesUnion) => {\r\n if (availabilityType === undefined) {\r\n return false;\r\n }\r\n const bookable: AvailabilityTypesUnion[] = [\r\n 'FreelyBookable',\r\n 'LectureRoom',\r\n 'LoanableEquipment',\r\n 'TrainingProgram',\r\n ];\r\n return bookable.includes(availabilityType);\r\n};\r\nexport const isOnlineService = (availabilityType?: AvailabilityTypesUnion) => {\r\n if (availabilityType === undefined) {\r\n return false;\r\n }\r\n const notOnline: AvailabilityTypesUnion[] = [\r\n 'ServiceGroup',\r\n 'ServiceRelated',\r\n 'RequestRelated',\r\n 'SuperGroup',\r\n ];\r\n return !notOnline.includes(availabilityType);\r\n};\r\nexport function removeArrayItem(target, id: string) {\r\n const ri = target.findIndex(v => v.Id === id);\r\n if (ri >= 0) {\r\n const rows = target.splice(ri, 1);\r\n return rows[0];\r\n } else return null;\r\n}\r\nexport function moveArrayItem(target, id: string, pos: number) {\r\n const ri = target.findIndex(v => v.Id === id);\r\n if (pos < target.length && ri >= 0 && pos !== ri) {\r\n const row = target.splice(ri, 1);\r\n target.splice(pos, 0, row[0]);\r\n }\r\n}\r\nexport function moveArrayItemToEnd(target, id: string) {\r\n const ri = target.findIndex(v => v.Id === id);\r\n if (ri >= 0) {\r\n const row = target.splice(ri, 1);\r\n target.splice(target.length, 0, row[0]);\r\n }\r\n}\r\nexport function moveArrayItemByName(target, id: string, name: string) {\r\n if (id !== name) {\r\n const ri = target.findIndex(v => v.Id === id);\r\n if (ri >= 0) {\r\n const rn = target.findIndex(v => v.Id === name);\r\n if (rn >= 0) {\r\n const row = target.splice(ri, 1);\r\n if (rn < ri) {\r\n target.splice(rn + 1, 0, row[0]);\r\n } else {\r\n target.splice(rn, 0, row[0]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nexport function addArrayItemByName(target, id: string, name: string) {\r\n const ri = target.findIndex(v => v.Id === id);\r\n if (ri < 0) {\r\n const rn = target.findIndex(v => v.Id === name);\r\n if (rn > 0) {\r\n target.splice(rn + 1, 0, {\r\n Id: id,\r\n Visible: true,\r\n });\r\n } else {\r\n target.unshift({\r\n Id: id,\r\n Visible: true,\r\n });\r\n }\r\n }\r\n}\r\nexport function moveArrayItemByKey(target, key: string, pos: number) {\r\n const ri = target.findIndex(v => v.key === key);\r\n if (pos < target.length && ri >= 0 && pos !== ri) {\r\n const row = target.splice(ri, 1);\r\n target.splice(pos, 0, row[0]);\r\n }\r\n}\r\n\r\nexport function GetReservationEnabled(\r\n availabilityType: AvailabilityTypes,\r\n active: boolean,\r\n notAllowReservations: boolean,\r\n) {\r\n let reservationEnabled: boolean = false;\r\n switch (availabilityType) {\r\n case AvailabilityTypes.FreelyBookable:\r\n case AvailabilityTypes.LoanableEquipment:\r\n case AvailabilityTypes.LectureRoom:\r\n reservationEnabled = notAllowReservations === false && active === true;\r\n break;\r\n case AvailabilityTypes.TrainingProgram:\r\n reservationEnabled = active === true;\r\n break;\r\n case AvailabilityTypes.ServiceRelated:\r\n case AvailabilityTypes.ServiceGroup:\r\n case AvailabilityTypes.SuperGroup:\r\n case AvailabilityTypes.NotAvailable:\r\n case AvailabilityTypes.AvailableNotBookable:\r\n default:\r\n reservationEnabled = false;\r\n break;\r\n }\r\n return reservationEnabled;\r\n}\r\n\r\nexport function GetUsageEnabled(\r\n availabilityType: AvailabilityTypes,\r\n active: boolean,\r\n autoMode?: number,\r\n) {\r\n var result: boolean = autoMode === AutoMode?.LocalAppEnabled;\r\n switch (availabilityType) {\r\n case AvailabilityTypes.FreelyBookable:\r\n case AvailabilityTypes.TrainingProgram:\r\n case AvailabilityTypes.LoanableEquipment:\r\n case AvailabilityTypes.LectureRoom:\r\n result = result && active === true;\r\n break;\r\n case AvailabilityTypes.ServiceRelated:\r\n case AvailabilityTypes.ServiceGroup:\r\n case AvailabilityTypes.SuperGroup:\r\n case AvailabilityTypes.NotAvailable:\r\n case AvailabilityTypes.AvailableNotBookable:\r\n default:\r\n result = result && false;\r\n break;\r\n }\r\n return result;\r\n}\r\n\r\nexport function GetAlertsEnabled(\r\n availabilityType: AvailabilityTypes,\r\n active: boolean,\r\n) {\r\n let alertsEnabled: boolean = false;\r\n switch (availabilityType) {\r\n case AvailabilityTypes.FreelyBookable:\r\n case AvailabilityTypes.LoanableEquipment:\r\n case AvailabilityTypes.LectureRoom:\r\n case AvailabilityTypes.TrainingProgram:\r\n case AvailabilityTypes.NotAvailable:\r\n case AvailabilityTypes.AvailableNotBookable:\r\n alertsEnabled = active === true;\r\n break;\r\n case AvailabilityTypes.ServiceGroup:\r\n case AvailabilityTypes.SuperGroup:\r\n case AvailabilityTypes.ServiceRelated:\r\n case AvailabilityTypes.RequestRelated:\r\n default:\r\n alertsEnabled = false;\r\n break;\r\n }\r\n return alertsEnabled;\r\n}\r\nexport const isValid = (row: IAssetRow, data: IAsset) => {\r\n if (\r\n row.State === AssetRowState.SectionName ||\r\n row.State === AssetRowState.Mandatory\r\n ) {\r\n return true;\r\n }\r\n const value = data![row.PropName ?? row.Id];\r\n if (value !== null && value !== undefined && value !== '') {\r\n if (Array.isArray(value)) {\r\n return value.length > 0;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n};\r\nexport function GetValidRos(rows: IAssetRow[], data: IAsset): IAssetRow[] {\r\n return rows.filter(row => isValid(row, data));\r\n}\r\nexport function RemoveLastEmptySections(rows: IAssetRow[]) {\r\n if (rows.length > 0) {\r\n if (rows[rows.length - 1].State === AssetRowState.SectionName) {\r\n do {\r\n rows.pop();\r\n } while (\r\n rows.length > 0 &&\r\n rows[rows.length - 1].State === AssetRowState.SectionName\r\n );\r\n }\r\n }\r\n return rows;\r\n}\r\n\r\nexport function GetRawSections(rows: IAssetRow[]): RawSection[] {\r\n const sections: RawSection[] = rows\r\n .map((r, index) => {\r\n return {\r\n Id: r.Id,\r\n Index: index,\r\n SectionName: r.State === AssetRowState.SectionName,\r\n remove: false,\r\n };\r\n })\r\n .filter(f => f.SectionName);\r\n return sections;\r\n}\r\nexport function CheckEmptyRawSections(sections: RawSection[]) {\r\n if (sections.length > 1) {\r\n for (let i = 0; i < sections.length - 1; i++) {\r\n const s = sections[i];\r\n const s1 = sections[i + 1];\r\n if (s1.Index - s.Index === 1) {\r\n s.remove = true;\r\n }\r\n }\r\n }\r\n}\r\nexport function RemoveEmptySections(sections: RawSection[], rows: IAssetRow[]) {\r\n for (let i = 0; i < sections.length - 1; i++) {\r\n const s = sections[i];\r\n if (s.remove) {\r\n const ri = rows.findIndex(v => v.Id === s.Id);\r\n rows.splice(ri, 1);\r\n }\r\n }\r\n}\r\n\r\nexport function GetSections(rows: IAssetRow[]): Section[] {\r\n const noNameSection: Section = { Id: '', row: {} as IAssetRow, rows: [] };\r\n const sections: Section[] = [];\r\n let section: number = -1;\r\n for (let r of rows) {\r\n if (r.State === AssetRowState.SectionName) {\r\n section++;\r\n sections.push({\r\n Id: r.Id,\r\n Index: -1,\r\n row: r,\r\n rows: [],\r\n } as Section);\r\n } else {\r\n if (section >= 0) {\r\n sections[section].rows.push(r);\r\n } else {\r\n noNameSection.rows.push(r);\r\n }\r\n }\r\n }\r\n if (noNameSection.rows.length > 0) {\r\n sections.unshift(noNameSection);\r\n }\r\n return sections;\r\n}\r\nexport function RowsToSections(rows: IAssetRow[]): Section[] {\r\n const sections: Section[] = [];\r\n for (let r of rows) {\r\n sections.push({\r\n Id: r.Id,\r\n Index: -1,\r\n row: r,\r\n rows: [r],\r\n } as Section);\r\n }\r\n return sections;\r\n}\r\nexport function RowToSections(rows: IAssetRow[], id: string): Section | null {\r\n const row = removeArrayItem(rows, id);\r\n if (row !== null) {\r\n const section = {\r\n Id: row.Id,\r\n Index: -1,\r\n row: row,\r\n rows: [row],\r\n } as Section;\r\n return section;\r\n } else return null;\r\n}\r\nexport function GetRowsWithSections(\r\n rows: IAssetRow[],\r\n data: IAsset,\r\n): IAssetRow[] {\r\n let res: IAssetRow[] = GetValidRos(rows, data);\r\n res = RemoveLastEmptySections(res);\r\n const sections = GetRawSections(res);\r\n CheckEmptyRawSections(sections);\r\n RemoveEmptySections(sections, res);\r\n return res;\r\n}\r\nexport function GetRowsSections(\r\n rows: IAssetRow[],\r\n data: IAsset,\r\n isMobile?: boolean,\r\n): Sections {\r\n let leftRes: IAssetRow[] = [];\r\n let rightRes: IAssetRow[] = [];\r\n const checkSection = (row: IAssetRow) => {\r\n return isMobile\r\n ? ['Description', 'Comments', 'AssetAssemblyStructure'].includes(\r\n row.Id,\r\n ) === false\r\n : [\r\n 'ImageName',\r\n 'Description',\r\n 'Comments',\r\n 'AssetAssemblyStructure',\r\n ].includes(row.Id) === false;\r\n };\r\n for (const row of rows) {\r\n if (isValid(row, data)) {\r\n if (checkSection(row)) {\r\n leftRes.push(row);\r\n } else {\r\n rightRes.push(row);\r\n }\r\n }\r\n }\r\n leftRes = RemoveLastEmptySections(leftRes);\r\n const sections = GetRawSections(leftRes);\r\n CheckEmptyRawSections(sections);\r\n RemoveEmptySections(sections, leftRes);\r\n if (isMobile) {\r\n if (rightRes.length > 0) {\r\n moveArrayItem(rightRes, 'Description', 0);\r\n moveArrayItem(rightRes, 'AssetAssemblyStructure', 1);\r\n moveArrayItem(rightRes, 'Comments', 2);\r\n }\r\n } else {\r\n if (rightRes.length > 0) {\r\n moveArrayItem(rightRes, 'ImageName', 0);\r\n moveArrayItem(rightRes, 'Description', 1);\r\n moveArrayItem(rightRes, 'AssetAssemblyStructure', 2);\r\n moveArrayItem(rightRes, 'Comments', 3);\r\n }\r\n }\r\n\r\n leftRes = leftRes.filter(getSectionsFilter(data));\r\n rightRes = rightRes.filter(getSectionsFilter(data));\r\n const resSections: Sections = {} as Sections;\r\n if (isMobile) {\r\n const imageSection = RowToSections(leftRes, 'ImageName');\r\n resSections.leftSections = GetSections(leftRes);\r\n if (imageSection !== null) {\r\n resSections.leftSections.unshift(imageSection);\r\n }\r\n } else {\r\n resSections.leftSections = GetSections(leftRes);\r\n }\r\n resSections.rightSections = RowsToSections(rightRes);\r\n return resSections;\r\n}\r\n\r\nconst getSectionsFilter = (data: IAssetDetails2Dto) => (row: IAssetRow) => {\r\n return (\r\n row.validToRender === undefined ||\r\n row.validToRender({\r\n value: data![row.PropName ?? row.Id],\r\n original: data,\r\n })\r\n );\r\n};\r\n/**\r\n * Main asset identifier based on primary key\r\n */\r\nexport interface AssetIdIdentifier {\r\n id: number;\r\n}\r\n/**\r\n * Service/ServiceType identification. In this case both properties must be supplied in order to prevent potential conflicts between different service types.\r\n */\r\nexport interface AssetServiceIdentifier {\r\n serviceType: ServiceTypeUnion;\r\n serviceId: number;\r\n}\r\n/**\r\n * Internal code based identifier.\r\n */\r\nexport interface AssetInternalCodeIdentifier {\r\n internalCode: string;\r\n}\r\nexport interface AssetEmptyIdentifier {\r\n id: AssetIdIdentifier['id'] | undefined;\r\n}\r\n/**\r\n * Combined interface that uniquely identifies asset by one of the unioned interfaces\r\n */\r\nexport type AssetIdentifier =\r\n | AssetIdIdentifier\r\n | AssetServiceIdentifier\r\n | AssetInternalCodeIdentifier\r\n | AssetEmptyIdentifier;\r\n\r\nexport async function fetchAssetBy(props: {\r\n id: AssetIdentifier;\r\n params: Record;\r\n isAuth?: boolean;\r\n}) {\r\n const res = await fetchAssetByInternal(props);\r\n if (res !== undefined) {\r\n res.Division = res.ServiceGroup?.DivisionName;\r\n res.AssetCatGroup =\r\n res.AssetCat !== null && !!res.AssetCat\r\n ? res.AssetCat.AssetCatGroupName\r\n : null;\r\n res.Status = ' ';\r\n res.AlertsEnabled =\r\n props.isAuth === true\r\n ? GetAlertsEnabled(\r\n AvailabilityTypes[res.AvailabilityType.Id],\r\n res.Active,\r\n )\r\n : false;\r\n }\r\n return res;\r\n}\r\nasync function fetchAssetByInternal(props: {\r\n id: AssetIdentifier;\r\n params: Record;\r\n isAuth?: boolean;\r\n}) {\r\n const url = props.isAuth\r\n ? `/api/odata/v4/AssetDetails2`\r\n : `/api/odata/v4/PublicAsset`;\r\n if ((props.id as AssetIdIdentifier).id !== undefined) {\r\n const res: IAssetDetails2Dto = await httpClient.get(\r\n `${url}/${(props.id as AssetIdIdentifier).id}`,\r\n props.params,\r\n );\r\n return res;\r\n } else if (\r\n (props.id as AssetServiceIdentifier).serviceId !== undefined &&\r\n (props.id as AssetServiceIdentifier).serviceType !== undefined\r\n ) {\r\n const res: IODataQueryResponse = await httpClient.get(\r\n url,\r\n {\r\n ...props.params,\r\n $filter: `ServiceType eq '${\r\n (props.id as AssetServiceIdentifier).serviceType\r\n }' and ServiceId eq ${(props.id as AssetServiceIdentifier).serviceId}`,\r\n },\r\n );\r\n return res.value[0];\r\n } else if (\r\n (props.id as AssetInternalCodeIdentifier).internalCode !== undefined\r\n ) {\r\n const res: IODataQueryResponse = await httpClient.get(\r\n `${url}`,\r\n {\r\n ...props.params,\r\n $filter: new Condition(\r\n 'InternalCode',\r\n ODataOperators.Equals,\r\n (props.id as AssetInternalCodeIdentifier).internalCode,\r\n ).toString(),\r\n },\r\n );\r\n return res.value[0];\r\n }\r\n}\r\nexport async function fetchAssetAdditionalData(props: {\r\n Id: number;\r\n typeId: number;\r\n isAuth?: boolean;\r\n buttonsData?: boolean;\r\n}) {\r\n try {\r\n const res = await httpClient.post(\r\n props.isAuth\r\n ? `/api/odata/v4/AssetDetails2/GetAdditionalDetails`\r\n : `/api/odata/v4/PublicAsset/GetAdditionalDetails`,\r\n { key: props.Id, buttonsData: props.buttonsData, typeId: props.typeId },\r\n );\r\n return res;\r\n } catch {}\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { MenuItemLinkProps } from 'app/components/Menu/MenuItemLink';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IAsset, mapToAssetDto } from '../IAsset';\r\nimport { alertsEnabled } from '..';\r\nimport { getAssetEditLink } from '../getAssetEditLink';\r\nimport { isBookable } from './Utils';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { PrintSelectedAssetLabelsButton } from 'app/components/LabelPrint/PrintSelectedAssetLabelsButton';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { ExportQRCodesButton } from 'app/components/QrCodeExport';\r\nimport { Roles } from 'api/odata/generated/enums/Roles';\r\n\r\nexport interface TopAssetActionsDropDownProps {\r\n data: IAsset;\r\n buttonsData: IAsset;\r\n}\r\n\r\nconst ButtonOrLink = (props: MenuItemLinkProps) => {\r\n const { icon, target, text, disabled, ...rest } = props;\r\n return (\r\n }\r\n size={'small'}\r\n variant=\"white\"\r\n component={'a'}\r\n disabled={disabled}\r\n target={!!target ? '_blank' : '_self'}\r\n {...rest}\r\n >\r\n {text}\r\n \r\n );\r\n};\r\nexport const useTopAssetActionsDropDown = ({\r\n isMismatchCore,\r\n isAdmin,\r\n}: {\r\n isMismatchCore?: boolean;\r\n isAdmin: boolean;\r\n}) => {\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const roles = authenticatedUser?.Roles;\r\n const canAddQuiz = React.useCallback((): boolean => {\r\n return (\r\n authenticatedUser !== undefined &&\r\n authenticatedUser.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n );\r\n }, [authenticatedUser]);\r\n const { allowedToView } = useAssetsPermissions();\r\n\r\n const getMenuItems = React.useCallback(\r\n ({ data, buttonsData }: TopAssetActionsDropDownProps) => {\r\n const rows = [\r\n {\r\n Id: data.Id,\r\n Name: data.Name,\r\n AssetCatId: data?.AssetCat?.Id,\r\n AvailabilityTypeId: AvailabilityTypes[data.AvailabilityType.Id],\r\n AvailabilityTypeName: data.AvailabilityType.Name,\r\n ServiceGroupId: data.ServiceGroup?.Id,\r\n ServiceGroupName: data.ServiceGroup?.Name,\r\n ServiceId: data?.ServiceId,\r\n ServiceTypeId:\r\n data?.ServiceType === null\r\n ? null\r\n : (ServiceType[data.ServiceType] as number) ?? null,\r\n ServiceGroupAssetId: data?.ServiceGroup?.AssetId,\r\n },\r\n ];\r\n const NotificationIsAvailable = [\r\n 'FreelyBookableBillable',\r\n 'ApprovalRequiredBillable',\r\n 'FreelyBookable',\r\n 'BookableWApproval',\r\n 'TrainingProgram',\r\n 'LoanableEquipment',\r\n 'LectureRoom',\r\n ].includes(data.AvailabilityType.Id);\r\n let items: React.ReactNode[] = [];\r\n if (\r\n isAdmin &&\r\n [\r\n 'NotAvailable',\r\n 'AvailableNotBookable',\r\n 'FreelyBookableBillable',\r\n 'ApprovalRequiredBillable',\r\n 'FreelyBookable',\r\n 'BookableWApproval',\r\n 'TrainingProgram',\r\n 'LoanableEquipment',\r\n 'LectureRoom',\r\n 'ServiceRelated',\r\n 'RequestRelated',\r\n 'ServiceGroup',\r\n 'SuperGroup',\r\n ].includes(data.AvailabilityType.Id)\r\n ) {\r\n const editLink = getAssetEditLink(\r\n data.AvailabilityType.Id,\r\n data.Id,\r\n data.ServiceId ?? undefined,\r\n data.ServiceGroup?.Id ?? undefined,\r\n data.ServiceGroup?.DivisionId ?? undefined,\r\n );\r\n if (editLink !== undefined) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n }\r\n /*items.push(\r\n ,\r\n );*/\r\n if (\r\n (buttonsData.ReservationEnabled &&\r\n roles?.includes(Roles.Administrators)) ||\r\n roles?.includes(Roles.LabTech)\r\n ) {\r\n items.push(\r\n }\r\n variant=\"white\"\r\n component={'a'}\r\n size={'small'}\r\n >\r\n {t(translations.Calendar)}\r\n ,\r\n );\r\n }\r\n if (\r\n buttonsData.ReservationEnabled &&\r\n isBookable(data.AvailabilityType?.Id)\r\n ) {\r\n items.push(\r\n }\r\n size={'small'}\r\n >\r\n {t(translations.Timeline)}\r\n ,\r\n );\r\n if (\r\n allowedToView(\r\n ((rows as unknown) as IMyAssetsRow[]).map(mapToAssetDto),\r\n RenderTypes.ExportQRCodes,\r\n )\r\n ) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (\r\n allowedToView(\r\n ((rows as unknown) as IMyAssetsRow[]).map(mapToAssetDto),\r\n RenderTypes.PrintAssetLabels,\r\n )\r\n ) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (isBookable(data.AvailabilityType?.Id)) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n }\r\n if (buttonsData.UsageEnabled) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (data.ServiceType === 'Offline' && data.AllowToUser) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (\r\n data.ServiceType === 'Online' &&\r\n IsModuleEnabled(appSettings, KnownModules.Quizzes) &&\r\n canAddQuiz()\r\n ) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (alertsEnabled(data.AvailabilityType.Id)) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (buttonsData.PlanedEventsEnabled) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (data.ServiceType === 'Offline' && data.AllowToUser) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (\r\n data.ServiceType === 'Sample' &&\r\n data.CanBeCreatedFromLinkOnly === false\r\n ) {\r\n items.push(\r\n ,\r\n );\r\n /*items.push(\r\n ,\r\n );*/\r\n }\r\n if (\r\n isBookable(data.AvailabilityType?.Id) &&\r\n data.ServiceType === 'Online' &&\r\n buttonsData.ReservationEnabled &&\r\n (IsModuleEnabled(appSettings, KnownModules.ResCancelNotifications) ||\r\n IsModuleEnabled(appSettings, KnownModules.ReservationNotification)) &&\r\n NotificationIsAvailable\r\n ) {\r\n items.push(\r\n ,\r\n );\r\n }\r\n if (\r\n buttonsData.ShowFeed &&\r\n globalSettings.GetBoolean('CalendarPublicIntegrationFeed')\r\n ) {\r\n items.push(\r\n void;\r\n}) {\r\n const { t } = useTranslation();\r\n const [state, setState] = useAsyncExtendedState([]);\r\n const [fetchAlertTypesState, fetchAlertTypes] = usePromise(\r\n fetchAlertTypesPromise,\r\n );\r\n React.useEffect(() => {\r\n setState(fetchAlertTypes(props.assetId));\r\n }, [fetchAlertTypes, props.assetId, setState]);\r\n const downtimeProps = React.useMemo(() => {\r\n return props.downtime ? { offH: true, down: true } : {};\r\n }, [props.downtime]);\r\n return (\r\n }\r\n title={t(translations.CreateAnAssetRelatedEvent)}\r\n processing={fetchAlertTypesState.status === 'pending'}\r\n color=\"primary\"\r\n variant={/*!props.bookable ? 'main' : */ 'white'}\r\n disabled={props.mismatchCore}\r\n addChevron\r\n menuChildren={onClose => [\r\n \r\n {t(translations.PleaseSelectAnEventType)}\r\n ,\r\n\r\n ...state.map(\r\n a =>\r\n a.Name !== null && (\r\n {\r\n !!props.openPanel &&\r\n props.openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: {\r\n queryParams: {\r\n aType: a.Id.toString(),\r\n assetId: props.assetId.toString(),\r\n down: !!downtimeProps.down\r\n ? downtimeProps.down.toString()\r\n : undefined,\r\n offH: !!downtimeProps.offH\r\n ? downtimeProps.offH.toString()\r\n : undefined,\r\n },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n });\r\n onClose();\r\n }}\r\n >\r\n {a.Name}\r\n \r\n ),\r\n ),\r\n ]}\r\n menuProps={{}}\r\n >\r\n {t(translations.Event)}\r\n \r\n );\r\n}\r\nexport const fetchAlertTypesPromise = async (assetId: number) => {\r\n const response: IODataQueryResponse = await httpClient.get(\r\n `/api/odata/v4/AssetDetails2(${assetId})/AlertTypes`,\r\n );\r\n return response.value;\r\n};\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { DocumentsTable } from 'app/pages/Documents/DocumentsTable';\r\nimport { IDocumentsDirectoryRow } from 'app/pages/Documents/IDocumentsDirectoryRow';\r\n//import { useFilters } from './TableFilters';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IBasicTableState } from 'app/components/BasicTable';\r\nimport React from 'react';\r\nimport { getColumns } from 'app/pages/Documents/Columns';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst ExcludeAssetDocumentsColumns: string[] = ['AssetName', 'ServiceGroup'];\r\nexport interface AssetDetailsFilesProps {\r\n assetId: number;\r\n getFiltersDefinition?: GetPageFilters;\r\n isMobile?: boolean;\r\n serviceGroupId?: number;\r\n availabilityType?: string;\r\n user?: AuthenticatedUser;\r\n}\r\nexport function AssetDetailsFiles(props: AssetDetailsFilesProps) {\r\n const { t } = useTranslation();\r\n const documentsColumns = React.useMemo(() => getColumns(t), [t]);\r\n const { assetId, isMobile, serviceGroupId, availabilityType } = props;\r\n const columns = React.useMemo(() => {\r\n let res: Column[] = documentsColumns.filter(\r\n f =>\r\n f.accessor !== undefined &&\r\n !ExcludeAssetDocumentsColumns.includes(f.accessor as string),\r\n );\r\n return res;\r\n }, [documentsColumns]);\r\n const predicates: Array<\r\n Condition | string\r\n > = React.useMemo(() => {\r\n // The asset matches and the service group matches or there is only a service group and it matches.\r\n const res: Array | string> = [];\r\n const assetPredicate = new Condition(\r\n 'AssetId',\r\n ODataOperators.Equals,\r\n assetId,\r\n );\r\n const groupPredicate = new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n serviceGroupId,\r\n );\r\n if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n res.push(\r\n `(${[assetPredicate.toString(), groupPredicate.toString()].join(\r\n ' or ',\r\n )})`,\r\n );\r\n } else {\r\n res.push(assetPredicate);\r\n }\r\n return res;\r\n }, [assetId, availabilityType, serviceGroupId]);\r\n /*const {\r\n allfilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n getFilterValue,\r\n setFilterValue,\r\n } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Id', desc: false }],\r\n }),\r\n [],\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import { IAsset } from '../IAsset';\r\nimport { Section, SectionsProps } from './types';\r\nimport { AttributeValue } from '../IAssetRow';\r\nimport React from 'react';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { GhostInput } from 'app/components/BasicInputs/GhostInput';\r\n\r\nexport interface SectionRowsProps {\r\n sections: Section[];\r\n data?: IAsset;\r\n noLabel?: boolean;\r\n}\r\nexport const notFullWidth = ['Status', 'DOI'];\r\nexport const noLabelRendersArray = ['ImageName', 'Comments'];\r\nexport const asHtmlRenderArray = ['Comments', 'ImageName'];\r\nexport const DefautltCell = ({ value }: AttributeValue) => (\r\n {value}\r\n);\r\nexport function RenderRows({\r\n sections,\r\n data,\r\n noLabel,\r\n ...props\r\n}: SectionRowsProps) {\r\n // const rows = React.useCallback(\r\n // (rows: IAssetRow[]) => {\r\n // if (!!data) {\r\n // return (\r\n // <>\r\n // {rows\r\n // .filter(f => {\r\n // return (\r\n // f.validToRender === undefined ||\r\n // f.validToRender({\r\n // value: data![f.PropName ?? f.Id],\r\n // original: data,\r\n // })\r\n // );\r\n // })\r\n // .map(r => {\r\n // let cell = r.Cell ?? DefautltCell;\r\n // let cellData = {\r\n // original: data,\r\n // value: data![r.PropName ?? r.Id],\r\n // };\r\n // return (\r\n // \r\n // \r\n // \r\n // );\r\n // })}\r\n // \r\n // );\r\n // } else {\r\n // return <> ;\r\n // }\r\n // },\r\n // [data, noLabel],\r\n // );\r\n return !!data ? (\r\n \r\n {sections.map(s => {\r\n return (\r\n \r\n {s.rows\r\n .filter(f => {\r\n return (\r\n f.validToRender === undefined ||\r\n f.validToRender({\r\n value: data![f.PropName ?? f.Id],\r\n original: data,\r\n })\r\n );\r\n })\r\n .map(r => {\r\n let cell = r.Cell ?? DefautltCell;\r\n let cellData = {\r\n original: data,\r\n value: data![r.PropName ?? r.Id],\r\n };\r\n return (\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n );\r\n })}\r\n \r\n ) : null;\r\n}\r\nexport const RenderLeftSection = React.memo(function RenderSection({\r\n sections,\r\n data,\r\n ...props\r\n}: SectionsProps) {\r\n return sections.length > 0 ? (\r\n \r\n ) : null;\r\n});\r\nexport const RenderRightSection = React.memo(function RenderSection({\r\n sections,\r\n data,\r\n}: SectionsProps) {\r\n return sections.length > 0 ? (\r\n \r\n ) : null;\r\n});\r\n","import { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function MismatchCore(\r\n data: IAssetDetails2Dto | undefined,\r\n isAuthenticated: boolean | undefined,\r\n topServiceGroupsIsHidden: boolean,\r\n selectedServiceGroups: Entity[] | undefined,\r\n): boolean {\r\n if (isAuthenticated && !topServiceGroupsIsHidden) {\r\n const showAllCores =\r\n !!data &&\r\n !!data.ServiceGroup &&\r\n selectedServiceGroups?.find(f => f.Id === data?.ServiceGroup.Id) ===\r\n undefined;\r\n return showAllCores\r\n ? !!data &&\r\n !!data.AvailabilityType &&\r\n data.AvailabilityType?.Id !== 'ServiceGroup' &&\r\n data.AvailabilityType?.Id !== 'SuperGroup' &&\r\n !!selectedServiceGroups &&\r\n selectedServiceGroups.length > 0 &&\r\n !selectedServiceGroups.some(f => f.Id === data.ServiceGroup.Id)\r\n : false;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\nexport interface MismatchCoreMessageProps {\r\n data: IAssetDetails2Dto | undefined;\r\n mismatchCore: boolean;\r\n}\r\nexport function MismatchCoreMessage({\r\n data,\r\n mismatchCore,\r\n}: MismatchCoreMessageProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const { actions } = useAppSettingsSlice();\r\n const updateGlobalServiceGroup = React.useCallback(() => {\r\n const showAllCores =\r\n !!data &&\r\n !!data.ServiceGroup &&\r\n selectedServiceGroups?.find(f => f.Id === data?.ServiceGroup.Id) ===\r\n undefined;\r\n if (showAllCores && !!data && !!data.ServiceGroup.Id) {\r\n const groups = [\r\n ...(selectedServiceGroups ?? []),\r\n ...(data.ServiceGroup !== null ? [data.ServiceGroup] : []).map(sg => ({\r\n Id: sg.Id,\r\n Name: sg.Name,\r\n })),\r\n ];\r\n\r\n dispatch(actions.saveGlobalServiceGroupFilter(groups));\r\n }\r\n }, [actions, data, dispatch, selectedServiceGroups]);\r\n return mismatchCore ? (\r\n \r\n \r\n {t(translations.MismatchAssetCore_warning) as string}\r\n \r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n }}\r\n />\r\n ) : (\r\n <>\r\n );\r\n}\r\n","import { IAssetRow } from '../IAssetRow';\r\nimport React from 'react';\r\nimport { IAsset } from '../IAsset';\r\nimport { AssetDetailsFiles } from './AssetDetailsFiles';\r\nimport {\r\n FormLeftSection,\r\n FormRightSection,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { GetRowsSections } from './Utils';\r\nimport { RenderLeftSection, RenderRightSection } from './RenderAssetRows';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectGlobalSettingBool,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { MismatchCore, MismatchCoreMessage } from './MismatchCoreMessage';\r\n\r\nexport interface AssetDetailsTabContentProps {\r\n rows: IAssetRow[];\r\n data: IAsset;\r\n loadingAdditionalData?: boolean;\r\n isAdmin: boolean;\r\n commentsForStaff?: boolean;\r\n shortView?: boolean;\r\n isCover?: boolean;\r\n}\r\n\r\nexport function AssetDetailsTabContent(props: AssetDetailsTabContentProps) {\r\n const { rows, data, shortView, isCover } = props;\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const topServiceGroupsIsHidden = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n );\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const sections = React.useMemo(() => {\r\n return GetRowsSections(rows, data, shortView);\r\n }, [data, shortView, rows]);\r\n const leftSections = React.useMemo(() => {\r\n return sections.leftSections;\r\n }, [sections]);\r\n const rightSections = React.useMemo(() => {\r\n return sections.rightSections;\r\n }, [sections]);\r\n // const getMobileRows = React.useCallback(() => {\r\n // let res = leftSections;\r\n // if (rightSections.length > 0 && rightSections[0].rows.length > 0) {\r\n // res.unshift(...rightSections);\r\n // }\r\n // return res;\r\n // }, [leftSections, rightSections]);\r\n const mismatchCore = React.useMemo(() => {\r\n return MismatchCore(\r\n data,\r\n isAuthenticated,\r\n topServiceGroupsIsHidden,\r\n selectedServiceGroups,\r\n );\r\n }, [data, isAuthenticated, selectedServiceGroups, topServiceGroupsIsHidden]);\r\n return (\r\n <>\r\n \r\n \r\n {shortView && (\r\n \r\n )}\r\n \r\n \r\n \r\n {!shortView && (\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n {!!data && isAuthenticated && (\r\n \r\n )}\r\n\r\n {/*TODO: should be implemented mobile floating comment component and separate input from comments section\r\n Jira task BKT-9685*/}\r\n {/* {isMobile && (\r\n \r\n )} */}\r\n \r\n );\r\n}\r\n","import { InstrumentRestrictions } from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\n\r\nexport interface AssetBookingRulesProps {\r\n serviceId?: number;\r\n serviceGroupId?: number;\r\n user?: string;\r\n useShortView?: boolean;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function AssetBookingRules(props: AssetBookingRulesProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport { getDependencyFilters } from 'app/components/BasicTable/BasicFilter';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { getFilterValue } from 'app/components/BasicTable/getFilterValue';\r\nimport { initFilterData } from 'app/components/BasicTable/initFilterData';\r\nimport { visibleFiltersFilter } from 'app/components/BasicTable/withSavedHistory';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface FilterValue {\r\n Name: string;\r\n Value: FilterValueType | null;\r\n}\r\nexport class BaseFilterValues {\r\n GetFilter = (): Array => {\r\n const res: Array = Object.entries(this)\r\n .filter(v => typeof v[1] !== 'function')\r\n .map(v => {\r\n return { Name: v[0], Value: v[1] as FilterValueType | null };\r\n });\r\n return res;\r\n };\r\n SetValue = (name: string, value: FilterValueType | null) => {\r\n this[name] = value;\r\n };\r\n}\r\nexport function useFilters(\r\n GetFiltersDefinition: GetPageFilters,\r\n filterBy?: FilterValue[],\r\n setValue?: (name: string, value: FilterValueType | null) => void,\r\n) {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n const getLocalizedFilters = useMemo(() => {\r\n const result = GetFiltersDefinition(\r\n t,\r\n appSettings,\r\n authenticatedUser ?? null,\r\n settings,\r\n );\r\n return result;\r\n }, [GetFiltersDefinition, appSettings, authenticatedUser, settings, t]);\r\n\r\n const allFilters = useMemo(() => {\r\n var result = getLocalizedFilters('');\r\n // get the necessary filters\r\n if (filterBy !== undefined && filterBy.length > 0) {\r\n result = result.filter(\r\n f => filterBy.findIndex(v => v.Name === f.fieldName) >= 0,\r\n );\r\n // Set saved values\r\n for (const f of filterBy) {\r\n let rf = result.find(r => r.fieldName === f.Name);\r\n if (rf !== undefined) {\r\n rf.value = f.Value;\r\n }\r\n }\r\n }\r\n return result;\r\n }, [filterBy, getLocalizedFilters]);\r\n\r\n const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n IFilterSettings[] | undefined\r\n >(undefined);\r\n const handleFilterChange: (\r\n items: IFilterSettings[],\r\n ) => void = React.useCallback(\r\n items => {\r\n const newState = [...items.filter(showFiltersFn)];\r\n\r\n setAppliedFilters(getDependencyFilters(newState));\r\n\r\n // Save values\r\n if (setValue !== undefined) {\r\n for (const f of newState) {\r\n setValue(\r\n f.fieldName as string,\r\n f.value !== undefined ? f.value : null,\r\n );\r\n }\r\n }\r\n },\r\n [setAppliedFilters, setValue, showFiltersFn],\r\n );\r\n const setFilterValueCallback = React.useCallback(\r\n (id: string, value: FilterValueType) => {\r\n if (allFilters === undefined) {\r\n return;\r\n }\r\n const filter = allFilters?.find(f => f.id === id);\r\n // in cases when applied filter is not defined call to setAppliedFilters will just only mutate appliedFilters array and cause duplicate/unnecessary invocation of hooks that have appliedFilters as a dependency\r\n if (filter !== undefined) {\r\n filter.value = value;\r\n const x = allFilters\r\n .map(f => (f === filter ? { ...filter, ...{ value: value } } : f))\r\n .filter(showFiltersFn);\r\n handleFilterChange(x);\r\n }\r\n },\r\n [allFilters, handleFilterChange, showFiltersFn],\r\n );\r\n const getFilterValueCallback = React.useCallback(\r\n (id: string) => {\r\n const f = getFilterValue(appliedFilters, id);\r\n return f;\r\n },\r\n [appliedFilters],\r\n );\r\n React.useEffect(() => {\r\n if (authenticatedUser === undefined) {\r\n return;\r\n }\r\n // get the filters\r\n let visibleFilters = allFilters?.filter(showFiltersFn);\r\n let depFilters = getDependencyFilters(visibleFilters);\r\n setAppliedFilters(depFilters);\r\n setAppliedFilters(initFilterData(depFilters, globalServiceGroupFilter));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [globalServiceGroupFilter]);\r\n return {\r\n allfilters: allFilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n getFilterValue: getFilterValueCallback,\r\n setFilterValue: setFilterValueCallback,\r\n };\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\n\r\nfunction getUrlAndParams(\r\n api: string | IPathAndQuery,\r\n oDataParams: {\r\n $count?: boolean;\r\n $select?: string;\r\n $filter?: string | undefined;\r\n },\r\n) {\r\n var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n var search = (api as IPathAndQuery).search;\r\n const params = { ...oDataParams, ...search };\r\n return { url, params };\r\n}\r\nexport async function GettableCount(state: {\r\n api: string;\r\n predicates: Array | string>;\r\n columns: Array;\r\n globalFilterValue?: string;\r\n customFilter: IFilterSettings[];\r\n serviceGroups: Entity[];\r\n isOptionalServiceGroup: boolean;\r\n}) {\r\n const oDataParams = buildParams({\r\n ...state,\r\n select: state.columns,\r\n serviceGroups: state.serviceGroups,\r\n pageSize: 1,\r\n pageIndex: 0,\r\n });\r\n var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n const response = await httpClient.get(url, params /*, cancelToken*/);\r\n const dataLength = response['@odata.count'];\r\n return dataLength;\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { GetFilters as getTrainingFilters } from 'app/pages/TrainingSessionsPage/Filter';\r\nimport { getColumns } from 'app/pages/TrainingSessionsPage/Columns';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { TrainingSessionsTable } from 'app/pages/TrainingSessionsPage/TrainingSessionsTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Column } from 'react-table';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { BaseFilterValues, useFilters } from './TableFilters';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport trainingSessionPrimaryAction from 'app/pages/TrainingSessionsPage/PrimaryAction';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\n\r\nconst AssetTrainingSessionsColumns: string[] = [\r\n 'Id',\r\n 'TrainingState',\r\n 'TrainerName',\r\n 'StartDate',\r\n 'EndDate',\r\n 'Duration',\r\n 'Campus',\r\n 'Building',\r\n 'Room',\r\n 'hasReservation',\r\n 'myReservationId',\r\n 'MinAttendance',\r\n 'MaxAttendance',\r\n 'RemainedSlots',\r\n 'Remarks',\r\n];\r\nconst url = '/api/odata/v4/TrainingSessions';\r\nconst GetPredicates = (\r\n assetId: number,\r\n serviceGroupId?: number,\r\n availabilityType?: string,\r\n): Array | string> => {\r\n const res: Array | string> = [];\r\n const assetPredicate = new Condition(\r\n 'AssetId',\r\n ODataOperators.Equals,\r\n assetId,\r\n );\r\n const serviceGroupPredicate = new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n serviceGroupId,\r\n );\r\n if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n res.push(serviceGroupPredicate);\r\n } else {\r\n res.push(assetPredicate);\r\n }\r\n res.push(\r\n new Condition(\r\n 'IsUpcoming',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n return res;\r\n};\r\nclass FilterValues extends BaseFilterValues {\r\n TrainingState: FilterValueType | null = null;\r\n Trainer: FilterValueType | null = null;\r\n}\r\nconst filterValues = new FilterValues();\r\nexport interface AssetTrainingSessionsProps {\r\n assetId: number;\r\n serviceId: number | null;\r\n serviceTypeId?: ServiceType;\r\n isMobile?: boolean;\r\n serviceGroupId?: number;\r\n availabilityType?: string;\r\n useSidePanel?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n}\r\nexport async function GetTrainingSessionsTableCount(\r\n assetId: number,\r\n name: string,\r\n updateCounters: (name: string, count: number) => void,\r\n serviceGroupId?: number,\r\n availabilityType?: string,\r\n) {\r\n const res = await GettableCount({\r\n api: url,\r\n predicates: GetPredicates(\r\n assetId,\r\n serviceGroupId,\r\n availabilityType,\r\n ) as Array | string>,\r\n columns: ['Id'],\r\n globalFilterValue: '',\r\n customFilter: [],\r\n serviceGroups: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n updateCounters(name, res);\r\n}\r\nexport function AssetTrainingSessions(props: AssetTrainingSessionsProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const history = useHistory();\r\n const { actions } = useLayoutSlice();\r\n const {\r\n assetId,\r\n serviceId,\r\n serviceTypeId,\r\n isMobile,\r\n serviceGroupId,\r\n availabilityType,\r\n useSidePanel,\r\n openPanel,\r\n } = props;\r\n const {\r\n allfilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n getFilterValue,\r\n setFilterValue,\r\n } = useFilters(\r\n getTrainingFilters,\r\n filterValues.GetFilter(),\r\n filterValues.SetValue,\r\n );\r\n const trainingSessionsColumns = React.useMemo(() => getColumns(t), [t]);\r\n const columns = React.useMemo(() => {\r\n let res: Column[] = [];\r\n for (const c of AssetTrainingSessionsColumns) {\r\n const column = trainingSessionsColumns.find(f => f.accessor === c);\r\n if (column !== undefined) {\r\n res.push(column);\r\n }\r\n }\r\n return res;\r\n }, [trainingSessionsColumns]);\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n /*const menuItems: React.ReactNode[] = React.useMemo(() => {\r\n let items: React.ReactNode[] = [\r\n \r\n window.open(\r\n toRootedURL('/TrainingSession/Details.aspx', {\r\n eqid: serviceId,\r\n }),\r\n '_blank',\r\n )\r\n }\r\n >\r\n {t(translations.menu_DetailsTrainingSessions)}\r\n ,\r\n ];\r\n return items;\r\n }, [serviceId, t]);*/\r\n\r\n const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n const actions: PageActionRenderer[] = [];\r\n if (serviceTypeId !== undefined && serviceId !== null) {\r\n if (\r\n user?.HasAdminServicePermissions(serviceTypeId, serviceId) ||\r\n user?.HasLabTechServicePermissions(serviceTypeId, serviceId)\r\n ) {\r\n actions.push(() => (\r\n {\r\n window.open(\r\n toRootedURL('/TrainingSession/AddNew.aspx', {\r\n eqid: serviceId,\r\n }),\r\n '_blank',\r\n );\r\n }}\r\n />\r\n ));\r\n actions.push(() => (\r\n {\r\n window.open(\r\n toRootedURL('/TrainingSession/Details.aspx', {\r\n eqid: serviceId,\r\n }),\r\n '_blank',\r\n );\r\n }}\r\n />\r\n ));\r\n }\r\n }\r\n return actions;\r\n }, [isMobile, serviceId, serviceTypeId, t, user]);\r\n const goToTrainingSessions = React.useCallback(() => {\r\n history.push(`trainingsessions?eqid=${serviceId}`);\r\n dispatch(actions.toggleSidePanel(false));\r\n }, [actions, dispatch, history, serviceId]);\r\n const customScreenName: React.ReactNode = React.useMemo(() => {\r\n const result = (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n );\r\n return result;\r\n }, [goToTrainingSessions, t]);\r\n const primaryAction: PrimaryAction = React.useCallback(\r\n (...args) => {\r\n const hasNextSession =\r\n getOffsetDate(args[0].original.StartDate) >\r\n dateUtils.truncateTime(newDate());\r\n if (hasNextSession) {\r\n trainingSessionPrimaryAction(\r\n openPanel,\r\n args[0],\r\n args[1],\r\n args[2],\r\n useSidePanel,\r\n );\r\n }\r\n },\r\n [getOffsetDate, newDate, openPanel, useSidePanel],\r\n );\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'StartDate', desc: false }],\r\n }),\r\n [],\r\n );\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport React from 'react';\r\nimport { ArticlesTable } from 'app/pages/ArticlesPage/ArticlesTable';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport articlePrimaryAction from 'app/pages/ArticlesPage/PrimaryAction';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst url = '/api/odata/v4/articles';\r\nconst GetPredicates = (\r\n assetId: number,\r\n serviceGroupId: number | undefined,\r\n availabilityType?: string,\r\n): string[] => {\r\n // The asset matches and the service group matches or there is only a service group and it matches.\r\n const res: string[] = [];\r\n if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n res.push(\r\n `Assets/any(a: a/Id eq ${assetId} ${\r\n !!serviceGroupId ? 'or a/ServiceGroupId eq ' + serviceGroupId : ''\r\n })`,\r\n );\r\n } else {\r\n res.push(\r\n `Assets/any(a: a/Id eq ${assetId} ${\r\n !!serviceGroupId ? 'and a/ServiceGroupId eq ' + serviceGroupId : ''\r\n })`,\r\n );\r\n }\r\n return res;\r\n};\r\nexport async function GetArticlesTableCount(\r\n assetId: number,\r\n serviceGroupId: number | undefined,\r\n name: string,\r\n updateCounters: (name: string, count: number) => void,\r\n availabilityType: string,\r\n) {\r\n let res = 0;\r\n res = await GettableCount({\r\n api: url,\r\n predicates: GetPredicates(\r\n assetId,\r\n serviceGroupId,\r\n availabilityType,\r\n ) as Array | string>,\r\n columns: ['Id'],\r\n globalFilterValue: '',\r\n customFilter: [],\r\n serviceGroups: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n updateCounters(name, res);\r\n}\r\nexport interface AssetArticlesTableProps {\r\n assetId: number;\r\n serviceGroupId?: number;\r\n isMobile?: boolean;\r\n useSidePanel?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n availabilityType?: string;\r\n user?: AuthenticatedUser;\r\n}\r\nexport function AssetArticlesTable(props: AssetArticlesTableProps) {\r\n //const { serviceGroups } = useGlobalServiceGroupsFilter(true);\r\n /*const {\r\n allfilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n getFilterValue,\r\n setFilterValue,\r\n } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n const predicates = React.useMemo(() => {\r\n return GetPredicates(\r\n props.assetId,\r\n props.serviceGroupId,\r\n props.availabilityType,\r\n );\r\n }, [props.assetId, props.availabilityType, props.serviceGroupId]);\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Id', desc: false }],\r\n }),\r\n [],\r\n );\r\n const primaryAction: PrimaryAction = React.useCallback(\r\n (...args) => {\r\n articlePrimaryAction(\r\n props.openPanel,\r\n args[0],\r\n undefined,\r\n args[2],\r\n props.useSidePanel,\r\n );\r\n },\r\n [props.openPanel, props.useSidePanel],\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IDocumentsDirectoryRow } from 'app/pages/Documents/IDocumentsDirectoryRow';\r\n//import { useFilters } from './TableFilters';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { WorkOrdersTable } from 'app/pages/WorkOrdersPage/WorkOrdersTable';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { NewWorkOrderButton } from 'app/pages/WorkOrdersPage/Actions/NewWorkOrder';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { getColumns } from 'app/pages/WorkOrdersPage/Columns';\r\nimport { Column } from 'react-table';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport workOrderPrimaryAction from 'app/pages/WorkOrdersPage/PrimaryAction';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst AssetWorkOrdersColumns: string[] = [\r\n 'Id',\r\n 'AlertType',\r\n 'AlertTitle',\r\n 'AlertDescription',\r\n 'AssignedUsers',\r\n 'AlertOfflineTime',\r\n 'ReportedBy',\r\n 'LastUpdated',\r\n 'LastComment',\r\n 'LastCommentAt',\r\n 'LastCommentBy',\r\n];\r\nconst AssetCalibrationColumns: string[] = [\r\n 'Id',\r\n 'AlertType',\r\n 'EventStart',\r\n 'EventEnd',\r\n 'AlertTitle',\r\n 'AlertDescription',\r\n 'ReportedBy',\r\n];\r\nconst url = '/api/odata/v4/WorkOrders';\r\n\r\nconst GetPredicates = (\r\n assetId: number,\r\n availabilityType?: string,\r\n serviceGroupId?: number,\r\n calibration?: boolean,\r\n): Array | string> => {\r\n const res: Array | string> = [];\r\n const assetPredicate = new Condition(\r\n 'AssetId',\r\n ODataOperators.Equals,\r\n assetId,\r\n );\r\n const groupPredicate = new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n serviceGroupId,\r\n );\r\n const calibrationPredicate = `(${[\r\n new Condition(\r\n 'ShowOnCalibrationHistory',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString(),\r\n new Condition(\r\n 'IsClosed',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString(),\r\n ].join(' and ')})`;\r\n\r\n if (\r\n !!availabilityType &&\r\n availabilityType === 'ServiceGroup' &&\r\n !!serviceGroupId\r\n ) {\r\n res.push(groupPredicate);\r\n } else {\r\n res.push(assetPredicate);\r\n }\r\n if (calibration) {\r\n res.push(calibrationPredicate);\r\n }\r\n\r\n return res;\r\n};\r\nexport async function GetWorkOrdersTableCount(\r\n assetId: number,\r\n calibration: boolean,\r\n name: string,\r\n updateCounters: (name: string, count: number) => void,\r\n serviceGroupId?: number,\r\n availabilityType?: string,\r\n) {\r\n const res = await GettableCount({\r\n api: url,\r\n predicates: GetPredicates(\r\n assetId,\r\n availabilityType,\r\n serviceGroupId,\r\n calibration,\r\n ) as Array | string>,\r\n columns: ['Id'],\r\n globalFilterValue: '',\r\n customFilter: [],\r\n serviceGroups: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n updateCounters(name, res);\r\n}\r\nexport interface AssetWorkOrdersProps {\r\n assetId: number;\r\n assetName: string;\r\n serviceGroupId: number | undefined;\r\n calibration?: boolean;\r\n getFiltersDefinition?: GetPageFilters;\r\n isMobile?: boolean;\r\n useSidePanel?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n allowToAddNew?: boolean;\r\n availabilityType?: string;\r\n user?: AuthenticatedUser;\r\n}\r\nexport function AssetWorkOrders(props: AssetWorkOrdersProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { actions } = useLayoutSlice();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n /*const {\r\n allfilters,\r\n appliedFilters,\r\n handleFilterChange,\r\n getFilterValue,\r\n setFilterValue,\r\n } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n const workOrdersColumns = React.useMemo(\r\n () =>\r\n getColumns(\r\n t,\r\n undefined,\r\n undefined,\r\n authenticatedUser,\r\n props.useSidePanel,\r\n props.openPanel,\r\n ),\r\n [authenticatedUser, props.openPanel, props.useSidePanel, t],\r\n );\r\n const columns = React.useMemo(() => {\r\n let res: Column[] = [];\r\n if (props.calibration) {\r\n for (const c of AssetCalibrationColumns) {\r\n const column = workOrdersColumns.find(f => f.accessor === c);\r\n if (column !== undefined) {\r\n res.push(column);\r\n }\r\n }\r\n return res;\r\n } else {\r\n for (const c of AssetWorkOrdersColumns) {\r\n const column = workOrdersColumns.find(f => f.accessor === c);\r\n if (column !== undefined) {\r\n res.push(column);\r\n }\r\n }\r\n return res;\r\n }\r\n }, [props.calibration, workOrdersColumns]);\r\n\r\n const PageActions: PageActionRenderer[] = React.useMemo(() => {\r\n if (props.calibration || !props.allowToAddNew) {\r\n return [];\r\n } else {\r\n return [\r\n () => (\r\n \r\n ),\r\n ];\r\n }\r\n }, [\r\n props.allowToAddNew,\r\n props.assetId,\r\n props.assetName,\r\n props.calibration,\r\n props.openPanel,\r\n props.useSidePanel,\r\n t,\r\n ]);\r\n const primaryAction: PrimaryAction = React.useCallback(\r\n (...args) => {\r\n workOrderPrimaryAction(\r\n props.openPanel,\r\n args[0],\r\n args[1],\r\n args[2],\r\n props.useSidePanel,\r\n );\r\n },\r\n [props.openPanel, props.useSidePanel],\r\n );\r\n const goToWorkOrders = React.useCallback(() => {\r\n dispatch(actions.toggleSidePanel(false));\r\n history.push('/workorders?aid=' + props.assetId);\r\n }, [actions, dispatch, history, props.assetId]);\r\n\r\n const predicates = React.useMemo(() => {\r\n return GetPredicates(\r\n props.assetId,\r\n props.availabilityType,\r\n props.serviceGroupId,\r\n props.calibration,\r\n );\r\n }, [\r\n props.assetId,\r\n props.availabilityType,\r\n props.calibration,\r\n props.serviceGroupId,\r\n ]);\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Id', desc: true }],\r\n }),\r\n [],\r\n );\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n hideMenuOnMobile={true}\r\n screenNameVariant=\"section\"\r\n tablePaddingVariant={'dense'}\r\n compactTable={props.isMobile}\r\n />\r\n );\r\n}\r\n","import styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface BadgeCounterProps {\r\n count?: number;\r\n}\r\nconst Badge = styled('div')(({ theme }) => ({\r\n '&.badgeRoot': {\r\n display: 'flex',\r\n width: '16px',\r\n height: '16px',\r\n //padding: '1.5px 0px 2px 0px',\r\n padding: 0,\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n borderRadius: '100px',\r\n background: bookitColors.grayscale.grayComponentsLight,\r\n '&.hasValue': {\r\n background: bookitColors.primary.components,\r\n },\r\n '& .badgeText': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n flex: '1 0 0',\r\n alignSelf: 'stretch',\r\n color: bookitColors.base.white,\r\n textAlign: 'center',\r\n /* Bkt/Tips Regular */\r\n fontFamily: `'Lato', sans-serif`,\r\n fontSize: '10px',\r\n fontStyle: 'normal',\r\n lineHeight: '141%' /* 19.2px */,\r\n fontWeight: 400,\r\n letterSpacing: '0.2px',\r\n },\r\n },\r\n}));\r\nexport function BadgeCounter(props: BadgeCounterProps) {\r\n return (\r\n 0,\r\n })}\r\n >\r\n {props.count ?? 0}\r\n \r\n );\r\n}\r\n","import {\r\n ListItemSecondaryAction,\r\n ListItemText,\r\n MenuItem,\r\n useTheme,\r\n} from '@material-ui/core';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport styled from 'styled-components';\r\nimport * as React from 'react';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { TabPanel, TabPanelProps } from 'app/components/BasicTabs/TabPanel';\r\n\r\nexport interface AssetMobileDropDownTabsProps {\r\n tabs: TabContent[];\r\n tabsId: string;\r\n tabsPanelId: string;\r\n isMobile?: boolean;\r\n handleTabChange: (tab: TabContent) => void;\r\n selectedTab: TabContent;\r\n tabPanels?: Array>;\r\n}\r\nexport const DropDownTabsWrapper = styled('div')(({ theme }) => ({\r\n '&.drpTabsWrapper': {\r\n display: 'flex',\r\n padding: '0px 16px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n gap: '16px',\r\n width: '100%',\r\n overflow: 'hidden',\r\n '& .asset-mobile-tabs': {\r\n '& .asset-mobile-tabs-paper': {\r\n width: '100%',\r\n },\r\n },\r\n },\r\n}));\r\n\r\nexport function AssetMobileDropDownTabs(props: AssetMobileDropDownTabsProps) {\r\n const {\r\n tabs,\r\n tabsId,\r\n tabsPanelId,\r\n isMobile,\r\n handleTabChange,\r\n selectedTab,\r\n tabPanels,\r\n } = props;\r\n const theme = useTheme();\r\n // const [selectedOption, setSelectedOption] = React.useState(\r\n // tabs[0],\r\n // );\r\n const handleSelectedTabIndexChange = (newValue: TabContent) => {\r\n handleTabChange(newValue);\r\n };\r\n const getTabProps = React.useCallback(\r\n (item: TabContent) => {\r\n return {\r\n id: `${tabsId}-${item.Id}`,\r\n 'aria-controls': `${tabsPanelId}-${item.Id}`,\r\n label: item.Name,\r\n };\r\n },\r\n [tabsId, tabsPanelId],\r\n );\r\n return (\r\n \r\n \r\n tabs.map(tab => (\r\n {\r\n handleSelectedTabIndexChange(tab);\r\n close();\r\n }}\r\n selected={selectedTab.Id === tab.Id}\r\n {...getTabProps(tab)}\r\n >\r\n \r\n {!!tab.endIcon && (\r\n {tab.endIcon}\r\n )}\r\n \r\n ))\r\n }\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n },\r\n transformOrigin: {\r\n vertical: 'top',\r\n horizontal: 'left',\r\n },\r\n getContentAnchorEl: null,\r\n className: 'asset-mobile-tabs',\r\n PaperProps: {\r\n style: { width: isMobile ? '100%' : '340px' },\r\n className: 'asset-mobile-tabs-paper',\r\n },\r\n }}\r\n addChevron\r\n >\r\n {selectedTab.Name}\r\n \r\n {!!tabPanels && tabPanels.length > 0 ? (\r\n {tabPanels}\r\n ) : (\r\n \r\n {tabs.map((item, index) => (\r\n \r\n {item.Content}\r\n \r\n ))}\r\n \r\n )}\r\n {/* {tabs.map((item, index) => (\r\n \r\n {item.Content}\r\n \r\n ))} */}\r\n \r\n );\r\n}\r\n","import { BasicTabs } from 'app/components/BasicTabs';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport { TabPanel, TabPanelProps } from 'app/components/BasicTabs/TabPanel';\r\nimport * as React from 'react';\r\nimport { AssetMobileDropDownTabs } from './AssetMobileDropDownTabs';\r\n\r\nexport interface AssetDetailsTabsProps {\r\n tabs: TabContent[];\r\n shortView: boolean;\r\n isMobile: boolean;\r\n}\r\nexport function AssetDetailsTabs(props: AssetDetailsTabsProps) {\r\n const { tabs, shortView, isMobile } = props;\r\n\r\n const [selectedTab, setSelectedTab] = React.useState(tabs[0]);\r\n\r\n const tabsId = 'assetdetails-tab';\r\n const tabsPanelId = 'assetdetails-tabpanel';\r\n\r\n const handleSelectedTabChange = (newValue: TabContent) => {\r\n setSelectedTab(newValue);\r\n };\r\n const tabsPanels: Array> = React.useMemo(() => {\r\n return tabs.map((item, index) => (\r\n f.Id === selectedTab.Id)}\r\n index={index}\r\n tabsId={tabsId}\r\n tabsPanelId={tabsPanelId}\r\n scrollableContent={true}\r\n key={item.Id}\r\n >\r\n {item.Content}\r\n \r\n ));\r\n }, [selectedTab.Id, tabs]);\r\n return (\r\n \r\n {shortView ? (\r\n \r\n ) : (\r\n f.Id === selectedTab.Id)}\r\n scrollableContent={true}\r\n handleTabChange={handleSelectedTabChange}\r\n tabPanels={tabsPanels}\r\n />\r\n )}\r\n \r\n );\r\n}\r\n","import { IAssetRangeDto } from 'api/odata/generated/complexTypes/IAssetRangeDto';\r\nimport { Entity } from 'types/common';\r\nimport { AlertInfo, IAsset } from '../IAsset';\r\nimport { IAssetAssemblyStructure } from '../IAssetAssemblyStructure';\r\nimport { IAssetRow } from '../IAssetRow';\r\n\r\nexport interface RawSection {\r\n Id: string;\r\n Index: number;\r\n SectionName: boolean;\r\n remove: boolean;\r\n}\r\nexport interface Section {\r\n Id: string;\r\n row: IAssetRow;\r\n rows: IAssetRow[];\r\n}\r\nexport interface Sections {\r\n leftSections: Section[];\r\n rightSections: Section[];\r\n}\r\nexport interface SectionsProps {\r\n sections: Section[];\r\n data?: IAsset;\r\n}\r\nexport interface AssetDetailsAdditionalData {\r\n ApprovalRequired: boolean;\r\n Status: string;\r\n StatusId: number;\r\n AssemblyStructure?: IAssetAssemblyStructure;\r\n HideTrainingSession: boolean;\r\n Range: IAssetRangeDto[];\r\n ForceTutoring: boolean;\r\n AutoMode?: number;\r\n Allowed_ByTraining?: boolean;\r\n CanStartUsage: boolean;\r\n CanEndUsage: boolean;\r\n UsageId?: number;\r\n EndUsageIds?: number[];\r\n Alerts?: Entity[];\r\n PlanedEventsEnabled: boolean;\r\n AlertInfo?: AlertInfo;\r\n NotifyExists?: boolean;\r\n CanBeCreatedFromLinkOnly?: boolean;\r\n NotAllowReservations: boolean | null;\r\n ShowFeed?: boolean;\r\n AssemblyId: number | null;\r\n CanRequestAccess: boolean;\r\n ApprovalStatusId: number | null;\r\n}\r\n\r\nexport class CountersForTabs {\r\n Reservations: { Enabled: boolean; Count: number } = {\r\n Enabled: true,\r\n Count: 0,\r\n };\r\n Schedule: { Enabled: boolean; Count: number } = {\r\n Enabled: true,\r\n Count: 0,\r\n };\r\n WorkOrders: { Enabled: boolean; Count: number } = {\r\n Enabled: true,\r\n Count: 0,\r\n };\r\n Calibrations: { enabled: boolean; Count: number } = {\r\n enabled: true,\r\n Count: 0,\r\n };\r\n Publications: { Enabled: boolean; Count: number } = {\r\n Enabled: true,\r\n Count: 0,\r\n };\r\n TrainingSessions: { Enabled: boolean; Count: number } = {\r\n Enabled: true,\r\n Count: 0,\r\n };\r\n}\r\nexport const ExpandableRows: Array = [\r\n //'Alerts',\r\n 'Tags',\r\n 'Suppliers',\r\n 'Contacts',\r\n 'Experts',\r\n 'AssetAccessories',\r\n 'ServiceGroup',\r\n 'AssetCat',\r\n 'AvailabilityType',\r\n 'ExtraDDL0',\r\n 'ExtraDDL1',\r\n 'ExtraDDL2',\r\n 'ExtraDDL3',\r\n 'ExtraDDL4',\r\n 'ExtraDDL5',\r\n 'ExtraDDL6',\r\n 'ExtraDDL7',\r\n 'ExtraDDL8',\r\n 'ExtraDDL9',\r\n 'ExtraDDL10',\r\n 'ExtraDDL11',\r\n 'ExtraDDL12',\r\n 'ExtraDDL13',\r\n 'ExtraDDL14',\r\n 'ExtraDDL15',\r\n //'Articles',\r\n];\r\nexport const DefaultRows: Array = [\r\n //'ImageName',\r\n //'DivisionName',\r\n //'AvailabilityType',\r\n 'Articles',\r\n 'Comments',\r\n];\r\nexport const DefaultAttributes: Array = [\r\n 'Id',\r\n 'Name',\r\n 'ImageName',\r\n 'ServiceId',\r\n 'ServiceType',\r\n 'AvailabilityType',\r\n 'CommentsAreStaffonly',\r\n 'ServiceGroup',\r\n];\r\n","import * as React from 'react';\r\nimport { useCallback, useEffect, useMemo, useState, Fragment } from 'react';\r\nimport {\r\n selectAppSettings,\r\n selectAssetPopupSettings,\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectGlobalSettingBool,\r\n selectglobalSettings,\r\n selectIsAuthenticated,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nimport { IAsset } from './IAsset';\r\nimport { IAssetRow } from './IAssetRow';\r\nimport { getRows } from './Rows';\r\nimport { Badge, MenuItem } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { buildURL, toRootedURL } from 'utils/url-utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useTopAssetActionsDropDown } from './components/TopAssetActionsDropDown';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { CreateAnAssetRelatedEvent } from './CreateAnAssetRelatedEvent';\r\nimport {\r\n AvailabilityTypes,\r\n AvailabilityTypesUnion,\r\n} from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { AssetDetailsTabContent } from './components/AssetDetailsTabContent';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AssetBookingRules } from './components/AssetBookingRules';\r\nimport {\r\n AssetTrainingSessions,\r\n GetTrainingSessionsTableCount,\r\n} from './components/AssetTrainingSessions';\r\nimport {\r\n AssetArticlesTable,\r\n GetArticlesTableCount,\r\n} from './components/AssetArcticlesTable';\r\nimport {\r\n AssetWorkOrders,\r\n GetWorkOrdersTableCount,\r\n} from './components/AssetWorkOrders';\r\nimport {\r\n GetAlertsEnabled,\r\n GetReservationEnabled,\r\n GetUsageEnabled,\r\n addArrayItemByName,\r\n isBookable,\r\n moveArrayItem,\r\n fetchAssetBy,\r\n fetchAssetAdditionalData,\r\n moveArrayItemByName,\r\n isOnlineService,\r\n AssetIdentifier,\r\n AssetIdIdentifier,\r\n AssetServiceIdentifier,\r\n AssetInternalCodeIdentifier,\r\n} from './components/Utils';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport { BadgeCounter } from './components/BadgeCounter';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { EndUsageConfirm, EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { AssetDetailsApi } from 'api/AssetDetailsApi';\r\nimport { AssetDetailsTabs } from './components/AssetDetailsTabs';\r\nimport { MismatchCore } from './components/MismatchCoreMessage';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport {\r\n AssetDetailsAdditionalData,\r\n CountersForTabs,\r\n DefaultAttributes,\r\n DefaultRows,\r\n ExpandableRows,\r\n} from './components/types';\r\nimport {\r\n AssetTypes,\r\n GetAssetTypeFrom,\r\n IsAssetFieldEnabled,\r\n IsAssetFieldIsPublic,\r\n} from 'types/AppSettings';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from '../WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { TrendingUpRounded } from '@material-ui/icons';\r\nimport { ReportConsumablesProps } from '../OtherServiceDetails/ReportConsumables';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { Messages } from 'app/components/Messages';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { NotFoundPage } from '../NotFoundPage';\r\n\r\nexport function alertsEnabled(availabilityType: AvailabilityTypesUnion) {\r\n switch (availabilityType) {\r\n case 'FreelyBookable':\r\n case 'LoanableEquipment':\r\n case 'LectureRoom':\r\n case 'TrainingProgram':\r\n case 'NotAvailable':\r\n case 'AvailableNotBookable':\r\n return true;\r\n case 'ServiceGroup':\r\n case 'SuperGroup':\r\n case 'ServiceRelated':\r\n case 'RequestRelated':\r\n return false;\r\n default:\r\n assertExhaustive(availabilityType);\r\n }\r\n}\r\n\r\nconst maxLeftTopButtonsLength = 2;\r\nconst countersForTabs = new CountersForTabs();\r\n\r\nexport interface AssetPopUpProps extends CoverProps {\r\n identifier: AssetIdentifier;\r\n onClose?: () => void;\r\n showAllCores?: boolean;\r\n useSidePanel: boolean;\r\n useRedirectToDash?: boolean;\r\n addFromCalendar?: boolean;\r\n}\r\n\r\nexport const AssetPopUp = ({\r\n identifier,\r\n onClose,\r\n showAllCores,\r\n useSidePanel = true,\r\n useRedirectToDash,\r\n isCover,\r\n addFromCalendar = true,\r\n\r\n closeCover,\r\n ...props\r\n}: AssetPopUpProps) => {\r\n const { t } = useTranslation();\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const history = useHistory();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n\r\n const [rows, setRows] = useState([]);\r\n const [selectColumns, setSelectColumns] = useState('');\r\n const [expandColumns, setExpandColumns] = useState('');\r\n const [data, setData] = useState();\r\n const [buttonsData, setButtonsData] = useState();\r\n const [loading, setLoading] = useState(true);\r\n const [idChanged, setIdChanged] = useState(false);\r\n const [loadingAdditionalData, setLoadingAdditionalData] = useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [\r\n loadingButtonsAdditionalData,\r\n setLoadingButtonsAdditionalData,\r\n ] = useState(undefined);\r\n const [openEndUsage, setOpenEndUsage] = useState(false);\r\n const [endUsageProcessing, setEndUsageProcessing] = useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const {\r\n cover: assetCover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState();\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const topServiceGroupsIsHidden = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n );\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const [counters, setCounters] = useState(countersForTabs);\r\n const location = useLocation();\r\n const isMobile = DetectIsMobile();\r\n const appSettings = useSelector(selectAppSettings);\r\n const assetProps = useSelector(selectAssetPopupSettings);\r\n const shortView = React.useMemo(() => {\r\n return isMobile || (useSidePanel === true && !sidePanelExpanded) || isCover;\r\n }, [isCover, isMobile, sidePanelExpanded, useSidePanel]);\r\n const isAdmin = React.useMemo(() => {\r\n if (data === undefined) {\r\n return false;\r\n }\r\n const serviceGroupId = data?.ServiceGroup?.Id ?? undefined;\r\n const serviceId = data?.ServiceId ?? undefined;\r\n const serviceTypeId =\r\n data?.ServiceType === null\r\n ? undefined\r\n : ServiceType[data.ServiceType] ?? undefined;\r\n const result =\r\n authenticatedUser?.HasAdminGroupOnlyPermissions(serviceGroupId) ||\r\n authenticatedUser?.HasAdminServiceOnlyPermissions(\r\n serviceTypeId !== undefined ? serviceTypeId : 1,\r\n serviceId,\r\n );\r\n return result ?? false;\r\n }, [authenticatedUser, data]);\r\n const isDashboardCore = React.useMemo(() => {\r\n var path = location.pathname;\r\n return path.toLowerCase() === '/dashboards/core/' + data?.ServiceGroup?.Id;\r\n }, [data?.ServiceGroup?.Id, location.pathname]);\r\n const assetFieldEnabled = React.useCallback(\r\n (\r\n AssetField: AssetAttributes,\r\n AssetAvailabilityType?: AssetTypes,\r\n ): boolean => {\r\n if (isAuthenticated) {\r\n return IsAssetFieldEnabled(\r\n appSettings,\r\n AssetField,\r\n AssetAvailabilityType,\r\n );\r\n } else {\r\n return (\r\n IsAssetFieldEnabled(appSettings, AssetField, AssetAvailabilityType) &&\r\n IsAssetFieldIsPublic(appSettings, AssetField, AssetAvailabilityType)\r\n );\r\n }\r\n },\r\n [appSettings, isAuthenticated],\r\n );\r\n const updateCounters = useCallback(\r\n (name: string, count: number) => {\r\n const tempCounters = Object.assign({}, counters);\r\n tempCounters[name].Count = count;\r\n setCounters(tempCounters);\r\n },\r\n [counters],\r\n );\r\n const updateCountersEnable = useCallback(\r\n (name: string, enabled: boolean) => {\r\n const tempCounters = counters;\r\n tempCounters[name].Enabled = enabled;\r\n setCounters(tempCounters);\r\n },\r\n [counters],\r\n );\r\n const dict: Record = useMemo(() => {\r\n return getRows(\r\n t,\r\n globalSettings,\r\n openPanel,\r\n publicUrl,\r\n isCover,\r\n useSidePanel,\r\n isAdmin,\r\n shortView,\r\n isAuthenticated,\r\n ).reduce((res, current) => {\r\n res[current.Id] = current;\r\n return res;\r\n }, {});\r\n }, [\r\n t,\r\n globalSettings,\r\n openPanel,\r\n publicUrl,\r\n isCover,\r\n useSidePanel,\r\n isAdmin,\r\n shortView,\r\n isAuthenticated,\r\n ]);\r\n\r\n const mismatchCore = useMemo(() => {\r\n return MismatchCore(\r\n data,\r\n isAuthenticated,\r\n topServiceGroupsIsHidden,\r\n selectedServiceGroups,\r\n );\r\n }, [data, isAuthenticated, selectedServiceGroups, topServiceGroupsIsHidden]);\r\n const loadAdditionalData = useCallback(\r\n async (data: IAssetDetails2Dto) => {\r\n const res = Object.assign({}, data);\r\n if (!!res) {\r\n setLoadingAdditionalData(true);\r\n try {\r\n const ad:\r\n | AssetDetailsAdditionalData\r\n | undefined = await fetchAssetAdditionalData({\r\n Id: res.Id,\r\n typeId: AvailabilityTypes[res.AvailabilityType.Id] as number,\r\n isAuth: isAuthenticated,\r\n buttonsData: false,\r\n });\r\n if (!!ad) {\r\n res.ApprovalRequired = ad.ApprovalRequired;\r\n res.Status = ad.Status;\r\n res.StatusId = ad.StatusId;\r\n res.AssetAssemblyStructure = ad.AssemblyStructure;\r\n res.HideTrainingSession = ad.HideTrainingSession;\r\n res.Range = ad.Range;\r\n res.ForceTutoring = ad.ForceTutoring;\r\n res.Allowed_ByTraining = ad.Allowed_ByTraining;\r\n res.EndUsageIds = ad.EndUsageIds;\r\n if (res.ServiceGroup !== undefined && res.ServiceGroup !== null) {\r\n res.ServiceGroup.CanRequestAccess = ad.CanRequestAccess;\r\n res.ServiceGroup.ApprovalStatusId = ad.ApprovalStatusId;\r\n }\r\n res.CanBeCreatedFromLinkOnly = ad.CanBeCreatedFromLinkOnly;\r\n res.NotAllowReservations = ad.NotAllowReservations;\r\n res.ReservationEnabled = GetReservationEnabled(\r\n AvailabilityTypes[res.AvailabilityType.Id],\r\n res.Active,\r\n !!res.NotAllowReservations,\r\n );\r\n setData(res);\r\n }\r\n } finally {\r\n setLoadingAdditionalData(false);\r\n }\r\n }\r\n },\r\n [isAuthenticated],\r\n );\r\n const loadButtonsAdditionalData = useCallback(\r\n async (data: IAssetDetails2Dto) => {\r\n const res = Object.assign({}, buttonsData);\r\n if (!!data) {\r\n setLoadingButtonsAdditionalData(true);\r\n try {\r\n const ad:\r\n | AssetDetailsAdditionalData\r\n | undefined = await fetchAssetAdditionalData({\r\n Id: data.Id,\r\n typeId: AvailabilityTypes[data.AvailabilityType.Id] as number,\r\n isAuth: isAuthenticated,\r\n buttonsData: true,\r\n });\r\n if (!!ad) {\r\n res.AutoMode = ad.AutoMode;\r\n res.UsageEnabled = GetUsageEnabled(\r\n AvailabilityTypes[data.AvailabilityType.Id],\r\n data.Active,\r\n res.AutoMode,\r\n );\r\n res.UsageId = ad.UsageId;\r\n res.CanStartUsage = ad.CanStartUsage;\r\n res.CanEndUsage = ad.CanEndUsage;\r\n res.Alerts = ad.Alerts;\r\n res.PlanedEventsEnabled = ad.PlanedEventsEnabled;\r\n res.AlertInfo = ad.AlertInfo;\r\n res.NotifyExists = ad.NotifyExists;\r\n res.NotAllowReservations = ad.NotAllowReservations;\r\n res.AssemblyId = ad.AssemblyId;\r\n res.ReservationEnabled = GetReservationEnabled(\r\n AvailabilityTypes[data.AvailabilityType.Id],\r\n data.Active,\r\n !!res.NotAllowReservations,\r\n );\r\n res.ShowFeed = ad.ShowFeed;\r\n setButtonsData(res);\r\n }\r\n } finally {\r\n setLoadingButtonsAdditionalData(false);\r\n }\r\n }\r\n },\r\n [buttonsData, isAuthenticated],\r\n );\r\n\r\n const loadCounters = useCallback(\r\n (data: IAssetDetails2Dto) => {\r\n if (data.Id !== undefined) {\r\n if (counters.TrainingSessions.Enabled) {\r\n GetTrainingSessionsTableCount(\r\n data.Id,\r\n 'TrainingSessions',\r\n updateCounters,\r\n data.ServiceGroup.Id,\r\n data.AvailabilityType.Id,\r\n );\r\n }\r\n GetWorkOrdersTableCount(\r\n data.Id,\r\n false,\r\n 'WorkOrders',\r\n updateCounters,\r\n data.ServiceGroup.Id,\r\n data.AvailabilityType.Id,\r\n );\r\n GetWorkOrdersTableCount(\r\n data.Id,\r\n true,\r\n 'Calibrations',\r\n updateCounters,\r\n data.ServiceGroup.Id,\r\n data.AvailabilityType.Id,\r\n );\r\n GetArticlesTableCount(\r\n data.Id,\r\n data.ServiceGroup?.Id,\r\n 'Publications',\r\n updateCounters,\r\n data.AvailabilityType.Id,\r\n );\r\n }\r\n },\r\n [counters.TrainingSessions.Enabled, updateCounters],\r\n );\r\n\r\n const enabledAssetProps = React.useMemo(() => {\r\n const id = data?.AvailabilityType?.Id;\r\n if (id !== undefined) {\r\n const res = assetProps.filter(a =>\r\n assetFieldEnabled(\r\n AssetAttributes[a.Id],\r\n GetAssetTypeFrom(AvailabilityTypes[id]),\r\n ),\r\n );\r\n return res;\r\n } else {\r\n return assetProps;\r\n }\r\n }, [assetFieldEnabled, assetProps, data?.AvailabilityType?.Id]);\r\n const columnNamesFilter = React.useCallback((r: IAssetRow) => {\r\n return (\r\n r.State === undefined &&\r\n [\r\n 'AssetAssemblyStructure',\r\n 'Status',\r\n 'Division',\r\n 'AssetCatGroup',\r\n 'Range',\r\n ].includes(r.PropName ?? r.Id) === false &&\r\n r.Id !== 'ForceTutoring'\r\n );\r\n }, []);\r\n const setRequestParams = React.useCallback(\r\n (rows: IAssetRow[]) => {\r\n if (rows.length > 0) {\r\n let columns = [\r\n ...rows\r\n .filter(r => columnNamesFilter(r))\r\n .map(v => v.PropName ?? v.Id),\r\n ...DefaultAttributes,\r\n ];\r\n setSelectColumns('Active,' + columns.join(','));\r\n setExpandColumns(\r\n columns\r\n .filter(column => ExpandableRows.includes(column))\r\n //.concat('ServiceGroup')\r\n .join(','),\r\n );\r\n }\r\n },\r\n [columnNamesFilter],\r\n );\r\n useEffect(() => {\r\n if (!!data) {\r\n if ((identifier as AssetIdIdentifier).id !== undefined) {\r\n if (data.Id !== (identifier as AssetIdIdentifier).id) {\r\n setIdChanged(true);\r\n }\r\n } else if (\r\n (identifier as AssetServiceIdentifier).serviceId !== undefined &&\r\n (identifier as AssetServiceIdentifier).serviceType !== undefined\r\n ) {\r\n if (\r\n data.ServiceId !== (identifier as AssetServiceIdentifier).serviceId\r\n ) {\r\n setIdChanged(true);\r\n }\r\n } else if (\r\n (identifier as AssetInternalCodeIdentifier).internalCode !== undefined\r\n ) {\r\n if (\r\n data.InternalCode !==\r\n (identifier as AssetInternalCodeIdentifier).internalCode\r\n ) {\r\n setIdChanged(true);\r\n }\r\n }\r\n }\r\n }, [data, identifier]);\r\n useEffect(() => {\r\n moveArrayItem(enabledAssetProps, 'ImageName', 0);\r\n addArrayItemByName(\r\n enabledAssetProps,\r\n 'AssetAssemblyStructure',\r\n 'ImageName',\r\n );\r\n moveArrayItemByName(enabledAssetProps, 'Status', 'ServiceGroup');\r\n const rs = [\r\n ...DefaultRows.map(r => dict[r]),\r\n ...enabledAssetProps.flatMap(assetProp => {\r\n let val = dict[assetProp.Id];\r\n if (!!val) {\r\n val.Name = assetProp.DisplayName ?? val.Name;\r\n if (val.dependencies && !!val.dependencies.length) {\r\n return [val, ...val.dependencies.map(v => dict[v])];\r\n }\r\n }\r\n return val;\r\n }),\r\n ].filter(v => !!v);\r\n setRequestParams(rs);\r\n setRows(rs);\r\n }, [assetProps, dict, enabledAssetProps, setRequestParams]);\r\n useEffect(() => {\r\n if (rows.length === 0 || (data !== undefined && idChanged === false))\r\n return;\r\n setLoading(true);\r\n let active = true;\r\n const cancelToken = httpClient.cancelToken.source();\r\n async function fetchData() {\r\n try {\r\n const params = {\r\n $select: selectColumns,\r\n $expand: expandColumns,\r\n };\r\n\r\n const res = await fetchAssetBy({\r\n id: identifier,\r\n params,\r\n isAuth: isAuthenticated,\r\n });\r\n\r\n if (active && res !== undefined) {\r\n res.Division = res.ServiceGroup?.DivisionName;\r\n res.AssetCatGroup =\r\n res.AssetCat !== null && !!res.AssetCat\r\n ? res.AssetCat.AssetCatGroupName\r\n : null;\r\n res.Status = ' ';\r\n res.AlertsEnabled = isAuthenticated\r\n ? GetAlertsEnabled(\r\n AvailabilityTypes[res.AvailabilityType.Id],\r\n res.Active,\r\n )\r\n : false;\r\n setData(res);\r\n loadButtonsAdditionalData(res);\r\n loadAdditionalData(res);\r\n if (isAuthenticated) {\r\n loadCounters(res);\r\n }\r\n }\r\n setLoading(false);\r\n setIdChanged(false);\r\n } catch (error) {\r\n console.error(error);\r\n setLoading(false);\r\n }\r\n }\r\n\r\n fetchData();\r\n\r\n return () => {\r\n active = false;\r\n setLoading(false);\r\n cancelToken.cancel('cancelled');\r\n };\r\n }, [\r\n data,\r\n expandColumns,\r\n idChanged,\r\n identifier,\r\n isAuthenticated,\r\n loadAdditionalData,\r\n loadButtonsAdditionalData,\r\n loadCounters,\r\n rows.length,\r\n selectColumns,\r\n ]);\r\n\r\n const handleEndUsage = React.useCallback(\r\n (usageData: EndUsageData) => {\r\n if (buttonsData?.UsageId) {\r\n setEndUsageProcessing(true);\r\n AssetDetailsApi.endUsage(buttonsData?.UsageId, usageData)\r\n .then(response => {\r\n setEndUsageProcessing(false);\r\n\r\n if (response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n } else {\r\n setOpenEndUsage(false);\r\n if (data !== undefined) {\r\n loadButtonsAdditionalData(data);\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n response.SuccessMessages.forEach(msg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: msg,\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n response.WarningMessages.forEach(wrnmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'warning',\r\n message: wrnmsg,\r\n }),\r\n ),\r\n );\r\n }\r\n }\r\n })\r\n .catch(e => console.error(e))\r\n .finally(() => setEndUsageProcessing(false));\r\n }\r\n },\r\n [actions, buttonsData?.UsageId, data, dispatch, loadButtonsAdditionalData],\r\n );\r\n\r\n const getTopAssetActionsDropDown = useTopAssetActionsDropDown({\r\n isMismatchCore: mismatchCore,\r\n isAdmin: isAdmin,\r\n });\r\n\r\n const topActions = useMemo(() => {\r\n let buttonActions = [] as ActionRenderer[];\r\n if (\r\n data !== undefined &&\r\n buttonsData !== undefined &&\r\n data.AvailabilityType !== undefined &&\r\n loading === false &&\r\n loadingButtonsAdditionalData === false\r\n ) {\r\n const bookable = isBookable(data.AvailabilityType.Id);\r\n const addWorkOrder = () => {\r\n if (alertsEnabled(data.AvailabilityType.Id) && isAuthenticated) {\r\n buttonActions.push(() => (\r\n \r\n ));\r\n }\r\n };\r\n const addReservation = () => {\r\n if (!buttonsData.AssemblyId && buttonsData.ReservationEnabled) {\r\n buttonActions.push(() => (\r\n }\r\n variant={bookable ? 'main' : 'white'}\r\n title={t(translations.PlaceAReservation)}\r\n disabled={mismatchCore}\r\n instruments={data.ServiceId === null ? [] : [data.ServiceId]}\r\n useSidePanel={useSidePanel}\r\n openPanelOrCover={openPanel}\r\n >\r\n {t(translations.Reservation)}\r\n \r\n ));\r\n }\r\n };\r\n const addServiceRequest = () => {\r\n if (\r\n data.ServiceType === 'Sample' &&\r\n data.CanBeCreatedFromLinkOnly === false\r\n ) {\r\n buttonActions.push(() => (\r\n {\r\n history.push(\r\n '/ServiceRequests?OfflineServiceTypeId=' +\r\n data.ServiceId +\r\n '&Active=true',\r\n );\r\n }}\r\n title={t(translations.SampleRequests)}\r\n startIcon={}\r\n disabled={mismatchCore}\r\n >\r\n {t(translations.SampleRequests)}\r\n \r\n ));\r\n }\r\n };\r\n const addReservationFromCalendar = () => {\r\n if (!buttonsData.AssemblyId && buttonsData.ReservationEnabled) {\r\n buttonActions.push(() => (\r\n }\r\n title={t(translations.PlaceAReservation)}\r\n equipments={data.ServiceId === null ? [] : [data.ServiceId]}\r\n disabled={mismatchCore}\r\n openToBook={true}\r\n target={isAuthenticated ? '_self' : '_blank'}\r\n >\r\n {t(translations.Reservation)}\r\n \r\n ));\r\n }\r\n };\r\n const addUsage = () => {\r\n if (!!buttonsData.UsageEnabled) {\r\n if (!!buttonsData.CanStartUsage && !buttonsData.AssemblyId) {\r\n buttonActions.push(() => (\r\n }\r\n href={toRootedURL(`/Usage.aspx?id=${data.ServiceId}`)}\r\n target={'_blank'}\r\n title={t(translations.StartUsage)}\r\n disabled={mismatchCore}\r\n >\r\n {t(translations.Use)}\r\n \r\n ));\r\n }\r\n if (!!buttonsData.CanEndUsage && !!buttonsData.UsageId) {\r\n buttonActions.push(() => (\r\n }\r\n title={t(translations.StopUsage)}\r\n onClick={() => setOpenEndUsage(true)}\r\n disabled={mismatchCore}\r\n >\r\n {t(translations.Stop)}\r\n \r\n ));\r\n }\r\n }\r\n };\r\n const addTakeDown = () => {\r\n if (\r\n isBookable(data.AvailabilityType?.Id) &&\r\n buttonsData.AlertInfo !== undefined &&\r\n !!buttonsData.PlanedEventsEnabled &&\r\n !!buttonsData.AlertInfo.show &&\r\n isAuthenticated\r\n ) {\r\n if (!buttonsData.AlertInfo.hasDownActive) {\r\n if (\r\n !!buttonsData.AlertInfo.isAdmin &&\r\n !!buttonsData.AlertInfo.assetId\r\n ) {\r\n buttonActions.push(() => (\r\n {\r\n let res = [\r\n \r\n {t(translations.PleaseSelectAnEventType)}\r\n ,\r\n ];\r\n if (buttonsData.Alerts !== undefined) {\r\n res.push(\r\n ...buttonsData.Alerts.map(a => (\r\n \r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: {\r\n queryParams: {\r\n aType: a.Id.toString(),\r\n assetId:\r\n !!buttonsData.AlertInfo &&\r\n !!buttonsData.AlertInfo.assetId\r\n ? buttonsData.AlertInfo.assetId.toString()\r\n : undefined,\r\n down: true.toString(),\r\n\r\n offH: true.toString(),\r\n },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n })\r\n }\r\n key={a.Id + a.Name + 'key'}\r\n >\r\n {a.Name}\r\n \r\n )),\r\n );\r\n }\r\n return res;\r\n }}\r\n >\r\n \r\n \r\n ));\r\n }\r\n } else if (\r\n !!buttonsData.AlertInfo.noAlerts ||\r\n !!buttonsData.AlertInfo.hasActive\r\n ) {\r\n if (\r\n !!buttonsData.AlertInfo.isAdmin &&\r\n !!buttonsData.AlertInfo.alertId\r\n ) {\r\n buttonActions.push(() => (\r\n \r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: {\r\n queryParams: {\r\n id: (buttonsData.AlertInfo?.alertId ?? -1).toString(),\r\n Up: TrendingUpRounded.toString(),\r\n },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState)\r\n }\r\n >\r\n \r\n \r\n ));\r\n }\r\n }\r\n }\r\n };\r\n\r\n const addConsumable = () => {\r\n if (data.ServiceType === 'Offline' && isAuthenticated) {\r\n buttonActions.push(() => (\r\n }\r\n title={t(translations.ReportAConsumable)}\r\n onClick={() => {\r\n let params = {\r\n useSidePanel: true,\r\n queryParams: {\r\n stid: data.ServiceId?.toString(),\r\n user: authenticatedUser?.Id,\r\n },\r\n } as ReportConsumablesProps;\r\n openPanel({\r\n renderPageType: RenderPageType.ReportConsumables,\r\n renderPageProps: params,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n }}\r\n //href={toRootedURL(`/reportConsumables?stid=${data.ServiceId}`)}\r\n >\r\n {t(translations.LogConsumables)}\r\n \r\n ));\r\n }\r\n };\r\n\r\n const addCoreBoard = () => {\r\n if (!isDashboardCore) {\r\n buttonActions.push(() => (\r\n {\r\n dispatch(\r\n actions.saveGlobalServiceGroupFilter([\r\n {\r\n Id: data.ServiceGroup?.Id,\r\n Name: data.ServiceGroup?.Name,\r\n },\r\n ]),\r\n );\r\n dispatch(layoutActions.resetSidePanel());\r\n history.push('/dashboards/core/' + data.ServiceGroup?.Id ?? '');\r\n }}\r\n >\r\n {t(translations.CoreBoard)}\r\n \r\n ));\r\n }\r\n };\r\n const addRequestAccess = () => {\r\n if (!isAdmin && isAuthenticated) {\r\n const approvalStatus =\r\n data.ServiceGroup?.ApprovalStatusId ===\r\n ServiceGroupRegistrationStatus.Approved;\r\n if (data.ServiceGroup?.CanRequestAccess && !approvalStatus) {\r\n buttonActions.push(() => (\r\n {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${data.ServiceGroup?.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n }}\r\n >\r\n {t(translations.RequestAccess)}\r\n \r\n ));\r\n } else {\r\n buttonActions.push(() => (\r\n \r\n {t(\r\n translations[\r\n ServiceGroupRegistrationStatus[\r\n data.ServiceGroup?.ApprovalStatusId ?? 0\r\n ]\r\n ],\r\n )}\r\n \r\n ));\r\n }\r\n }\r\n };\r\n if (\r\n data.ServiceType === 'Sample' &&\r\n data.CanBeCreatedFromLinkOnly === false\r\n ) {\r\n addServiceRequest();\r\n }\r\n if (bookable) {\r\n if (addFromCalendar) {\r\n addReservationFromCalendar();\r\n } else {\r\n addReservation();\r\n }\r\n\r\n addUsage();\r\n addWorkOrder();\r\n addTakeDown();\r\n } else {\r\n addWorkOrder();\r\n addTakeDown();\r\n addUsage();\r\n addReservation();\r\n addConsumable();\r\n }\r\n addCoreBoard();\r\n addRequestAccess();\r\n if (isAuthenticated) {\r\n const assetActionsDropDown = getTopAssetActionsDropDown({\r\n data,\r\n buttonsData,\r\n });\r\n\r\n buttonActions.push(...assetActionsDropDown.map(item => () => item));\r\n }\r\n }\r\n return buttonActions;\r\n }, [\r\n actions,\r\n addFromCalendar,\r\n authenticatedUser?.Id,\r\n buttonsData,\r\n data,\r\n dispatch,\r\n getTopAssetActionsDropDown,\r\n history,\r\n isAdmin,\r\n isAuthenticated,\r\n isDashboardCore,\r\n layoutActions,\r\n loading,\r\n loadingButtonsAdditionalData,\r\n mismatchCore,\r\n openPanel,\r\n t,\r\n useSidePanel,\r\n ]);\r\n\r\n const tabs = useMemo(() => {\r\n if (data !== undefined) {\r\n const res: TabContent[] = [];\r\n res.push({\r\n Name: t(translations.AssetDetailsTab_Details),\r\n Id: 'details',\r\n Content: (\r\n \r\n ),\r\n });\r\n if (isBookable(data.AvailabilityType?.Id) && isAuthenticated) {\r\n res.push({\r\n Name: t(translations.BookingRules),\r\n Id: 'BookingRules',\r\n Content: (\r\n \r\n ),\r\n });\r\n }\r\n if (isBookable(data.AvailabilityType?.Id) && isAuthenticated) {\r\n if (\r\n data.AvailabilityType?.Id !== 'LectureRoom' ||\r\n (!data.HideTrainingSession && data.Active)\r\n ) {\r\n const serviceType =\r\n data.ServiceType !== null\r\n ? ServiceType[data.ServiceType]\r\n : undefined;\r\n res.push({\r\n Name: t(translations.TrainingSessions),\r\n Id: 'trainingSessions',\r\n Content: (\r\n \r\n ),\r\n endIcon: ,\r\n });\r\n updateCountersEnable('TrainingSessions', true);\r\n } else {\r\n updateCountersEnable('TrainingSessions', false);\r\n }\r\n }\r\n if (isAuthenticated) {\r\n res.push({\r\n Name: t(translations.AssetDetailsTab_WorkOrders),\r\n Id: 'workOrders',\r\n Content: (\r\n \r\n ),\r\n endIcon: ,\r\n });\r\n }\r\n if (isAuthenticated) {\r\n res.push({\r\n Name: t(translations.Calibrations),\r\n Id: 'calibrations',\r\n Content: (\r\n \r\n ),\r\n endIcon: ,\r\n });\r\n }\r\n if (isAuthenticated) {\r\n res.push({\r\n Name: t(translations.Publications),\r\n Id: 'publications',\r\n Content: (\r\n \r\n ),\r\n endIcon: ,\r\n });\r\n }\r\n /*res.push({\r\n Name:\r\n t(translations.AssetDetailsTab_MyReservations) +\r\n ` (${counters.Reservations.Count})`,\r\n Id: 'my_reservations',\r\n Content: <>reservations,\r\n });*/\r\n /*res.push({\r\n Name: t(translations.AssetDetailsTab_Schedule),\r\n Id: 'schedule',\r\n Content: <>schedule,\r\n });*/\r\n return res;\r\n } else return [];\r\n }, [\r\n counters.Calibrations.Count,\r\n counters.Publications.Count,\r\n counters.TrainingSessions.Count,\r\n counters.WorkOrders.Count,\r\n data,\r\n isAdmin,\r\n isAuthenticated,\r\n isCover,\r\n loadingAdditionalData,\r\n openPanel,\r\n rows,\r\n shortView,\r\n t,\r\n updateCountersEnable,\r\n useSidePanel,\r\n ]);\r\n\r\n const handleCloselClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n onClose: () => {\r\n !!onClose && onClose();\r\n },\r\n } as SidePanelCloseState);\r\n }, [closePanel, isCover, onClose, useSidePanel]);\r\n\r\n // more direct loading/fetch state indicator will be more appropriate here to determine that fetch operations are finished and no asset details were found\r\n const dataFound = data && tabs !== undefined && tabs.length > 0;\r\n if (!loading && !dataFound && data === undefined) {\r\n return ;\r\n }\r\n return (\r\n \r\n {dataFound ? (\r\n \r\n \r\n {isAuthenticated && buttonsData?.UsageId && (\r\n \r\n setOpenEndUsage(false)}\r\n onConfirm={handleEndUsage}\r\n />\r\n \r\n )}\r\n \r\n \r\n ) : (\r\n <>{t(translations.err_Equipment_NotFound)}\r\n )}\r\n \r\n }\r\n closeSidePanel={handleCloselClick}\r\n rightTopActions={!shortView ? topActions : undefined}\r\n rightActionsLoading={!shortView && loadingButtonsAdditionalData}\r\n leftTopActions={shortView ? topActions : undefined}\r\n leftActionsLoading={shortView && loadingButtonsAdditionalData}\r\n maxLeftTopButtonsLength={\r\n data?.ReservationEnabled ? maxLeftTopButtonsLength : 1\r\n }\r\n rightTopActionsLength={data?.ReservationEnabled ? 2 : 1}\r\n isCover={isCover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n cover={assetCover}\r\n coverClosed={coverClosed}\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * Link\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport * as H from 'history';\r\nimport { IPathAndQuery, toQueryString } from 'utils/url-utils';\r\nimport {\r\n Link as RouterLink,\r\n LinkProps as RouterLinkProps,\r\n} from 'react-router-dom';\r\n\r\nexport interface LinkProps extends Omit, 'to'> {\r\n to: t;\r\n}\r\n\r\ntype routerLinkType = H.LocationDescriptor;\r\n//| ((location: H.Location) => H.LocationDescriptor);\r\n\r\ntype t = routerLinkType | IPathAndQuery;\r\n/**\r\n * Link to a resource inside the larger system but external to the React app\r\n * Renders ({ to, ...props }: LinkProps) {\r\n const toto = toLocationDescriptor(to);\r\n return ;\r\n}\r\n\r\nexport function toLocationDescriptor(\r\n tt: t,\r\n): H.LocationDescriptorObject {\r\n if (isPathAndQuery(tt)) {\r\n return toLocationDescriptorObject(tt as IPathAndQuery);\r\n } else {\r\n return tt as H.LocationDescriptorObject;\r\n }\r\n}\r\n\r\nfunction isPathAndQuery(value: t) {\r\n var s = value as IPathAndQuery;\r\n if (value === null) {\r\n return false;\r\n }\r\n\r\n return (\r\n s.path !== undefined &&\r\n s.search !== undefined &&\r\n typeof s.search === 'object'\r\n );\r\n}\r\n\r\nfunction toLocationDescriptorObject(\r\n to: IPathAndQuery,\r\n): H.LocationDescriptorObject {\r\n return {\r\n pathname: to.path,\r\n search: toQueryString(to.search).toString(),\r\n };\r\n}\r\n","/**\r\n *\r\n * ActionIconButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\n\r\nexport interface ActionIconButtonProps {\r\n onClick?: React.MouseEventHandler;\r\n disabled?: boolean;\r\n icon: IconProp;\r\n title: string;\r\n variant?: ButtonsVariant;\r\n size?: 'large' | 'medium' | 'small' | 'xs';\r\n autoFocus?: boolean;\r\n shape?: 'circle' | 'square';\r\n customIcon?: React.ReactNode;\r\n to?: string;\r\n href?: string | IPathAndQuery;\r\n id?: string;\r\n target?: string;\r\n}\r\n\r\nexport function ActionIconButton({\r\n disabled,\r\n onClick,\r\n title,\r\n icon,\r\n variant,\r\n size,\r\n autoFocus,\r\n shape,\r\n customIcon,\r\n to,\r\n href,\r\n id,\r\n target,\r\n ...other\r\n}: ActionIconButtonProps) {\r\n return (\r\n \r\n \r\n \r\n {customIcon ? customIcon : }\r\n \r\n \r\n \r\n );\r\n}\r\n","import { BaseToggleButtonGroup } from 'app/components/BasicButtons/BaseToggleButtonGroup';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SwitchActionsProps {\r\n target: SwitchTarget;\r\n getProps: () => ReservationDetailsProps | WorkOrderDetailsProps;\r\n}\r\nexport enum SwitchTarget {\r\n WorkOrder = 1,\r\n Reservation = 2,\r\n}\r\n\r\nexport function SwitchActions(props: SwitchActionsProps) {\r\n const { target, getProps } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { updateValue: updateX } = useProfileSetting({\r\n profileSettingKey: 'EmptySlotAdminClick',\r\n });\r\n const openReservation = React.useCallback(() => {\r\n let params = getProps() as ReservationDetailsProps;\r\n setTimeout(\r\n () =>\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ReservationDetails,\r\n props: params,\r\n }),\r\n ),\r\n null,\r\n );\r\n updateX(EmptySlotAdminClick.ReservationsOnly.toString());\r\n }, [actions, dispatch, getProps, updateX]);\r\n const openWorkOrder = React.useCallback(() => {\r\n let params = getProps() as WorkOrderDetailsProps;\r\n setTimeout(\r\n () =>\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.WorkOrderDetails,\r\n props: params,\r\n }),\r\n ),\r\n null,\r\n );\r\n updateX(EmptySlotAdminClick.DownTimeOnly.toString());\r\n }, [actions, dispatch, getProps, updateX]);\r\n const options = [\r\n {\r\n Id: 2,\r\n Name: t(translations.SwitchToReservationTitle),\r\n },\r\n {\r\n Id: 1,\r\n Name: t(translations.SwitchToDowntime),\r\n },\r\n ];\r\n const [selectedOption, setSelectedOption] = React.useState>(\r\n options.filter(f => f.Id !== (target as number))[0],\r\n );\r\n const handleChange = (item: Entity | null) => {\r\n let selected = item === null ? options[0] : item;\r\n if (selected.Id === (target as number)) {\r\n setSelectedOption(selected);\r\n if (selected.Id === (SwitchTarget.WorkOrder as number)) {\r\n openWorkOrder();\r\n } else {\r\n openReservation();\r\n }\r\n }\r\n };\r\n return (\r\n \r\n []}\r\n onChange={handleChange}\r\n fullWidth={true}\r\n value={selectedOption}\r\n orientation={'horizontal'}\r\n variant={'white'}\r\n />\r\n {/* openReservation()}\r\n >\r\n {t(translations.SwitchToReservationTitle)}\r\n \r\n openWorkOrder()}\r\n >\r\n {t(translations.SwitchToDowntime)}\r\n */}\r\n \r\n );\r\n}\r\n","import { ServiceType } from 'api/odata/generated/enums/ServiceType';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { IReservationEquipmentDto } from './types';\r\n\r\n/**\r\n * This function determines if the budgets are enabled and should be visible for particular online services selection\r\n * @param globalSettings global settings\r\n * @param equipments related online services\r\n * @returns\r\n */\r\n\r\nexport function getBudgetVisible(\r\n globalSettings: Pick<\r\n GlobalSettingsType,\r\n | 'billingModuleEnabled'\r\n | 'budgetModuleEnabled'\r\n | 'priceSheetPricing'\r\n | 'projectsAreOptional'\r\n >,\r\n equipments: Array<\r\n Pick<\r\n IReservationEquipmentDto,\r\n 'HideProjects' | 'BudgetsTurnedOn' | 'Billable'\r\n > & { ServiceTypeId: number }\r\n >,\r\n): boolean {\r\n if (!globalSettings.budgetModuleEnabled) {\r\n return false;\r\n }\r\n\r\n const isNotBillable = GetIsNotBillable(globalSettings, equipments);\r\n if (isNotBillable !== undefined) {\r\n return isNotBillable;\r\n }\r\n\r\n // HideProjects is enabled only when ProjectsAreOptional is turned on in the system settings\r\n if (globalSettings.projectsAreOptional) {\r\n if (equipments.every(f => f.HideProjects)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Returns false in case the instrument is not billable given it makes any sense (e.g. billing is turned on)\r\n * Otherwise it's undefined\r\n * @param globalSettings\r\n * @param equipments\r\n * @returns\r\n */\r\n\r\nexport function GetIsNotBillable(\r\n globalSettings: Pick<\r\n GlobalSettingsType,\r\n 'billingModuleEnabled' | 'budgetModuleEnabled' | 'priceSheetPricing'\r\n >,\r\n equipments?: Array<\r\n Pick & {\r\n ServiceTypeId: number;\r\n }\r\n >,\r\n) {\r\n if (globalSettings.billingModuleEnabled) {\r\n // Billable is only shown on the instrument details when the PriceSheetPricing is off.\r\n // Otherwise the instruments will with Billable = false, which should be ignored since they are in fact billable\r\n // on reservationEdit Billable might have \"true\" which is different from the actual value in db/model\r\n if (globalSettings.priceSheetPricing === false) {\r\n if (\r\n equipments?.every(\r\n f => f.Billable === false && f.ServiceTypeId === ServiceType.Online,\r\n )\r\n ) {\r\n return false;\r\n }\r\n }\r\n\r\n // budgets turned off on service group level (BudgetsTurnedOn)\r\n // active only if the budgets are turned on\r\n if (\r\n globalSettings.budgetModuleEnabled === true &&\r\n equipments?.every(f => f.BudgetsTurnedOn === false)\r\n ) {\r\n return false;\r\n }\r\n }\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport React from 'react';\r\n\r\nexport interface OpenWorkOrderButtonProps extends ButtonProps {\r\n buttonName: React.ReactNode;\r\n orderId: number;\r\n bringBackUp?: boolean;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}\r\nexport function OpenWorkOrderButton(props: OpenWorkOrderButtonProps) {\r\n const {\r\n buttonName,\r\n orderId,\r\n bringBackUp,\r\n useSidePanel,\r\n openPanelWithCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const { openPanel } = useSidePanelState();\r\n const openOrder = () => {\r\n let orderProps = {\r\n queryParams: {\r\n id: orderId.toString(),\r\n Up: (bringBackUp === true).toString(),\r\n },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps;\r\n let panelProps = {\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: orderProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState;\r\n !!openPanelWithCover\r\n ? openPanelWithCover(panelProps)\r\n : openPanel(panelProps);\r\n };\r\n\r\n return (\r\n openOrder()}\r\n >\r\n {buttonName || t(translations.menu_EditWorkOrder)}\r\n \r\n );\r\n}\r\nexport const WorkOrderLink = (props: {\r\n id: number;\r\n Up?: boolean;\r\n children: React.ReactNode;\r\n title?: string;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n const { t } = useTranslation();\r\n const openOrder = useOpenWorkOrderPopUp();\r\n const open = () => {\r\n openOrder(\r\n {\r\n id: props.id,\r\n Up: props.Up,\r\n useSidePanel: props.useSidePanel,\r\n },\r\n props.openPanelWithCover,\r\n );\r\n };\r\n return (\r\n \r\n open()}\r\n color=\"textPrimary\"\r\n >\r\n {props.children}\r\n \r\n \r\n );\r\n};\r\n\r\nexport const useOpenWorkOrderPopUp = () => {\r\n const { openPanel } = useSidePanelState();\r\n return React.useCallback(\r\n (\r\n props: { id: number; Up?: boolean; useSidePanel?: boolean },\r\n openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n ) => {\r\n let orderProps = {\r\n queryParams: {\r\n id: props.id.toString(),\r\n Up: (props.Up === true).toString(),\r\n },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps;\r\n const panelState = {\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: orderProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n } as SidePanelOpenState;\r\n if (!!openPanelWithCover) {\r\n openPanelWithCover(panelState);\r\n } else {\r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: orderProps,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState);\r\n }\r\n },\r\n [openPanel],\r\n );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const useCommentStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n commentSection: {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n padding: theme.spacing(2, 0),\r\n gap: '16px',\r\n alignSelf: 'stretch',\r\n borderBottom: `1px solid ${theme.palette.common.grayDividers}`,\r\n width: '100%',\r\n },\r\n commentTextFiles: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n flex: '1 0 0',\r\n gap: '16px',\r\n },\r\n commentText: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '8px',\r\n alignSelf: 'stretch',\r\n },\r\n nameAndTime: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '4px',\r\n alignSelf: 'stretch',\r\n },\r\n nameTitleButtons: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '12px',\r\n alignSelf: 'stretch',\r\n },\r\n nameTitle: {\r\n flex: '1 0 0',\r\n },\r\n }),\r\n);\r\nexport const useContainerStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n commentsContainer: {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n flexDirection: 'column',\r\n gap: '8px',\r\n width: '100%',\r\n },\r\n sectionTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n paddingBottom: '0px',\r\n gap: '16px',\r\n alignSelf: 'stretch',\r\n },\r\n controlBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n //paddingTop: '16px',\r\n alignItems: 'flex-start',\r\n gap: '24px',\r\n alignSelf: 'stretch',\r\n },\r\n addCommentBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n alignSelf: 'stretch',\r\n },\r\n }),\r\n);\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n section: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n //padding: theme.spacing(0, 4),\r\n maxWidth: '100%',\r\n },\r\n leftSide: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n flexGrow: 1,\r\n padding: 0,\r\n width: '100%',\r\n },\r\n rightSide: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n flexGrow: 0,\r\n padding: 0,\r\n },\r\n form: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n width: '100%',\r\n },\r\n fields: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n boxSizing: 'border-box',\r\n width: '100%',\r\n gap: '16px',\r\n //paddingBottom: '36px',\r\n },\r\n // fieldsSpacing: {\r\n // width: 'calc(100% + 24px)',\r\n // margin: '-12px',\r\n // '& > $row': {\r\n // padding: theme.spacing(0.75, 0, 0.75, 0),\r\n // },\r\n // },\r\n row: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n width: '100%',\r\n gap: '16px',\r\n },\r\n sectionTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: theme.spacing(0, 0, 2.5),\r\n },\r\n alertSpacing: {\r\n width: 'calc(100% + 24px)',\r\n margin: '12px -12px 12px -12px',\r\n },\r\n item: {\r\n flexBasis: '100%',\r\n maxWidth: '100%',\r\n },\r\n itemCheck: {\r\n display: 'flex',\r\n justifyContent: 'start',\r\n alignItems: 'center',\r\n flexDirection: 'row',\r\n },\r\n }),\r\n);\r\n","import { Grid } from '@material-ui/core';\r\nimport { Body, InputLabel } from '../Typography';\r\nimport { CommentFile } from './IComment';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useState } from 'react';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { DownloadFileButon } from '../DownloadFileButton';\r\n\r\nconst fileSizeToString = (size: number, dp: number = 1) => {\r\n const thresh = 1000;\r\n if (Math.abs(size) < thresh) {\r\n return size + ' B';\r\n }\r\n const units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n let i = -1;\r\n const r = 10 ** dp;\r\n do {\r\n size /= thresh;\r\n i++;\r\n } while (\r\n Math.round(Math.abs(size) * r) / r >= thresh &&\r\n i < units.length - 1\r\n );\r\n return size.toFixed(dp) + ' ' + units[i];\r\n};\r\n\r\nexport const FileButton = ({\r\n file,\r\n canRemove,\r\n onDeleteFile,\r\n}: {\r\n file: CommentFile;\r\n canRemove: Boolean;\r\n onDeleteFile: (id: string) => void;\r\n}) => {\r\n const shortenName = (name: string) => {\r\n const [rawName, suffix] = name.split('.');\r\n if (rawName.length < 25) return name;\r\n return rawName.slice(0, 24) + '...' + suffix;\r\n };\r\n const { t } = useTranslation();\r\n const [openDelete, setOpenDelete] = useState(false);\r\n const sendNotifications = useResponseModel();\r\n const close = () => setOpenDelete(false);\r\n const onDelete = useCallback(() => {\r\n close();\r\n onDeleteFile(file.Id);\r\n sendNotifications({\r\n ErrorMessages: [],\r\n SuccessMessages: [t(translations.msg_DeleteFile)],\r\n WarningMessages: [],\r\n });\r\n }, [file.Id, onDeleteFile, sendNotifications, t]);\r\n return (\r\n \r\n \r\n }\r\n />\r\n \r\n \r\n \r\n \r\n {shortenName(file.Name)}}\r\n />\r\n \r\n \r\n \r\n {file.Size && {fileSizeToString(file.Size)}}\r\n \r\n \r\n {canRemove && (\r\n \r\n setOpenDelete(true)}\r\n />\r\n \r\n CommentsApi.removeFile(file.Id)\r\n .then(onDelete)\r\n .catch(e => {\r\n console.error(e);\r\n sendNotifications({\r\n ErrorMessages: [t(translations.err_DeleteFileFailure)],\r\n SuccessMessages: [],\r\n WarningMessages: [],\r\n });\r\n })\r\n }\r\n onCancel={close}\r\n onClose={close}\r\n body={undefined}\r\n title={t(translations.AreYouSure)}\r\n isOpen={openDelete}\r\n />\r\n \r\n )}\r\n \r\n );\r\n};\r\n","import axios from 'axios';\r\nimport { CancelTokenSource } from 'axios';\r\nimport { UploadLargeFileApi } from './Api';\r\nimport { CancelToken } from 'axios';\r\nimport { Guid } from 'guid-typescript';\r\n\r\nexport interface AddFileResponse {\r\n Result: boolean;\r\n FileId: Guid | null;\r\n UploadId: string | null;\r\n ETag: string | null;\r\n PartNumber: number | null;\r\n Message: string | null;\r\n NeedCompleteMultipartUpload: boolean;\r\n}\r\nexport interface S3DS_UploadRespunse {\r\n ETag: string;\r\n PartNumber: number;\r\n}\r\n// Each part must be at least 5 MB in size, except the last part.\r\n// https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html\r\nexport const minChunkSize = 5 * 1024 * 1024;\r\nexport class UploadLargeFile {\r\n private cancelTokenSource?: CancelTokenSource;\r\n private cancelToken?: any;\r\n private _pause: boolean = false;\r\n private _busy: boolean = false;\r\n public finished: boolean = false;\r\n public fileId: Guid | null = null;\r\n public uploadId: string | null = null;\r\n public NeedCompleteMultipartUpload: boolean = false;\r\n private uploadResponses: S3DS_UploadRespunse[] = [];\r\n public get pause() {\r\n return this._pause;\r\n }\r\n public set pause(value: boolean) {\r\n if (this._pause !== value) {\r\n this._pause = value;\r\n if (value) {\r\n this.cancel();\r\n }\r\n }\r\n }\r\n public get busy() {\r\n return this._busy;\r\n }\r\n public set busy(value: boolean) {\r\n this._busy = value;\r\n }\r\n public cancel() {\r\n this.cancelTokenSource?.cancel();\r\n }\r\n public stopAndCancel() {\r\n this.cancelTokenSource?.cancel();\r\n this.pause = true;\r\n }\r\n conscreateCancelToken() {\r\n this.cancelTokenSource = axios.CancelToken.source();\r\n this.cancelToken = this.cancelTokenSource.token;\r\n }\r\n public async deleteUnfinishedLargeFiles() {\r\n if (!this.finished && this.fileId !== null) {\r\n await DeleteUnfinishedLargeFiles([this.fileId], this.uploadId);\r\n this.fileId = null;\r\n this.uploadId = null;\r\n this.uploadResponses = [];\r\n }\r\n }\r\n private finish() {\r\n this.finished = true;\r\n this.fileId = null;\r\n this.uploadId = null;\r\n }\r\n async upload(\r\n file: File,\r\n chunkSendResult: (\r\n res: boolean,\r\n pos: number,\r\n part: number,\r\n error?: string,\r\n ) => void,\r\n continueFrom: { start: number; part: number } | null,\r\n uploadEnd: () => void,\r\n targetId: number,\r\n CompletionResult: (value: boolean) => void,\r\n ) {\r\n if (this.finished === false && this.busy === false && targetId > 0) {\r\n this.busy = true;\r\n let start = 0;\r\n let part = 0;\r\n this.conscreateCancelToken();\r\n try {\r\n this.pause = false;\r\n if (file !== undefined && file.size > 0) {\r\n const size = Math.floor(file.size / 100);\r\n const chunkSize: number = size < minChunkSize ? minChunkSize : size;\r\n if (continueFrom !== null) {\r\n start = continueFrom.start;\r\n part = continueFrom.part;\r\n } else {\r\n this.fileId = null;\r\n this.uploadResponses = [];\r\n }\r\n while (start < file.size) {\r\n const res = await uploadChunk(\r\n file,\r\n file.slice(start, start + chunkSize),\r\n start,\r\n part,\r\n targetId,\r\n this.fileId,\r\n this.uploadId,\r\n this.cancelToken,\r\n );\r\n if (res.Result) {\r\n this.fileId = res.FileId;\r\n this.uploadId = res.UploadId;\r\n this.NeedCompleteMultipartUpload =\r\n res.NeedCompleteMultipartUpload;\r\n if (\r\n this.uploadId !== null &&\r\n this.uploadId !== '' &&\r\n res.ETag !== null &&\r\n res.PartNumber !== null &&\r\n res.NeedCompleteMultipartUpload\r\n ) {\r\n this.uploadResponses.push({\r\n ETag: res.ETag,\r\n PartNumber: res.PartNumber,\r\n });\r\n }\r\n start += chunkSize;\r\n part++;\r\n chunkSendResult(true, start, part);\r\n if (this.pause) {\r\n uploadEnd();\r\n return;\r\n }\r\n } else {\r\n chunkSendResult(false, start, part, res.Message ?? undefined);\r\n return;\r\n }\r\n }\r\n }\r\n } finally {\r\n if (start >= file.size) {\r\n if (\r\n this.uploadId !== null &&\r\n this.uploadResponses.length > 0 &&\r\n this.NeedCompleteMultipartUpload\r\n ) {\r\n const res = await CompleteMultipartUpload(\r\n this.fileId,\r\n this.uploadId,\r\n this.uploadResponses,\r\n );\r\n if (res) {\r\n this.finish();\r\n } else {\r\n CompletionResult(false);\r\n }\r\n } else {\r\n this.finish();\r\n }\r\n }\r\n uploadEnd();\r\n this.busy = false;\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst Api = new UploadLargeFileApi();\r\nasync function uploadChunk(\r\n file: File,\r\n chunk: Blob,\r\n pos: number,\r\n part: number,\r\n targetId: number,\r\n fileId: Guid | null,\r\n uploadId: string | null,\r\n cancel?: CancelToken,\r\n): Promise {\r\n try {\r\n const res = await Api.uploadChunck(\r\n //'api/LargeFilesUpload/Upload',\r\n '/api/odata/v4/Comments/AddFile',\r\n file.name,\r\n file.size,\r\n chunk,\r\n pos,\r\n part,\r\n targetId,\r\n fileId,\r\n uploadId,\r\n cancel,\r\n );\r\n return Promise.resolve(res.data);\r\n } catch (error: unknown) {\r\n return Promise.resolve({\r\n Result: false,\r\n FileId: null,\r\n UploadId: null,\r\n ETag: null,\r\n PartNumber: null,\r\n Message: null,\r\n NeedCompleteMultipartUpload: false,\r\n });\r\n }\r\n}\r\n\r\nexport async function CompleteMultipartUpload(\r\n fileId: Guid | null,\r\n uploadId: string | null,\r\n uploadResponses: S3DS_UploadRespunse[],\r\n): Promise {\r\n const url = '/api/odata/v4/Comments/CompleteMultipartUpload';\r\n try {\r\n await Api.CompleteMultipartUpload(url, fileId, uploadId, uploadResponses);\r\n return Promise.resolve(true);\r\n } catch {\r\n return Promise.resolve(false);\r\n }\r\n}\r\n\r\nexport async function DeleteUnfinishedLargeFiles(\r\n ids: Guid[],\r\n uploadId: string | null,\r\n): Promise {\r\n const url = '/api/odata/v4/Comments/DeleteUnfinishedLargeFileIds';\r\n try {\r\n await Api.DeleteUnfinishedLargeFiles(url, ids, uploadId);\r\n return Promise.resolve(true);\r\n } catch {\r\n return Promise.resolve(false);\r\n }\r\n}\r\n","import axios, { CancelToken } from 'axios';\r\nimport { Guid } from 'guid-typescript';\r\nimport { S3DS_UploadRespunse } from '.';\r\n\r\nexport class UploadLargeFileApi {\r\n uploadChunck = async (\r\n url: string,\r\n fileName: string,\r\n fileSize: number,\r\n chunck: Blob,\r\n pos: number,\r\n part: number,\r\n targetId: number,\r\n fileId: Guid | null,\r\n uploadId: string | null,\r\n cancel?: CancelToken,\r\n ) => {\r\n const formData = new FormData();\r\n formData.append('File', chunck);\r\n formData.append('rawFileName', fileName);\r\n formData.append('fileSize', fileSize.toString());\r\n formData.append('pos', pos.toString());\r\n formData.append('part', part.toString());\r\n formData.append('targetId', targetId.toString());\r\n formData.append('uploadId', uploadId ?? '');\r\n formData.append('fileId', fileId !== null ? fileId.toString() : Guid.EMPTY);\r\n const response = await axios.post(url, formData, {\r\n headers: {\r\n 'Content-Type': 'multipart/form-data',\r\n },\r\n cancelToken: cancel,\r\n });\r\n return response;\r\n };\r\n CompleteMultipartUpload = async (\r\n url: string,\r\n fileId: Guid | null,\r\n uploadId: string | null,\r\n uploadResponses: S3DS_UploadRespunse[],\r\n ) => {\r\n const data = {\r\n fileId: fileId,\r\n uploadId: uploadId,\r\n uploadResponses: uploadResponses,\r\n };\r\n return axios.post(url, data);\r\n };\r\n DeleteUnfinishedLargeFiles = async (\r\n url: string,\r\n ids: Guid[],\r\n uploadId: string | null,\r\n ) => {\r\n const data = { ids: ids, uploadId: uploadId };\r\n return axios.post(url, data);\r\n };\r\n}\r\n","import {\r\n Card,\r\n CardContent,\r\n createStyles,\r\n LinearProgress,\r\n makeStyles,\r\n} from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useCallback, useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectLargeFilesCanUpload,\r\n selectLargeFilesUploadTargetId,\r\n} from '../slice/selectoes';\r\nimport { UploadLargeFile } from '../Upload';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface FileSize {\r\n size: number;\r\n name: string;\r\n}\r\nexport interface FileData {\r\n name: string;\r\n path: string;\r\n size: FileSize;\r\n}\r\nexport interface FileCardProps {\r\n file: File;\r\n remorFile: (name: string) => void;\r\n}\r\nexport const FileCard = ({ file, remorFile }: FileCardProps) => {\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const canUplpoad = useSelector(selectLargeFilesCanUpload);\r\n const targetId = useSelector(selectLargeFilesUploadTargetId);\r\n const [inProgress, setInProgress] = React.useState(false);\r\n const [progress, setProgress] = React.useState(0);\r\n const [part, setPart] = React.useState(0);\r\n const [error, setError] = React.useState(false);\r\n const [show, setShow] = React.useState(true);\r\n const [pause, setPause] = React.useState(false);\r\n const fileSize = getFileSize(file.size);\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const { actions: notificationActions } = useAppSettingsSlice();\r\n const fileName = React.useMemo(() => file.name, [file.name]);\r\n const uploadLargeFile = React.useMemo(() => new UploadLargeFile(), []);\r\n const closeHandler = useCallback(async () => {\r\n if (!inProgress) {\r\n setShow(false);\r\n await uploadLargeFile.deleteUnfinishedLargeFiles();\r\n remorFile(file.name);\r\n } else {\r\n setPause(true);\r\n uploadLargeFile.pause = true;\r\n }\r\n }, [file.name, inProgress, remorFile, uploadLargeFile]);\r\n const chunkSendResult = useCallback(\r\n (res: boolean, pos: number, part: number, error?: string) => {\r\n if (res) {\r\n setProgress(pos);\r\n setPart(part);\r\n } else {\r\n setProgress(pos);\r\n setPart(part);\r\n setInProgress(false);\r\n if (uploadLargeFile.pause === false) {\r\n setError(true);\r\n }\r\n if (error !== undefined) {\r\n dispatch(\r\n notificationActions.addNotification({\r\n variant: 'error',\r\n message: error,\r\n }),\r\n );\r\n }\r\n }\r\n },\r\n [dispatch, notificationActions, uploadLargeFile.pause],\r\n );\r\n const CompletionResult = useCallback(\r\n (value: boolean) => {\r\n if (!value) {\r\n setError(true);\r\n dispatch(\r\n notificationActions.addNotification({\r\n variant: 'error',\r\n message: 'Upload is failed',\r\n }),\r\n );\r\n }\r\n },\r\n [dispatch, notificationActions],\r\n );\r\n\r\n const uploadEnd = useCallback(() => {\r\n if (pause) {\r\n setInProgress(false);\r\n } else {\r\n setInProgress(false);\r\n dispatch(largeFileActions.removeFile(fileName));\r\n setShow(false);\r\n }\r\n }, [dispatch, fileName, largeFileActions, pause]);\r\n useEffect(() => {\r\n if (canUplpoad) {\r\n setInProgress(true);\r\n dispatch(largeFileActions.addFile(fileName));\r\n uploadLargeFile.upload(\r\n file,\r\n chunkSendResult,\r\n null,\r\n uploadEnd,\r\n targetId,\r\n CompletionResult,\r\n );\r\n }\r\n return () => {\r\n uploadLargeFile.stopAndCancel();\r\n uploadLargeFile.deleteUnfinishedLargeFiles();\r\n dispatch(largeFileActions.removeFile(fileName));\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [canUplpoad]);\r\n return (\r\n <>\r\n {show === true ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {error === false ? (\r\n <>\r\n \r\n \r\n \r\n {file.name}\r\n \r\n \r\n \r\n {inProgress ? (\r\n 0 ? 'determinate' : 'query'}\r\n value={\r\n progress > 0\r\n ? (progress / file.size) * 100\r\n : undefined\r\n }\r\n />\r\n ) : (\r\n <>\r\n {pause === false && (\r\n \r\n {fileSize.size + fileSize.name}\r\n \r\n )}\r\n \r\n )}\r\n \r\n ) : (\r\n <>\r\n \r\n {file.name}\r\n \r\n \r\n {t(translations.ErrorDueUpload)}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(error || pause) && (\r\n \r\n }\r\n onClick={() => {\r\n if (uploadLargeFile.busy === false) {\r\n setPause(false);\r\n setInProgress(true);\r\n setError(false);\r\n uploadLargeFile.upload(\r\n file,\r\n chunkSendResult,\r\n {\r\n start: progress,\r\n part: part,\r\n },\r\n uploadEnd,\r\n targetId,\r\n CompletionResult,\r\n );\r\n }\r\n }}\r\n >\r\n {t(translations.ReUploadFile)}\r\n \r\n \r\n )}\r\n \r\n \r\n ) : (\r\n <>\r\n )}\r\n \r\n );\r\n};\r\n\r\nconst getFileSize = (size): FileSize => {\r\n var string;\r\n if (size >= 1024 * 1024 * 1024 * 1024) {\r\n size = size / (1024 * 1024 * 1024 * 1024);\r\n string = 'TiB';\r\n } else if (size >= 1024 * 1024 * 1024) {\r\n size = size / (1024 * 1024 * 1024);\r\n string = 'GiB';\r\n } else if (size >= 1024 * 1024) {\r\n size = size / (1024 * 1024);\r\n string = 'MiB';\r\n } else if (size >= 1024) {\r\n size = size / 1024;\r\n string = 'KiB';\r\n } else {\r\n string = 'b';\r\n }\r\n return { size: Math.round(size), name: string };\r\n};\r\n\r\nconst useStyles = makeStyles(theme =>\r\n createStyles({\r\n base: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n backgroundColor: theme.palette.background.default,\r\n //height: '163px',\r\n borderRadius: '8px',\r\n //width: '400px',\r\n marginTop: '8px',\r\n },\r\n container: {\r\n boxSizing: 'border-box',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n //alignItems: 'center',\r\n justifyContent: 'center',\r\n },\r\n content: {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n justifyContent: 'center',\r\n width: '100%',\r\n },\r\n }),\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport { FileCard } from './FileCard';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\n\r\nexport interface SelectFileProps {\r\n accept: any;\r\n downloadFileName?: string;\r\n filesPlaceholder: React.ReactNode;\r\n height?: number;\r\n maxFilesCount?: number;\r\n maxSize: number;\r\n disableFileUpload?: boolean;\r\n}\r\n\r\nexport const SelectFile = ({\r\n label,\r\n onBlur,\r\n value,\r\n name,\r\n error,\r\n helperText,\r\n accept,\r\n downloadFileName,\r\n filesPlaceholder,\r\n maxFilesCount,\r\n maxSize,\r\n disableFileUpload,\r\n ...props\r\n}: FieldHookConfig & TextFieldProps & SelectFileProps) => {\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const isMobile = DetectIsMobile();\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n const maxFiles =\r\n maxFilesCount === undefined ? 1 : maxFilesCount > 20 ? 20 : maxFilesCount;\r\n const onDrop = React.useCallback(\r\n (acceptedFiles: File[]) => {\r\n dispatch(largeFileActions.setSeletedFiles(acceptedFiles.length));\r\n },\r\n [dispatch, largeFileActions],\r\n );\r\n\r\n const { acceptedFiles, getRootProps, getInputProps } = useDropzone({\r\n onDrop,\r\n maxFiles: maxFiles,\r\n //minSize: minChunkSize,\r\n maxSize: maxSize,\r\n accept: accept,\r\n disabled: disableFileUpload,\r\n });\r\n const remorFile = React.useCallback(\r\n (filename: string) => {\r\n const index = acceptedFiles.findIndex(item => item.name === filename);\r\n acceptedFiles.splice(index, 1);\r\n dispatch(largeFileActions.setSeletedFiles(acceptedFiles.length));\r\n },\r\n [acceptedFiles, dispatch, largeFileActions],\r\n );\r\n return (\r\n <>\r\n \r\n \r\n \r\n

    {filesPlaceholder}

    \r\n
    \r\n {acceptedFiles.length > 0 && (\r\n
    \r\n {acceptedFiles.map(file => (\r\n \r\n ))}\r\n
    \r\n )}\r\n
    \r\n \r\n );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n flex: 1,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n padding: '20px',\r\n borderWidth: '2px',\r\n borderRadius: '2px',\r\n borderColor: theme.palette.common.grayBorders,\r\n borderStyle: 'dashed',\r\n backgroundColor: theme.palette.background.paper,\r\n color: '#bdbdbd',\r\n outline: 'none',\r\n transition: 'border .24s ease-in-out',\r\n}));\r\n","import { useTranslation } from 'react-i18next';\r\nimport { SelectFile } from './Components/SelectFile';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { Body } from '../Typography';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface LargeFilesUpdateProps {\r\n maxFilesCount?: number;\r\n disableFileUpload?: boolean;\r\n}\r\nexport function LargeFilesUpdate({\r\n maxFilesCount,\r\n disableFileUpload,\r\n}: LargeFilesUpdateProps) {\r\n const { t } = useTranslation();\r\n const systemSettings = useSelector(selectglobalSettings);\r\n const AllowLargeFilesUpload = systemSettings.GetBooleanByKey(\r\n AllowedSettings.AllowLargeFilesUpload,\r\n );\r\n const fh = React.useMemo((): React.ReactNode => {\r\n let s = AllowLargeFilesUpload\r\n ? t(translations.MaxLargeFileSize)\r\n : t(translations.MaxUploadFileSize);\r\n s = s.replace('{0}', AllowLargeFilesUpload ? '2' : '20');\r\n return (\r\n <>\r\n {t(translations.DragTheFilesOrBrowse)}\r\n
    {s}
    \r\n \r\n );\r\n }, [AllowLargeFilesUpload, t]);\r\n return (\r\n <>\r\n \r\n {t(translations.Attachments)}\r\n \r\n \r\n \r\n );\r\n}\r\n","import { MenuItem } from '@material-ui/core';\r\nimport { useMemo, useState, useRef } from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CommentFile, IComment, NewComment } from './IComment';\r\nimport { parse } from './commentParser';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Caption } from '../Typography';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport * as Yup from 'yup';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Form, Formik } from 'formik';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { FormRichTextField } from '../Forms/FormRichTextField';\r\nimport { TextField } from '../TextField';\r\nimport clsx from 'clsx';\r\nimport { useCommentStyles, useContainerStyles, useStyles } from './styles';\r\nimport { DropDown } from '../DropDown';\r\nimport { IEmail } from 'api/EmailApi';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSendMail } from 'app/hooks/useSendMail';\r\nimport { renderToStaticMarkup } from 'react-dom/server';\r\nimport { FormListener } from '../Forms/FormRender/FormRenderer';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Avatar } from '../Avatar';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { Body } from '../Typography';\r\nimport * as React from 'react';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { FileButton } from './FileButton';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { orderBy } from 'lodash';\r\nimport { LargeFilesUpdate } from '../LargeFilesUpload';\r\nimport { useLargeFilesUploadSlice } from '../LargeFilesUpload/slice';\r\nimport {\r\n selectLargeFilesStartedToUpload,\r\n selectLargeFilesUpload,\r\n selectLargeFilesUploadFilesNumber,\r\n selectLargeFilesUploadSelectedFiles,\r\n selectLargeFilesUploadTargetId,\r\n selectLargeFilesUploading,\r\n} from '../LargeFilesUpload/slice/selectoes';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\n\r\nexport interface CommentsContainerProps extends EmailRelated {\r\n Comments: IComment[];\r\n onSubmit: (comment: NewComment, innerClick?: boolean) => void;\r\n withMentions?: boolean;\r\n isAdmin?: boolean;\r\n onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n onDeleteComment?: (comment: IComment) => void;\r\n shouldSendEmail?: boolean;\r\n disabled?: boolean;\r\n bindSubmitComment?: any;\r\n defaultComment?: Partial;\r\n cannotComment?: boolean;\r\n sectionTitle?: React.ReactNode;\r\n noTitle?: boolean;\r\n disableFileUpload?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}\r\n\r\nexport interface EmailRelated {\r\n emailBody?: string;\r\n emailSubject?: string;\r\n emailType?: EmailTypeUnion;\r\n pageName?: string;\r\n referenceName?: string;\r\n linkUrl?: string;\r\n}\r\n\r\nconst AddComment = ({\r\n onSubmit,\r\n onClose,\r\n withMentions,\r\n isAdmin,\r\n defaultComment,\r\n disabled,\r\n bindSubmitComment,\r\n disableFileUpload,\r\n serviceGroups,\r\n}: {\r\n onSubmit: (comment: NewComment, innerSender?: boolean) => void;\r\n onClose: () => void;\r\n withMentions: boolean;\r\n isAdmin?: boolean;\r\n defaultComment?: Partial;\r\n disabled?: boolean;\r\n bindSubmitComment?: any;\r\n disableFileUpload?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}) => {\r\n const { t } = useTranslation();\r\n const formRef = useRef(null);\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const selectedFiles = useSelector(selectLargeFilesUploadSelectedFiles);\r\n const classes = useStyles();\r\n\r\n useEffectOnMount(() => {\r\n formRef.current?.scrollIntoView({\r\n behavior: 'smooth',\r\n block: 'nearest',\r\n inline: 'nearest',\r\n });\r\n });\r\n React.useEffect(() => {\r\n dispatch(largeFileActions.setCanUpload(0));\r\n }, [dispatch, largeFileActions]);\r\n const userSchema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.string().ensure(),\r\n Name: Yup.string().ensure(),\r\n });\r\n\r\n const schema: Yup.SchemaOf = Yup.object({\r\n Users: Yup.array().of(userSchema),\r\n Files: Yup.mixed().notRequired(),\r\n Text: Yup.string()\r\n .notRequired()\r\n .test(val => (val ?? '').length > 0),\r\n IsInternal: Yup.boolean().nullable(),\r\n });\r\n\r\n const initial: NewComment = {\r\n Text: defaultComment?.Text,\r\n Users: [],\r\n IsInternal: defaultComment?.IsInternal,\r\n };\r\n\r\n const innerClicked = useRef(false);\r\n\r\n const handleSubmit = ({ Files, ...values }: NewComment) => {\r\n const comment: NewComment = {\r\n ...values,\r\n };\r\n onSubmit(comment, innerClicked.current);\r\n innerClicked.current = false;\r\n if (selectedFiles === 0) onClose();\r\n };\r\n return (\r\n {\r\n handleSubmit(values);\r\n action.resetForm();\r\n }}\r\n initialValues={initial}\r\n validationSchema={schema}\r\n >\r\n {formik => {\r\n if (bindSubmitComment && formik.isValid) {\r\n bindSubmitComment(formik.submitForm);\r\n }\r\n const additionalButtons = [\r\n (className, key) => {\r\n return isAdmin ? (\r\n [\r\n \r\n }\r\n onClick={() => {\r\n formik.getFieldHelpers('IsInternal').setValue(false);\r\n close();\r\n }}\r\n >\r\n {t(translations.VisibleToUsers)}\r\n \r\n ,\r\n \r\n }\r\n onClick={() => {\r\n formik.getFieldHelpers('IsInternal').setValue(true);\r\n close();\r\n }}\r\n >\r\n {t(translations.StaffOnly)}\r\n \r\n ,\r\n ]}\r\n >\r\n \r\n \r\n ) : (\r\n <>\r\n );\r\n },\r\n ];\r\n return (\r\n {\r\n innerClicked.current = true;\r\n formik.handleSubmit(e);\r\n }}\r\n className={classes.section}\r\n >\r\n {}} fields={[]} />\r\n \r\n \r\n \r\n \r\n formik.getFieldHelpers('Users').setValue(v, true)\r\n }\r\n additionalButtons={additionalButtons}\r\n serviceGroups={serviceGroups}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.AddComment)}\r\n \r\n \r\n {t(translations.Close)}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n};\r\n\r\nconst CommentCell = ({\r\n comment,\r\n onSubmit,\r\n onClose,\r\n withMentions,\r\n isAdmin,\r\n onEditComment,\r\n onDeleteComment,\r\n disabled,\r\n bindSubmitComment,\r\n disableFileUpload,\r\n}: {\r\n comment: IComment;\r\n onSubmit: (comment: NewComment, innerSender?: boolean) => void;\r\n onClose: () => void;\r\n withMentions: boolean;\r\n isAdmin?: boolean;\r\n onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n onDeleteComment?: (comment: IComment) => void;\r\n disabled?: boolean;\r\n bindSubmitComment?: any;\r\n disableFileUpload?: boolean;\r\n}) => {\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const [hover, setHover] = useState(false);\r\n const [edit, setEdit] = useState(false);\r\n const { t } = useTranslation();\r\n const { newDate, withoutOffset } = useSystemDate();\r\n const classes = useCommentStyles();\r\n const [files, setFiles] = useState([]);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const currentUserComment = authenticatedUser?.Id === comment.CreatedBy.Id;\r\n const uploadedFiles = useSelector(selectLargeFilesUploadFilesNumber);\r\n const commentId = useSelector(selectLargeFilesUploadTargetId);\r\n const startedToUpload = useSelector(selectLargeFilesStartedToUpload);\r\n const uploading = useSelector(selectLargeFilesUploading);\r\n const filesUpload = useSelector(selectLargeFilesUpload);\r\n React.useEffect(() => {\r\n setFiles(comment.Files);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n React.useEffect(() => {\r\n const getComments = async () => {\r\n if (\r\n filesUpload.commentType !== undefined &&\r\n filesUpload.referenceId !== undefined\r\n ) {\r\n var result = await CommentsApi.GetComments(\r\n filesUpload.commentType,\r\n filesUpload.referenceId,\r\n commentId,\r\n );\r\n if (result.length > 0) {\r\n setFiles(result[0].Files);\r\n }\r\n }\r\n dispatch(largeFileActions.resetNumberOfUploadedFiles());\r\n };\r\n if (\r\n commentId === comment.Id &&\r\n startedToUpload &&\r\n !uploading &&\r\n uploadedFiles > 0\r\n ) {\r\n getComments();\r\n onClose();\r\n }\r\n }, [\r\n commentId,\r\n startedToUpload,\r\n uploading,\r\n uploadedFiles,\r\n dispatch,\r\n largeFileActions,\r\n filesUpload.commentType,\r\n filesUpload.referenceId,\r\n comment.Id,\r\n onClose,\r\n ]);\r\n return (\r\n \r\n {onEditComment && edit ? (\r\n <>\r\n {\r\n onEditComment(comment, newComment);\r\n setEdit(false);\r\n }}\r\n onClose={() => setEdit(false)}\r\n bindSubmitComment={bindSubmitComment}\r\n disableFileUpload={disableFileUpload}\r\n />\r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n setHover(true)}\r\n onMouseLeave={() => setHover(false)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n {comment.CreatedBy.Name}\r\n \r\n {isAdmin && comment.IsInternal && }\r\n \r\n {withMentions && hover && (\r\n <>\r\n {isAdmin && (\r\n <>\r\n {onEditComment && (\r\n }\r\n size=\"small\"\r\n onClick={() => setEdit(true)}\r\n >\r\n {t(translations.Edit)}\r\n \r\n )}\r\n {onDeleteComment && (\r\n }\r\n size=\"small\"\r\n onClick={() => onDeleteComment(comment)}\r\n >\r\n {t(translations.Delete)}\r\n \r\n )}\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {Math.abs(\r\n dateUtils.differenceInDays(\r\n dateUtils.dateOrStringToDate(comment.CreatedAt),\r\n newDate(),\r\n ),\r\n ) > 30\r\n ? dateUtils.format(\r\n comment.CreatedAt,\r\n dateUtils.DateIOFormats.keyboardDateTime24h, //'PP hh:mm',\r\n )\r\n : dateUtils.formatDistanceToNow(\r\n withoutOffset(comment.CreatedAt),\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {comment.Text.trim() !== '' ? parse(comment.Text) : ''}\r\n \r\n \r\n\r\n {files.map(f => {\r\n return (\r\n <>\r\n {\r\n setFiles(prev => prev.filter(file => file.Id !== id));\r\n }}\r\n key={f.Id}\r\n file={f}\r\n />\r\n \r\n );\r\n })}\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport const CommentsContainer = ({\r\n Comments,\r\n onSubmit,\r\n withMentions,\r\n isAdmin,\r\n onEditComment,\r\n onDeleteComment,\r\n emailBody,\r\n emailSubject,\r\n pageName,\r\n referenceName,\r\n emailType,\r\n linkUrl,\r\n disabled,\r\n shouldSendEmail = true,\r\n bindSubmitComment,\r\n defaultComment,\r\n cannotComment,\r\n sectionTitle,\r\n noTitle,\r\n disableFileUpload,\r\n serviceGroups,\r\n}: CommentsContainerProps) => {\r\n const [count, setCount] = useState(5);\r\n const sortedComments = useMemo(() => {\r\n return orderBy(\r\n Comments,\r\n c => dateUtils.dateOrStringToDate(c.CreatedAt),\r\n 'desc',\r\n ).filter(c => !c.IsInternal || isAdmin);\r\n }, [Comments, isAdmin]);\r\n const [writeCommentOpen, setWriteCommentOpen] = useState(false);\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const sendMail = useSendMail();\r\n const handleSubmit = (comment: NewComment, innerSender?: boolean) => {\r\n if (shouldSendEmail && withMentions) {\r\n const email = createEmail({\r\n emailBody: emailBody ?? t(translations.DefaultEmailTemplateBody),\r\n emailSubject:\r\n emailSubject ?? t(translations.DefaultEmailTemplateSubject),\r\n pageName: pageName ?? t(translations.DefaultPageName),\r\n referenceName: referenceName ?? t(translations.DefaultReferenceName),\r\n emailType: emailType,\r\n linkUrl: linkUrl ?? '',\r\n userName: authenticatedUser?.Name ?? '',\r\n comment: comment,\r\n });\r\n if (email) {\r\n sendMail(email);\r\n }\r\n }\r\n onSubmit(comment, innerSender);\r\n };\r\n const classes = useContainerStyles();\r\n return (\r\n \r\n {!noTitle && (\r\n \r\n \r\n {sectionTitle || t(translations.CommentsCount)}\r\n \r\n \r\n )}\r\n {sortedComments\r\n .slice(0, count < sortedComments.length ? count : undefined)\r\n .map((c, i) => (\r\n setWriteCommentOpen(false)}\r\n withMentions={!!withMentions}\r\n isAdmin={isAdmin}\r\n onEditComment={onEditComment}\r\n onDeleteComment={onDeleteComment}\r\n bindSubmitComment={bindSubmitComment}\r\n disableFileUpload={disableFileUpload}\r\n />\r\n ))}\r\n \r\n {count < sortedComments.length && (\r\n setCount(prev => prev + 5)}\r\n >\r\n {(('Load more ' + t(translations.CommentsCount)) as string) +\r\n ' (' +\r\n (sortedComments.length - count) +\r\n ')'}\r\n \r\n )}\r\n {!cannotComment && (\r\n \r\n {writeCommentOpen ? (\r\n setWriteCommentOpen(false)}\r\n withMentions={!!withMentions}\r\n isAdmin={isAdmin}\r\n bindSubmitComment={bindSubmitComment}\r\n disableFileUpload={disableFileUpload}\r\n serviceGroups={serviceGroups}\r\n />\r\n ) : (\r\n setWriteCommentOpen(true)}\r\n />\r\n )}\r\n \r\n )}\r\n {cannotComment && sortedComments.length === 0 && (\r\n {t(translations.Comments_EmptyMessage)}\r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nconst createEmail = ({\r\n comment,\r\n emailBody,\r\n emailSubject,\r\n pageName,\r\n referenceName,\r\n emailType,\r\n userName,\r\n linkUrl,\r\n}: {\r\n emailBody: string;\r\n emailSubject: string;\r\n emailType?: EmailTypeUnion;\r\n pageName: string;\r\n referenceName: string;\r\n comment: NewComment;\r\n userName: string;\r\n linkUrl: string;\r\n}) => {\r\n if (emailType === undefined || comment.Users.length === 0) return;\r\n const subject = emailSubject\r\n .replaceAll('{@UserName}', userName)\r\n .replaceAll('{@PageName}', pageName)\r\n .replaceAll('{@Reference}', referenceName);\r\n const body = emailBody\r\n .replaceAll('{@UserName}', userName)\r\n .replaceAll('{@PageName}', pageName)\r\n .replaceAll('{@Reference}', referenceName)\r\n .replaceAll('{@Link}', linkUrl)\r\n .replaceAll(\r\n '{@Body}',\r\n renderToStaticMarkup(<>{parse(comment.Text ?? '')}),\r\n );\r\n return {\r\n Subject: subject,\r\n Body: body,\r\n Files: comment.Files,\r\n SaveToLog: true,\r\n To: [],\r\n Cc: [],\r\n Bcc: comment.Users,\r\n Type: emailType,\r\n } as IEmail;\r\n};\r\n","import { DropDown } from 'app/components/DropDown';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { LinearProgress, List, ListItem, MenuItem } from '@material-ui/core';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport styled from 'styled-components';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nexport interface AddServiceProps {\r\n getServiceTypes?: (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ) => Promise;\r\n addService: (serviceType: IOfflineServiceFilterDto) => void;\r\n selected: IOtherServices[];\r\n disabled?: boolean;\r\n}\r\n\r\nexport function AddService({\r\n addService,\r\n getServiceTypes,\r\n selected,\r\n disabled,\r\n}: AddServiceProps) {\r\n const { t } = useTranslation();\r\n\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n\r\n const [input, setInnput] = React.useState('');\r\n const fetchServiceTypes = async (): Promise => {\r\n const filter =\r\n !!selected && selected.length > 0\r\n ? [\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Excludes,\r\n selected.map(s => s.ServiceTypeID),\r\n ),\r\n ]\r\n : undefined;\r\n return new Promise(async (resolve, reject) => {\r\n if (!!getServiceTypes) {\r\n try {\r\n const data = await getServiceTypes(input || null, filter);\r\n resolve(data);\r\n } catch {\r\n resolve([]);\r\n }\r\n } else {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n filter,\r\n 'base',\r\n globalServiceGroupFilter || [],\r\n )(input || null, undefined);\r\n resolve(\r\n data.value.filter(\r\n f => !selected.some(s => s.ServiceTypeID === f.Id),\r\n ),\r\n );\r\n } catch (error) {\r\n resolve([]);\r\n }\r\n }\r\n });\r\n };\r\n const [serviceTypes, setServiceTypes] = useAsyncExtendedState<\r\n IOfflineServiceFilterDto[]\r\n >([]);\r\n\r\n const [fetchServiceTypeState, fetchServiceTypePromise] = usePromise(\r\n fetchServiceTypes,\r\n );\r\n const stopImmediatePropagation = (e: any) => {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n useEffectOnMount(() => {\r\n setServiceTypes(fetchServiceTypePromise());\r\n });\r\n\r\n return (\r\n {\r\n setServiceTypes([]);\r\n setServiceTypes(fetchServiceTypePromise());\r\n }}\r\n onHandleClose={() => {\r\n setInnput('');\r\n setServiceTypes([]);\r\n }}\r\n menuChildren={onClose => [\r\n e.stopPropagation()}\r\n onClickCapture={stopImmediatePropagation}\r\n >\r\n \r\n }\r\n value={input || ''}\r\n size=\"small\"\r\n aria-label={t(translations.SearchFilter)}\r\n inputProps={{\r\n 'aria-label': t(translations.SearchFilter),\r\n }}\r\n onChange={e => {\r\n setInnput(e.target.value);\r\n setTimeout(() => setServiceTypes(fetchServiceTypePromise()), 200);\r\n }}\r\n autoFocus\r\n fullWidth\r\n />\r\n ,\r\n \r\n \r\n \r\n {fetchServiceTypeState.status === 'pending' && (\r\n \r\n )}\r\n {serviceTypes.length > 0 &&\r\n serviceTypes.map(s => (\r\n {\r\n addService(s);\r\n onClose();\r\n }}\r\n >\r\n {s.Name}\r\n \r\n ))}\r\n {fetchServiceTypeState.status !== 'pending' &&\r\n serviceTypes.length < 1 && (\r\n \r\n {t(translations.NotFound)}\r\n \r\n )}\r\n \r\n \r\n ,\r\n ]}\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n },\r\n transformOrigin: {\r\n vertical: 'top',\r\n horizontal: 'left',\r\n },\r\n getContentAnchorEl: null,\r\n }}\r\n addChevron\r\n >\r\n {t(translations.AddConsumable)}\r\n \r\n );\r\n}\r\nconst ContentWrapper = styled.div`\r\n width: 300px;\r\n height: 300px;\r\n max-height: 300px;\r\n max-width: 300px;\r\n overflow-y: auto;\r\n`;\r\n","import { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport {\r\n BatchesByServiceTypeFilter,\r\n convertInventoryBatchName,\r\n loadInventoryBatchesData,\r\n} from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InventoryBatchList } from './InventoryBatchList';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectCreatableService,\r\n selectInventoryBatchEditable,\r\n} from '../slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface InventoryBatchChipProps {\r\n renderService: IOtherServices;\r\n onServiceClick?: (service: IOtherServices) => void;\r\n onAddBatchClick?: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n renewStock?: boolean;\r\n isAdmin?: boolean;\r\n handleServiceChange: (item: IOtherServices) => Promise;\r\n disabled?: boolean;\r\n onRenewStockClick?: (service: IOtherServices) => void;\r\n}\r\nexport const InventoryBatchChip = React.memo(function InventoryBatchChip(\r\n props: InventoryBatchChipProps,\r\n) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const {\r\n renderService,\r\n onServiceClick,\r\n onAddBatchClick,\r\n renewStock,\r\n isAdmin,\r\n handleServiceChange,\r\n disabled,\r\n onRenewStockClick,\r\n } = props;\r\n const batchRequested = useSelector(selectInventoryBatchEditable);\r\n const savedCreatableRenewal = useSelector(selectCreatableService);\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const handleBatchListOpen = event => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n const handleBatchListClose = () => {\r\n setAnchorEl(null);\r\n };\r\n const availableBatches = useAsyncGetWthEffect(\r\n async () =>\r\n loadInventoryBatchesData(\r\n BatchesByServiceTypeFilter(\r\n renderService.ServiceTypeID,\r\n renewStock === true ? undefined : true,\r\n ),\r\n )(null, undefined).then(res => res.value),\r\n [],\r\n [renderService, batchRequested, savedCreatableRenewal],\r\n );\r\n const currentBatch = React.useMemo(() => {\r\n return renderService.InventoryBatchesEnabled\r\n ? renderService.InventoryBatchId !== null\r\n ? availableBatches.find(f => f.Id === renderService.InventoryBatchId)\r\n : null\r\n : null;\r\n }, [\r\n availableBatches,\r\n renderService.InventoryBatchId,\r\n renderService.InventoryBatchesEnabled,\r\n ]);\r\n const onChipClick = event => {\r\n if (renewStock && !onAddBatchClick) {\r\n !!onServiceClick && onServiceClick(renderService);\r\n } else {\r\n if (isAdmin && !disabled) {\r\n handleBatchListOpen(event);\r\n }\r\n }\r\n };\r\n const handleChipSelect = React.useCallback(\r\n (batch: IInventoryBatchDto) => {\r\n return new Promise(async resolve => {\r\n try {\r\n handleBatchListClose();\r\n await handleServiceChange(\r\n Object.assign({}, renderService, {\r\n InventoryBatchId: batch.Id,\r\n InventoryBatchName: batch.Name,\r\n InventoryBatchAmount: batch.Inventory,\r\n }),\r\n );\r\n } catch (error) {}\r\n });\r\n },\r\n [handleServiceChange, renderService],\r\n );\r\n React.useEffect(() => {\r\n if (batchRequested !== undefined) {\r\n handleChipSelect(batchRequested);\r\n dispatch(actions.setInventoryBatchEditable(undefined));\r\n }\r\n }, [actions, batchRequested, dispatch, handleChipSelect]);\r\n React.useEffect(() => {\r\n if (savedCreatableRenewal !== undefined) {\r\n handleChipSelect({\r\n Id: savedCreatableRenewal.InventoryBatchId,\r\n Name: savedCreatableRenewal.InventoryBatchName,\r\n Inventory: savedCreatableRenewal.InventoryBatchAmount,\r\n } as IInventoryBatchDto);\r\n dispatch(actions.getCreatableService(undefined));\r\n }\r\n }, [actions, dispatch, handleChipSelect, savedCreatableRenewal]);\r\n return (\r\n \r\n \r\n {(!renewStock || (renewStock && !!onAddBatchClick)) && (\r\n {\r\n !!onAddBatchClick &&\r\n onAddBatchClick(null, renderService.ServiceTypeID);\r\n handleBatchListClose();\r\n }}\r\n isAdmin={isAdmin ?? false}\r\n onClose={handleBatchListClose}\r\n serviceTypeId={renderService.ServiceTypeID}\r\n onBatchClick={handleChipSelect}\r\n selectedBatch={currentBatch ?? undefined}\r\n showRenewStockButtons={!renewStock}\r\n createdRenewal={savedCreatableRenewal}\r\n onRenewStockClick={batchId => {\r\n !!onRenewStockClick &&\r\n onRenewStockClick(\r\n Object.assign({}, renderService, {\r\n InventoryBatchId: batchId ?? null,\r\n }),\r\n );\r\n handleBatchListClose();\r\n }}\r\n batches={[]}\r\n />\r\n )}\r\n \r\n );\r\n});\r\n","import { useTheme, FormHelperText } from '@material-ui/core';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\n\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { AuthenticatedUser, IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ErrorServices } from '../slice/types';\r\nimport { InventoryBatchChip } from './InventoryBatchChip';\r\n\r\nexport interface QuickServiceItemProps {\r\n service: IOtherServices;\r\n handleRemove: (item: IOtherServices) => Promise;\r\n handleChange: (item: IOtherServices) => Promise;\r\n onServiceClick?: (item: IOtherServices) => void;\r\n mandatory?: boolean;\r\n isEditMode?: boolean;\r\n createdEditable?: boolean;\r\n count: number | null;\r\n minStep: number;\r\n step: number;\r\n maxStep: number;\r\n disabled?: boolean;\r\n renewStock?: boolean;\r\n user?: AuthenticatedUser;\r\n onAddBatchClick?: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n onRenewStockClick?: (service: IOtherServices) => void;\r\n setError?: (error: ErrorServices) => void;\r\n focused?: boolean;\r\n}\r\nconst QuickItem = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n background: theme.palette.common.white,\r\n boxShadow: 'inset 0px -1px 0px #E3E8EF',\r\n '& .errorsRoot': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n },\r\n '& .contentRoot': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '12px 12px',\r\n gap: '8px',\r\n '& .textandImage': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n gap: '12px',\r\n width: '100%',\r\n flexGrow: 1,\r\n },\r\n '& .quantity': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n gap: '8px',\r\n flexGrow: 0,\r\n },\r\n '& .adjustment': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px 0px 0px 8px',\r\n gap: '10px',\r\n },\r\n },\r\n '& .bottomRoot': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n justifyContent: 'flex-end',\r\n padding: '0px 8px 8px 8px',\r\n },\r\n}));\r\n\r\nexport const QuickServiceItem = React.memo(function QuickServiceItem(\r\n props: QuickServiceItemProps,\r\n) {\r\n const { t } = useTranslation();\r\n const {\r\n service,\r\n mandatory,\r\n handleChange,\r\n handleRemove,\r\n onServiceClick,\r\n isEditMode,\r\n createdEditable,\r\n count,\r\n minStep,\r\n step,\r\n maxStep,\r\n disabled,\r\n renewStock,\r\n onAddBatchClick,\r\n onRenewStockClick,\r\n user,\r\n setError,\r\n focused,\r\n } = props;\r\n const theme = useTheme();\r\n const inputProps = {\r\n step: step,\r\n min: minStep,\r\n max: maxStep,\r\n 'aria-label': 'Counter',\r\n style: {\r\n minWidth: '30px',\r\n padding: '6px 6px',\r\n textAlign: 'center' as 'center',\r\n },\r\n };\r\n const [errorMessage, setErrorMessage] = React.useState(\r\n undefined,\r\n );\r\n const handleAddError = React.useCallback(\r\n (error: string | undefined) => {\r\n setErrorMessage(error);\r\n if (!!setError) {\r\n setError({\r\n id: service.ServiceTypeID,\r\n error: !!error ? `${service.ServiceType}: ${error}` : undefined,\r\n } as ErrorServices);\r\n }\r\n },\r\n [service.ServiceType, service.ServiceTypeID, setError],\r\n );\r\n const [quantity, setQuantity] = React.useState(count);\r\n React.useEffect(() => {\r\n setQuantity(count);\r\n }, [count]);\r\n React.useEffect(() => {\r\n if (quantity === null || quantity === undefined || quantity === 0) {\r\n handleAddError(t(translations.err_Quantity_required) as string);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [quantity, t]);\r\n\r\n // const IsGroupAdmin = React.useMemo(() => {\r\n // return user?.HasAdminGroupPermissions(service?.ServiceGroupId ?? undefined);\r\n // }, [service?.ServiceGroupId, user]);\r\n const IsAdminOfService = React.useMemo(() => {\r\n return user?.IsAdminOf({\r\n ServiceGroupId: service?.ServiceGroupId,\r\n ServiceId: service?.Id,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IIsAdminOfParams);\r\n }, [service?.Id, service?.ServiceGroupId, user]);\r\n const [counterUpdated, setCounterUpdated] = React.useState(false);\r\n const arrowTitle = React.useMemo(() => {\r\n if (service.TrackInventory && service.RenewStockInventory) {\r\n return t(translations.RenewStockArrow_info) as string;\r\n } else {\r\n return isEditMode && service.Id > 0\r\n ? (t(translations.ReservationOfflineServiceEditArrow_info) as string)\r\n : createdEditable\r\n ? (t(translations.ConsumableCreateArrow_info) as string)\r\n : (t(translations.ReservationOfflineServiceCreateArrow_info) as string);\r\n }\r\n }, [\r\n createdEditable,\r\n isEditMode,\r\n service.Id,\r\n service.RenewStockInventory,\r\n service.TrackInventory,\r\n t,\r\n ]);\r\n const serviceChange = React.useCallback(\r\n (change: number | null, item: IOtherServices, withError?: boolean) => {\r\n return new Promise(async resolve => {\r\n const precision = service.IntQuantityOnly === true ? 0 : 2;\r\n try {\r\n await handleChange(\r\n Object.assign({}, item, {\r\n Quantity: change === null ? null : +change.toFixed(precision),\r\n DefaultQuantity: change === null ? null : item.DefaultQuantity,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(item.ServiceDate),\r\n ),\r\n }),\r\n );\r\n\r\n setQuantity(change === null ? null : +change.toFixed(precision));\r\n setCounterUpdated(false);\r\n if (!withError) {\r\n handleAddError(undefined);\r\n }\r\n } catch (error) {\r\n handleAddError(error as string);\r\n setQuantity(change === null ? null : +change.toFixed(precision));\r\n setCounterUpdated(false);\r\n }\r\n });\r\n },\r\n [handleAddError, handleChange, service.IntQuantityOnly],\r\n );\r\n const remove = (service: IOtherServices) => {\r\n return new Promise(async resolve => {\r\n try {\r\n await handleRemove(service);\r\n resolve(undefined);\r\n setCounterUpdated(false);\r\n } catch (error) {\r\n handleAddError(error as string);\r\n setCounterUpdated(false);\r\n }\r\n });\r\n };\r\n const onInputChange = React.useCallback(\r\n event => {\r\n const precision = service.IntQuantityOnly === true ? 0 : 2;\r\n if (event.target.value === '') {\r\n //setCounterUpdated(true);\r\n setQuantity(null);\r\n serviceChange(null, service, true);\r\n handleAddError(\r\n (t(translations.err_LowQuantity) as string).replace(\r\n '{0}',\r\n minStep.toString(),\r\n ),\r\n );\r\n return;\r\n } else {\r\n const value = +(+event.target.value).toFixed(precision);\r\n if (value < minStep) {\r\n // event.preventDefault();\r\n // event.stopPropagation();\r\n setCounterUpdated(true);\r\n serviceChange(value, service, true);\r\n handleAddError(\r\n (t(translations.err_LowQuantity) as string).replace(\r\n '{0}',\r\n minStep.toString(),\r\n ),\r\n );\r\n } else if (value > 0 && value > maxStep) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n handleAddError(\r\n (t(translations.err_HighQuantity) as string).replace(\r\n '{0}',\r\n maxStep.toString(),\r\n ),\r\n );\r\n } else {\r\n handleAddError(undefined);\r\n // setCounterUpdated(true);\r\n serviceChange(value, service);\r\n }\r\n }\r\n },\r\n [handleAddError, maxStep, minStep, service, serviceChange, t],\r\n );\r\n return (\r\n \r\n
    \r\n \r\n {errorMessage}\r\n \r\n
    \r\n
    \r\n
    \r\n {`${service.ServiceType}`}\r\n
    \r\n
    \r\n {\r\n let valid = mandatory\r\n ? (quantity ?? 0) - step > 0\r\n : (quantity ?? 0) - step >= 0;\r\n if (\r\n !mandatory &&\r\n !valid &&\r\n (quantity === null || quantity <= 0)\r\n ) {\r\n setCounterUpdated(true);\r\n remove(service);\r\n return;\r\n }\r\n if (valid) {\r\n handleAddError(undefined);\r\n if (!mandatory && (quantity ?? 0) - step === 0) {\r\n setCounterUpdated(true);\r\n remove(service);\r\n } else {\r\n setCounterUpdated(true);\r\n serviceChange((quantity ?? 0) - step, service);\r\n }\r\n } else {\r\n handleAddError(\r\n (t(translations.err_LowQuantity) as string).replace(\r\n '{0}',\r\n minStep.toString(),\r\n ),\r\n );\r\n }\r\n }}\r\n >\r\n {(quantity ?? 0) <= step ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n {\r\n let valid = (quantity ?? 0) + step < maxStep;\r\n if (valid) {\r\n setCounterUpdated(true);\r\n serviceChange((quantity ?? 0) + step, service);\r\n } else {\r\n handleAddError(\r\n (t(translations.err_HighQuantity) as string).replace(\r\n '{0}',\r\n maxStep.toString(),\r\n ),\r\n );\r\n }\r\n }}\r\n >\r\n \r\n \r\n
    \r\n\r\n
    \r\n {counterUpdated ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n {!!onServiceClick && (\r\n !!onServiceClick && onServiceClick(service)}\r\n >\r\n \r\n \r\n )}\r\n \r\n )}\r\n
    \r\n
    \r\n {service.InventoryBatchesEnabled && IsAdminOfService && (\r\n
    \r\n 0}\r\n onRenewStockClick={onRenewStockClick}\r\n />\r\n
    \r\n )}\r\n
    \r\n );\r\n});\r\nconst StyledBaseTextField = styled(BaseTextField)(({ theme }) => ({\r\n '& input[type=number]': {\r\n '-moz-appearance': 'textfield',\r\n },\r\n '& input[type=number]::-webkit-outer-spin-button': {\r\n '-webkit-appearance': 'none',\r\n margin: 0,\r\n },\r\n '& input[type=number]::-webkit-inner-spin-button': {\r\n '-webkit-appearance': 'none',\r\n margin: 0,\r\n },\r\n}));\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\n\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { PageTopActionsProps } from '../type';\r\n\r\nexport function AddConsumable(\r\n props: PageTopActionsProps & { services: number[] },\r\n) {\r\n const location = useLocation();\r\n //const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { t } = useTranslation();\r\n const {\r\n size,\r\n text,\r\n variant,\r\n icon,\r\n services,\r\n disabled,\r\n compact = true,\r\n } = props;\r\n\r\n return (\r\n {\r\n let selParams = {\r\n useSidePanel: true,\r\n actionType: 'OfflineService',\r\n offTypeIds:\r\n services.length > 0\r\n ? services.join(',')\r\n : GetRawValue(new URLSearchParams(location.search), 'stid'),\r\n } as AssetsSelectionProps;\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.AssetsSelection,\r\n props: selParams,\r\n expanded: false,\r\n }),\r\n );\r\n }}\r\n />\r\n );\r\n}\r\nexport function AddCoverConsumable(\r\n props: PageTopActionsProps & {\r\n services: number[];\r\n onAddClick: (services: number[]) => void;\r\n },\r\n) {\r\n const { t } = useTranslation();\r\n const {\r\n size,\r\n text,\r\n variant,\r\n icon,\r\n services,\r\n disabled,\r\n onAddClick,\r\n compact = true,\r\n } = props;\r\n\r\n return (\r\n onAddClick(services)}\r\n />\r\n );\r\n}\r\n","import { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { AddCoverConsumable } from 'app/pages/Actions/PageTopActions/AddConsumable';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport {\r\n selectBarcodeScanned,\r\n selectSelectedServiceType,\r\n} from '../slice/selectors';\r\nimport * as React from 'react';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nexport interface AddServiceFromSelectionProps {\r\n onAddClick: (services: number[]) => void;\r\n getServiceTypes?: (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ) => Promise;\r\n addServices: (serviceType: IOfflineServiceFilterDto[]) => void;\r\n removeServices: (services: IOtherServices[]) => void;\r\n addAndRemoveServices: (\r\n serviceType: IOfflineServiceFilterDto[],\r\n services: IOtherServices[],\r\n ) => void;\r\n selected: IOtherServices[];\r\n disabled?: boolean;\r\n}\r\nexport function AddServiceFromSelection(props: AddServiceFromSelectionProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const {\r\n getServiceTypes,\r\n addServices,\r\n selected,\r\n disabled,\r\n onAddClick,\r\n removeServices,\r\n addAndRemoveServices,\r\n } = props;\r\n const newSelectedServices = useSelector(selectSelectedServiceType);\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const [updated, setUpdated] = React.useState(undefined);\r\n const isBarcodeScanned = useSelector(selectBarcodeScanned);\r\n const fetchServiceTypes = async (): Promise => {\r\n const filter: (string | Condition)[] = [];\r\n if (!!selected && selected.length > 0) {\r\n filter.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Excludes,\r\n selected.map(s => s.ServiceTypeID),\r\n ),\r\n );\r\n }\r\n if (!!newSelectedServices && newSelectedServices.length > 0) {\r\n filter.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n newSelectedServices.map(s => s),\r\n ),\r\n );\r\n }\r\n return new Promise(async (resolve, reject) => {\r\n if (!!getServiceTypes) {\r\n try {\r\n const data = await getServiceTypes(null, filter);\r\n resolve(data);\r\n } catch {\r\n resolve([]);\r\n }\r\n } else {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n filter,\r\n 'base',\r\n globalServiceGroupFilter || [],\r\n undefined,\r\n 'InventoryBatches',\r\n )(null, undefined);\r\n resolve(data.value);\r\n } catch (error) {\r\n resolve([]);\r\n }\r\n }\r\n });\r\n };\r\n const [serviceTypes, setServiceTypes] = useAsyncExtendedState<\r\n IOfflineServiceFilterDto[]\r\n >([]);\r\n const [fetchServiceTypeState, fetchServiceTypePromise] = usePromise(\r\n fetchServiceTypes,\r\n );\r\n React.useEffect(() => {\r\n if (\r\n newSelectedServices.length > 0 &&\r\n !updated &&\r\n fetchServiceTypeState.status !== 'pending'\r\n ) {\r\n setServiceTypes(fetchServiceTypePromise());\r\n setUpdated(true);\r\n }\r\n }, [\r\n actions,\r\n dispatch,\r\n fetchServiceTypePromise,\r\n fetchServiceTypeState.status,\r\n newSelectedServices,\r\n newSelectedServices.length,\r\n selected,\r\n serviceTypes,\r\n setServiceTypes,\r\n updated,\r\n ]);\r\n React.useEffect(() => {\r\n let added = newSelectedServices.filter(\r\n f => !selected.some(s => s.ServiceTypeID === f),\r\n );\r\n let removed = isBarcodeScanned\r\n ? []\r\n : selected.filter(\r\n f => !newSelectedServices.some(c => c === f.ServiceTypeID),\r\n );\r\n if (\r\n (added.length > 0 || removed.length > 0) &&\r\n updated &&\r\n fetchServiceTypeState.status === 'resolved' &&\r\n serviceTypes.length > 0\r\n ) {\r\n setUpdated(undefined);\r\n dispatch(actions.resetSelectedServiceType());\r\n dispatch(actions.setBarcodeScanned(undefined));\r\n\r\n if (added.length > 0 && removed.length > 0) {\r\n addAndRemoveServices(\r\n serviceTypes.filter(f => added.includes(f.Id)),\r\n removed,\r\n );\r\n } else {\r\n if (added.length > 0) {\r\n addServices(serviceTypes.filter(f => added.includes(f.Id)));\r\n }\r\n if (removed.length > 0) {\r\n removeServices(removed);\r\n }\r\n }\r\n\r\n setServiceTypes([]);\r\n }\r\n }, [\r\n actions,\r\n addAndRemoveServices,\r\n addServices,\r\n dispatch,\r\n fetchServiceTypeState.status,\r\n isBarcodeScanned,\r\n newSelectedServices,\r\n removeServices,\r\n selected,\r\n serviceTypes,\r\n setServiceTypes,\r\n updated,\r\n ]);\r\n return (\r\n f.ServiceTypeID)}\r\n disabled={disabled}\r\n onAddClick={onAddClick}\r\n />\r\n );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport * as React from 'react';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { AddService } from './AddService';\r\nimport { QuickServiceItem } from './QuickServiceItem';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { selectRefreshOfflineServices } from 'app/pages/ReservationDetails/Details/slice/selectors';\r\nimport { useReservationSlice } from 'app/pages/ReservationDetails/Details/slice';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { AddServiceFromSelection } from './AddServiceFromSelection';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { ScannerView } from 'app/components/ScannerView';\r\nimport { selectRefreshConsumableServices } from '../slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorServices } from '../slice/types';\r\nimport clsx from 'clsx';\r\nimport styled from 'styled-components';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\n\r\nexport interface BookQuickServicesProps {\r\n initServicesFunc: () => Promise;\r\n loadSeviceTypes?: (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ) => Promise;\r\n onServiceUpdate?: (service: IOtherServices) => Promise;\r\n onServiceRemove?: (service: IOtherServices) => Promise;\r\n onServicesRemove?: (service: IOtherServices[]) => Promise;\r\n onServiceClick?: (item: IOtherServices) => void;\r\n onRenewStockClick?: (service: IOtherServices) => void;\r\n onAddBatchClick?: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n createServiceFromServiceType?: (\r\n serviceTypes: IOfflineServiceFilterDto,\r\n ) => Promise;\r\n createServicesFromServiceType?: (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n ) => Promise;\r\n userName?: string;\r\n isEditMode?: boolean;\r\n disabled?: boolean;\r\n useAssetSelection?: boolean;\r\n onAddClick?: (services: number[]) => void;\r\n onAddAndRemoveServices?: (\r\n serviceType: IOfflineServiceFilterDto[],\r\n services: IOtherServices[],\r\n ) => Promise;\r\n createdEditable?: boolean;\r\n renewStock?: boolean;\r\n setError?: (errors: ErrorServices) => void;\r\n showScannerView?: boolean;\r\n}\r\nconst QuickServiceItems = styled('div')(({ theme }) => ({\r\n width: '100%',\r\n '& .addNewSection': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: '16px',\r\n '&.hasServices': {\r\n padding: '16px 0px 0px',\r\n },\r\n '& .sectionRow': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0',\r\n gap: '12px',\r\n '& .sectionItems': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0',\r\n gap: '8px',\r\n },\r\n },\r\n },\r\n}));\r\n\r\nexport const BookQuickServices = React.memo(function BookQuickServices(\r\n props: BookQuickServicesProps,\r\n) {\r\n const user = useSelector(selectAuthenticatedUser);\r\n const refreshServices = useSelector(selectRefreshOfflineServices);\r\n const refreshCosumables = useSelector(selectRefreshConsumableServices);\r\n const dispatch = useDispatch();\r\n const { actions } = useReservationSlice();\r\n const { actions: offlineActions } = useOfflineServiceStateSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const {\r\n initServicesFunc,\r\n onServiceRemove,\r\n onServicesRemove,\r\n onServiceUpdate,\r\n createServiceFromServiceType,\r\n createServicesFromServiceType,\r\n loadSeviceTypes,\r\n onServiceClick,\r\n userName,\r\n isEditMode,\r\n disabled,\r\n useAssetSelection,\r\n onAddClick,\r\n onAddAndRemoveServices,\r\n createdEditable,\r\n renewStock,\r\n onAddBatchClick,\r\n onRenewStockClick,\r\n setError,\r\n showScannerView,\r\n } = props;\r\n const theme = useTheme();\r\n const fetchServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n try {\r\n let data = await initServicesFunc();\r\n resolve(data);\r\n } catch {\r\n resolve([]);\r\n }\r\n });\r\n };\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n const currentUser = React.useMemo(() => {\r\n return !!userName ? userName : user?.Id;\r\n }, [user?.Id, userName]);\r\n const [serviceCreated, setServiceCreated] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [services, setServices] = useAsyncExtendedState([]);\r\n const [fetchServicesState, fetchServicesPromise] = usePromise(fetchServices);\r\n React.useEffect(() => {\r\n if (\r\n !fetchServicesState.status ||\r\n (fetchServicesState.status !== 'pending' &&\r\n fetchServicesState.status !== 'resolved')\r\n ) {\r\n setServices(fetchServicesPromise());\r\n }\r\n return () => {};\r\n }, [\r\n fetchServicesPromise,\r\n fetchServicesState.status,\r\n initServicesFunc,\r\n setServices,\r\n ]);\r\n React.useEffect(() => {\r\n let active = refreshServices || refreshCosumables;\r\n if (active === true && fetchServicesState.status !== 'pending') {\r\n dispatch(actions.setRefreshOfflineServices(undefined));\r\n dispatch(offlineActions.setRefreshConsumableOfflineServices(undefined));\r\n setServices(fetchServicesPromise());\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n fetchServicesPromise,\r\n fetchServicesState.status,\r\n initServicesFunc,\r\n offlineActions,\r\n refreshCosumables,\r\n refreshServices,\r\n setServices,\r\n ]);\r\n const handleServiceChange = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (!!onServiceUpdate) {\r\n try {\r\n let data = await onServiceUpdate(service);\r\n if (!!data) {\r\n setServices(\r\n services.map(f => {\r\n if (f.ServiceTypeID === service.ServiceTypeID) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n );\r\n resolve(data);\r\n } else {\r\n reject('error occured');\r\n }\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n setServices(\r\n services.map(f => {\r\n if (f.ServiceTypeID === service.ServiceTypeID) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n );\r\n resolve(service);\r\n }\r\n });\r\n };\r\n const handleRemoveService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (!!onServiceRemove) {\r\n try {\r\n let res = await onServiceRemove(service);\r\n setServices(\r\n services.filter(f => {\r\n if (isEditMode) {\r\n return f.Id !== service.Id;\r\n } else {\r\n return f.ServiceTypeID !== service.ServiceTypeID;\r\n }\r\n }),\r\n );\r\n resolve(res);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n setServices(\r\n services.filter(f => {\r\n return f.ServiceTypeID !== service.ServiceTypeID;\r\n }),\r\n );\r\n resolve(service);\r\n }\r\n });\r\n };\r\n const handleAddService = React.useCallback(\r\n (serviceType: IOfflineServiceFilterDto) => {\r\n setServiceCreated(true);\r\n setServices(\r\n new Promise(async resolve => {\r\n try {\r\n if (!!createServiceFromServiceType) {\r\n let data = await createServiceFromServiceType(serviceType);\r\n if (!!data) {\r\n resolve([...services, data]);\r\n } else {\r\n resolve([...services]);\r\n }\r\n } else {\r\n let batch = serviceType.InventoryBatchesEnabled\r\n ? !!serviceType.InventoryBatches &&\r\n serviceType.InventoryBatches.length > 0\r\n ? serviceType.InventoryBatches.filter(\r\n f =>\r\n (f.ExpirationDate === null ||\r\n getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n (serviceType.NotLessThanZero\r\n ? f.Inventory > 0\r\n : true) &&\r\n (renewStock === true || f.StokRenewed === true),\r\n ).sort((a, b) => b.Id - a.Id)[0]\r\n : null\r\n : null;\r\n resolve([\r\n ...services,\r\n {\r\n Id: 0,\r\n ServiceTypeID: serviceType.Id,\r\n BookedBy: currentUser,\r\n DefaultQuantity: serviceType.DefaultQuantity,\r\n IntQuantityOnly: serviceType.IntQuantityOnly,\r\n Mandatory: false,\r\n Quantity: serviceType.DefaultQuantity,\r\n ServiceDate: newDate(),\r\n ServiceType: serviceType.Name,\r\n Units: serviceType.UnitTypeName,\r\n ServiceGroupId: serviceType.ServiceGroupId,\r\n NotLessThanZero: serviceType.NotLessThanZero,\r\n TrackInventory: serviceType.TrackInventory,\r\n InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n } as IOtherServices,\r\n ]);\r\n }\r\n } catch {\r\n resolve([...services]);\r\n } finally {\r\n setServiceCreated(undefined);\r\n }\r\n }),\r\n );\r\n },\r\n [\r\n createServiceFromServiceType,\r\n currentUser,\r\n getOffsetDate,\r\n newDate,\r\n renewStock,\r\n services,\r\n setServices,\r\n ],\r\n );\r\n const handleAddServices = React.useCallback(\r\n (serviceTypes: IOfflineServiceFilterDto[]) => {\r\n setServiceCreated(true);\r\n setServices(\r\n new Promise(async resolve => {\r\n try {\r\n if (!!createServicesFromServiceType) {\r\n let data = await createServicesFromServiceType(serviceTypes);\r\n if (!!data && data.length > 0) {\r\n resolve([...services, ...data]);\r\n } else {\r\n resolve([...services]);\r\n }\r\n } else {\r\n resolve([\r\n ...services,\r\n ...serviceTypes.map(s => {\r\n let batch = s.InventoryBatchesEnabled\r\n ? !!s.InventoryBatches && s.InventoryBatches.length > 0\r\n ? s.InventoryBatches.filter(\r\n f =>\r\n (f.ExpirationDate === null ||\r\n getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n (s.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n (renewStock === true || f.StokRenewed === true),\r\n ).sort((a, b) => b.Id - a.Id)[0]\r\n : null\r\n : null;\r\n return {\r\n Id: 0,\r\n ServiceTypeID: s.Id,\r\n BookedBy: currentUser,\r\n DefaultQuantity: s.DefaultQuantity,\r\n IntQuantityOnly: s.IntQuantityOnly,\r\n Mandatory: false,\r\n Quantity: s.DefaultQuantity,\r\n ServiceDate: newDate(),\r\n ServiceType: s.Name,\r\n Units: s.UnitTypeName,\r\n UnitTypeId: s.UnitTypeID,\r\n ServiceGroupId: s.ServiceGroupId,\r\n NotLessThanZero: s.NotLessThanZero,\r\n TrackInventory: s.TrackInventory,\r\n InventoryBatchesEnabled: s.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount:\r\n batch === null ? null : batch.Inventory,\r\n } as IOtherServices;\r\n }),\r\n ]);\r\n }\r\n } catch {\r\n resolve([...services]);\r\n } finally {\r\n setServiceCreated(undefined);\r\n }\r\n }),\r\n );\r\n },\r\n [\r\n createServicesFromServiceType,\r\n currentUser,\r\n getOffsetDate,\r\n newDate,\r\n renewStock,\r\n services,\r\n setServices,\r\n ],\r\n );\r\n const handleRemoveServices = async (items: IOtherServices[]) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (!!onServicesRemove) {\r\n try {\r\n let res = await onServicesRemove(items);\r\n setServices(\r\n services.filter(f => {\r\n if (isEditMode) {\r\n return !items.some(a => a.Id === f.Id);\r\n } else {\r\n return !items.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n }\r\n }),\r\n );\r\n resolve(res);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n let newServices = services.filter(f => {\r\n return !items.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServices(newServices);\r\n resolve(newServices);\r\n }\r\n });\r\n };\r\n const handleAddAndRemoveServices = async (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n removed: IOtherServices[],\r\n ) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (!!onAddAndRemoveServices) {\r\n try {\r\n let res = await onAddAndRemoveServices(serviceTypes, removed);\r\n setServices(res);\r\n resolve(res);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n let staticServices = serviceTypes.map(s => {\r\n return {\r\n Id: 0,\r\n ServiceTypeID: s.Id,\r\n BookedBy: currentUser,\r\n DefaultQuantity: s.DefaultQuantity,\r\n IntQuantityOnly: s.IntQuantityOnly,\r\n Mandatory: false,\r\n Quantity: s.DefaultQuantity,\r\n ServiceDate: newDate(),\r\n ServiceType: s.Name,\r\n Units: s.UnitTypeName,\r\n ServiceGroupId: s.ServiceGroupId,\r\n } as IOtherServices;\r\n });\r\n let addedServ = staticServices.filter(\r\n f => !services.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n let otherServices = services.filter(f => {\r\n return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServices([...otherServices, ...addedServ]);\r\n resolve([...otherServices, ...addedServ]);\r\n }\r\n });\r\n };\r\n const focusedService = React.useMemo(() => {\r\n return services.some(f => f.Quantity === null && f.DefaultQuantity === null)\r\n ? services.filter(\r\n f => f.Quantity === null && f.DefaultQuantity === null,\r\n )[0]\r\n : services[0];\r\n }, [services]);\r\n return (\r\n \r\n {services.map(item => (\r\n \r\n ))}\r\n 0 })}\r\n >\r\n {(useAssetSelection || showScannerView) && services.length < 1 && (\r\n \r\n )}\r\n\r\n
    \r\n
    \r\n {useAssetSelection ? (\r\n \r\n {\r\n let selParams = {\r\n useSidePanel: true,\r\n actionType: 'OfflineService',\r\n offTypeIds: services,\r\n } as AssetsSelectionProps;\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.AssetsSelection,\r\n props: selParams,\r\n expanded: false,\r\n }),\r\n );\r\n }\r\n }\r\n />\r\n \r\n ) : (\r\n \r\n )}\r\n
    \r\n
    \r\n \r\n
    \r\n );\r\n});\r\n","export enum ReservationOrDowntimeEnum {\r\n All = 0,\r\n ReservationsOnly = 1,\r\n DownTimeOnly = 2,\r\n}\r\n","import { capitalize } from 'lodash';\r\nimport { BookitDatePicker, BookitDatePickerProps } from '.';\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport clsx from 'clsx';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { useUtils } from '@material-ui/pickers';\r\nimport { validateError } from '../DatePicker/utils/pickerDateValidate';\r\nimport { v4 as uuid } from 'uuid';\r\n\r\nexport interface BookitDateTimePickerProps extends BookitDatePickerProps {\r\n labelInline?: boolean;\r\n}\r\n\r\nexport function BookitDateTimePicker({\r\n value,\r\n endTime,\r\n onChange,\r\n truncateTime,\r\n label,\r\n helperText,\r\n error,\r\n size,\r\n labelInline = false,\r\n dateLabel,\r\n timeLabel,\r\n maskIfEmpty,\r\n id = 'datetime_picker',\r\n ...props\r\n}: BookitDateTimePickerProps) {\r\n const utils = useUtils();\r\n const inputLabelId = label && id ? `${id}-label` : undefined;\r\n const helperTextId = id ? `${id}-helper-text` : undefined;\r\n const dateId = !!id ? `${id}-date` : uuid();\r\n const timeId = !!id ? `${id}-time` : uuid();\r\n const dateName = !!props.name ? `${props.name}-date` : uuid();\r\n const timeName = !!props.name ? `${props.name}-time` : uuid();\r\n const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n const dateLabelInline = labelInline\r\n ? dateLabel ?? `${label} Date`\r\n : undefined;\r\n const timeLabelInline = labelInline\r\n ? timeLabel ?? `${label} Time`\r\n : undefined;\r\n const dateTimeValue = React.useMemo(() => {\r\n return value;\r\n }, [value]);\r\n const [dateValue, setDateValue] = React.useState<\r\n Date | string | null | undefined\r\n >(() => {\r\n if (dateTimeValue === null || dateTimeValue === undefined) {\r\n return null;\r\n } else {\r\n let parsedValue = dateUtils.dateOrStringToDate(dateTimeValue);\r\n return parsedValue === null ? null : dateUtils.truncateTime(parsedValue);\r\n }\r\n });\r\n const [timeValue, setTimeValue] = React.useState<\r\n Date | string | null | undefined\r\n >(() => {\r\n if (dateTimeValue === null || dateTimeValue === undefined) {\r\n return null;\r\n } else {\r\n return dateUtils.dateOrStringToDate(dateTimeValue);\r\n }\r\n });\r\n React.useEffect(() => {\r\n setTimeValue(() => {\r\n if (dateTimeValue === null || dateTimeValue === undefined) {\r\n return null;\r\n } else {\r\n return dateUtils.dateOrStringToDate(dateTimeValue);\r\n }\r\n });\r\n setDateValue(() => {\r\n if (dateTimeValue === null || dateTimeValue === undefined) {\r\n return null;\r\n } else {\r\n let parsedValue = dateUtils.dateOrStringToDate(dateTimeValue);\r\n return parsedValue === null\r\n ? null\r\n : dateUtils.truncateTime(parsedValue);\r\n }\r\n });\r\n }, [dateTimeValue]);\r\n\r\n const handleChange = React.useCallback(\r\n (date: MaterialUiPickersDate, inpValue?: string | null): void => {\r\n let error = validateError(\r\n date,\r\n {\r\n maxDate: props.maxDate,\r\n minDate: props.minDate,\r\n disablePast: props.disablePast,\r\n disableFuture: props.disableFuture,\r\n maxDateMessage: props.maxDateMessage,\r\n minDateMessage: props.minDateMessage,\r\n invalidDateMessage: props.invalidDateMessage,\r\n strictCompareDates: props.strictCompareDates,\r\n },\r\n utils,\r\n );\r\n if (!!error) {\r\n setDateError(error);\r\n } else {\r\n if (!(date?.toString() === 'Invalid Date')) {\r\n if (props.required && (date === null || date === undefined)) {\r\n setDateError(`${label} is a required field`);\r\n if (!!props.onError) {\r\n props.onError(`${label} is a required field`, date);\r\n }\r\n } else {\r\n onChange(\r\n date === null || date === undefined\r\n ? null\r\n : new CustomDate(date, 'complete'),\r\n inpValue,\r\n );\r\n }\r\n }\r\n }\r\n // onChange(\r\n // date === null || date === undefined\r\n // ? null\r\n // : new CustomDate(date, 'complete'),\r\n // inpValue,\r\n // );\r\n },\r\n [label, onChange, props, utils],\r\n );\r\n const handleDateChange = React.useCallback(\r\n (displayValue: MaterialUiPickersDate): void => {\r\n const finalValue =\r\n displayValue === null\r\n ? null\r\n : displayValue === undefined\r\n ? null\r\n : displayValue;\r\n setDateValue(finalValue);\r\n if (finalValue !== null) {\r\n if (timeValue === null || timeValue === undefined) {\r\n setTimeValue(dateUtils.startOfDay(finalValue));\r\n if (props.saveOnSelect) {\r\n handleChange(dateUtils.startOfDay(finalValue));\r\n }\r\n } else {\r\n let time = dateUtils.dateOrStringToDate(timeValue);\r\n let val = dateUtils.set(dateUtils.truncateTime(finalValue), {\r\n hours: time === null ? 0 : time.getHours(),\r\n minutes: time === null ? 0 : time.getMinutes(),\r\n seconds: time === null ? 0 : time.getSeconds(),\r\n });\r\n handleChange(val);\r\n }\r\n } else {\r\n if (props.saveOnSelect) {\r\n setTimeValue(null);\r\n handleChange(null);\r\n } else {\r\n if (timeValue === null || timeValue === undefined) {\r\n handleChange(null);\r\n }\r\n }\r\n }\r\n },\r\n [handleChange, props.saveOnSelect, timeValue],\r\n );\r\n const handleTimeChange = React.useCallback(\r\n (displayValue: MaterialUiPickersDate): void => {\r\n const finalValue =\r\n displayValue === null\r\n ? null\r\n : displayValue === undefined\r\n ? null\r\n : displayValue;\r\n setTimeValue(finalValue);\r\n if (finalValue !== null) {\r\n if (dateValue !== null && dateValue !== undefined) {\r\n let val = dateUtils.set(dateUtils.truncateTime(dateValue), {\r\n hours: finalValue.getHours(),\r\n minutes: finalValue.getMinutes(),\r\n seconds: finalValue.getSeconds(),\r\n });\r\n handleChange(val);\r\n }\r\n } else {\r\n if (dateValue === null || dateValue === undefined) {\r\n handleChange(null);\r\n }\r\n }\r\n },\r\n [dateValue, handleChange],\r\n );\r\n const [dateError, setDateError] = React.useState(\r\n undefined,\r\n );\r\n const [timeError, setTimeError] = React.useState(\r\n undefined,\r\n );\r\n const validationError = React.useMemo(() => {\r\n return dateError || timeError || undefined;\r\n }, [dateError, timeError]);\r\n const handleOnError = React.useCallback(\r\n (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n if (!!props.onError) {\r\n props.onError(validationError, value);\r\n }\r\n },\r\n [props, validationError],\r\n );\r\n const onDateError = React.useCallback(\r\n (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n setDateError(error);\r\n if (!!props.onError) {\r\n handleOnError(error, value);\r\n }\r\n },\r\n [handleOnError, props.onError],\r\n );\r\n const onTimeError = React.useCallback(\r\n (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n setTimeError(error);\r\n if (!!props.onError) {\r\n handleOnError(error, value);\r\n }\r\n },\r\n [handleOnError, props.onError],\r\n );\r\n\r\n return (\r\n \r\n
    \r\n {label && !labelInline && (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n \r\n
    \r\n {(!!helperText || !!validationError) && (\r\n \r\n {helperText || validationError}\r\n \r\n )}\r\n
    \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.assetInventory || initialState;\r\n\r\nexport const selectAssetInventory = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectRoomSelected = createSelector(\r\n [selectAssetInventory],\r\n state => state.selectedRoomState,\r\n);\r\nexport const selectLocationSelected = createSelector(\r\n [selectAssetInventory],\r\n state => state.selectedLocationState,\r\n);\r\nexport const selectSubLocationSelected = createSelector(\r\n [selectAssetInventory],\r\n state => state.selectedSubLocationState,\r\n);\r\nexport const selectScanProcessing = createSelector(\r\n [selectAssetInventory],\r\n state => state.scanProcessing,\r\n);\r\nexport const selectNoRoomAccessProcessing = createSelector(\r\n [selectAssetInventory],\r\n state => state.noRoomAccessProcessing,\r\n);\r\nexport const selectInventoryLogFilters = createSelector(\r\n [selectAssetInventory],\r\n state => state.logFilters,\r\n);\r\n","export enum MultipleInstrumentReservations {\r\n NotAllowed = 0,\r\n AllowedDefaultMultiple = 1,\r\n AllowedDefaultSingle = 2,\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { IOptionWithIcon } from 'app/components/Dashboard/TableViewEdit/ViewTypePicker';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { Entity } from 'types/common';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ISchedulerParseEvent } from '../types/ISchedulerParseEvent';\r\n\r\n/* --- STATE --- */\r\n\r\nexport interface SchedulerState {\r\n viewState?: IViewState;\r\n previousViewState?: IViewState;\r\n selectedServices?: Array;\r\n derivedServices?: Array;\r\n filters?: ISerializableFilterSettings;\r\n events: Record>;\r\n offlineHours: Record>;\r\n trainingSessions: Record>;\r\n nonWorkingHours?: Array;\r\n tempReservations?: INewEvent;\r\n multipleInstrumentsMode?: boolean;\r\n notUseLocation?: boolean;\r\n emptySlotAdminClick: EmptySlotAdminClick;\r\n selectedReservationEvents: Array;\r\n loadingEvents?: boolean;\r\n TimelineGroupBy: TimelineGroupByUnion;\r\n exportToPDF: boolean;\r\n}\r\nexport type ViewTypes = 'calendar' | 'timeline';\r\nexport type ViewMultiToggleType = 'single' | 'multi';\r\nexport const ViewLengthsArray = [\r\n 'day',\r\n 'twodays',\r\n 'customdays',\r\n 'week',\r\n 'month',\r\n 'quarter',\r\n 'year',\r\n 'customPeriod',\r\n] as const;\r\ntype ViewLengthsTuple = typeof ViewLengthsArray;\r\nexport type ViewLengths = ViewLengthsTuple[number];\r\nexport const viewLengthOptions: IOptionWithIcon[] = [\r\n { Id: 'day', Name: 'SchedulerDay', shortName: 'SchedulerShortDay' },\r\n { Id: 'twodays', Name: 'TimelineTwoDays', shortName: 'TimelineShortTwoDays' },\r\n {\r\n Id: 'customdays',\r\n Name: 'TimelineCustomDays',\r\n shortName: 'TimelineShortCustomDays',\r\n },\r\n { Id: 'week', Name: 'SchedulerWeek', shortName: 'SchedulerShortWeek' },\r\n { Id: 'month', Name: 'SchedulerMonth', shortName: 'SchedulerShortMonth' },\r\n {\r\n Id: 'quarter',\r\n Name: 'TimelinePeriodQuarter',\r\n shortName: 'TimelineShortQuarter',\r\n },\r\n { Id: 'year', Name: 'TimelinePeriodYear', shortName: 'TimelineShortYear' },\r\n {\r\n Id: 'customPeriod',\r\n Name: 'TimelineCustomDays',\r\n shortName: 'TimelineShortCustomDays',\r\n Icon: 'cog',\r\n },\r\n];\r\nexport const viewTypeOptions: IOptionWithIcon[] = [\r\n {\r\n Id: 'calendar',\r\n Name: 'Calendar',\r\n Icon: 'calendar',\r\n },\r\n {\r\n Id: 'timeline',\r\n Name: 'Timeline',\r\n Icon: 'list-timeline',\r\n },\r\n];\r\nexport type ISerializableFilterSettings = Record<\r\n string,\r\n {\r\n value: any;\r\n predicate: string | Condition;\r\n }\r\n>;\r\nexport const getViewType = (type: ViewTypes) => {\r\n return viewTypeOptions.find(f => f.Id === type);\r\n};\r\nexport const getViewLength = (length: ViewLengths) => {\r\n return viewLengthOptions.find(f => f.Id === length);\r\n};\r\n// Parsing error: Type expected.\r\n// TODO: upgrade prettier to support Template Literal Types (https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html)\r\n// prettier v2.2.0 + - https://prettier.io/blog/2020/11/20/2.2.0.html#typescript\r\n// eslint-disable-next-line prettier/prettier\r\nexport type ViewModesTimeline = `${ViewLengths}_timeline`;\r\n// eslint-disable-next-line prettier/prettier\r\nexport type ViewModesUnit = `${ViewLengths}_unit`;\r\nexport type ViewModes = ViewLengths | ViewModesTimeline | ViewModesUnit;\r\n\r\nexport interface IInstrument extends Entity {\r\n ServiceGroup: Entity;\r\n Color: string;\r\n}\r\n\r\nexport interface IChangeViewModePayload {\r\n current: IViewState;\r\n withNoChangeLocation?: boolean;\r\n forceEvents?: boolean;\r\n}\r\n\r\nexport interface IEventBase {\r\n start_date: Timestamp;\r\n end_date: Timestamp;\r\n service_id: number;\r\n service_name: string;\r\n color?: string | null;\r\n}\r\n\r\nexport interface IEvent extends IEventBase {\r\n id: number;\r\n reservation_id?: number;\r\n alert_id?: number;\r\n service_id: number;\r\n service_name: string;\r\n user_id: string;\r\n user_name: string;\r\n}\r\n\r\nexport interface INonWorkingHours extends IEventBase {\r\n id: `nonworking_${number}`;\r\n}\r\nexport interface IOfflineHours extends IEventBase {\r\n id: `offline_${number}`;\r\n offline: true;\r\n}\r\n\r\nexport type ISchedulerService = IServiceFilterDto;\r\n\r\nexport interface INewEvent {\r\n id: string | number;\r\n start_date: Timestamp;\r\n end_date: Timestamp;\r\n service_id?: number | Array;\r\n alert_type?: number;\r\n sample_run_id?: number;\r\n defaultMulti?: boolean;\r\n bid?: number;\r\n srid?: number;\r\n srrid?: number;\r\n un?: string;\r\n duration?: number;\r\n}\r\nexport interface IEditEvent extends ISchedulerParseEvent {}\r\n\r\nexport type EventType = 'offline' | 'reservation' | 'trainingsession';\r\n\r\nexport interface IViewState {\r\n preset: SchedulerDatePositionUnion | null;\r\n viewType: ViewTypes;\r\n viewLength: ViewLengths;\r\n date: Timestamp;\r\n search: string;\r\n customDays?: number;\r\n customStart?: boolean;\r\n groupBy?: TimelineGroupByUnion;\r\n}\r\nexport interface RestrictDuration {\r\n durationType: RestrictDurationUnitTypes;\r\n durationAmount: number;\r\n}\r\n\r\nexport type ChangeViewModeAction = PayloadAction;\r\nexport type GetServicesAction = PayloadAction<\r\n Array | undefined\r\n>;\r\nexport type ChangeServicesAction = PayloadAction>;\r\nexport type SetFilterAction = PayloadAction<\r\n ISerializableFilterSettings | undefined\r\n>;\r\n\r\nexport interface IOnlineEventDto {\r\n StartTime: string;\r\n EndTime: string;\r\n EquipmentId: number;\r\n ServiceGroupId: number;\r\n AssetRoomId: number | null;\r\n AssetCampusId: number | null;\r\n AssetBuildingId: number | null;\r\n AssetGroupId: number | null;\r\n AssetCatId: number | null;\r\n AvailabilityTypeId: number | null;\r\n BookedById: string;\r\n}\r\nexport interface DateSection {\r\n date: Date;\r\n section?: number;\r\n}\r\nexport interface LeftTop {\r\n left: number;\r\n top: number;\r\n}\r\nexport type ScrollPosition = DateSection | LeftTop | Date | number;\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { OnlineServiceMultiPicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ServiceMultiFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport const ServiceAdminFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport const ServiceReservationFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const P = styled.p`\r\n font-size: 1rem;\r\n line-height: 1.5;\r\n color: black;\r\n margin: 0.625rem 0 1.5rem 0;\r\n`;\r\n","import * as React from 'react';\r\nimport styled from 'styled-components/macro';\r\nimport { P } from './P';\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Button } from '../../components/BasicButtons/Button';\r\n\r\nexport function NotFoundPage() {\r\n return (\r\n <>\r\n \r\n 404 Page Not Found\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

    Page not found!

    \r\n

    \r\n Unfortunately the page you a looking for doesn’t exist
    \r\n (anymore) or there was an error in the link that you
    \r\n followed or typed.\r\n

    \r\n window.open(toRootedURL('Divisions.aspx'), '_self')}\r\n >\r\n {' '}\r\n Go back to main{' '}\r\n \r\n
    \r\n
    \r\n \r\n );\r\n}\r\n\r\nconst DivStyle = styled.div`\r\n display: inline-block;\r\n padding: 70px;\r\n`;\r\n\r\nconst Wrapper = styled.div`\r\n height: 100vh;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n min-height: 320px;\r\n`;\r\n\r\n/* const Title = styled.div`\r\n margin-top: -8vh;\r\n font-weight: bold;\r\n color: black;\r\n font-size: 3.375rem;\r\n\r\n span {\r\n font-size: 3.125rem;\r\n }\r\n`;*/\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\nexport const autocompleteExtendStyles = makeStyles((theme: Theme) => ({\r\n extendRoot: {\r\n '&.Mui-focused $infoWidthPlus': {\r\n right: '48px',\r\n },\r\n '@media (pointer: fine)': {\r\n '&:hover $infoWidthPlus': {\r\n right: '48px',\r\n },\r\n },\r\n },\r\n infoIcon: {\r\n padding: '4px',\r\n top: 'calc(50% - 14px)',\r\n position: 'absolute',\r\n cursor: 'auto',\r\n zIndex: 4,\r\n '& > svg': {\r\n width: '12px',\r\n height: '12px',\r\n },\r\n },\r\n infoWidthPlus: {\r\n right: '26px',\r\n },\r\n infoWidthMinus: {\r\n right: '26px',\r\n },\r\n}));\r\n/* These styles was taken from original place https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/Autocomplete/Autocomplete.js\r\n and partially redefined for for our components */\r\nexport const autocompleteStyles = makeStyles((theme: Theme) => ({\r\n /* Styles applied to the root element. */\r\n root: {\r\n '&$focused $clearIndicatorDirty': {\r\n visibility: 'visible',\r\n //display: 'inline-flex',\r\n },\r\n /* Avoid double tap issue on iOS */\r\n '@media (pointer: fine)': {\r\n '&:hover $clearIndicatorDirty': {\r\n visibility: 'visible',\r\n //display: 'inline-flex',\r\n },\r\n // '&:hover $infoWidthPlus': {\r\n // right: '54px',\r\n // },\r\n },\r\n // '&$focused $infoWidthPlus': {\r\n // right: '54px',\r\n // },\r\n '&>[class*=\"MuiFormControl-root\"]': {\r\n '&>[class*=\"multiSelect\"]': {\r\n maxWidth: '400px',\r\n // paddingTop: '6px',\r\n // paddingBottom: '6px',\r\n '&>[class*=\"shortView\"]': {\r\n maxWidth: 360,\r\n },\r\n '&.hasLabel': {\r\n '& > $tag:first-child': {\r\n marginTop: '6px',\r\n //marginBottom: '6px',\r\n },\r\n },\r\n [theme.breakpoints.up('sm')]: {\r\n maxWidth: '100%',\r\n '&>[class*=\"shortView\"]': {\r\n maxWidth: '100%',\r\n },\r\n },\r\n },\r\n '&>[class*=\"MuiInputLabel-filled\"]': {\r\n transform: 'translate(12px, 16px) scale(1)',\r\n // long placeholder/label might break in 2+ lines - show only single line here\r\n // setting up width to minimum assuming there might be clear as well as other adornments just in case\r\n // 12px is the left translate value, the other sum equals to max paddingRight of filled inputRoot\r\n width: 'calc(100% - 12px - (52px + 4px + 9px))',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n paddingTop: 0,\r\n paddingBottom: 0,\r\n '&.adornedStart-label': {\r\n transform: 'translate(41px, 16px) scale(0.85)',\r\n },\r\n '&[class*=\"MuiInputLabel-shrink\"]': {\r\n letterSpacing: '0.2px',\r\n transform: 'translate(12px, 8px) scale(1)',\r\n // '&$marginDense': {\r\n // transform: 'translate(12px, 4px) scale(0.75)',\r\n // },\r\n '&.adornedStart-label': {\r\n transform: 'translate(41px, 27px) scale(0.85)',\r\n },\r\n },\r\n '&[class*=\"multiSelect\"][class*=\"MuiInputLabel-shrink\"]': {\r\n letterSpacing: '0.2px',\r\n transform: 'translate(12px, 4px) scale(1)',\r\n // '&$marginDense': {\r\n // transform: 'translate(12px, 4px) scale(0.75)',\r\n // },\r\n '&.adornedStart-label': {\r\n transform: 'translate(41px, 27px) scale(0.85)',\r\n },\r\n },\r\n },\r\n },\r\n '&>[class*=\"MuiInputLabel-shrink\"]': {\r\n transform: 'translate(0, -2.5px) scale(1.1)',\r\n },\r\n },\r\n /* Styles applied to the root element if `fullWidth={true}`. */\r\n fullWidth: {\r\n width: '100%',\r\n '&>[class*=\"MuiFormControl-root\"]': {\r\n '&>[class*=\"multiSelect\"]': {\r\n maxWidth: '100%',\r\n },\r\n '&>[class*=\"shortView\"]': {\r\n maxWidth: 360,\r\n },\r\n [theme.breakpoints.up('sm')]: {\r\n maxWidth: '100%',\r\n '&>[class*=\"shortView\"]': {\r\n maxWidth: '100%',\r\n },\r\n },\r\n },\r\n },\r\n /* Pseudo-class applied to the root element if focused. */\r\n focused: {},\r\n /* Styles applied to the tag elements, e.g. the chips. */\r\n tag: {\r\n margin: 0,\r\n // maxWidth: 400, //'calc(100% - 56px)',\r\n // //width: 'inherit',\r\n // [theme.breakpoints.down('sm')]: {\r\n // maxWidth: 300,\r\n // },\r\n },\r\n /* Styles applied to the tag elements, e.g. the chips if `size=\"small\"`. */\r\n tagSizeSmall: {\r\n margin: 0,\r\n maxWidth: 'calc(100% - 4px)',\r\n },\r\n /* Styles applied when the popup icon is rendered. */\r\n hasPopupIcon: {},\r\n /* Styles applied when the clear icon is rendered. */\r\n hasClearIcon: {\r\n '& > * > * > [class*=\"infoWidthPlus\"]': {\r\n right: '48px',\r\n },\r\n },\r\n /* Styles applied to the Input element. */\r\n // inputRoot: {\r\n // backgroundColor: theme.palette.common.white,\r\n // border: `1px solid ${theme.palette.common.grayBorders}`,\r\n // borderRadius: 6,\r\n // cursor: 'auto',\r\n // flexWrap: 'wrap',\r\n // height: 32,\r\n // '$hasPopupIcon &, $hasClearIcon &': {\r\n // paddingRight: 26 + 4,\r\n // },\r\n // '$hasPopupIcon$hasClearIcon &': {\r\n // paddingRight: 24 + 4,\r\n // },\r\n // gap: 4,\r\n // // 'label + &': {\r\n // // marginTop: '21px',\r\n // // },\r\n // // 'label + &[class*=\"MuiFilledInput-root\"]': {\r\n // // marginTop: '0',\r\n // // },\r\n // '& $input': {\r\n // width: 'auto',\r\n // minWidth: 30,\r\n // padding: '7px 12px',\r\n // },\r\n // '&:hover': {\r\n // backgroundColor: 'unset', //'rgba(255, 255, 255, 0.80)',\r\n // // Reset on touch devices, it doesn't add specificity\r\n // '@media (hover: none)': {\r\n // backgroundColor: 'unset', //'rgba(255, 255, 255, 0.90)',\r\n // },\r\n // },\r\n // '&[class*=\"Mui-focused\"]': {\r\n // backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n // border: `1px solid ${theme.palette.primary.main}`,\r\n // },\r\n // '&[class*=\"Mui-disabled\"]': {\r\n // backgroundColor: theme.palette.common.backgroundHover,\r\n // },\r\n // '&[class*=\"MuiInput-root\"]': {\r\n // paddingBottom: 1,\r\n // '& $input': {\r\n // padding: 4,\r\n // },\r\n // '& $input:first-child': {\r\n // padding: '6px 0',\r\n // },\r\n // },\r\n // '&[class*=\"marginDense\"]': {\r\n // borderRadius: 4,\r\n // '& $input': {\r\n // padding: '4px 4px 5px',\r\n // },\r\n // '& $input:first-child': {\r\n // padding: '1px 0px 1px 6px',\r\n // },\r\n // },\r\n // '&[class*=\"MuiOutlinedInput-root\"]': {\r\n // padding: 9,\r\n // '$hasPopupIcon &, $hasClearIcon &': {\r\n // paddingRight: 26 + 4 + 9,\r\n // },\r\n // '$hasPopupIcon$hasClearIcon &': {\r\n // paddingRight: 52 + 4 + 9,\r\n // },\r\n // '& $input': {\r\n // padding: '9.5px 4px',\r\n // },\r\n // '& $input:first-child': {\r\n // paddingLeft: 6,\r\n // },\r\n // '& $endAdornment': {\r\n // right: 9,\r\n // },\r\n // },\r\n // '&[class*=\"MuiOutlinedInput-root\"][class*=\"MuiOutlinedInput-marginDense\"]': {\r\n // padding: 6,\r\n // '& $input': {\r\n // padding: '4.5px 4px',\r\n // },\r\n // },\r\n // '&[class*=\"MuiFilledInput-root\"]': {\r\n // paddingTop: 16,\r\n // paddingLeft: 8,\r\n // '$hasPopupIcon &, $hasClearIcon &': {\r\n // paddingRight: 26 + 4 + 9,\r\n // },\r\n // '$hasPopupIcon$hasClearIcon &': {\r\n // paddingRight: 52 + 4 + 9,\r\n // },\r\n // '& $input': {\r\n // padding: '6px 4px 4px',\r\n // },\r\n // '& $endAdornment': {\r\n // right: 4,\r\n // },\r\n // '&[class*=\"MuiFilledInput-adornedStart\"]': {\r\n // //paddingLeft: '36px',\r\n // '&>.adornedStart': {\r\n // cursor: 'auto',\r\n // position: 'absolute',\r\n // left: 12,\r\n // top: 'calc(50% - 3px)',\r\n // },\r\n // },\r\n // },\r\n // '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"]': {\r\n // paddingTop: 14,\r\n // paddingBottom: 0,\r\n // '& $input': {\r\n // padding: '4.5px 4px',\r\n // },\r\n // },\r\n // '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"][class*=\"miniDense\"]': {\r\n // paddingTop: 2,\r\n // paddingBottom: 2,\r\n // //borderRadius: '6px',\r\n // border: `1px solid ${theme.palette.primary.main}`,\r\n // '& $input': {\r\n // padding: '3.5px 3px',\r\n // },\r\n // },\r\n // },\r\n inputRoot: {\r\n flexWrap: 'wrap',\r\n backgroundColor: theme.palette.common.white,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n borderRadius: 6,\r\n cursor: 'auto',\r\n minHeight: 32,\r\n '$hasPopupIcon &, $hasClearIcon &': {\r\n paddingRight: 56, //26 + 4,\r\n },\r\n '$hasPopupIcon$hasClearIcon &': {\r\n paddingRight: 56, //24 + 4,\r\n },\r\n gap: 4,\r\n '& $input': {\r\n width: 'auto',\r\n minWidth: 30,\r\n //padding: '6px 12px',\r\n },\r\n '&[class*=\"MuiInput-root\"]': {\r\n paddingBottom: 0,\r\n '& $input': {\r\n padding: 4,\r\n },\r\n '& $input:first-child': {\r\n padding: '6px 12px',\r\n },\r\n },\r\n '&[class*=\"MuiInput-root\"][class*=\"MuiInput-marginDense\"]': {\r\n // '& $input': {\r\n // padding: '4px 4px 5px',\r\n // },\r\n // '& $input:first-child': {\r\n // padding: '4px 4px 5px', //'3px 0 6px',\r\n // },\r\n borderRadius: 6,\r\n '& $input': {\r\n padding: '4px 4px 5px',\r\n },\r\n '& $input:first-child': {\r\n padding: '1px 0px 1px 7px',\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.80)',\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n },\r\n },\r\n '&[class*=\"Mui-focused\"]': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n border: `1px solid ${theme.palette.primary.main}`,\r\n },\r\n '&[class*=\"Mui-disabled\"]': {\r\n backgroundColor: theme.palette.common.backgroundHover,\r\n },\r\n '&[class*=\"MuiOutlinedInput-root\"]': {\r\n padding: 9,\r\n '$hasPopupIcon &, $hasClearIcon &': {\r\n paddingRight: 26 + 4 + 9,\r\n },\r\n '$hasPopupIcon$hasClearIcon &': {\r\n paddingRight: 52 + 4 + 9,\r\n },\r\n '& $input': {\r\n padding: '9.5px 4px',\r\n },\r\n '& $input:first-child': {\r\n paddingLeft: 6,\r\n },\r\n '& $endAdornment': {\r\n right: 9,\r\n },\r\n },\r\n '&[class*=\"MuiOutlinedInput-root\"][class*=\"MuiOutlinedInput-marginDense\"]': {\r\n padding: 6,\r\n '& $input': {\r\n padding: '4.5px 4px',\r\n },\r\n },\r\n '&[class*=\"MuiFilledInput-root\"]': {\r\n paddingTop: 16,\r\n paddingLeft: 8,\r\n minHeight: 48,\r\n height: 'auto',\r\n '$hasPopupIcon &, $hasClearIcon &': {\r\n paddingRight: 26 + 4 + 9,\r\n },\r\n '$hasPopupIcon$hasClearIcon &': {\r\n paddingRight: 52 + 4 + 9,\r\n },\r\n '& $input': {\r\n padding: '6px 4px 4px',\r\n },\r\n '& $endAdornment': {\r\n right: 4,\r\n },\r\n '&[class*=\"MuiFilledInput-adornedStart\"]': {\r\n //paddingLeft: '36px',\r\n '&>.adornedStart': {\r\n cursor: 'auto',\r\n position: 'absolute',\r\n left: 12,\r\n top: 'calc(50% - 3px)',\r\n },\r\n },\r\n },\r\n '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"]': {\r\n paddingTop: 14,\r\n paddingBottom: 0,\r\n '& $input': {\r\n padding: '4.5px 4px',\r\n },\r\n },\r\n },\r\n /* Styles applied to the input element. */\r\n input: {\r\n flexGrow: 1,\r\n textOverflow: 'ellipsis',\r\n opacity: 0,\r\n padding: '6px 12px',\r\n },\r\n /* Styles applied to the input element if tag focused. */\r\n inputFocused: {\r\n opacity: 1,\r\n },\r\n /* Styles applied to the endAdornment element. */\r\n endAdornment: {\r\n // We use a position absolute to support wrapping tags.\r\n position: 'absolute',\r\n right: 8,\r\n top: 'calc(50% - 11px)', // Center vertically\r\n },\r\n /* Styles applied to the clear indicator. */\r\n clearIndicator: {\r\n marginRight: 2,\r\n padding: 4,\r\n '& > * > svg': {\r\n width: 12,\r\n height: 12,\r\n cursor: 'pointer',\r\n },\r\n visibility: 'hidden',\r\n //display: 'none',\r\n },\r\n /* Styles applied to the clear indicator if the input is dirty. */\r\n clearIndicatorDirty: { visibility: 'visible', display: 'inline-flex' },\r\n /* Styles applied to the popup indicator. */\r\n popupIndicator: {\r\n padding: 4,\r\n marginRight: 0,\r\n '& > * > svg': {\r\n width: 12,\r\n height: 12,\r\n },\r\n },\r\n /* Styles applied to the popup indicator if the popup is open. */\r\n popupIndicatorOpen: {\r\n transform: 'rotate(180deg)',\r\n },\r\n /* Styles applied to the popper element. */\r\n popper: {\r\n zIndex: theme.zIndex.modal,\r\n },\r\n /* Styles applied to the popper element if `disablePortal={true}`. */\r\n popperDisablePortal: {\r\n position: 'absolute',\r\n },\r\n /* Styles applied to the `Paper` component. */\r\n paper: {\r\n ...theme.typography.bodyM,\r\n overflow: 'hidden',\r\n margin: '4px 0',\r\n },\r\n /* Styles applied to the `listbox` component. */\r\n listbox: {\r\n listStyle: 'none',\r\n margin: 0,\r\n padding: '8px 0',\r\n maxHeight: '40vh',\r\n overflow: 'auto',\r\n },\r\n /* Styles applied to the loading wrapper. */\r\n loading: {\r\n color: theme.palette.text.disabled,\r\n padding: '14px 16px',\r\n },\r\n /* Styles applied to the no option wrapper. */\r\n noOptions: {\r\n color: theme.palette.text.secondary,\r\n padding: '14px 16px',\r\n },\r\n /* Styles applied to the option elements. */\r\n option: {\r\n minHeight: 48,\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n cursor: 'pointer',\r\n paddingTop: 6,\r\n boxSizing: 'border-box',\r\n outline: '0',\r\n WebkitTapHighlightColor: 'transparent',\r\n paddingBottom: 6,\r\n paddingLeft: 16,\r\n paddingRight: 16,\r\n [theme.breakpoints.up('sm')]: {\r\n minHeight: 'auto',\r\n },\r\n '&[aria-selected=\"true\"]': {\r\n backgroundColor: theme.palette.action.selected,\r\n },\r\n '&[data-focus=\"true\"]': {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n '&:active': {\r\n backgroundColor: theme.palette.action.selected,\r\n },\r\n '&[aria-disabled=\"true\"]': {\r\n opacity: theme.palette.action.disabledOpacity,\r\n pointerEvents: 'none',\r\n },\r\n },\r\n /* Styles applied to the group's label elements. */\r\n groupLabel: {\r\n backgroundColor: theme.palette.background.paper,\r\n top: -8,\r\n },\r\n /* Styles applied to the group's ul elements. */\r\n groupUl: {\r\n padding: 0,\r\n '& $option': {\r\n paddingLeft: 24,\r\n },\r\n },\r\n}));\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { intersection } from 'lodash';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const initFilterData = async (\r\n filters: IFilterSettings[],\r\n serviceGroups?: Identifiable[],\r\n): Promise[]> => {\r\n var result = Promise.all(\r\n filters.map(async item => {\r\n if (item.initData === undefined) {\r\n return item;\r\n }\r\n if (item.value === undefined) {\r\n return item;\r\n }\r\n if (item.value === null) {\r\n return item;\r\n }\r\n if (typeof item.value === 'string') {\r\n return item;\r\n }\r\n if (\r\n Array.isArray(item.value) &&\r\n item.value.some(f => f.Name !== undefined)\r\n ) {\r\n return item;\r\n }\r\n try {\r\n const data = await item.initData(item.value, serviceGroups);\r\n if (data !== undefined) {\r\n return {\r\n ...item,\r\n ...{\r\n value: filterByServiceGroups(\r\n data,\r\n serviceGroups?.map(f => f.Id) ?? [],\r\n ),\r\n initCompleted: item.refreshAfterInit ? true : undefined,\r\n },\r\n };\r\n } else {\r\n return item;\r\n }\r\n } catch {\r\n return item;\r\n }\r\n }),\r\n );\r\n return result;\r\n};\r\n\r\nfunction filterByServiceGroups(item, serviceGroups: number[]) {\r\n if (serviceGroups.length === 0) {\r\n return item;\r\n }\r\n if (item.ServiceGroupId !== undefined) {\r\n if (serviceGroups.includes(item.ServiceGroupId)) {\r\n return item;\r\n } else {\r\n return null;\r\n }\r\n } else if (item.ServiceGroups !== undefined) {\r\n let a = [];\r\n if (item.ServiceGroups.length === 0) {\r\n return item;\r\n } else {\r\n if (typeof item.ServiceGroups[0] === 'number') {\r\n a = item.ServiceGroups;\r\n } else {\r\n a = item.ServiceGroups.map(f => f.Id);\r\n }\r\n }\r\n const intersectsWithServiceGroups =\r\n intersection(a, serviceGroups).length > 0;\r\n if (intersectsWithServiceGroups) {\r\n return item;\r\n } else {\r\n return null;\r\n }\r\n } else if (Array.isArray(item)) {\r\n return item\r\n .map(c => filterByServiceGroups(c, serviceGroups))\r\n .filter(f => f != null);\r\n }\r\n return item;\r\n}\r\n","export enum InvoiceStatuses {\r\n New,\r\n SentToBilling,\r\n SentToReview,\r\n BillingRejected,\r\n Paid,\r\n ReviewApproved,\r\n ReviewRejected,\r\n}\r\n","import { AsyncDataState } from 'types/common';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { FieldHandlerProps } from '../../FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface RepetitiveState extends AsyncDataState {\r\n repetitiveValueHandler?: FieldHandlerProps;\r\n}\r\nexport enum RepetitiveFor {\r\n WorkOrder = 1,\r\n Reservations = 2,\r\n Schedule = 3,\r\n}\r\n","import {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport {\r\n ALL_PERIOD_TYPES,\r\n PeriodTypes,\r\n PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport i18next from 'i18next';\r\nimport * as React from 'react';\r\n\r\nconst DATE_PERIODS = (periods?: Array) => {\r\n const all = ALL_PERIOD_TYPES.map((value, index) => {\r\n return { Id: value, Name: value };\r\n });\r\n if (periods === undefined) {\r\n return all;\r\n } else {\r\n return all.filter(f => periods.includes(f.Name));\r\n }\r\n};\r\n\r\nexport interface DatePeriodsPickerProps\r\n extends Omit, 'getOptions'> {\r\n periods?: Array;\r\n twoDaysDisabled?: boolean;\r\n}\r\nexport function getPeriods(periods?: Array) {\r\n return DATE_PERIODS(periods);\r\n}\r\nconst getOptions = (\r\n searchTerm: string | null,\r\n periods?: Array,\r\n) => {\r\n let items = DATE_PERIODS(periods).map(item => {\r\n return {\r\n Id: item.Id,\r\n Name: i18next.t(item.Name),\r\n type: item.Name as PeriodTypes,\r\n };\r\n });\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\nexport function DatePeriodsPicker(props: DatePeriodsPickerProps) {\r\n const getOptionsCallback = React.useCallback(\r\n (searchTerm: string | null) => {\r\n return getOptions(searchTerm, props.periods);\r\n },\r\n [props.periods],\r\n );\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nconst url = '/api/odata/v4/UnitTypesFilter';\r\n\r\nexport interface UnitTypePickerProps\r\n extends Omit, 'loadData'> {\r\n type?: number;\r\n $select?: Array;\r\n}\r\n\r\nexport interface UnitType extends Entity {\r\n SourceUnits: Conversion[];\r\n TargetUnits: Conversion[];\r\n CategoryType: number | null;\r\n}\r\n\r\ninterface Conversion {\r\n ConversionRate: number;\r\n TargetId: number;\r\n}\r\n\r\nexport const getUnitTypesData = () => {\r\n const params: {\r\n $orderby: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $skip: 0,\r\n $top: 100,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as UnitType[]);\r\n};\r\n\r\nexport const initUnitTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return Promise.resolve([]);\r\n }\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as UnitType[]);\r\n};\r\nconst loadData = (\r\n $select?: Array | undefined,\r\n predicates?: (string | Condition)[],\r\n) => {\r\n return getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: $select ?? [\r\n 'Id',\r\n 'Name',\r\n 'CategoryType',\r\n 'SourceUnits',\r\n 'TargetUnits',\r\n ],\r\n });\r\n};\r\n// const getLoadData = (\r\n// type?: number,\r\n// $select?: Array | undefined,\r\n// ) => (searchTerm: string | null) => {\r\n// const params: {\r\n// $orderby: string;\r\n// $filter?: string;\r\n// $select?: string | undefined;\r\n// } = {\r\n// $orderby: 'Name asc',\r\n// $select: $select?.join(','),\r\n// };\r\n\r\n// const predicates: Condition[] = [];\r\n// if (type !== undefined) {\r\n// predicates.push(new Condition('CategoryType', ODataOperators.Equals, type));\r\n// }\r\n// params.$filter = new ODataFilterBuilder({\r\n// predicates: predicates,\r\n// stringColumns: ['Name'],\r\n// stringSearch: searchTerm,\r\n// }).toString();\r\n\r\n// return httpClient\r\n// .get(url, params)\r\n// .then(response => response.value as UnitType[]);\r\n// };\r\nexport const UnitTypePicker = ({\r\n type,\r\n $select,\r\n ...props\r\n}: UnitTypePickerProps) => {\r\n const predicates: Condition[] = React.useMemo(() => {\r\n return !!type\r\n ? [new Condition('CategoryType', ODataOperators.Equals, type)]\r\n : [];\r\n }, [type]);\r\n\r\n const innerLoadData = loadData($select, predicates);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * AssetThumbImage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Avatar, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { getAssetImageThumbSrc } from './getAssetImageSrc';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n// asset thumbs have max size of 64px\r\nconst MAX_SIZE_DEFAULT = 64;\r\n\r\nexport interface AssetThumbImageProps {\r\n maxSize?: number;\r\n imageName: string | null;\r\n}\r\n\r\nexport const defaultImgSrc =\r\n process.env.PUBLIC_URL + `/images/DefaultImage.png`;\r\n\r\nexport function AssetThumbImage(props: AssetThumbImageProps) {\r\n const [hasImgeBroken, setHasImgeBroken] = React.useState(\r\n undefined,\r\n );\r\n const handleImgError = event => {\r\n setHasImgeBroken(true);\r\n };\r\n const imageExist = useSelector(state =>\r\n selectImageExist(state, props.imageName),\r\n );\r\n const classes = useStyles(props);\r\n const src = imageExist\r\n ? getAssetImageThumbSrc(props.imageName, 'thumb')\r\n : null;\r\n return (\r\n
    \r\n {src === null || hasImgeBroken ? (\r\n \r\n {'A'}\r\n \r\n ) : (\r\n \r\n )}\r\n
    \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n maxWidth: props =>\r\n Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n maxHeight: props =>\r\n Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n },\r\n image: {\r\n maxWidth: props =>\r\n Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n maxHeight: props =>\r\n Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n borderRadius: '4px',\r\n },\r\n avatar: {\r\n color: theme.palette.getContrastText(bookitColors.grayscale.grayBorders),\r\n backgroundColor: theme.palette.common.grayDividers,\r\n width: '32px',\r\n height: '32px',\r\n borderRadius: '4px',\r\n },\r\n }),\r\n);\r\n","import * as React from 'react';\r\nimport { EntityType } from 'types/common';\r\nimport { FormAutocomplete, FormAutocompleteProps } from './FormAutocomplete';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteOptionsProps\r\n extends Omit, 'loadData'>,\r\n IFieldProps {\r\n getOptions: (searchTerm: string | null) => T[];\r\n disabled?: boolean;\r\n id?: string;\r\n}\r\n\r\nexport function FormAutocompleteOptions({\r\n getOptions,\r\n ...props\r\n}: FormAutocompleteOptionsProps) {\r\n const loadData = async (searchTerm: string | null): Promise =>\r\n new Promise(resolve => {\r\n const opts = getOptions(searchTerm);\r\n resolve(opts);\r\n });\r\n return ;\r\n}\r\n","import * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n FormAutocompleteMulti,\r\n FormAutocompleteMultiProps,\r\n} from './FormAutocompleteMulti';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteMultiOptionsProps\r\n extends Omit, 'loadData'>,\r\n IFieldProps {\r\n getOptions: (searchTerm: string | null) => Entity[];\r\n disabled?: boolean;\r\n id?: string;\r\n}\r\n\r\nexport function FormAutocompleteMultiOptions({\r\n getOptions,\r\n ...props\r\n}: FormAutocompleteMultiOptionsProps) {\r\n const loadData = async (searchTerm: string | null): Promise[]> =>\r\n new Promise[]>(resolve => {\r\n const opts = getOptions(searchTerm);\r\n resolve(opts);\r\n });\r\n return (\r\n \r\n );\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const ExternalApi = {\r\n getExternalItems(\r\n formFieldId: number,\r\n payload: { filter: string | null; pageSize: number; pageIndex: number },\r\n ) {\r\n const url = `/api/externalitems/${formFieldId}/query`;\r\n const data = { param: payload };\r\n return httpClient.get(url, data);\r\n },\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { Entity } from 'types/common';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { FormAutocompleteOptions } from 'app/components/Forms/FormAutocompleteOptions';\r\nimport { FormAutocompleteMultiOptions } from 'app/components/Forms/FormAutocompleteMultiOptions';\r\nimport { ExternalApi } from 'api/ExternalApi';\r\nimport { FormAutocompleteMulti } from 'app/components/Forms/FormAutocompleteMulti';\r\nimport { FormAutocomplete } from 'app/components/Forms/FormAutocomplete';\r\n\r\nexport const initCustomDropDownData = (\r\n initialValue: string | undefined,\r\n formField: IFormFieldDto | undefined,\r\n) => {\r\n if (initialValue === undefined || formField === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n const options = createOptions(formField);\r\n resolve(\r\n getDropDownInitValue(initialValue, formField.IsMultiple, options),\r\n );\r\n });\r\n }\r\n};\r\nexport const getDropDownInitValue = (\r\n initialValue: string | undefined,\r\n isMultiple: boolean,\r\n options: IFormFieldOptionDto[],\r\n) => {\r\n if (initialValue === undefined) {\r\n return [] as Entity[];\r\n } else {\r\n if (isMultiple) {\r\n let values = initialValue.split(',');\r\n return options.filter(item => values.includes(item.Id));\r\n } else {\r\n return options.filter(item => item.Id === initialValue);\r\n }\r\n }\r\n};\r\nexport const createOptions = (\r\n field: Pick,\r\n): IFormFieldOptionDto[] => {\r\n if (field.Options && field.Options !== null) {\r\n switch (field.OptionsSourceType) {\r\n case 'Internal':\r\n return deserializeOptions(field.Options);\r\n\r\n case 'SimpleList':\r\n return deserializeOptions(field.Options.split(','));\r\n case 'External':\r\n return [] as IFormFieldOptionDto[];\r\n }\r\n } else {\r\n return [] as IFormFieldOptionDto[];\r\n }\r\n};\r\nconst deserializeOptions = (options: any): IFormFieldOptionDto[] => {\r\n let optsArray = [] as IFormFieldOptionDto[];\r\n if (Array.isArray(options)) {\r\n optsArray = options.map(opt => {\r\n return { Id: opt, Name: opt, Parent: null } as IFormFieldOptionDto;\r\n });\r\n } else {\r\n try {\r\n let items = JSON.parse(options);\r\n if (Array.isArray(items)) {\r\n let arr = items.map(o => {\r\n if (typeof o == 'string') {\r\n return { Id: o, Name: o, Parent: null } as IFormFieldOptionDto;\r\n } else if (o.hasOwnProperty('id') && o.hasOwnProperty('text')) {\r\n return {\r\n Id: o.id,\r\n Name: o.text,\r\n Parent: o.parent,\r\n } as IFormFieldOptionDto;\r\n } else {\r\n return undefined;\r\n }\r\n });\r\n optsArray =\r\n (arr.filter(o => o !== undefined) as IFormFieldOptionDto[]) ||\r\n ([] as IFormFieldOptionDto[]);\r\n }\r\n return optsArray;\r\n } catch {\r\n return optsArray;\r\n }\r\n }\r\n\r\n return optsArray;\r\n};\r\n\r\nexport function CustomFormDropDown({\r\n formField,\r\n readonly,\r\n parentValue,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n const getOptions = (searchTerm: string | null): Entity[] => {\r\n if (formField) {\r\n let options = createOptions(formField);\r\n if (formField.ParentId !== null && parentValue !== undefined) {\r\n return options.filter(\r\n item =>\r\n parentValue === undefined ||\r\n parentValue.length < 1 ||\r\n parentValue.filter(p => p.Id === item.Parent).length > 0,\r\n ) as Entity[];\r\n } else {\r\n return options as Entity[];\r\n }\r\n } else {\r\n return [] as Entity[];\r\n }\r\n };\r\n const externalLoadData = (searchTerm: string | null) => {\r\n const params: {\r\n filter: string | null;\r\n pageSize: number;\r\n pageIndex: number;\r\n } = {\r\n filter: searchTerm,\r\n pageSize: 50,\r\n pageIndex: 0,\r\n };\r\n\r\n return ExternalApi.getExternalItems(formField.Id, params).then(response => {\r\n if (!!response.data.data) {\r\n let options = response.data.data.map(option => {\r\n return { Id: option.name, Name: option.value };\r\n });\r\n return options as Entity[];\r\n } else if (!!response.data && response.data.length > 0) {\r\n let options = response.data.map(option => {\r\n return { Id: option.name, Name: option.value };\r\n });\r\n return options as Entity[];\r\n } else {\r\n return [] as Entity[];\r\n }\r\n });\r\n };\r\n return (\r\n \r\n {formField.OptionsSourceType === 'External' ? (\r\n formField.IsMultiple ? (\r\n \r\n ) : (\r\n \r\n )\r\n ) : formField.IsMultiple ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { Theme } from '@material-ui/core';\r\nimport { PropTypes } from '@material-ui/core';\r\nimport { PaletteColor } from '@material-ui/core/styles/createPalette';\r\n\r\nexport type TypeColor =\r\n | Exclude\r\n | 'danger'\r\n | 'accent'\r\n | 'filters'\r\n | 'success'\r\n | 'black'\r\n | 'info'\r\n | 'warning';\r\nexport type TypeColorOptions =\r\n | 'dark'\r\n | 'main'\r\n | 'light'\r\n | 'textHover'\r\n | 'bgHover'\r\n | 'contrastText';\r\nexport const getColor = (\r\n theme: Theme,\r\n color: TypeColor | undefined = 'primary',\r\n options: TypeColorOptions | undefined = 'main',\r\n): string | undefined => {\r\n switch (color) {\r\n case 'black':\r\n return getBlackColorOption(options, theme);\r\n case 'accent':\r\n case 'danger':\r\n case 'default':\r\n case 'filters':\r\n case 'info':\r\n case 'primary':\r\n case 'secondary':\r\n case 'success':\r\n case 'warning':\r\n return getColorOption(options, theme.palette[color]);\r\n default:\r\n return getColorOption(options, theme.palette.primary);\r\n }\r\n};\r\nfunction getBlackColorOption(options: string, theme: Theme) {\r\n switch (options) {\r\n case 'main':\r\n return theme.palette.common.graySubtitle;\r\n case 'dark':\r\n return theme.palette.common.blackRegular;\r\n case 'light':\r\n return theme.palette.common.grayComponentsLight;\r\n case 'textHover':\r\n return theme.palette.common.blackComponent;\r\n case 'bgHover':\r\n return theme.palette.common.backgroundHover;\r\n case 'contrastText':\r\n return theme.palette.common.white;\r\n default:\r\n return theme.palette.common.graySubtitle;\r\n }\r\n}\r\nfunction getColorOption(options: string | undefined, color: PaletteColor) {\r\n switch (options) {\r\n case 'main':\r\n return color.main;\r\n case 'dark':\r\n return color.dark;\r\n case 'light':\r\n return color.light;\r\n case 'textHover':\r\n return color.textHover;\r\n case 'bgHover':\r\n return color.bgHover;\r\n case 'contrastText':\r\n return color.contrastText;\r\n default:\r\n return color.main;\r\n }\r\n}\r\n","import { Timestamp } from '../../../../../types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const serializeSchedulerDateOrUndefined = (\r\n d: Date | null | undefined,\r\n): Timestamp | undefined => {\r\n if (d === null || d === undefined) {\r\n return undefined;\r\n }\r\n return serializeSchedulerDate(d);\r\n};\r\nexport const serializeSchedulerDate = (d: Date): Timestamp => {\r\n try {\r\n return dateUtils.formatISO(d);\r\n } catch (error) {\r\n throw error;\r\n }\r\n};\r\n","export enum FileTypes {\r\n Undefined = -1,\r\n ServiceFile = 0,\r\n ServiceRequestFile = 1,\r\n ServiceRequestComment = 2,\r\n ServiceRequestRowFile = 3,\r\n ServiceRequestRowComment = 4,\r\n ExperimentFile = 5,\r\n ExperimentComment = 6,\r\n AssetFile = 7,\r\n SrpFile = 8,\r\n SrpComment = 9,\r\n AlertFile = 10,\r\n BudgetExperimentFile = 11,\r\n Expense = 12,\r\n ReservationFile = 13,\r\n AlertComment = 14,\r\n AlertTypeFile = 15,\r\n ServiceGroupFile = 16,\r\n InvoiceTemplate = 17,\r\n}\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\n\r\nexport interface UpdateFilesModel {\r\n files: IFormFileValue[];\r\n typeId: number;\r\n referenceId: number;\r\n formType: number;\r\n operation: string;\r\n updateOption: number;\r\n reccurentAssetId: number | null;\r\n recurrentGroupId: number | null;\r\n alertTypeId: number | null;\r\n}\r\nexport const getFilesModel = (\r\n original: IFormFileValue[],\r\n current: IFormFileValue[],\r\n type: number,\r\n referenceId: number,\r\n formType: number,\r\n updateOption: number,\r\n reccurentAssetId: number | null,\r\n recurrentGroupId: number | null,\r\n alertTypeId: number | null,\r\n) => {\r\n const filesData: UpdateFilesModel[] = [];\r\n if (current.length > 0 || original.length > 0) {\r\n let added =\r\n current.length > 0\r\n ? current.filter(f => f.Value === null && f.PostedFile !== null)\r\n : [];\r\n let removed =\r\n original.length > 0 && current.length > 0\r\n ? original.filter(\r\n f => f.Value !== null && !current.some(s => s.Value === f.Value),\r\n )\r\n : [];\r\n if (added.length > 0) {\r\n filesData.push({\r\n files: added,\r\n typeId: type,\r\n referenceId: referenceId,\r\n formType: formType,\r\n operation: 'added',\r\n updateOption: updateOption,\r\n reccurentAssetId: reccurentAssetId,\r\n recurrentGroupId: recurrentGroupId,\r\n alertTypeId: alertTypeId,\r\n });\r\n }\r\n if (removed.length > 0) {\r\n filesData.push({\r\n files: removed,\r\n typeId: type,\r\n referenceId: referenceId,\r\n formType: formType,\r\n operation: 'removed',\r\n updateOption: updateOption,\r\n reccurentAssetId: reccurentAssetId,\r\n recurrentGroupId: recurrentGroupId,\r\n alertTypeId: alertTypeId,\r\n });\r\n }\r\n }\r\n return filesData;\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Default.Roles\r\n *\r\n */\r\n\r\nexport enum Roles {\r\n Administrators = 1,\r\n GroupAdministrators = 2,\r\n InstituteCoord = 3,\r\n HeadOfLab = 4,\r\n CagesAdministrators = 5,\r\n LabTech = 6,\r\n FinAdmin = 7,\r\n RepAdmin = 8,\r\n InventoryAdmin = 9,\r\n UserGroupCoord = 10,\r\n InstrumentEventsAdmin = 11,\r\n GroupBudgetsAdmin = 12,\r\n CalendarOnly = 13,\r\n Readonly = 14,\r\n LoanDeskManager = 15,\r\n EquipmentAdministrator = 16,\r\n UserInquiryAdmin = 17,\r\n ModelAdmin = 18,\r\n RoomOnly = 19,\r\n InvoicesReader = 20,\r\n KioskAdmin = 21,\r\n CustomRole = 22,\r\n BudgetAdmin = 23,\r\n GroupAdminAffiliated = 24,\r\n AnimalAdmin = 25,\r\n LargeAnimalsOperatingRoomUser = 26,\r\n LargeAnimalsOperatingRoomTechnician = 27,\r\n LargeAnimalsOperatingRoomVeterinarian = 28,\r\n CoreBudgetsAdmin = 29,\r\n ConsumableKiosk = 30,\r\n CreateNewAssetsAdmin = 31,\r\n}\r\nexport type RolesUnion = keyof typeof Roles;\r\nexport const RolesUnionArray: Array = [\r\n 'Administrators',\r\n 'GroupAdministrators',\r\n 'InstituteCoord',\r\n 'HeadOfLab',\r\n 'CagesAdministrators',\r\n 'LabTech',\r\n 'FinAdmin',\r\n 'RepAdmin',\r\n 'InventoryAdmin',\r\n 'UserGroupCoord',\r\n 'InstrumentEventsAdmin',\r\n 'GroupBudgetsAdmin',\r\n 'CalendarOnly',\r\n 'Readonly',\r\n 'LoanDeskManager',\r\n 'EquipmentAdministrator',\r\n 'UserInquiryAdmin',\r\n 'ModelAdmin',\r\n 'RoomOnly',\r\n 'InvoicesReader',\r\n 'KioskAdmin',\r\n 'CustomRole',\r\n 'BudgetAdmin',\r\n 'GroupAdminAffiliated',\r\n 'AnimalAdmin',\r\n 'LargeAnimalsOperatingRoomUser',\r\n 'LargeAnimalsOperatingRoomTechnician',\r\n 'LargeAnimalsOperatingRoomVeterinarian',\r\n 'CoreBudgetsAdmin',\r\n 'ConsumableKiosk',\r\n 'CreateNewAssetsAdmin',\r\n];\r\n","import { Dictionary, keyBy, omit, orderBy, transform } from 'lodash';\r\nimport {\r\n IServiceRequestTableRowModel,\r\n IServiceRequestTableRowValueModel,\r\n} from './types';\r\nimport { fromDtoValue } from './selectors';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { serializeCustomFormRowValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { ServiceRequestTableColumnsCollection } from './utils/ServiceRequestTableColumn';\r\n\r\nexport function prepareServiceRequestRowModel(\r\n rows: Array,\r\n columns: ServiceRequestTableColumnsCollection,\r\n) {\r\n const result: IServiceRequestTableRowModel[] | undefined = orderBy(\r\n rows,\r\n f => f.Id,\r\n )?.map(row => {\r\n const values = keyBy(row.Values, value => value.ColumnId);\r\n const rowValues: Dictionary = transform(\r\n columns.columnsObj,\r\n (result, column, columnId) => {\r\n result[column.getFieldName()] = fromDtoValue(\r\n column.ColumnType,\r\n values[column.Id],\r\n );\r\n },\r\n {},\r\n );\r\n const model: IServiceRequestTableRowModel = {\r\n ...omit(row, 'Values', '@odata.context'),\r\n ...{\r\n Values: rowValues,\r\n },\r\n };\r\n return model;\r\n });\r\n return result;\r\n}\r\n\r\nexport function serviceRequestModelToDto(\r\n model: Partial,\r\n columns: ServiceRequestTableColumnsCollection,\r\n) {\r\n const result: Partial<\r\n Omit & {\r\n Values: Array>;\r\n }\r\n > = {\r\n ...omit(model, 'Values'),\r\n Values: columns\r\n .getArray()\r\n .filter(column => column.CopyPrevValues)\r\n .map(column => {\r\n const dto: Partial = {\r\n ColumnId: column.Id,\r\n };\r\n const modelValue = model.Values?.[column.Id];\r\n if (modelValue !== undefined) {\r\n Object.assign(dto, serializeCustomFormRowValue(modelValue));\r\n }\r\n return dto;\r\n }),\r\n };\r\n return result;\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectExpandedSidePanel,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { omit } from 'lodash';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { push } from 'connected-react-router';\r\nimport { DeatilsOperations } from './ditails';\r\nimport { SaveFormButton } from 'app/pages/UserTrainings/TrainingDetailsPage/Details/Actions/TrainingActions';\r\nimport { TFunction } from 'i18next';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { INotification } from '../Actions/Actions';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface DetailsFormProps {\r\n initialValues?: LocationDetailsProps;\r\n ModelDetails: any;\r\n isEdit?: boolean;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n onSubmit: (item: any) => void;\r\n onCancel?: () => void;\r\n}\r\n\r\nexport interface LocationDetailsProps extends SidePanelContentProps {\r\n Id: number;\r\n Title: string;\r\n AddNew: string;\r\n ModelDetails: any;\r\n PageComponent: string;\r\n component: React.FC;\r\n operation: DeatilsOperations;\r\n submitcall: (\r\n t: TFunction,\r\n Id: number,\r\n operation: DeatilsOperations,\r\n details: any,\r\n handleSubmitCallResult: (values: INotification[]) => void,\r\n ) => void;\r\n}\r\n\r\nexport function LocationDetails(props: LocationDetailsProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const initialValues: LocationDetailsProps = props;\r\n const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const edit = initialValues.operation === DeatilsOperations.edit;\r\n const busy = false;\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const requestCompleted = true;\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const handleSubmitForm = e => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const handleCancelClick = React.useCallback(() => {\r\n if (props.useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/' + initialValues.PageComponent));\r\n }\r\n }, [\r\n dispatch,\r\n initialValues.PageComponent,\r\n layoutActions,\r\n props.useSidePanel,\r\n ]);\r\n const handleClose = () => {\r\n if (hasChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n if (confirmApproved) {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n });\r\n\r\n const submitFormRef = React.useRef(null);\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n const handleSubmitCallResult = React.useCallback(\r\n (values: INotification[]) => {\r\n values.forEach(v =>\r\n dispatch(\r\n actions.addNotification({ variant: v.variant, message: v.message }),\r\n ),\r\n );\r\n dispatch(layoutActions.resetSidePanel());\r\n dispatch(layoutActions.setRefreshTable(true));\r\n },\r\n [actions, dispatch, layoutActions],\r\n );\r\n const handleSubmit = React.useCallback(\r\n values => {\r\n initialValues.submitcall(\r\n t,\r\n initialValues.Id,\r\n initialValues.operation,\r\n values,\r\n handleSubmitCallResult,\r\n );\r\n },\r\n [handleSubmitCallResult, initialValues, t],\r\n );\r\n const LocationContent = React.useMemo(() => {\r\n return (\r\n \r\n );\r\n }, [bindSubmitForm, handleSubmit, initialValues]);\r\n const leftActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleSubmitForm}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [busy, edit, isMobile, requestCompleted, sidePanelExpanded, t]);\r\n\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCancelClick, isMobile, sidePanelExpanded, t]);\r\n return (\r\n <>\r\n \r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n * Bookit.Data.CatRate.CatRateTypes\r\n */\r\nexport enum CatRateTypes {\r\n Usage = 1,\r\n\r\n FixedUsage = 2,\r\n\r\n Reservation = 3,\r\n\r\n FixedReservation = 4,\r\n\r\n TutoringUsage = 5,\r\n\r\n FixedTutoringUsage = 6,\r\n\r\n TutoringReservation = 7,\r\n\r\n FixedTutoringReservation = 8,\r\n\r\n ReservationCancelation = 9,\r\n\r\n OfflineService = 10,\r\n\r\n ServiceRequestLine = 11,\r\n\r\n ServiceRequest = 12,\r\n\r\n Other = 13,\r\n\r\n UsageExceededReservation = 16,\r\n\r\n /// \r\n /// This Fee Type is used for display purposes in the invoice rows to differentiate offlin services from service requests\r\n /// \r\n\r\n ServiceRequestServices = 17,\r\n /// \r\n /// This Fee Type is used for setup Milistones Requests in the Price Sheet screen\r\n /// \r\n\r\n ServiceRequestMilestones = 18,\r\n\r\n TrainingSessions = 19,\r\n\r\n FixedTrainingSessions = 20,\r\n\r\n Subscription = 21,\r\n\r\n PartialReservationCancellation = 22,\r\n\r\n Refund = 23,\r\n System = 24,\r\n Discount = 25,\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { BudgetEntitySechema, ServiceGroupEntitySchema } from '..';\r\n\r\n/**\r\n *\r\n * @param t localization TFunction\r\n * @returns base validation schema for paymet or charge\r\n */\r\nexport function InvoiceChildRowBaseSchema(t: TFunction) {\r\n return Yup.object({\r\n Id: Yup.number().notRequired(),\r\n InvoiceId: Yup.number().notRequired(),\r\n Budget: BudgetEntitySechema.nullable().required(\r\n t(translations.PleaseSelectABudgetNumber),\r\n ),\r\n ServiceGroup: ServiceGroupEntitySchema.required(\r\n t(translations.PleaseSelectServiceGroup),\r\n ).nullable(),\r\n Date: Yup.date().required(t(translations.PleaseSelectADate)),\r\n });\r\n}\r\n","export enum AllowCreateInvoicesBy {\r\n AlllowCreateInvoicesBy_AllowToChooseOnCreation,\r\n AlllowCreateInvoicesBy_BudgetsOnly,\r\n AlllowCreateInvoicesBy_UserGroupOnly,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { PaymentApi } from 'api/PaymentApi';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n// import { FormAdminServiceGroupPicker } from 'app/components/Forms/FormAdminServiceGroupPicker';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormPaymentMethodPicker } from 'app/components/Forms/FormPaymentMethodPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { serviceGroupFilterUrl } from 'app/components/pickers/ServiceGroupPicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { IPayment } from './IPayment';\r\nimport { getPaymentSchema } from './PaymentSchema';\r\nimport { getPaymentSchemaWithBudgetNotRequired } from './PaymentSchema';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface PaymentProps extends CoverProps {\r\n invoiceId?: number;\r\n budget: Entity | null;\r\n serviceGroup: Entity | null;\r\n amount?: number;\r\n paymentId?: number;\r\n serviceGroupPredicate?: (string | Condition>)[];\r\n userGroupId?: string;\r\n}\r\n\r\nexport const AddPayment = (props: PaymentProps) => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const appSettings = useSelector(selectAppSettings);\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n const submitRef = useRef();\r\n const [busy, setBusy] = useState(false);\r\n const close = useCallback(() => {\r\n if (props.isCover) {\r\n props.closeCover?.();\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }, [props, dispatch, actions]);\r\n const refreshTable = useCallback(() => {\r\n dispatch(actions.setRefreshTable(true));\r\n }, [dispatch, actions]);\r\n const sendResponse = useResponseModel();\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const closeApproved = useSelector(selectConfirmApproved);\r\n const closeRejected = useSelector(selectConfirmRejected);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const isEdit = !!props.paymentId && !!props.invoiceId;\r\n const { newDate } = useSystemDate();\r\n const submit = useCallback(\r\n (payment: IPayment) => {\r\n setBusy(true);\r\n if (!isEdit) {\r\n PaymentApi.AddPayment(payment)\r\n .then(v => {\r\n if (v.SuccessMessages.length > 0) {\r\n dispatch(\r\n notifyActions.addNotification({\r\n key: 'payment_success',\r\n message: v.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n v.SuccessMessages = [];\r\n }\r\n sendResponse(v);\r\n })\r\n .catch(() => {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.err_InvoicePaymentAdd),\r\n variant: 'error',\r\n }),\r\n );\r\n })\r\n .finally(() => {\r\n close();\r\n refreshTable();\r\n });\r\n } else {\r\n PaymentApi.UpdatePayment(props.paymentId!, payment)\r\n .then(() => {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.success_EditInvoicePayment),\r\n variant: 'success',\r\n }),\r\n );\r\n })\r\n .catch(() => {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.err_EditInvoicePayment),\r\n variant: 'error',\r\n }),\r\n );\r\n })\r\n .finally(() => {\r\n close();\r\n refreshTable();\r\n });\r\n }\r\n },\r\n [\r\n close,\r\n dispatch,\r\n isEdit,\r\n notifyActions,\r\n props.paymentId,\r\n refreshTable,\r\n sendResponse,\r\n t,\r\n ],\r\n );\r\n const [initialValues, setinitialValues] = useState({\r\n InvoiceId: props.invoiceId,\r\n Budget: props.budget,\r\n ServiceGroup: props.serviceGroup,\r\n Amount: props.amount,\r\n Method: null,\r\n Date: newDate(),\r\n });\r\n useEffect(() => {\r\n if (closeApproved) {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n if (closeRejected) {\r\n dispatch(actions.resetConfirmState());\r\n }\r\n }, [actions, closeApproved, closeRejected, dispatch]);\r\n useEffectOnMount(() => {\r\n //dispatch(layoutActions.setUpSnackBarIndex(true)); // increase snack bar z-index\r\n if (!isEdit) {\r\n if (props.serviceGroup === null) {\r\n setBusy(true);\r\n let isMounted = true;\r\n (async () => {\r\n const res = await getAutoCompleteLoadDataFn>({\r\n url: serviceGroupFilterUrl,\r\n predicates: authenticatedUser\r\n ? [\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n authenticatedUser.AdminServiceGroups,\r\n ),\r\n ]\r\n : undefined,\r\n })('', props.serviceGroupPredicate).then(v => v.value);\r\n if (isMounted) {\r\n if (res && res.length === 1) {\r\n setinitialValues(prev => ({ ...prev, ServiceGroup: res[0] }));\r\n }\r\n setBusy(false);\r\n }\r\n })();\r\n return () => {\r\n isMounted = false;\r\n };\r\n }\r\n return;\r\n }\r\n setBusy(true);\r\n let mounted = true;\r\n (async () => {\r\n try {\r\n let res = await httpClient.get(\r\n '/api/odata/v4/InvoicePayments(' + props.paymentId + ')',\r\n {\r\n id: props.invoiceId,\r\n $select: [\r\n 'InvoiceId',\r\n 'MethodId',\r\n 'PaymentMethodName',\r\n 'Amount',\r\n 'Date',\r\n 'Remarks',\r\n 'Reference',\r\n 'BudgetId',\r\n 'BudgetNumber',\r\n 'ServiceGroupId',\r\n 'ServiceGroupName',\r\n ].join(','),\r\n },\r\n );\r\n if (mounted) {\r\n setinitialValues({\r\n Id: props.paymentId,\r\n InvoiceId: res.InvoiceId,\r\n Budget: res.BudgetId\r\n ? { Id: res.BudgetId, Name: res.BudgetNumber }\r\n : null,\r\n ServiceGroup: res.ServiceGroupId\r\n ? { Id: res.ServiceGroupId, Name: res.ServiceGroupName }\r\n : null,\r\n Method: { Id: res.MethodId, Name: res.PaymentMethodName },\r\n Date: res.Date,\r\n Amount: res.Amount,\r\n Reference: res.Reference ?? undefined,\r\n Remarks: res.Remarks ?? undefined,\r\n });\r\n setBusy(false);\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n })();\r\n return () => {\r\n //dispatch(layoutActions.setUpSnackBarIndex(false)); // decrease snack bar z-index\r\n mounted = false;\r\n };\r\n });\r\n\r\n const PaymentSchema: Yup.SchemaOf = getPaymentSchema(t);\r\n const PaymentSchemaWithBudgetNotRequired: Yup.SchemaOf = getPaymentSchemaWithBudgetNotRequired(\r\n t,\r\n );\r\n if (isEdit) {\r\n PaymentSchema.fields.ServiceGroup = PaymentSchema.fields.ServiceGroup.notRequired();\r\n }\r\n\r\n const Paymentform = () => (\r\n \r\n {formik => {\r\n submitRef.current = formik.submitForm;\r\n return (\r\n \r\n {/* By using FormListener, the fields become not editable */}\r\n {/* {}} /> */}\r\n \r\n \r\n \r\n \r\n \r\n {IsModuleEnabled(appSettings, KnownModules.Budgets) && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n const leftActions = [\r\n () => (\r\n <>\r\n submitRef.current?.()}\r\n size=\"small\"\r\n disabled={busy}\r\n >\r\n {t(translations.Submit)}\r\n \r\n \r\n ),\r\n ];\r\n const rightActions = [\r\n () => (\r\n <>\r\n }\r\n onClick={close}\r\n disabled={busy}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ];\r\n return (\r\n }\r\n leftActions={leftActions}\r\n rightActions={rightActions}\r\n disableExpandToggle\r\n closeSidePanel={() => {\r\n if (hasChanges) {\r\n dispatch(actions.setConfirmOpen(true));\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }}\r\n isCover={props.isCover}\r\n closeCover={props.closeCover}\r\n />\r\n );\r\n};\r\n","import {\r\n BudgetEntitySechema,\r\n FeeTypeEntitySchema,\r\n OfflineServiceTypeEntitySchema,\r\n OnlineServiceEntitySchema,\r\n PaymentMethodEntitySchema,\r\n ServiceGroupEntitySchema,\r\n UserEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { InvoiceChildRowBaseSchema } from 'app/components/Forms/Schemas/InvoiceChildRowBaseSchema';\r\nimport { CatRateTypes } from 'enums/CatRateTypes';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\n\r\nimport { IPayment } from './IPayment';\r\n\r\nexport function getPaymentSchema(t: TFunction): Yup.SchemaOf {\r\n return InvoiceChildRowBaseSchema(t).shape({\r\n Budget: BudgetEntitySechema.nullable().notRequired().optional(),\r\n Method: PaymentMethodEntitySchema.required(\r\n t(translations.err_PaymentMethodRequired),\r\n ).nullable(),\r\n Amount: Yup.number()\r\n .required(t(translations.PleaseEnterAnAmount))\r\n .positive(t(translations.InvalidValue)),\r\n\r\n Reference: Yup.string().notRequired(),\r\n Remarks: Yup.string().notRequired(),\r\n });\r\n}\r\n\r\nexport function getPaymentSchemaWithBudgetNotRequired(\r\n t: TFunction,\r\n): Yup.SchemaOf {\r\n return InvoiceChildRowBaseSchema(t).shape({\r\n Method: PaymentMethodEntitySchema.required(\r\n t(translations.err_PaymentMethodRequired),\r\n ).nullable(),\r\n Amount: Yup.number()\r\n .required(t(translations.PleaseEnterAnAmount))\r\n .positive(t(translations.InvalidValue)),\r\n\r\n Reference: Yup.string().notRequired(),\r\n Remarks: Yup.string().notRequired(),\r\n Budget: BudgetEntitySechema.nullable().notRequired().optional(),\r\n });\r\n}\r\n\r\nexport function foo(t: TFunction) {\r\n return InvoiceChildRowBaseSchema(t).shape({\r\n User: UserEntitySchema.nullable().when(\r\n 'FeeType',\r\n (catRateType, schema: Yup.SchemaOf>) =>\r\n [CatRateTypes.Refund, CatRateTypes.Other].includes(\r\n (catRateType as Entity)?.Id,\r\n )\r\n ? schema.notRequired()\r\n : schema.required(),\r\n ),\r\n Resource: OnlineServiceEntitySchema.notRequired().nullable(),\r\n OtherService: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n SampleType: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n FeeType: FeeTypeEntitySchema.required().nullable(),\r\n Quantity: Yup.number().defined(),\r\n Rate: Yup.number()\r\n .defined()\r\n .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n return (catRateType as Entity)?.Id === CatRateTypes.Refund ||\r\n (catRateType as Entity)?.Id === CatRateTypes.Discount\r\n ? schema.negative()\r\n : schema.positive();\r\n }),\r\n Amount: Yup.number()\r\n .defined()\r\n .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n return (catRateType as Entity)?.Id === CatRateTypes.Refund ||\r\n (catRateType as Entity)?.Id === CatRateTypes.Discount\r\n ? schema.negative()\r\n : schema.positive();\r\n }),\r\n\r\n ServiceGroup: ServiceGroupEntitySchema.required().nullable(),\r\n });\r\n}\r\n","import { ICharge } from 'app/pages/AddChargePage/ICharge';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nconst url = '/api/odata/v4/Charge';\r\nexport const ChargeApi = {\r\n AddCharge: (charge: ICharge) => {\r\n const data = {\r\n Id: charge.Id,\r\n Username: charge.User?.Id,\r\n BudgetId: charge.Budget?.Id,\r\n EquipmentId: charge.Resource?.Id,\r\n OfflineServiceTypeId: charge.OtherService?.Id,\r\n Quantity: charge.Quantity,\r\n BaseRate: charge.Rate,\r\n CatRateTypeId: charge.FeeType?.Id,\r\n Date: charge.Date,\r\n SampleTypeId: charge.SampleType?.Id,\r\n ServiceGroupId: charge.ServiceGroup?.Id,\r\n UserGroupId: charge.UserGroup?.Id,\r\n Remarks: charge.Remarks,\r\n PurchaseOrder: charge.PurchaseOrder,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n UpdateCharge: (charge: ICharge, rowId: number) => {\r\n const data = {\r\n Id: charge.Id,\r\n Username: charge.User?.Id,\r\n BudgetId: charge.Budget?.Id,\r\n EquipmentId: charge.Resource?.Id,\r\n OfflineServiceTypeId: charge.OtherService?.Id,\r\n Quantity: charge.Quantity,\r\n BaseRate: charge.Rate,\r\n CatRateTypeId: charge.FeeType?.Id,\r\n Date: charge.Date,\r\n SampleTypeId: charge.SampleType?.Id,\r\n ServiceGroupId: charge.ServiceGroup?.Id,\r\n ActualRate: charge.ActualRate,\r\n UserGroupId: charge.UserGroup?.Id,\r\n Remarks: charge.Remarks,\r\n PurchaseOrder: charge.PurchaseOrder,\r\n };\r\n return httpClient.put(url + '(' + rowId + ')', data);\r\n },\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n CatRateTypePicker,\r\n CatRateTypeProps,\r\n} from '../pickers/AutocompletePickers/CatRateTypePicker';\r\n\r\ninterface FormCatRateTypePickerIntrinsicProps\r\n extends Omit {\r\n serviceGroupId?: number;\r\n}\r\nexport const FormCatRateTypePicker = ({\r\n onChange,\r\n onBlur,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n FormCatRateTypePickerIntrinsicProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n {...props}\r\n />\r\n \r\n );\r\n};\r\n","import {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst filter = 'ServiceTypeId eq 2 and Active eq true';\r\nexport interface OfflineServicePickerProps\r\n extends Omit>, 'url'> {}\r\n// this picker is redundand, instead use OfflineServiceTyePicker\r\nexport const OfflineServicePicker = (props: OfflineServicePickerProps) => {\r\n const { queryfilter, ...other } = props;\r\n const predicate =\r\n queryfilter && queryfilter !== ''\r\n ? [queryfilter, filter].join(' and ')\r\n : filter;\r\n return (\r\n \r\n );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n OfflineServicePicker,\r\n OfflineServicePickerProps,\r\n} from '../pickers/AutocompletePickers/OfflineServicePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\ninterface FormOfflineServicePickerIntrinsicProps\r\n extends Omit<\r\n OfflineServicePickerProps,\r\n 'onBlur' | 'value' | 'error' | 'onChange'\r\n > {\r\n serviceGroupId?: number;\r\n}\r\nexport const FormOfflineServicePicker = ({\r\n onChange,\r\n onBlur,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n FormOfflineServicePickerIntrinsicProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (onChange) {\r\n onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n variant=\"filled\"\r\n queryfilter={\r\n props.serviceGroupId\r\n ? new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n props.serviceGroupId,\r\n ).toString()\r\n : undefined\r\n }\r\n {...props}\r\n />\r\n \r\n );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n SampleTypePicker,\r\n SampleTypePickerProps,\r\n} from '../pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\ninterface FormOfflineServicePickerIntrinsicProps\r\n extends Omit<\r\n SampleTypePickerProps,\r\n 'onBlur' | 'value' | 'error' | 'onChange'\r\n > {\r\n serviceGroupId?: number;\r\n}\r\nexport const FormSampleTypePicker = ({\r\n onChange,\r\n onBlur,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n FormOfflineServicePickerIntrinsicProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n queryfilter={\r\n props.serviceGroupId\r\n ? new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n props.serviceGroupId,\r\n ).toString()\r\n : undefined\r\n }\r\n {...props}\r\n />\r\n \r\n );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ServiceUserGroupPicker } from '../pickers/AutocompletePickers/ServiceUserGroupPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormServiceUserGroupPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n predicates={props.predicates}\r\n disabled={props.disabled}\r\n />\r\n );\r\n};\r\n","import { ChargeApi } from 'api/ChargeApi';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { FormCatRateTypePicker } from 'app/components/Forms/FormCatRateTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormOfflineServicePicker } from 'app/components/Forms/FormOfflineServicePicker';\r\nimport { FormSampleTypePicker } from 'app/components/Forms/FormSampleTypePicker';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormServiceUserGroupPicker } from 'app/components/Forms/FormServiceUserGroupPicker';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { loadBudgets } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { serviceGroupFilterUrl } from 'app/components/pickers/ServiceGroupPicker';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AllowCreateInvoicesBy } from 'enums/allowCreateInvoicesBy';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React, {\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { GetChargeSchema } from './ChargeSchema';\r\nimport { ICharge } from './ICharge';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport useGlobalSettingsHook from '../ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport produce from 'immer';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\n\r\nexport interface ChargeProps extends CoverProps {\r\n invoiceId?: number;\r\n budget: Entity | null;\r\n serviceGroup: Entity | null;\r\n rowId?: number;\r\n serviceGroupPredicate?: (string | Condition>)[];\r\n}\r\n\r\nconst onlyManual = true;\r\n\r\nexport const AddCharge = ({ serviceGroupPredicate, ...props }: ChargeProps) => {\r\n const { newDate } = useSystemDate();\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n const submitRef = useRef();\r\n const [busy, setBusy] = useState(false);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const closeApproved = useSelector(selectConfirmApproved);\r\n const closeRejected = useSelector(selectConfirmRejected);\r\n const continueToOther = useSelector(selectContinueState);\r\n const globalSettings = useGlobalSettingsHook();\r\n\r\n const [insertedAt, setinsertedAt] = useState(null);\r\n const [insertedBy, setinsertedBy] = useState(null);\r\n const isEdit = !!props.rowId;\r\n const userGroupByBudeget = settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.ReservationUserGroupGroupByBudgetUserGroup],\r\n );\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.fundingTypeBudgetEnabled &&\r\n globalSettings.budgetModuleEnabled\r\n );\r\n }, [globalSettings]);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const [initialValues, setInitialValue] = useState({\r\n Id: props.invoiceId,\r\n Quantity: 0,\r\n Rate: 0,\r\n Amount: 0,\r\n Date: newDate(),\r\n User: null,\r\n FeeType: null,\r\n OtherService: null,\r\n Resource: null,\r\n SampleType: null,\r\n Budget: props.budget,\r\n ServiceGroup: props.serviceGroup,\r\n Manual: true,\r\n UserGroup: null,\r\n Remarks: '',\r\n FundingType:\r\n fundingTypeVisible &&\r\n !!props.budget &&\r\n props.budget !== null &&\r\n (props.budget as IBudgetFilterDto).FundingTypeId !== null\r\n ? getSingleInvoiceFundingType(\r\n (props.budget as IBudgetFilterDto).FundingTypeId ?? 0,\r\n )\r\n : null,\r\n PurchaseOrder: null,\r\n });\r\n\r\n useEffect(() => {\r\n if (closeApproved) {\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(actions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(actions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(notifyActions.navigate(continueLink));\r\n dispatch(actions.resetSidePanel());\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }\r\n if (closeRejected) {\r\n dispatch(actions.resetConfirmState());\r\n }\r\n }, [\r\n actions,\r\n closeApproved,\r\n closeRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n notifyActions,\r\n ]);\r\n useEffect(() => {\r\n if (!isEdit) {\r\n if (props.budget !== null) {\r\n setBusy(true);\r\n let isMounted = true;\r\n (async () => {\r\n try {\r\n let queryBudg = loadBudgets([\r\n new Condition('Id', ODataOperators.Equals, props.budget!.Id),\r\n new Condition('Active', ODataOperators.Equals, true),\r\n ]);\r\n const budgetRes = await queryBudg(null);\r\n const serviceGroupRes = await (() => {\r\n if (props.serviceGroup !== null) return Promise.resolve([]);\r\n return getAutoCompleteLoadDataFn>({\r\n url: serviceGroupFilterUrl,\r\n predicates: authenticatedUser\r\n ? [\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n authenticatedUser.AdminServiceGroups,\r\n ),\r\n ]\r\n : undefined,\r\n })('', serviceGroupPredicate).then(v => v.value);\r\n })();\r\n if (isMounted) {\r\n const values = { ...initialValues };\r\n if (budgetRes && budgetRes.value.length > 0) {\r\n const budegtval = budgetRes.value[0];\r\n values.UserGroup =\r\n budegtval.UserGroupId && budegtval.UserGroupName\r\n ? {\r\n Id: budegtval.UserGroupId,\r\n Name: budegtval.UserGroupName,\r\n }\r\n : values.UserGroup;\r\n }\r\n if (serviceGroupRes && serviceGroupRes.length === 1) {\r\n values.ServiceGroup = serviceGroupRes[0];\r\n }\r\n setInitialValue(values);\r\n setBusy(false);\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n })();\r\n return () => {\r\n isMounted = false;\r\n };\r\n }\r\n return;\r\n }\r\n setBusy(true);\r\n let mounted = true;\r\n (async () => {\r\n try {\r\n const res = await httpClient.get(\r\n '/api/odata/v4/InvoiceRows(' + props.rowId + ')',\r\n {\r\n id: props.invoiceId ?? 'null',\r\n $select: [\r\n 'InvoiceId',\r\n 'BudgetId',\r\n 'Budget',\r\n 'OnlineService',\r\n 'OnlineServiceId',\r\n 'OfflineServiceType',\r\n 'OfflineServiceTypeId',\r\n 'SampleService',\r\n 'SampleServiceId',\r\n 'CatRateTypeId',\r\n 'CatRateType',\r\n 'Quantity',\r\n 'BaseRate',\r\n 'Amount',\r\n 'SubsProfPercentage',\r\n 'User',\r\n 'UserId',\r\n 'Date',\r\n 'ServiceGroupId',\r\n 'ServiceGroupName',\r\n 'Manual',\r\n 'ActualRate',\r\n 'UserGroupId',\r\n 'UserGroup',\r\n 'InsertedAt',\r\n 'InsertedByDisplay',\r\n 'Remarks',\r\n 'FundingTypeId',\r\n 'PurchaseOrder',\r\n 'PurchaseOrderOptionId',\r\n ].join(','),\r\n },\r\n );\r\n if (mounted) {\r\n setInitialValue({\r\n Id: res.InvoiceId ?? 0,\r\n Budget:\r\n !!res.BudgetId && res.BudgetId !== null\r\n ? ({\r\n Id: res.BudgetId,\r\n Name: res.Budget,\r\n PurchaseOrderOptionId: res.PurchaseOrderOptionId,\r\n } as Entity)\r\n : null,\r\n User: res.UserId ? { Id: res.UserId, Name: res.User } : null,\r\n Resource: res.OnlineServiceId\r\n ? { Id: res.OnlineServiceId, Name: res.OnlineService }\r\n : null,\r\n OtherService: res.OfflineServiceTypeId\r\n ? { Id: res.OfflineServiceTypeId, Name: res.OfflineServiceType }\r\n : null,\r\n FeeType: { Id: res.CatRateTypeId, Name: res.CatRateType },\r\n SampleType: res.SampleServiceId\r\n ? { Id: res.SampleServiceId, Name: res.SampleService }\r\n : null,\r\n Quantity: res.Quantity,\r\n Rate: res.BaseRate,\r\n Amount: res.Amount,\r\n Date: res.Date,\r\n ServiceGroup: res.ServiceGroupId\r\n ? { Id: res.ServiceGroupId, Name: res.ServiceGroupName }\r\n : null,\r\n Manual: res.Manual,\r\n ActualRate: res.ActualRate,\r\n UserGroup: res.UserGroupId\r\n ? {\r\n Id: res.UserGroupId,\r\n Name: res.UserGroup,\r\n }\r\n : null,\r\n Remarks: res.Remarks,\r\n FundingType:\r\n res.FundingTypeId !== null\r\n ? getSingleInvoiceFundingType(res.FundingTypeId)\r\n : null,\r\n PurchaseOrder: res.PurchaseOrder,\r\n });\r\n setinsertedAt(res.InsertedAt);\r\n setinsertedBy(res.InsertedBy);\r\n setBusy(false);\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n })();\r\n return () => {\r\n mounted = false;\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props.rowId]);\r\n const close = useCallback(() => {\r\n if (props.isCover) {\r\n props.closeCover?.();\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }, [props, dispatch, actions]);\r\n const refreshTable = useCallback(() => {\r\n dispatch(actions.setRefreshTable(true));\r\n }, [dispatch, actions]);\r\n const submit = useCallback(\r\n (charge: ICharge) => {\r\n setBusy(true);\r\n if (!isEdit) {\r\n ChargeApi.AddCharge(charge)\r\n .then(() => {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.msg_addedChargeSuccessfully),\r\n variant: 'success',\r\n }),\r\n );\r\n })\r\n .catch(e => console.error(e))\r\n .finally(() => {\r\n close();\r\n refreshTable();\r\n });\r\n } else {\r\n ChargeApi.UpdateCharge(charge, props.rowId!)\r\n .then(res => {\r\n if (res.ErrorMessages.length > 0) {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: res.ErrorMessages[0],\r\n variant: 'error',\r\n }),\r\n );\r\n setBusy(false);\r\n return;\r\n }\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.success_EditInvoiceLine),\r\n variant: 'success',\r\n }),\r\n );\r\n close();\r\n refreshTable();\r\n })\r\n .catch(e => console.error(e));\r\n }\r\n },\r\n [close, dispatch, isEdit, notifyActions, props.rowId, refreshTable, t],\r\n );\r\n const budgetOnly = useMemo(() => {\r\n return (\r\n settings.GetString(AllowedSettings.CreateInovicesBy) ===\r\n AllowCreateInvoicesBy[\r\n AllowCreateInvoicesBy.AlllowCreateInvoicesBy_BudgetsOnly\r\n ]\r\n );\r\n }, [settings]);\r\n const ChargeSchema = GetChargeSchema(t, isEdit, globalSettings);\r\n const ChargeForm = () => {\r\n return (\r\n \r\n {formik => {\r\n submitRef.current = formik.submitForm;\r\n const setAmount = (rate: number, quantity: number) => {\r\n formik\r\n .getFieldHelpers('Amount')\r\n .setValue(+(quantity * rate).toFixed(2), true);\r\n };\r\n const serviceGroupChanged = () => {\r\n formik.getFieldHelpers('Resource').setValue(null, true);\r\n formik.getFieldHelpers('OtherService').setValue(null, true);\r\n formik.getFieldHelpers('SampleType').setValue(null, true);\r\n };\r\n return (\r\n \r\n {/* By using FormListener, the fields become not editable */}\r\n {/* {}} /> */}\r\n \r\n \r\n {/* ServiceGroup */}\r\n \r\n \r\n \r\n {/* FeeType */}\r\n \r\n \r\n \r\n {/* Date */}\r\n \r\n {\r\n formik.setFieldValue('Date', value);\r\n }}\r\n />\r\n \r\n {/* UserGroup */}\r\n \r\n v !== undefined) as Condition[]\r\n }\r\n />\r\n \r\n {/* User */}\r\n \r\n (\r\n 'UserGroups',\r\n ODataOperators.Any,\r\n formik.values.UserGroup.Id,\r\n 'Id',\r\n )\r\n : undefined,\r\n ].filter(v => v !== undefined) as Condition[]\r\n }\r\n name=\"User\"\r\n fullWidth\r\n placeholder={t(translations.User)}\r\n label={t(translations.User)}\r\n disabled={isEdit && !initialValues.Manual}\r\n />\r\n \r\n {/* FundingType */}\r\n {fundingTypeVisible && (\r\n \r\n {\r\n formik.setValues(\r\n produce(values => {\r\n // clear budget selection when funding type is changed to an incompatible value\r\n // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n if (\r\n (value as Entity).Id !==\r\n (values.Budget as IBudgetFilterDto)\r\n ?.FundingTypeId\r\n ) {\r\n values.Budget = null;\r\n }\r\n values.FundingType = value;\r\n }),\r\n );\r\n }}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {/* Budget */}\r\n {IsModuleEnabled(appSettings, KnownModules.Budgets) && (\r\n \r\n {\r\n if (!userGroupByBudeget && val && val.UserGroupId) {\r\n formik.getFieldHelpers('UserGroup').setValue(\r\n {\r\n Id: val.UserGroupId,\r\n Name: val.UserGroup,\r\n },\r\n true,\r\n );\r\n }\r\n }}\r\n name=\"Budget\"\r\n fullWidth\r\n placeholder={t(translations.Budget)}\r\n label={t(translations.Budget)}\r\n predicates={restrictedBudgetFilter({\r\n budgetLimitedByUsers:\r\n globalSettings.budgetLimitedByUsers,\r\n isBudgetsWithoutUserGroup:\r\n globalSettings.isBudgetsWithoutUserGroup,\r\n userGroupId: globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n ? undefined\r\n : formik.values.UserGroup?.Id,\r\n serviceGroupId: formik.values.ServiceGroup?.Id,\r\n services: formik.values.Resource\r\n ? [\r\n {\r\n Id: formik.values.Resource.Id,\r\n Name: formik.values.Resource.Name,\r\n ServiceTypeId: 1,\r\n ServiceGroupId:\r\n formik.values.ServiceGroup?.Id ?? null,\r\n } as IServiceTypeFilterDto,\r\n ]\r\n : formik.values.OtherService\r\n ? [\r\n {\r\n Id: formik.values.OtherService.Id,\r\n Name: formik.values.OtherService.Name,\r\n ServiceTypeId: 2,\r\n ServiceGroupId:\r\n formik.values.ServiceGroup?.Id ?? null,\r\n } as IServiceTypeFilterDto,\r\n ]\r\n : formik.values.SampleType\r\n ? [\r\n {\r\n Id: formik.values.SampleType.Id,\r\n Name: formik.values.SampleType.Name,\r\n ServiceTypeId: 3,\r\n ServiceGroupId:\r\n formik.values.ServiceGroup?.Id ?? null,\r\n } as IServiceTypeFilterDto,\r\n ]\r\n : undefined,\r\n startTime: !!formik.values.Date\r\n ? dateUtils.dateOrStringToDate(formik.values.Date)\r\n : undefined,\r\n endTime: !!formik.values.Date\r\n ? dateUtils.dateOrStringToDate(formik.values.Date)\r\n : undefined,\r\n user: formik.values.User?.Id ?? authenticatedUser?.Id,\r\n defaultBudgetEnabled:\r\n globalSettings.defaultBudgetEnabled,\r\n userDefaultBudgetEnabled:\r\n globalSettings.userDefaultBudgetEnabled,\r\n hideNonDefaultBudgets:\r\n globalSettings.hideNonDefaultBudgets,\r\n // funding type is set to Internal by default even if it's not in use\r\n fundingType: fundingTypeVisible\r\n ? formik.values.FundingType\r\n : null,\r\n })}\r\n disabled={\r\n (initialValues.Budget !== null && budgetOnly) ||\r\n (isEdit && !initialValues.Manual)\r\n }\r\n />\r\n \r\n )}\r\n {/* PurchaseOrder */}\r\n {fundingTypeVisible &&\r\n ((formik.values.Budget as IBudgetFilterDto)\r\n ?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !==\r\n PurchaseOrderOptions.Hidden && (\r\n \r\n \r\n \r\n )}\r\n\r\n {/* Quantity */}\r\n {onlyManual && (\r\n <>\r\n \r\n \r\n setAmount(\r\n +formik\r\n .getFieldMeta('Rate')\r\n .value.toFixed(2),\r\n +v.target.value,\r\n )\r\n }\r\n />\r\n \r\n {/* Rate */}\r\n \r\n \r\n setAmount(\r\n +v.target.value,\r\n +formik\r\n .getFieldMeta('Quantity')\r\n .value.toFixed(2),\r\n )\r\n }\r\n />\r\n \r\n \r\n )}\r\n {/* Amount */}\r\n \r\n {\r\n formik.getFieldHelpers('Quantity').setValue(1, false);\r\n formik\r\n .getFieldHelpers('Rate')\r\n .setValue(+v.target.value, true);\r\n }}\r\n disabled={isEdit && !initialValues.Manual}\r\n />\r\n \r\n\r\n {/* Resource */}\r\n \r\n \r\n \r\n {/* OtherService */}\r\n \r\n \r\n \r\n {/* SampleType */}\r\n \r\n \r\n \r\n\r\n {/* Remarks */}\r\n \r\n \r\n \r\n \r\n {insertedAt && (\r\n \r\n \r\n {t(translations.InsertedAt)}\r\n \r\n {dateUtils.shortDateTimeFormat(insertedAt)}\r\n \r\n )}\r\n {insertedBy && (\r\n \r\n \r\n {t(translations.InsertedBy)}\r\n \r\n {insertedBy}\r\n \r\n )}\r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n };\r\n const leftActions = [\r\n () => (\r\n <>\r\n submitRef.current?.()}\r\n size=\"small\"\r\n disabled={busy}\r\n >\r\n {t(translations.Submit)}\r\n \r\n \r\n ),\r\n ];\r\n const rightActions = [\r\n () => (\r\n <>\r\n }\r\n onClick={close}\r\n size=\"small\"\r\n disabled={busy}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ];\r\n return (\r\n }\r\n leftActions={leftActions}\r\n rightActions={rightActions}\r\n disableExpandToggle={true}\r\n closeSidePanel={() => {\r\n if (hasChanges) {\r\n dispatch(actions.setConfirmOpen(true));\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }}\r\n isCover={props.isCover}\r\n closeCover={props.closeCover}\r\n />\r\n );\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport {\r\n FeeTypeEntitySchema,\r\n OfflineServiceTypeEntitySchema,\r\n OnlineServiceEntitySchema,\r\n UserEntitySchema,\r\n UserGroupEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { InvoiceChildRowBaseSchema } from 'app/components/Forms/Schemas/InvoiceChildRowBaseSchema';\r\nimport { CatRateTypes } from 'enums/CatRateTypes';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { ICharge } from '../AddChargePage/ICharge';\r\nimport { GlobalSettingsType } from '../ReservationDetails/Details/components/useGlobalSettingsHook';\r\n\r\nexport function GetChargeSchema(\r\n t: TFunction,\r\n isEdit: boolean,\r\n globalSettings: GlobalSettingsType,\r\n): Yup.SchemaOf {\r\n const result = InvoiceChildRowBaseSchema(t).concat(\r\n Yup.object({\r\n User: UserEntitySchema.nullable().notRequired(),\r\n Resource: OnlineServiceEntitySchema.notRequired().nullable(),\r\n OtherService: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n UserGroup: UserGroupEntitySchema.nullable().when(\r\n 'User',\r\n (_, schema: Yup.SchemaOf>) =>\r\n isEdit ? schema.notRequired() : schema.required(),\r\n ),\r\n SampleType: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n FeeType: FeeTypeEntitySchema.required().nullable(),\r\n Quantity: Yup.number().defined(),\r\n Rate: Yup.number()\r\n .defined()\r\n .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n return (catRateType as Entity)?.Id === CatRateTypes.Refund ||\r\n (catRateType as Entity)?.Id === CatRateTypes.Discount\r\n ? schema.negative().max(0)\r\n : schema.positive().min(0);\r\n }),\r\n Amount: Yup.number()\r\n .defined()\r\n .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n return (catRateType as Entity)?.Id === CatRateTypes.Refund ||\r\n (catRateType as Entity)?.Id === CatRateTypes.Discount\r\n ? schema.negative().max(0)\r\n : schema.positive().min(0);\r\n }),\r\n Manual: Yup.bool().notRequired(),\r\n ActualRate: Yup.number().notRequired(),\r\n Remarks: Yup.string().nullable().default('').notRequired(),\r\n FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n PurchaseOrder: Yup.string()\r\n .label(t(translations.PurchaseOrder) as string)\r\n .nullable(true)\r\n .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n .when('Budget', {\r\n is: budget => {\r\n const result =\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory;\r\n return result;\r\n },\r\n then: schema => schema.required(),\r\n }),\r\n }),\r\n );\r\n return result;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LabelTypeEdit,\r\n);\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectArticleDetailsForm } from '../slice/selectors';\r\n\r\nexport type AllowedToChangeStatusFunc = (asset: IAssetDto) => boolean;\r\nexport const useAllowedToChangeStatus = (): AllowedToChangeStatusFunc => {\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const admin = authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n const readOnlyUser =\r\n authenticatedUser?.Roles.includes(Roles.Readonly) ||\r\n authenticatedUser?.Roles.includes(Roles.CalendarOnly);\r\n const allowedToChangeStatus = React.useCallback(\r\n asset => {\r\n if (admin && asset !== undefined && asset !== null && !readOnlyUser) {\r\n return asset.ServiceGroupId !== null &&\r\n asset.ServiceGroupId !== undefined &&\r\n (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n asset.ServiceGroupId,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n ? true\r\n : false;\r\n } else {\r\n return false;\r\n }\r\n },\r\n [admin, authenticatedUser, readOnlyUser],\r\n );\r\n return allowedToChangeStatus;\r\n};\r\n\r\nexport const useCanEdit = (): [boolean, string] => {\r\n const { t } = useTranslation();\r\n const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n const allowedToChangeStatus = useAllowedToChangeStatus();\r\n if (allowedToChangeStatus(articleDetailsForm?.ServiceGroupAssets[0])) {\r\n return [true, ''];\r\n } else {\r\n // simple user rights\r\n if (articleDetailsForm?.CreatedByMe) {\r\n if (articleDetailsForm?.Status === ArticleStatus.Approved) {\r\n return [false, t(translations.PublicationRecordApproved_info)];\r\n } else {\r\n return [true, ''];\r\n }\r\n } else {\r\n return [false, ''];\r\n }\r\n }\r\n};\r\n\r\nexport const useCanAdd = (): boolean => {\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const readOnlyUser =\r\n authenticatedUser?.Roles.includes(Roles.Readonly) ||\r\n authenticatedUser?.Roles.includes(Roles.CalendarOnly);\r\n return !readOnlyUser;\r\n};\r\n","/**\r\n *\r\n * ArticleDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useArticlesSlice } from 'app/pages/ArticlesPage/slice';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport {\r\n selectArticleDetails,\r\n selectArticleDetailsBusy,\r\n selectArticleDetailsForm,\r\n selectRefreshEditArticleAssociation,\r\n} from 'app/pages/ArticlesPage/slice/selectors';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { useCanAdd, useCanEdit } from '../Hooks/useAllowedToChangeStatus';\r\nimport { WorkOrderLink } from 'app/pages/Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { GhostInput } from 'app/components/BasicInputs/GhostInput';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ArticleDoiLink } from '../ArticleDoiLink';\r\n\r\nexport interface ArticleDetailsProps extends SidePanelContentProps, CoverProps {\r\n value?: IArticleDto;\r\n Id?: number;\r\n externalId?: string;\r\n externalIdSource?: string;\r\n onClose?: () => void;\r\n}\r\n\r\nexport function ArticleDetails({\r\n useSidePanel = true,\r\n closeCover,\r\n isCover,\r\n ...props\r\n}: ArticleDetailsProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useArticlesSlice();\r\n const selectedArticle = useSelector(selectArticleDetails);\r\n const articleDetails = useSelector(selectArticleDetailsForm);\r\n const refreshDetails = useSelector(selectRefreshEditArticleAssociation);\r\n const busy = useSelector(selectArticleDetailsBusy);\r\n const refresh = useSelector(selectDoRefreshTable);\r\n\r\n const isSaved = React.useMemo(() => {\r\n return articleDetails?.Id !== undefined && articleDetails?.Id > 0;\r\n }, [articleDetails?.Id]);\r\n const [canEdit, msg] = useCanEdit();\r\n const canAdd = useCanAdd();\r\n\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n\r\n if (active && !busy) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.showDetails({\r\n Id: props.Id,\r\n externalId: props.externalId,\r\n externalIdSource: props.externalIdSource,\r\n article: props.value,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n busy,\r\n dispatch,\r\n firstLoad,\r\n props.Id,\r\n props.externalId,\r\n props.externalIdSource,\r\n props.value,\r\n refresh,\r\n ]);\r\n React.useEffect(() => {\r\n let active = refreshDetails === true;\r\n\r\n if (active && !busy) {\r\n dispatch(\r\n actions.showDetails({\r\n Id: selectedArticle?.Id,\r\n externalId: selectedArticle?.ExternalId ?? undefined,\r\n externalIdSource: selectedArticle?.ExternalIdSource ?? undefined,\r\n article: selectedArticle,\r\n }),\r\n );\r\n dispatch(actions.refreshEditArticleAssociation(undefined));\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actions, busy, dispatch, refreshDetails, selectedArticle]);\r\n\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(() => false, undefined, isCover, useSidePanel);\r\n const openExternalEntry = React.useCallback(\r\n (article: IArticleDto | undefined) => {\r\n openPanel({\r\n renderPageType: RenderPageType.ArticleEdit,\r\n renderPageProps: {\r\n useSidePanel: true,\r\n value: article,\r\n },\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const editArticle = React.useCallback(() => {\r\n openPanel({\r\n renderPageType: RenderPageType.ArticleForm,\r\n renderPageProps: {\r\n useSidePanel: true,\r\n },\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n }, [openPanel, useSidePanel]);\r\n // const setCover = React.useCallback(\r\n // showCover => {\r\n // if (\r\n // selectedArticle !== undefined &&\r\n // selectedArticle.ExternalIdSource === 'Manual Entry'\r\n // ) {\r\n // const sidePanelProps: EditArticleDetailsFormProps = {\r\n // useSidePanel: true,\r\n // value: selectedArticle,\r\n // };\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: RenderPageType.ArticleEdit,\r\n // props: sidePanelProps,\r\n // }),\r\n // );\r\n // } else {\r\n // dispatch(actions.showEditArticleAssociation(showCover));\r\n // }\r\n // },\r\n // [actions, dispatch, selectedArticle],\r\n // );\r\n // const showEditArticle = useSelector(selectShowEditArticleAssociation);\r\n\r\n //CSS\r\n /*const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n articleLabelColorPaddingTop: {\r\n color: 'grey',\r\n paddingTop: '10px',\r\n },\r\n articleValueLabelBold: {\r\n fontWeight: 'bold',\r\n },\r\n }),\r\n );*/\r\n //const classes = useStyles();\r\n const handleCancelClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: false,\r\n onClose: () => {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n },\r\n } as SidePanelCloseState);\r\n }, [closePanel, dispatch, isCover, useSidePanel]);\r\n const isEmpty = React.useCallback(value => {\r\n if (value === undefined || value === null) {\r\n return true;\r\n } else {\r\n if (typeof value === 'string') {\r\n const res = value.trim();\r\n return res !== '' ? false : true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }, []);\r\n const getValue = React.useCallback(\r\n value => {\r\n if (value === undefined || value === null) {\r\n return t(translations.NA);\r\n } else {\r\n if (typeof value === 'string') {\r\n const res = value.trim();\r\n return res !== '' ? res : t(translations.NA);\r\n } else {\r\n return value;\r\n }\r\n }\r\n },\r\n [t],\r\n );\r\n return (\r\n 0 && canEdit) ||\r\n (selectedArticle !== undefined &&\r\n selectedArticle.Id === 0 &&\r\n !busy &&\r\n canAdd)\r\n ? [\r\n () => (\r\n <>\r\n \r\n selectedArticle !== undefined &&\r\n selectedArticle.ExternalIdSource === 'Manual Entry'\r\n ? openExternalEntry(selectedArticle)\r\n : editArticle()\r\n }\r\n disabled={!canEdit}\r\n />\r\n \r\n ),\r\n ]\r\n : undefined\r\n }\r\n // cover={\r\n // cover\r\n // // && setCover(false)} />\r\n // }\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n isCover={isCover}\r\n coverClosed={coverClosed}\r\n useSwitchActions={true}\r\n >\r\n \r\n \r\n \r\n {/*\r\n \r\n {msg !== '' && (\r\n \r\n {msg}\r\n \r\n )}\r\n \r\n {t(translations.Title)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Abstract)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Authors)}\r\n \r\n \r\n \r\n \r\n {!isNullOrUndefined(articleDetails.ExternalIdSource) && (\r\n <>\r\n \r\n {t(translations.Source)}\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n {t(translations.EnteredBy)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.InsertedAt)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Doi)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.ArticleDataset)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.ISSN)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.ORCID)}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Year)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.ArticleStatus)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.RelatedUser)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.CalibrationRecord)}\r\n \r\n \r\n \r\n {articleDetails.CalibrationRecord !== undefined &&\r\n articleDetails.CalibrationRecord !== null && (\r\n \r\n {articleDetails.CalibrationRecord}\r\n \r\n )}\r\n \r\n \r\n {t(translations.Journal)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.ArticlePageNumber)}\r\n \r\n \r\n \r\n \r\n \r\n {isSaved && (\r\n <>\r\n \r\n \r\n {t(translations.ParticipatedLabs)}\r\n \r\n \r\n \r\n {articleDetails.ServiceGroupAssets.length === 0 ? (\r\n t(translations.NA)\r\n ) : (\r\n
      \r\n {articleDetails.ServiceGroupAssets.map(asset => (\r\n
    • \r\n \r\n {asset.Name}\r\n \r\n
    • \r\n ))}\r\n
    \r\n )}\r\n
    \r\n \r\n \r\n {t(translations.ParticipatedInstruments)}\r\n \r\n \r\n \r\n {articleDetails.InstrumentAssets.length === 0 ? (\r\n t(translations.NA)\r\n ) : (\r\n
      \r\n {articleDetails.InstrumentAssets.map(asset => (\r\n
    • \r\n \r\n {asset.Name}\r\n \r\n
    • \r\n ))}\r\n
    \r\n )}\r\n
    \r\n \r\n )}\r\n \r\n
    */}\r\n {msg !== '' && (\r\n \r\n {msg}\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n {!isNullOrUndefined(articleDetails.ExternalIdSource) && (\r\n <>\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n t(translations.NA)\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n ) : (\r\n t(translations.NA)\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {articleDetails.CalibrationRecord}\r\n \r\n ) : (\r\n t(translations.NA)\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {isSaved && (\r\n <>\r\n \r\n \r\n {articleDetails.ServiceGroupAssets.map(asset => (\r\n
  • \r\n \r\n {asset.Name}\r\n \r\n
  • \r\n ))}\r\n \r\n )\r\n }\r\n />\r\n
    \r\n \r\n \r\n {articleDetails.InstrumentAssets.map(asset => (\r\n
  • \r\n \r\n {asset.Name}\r\n \r\n
  • \r\n ))}\r\n \r\n )\r\n }\r\n />\r\n
    \r\n \r\n )}\r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n );\r\n}\r\nfunction EditAssociationButton({\r\n item,\r\n onClick,\r\n disabled,\r\n}: {\r\n item?: IArticleDto;\r\n onClick: () => void;\r\n disabled: boolean;\r\n}) {\r\n const { t } = useTranslation();\r\n //const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n if (item === undefined) {\r\n return <>;\r\n }\r\n /*const show =\r\n authenticatedUser?.Roles?.includes(Roles.GroupAdministrators) === true;\r\n if (!show) {\r\n return <>;\r\n }*/\r\n if (item.Id > 0) {\r\n if (item.ExternalIdSource === 'Manual Entry') {\r\n return (\r\n }\r\n onClick={onClick}\r\n disabled={disabled}\r\n >\r\n {t(translations.EditArticle)}\r\n \r\n );\r\n } else {\r\n return (\r\n }\r\n onClick={onClick}\r\n disabled={disabled}\r\n >\r\n {t(translations.EditAssociation)}\r\n \r\n );\r\n }\r\n } else {\r\n return (\r\n }\r\n onClick={onClick}\r\n >\r\n {t(translations.AssociateThisPublication)}\r\n \r\n );\r\n }\r\n}\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { avTypes } from '../pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { AssetPicker } from '../pickers/AutocompletePickers/AssetPicker';\r\n\r\nexport const FormAssetPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps & {\r\n restrictByAvType?: avTypes;\r\n admin?: boolean;\r\n showOnlyActiveAssets?: boolean;\r\n }) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n restrictByAvType={props.restrictByAvType}\r\n admin={props.admin}\r\n showOnlyActiveAssets={props.showOnlyActiveAssets}\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n required={props.required}\r\n />\r\n );\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface IArticleNewEditForm {\r\n Title: string;\r\n Authors: string;\r\n Abstract: string;\r\n Doi?: string | null;\r\n Dataset?: string | null;\r\n ISSN?: string | null;\r\n ORCIDs?: string | null;\r\n Year: number;\r\n RelatedUser: Entity | null;\r\n ServiceGroupAsset: IAssetDto | null;\r\n Journal?: string | null;\r\n PageNumber?: number | null;\r\n //ServiceGroupAssets: Array;\r\n InstrumentAssets: Array;\r\n Status: Entity;\r\n CalibrationRecord: Entity | null;\r\n}\r\n\r\nexport const assetSchema = Yup.mixed();\r\nexport const assetsSchema = Yup.array().of(\r\n Yup.mixed() as Yup.SchemaOf,\r\n);\r\n\r\nexport const GetInstrumentFilter = (serviceGroups: IAssetDto[]) => {\r\n const sv = serviceGroups.filter(f => f !== null && f !== undefined);\r\n if (sv.length > 0) {\r\n const f = [\r\n `(ServiceGroupId in (${sv.map(f => f.ServiceGroupId).join(',')}))`,\r\n ];\r\n return f;\r\n } else {\r\n return [];\r\n }\r\n};\r\nexport const GetCalibrationRecordFilter = (assets: IAssetDto[]) => {\r\n const services = assets.filter(f => f !== null && f !== undefined);\r\n if (services.length > 0) {\r\n const test = services.map(f => f.Id);\r\n const test_s = test.join(',');\r\n const f = [`(AssetId in (${test_s}))`];\r\n return f;\r\n } else {\r\n return [];\r\n }\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { FormControl } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { Entity } from 'types/common';\r\nimport CustomPickerFilter from '../BasicTable/Filters/CustomPickerFilter';\r\n\r\nexport interface FormCustomPickerProps extends IFieldProps {\r\n data: Entity[];\r\n}\r\nexport const FormCustomPicker = ({\r\n label,\r\n disableFuture,\r\n disablePast,\r\n data,\r\n ...props\r\n}: FieldHookConfig | null> & FormCustomPickerProps) => {\r\n const [field, , helpers] = useField | null>(props);\r\n return (\r\n \r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n value={field.value}\r\n customData={data}\r\n fullWidth={true}\r\n open={false}\r\n placeholder={props.placeholder}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","import {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ArticleWorkOrdersPickerProps\r\n extends Omit>, 'url'> {}\r\n\r\nexport function ArticleWorkOrdersPicker(props: ArticleWorkOrdersPickerProps) {\r\n return ;\r\n}\r\n","import { IFieldProps } from 'app/components/Forms/FormRender/IFormFieldSetting';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ArticleWorkOrdersPicker } from '../ArticlePickers';\r\n\r\nexport const ArticleFormPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * NewArticleDetailsForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { selectEditArticleAssociationBusy } from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport {\r\n EntityNumberSchema,\r\n UserEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport {\r\n assetSchema,\r\n assetsSchema,\r\n GetCalibrationRecordFilter,\r\n GetInstrumentFilter,\r\n IArticleNewEditForm,\r\n} from '../utils';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { FormCustomPicker } from 'app/components/Forms/FormCustomPicker';\r\nimport { Entity } from 'types/common';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { Roles } from 'app/slice/types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface NewArticleDetailsFormProps\r\n extends SidePanelContentProps,\r\n CoverProps {\r\n Journal?: string | null;\r\n PageNumber?: number | null;\r\n}\r\n\r\nexport function NewArticleDetailsForm(props: NewArticleDetailsFormProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const [oldServiceGroups, setOldServiceGroups] = React.useState(\r\n [],\r\n );\r\n const [serviceGroups, setServiceGroups] = React.useState([]);\r\n const [instruments, setInstruments] = React.useState([]);\r\n\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const processing = useSelector(selectEditArticleAssociationBusy);\r\n const admin = authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n const dispatch = useDispatch();\r\n const { actions } = useArticlesSlice();\r\n const [canEditStatus, setCanEditStatus] = React.useState(false);\r\n const allowedToChangeStatus = useAllowedToChangeStatus();\r\n const schema: Yup.SchemaOf = Yup.object().shape(\r\n {\r\n Title: Yup.string().required().label(t(translations.Title)).trim(),\r\n Authors: Yup.string().required().label(t(translations.Authors)).trim(),\r\n Abstract: Yup.string().required().label(t(translations.Abstract)).trim(),\r\n Doi: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.Doi))\r\n .trim(),\r\n Dataset: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ArticleDataset))\r\n .trim(),\r\n ISSN: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ISSN))\r\n .trim(),\r\n ORCIDs: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ORCID))\r\n .trim(),\r\n Year: Yup.number().required().label(t(translations.Year)).min(1),\r\n RelatedUser: UserEntitySchema.nullable().notRequired(),\r\n CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n /*ServiceGroupAssets: assetsSchema.when(['InstrumentAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetsSchema\r\n .required()\r\n .label(t(translations.ServiceGroup))\r\n .min(1)\r\n otherwise: assetsSchema.notRequired(),\r\n }),*/\r\n ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetSchema\r\n .required()\r\n .label(t(translations.ServiceGroup))\r\n .nullable(),\r\n otherwise: assetSchema.nullable().notRequired(),\r\n }),\r\n /*InstrumentAssets: assetsSchema.when(['ServiceGroupAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n otherwise: assetsSchema.notRequired(),\r\n }),*/\r\n InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n is: v => v === null,\r\n then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n otherwise: assetsSchema.notRequired(),\r\n }),\r\n Status: EntityNumberSchema.required().label(\r\n t(translations.ArticleStatus),\r\n ),\r\n Journal: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.Journal))\r\n .trim(),\r\n PageNumber: Yup.number(),\r\n },\r\n [['ServiceGroupAsset', 'InstrumentAssets']],\r\n );\r\n const initialValues: IArticleNewEditForm = React.useMemo(\r\n () => ({\r\n Title: '',\r\n Authors: '',\r\n Abstract: '',\r\n Doi: null,\r\n Dataset: null,\r\n ISSN: null,\r\n ORCIDs: null,\r\n Year: 0,\r\n RelatedUser: null,\r\n CalibrationRecord: null,\r\n InstrumentAssets: [],\r\n //ServiceGroupAssets: [],\r\n ServiceGroupAsset: null,\r\n Status: admin\r\n ? { Id: 1, Name: t('Article' + ArticleStatus[1]) }\r\n : { Id: 0, Name: t('Article' + ArticleStatus[0]) },\r\n }),\r\n [admin, t],\r\n );\r\n\r\n const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState();\r\n\r\n const handleCloseClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: props.isCover,\r\n useSidePanel: props.useSidePanel,\r\n showConfirm: undefined,\r\n onClose: () => {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n dispatch(actions.resetArticleAssociationState());\r\n },\r\n } as SidePanelCloseState);\r\n }, [\r\n actions,\r\n closePanel,\r\n dispatch,\r\n layoutActions,\r\n props.isCover,\r\n props.useSidePanel,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (processing === false) {\r\n handleCloseClick();\r\n }\r\n return () => undefined;\r\n }, [processing, handleCloseClick]);\r\n\r\n const instrumentFilter = React.useCallback(() => {\r\n return GetInstrumentFilter(serviceGroups);\r\n }, [serviceGroups]);\r\n const CalibrationRecordFilter = React.useCallback(() => {\r\n return GetCalibrationRecordFilter(instruments);\r\n }, [instruments]);\r\n\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: IArticleNewEditForm,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (\r\n serviceGroups.length !== oldServiceGroups.length ||\r\n serviceGroups[0] !== oldServiceGroups[0]\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('InstrumentAssets', []);\r\n return;\r\n }\r\n if (\r\n values.ServiceGroupAsset === null &&\r\n values.InstrumentAssets.length > 0\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('ServiceGroupAsset', {\r\n Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n Name: values.InstrumentAssets[0].ServiceGroupName,\r\n ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n });\r\n }\r\n setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n },\r\n [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n );\r\n const handleSubmit = React.useCallback(\r\n (values: IArticleNewEditForm) => {\r\n if (\r\n //values.ServiceGroupAssets.length === 0 &&\r\n (values.ServiceGroupAsset === null &&\r\n values.InstrumentAssets.length === 0) ||\r\n values.Status === null\r\n ) {\r\n return;\r\n }\r\n const payload: IArticleDto = {\r\n Id: 0,\r\n Title: values.Title.trim(),\r\n Authors: values.Authors.trim().split(','),\r\n Abstract: values.Abstract.trim(),\r\n Year: values.Year,\r\n ExternalId: null,\r\n ExternalIdSource: 'Manual Entry',\r\n Doi:\r\n values.Doi !== undefined && values.Doi !== null\r\n ? values.Doi.trim()\r\n : null,\r\n Dataset:\r\n values.Dataset !== undefined && values.Dataset !== null\r\n ? values.Dataset.trim()\r\n : null,\r\n ISSN:\r\n values.ISSN !== undefined && values.ISSN !== null\r\n ? values.ISSN.trim()\r\n : null,\r\n Journal: values.Journal !== undefined ? values.Journal : null,\r\n PageNumber: values.PageNumber !== undefined ? values.PageNumber : null,\r\n ORCIDs:\r\n values.ORCIDs !== undefined && values.ORCIDs !== null\r\n ? values.ORCIDs.trim().split(',')\r\n : [],\r\n ArticleContributionLevelId: null,\r\n FirstInstrumentAssetName: null,\r\n FirstServiceGroupAssetName: null,\r\n ...{\r\n //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n Assets:\r\n values.ServiceGroupAsset !== null\r\n ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n : values.InstrumentAssets,\r\n },\r\n Status: values.Status.Id,\r\n EnteredBy: null,\r\n UserDisplayName: null,\r\n EnteredAt: null,\r\n RelatedUser:\r\n values.RelatedUser !== null ? values.RelatedUser?.Id : null,\r\n RelatedUserDisplayName: null,\r\n CalibrationRecord:\r\n values.CalibrationRecord !== null\r\n ? values.CalibrationRecord?.Id\r\n : null,\r\n CalibrationRecordName: null,\r\n UserGroupId: null,\r\n UserGroupName: null,\r\n DepartmentId: null,\r\n DepartmentName: null,\r\n InstituteId: null,\r\n InstituteName: null,\r\n InstituteTypeId: null,\r\n InstituteTypeName: null,\r\n CreatedByMe: false,\r\n };\r\n dispatch(actions.saveArticleAssociation(payload));\r\n },\r\n [actions, dispatch],\r\n );\r\n\r\n const statusPickerData: Entity[] = React.useMemo(() => {\r\n const data = [\r\n {\r\n Id: ArticleStatus.AwaitingApproval,\r\n Name: t('Article' + ArticleStatus[ArticleStatus.AwaitingApproval]),\r\n },\r\n {\r\n Id: ArticleStatus.Approved,\r\n Name: t('Article' + ArticleStatus[ArticleStatus.Approved]),\r\n },\r\n ] as Entity[];\r\n return data;\r\n }, [t]);\r\n\r\n return (\r\n \r\n \r\n \r\n {formik => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Source)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 0\r\n ? t(translations.CalibrationRecord)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n placeholder={\r\n instruments.length > 0\r\n ? t(translations.PleaseSelectWorkOrder)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n disabled={\r\n formik.isSubmitting ||\r\n !canEditStatus ||\r\n instruments.length === 0\r\n }\r\n filter={CalibrationRecordFilter()}\r\n info={t(translations.CalibrationRecord_info)}\r\n fullWidth\r\n />\r\n \r\n \r\n \r\n \r\n \r\n {\r\n setOldServiceGroups(serviceGroups);\r\n setServiceGroups([value]);\r\n }}\r\n />\r\n \r\n \r\n {\r\n setInstruments(value);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n}\r\n","import { Entity } from 'types/common';\r\n\r\nexport interface IComment {\r\n Id: number;\r\n Text: string;\r\n CreatedAt: Date | string;\r\n CreatedBy: Entity;\r\n Files: CommentFile[];\r\n IsInternal?: boolean | null;\r\n}\r\n\r\nexport interface NewComment {\r\n Text?: string;\r\n Files?: FileList;\r\n Users: Entity[];\r\n IsInternal?: boolean | null;\r\n}\r\n\r\nexport interface CommentFile {\r\n Id: string;\r\n Name: string;\r\n Size?: number;\r\n}\r\nexport const ConvertNewToComment = (\r\n newcomment: NewComment,\r\n Id: number,\r\n CreatedAt: Date | string,\r\n CreatedBy: Entity,\r\n) => {\r\n let newFiles: CommentFile[] = [];\r\n if (!!newcomment.Files && newcomment.Files.length > 0) {\r\n for (\r\n let i: number = 0;\r\n !!newcomment.Files && i < newcomment.Files.length;\r\n i++\r\n ) {\r\n let item = newcomment.Files.item(i);\r\n if (!!item) {\r\n newFiles.push({\r\n Id: i.toString(),\r\n Name: item.name,\r\n Size: item.size,\r\n } as CommentFile);\r\n }\r\n }\r\n }\r\n return {\r\n Id: Id,\r\n Text: newcomment.Text || '',\r\n CreatedAt: CreatedAt,\r\n CreatedBy: CreatedBy,\r\n Files: newFiles,\r\n IsInternal: newcomment.IsInternal,\r\n } as IComment;\r\n};\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport {\r\n ConvertNewToComment,\r\n IComment,\r\n NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { Portal } from '@material-ui/core';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\n\r\nexport interface ArticleCommentsProps {\r\n isAdmin?: boolean;\r\n article: IArticleDto;\r\n disabled?: boolean;\r\n commentsFormRef: React.MutableRefObject;\r\n isEdit?: boolean;\r\n user?: AuthenticatedUser;\r\n sectionTitle?: React.ReactNode;\r\n}\r\n\r\nexport const ArticleComments = (props: ArticleCommentsProps) => {\r\n const {\r\n article,\r\n isAdmin,\r\n disabled,\r\n commentsFormRef,\r\n isEdit,\r\n user,\r\n sectionTitle,\r\n } = props;\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const [changed, setchanged] = React.useState(false);\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const [newSavedComments, setNewSavedComments] = React.useState(\r\n [],\r\n );\r\n const [newComments, setNewComments] = React.useState([]);\r\n const comments = useAsyncGetWthEffect(\r\n () =>\r\n CommentsApi.GetComments(\r\n CommentReferenceTypes.Article,\r\n article.Id > 0 ? article.Id : -1,\r\n ),\r\n [],\r\n [changed],\r\n );\r\n const bindSubmitComment = React.useCallback(\r\n submitForm => {\r\n commentsFormRef.current = submitForm;\r\n },\r\n [commentsFormRef],\r\n );\r\n const { onCommentAdded } = useUploadToNewComment();\r\n\r\n React.useEffect(() => {\r\n dispatch(\r\n largeFileActions.setCommentProperties({\r\n commentType: CommentReferenceTypes.Article,\r\n referenceId: article.Id,\r\n }),\r\n );\r\n }, [article.Id, dispatch, largeFileActions]);\r\n\r\n const portalRef = React.useRef(null);\r\n return (\r\n \r\n
    \r\n \r\n {\r\n if (!disabled) {\r\n if (isEdit) {\r\n CommentsApi.SendComment(\r\n CommentReferenceTypes.Article,\r\n article.Id,\r\n c,\r\n )\r\n .then(res => onCommentAdded?.(res))\r\n .finally(() => setchanged(prev => !prev));\r\n } else {\r\n setNewSavedComments(() => [...newSavedComments, c]);\r\n setNewComments(() => [\r\n ...newComments,\r\n ConvertNewToComment(c, newComments.length + 1, newDate(), {\r\n Id: user?.Id || '',\r\n Name: user?.Name || '',\r\n }),\r\n ]);\r\n }\r\n }\r\n }}\r\n isAdmin={isAdmin}\r\n withMentions\r\n pageName={t(translations.Publications)}\r\n referenceName={article?.Id?.toString()}\r\n />\r\n \r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * EditArticleDetailsForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport {\r\n selectArticleDetails,\r\n selectArticleDetailsBusy,\r\n selectArticleDetailsForm,\r\n selectEditArticleAssociationBusy,\r\n} from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport { Entity } from 'types/common';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport {\r\n assetSchema,\r\n assetsSchema,\r\n GetCalibrationRecordFilter,\r\n GetInstrumentFilter,\r\n IArticleNewEditForm,\r\n} from '../utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { FormCustomPicker } from 'app/components/Forms/FormCustomPicker';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { ArticleComments } from '../ArticleComments';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface EditArticleDetailsFormProps\r\n extends SidePanelContentProps,\r\n CoverProps {\r\n value: IArticleDto;\r\n onClose?: () => void;\r\n Journal?: string | null;\r\n PageNumber?: number | null;\r\n}\r\nexport function EditArticleDetailsForm(props: EditArticleDetailsFormProps) {\r\n const { t } = useTranslation();\r\n const editProcessing = useSelector(selectEditArticleAssociationBusy);\r\n const detailsLoading = useSelector(selectArticleDetailsBusy);\r\n const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n const articleDetails = useSelector(selectArticleDetails);\r\n const user = useSelector(selectAuthenticatedUser);\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const [canEditStatus, setCanEditStatus] = React.useState(false);\r\n const allowedToChangeStatus = useAllowedToChangeStatus();\r\n const submitCommentRef = React.useRef(null);\r\n const dispatch = useDispatch();\r\n const { actions } = useArticlesSlice();\r\n const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState(\r\n undefined,\r\n undefined,\r\n props.isCover,\r\n props.useSidePanel,\r\n undefined,\r\n );\r\n\r\n const handleCloseClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: props.isCover,\r\n useSidePanel: props.useSidePanel,\r\n showConfirm: false,\r\n onClose: () => {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n dispatch(actions.resetArticleAssociationState());\r\n },\r\n } as SidePanelCloseState);\r\n }, [\r\n actions,\r\n closePanel,\r\n dispatch,\r\n layoutActions,\r\n props.isCover,\r\n props.useSidePanel,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (editProcessing === false) {\r\n handleCloseClick();\r\n }\r\n return () => undefined;\r\n }, [editProcessing, handleCloseClick]);\r\n\r\n const schema: Yup.SchemaOf = Yup.object().shape(\r\n {\r\n Title: Yup.string().required().label(t(translations.Title)).trim(),\r\n Authors: Yup.string().required().label(t(translations.Authors)).trim(),\r\n Abstract: Yup.string().required().label(t(translations.Abstract)).trim(),\r\n Doi: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.Doi))\r\n .trim(),\r\n Dataset: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ArticleDataset))\r\n .trim(),\r\n ISSN: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ISSN))\r\n .trim(),\r\n ORCIDs: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.ORCID))\r\n .trim(),\r\n Year: Yup.number().required().label(t(translations.Year)).min(1),\r\n CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n RelatedUser: Yup.mixed().nullable().notRequired(),\r\n /*ServiceGroupAssets: assetsSchema.when(['InstrumentAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetsSchema\r\n .required()\r\n .label(t(translations.ServiceGroup))\r\n .min(1)\r\n otherwise: assetsSchema.notRequired(),\r\n }),*/\r\n ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetSchema\r\n .required()\r\n .label(t(translations.ServiceGroup))\r\n .nullable(),\r\n otherwise: assetSchema.nullable().notRequired(),\r\n }),\r\n /*InstrumentAssets: assetsSchema.when(['ServiceGroupAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n otherwise: assetsSchema.notRequired(),\r\n }),*/\r\n InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n is: v => v === null,\r\n then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n otherwise: assetsSchema.notRequired(),\r\n }),\r\n Status: EntityNumberSchema.required().label(\r\n t(translations.ArticleStatus),\r\n ),\r\n Journal: Yup.string()\r\n .notRequired()\r\n .nullable()\r\n .label(t(translations.Journal))\r\n .trim(),\r\n PageNumber: Yup.number().nullable().default(null),\r\n },\r\n [['ServiceGroupAsset', 'InstrumentAssets']],\r\n );\r\n const GetServiceGroupAsset = React.useCallback(asset => {\r\n /*if (asset !== undefined && asset !== null) {\r\n return asset.ServiceGroupId !== null &&\r\n asset.ServiceGroupId !== undefined &&\r\n (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n asset.ServiceGroupId,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n ? asset\r\n : null;\r\n } else {\r\n return null;\r\n }*/\r\n return asset;\r\n }, []);\r\n const initialValues: IArticleNewEditForm = React.useMemo(\r\n () => ({\r\n Title:\r\n articleDetailsForm.Title === null ||\r\n articleDetailsForm.Title === undefined\r\n ? ''\r\n : articleDetailsForm.Title,\r\n Authors:\r\n articleDetailsForm.Authors === null ||\r\n articleDetailsForm.Authors === undefined\r\n ? ''\r\n : articleDetailsForm.Authors.join(','),\r\n Abstract:\r\n articleDetailsForm.Abstract === null ||\r\n articleDetailsForm.Abstract === undefined\r\n ? ''\r\n : articleDetailsForm?.Abstract?.trim(),\r\n Doi: articleDetailsForm.Doi,\r\n Dataset: articleDetailsForm.Dataset,\r\n ISSN: articleDetailsForm.ISSN,\r\n ORCIDs:\r\n articleDetailsForm.ORCIDs === null\r\n ? null\r\n : articleDetailsForm.ORCIDs.join(','),\r\n Year: articleDetailsForm.Year ?? 0,\r\n Journal: articleDetailsForm.Journal,\r\n PageNumber: articleDetailsForm.PageNumber,\r\n RelatedUser: {\r\n Id: articleDetailsForm.RelatedUser,\r\n Name: articleDetailsForm.RelatedUserDisplayName,\r\n } as Entity,\r\n CalibrationRecord: {\r\n Id: articleDetailsForm.CalibrationRecord,\r\n Name: !!articleDetailsForm.CalibrationRecord\r\n ? '#' +\r\n articleDetailsForm.CalibrationRecord?.toString() +\r\n ': ' +\r\n articleDetailsForm.CalibrationRecordName ?? ''\r\n : '',\r\n } as Entity,\r\n InstrumentAssets:\r\n articleDetailsForm !== undefined\r\n ? articleDetailsForm?.InstrumentAssets\r\n : /*? articleDetailsForm?.InstrumentAssets.filter(\r\n asset =>\r\n asset.ServiceId !== null &&\r\n asset.ServiceId !== undefined &&\r\n (authenticatedUser?.HasAdminServicePermissions(\r\n asset.ServiceTypeId ?? 1,\r\n asset.ServiceId,\r\n ) ||\r\n authenticatedUser?.HasLabTechServicePermissions(\r\n asset.ServiceTypeId ?? 1,\r\n asset.ServiceId,\r\n ) ||\r\n authenticatedUser?.HasAdminGroupPermissions(\r\n asset.ServiceGroupId ?? undefined,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(\r\n asset.ServiceGroupId ?? undefined,\r\n )),\r\n )*/\r\n [],\r\n /*ServiceGroupAssets:\r\n articleDetailsForm !== undefined\r\n ? articleDetailsForm?.ServiceGroupAssets.filter(\r\n asset =>\r\n asset.ServiceGroupId !== null &&\r\n asset.ServiceGroupId !== undefined &&\r\n (authenticatedUser?.HasAdminGroupPermissions(\r\n asset.ServiceGroupId,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(\r\n asset.ServiceGroupId,\r\n )),\r\n )\r\n : [],*/\r\n ServiceGroupAsset:\r\n articleDetailsForm !== undefined\r\n ? GetServiceGroupAsset(articleDetailsForm?.ServiceGroupAssets[0])\r\n : null,\r\n Status:\r\n articleDetailsForm !== undefined &&\r\n articleDetailsForm.Status !== undefined\r\n ? {\r\n Id: articleDetailsForm.Status,\r\n Name: t('Article' + ArticleStatus[articleDetailsForm.Status]),\r\n }\r\n : { Id: 0, Name: t('Article' + ArticleStatus[0]) },\r\n }),\r\n [GetServiceGroupAsset, articleDetailsForm, t],\r\n );\r\n const [oldServiceGroups, setOldServiceGroups] = React.useState(\r\n //initialValues.ServiceGroupAssets,\r\n initialValues.ServiceGroupAsset === null\r\n ? []\r\n : [initialValues.ServiceGroupAsset],\r\n );\r\n const [serviceGroups, setServiceGroups] = React.useState(\r\n //initialValues.ServiceGroupAssets,\r\n initialValues.ServiceGroupAsset === null\r\n ? []\r\n : [initialValues.ServiceGroupAsset],\r\n );\r\n const [instruments, setInstruments] = React.useState(\r\n initialValues.InstrumentAssets,\r\n );\r\n const instrumentFilter = React.useCallback(() => {\r\n return GetInstrumentFilter(serviceGroups);\r\n }, [serviceGroups]);\r\n const CalibrationRecordFilter = React.useCallback(() => {\r\n return GetCalibrationRecordFilter(instruments);\r\n }, [instruments]);\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: IArticleNewEditForm,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (\r\n serviceGroups.length !== oldServiceGroups.length ||\r\n serviceGroups[0] !== oldServiceGroups[0]\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('InstrumentAssets', []);\r\n return;\r\n }\r\n if (\r\n values.ServiceGroupAsset === null &&\r\n values.InstrumentAssets.length > 0\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('ServiceGroupAsset', {\r\n Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n Name: values.InstrumentAssets[0].ServiceGroupName,\r\n ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n });\r\n }\r\n setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n },\r\n [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n );\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: IArticleNewEditForm) => {\r\n if (\r\n //values.ServiceGroupAssets.length === 0 &&\r\n (values.ServiceGroupAsset === null &&\r\n values.InstrumentAssets.length === 0) ||\r\n values.Status === null\r\n ) {\r\n return;\r\n }\r\n const payload: IArticleDto = {\r\n ...props.value,\r\n Title: values.Title.trim(),\r\n Authors: values.Authors.trim().split(','),\r\n Abstract: values.Abstract.trim(),\r\n Doi:\r\n values.Doi !== undefined && values.Doi !== null\r\n ? values.Doi.trim()\r\n : null,\r\n Dataset:\r\n values.Dataset !== undefined && values.Dataset !== null\r\n ? values.Dataset.trim()\r\n : null,\r\n ISSN:\r\n values.ISSN !== undefined && values.ISSN !== null\r\n ? values.ISSN.trim()\r\n : null,\r\n ORCIDs:\r\n values.ORCIDs !== undefined && values.ORCIDs !== null\r\n ? values.ORCIDs.trim().split(',')\r\n : [],\r\n Year: values.Year,\r\n Status: values.Status.Id,\r\n Journal: values.Journal !== undefined ? values.Journal : null,\r\n PageNumber: values.PageNumber !== undefined ? values.PageNumber : null,\r\n RelatedUser:\r\n values.RelatedUser !== null ? values.RelatedUser?.Id : null,\r\n CalibrationRecord:\r\n values.CalibrationRecord !== null\r\n ? values.CalibrationRecord?.Id\r\n : null,\r\n ExternalId: articleDetailsForm?.ExternalId ?? null,\r\n ExternalIdSource: 'Manual Entry',\r\n ...{\r\n //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n Assets:\r\n values.ServiceGroupAsset !== null\r\n ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n : values.InstrumentAssets,\r\n },\r\n };\r\n dispatch(actions.saveArticleAssociation(payload));\r\n },\r\n [props.value, articleDetailsForm?.ExternalId, dispatch, actions],\r\n );\r\n\r\n const statusPickerData: Entity[] = React.useMemo(() => {\r\n const data = [\r\n {\r\n Id: ArticleStatus.AwaitingApproval,\r\n Name: t('Article' + ArticleStatus[ArticleStatus.AwaitingApproval]),\r\n },\r\n {\r\n Id: ArticleStatus.Approved,\r\n Name: t('Article' + ArticleStatus[ArticleStatus.Approved]),\r\n },\r\n ] as Entity[];\r\n return data;\r\n }, [t]);\r\n\r\n return (\r\n \r\n \r\n {!detailsLoading && (\r\n \r\n {formik => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Source)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {!!articleDetails && (\r\n \r\n \r\n \r\n )}\r\n\r\n \r\n 0\r\n ? t(translations.CalibrationRecord)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n placeholder={\r\n instruments.length > 0\r\n ? t(translations.PleaseSelectWorkOrder)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n disabled={\r\n formik.isSubmitting ||\r\n !canEditStatus ||\r\n instruments.length === 0\r\n }\r\n filter={CalibrationRecordFilter()}\r\n info={t(translations.CalibrationRecord_info)}\r\n fullWidth\r\n />\r\n \r\n \r\n \r\n \r\n \r\n {\r\n setOldServiceGroups(serviceGroups);\r\n setServiceGroups([value]);\r\n }}\r\n />\r\n \r\n \r\n {\r\n setInstruments(value);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * UserAttributesActions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { AsyncDataState } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\n/* --- STATE --- */\r\nexport interface UserAttributesState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n processing: boolean;\r\n}\r\n\r\nexport interface UserAttributesDetailsState {\r\n Id: number;\r\n Attribute?: string | null;\r\n AttributeLocalized: string;\r\n Disabled?: boolean | null;\r\n SSO?: boolean | null;\r\n SSOAttribute?: string | null;\r\n Mandatory?: boolean | null;\r\n RegistrationForm?: boolean | null;\r\n UserDetails?: boolean | null;\r\n UserSidePanel?: boolean | null;\r\n UserProfile?: boolean | null;\r\n Order?: number | null;\r\n}\r\n\r\nexport interface UserAttributesDetailsQStringParameters {\r\n id?: string;\r\n attr?: string;\r\n attrL?: string;\r\n disabled?: string;\r\n sso?: string;\r\n ssoAttr?: string;\r\n mandatory?: string;\r\n regForm?: string;\r\n usrDetails?: string;\r\n usrSidePanel?: string;\r\n usrProfile?: string;\r\n order?: string;\r\n}\r\n\r\nexport interface UserAttributesDetailsResponse extends IResponseType {\r\n Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityUserAttributesDetails(\r\n entity: IUserAttributesDto,\r\n): UserAttributesDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: entity.Id,\r\n Attribute: entity.Attribute,\r\n AttributeLocalized: entity.AttributeLocalized,\r\n Disabled: entity.Disabled,\r\n SSO: entity.SSO,\r\n SSOAttribute: entity.SSOAttribute,\r\n Mandatory: entity.Mandatory,\r\n RegistrationForm: entity.RegistrationForm,\r\n UserDetails: entity.UserDetails,\r\n UserSidePanel: entity.UserSidePanel,\r\n UserProfile: entity.UserProfile,\r\n Order: entity.Order,\r\n } as UserAttributesDetailsState;\r\n }\r\n}\r\n\r\nexport function ConvertEntityToModelUserAttributesDetails(\r\n model: UserAttributesDetailsState,\r\n original: UserAttributesDetailsState | undefined,\r\n): IUserAttributesDto {\r\n let entity = {\r\n Id: original?.Id === undefined ? model.Id : original.Id,\r\n Attribute: model.Attribute,\r\n AttributeLocalized: model.AttributeLocalized,\r\n Disabled: model.Disabled,\r\n SSO: model.SSO,\r\n SSOAttribute: model.SSOAttribute,\r\n Mandatory: model.Mandatory,\r\n RegistrationForm: model.RegistrationForm,\r\n UserDetails: model.UserDetails,\r\n UserSidePanel: model.UserSidePanel,\r\n UserProfile: model.UserProfile,\r\n Order: model.Order,\r\n } as IUserAttributesDto;\r\n return entity;\r\n}\r\n","import { UserAttributesDetailsQStringParameters } from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/types';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { IUserAttributesDto } from './odata/generated/entities/IUserAttributesDto';\r\n\r\nexport const UserAttributesApi = {\r\n initCreateData: (payload: UserAttributesDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = '/api/odata/v4/UserAttributes/InitUserAttributes';\r\n return httpClient.post(url, data);\r\n },\r\n initUpdateData: (payload: UserAttributesDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n console.log(data);\r\n const url = '/api/odata/v4/UserAttributes/InitUserAttributes';\r\n return httpClient.post(url, data);\r\n },\r\n insertUserAttributesDetails: (payload: IUserAttributesDto) => {\r\n const url = '/api/odata/v4/UserAttributes'; //POST action in Controller\r\n return httpClient.post(url, payload);\r\n },\r\n updateUserAttributesDetails: (payload: IUserAttributesDto) => {\r\n const url = `/api/odata/v4/UserAttributes(${payload.Id})`; //PUT action in Controller\r\n return httpClient.put(url, payload);\r\n },\r\n deleteUserAttributesDetails: (\r\n rows: IUserAttributesDto[],\r\n ): Promise => {\r\n const userAttributesIds: number[] = rows.map(item => item.Id);\r\n const data = { userAttributesIds };\r\n const url = '/api/odata/v4/UserAttributes/DeleteUserAttributes';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n ConvertEntityToModelUserAttributesDetails,\r\n UserAttributesDetailsQStringParameters,\r\n UserAttributesDetailsResponse,\r\n UserAttributesDetailsState,\r\n} from './types';\r\nimport { userAttributesDetailsActions as actions } from '.';\r\nimport { UserAttributesApi } from '../../../../../../api/UserAttributesApi';\r\nimport { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { UserAttributesDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitCreate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(UserAttributesApi.initCreateData, action.payload);\r\n yield put(actions.initUserAttributesDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initUserAttributesDetails_Error(error));\r\n }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(UserAttributesApi.initUpdateData, action.payload);\r\n yield put(actions.initUpdateUserAttributesDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initUpdateUserAttributesDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction) {\r\n const httpPayloads: IUserAttributesDto = ConvertEntityToModelUserAttributesDetails(\r\n action.payload,\r\n undefined,\r\n );\r\n try {\r\n const result = yield call(\r\n UserAttributesApi.insertUserAttributesDetails,\r\n httpPayloads,\r\n );\r\n let response: UserAttributesDetailsResponse = result as UserAttributesDetailsResponse;\r\n\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'userAttributesInsert',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'userAttributesInsert',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n if (response.Id) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'userAttributesInsert',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: true,\r\n itemName: i18next.t(translations.menu_UserAttributes),\r\n detailsType: RenderPageType.UserAttributesDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as UserAttributesDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as UserAttributesDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'userAttributesInsertSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.createUserAttributesDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'userAttributesInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createUserAttributesDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: UserAttributesDetailsState;\r\n original: UserAttributesDetailsState | undefined;\r\n }>,\r\n) {\r\n const httpPayloads: IUserAttributesDto = ConvertEntityToModelUserAttributesDetails(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n try {\r\n const results = yield call(\r\n UserAttributesApi.updateUserAttributesDetails,\r\n httpPayloads,\r\n );\r\n let response = results as UserAttributesDetailsResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'userAttributesUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'userAttributesUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'userAttributesUpdate',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: i18next.t(translations.menu_UserAttributes),\r\n detailsType: RenderPageType.UserAttributesDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as UserAttributesDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as UserAttributesDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateUserAttributesDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'userAttributesUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateUserAttributesDetails_Error(Error));\r\n }\r\n}\r\n\r\nexport function* userAttributesDetailsSaga() {\r\n yield takeLatest(actions.initUserAttributesDetails.type, doInitCreate);\r\n yield takeLatest(actions.initUpdateUserAttributesDetails.type, doInitUpdate);\r\n yield takeLatest(actions.createUserAttributesDetails.type, doCreate);\r\n yield takeLatest(actions.updateUserAttributesDetails.type, doUpdate);\r\n}\r\n","import {\r\n ConvertModelToEntityUserAttributesDetails,\r\n UserAttributesDetailsQStringParameters,\r\n UserAttributesDetailsState,\r\n UserAttributesState,\r\n} from './types';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { userAttributesDetailsSaga } from './saga';\r\n\r\nexport const initialState: UserAttributesState = {\r\n processing: false,\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'userAttributesDetail',\r\n initialState,\r\n reducers: {\r\n initUserAttributesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateUserAttributesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUserAttributesDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.createState.data = ConvertModelToEntityUserAttributesDetails(\r\n action.payload,\r\n );\r\n },\r\n initUpdateUserAttributesDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.updateState.data = ConvertModelToEntityUserAttributesDetails(\r\n action.payload,\r\n );\r\n },\r\n initUserAttributesDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n initUpdateUserAttributesDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n //====================================================================\r\n resetUpdateUserAttributesDetailsState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n resetCreateUserAttributesDetailsState(state, action: PayloadAction) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n //====================================================================\r\n updateUserAttributesDetails(\r\n state,\r\n action: PayloadAction<{\r\n current: UserAttributesDetailsState;\r\n original: UserAttributesDetailsState | undefined;\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateUserAttributesDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n },\r\n updateUserAttributesDetails_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n //====================================================================\r\n createUserAttributesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createUserAttributesDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.createState.processing = false;\r\n state.createState.hasErrors = action.payload.hasErrors;\r\n state.createState.completed = true;\r\n },\r\n createUserAttributesDetails_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n state.createState.hasErrors = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: userAttributesDetailsActions } = slice;\r\n\r\nexport const useUserAttributesDetailsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: userAttributesDetailsSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.userAttributesDetail || initialState;\r\n\r\nexport const selectUserAttributesDetails = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateUserAttributesDetails = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateUserAttributesDetailsCompleted = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateUserAttributesDetailsHasError = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateUserAttributesDetails = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateUserAttributesDetailsCompleted = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectUpdateUserAttributesDetailsHasError = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUserAttributesDetailsProcessing = createSelector(\r\n [selectUserAttributesDetails],\r\n state => state.processing,\r\n);\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UserAttributesDetailsState } from '../slice/types';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\n\r\nexport interface UserAttributesFormProps {\r\n initialValues: UserAttributesDetailsState;\r\n onSubmit: (item: UserAttributesDetailsState) => void;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n bindSubmitForm: any;\r\n}\r\n\r\nexport const UserAttributesForm = React.memo(function UserAttributesForm({\r\n initialValues,\r\n onSubmit,\r\n isEdit,\r\n isAdmin,\r\n bindSubmitForm,\r\n}: UserAttributesFormProps): JSX.Element {\r\n //SETTINGS\r\n const { t } = useTranslation();\r\n\r\n //STATES\r\n //const [ssoChanged, setSsoChanged] = useState(false);\r\n /* const [ssoAttributeChanged, setSsoAttributeChanged] = useState(\r\n false,\r\n ); */\r\n\r\n //FUNCTIONS\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n\r\n //check if the field's props (Disabled, Mandatory) can't be editted\r\n const isNotEditableField = () => {\r\n if (initialValues.Attribute === 'UserName') {\r\n return true;\r\n }\r\n if (initialValues.Attribute === 'Password') {\r\n return true;\r\n }\r\n if (initialValues.Attribute === 'Email') {\r\n return true;\r\n }\r\n if (initialValues.Attribute === 'UserGroup') {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n /* const handleFormChange = useCallback(\r\n (values, isValid, dirty, setValue) => {\r\n if (\r\n initialValues.Attribute === 'UserName' ||\r\n initialValues.Attribute === 'Password' ||\r\n initialValues.Attribute === 'Email' ||\r\n initialValues.Attribute === 'UserGroup'\r\n ) {\r\n setValue('Disabled', false, false);\r\n setValue('Mandatory', true, false);\r\n }\r\n /* if (ssoChanged) {\r\n if (values.SSO === true) {\r\n setValue('Mandatory', false, false);\r\n setValue('RegistrationForm', false, false);\r\n setValue('UserDetails', false, false);\r\n setValue('UserSidePanel', false, false);\r\n setValue('UserProfile', false, false);\r\n setValue('Order', 0, false);\r\n } else {\r\n setValue('SSOAttribute', '', false);\r\n setValue('Mandatory', false, false);\r\n }\r\n setSsoChanged(false);\r\n }\r\n if (ssoAttributeChanged) {\r\n if (values.SSOAttribute !== '') {\r\n setValue('Mandatory', true, false);\r\n } else {\r\n setValue('Mandatory', false, false);\r\n }\r\n setSsoAttributeChanged(false);\r\n } */\r\n // },\r\n // [initialValues.Attribute],\r\n //);\r\n\r\n //SCHEMA\r\n const userAttributesDetailsSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n Attribute: Yup.string().default('').notRequired().nullable(),\r\n AttributeLocalized: Yup.string()\r\n .default('')\r\n .nullable()\r\n .required()\r\n .label(i18next.t(translations.Attribute)),\r\n Disabled: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.Disabled)),\r\n SSO: Yup.boolean()\r\n .notRequired()\r\n .default(false)\r\n .nullable()\r\n .label(i18next.t(translations.SSO)),\r\n SSOAttribute: Yup.string()\r\n .label(i18next.t(translations.SSOAttribute))\r\n .when('SSO', {\r\n is: sso => sso === true,\r\n then: Yup.string().nullable().required(),\r\n otherwise: Yup.string().notRequired().nullable().default(''),\r\n }),\r\n Mandatory: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.Mandatory)),\r\n RegistrationForm: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.RegistrationForm)),\r\n UserDetails: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.UserDetails)),\r\n UserSidePanel: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.UserSidePanel)),\r\n UserProfile: Yup.boolean()\r\n .notRequired()\r\n .nullable()\r\n .default(false)\r\n .label(i18next.t(translations.UserProfile)),\r\n Order: Yup.number()\r\n .notRequired()\r\n .nullable()\r\n .default(0)\r\n .label(i18next.t(translations.Order)),\r\n },\r\n );\r\n\r\n //RENDER\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('Submitting: ', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n //console.log('User Attributes Details Errors: ', formik.errors);\r\n }\r\n return (\r\n <>\r\n \r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* \r\n setSsoChanged(true)}\r\n />\r\n \r\n \r\n setSsoAttributeChanged(true)}\r\n fullWidth\r\n />\r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n */}\r\n {/* \r\n \r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import Box from '@material-ui/core/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectHasNotSavedChanges,\r\n selectContinueToLink,\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { SaveFormButton } from './Actions/UserAttributesActions';\r\nimport { useUserAttributesDetailsSlice } from './slice';\r\nimport {\r\n selectUserAttributesDetailsProcessing,\r\n selectCreateUserAttributesDetailsCompleted,\r\n selectUpdateUserAttributesDetailsCompleted,\r\n selectCreateUserAttributesDetails,\r\n selectUpdateUserAttributesDetails,\r\n} from './slice/selectors';\r\nimport {\r\n UserAttributesDetailsQStringParameters,\r\n UserAttributesDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { UserAttributesForm } from './UserAttributesForm';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface UserAttributesDetailsProps extends SidePanelContentProps {\r\n queryParams: UserAttributesDetailsQStringParameters;\r\n}\r\n\r\nexport function UserAttributesDetails(\r\n props: UserAttributesDetailsProps,\r\n): JSX.Element {\r\n //PROPS\r\n const { queryParams, useSidePanel } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n //PERMISSIONS\r\n const User = useSelector(selectAuthenticatedUser);\r\n const IsAdmin =\r\n User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n //SLICES\r\n const { actions } = useUserAttributesDetailsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n //SELECTORS\r\n const publicUrl = useSelector(selectPublicUrl);\r\n //====================================================================\r\n const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const loading = useSelector(selectUserAttributesDetailsProcessing);\r\n //====================================================================\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const continueToOther = useSelector(selectContinueState);\r\n //====================================================================\r\n const requestCreateCompleted = useSelector(\r\n selectCreateUserAttributesDetailsCompleted,\r\n );\r\n const requestUpdateCompleted = useSelector(\r\n selectUpdateUserAttributesDetailsCompleted,\r\n );\r\n //====================================================================\r\n const createModel = useSelector(\r\n selectCreateUserAttributesDetails,\r\n shallowEqual,\r\n );\r\n const editModel = useSelector(\r\n selectUpdateUserAttributesDetails,\r\n shallowEqual,\r\n );\r\n const baseModel = createModel || editModel;\r\n //====================================================================\r\n\r\n //STATES\r\n const [edit, setEdit] = useState(false);\r\n const [busy, setBusy] = useState(false);\r\n const [requestCompleted, setRequestCompleted] = useState(\r\n undefined,\r\n );\r\n\r\n //REF\r\n const submitFormRef = useRef(null);\r\n\r\n //FUNCTIONS\r\n const bindSubmitForm = useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n\r\n const handleSaveClick = (e: any) => {\r\n handleSubmitForm(e);\r\n };\r\n\r\n const handleSubmit = useCallback(\r\n (values: UserAttributesDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateUserAttributesDetails({\r\n current: values,\r\n original: baseModel,\r\n }),\r\n );\r\n } else {\r\n let value = values as UserAttributesDetailsState;\r\n console.debug('Data: ', value);\r\n dispatch(actions.createUserAttributesDetails(values));\r\n }\r\n },\r\n [actions, baseModel, dispatch, edit],\r\n );\r\n\r\n const handleCancelClick = useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/UserAttributes'));\r\n }\r\n if (edit) {\r\n dispatch(actions.resetUpdateUserAttributesDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateUserAttributesDetailsState());\r\n }\r\n }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n const handleClose = () => {\r\n if (hasUnsavedChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n\r\n //USE EFFECT ON MOUNT\r\n useEffectOnMount(() => {\r\n if (\r\n queryParams.id !== undefined &&\r\n !isNaN(parseInt(queryParams.id || ''))\r\n ) {\r\n dispatch(actions.initUpdateUserAttributesDetails(queryParams));\r\n } else {\r\n dispatch(actions.initUserAttributesDetails(queryParams));\r\n }\r\n setBusy(false);\r\n setEdit(false);\r\n setRequestCompleted(undefined);\r\n return () => {};\r\n });\r\n\r\n //USE EFFECT\r\n useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n setEdit(true);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n handleCancelClick();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n handleCancelClick,\r\n loading,\r\n queryParams.id,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n ]);\r\n\r\n //USE EFFECT 2\r\n useEffect(() => {\r\n if (confirmApproved) {\r\n if (edit) {\r\n dispatch(actions.resetUpdateUserAttributesDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateUserAttributesDetailsState());\r\n }\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n\r\n //LEFT ACTIONS\r\n const leftActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RIGHT ACTIONS\r\n const rightActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n />\r\n {hasUnsavedChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.Enums.Priorities\r\n *\r\n */\r\n\r\nexport enum Priorities {\r\n Lowest = 0,\r\n Low = 1,\r\n Medium = 2,\r\n High = 3,\r\n Highest = 4,\r\n}\r\nexport type PrioritiesUnion = keyof typeof Priorities;\r\nexport const PrioritiesUnionArray: Array = [\r\n 'Lowest',\r\n 'Low',\r\n 'Medium',\r\n 'High',\r\n 'Highest',\r\n];\r\n","import { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\nimport { TFunction } from 'i18next';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface IServiceRequestTicketEdit {\r\n AssignedTo?: IUserBaseDto;\r\n Status?: IServiceRequestStatusDto;\r\n Priority?: PrioritiesUnion;\r\n ParentTicketId?: number | null;\r\n SamplesCount?: number | null;\r\n}\r\n\r\nexport type ServiceRequestSubTicketSchema = Pick<\r\n IServiceRequestTicketDto,\r\n 'AssignedTo' | 'Priority' | 'Status' | 'SamplesCount'\r\n>;\r\nexport const getInitialValues = (\r\n item: IServiceRequestTicketDto,\r\n t: TFunction,\r\n) => ({\r\n AssignedTo: item.AssignedTo,\r\n Status: item.Status,\r\n Priority: item.Priority,\r\n ParentTicketId: item.ParentTicketId,\r\n SamplesCount: item.ParentTicketId === null ? undefined : item.SamplesCount,\r\n});\r\n\r\nexport const getTicketSchema = (\r\n t: TFunction,\r\n item: IServiceRequestTicketDto,\r\n samplesAutomationEnabled: boolean,\r\n): Yup.SchemaOf => {\r\n const base = {\r\n AssignedTo: Yup.mixed().optional(),\r\n Priority: Yup.mixed().required(),\r\n Status: Yup.mixed().required(),\r\n ParentTicketId: Yup.number().optional().nullable(),\r\n };\r\n const isSubTicket =\r\n item.ParentTicketId !== null &&\r\n item.ParentTicketId !== undefined &&\r\n !isNaN(item.ParentTicketId);\r\n if (!isSubTicket) {\r\n return Yup.object({\r\n ...base,\r\n SamplesCount: Yup.number().optional(),\r\n });\r\n } else {\r\n const parentSamplesCount = item.ParentTicket?.SamplesCount ?? 0;\r\n const samplesRequired = samplesAutomationEnabled && parentSamplesCount > 0;\r\n const max = parentSamplesCount + (item.SamplesCount ?? 0);\r\n return Yup.object({\r\n ...base,\r\n SamplesCount: samplesRequired\r\n ? Yup.number().required().min(0).max(max)\r\n : Yup.number().optional(),\r\n });\r\n }\r\n};\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\n\r\nimport {\r\n PrioritiesUnion,\r\n PrioritiesUnionArray,\r\n} from 'api/odata/generated/enums/Priorities';\r\nimport {\r\n EnumPicker,\r\n withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport const PriorityPicker = withEnumOptions(\r\n PrioritiesUnionArray,\r\n)(EnumPicker);\r\n","/**\r\n *\r\n * FormPriorityPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { PriorityPicker } from '../pickers/StaticOptionsPickers/PriorityPicker';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\n\r\nexport const FormPriorityPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * FormServiceRequestStatusPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ServiceRequestStatusPicker } from '../pickers/AutocompletePickers/ServiceRequestStatusPicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\ntype optionType = IServiceRequestStatusDto;\r\nexport const FormServiceRequestStatusPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n predicates={props.predicates}\r\n />\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { Formik } from 'formik';\r\nimport * as Yup from 'yup';\r\nimport {\r\n FormFieldsSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormPriorityPicker } from 'app/components/Forms/FormPriorityPicker';\r\nimport { FormServiceRequestStatusPicker } from 'app/components/Forms/FormServiceRequestStatusPicker';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestTicketEdit } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\ninterface FormProps {\r\n schema: Yup.SchemaOf;\r\n initialValues: IServiceRequestTicketEdit;\r\n item: Partial;\r\n onSubmit: (values: IServiceRequestTicketEdit) => void;\r\n onCancel: () => void;\r\n processing: boolean;\r\n}\r\nexport const Form = ({\r\n schema,\r\n initialValues,\r\n onSubmit,\r\n onCancel,\r\n processing,\r\n item,\r\n}: FormProps) => {\r\n const { t } = useTranslation();\r\n\r\n const samplesAutomationEnabled = useSelector(state =>\r\n selectKnownModule(state, KnownModules.SamplesAutomation),\r\n );\r\n return (\r\n \r\n {formik => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {samplesAutomationEnabled &&\r\n item.ParentTicketId !== null &&\r\n item.SamplesCount !== undefined && (\r\n \r\n \r\n \r\n )}\r\n\r\n \r\n }\r\n disabled={processing}\r\n processing={processing}\r\n >\r\n {t(translations.Submit)}\r\n \r\n }\r\n color=\"default\"\r\n onClick={onCancel}\r\n disabled={processing}\r\n variant=\"ghost\"\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * ServiceRequestTicketDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n IServiceRequestTicketEdit,\r\n getInitialValues,\r\n getTicketSchema,\r\n} from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { useServiceRequestsKanbanSlice } from 'app/pages/ServiceRequestsKanbanPage/slice';\r\n\r\nimport { Form } from '../Form';\r\nimport { Dto } from 'app/pages/ServiceRequestsKanbanPage/slice/types';\r\nimport { selectServiceRequestsKanbanProcessingInsert } from 'app/pages/ServiceRequestsKanbanPage/slice/selectors';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { omit } from 'lodash';\r\n\r\nexport interface AddSubTicketProps {\r\n parentTicket: IServiceRequestTicketDto;\r\n useSidePanel: boolean;\r\n}\r\nexport function AddSubTicket({ parentTicket, ...props }: AddSubTicketProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useServiceRequestsKanbanSlice();\r\n const processing = useSelector(selectServiceRequestsKanbanProcessingInsert);\r\n const samplesAutomationEnabled = useSelector(state =>\r\n selectKnownModule(state, KnownModules.SamplesAutomation),\r\n );\r\n\r\n const schema = React.useMemo(\r\n () =>\r\n getTicketSchema(\r\n t,\r\n {\r\n Id: 0,\r\n AssignedTo: parentTicket.AssignedTo,\r\n AssignedTo_Id: parentTicket.AssignedTo_Id,\r\n Index: parentTicket.Index + 1,\r\n Priority: parentTicket.Priority,\r\n SamplesCount: null,\r\n ServiceRequest: parentTicket.ServiceRequest,\r\n ServiceRequestId: parentTicket.ServiceRequestId,\r\n ServiceRequestStatusId: parentTicket.ServiceRequestStatusId,\r\n Status: parentTicket.Status,\r\n SubSamplesCount: parentTicket.SubSamplesCount,\r\n TotalSamplesCount: parentTicket.TotalSamplesCount,\r\n ParentTicketId: parentTicket.Id,\r\n ParentTicket: parentTicket,\r\n },\r\n samplesAutomationEnabled,\r\n ),\r\n [parentTicket, samplesAutomationEnabled, t],\r\n );\r\n const initialValues = React.useMemo(\r\n () =>\r\n getInitialValues(\r\n {\r\n ParentTicketId: parentTicket.Id,\r\n AssignedTo: parentTicket.AssignedTo,\r\n Status: parentTicket.Status,\r\n Priority: parentTicket.Priority,\r\n } as Dto,\r\n t,\r\n ),\r\n [parentTicket, t],\r\n );\r\n const handleSubmit = React.useCallback(\r\n (values: IServiceRequestTicketEdit) => {\r\n dispatch(\r\n actions.insert({\r\n ...values,\r\n ParentTicket: parentTicket,\r\n // insert after the parent ticket\r\n Index: parentTicket.Index + 1,\r\n ServiceRequestId: parentTicket.ServiceRequestId,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, parentTicket],\r\n );\r\n const item: Partial = {\r\n ...omit(parentTicket, 'Id', 'SamplesCount'),\r\n ParentTicketId: parentTicket.Id,\r\n SamplesCount: parentTicket.SamplesCount,\r\n };\r\n\r\n const handleCancel = () => dispatch(actions.showAddSubTicket());\r\n\r\n const title = t(translations.AddSubServiceRequestTicket);\r\n\r\n return (\r\n \r\n <>\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ServiceRequestTicketDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { getInitialValues, getTicketSchema } from './schema';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { IServiceRequestTicketEdit } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { useServiceRequestsKanbanSlice } from 'app/pages/ServiceRequestsKanbanPage/slice';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\nimport { Form } from './components/Form';\r\nimport {\r\n selectEdit,\r\n selectServiceRequestsKanbanProcessingUpdate,\r\n selectShowAddSubTicket,\r\n} from 'app/pages/ServiceRequestsKanbanPage/slice/selectors';\r\nimport { AddSubTicket } from './components/AddSubTicket';\r\nimport { Comments } from 'app/components/Comments';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { getServiceRequestTicketTitle } from 'app/pages/ServiceRequestsKanbanPage/components/getServiceRequestTicketTitle';\r\nimport { ParentTicketDetailsButton } from 'app/pages/ServiceRequestsKanbanPage/components/ParentTicketDetailsButton';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport interface ServiceRequestTicketDetailsProps {\r\n item: IServiceRequestTicketDto;\r\n useSidePanel: boolean;\r\n}\r\nexport function ServiceRequestTicketDetails({\r\n item,\r\n ...props\r\n}: ServiceRequestTicketDetailsProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useServiceRequestsKanbanSlice();\r\n const showAddSubTicket = useSelector(selectShowAddSubTicket);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const samplesAutomationEnabled = useSelector(state =>\r\n selectKnownModule(state, KnownModules.SamplesAutomation),\r\n );\r\n const processing = useSelector(selectServiceRequestsKanbanProcessingUpdate);\r\n const editState = useSelector(selectEdit);\r\n const editItem = editState.value;\r\n const enableAddSubTicket =\r\n !samplesAutomationEnabled || (editItem?.SamplesCount ?? 0) > 0;\r\n\r\n const handleAddSubTicketClick = React.useCallback(() => {\r\n dispatch(actions.showAddSubTicket(editItem));\r\n }, [actions, dispatch, editItem]);\r\n const rightTopActions: ActionRenderer[] = React.useMemo(() => {\r\n const result: ActionRenderer[] = [];\r\n if (editItem?.ParentTicketId === null) {\r\n result.push(() => (\r\n \r\n ));\r\n } else {\r\n result.push(() => );\r\n }\r\n return result;\r\n }, [editItem, handleAddSubTicketClick, enableAddSubTicket, t]);\r\n\r\n const schema = React.useMemo(\r\n () =>\r\n editItem === undefined\r\n ? undefined\r\n : getTicketSchema(t, editItem, samplesAutomationEnabled),\r\n [editItem, samplesAutomationEnabled, t],\r\n );\r\n const initialValues = React.useMemo(\r\n () => getInitialValues(editItem as IServiceRequestTicketDto, t),\r\n [editItem, t],\r\n );\r\n const handleSubmit = React.useCallback(\r\n (values: IServiceRequestTicketEdit) => {\r\n const updated: Partial = {\r\n ...editItem,\r\n ...{\r\n AssignedTo: values.AssignedTo,\r\n Status: values.Status,\r\n Priority: values.Priority,\r\n SamplesCount: values.SamplesCount,\r\n },\r\n };\r\n if (\r\n (updated as PartialExceptId).Id === undefined\r\n ) {\r\n return;\r\n }\r\n dispatch(\r\n actions.update(updated as PartialExceptId),\r\n );\r\n },\r\n [actions, dispatch, editItem],\r\n );\r\n\r\n const handleCancel = () => dispatch(layoutActions.resetSidePanel());\r\n const cover = React.useMemo(() => {\r\n return (\r\n showAddSubTicket &&\r\n editItem !== undefined && (\r\n \r\n )\r\n );\r\n }, [editItem, showAddSubTicket]);\r\n const isAdmin = React.useMemo(\r\n () =>\r\n (editItem !== undefined &&\r\n authenticatedUser?.IsAdminOf({\r\n ServiceGroupId: editItem.ServiceRequest.Service.ServiceGroup.Id,\r\n ServiceId: editItem.ServiceRequest.Service.Id,\r\n ServiceTypeId: ServiceType.Sample,\r\n })) ??\r\n false,\r\n [authenticatedUser, editItem],\r\n );\r\n const title =\r\n editItem === undefined ? undefined : getServiceRequestTicketTitle(editItem);\r\n const { onCommentAdded } = useUploadToNewComment();\r\n return (\r\n \r\n {schema !== undefined && editItem !== undefined && (\r\n <>\r\n \r\n\r\n {editItem.ParentTicketId === null && (\r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { StockRenewalState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n selectEditCreatableService,\r\n selectStockRenewalHasErrors,\r\n selectStockRenewalValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { BookQuickServices } from '../Details/components/BookQuickServices';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorsSummury } from 'app/components/Forms/FormsLayout/FormErrorSummury';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\n\r\nexport interface StockRenewalFormProps {\r\n onSubmit: (item: StockRenewalState) => void;\r\n onAddServiceClick: (services: number[]) => void;\r\n initialValues: StockRenewalState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n globalSettings: GlobalSettingsType;\r\n onRenewStockClick?: (service: IOtherServices) => void;\r\n editCreatable?: boolean;\r\n onAddBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n}\r\n\r\nexport const StockRenewalForm = React.memo(function StockRenewalForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isAdmin,\r\n user,\r\n globalSettings,\r\n innerFormRef,\r\n onRenewStockClick,\r\n onAddServiceClick,\r\n editCreatable,\r\n onAddBatchClick,\r\n}: StockRenewalFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n\r\n const fieldHandler = useSelector(selectStockRenewalValueHandler);\r\n const hasError = useSelector(selectStockRenewalHasErrors);\r\n const editCreatableService = useSelector(selectEditCreatableService);\r\n const { newDate } = useSystemDate();\r\n // const readonly = !isAdmin;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (values: StockRenewalState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values);\r\n validateForms(true);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetStockRenewalValueHandler());\r\n };\r\n\r\n /// Local State ///\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [\r\n recentMostBatchesChanged,\r\n setRecentMostBatchesChanged,\r\n ] = React.useState(false);\r\n const [allIsValid, setAllIsValid] = React.useState(true);\r\n const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n IOtherServices[]\r\n >(initialValues.Services ?? []);\r\n // const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n // IOfflineServiceFilterDto | undefined\r\n // >(initialValues.ServiceType ?? undefined);\r\n // const IsAdmin = React.useCallback(\r\n // (service: IOtherServices) => {\r\n // return user?.IsAllGroupOrLabTechAdmin(\r\n // [service.ServiceGroupId ?? 0],\r\n // [\r\n // {\r\n // Id: service.ServiceTypeID,\r\n // Name: service.ServiceType,\r\n // ServiceTypeId: ServiceType.Offline,\r\n // } as IServiceTypeFilterDto,\r\n // ],\r\n // );\r\n // },\r\n // [user],\r\n // );\r\n // const [errorMessages, setErrorMessages] = React.useState([]);\r\n // const addErrorMessages = React.useCallback((data: string[]) => {\r\n // if (data.length > 0) {\r\n // setErrorMessages([]);\r\n // messagesHandler(data, 'error', (nodes: IndexNode[]) =>\r\n // setErrorMessages(() => nodes),\r\n // );\r\n // }\r\n // }, []);\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: StockRenewalState,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (recentMostBatchesChanged) {\r\n setRecentMostBatchesChanged(false);\r\n }\r\n if (serviceChanged) {\r\n setServiceChanged(false);\r\n }\r\n },\r\n [recentMostBatchesChanged, serviceChanged],\r\n );\r\n const validateForms = React.useCallback((isValid: boolean) => {\r\n setAllIsValid(isValid);\r\n }, []);\r\n\r\n // useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n\r\n // React.useEffect(() => {\r\n // if (!!serviceChangeState) {\r\n // console.log('service settings: ', serviceSettings);\r\n // if (!!serviceChangeState) {\r\n // if (serviceSettings.budgetVisible) {\r\n // dispatch(\r\n // connectedFiltersActions.setConnectedValue({\r\n // fieldKey: 'Budget',\r\n // fieldValue: serviceChangeState.DefaultBudget,\r\n // }),\r\n // );\r\n // if (\r\n // serviceSettings.ReservationUserGroupGroupByBudgetUserGroup &&\r\n // serviceChangeState.DefaultBudget !== null\r\n // ) {\r\n // dispatch(\r\n // connectedFiltersActions.setConnectedValue({\r\n // fieldKey: 'UserGroup',\r\n // fieldValue: {\r\n // Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n // Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n // },\r\n // }),\r\n // );\r\n // }\r\n // if (\r\n // serviceSettings.budgetExpirementVisible &&\r\n // serviceChangeState.DefaultExperiment !== null\r\n // ) {\r\n // dispatch(\r\n // connectedFiltersActions.setConnectedValue({\r\n // fieldKey: 'BudgetExperiment',\r\n // fieldValue: serviceChangeState.DefaultExperiment,\r\n // }),\r\n // );\r\n // }\r\n // } else {\r\n // if (serviceSettings.isUserGroupCoordinator) {\r\n // dispatch(\r\n // connectedFiltersActions.setConnectedValue({\r\n // fieldKey: 'UserGroup',\r\n // fieldValue: {\r\n // Id: user?.ActiveUserGroup?.Id,\r\n // Name: user?.ActiveUserGroup?.Name,\r\n // },\r\n // }),\r\n // );\r\n // }\r\n // }\r\n // }\r\n // dispatch(actions.resetServiceChangeState());\r\n // }\r\n // }, [\r\n // actions,\r\n // connectedFiltersActions,\r\n // dispatch,\r\n // serviceChangeState,\r\n // serviceSettings,\r\n // user?.ActiveUserGroup?.Id,\r\n // user?.ActiveUserGroup?.Name,\r\n // ]);\r\n React.useEffect(() => {\r\n dispatch(\r\n actions.setStockRenewalValue({\r\n fieldKey: 'Services',\r\n fieldValue: servicesSelected,\r\n }),\r\n );\r\n }, [actions, dispatch, servicesSelected]);\r\n\r\n const otherServicesSchema = Yup.array().of(\r\n Yup.mixed() as Yup.SchemaOf,\r\n );\r\n const changeOfflineServices = React.useCallback(\r\n (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n if (operation === 'add') {\r\n let addedServ = services.filter(\r\n f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n setServicesSelected([...servicesSelected, ...addedServ]);\r\n setServiceChanged(true);\r\n }\r\n if (operation === 'remove') {\r\n let otherServices = servicesSelected.filter(f => {\r\n return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServicesSelected(otherServices);\r\n setServiceChanged(true);\r\n }\r\n if (operation === 'update') {\r\n setServicesSelected(\r\n servicesSelected.map(f => {\r\n let service = services.find(\r\n s => s.ServiceTypeID === f.ServiceTypeID,\r\n );\r\n if (!!service && service !== null) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n );\r\n }\r\n },\r\n [servicesSelected, setServicesSelected],\r\n );\r\n const stockRenwevalSchema: Yup.SchemaOf = Yup.object({\r\n Services: otherServicesSchema\r\n .min(1)\r\n .label(t(translations.Consumables) as string)\r\n .required(t(translations.err_OfflineServiceTypeRequired) as string),\r\n DateReceived: Yup.date()\r\n .default(newDate())\r\n .label(t(translations.DateReceived) as string)\r\n .required(t(translations.err_DateReceived_required) as string),\r\n AutoGenerateNewBatches: Yup.boolean()\r\n .nullable()\r\n .default(true)\r\n .label(t(translations.AutoGenerateNewBatches) as string),\r\n });\r\n const initServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n resolve(servicesSelected);\r\n });\r\n };\r\n const prepareService = (\r\n serviceType: IOfflineServiceFilterDto,\r\n otherData?: StockRenewalState,\r\n ) => {\r\n let batch =\r\n otherData?.AutoGenerateNewBatches === false\r\n ? serviceType.InventoryBatches.length > 0\r\n ? serviceType.InventoryBatches.sort((a, b) => b.Id - a.Id)[0]\r\n : null\r\n : null;\r\n let data = {\r\n Id: 0,\r\n BookedBy: user?.Id,\r\n UserDisplayName: user?.Name,\r\n BudgetID: null,\r\n Budget: null,\r\n Quantity: serviceType.DefaultQuantity,\r\n DefaultQuantity: serviceType.DefaultQuantity,\r\n IntQuantityOnly: serviceType.IntQuantityOnly,\r\n DiscountFactor: 1,\r\n Mandatory: false,\r\n Remarks: t(translations.StockRenewal) as string,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(otherData?.DateReceived ?? newDate()),\r\n ),\r\n TrackInventory: serviceType.TrackInventory,\r\n ServiceTypeID: serviceType.Id,\r\n ServiceType: serviceType.Name,\r\n ServiceGroupId: serviceType.ServiceGroupId,\r\n Units: serviceType.UnitTypeName,\r\n UserGroup: user?.ActiveUserGroup?.Id,\r\n UserGroupName: user?.ActiveUserGroup?.Name,\r\n AllowToUser: serviceType.AllowToUser,\r\n BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n StaffOnly: serviceType.StaffOnly,\r\n InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n RenewStockInventory: true,\r\n AutoGenerateNewBatches: otherData?.AutoGenerateNewBatches ?? true,\r\n } as IOtherServices;\r\n return data;\r\n };\r\n const createService = (values: StockRenewalState) => async (\r\n serviceType: IOfflineServiceFilterDto,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticService = prepareService(serviceType, values);\r\n changeOfflineServices([staticService], 'add');\r\n resolve(staticService);\r\n });\r\n };\r\n const createServices = (values: StockRenewalState) => async (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticServices = serviceTypes.map(f => prepareService(f, values));\r\n changeOfflineServices(staticServices, 'add');\r\n resolve(staticServices);\r\n });\r\n };\r\n const onRemoveService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'remove');\r\n resolve(service);\r\n });\r\n };\r\n const onRemoveServices = async (services: IOtherServices[]) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices(services, 'remove');\r\n resolve(services);\r\n });\r\n };\r\n const onUpdateService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'update');\r\n resolve(service);\r\n });\r\n };\r\n const onAddAndRemoveServices = (values: StockRenewalState) => async (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n removed: IOtherServices[],\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticServices = serviceTypes.map(f => prepareService(f, values));\r\n let addedServ = staticServices.filter(\r\n f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n let otherServices = servicesSelected.filter(f => {\r\n return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServicesSelected([...otherServices, ...addedServ]);\r\n setServiceChanged(true);\r\n resolve([...otherServices, ...addedServ]);\r\n });\r\n };\r\n const loadServiceTypes = async (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n predicates,\r\n 'base',\r\n [],\r\n undefined,\r\n 'InventoryBatches',\r\n )(searchTerm, undefined);\r\n resolve(data.value);\r\n } catch (error) {\r\n resolve([]);\r\n }\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n if (\r\n !!editCreatableService &&\r\n servicesSelected.some(\r\n f => f.ServiceTypeID === editCreatableService.ServiceTypeID,\r\n )\r\n ) {\r\n changeOfflineServices([editCreatableService], 'update');\r\n dispatch(actions.setEditCreatableService(undefined));\r\n dispatch(actions.setRefreshConsumableOfflineServices(true));\r\n }\r\n }, [\r\n actions,\r\n changeOfflineServices,\r\n dispatch,\r\n editCreatableService,\r\n servicesSelected,\r\n ]);\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n if (allIsValid) {\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else if (\r\n values.AutoGenerateNewBatches === false &&\r\n values.Services.some(\r\n f => f.InventoryBatchesEnabled && f.InventoryBatchId === null,\r\n )\r\n ) {\r\n // addErrorMessages([\r\n // `No batch associated with ${\r\n // values.Services.filter(\r\n // f =>\r\n // f.InventoryBatchesEnabled &&\r\n // f.InventoryBatchId === null,\r\n // )[0].ServiceType\r\n // }`,\r\n // ]);\r\n formikHelpers.setErrors({\r\n Services: `No batch associated with ${\r\n values.Services.filter(\r\n f =>\r\n f.InventoryBatchesEnabled &&\r\n f.InventoryBatchId === null,\r\n )[0].ServiceType\r\n }`,\r\n });\r\n formikHelpers.setSubmitting(false);\r\n } else if (values.Services.length < 1) {\r\n // addErrorMessages([\r\n // t(translations.err_OfflineServiceTypeRequired) as string,\r\n // ]);\r\n formikHelpers.setErrors({\r\n Services: t(\r\n translations.err_OfflineServiceTypeRequired,\r\n ) as string,\r\n });\r\n formikHelpers.setSubmitting(false);\r\n }\r\n // else if (errorMessages.length > 0) {\r\n // console.debug('errors', errorMessages);\r\n // formikHelpers.setSubmitting(false);\r\n // }\r\n else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n } else {\r\n formikHelpers.setSubmitting(false);\r\n }\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Consumables errors', formik.errors);\r\n }\r\n console.log('Consumables submitting', formik.isSubmitting);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 0 &&\r\n !formik.values.Services.some(\r\n f => f.InventoryBatchesEnabled,\r\n )\r\n }\r\n >\r\n 1\r\n ? t(\r\n translations.AutoGenerateNewBatchesDisabled_info,\r\n )\r\n : t(translations.AutoGenerateNewBatches_info)\r\n }\r\n label={t(translations.AutoGenerateNewBatches)}\r\n disabled={\r\n formik.isSubmitting || servicesSelected.length > 0\r\n }\r\n onChange={() => setRecentMostBatchesChanged(true)}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n selectStockRenewalCompleted,\r\n selectStockRenewalData,\r\n selectStockRenewalHasErrors,\r\n selectStockRenewalProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n RenewStockState,\r\n StockRenewalParams,\r\n StockRenewalState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Roles, ScanTarget } from 'app/slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { StockRenewalForm } from './StockRenewalForm';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface StockRenewalProps extends CoverProps, SidePanelContentProps {\r\n queryParams: StockRenewalParams;\r\n initialServices: IOtherServices[];\r\n onClose?: () => void;\r\n}\r\nexport const StockRenewal = React.memo(function StockRenewal(\r\n props: StockRenewalProps,\r\n) {\r\n const {\r\n useSidePanel,\r\n queryParams,\r\n initialServices,\r\n closeCover,\r\n isCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const processing = useSelector(selectStockRenewalProcessing);\r\n const actionCompleted = useSelector(selectStockRenewalCompleted);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const hasError = useSelector(selectStockRenewalHasErrors);\r\n const stockRenewalServicesData = useSelector(selectStockRenewalData);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n // const { checkIsMobile } = useIsMobile();\r\n // const mobile = checkIsMobile();\r\n const globalSettings = useGlobalSettingsHook();\r\n //Local State\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(\r\n () => {\r\n dispatch(actions.resetStockRenewalState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n const [busy, setBusy] = React.useState(false);\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n // const [submitAllowed, setSubmitAllowed] = React.useState(\r\n // false,\r\n // );\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n\r\n //Refs\r\n const submitFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(null);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n const assetsFilter = React.useMemo(() => {\r\n const userGroups = User?.AdminServiceGroups.map(f => f.Id);\r\n let filter: (string | Condition)[] | undefined = [];\r\n filter.push(\r\n new Condition(\r\n 'TrackInventory',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n filter.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n userGroups || [],\r\n ),\r\n );\r\n return filter.length > 0 ? filter : undefined;\r\n }, [User?.AdminServiceGroups]);\r\n //Methods\r\n\r\n const handleCloselClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n dispatch(actions.resetStockRenewalState());\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/otherServices'));\r\n }\r\n }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: StockRenewalState) => {\r\n setBusy(true);\r\n dispatch(actions.createStockRenewals(values));\r\n },\r\n [actions, dispatch],\r\n );\r\n const onRenewStockClick = React.useCallback(\r\n (service: IOtherServices) => {\r\n let renewProps = {\r\n initialService: service,\r\n editCreatable: true,\r\n queryParams: {\r\n id: '' + service.Id ?? -1,\r\n },\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.RenewStock,\r\n renderPageProps: renewProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const onAddBatchClick = React.useCallback(\r\n (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n let batchProps = {\r\n initialBatch: batch ?? undefined,\r\n saveCreatable: true,\r\n queryParams: {\r\n id: '' + (batch?.Id ?? -1),\r\n stid: '' + serviceType,\r\n },\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.InventoryBatch,\r\n renderPageProps: batchProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const onAddServiceClick = React.useCallback(\r\n (services: number[]) => {\r\n let selParams = {\r\n actionType: 'OfflineService',\r\n offTypeIds: services,\r\n customPredicates: assetsFilter,\r\n } as AssetsSelectionProps;\r\n openPanel({\r\n renderPageType: RenderPageType.AssetsSelection,\r\n renderPageProps: selParams,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [assetsFilter, openPanel, useSidePanel],\r\n );\r\n //effects\r\n useEffectOnMount(() => {\r\n dispatch(\r\n appSettingsActions.setBarcodeScannigTarget(ScanTarget.Consumables),\r\n );\r\n return () => {\r\n dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.All));\r\n };\r\n });\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initStockRenewal({\r\n query: queryParams,\r\n services: initialServices,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n firstLoad,\r\n globalSettings,\r\n initialServices,\r\n queryParams,\r\n ]);\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n dispatch,\r\n handleCloselClick,\r\n hasError,\r\n layoutActions,\r\n processing,\r\n ]);\r\n\r\n // React.useEffect(() => {\r\n // setSubmitAllowed(\r\n // !!stockRenewalServicesData &&\r\n // stockRenewalServicesData.Services.length > 0,\r\n // );\r\n // }, [setSubmitAllowed, stockRenewalServicesData]);\r\n //memo\r\n const IsAdmin = React.useMemo(() => {\r\n return !!innerFormRef.current &&\r\n innerFormRef.current.values.Services.length > 0\r\n ? User?.IsAllGroupOrLabTechAdmin(\r\n innerFormRef.current.values.Services.map(g => g.ServiceGroupId || 0),\r\n innerFormRef.current.values.Services.map(f => {\r\n return {\r\n Id: f.ServiceTypeId,\r\n Name: f.ServiceTypeName,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n )\r\n : false;\r\n }, [User]);\r\n const rightActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy} // || !submitAllowed\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n actions.push(() => (\r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n ));\r\n return actions;\r\n }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'stockRenewals', queryParams)}\r\n toPageLink={`stockRenewals?${toQueryString(queryParams)}`}\r\n isCover={isCover}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n coverClosed={coverClosed}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { RenewStockState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n selectInventoryBatchEditable,\r\n selectRenewStockHasErrors,\r\n selectRenewStockValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { RenewStockRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormInventoryBatchPicker } from 'app/components/Forms/FormInventoryBatchPicker';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BatchesByServiceTypeFilter } from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\n\r\nexport interface RenewStockFormProps {\r\n onSubmit: (item: RenewStockState) => void;\r\n initialValues: RenewStockState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n globalSettings: GlobalSettingsType;\r\n isEdit: boolean;\r\n editCreatable?: boolean;\r\n onBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n}\r\n\r\nexport const RenewStockForm = React.memo(function RenewStockForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isAdmin,\r\n user,\r\n globalSettings,\r\n innerFormRef,\r\n isEdit,\r\n editCreatable,\r\n onBatchClick,\r\n}: RenewStockFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n\r\n const fieldHandler = useSelector(selectRenewStockValueHandler);\r\n const hasError = useSelector(selectRenewStockHasErrors);\r\n const batchRequested = useSelector(selectInventoryBatchEditable);\r\n const { newDate } = useSystemDate();\r\n // const readonly = !isAdmin;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (values: RenewStockState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetRenewStockValueHandler());\r\n };\r\n\r\n /// Local State ///\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [batchChanged, setBatchChanged] = React.useState(false);\r\n\r\n const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n IOfflineServiceFilterDto | undefined\r\n >(initialValues.ServiceType ?? undefined);\r\n const minStep = React.useMemo(() => {\r\n return !!serviceTypeSelected\r\n ? serviceTypeSelected.IntQuantityOnly === true\r\n ? 1\r\n : 0.01\r\n : 1;\r\n }, [serviceTypeSelected]);\r\n const step = React.useMemo(() => {\r\n return !!serviceTypeSelected\r\n ? serviceTypeSelected.IntQuantityOnly === true\r\n ? 1\r\n : 0.01\r\n : 1;\r\n }, [serviceTypeSelected]);\r\n\r\n const maxStep = 9999;\r\n const inputProps = {\r\n step: step,\r\n min: minStep,\r\n max: maxStep,\r\n 'aria-label': 'Counter',\r\n };\r\n\r\n // const IsAdmin = React.useCallback(\r\n // (service: IOfflineServiceFilterDto) => {\r\n // return user?.IsAllGroupOrLabTechAdmin(\r\n // [service.ServiceGroupId ?? 0],\r\n // [\r\n // {\r\n // Id: service.Id,\r\n // Name: service.Name,\r\n // ServiceTypeId: ServiceType.Offline,\r\n // } as IServiceTypeFilterDto,\r\n // ],\r\n // );\r\n // },\r\n // [user],\r\n // );\r\n\r\n const handleFormChange = React.useCallback(\r\n (values: RenewStockState) => {\r\n if (serviceChanged) {\r\n setServiceTypeSelected(values.ServiceType ?? undefined);\r\n // dispatch(\r\n // connectedFiltersActions.extendSettingsState({\r\n // services:\r\n // values.Services.length < 1\r\n // ? []\r\n // : values.Services.map(f => {\r\n // return {\r\n // Id: f.ServiceTypeId,\r\n // Name: f.ServiceTypeName,\r\n // ServiceGroupId: f.ServiceGroupId,\r\n // ServiceTypeId: ServiceType.Offline,\r\n // Active: true,\r\n // BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n // HideProject: f.HideProjects,\r\n // } as IServiceTypeFilterDto;\r\n // }),\r\n // globalSettings: globalSettings,\r\n // settings: serviceSettings,\r\n // isEdit: false,\r\n // data: connectedData,\r\n // }),\r\n // );\r\n // if (values.Services.length > 0 && connectedData?.User !== null) {\r\n // const parameters = {\r\n // ServiceTypes: values.Services.map(f => f.ServiceTypeID),\r\n // ReservationId: null,\r\n // UsageId: null,\r\n // BookedBy: connectedData?.User?.Id || null,\r\n // ADGroup: connectedData?.UserGroup?.Id || null,\r\n // Start: dateUtils.formatISO(\r\n // dateUtils.dateOrStringToDate(\r\n // connectedData?.StartTime || newDate(),\r\n // ),\r\n // ),\r\n // BudgetId: connectedData?.Budget?.Id || null,\r\n // FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n // } as ServiceChangeStateParameters;\r\n // dispatch(actions.initServiceChangeStateData(parameters));\r\n // }\r\n //setServiceTypesSelected(values.Services);\r\n setServiceChanged(false);\r\n }\r\n if (batchChanged) {\r\n setBatchChanged(false);\r\n }\r\n },\r\n [batchChanged, serviceChanged, setServiceTypeSelected],\r\n );\r\n\r\n // useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n React.useEffect(() => {\r\n if (batchRequested !== undefined) {\r\n dispatch(\r\n actions.setRenewStockValue({\r\n fieldKey: 'InventoryBatch',\r\n fieldValue: batchRequested,\r\n }),\r\n );\r\n dispatch(actions.setInventoryBatchEditable(undefined));\r\n }\r\n }, [actions, batchRequested, dispatch]);\r\n\r\n const computedSchema = React.useMemo(() => {\r\n const renewStockSchema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().notRequired().default(-1),\r\n ServiceType: ServiceTypeSchema.nullable().required(\r\n t(translations.err_OfflineServiceTypeRequired),\r\n ),\r\n Quantity: Yup.number()\r\n .label(t(translations.Quantity) as string)\r\n .required(t(translations.err_Quantity_required))\r\n .nullable()\r\n .default(null)\r\n .max(maxStep)\r\n .min(minStep)\r\n .test(\r\n 'empty',\r\n t(translations.err_Quantity_required) as string,\r\n (value, context) => {\r\n let currVal = (context as any).from[0].value.Quantity;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal) ||\r\n currVal === 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n )\r\n .test(\r\n 'integerOnly',\r\n t(translations.err_IntQuantityOnly) as string,\r\n (value, context) => {\r\n let currVal = (context as any).from[0].value.Quantity;\r\n if (\r\n !!serviceTypeSelected &&\r\n serviceTypeSelected.IntQuantityOnly &&\r\n currVal % 1 !== 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n ),\r\n DateReceived: Yup.date()\r\n .default(newDate())\r\n .label(t(translations.DateReceived) as string)\r\n .required(t(translations.err_DateReceived_required) as string),\r\n Remarks: Yup.string()\r\n .nullable()\r\n .label(t(translations.Remarks) as string),\r\n InventoryBatch: (Yup.mixed() as Yup.SchemaOf)\r\n .nullable()\r\n .label(t(translations.Batch) as string),\r\n });\r\n if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n if (serviceTypeSelected?.NotLessThanZero) {\r\n if (serviceTypeSelected.Inventory === 0) {\r\n renewStockSchema.fields.Quantity.withMutation(schema =>\r\n schema\r\n .label(t(translations.Quantity) as string)\r\n .required(t(translations.err_Quantity_required))\r\n .default(null)\r\n .nullable()\r\n .max(maxStep)\r\n .min(minStep)\r\n .test(\r\n 'empty',\r\n t(translations.err_Quantity_required) as string,\r\n (value, context) => {\r\n let currVal = context.from[0].value.Quantity;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal) ||\r\n currVal === 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n )\r\n .test(\r\n 'minQuantWithZero',\r\n t(\r\n translations.NotAllowNegativeInventory_currentEqualsZero_err,\r\n ) as string,\r\n (value, context) => {\r\n let currVal = context.from[0].value.Quantity;\r\n let current = currVal as number;\r\n if (current < 1) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n ),\r\n );\r\n } else {\r\n renewStockSchema.fields.Quantity.withMutation(schema =>\r\n schema\r\n .label(t(translations.Quantity) as string)\r\n .required(t(translations.err_Quantity_required))\r\n .max(maxStep)\r\n .min(minStep)\r\n .test(\r\n 'empty',\r\n t(translations.err_Quantity_required) as string,\r\n (value, context) => {\r\n let currVal = context.from[0].value.Quantity;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal) ||\r\n currVal === 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n )\r\n .test(\r\n 'minQuant',\r\n (t(\r\n translations.NotAllowNegativeInventory_currentMoreThanZero_err,\r\n ) as string).replace(\r\n '{0}',\r\n serviceTypeSelected.Inventory.toString(),\r\n ),\r\n (value, context) => {\r\n let currVal = context.from[0].value.Quantity;\r\n let current = currVal as number;\r\n if (serviceTypeSelected.Inventory - current < 0) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n ),\r\n );\r\n }\r\n }\r\n if (serviceTypeSelected?.InventoryBatchesEnabled) {\r\n renewStockSchema.fields.InventoryBatch.withMutation(schema =>\r\n schema\r\n .label(t(translations.Batch) as string)\r\n .nullable()\r\n .required(t(translations.err_InventoryBatch_required) as string),\r\n );\r\n }\r\n }\r\n return renewStockSchema;\r\n }, [minStep, newDate, serviceTypeSelected, t]);\r\n\r\n // const loadServiceTypes = async (\r\n // searchTerm: string | null,\r\n // ): Promise => {\r\n // return new Promise(async (resolve, reject) => {\r\n // try {\r\n // const data = await loadOfflineServiceType(\r\n // undefined,\r\n // [],\r\n // undefined,\r\n // 'InventoryBatches',\r\n // )(searchTerm, undefined);\r\n // resolve(data.value);\r\n // } catch (error) {\r\n // resolve([]);\r\n // }\r\n // });\r\n // };\r\n\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Consumables errors', formik.errors);\r\n }\r\n console.log('Consumables submitting', formik.isSubmitting);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {editCreatable ? (\r\n \r\n \r\n {formik.values.ServiceType !== undefined &&\r\n formik.values.ServiceType !== null\r\n ? formik.values.ServiceType.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n ) : (\r\n \r\n {\r\n setServiceChanged(true);\r\n }}\r\n />\r\n \r\n )}\r\n \r\n {\r\n const precision =\r\n formik.values.ServiceType?.IntQuantityOnly === false\r\n ? 2\r\n : 0;\r\n const value = +(+event.target.value).toFixed(\r\n precision,\r\n );\r\n console.log('qyt', value);\r\n }}\r\n inputProps={inputProps}\r\n />\r\n \r\n \r\n \r\n \r\n {!!serviceTypeSelected &&\r\n serviceTypeSelected?.InventoryBatchesEnabled && (\r\n \r\n \r\n {\r\n setBatchChanged(true);\r\n }}\r\n predicates={BatchesByServiceTypeFilter(\r\n serviceTypeSelected.Id,\r\n )}\r\n />\r\n \r\n {formik.values.ServiceType !== null &&\r\n formik.values.ServiceType !== undefined && (\r\n \r\n \r\n onBatchClick(\r\n null,\r\n formik.values.ServiceType?.Id ?? 0,\r\n )\r\n }\r\n >\r\n {t(translations.AddNewBatch)}\r\n \r\n {formik.values.InventoryBatch !== null &&\r\n formik.values.InventoryBatch !==\r\n undefined && (\r\n \r\n onBatchClick(\r\n formik.values.InventoryBatch ?? null,\r\n formik.values.ServiceType?.Id ?? 0,\r\n )\r\n }\r\n >\r\n {t(translations.EditSelectedBatch)}\r\n \r\n )}\r\n \r\n )}\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n selectIsEdit,\r\n selectRenewStockCompleted,\r\n selectRenewStockData,\r\n selectRenewStockHasErrors,\r\n selectRenewStockProcessing,\r\n} from '../Details/slice/selectors';\r\nimport { RenewStockParams, RenewStockState } from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { RenewStockForm } from './RenewStockForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface RenewStockProps extends CoverProps, SidePanelContentProps {\r\n queryParams: RenewStockParams;\r\n initialService?: IOtherServices;\r\n editCreatable?: boolean;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n onClose?: () => void;\r\n}\r\nexport const RenewStock = React.memo(function RenewStock(\r\n props: RenewStockProps,\r\n) {\r\n const {\r\n useSidePanel,\r\n queryParams,\r\n initialService,\r\n editCreatable,\r\n preventRefreshTable,\r\n saveCreatable,\r\n isCover,\r\n closeCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const processing = useSelector(selectRenewStockProcessing);\r\n const actionCompleted = useSelector(selectRenewStockCompleted);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const hasError = useSelector(selectRenewStockHasErrors);\r\n const renewStockData = useSelector(selectRenewStockData);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const isEdit = useSelector(selectIsEdit);\r\n // const { checkIsMobile } = useIsMobile();\r\n // const mobile = checkIsMobile();\r\n const globalSettings = useGlobalSettingsHook();\r\n //Local State\r\n // const [cover, setCover] = React.useState();\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(\r\n () => {\r\n dispatch(actions.resetRenewStockState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n const [busy, setBusy] = React.useState(false);\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n\r\n //Refs\r\n const submitFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(null);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n\r\n //Methods\r\n // const closeCover = () => {\r\n // setCover(undefined);\r\n // };\r\n // const handleClose = () => {\r\n // if (hasChanges) {\r\n // dispatch(layoutActions.setConfirmOpen(true));\r\n // } else {\r\n // handleCloselClick();\r\n // }\r\n // };\r\n const handleCloselClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n dispatch(actions.resetRenewStockState());\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/otherServices'));\r\n }\r\n // if (!!onClose) {\r\n // onClose();\r\n // } else {\r\n // if (useSidePanel) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(push('/otherServices'));\r\n // }\r\n // }\r\n // dispatch(actions.resetRenewStockState());\r\n }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: RenewStockState) => {\r\n setBusy(true);\r\n if (isEdit) {\r\n dispatch(\r\n actions.updateRenewStock({\r\n current: values,\r\n original: renewStockData || values,\r\n editCreatable: editCreatable ?? false,\r\n autoGenerateBatch: initialService?.AutoGenerateNewBatches,\r\n }),\r\n );\r\n } else {\r\n dispatch(\r\n actions.createRenewStock({\r\n model: values,\r\n editCreatable: editCreatable ?? false,\r\n preventRefreshTable: preventRefreshTable,\r\n autoGenerateBatch: initialService?.AutoGenerateNewBatches,\r\n saveCreatable: saveCreatable,\r\n }),\r\n );\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n editCreatable,\r\n initialService?.AutoGenerateNewBatches,\r\n isEdit,\r\n preventRefreshTable,\r\n renewStockData,\r\n saveCreatable,\r\n ],\r\n );\r\n\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initRenewStock({\r\n query: queryParams,\r\n service: initialService,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n firstLoad,\r\n globalSettings,\r\n initialService,\r\n queryParams,\r\n ]);\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n dispatch,\r\n handleCloselClick,\r\n hasError,\r\n layoutActions,\r\n processing,\r\n ]);\r\n const onBatchClick = React.useCallback(\r\n (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n let batchProps = {\r\n initialBatch:\r\n batch?.OfflineServiceTypeId === undefined ? undefined : batch,\r\n queryParams: {\r\n id: '' + (batch?.Id ?? -1),\r\n stid: '' + serviceType,\r\n },\r\n saveCreatable: true,\r\n useSidePanel: true,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.InventoryBatch,\r\n renderPageProps: batchProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n // React.useEffect(() => {\r\n // if (confirmApproved) {\r\n // dispatch(actions.resetRenewStockState());\r\n // if (continueToOther.continueOnApprove) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // setTimeout(() => {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: continueToOther.pageType,\r\n // props: continueToOther.pageProps,\r\n // expanded: continueToOther.expanded,\r\n // }),\r\n // );\r\n // dispatch(layoutActions.resetContinueState());\r\n // }, 200);\r\n // } else if (continueLink !== undefined) {\r\n // dispatch(appSettingsActions.navigate(continueLink));\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // }\r\n // //dispatch(actions.setChangedState(false));\r\n // }\r\n // if (confirmRejected) {\r\n // dispatch(layoutActions.resetConfirmState());\r\n // }\r\n\r\n // return () => undefined;\r\n // }, [\r\n // actions,\r\n // appSettingsActions,\r\n // confirmApproved,\r\n // confirmRejected,\r\n // continueLink,\r\n // continueToOther,\r\n // dispatch,\r\n // layoutActions,\r\n // ]);\r\n\r\n //memo\r\n const IsAdmin = React.useMemo(() => {\r\n return !!innerFormRef.current &&\r\n innerFormRef.current.values.ServiceType !== null\r\n ? User?.IsAllGroupOrLabTechAdmin(\r\n [innerFormRef.current.values.ServiceType.ServiceGroupId],\r\n [\r\n {\r\n Id: innerFormRef.current.values.ServiceType.Id,\r\n Name: innerFormRef.current.values.ServiceType.Name,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IServiceTypeFilterDto,\r\n ],\r\n )\r\n : false;\r\n }, [User]);\r\n const rightActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={\r\n busy ||\r\n !(\r\n !!innerFormRef.current &&\r\n (innerFormRef.current.values.ServiceType ?? null) !== null\r\n )\r\n }\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n actions.push(() => (\r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n ));\r\n return actions;\r\n }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + '/renwestock', queryParams)}\r\n toPageLink={`renwestock?${toQueryString(queryParams)}`}\r\n isCover={isCover}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n coverClosed={coverClosed}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { InventoryBatchState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n selectInventoryBatchHasErrors,\r\n selectInventoryBatchValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { InventoryBatchRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface InventoryBatchFormProps {\r\n onSubmit: (item: InventoryBatchState) => void;\r\n initialValues: InventoryBatchState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n globalSettings: GlobalSettingsType;\r\n isEdit: boolean;\r\n}\r\n\r\nexport const InventoryBatchForm = React.memo(function InventoryBatchForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isAdmin,\r\n user,\r\n globalSettings,\r\n innerFormRef,\r\n isEdit,\r\n}: InventoryBatchFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n\r\n const fieldHandler = useSelector(selectInventoryBatchValueHandler);\r\n const hasError = useSelector(selectInventoryBatchHasErrors);\r\n const { newDate } = useSystemDate();\r\n // const readonly = !isAdmin;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (values: InventoryBatchState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetInventoryBatchValueHandler());\r\n };\r\n\r\n /// Local State ///\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [batchChanged, setBatchChanged] = React.useState(false);\r\n\r\n const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n IOfflineServiceFilterDto | undefined\r\n >(initialValues.ServiceType ?? undefined);\r\n const minStep = React.useMemo(() => {\r\n return !!serviceTypeSelected\r\n ? serviceTypeSelected.NotLessThanZero === true\r\n ? 0\r\n : -9999\r\n : -9999;\r\n }, [serviceTypeSelected]);\r\n const maxStep = 9999;\r\n const inputProps = {\r\n step: 1,\r\n min: minStep,\r\n max: maxStep,\r\n 'aria-label': 'Inventory',\r\n };\r\n\r\n // const IsAdmin = React.useCallback(\r\n // (service: IOfflineServiceFilterDto) => {\r\n // return user?.IsAllGroupOrLabTechAdmin(\r\n // [service.ServiceGroupId ?? 0],\r\n // [\r\n // {\r\n // Id: service.Id,\r\n // Name: service.Name,\r\n // ServiceTypeId: ServiceType.Offline,\r\n // } as IServiceTypeFilterDto,\r\n // ],\r\n // );\r\n // },\r\n // [user],\r\n // );\r\n\r\n const handleFormChange = React.useCallback(\r\n (values: InventoryBatchState) => {\r\n if (serviceChanged) {\r\n setServiceTypeSelected(values.ServiceType ?? undefined);\r\n setServiceChanged(false);\r\n }\r\n if (batchChanged) {\r\n setBatchChanged(false);\r\n }\r\n },\r\n [batchChanged, serviceChanged, setServiceTypeSelected],\r\n );\r\n\r\n // useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n\r\n const computedSchema = React.useMemo(() => {\r\n const inventoryBatchSchema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().notRequired().default(-1),\r\n Name: Yup.string()\r\n .label(t(translations.BatchName) as string)\r\n .required(t(translations.err_BatchName_required) as string),\r\n ServiceType: ServiceTypeSchema.nullable().required(\r\n t(translations.err_OfflineServiceTypeRequired),\r\n ),\r\n ExpirationDate: Yup.date()\r\n .label(t(translations.BatchExpirationDate) as string)\r\n .nullable()\r\n .default(null),\r\n PurchaseDate: Yup.date()\r\n .default(newDate())\r\n .label(t(translations.BatchPurchaseDate) as string)\r\n .required(t(translations.err_BatchPurchaseDate_required) as string),\r\n Inventory: Yup.number()\r\n .label(t(translations.BatchInventory) as string)\r\n .required(t(translations.err_BatchInventory_required) as string)\r\n .max(maxStep)\r\n .min(minStep)\r\n .default(0)\r\n .test(\r\n 'empty',\r\n t(translations.err_BatchInventory_required) as string,\r\n (value, context) => {\r\n let currVal = (context as any).from[0].value.Inventory;\r\n if (currVal === undefined || currVal === null || isNaN(currVal)) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n ),\r\n Lot: Yup.string()\r\n .nullable()\r\n .label(t(translations.BatchLot) as string),\r\n PurchasePricePerUnit: Yup.number()\r\n .label(t(translations.BatchPurchasePricePerUnit) as string)\r\n .nullable(true)\r\n .default(null),\r\n });\r\n\r\n if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n if (serviceTypeSelected?.NotLessThanZero) {\r\n inventoryBatchSchema.fields.Inventory.withMutation(schema =>\r\n schema\r\n .label(t(translations.BatchInventory) as string)\r\n .required(t(translations.err_BatchInventory_required))\r\n .max(maxStep)\r\n .min(minStep)\r\n .default(0)\r\n .test(\r\n 'empty',\r\n t(translations.err_BatchInventory_required) as string,\r\n (value, context) => {\r\n let currVal = context.from[0].value.Inventory;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal)\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n )\r\n .test(\r\n 'noLessThanZero',\r\n t(translations.NotAllowNegativeInventory_err) as string,\r\n (value, context) => {\r\n let currVal = context.from[0].value.Inventory;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal) ||\r\n currVal >= 0\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n },\r\n ),\r\n );\r\n }\r\n }\r\n return inventoryBatchSchema;\r\n }, [minStep, newDate, serviceTypeSelected, t]);\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Consumables errors', formik.errors);\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n setServiceChanged(true);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n const value = +(+event.target.value).toFixed(0);\r\n console.log('qyt', value);\r\n }}\r\n inputProps={inputProps}\r\n />\r\n \r\n \r\n {\r\n const value = +(+event.target.value).toFixed(2);\r\n console.log('qyt', value);\r\n }}\r\n inputProps={{\r\n step: 1,\r\n min: 0,\r\n 'aria-label': 'PurchasePricePerUnit',\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n selectInventoryBatchCompleted,\r\n selectInventoryBatchData,\r\n selectInventoryBatchHasErrors,\r\n selectInventoryBatchIsEdit,\r\n selectInventoryBatchProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n InventoryBatchParams,\r\n InventoryBatchState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { InventoryBatchForm } from './InventoryBatchForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface InventoryBatchProps extends CoverProps, SidePanelContentProps {\r\n queryParams: InventoryBatchParams;\r\n initialBatch?: IInventoryBatchDto;\r\n onClose?: () => void;\r\n saveCreatable?: boolean;\r\n preventRefreshTable?: boolean;\r\n}\r\nexport const InventoryBatch = React.memo(function InventoryBatch(\r\n props: InventoryBatchProps,\r\n) {\r\n const {\r\n useSidePanel,\r\n queryParams,\r\n initialBatch,\r\n saveCreatable,\r\n preventRefreshTable,\r\n closeCover,\r\n isCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const processing = useSelector(selectInventoryBatchProcessing);\r\n const actionCompleted = useSelector(selectInventoryBatchCompleted);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const hasError = useSelector(selectInventoryBatchHasErrors);\r\n const inventoryBatchData = useSelector(selectInventoryBatchData);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const isEdit = useSelector(selectInventoryBatchIsEdit);\r\n // const { checkIsMobile } = useIsMobile();\r\n // const mobile = checkIsMobile();\r\n const globalSettings = useGlobalSettingsHook();\r\n //Local State\r\n // const [cover, setCover] = React.useState();\r\n const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState(\r\n () => {\r\n dispatch(actions.resetInventoryBatchState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n const [busy, setBusy] = React.useState(false);\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n\r\n //Refs\r\n const submitFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(null);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n\r\n //Methods\r\n // const closeCover = () => {\r\n // setCover(undefined);\r\n // };\r\n // const handleClose = () => {\r\n // if (hasChanges) {\r\n // dispatch(layoutActions.setConfirmOpen(true));\r\n // } else {\r\n // handleCloselClick();\r\n // }\r\n // };\r\n const handleCloselClick = React.useCallback(() => {\r\n // if (!!onClose) {\r\n // onClose();\r\n // } else {\r\n // if (useSidePanel) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(push('/otherServices'));\r\n // }\r\n // }\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n dispatch(actions.resetInventoryBatchState());\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/otherServices'));\r\n }\r\n }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: InventoryBatchState) => {\r\n setBusy(true);\r\n if (isEdit) {\r\n dispatch(\r\n actions.updateInventoryBatch({\r\n current: values,\r\n original: inventoryBatchData || values,\r\n saveCreatable: saveCreatable,\r\n preventRefreshTable: preventRefreshTable,\r\n }),\r\n );\r\n } else {\r\n dispatch(\r\n actions.createInventoryBatch({\r\n model: values,\r\n saveCreatable: saveCreatable,\r\n preventRefreshTable: preventRefreshTable,\r\n }),\r\n );\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n inventoryBatchData,\r\n isEdit,\r\n preventRefreshTable,\r\n saveCreatable,\r\n ],\r\n );\r\n\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initInventoryBatch({\r\n query: queryParams,\r\n batch: initialBatch,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actions, dispatch, firstLoad, globalSettings, initialBatch, queryParams]);\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actionCompleted, handleCloselClick, hasError, processing]);\r\n // React.useEffect(() => {\r\n // if (confirmApproved) {\r\n // dispatch(actions.resetInventoryBatchState());\r\n // if (continueToOther.continueOnApprove) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // setTimeout(() => {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: continueToOther.pageType,\r\n // props: continueToOther.pageProps,\r\n // expanded: continueToOther.expanded,\r\n // }),\r\n // );\r\n // dispatch(layoutActions.resetContinueState());\r\n // }, 200);\r\n // } else if (continueLink !== undefined) {\r\n // dispatch(appSettingsActions.navigate(continueLink));\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // }\r\n // //dispatch(actions.setChangedState(false));\r\n // }\r\n // if (confirmRejected) {\r\n // dispatch(layoutActions.resetConfirmState());\r\n // }\r\n\r\n // return () => undefined;\r\n // }, [\r\n // actions,\r\n // appSettingsActions,\r\n // confirmApproved,\r\n // confirmRejected,\r\n // continueLink,\r\n // continueToOther,\r\n // dispatch,\r\n // layoutActions,\r\n // ]);\r\n\r\n //memo\r\n const IsAdmin = React.useMemo(() => {\r\n return !!innerFormRef.current &&\r\n innerFormRef.current.values.ServiceType !== null\r\n ? User?.IsAllGroupOrLabTechAdmin(\r\n [innerFormRef.current.values.ServiceType.ServiceGroupId],\r\n [\r\n {\r\n Id: innerFormRef.current.values.ServiceType.Id,\r\n Name: innerFormRef.current.values.ServiceType.Name,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IServiceTypeFilterDto,\r\n ],\r\n )\r\n : false;\r\n }, [User]);\r\n const rightActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={\r\n busy ||\r\n !(\r\n !!innerFormRef.current &&\r\n (innerFormRef.current.values.ServiceType ?? null) !== null\r\n )\r\n }\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n actions.push(() => (\r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n ));\r\n return actions;\r\n }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + '/inventoryBatch', queryParams)}\r\n toPageLink={`inventoryBatch?${toQueryString(queryParams)}`}\r\n isCover={isCover}\r\n cover={cover}\r\n coverClosed={coverClosed}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * ArticleAssociationForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport {\r\n selectArticleDetails,\r\n selectArticleDetailsForm,\r\n selectArticles,\r\n selectEditArticleAssociationBusy,\r\n} from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { GetCalibrationRecordFilter, GetInstrumentFilter } from '../utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { ArticleComments } from '../ArticleComments';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport interface ArticleAssociationFormProps\r\n extends SidePanelContentProps,\r\n CoverProps {}\r\nexport interface IArticleAssociationForm {\r\n RelatedUser: Entity | null;\r\n ServiceGroupAsset: IAssetDto | null;\r\n //ServiceGroupAssets: Array;\r\n InstrumentAssets: Array;\r\n CalibrationRecord: Entity | null;\r\n PageNumber?: number | null;\r\n}\r\n\r\nconst assetSchema = Yup.mixed();\r\nconst assetsSchema = Yup.array().of(Yup.mixed() as Yup.SchemaOf);\r\n\r\nexport function ArticleAssociationForm(props: ArticleAssociationFormProps) {\r\n const { useSidePanel = true, closeCover, isCover } = props;\r\n const { t } = useTranslation();\r\n const state = useSelector(selectArticles);\r\n const articleDetails = useSelector(selectArticleDetails);\r\n const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n const user = useSelector(selectAuthenticatedUser);\r\n const editProcessing = useSelector(selectEditArticleAssociationBusy);\r\n const allowedToChangeStatus = useAllowedToChangeStatus();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const [canEditStatus, setCanEditStatus] = React.useState(false);\r\n const submitCommentRef = React.useRef(null);\r\n const dispatch = useDispatch();\r\n const { actions } = useArticlesSlice();\r\n const schema: Yup.SchemaOf = Yup.object().shape(\r\n {\r\n CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n RelatedUser: Yup.mixed().nullable().notRequired(),\r\n //ServiceGroupAssets: assetsSchema.required(),\r\n /*ServiceGroupAsset: assetSchema.nullable().required(),\r\n InstrumentAssets: assetsSchema.required(),*/\r\n ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n is: v => (v === undefined ? true : v.length === 0),\r\n then: assetSchema.required().nullable(),\r\n otherwise: assetSchema.nullable().notRequired(),\r\n }),\r\n InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n is: v => v === null,\r\n then: assetsSchema.required().min(1),\r\n otherwise: assetsSchema.notRequired(),\r\n }),\r\n PageNumber: Yup.number().nullable().default(null),\r\n },\r\n [['ServiceGroupAsset', 'InstrumentAssets']],\r\n );\r\n const GetServiceGroupAsset = React.useCallback(asset => {\r\n /*if (asset !== undefined && asset !== null) {\r\n return asset.ServiceGroupId !== null &&\r\n asset.ServiceGroupId !== undefined &&\r\n (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n asset.ServiceGroupId,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n ? asset\r\n : null;\r\n } else {\r\n return null;\r\n }*/\r\n return asset;\r\n }, []);\r\n const initialValues: IArticleAssociationForm = React.useMemo(\r\n () => ({\r\n CalibrationRecord: {\r\n Id: articleDetails?.CalibrationRecord,\r\n Name: !!articleDetails?.CalibrationRecord\r\n ? '#' +\r\n articleDetails?.CalibrationRecord?.toString() +\r\n ': ' +\r\n articleDetails?.CalibrationRecordName\r\n : '',\r\n } as Entity,\r\n RelatedUser: {\r\n Id: articleDetails?.RelatedUser,\r\n Name: articleDetails?.RelatedUserDisplayName,\r\n } as Entity,\r\n PageNumber: articleDetails?.PageNumber,\r\n InstrumentAssets: articleDetailsForm?.InstrumentAssets,\r\n /*articleDetailsForm?.InstrumentAssets.filter(\r\n asset =>\r\n asset.ServiceId !== null &&\r\n asset.ServiceId !== undefined &&\r\n (authenticatedUser?.HasAdminServicePermissions(\r\n asset.ServiceTypeId ?? 1,\r\n asset.ServiceId,\r\n ) ||\r\n authenticatedUser?.HasLabTechServicePermissions(\r\n asset.ServiceTypeId ?? 1,\r\n asset.ServiceId,\r\n ) ||\r\n authenticatedUser?.HasAdminGroupPermissions(\r\n asset.ServiceGroupId ?? undefined,\r\n ) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(\r\n asset.ServiceGroupId ?? undefined,\r\n )),\r\n ),*/\r\n /*ServiceGroupAssets: articleDetailsForm?.ServiceGroupAssets.filter(\r\n asset =>\r\n asset.ServiceGroupId !== null &&\r\n asset.ServiceGroupId !== undefined &&\r\n (authenticatedUser?.HasAdminGroupPermissions(asset.ServiceGroupId) ||\r\n authenticatedUser?.HasLabTechGroupPermissions(\r\n asset.ServiceGroupId,\r\n )),\r\n ),*/\r\n ServiceGroupAsset:\r\n articleDetailsForm !== undefined\r\n ? GetServiceGroupAsset(articleDetailsForm?.ServiceGroupAssets[0])\r\n : null,\r\n }),\r\n [\r\n GetServiceGroupAsset,\r\n articleDetails?.CalibrationRecord,\r\n articleDetails?.CalibrationRecordName,\r\n articleDetails?.PageNumber,\r\n articleDetails?.RelatedUser,\r\n articleDetails?.RelatedUserDisplayName,\r\n articleDetailsForm,\r\n ],\r\n );\r\n const [oldServiceGroups, setOldServiceGroups] = React.useState(\r\n //initialValues.ServiceGroupAssets,\r\n initialValues.ServiceGroupAsset === null\r\n ? []\r\n : [initialValues.ServiceGroupAsset],\r\n );\r\n const [serviceGroups, setServiceGroups] = React.useState(\r\n //initialValues.ServiceGroupAssets,\r\n initialValues.ServiceGroupAsset === null\r\n ? []\r\n : [initialValues.ServiceGroupAsset],\r\n );\r\n const [instruments, setInstruments] = React.useState(\r\n initialValues.InstrumentAssets,\r\n );\r\n\r\n const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState();\r\n\r\n const handleCloseClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: undefined,\r\n onClose: () => {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n dispatch(actions.resetArticleAssociationState());\r\n },\r\n } as SidePanelCloseState);\r\n }, [actions, closePanel, dispatch, isCover, layoutActions, useSidePanel]);\r\n\r\n React.useEffect(() => {\r\n if (editProcessing === false) {\r\n handleCloseClick();\r\n }\r\n return () => undefined;\r\n }, [editProcessing, handleCloseClick]);\r\n\r\n const instrumentFilter = React.useCallback(() => {\r\n return GetInstrumentFilter(serviceGroups);\r\n }, [serviceGroups]);\r\n const CalibrationRecordFilter = React.useCallback(() => {\r\n return GetCalibrationRecordFilter(instruments);\r\n }, [instruments]);\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: IArticleAssociationForm,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (\r\n serviceGroups.length !== oldServiceGroups.length ||\r\n serviceGroups[0] !== oldServiceGroups[0]\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('InstrumentAssets', []);\r\n return;\r\n }\r\n if (\r\n values.ServiceGroupAsset === null &&\r\n values.InstrumentAssets.length > 0\r\n ) {\r\n setOldServiceGroups(serviceGroups);\r\n setValue('ServiceGroupAsset', {\r\n Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n Name: values.InstrumentAssets[0].ServiceGroupName,\r\n ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n });\r\n }\r\n setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n },\r\n [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n );\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: IArticleAssociationForm) => {\r\n if (articleDetails === undefined) {\r\n return;\r\n }\r\n const payload: IArticleDto = {\r\n ...articleDetails,\r\n ...{\r\n RelatedUser:\r\n values.RelatedUser !== null && !!values.RelatedUser\r\n ? values.RelatedUser?.Id\r\n : null,\r\n },\r\n ...{\r\n CalibrationRecord:\r\n values.CalibrationRecord !== null && !!values.CalibrationRecord\r\n ? values.CalibrationRecord?.Id\r\n : null,\r\n },\r\n ...{\r\n //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n Assets:\r\n values.ServiceGroupAsset !== null && !!values.ServiceGroupAsset\r\n ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n : values.InstrumentAssets,\r\n },\r\n PageNumber:\r\n articleDetails?.ExternalIdSource === 'PubMed'\r\n ? values.PageNumber !== undefined\r\n ? values.PageNumber\r\n : null\r\n : articleDetails?.PageNumber,\r\n Status: allowedToChangeStatus(serviceGroups[0])\r\n ? ArticleStatus.Approved\r\n : ArticleStatus.AwaitingApproval,\r\n };\r\n dispatch(actions.saveArticleAssociation(payload));\r\n },\r\n [actions, allowedToChangeStatus, articleDetails, dispatch, serviceGroups],\r\n );\r\n const processing = state.editArticleAssociationBusy;\r\n\r\n return (\r\n \r\n \r\n \r\n {formik => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 0\r\n ? t(translations.CalibrationRecord)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n placeholder={\r\n instruments.length > 0\r\n ? t(translations.PleaseSelectWorkOrder)\r\n : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n }\r\n disabled={\r\n formik.isSubmitting ||\r\n !canEditStatus ||\r\n instruments.length === 0\r\n }\r\n filter={CalibrationRecordFilter()}\r\n info={t(translations.CalibrationRecord_info)}\r\n fullWidth\r\n />\r\n \r\n {articleDetails?.ExternalIdSource === 'PubMed' && (\r\n \r\n \r\n \r\n )}\r\n \r\n setAssetChanged(true)}\r\n onChange={(value: any) => {\r\n setOldServiceGroups(serviceGroups);\r\n setServiceGroups([value]);\r\n }}\r\n fullWidth\r\n />\r\n \r\n \r\n setAssetChanged(true)}\r\n fullWidth\r\n withoutServiceGroups={true}\r\n onChange={(value: any) => {\r\n setInstruments(value);\r\n }}\r\n />\r\n \r\n {articleDetails && articleDetails.Id > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n}\r\n","import { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport * as React from 'react';\r\nimport {\r\n TrainingDetails,\r\n TrainingDetailsProps,\r\n} from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { StartQuiz, StartQuizProps } from 'app/pages/QuizPage/StartQuiz';\r\nimport {\r\n QuizDetails,\r\n QuizDetailsProps,\r\n} from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { AssetPopUp, AssetPopUpProps } from 'app/pages/AssetPopUp';\r\nimport {\r\n LocationDetails,\r\n LocationDetailsProps,\r\n} from 'app/pages/LocationsPage/Details';\r\nimport {\r\n WorkOrderDetails,\r\n WorkOrderDetailsProps,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { AddPayment, PaymentProps } from 'app/pages/AddPaymentPage';\r\nimport { AddCharge, ChargeProps } from 'app/pages/AddChargePage';\r\nimport {\r\n InvoiceDetailsSidePanel,\r\n InvoiceDetailsSidePanelProps,\r\n} from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport {\r\n BillingActionsDetails,\r\n BillingActionsDetailsProps,\r\n} from 'app/pages/BillingActions/BillingActionsDetailsPage/Details';\r\nimport {\r\n SavedViewDetails,\r\n SavedViewDetailsProps,\r\n} from 'app/pages/SavedViewsPage/SavedViewPage/Details';\r\nimport { LabelTypePage } from 'app/pages/LabelTypesPage/LabelTypeEdit/Loadable';\r\nimport { LabelTypeEditProps } from 'app/pages/LabelTypesPage/LabelTypeEdit';\r\nimport {\r\n InstrumentRestrictions,\r\n InstrumentRestrictionsProps,\r\n} from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\nimport {\r\n ReservationDetails,\r\n ReservationDetailsProps,\r\n} from 'app/pages/ReservationDetails/Details';\r\nimport {\r\n InvoiceTemplatePopUp,\r\n InvoiceTemplatePopUpProps,\r\n} from 'app/pages/InvoiceTemplates/InvoiceTemplatePopUp';\r\nimport {\r\n OtherServiceDetails,\r\n OtherServiceDetailsProps,\r\n} from 'app/pages/OtherServiceDetails/Details';\r\nimport {\r\n PricePeriodDetails,\r\n PricePeriodDetailsProps,\r\n} from 'app/pages/PriceSheetPeriodDetails/Details';\r\nimport {\r\n ArticleDetails,\r\n ArticleDetailsProps,\r\n} from 'app/pages/ArticlesPage/ArticleDetails';\r\nimport {\r\n CoreSelection,\r\n CoreSelectionProps,\r\n} from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport {\r\n AssetsSelection,\r\n AssetsSelectionProps,\r\n} from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport {\r\n NewArticleDetailsForm,\r\n NewArticleDetailsFormProps,\r\n} from 'app/pages/ArticlesPage/NewArticleDetailsForm';\r\nimport {\r\n EditArticleDetailsForm,\r\n EditArticleDetailsFormProps,\r\n} from 'app/pages/ArticlesPage/EditArticleDetailsForm';\r\nimport {\r\n UserAttributesDetails,\r\n UserAttributesDetailsProps,\r\n} from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details';\r\nimport {\r\n ServiceRequestDetails,\r\n ServiceRequestDetailsProps,\r\n} from 'app/pages/Samples/RequestSamplesPage';\r\nimport {\r\n ServiceRequestTicketDetails,\r\n ServiceRequestTicketDetailsProps,\r\n} from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\nimport {\r\n ReportConsumables,\r\n ReportConsumablesProps,\r\n} from 'app/pages/OtherServiceDetails/ReportConsumables';\r\nimport {\r\n CalendarMessagesDetails,\r\n CalendarMessagesDetailsProps,\r\n} from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details';\r\nimport {\r\n ServiceRequestMilestoneChargeDetails,\r\n ServiceRequestMilestoneChargeDetailsProps,\r\n} from 'app/pages/Samples/components/ServiceRequestMilestoneChargeDetails';\r\nimport {\r\n ServiceRequestMilestoneDetails,\r\n ServiceRequestMilestoneDetailsProps,\r\n} from 'app/pages/Samples/components/ServiceRequestMilestoneDetails';\r\nimport {\r\n StockRenewal,\r\n StockRenewalProps,\r\n} from 'app/pages/OtherServiceDetails/StockRenewal';\r\nimport {\r\n RenewStock,\r\n RenewStockProps,\r\n} from 'app/pages/OtherServiceDetails/RenewStock';\r\nimport {\r\n InventoryBatch,\r\n InventoryBatchProps,\r\n} from 'app/pages/OtherServiceDetails/InventoryBatch';\r\nimport {\r\n InvoiceBatchesComments,\r\n InvoiceBatchesCommentsProps,\r\n} from 'app/pages/InvoiceBatches/InvoiceBatchesComments';\r\nimport {\r\n InventoryLog,\r\n InventoryLogProps,\r\n} from 'app/pages/AssetsInventoryLog/InventoryLog';\r\nimport {\r\n ArticleAssociationForm,\r\n ArticleAssociationFormProps,\r\n} from 'app/pages/ArticlesPage/ArticleAssociationForm';\r\nimport {\r\n RegionDetails,\r\n RegionDetailsProps,\r\n} from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\nexport interface SidePanelRendererProps {\r\n renderPageType?: RenderPageType;\r\n renderPageProps: PageTypeProps;\r\n}\r\n\r\nexport function SidePanelRenderer(props: SidePanelRendererProps) {\r\n const { renderPageType, renderPageProps } = props;\r\n\r\n switch (renderPageType) {\r\n case RenderPageType.TrainingDetails:\r\n return ;\r\n case RenderPageType.QuizCreate:\r\n return ;\r\n case RenderPageType.QuizzDetails:\r\n return ;\r\n case RenderPageType.LocationDetails:\r\n return ;\r\n case RenderPageType.AssetDetails:\r\n return ;\r\n case RenderPageType.WorkOrderDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.AddCharge:\r\n return ;\r\n case RenderPageType.AddPayment:\r\n return ;\r\n case RenderPageType.InvoiceDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.AddBillingAction:\r\n return (\r\n \r\n );\r\n case RenderPageType.SavedViewDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.LabelType:\r\n return ;\r\n case RenderPageType.OtherServiceDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.RestrictionDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.ReservationDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.PricePeriodsDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.Article:\r\n return ;\r\n case RenderPageType.ArticleNew:\r\n return (\r\n \r\n );\r\n case RenderPageType.ArticleEdit:\r\n return (\r\n \r\n );\r\n case RenderPageType.InvoiceTemplatePopUp:\r\n return (\r\n \r\n );\r\n case RenderPageType.CoreSelection:\r\n return ;\r\n case RenderPageType.AssetsSelection:\r\n return ;\r\n case RenderPageType.UserAttributesDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.ServiceRequestDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.ServiceRequestTicketDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.CalendarMessagesDetails:\r\n return (\r\n \r\n );\r\n case RenderPageType.ReportConsumables:\r\n return (\r\n \r\n );\r\n case RenderPageType.ServiceRequestMilestone:\r\n return (\r\n \r\n );\r\n case RenderPageType.ServiceRequestMilestoneCharge:\r\n return (\r\n \r\n );\r\n case RenderPageType.StockRenewal:\r\n return ;\r\n case RenderPageType.RenewStock:\r\n return ;\r\n case RenderPageType.InventoryBatch:\r\n return ;\r\n case RenderPageType.InvoiceBatchesComments:\r\n return (\r\n \r\n );\r\n case RenderPageType.AssetInventoryLog:\r\n return ;\r\n case RenderPageType.ArticleForm:\r\n return (\r\n \r\n );\r\n case RenderPageType.RegionDetails:\r\n return ;\r\n default:\r\n return ;\r\n }\r\n}\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetCatGroupDto } from 'api/odata/generated/entities/IAssetCatGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type CatGroupUrl = 'base' | 'assetBase' | 'public';\r\nexport interface AssetCatGroupPickerProps\r\n extends Omit, 'loadData'> {\r\n noGlobalServiceGroupFilter?: boolean;\r\n urlType?: CatGroupUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetCatGroups';\r\nconst assetBaseUrl = '/api/odata/v4/AssetCatGroups/AssetCatGroupsFilter';\r\nconst publicUrl = '/api/odata/v4/AssetCatGroups/PublicAssetCatGroupsFilter';\r\nexport const initAssetCatGroupData = (\r\n initval: string | undefined,\r\n sourceUrl?: CatGroupUrl,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IAssetCatGroupDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,ServiceGroups',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetBaseUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IAssetCatGroupDto[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: CatGroupUrl,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicUrl\r\n : urlType === 'assetBase'\r\n ? assetBaseUrl\r\n : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'ServiceGroups'],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function AssetCatGroupPicker(props: AssetCatGroupPickerProps) {\r\n const { predicates, noGlobalServiceGroupFilter, urlType, ...other } = props;\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n predicates,\r\n isAuth\r\n ? !noGlobalServiceGroupFilter\r\n ? globalServiceGroupFilter || []\r\n : []\r\n : [],\r\n isAuth,\r\n urlType,\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport const AssetCatGroupByServiceGroupFilter = (value: FilterValueType) => {\r\n if (value !== undefined && value !== null) {\r\n return [\r\n `${new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.In,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n return [];\r\n};\r\n","/**\r\n *\r\n * CampusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InstitutePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InstituteFilter';\r\nexport const initInstituteData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function InstitutePicker(props: InstitutePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { IAssetCatDto } from 'app/pages/CategoriesPage/IAssetCatDto';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nexport type CatUrl = 'base' | 'assetBase' | 'public';\r\nexport interface AssetCatPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: CatUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetCat';\r\nconst assetBaseUrl = '/api/odata/v4/AssetCat/AssetCatsFilter';\r\nconst publicUrl = '/api/odata/v4/AssetCat/PublicAssetCatsFilter';\r\nexport const initAssetCatData = (\r\n initval: string | undefined,\r\n sourceUrl?: CatUrl,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IAssetCatDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,GroupId,AssetCatGroupName',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetBaseUrl\r\n : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as IAssetCatDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: CatUrl,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicUrl\r\n : urlType === 'assetBase'\r\n ? assetBaseUrl\r\n : url;\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'GroupId', 'AssetCatGroupName', 'ServiceGroups'],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function AssetCatPicker(props: AssetCatPickerProps) {\r\n const { predicates, urlType, ...other } = props;\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n urlType,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const AssetCatByCategoryFilter = (\r\n value: FilterValueType,\r\n fieldName: any,\r\n) => {\r\n if (value !== undefined && value !== null) {\r\n if (fieldName === 'AssetCatGroupId') {\r\n return [\r\n `${new Condition(\r\n 'GroupId',\r\n ODataOperators.Equals,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n if (fieldName === 'ServiceGroupId') {\r\n return [\r\n `${new Condition('ServiceGroups', ODataOperators.AnyIn, [\r\n (value as Identifiable).Id,\r\n ]).toString()}`,\r\n ];\r\n }\r\n }\r\n return [];\r\n};\r\n","/**\r\n *\r\n * DepartmentPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface DepartmentPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/DepartmentFilter';\r\nexport const initDepartmentData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function DepartmentPicker(props: DepartmentPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * RoomPickerFilter\r\n *\r\n */\r\nimport { RoomPicker } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const RoomPickerFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default RoomPickerFilter;\r\n","/**\r\n *\r\n * Description\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport htmlParse from 'html-react-parser';\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Predefined (column) widths\r\n */\r\ntype TextLength = 'short' | 'medium' | 'long' | 'auto';\r\n\r\nconst DEFAULT_WIDTH = 'medium';\r\n\r\nexport interface DescriptionProps\r\n extends Omit, 'children' | 'title'> {\r\n value?: string | null;\r\n //className?: string;\r\n title?: string | null | React.ReactNode;\r\n /**\r\n * predefined width - default = medium\r\n */\r\n width?: TextLength;\r\n /**\r\n * Makes a tooltip interactive, i.e. will not close when the user\r\n * hovers over the tooltip before the `leaveDelay` is expired.\r\n */\r\n interactive?: boolean;\r\n /**\r\n * The number of milliseconds to wait before hiding the tooltip.\r\n * This prop won't impact the leave touch delay (`leaveTouchDelay`).\r\n */\r\n leaveDelay?: number;\r\n /**\r\n * The number of milliseconds after the user stops touching an element before hiding the tooltip.\r\n */\r\n leaveTouchDelay?: number;\r\n}\r\n/**\r\n * Renders a long text Cell - truncates long text with a popup\r\n * @param param0 value to render\r\n * @returns\r\n */\r\nexport const Description = ({\r\n value,\r\n title,\r\n width = DEFAULT_WIDTH,\r\n interactive,\r\n leaveDelay,\r\n leaveTouchDelay,\r\n}: DescriptionProps) => {\r\n // cleanup html tags for inline display and trim white spaces\r\n\r\n const textValue = tryCleanValue(value);\r\n\r\n if (value === '' || value === null || value === undefined) {\r\n return <>;\r\n }\r\n\r\n // use the title if provided, otherwise tooltip will show full text value\r\n const titleValue = title ?? value;\r\n\r\n // parse html title value for html values e.g. remarks, email body, etc.\r\n const parsedTitle =\r\n typeof titleValue === 'string' ? htmlParse(titleValue) : titleValue;\r\n\r\n const maxChars = toCharsWidth(width);\r\n const foo =\r\n maxChars !== undefined &&\r\n maxChars > 0 &&\r\n typeof textValue === 'string' &&\r\n textValue.length > maxChars;\r\n if (foo) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return <>{String(textValue)};\r\n }\r\n};\r\n\r\n/***\r\n * Renders truncated text without tooltip\r\n */\r\nexport const TruncatedDescriptionText = React.forwardRef<\r\n HTMLSpanElement,\r\n DescriptionProps\r\n>(function TruncatedDescriptionText(\r\n { value, width = DEFAULT_WIDTH, title, ...props }: DescriptionProps,\r\n ref,\r\n) {\r\n if (value === '' || value === null || value === undefined) {\r\n return null;\r\n }\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n});\r\nconst Styled = styled('span')<{ width: string }>`\r\n display: inline-block;\r\n white-space: nowrap;\r\n max-width: ${props => props.width};\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n`;\r\n\r\n/**\r\n * Converts preset width to value that can be used to set css width\r\n * @param lengthType preset width\r\n * @returns\r\n */\r\nconst toCharsWidth = (lengthType?: TextLength) => {\r\n const length = lengthType ?? DEFAULT_WIDTH;\r\n switch (length) {\r\n case 'short':\r\n return 15;\r\n case 'medium':\r\n return 30;\r\n case 'long':\r\n return 70;\r\n case 'auto':\r\n return undefined;\r\n default:\r\n assertExhaustive(length);\r\n }\r\n};\r\n\r\n/**\r\n * Converts preset width to value that can be used to set css width\r\n * @param lengthType preset width\r\n * @returns\r\n */\r\nconst toCssWidth = (lengthType?: TextLength) => {\r\n const length = lengthType ?? DEFAULT_WIDTH;\r\n switch (length) {\r\n case 'short':\r\n case 'medium':\r\n case 'long':\r\n return `${toCharsWidth(length)}ch`;\r\n\r\n case 'auto':\r\n return 'auto';\r\n default:\r\n assertExhaustive(length);\r\n }\r\n};\r\n\r\nfunction tryCleanValue(value: string | null | undefined) {\r\n if (value === null || value === undefined) {\r\n return undefined;\r\n }\r\n\r\n try {\r\n return value?.replace(/<[^>]+>/g, '')?.trim();\r\n } catch (error) {\r\n return value;\r\n }\r\n}\r\n","/**\r\n *\r\n * InstituteTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InstituteTypePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InstituteTypeFilter';\r\nexport const initInstituteTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function InstituteTypePicker(props: InstituteTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import clsx from 'clsx';\r\nimport {\r\n Card,\r\n CardActionArea,\r\n CardActions,\r\n CardContent,\r\n CardMedia,\r\n CardProps,\r\n Theme,\r\n useTheme,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { SimpleList } from 'app/components/BasicList/StyledList';\r\nimport React, { useState } from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { defaultImgSrc } from 'app/components/AssetThumbImage';\r\nimport { Body } from '../Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport styled from 'styled-components';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\n// import useState from 'react-usestateref';\r\n\r\nexport type CardPosition = 'vertical' | 'horizontal';\r\nexport type CardBackground = 'white' | 'gray';\r\nexport type CardSize = 'small' | 'medium';\r\nexport type StatusType = 'info' | 'success' | 'warning' | 'error' | 'active';\r\nexport interface CardButton {\r\n key: React.Key | null | undefined;\r\n button: React.ReactNode;\r\n}\r\nexport interface CardContentRow {\r\n key: React.Key | null | undefined;\r\n label: React.ReactNode;\r\n text: React.ReactNode;\r\n}\r\nexport interface CardTopActions {\r\n key: React.Key | null | undefined;\r\n action: React.ReactNode;\r\n}\r\nexport interface DemSize {\r\n width: number;\r\n height: number;\r\n}\r\nexport interface BasicCardProps {\r\n position?: CardPosition;\r\n backStyle?: CardBackground;\r\n cardSize?: CardSize;\r\n mobileSize?: CardSize;\r\n useImage?: boolean;\r\n imageSrc?: string;\r\n showBullet?: boolean;\r\n useButtons?: boolean;\r\n useSelect?: boolean;\r\n selectVisible?: boolean;\r\n selected?: boolean;\r\n title?: React.ReactNode;\r\n disabled?: boolean;\r\n primaryAction?: () => void;\r\n checkBox?: React.ReactNode;\r\n topActions?: Array;\r\n hasTopActions?: boolean;\r\n buttons?: Array;\r\n cardContent?: React.ReactNode;\r\n cardContentRows?: Array;\r\n iconTitle?: React.ReactNode;\r\n status?: StatusType;\r\n maxContentHeight?: number;\r\n preventInnerClicks?: boolean;\r\n contentEditable?: boolean;\r\n loading?: boolean;\r\n info?: string;\r\n}\r\n\r\nexport function BasicCard(props: BasicCardProps) {\r\n const {\r\n position,\r\n cardSize,\r\n mobileSize,\r\n useButtons,\r\n useImage,\r\n useSelect,\r\n showBullet,\r\n selected,\r\n title,\r\n imageSrc,\r\n disabled,\r\n primaryAction,\r\n checkBox,\r\n topActions,\r\n buttons,\r\n cardContent,\r\n cardContentRows,\r\n selectVisible,\r\n iconTitle,\r\n status,\r\n maxContentHeight,\r\n preventInnerClicks,\r\n contentEditable,\r\n hasTopActions,\r\n loading,\r\n } = props;\r\n const theme = useTheme();\r\n const [imgError, setImageError] = React.useState(false);\r\n const imgSrc = React.useMemo(() => {\r\n return useImage\r\n ? imgError\r\n ? defaultImgSrc\r\n : imageSrc !== undefined\r\n ? imageSrc\r\n : defaultImgSrc\r\n : undefined;\r\n }, [imageSrc, imgError, useImage]);\r\n const [imageDimensions, setImageDimensions] = useState(\r\n undefined,\r\n );\r\n React.useEffect(() => {\r\n if (loading !== undefined) {\r\n if (loading === true && imageDimensions !== undefined) {\r\n setImageDimensions(undefined);\r\n }\r\n }\r\n }, [imageDimensions, loading]);\r\n const loadImage = (setImageDimensions, imageUrl) => {\r\n const img = new Image();\r\n img.src = imageUrl;\r\n img.onload = () => {\r\n setImageDimensions({\r\n height: img.height,\r\n width: img.width,\r\n });\r\n // console.debug('image loaded', img);\r\n };\r\n // img.onerror = err => {\r\n // console.log('img error');\r\n // console.error(err);\r\n // };\r\n };\r\n const backgroundSize = React.useMemo(() => {\r\n if (!!imageDimensions) {\r\n let horizontal = imageDimensions.width - imageDimensions.height > 0;\r\n if (imageDimensions.height === imageDimensions.width) {\r\n return 'contain';\r\n }\r\n if (position === 'vertical') {\r\n if (horizontal) {\r\n if (\r\n imageDimensions.height <\r\n (cardSize === 'medium' ? 180 : 150) / 1.8\r\n ) {\r\n return 'contain';\r\n } else {\r\n if (imageDimensions.width < imageDimensions.height * 1.33) {\r\n return 'contain';\r\n }\r\n return 'cover';\r\n }\r\n } else {\r\n return 'contain';\r\n }\r\n } else {\r\n if (!horizontal) {\r\n if (\r\n imageDimensions.height <\r\n (cardSize === 'medium' ? 180 : 150) / 1.8\r\n ) {\r\n return 'contain';\r\n } else {\r\n return 'cover';\r\n }\r\n } else {\r\n if (\r\n imageDimensions.width <\r\n (cardSize === 'medium' ? 180 : 150) / 1.8\r\n ) {\r\n return 'contain';\r\n } else {\r\n return 'cover';\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }, [cardSize, imageDimensions, position]);\r\n const [showSelect, setShowSelect] = useState(selectVisible);\r\n React.useEffect(() => {\r\n let active =\r\n imgSrc !== undefined &&\r\n imageDimensions === undefined &&\r\n loading === false;\r\n if (active) {\r\n loadImage(setImageDimensions, imgSrc);\r\n }\r\n return () => {\r\n active = false;\r\n //setImageDimensions(undefined);\r\n };\r\n }, [imageDimensions, imgSrc, loading]);\r\n const showHeader = React.useMemo(() => {\r\n return !!title || !!iconTitle || (useSelect && showSelect) || hasTopActions;\r\n }, [iconTitle, showSelect, title, hasTopActions, useSelect]);\r\n // const headerHeight = React.useMemo(() => {\r\n // return showHeader ? 25 : 0;\r\n // }, [showHeader]);\r\n // const imageHeight = React.useMemo(() => {\r\n // return position === 'horizontal' || imgSrc === undefined\r\n // ? 0\r\n // : cardSize === 'medium'\r\n // ? 180\r\n // : 150;\r\n // }, [cardSize, imgSrc, position]);\r\n\r\n // const rowsHeight = 78;\r\n\r\n const contentHeight = React.useMemo(() => {\r\n let maxHeight = maxContentHeight || 60;\r\n return cardContent === undefined ? 0 : maxHeight;\r\n }, [cardContent, maxContentHeight]);\r\n // const otherHeight = React.useMemo(() => {\r\n // //paddings and gaps\r\n // return (\r\n // (rowsHeight > 0 || maxContentHeight === undefined\r\n // ? cardSize === 'medium'\r\n // ? 16 * 2\r\n // : 8 * 2\r\n // : 6) + (useButtons ? 16 : 8)\r\n // );\r\n // }, [cardSize, maxContentHeight, rowsHeight, useButtons]);\r\n\r\n // const buttonsHeight = React.useMemo(() => {\r\n // return useButtons ? 32 : 0;\r\n // }, [useButtons]);\r\n const [mouseUp, setMouseUp] = React.useState(false);\r\n // const [preventPrimary, setPreventPrimary] = React.useState(false);\r\n // const cardHeight = React.useMemo(() => {\r\n // return (\r\n // headerHeight + rowsHeight + buttonsHeight + otherHeight + contentHeight\r\n // );\r\n // }, [buttonsHeight, headerHeight, otherHeight, rowsHeight, contentHeight]);\r\n\r\n const trimTitleText = React.useMemo(() => {\r\n if (!!title && typeof title === 'string') {\r\n let trimmedTitle = title as string;\r\n let trimSize = cardSize === 'medium' ? 24 : 26;\r\n if (trimmedTitle.length > trimSize) {\r\n trimmedTitle = trimmedTitle.substring(0, trimSize).trim() + '...';\r\n }\r\n return trimmedTitle;\r\n }\r\n return title;\r\n }, [cardSize, title]);\r\n\r\n return (\r\n \r\n {\r\n if (useSelect) {\r\n setShowSelect(true);\r\n }\r\n }}\r\n onMouseLeave={() => {\r\n if (useSelect) setShowSelect(selectVisible);\r\n }}\r\n onMouseUp={event => {\r\n if ('type' in event.target && event.target.type === 'checkbox') {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (\r\n 'className' in event.target &&\r\n event.target.className !== undefined &&\r\n event.target.className !== null &&\r\n typeof event.target.className === 'string' &&\r\n event.target.className.indexOf('MuiCardMedia-root') > -1\r\n ) {\r\n setMouseUp(true);\r\n if (!!primaryAction) {\r\n primaryAction();\r\n }\r\n } else if (\r\n ('className' in event.target &&\r\n event.target.className !== undefined &&\r\n event.target.className !== null &&\r\n typeof event.target.className === 'string' &&\r\n event.target.className.indexOf('MuiLink-root') > -1) ||\r\n event.target?.parentElement?.nodeName === 'A'\r\n ) {\r\n setMouseUp(true);\r\n } else {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }}\r\n onClick={() => {\r\n if (mouseUp) {\r\n setMouseUp(false);\r\n return;\r\n }\r\n if (!!primaryAction) {\r\n primaryAction();\r\n }\r\n }}\r\n >\r\n {imgSrc !== undefined && (\r\n \r\n \r\n {\r\n console.log('img event', e);\r\n }}\r\n onLoad={e => {\r\n console.log('img event', e);\r\n }}\r\n src=\"\"\r\n onError={() => setImageError(true)}\r\n >\r\n {useSelect &&\r\n (showSelect || selectVisible) &&\r\n position === 'vertical' &&\r\n !disabled &&
    {checkBox}
    }\r\n \r\n
    \r\n \r\n )}\r\n \r\n {showHeader && (\r\n
    \r\n
    \r\n {!!iconTitle && iconTitle}\r\n {title !== undefined && (\r\n
    \r\n \r\n \r\n \r\n {trimTitleText}\r\n \r\n \r\n \r\n
    \r\n )}\r\n
    \r\n
    \r\n {(imgSrc === undefined || position === 'horizontal') &&\r\n useSelect &&\r\n (showSelect || selectVisible) &&\r\n !disabled && {checkBox}}\r\n {!!topActions &&\r\n topActions.map(c => {\r\n return (\r\n e.stopPropagation()}>\r\n {c.action}\r\n \r\n );\r\n })}\r\n
    \r\n
    \r\n )}\r\n {!!cardContent && (\r\n
    \r\n {cardContent}\r\n
    \r\n )}\r\n {!!cardContentRows && cardContentRows.length > 0 && (\r\n \r\n {cardContentRows.map(c => {\r\n return (\r\n
  • \r\n {showBullet && (\r\n \r\n )}\r\n\r\n {\r\n if (preventInnerClicks) {\r\n e.preventDefault();\r\n }\r\n }}\r\n className={'rowOverRule'}\r\n >\r\n \r\n {c.label}\r\n \r\n \r\n {c.text}\r\n \r\n \r\n
  • \r\n );\r\n })}\r\n \r\n )}\r\n\r\n {useButtons && !!buttons && (\r\n \r\n
    \r\n {buttons.map(c => {\r\n return (\r\n e.stopPropagation()}>\r\n {c.button}\r\n \r\n );\r\n })}\r\n
    \r\n {status !== undefined && (\r\n
    \r\n \r\n
    \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n}\r\nexport const ImageContainer = styled('div')(({ theme }) => ({\r\n '&.imgContainer': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n alignSelf: 'stretch',\r\n background: `${bookitColors.base.white}`,\r\n borderRadius: '12px 12px 0px 0px',\r\n '&.position_horizontal': {\r\n borderRadius: '12px 0px 0px 12px',\r\n '&.mobileSizeMedium, &.mobileSizeSmall': {\r\n padding: '16px 0px 16px 16px',\r\n },\r\n },\r\n '&.position_vertical': {\r\n '&.cardSize_medium': {\r\n height: '180px',\r\n },\r\n '&.cardSize_small': {\r\n height: '150px',\r\n },\r\n },\r\n '& .frame': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n justifyContent: 'center',\r\n gap: '10px',\r\n flex: '1 0 0',\r\n alignSelf: 'stretch',\r\n borderRadius: '12px 12px 0px 0px',\r\n background: `${bookitColors.grayscale.graySelection}`,\r\n '&.position_horizontal': {\r\n height: 'auto',\r\n borderRadius: '12px 0px 0px 12px',\r\n '&.mobileSizeMedium': {\r\n alignItems: 'center',\r\n //padding: '16px 0px',\r\n borderRadius: '8px',\r\n height: '80px',\r\n },\r\n '&.mobileSizeSmall': {\r\n alignItems: 'center',\r\n //padding: '16px 0px',\r\n borderRadius: '8px',\r\n height: '64px',\r\n },\r\n },\r\n '& .mediaStyles': {\r\n imageRendering: '-webkit-optimize-contrast',\r\n backgroundSize: 'auto',\r\n width: '100%',\r\n backgroundBlendMode: 'multiply',\r\n minWidth: 'unset',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: 15,\r\n // '&.position_vertical': {\r\n // height: '100%',\r\n // width: '100%',\r\n // },\r\n '& .checkTop': {\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n padding: '5px',\r\n borderRadius: '8px',\r\n },\r\n '&.position_horizontal': {\r\n height: '100%',\r\n minWidth: '64px',\r\n '&.cardSize_small': {\r\n width: '150px',\r\n '&.mobileSizeMedium': {\r\n width: '80px',\r\n height: '80px',\r\n },\r\n '&.mobileSizeSmall': {\r\n width: '64px',\r\n height: '64px',\r\n },\r\n },\r\n '&.cardSize_medium': {\r\n width: '180px',\r\n '&.mobileSizeMedium': {\r\n width: '80px',\r\n height: '80px',\r\n },\r\n '&.mobileSizeSmall': {\r\n width: '64px',\r\n height: '64px',\r\n },\r\n },\r\n },\r\n '&.position_vertical': {\r\n '&.cardSize_small': {\r\n height: 0,\r\n paddingTop: 150,\r\n },\r\n '&.cardSize_medium': {\r\n height: 0,\r\n paddingTop: 180,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n}));\r\nexport const StyledCard = styled(\r\n ({\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & CardProps) => {children},\r\n)({\r\n '&.card': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n //justifyContent: 'flex-start',\r\n justifyContent: 'center',\r\n alignItems: 'flex-start',\r\n borderRadius: '12px',\r\n padding: 0,\r\n flex: '1 0 0',\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n boxShadow: 'unset',\r\n height: '100%',\r\n '&.cardActive': {\r\n boxShadow: bookitShadows.shadowS,\r\n border: `1px solid ${bookitColors.primary.components}`,\r\n background: bookitColors.primary.background,\r\n '&.cardInfo': {\r\n border: `1px solid ${bookitColors.primary.borders}`,\r\n background: bookitColors.primary.bgLight,\r\n },\r\n '&.cardSuccess': {\r\n border: `1px solid ${bookitColors.success.components}`,\r\n background: bookitColors.success.background,\r\n },\r\n '&.cardWarning': {\r\n border: `1px solid ${bookitColors.warning.components}`,\r\n background: bookitColors.warning.background,\r\n },\r\n '&.cardError': {\r\n border: `1px solid ${bookitColors.danger.components}`,\r\n background: bookitColors.danger.background,\r\n },\r\n // boxShadow: `2px 1px 1px -2px ${bookitColors.primary.components}, 0px 0px 1px 2px ${bookitColors.primary.components}, 0px 1px 1px 0px ${bookitColors.primary.components}`,\r\n },\r\n\r\n '& .cardActionArea': {\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n flexDirection: 'column',\r\n alignSelf: 'stretch',\r\n borderRadius: '12px',\r\n height: '100%',\r\n '&.position_horizontal': {\r\n flexDirection: 'row',\r\n },\r\n //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n '&.disabled': {\r\n backgroundColor: `${bookitColors.grayscale.grayBorders}`,\r\n },\r\n '&:hover': {\r\n opacity: 1,\r\n boxShadow: bookitShadows.shadowS,\r\n // border: `1px solid ${bookitColors.primary.components}`,\r\n background: bookitColors.primary.background,\r\n '&.cardInfo': {\r\n //border: `1px solid ${bookitColors.primary.borders}`,\r\n background: bookitColors.primary.bgLight,\r\n },\r\n '&.cardSuccess': {\r\n //border: `1px solid ${bookitColors.success.components}`,\r\n background: bookitColors.success.background,\r\n },\r\n '&.cardWarning': {\r\n //border: `1px solid ${bookitColors.warning.components}`,\r\n background: bookitColors.warning.background,\r\n },\r\n '&.cardError': {\r\n //border: `1px solid ${bookitColors.danger.components}`,\r\n background: bookitColors.danger.background,\r\n },\r\n },\r\n '& .cardContent': {\r\n // height: props => props.cardHeight - props.imageHeight, //isMobile ? 'auto' : `${cardcurrentHeight - 84}px`,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n width: '100%',\r\n gap: 8,\r\n alignSelf: 'stretch',\r\n height: '100%',\r\n justifyContent: 'space-between',\r\n '&.cardSize_small': {\r\n padding: '8px 12px 12px 12px',\r\n },\r\n '&.cardSize_medium': {\r\n padding: '16',\r\n },\r\n '& .cardTitle': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n height: '25px',\r\n '& .title': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n gap: 8,\r\n '& .titleOverRule': {\r\n display: 'inline-block',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '26ch',\r\n // [theme.breakpoints.down('sm')]: {\r\n // maxWidth: '29ch',\r\n // },\r\n },\r\n },\r\n '& .checkWithAction': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n gap: 8,\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n },\r\n },\r\n '& .content': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n margin: 0,\r\n gap: '8px',\r\n flexGrow: 1,\r\n overflowY: 'auto',\r\n overflowX: 'clip',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n '& .cardContentRows': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n margin: 0,\r\n gap: '8px',\r\n flexGrow: 2,\r\n overflowY: 'clip',\r\n overflowX: 'clip',\r\n minHeight: '78px',\r\n height: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: bookitColors.grayscale.grayBorders,\r\n },\r\n '&.position_horizontal': {\r\n '& .contentRow': {\r\n '& .rowOverRule': {\r\n '& .rowTitle': {\r\n maxWidth: '14ch',\r\n },\r\n // '& .rowText': {\r\n // maxWidth: '14ch',\r\n // },\r\n },\r\n },\r\n '&.mobileSizeMedium, &.mobileSizeSmall': {\r\n '& .contentRow': {\r\n '& .rowOverRule': {\r\n '& .rowTitle': {\r\n maxWidth: '12ch',\r\n },\r\n // '& .rowText': {\r\n // maxWidth: '12ch',\r\n // },\r\n },\r\n },\r\n },\r\n },\r\n '& .contentRow': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: 8,\r\n height: 'auto',\r\n //height: '20px',\r\n // width: '100%',\r\n '& .rowOverRule': {\r\n display: 'flex',\r\n width: '100%',\r\n alignItems: 'flex-start',\r\n // whiteSpace: 'pre',\r\n // overflow: 'hidden',\r\n // textOverflow: 'ellipsis',\r\n // maxWidth: '36ch',\r\n '& .rowTitle': {\r\n color: bookitColors.grayscale.graySubtitles,\r\n paddingRight: 8,\r\n display: 'inline',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '16ch',\r\n },\r\n '& .rowText': {\r\n color: bookitColors.grayscale.blackRegular,\r\n display: 'inline',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n //maxWidth: '18ch',\r\n '& > *': {\r\n display: 'initial',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n '& .cardActions': {\r\n justifyContent: 'space-between',\r\n padding: '0px',\r\n gap: 8,\r\n width: '100%',\r\n '& .cardActionsButtons': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n gap: 8,\r\n justifyContent: 'flex-start',\r\n width: '100%',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n});\r\n\r\nexport const BasicCardWithInfo = (props: BasicCardProps) => {\r\n const { info, ...other } = props;\r\n return info ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n );\r\n};\r\n","import {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { IsEmptyArray, IsEntity } from '../BasicFilter/AppliedFilterComponent';\r\n\r\nimport { FilterValueType } from '../BasicFilter/FilterValueType';\r\n\r\nconst extractValuePart = function (\r\n value: FilterValueType | undefined,\r\n): FilterValueType | undefined {\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n if (value === null) {\r\n return undefined;\r\n }\r\n if (IsEntity(value)) {\r\n return (value as Entity).Id;\r\n }\r\n\r\n return value;\r\n};\r\n\r\nexport function TableFilterBuilder>(\r\n appliedFilters?: Array>,\r\n globalFilterValue?: string | undefined,\r\n serviceGroups?: Entity[],\r\n searchColumns?: Array,\r\n additionalFilters?: (string | Condition)[],\r\n multipleServiceGroups?: boolean,\r\n) {\r\n return new ODataFilterBuilder({\r\n predicates: ((appliedFilters || [])\r\n .map(filterSettingToCondition)\r\n .filter(f => f !== null)\r\n .filter(f => f !== undefined) as (string | Condition)[]).concat(\r\n additionalFilters ?? [],\r\n ),\r\n globalServiceGroupFilter:\r\n serviceGroups === undefined || serviceGroups.length === 0\r\n ? undefined\r\n : [\r\n new Condition(\r\n multipleServiceGroups ? 'ServiceGroups' : 'ServiceGroupId',\r\n multipleServiceGroups\r\n ? ODataOperators.AnyIn\r\n : ODataOperators.Includes,\r\n serviceGroups,\r\n multipleServiceGroups ? 'Id' : undefined,\r\n ),\r\n ],\r\n stringColumns: searchColumns || [],\r\n stringSearch: globalFilterValue,\r\n }).toString();\r\n}\r\n\r\nexport function filterSettingToCondition>(\r\n filter: IFilterSettings,\r\n index: number,\r\n array: Array>,\r\n) {\r\n if (typeof filter === 'string') {\r\n return filter;\r\n }\r\n if (\r\n filter.value === undefined ||\r\n filter.value === null ||\r\n IsEmptyArray(filter.value)\r\n ) {\r\n return undefined;\r\n }\r\n if (filter.customFilter) {\r\n return filter.customFilter(filter.value, filter, array);\r\n }\r\n\r\n var value = extractValuePart(filter.value);\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n\r\n return new Condition(\r\n filter.fieldName,\r\n filter.operator,\r\n value,\r\n filter.fieldName1,\r\n filter.isInversed,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { call, put, select, takeLatest, takeLeading } from 'redux-saga/effects';\r\nimport { push } from 'connected-react-router';\r\nimport { internalIdLoginActions as actions } from '.';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { LoginTypes, Roles } from 'app/slice/types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nconst SESSIONSTORAGE_KEY = 'internalIdLogin';\r\nfunction storeInternalIdLogin(item: IAuthenticatedUser | null): void {\r\n if (item === null) {\r\n sessionStorage.removeItem(SESSIONSTORAGE_KEY);\r\n } else {\r\n sessionStorage.setItem(SESSIONSTORAGE_KEY, JSON.stringify(item));\r\n }\r\n}\r\nfunction loadInternalIdLogin(): IAuthenticatedUser | null {\r\n const s = sessionStorage.getItem(SESSIONSTORAGE_KEY);\r\n if (s === null) {\r\n return null;\r\n }\r\n const d = JSON.parse(s);\r\n const f = d as IAuthenticatedUser;\r\n return f;\r\n}\r\nfunction* doInit(action: PayloadAction<{ isLargeAnimals: boolean }>) {\r\n // /try get identity stored in sessionstorage (saved during internalid entry)\r\n try {\r\n const storedIdentity: IAuthenticatedUser | null = yield call(\r\n loadInternalIdLogin,\r\n );\r\n if (storedIdentity !== null) {\r\n yield put(actions.success(storedIdentity));\r\n yield put(actions.init_success());\r\n return;\r\n }\r\n } catch (error: unknown) {\r\n console.error('ap init error', error);\r\n }\r\n\r\n // simulate internalid login for technicians so that they'll be able to enter the Kiosk cases list/details\r\n const user = yield select(selectAuthenticatedUser);\r\n if (!isNullOrUndefined(user)) {\r\n if (\r\n action.payload.isLargeAnimals &&\r\n user.Roles.indexOf(Roles.LargeAnimalsOperatingRoomTechnician) >= 0\r\n ) {\r\n yield put(actions.success(user));\r\n yield put(actions.init_success());\r\n return;\r\n }\r\n }\r\n\r\n yield put(actions.init_success());\r\n}\r\nfunction* doLogin(\r\n action: PayloadAction<{ internalId: string; General: boolean }>,\r\n) {\r\n const httpPayload = {\r\n internalId: action.payload.internalId,\r\n General: action.payload.General,\r\n };\r\n try {\r\n // send authentication request\r\n const requestURL = '/api/account/internalidlogin';\r\n const result = yield call(httpClient.post, requestURL, httpPayload);\r\n result.LoginType = LoginTypes.InternalId;\r\n //store authentication result in session storage\r\n yield call(storeInternalIdLogin, result);\r\n yield put(actions.success(result));\r\n } catch (err) {\r\n yield put(actions.error(err));\r\n }\r\n}\r\nfunction* doRedirectToLogin() {\r\n yield call(storeInternalIdLogin, null);\r\n yield put(push('/internalidlogin'));\r\n}\r\nexport function* internalIdLoginSaga() {\r\n yield takeLatest(actions.login.type, doLogin);\r\n yield takeLeading(actions.redirectToLogin, doRedirectToLogin);\r\n yield takeLeading(actions.logout, doRedirectToLogin);\r\n yield takeLatest(actions.init.type, doInit);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { internalIdLoginSaga } from './saga';\r\nimport { InternalIdLoginState } from './types';\r\n\r\nexport const initialState: InternalIdLoginState = {\r\n processing: false,\r\n error: false,\r\n internalId: '',\r\n initialized: false,\r\n isLargeAnimals: true,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'internalIdLogin',\r\n initialState,\r\n reducers: {\r\n init(\r\n state,\r\n action: PayloadAction<{ isLargeAnimals: boolean; returnUrl?: string }>,\r\n ) {\r\n state.isLargeAnimals = action.payload.isLargeAnimals;\r\n state.initialized = false;\r\n state.returnUrl = action.payload.returnUrl;\r\n },\r\n init_success(state, action: PayloadAction) {\r\n state.initialized = true;\r\n },\r\n login(\r\n state,\r\n action: PayloadAction<{ internalId: string; General: boolean }>,\r\n ) {\r\n state.processing = true;\r\n state.error = false;\r\n },\r\n success(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.identity = action.payload;\r\n state.internalId = '';\r\n },\r\n error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.identity = undefined;\r\n state.error = true;\r\n state.internalId = '';\r\n },\r\n clearError(state, action: PayloadAction) {\r\n state.error = false;\r\n state.processing = false;\r\n },\r\n redirectToLogin(state, action: PayloadAction) {},\r\n logout(state, action: PayloadAction) {\r\n state.identity = undefined;\r\n state.internalId = '';\r\n state.processing = false;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: internalIdLoginActions } = slice;\r\n\r\nexport const useInternalIdLoginSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: internalIdLoginSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useInternalIdLoginSlice();\r\n *E\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { UserMultiPicker } from '../pickers/AutocompletePickers/UserMultiPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const FormUsersPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig[] | null> & {\r\n selectArray?: Array;\r\n} & IFieldProps) => {\r\n const [field, meta, helpers] = useField[] | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n disabled={props.disabled}\r\n onBlur={field?.onBlur}\r\n value={field.value as IUserFilterDto[]}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n selectArray={props.selectArray}\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * SubLocationListPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SubLocationListPickerProps\r\n extends Omit, 'loadData'> {\r\n withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/SubLocationList';\r\nexport const initSubLocationListData = (\r\n initval: string | undefined,\r\n): Promise => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as ISubLocationListDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as ISubLocationListDto[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter?: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'LocationListId',\r\n 'LocationListLocationType',\r\n 'LocationListLocationType1Name',\r\n 'LocationListName',\r\n 'LocationType',\r\n 'LocationTypeId',\r\n 'RoomId',\r\n 'RoomName',\r\n 'ServiceGroups',\r\n ],\r\n globalServiceGroupFilter:\r\n globalServiceGroupFilter?.map(\r\n serviceGroup =>\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n serviceGroup.Id,\r\n 'Id',\r\n ),\r\n ) ?? [],\r\n isOptionalServiceGroup: true,\r\n });\r\n\r\nexport function SubLocationListPicker(props: SubLocationListPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n !props.withoutServiceGroups\r\n ? globalServiceGroupFilter || undefined\r\n : undefined,\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ReservationDetailsProps } from '../../pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../../pages/ReservationDetails/Details/slice/types';\r\nimport ButtonLink, { ButtonLinkProps } from '../BasicLinks/ButtonLink';\r\n\r\nexport interface ReservationEditButtonProps extends ButtonProps {\r\n reservationId: number;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function ReservationEditButton({\r\n variant = 'white',\r\n size = 'small',\r\n onClick,\r\n startIcon,\r\n reservationId,\r\n useSidePanel,\r\n ...props\r\n}: ReservationEditButtonProps) {\r\n props.children = props.children ?? reservationId;\r\n const p = useReservationEditBehavior({\r\n onClick: onClick,\r\n useSidePanel: useSidePanel,\r\n });\r\n return (\r\n \r\n );\r\n}\r\nexport interface ReservationEditButtonLinkProps extends ButtonLinkProps {\r\n reservationId: number;\r\n}\r\nexport function ReservationEditButtonLink({\r\n onClick,\r\n reservationId,\r\n ...props\r\n}: ReservationEditButtonLinkProps) {\r\n props.children = props.children ?? reservationId;\r\n const p = useReservationEditBehavior({\r\n onClick: onClick,\r\n });\r\n return ;\r\n}\r\n\r\nexport interface ReservationEditBehaviorProps {\r\n onClick?: React.MouseEventHandler;\r\n useSidePanel?: boolean;\r\n}\r\nexport function useReservationEditBehavior(\r\n props: ReservationEditBehaviorProps,\r\n) {\r\n const { openPanel } = useSidePanelState();\r\n const User = useSelector(selectAuthenticatedUser);\r\n const EnableLegacyScheduler = useSelector(\r\n selectGlobalDbSetting_EnableLegacyScheduler,\r\n );\r\n return (reservationId: number) => {\r\n const params = {\r\n id: String(reservationId),\r\n un: User?.Id,\r\n } as ReservationQueryStringParameters;\r\n const handleClick = e => {\r\n if (!EnableLegacyScheduler) {\r\n openPanel({\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n queryParams: params,\r\n useSidePanel: true,\r\n } as ReservationDetailsProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n } as SidePanelOpenState);\r\n }\r\n props.onClick?.(e);\r\n };\r\n const legacyURL: IPathAndQuery = {\r\n path: '/Reservation.aspx',\r\n search: { Edit: reservationId },\r\n };\r\n const p = EnableLegacyScheduler\r\n ? {\r\n component: ExternalLink,\r\n href: legacyURL,\r\n }\r\n : {\r\n onClick: handleClick,\r\n };\r\n return p;\r\n };\r\n}\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface BaseOptionsMultiPickerProps\r\n extends Omit, 'loadData'> {\r\n getOptions: (searchTerm: string | null) => Entity[];\r\n}\r\n\r\nexport function BaseOptionsMultiPicker(\r\n props: BaseOptionsMultiPickerProps,\r\n) {\r\n const { getOptions, ...other } = props;\r\n const loadData = async (searchTerm: string | null): Promise =>\r\n new Promise(resolve => {\r\n const opts = getOptions(searchTerm);\r\n resolve(opts);\r\n });\r\n return ;\r\n}\r\n","import { RootState } from 'types';\r\nimport { createSelector } from '@reduxjs/toolkit';\r\n\r\nconst selectRouterSlice = (state: RootState) => {\r\n return state.router;\r\n};\r\nexport const selectRouterLocation = createSelector(\r\n [selectRouterSlice],\r\n state => state?.location,\r\n);\r\nexport const selectRouterAction = createSelector(\r\n [selectRouterSlice],\r\n state => state?.action,\r\n);\r\nexport const selectRouterSearch = createSelector(\r\n [selectRouterLocation],\r\n state => state?.search,\r\n);\r\nexport const selectRouterSearchParams = createSelector(\r\n [selectRouterSearch],\r\n state => new URLSearchParams(state),\r\n);\r\nexport const selectRouterPathname = createSelector(\r\n [selectRouterLocation],\r\n state => state?.pathname,\r\n);\r\n","export enum BudgetExperimentStatuses {\r\n Draft = 0,\r\n Pending = 1,\r\n Approved = 2,\r\n Rejected = 3,\r\n}\r\n","/**\r\n *\r\n * SuperGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISuperGroupFilterDto } from 'api/odata/generated/entities/ISuperGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport type DivisionsUrl = 'base' | 'full' | 'public';\r\nexport interface SuperGroupPickerProps\r\n extends Omit, 'loadData'> {\r\n urlType?: DivisionsUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/SuperGroupFilter';\r\nconst publicUrl = '/api/odata/v4/SuperGroupFilter/GetPublicDivisions';\r\nconst baseUrl = '/api/odata/v4/SuperGroupFilter/GetDivisions';\r\nexport const initSuperGroupData = (\r\n initval: string | undefined,\r\n sourceUrl?: DivisionsUrl,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as ISuperGroupFilterDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n sourceUrl !== undefined && sourceUrl !== 'full'\r\n ? 'Id,Name,ServiceGroups'\r\n : 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n let initUrl =\r\n sourceUrl === 'public' ? publicUrl : sourceUrl === 'base' ? baseUrl : url;\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as ISuperGroupFilterDto[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: DivisionsUrl,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicUrl\r\n : urlType === 'base'\r\n ? baseUrl\r\n : url;\r\n\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select:\r\n urlType !== undefined && urlType !== 'full'\r\n ? ['Id', 'Name', 'ServiceGroups']\r\n : ['Id', 'Name'],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter &&\r\n globalServiceGroupFilter.length > 0 &&\r\n urlType !== undefined &&\r\n urlType !== 'full'\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function SuperGroupPicker(props: SuperGroupPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n props.urlType,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AllowedToRender, RenderTypes } from './renderTypes';\r\n\r\nexport function useAssetsPermissions() {\r\n const user = useSelector(selectAuthenticatedUser);\r\n\r\n const allowedToView = React.useCallback(\r\n (rows: IAssetDto[], render: RenderTypes): boolean => {\r\n if (!user) return false;\r\n return rows.every(f => AllowedToRender(user, render, f));\r\n },\r\n [user],\r\n );\r\n return {\r\n allowedToView,\r\n };\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n Box,\r\n Divider,\r\n Grid,\r\n ListItemText,\r\n MenuItem,\r\n MenuList,\r\n Popover,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n AssetsFilterForWorkOrder,\r\n AssetsPicker,\r\n} from 'app/components/pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { initWOTypeDataParams } from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface AddWorkOrderProps {\r\n rows: TRow[];\r\n getAssets: (rows: TRow[]) => Promise;\r\n downtime?: boolean;\r\n buttonName?: string;\r\n primary?: boolean;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n onClick?: () => void;\r\n}\r\nconst WorkButton = props => {\r\n return (\r\n }\r\n endIcon={}\r\n onClick={props.handleClick}\r\n aria-controls={props.id}\r\n aria-haspopup=\"true\"\r\n >\r\n {props.buttonName}\r\n \r\n );\r\n};\r\nexport function AddWorkOrder({\r\n rows,\r\n getAssets,\r\n downtime,\r\n buttonName,\r\n primary,\r\n useSidePanel,\r\n openPanelWithCover,\r\n onClick,\r\n}: AddWorkOrderProps) {\r\n const { t } = useTranslation();\r\n const location = useLocation();\r\n const { openPanel } = useSidePanelState();\r\n const [assets, setAssets] = React.useState([]);\r\n const [workTypes, setWorkTypes] = React.useState<\r\n IWorkOrderTypeDto[] | undefined\r\n >(undefined);\r\n const [workTypeLoading, setWorkTypeLoading] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [assetLoading, setAssetLoading] = React.useState(\r\n undefined,\r\n );\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const [open, setOpen] = React.useState(false);\r\n const handleAssetChange = React.useCallback((value: IAssetDto[] | []) => {\r\n setAssets(value);\r\n setWorkTypeLoading(undefined);\r\n // setWorkTypeLoading(true);\r\n // initWOTypeDataParams(value, undefined, downtime).then(types => {\r\n // setWorkTypes(types);\r\n // setWorkTypeLoading(false);\r\n // });\r\n }, []);\r\n const getParamFromUrl = (name: string): string | undefined => {\r\n return GetRawValue(new URLSearchParams(location.search), name) ?? undefined;\r\n };\r\n const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n let params = {\r\n queryParams: {\r\n id: undefined,\r\n aType: event.Id.toString(),\r\n down: (downtime === true && event.AssetAlertType).toString(),\r\n source: getParamFromUrl('source'),\r\n Up: getParamFromUrl('Up'),\r\n title: getParamFromUrl('title'),\r\n eStart: getParamFromUrl('eStart'),\r\n sympt: getParamFromUrl('sympt'),\r\n aStatus: getParamFromUrl('aStatus'),\r\n aStart: getParamFromUrl('aStart'),\r\n desc: getParamFromUrl('desc'),\r\n assetId: !!assets ? assets.map(a => a.Id).join(',') : undefined,\r\n offH: (downtime === true && event.AssetAlertType).toString(),\r\n offStart: getParamFromUrl('offStart'),\r\n offEnd: getParamFromUrl('offStart'),\r\n reason: getParamFromUrl('reason'),\r\n eqid: getParamFromUrl('eqid'),\r\n sid: getParamFromUrl('sid'),\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps;\r\n const panelProps = {\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: params,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState;\r\n\r\n !!openPanelWithCover\r\n ? openPanelWithCover(panelProps)\r\n : openPanel(panelProps);\r\n onClick?.();\r\n setOpen(false);\r\n };\r\n React.useEffect(() => {\r\n let active =\r\n open && !assetLoading && (assets === undefined || assets?.length < 1);\r\n if (active) {\r\n setAssetLoading(true);\r\n getAssets(rows).then(ass => {\r\n setAssets(() => ass);\r\n setAssetLoading(false);\r\n });\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [assetLoading, assets, getAssets, open, rows]);\r\n React.useEffect(() => {\r\n let active =\r\n open && !!assets && assets.length > 0 && workTypeLoading === undefined;\r\n if (active) {\r\n setWorkTypeLoading(true);\r\n initWOTypeDataParams(assets, undefined, downtime).then(types => {\r\n setWorkTypes(types);\r\n setWorkTypeLoading(false);\r\n });\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [assets, downtime, open, workTypeLoading]);\r\n const handleClick = event => {\r\n setAnchorEl(event.currentTarget);\r\n setOpen(prev => !prev);\r\n };\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n {t(translations.CreateAnAssetRelatedEvent)}\r\n \r\n {\r\n setOpen(false);\r\n setAssets([]);\r\n setWorkTypes([]);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n handleAssetChange(value);\r\n }}\r\n placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n fullWidth={true}\r\n name=\"assets\"\r\n variant=\"filled\"\r\n id=\"asset-id\"\r\n restrictByAvType=\"serviceRelated\"\r\n label={t(translations.Asset)}\r\n value={assets || undefined}\r\n />\r\n \r\n \r\n {assets && assets.length > 0 && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.PleaseSelectAnEventType)}\r\n \r\n \r\n \r\n {workTypeLoading ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : workTypes && workTypes.length > 0 ? (\r\n workTypes.map(wt => (\r\n {\r\n handleWorkTypeClick(wt);\r\n setAssets([]);\r\n setWorkTypes([]);\r\n }}\r\n >\r\n \r\n {wt.Name}\r\n \r\n \r\n ))\r\n ) : (\r\n \r\n \r\n {t(translations.NoAlertTypesFoundForSelectedAssets)}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n}\r\n","/**\r\n *\r\n * RegionFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\nimport { RegionPicker } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\n\r\nexport const RegionFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n return (\r\n \r\n );\r\n};\r\nexport default RegionFilter;\r\n","import { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface MyAssetAvailabilityTypeMultiPickerProps\r\n extends Omit>, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n urlType?: 'allServices' | 'onlineServices';\r\n}\r\n\r\nconst url = '/api/odata/v4/AvailabilityTypesFilter/GetMyAsset';\r\nconst onlineUrl = '/api/odata/v4/AvailabilityTypesFilter/GetOnlineMyAsset';\r\nexport const initMyAssetAvailabilityTypeMultiData = (\r\n initval: string | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const ids = initval.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id asc', //Must be ordered by ID to prevent re-rendering as a result of reordering.\r\n $filter: '(Id in (' + ids.join(',') + '))',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport const initMyAssetAvailabilityTypeOnlineMultiData = (\r\n initval: string | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const ids = initval.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id asc', //Must be ordered by ID to prevent re-rendering as a result of reordering.\r\n $filter: '(Id in (' + ids.join(',') + '))',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(onlineUrl, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport function MyAssetAvailabilityTypeMultiPicker(\r\n props: MyAssetAvailabilityTypeMultiPickerProps,\r\n) {\r\n const { urlType, predicates } = props;\r\n const loadData = getAutoCompleteLoadDataFn>({\r\n url: !!urlType && urlType === 'onlineServices' ? onlineUrl : url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name'],\r\n });\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import Badge from '@material-ui/core/Badge';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { IconButton } from '../IconButton';\r\n\r\nexport interface FilterIconButtonProps {\r\n filterLength: number;\r\n handleClick: React.MouseEventHandler;\r\n innerRef?: React.RefObject;\r\n}\r\n\r\nexport function FilterIconButton({\r\n filterLength: filterLengs,\r\n handleClick: onClick,\r\n ...props\r\n}: FilterIconButtonProps) {\r\n return (\r\n \r\n \r\n 0 ? 'primary' : 'default'}\r\n colorExtend={filterLengs > 0 ? 'main' : 'dark'}\r\n />\r\n \r\n \r\n );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ReservationDetailsProps } from '../../pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../../pages/ReservationDetails/Details/slice/types';\r\n\r\nexport interface ReservationCreateButtonProps extends ButtonProps {\r\n instruments: number[];\r\n useSidePanel?: boolean;\r\n openPanelOrCover?: (state: SidePanelOpenState) => void;\r\n}\r\nexport function ReservationCreateButton({\r\n variant = 'white',\r\n size = 'small',\r\n onClick,\r\n startIcon,\r\n instruments,\r\n useSidePanel,\r\n openPanelOrCover,\r\n ...props\r\n}: ReservationCreateButtonProps) {\r\n const { openPanel } = useSidePanelState();\r\n const User = useSelector(selectAuthenticatedUser);\r\n const EnableLegacyScheduler = useSelector(\r\n selectGlobalDbSetting_EnableLegacyScheduler,\r\n );\r\n\r\n const params = {\r\n selectedIds: String(instruments.join(',')),\r\n un: User?.Id,\r\n } as ReservationQueryStringParameters;\r\n\r\n const handleClick = e => {\r\n if (!EnableLegacyScheduler) {\r\n const openProps = {\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n useSidePanel: true,\r\n queryParams: params,\r\n } as ReservationDetailsProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState;\r\n !!openPanelOrCover ? openPanelOrCover(openProps) : openPanel(openProps);\r\n }\r\n onClick?.(e);\r\n };\r\n const legacyURL: IPathAndQuery = {\r\n path: '/Reservation.aspx',\r\n search: { id: instruments.join(',') },\r\n };\r\n const p = EnableLegacyScheduler\r\n ? {\r\n component: ExternalLink,\r\n href: legacyURL,\r\n }\r\n : {};\r\n return (\r\n }\r\n onClick={handleClick}\r\n target={EnableLegacyScheduler ? '_blank' : undefined}\r\n {...p}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\n\r\nexport const ReservationLink = (props: {\r\n id: number;\r\n children: React.ReactNode;\r\n title?: string;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n const { t } = useTranslation();\r\n const openDetails = useOpenReservationPopUp();\r\n const getLink = useReservationLinkUrl();\r\n const User = useSelector(selectAuthenticatedUser);\r\n const link = getLink({ id: String(props.id), un: User?.Id });\r\n const open = React.useCallback(() => {\r\n openDetails(\r\n {\r\n id: props.id,\r\n useSidePanel: props.useSidePanel,\r\n },\r\n props.openPanelWithCover,\r\n );\r\n }, [openDetails, props.id, props.openPanelWithCover, props.useSidePanel]);\r\n return (\r\n \r\n {\r\n if (!!link) {\r\n if (!event.ctrlKey) {\r\n event.preventDefault();\r\n open();\r\n }\r\n } else {\r\n open();\r\n }\r\n }}\r\n color=\"textPrimary\"\r\n href={link}\r\n >\r\n {props.children}\r\n \r\n \r\n );\r\n};\r\n\r\nexport const useOpenReservationPopUp = () => {\r\n const { openPanel } = useSidePanelState();\r\n const User = useSelector(selectAuthenticatedUser);\r\n return React.useCallback(\r\n (\r\n props: { id: number; useSidePanel?: boolean; useSwitchButtons?: boolean },\r\n openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n ) => {\r\n const params = {\r\n id: String(props.id),\r\n un: User?.Id,\r\n } as ReservationQueryStringParameters;\r\n let resProps = {\r\n queryParams: params,\r\n useSidePanel: true,\r\n useSwitchButtons: props.useSwitchButtons,\r\n } as ReservationDetailsProps;\r\n\r\n const panelState = {\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: resProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n } as SidePanelOpenState;\r\n if (!!openPanelWithCover) {\r\n openPanelWithCover(panelState);\r\n } else {\r\n openPanel({\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: resProps,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState);\r\n }\r\n },\r\n [User?.Id, openPanel],\r\n );\r\n};\r\nexport const useReservationLinkUrl = () => {\r\n const publicUrl = useSelector(selectPublicUrl);\r\n\r\n return React.useCallback(\r\n (params: ReservationQueryStringParameters) => {\r\n return buildURL(publicUrl + 'reservations/details', params);\r\n },\r\n [publicUrl],\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport Scheduler, { SchedulerProps } from './Scheduler';\r\nimport { useSchedulerSlice } from './Scheduler/slice';\r\nimport { IViewState, ViewLengths, ViewTypes } from './Scheduler/slice/types';\r\nimport {\r\n IWithSavedHistoryComponentProps,\r\n withSavedHistoryT,\r\n} from 'app/components/BasicTable/withSavedHistory';\r\n\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { presetPeriodToViewLength } from './Scheduler/utils/parseLength';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { CalendarHeader } from './Scheduler/components/CalendarHeader';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { CombinedSchedulerTRow, getFilters } from './Filter';\r\nimport { getDefaultFilter } from './getDefaultFilter';\r\nimport { getRequiredFilter } from './getRequiredFilter';\r\nimport { MyListFilter } from 'app/pages/ReservationHistoryPage/MyListFilter';\r\nimport { getPredicates } from 'api/odata/getPredicates';\r\nimport { ErrorBoundary } from 'app/components/ErrorBoundary';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n selectCustomDaysTimelineButtonEnabled,\r\n selectDefaultCustomDaysTimelineValue,\r\n selectSchedulerLoadingEvents,\r\n selectSchedulerServicesLimit,\r\n selectSchedulerServicesLimitReached,\r\n selectTwoDaysTimelineButtonEnabled,\r\n} from './Scheduler/slice/selectors';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n TableRowsSkeleton,\r\n TableSkeleton,\r\n} from 'app/components/BasicTable/components/TableSkeleton';\r\nimport {\r\n getPeriodFromViewLength,\r\n viewStateFromFilter,\r\n} from './Scheduler/utils';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useLocation } from 'react-router';\r\nimport { H1 } from 'app/components/Typography';\r\nimport {\r\n groupByFilterFieldName,\r\n periodFilterFieldName,\r\n} from './parseCalendarPageParams';\r\n\r\nexport type SchedulerWithFiltersProps = IWithSavedHistoryComponentProps<\r\n CombinedSchedulerTRow\r\n> &\r\n SchedulerProps;\r\nexport const SchedulerWithFilters = function ({\r\n appliedFilters,\r\n availableFilters,\r\n getFilterValue,\r\n setFilterValue,\r\n ...props\r\n}: SchedulerWithFiltersProps) {\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const { actions } = useSchedulerSlice();\r\n const location = useLocation();\r\n const customDaysEnabled = useSelector(selectCustomDaysTimelineButtonEnabled);\r\n const customDays = useSelector(selectDefaultCustomDaysTimelineValue);\r\n const twoDaysEnabled = useSelector(selectTwoDaysTimelineButtonEnabled);\r\n const isMobile = DetectIsMobile();\r\n const loadingEvents = useSelector(selectSchedulerLoadingEvents);\r\n // change scheduler period & date when \"Date Period\" is changed in the filter\r\n React.useEffect(() => {\r\n const periodValue: PresetDatesRange = getFilterValue?.(\r\n periodFilterFieldName,\r\n ) as PresetDatesRange;\r\n const preset = (periodValue as PresetDatesRange)?.type?.Id;\r\n const date = (periodValue as PresetDatesRange)?.start;\r\n if (preset !== undefined && date !== undefined && date !== null) {\r\n const new_state: Partial = {\r\n viewLength: presetPeriodToViewLength(\r\n preset as SchedulerDatePositionUnion,\r\n props.viewType,\r\n ),\r\n date: dateUtils.formatISO(date),\r\n };\r\n\r\n dispatch(actions.changeViewModePartial(new_state));\r\n }\r\n }, [actions, dispatch, getFilterValue, props.viewType]);\r\n\r\n // collapsed state of the filters\r\n // reference to the show/hide filters button\r\n const [\r\n filtersButtonAnchorEl,\r\n setFiltersButtonAnchorEl,\r\n ] = React.useState(null);\r\n const filterRef = React.useRef(null);\r\n // collapsed state of the filters\r\n const [filterOpen, setFilterOpen] = React.useState(false);\r\n const handleFilterOpen = React.useCallback(() => {\r\n setFiltersButtonAnchorEl(filterRef.current);\r\n setFilterOpen(true);\r\n }, []);\r\n const handleFilterClose = React.useCallback(() => {\r\n setFiltersButtonAnchorEl(null);\r\n setFilterOpen(false);\r\n }, []);\r\n\r\n const fetchData = React.useCallback(() => {\r\n const serviceFilterId = 'service';\r\n const service = getFilterValue?.(serviceFilterId);\r\n // wait for a services value where service name is already populated\r\n // if the Name is empty then there the appliedFilters will immediately change after the population\r\n if (Array.isArray(service) && service.some(f => f.Name === undefined)) {\r\n return;\r\n }\r\n const foo = appliedFilters?.reduce((acc, current) => {\r\n if (current.id !== undefined) {\r\n let setValue: FilterValueType | undefined = undefined;\r\n if (current.id === 'period') {\r\n setValue = (current.value as PresetDatesRange)?.type?.Id;\r\n } else {\r\n setValue = current.value;\r\n }\r\n const predicate = {\r\n value: setValue,\r\n predicate: getPredicates(\r\n [current],\r\n // todo: deal with the customParams\r\n () => void 0,\r\n () => void 0,\r\n ).join(' and '),\r\n };\r\n if (predicate.predicate !== '') {\r\n acc[current.id] = predicate;\r\n }\r\n }\r\n return acc;\r\n }, {});\r\n dispatch(actions.setFilters(foo));\r\n }, [actions, appliedFilters, dispatch, getFilterValue]);\r\n\r\n const handleRefresh = React.useCallback(() => {\r\n fetchData();\r\n }, [fetchData]);\r\n\r\n React.useEffect(() => {\r\n fetchData();\r\n }, [fetchData]);\r\n\r\n const handleFilterChange = (\r\n value: IFilterSettings[],\r\n ) => {\r\n props.onFilterChange?.(value);\r\n };\r\n const handleSetPeriodFilter = React.useCallback(\r\n (length: ViewLengths, value?: Date) => {\r\n let changedValue = getPeriodFromViewLength(\r\n length,\r\n value ?? dateUtils.parseISO(props.date),\r\n customDays,\r\n );\r\n !!setFilterValue && setFilterValue(periodFilterFieldName, changedValue);\r\n },\r\n [customDays, props.date, setFilterValue],\r\n );\r\n const updateSearchPeriod = (\r\n preset: SchedulerDatePositionUnion | null,\r\n search?: string,\r\n ) => {\r\n if (preset !== null) {\r\n const params = new URLSearchParams(search ?? '');\r\n if (params.has(periodFilterFieldName)) {\r\n params.delete(periodFilterFieldName);\r\n }\r\n params.set(periodFilterFieldName, preset);\r\n return params.toString();\r\n }\r\n return search;\r\n };\r\n const handleViewTypeLengthChange = (\r\n type: ViewTypes,\r\n length: ViewLengths,\r\n value?: Date,\r\n noChangeLocation?: boolean,\r\n ) => {\r\n let presetValue = getPeriodFromViewLength(\r\n length,\r\n value ?? dateUtils.parseISO(props.date),\r\n customDays,\r\n );\r\n handleSetPeriodFilter(length, value);\r\n let searchComp =\r\n updateSearchPeriod(\r\n viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n location.search,\r\n ) ?? location.search;\r\n dispatch(\r\n actions.changeViewMode({\r\n current: {\r\n viewType: type,\r\n viewLength: length,\r\n date: !!value ? dateUtils.formatISO(value) : props.date,\r\n preset: isMobile\r\n ? null\r\n : viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n search: searchComp,\r\n customDays: customDays,\r\n customStart: undefined,\r\n },\r\n withNoChangeLocation: noChangeLocation,\r\n }),\r\n );\r\n };\r\n\r\n const handleMultipleModeChange: ValueChangeHandler = value => {\r\n dispatch(actions.updateMultiMode(value));\r\n };\r\n const servicesLimit = useSelector(selectSchedulerServicesLimit);\r\n const limitReached = useSelector(selectSchedulerServicesLimitReached);\r\n React.useEffect(() => {\r\n if (limitReached) {\r\n const msg = t(translations.SchedulerServicesLimitReachedWarningMessage, {\r\n servicesLimit: servicesLimit,\r\n });\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n key: translations.SchedulerServicesLimitReachedWarningMessage,\r\n variant: 'warning',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n }, [dispatch, limitReached, servicesLimit, t]);\r\n\r\n if (appliedFilters === undefined) {\r\n return null;\r\n }\r\n\r\n const showSkeleton =\r\n props.services === undefined ||\r\n props.viewType === undefined ||\r\n props.viewLength === undefined;\r\n\r\n if (showSkeleton) {\r\n return ;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {loadingEvents ? (\r\n \r\n ) : (\r\n {t(translations.AnErrorOccurred)}}>\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport const SchedulerConnectedWithFilters = withSavedHistoryT<\r\n CombinedSchedulerTRow,\r\n SchedulerWithFiltersProps\r\n>(\r\n SchedulerWithFilters,\r\n '/schedule',\r\n getFilters,\r\n getDefaultFilter,\r\n [periodFilterFieldName, groupByFilterFieldName],\r\n getRequiredFilter,\r\n MyListFilter,\r\n true,\r\n);\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\n/**\r\n * Gets the default filters for the calendar/timeline\r\n * @param user\r\n * @returns\r\n */\r\nexport const getDefaultFilter: (\r\n user: IAuthenticatedUser,\r\n) => URLSearchParams = user => {\r\n const result = new URLSearchParams();\r\n return result;\r\n};\r\n","export function getRequiredFilter(\r\n search: string,\r\n appSettings,\r\n): string | undefined {\r\n return undefined;\r\n}\r\n","import * as React from 'react';\r\nimport { Redirect } from 'react-router';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting/index';\r\nimport {\r\n parseProfileUrl,\r\n undefinedIfIsEmpty,\r\n} from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { CalendarPageProps, calendarPathUserProfileKey } from './index';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { ViewTypes } from './Scheduler/slice/types';\r\nimport { trimEnd } from 'lodash';\r\n\r\n/**\r\n * Redirects to the last visited calendar view.\r\n * e.g. /schedule -> /schedule/timeline?eid=12150&un=&BookedById=\r\n * @param param0\r\n * @returns\r\n */\r\nexport function CalendarPageDefaultRedir({\r\n match,\r\n ...props\r\n}: CalendarPageProps) {\r\n const isMobile = DetectIsMobile();\r\n const { savedValue } = useProfileSetting({\r\n profileSettingKey: calendarPathUserProfileKey,\r\n });\r\n const defaultViewType: ViewTypes = isMobile ? 'calendar' : 'timeline';\r\n const defaultPathName = `/schedule/${defaultViewType}`;\r\n const { pathName: savedPathName, search: savedSearch } = parseProfileUrl(\r\n savedValue,\r\n );\r\n // mobile clients should always land on calendar, regardless last visited mode\r\n const pathName = trimEnd(\r\n isMobile ? defaultPathName : savedPathName ?? defaultPathName,\r\n '?',\r\n );\r\n // the saved search part will be applied anyway\r\n // setting it here will save one redir/replace that will happen in the useFilters componenent on the scheduler page\r\n const search = savedSearch;\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SchedulerEventEditHandler, ViewModeChangeHandler } from './Scheduler';\r\nimport { useSchedulerSlice } from './Scheduler/slice';\r\nimport {\r\n selectSchedulerParseEvents,\r\n selectNonWorkingHours,\r\n selectSchedulerServices,\r\n selectSchedulerViewState,\r\n selectSelectedReservationEvents,\r\n selectLoadedServices,\r\n} from './Scheduler/slice/selectors';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { INewEvent, ViewTypes } from './Scheduler/slice/types';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { generatePath } from 'react-router';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport { BasicTableProps } from 'app/components/BasicTable';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { SchedulerConnectedWithFilters } from './SchedulerWithFiltersProps';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting/index';\r\nimport { parseCalendarPageParams as parseViewState } from './parseCalendarPageParams';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { Messages } from 'app/components/Messages';\r\nexport { CalendarPageDefaultRedir } from './CalendarPageDefaultRedir';\r\n\r\nexport interface CalendarPageParams {\r\n type: ViewTypes;\r\n period: SchedulerDatePositionUnion;\r\n}\r\n\r\nexport const calendarPageDefaultPath = '/schedule';\r\nexport const calendarPageFullPath = '/schedule/:type';\r\nexport const CalendarPagePaths = [\r\n calendarPageFullPath,\r\n calendarPageDefaultPath,\r\n];\r\nexport interface CalendarPageProps\r\n extends IBasePageProps,\r\n Pick<\r\n BasicTableProps,\r\n 'filterOpen' | 'onFilterChange' | 'appliedFilters' | 'availableFilters'\r\n > {}\r\n\r\nexport const calendarPathUserProfileKey = calendarPageDefaultPath;\r\nexport function CalendarPage({ match, location, ...props }: CalendarPageProps) {\r\n // show the global service groups filter on the page\r\n useGlobalServiceGroupsFilter(true);\r\n const isMobile = DetectIsMobile();\r\n const dispatch = useDispatch();\r\n const { updateValue: updateX } = useProfileSetting({\r\n profileSettingKey: calendarPathUserProfileKey,\r\n });\r\n const { newDate } = useSystemDate();\r\n const viewStateSearchParams = React.useMemo(() => {\r\n return parseViewState(match, location.search, isMobile, newDate());\r\n }, [match, location.search, isMobile, newDate]);\r\n\r\n // search params that not affect the viewState\r\n const searchParams = React.useMemo(() => {\r\n const purlSearchParams = new URLSearchParamsCI(location.search);\r\n return {\r\n SampleRunId: tryParseInt(purlSearchParams.get('sampleRunId')),\r\n duration: tryParseInt(purlSearchParams.get('duration')),\r\n un: purlSearchParams.get('un'),\r\n srid: tryParseInt(purlSearchParams.get('srid')),\r\n srrid: tryParseInt(purlSearchParams.get('srrid')),\r\n bid: tryParseInt(purlSearchParams.get('bid')),\r\n };\r\n }, [location.search]);\r\n\r\n React.useEffect(() => {\r\n if (isMobile) {\r\n return;\r\n }\r\n const pathName = generatePath(calendarPageFullPath, {\r\n type: viewStateSearchParams.viewType,\r\n });\r\n // the \"saved filter\" url setting have to have the search part in the URL\r\n // as it's primarily used for it's query string value in the filters component\r\n // see parseProfileURL.ts\r\n const url = pathName + (undefinedIfIsEmpty(location.search) ?? '?');\r\n updateX(url);\r\n }, [location.search, viewStateSearchParams.viewType, updateX, isMobile]);\r\n\r\n const { actions } = useSchedulerSlice();\r\n const events = useSelector(selectSchedulerParseEvents);\r\n const nonWorkingHours = useSelector(selectNonWorkingHours);\r\n const schedulerServices = useSelector(selectSchedulerServices);\r\n\r\n const viewState = useSelector(selectSchedulerViewState);\r\n const selectedMultipleEvents = useSelector(selectSelectedReservationEvents);\r\n\r\n useEffectOnMount(() => {\r\n dispatch(actions.init(viewStateSearchParams));\r\n });\r\n\r\n const handleViewModeChange: ViewModeChangeHandler = p => {\r\n dispatch(actions.changeViewMode(p));\r\n };\r\n\r\n const handleEdit: SchedulerEventEditHandler = React.useCallback(\r\n event => {\r\n dispatch(actions.edit(event));\r\n },\r\n [actions, dispatch],\r\n );\r\n const handleCreate = React.useCallback(\r\n (event: INewEvent | undefined) => {\r\n dispatch(\r\n actions.create(\r\n event === undefined\r\n ? undefined\r\n : {\r\n ...event,\r\n sample_run_id: searchParams.SampleRunId,\r\n un: searchParams.un ?? undefined,\r\n bid: searchParams.bid,\r\n srid: searchParams.srid,\r\n srrid: searchParams.srrid,\r\n duration: searchParams.duration,\r\n },\r\n ),\r\n );\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n searchParams.SampleRunId,\r\n searchParams.bid,\r\n searchParams.duration,\r\n searchParams.srid,\r\n searchParams.srrid,\r\n searchParams.un,\r\n ],\r\n );\r\n const selectedEquipment = useSelector(selectLoadedServices);\r\n\r\n if (viewState === undefined) {\r\n return <>;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n\r\n void 0}\r\n onViewModeChange={handleViewModeChange}\r\n onEdit={handleEdit}\r\n onCreate={handleCreate}\r\n reservationEditEvents={selectedMultipleEvents}\r\n savedListSettings={{\r\n enableSavedLists: true,\r\n savedListRelatedPickerName: 'EquipmentId',\r\n savedListSerializedKey: 'eid',\r\n }}\r\n />\r\n {selectedEquipment !== undefined && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * BooleanPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AutocompletePickerProps } from '../BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\nimport { TFunction } from 'i18next';\r\nimport { BaseOptionsPicker } from '../BasicPickers/BaseOptionsPicker';\r\n\r\nexport interface BooleanPickerProps\r\n extends Omit>, 'loadData'> {\r\n trueName?: string;\r\n falseName?: string;\r\n}\r\nexport const GetBooleanFilterOptions = (\r\n t: TFunction,\r\n trueName?: string,\r\n falseName?: string,\r\n) => {\r\n return [\r\n {\r\n Id: true,\r\n Name: !!trueName ? trueName : t(translations.Yes),\r\n },\r\n { Id: false, Name: !!falseName ? falseName : t(translations.No) },\r\n ];\r\n};\r\nexport function BooleanPicker(props: BooleanPickerProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const getOptions = () =>\r\n GetBooleanFilterOptions(t, props.trueName, props.falseName);\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\nimport { DialogAlertState } from './types';\r\n\r\nexport const initialState: DialogAlertState = {\r\n open: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'dialogAlert',\r\n initialState,\r\n reducers: {\r\n showAlert(state, action: PayloadAction) {\r\n state.open = true;\r\n state.content = action.payload;\r\n },\r\n hideAlert(state, action: PayloadAction) {\r\n state.open = false;\r\n state.content = undefined;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: dialogAlertActions } = slice;\r\n\r\nexport const useDialogAlertSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useAlertSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","/**\r\n *\r\n * ErrorBoundary\r\n *\r\n */\r\nimport { getLogger } from 'loglevel';\r\nimport * as React from 'react';\r\n\r\nexport class ErrorBoundary extends React.Component<\r\n { fallBack?: React.ReactElement; onError?: (error) => void },\r\n { hasError: boolean }\r\n> {\r\n private _log = getLogger('ErrorBoundary');\r\n private fallBack?: React.FC;\r\n private onError?: (error) => void;\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { hasError: false };\r\n this.fallBack = props.fallback;\r\n this.onError = props.onError;\r\n }\r\n\r\n static getDerivedStateFromError(error) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n componentDidCatch(error, errorInfo) {\r\n // You can also log the error to an error reporting service\r\n this.onError?.(errorInfo);\r\n this._log.error(error, errorInfo);\r\n }\r\n render() {\r\n if (this.state.hasError) {\r\n // You can render any custom fallback UI\r\n return this.props.fallBack ||

    Something went wrong.

    ;\r\n }\r\n return this.props.children;\r\n }\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Body, H3 } from 'app/components/Typography';\r\nimport { OpenMenuButton } from '../../TopBar/components/openMenuButton';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport styled from 'styled-components';\r\n\r\nexport interface TitlePageProps {\r\n // title of the current screen\r\n title: string;\r\n // link to open the details page as its own url on a new browser tab\r\n pageLink?: string;\r\n toPageLink?: string;\r\n useSidePanel?: boolean;\r\n buttonsLenth: number;\r\n expandPanel?: () => void;\r\n tooltip?: string;\r\n isCover?: boolean;\r\n toExpandPanel?: () => void;\r\n useShortView?: boolean;\r\n hideMenu?: boolean;\r\n}\r\nconst TitleSection = styled('div')`\r\n display: flex;\r\n gap: 4px;\r\n align-items: center;\r\n`;\r\nconst ShortTitle = styled('span')`\r\n cursor: pointer;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n word-break: break-all;\r\n`;\r\nexport function TitlePage(props: TitlePageProps) {\r\n const { t } = useTranslation();\r\n const {\r\n title,\r\n pageLink,\r\n toPageLink,\r\n useSidePanel,\r\n buttonsLenth,\r\n expandPanel,\r\n tooltip,\r\n isCover,\r\n toExpandPanel,\r\n useShortView,\r\n hideMenu,\r\n } = props;\r\n const [showCopy, setShowCopy] = React.useState(false);\r\n const [copied, setCopied] = React.useState(false);\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const showShortView = React.useMemo(() => {\r\n return (\r\n isMobile ||\r\n (useSidePanel && !sidePanelExpanded) ||\r\n isCover ||\r\n useShortView\r\n );\r\n }, [isCover, isMobile, sidePanelExpanded, useShortView, useSidePanel]);\r\n const truncatedTitle = React.useMemo(() => {\r\n return showCopy\r\n ? cliTruncate(\r\n title,\r\n buttonsLenth === 1\r\n ? isCover\r\n ? 22\r\n : 24\r\n : buttonsLenth === 2\r\n ? isCover\r\n ? 18\r\n : 18\r\n : isCover\r\n ? 14\r\n : 16,\r\n { position: 'middle' },\r\n )\r\n : cliTruncate(\r\n title,\r\n buttonsLenth === 1\r\n ? isCover\r\n ? 28\r\n : 30\r\n : buttonsLenth === 2\r\n ? isCover\r\n ? 22\r\n : 24\r\n : isCover\r\n ? 18\r\n : 20,\r\n { position: 'end' },\r\n );\r\n }, [buttonsLenth, isCover, showCopy, title]);\r\n const absolutePageLink = useAbsolute(pageLink, toPageLink);\r\n return pageLink || toPageLink ? (\r\n setShowCopy(true)}\r\n onMouseLeave={() => setShowCopy(false)}\r\n >\r\n {isMobile && !useSidePanel && !hideMenu && (\r\n \r\n )}\r\n {expandPanel && (\r\n \r\n \r\n \r\n )}\r\n {isMobile ? (\r\n \r\n \r\n {{title.replace(/-/g, '‑')}}\r\n \r\n \r\n ) : (\r\n \r\n {showShortView ? (\r\n \r\n \r\n {{title.replace(/-/g, '‑')}}\r\n \r\n \r\n ) : (\r\n

    {title}

    \r\n )}\r\n \r\n )}\r\n\r\n {showCopy && absolutePageLink !== undefined && !isMobile && (\r\n {\r\n navigator.clipboard.writeText(absolutePageLink);\r\n setCopied(true);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n ) : (\r\n \r\n {showShortView ? (\r\n \r\n \r\n {{truncatedTitle}}\r\n \r\n \r\n ) : (\r\n

    {title}

    \r\n )}\r\n
    \r\n );\r\n}\r\n","import htmlParse from 'html-react-parser';\r\nimport { Mention } from '../RichTextEditor/RichEditor';\r\n\r\nexport const parse = (text: string) => {\r\n const options = {\r\n replace: (domNode: any) => {\r\n if (domNode.attribs?.class === 'MENTION') {\r\n const attribs = domNode.attribs;\r\n return (\r\n \r\n );\r\n }\r\n },\r\n };\r\n return htmlParse(text, options);\r\n};\r\n","import { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { groupBy, values } from 'lodash';\r\nimport {\r\n IEquipmentOfflineServiceTypeDto,\r\n IReservationEquipmentDto,\r\n} from './types';\r\n\r\n/**\r\n * Combines offline services from multiple instrument into a single list.\r\n * E.g. on multi instrument reservations, offline services section is shared across all instruments\r\n * @param equipments online services\r\n * @returns list of offline service types applicable to selected services\r\n */\r\nexport function combineOfflineServiceTypes(\r\n equipments: IReservationEquipmentDto[] | undefined,\r\n): IEquipmentOfflineServiceTypeDto[] | undefined {\r\n if (equipments === undefined) {\r\n return undefined;\r\n }\r\n let haidProject = equipments.every(f => f.HideProjects === true);\r\n return (\r\n values(\r\n groupBy(\r\n equipments\r\n //ignore equipments without offline services enabled\r\n .filter(f => f.ReservationOfflineServicesEnabled)\r\n .flatMap(f => f.OfflineServices),\r\n f => f.Id,\r\n ),\r\n )\r\n // offline service must be enabled on each instrument\r\n .filter(group => group.length === equipments.length)\r\n // offline service is mandatory if it's mandatory on one of the instruments\r\n .map(f => {\r\n return {\r\n ...f[0],\r\n Mandatory: f.some(g => g.Mandatory),\r\n };\r\n })\r\n .filter(o => o.HideProject === haidProject)\r\n );\r\n}\r\nexport function combineMandatoryOfflineServices(\r\n services: IOtherServices[] | undefined,\r\n): IOtherServices[] | undefined {\r\n if (services === undefined) {\r\n return undefined;\r\n }\r\n return values(groupBy(services, f => f.ServiceTypeID)).map(f => {\r\n return f[0];\r\n });\r\n}\r\n","/**\r\n *\r\n * TrainingSessionPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport i18next from 'i18next';\r\n\r\nexport type UserUrl = 'restricted' | 'full' | 'admin';\r\nexport interface TrainingSessionPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n selectArray?: Array;\r\n}\r\n\r\nconst url = '/api/odata/v4/TrainingSessions';\r\nexport const generateTrainingSessionName = (\r\n dto: ITrainingSessionDto,\r\n): ITrainingSessionDto => {\r\n let name = `${dateUtils.format(\r\n dto.StartDate,\r\n dateUtils.DateIOFormats.fullDateTime,\r\n )} ${dto.Duration}(h) ${dto.Trainer} ${\r\n dto.RemainedSlots === null\r\n ? i18next.t(translations.MaxAttendees_NA)\r\n : dto.RemainedSlots\r\n }`;\r\n return Object.assign({}, dto, { Name: name });\r\n};\r\nexport const initSessionsData = (id: string) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'StartDate asc',\r\n $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response =>\r\n (response.value as ITrainingSessionDto[]).map(f =>\r\n generateTrainingSessionName(f),\r\n ) as Entity[],\r\n );\r\n};\r\n\r\nexport function TrainingSessionPicker(props: TrainingSessionPickerProps) {\r\n const { t } = useTranslation();\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: props.predicates,\r\n select: props.selectArray ?? [\r\n 'Id',\r\n 'Name',\r\n 'StartDate',\r\n 'EndDate',\r\n 'RemainedSlots',\r\n 'TrainingState',\r\n 'Trainer',\r\n 'Duration',\r\n ],\r\n transformModel: generateTrainingSessionName,\r\n });\r\n return (\r\n \r\n );\r\n}\r\nexport function ReservRelatedFilter(\r\n EquipmentId?: number,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (EquipmentId !== undefined) {\r\n predicates.push(\r\n new Condition(\r\n 'ServiceId',\r\n ODataOperators.Equals,\r\n EquipmentId,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n","/**\r\n *\r\n * RemindBeforPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RemindBefore } from 'enums/RemindBefore';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RemindBeforePickerProps\r\n extends Omit>, 'getOptions'> {}\r\nexport const getSingleReminder = (val: number): Entity => {\r\n return enumToEntityArray(RemindBefore).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\nexport const initRemindBeforeData = (\r\n initval: number | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSingleReminder(initval)]);\r\n });\r\n }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(RemindBefore);\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\nexport function RemindBeforePicker(props: RemindBeforePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * WorkflowBookingPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkflowBookingDto } from 'api/odata/generated/entities/IWorkflowBookingDto';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface WorkflowBookingPickerProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/WorkflowBooking';\r\nexport const initWorkflowBookingData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,UserName',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport function WorkflowBookingPicker(props: WorkflowBookingPickerProps) {\r\n const loadData = getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: props.predicates,\r\n select: ['Id', 'Name', 'UserName'],\r\n });\r\n return (\r\n \r\n );\r\n}\r\n","export enum UserGroupsProviderTypes {\r\n /// \r\n /// user groups are sourced internally\r\n /// \r\n SQL,\r\n /// \r\n /// user groups are taken externally from AD\r\n /// \r\n AD,\r\n /// \r\n /// Same as AD, except:\r\n /// User will keep his (SQL) group after his (AD) group was removed\r\n /// \r\n Combo,\r\n}\r\n\r\nexport enum AutoMode {\r\n /// \r\n /// Usage enabled on equipment\r\n /// \r\n LocalAppEnabled = 1,\r\n /// \r\n /// Usage disabled on equipment\r\n /// \r\n LocalAppDisabled = 2,\r\n}\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n tableRoot: {\r\n // paddingInline: theme.spacing(2),\r\n },\r\n filterPanel: {\r\n padding: theme.spacing(1),\r\n },\r\n tableScrolling: {\r\n width: '100%',\r\n height: '100%',\r\n overflow: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n height: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n tableContent: {\r\n padding: theme.spacing(0, 2, 0, 4),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n /* will cause table footer to be at the bottom of the screen */\r\n //height: '100%',\r\n justifyContent: 'space-between',\r\n overflowY: 'hidden',\r\n '&.tablePaddingDense': {\r\n padding: '0',\r\n },\r\n },\r\n tableContentShort: {\r\n padding: theme.spacing(0, 1, 0, 2),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n height: '100%',\r\n justifyContent: 'space-between',\r\n overflowY: 'hidden',\r\n width: '100%',\r\n '&.tablePaddingDense': {\r\n padding: '0',\r\n },\r\n },\r\n table: {\r\n backgroundColor: theme.palette.background.paper,\r\n whiteSpace: 'pre',\r\n '&.withFooter': {\r\n borderRadius: '8px 8px 0px 0px',\r\n },\r\n },\r\n tableButtonsRoot: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n padding: '8px 32px 16px',\r\n gap: theme.spacing(1.5),\r\n flexWrap: 'wrap',\r\n '&.tablePaddingDense': {\r\n padding: '8px 0px 16px',\r\n },\r\n },\r\n tableButtonsRootShort: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'space-between',\r\n alignItems: 'normal',\r\n padding: '8px 16px 16px',\r\n gap: theme.spacing(1.5),\r\n '&.tablePaddingDense': {\r\n padding: '8px 0px 16px',\r\n },\r\n },\r\n filterDisplayRoot: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n padding: '0px 32px 16px',\r\n gap: theme.spacing(2),\r\n flexWrap: 'wrap',\r\n },\r\n filterDisplayRootShort: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'normal',\r\n justifyContent: 'flex-start',\r\n padding: '0px 32px 16px',\r\n gap: theme.spacing(2),\r\n flexWrap: 'wrap',\r\n },\r\n tableButtonsLeft: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: theme.spacing(1.5),\r\n flexWrap: 'wrap',\r\n },\r\n tableButtonsLeftShort: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: theme.spacing(1.5),\r\n flexWrap: 'wrap',\r\n justifyContent: 'space-between',\r\n maxWidth: '90%',\r\n },\r\n tableButtonWrap: {\r\n flexWrap: 'wrap',\r\n },\r\n tableButtonNoWrap: {\r\n flexWrap: 'nowrap',\r\n },\r\n tableButtonsRight: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: theme.spacing(1),\r\n marginLeft: 'auto',\r\n },\r\n tableButtonsRightShort: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: theme.spacing(1),\r\n justifyContent: 'space-between',\r\n },\r\n menuPaper: {\r\n width: '160px',\r\n },\r\n subHeader: {\r\n // same padding as in all child elements of the table container\r\n padding: '0px 32px 16px',\r\n },\r\n isAggregated: {\r\n fontWeight: 'bold',\r\n },\r\n tableFooter: {\r\n width: '100%',\r\n backgroundColor: bookitColors.base.white,\r\n minHeight: '42px',\r\n overflowX: 'auto',\r\n '&::-webkit-scrollbar': {\r\n height: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n // '&.tableFooterShortView': {\r\n // minHeight: '56px',\r\n // },\r\n },\r\n tableFooterWithBorder: {\r\n border: '1px solid ' + theme.palette.divider,\r\n borderTop: `1px solid ${theme.palette.common.grayBorders}`,\r\n borderRadius: '5px',\r\n borderTopLeftRadius: '0px',\r\n borderTopRightRadius: '0px',\r\n },\r\n}));\r\n","import * as React from 'react';\r\nimport { IFilterSettings } from './BasicFilter/IFilterSettings';\r\nimport { filterKey } from './BasicFilter/utils';\r\nimport { EntityType } from 'types/common';\r\n\r\n/**\r\n * Memoes the array of filter to be used in the fetch data functions. Tracks the current state of the filters by the filter key (fieldName,fieldName1/etc) + filter value without the display name in case of Entity value\r\n * @param props\r\n * @returns\r\n */\r\nexport const useMemoFilters = (props: {\r\n appliedFilters?: IFilterSettings[];\r\n}) => {\r\n const nonEmpty = props.appliedFilters?.filter(\r\n f => f.value !== null && f.value !== undefined,\r\n );\r\n const singleValueToId = value => {\r\n return (value as EntityType)?.Id !== undefined\r\n ? (value as EntityType)?.Id\r\n : value;\r\n };\r\n\r\n const singleValue = value => {\r\n return Array.isArray(value)\r\n ? value.map(singleValueToId)\r\n : singleValueToId(value);\r\n };\r\n const mapped = nonEmpty?.map(f => ({\r\n key: filterKey(f),\r\n value: singleValue(f.value),\r\n operator: f.operator,\r\n isInversed: f.isInversed,\r\n initCompleted: f.initCompleted ?? false,\r\n }));\r\n\r\n const customFilter = React.useMemo(() => {\r\n const result = nonEmpty;\r\n return result;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [JSON.stringify(mapped)]);\r\n return customFilter;\r\n};\r\n","/**\r\n *\r\n * ValueLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ValueLabelProps {\r\n value: string | number | undefined | null;\r\n}\r\n\r\nexport function ValueLabel({ value }: ValueLabelProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const isEmpty =\r\n value === undefined ||\r\n value === null ||\r\n (typeof value === 'string' && value.trim() === '');\r\n const displayValue = isEmpty ? t(translations.NA) : value;\r\n return <>{displayValue};\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { TabPanelWrapper } from '../TabsWrapper';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TabPanelProps {\r\n children?: React.ReactNode;\r\n index: any;\r\n value: any;\r\n styles?: React.CSSProperties;\r\n tabsId: string;\r\n tabsPanelId: string;\r\n scrollableContent?: boolean;\r\n}\r\n\r\nexport function TabPanel(props: TabPanelProps) {\r\n const {\r\n tabsPanelId,\r\n tabsId,\r\n children,\r\n value,\r\n index,\r\n styles,\r\n scrollableContent,\r\n ...other\r\n } = props;\r\n const theme = useTheme();\r\n return (\r\n
    \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { FormAutocompleteMulti } from 'app/components/Forms/FormAutocompleteMulti';\r\nimport { FormAutocomplete } from 'app/components/Forms/FormAutocomplete';\r\n\r\nconst url = '/api/odata/v4/UserFilter/GetUserSelections';\r\nexport const initUserData = (\r\n id: string,\r\n formField: IFormFieldDto | undefined,\r\n) => {\r\n let filter: string | undefined = '';\r\n const initids = id.split(',').map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n if (formField) {\r\n if (\r\n formField.UserSelectionType === 'FixedRoles' &&\r\n formField.FixedRoles !== null &&\r\n formField.FixedRoles !== ''\r\n ) {\r\n let ids = formField.FixedRoles.split(',').map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n filter = new Condition(\r\n 'UserRoles',\r\n ODataOperators.AnyIn,\r\n ids,\r\n 'Name',\r\n ).toString();\r\n }\r\n if (\r\n formField.UserSelectionType === 'CustomRoles' &&\r\n formField.CustomRoles !== null &&\r\n formField.CustomRoles !== ''\r\n ) {\r\n let ids = formField.CustomRoles.split(',')\r\n .map(item => {\r\n let id = item.split('#');\r\n return { Id: parseInt(id[0]) };\r\n })\r\n .filter(item => !isNaN(item.Id)) as Identifiable[];\r\n filter = new Condition(\r\n 'CustomRoles',\r\n ODataOperators.AnyIn,\r\n ids,\r\n 'Id',\r\n ).toString();\r\n }\r\n }\r\n if (filter !== '') {\r\n filter += ` and ${new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n initids,\r\n ).toString()}`;\r\n } else {\r\n filter = new Condition('Id', ODataOperators.Includes, initids).toString();\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filter,\r\n $select: 'Id,Name,UserRoles,CustomRoles',\r\n $skip: 0,\r\n $top: initids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport const getGetUserSelectionsAutocompleteFn = (\r\n formField: Pick<\r\n IFormFieldDto,\r\n 'UserSelectionType' | 'FixedRoles' | 'CustomRoles'\r\n >,\r\n) => (searchTerm: string | null) => {\r\n const params: {\r\n $orderby: string;\r\n $top: number;\r\n $filter?: string;\r\n $select?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,UserRoles,CustomRoles',\r\n $top: 100,\r\n };\r\n const predicates: Condition[] = [];\r\n if (\r\n formField.UserSelectionType === 'FixedRoles' &&\r\n formField.FixedRoles !== null &&\r\n formField.FixedRoles !== ''\r\n ) {\r\n let ids = formField.FixedRoles.split(',').map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n predicates.push(\r\n new Condition('UserRoles', ODataOperators.AnyIn, ids, 'Name'),\r\n );\r\n }\r\n if (\r\n formField.UserSelectionType === 'CustomRoles' &&\r\n formField.CustomRoles !== null &&\r\n formField.CustomRoles !== ''\r\n ) {\r\n let ids = formField.CustomRoles.split(',')\r\n .map(item => {\r\n let id = item.split('#');\r\n return { Id: parseInt(id[0]) };\r\n })\r\n .filter(item => !isNaN(item.Id)) as Identifiable[];\r\n predicates.push(\r\n new Condition('CustomRoles', ODataOperators.AnyIn, ids, 'Id'),\r\n );\r\n }\r\n if (searchTerm !== null || predicates.length > 0) {\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm ?? undefined,\r\n }).toString();\r\n }\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function CustomFormUserSelection({\r\n formField,\r\n readonly,\r\n parentValue,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n const loadData = getGetUserSelectionsAutocompleteFn(formField);\r\n return (\r\n \r\n {formField.IsMultiple ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.repetitive || initialState;\r\n\r\nexport const selectRepetitive = createSelector([selectSlice], state => state);\r\n\r\nexport const selectRepetitiveProcessing = createSelector(\r\n [selectRepetitive],\r\n state => state.processing,\r\n);\r\n\r\nexport const selectRepetitiveError = createSelector(\r\n [selectRepetitive],\r\n state => state.error,\r\n);\r\n\r\nexport const selectRepetitiveData = createSelector(\r\n [selectRepetitive],\r\n state => state.data,\r\n);\r\nexport const selectRepetitiveFieldHandler = createSelector(\r\n [selectRepetitive],\r\n state => state.repetitiveValueHandler,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst filter = 'ServiceTypeId eq 3 and Active eq true';\r\nexport interface SampleTypePickerProps\r\n extends Omit>, 'url'> {}\r\n\r\nexport const initSampleTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new ODataFilterBuilder>({\r\n predicates: [filter, new Condition('Id', ODataOperators.Equals, id)],\r\n stringColumns: [],\r\n }).toString(),\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport const SampleTypePicker = (props: SampleTypePickerProps) => {\r\n const { queryfilter, ...other } = props;\r\n const predicate =\r\n queryfilter && queryfilter !== ''\r\n ? [queryfilter, filter].join(' and ')\r\n : filter;\r\n return (\r\n \r\n );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport {\r\n OfflineServiceTypePicker,\r\n OfflineServiceTypePickerProps,\r\n} from '../pickers/AutocompletePickers/OfflineServiceTypePicker';\r\n\r\nexport const FormOfflineServiceTypePicker = (\r\n props: FieldHookConfig &\r\n Omit,\r\n) => {\r\n const [field, meta, helpers] = useField(\r\n props,\r\n );\r\n const handleChange = val => {\r\n props.onChange?.(val);\r\n helpers.setValue(val, true);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","import useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport React from 'react';\r\nimport { RegionDetailsProps } from './RegionsDetailsPage/Details';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { IRegionDto } from './IRegionDto';\r\n\r\nexport interface RegionLinkProps {\r\n id: number;\r\n children: React.ReactNode;\r\n title?: string;\r\n useSidePanel?: boolean;\r\n initialModel?: IRegionDto;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}\r\n\r\nexport const RegionLink = (props: RegionLinkProps) => {\r\n const { t } = useTranslation();\r\n const openRegion = useOpenRegionPopUp();\r\n\r\n const open = () => {\r\n openRegion(\r\n {\r\n id: props.id,\r\n useSidePanel: props.useSidePanel,\r\n initialModel: props.initialModel,\r\n },\r\n props.openPanelWithCover,\r\n );\r\n };\r\n return (\r\n \r\n open()} color=\"textPrimary\">\r\n {props.children}\r\n \r\n \r\n );\r\n};\r\n\r\nexport const useOpenRegionPopUp = () => {\r\n const { openPanel } = useSidePanelState();\r\n\r\n return React.useCallback(\r\n (\r\n props: { id: number; useSidePanel?: boolean; initialModel?: IRegionDto },\r\n openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n ) => {\r\n const identifier = props.id;\r\n if (identifier !== undefined) {\r\n const popupProps: RegionDetailsProps = {\r\n id: '' + props.id,\r\n initialModel: props.initialModel,\r\n useSidePanel: props.useSidePanel ?? false,\r\n };\r\n if (!!openPanelWithCover) {\r\n openPanelWithCover({\r\n renderPageType: RenderPageType.RegionDetails,\r\n renderPageProps: popupProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n });\r\n } else {\r\n openPanel({\r\n renderPageType: RenderPageType.RegionDetails,\r\n renderPageProps: popupProps,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState);\r\n }\r\n }\r\n },\r\n [openPanel],\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport { RadioGroup, RadioGroupProps } from '../RadioGroup';\r\nimport FormControl from '@material-ui/core/FormControl';\r\nimport { FormHelperText, FormLabel, styled } from '@material-ui/core';\r\nimport { useIsRequired } from './ValidationSchemaProvider';\r\nimport { buttonM, buttonS } from 'styles/typography/bookitTypography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\n\r\nexport type FormRadioGroupProps = FieldHookConfig & RadioGroupProps;\r\nexport const FormRadioGroup = ({\r\n id,\r\n label,\r\n onChange,\r\n value,\r\n name,\r\n error,\r\n title,\r\n helperText,\r\n info,\r\n required,\r\n ...props\r\n}: FieldHookConfig & RadioGroupProps) => {\r\n const [field, meta] = useField({ name, ...props });\r\n const handleChange = (value, event) => {\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n field.onChange(event);\r\n };\r\n const { submitCount } = useFormikContext();\r\n const isRequired = useIsRequired(name);\r\n const hasError = meta?.error !== undefined;\r\n const showError = hasError && (meta.touched || submitCount > 0);\r\n return (\r\n \r\n \r\n {label} {info && }\r\n \r\n {title && {title}}\r\n \r\n \r\n {showError ? meta.error : helperText}\r\n \r\n \r\n );\r\n};\r\n\r\n// spacing is needed in the quizzes\r\nconst StyledFormControl = styled(FormControl)(props => ({\r\n marginBottom: props.theme.spacing(0),\r\n}));\r\n\r\n// the label needs to be stronger in quizzes\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n color: theme.palette.common.blackRegular,\r\n ...buttonM,\r\n '&[class*=\"Mui-focused\"]': {\r\n color: theme.palette.common.blackRegular,\r\n },\r\n}));\r\n// the label needs to be stronger in quizzes\r\nconst StyledFormTitle = styled('label')(({ theme }) => ({\r\n color: theme.palette.common.blackRegular,\r\n ...buttonS,\r\n fontStyle: 'italic',\r\n marginBottom: theme.spacing(3),\r\n}));\r\nconst StyledFormHelperText = styled(FormHelperText)(props => ({\r\n // empty helperText results in zero element height. So when field is validated the appearance of the\r\n // error message in the helperText causes the form element to increase in height and forces a redraw\r\n // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n '&::before': {\r\n content: '\"\\\\00a0\"',\r\n },\r\n}));\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { FormRadioGroup } from 'app/components/Forms/FromRadioGroup';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function CustomFormAnswerQuestions({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n const { t } = useTranslation();\r\n const options = getOptions(formField);\r\n const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n return (\r\n \r\n );\r\n}\r\nconst indexToAlpha = (index: number): string => {\r\n return (index + 10).toString(36);\r\n};\r\n\r\nconst getOptions = (formField: IFormFieldDto): Entity[] => {\r\n switch (formField.OptionsSourceType) {\r\n case 'SimpleList':\r\n return (\r\n formField.Options?.split(';').map((s, index) => ({\r\n Id: s,\r\n Name: `${indexToAlpha(index)}. ${s}`,\r\n })) ?? []\r\n );\r\n default:\r\n console.error(\r\n `OptionsSourceType ${formField.OptionsSourceType} is not implemented`,\r\n );\r\n return [];\r\n }\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\n\r\nexport function CustomFormCheckBox({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport function CustomFormDate({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\n\r\nexport function CustomFormDisclimer({\r\n formField,\r\n readonly,\r\n disabled,\r\n required,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormEmail({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormNumberText({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormParagraph } from 'app/components/Forms/FormParagraph';\r\nimport parse from 'html-react-parser';\r\nexport function CustomFormParagraph({\r\n formField,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n }\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormPositiveNumberText({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormRadioGroup\r\n *\r\n */\r\nimport React from 'react';\r\n\r\nimport { FormRadioGroup } from 'app/components/Forms/FromRadioGroup';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function CustomFormRadioGroup({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n const options = getOptions(formField);\r\n\r\n //const title = formField.Description ?? undefined;\r\n return (\r\n \r\n );\r\n}\r\n\r\nconst getOptions = (formField: IFormFieldDto): Entity[] => {\r\n if (formField) {\r\n return createOptions(formField);\r\n } else {\r\n return [] as Entity[];\r\n }\r\n};\r\nconst createOptions = (field: IFormFieldDto): Entity[] => {\r\n if (field.Options && field.Options !== null) {\r\n switch (field.OptionsSourceType) {\r\n case 'Internal':\r\n return deserializeOptions(field.Options);\r\n\r\n case 'SimpleList':\r\n return deserializeOptions(field.Options.split(','));\r\n case 'External':\r\n return [] as Entity[];\r\n }\r\n } else {\r\n return [] as Entity[];\r\n }\r\n};\r\nconst deserializeOptions = (options: any): Entity[] => {\r\n let optsArray = [] as Entity[];\r\n if (Array.isArray(options)) {\r\n optsArray = options.map(opt => {\r\n return { Id: opt, Name: opt } as Entity;\r\n });\r\n } else {\r\n try {\r\n let items = JSON.parse(options);\r\n if (Array.isArray(items)) {\r\n let arr = items.map(o => {\r\n if (typeof o == 'string') {\r\n return { Id: o, Name: o, Parent: null } as Entity;\r\n } else if (o.hasOwnProperty('id') && o.hasOwnProperty('text')) {\r\n return {\r\n Id: o.id,\r\n Name: o.text,\r\n } as Entity;\r\n } else {\r\n return undefined;\r\n }\r\n });\r\n optsArray =\r\n (arr.filter(o => o !== undefined) as Entity[]) ||\r\n ([] as Entity[]);\r\n }\r\n return optsArray;\r\n } catch {\r\n return optsArray;\r\n }\r\n }\r\n\r\n return optsArray;\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\n\r\nexport function CustomFormRichText({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormShortText({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { FieldTypesUnion } from 'api/odata/generated/enums/FieldTypes';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { CustomFormAnswerQuestions } from './CustomFormFields/CustomFormAnswerQuestions';\r\nimport { CustomFormCheckBox } from './CustomFormFields/CustomFormCheckBox';\r\nimport { CustomFormDate } from './CustomFormFields/CustomFormDate';\r\nimport { CustomFormDisclimer as CustomFormDisclaimer } from './CustomFormFields/CustomFormDisclimer';\r\nimport { CustomFormDropDown } from './CustomFormFields/CustomFormDropDown';\r\nimport { CustomFormEmail } from './CustomFormFields/CustomFormEmail';\r\nimport { CustomFormFileUpload } from './CustomFormFields/CustomFormFileUpload';\r\nimport { CustomFormNumberText } from './CustomFormFields/CustomFormNumberText';\r\nimport { CustomFormParagraph } from './CustomFormFields/CustomFormParagraph';\r\nimport { CustomFormPositiveNumberText } from './CustomFormFields/CustomFormPositiveNumber';\r\nimport { CustomFormRadioGroup } from './CustomFormFields/CustomFormRadioGroup';\r\nimport { CustomFormRichText } from './CustomFormFields/CustomFormRichText';\r\nimport { CustomFormShortText } from './CustomFormFields/CustomFormShortText';\r\nimport { CustomFormUserSelection } from './CustomFormFields/CustomFormUserSelection';\r\n\r\nexport interface CustomFormFieldProps {\r\n name: string;\r\n id: string;\r\n formField: IFormFieldDto;\r\n readonly?: boolean;\r\n parentValue?: Entity[];\r\n disabled?: boolean;\r\n onChange?: (value: any) => void;\r\n autoFocus?: boolean;\r\n required?: boolean;\r\n}\r\nexport function CustomFormField({\r\n formField,\r\n readonly,\r\n disabled,\r\n onChange,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n const requireComponent = (\r\n type: FieldTypesUnion,\r\n ): React.FC => {\r\n switch (type) {\r\n case 'MultipleAnswersQuestion':\r\n return CustomFormAnswerQuestions;\r\n case 'RadioButtons':\r\n return CustomFormRadioGroup;\r\n case 'CheckBox':\r\n return CustomFormCheckBox;\r\n case 'Disclaimer':\r\n return CustomFormDisclaimer;\r\n case 'Date':\r\n return CustomFormDate;\r\n case 'DropDownList':\r\n return CustomFormDropDown;\r\n case 'Email':\r\n return CustomFormEmail;\r\n case 'Number':\r\n return CustomFormNumberText;\r\n case 'PositiveNumber':\r\n return CustomFormPositiveNumberText;\r\n case 'Paragraph':\r\n return CustomFormParagraph;\r\n case 'RichText':\r\n return CustomFormRichText;\r\n case 'ShortText':\r\n return CustomFormShortText;\r\n case 'UserSelection':\r\n return CustomFormUserSelection;\r\n case 'File':\r\n return CustomFormFileUpload;\r\n case 'AlphanumericWithDashes':\r\n return CustomFormShortText;\r\n case 'FormSection':\r\n return CustomFormParagraph;\r\n default:\r\n assertExhaustive(type);\r\n }\r\n };\r\n const Component = requireComponent(formField.Type);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n bookitlab: () => _t(translations.BookitLab),\r\n};\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerState } from '../types/ISchedulerState';\r\nimport { ISchedulerParseEvent } from '../types/ISchedulerParseEvent';\r\nimport { ISchedulerEvent } from '../types/ISchedulerEvent';\r\nimport { EventType } from '../slice/types';\r\nimport { omit } from 'lodash';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\n/**\r\n * Syncs the event provided from outside of the scheduler (props,state,etc.) into the scheduler instance\r\n * @param scheduler Scheduler instance\r\n * @param type event type\r\n * @param items events array\r\n * @param mapfn mapping from event to the type parsable by the scheduler\r\n * @returns nothing\r\n */\r\nexport function syncSchedulerEvents(\r\n scheduler: DHTMLX.SchedulerStatic | undefined,\r\n items: Array | undefined,\r\n) {\r\n if (scheduler === undefined) {\r\n return;\r\n }\r\n\r\n // events internally stored on the scheduler instance (not a part of a public API)\r\n const _events = (scheduler as any)['_events'] as Record;\r\n const mappedEvents = items ?? [];\r\n\r\n //cleanup events\r\n const mappedEventIds = new Set(mappedEvents.map(f => f.id));\r\n // clear currently displayed items on the current period\r\n // and replace these with the fresh data from the store\r\n // events need to be deleted in case and new filter has been applied\r\n const state: ISchedulerState = scheduler.getState();\r\n scheduler\r\n .getEvents(state.min_date, state.max_date)\r\n .filter(\r\n (f: ISchedulerEvent) =>\r\n typeof f.id === 'number' || !mappedEventIds.has(f.id),\r\n )\r\n .filter(event => event.type !== undefined)\r\n .forEach(event => delete _events[event.id]);\r\n if (items !== undefined && items.length > 0) {\r\n //push items into the the scheduler\r\n scheduler.parse(mappedEvents);\r\n }\r\n}\r\n\r\nexport function mapEvents<\r\n TIn extends object =\r\n | ITrainingSessionSlotDto\r\n | IWorkingHoursDto\r\n | ICalendarReservationDto\r\n>(\r\n type: EventType,\r\n items: Array | undefined,\r\n mapfn: (\r\n item: TIn,\r\n ) => Omit,\r\n) {\r\n const mappedEvents =\r\n items?.map(item => {\r\n const original: Omit = omit(item, 'Id') as Omit<\r\n TIn,\r\n 'Id'\r\n >;\r\n const result = {\r\n type: type,\r\n ...mapfn(item),\r\n\r\n original: original,\r\n };\r\n return result;\r\n }) ?? [];\r\n return mappedEvents;\r\n}\r\n","import { httpClient } from './HttpClient';\r\nimport { UpdateFilesModel } from 'utils/fileStoreHelper';\r\n\r\nexport const FileStoreApi = {\r\n saveFormFiles: (payload: UpdateFilesModel[]) => {\r\n const url = `/api/odata/v4/files/InsertFormFile`;\r\n const form = new FormData();\r\n form.append('TypeId', payload[0].typeId as any);\r\n form.append('ReferenceId', payload[0].referenceId as any);\r\n form.append('FormTypeId', payload[0].formType as any);\r\n form.append('UpdateOption', payload[0].updateOption as any);\r\n form.append('AlertTypeId', payload[0].alertTypeId as any);\r\n let added = payload.filter(f => f.operation === 'added')[0];\r\n if (!!added && added.files.length > 0) {\r\n added.files.forEach((file, ind) => {\r\n form.append(\r\n `FormField_${file.Id}_${ind}`,\r\n file.PostedFile ?? file.Id.toString(),\r\n file.PostedFile === null ? undefined : file.PostedFile.name,\r\n );\r\n });\r\n }\r\n return httpClient.post(url, form);\r\n },\r\n updateFormFiles: (payload: UpdateFilesModel[]) => {\r\n const url = `/api/odata/v4/files/UpdateFormFile`;\r\n const form = new FormData();\r\n form.append('TypeId', payload[0].typeId as any);\r\n form.append('ReferenceId', payload[0].referenceId as any);\r\n form.append('FormTypeId', payload[0].formType as any);\r\n form.append('UpdateOption', payload[0].updateOption as any);\r\n form.append('AlertTypeId', payload[0].alertTypeId as any);\r\n let deleted = payload.filter(f => f.operation === 'removed')[0];\r\n let added = payload.filter(f => f.operation === 'added')[0];\r\n if (!!deleted) {\r\n deleted.files.forEach((f, ind) => {\r\n form.append(`deleted_${ind}`, `FormField_${f.Id}_${f.Value}`);\r\n });\r\n }\r\n if (!!added && added.files.length > 0) {\r\n added.files.forEach((file, ind) => {\r\n form.append(\r\n `FormField_${file.Id}_${ind}`,\r\n file.PostedFile ?? file.Id.toString(),\r\n file.PostedFile === null ? undefined : file.PostedFile.name,\r\n );\r\n });\r\n }\r\n return httpClient.post(url, form);\r\n },\r\n};\r\n","import { useEffect, useRef } from 'react';\r\n\r\nexport function usePrevious(value: T): T | undefined {\r\n const ref = useRef();\r\n useEffect(() => {\r\n ref.current = value;\r\n }, [value]);\r\n return ref.current;\r\n}\r\n","import { Roles } from 'app/slice/types';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IFixedRoleDto } from './IFixedRolesDto';\r\nimport { IServiceTypeFilterDto } from './IServiceTypeFilterDto';\r\nimport { IUserGroupDto } from './IUserGroupDto';\r\n\r\n/**\r\n *\r\n * auto generated interface for bkt_webApp.Api.OData.V4.Dto.UserFilterDto\r\n *\r\n */\r\nexport interface IUserFilterDto extends Identifiable {\r\n Id: string;\r\n Name: string;\r\n UserGroupId: string | null;\r\n UserGroupName: string | null;\r\n UserGroups: IUserGroupDto[];\r\n Budgets: number[];\r\n UserRoles: IFixedRoleDto[];\r\n CustomRoles: Entity[];\r\n Services: IServiceTypeFilterDto[];\r\n ServiceGroupIds: number[];\r\n IsAdminPanel: boolean;\r\n IsGroupAdmin: boolean;\r\n IsEquipmentAdmin: boolean;\r\n IsLabTech: boolean;\r\n AssetIds: number[];\r\n InstituteId: number | null;\r\n StaffEquipmentId: number | null;\r\n DefaultBudgetId: number | null;\r\n}\r\nexport const convertAuthToIUserFilterDto = (\r\n user: AuthenticatedUser,\r\n): IUserFilterDto => {\r\n return {\r\n Id: user.Id,\r\n Name: user.Name,\r\n UserGroupId: user.ActiveUserGroup?.Id,\r\n UserGroupName: user.ActiveUserGroup?.Name,\r\n Services: user.AdminEquipments.map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: f.ServiceTypeId,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n ServiceGroupIds: user.AdminServiceGroups.map(f => f.Id),\r\n IsAdminPanel: user.Roles.includes(Roles.Administrators),\r\n } as IUserFilterDto;\r\n};\r\n","export enum SamplePlatePositionNamingTypes {\r\n Alpha = 0,\r\n Numeric = 1,\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const CustomFormApi = {\r\n getAll: (key: number) => {\r\n const url = `/api/odata/v4/CustomForm(${key})`;\r\n return httpClient.get(url);\r\n },\r\n getSingle: (key: number, customFormId: number) => {\r\n const url = `/api/odata/v4/CustomForm(${key})`;\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n //$select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: `(Id eq ${customFormId})`,\r\n //$select: 'Id,Name,FormFields,ServiceGroups,Active,Type',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n};\r\n","import * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport * as Yup from 'yup';\r\nimport { FormikProps } from 'formik';\r\nimport { CustomFormField } from '../CustomFormFields';\r\nimport { getFieldsVisibilities } from '../CustomFormUtils';\r\nimport { ValidationSchemaProvider } from 'app/components/Forms/ValidationSchemaProvider';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { sortBy } from 'lodash';\r\n\r\nexport interface CustomFormContentProps {\r\n title?: string;\r\n formik: FormikProps>;\r\n schema: Yup.SchemaOf;\r\n formFields: IFormFieldDto[];\r\n validationEnabled?: boolean;\r\n isAdmin?: boolean;\r\n readonly?: boolean;\r\n disabled?: boolean;\r\n sectionStyles?: React.CSSProperties;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n}\r\nexport function CustomFormContent({\r\n title,\r\n formik,\r\n schema,\r\n formFields,\r\n validationEnabled,\r\n isAdmin,\r\n readonly,\r\n disabled,\r\n sectionStyles,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n}: CustomFormContentProps) {\r\n const isVisibleField = (\r\n field: IFormFieldDto,\r\n isAdmin: boolean,\r\n values: Record | undefined,\r\n visibleOnCompletion?: () => boolean,\r\n ): boolean => {\r\n let visibilities = getFieldsVisibilities(\r\n formFields,\r\n isAdmin,\r\n values,\r\n visibleOnCompletion,\r\n );\r\n if (visibilities) {\r\n return visibilities[field.Id];\r\n }\r\n return true;\r\n };\r\n const sortedActiveFormFields = React.useMemo(\r\n () =>\r\n sortBy(\r\n formFields.filter(f => f.Active === true),\r\n f => f.Index,\r\n ),\r\n [formFields],\r\n );\r\n return (\r\n \r\n \r\n {sortedActiveFormFields.map((formField, index) => {\r\n // paragraphs & form sections deserve to start from the new line in 2 column layout (full screen)\r\n const fullRow =\r\n formField.Type !== null &&\r\n ['Paragraph', 'FormSection'].includes(formField.Type);\r\n return (\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CustomForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport * as Yup from 'yup';\r\nimport { Formik } from 'formik';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport {\r\n serializeValues,\r\n IFormFileValue,\r\n useCustomFormSchema,\r\n} from '../../CustomFormUtils';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { CustomFormContent } from '../../CustomFormContent';\r\n\r\nexport interface CustomFormProps {\r\n formFields: IFormFieldDto[];\r\n formType: CustomFormTypeEnum;\r\n formValues?: Record;\r\n readonly?: boolean;\r\n onSubmit: (\r\n values: Record,\r\n files: IFormFileValue[],\r\n ) => void;\r\n bindSubmitForm?: any;\r\n isAdmin?: boolean;\r\n CustomFormId?: number;\r\n formName?: string;\r\n formIsValid?: (isValid: boolean) => void;\r\n disabled?: boolean;\r\n validationEnabled?: boolean;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n}\r\n\r\nexport interface CustomFormValue extends Record {}\r\n\r\nexport const CustomForm = React.memo(function CustomForm({\r\n formFields,\r\n formValues,\r\n onSubmit,\r\n readonly,\r\n bindSubmitForm,\r\n formName,\r\n isAdmin,\r\n disabled,\r\n formIsValid,\r\n validationEnabled,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n}: CustomFormProps) {\r\n const schema: Yup.SchemaOf = useCustomFormSchema(\r\n formFields,\r\n isAdmin || false,\r\n );\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n const { serialized, files } = serializeValues(formFields, value);\r\n onSubmit(serialized, files);\r\n }\r\n };\r\n\r\n const [initialValues, setInitialValues] = React.useState<\r\n Record | undefined\r\n >(undefined);\r\n useEffectOnMount(() => {\r\n setInitialValues(formValues);\r\n return () => {};\r\n });\r\n\r\n return initialValues ? (\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm?.(formik.submitForm);\r\n // if (!formik.isValid) {\r\n // console.log('Custom form errors', formik.errors);\r\n // }\r\n if (!!formIsValid) {\r\n formIsValid(formik.isValid);\r\n }\r\n return (\r\n
    \r\n \r\n \r\n );\r\n }}\r\n \r\n ) : (\r\n <>\r\n );\r\n});\r\n","import { Portal } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { CustomFormApi } from 'api/CustomFormApi';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { CustomForm } from 'app/components/CustomForm/CusomFormControl/Form';\r\nimport { initUserData } from 'app/components/CustomForm/CustomFormFields/CustomFormUserSelection';\r\nimport {\r\n DeserializeValue,\r\n IFormFileValue,\r\n orderFields,\r\n ParseFormFieldEnums,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport React from 'react';\r\nimport { MutableRefObject } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\nimport { InitFormFiles } from '../CustomFormFields/CustomFormFileUpload';\r\n\r\nexport interface CustomFormControlProps {\r\n CustomFormId: number;\r\n FormType: CustomFormTypeEnum;\r\n values?: IFormValueDto[];\r\n submitFormRef: MutableRefObject;\r\n saveFormValues: (\r\n values: IFormValueDto[],\r\n files: IFormFileValue[],\r\n originalFiles: IFormFileValue[],\r\n ) => void;\r\n isAdmin?: boolean;\r\n formIsValid?: (isValid: boolean) => void;\r\n readonly?: boolean;\r\n formName?: string;\r\n disabled?: boolean;\r\n onLoadCompleted?: () => void;\r\n onLoadStarted?: () => void;\r\n validationEnabled?: boolean;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n}\r\n\r\nexport function CustomFormControl(props: CustomFormControlProps) {\r\n const {\r\n CustomFormId,\r\n values,\r\n submitFormRef,\r\n saveFormValues,\r\n FormType,\r\n isAdmin,\r\n formIsValid,\r\n readonly,\r\n formName,\r\n disabled,\r\n onLoadCompleted,\r\n onLoadStarted,\r\n validationEnabled,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n } = props;\r\n\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const [originalFiles, setOriginalFiles] = React.useState(\r\n [],\r\n );\r\n // const [currentFormId, setCurrentFormId] = React.useState(\r\n // CustomFormId,\r\n // );\r\n const fetchCustomForm = async (formType: number, customFormId: number) =>\r\n CustomFormApi.getSingle(formType, customFormId).then(response => {\r\n let item = response.value[0] as ICustomFormDto;\r\n ParseFormFieldEnums(item.FormFields);\r\n return item;\r\n });\r\n const loadValue = async (\r\n field: IFormFieldDto,\r\n value: IFormValueDto | null,\r\n ): Promise => {\r\n if (field.Type === 'UserSelection') {\r\n if (isNullOrUndefined(value?.Value)) {\r\n return new Promise(resolve => {\r\n resolve({\r\n fieldId: field.Id,\r\n value: field.IsMultiple ? [] : null,\r\n } as ValueResults);\r\n });\r\n } else {\r\n try {\r\n let data = await initUserData(value?.Value ?? '', field);\r\n return {\r\n fieldId: field.Id,\r\n value: field.IsMultiple ? data : data[0],\r\n } as ValueResults;\r\n } catch (ex) {\r\n return {\r\n fieldId: field.Id,\r\n value: null,\r\n } as ValueResults;\r\n }\r\n }\r\n } else if (field.Type === 'File') {\r\n if (isNullOrUndefined(value?.Value)) {\r\n return new Promise(resolve => {\r\n resolve({\r\n fieldId: field.Id,\r\n value: [],\r\n } as ValueResults);\r\n });\r\n } else {\r\n try {\r\n let results = await InitFormFiles(value?.Value ?? '', field);\r\n const files =\r\n results.length > 0\r\n ? results.map(r => {\r\n return {\r\n Id: field.Id,\r\n Value: r.Id,\r\n DisplayValue: r.Name,\r\n Size: r.Size,\r\n PostedFile: null,\r\n } as IFormFileValue;\r\n })\r\n : [];\r\n setOriginalFiles(prev => [...prev, ...files]);\r\n return {\r\n fieldId: field.Id,\r\n value: files,\r\n } as ValueResults;\r\n } catch (ex) {\r\n return {\r\n fieldId: field.Id,\r\n value: [],\r\n } as ValueResults;\r\n }\r\n }\r\n } else {\r\n return new Promise(resolve => {\r\n const opts = DeserializeValue(field, value);\r\n resolve({\r\n fieldId: field.Id,\r\n value: opts,\r\n } as ValueResults);\r\n });\r\n }\r\n };\r\n interface ValueResults {\r\n fieldId: number;\r\n value: any;\r\n }\r\n const [fetchFormValues, getFormValues] = usePromise(\r\n async (\r\n formFields: IFormFieldDto[],\r\n formValues: IFormValueDto[] | undefined,\r\n ) => {\r\n return Promise.all(\r\n formFields\r\n .filter(f => f.Active === true)\r\n .map(async field => {\r\n try {\r\n const resvalue = await loadValue(\r\n field,\r\n formValues?.find(v => v.FormFieldId === field.Id) || null,\r\n );\r\n return resvalue;\r\n } catch {\r\n return {\r\n fieldId: field.Id,\r\n value: null,\r\n } as ValueResults;\r\n }\r\n }),\r\n );\r\n },\r\n );\r\n const [fetchFormState, fetchFormPromise] = usePromise(fetchCustomForm);\r\n const [customForm, setState] = useAsyncExtendedState<\r\n ICustomFormDto | undefined\r\n >(undefined);\r\n const [loadedValues, setValues] = useAsyncExtendedState<\r\n Record | undefined\r\n >(undefined);\r\n // useEffectOnMount(() => {\r\n // setState(fetchFormPromise(FormType as number, currentFormId));\r\n // return () => {};\r\n // });\r\n React.useEffect(() => {\r\n if (CustomFormId) {\r\n !!onLoadStarted && onLoadStarted();\r\n setState(fetchFormPromise(FormType as number, CustomFormId));\r\n }\r\n return () => {\r\n setState(undefined);\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [CustomFormId]);\r\n React.useEffect(() => {\r\n if (customForm) {\r\n const serializedvalues: Record = {};\r\n setValues(\r\n getFormValues(customForm.FormFields, values).then(vals => {\r\n vals.forEach(\r\n item => (serializedvalues[item.fieldId.toString()] = item.value),\r\n );\r\n return serializedvalues;\r\n }),\r\n );\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [customForm]);\r\n React.useEffect(() => {\r\n const messageKey = 'formLoad';\r\n let active = !!fetchFormState && !!fetchFormState.status;\r\n if (active) {\r\n if (fetchFormState.error) {\r\n let msg = fetchFormState.error.message;\r\n !!onLoadCompleted && onLoadCompleted();\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Something went wrong. ' + msg,\r\n key: messageKey,\r\n }),\r\n );\r\n }\r\n if (\r\n fetchFormState.status === 'resolved' &&\r\n fetchFormValues?.status === 'resolved' &&\r\n !!customForm &&\r\n !!loadedValues\r\n ) {\r\n !!onLoadCompleted && onLoadCompleted();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n fetchFormValues,\r\n onLoadCompleted,\r\n customForm,\r\n loadedValues,\r\n fetchFormState,\r\n ]);\r\n\r\n const portalRef = React.useRef(null);\r\n const bindSubmitForm = React.useCallback(\r\n submitForm => {\r\n submitFormRef.current = submitForm;\r\n },\r\n [submitFormRef],\r\n );\r\n const handleSubmit = React.useCallback(\r\n (values: Record, files: IFormFileValue[]) => {\r\n const formValues: IFormValueDto[] = Object.entries(values).map(\r\n ([formFieldId, value]) => ({\r\n Id: -1,\r\n FormFieldId: +formFieldId,\r\n Value: isEmptyOrWhitespace(value) ? null : value,\r\n DisplayValue: null,\r\n SourceValueId: null,\r\n AlertId: null,\r\n AlertTypeId: null,\r\n Readonly: false,\r\n CustomFormId: customForm?.Id || CustomFormId,\r\n CustomFormName: customForm?.Name || null,\r\n BudgetExperimentId: null,\r\n ExperimentItemId: null,\r\n RequestId: null,\r\n ReservationId: null,\r\n ServiceGroupId: null,\r\n ServiceGroupUserId: null,\r\n }),\r\n );\r\n saveFormValues(formValues, files, originalFiles);\r\n },\r\n [\r\n CustomFormId,\r\n customForm?.Id,\r\n customForm?.Name,\r\n originalFiles,\r\n saveFormValues,\r\n ],\r\n );\r\n const formFields = React.useMemo(() => {\r\n return customForm !== undefined\r\n ? validationEnabled\r\n ? customForm.FormFields.sort(orderFields)\r\n : customForm.FormFields.sort(orderFields).map(field =>\r\n Object.assign(field, { Required: 0 }),\r\n )\r\n : [];\r\n }, [customForm, validationEnabled]);\r\n return (\r\n \r\n
    \r\n {fetchFormState.status === 'resolved' &&\r\n customForm !== undefined &&\r\n !!loadedValues &&\r\n fetchFormValues.status === 'resolved' ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\n\r\nconst url = '/api/odata/v4/ServiceRequestStatusFilter';\r\n\r\nexport interface ServiceRequestStatusMultiPickerProps\r\n extends Omit<\r\n AutocompleteMultiPickerProps,\r\n 'loadData'\r\n > {\r\n exclude?: InternalServiceRequestStatusesUnion[];\r\n}\r\n\r\nexport const initServiceRequestStatusMultiData = (\r\n initialValue: string | undefined,\r\n) => {\r\n if (initialValue === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IServiceRequestStatusDto[]);\r\n });\r\n } else {\r\n const ids = initialValue.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id in (' + ids.join(',') + '))',\r\n $select: 'Id,Name,InternalStatusId',\r\n $skip: 0,\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IServiceRequestStatusDto[]);\r\n }\r\n};\r\n\r\nconst getLoadDataFn = (exclude?: InternalServiceRequestStatusesUnion[]) => (\r\n searchTerm: string | null,\r\n) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: Array> = [];\r\n if (exclude !== undefined && exclude.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'InternalStatusId',\r\n ODataOperators.Excludes,\r\n exclude,\r\n ),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IServiceRequestStatusDto[]);\r\n};\r\n\r\nexport function ServiceRequestStatusMultiPicker(\r\n props: ServiceRequestStatusMultiPickerProps,\r\n) {\r\n const loadData = React.useMemo(() => getLoadDataFn(props.exclude), [\r\n props.exclude,\r\n ]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * RadioGroup\r\n *\r\n */\r\nimport { RadioGroup as MuiRadioGroup } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport Radio from '../BasicInputs/Radio';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface RadioGroupProps {\r\n options: Array>;\r\n value?: string;\r\n className?: string;\r\n onChange?: (\r\n value: string,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n id: string;\r\n //formik\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n disabled?: boolean;\r\n helperText?: string;\r\n row?: boolean;\r\n info?: string;\r\n}\r\n\r\nexport function RadioGroup({\r\n name,\r\n id,\r\n value,\r\n options,\r\n onChange,\r\n error,\r\n row,\r\n helperText,\r\n ...props\r\n}: RadioGroupProps) {\r\n const handleChange = (event: React.ChangeEvent) => {\r\n const value = event.target.value as string;\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n };\r\n return (\r\n \r\n {options.map((option, index) => (\r\n \r\n }\r\n label={option.Name}\r\n disabled={props.disabled}\r\n />\r\n {(option as any).Name.length > 28 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n ))}\r\n \r\n );\r\n}\r\n","import { BillingActionsDetailsQStringParameters } from 'app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\nimport { IBillingActionsDto } from '../app/pages/BillingActions/BillingActionsPage/IBillingActionsDto';\r\nimport { IResponseType } from '../types/ResponseType';\r\nimport { IBillingDto } from 'app/pages/InvoiceBillingPage/IBillingDto';\r\nimport { IInvoiceBatchesDto } from 'app/pages/InvoiceBatches/IInvoiceBatchesDto';\r\nimport { IBillingActionInvoice } from 'app/pages/InvoiceBillingPage/SelectedRowActions/BillingActionsPopup/BillingActionsPopupTable/IBillingActionInvoice';\r\n\r\nexport const BillingActionsApi = {\r\n initCreateData: (payload: BillingActionsDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = '/api/odata/v4/BillingActions/InitBillingActions';\r\n return httpClient.post(url, data);\r\n },\r\n initUpdateData: (payload: BillingActionsDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = '/api/odata/v4/BillingActions/InitBillingActions';\r\n return httpClient.post(url, data);\r\n },\r\n insertBillingActionsDetails: (payload: IBillingActionsDto) => {\r\n const url = '/api/odata/v4/BillingActions'; //POST action in Controller\r\n return httpClient.post(url, payload);\r\n },\r\n updateBillingActionsDetails: (payload: IBillingActionsDto) => {\r\n const url = `/api/odata/v4/BillingActions(${payload.Id})`; //PUT action in Controller\r\n return httpClient.put(url, payload);\r\n },\r\n deleteBillingActionsDetails: (\r\n rows: IBillingActionsDto[],\r\n ): Promise => {\r\n const billingActionIds: number[] = rows.map(item => item.Id);\r\n const data = { billingActionIds };\r\n const url = '/api/odata/v4/BillingActions/DeleteBillingActions';\r\n return httpClient.post(url, data);\r\n },\r\n getBillingActions: (screen: number) => {\r\n const url = `/api/odata/v4/BillingActions(${screen})`;\r\n return httpClient.get(url, {\r\n $expand: ['EmailAttachmentTypes', 'EmailRecipientTypes'].join(','),\r\n });\r\n },\r\n getBillingActionById: (screen: number, billingActionId: number) => {\r\n const url = `/api/odata/v4/BillingActions(${screen})`;\r\n const params: {\r\n $filter?: string;\r\n $expand?: string;\r\n } = {\r\n $filter: '(Id eq ' + billingActionId + ')',\r\n $expand: ['EmailAttachmentTypes', 'EmailRecipientTypes'].join(','),\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n getBillingActionInvoices: (\r\n batchInvoiceIds: IBillingDto[] | IInvoiceBatchesDto[],\r\n screen: number,\r\n ) => {\r\n const ids: string = batchInvoiceIds.map(item => item.Id).join(',');\r\n const data = { ids, screen };\r\n const url = '/api/odata/v4/BillingActions/GetBillingActionInvoices';\r\n return httpClient.post(url, data);\r\n },\r\n processEmailAction: (\r\n billingActionsParams: IBillingActionsDto,\r\n rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n ) => {\r\n const billingActionId: number = billingActionsParams.Id;\r\n const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n const data = { billingActionId, invoiceIds };\r\n const url = '/api/odata/v4/BillingActions/ProcessEmailAction';\r\n return httpClient.post(url, data);\r\n },\r\n ProcessSftpUploadAction: (\r\n billingActionsParams: IBillingActionsDto,\r\n rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n ) => {\r\n const billingActionId: number = billingActionsParams.Id;\r\n const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n const data = { billingActionId, invoiceIds };\r\n const url = '/api/odata/v4/BillingActions/ProcessSftpUploadAction';\r\n return httpClient.post(url, data);\r\n },\r\n processStatusAction: (\r\n billingActionsParams: IBillingActionsDto,\r\n rows: IBillingActionInvoice[],\r\n ) => {\r\n const billingActionId: number = billingActionsParams.Id;\r\n const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n const data = { billingActionId, invoiceIds };\r\n const url = '/api/odata/v4/BillingActions/ProcessStatusAction';\r\n return httpClient.post(url, data);\r\n },\r\n getRecipientsEmailAddresses: (\r\n rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n billingActionsRow: IBillingActionsDto,\r\n ) => {\r\n const invoiceIds: number[] = rows.map(item => item.Id);\r\n const emailTypes: number[] = billingActionsRow.EmailRecipientTypes.map(\r\n item => item.Id,\r\n );\r\n const screen: number = billingActionsRow.ShowOn;\r\n const specEmailAddresses: string | null =\r\n billingActionsRow.SpecificEmailAddresses;\r\n const data = { invoiceIds, emailTypes, screen, specEmailAddresses };\r\n const url = '/api/odata/v4/BillingActions/GetRecipientsEmailAddresses';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n AuthenticatedUser,\r\n IIsAdminOrOwnerOfParams,\r\n} from 'types/AuthenticatedUser';\r\n\r\nexport function useReservationPermissions() {\r\n const user = useSelector(selectAuthenticatedUser);\r\n const roles: number[] | undefined = user?.Roles;\r\n\r\n const allowedToView = React.useCallback(\r\n (row: IReservationHistoryDto): boolean => {\r\n return canEditReservation(user, {\r\n ServiceGroupId: row.ServiceGroupId,\r\n ServiceId: row.EquipmentId,\r\n ServiceTypeId: ServiceType.Online,\r\n UserId: row.BookedById,\r\n });\r\n },\r\n [user],\r\n );\r\n const allowedroles = [\r\n Roles.Administrators,\r\n Roles.EquipmentAdministrator,\r\n Roles.GroupAdministrators,\r\n Roles.LabTech,\r\n ];\r\n const hasRolePermissions: boolean =\r\n intersection(roles, allowedroles).length > 0;\r\n return {\r\n hasRolePermissions,\r\n allowedToView,\r\n };\r\n}\r\n/**\r\n * Determines if current user has permissions to edit reservation\r\n * @param user authenticated user\r\n * @param row reservation like DTO\r\n * @returns true if current user is allowed to edit the reservation\r\n */\r\nexport function canEditReservation(\r\n user: AuthenticatedUser | undefined,\r\n row: IIsAdminOrOwnerOfParams,\r\n) {\r\n return user?.IsAdminOrOwnerOf(row) ?? false;\r\n}\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { AsyncDataState, AsyncProgressState } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport interface IChargeOnlineBudgetState\r\n extends AsyncProgressState> {\r\n currentRecord?: IInvoiceBudgetBalanceDto;\r\n errors?: string[];\r\n}\r\n\r\n/* --- STATE --- */\r\nexport interface OnlineBudgetsStatusState {\r\n endDate: string | null;\r\n needTableRefresh: boolean;\r\n tableState: AsyncDataState>;\r\n selected: IInvoiceBudgetBalanceDto[];\r\n generateInvoicesState: AsyncDataState;\r\n charge: IChargeOnlineBudgetState;\r\n pay: IPayState;\r\n generateInvoicesAndSendToSap: IGenerateInvoicesAndSendToSapState;\r\n}\r\n\r\nexport interface IPayState {\r\n currentRecord?: IInvoiceBudgetBalanceDto;\r\n selected?: IInvoiceBudgetBalanceDto[];\r\n progress?: number;\r\n status?: PromiseStatus;\r\n dialogOpen?: boolean;\r\n data?: IPayActionPayload;\r\n messages?: IResponseType[];\r\n}\r\nexport type PromiseStatus = `pending` | `resolved` | `rejected`;\r\n\r\nexport enum PaymentMethods {\r\n BudgetTransfer = 1,\r\n CreditCard = 2,\r\n Wire = 3,\r\n Cash = 4,\r\n Check = 5,\r\n Other = 6,\r\n}\r\n\r\nexport interface IPayActionPayload {\r\n PaymentMethod: PaymentMethods;\r\n EndDate: Date;\r\n Rows: Array;\r\n}\r\n\r\nexport interface IProgressAction {\r\n selected: T[];\r\n progress?: number;\r\n status?: PromiseStatus;\r\n}\r\n\r\nexport interface ChargeOnlineBudgetResponse {\r\n Messages: string[];\r\n SuccessTransactionsCount: number;\r\n TransactionsCount: number;\r\n FailedTransactionsCount: number;\r\n}\r\n\r\nexport interface IGenerateInvoicesAndSendToSapState {\r\n processing?: boolean;\r\n dialogOpen?: boolean;\r\n progress?: number;\r\n selected?: IInvoiceBudgetBalanceDto[];\r\n endDate?: Date;\r\n currentRecord?: IInvoiceBudgetBalanceDto;\r\n}\r\n","/**\r\n *\r\n * DateLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface DateLabelProps {\r\n value: Date | string | null;\r\n}\r\n\r\nexport function DateLabel(props: DateLabelProps) {\r\n return <>{dateUtils.shortDateFormat(props.value)};\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IPayment } from 'app/pages/AddPaymentPage/IPayment';\r\n//import { IResponseType } from 'types/ResponseType';\r\nconst url = '/api/odata/v4/Payment';\r\nexport interface IPaymentPayload extends IPayment {\r\n ShouldCloseInvoice?: boolean;\r\n}\r\nexport const PaymentApi = {\r\n AddPayment: (payment: IPaymentPayload) => {\r\n const data = {\r\n InvoiceId: payment.InvoiceId,\r\n MethodId: payment.Method?.Id,\r\n Amount: payment.Amount,\r\n Date: payment.Date,\r\n Remarks: payment.Remarks,\r\n Reference: payment.Reference,\r\n BudgetId: payment.Budget?.Id,\r\n ServiceGroupId: payment.ServiceGroup?.Id,\r\n ShouldCloseInvoice: payment.ShouldCloseInvoice,\r\n };\r\n return httpClient.post(url, data);\r\n },\r\n UpdatePayment: (paymentId: number, payment: IPaymentPayload) => {\r\n const data = {\r\n InvoiceId: payment.InvoiceId,\r\n MethodId: payment.Method?.Id,\r\n Amount: payment.Amount,\r\n Date: payment.Date,\r\n Remarks: payment.Remarks,\r\n Reference: payment.Reference,\r\n BudgetId: payment.Budget?.Id,\r\n ServiceGroupId: payment.ServiceGroup?.Id,\r\n ShouldCloseInvoice: payment.ShouldCloseInvoice,\r\n };\r\n return httpClient.put(url + '(' + paymentId + ')', data);\r\n },\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport clsx from 'clsx';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { RowSection } from '../wrappers';\r\n\r\nexport interface FormRowProps {\r\n children: React.ReactNode;\r\n fullRow?: boolean;\r\n minRow?: boolean;\r\n hide?: boolean;\r\n wrapOnMobile?: boolean;\r\n isCover?: boolean;\r\n shrink?: '1' | '2' | '3';\r\n}\r\nexport const FormRow = (props: FormRowProps) => {\r\n const { children, fullRow, hide, minRow, wrapOnMobile, isCover, shrink } =\r\n props;\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView =\r\n isMobile || (sidePanelOpen && !sidePanelExpanded) || isCover;\r\n const shrinkClass = shrink ? `shrink-${shrink}` : '';\r\n const theme = useTheme();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.samplePlates || initialState;\r\n\r\nexport const selectSamplePlates = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSamplePlatesData = createSelector(\r\n [selectSamplePlates],\r\n state => state.data,\r\n);\r\nexport const selectSamplePlatesTableState = createSelector(\r\n [selectSamplePlates],\r\n state => state.tableState,\r\n);\r\nexport const selectSamplePlatesCreate = createSelector(\r\n [selectSamplePlates],\r\n state => state.create,\r\n);\r\n\r\nexport const selectBulkSamplePlatesCreate = createSelector(\r\n [selectSamplePlates],\r\n state => state.bulckCreate,\r\n);\r\n\r\nexport const selectSamplePlatesUpdate = createSelector(\r\n [selectSamplePlates],\r\n state => state.update,\r\n);\r\n","/**\r\n *\r\n * FilterBox\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FilterBoxCoreProps {\r\n direction: Directions;\r\n}\r\nexport interface FilterBoxProps\r\n extends React.PropsWithChildren<\r\n FilterBoxCoreProps & React.HTMLAttributes\r\n > {}\r\n\r\nexport const FilterBox = React.forwardRef(function FilterBox(\r\n props: FilterBoxProps,\r\n ref: any,\r\n) {\r\n const isMobile = DetectIsMobile();\r\n const classes = useStyles({\r\n isMobile: isMobile,\r\n direction: props.direction,\r\n });\r\n return (\r\n \r\n {props.children}\r\n
    \r\n );\r\n});\r\n\r\nexport type Directions = 'vertical' | 'horizontal';\r\n\r\nconst useStyles = makeStyles((theme: Theme) => {\r\n return createStyles({\r\n root: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n flexWrap: 'nowrap',\r\n flexDirection: 'row',\r\n gap: 8,\r\n position: 'relative',\r\n '&.isMobile': {\r\n display: 'inline-flex',\r\n flexWrap: 'wrap',\r\n width: 'inherit',\r\n marginTop: '12px',\r\n marginBottom: '-4px',\r\n gap: 'unset',\r\n },\r\n '&.horizontal': {\r\n display: 'inline-flex',\r\n flexWrap: 'wrap',\r\n marginLeft: '-8px',\r\n },\r\n },\r\n });\r\n});\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { downloadFile } from 'utils/url-utils';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\ninterface DownloadFileButonProps {\r\n id: string;\r\n name?: React.ReactNode;\r\n}\r\n\r\nexport function DownloadFileButon(props: DownloadFileButonProps) {\r\n const { t } = useTranslation();\r\n const url = `/file.ashx?id=${props.id}&ap=true`;\r\n const [busy, setBusy] = React.useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const handleClick = React.useCallback(\r\n async event => {\r\n event.preventDefault();\r\n if (busy) {\r\n return;\r\n }\r\n setBusy(true);\r\n try {\r\n await downloadFile({ path: url });\r\n setBusy(false);\r\n } catch (error) {\r\n setBusy(false);\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: t(translations.Error_FileNotAvailable),\r\n }),\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n [actions, busy, dispatch, t, url],\r\n );\r\n return (\r\n \r\n {props.name ?? t(translations.Download)}\r\n \r\n );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\nexport interface ActivateButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: () => void;\r\n ServiceGroupId?: number;\r\n Active: boolean;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n const { t } = useTranslation();\r\n const settings = useSelector(selectglobalSettings);\r\n const [showConfirm, setShowConfirm] = React.useState(false);\r\n\r\n return edit &&\r\n settings.GetBooleanByKey(\r\n AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n ) ? (\r\n \r\n \r\n setShowConfirm(false)}\r\n />\r\n \r\n ) : (\r\n \r\n );\r\n}\r\nexport function ActivateButton({\r\n edit,\r\n text,\r\n onClick,\r\n ServiceGroupId,\r\n Active,\r\n ...props\r\n}: ActivateButtonProps) {\r\n const { t } = useTranslation();\r\n const [showConfirm, setShowConfirm] = React.useState(false);\r\n\r\n return (\r\n \r\n {Active ? (\r\n \r\n \r\n setShowConfirm(false)}\r\n />\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { useIsRequired } from './ValidationSchemaProvider';\r\nimport { FileInputProps } from '../BasicInputs/FileUpload/FileInput';\r\nimport { IFormFileValue } from '../CustomForm/CustomFormUtils';\r\nimport { FileUpload } from '../BasicInputs/FileUpload/FileUpload';\r\n\r\nexport const FormInputFile = ({\r\n id,\r\n label,\r\n onChange,\r\n value,\r\n name,\r\n title,\r\n required,\r\n ...props\r\n}: FieldHookConfig & IFieldProps & FileInputProps) => {\r\n const [field, meta, helper] = useField({\r\n name,\r\n ...props,\r\n });\r\n const handleChange = (files: IFormFileValue[]) => {\r\n helper.setValue(files);\r\n //const files = event.target.files;\r\n //console.log('value', event.target);\r\n console.debug('files', files);\r\n onChange?.(files);\r\n // if (onChange !== undefined) {\r\n // onChange(files, event);\r\n // }\r\n // field.onChange(event);\r\n };\r\n const { submitCount } = useFormikContext();\r\n const isRequired = useIsRequired(name);\r\n const hasError = meta?.error !== undefined;\r\n const showError = hasError || submitCount > 0;\r\n return (\r\n \r\n );\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\n\r\nexport const TransformDate = (value, original, ctx) => {\r\n if (ctx.isType(value)) return value;\r\n return dateUtils.format(original, dateUtils.DateIOFormats.keyboardDate);\r\n};\r\n","/**\r\n *\r\n * WorkOrderPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface WorkOrderPickerProps\r\n extends Omit, 'loadData'> {\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/WorkOrders';\r\nexport const initWorkOrdersData = (\r\n initval: string | undefined,\r\n select?: (keyof IWorkOrderDetailsDto)[],\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n $select: string;\r\n $expand?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n $select: !!select\r\n ? select.join(',')\r\n : [\r\n 'Id',\r\n 'Name',\r\n 'AssetName',\r\n 'AssetId',\r\n 'ServiceGroup',\r\n 'ServiceGroupId',\r\n 'ServiceId',\r\n 'ServiceTypeId',\r\n 'AssetCatId',\r\n 'AssetCatGroupId',\r\n 'AssetCatName',\r\n 'AssetCatGroupName',\r\n 'AlertTypeId',\r\n 'AlertTitle',\r\n 'AlertDescription',\r\n 'StatusName',\r\n 'AlertType',\r\n 'EventStart',\r\n 'ReportedBy',\r\n 'ReportedByDisplayName',\r\n 'LastUpdated',\r\n 'Reservation',\r\n 'AlertOfflineTime',\r\n 'OfflineEventEnd',\r\n 'OfflineEventStart',\r\n 'OfflineRemarks',\r\n 'ReasonTypeId',\r\n 'ReasonTypeName',\r\n 'StatusId',\r\n 'IsClosed',\r\n 'UserTicket',\r\n 'InstrumentWasDown',\r\n 'IsAutoCreatedType',\r\n 'AlertStart',\r\n 'CreateDate',\r\n 'DoneDate',\r\n 'RecurringGroupId',\r\n 'RecurringAssetId',\r\n 'WorkOrderType',\r\n 'StaffOnly',\r\n 'WorkingHoursId',\r\n 'ShowOnCalibrationHistory',\r\n 'NotEditable',\r\n ].join(','),\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n queryUrl?: string,\r\n useSearchOrPredicate?: boolean,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url ?? queryUrl,\r\n predicates: predicates,\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'AssetName',\r\n 'AssetId',\r\n 'ServiceGroup',\r\n 'ServiceGroupId',\r\n 'ServiceId',\r\n 'ServiceTypeId',\r\n 'AssetCatId',\r\n 'AssetCatGroupId',\r\n 'AssetCatName',\r\n 'AssetCatGroupName',\r\n 'AlertTypeId',\r\n 'AlertTitle',\r\n 'AlertDescription',\r\n 'StatusName',\r\n 'AlertType',\r\n 'EventStart',\r\n 'ReportedBy',\r\n 'ReportedByDisplayName',\r\n 'LastUpdated',\r\n 'Reservation',\r\n 'AlertOfflineTime',\r\n 'OfflineEventEnd',\r\n 'OfflineEventStart',\r\n 'OfflineRemarks',\r\n 'ReasonTypeId',\r\n 'ReasonTypeName',\r\n 'StatusId',\r\n 'IsClosed',\r\n 'UserTicket',\r\n 'InstrumentWasDown',\r\n 'IsAutoCreatedType',\r\n 'AlertStart',\r\n 'CreateDate',\r\n 'DoneDate',\r\n 'RecurringGroupId',\r\n 'RecurringAssetId',\r\n 'WorkOrderType',\r\n 'StaffOnly',\r\n 'WorkingHoursId',\r\n 'ShowOnCalibrationHistory',\r\n 'NotEditable',\r\n ],\r\n useSearchOrPredicate: useSearchOrPredicate,\r\n });\r\nexport function WorkOrderPicker(props: WorkOrderPickerProps) {\r\n const innerLoadData = (predicates, queryUrl) =>\r\n loadData(props.predicates, queryUrl, props.useSearchOrPredicate);\r\n const queryUrl = '/api/odata/v4/WorkOrders';\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport const WorkOrdersCalibrationFilter = (\r\n assetId?: number,\r\n woTypeId?: number,\r\n excludeIds?: number[],\r\n) => {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!assetId) {\r\n predicates.push(\r\n new Condition(\r\n 'AssetId',\r\n ODataOperators.Equals,\r\n assetId,\r\n ),\r\n );\r\n }\r\n if (!!woTypeId) {\r\n predicates.push(\r\n new Condition(\r\n 'AlertTypeId',\r\n ODataOperators.Equals,\r\n woTypeId,\r\n ),\r\n );\r\n }\r\n if (!!excludeIds && excludeIds?.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Excludes,\r\n excludeIds,\r\n ),\r\n );\r\n }\r\n predicates.push(\r\n new Condition(\r\n 'IsClosed',\r\n ODataOperators.NotEquals,\r\n true,\r\n ),\r\n );\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n};\r\nexport const loadWorkOrders = loadData;\r\n","/**\r\n *\r\n * FormRestrictedUserGroupPicker\r\n *\r\n */\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { RestrictedUserGroupPicker } from '../pickers/AutocompletePickers/UserGroupPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormRestrictedUserGroupPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n predicates={props.predicates}\r\n disabled={props.disabled}\r\n />\r\n );\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n URLSearchParamsCI,\r\n arrayToQueryString,\r\n getNumberEntityArray,\r\n initMultiPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport {\r\n ServiceRequestStatusMultiPicker,\r\n initServiceRequestStatusMultiData,\r\n} from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const StatusFilterId = 'Status';\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n const result: IFilterSettings[] = [\r\n {\r\n id: StatusFilterId,\r\n fieldName: 'Status',\r\n queryStringSerializer: arrayToQueryString('RequestStatusInclude'),\r\n displayName: t(translations.IncludeStatus) as string,\r\n operator: ODataOperators.Includes,\r\n value: getNumberEntityArray(params, 'RequestStatusInclude'),\r\n component: ServiceRequestStatusMultiPicker,\r\n initData: initMultiPickerValue(initServiceRequestStatusMultiData),\r\n urlKey: 'RequestStatusInclude',\r\n },\r\n ];\r\n return result;\r\n};\r\n","import React from 'react';\r\n\r\nimport FirstPageIcon from '@material-ui/icons/FirstPage';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft';\r\nimport KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight';\r\nimport LastPageIcon from '@material-ui/icons/LastPage';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n flexShrink: 0,\r\n marginLeft: theme.spacing(2.5),\r\n },\r\n}));\r\n\r\nconst TablePaginationActions = props => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const { count, page, rowsPerPage, onChangePage } = props;\r\n\r\n const handleFirstPageButtonClick = event => {\r\n onChangePage(event, 0);\r\n };\r\n\r\n const handleBackButtonClick = event => {\r\n onChangePage(event, page - 1);\r\n };\r\n\r\n const handleNextButtonClick = event => {\r\n onChangePage(event, page + 1);\r\n };\r\n\r\n const handleLastPageButtonClick = event => {\r\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\r\n };\r\n\r\n return (\r\n
    \r\n \r\n {theme.direction === 'rtl' ? : }\r\n \r\n \r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n = Math.ceil(count / rowsPerPage) - 1}\r\n aria-label=\"next page\"\r\n >\r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n = Math.ceil(count / rowsPerPage) - 1}\r\n aria-label=\"last page\"\r\n >\r\n {theme.direction === 'rtl' ? : }\r\n \r\n
    \r\n );\r\n};\r\n\r\nTablePaginationActions.propTypes = {\r\n count: PropTypes.number.isRequired,\r\n onChangePage: PropTypes.func.isRequired,\r\n page: PropTypes.number.isRequired,\r\n rowsPerPage: PropTypes.number.isRequired,\r\n};\r\n\r\nexport default TablePaginationActions;\r\n","import * as React from 'react';\r\nimport {\r\n Table as MuiTable,\r\n TableBody,\r\n TableHead,\r\n TableRow,\r\n TableCell,\r\n TableFooter,\r\n TableContainer,\r\n Table,\r\n} from '@material-ui/core/index';\r\nimport TablePagination from '@material-ui/core/TablePagination';\r\nimport { Checkbox } from '@material-ui/core/index';\r\nimport {\r\n Column,\r\n useTable,\r\n useRowSelect,\r\n usePagination,\r\n PluginHook,\r\n useGlobalFilter,\r\n Row,\r\n} from 'react-table';\r\n\r\nimport TablePaginationActions from './TablePaginationActions';\r\nimport { GlobalFilter } from 'app/components/BasicTable/GlobalFilter';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { SelectedActions } from 'app/components/BasicTable/SelectedActions';\r\nimport { BasicTableProps } from 'app/components/BasicTable';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { useRowActionsColumn } from 'app/components/BasicTable/RowActions';\r\nimport { ConfigureColumnsButton } from 'app/components/BasicTable/components/ConfigureColumnsButton';\r\nimport { ExportButton } from 'app/components/BasicTable/ExportButton';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface EditableTableProps\r\n extends Pick<\r\n BasicTableProps,\r\n 'columns' | 'selectedRowsActions' | 'pageActions' | 'rowActions'\r\n > {\r\n columns: Column[];\r\n // defaultColumn: any;\r\n // skipPageReset: boolean;\r\n updateMyData?: any;\r\n data: TRow[];\r\n toolbar?: (selectedRows: TRow[]) => JSX.Element;\r\n // controlledPageCount: number;\r\n // fetchData: (state: ITableState) => void;\r\n toggleHideColumn?: (columnId: String, value: Boolean) => void;\r\n useRowSelect: boolean;\r\n onSelectedRowsChange?: (selectedRows: TRow[]) => void;\r\n useGlobalFilter: boolean;\r\n subHeader?: React.ReactNode;\r\n screenName: string | React.ReactNode;\r\n handleConfigurableColumns: () => void;\r\n handleExport: () => Promise;\r\n useImportLink?: boolean;\r\n importLink?: string;\r\n importHandler?: () => void;\r\n onExportForImport?: (rows: Row[]) => void;\r\n onDownloadTemplate?: () => void;\r\n}\r\n\r\nexport function EditableTable>({\r\n selectedRowsActions,\r\n onSelectedRowsChange,\r\n screenName,\r\n ...props\r\n}: EditableTableProps) {\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const {\r\n columns,\r\n data,\r\n // fetchData,\r\n // controlledPageCount,\r\n // skipPageReset,\r\n updateMyData,\r\n } = props;\r\n const tablePlugins: PluginHook[] = [useGlobalFilter, usePagination];\r\n\r\n if (props.useRowSelect) {\r\n tablePlugins.push(useRowSelect);\r\n tablePlugins.push(hooks => {\r\n hooks.visibleColumns.push(columns => [\r\n // Let's make a column for selection\r\n {\r\n id: 'selection',\r\n // The header can use the table's getToggleAllRowsSelectedProps method\r\n // to render a checkbox\r\n Header: ({ getToggleAllRowsSelectedProps }) => (\r\n
    \r\n \r\n
    \r\n ),\r\n // The cell can use the individual row's getToggleRowSelectedProps method\r\n // to the render a checkbox\r\n Cell: ({ row }) => (\r\n
    \r\n \r\n
    \r\n ),\r\n },\r\n ...columns,\r\n ]);\r\n });\r\n }\r\n\r\n useRowActionsColumn(props.rowActions, tablePlugins);\r\n const tableInstance = useTable(\r\n {\r\n columns,\r\n data,\r\n\r\n // use the skipPageReset option to disable page resetting temporarily\r\n // autoResetPage: !skipPageReset,\r\n // updateMyData isn't part of the API, but\r\n // anything we put into these options will\r\n // automatically be available on the instance.\r\n // That way we can call this function from our\r\n // cell renderer!\r\n updateMyData,\r\n autoResetPage: false,\r\n // initialState: { pageSize: 10 },\r\n // manualPagination: true, // Tell the usePagination\r\n // pageCount: controlledPageCount,\r\n },\r\n ...tablePlugins,\r\n );\r\n\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n page, // Instead of using 'rows', we'll use page,\r\n prepareRow,\r\n //pagination\r\n gotoPage,\r\n setPageSize,\r\n state: { pageIndex, pageSize, globalFilter, selectedRowIds },\r\n selectedFlatRows,\r\n toggleAllRowsSelected,\r\n setGlobalFilter,\r\n } = tableInstance;\r\n\r\n const isSomeselected = Object.keys(selectedRowIds || {}).length > 0;\r\n const [selected, setSelected] = React.useState>({});\r\n React.useEffect(\r\n () =>\r\n onSelectedRowsChange?.(Object.entries(selected).map(value => value[1])),\r\n [onSelectedRowsChange, selected],\r\n );\r\n\r\n React.useEffect(() => {\r\n setSelected(state =>\r\n Object.keys(selectedRowIds || {}).reduce((accumulator, key) => {\r\n accumulator[key] =\r\n state[key] ?? selectedFlatRows.find(row => row.id === key)?.original;\r\n return accumulator;\r\n }, {}),\r\n );\r\n }, [selectedRowIds, selectedFlatRows]);\r\n const selectedArray = Object.entries(selected).map(value => value[1]);\r\n\r\n const handleChangePage = (event, newPage) => {\r\n gotoPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = event => {\r\n setPageSize(Number(event.target.value));\r\n };\r\n return (\r\n <>\r\n \r\n (\r\n {item(0, () => void 0)}\r\n )) ?? []\r\n }\r\n />\r\n {props.subHeader !== undefined && {props.subHeader}}\r\n \r\n \r\n <>\r\n {isSomeselected && selectedRowsActions !== undefined ? (\r\n \r\n ) : (\r\n <>\r\n {/* {screenId && AuthenticatedUser && (\r\n }\r\n onClick={handleConfigurableColumns}\r\n >\r\n {t(translations.Columns)}\r\n \r\n )} */}\r\n {/* {useExport && (\r\n \r\n )} */}\r\n {/* {useImportLink && importLink && (\r\n }\r\n onClick={() =>\r\n window.open(toRootedURL(importLink), '_self')\r\n }\r\n >\r\n {t(translations.Import)}\r\n \r\n )} */}\r\n\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {props.useImportLink && (props.importLink || props.importHandler) && (\r\n }\r\n onClick={() => {\r\n if (props.importHandler) {\r\n props.importHandler();\r\n } else {\r\n if (props.importLink) {\r\n window.open(toRootedURL(props.importLink), '_self');\r\n }\r\n }\r\n }}\r\n >\r\n {t(translations.Import)}\r\n \r\n )}\r\n \r\n \r\n\r\n
    \r\n \r\n \r\n {\r\n // Loop over the header rows\r\n headerGroups.map(headerGroup => (\r\n // Apply the header row props\r\n \r\n {\r\n // Loop over the headers in each row\r\n headerGroup.headers.map(column => (\r\n // Apply the header cell props\r\n \r\n {\r\n // Render the header\r\n column.render('Header')\r\n }\r\n \r\n ))\r\n }\r\n \r\n ))\r\n }\r\n \r\n {/* Apply the table body props */}\r\n \r\n {\r\n // Loop over the table rows\r\n page.map(row => {\r\n // Prepare the row for display\r\n\r\n prepareRow(row);\r\n return (\r\n // Apply the row props\r\n \r\n {\r\n // Loop over the rows cells\r\n row.cells.map(cell => {\r\n // Apply the cell props\r\n return (\r\n \r\n {\r\n // Render the cell contents\r\n cell.render('Cell')\r\n }\r\n \r\n );\r\n })\r\n }\r\n \r\n );\r\n })\r\n }\r\n \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePositionsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { SamplePlatePositionNamingTypes } from 'api/odata/generated/enums/SamplePlatePositionNamingTypes';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport {\r\n ISample,\r\n ISampleRun,\r\n} from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePositionsPickerProps\r\n extends Omit<\r\n AutocompleteMultiPickerProps,\r\n 'loadData' | 'onChange' | 'value' | 'label' | 'multiple' | 'fullWidth'\r\n > {\r\n serviceGroupId?: number;\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n values?: ISample;\r\n value: string | null;\r\n onChange: (value: string | null) => void;\r\n}\r\n\r\nexport interface ConnectedSamplePlatePositionsPickerProps\r\n extends SamplePlatePositionsPickerProps {\r\n samplePlateId: string | null;\r\n}\r\nfunction range(x) {\r\n return Array.apply(null, Array(x)).map(function (x, i) {\r\n return i;\r\n });\r\n}\r\nconst loadData = (plateId?: string | null) => async (\r\n searchTerm: string | null,\r\n): Promise[]> => {\r\n const plate = await httpClient.get(\r\n `/api/odata/v4/sampleplates('${plateId}')`,\r\n );\r\n\r\n const rowsCount = plate.SamplePlateTypeRows;\r\n const columnsCount = plate.SamplePlateTypeColumns;\r\n const rows = range(columnsCount)\r\n .map(i =>\r\n plate.SamplePlateTypeColumnsNaming ===\r\n SamplePlatePositionNamingTypes.Alpha\r\n ? String.fromCharCode(65 + i)\r\n : i + 1,\r\n )\r\n .flatMap(column =>\r\n range(rowsCount)\r\n .map(i =>\r\n plate.SamplePlateTypeRowsNaming ===\r\n SamplePlatePositionNamingTypes.Alpha\r\n ? String.fromCharCode(65 + i)\r\n : i + 1,\r\n )\r\n .map(row => `${column}${row}`),\r\n );\r\n const options = rows.map(a => ({ Id: a, Name: a }));\r\n return options;\r\n};\r\nexport function SamplePlatePositionsPicker({\r\n serviceGroupId,\r\n samplePlateId,\r\n value,\r\n values,\r\n onChange,\r\n ...props\r\n}: ConnectedSamplePlatePositionsPickerProps) {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const loadDatax = React.useCallback(loadData(samplePlateId), [\r\n serviceGroupId,\r\n samplePlateId,\r\n ]);\r\n const S2Value =\r\n value === null\r\n ? []\r\n : value\r\n .split(';')\r\n .filter(value => value !== '')\r\n .map(value => ({ Id: value, Name: value }));\r\n return (\r\n item.Name}\r\n size={props.size}\r\n onChange={value =>\r\n onChange(value?.map(item => item.Id)?.join(';') ?? null)\r\n }\r\n value={S2Value}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport function TargetSamplePlatePositionsPicker({\r\n values,\r\n\r\n ...props\r\n}: SamplePlatePositionsPickerProps) {\r\n const samplePlateId = (values as ISampleRun)?.TargetPlateId ?? null;\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from '../BasicPickers/AutocompletePicker';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nexport interface FormGradientPickerProps\r\n extends Omit<\r\n AutocompletePickerProps,\r\n 'onBlur' | 'value' | 'error' | 'loadData' | 'onChange'\r\n > {\r\n serviceGroupId?: number;\r\n}\r\nexport interface IGradientDto extends Entity {\r\n EstimatedRuntimeMinutes: number;\r\n}\r\nexport const FormGradientPicker = ({\r\n serviceGroupId,\r\n onChange,\r\n onBlur,\r\n ...props\r\n}: FieldHookConfig & FormGradientPickerProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n const handleChange: (value: IGradientDto | null) => void = (\r\n value: IGradientDto | null,\r\n ) => helpers.setValue(value, true);\r\n const loadData = React.useCallback(\r\n async (searchTerm: string | null): Promise => {\r\n const data = await httpClient.get(`/odata.svc/Gradients`, {\r\n $filter:\r\n serviceGroupId === undefined\r\n ? undefined\r\n : `ServiceGroupId eq ${serviceGroupId}`,\r\n $orderby: 'Name',\r\n });\r\n const result: IGradientDto[] = data.d.map(item => ({\r\n Id: item.Id,\r\n Name: item.Name,\r\n EstimatedRuntimeMinutes: item.EstimatedRuntimeMinutes,\r\n }));\r\n return result;\r\n },\r\n [serviceGroupId],\r\n );\r\n return (\r\n <>\r\n \r\n \r\n );\r\n};\r\n","import {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n} from '@material-ui/core';\r\nimport { useRef, useState } from 'react';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IRunDetails, ISample } from '../../SamplesListPage/slice/types';\r\nimport * as Yup from 'yup';\r\nimport { Form, Formik, FormikProps, FormikValues } from 'formik';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n FormGradientPicker,\r\n IGradientDto,\r\n} from 'app/components/Forms/FormGradientPicker';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { useSamplesListSlice } from '../../SamplesListPage/slice';\r\nimport { useDispatch } from 'react-redux';\r\nimport { push } from 'connected-react-router';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\n\r\nexport interface CreateReservationComponentProps {\r\n runDetails?: IRunDetails;\r\n sampleRunId?: number;\r\n rows: ISample[];\r\n}\r\ninterface ICreateReservationOptions {\r\n Gradient?: IGradientDto | null;\r\n SampleOverhead?: number | null;\r\n TotalOverhead?: number | null;\r\n Equipment?: Entity | null;\r\n SecondaryEquipment?: Entity | null;\r\n ACQUISITION_TYPE?: string | null;\r\n}\r\nconst schema: Yup.SchemaOf = Yup.object({\r\n Gradient: Yup.mixed().nullable(),\r\n SampleOverhead: Yup.number().positive().nullable(),\r\n TotalOverhead: Yup.number().positive().nullable(),\r\n Equipment: Yup.mixed().required().nullable(),\r\n SecondaryEquipment: Yup.mixed().notRequired().nullable(),\r\n ACQUISITION_TYPE: Yup.string().notRequired().nullable(),\r\n});\r\n\r\nexport const CreateSampleRunReservation = ({\r\n runDetails,\r\n sampleRunId,\r\n rows,\r\n}: CreateReservationComponentProps) => {\r\n const { t } = useTranslation();\r\n const [open, setOpen] = useState(false);\r\n const [save, setSave] = useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useSamplesListSlice();\r\n const formikRef = useRef>(null);\r\n\r\n const serviceRequestId = rows?.map(item => item.ServiceRequestId)[0];\r\n const serviceGroupId = rows?.map(item => item.ServiceGroupId)[0];\r\n const handleCreateReservationButtonClick = (\r\n values: ICreateReservationOptions,\r\n ) => {\r\n if (save) {\r\n setSave(false);\r\n dispatch(\r\n actions.updateRun({\r\n SampleRunId: sampleRunId,\r\n InstrumentId:\r\n values.Equipment !== undefined && values.Equipment !== null\r\n ? values.Equipment.Id\r\n : undefined,\r\n SecondaryInstrumentId:\r\n values.SecondaryEquipment !== undefined &&\r\n values.SecondaryEquipment !== null\r\n ? values.SecondaryEquipment.Id\r\n : undefined,\r\n GradientId:\r\n values.Gradient !== undefined && values.Gradient !== null\r\n ? values.Gradient.Id\r\n : undefined,\r\n ACQUISITION_TYPE:\r\n values.ACQUISITION_TYPE !== null ? values.ACQUISITION_TYPE : null,\r\n }),\r\n );\r\n setOpen(false);\r\n } else {\r\n var p: Record = {\r\n srid: serviceRequestId,\r\n sampleRunId: sampleRunId,\r\n eid: [values.Equipment?.Id, values.SecondaryEquipment?.Id],\r\n srsid:\r\n sampleRunId === undefined\r\n ? rows?.map(r => r.Id).join(',')\r\n : undefined,\r\n duration: getReservationDuration(values, rows),\r\n };\r\n dispatch(\r\n push({\r\n pathname: GetSchedulerPagePath('calendar'),\r\n search: toQueryString(p).toString(),\r\n }),\r\n );\r\n setOpen(false);\r\n }\r\n };\r\n const initialValues: ICreateReservationOptions = {\r\n Gradient: runDetails?.Gradient as IGradientDto,\r\n //SampleOverhead: 0,\r\n //TotalOverhead: 0,\r\n Equipment: runDetails?.Instrument,\r\n SecondaryEquipment: runDetails?.SecondaryInstrument,\r\n ACQUISITION_TYPE: runDetails?.ACQUISITION_TYPE,\r\n };\r\n return (\r\n <>\r\n \r\n setOpen(false)}>\r\n {\r\n handleCreateReservationButtonClick(values);\r\n }}\r\n >\r\n {formik => (\r\n
    \r\n \r\n {t(translations.RunDetailsCreateReservation)} {' '}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n setOpen(false)}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n {\r\n setSave(true);\r\n formikRef.current?.handleSubmit();\r\n }}\r\n >\r\n {t(translations.Save)}\r\n \r\n {\r\n setSave(false);\r\n formikRef.current?.handleSubmit();\r\n }}\r\n >\r\n {t(translations.CreateReservation)}\r\n \r\n \r\n
    \r\n )}\r\n \r\n
    \r\n \r\n );\r\n};\r\nfunction getReservationDuration(\r\n values: ICreateReservationOptions,\r\n rows: ISample[],\r\n) {\r\n var timePerSample =\r\n (values.Gradient?.EstimatedRuntimeMinutes ?? 0) +\r\n (values.SampleOverhead ?? 0);\r\n var totalMinutes = timePerSample * rows.length + (values?.TotalOverhead ?? 0);\r\n const duration = totalMinutes > 0 ? totalMinutes : undefined;\r\n return duration;\r\n}\r\n","import {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n} from '@material-ui/core';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { FormLocationPicker } from 'app/components/Forms/FormLocationPicker';\r\nimport { FormRoomPicker } from 'app/components/Forms/FormRoomPicker';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormSamplePlateTypePicker } from 'app/components/Forms/FromSamplePlateTypePicker';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { ImportComponent, ImportProps } from './ImportComponent';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\n\r\nexport interface ImportSamplePlateProps extends ImportProps {\r\n onSubmit: (item: ISampleCreateBase | null, file: File) => void;\r\n onClose: () => void;\r\n initialValues: ISampleCreateBase;\r\n}\r\nfunction GetSchema(f: boolean): Yup.SchemaOf {\r\n if (f) {\r\n const schema: Yup.SchemaOf = Yup.object({\r\n Room: Yup.mixed(),\r\n Location: Yup.mixed(),\r\n ServiceGroup: Yup.mixed().required(),\r\n SamplePlateType: Yup.mixed().required(),\r\n Active: Yup.boolean(),\r\n IsRack: Yup.boolean(),\r\n });\r\n return schema;\r\n } else {\r\n const schema: Yup.SchemaOf = Yup.object({\r\n Room: Yup.mixed(),\r\n Location: Yup.mixed(),\r\n ServiceGroup: Yup.mixed(),\r\n SamplePlateType: Yup.mixed(),\r\n Active: Yup.boolean(),\r\n IsRack: Yup.boolean(),\r\n });\r\n return schema;\r\n }\r\n}\r\nexport function ImportSamplePlateForm({\r\n onSubmit,\r\n onClose,\r\n processing,\r\n initialValues,\r\n ...props\r\n}: ImportSamplePlateProps) {\r\n const { t } = useTranslation();\r\n const [file, setFile] = React.useState();\r\n const [generatePlatesonImport, setGeneratePlatesonImport] = React.useState<\r\n boolean\r\n >(false);\r\n const handleFileChange = (file: File) => {\r\n setFile(file);\r\n };\r\n const handleCheckboxChange = event => {\r\n setGeneratePlatesonImport(event.target.checked);\r\n };\r\n const handleSubmit = value => {\r\n if (file !== undefined) {\r\n if (generatePlatesonImport) {\r\n onSubmit(value, file);\r\n } else {\r\n onSubmit(null, file);\r\n }\r\n }\r\n };\r\n const handleClose = () => {\r\n onClose();\r\n };\r\n return (\r\n \r\n {\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => (\r\n <>\r\n
    \r\n \r\n \r\n

    \r\n {props.title ?? t(translations.ImportRecords)}\r\n

    \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.GeneratePlatesOnImport)}\r\n \r\n {generatePlatesonImport && (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n )}\r\n \r\n
    \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSamplesListSlice } from '../SamplesListPage/slice';\r\nimport { ImportSamplePlateForm } from './ImportComponents/PopupImport';\r\nimport { ISampleCreateBase } from '../SamplePlatesPage/slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n selectImportingRunDetails,\r\n selectImportingRunDetailsFinished,\r\n} from '../SamplesListPage/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ImportButtonProps {\r\n onDownloadTemplateButtonClick: React.MouseEventHandler;\r\n}\r\n\r\nexport function ImportButton({\r\n onDownloadTemplateButtonClick,\r\n}: ImportButtonProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useSamplesListSlice();\r\n const [open, setOpen] = React.useState(false);\r\n const importStarted = useSelector(selectImportingRunDetails);\r\n const importFinished = useSelector(selectImportingRunDetailsFinished);\r\n\r\n const onImportButtonClick = () => {\r\n dispatch(actions.setShowImportDialog(false));\r\n setOpen(true);\r\n };\r\n const handleConfirm = (item: ISampleCreateBase | null, file: any) => {\r\n if (file !== undefined) {\r\n dispatch(actions.setShowImportDialog(true));\r\n dispatch(actions.readImportFile({ file: file, plate: item }));\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n \r\n {open && importFinished === false && (\r\n setOpen(false)}\r\n initialValues={{\r\n IsRack: false,\r\n ServiceGroup: undefined,\r\n SamplePlateType: undefined,\r\n Active: true,\r\n }}\r\n />\r\n )}\r\n \r\n );\r\n}\r\n","import { IRow } from 'app/components/BasicTable/IRow';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ISampleRun } from '../../SamplesListPage/slice/types';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\nexport const ExportRunDetailsSamples = (\r\n id: number,\r\n exportConfigurableColumns: Array | undefined,\r\n): Promise => {\r\n if (exportConfigurableColumns !== undefined) {\r\n try {\r\n const params = {\r\n $format: 'application/xlsx',\r\n $select: exportConfigurableColumns.join(','),\r\n };\r\n const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n const exportUrl = toRootedURL(samples_url, params);\r\n return openExportLink(exportUrl);\r\n } catch (error) {\r\n console.error('doRunDetailsExport failed', error);\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n }\r\n } else\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n};\r\nexport const ExportForImportRunDetailsSamples = (\r\n id: number,\r\n rows: ISampleRun[],\r\n exportConfigurableColumns: Array | undefined,\r\n): Promise => {\r\n if (rows?.length === 0)\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n if (exportConfigurableColumns !== undefined) {\r\n const params = {\r\n $format: 'application/xlsx',\r\n $filter: `Id in (${rows.map(f => f.Id).join(',')})`,\r\n $select: exportConfigurableColumns.join(','),\r\n };\r\n const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n const exportUrl = toRootedURL(samples_url, params);\r\n return openExportLink(exportUrl);\r\n } else\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n};\r\nexport const DownloadTemplateRunDetailsSamples = (\r\n id: number,\r\n exportConfigurableColumns: Array | undefined,\r\n): Promise | undefined => {\r\n if (exportConfigurableColumns !== undefined) {\r\n try {\r\n const params = {\r\n $format: 'application/xlsx',\r\n $top: 0,\r\n $select: exportConfigurableColumns.join(','),\r\n };\r\n const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n const exportUrl = toRootedURL(samples_url, params);\r\n return openExportLink(exportUrl);\r\n } catch (error) {\r\n console.error('doRunDetailsExport failed', error);\r\n }\r\n }\r\n};\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ISampleRun } from '../../SamplesListPage/slice/types';\r\nimport { ExportForImportRunDetailsSamples } from '../Actions';\r\n\r\nexport interface GetSelectedActionsProps {}\r\nexport function GetSelectedActions(\r\n t: TFunction,\r\n id: number,\r\n exportConfigurableColumns: Array | undefined,\r\n props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer[] {\r\n const [validUpdate] = React.useState(false);\r\n const SelectedActions: SelectedRowsActionRenderer<\r\n ISampleRun\r\n >[] = React.useMemo(\r\n () => [\r\n (rows, onRefresh, toggleAllRowsSelected) => (\r\n {\r\n toggleAllRowsSelected(false);\r\n }}\r\n variantButton=\"button\"\r\n action={() =>\r\n new Promise(async (resolve, reject) => {\r\n await ExportForImportRunDetailsSamples(\r\n id,\r\n rows,\r\n exportConfigurableColumns,\r\n );\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n })\r\n }\r\n />\r\n ),\r\n ],\r\n [exportConfigurableColumns, id, t, validUpdate],\r\n );\r\n return SelectedActions;\r\n}\r\n","import {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo } from 'react';\r\nimport { Form, Formik } from 'formik';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport * as Yup from 'yup';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\nexport interface PopupSuffixComponentProps {\r\n onSubmit: (value: string) => void;\r\n close: () => void;\r\n}\r\ninterface ISuffixOptions {\r\n Suffix: string;\r\n}\r\nconst schema: Yup.SchemaOf = Yup.object({\r\n Suffix: Yup.string().required(),\r\n});\r\nexport function PopupSuffixComponent(props: PopupSuffixComponentProps) {\r\n const { t } = useTranslation();\r\n const initialValues: ISuffixOptions = useMemo(() => {\r\n return {\r\n Suffix: '',\r\n };\r\n }, []);\r\n const handleSubmitk = useCallback(\r\n values => {\r\n props.onSubmit(values.Suffix);\r\n },\r\n [props],\r\n );\r\n const content = useMemo(() => {\r\n return (\r\n {\r\n handleSubmitk(values);\r\n }}\r\n >\r\n
    \r\n \r\n {t(translations.AnalyticalSampleIDSuffix)} {' '}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n );\r\n }, [handleSubmitk, initialValues, props.close, t]);\r\n return <>{content};\r\n}\r\nexport interface AnalyticalSampleIDSuffixPopupProps {\r\n show: boolean;\r\n onClose: () => void;\r\n onSubmit: (value: string) => void;\r\n}\r\nexport function AnalyticalSampleIDSuffixPopup({\r\n show,\r\n onClose,\r\n onSubmit,\r\n}: AnalyticalSampleIDSuffixPopupProps) {\r\n return (\r\n <>\r\n }\r\n />\r\n \r\n );\r\n}\r\nexport interface SuffixDialogProps {\r\n open: boolean;\r\n content: React.ReactNode;\r\n fullWidth: boolean;\r\n}\r\nexport function SuffixDialog(props: SuffixDialogProps) {\r\n return (\r\n \r\n {props.content}\r\n \r\n );\r\n}\r\n","export const CellPositionToNumber = (value: string, columns: number) => {\r\n let res = 0;\r\n if (value !== null) {\r\n const s = value.match(/[a-zA-Z]+|[0-9]+/g);\r\n if (s !== null) {\r\n if (s.length === 1) {\r\n const c1 = s[0][0].charCodeAt(0) - 64;\r\n const r1 = s[0][1].charCodeAt(0) - 64;\r\n res = (r1 - 1) * columns + c1;\r\n } else {\r\n const c = parseInt(s[0]);\r\n const r = parseInt(s[1]);\r\n if (!isNaN(c) && !isNaN(r)) {\r\n res = (r - 1) * columns + c;\r\n } else {\r\n if (isNaN(c) && !isNaN(r)) {\r\n const c1 = s[0].charCodeAt(0) - 64;\r\n res = (r - 1) * columns + c1;\r\n } else {\r\n if (!isNaN(c) && isNaN(r)) {\r\n const r1 = s[1].charCodeAt(0) - 64;\r\n res = (r1 - 1) * columns + c;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return res;\r\n};\r\n","/**\r\n *\r\n * RunPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { EditableCell } from '../EditableTable/EditableCell';\r\nimport { NumberField } from 'app/pages/Samples/EditableTable/Fields/NumberField';\r\nimport { TextField } from 'app/pages/Samples/EditableTable/Fields/TextField';\r\nimport { EditableTable } from '../EditableTable';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectRunDetails,\r\n selectRunDetailsGradient,\r\n selectRunDetailsInstrument,\r\n selectRunDetailsSecondaryInstrument,\r\n selectRunDetailsCreatedDate,\r\n selectRunDetailsAcquision_type,\r\n} from '../SamplesListPage/slice/selectors';\r\nimport {\r\n ISample,\r\n ISampleRun,\r\n ISampleTarget,\r\n} from '../SamplesListPage/slice/types';\r\nimport { useSamplesListSlice } from '../SamplesListPage/slice';\r\nimport { Box, Card, CardContent, Grid } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Link } from 'react-router-dom';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { SamplePlatePicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePicker';\r\nimport { getRunTypeValue } from '../components/RunTypePicker';\r\nimport { TargetSamplePlatePositionPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionPicker';\r\nimport { TargetSamplePlatePositionsPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionsPicker';\r\nimport { CreateSampleRunReservation } from '../components/CreateSampleRunReservation';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ImportButton } from './ImportButton';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { ReservationEditButton } from 'app/components/ReservationEditButton';\r\nimport { GetServiceRequestDetailsPath } from '../RequestSamplesPage/slice/path';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { Column } from 'react-table';\r\nimport { GetSelectedActions } from 'app/pages/Samples/RunDetailsPage/SelectedRowActions/GetSelectaedRowActions';\r\nimport {\r\n DownloadTemplateRunDetailsSamples,\r\n ExportRunDetailsSamples,\r\n} from './Actions';\r\nimport { useConfigurableColumnsAdvanced } from 'app/components/BasicTable/useConfigurableColumnsAdvanced';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { ImportButton as SamplesImportButton } from '../SamplesListPage/ImportButton';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { useRequestSamplesSlice } from '../RequestSamplesPage/slice';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { AnalyticalSampleIDSuffixPopup } from './AnalyticalSampleIDSuffix';\r\nimport { CellPositionToNumber } from './CellPositionToNumber';\r\n\r\nexport const RUN_DETAILS_PAGE_PATH = '/samples/runs/details/:id';\r\nexport interface RunPageProps extends RouteComponentProps<{ id: string }> {}\r\nexport function RunDetailsPage(props: RunPageProps) {\r\n const id = +props.match.params.id;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const appSettings = useSelector(selectAppSettings);\r\n const { actions } = useSamplesListSlice();\r\n const { actions: requestactions } = useRequestSamplesSlice();\r\n const runDetails = useSelector(selectRunDetails);\r\n const instrument = useSelector(selectRunDetailsInstrument);\r\n const secondaryInstrument = useSelector(selectRunDetailsSecondaryInstrument);\r\n const gradient = useSelector(selectRunDetailsGradient);\r\n const createdDate = useSelector(selectRunDetailsCreatedDate);\r\n const acquision_type = useSelector(selectRunDetailsAcquision_type);\r\n const [showSuffixDialog, setShowSuffixDialog] = React.useState(\r\n false,\r\n );\r\n const runType = runDetails?.RunType;\r\n\r\n const updateMyData = item => {\r\n // We also turn on the flag to not reset the page\r\n\r\n // setSkipPageReset(true);\r\n const foo: Omit = item as Omit;\r\n console.log('updateMyData', foo);\r\n dispatch(actions.updateRunSampleValue(item));\r\n };\r\n const samples = runDetails?.Samples;\r\n const handleCompleteButtonClick = React.useCallback(\r\n (suffix?: string) => {\r\n const data = samples;\r\n if (data === undefined) {\r\n return;\r\n }\r\n if (runType === undefined) {\r\n return;\r\n }\r\n\r\n dispatch(\r\n actions.completeRun({\r\n Id: id,\r\n RunType: runType,\r\n Samples: data,\r\n AnalyticalSampleIDSuffix: suffix,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, id, samples, runType],\r\n );\r\n const submitSuffixDialog = React.useCallback(\r\n (value: string) => {\r\n setShowSuffixDialog(false);\r\n handleCompleteButtonClick(value);\r\n },\r\n [handleCompleteButtonClick],\r\n );\r\n const showCompleteDialog = React.useCallback(() => {\r\n if (runDetails?.RunType === 'Fractioning') {\r\n setShowSuffixDialog(true);\r\n } else {\r\n handleCompleteButtonClick();\r\n }\r\n }, [handleCompleteButtonClick, runDetails?.RunType]);\r\n const runId = runDetails?.Id;\r\n\r\n const handleExportButtonClick = React.useCallback(() => {\r\n dispatch(actions.exportRun(samples || []));\r\n }, [actions, dispatch, samples]);\r\n const handleDownloadTemplateButtonClick = React.useCallback(() => {\r\n dispatch(actions.exportRun([]));\r\n }, [actions, dispatch]);\r\n const columns: Array> = [\r\n /*{\r\n Header: ' ',\r\n columns: [*/\r\n {\r\n Header: t(translations.SampleId) as string,\r\n accessor: 'Id', // accessor is the \"key\" in the data\r\n },\r\n {\r\n Header: 'Request ID',\r\n accessor: 'ServiceRequestId',\r\n Cell: ({ value }) => (\r\n {value}\r\n ),\r\n },\r\n {\r\n Header: 'Status',\r\n accessor: 'StatusName',\r\n Cell: ({ row, value }) => {\r\n /*switch (value) {\r\n case 0:\r\n return 'New';\r\n case 1:\r\n return 'In Work';\r\n case 2:\r\n return 'Done';\r\n default:\r\n return 'N/A';\r\n }*/\r\n return row.original.StatusName;\r\n },\r\n },\r\n { Header: 'Project ID', accessor: 'BudgetId' },\r\n //],\r\n //},\r\n /*{\r\n Header: 'Source sample attributes',\r\n columns: [*/\r\n {\r\n Header: 'Analytical Sample ID',\r\n accessor: 'AnalyticalSampleId',\r\n },\r\n {\r\n Header: 'BiologicalSampleId',\r\n accessor: 'BiologicalSampleId',\r\n },\r\n { Header: t(translations.TMT_Type) as string, accessor: 'TMT_Type' },\r\n {\r\n Header: t(translations.TMT_Label) as string,\r\n accessor: 'TMT_Label',\r\n },\r\n {\r\n id: 'TMT_RunSet',\r\n Header: t(translations.TMT_Set) as string,\r\n accessor: 'TMT_Set',\r\n Cell: ({ row, value }) => {\r\n if (row.ServiceRequestId !== undefined && row.TMT_Set !== undefined) {\r\n return `${row.ServiceRequestId}-${row.TMT_Set}`;\r\n } else {\r\n return <>;\r\n }\r\n },\r\n },\r\n //],\r\n //},\r\n /*{\r\n Header: 'Standard attributes',\r\n columns: [*/\r\n {\r\n Header: 'Tube Label',\r\n accessor: 'TubeLabel',\r\n },\r\n {\r\n Header: t(translations.SamplePlateId) as string,\r\n accessor: 'SamplePlateId',\r\n },\r\n {\r\n Header: t(translations.UniquePlateNumber) as string,\r\n accessor: 'UniquePlateNumber',\r\n },\r\n {\r\n Header: t(translations.PlatePosition) as string,\r\n accessor: 'Position',\r\n },\r\n {\r\n Header: t(translations.NumericalPlatePosition) as string,\r\n accessor: 'NumericalPlatePosition',\r\n Cell: ({ row, value }) => {\r\n if (value !== null) {\r\n const res = CellPositionToNumber(\r\n value,\r\n row.original.SamplePlateTypeColumns,\r\n );\r\n return res;\r\n } else {\r\n return value;\r\n }\r\n },\r\n },\r\n {\r\n Header: 'Volume (ul)',\r\n accessor: 'Volume',\r\n },\r\n {\r\n Header: 'Concentration (mg/mL)',\r\n accessor: 'Concentration',\r\n },\r\n {\r\n Header: t(translations.SampleType) as string,\r\n accessor: 'SampleType',\r\n },\r\n //],\r\n //},\r\n\r\n /*{\r\n Header: 'Target attributes',\r\n columns: [*/\r\n {\r\n Header: 'Target Tube Label',\r\n accessor: 'TargetTubeLabel',\r\n Cell: React.memo(EditableCell(TextField)),\r\n },\r\n {\r\n Header: 'Target Plate ID',\r\n accessor: 'TargetPlateId',\r\n Cell:\r\n runType === undefined || ['MassSpec'].includes(runType)\r\n ? 'N/A'\r\n : React.memo(EditableCell(SamplePlatePicker)),\r\n },\r\n {\r\n Header: 'Target Plate Position',\r\n accessor: 'TargetPosition',\r\n Cell:\r\n runType === undefined || ['MassSpec'].includes(runType)\r\n ? 'N/A'\r\n : ['Fractioning'].includes(runType)\r\n ? React.memo(EditableCell(TargetSamplePlatePositionsPicker))\r\n : React.memo(EditableCell(TargetSamplePlatePositionPicker)),\r\n },\r\n {\r\n Header: 'Target Volume (ul)',\r\n accessor: 'TargetVolume',\r\n Cell:\r\n runType === undefined || ['MassSpec'].includes(runType)\r\n ? 'N/A'\r\n : React.memo(EditableCell(NumberField)),\r\n },\r\n {\r\n Header: 'Target Concentration (mg/mL)',\r\n accessor: 'TargetConcentration',\r\n Cell:\r\n runType === undefined || ['MassSpec'].includes(runType)\r\n ? 'N/A'\r\n : React.memo(EditableCell(NumberField)),\r\n },\r\n {\r\n Header: 'Target Sample Type',\r\n accessor: 'TargetSampleType',\r\n Cell: React.memo(EditableCell(TextField)),\r\n },\r\n //],\r\n //},\r\n ];\r\n\r\n const pageActions = React.useMemo(() => {\r\n const actions: PageActionRenderer[] = [\r\n () => ,\r\n ];\r\n actions.push(() => (\r\n \r\n ));\r\n //if (runType !== 'MassSpec') {\r\n actions.push(() => (\r\n \r\n ));\r\n //}\r\n actions.push(() => (\r\n \r\n ));\r\n\r\n return actions;\r\n }, [\r\n handleDownloadTemplateButtonClick,\r\n handleExportButtonClick,\r\n runDetails,\r\n runId,\r\n samples,\r\n showCompleteDialog,\r\n t,\r\n ]);\r\n const {\r\n configurableColumns,\r\n columnAccessors,\r\n exportConfigurableColumns,\r\n handleConfigurableColumns,\r\n } = useConfigurableColumnsAdvanced(ScreensId.SampleRunsDetails, columns, [\r\n 'TargetTubeLabel',\r\n 'TargetPlateId',\r\n 'TargetPosition',\r\n 'TargetVolume',\r\n 'TargetConcentration',\r\n 'TargetSampleType',\r\n ]);\r\n React.useEffect(() => {\r\n dispatch(actions.loadRunDetqails({ id: id, columns: columnAccessors }));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n const handleExport = (): Promise => {\r\n return ExportRunDetailsSamples(id, exportConfigurableColumns);\r\n };\r\n const handleDownloadTemplateClick = (): Promise => {\r\n const res = DownloadTemplateRunDetailsSamples(\r\n id,\r\n exportConfigurableColumns,\r\n );\r\n if (res !== undefined) {\r\n return res;\r\n } else\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n };\r\n const importHandler = () => {\r\n dispatch(requestactions.toggleImport(true));\r\n };\r\n return (\r\n <>\r\n \r\n \r\n {t(translations.RunDetails)} {' '}\r\n \r\n {' #'} {id}\r\n \r\n }\r\n columns={configurableColumns !== undefined ? configurableColumns : []}\r\n data={runDetails?.Samples || []}\r\n useRowSelect={true}\r\n useGlobalFilter={true}\r\n // fetchData={fetchData}\r\n // skipPageReset={skipPageReset}\r\n updateMyData={updateMyData}\r\n pageActions={pageActions}\r\n handleConfigurableColumns={handleConfigurableColumns}\r\n handleExport={handleExport}\r\n useImportLink={true}\r\n importHandler={importHandler}\r\n onDownloadTemplate={handleDownloadTemplateClick}\r\n selectedRowsActions={GetSelectedActions(\r\n t,\r\n id,\r\n exportConfigurableColumns,\r\n {},\r\n )}\r\n subHeader={\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    Run Id:
    \r\n
    {id}
    \r\n
    Run Type:
    \r\n
    {getRunTypeValue(t, runDetails?.RunType)}
    \r\n
    Reservations:
    \r\n
    \r\n {(runDetails?.ReservationIds ?? []).length > 0\r\n ? runDetails?.ReservationIds?.map(reservationId => (\r\n <>\r\n \r\n  \r\n \r\n ))\r\n : 'N/A'}\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    Instrument:
    \r\n
    {instrument}
    \r\n
    SecondaryInstrument:
    \r\n
    {secondaryInstrument}
    \r\n
    Gradient:
    \r\n
    {gradient}
    \r\n
    Created date:
    \r\n
    \r\n \r\n
    \r\n
    Acquision type
    \r\n
    {acquision_type}
    \r\n
    \r\n
    \r\n
    \r\n {/*\r\n {t(translations.RunDetailsPageInstructions)}\r\n */}\r\n
    \r\n
    \r\n
    \r\n }\r\n />\r\n setShowSuffixDialog(false)}\r\n onSubmit={submitSuffixDialog}\r\n />\r\n \r\n );\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const EmailNotificationsApi = {\r\n deleteSelectedRows: (payload: number[]) => {\r\n const url = `/api/odata/v4/emailnotifications/DeleteSelected`;\r\n const data = { keys: payload };\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\nimport { IBasePageProps, IListPageProps } from '../IBasePageProps';\r\nimport { IEmailNotificationsRow } from './IEmailNotificationsRow';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { GetSelectedActions } from './SelectedRowActions/GetSelectedRowActions';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { withSavedHistoryT } from '../../components/BasicTable/withSavedHistory';\r\nimport { withGlobalServiceGroupFilter } from 'app/components/BasicTable/withGlobalServiceGroupFilter';\r\nimport { GetFilters as getFilters } from './Filter';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { AlertContentType } from 'app/components/BasicAlert';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\n\r\nexport const NOTIFICATIONS_LOG_PAGE_PATH = '/emailnotifications';\r\ntype RowType = IEmailNotificationsRow;\r\nexport interface EmailNotificationsPageProps\r\n extends IBasePageProps,\r\n IListPageProps {}\r\n\r\nfunction EmailNotifications(props: EmailNotificationsPageProps) {\r\n const { t } = useTranslation();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const settings = useSelector(selectglobalSettings);\r\n const scopeOfMonth = settings.GetString(\r\n AllowedSettings.DeleteEmailNotficationsMonth,\r\n );\r\n const topMessage = {\r\n type: 'info',\r\n message: t(translations.EmailNotficationsScreenWarning).replace(\r\n '{0}',\r\n scopeOfMonth,\r\n ),\r\n closable: true,\r\n } as AlertContentType;\r\n const isMainAdmin =\r\n user !== undefined && user.Roles.includes(Roles.Administrators);\r\n const columns: Column[] = React.useMemo(\r\n () => [\r\n {\r\n Header: t(translations.Timestamp) as string,\r\n accessor: 'Timestamp',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.Recipient) as string,\r\n accessor: 'RecipientName',\r\n Cell: ({ value, row }) =>\r\n row.original.Recipient !== null &&\r\n row.original.Recipient !== undefined ? (\r\n <>\r\n \r\n \r\n ) : (\r\n <>{t(translations.NA)}\r\n ),\r\n },\r\n {\r\n Header: t(translations.EmailTo) as string,\r\n accessor: 'EmailTo',\r\n },\r\n {\r\n Header: t(translations.EmailCc) as string,\r\n accessor: 'EmailCc',\r\n },\r\n {\r\n Header: t(translations.EmailBcc) as string,\r\n accessor: 'EmailBcc',\r\n },\r\n {\r\n Header: t(translations.CreatedBy) as string,\r\n accessor: 'CreatedByName',\r\n },\r\n {\r\n Header: t(translations.Subject) as string,\r\n accessor: 'Subject',\r\n },\r\n {\r\n Header: t(translations.EmailMessage) as string,\r\n accessor: 'Message',\r\n Cell: DescriptionCell({ width: 'medium' }),\r\n },\r\n {\r\n Header: t(translations.Asset) as string,\r\n accessor: 'AssetName',\r\n Cell: AssetRenderer,\r\n },\r\n {\r\n Header: t(translations.Attachment) as string,\r\n accessor: 'HasAttachment',\r\n },\r\n ],\r\n [t],\r\n );\r\n // const k = keys())\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Timestamp', desc: true }],\r\n }),\r\n [],\r\n );\r\n const selectedRowActions: SelectedRowsActionRenderer<\r\n IEmailNotificationsRow\r\n >[] = isMainAdmin ? GetSelectedActions({}) : [];\r\n\r\n const url = '/api/odata/v4/emailnotifications';\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\nconst TTable = withSavedHistoryT(\r\n BasicTable,\r\n '~/EmailNotifications',\r\n getFilters,\r\n);\r\n\r\nexport const EmailNotificationsPage = withGlobalServiceGroupFilter(\r\n EmailNotifications,\r\n false,\r\n);\r\n","import { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IEmailNotificationsRow } from '../IEmailNotificationsRow';\r\nimport * as React from 'react';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { EmailNotificationsApi } from 'api/EmailNotificationsApi';\r\n\r\nexport interface GetSelectedActionsProps {}\r\n\r\nexport function GetSelectedActions(\r\n props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer[] {\r\n const { t } = useTranslation();\r\n const SelectedActions: SelectedRowsActionRenderer<\r\n IEmailNotificationsRow\r\n >[] = React.useMemo(\r\n () => [\r\n (rows, onRefresh) => (\r\n \r\n {t(translations.ConfirmDeleteEmailNotif_message)}\r\n \r\n }\r\n confirmButtonLabel={t(translations.OK)}\r\n cancelButtonLabel={t(translations.Cancel)}\r\n rows={rows}\r\n onRefresh={onRefresh}\r\n variantButton=\"button\"\r\n validConfirm={true}\r\n action={() =>\r\n new Promise((resolve, reject) => {\r\n const postData = rows.map(item => item.Id);\r\n // do some work on the selected rows\r\n\r\n return EmailNotificationsApi.deleteSelectedRows(postData)\r\n .then(response => {\r\n let success = t(\r\n translations.DeleteNotifications_success,\r\n ) as string;\r\n resolve({\r\n SuccessMessages: [success],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n } as IResponseType);\r\n })\r\n .catch(error => {\r\n let err = t(translations.DeleteNotifications_error) as string;\r\n reject(err);\r\n });\r\n })\r\n }\r\n />\r\n ),\r\n ],\r\n [t],\r\n );\r\n return SelectedActions;\r\n}\r\n","import { makeStyles } from '@material-ui/core/styles';\r\n\r\nexport const styles = makeStyles(theme => ({\r\n /* Styles applied to the root element. */\r\n root: {\r\n position: 'relative',\r\n height: 32,\r\n backgroundColor: theme.palette.common.white,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n gap: 4,\r\n borderRadius: 8,\r\n '&.inputSizeSmall': {\r\n gap: 0,\r\n paddingRight: 8,\r\n },\r\n 'label + &': {\r\n marginTop: '21px',\r\n },\r\n '&:hover': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.80)',\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n },\r\n },\r\n '&$focused': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n },\r\n '&$disabled': {\r\n backgroundColor: theme.palette.common.backgroundHover,\r\n },\r\n },\r\n /* Styles applied to the root element if the component is a descendant of `FormControl`. */\r\n formControl: {\r\n 'label + &': {\r\n marginTop: '21px',\r\n },\r\n },\r\n /* Styles applied to the root element if the component is focused. */\r\n focused: {\r\n border: `1px solid ${theme.palette.primary.textHover}`,\r\n },\r\n /* Styles applied to the root element if `disabled={true}`. */\r\n disabled: {\r\n backgroundColor: theme.palette.common.backgroundHover,\r\n },\r\n /* Styles applied to the root element if color secondary. */\r\n colorSecondary: {\r\n '&$underline:after': {\r\n borderBottomColor: theme.palette.secondary.main,\r\n },\r\n },\r\n /* Styles applied to the root element if `disableUnderline={false}`. */\r\n underline: {\r\n // '&:after': {\r\n // borderBottom: `2px solid ${theme.palette.primary.main}`,\r\n // left: 0,\r\n // bottom: 0,\r\n // // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n // content: '\"\"',\r\n // position: 'absolute',\r\n // right: 0,\r\n // transform: 'scaleX(0)',\r\n // transition: theme.transitions.create('transform', {\r\n // duration: theme.transitions.duration.shorter,\r\n // easing: theme.transitions.easing.easeOut,\r\n // }),\r\n // pointerEvents: 'none', // Transparent to the hover style.\r\n // },\r\n // '&$focused:after': {\r\n // transform: 'scaleX(1)',\r\n // },\r\n // '&$error:after': {\r\n // borderBottomColor: theme.palette.error.main,\r\n // transform: 'scaleX(1)', // error is always underlined in red\r\n // },\r\n // '&:before': {\r\n // borderBottom: `1px solid ${theme.palette.primary.textHover}`,\r\n // left: 0,\r\n // bottom: 0,\r\n // // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n // content: '\"\\\\00a0\"',\r\n // position: 'absolute',\r\n // right: 0,\r\n // transition: theme.transitions.create('border-bottom-color', {\r\n // duration: theme.transitions.duration.shorter,\r\n // }),\r\n // pointerEvents: 'none', // Transparent to the hover style.\r\n // },\r\n // '&:hover:not($disabled):before': {\r\n // borderBottom: `2px solid ${theme.palette.text.primary}`,\r\n // // Reset on touch devices, it doesn't add specificity\r\n // '@media (hover: none)': {\r\n // borderBottom: `1px solid ${theme.palette.primary.textHover}`,\r\n // },\r\n // },\r\n // '&$disabled:before': {\r\n // borderBottomStyle: 'dotted',\r\n // },\r\n },\r\n /* Pseudo-class applied to the root element if `error={true}`. */\r\n error: {\r\n border: `1px solid ${theme.palette.error.main}`,\r\n },\r\n /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n marginDense: {\r\n borderRadius: 8,\r\n height: 24,\r\n },\r\n /* Styles applied to the root element if `multiline={true}`. */\r\n multiline: {\r\n padding: '6px 12px',\r\n '&$marginDense': {\r\n paddingTop: 1,\r\n paddingBottom: 1,\r\n },\r\n },\r\n /* Styles applied to the root element if `fullWidth={true}`. */\r\n fullWidth: {},\r\n /* Styles applied to the `input` element. */\r\n input: {\r\n minWidth: theme.spacing(6),\r\n padding: '6px 12px',\r\n borderRadius: 8,\r\n '&:-webkit-autofill': {\r\n WebkitBoxShadow:\r\n theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset',\r\n WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff',\r\n caretColor: theme.palette.type === 'light' ? null : '#fff',\r\n },\r\n '&&.inputSizeSmall &': {\r\n padding: '6px 8px',\r\n },\r\n },\r\n /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n inputMarginDense: {\r\n paddingTop: 1,\r\n paddingBottom: 1,\r\n },\r\n /* Styles applied to the `input` element if `multiline={true}`. */\r\n inputMultiline: {\r\n padding: 0,\r\n },\r\n /* Styles applied to the `input` element if `type=\"search\"`. */\r\n inputTypeSearch: {},\r\n // inputAdornedEnd: {\r\n // padding: '6px 8px',\r\n // },\r\n}));\r\n","import {\r\n Input,\r\n InputBaseProps,\r\n InputClassKey,\r\n StandardProps,\r\n} from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { styles } from './styles';\r\n\r\nexport interface StandardInputProps\r\n extends StandardProps {\r\n disableUnderline?: boolean;\r\n className?: string;\r\n fullWidth?: boolean;\r\n multiline?: boolean;\r\n noBorder?: boolean;\r\n info?: string;\r\n}\r\n// export function StandardInput(\r\n// {\r\n// classes,\r\n// className,\r\n// fullWidth,\r\n// inputComponent,\r\n// multiline,\r\n// noBorder,\r\n// type,\r\n// ...rest\r\n// }: StandardInputProps,\r\n// ref: React.Ref,\r\n// ) {\r\n// const innerClasses = styles();\r\n// fullWidth = false;\r\n// inputComponent = 'input';\r\n// multiline = false;\r\n// noBorder = false;\r\n// type = 'text';\r\n\r\n// return (\r\n// \r\n// );\r\n// }\r\nexport const StandardInput = React.forwardRef<\r\n React.HTMLAttributes,\r\n StandardInputProps\r\n>(function StandardInput(props, ref) {\r\n const {\r\n disableUnderline = true,\r\n classes = styles(),\r\n className,\r\n fullWidth = false,\r\n inputComponent = 'input',\r\n multiline = false,\r\n type = 'text',\r\n ...rest\r\n } = props;\r\n return (\r\n \r\n );\r\n});\r\nexport default StandardInput;\r\n","import * as React from 'react';\r\nimport { IBasePageProps } from '../../pages/IBasePageProps';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\n\r\n/**\r\n * Connects the saved selected global service groups filter with the element:\r\n * 1. Sets the state to show/hide the top service groups filter UI element\r\n * 2. Connects the saved selection to the prop of the wrapped element\r\n * example: export const FooPage = withGlobalServiceGroupFilter(FooPageComponent, true)\r\n * @param Component Page component that extends the IBasePageProps params interface\r\n * @param applyGlobalServiceGroupsFilter enable/disable the global service groups filter on a page\r\n * @returns component that can be passed to the router\r\n */\r\nexport function withGlobalServiceGroupFilter

    (\r\n Component: React.ComponentType

    ,\r\n applyGlobalServiceGroupsFilter: boolean,\r\n): React.FC

    {\r\n return ({ ...props }: IBasePageProps) => {\r\n const { serviceGroups } = useGlobalServiceGroupsFilter(\r\n applyGlobalServiceGroupsFilter,\r\n );\r\n\r\n if (serviceGroups === undefined && applyGlobalServiceGroupsFilter) {\r\n return <>;\r\n }\r\n return ;\r\n };\r\n}\r\n","/**\r\n *\r\n * UserGroupFilter\r\n *\r\n */\r\nimport { UserGroupPicker } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserGroupFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default UserGroupFilter;\r\n","import { IconProp } from 'app/AllIcons';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectSiteMapProvider,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AssetsSubTabUnionArray, MainTabsUnion } from 'types/SiteMapSettings';\r\nimport * as React from 'react';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface AdminActionsProps {\r\n menuTab: MainTabsUnion;\r\n icon?: IconProp;\r\n id?: string;\r\n title?: string;\r\n action?: RowActionsProps;\r\n subTab?: any;\r\n}\r\nexport function AdminActions(props: AdminActionsProps) {\r\n const { menuTab, icon, id, title, action, subTab } = props;\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const siteMapProvider = useSelector(selectSiteMapProvider);\r\n const admin =\r\n authenticatedUser !== undefined &&\r\n (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators) ||\r\n authenticatedUser.Roles.includes(Roles.CustomRole));\r\n // const handleSettingClick = React.useCallback(\r\n // (link: string) => {\r\n // dispatch(\r\n // actions.openAdminPanel({\r\n // url: link,\r\n // }),\r\n // );\r\n // },\r\n // [actions, dispatch],\r\n // );\r\n const adminSettings = React.useMemo(() => {\r\n let actions: RowActionsProps[] = [];\r\n if (admin) {\r\n if (menuTab === 'Assets' && !subTab) {\r\n AssetsSubTabUnionArray.forEach(ar => {\r\n actions = [\r\n ...actions,\r\n ...siteMapProvider.adminSettingsActions(\r\n menuTab,\r\n authenticatedUser,\r\n ar,\r\n undefined, // handleSettingClick,\r\n ),\r\n ];\r\n });\r\n } else {\r\n if (menuTab === 'Budgets' && !subTab) {\r\n return siteMapProvider.adminSettingsActions(\r\n menuTab,\r\n authenticatedUser,\r\n 'BudgetTabSetting',\r\n undefined, // handleSettingClick,\r\n );\r\n }\r\n return siteMapProvider.adminSettingsActions(\r\n menuTab,\r\n authenticatedUser,\r\n subTab,\r\n undefined, // handleSettingClick,\r\n );\r\n }\r\n }\r\n if (!!action) {\r\n actions.push(action);\r\n }\r\n return actions;\r\n }, [admin, action, menuTab, subTab, siteMapProvider, authenticatedUser]);\r\n\r\n return adminSettings.length > 0 ? (\r\n \r\n ) : null;\r\n}\r\n","/**\r\n *\r\n * ButtonLink\r\n *\r\n */\r\nimport React from 'react';\r\nimport { Link, styled } from '@material-ui/core';\r\n\r\nexport interface ButtonLinkProps {\r\n children: React.ReactNode;\r\n onClick?: React.MouseEventHandler &\r\n React.MouseEventHandler &\r\n React.MouseEventHandler;\r\n className?: string;\r\n id?: string;\r\n href?: string;\r\n color?:\r\n | 'inherit'\r\n | 'initial'\r\n | 'primary'\r\n | 'secondary'\r\n | 'textPrimary'\r\n | 'textSecondary'\r\n | 'error';\r\n}\r\n\r\n/**\r\n * Button styles as a Link\r\n * @param param0\r\n * @returns\r\n */\r\nexport default function ButtonLink(props: ButtonLinkProps) {\r\n return (\r\n \r\n );\r\n}\r\nconst StyledLink = styled(Link)(({ theme }) => ({\r\n cursor: 'pointer',\r\n}));\r\n","/**\r\n *\r\n * AssetCatGroupFilter\r\n *\r\n */\r\nimport { AssetCatGroupPicker } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IAssetCatGroupDto } from 'api/odata/generated/entities/IAssetCatGroupDto';\r\n\r\nexport const AssetCatGroupFilter = (props: IFilterComponentProps) => {\r\n const { t } = useTranslation();\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n if (props.readonly === true) {\r\n return <>{props.value?.Name};\r\n }\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AssetCatGroupFilter;\r\n","/**\r\n *\r\n * CampusPickerFilter\r\n *\r\n */\r\nimport { InstitutePicker } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const InstituteFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default InstituteFilter;\r\n","export interface IResponseType {\r\n SuccessMessages: string[];\r\n ErrorMessages: string[];\r\n WarningMessages: string[];\r\n}\r\nexport interface IResponseTypeWithId extends IResponseType {\r\n Id?: number;\r\n}\r\nexport interface IResponseTypeWithLink extends IResponseTypeWithId {\r\n link?: string;\r\n}\r\n\r\nexport const GetResponseMessages = (\r\n response,\r\n infoText: string,\r\n): IResponseType => {\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n if (typeof response.value === 'string') {\r\n if ((response.value = 'Ok')) {\r\n messages.SuccessMessages.push(infoText);\r\n } else {\r\n messages.ErrorMessages.push(infoText + ': ' + response.value);\r\n }\r\n } else {\r\n if (response.SuccessMessages && response.SuccessMessages.length > 0) {\r\n response.SuccessMessages.forEach(element => {\r\n messages.SuccessMessages.push(element);\r\n });\r\n }\r\n if (response.ErrorMessages && response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(element => {\r\n messages.ErrorMessages.push(element);\r\n });\r\n }\r\n if (response.WarningMessages && response.WarningMessages.length > 0) {\r\n response.WarningMessages.forEach(element => {\r\n messages.WarningMessages.push(element);\r\n });\r\n }\r\n if (\r\n messages.SuccessMessages.length === 0 &&\r\n response.ErrorMessages.length === 0 &&\r\n response.WarningMessages.length === 0\r\n ) {\r\n messages.SuccessMessages = [infoText];\r\n }\r\n }\r\n return messages;\r\n};\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ProjectPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ProjectFilter';\r\nexport const initProjectData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function ProjectPicker(props: ProjectPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { BudgetPicker } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\n\r\nexport const ProjectFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default ProjectFilter;\r\n","/**\r\n *\r\n * AssetCatFilter\r\n *\r\n */\r\nimport { AssetCatPicker } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AssetCatFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n );\r\n};\r\nexport default AssetCatFilter;\r\n","/**\r\n *\r\n * ServiceGroupFilter\r\n *\r\n */\r\n\r\nimport { ServiceGroupPicker } from 'app/components/pickers/ServiceGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\n\r\nexport const ServiceGroupFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n return (\r\n \r\n );\r\n};\r\nexport default ServiceGroupFilter;\r\n","/**\r\n *\r\n * DepartmentFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DepartmentPicker } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const DepartmentFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default DepartmentFilter;\r\n","/**\r\n *\r\n * ServiceTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IApplyGlobalServiceGroupFilter } from 'types/IApplyGlobalServiceGroupFilter';\r\nimport { IServiceGroupRelated } from 'types/IServiceGroupRelated';\r\n\r\ninterface IServiceDto extends Entity, IServiceGroupRelated {}\r\n\r\nexport interface ServiceTypePickerProps\r\n extends Omit>, 'loadData'>,\r\n IApplyGlobalServiceGroupFilter {}\r\n\r\nconst url = '/api/odata/v4/ServiceTypeFilter';\r\n\r\nexport function withServiceGroupFilter(\r\n globalServiceGroupFilter: Entity[],\r\n) {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n };\r\n}\r\nexport const initServiceTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,ServiceGroupId',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function ServiceTypePicker(props: ServiceTypePickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const loadData = withServiceGroupFilter(globalServiceGroupFilter || []);\r\n\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * UserDisciplinePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserDisciplinePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/DisciplineFilter';\r\nconst publicUrl = '/api/odata/v4/DisciplineFilter/PublicDisciplines';\r\nexport const initUserDisciplineData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function UserDisciplinePicker(props: UserDisciplinePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n\r\nconst loadPublicData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(publicUrl, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function UserDisciplinePublicPicker(props: UserDisciplinePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * BookitlabLogo\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { messages } from './messages';\r\n\r\nexport interface BookitlabLogoProps {\r\n width?: number | string;\r\n height?: number | string;\r\n vectorSmallOverlapColor?: string;\r\n vaectorBigCircleColor?: string;\r\n vectorSmallCircleColor?: string;\r\n vectorBigOverlapColor?: string;\r\n vectorBackColor?: string;\r\n size?: '123x34' | '80x24';\r\n}\r\n\r\nexport const BookitlabLogo = React.memo(function BookitlabLogo(\r\n props: BookitlabLogoProps,\r\n) {\r\n const { width, height, size } = props;\r\n const { t } = useTranslation();\r\n\r\n return size === '80x24' ? (\r\n \r\n {t(messages.bookitlab())}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n {t(messages.bookitlab())}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n});\r\n\r\nexport const BookitlabLoginLogo = React.memo(function BookitlabLoginLogo(\r\n props: BookitlabLogoProps,\r\n) {\r\n const { width, height } = props;\r\n const { t } = useTranslation();\r\n return (\r\n \r\n {t(messages.bookitlab())}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * InstituteTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InstituteTypePicker } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const InstituteTypeFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default InstituteTypeFilter;\r\n","/**\r\n *\r\n * InvoiceIdMultiPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InvoiceIdProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InvoiceIdFilter';\r\nexport const initInvoiceIdData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const ids = initval.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: '(Id in (' + ids.join(',') + '))',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null): Promise[]> => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Id asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function InvoiceIdMultiPicker(props: InvoiceIdProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { LabelTypes } from '../slice/types';\r\nimport Handlebars from 'handlebars';\r\n\r\n/**\r\n * Produces a URL used to print QR barcodes\r\n * @param item data record e.g. assetDetails, LocationListDto, etc.\r\n * @param type The type of the URL Template: Asset/LocationList/etc.\r\n * @param urlTemplate The URL template as configured in system settings\r\n * @returns\r\n */\r\nexport function getQrUrl(item: any, type: LabelTypes, urlTemplate: string) {\r\n if (\r\n type === 'Asset' &&\r\n (item as IGetQrURLAssetDetails).InternalCode !== undefined\r\n ) {\r\n return getAssetQrUrl(item, urlTemplate);\r\n } else {\r\n return getQrUrlH(item, urlTemplate);\r\n }\r\n}\r\n\r\ninterface IGetQrURLAssetDetails {\r\n InternalCode: string | null;\r\n}\r\n\r\nfunction getAssetQrUrl(\r\n assetDetails: IGetQrURLAssetDetails,\r\n AssetBarcodeUrlTemplate,\r\n) {\r\n if (assetDetails.InternalCode === null) {\r\n throw new Error('Asset QR: Internal code is empty');\r\n }\r\n return AssetBarcodeUrlTemplate.replace(\r\n /:internalCode/g,\r\n assetDetails.InternalCode,\r\n );\r\n}\r\n\r\n/**\r\n * Produces a URL through Handlebars engine\r\n * @param item data record\r\n * @param urlTemplate url template string\r\n * @returns URL for QR label print\r\n */\r\nfunction getQrUrlH(item: any, urlTemplate) {\r\n const template = Handlebars.compile(urlTemplate);\r\n const url = template(item);\r\n return url;\r\n}\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { IFileResult, ILabelPrinter } from '.';\r\nimport { LabelPrinter } from '../slice/types';\r\nimport { getQrUrl } from './getQrUrl';\r\n\r\nconst generateLabel = (labelXml, assetData, AssetBarcodeUrlTemplate) => {\r\n var label = globalThis.dymo.label.framework.openLabelXml(labelXml);\r\n var objectMapping = getObjectMapping(label, AssetBarcodeUrlTemplate);\r\n Object.keys(objectMapping).forEach(function (objectName) {\r\n var writeData = objectMapping[objectName](assetData);\r\n if (objectName === 'Name') {\r\n var splittedData = writeData.split('-');\r\n writeData = splittedData[0];\r\n if (splittedData.length > 1) {\r\n writeData += '-' + splittedData[1];\r\n }\r\n }\r\n if (objectName === 'Room') {\r\n if (assetData.LocationName) writeData += ', ' + assetData.LocationName;\r\n if (assetData.SubLocationName)\r\n writeData += ', ' + assetData.SubLocationName;\r\n }\r\n console.log('writeData', writeData);\r\n label.setObjectText(objectName, writeData);\r\n });\r\n return label;\r\n};\r\nconst getObjectMapping = (label, AssetBarcodeUrlTemplate) => {\r\n var staticObjectNames = ['CompanyLogo', 'StaticText'];\r\n return label.getObjectNames().reduce(function (previousValue, currentValue) {\r\n var nameParts = currentValue.split('_');\r\n var assetPropertyName = nameParts[0];\r\n if (staticObjectNames.indexOf(assetPropertyName) >= 0) {\r\n return previousValue;\r\n }\r\n if (assetPropertyName.toLowerCase() === 'qr') {\r\n if (nameParts.length > 1 && nameParts[1].toLowerCase() === 'text') {\r\n previousValue[currentValue] = function (assetData) {\r\n return getQrUrl(assetData, 'Asset', AssetBarcodeUrlTemplate);\r\n };\r\n }\r\n } else {\r\n previousValue[currentValue] = function (assetData) {\r\n var value = getValue(assetData, currentValue);\r\n if (value === null || value === undefined) {\r\n return 'N/A';\r\n } else {\r\n return value.toString();\r\n }\r\n };\r\n }\r\n return previousValue;\r\n }, {});\r\n};\r\nfunction getValue(obj, path) {\r\n var properties = path.split(/[.[\\]]+/);\r\n while (properties.length) {\r\n var property = properties.shift();\r\n obj = obj[property];\r\n if (obj === null || obj === undefined) {\r\n return null;\r\n }\r\n }\r\n return obj;\r\n}\r\n\r\nexport const Dymo: ILabelPrinter = {\r\n getPrinters: () => {\r\n const dymoLabelPrinterOption = printer => ({\r\n Id: printer.name,\r\n Name: `Dymo - ${printer.name}`,\r\n Type: 'Dymo',\r\n Device: printer,\r\n });\r\n return initDymoFramework()\r\n .then(p => {\r\n return globalThis.dymo.label.framework.getLabelWriterPrintersAsync();\r\n })\r\n .then(dymoPrinters => {\r\n const result = dymoPrinters.map(dymoLabelPrinterOption);\r\n return result;\r\n });\r\n },\r\n\r\n preview: (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: any[],\r\n options,\r\n ) => {\r\n return new Promise((resolve, reject) => {\r\n const result: IFileResult[] = [];\r\n try {\r\n for (const assetData of data) {\r\n var label = generateLabel(\r\n labelType.Xml,\r\n assetData,\r\n options.AssetBarcodeUrlTemplate,\r\n );\r\n var labelPreview = 'data:image/png;base64,' + label.render();\r\n var blob = dataURItoBlob(labelPreview);\r\n result.push({\r\n fileName: `${assetData.Name}.png`,\r\n content: blob,\r\n });\r\n }\r\n resolve(result);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n },\r\n download: (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: any[],\r\n options,\r\n ) => {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const result: any[] = [];\r\n for (const assetData of data) {\r\n var label = generateLabel(\r\n labelType.Xml,\r\n assetData,\r\n options.AssetBarcodeUrlTemplate,\r\n );\r\n var blob = new Blob([label.getLabelXml()], { type: 'text/xml' });\r\n\r\n result.push({\r\n fileName: `${assetData.Name}.label`,\r\n content: blob,\r\n });\r\n }\r\n resolve(result);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n },\r\n print: (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: any[],\r\n options,\r\n ) => {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n var printParams = globalThis.dymo.label.framework.createLabelWriterPrintParamsXml(\r\n {\r\n twinTurboRoll:\r\n globalThis.dymo.label.framework.TwinTurboRoll[\r\n labelType.twinTurboRoll ?? 'Left'\r\n ],\r\n },\r\n );\r\n\r\n for (var index = 0; index < data.length; index++) {\r\n var assetData = data[index];\r\n var label = generateLabel(\r\n labelType.Xml,\r\n assetData,\r\n options.AssetBarcodeUrlTemplate,\r\n );\r\n label.print(printer.Id, printParams);\r\n }\r\n resolve(null);\r\n } catch (err) {\r\n reject(err);\r\n }\r\n });\r\n },\r\n};\r\nconst initDymoFramework: () => Promise = () => {\r\n return new Promise((resolve, reject) => {\r\n const framework = globalThis.dymo.label.framework;\r\n\r\n framework.init(p => {\r\n if (!!p.errorDetails) {\r\n reject(p.errorDetails);\r\n } else {\r\n resolve(framework);\r\n }\r\n });\r\n });\r\n};\r\n\r\nfunction dataURItoBlob(dataURI) {\r\n // convert base64 to raw binary data held in a string\r\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\r\n var byteString = atob(dataURI.split(',')[1]);\r\n\r\n // separate out the mime component\r\n var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n\r\n // write the bytes of the string to an ArrayBuffer\r\n var ab = new ArrayBuffer(byteString.length);\r\n\r\n // create a view into the buffer\r\n var ia = new Uint8Array(ab);\r\n\r\n // set the bytes of the buffer to the correct values\r\n for (var i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n\r\n // write the ArrayBuffer to a blob, and you're done\r\n var blob = new Blob([ab], { type: mimeString });\r\n return blob;\r\n}\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport Handlebars from 'handlebars';\r\nimport { ILabelPrinter } from '.';\r\nimport { LabelPrinter } from '../slice/types';\r\n\r\nHandlebars.registerHelper('padStart', (context, maxLength, fillString) => {\r\n return String(context).padStart(maxLength, fillString);\r\n});\r\nHandlebars.registerHelper('padEnd', (context, maxLength, fillString) => {\r\n return String(context).padEnd(maxLength, fillString);\r\n});\r\n\r\nexport const zebra: ILabelPrinter = {\r\n getPrinters: () => {\r\n return new Promise((resolve, reject) => {\r\n globalThis.BrowserPrint.getLocalDevices(\r\n device_list => {\r\n resolve(\r\n device_list.printer.map(p => {\r\n var r: LabelPrinter = {\r\n Id: p.uid,\r\n Type: 'Zebra',\r\n Name: `Zebra - ${p.name}`,\r\n Device: p,\r\n };\r\n return r;\r\n }),\r\n );\r\n },\r\n reason => {\r\n const res =\r\n reason.trim() !== ''\r\n ? reason\r\n : 'Zebra Label Framework Plugin is not installed';\r\n reject(res);\r\n },\r\n );\r\n });\r\n },\r\n print: (printer, labelType, data, options) => {\r\n // noEscape: true to prevent the escapeExpression function from being called in handlebars\\utils module,\r\n // which replaces some characters with HTML codes.\r\n const t = Handlebars.compile(labelType.Xml, { noEscape: true });\r\n const labels = data.map(item => t(item));\r\n const zebra = new globalThis.Zebra.Printer(printer.Device);\r\n globalThis.Zebra.stopWatching(printer.Device);\r\n return Promise.all(\r\n labels.map(\r\n item =>\r\n new Promise((resolve, reject) => {\r\n console.debug('Zebra Printer - printing', item, zebra);\r\n\r\n zebra.send(\r\n item,\r\n function (success) {\r\n resolve(success);\r\n },\r\n function (error) {\r\n console.error('Error:' + error);\r\n reject(error);\r\n },\r\n );\r\n }),\r\n ),\r\n );\r\n },\r\n preview: function (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: any[],\r\n options: {\r\n AssetBarcodeUrlTemplate: string;\r\n RoomBarcodeUrlTemplate: string;\r\n LocationBarcodeUrlTemplate: string;\r\n SubLocationBarcodeUrlTemplate: string;\r\n ConsumableTypeBarcodeUrlTemplate: string;\r\n },\r\n ): Promise {\r\n throw new Error('Function not implemented.');\r\n },\r\n download: function (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: any[],\r\n options: {\r\n RoomBarcodeUrlTemplate: string;\r\n AssetBarcodeUrlTemplate: string;\r\n LocationBarcodeUrlTemplate: string;\r\n SubLocationBarcodeUrlTemplate: string;\r\n ConsumableTypeBarcodeUrlTemplate: string;\r\n },\r\n ): Promise {\r\n throw new Error('Function not implemented.');\r\n },\r\n};\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { LabelPrinter } from '../slice/types';\r\nimport { Dymo as DymoPrinter } from './Dymo';\r\nimport { zebra as ZebraPrinter } from './Zebra';\r\n\r\nexport type TGetPrinter = () => Promise>;\r\n\r\nexport type TPrint = (\r\n printer: LabelPrinter,\r\n labelType: ILabelTypeDto,\r\n data: Array,\r\n options: {\r\n AssetBarcodeUrlTemplate: string;\r\n RoomBarcodeUrlTemplate: string;\r\n LocationBarcodeUrlTemplate: string;\r\n SubLocationBarcodeUrlTemplate: string;\r\n SamplePlateBarcodeUrlTemplate: string;\r\n ConsumableTypeBarcodeUrlTemplate: string;\r\n },\r\n) => Promise;\r\nexport interface IFileResult {\r\n fileName: string;\r\n content: any;\r\n}\r\nexport type ILabelPrinter = {\r\n getPrinters: TGetPrinter;\r\n print: TPrint;\r\n preview: TPrint;\r\n download: TPrint;\r\n};\r\n\r\nexport const Dymo = DymoPrinter;\r\nexport const Zebra = ZebraPrinter;\r\nexport const getPrinterInterface = (printer: LabelPrinter) => {\r\n switch (printer.Type) {\r\n case 'Dymo':\r\n return Dymo;\r\n case 'Zebra':\r\n return Zebra;\r\n }\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLeading, takeLatest } from 'redux-saga/effects';\r\nimport { labelPrintActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\n\r\nimport { selectLabelPrint } from './selectors';\r\nimport {\r\n IPrintAssetLabelArgs,\r\n LabelPrinter,\r\n LabelPrintState,\r\n OpenPrintDialogPayload,\r\n} from './types';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Dymo, getPrinterInterface, TPrint, Zebra } from '../Printers';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { getQrUrl } from '../Printers/getQrUrl';\r\nimport fileDownload from 'js-file-download';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nfunction* doGetPrinters(action: PayloadAction) {\r\n let printers: Array = [];\r\n const systemSettings = yield select(selectglobalSettings);\r\n if (systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported)) {\r\n try {\r\n const dymo_printers = yield call(Dymo.getPrinters);\r\n printers = [...printers, ...dymo_printers];\r\n } catch (error: unknown) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: String(error),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.getPrinters_Error(Error));\r\n }\r\n }\r\n if (systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported)) {\r\n try {\r\n const zebra_printers = yield call(Zebra.getPrinters);\r\n printers = [...printers, ...zebra_printers];\r\n } catch (error: unknown) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: String(error),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.getPrinters_Error(Error));\r\n }\r\n }\r\n\r\n const serializablePayload = JSON.parse(JSON.stringify(printers));\r\n yield put(actions.getPrinters_Success(serializablePayload));\r\n}\r\nfunction* doGetLabelTypes(action: PayloadAction) {\r\n try {\r\n var filter = new Condition(\r\n 'Type',\r\n ODataOperators.Equals,\r\n action.payload.type,\r\n );\r\n\r\n const labelTypes = yield call(httpClient.get, '/api/odata/v4/labeltypes', {\r\n $filter: filter.toString(),\r\n });\r\n yield put(actions.getLabelTypes_Success(labelTypes.value));\r\n } catch (error) {\r\n yield put(actions.getLabelTypes_Error(error));\r\n }\r\n}\r\nasync function loadObjects(action: PayloadAction) {\r\n switch (action.payload.type) {\r\n case 'Asset':\r\n const assetResponse = await httpClient.get(`/api/odata/v4/AssetDetails`, {\r\n $filter: `Id in (${action.payload.ids.join(',')})`,\r\n });\r\n return assetResponse.value;\r\n /* const assets = await Promise.allSettled(\r\n action.payload.ids.map(assetId =>\r\n httpClient.get(\r\n `/api/odata/v4/AssetDetails(${assetId})?serviceId=0`,\r\n ),\r\n ),\r\n );\r\n return assets; */\r\n case 'Room':\r\n const roomResponse = await httpClient.get(\r\n `/api/odata/v4/LocationsBuilding`,\r\n {\r\n $filter: `Id in (${action.payload.ids.join(',')})`,\r\n },\r\n );\r\n return roomResponse.value;\r\n case 'LocationList':\r\n const locationlistsResponse = await httpClient.get(\r\n `/api/odata/v4/LocationList`,\r\n {\r\n $filter: `Id in (${action.payload.ids.join(',')})`,\r\n },\r\n );\r\n return locationlistsResponse.value;\r\n case 'SubLocationList':\r\n const sublocationlistsResponse = await httpClient.get(\r\n `/api/odata/v4/SubLocationList`,\r\n {\r\n $filter: `Id in (${action.payload.ids.join(',')})`,\r\n },\r\n );\r\n return sublocationlistsResponse.value;\r\n case 'SamplePlate':\r\n const Ids = action.payload.ids.map(id => \"'\" + id + \"'\");\r\n const samplePlatesResponse = await httpClient.get(\r\n `/api/odata/v4/SamplePlates`,\r\n {\r\n $filter: `Id in (${Ids.join(',')})`,\r\n },\r\n );\r\n return samplePlatesResponse.value;\r\n case 'Consumable':\r\n const consumableTypesResponse = await httpClient.get(\r\n `/api/odata/v4/AssetDetails`,\r\n {\r\n $filter: `Id in (${action.payload.ids.join(',')})`,\r\n },\r\n );\r\n return consumableTypesResponse.value;\r\n default:\r\n throw new Error('loadObjects NotImplemented');\r\n }\r\n}\r\nfunction* doGetObjects(action: PayloadAction) {\r\n try {\r\n const responses = yield call(loadObjects, action);\r\n const assetDetails = responses.map(response => response);\r\n yield put(actions.getAssetDetails_Success(assetDetails));\r\n } catch (error) {\r\n yield put(actions.getAssetDetails_Failure(error));\r\n }\r\n}\r\nfunction* doOpen(action: PayloadAction) {\r\n const state: LabelPrintState = yield select(selectLabelPrint);\r\n if (state.printers.value === undefined) {\r\n yield put(actions.getPrinters());\r\n }\r\n if (state.data.value === undefined) {\r\n yield put(actions.getAssetDetails(action.payload));\r\n }\r\n if (state.labelTypes.value === undefined) {\r\n yield put(actions.getLabelTypes(action.payload));\r\n }\r\n}\r\n\r\nfunction* doPrint(action: PayloadAction) {\r\n if (!action.payload.printer) {\r\n yield put(actions.getAssetDetails_Failure(`Printer not selected.`));\r\n return;\r\n }\r\n\r\n const systemSettings = yield select(selectglobalSettings);\r\n\r\n switch (action.payload.printer.Type) {\r\n case 'Dymo':\r\n if (\r\n !systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported)\r\n ) {\r\n const msg = i18next.t(translations.DymoPrinterIsNotSupported);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n yield put(actions.print_Error(msg));\r\n return;\r\n }\r\n break;\r\n case 'Zebra':\r\n if (\r\n !systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported)\r\n ) {\r\n const msg = i18next.t(translations.ZebraPrinterIsNotSupported);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n yield put(actions.print_Error(msg));\r\n return;\r\n }\r\n break;\r\n }\r\n\r\n const printerInterface = getPrinterInterface(action.payload.printer);\r\n if (printerInterface === undefined) {\r\n yield put(\r\n actions.getAssetDetails_Failure(\r\n `Printer ${action.payload.printer.Type} not supported.`,\r\n ),\r\n );\r\n return;\r\n }\r\n const settings: AppSettings = yield select(selectAppSettings);\r\n const state: LabelPrintState = yield select(selectLabelPrint);\r\n const type = state.type;\r\n const AssetBarcodeUrlTemplate =\r\n type === 'Asset'\r\n ? settings.AssetBarcodeUrlTemplate\r\n : type === 'Room'\r\n ? settings.RoomBarcodeUrlTemplate\r\n : type === 'LocationList'\r\n ? settings.LocationBarcodeUrlTemplate\r\n : type === 'SubLocationList'\r\n ? settings.SubLocationBarcodeUrlTemplate\r\n : type === 'SamplePlate'\r\n ? settings.SamplePlateBarcodeUrlTemplate\r\n : type === 'Consumable'\r\n ? settings.ConsumableTypeBarcodeUrlTemplate\r\n : null;\r\n try {\r\n if (type === undefined) {\r\n throw new Error('Label type is undefined');\r\n }\r\n if (AssetBarcodeUrlTemplate === null) {\r\n throw new Error(`Unsupported label type \"${type}\"`);\r\n }\r\n const data = action.payload.assetDetails.map(assetDetails => ({\r\n ...assetDetails,\r\n ...{ QR: getQrUrl(assetDetails, type, AssetBarcodeUrlTemplate) },\r\n }));\r\n const printAction: TPrint = printerInterface[action.payload.action];\r\n const result = yield call(\r\n printAction,\r\n action.payload.printer,\r\n action.payload.template,\r\n data,\r\n {\r\n AssetBarcodeUrlTemplate: settings.AssetBarcodeUrlTemplate,\r\n RoomBarcodeUrlTemplate: settings.RoomBarcodeUrlTemplate,\r\n LocationBarcodeUrlTemplate: settings.LocationBarcodeUrlTemplate,\r\n SubLocationBarcodeUrlTemplate: settings.SubLocationBarcodeUrlTemplate,\r\n SamplePlateBarcodeUrlTemplate: settings.SamplePlateBarcodeUrlTemplate,\r\n ConsumableTypeBarcodeUrlTemplate:\r\n settings.ConsumableTypeBarcodeUrlTemplate,\r\n },\r\n );\r\n switch (action.payload.action) {\r\n case 'print':\r\n break;\r\n case 'download':\r\n case 'preview':\r\n for (const item of result) {\r\n yield call(fileDownload, item, 'import-result.xlsx');\r\n }\r\n }\r\n yield put(actions.print_Success(null));\r\n } catch (error) {\r\n yield put(actions.print_Error(error));\r\n }\r\n}\r\n\r\nexport function* labelPrintSaga() {\r\n yield takeLeading(actions.getPrinters.type, doGetPrinters);\r\n yield takeLeading(actions.getLabelTypes.type, doGetLabelTypes);\r\n yield takeLatest(actions.getAssetDetails.type, doGetObjects);\r\n yield takeLeading(actions.open.type, doOpen);\r\n yield takeLeading(actions.print.type, doPrint);\r\n //yield takeLeading(actions.preview.type, doPrint);\r\n //yield takeLeading(actions.download.type, doPrint);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IAssetDetailsDto } from 'api/odata/generated/entities/IAssetDetailsDto';\r\nimport { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { labelPrintSaga } from './saga';\r\nimport {\r\n LabelPrintState,\r\n LabelPrinter,\r\n IPrintAssetLabelArgs,\r\n AsyncState,\r\n OpenPrintDialogPayload,\r\n} from './types';\r\n\r\nexport const initialState: LabelPrintState = {\r\n ids: [],\r\n labelTypes: {},\r\n printers: {},\r\n printState: {},\r\n data: {},\r\n open: false,\r\n};\r\n\r\nfunction init(state: AsyncState) {\r\n state.status = 'pending';\r\n state.error = undefined;\r\n state.value = undefined;\r\n}\r\nfunction resolve(state: AsyncState, value: T) {\r\n state.status = 'resolved';\r\n state.error = undefined;\r\n state.value = value;\r\n}\r\nfunction reject(state: AsyncState, error: unknown) {\r\n state.status = 'rejected';\r\n state.value = undefined;\r\n state.error = String(error);\r\n}\r\n\r\nconst slice = createSlice({\r\n name: 'labelPrint',\r\n initialState,\r\n reducers: {\r\n getPrinters(state, action: PayloadAction) {\r\n init(state.printers);\r\n },\r\n getPrinters_Success(state, action: PayloadAction>) {\r\n resolve(state.printers, action.payload);\r\n },\r\n getPrinters_Error(state, action: PayloadAction) {\r\n reject(state.printers, action.payload);\r\n },\r\n\r\n getLabelTypes(state, action: PayloadAction) {\r\n init(state.labelTypes);\r\n },\r\n getLabelTypes_Success(state, action: PayloadAction>) {\r\n resolve(state.labelTypes, action.payload);\r\n },\r\n getLabelTypes_Error(state, action: PayloadAction) {\r\n reject(state.labelTypes, action.payload);\r\n },\r\n\r\n getAssetDetails(state, action: PayloadAction) {\r\n init(state.data);\r\n },\r\n getAssetDetails_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n resolve(state.data, action.payload);\r\n },\r\n getAssetDetails_Failure(state, action: PayloadAction) {\r\n reject(state.data, action.payload);\r\n },\r\n\r\n open(state, action: PayloadAction) {\r\n state.open = true;\r\n state.ids = action.payload.ids;\r\n state.type = action.payload.type;\r\n state.data = {};\r\n },\r\n closeAssetLabelPrintDialog(state, action: PayloadAction) {\r\n state.open = false;\r\n state.ids = [];\r\n state.data = {};\r\n state.printState = {};\r\n },\r\n\r\n print(state, action: PayloadAction) {\r\n init(state.printState);\r\n state.selectedPrinter = action.payload.printer ?? null;\r\n state.selectedTemplate = action.payload.template ?? null;\r\n },\r\n print_Success(state, action: PayloadAction) {\r\n state.data = {};\r\n state.open = false;\r\n resolve(state.printState, null);\r\n },\r\n print_Error(state, action: PayloadAction) {\r\n reject(state.printState, action.payload);\r\n },\r\n\r\n download(state, action: PayloadAction) {\r\n init(state.printState);\r\n state.selectedPrinter = action.payload.printer ?? null;\r\n state.selectedTemplate = action.payload.template ?? null;\r\n },\r\n download_Success(state, action: PayloadAction) {\r\n state.data = {};\r\n state.open = false;\r\n resolve(state.printState, null);\r\n },\r\n download_Error(state, action: PayloadAction) {\r\n reject(state.printState, action.payload);\r\n },\r\n\r\n preview(state, action: PayloadAction) {\r\n init(state.printState);\r\n state.selectedPrinter = action.payload.printer ?? null;\r\n state.selectedTemplate = action.payload.template ?? null;\r\n },\r\n preview_Success(state, action: PayloadAction) {\r\n state.data = {};\r\n state.open = false;\r\n resolve(state.printState, null);\r\n },\r\n preview_Error(state, action: PayloadAction) {\r\n reject(state.printState, action.payload);\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: labelPrintActions } = slice;\r\n\r\nexport const useLabelPrintSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: labelPrintSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useLabelPrintSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TrainingLevelPickerProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/TrainingLevelFilter';\r\nexport const initTrainingLevelData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'ExpiredDays',\r\n 'MustOrderEveryDays',\r\n 'MustUseEveryDays',\r\n 'LevelEquipments',\r\n 'UPGroups',\r\n 'UPEquipments',\r\n ],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n isOptionalServiceGroup: true,\r\n });\r\nexport const loadTrainingLevels = loadData;\r\nexport function TrainingLevelPicker(props: TrainingLevelPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n globalServiceGroupFilter || [],\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport function TrainingLevelFilter(\r\n equipments: IServiceFilterDto[],\r\n trainingLevelPermissionsEnabled,\r\n userPermissionsEnabled,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (!!equipments && equipments.length > 0) {\r\n if (trainingLevelPermissionsEnabled) {\r\n predicates.push(\r\n equipments\r\n .map(eq => {\r\n if (eq.UseServiceGroupTrainingLevels) {\r\n return `(ServiceGroupId eq null or ServiceGroupId eq ${quoteODataValue(\r\n eq.ServiceGroupId,\r\n )})`;\r\n } else {\r\n return `LevelEquipments/any(g: g eq ${quoteODataValue(eq.Id)})`;\r\n }\r\n })\r\n .join(' or '),\r\n );\r\n } else if (userPermissionsEnabled) {\r\n // noop - clients could not select training level that was not part of user or group permissions on selected equipment they needed on uchicago\r\n // should be properly resolved in https://prog4biz.atlassian.net/browse/BKT-8190\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n } else {\r\n return [];\r\n }\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AutocompleteMultiPickerExProps } from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { AssetsPicker } from '../../MultiSelectPickers/AssetsPicker';\r\n\r\nexport interface AssetMultiPickerProps\r\n extends AutocompleteMultiPickerExProps {}\r\n\r\nconst url = '/api/odata/v4/AssetNames';\r\n\r\nexport const initAssetMultiData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return Promise.resolve([] as IAssetDto[]);\r\n }\r\n const ids = initval.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: '(Id in (' + ids.join(',') + '))',\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IAssetDto[]);\r\n};\r\n\r\nexport const AssetMultiPicker = (props: AssetMultiPickerProps) => {\r\n return ;\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AssetsPicker } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AssetMultiFilter = (props: IFilterComponentProps) => {\r\n const {\r\n onChange,\r\n value,\r\n additionalItem,\r\n customData,\r\n withoutServiceGroups,\r\n urlType,\r\n dateTimeClear,\r\n label,\r\n labelFunc,\r\n onOpen,\r\n onClose,\r\n open,\r\n fullWidth,\r\n ...other\r\n } = props;\r\n const handleChange = (value: Entity[]) => {\r\n onChange(value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\nexport const AssetWorkOrderMultiFilter = (props: IFilterComponentProps) => {\r\n const {\r\n onChange,\r\n value,\r\n additionalItem,\r\n customData,\r\n withoutServiceGroups,\r\n urlType,\r\n dateTimeClear,\r\n label,\r\n labelFunc,\r\n onOpen,\r\n onClose,\r\n open,\r\n ...other\r\n } = props;\r\n const handleChange = (value: Entity[]) => {\r\n onChange(value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * RoomPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { LocationPicker } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\n\r\nexport const LocationPickerFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default LocationPickerFilter;\r\n","import { Avatar, makeStyles } from '@material-ui/core';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectAppSettings, selectLoading } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface CustomerLogoProps {\r\n height?: string | number;\r\n width?: string | number;\r\n}\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n '&>img': {\r\n objectFit: 'contain',\r\n },\r\n },\r\n}));\r\nexport const CustomerLogo = React.memo(function CustomerLogo(\r\n props: CustomerLogoProps,\r\n) {\r\n const { t } = useTranslation();\r\n const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n const isLoading = useSelector(selectLoading);\r\n const { height, width } = props;\r\n const classes = useStyles();\r\n const [customerLink, setCustomerLink] = React.useState(\r\n undefined,\r\n );\r\n const [customerImg, setCustomerImg] = React.useState(\r\n undefined,\r\n );\r\n React.useEffect(() => {\r\n let active = !isLoading;\r\n if (active) {\r\n let link = appSettings?.TopCustomerLogoLink;\r\n let img = appSettings?.TopCustomerLogo;\r\n if (link !== undefined && link !== '') {\r\n setCustomerLink(link);\r\n }\r\n if (img !== undefined && img !== '') {\r\n setCustomerImg(img);\r\n console.log(toRootedURL(img));\r\n }\r\n } else {\r\n setCustomerLink(undefined);\r\n setCustomerImg(undefined);\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [appSettings, isLoading]);\r\n return (\r\n \r\n \r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * CampusPickerFilter\r\n *\r\n */\r\nimport { CampusPicker } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const CampusPickerFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default CampusPickerFilter;\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { downloadFile } from 'utils/url-utils';\r\nimport { SelectedRowsActionIconButton } from '../BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface ExportQRCodesButtonProps {\r\n url: string;\r\n rows: Array>;\r\n toggleAllRowsSelected?: (value?: boolean) => void;\r\n}\r\n\r\nexport function ExportQRCodesButton({\r\n url,\r\n rows,\r\n toggleAllRowsSelected,\r\n}: ExportQRCodesButtonProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n new Promise(async resolve => {\r\n let ids = rows.map(row => row.Id).join(',');\r\n let path = url + `?id=${ids}`;\r\n try {\r\n await downloadFile({ path: path });\r\n resolve({\r\n ErrorMessages: [],\r\n SuccessMessages: [],\r\n WarningMessages: [],\r\n });\r\n } catch (err) {\r\n console.debug(err);\r\n resolve({\r\n ErrorMessages: [\r\n 'Some thing went wrong, please check the Name or Qr Code of the Asset!',\r\n ],\r\n SuccessMessages: [],\r\n WarningMessages: [],\r\n });\r\n }\r\n })\r\n }\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * AreasPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface AreasPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/AreasFilter';\r\nexport const initAreasData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n searchTerm: string | null,\r\n predicates?: (string | Condition)[],\r\n) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null || predicates !== undefined) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates !== undefined ? predicates : [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport function AreasPicker(props: AreasPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Default.EmailType\r\n *\r\n */\r\n\r\nexport enum EmailType {\r\n Invoice = 0,\r\n Request = 1,\r\n Reservation = 2,\r\n User = 3,\r\n PaymentLetter = 4,\r\n Budget = 5,\r\n BudgetComment = 6,\r\n OfflineService = 7,\r\n Eln = 8,\r\n Alert = 9,\r\n DataStore = 10,\r\n SAP = 11,\r\n Equipment = 12,\r\n Asset = 13,\r\n TrainingSession = 14,\r\n ServiceGroup = 15,\r\n BudgetExpirement = 16,\r\n InstrumentNotifications = 17,\r\n WorkFlowBooking = 18,\r\n Cage = 19,\r\n InquiryAlert = 20,\r\n UserGroup = 21,\r\n LoanDesk = 22,\r\n Training = 23,\r\n RequestComment = 24,\r\n DownTime = 25,\r\n ExternalBillingError = 26,\r\n GenerateInvoice = 27,\r\n InstituteQuarter = 28,\r\n RequestMilestones = 29,\r\n Custom = 30,\r\n Subscription = 31,\r\n Article = 31,\r\n}\r\nexport type EmailTypeUnion = keyof typeof EmailType;\r\nexport const EmailTypeUnionArray: Array = [\r\n 'Invoice',\r\n 'Request',\r\n 'Reservation',\r\n 'User',\r\n 'PaymentLetter',\r\n 'Budget',\r\n 'BudgetComment',\r\n 'OfflineService',\r\n 'Eln',\r\n 'Alert',\r\n 'DataStore',\r\n 'SAP',\r\n 'Equipment',\r\n 'Asset',\r\n 'TrainingSession',\r\n 'ServiceGroup',\r\n 'BudgetExpirement',\r\n 'InstrumentNotifications',\r\n 'WorkFlowBooking',\r\n 'Cage',\r\n 'InquiryAlert',\r\n 'UserGroup',\r\n 'LoanDesk',\r\n 'Training',\r\n 'RequestComment',\r\n 'DownTime',\r\n 'ExternalBillingError',\r\n 'GenerateInvoice',\r\n 'InstituteQuarter',\r\n 'RequestMilestones',\r\n 'Custom',\r\n 'Subscription',\r\n 'Article',\r\n];\r\n","/**\r\n *\r\n * BasicDialogTitle\r\n *\r\n */\r\nimport {\r\n Box,\r\n createStyles,\r\n DialogTitle as MuiDialogTitle,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { Body } from '../Typography';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { H3 } from '../Typography';\r\nconst titleStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n margin: 0,\r\n padding: theme.spacing(3, 3, 1, 4),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n width: '100%',\r\n background: theme.palette.background.default,\r\n //borderRadius: '12px 12px 0px 0px',\r\n },\r\n titleContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n },\r\n titleBody: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n padding: '0px',\r\n },\r\n titleSubtitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n padding: '0px',\r\n },\r\n closeButton: {\r\n position: 'absolute',\r\n right: theme.spacing(1),\r\n top: theme.spacing(1),\r\n color: theme.palette.grey[500],\r\n },\r\n title: {\r\n margin: 0,\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n subtitle: {},\r\n }),\r\n);\r\nexport interface BasicDialogTitleProps {\r\n id?: string;\r\n children: React.ReactNode;\r\n subtitle?: React.ReactNode;\r\n onClose?: () => void;\r\n}\r\nexport function BasicDialogTitle(props: BasicDialogTitleProps) {\r\n const { id, children, subtitle, onClose, ...other } = props;\r\n const classes = titleStyles();\r\n return (\r\n \r\n \r\n \r\n

    {children}

    \r\n \r\n {subtitle && (\r\n \r\n {subtitle}\r\n \r\n )}\r\n\r\n {onClose ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ToggleButton, ToggleButtonProps } from '@material-ui/lab';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BaseToggleButtonProps\r\n extends Omit {\r\n disabled?: boolean;\r\n children?: React.ReactNode;\r\n processing?: boolean;\r\n variant?: ButtonsVariant;\r\n fullWidth?: boolean;\r\n component?: any;\r\n to?: string;\r\n target?: string;\r\n mainIcon?: IconProp;\r\n startIcon?: IconProp;\r\n endIcon?: IconProp;\r\n separated?: boolean;\r\n}\r\n\r\nexport const BaseToggleButton = React.forwardRef<\r\n HTMLButtonElement,\r\n BaseToggleButtonProps\r\n>(function BaseToggleButton(\r\n {\r\n children,\r\n disabled,\r\n processing,\r\n size,\r\n variant,\r\n component,\r\n title,\r\n to,\r\n mainIcon,\r\n fullWidth,\r\n separated,\r\n startIcon,\r\n endIcon,\r\n ...props\r\n },\r\n ref,\r\n) {\r\n const handleClick = (e: any) => {\r\n if (props.onClick) {\r\n props.onClick(e);\r\n }\r\n };\r\n const WithTitle = React.forwardRef(\r\n (\r\n {\r\n children,\r\n title,\r\n }: { children: React.ReactNode; title: React.ReactChild },\r\n ref,\r\n ) => (\r\n \r\n {children}\r\n \r\n ),\r\n );\r\n const startIconComponent = startIcon && (\r\n \r\n \r\n \r\n );\r\n const endIconComponent = endIcon && (\r\n \r\n \r\n \r\n );\r\n return title ? (\r\n \r\n {\r\n handleClick(event);\r\n }}\r\n className={props.className}\r\n {...props}\r\n >\r\n {mainIcon !== undefined ? (\r\n \r\n \r\n \r\n ) : !!startIcon || !!endIcon ? (\r\n \r\n {!!startIconComponent && startIconComponent}\r\n {children}\r\n {!!endIconComponent && endIconComponent}\r\n \r\n ) : (\r\n {children}\r\n )}\r\n \r\n \r\n ) : (\r\n {\r\n handleClick(event);\r\n }}\r\n className={props.className}\r\n {...props}\r\n >\r\n {mainIcon !== undefined ? (\r\n \r\n \r\n \r\n ) : !!startIcon || !!endIcon ? (\r\n \r\n {!!startIconComponent && startIconComponent}\r\n {children}\r\n {!!endIconComponent && endIconComponent}\r\n \r\n ) : (\r\n {children}\r\n )}\r\n \r\n );\r\n});\r\n","import { ToggleButtonGroup, ToggleButtonGroupProps } from '@material-ui/lab';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { EntityType } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { BaseOptionsPicker } from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { IsEntityType } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { BaseToggleButton } from '../BaseToggleButton';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface ToggleEntityType extends EntityType {\r\n icon?: IconProp;\r\n title?: string;\r\n disabled?: boolean;\r\n startIcon?: IconProp;\r\n endIcon?: IconProp;\r\n}\r\nexport interface BaseToggleButtonGroupProps\r\n extends Omit {\r\n variant?: ButtonsVariant;\r\n options: Array;\r\n otherOptions?: Array;\r\n value: T | null;\r\n error?: boolean;\r\n helperText?: string;\r\n label?: string;\r\n onChange: (value: T | null) => void;\r\n fullWidth?: boolean;\r\n compact?: boolean;\r\n separated?: boolean;\r\n name?: string;\r\n disabled?: boolean;\r\n}\r\n\r\nfunction BaseToggleButtonGroupInner(\r\n props: BaseToggleButtonGroupProps,\r\n ref: React.ForwardedRef,\r\n) {\r\n const {\r\n variant = 'ghost',\r\n size = 'medium',\r\n options,\r\n otherOptions,\r\n value,\r\n orientation = 'horizontal',\r\n error,\r\n helperText,\r\n onChange,\r\n fullWidth,\r\n compact,\r\n separated = true,\r\n exclusive,\r\n name,\r\n label,\r\n disabled,\r\n ...other\r\n } = props;\r\n const { t } = useTranslation();\r\n const [toggleValue, setToggleValue] = React.useState(value);\r\n React.useEffect(() => {\r\n setToggleValue(value);\r\n }, [value]);\r\n const handleOtherChange = React.useCallback(\r\n (newValue: T | null) => {\r\n if (newValue?.Id !== toggleValue?.Id) {\r\n setToggleValue(newValue);\r\n onChange(newValue);\r\n }\r\n },\r\n [onChange, toggleValue?.Id],\r\n );\r\n\r\n const handleToggleValue = React.useCallback(\r\n (event, newViewType: T) => {\r\n if (IsEntityType(event)) {\r\n handleOtherChange(event as T);\r\n } else {\r\n if (newViewType.Id !== toggleValue?.Id) {\r\n setToggleValue(newViewType);\r\n onChange(newViewType);\r\n }\r\n }\r\n },\r\n [handleOtherChange, onChange, toggleValue?.Id],\r\n );\r\n\r\n // const isMobile = DetectIsMobile();\r\n // const settings = React.useMemo(\r\n // () => ({\r\n // size: size,\r\n // variant: variant,\r\n // orientation: orientation,\r\n // separated: separated,\r\n // }),\r\n // [orientation, separated, size, variant],\r\n // );\r\n // const classes = toggleButtonGroupStyle(settings);\r\n return (\r\n \r\n {options.map((option, index) => (\r\n \r\n {(compact !== true || option.icon === undefined) && (\r\n {option.Name}\r\n )}\r\n \r\n ))}\r\n {otherOptions !== undefined && otherOptions.length > 0 && (\r\n otherOptions || []}\r\n onChange={handleOtherChange}\r\n placeholder={t(translations.Other)}\r\n value={value}\r\n size={size === 'large' ? 'medium' : size}\r\n />\r\n )}\r\n {helperText !== undefined && (\r\n {helperText}\r\n )}\r\n \r\n );\r\n}\r\nexport const BaseToggleButtonGroup = React.forwardRef(\r\n BaseToggleButtonGroupInner,\r\n);\r\n","/**\r\n *\r\n * FilterContainer\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n Box,\r\n createStyles,\r\n Dialog,\r\n DialogContent,\r\n DialogTitle,\r\n makeStyles,\r\n Paper,\r\n styled,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Popper } from 'app/components/Popper';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterSettings } from '../BasicFilter/IFilterSettings';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport useGlobalDOMEvents from 'app/hooks/useGlobalDomEvents';\r\nimport clsx from 'clsx';\r\nimport { IsEmptyArray } from '../BasicFilter/AppliedFilterComponent';\r\n\r\ninterface FilterContainerProps {\r\n open: boolean;\r\n onClose: () => void;\r\n children: React.ReactNode;\r\n anchorEl: any;\r\n appliedFilters: IFilterSettings[];\r\n onChange: (items: IFilterSettings[]) => void;\r\n compact?: boolean;\r\n}\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n filterRoot: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: 16,\r\n height: '100%',\r\n overflow: 'hidden',\r\n maxWidth: 700,\r\n },\r\n scrollPaperCompact: {\r\n alignItems: 'flex-start',\r\n justifyContent: 'flex-end',\r\n },\r\n scrollPaper: {\r\n paddingTop: 40,\r\n },\r\n }),\r\n);\r\n\r\nexport function FilterContainer({\r\n anchorEl,\r\n onClose,\r\n onChange,\r\n open,\r\n children,\r\n compact,\r\n ...props\r\n}: FilterContainerProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const handleClose = () => {\r\n onClose();\r\n };\r\n // save provided applied filters to be used in change callbacks\r\n const [, setVisibleFilters] = React.useState[]>(\r\n props.appliedFilters,\r\n );\r\n\r\n // refresh applied filters if they were changed from outside\r\n React.useEffect(() => {\r\n setVisibleFilters(props.appliedFilters);\r\n }, [props.appliedFilters]);\r\n\r\n // const handleClearClick = () => {\r\n // setVisibleFilters(currentState => {\r\n // const newState = currentState.map(f => ({ ...f, ...{ value: null } }));\r\n // onChange(newState);\r\n // return newState;\r\n // });\r\n // if (isMobile || compact) {\r\n // onClose();\r\n // }\r\n // };\r\n const elementRef = React.useRef(null);\r\n // manually trigger rerender using a useless usState hook\r\n // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n const countState = React.useState(0);\r\n React.useEffect(() => {\r\n countState[1](c => c + 1);\r\n // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementRef.current]);\r\n const classes = useStyles();\r\n const appliedFitltersCount = props.appliedFilters.filter(\r\n f =>\r\n f.value !== null &&\r\n f.value !== undefined &&\r\n f.value !== '' &&\r\n !IsEmptyArray(f.value),\r\n ).length;\r\n\r\n useGlobalDOMEvents({\r\n keyup(ev) {\r\n if ((ev as KeyboardEvent).key === 'Escape') {\r\n onClose();\r\n }\r\n },\r\n });\r\n\r\n const title = `${t(translations.Filters)} (${appliedFitltersCount})`;\r\n if (isMobile || compact) {\r\n return (\r\n \r\n {/* \r\n \r\n \r\n \r\n */}\r\n \r\n {title}\r\n {\r\n onClose();\r\n }}\r\n style={{ position: 'absolute', right: 4, top: 4 }}\r\n >\r\n \r\n \r\n \r\n \r\n {\r\n \r\n {children}\r\n \r\n }\r\n \r\n {/* \r\n onClose()}\r\n aria-label={t(translations.apply)}\r\n >\r\n {t(translations.apply)}\r\n \r\n \r\n {t(translations.ClearAll)}\r\n \r\n */}\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n onClose()}\r\n clickAway={true}\r\n clickAwayFunc={e => {\r\n onClose();\r\n }}\r\n maxWidth={'fit-content'}\r\n >\r\n \r\n <>{children}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n// const StyledDialog = styled(Dialog)(({ theme }) => ({\r\n// paddingTop: theme.spacing(5),\r\n// }));\r\nconst StyledDialogPaper = styled(Paper)(({ theme }) => ({\r\n borderTopLeftRadius: theme.shape.borderRadius,\r\n borderTopRightRadius: theme.shape.borderRadius,\r\n margin: 0,\r\n}));\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n GetRawValue,\r\n splitFilterValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\n\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { PageTopActionsProps } from '../type';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport function AddReservation({\r\n size,\r\n text,\r\n variant,\r\n icon,\r\n isIconButton,\r\n useSidePanel,\r\n isExpanded,\r\n compact = true,\r\n ...props\r\n}: PageTopActionsProps) {\r\n const location = useLocation();\r\n const { openPanel } = useSidePanelState();\r\n const isMobile = DetectIsMobile();\r\n const { t } = useTranslation();\r\n\r\n const EnableLegacyScheduler = useSelector(\r\n selectGlobalDbSetting_EnableLegacyScheduler,\r\n );\r\n\r\n const serviceIdsRawValue = GetRawValue(\r\n new URLSearchParams(location.search),\r\n 'selectedIds',\r\n );\r\n const serviceIds =\r\n serviceIdsRawValue === undefined || serviceIdsRawValue === null\r\n ? []\r\n : (splitFilterValue(serviceIdsRawValue)\r\n .map(tryParseInt)\r\n .filter(f => f !== undefined) as number[]);\r\n\r\n if (EnableLegacyScheduler && serviceIds.length > 0) {\r\n return ;\r\n }\r\n return (\r\n {\r\n let selParams = {\r\n useSidePanel: !isMobile && !useSidePanel,\r\n actionType: 'Reservation',\r\n serviceIds: GetRawValue(\r\n new URLSearchParams(location.search),\r\n 'selectedIds',\r\n ),\r\n } as AssetsSelectionProps;\r\n openPanel({\r\n renderPageType: RenderPageType.AssetsSelection,\r\n renderPageProps: selParams,\r\n expanded: isExpanded,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n }}\r\n {...props}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * ServiceGroupsFilter\r\n *\r\n */\r\nimport { ServiceGroupsPicker } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '..';\r\n\r\nexport const ServiceGroupsFilter = (props: IFilterComponentProps) => {\r\n const handleChange = (value: Entity[] | undefined) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n","import { SuperGroupPicker } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const SuperGroupFilter = (props: IFilterComponentProps) => {\r\n const handleChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * TagsPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITagsFilterDto } from 'api/odata/generated/entities/ITagsFilterDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { isNumericPositive } from 'utils/string-utils';\r\n\r\nexport type TagsUrl = 'base' | 'assetBase' | 'public';\r\nexport interface TagsPickerProps\r\n extends Omit, 'loadData'> {\r\n inputProps?: InputBaseComponentProps;\r\n urlType?: TagsUrl;\r\n separator?: string;\r\n}\r\n\r\nconst url = '/api/odata/v4/TagsFilter';\r\nconst assetTagsUrl = '/api/odata/v4/TagsFilter/AssetTagsFilter';\r\nconst publicAssetTagsUrl = '/api/odata/v4/TagsFilter/PublicAssetTagsFilter';\r\nexport const initTagsData = (\r\n initval: string | undefined,\r\n sourceUrl?: TagsUrl,\r\n separator?: string,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids =\r\n initval.indexOf(separator || '|') !== -1\r\n ? initval.split(separator || '|')\r\n : [initval];\r\n let intIds: Identifiable[] = [];\r\n\r\n if (\r\n ids.filter(f => {\r\n let test = isNumericPositive(f);\r\n return test === true;\r\n }).length === ids.length\r\n ) {\r\n intIds = ids.map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n }\r\n let strIds =\r\n intIds.length > 0\r\n ? []\r\n : (ids.map(item => {\r\n return { Id: item };\r\n }) as Identifiable[]);\r\n let filters: string | undefined = undefined;\r\n if (intIds.length > 0) {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(new Condition('Id', ODataOperators.Includes, intIds));\r\n filters = predicates.map(f => f.toString()).join(' and ');\r\n } else if (strIds.length > 0) {\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(new Condition('Name', ODataOperators.ContainsM, strIds));\r\n filters = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filters,\r\n $select: 'Id,Name,ServiceGroups',\r\n };\r\n\r\n let initUrl =\r\n sourceUrl === 'public'\r\n ? publicAssetTagsUrl\r\n : sourceUrl === 'assetBase'\r\n ? assetTagsUrl\r\n : url;\r\n\r\n return httpClient\r\n .get(initUrl, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n isAuthenticated?: boolean,\r\n urlType?: TagsUrl,\r\n) => {\r\n const sourceUrl =\r\n urlType === 'public' || !isAuthenticated\r\n ? publicAssetTagsUrl\r\n : urlType === 'assetBase'\r\n ? assetTagsUrl\r\n : url;\r\n\r\n return getAutoCompleteLoadDataFn({\r\n url: sourceUrl,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'ServiceGroups'],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\n};\r\n\r\nexport function TagsPicker(props: TagsPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const isAuth = useSelector(selectIsAuthenticated);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n isAuth ? globalServiceGroupFilter || [] : [],\r\n isAuth,\r\n props.urlType,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * LoanablePicker\r\n *\r\n */\r\nimport { AutocompletePickerProps } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { BaseOptionsPicker } from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport const LoanTypeOptions = [\r\n {\r\n Id: 1,\r\n Name: 'Yes',\r\n },\r\n {\r\n Id: 2,\r\n Name: 'No',\r\n },\r\n];\r\n\r\nexport interface LoanablePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nexport const getSingleLoanableType = (val: number): Entity => {\r\n return LoanTypeOptions.filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initLoanableData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n LoanTypeOptions.filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = LoanTypeOptions;\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function LoanablePicker(props: LoanablePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * StatusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface StatusPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/StatusFilter';\r\nexport const initStatusData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function StatusPicker(props: StatusPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * LockersPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface LockersPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/LockersFilter';\r\nexport const initLockersData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function LockersPicker(props: LockersPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * SubLocationFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { SubLocationListPicker } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\n\r\nexport const SubLocationFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default SubLocationFilter;\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n printtopdf: {\r\n '@media print': {\r\n '& button': { display: 'none' },\r\n },\r\n },\r\n }),\r\n);\r\n","import { useCallback, useEffect, useRef } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useReactToPrint } from 'react-to-print';\r\nimport { PrintToPDFPopup } from './Components/PrintToPDFPopup';\r\nimport { usePrintPDFSlice } from './slice';\r\nimport styled from 'styled-components';\r\nimport { useStyles } from './Components/PrintStyles';\r\nimport React from 'react';\r\nimport {\r\n selectPrintPDFisLoading,\r\n selectPrintPDFSections,\r\n} from './slice/selectors';\r\nimport { H3 } from '../Typography';\r\n\r\nexport interface Printing {\r\n id: string;\r\n onLoading?: (id: string, loading: boolean) => void;\r\n printing: boolean;\r\n}\r\nexport interface PrintToPDFProps {\r\n title: string;\r\n children: React.ReactNode;\r\n print: boolean;\r\n printTitle: string;\r\n useSections?: boolean;\r\n saveMarkedSections?: boolean;\r\n close: () => void;\r\n}\r\nexport function PrintToPDF(props: PrintToPDFProps) {\r\n const dispatch = useDispatch();\r\n const { actions } = usePrintPDFSlice();\r\n const printPDFSections = useSelector(selectPrintPDFSections);\r\n const printPDFFisLoading = useSelector(selectPrintPDFisLoading);\r\n const [startPrinting, setStartPrinting] = React.useState(false);\r\n const [printing, setPrinting] = React.useState(false);\r\n const componentRef = useRef(null);\r\n const promiseResolveRef = useRef<() => void>();\r\n const handlePrint = useReactToPrint({\r\n content: () =>\r\n componentRef.current !== undefined ? componentRef.current : null,\r\n documentTitle: props.printTitle,\r\n onAfterPrint: () => {\r\n setPrinting(false);\r\n setStartPrinting(false);\r\n dispatch(actions.setPrinting(false));\r\n props.close();\r\n },\r\n onBeforeGetContent: () => {\r\n dispatch(actions.setPrinting(true));\r\n return new Promise(resolve => {\r\n dispatch(actions.clearLoading());\r\n setStartPrinting(true);\r\n promiseResolveRef.current = resolve;\r\n });\r\n },\r\n });\r\n useEffect(() => {\r\n if (startPrinting && !printPDFFisLoading) {\r\n setStartPrinting(false);\r\n setPrinting(true);\r\n }\r\n }, [startPrinting, printPDFFisLoading]);\r\n useEffect(() => {\r\n if (printing && promiseResolveRef.current) {\r\n //setPrinting(false);\r\n promiseResolveRef.current();\r\n }\r\n }, [printing]);\r\n\r\n const handleSubmit = useCallback(() => {\r\n if (\r\n props.saveMarkedSections !== undefined &&\r\n props.saveMarkedSections === true\r\n ) {\r\n dispatch(actions.saveSections());\r\n }\r\n handlePrint?.();\r\n }, [actions, dispatch, handlePrint, props.saveMarkedSections]);\r\n const classes = useStyles();\r\n return (\r\n <>\r\n {props.print ? (\r\n \r\n {!!props.title && (\r\n \r\n

    {props.title}

    \r\n
    \r\n )}\r\n {props.children}\r\n
    \r\n ) : (\r\n <>{props.children}\r\n )}\r\n\r\n {props.print && (\r\n {\r\n props.close();\r\n }}\r\n onSubmit={handleSubmit}\r\n fullWidth={\r\n !!props.useSections &&\r\n printPDFSections !== undefined &&\r\n printPDFSections.length > 0\r\n }\r\n />\r\n )}\r\n \r\n );\r\n}\r\n/**\r\n * without width: 100% the layout of the PageWrapper breaks by overflowing the PageWrapper (service request details)\r\n */\r\nconst StyledDiv = styled('div')`\r\n width: 100%;\r\n height: 100%;\r\n padding: 16px 32px;\r\n`;\r\nconst TitleSection = styled('div')`\r\n display: flex;\r\n align-items: center;\r\n paddin: 16px;\r\n`;\r\n","export enum AssemblyTypes {\r\n Normal = 0,\r\n AssembliesAndNormal = 1,\r\n AssemblyParts = 2,\r\n AllEquipments = 3,\r\n}\r\n","/**\r\n *\r\n * FundingTypePicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { AssemblyTypes } from 'enums/InstrumentListAssemblyTypes';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface AssemblyTypePickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSingleAssemblyType = (val: number): Entity => {\r\n return enumToEntityArray(AssemblyTypes).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initAssemblyTypeData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n enumToEntityArray(AssemblyTypes).filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(AssemblyTypes);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function AssemblyTypePicker(props: AssemblyTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { StyledFormProps } from '../StyledForm';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport clsx from 'clsx';\r\nimport { Section } from '../wrappers';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\n\r\nexport const StyledFormFieldsContainer = (\r\n props: Omit,\r\n) => {\r\n const {\r\n avoidStyles,\r\n children,\r\n sectionStyle,\r\n isCover,\r\n noPadding,\r\n skipShortView,\r\n ...other\r\n } = props;\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const showShortView =\r\n (isMobile && !isLandscape) ||\r\n (sidePanelOpen && !sidePanelExpanded && !skipShortView) ||\r\n isCover;\r\n const theme = useTheme();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { FilterValueType } from './BasicFilter/FilterValueType';\r\n\r\n/**\r\n * Returns current value of the filter based on filter's id\r\n * @param allFilters all filters\r\n * @param id filter id\r\n * @returns filter value\r\n */\r\nexport const getFilterValue = function (\r\n allFilters: Array> | undefined,\r\n id: string,\r\n): FilterValueType | undefined {\r\n if (allFilters === undefined) {\r\n return undefined;\r\n }\r\n var filter = allFilters.find(f => f.id === id);\r\n if (filter === undefined) {\r\n return undefined;\r\n }\r\n const value = filter.value;\r\n return value ?? undefined;\r\n};\r\n","import { Skeleton } from '@material-ui/lab';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nconst SceletonBox = styled('div')`\r\n display: flex;\r\n padding-inline: 16px;\r\n`;\r\nexport const SkeletonIfLoading = ({\r\n loading,\r\n children,\r\n}: React.PropsWithChildren<{ loading: boolean }>) => {\r\n if (loading) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n return <>{children};\r\n};\r\n","import {\r\n FormGroupProps as MuiFormGroupProps,\r\n FormGroup as MuiFormGroup,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FormGroupProps extends MuiFormGroupProps {\r\n withInfo?: boolean;\r\n boxed?: boolean;\r\n boxedChecked?: boolean;\r\n boxedError?: boolean;\r\n}\r\nconst FormGroup = (props: FormGroupProps) => {\r\n const {\r\n withInfo,\r\n boxed,\r\n boxedChecked,\r\n boxedError,\r\n className,\r\n ...other\r\n } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormGroup;\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface FiltersButtonProps {\r\n onClick: React.MouseEventHandler;\r\n appliedFiltersLength?: number;\r\n allFiltersLength?: number;\r\n innerRef?: React.RefObject;\r\n}\r\n\r\nexport function FiltersButton({\r\n onClick,\r\n appliedFiltersLength,\r\n allFiltersLength,\r\n ...props\r\n}: FiltersButtonProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n if (isMobile) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n }\r\n endIcon={\r\n !!appliedFiltersLength && (\r\n \r\n \r\n \r\n {appliedFiltersLength}\r\n \r\n \r\n )\r\n }\r\n >\r\n {t(translations.Filters)}\r\n \r\n );\r\n}\r\n","import { initProjectData } from 'app/components/pickers/AutocompletePickers/ProjectPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n initPickerValue,\r\n} from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ProjectFilter } from './index';\r\n\r\n/**\r\n * Produces standard budgets filter settings\r\n * Returns undefined if the budgets are disabled in system settings\r\n * @param params URL search params to fetch the value form\r\n * @param fieldName aka accessor\r\n * @param t TFunction for localization\r\n * @param appSettings AppSettings used to determine if the budgets are enabled\r\n * @returns configured budgets filter\r\n */\r\nexport function getBudgetsFilterSettings(\r\n params: URLSearchParams,\r\n fieldName: keyof T,\r\n t: TFunction,\r\n appSettings: AppSettings | null,\r\n): IFilterSettings | undefined {\r\n const id = 'BudgetId';\r\n if (!IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n return undefined;\r\n }\r\n return {\r\n id: id,\r\n fieldName: fieldName,\r\n displayName: t(translations.BudgetNumber),\r\n operator: ODataOperators.Equals,\r\n // value: getDefaultFilterValue('bid', params),\r\n queryStringSerializer: 'bid',\r\n initData: initPickerValue(initProjectData),\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'bid'))),\r\n component: ProjectFilter,\r\n urlKey: 'bid',\r\n };\r\n}\r\n","/**\r\n *\r\n * AvailabilityTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface AvailabilityTypePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/AvailabilityTypesFilter';\r\nexport const initAvailabilityTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nconst loadBookableData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: (string | Condition>)[] = [];\r\n const bookable: number[] = [\r\n //AvailabilityTypes.ApprovalRequiredBillable as number,\r\n //AvailabilityTypes.BookableWApproval as number,\r\n AvailabilityTypes.FreelyBookable as number,\r\n //AvailabilityTypes.FreelyBookableBillable as number,\r\n AvailabilityTypes.LectureRoom as number,\r\n AvailabilityTypes.LoanableEquipment as number,\r\n AvailabilityTypes.TrainingProgram as number,\r\n ];\r\n let filter = `(${bookable\r\n .map(item =>\r\n new Condition>(\r\n 'Id',\r\n ODataOperators.Equals,\r\n item,\r\n ).toString(),\r\n )\r\n .join(' or ')})`;\r\n predicates.push(filter);\r\n\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport function AvailabilityTypePicker(props: AvailabilityTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function AvailabilityTypeBookablePicker(\r\n props: AvailabilityTypePickerProps,\r\n) {\r\n return (\r\n \r\n );\r\n}\r\n","import React from 'react';\r\nimport { useAsyncDebounce } from 'react-table';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from '../BasicInputs/TextControlField';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\n\r\nexport interface IGlobalFilterProps {\r\n globalFilter?: string;\r\n setGlobalFilter: (value: string) => void;\r\n info?: string;\r\n useRemoveSearch?: boolean;\r\n placeholder?: string;\r\n}\r\nexport function GlobalFilter({\r\n globalFilter,\r\n setGlobalFilter,\r\n info,\r\n placeholder,\r\n useRemoveSearch,\r\n}: IGlobalFilterProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const [value, setValue] = React.useState(globalFilter);\r\n const onChange = useAsyncDebounce(value => {\r\n setGlobalFilter(value || undefined);\r\n }, 200);\r\n\r\n return (\r\n {\r\n setValue('');\r\n onChange('');\r\n }}\r\n >\r\n {' '}\r\n \r\n \r\n ) : !!info ? (\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n inputProps={{ 'aria-label': 'table search' }}\r\n info={info}\r\n onChange={e => {\r\n setValue(e.target.value);\r\n onChange(e.target.value);\r\n }}\r\n />\r\n );\r\n}\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n bindPopover,\r\n bindTrigger,\r\n usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport {\r\n Box,\r\n Divider,\r\n Grid,\r\n LinearProgress,\r\n ListItemText,\r\n MenuItem,\r\n MenuList,\r\n Popover,\r\n} from '@material-ui/core';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n AssetsFilterForWorkOrder,\r\n AssetsPicker,\r\n initAssetsData,\r\n} from 'app/components/pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { initWOTypeDataParams } from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useLocationChange } from 'app/hooks/useLocationChange';\r\nimport { ButtonsVariant } from 'app/components/BasicButtons/Button';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface NewWorkOrderButtonProps {\r\n assetIds?: string;\r\n downtime?: boolean;\r\n text?: string;\r\n noChangeOnMobile?: boolean;\r\n fullWidth?: boolean;\r\n isIconButton?: boolean;\r\n variant?: ButtonsVariant;\r\n initAsset?: IAssetDto;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n id?: string;\r\n}\r\n\r\nexport const NewWorkOrderButton = (props: NewWorkOrderButtonProps) => {\r\n const { t } = useTranslation();\r\n const location = useLocation();\r\n const { openPanel } = useSidePanelState();\r\n const {\r\n assetIds,\r\n downtime,\r\n text,\r\n noChangeOnMobile,\r\n fullWidth,\r\n isIconButton,\r\n variant,\r\n useSidePanel,\r\n openPanelWithCover,\r\n id,\r\n } = props;\r\n const popupState = usePopupState({\r\n variant: 'popover',\r\n popupId: 'workOrderTypeSelection',\r\n });\r\n //const [open, setOpen] = useState(false);\r\n const [assets, setAssets] = React.useState(\r\n undefined,\r\n );\r\n const [workTypes, setWorkTypes] = React.useState<\r\n IWorkOrderTypeDto[] | undefined\r\n >(undefined);\r\n const [loadingAsset, setLoadingAssets] = React.useState(\r\n !!assetIds && !!assets && assets.length < 1,\r\n );\r\n const handleAssetChange = React.useCallback(\r\n (value: IAssetDto[] | []) => {\r\n setAssets(value);\r\n setLoadingAssets(true);\r\n initWOTypeDataParams(value, undefined, downtime).then(types => {\r\n setWorkTypes(types);\r\n setLoadingAssets(false);\r\n });\r\n },\r\n [downtime],\r\n );\r\n const getParamFromUrl = (name: string): string | undefined => {\r\n return GetRawValue(new URLSearchParams(location.search), name) ?? undefined;\r\n };\r\n const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n let params = {\r\n queryParams: {\r\n id: undefined,\r\n aType: event.Id.toString(),\r\n down: (downtime || getParamFromUrl('down')) && event.AssetAlertType,\r\n source: getParamFromUrl('source'),\r\n Up: getParamFromUrl('Up'),\r\n title: getParamFromUrl('title'),\r\n eStart: getParamFromUrl('eStart'),\r\n sympt: getParamFromUrl('sympt'),\r\n aStatus: getParamFromUrl('aStatus'),\r\n aStart: getParamFromUrl('aStart'),\r\n desc: getParamFromUrl('desc'),\r\n assetId: !!assets ? assets.map(a => a.Id).join(',') : undefined,\r\n offH:\r\n (downtime || getParamFromUrl('down')) && event.AssetAlertType\r\n ? getParamFromUrl('offH')\r\n : undefined,\r\n offStart: getParamFromUrl('offStart'),\r\n offEnd: getParamFromUrl('offStart'),\r\n reason: getParamFromUrl('reason'),\r\n eqid: getParamFromUrl('eqid'),\r\n sid: getParamFromUrl('sid'),\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps;\r\n const panelProps = {\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: params,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState;\r\n\r\n !!openPanelWithCover\r\n ? openPanelWithCover(panelProps)\r\n : openPanel(panelProps);\r\n };\r\n\r\n useLocationChange((current: Location, previus: Location) => {\r\n let ids = getParamFromUrl('aid');\r\n if ((!!ids && ids !== '') || !!assetIds) {\r\n setLoadingAssets(true);\r\n initAssetsData(ids || assetIds).then(response => {\r\n setAssets(response);\r\n initWOTypeDataParams(response, undefined, downtime).then(types => {\r\n setLoadingAssets(false);\r\n setWorkTypes(types);\r\n });\r\n });\r\n } else {\r\n setWorkTypes(undefined);\r\n setAssets(undefined);\r\n setLoadingAssets(false);\r\n }\r\n });\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n {t(translations.CreateAnAssetRelatedEvent)}\r\n \r\n {\r\n popupState.close();\r\n setAssets([]);\r\n setWorkTypes([]);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n {\r\n handleAssetChange(value);\r\n }}\r\n placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n fullWidth={true}\r\n name=\"assets\"\r\n variant=\"filled\"\r\n id=\"asset-id\"\r\n label={t(translations.Asset)}\r\n value={\r\n props.initAsset !== undefined\r\n ? [props.initAsset]\r\n : assets || undefined\r\n }\r\n disabled={props.initAsset !== undefined}\r\n />\r\n \r\n {loadingAsset && (\r\n
    \r\n \r\n
    \r\n )}\r\n {assets && assets.length > 0 && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.PleaseSelectAnEventType)}\r\n \r\n \r\n \r\n {workTypes && workTypes.length > 0 ? (\r\n workTypes.map(wt => (\r\n {\r\n handleWorkTypeClick(wt);\r\n popupState.close();\r\n setAssets([]);\r\n setWorkTypes([]);\r\n }}\r\n >\r\n \r\n {wt.Name}\r\n \r\n \r\n ))\r\n ) : (\r\n \r\n \r\n {t(translations.NoAlertTypesFoundForSelectedAssets)}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )}\r\n
    \r\n
    \r\n \r\n
    \r\n );\r\n};\r\n","import { MenuItem } from '@material-ui/core';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { WorkOrderApi } from 'api/WorkOrderApi';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useCalendarLink } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { OpenWorkOrderButton } from './OpenWorkOrder';\r\n\r\nexport interface BringBackUpProps {\r\n rows: TRow[];\r\n getAssetIds: (rows: TRow[]) => number[];\r\n getEquipmentIds: (rows: TRow[]) => number[];\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function BringBackUp({\r\n rows,\r\n getAssetIds,\r\n getEquipmentIds,\r\n useSidePanel,\r\n}: BringBackUpProps) {\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const fetchDownOrders = async (\r\n ids: number[],\r\n ): Promise => {\r\n return WorkOrderApi.DowntimeOrders(ids).then(data => {\r\n return data;\r\n });\r\n };\r\n const [downOrders, setDownOrders] = useAsyncExtendedState<\r\n IWorkOrderDetailsDto[]\r\n >([]);\r\n const [fetchOrdersState, fetchOrdersPromise] = usePromise(fetchDownOrders);\r\n\r\n React.useEffect(() => {\r\n if (\r\n !fetchOrdersState.status ||\r\n (fetchOrdersState.status !== 'pending' &&\r\n fetchOrdersState.status !== 'resolved')\r\n ) {\r\n setDownOrders(fetchOrdersPromise(getAssetIds(rows)));\r\n }\r\n }, [\r\n fetchOrdersPromise,\r\n fetchOrdersState.status,\r\n getAssetIds,\r\n rows,\r\n setDownOrders,\r\n ]);\r\n\r\n const calendarLinkParams = React.useMemo(() => {\r\n if (fetchOrdersState.status === 'resolved' && downOrders.length > 0) {\r\n let date =\r\n downOrders.filter(f => f.OfflineEventStart !== null)[0]\r\n .OfflineEventStart ?? newDate();\r\n\r\n return {\r\n equipments: getEquipmentIds(rows),\r\n Start: dateUtils.formatQueryStringDate(dateUtils.parseISO(date)),\r\n };\r\n } else {\r\n return undefined;\r\n }\r\n }, [downOrders, fetchOrdersState.status, getEquipmentIds, newDate, rows]);\r\n const calendarLink = useCalendarLink({\r\n ...calendarLinkParams,\r\n ...{ viewType: 'calendar' },\r\n });\r\n const alertslink = React.useMemo(() => {\r\n if (fetchOrdersState.status === 'resolved' && downOrders.length > 0) {\r\n return `/workorders?${toQueryString({\r\n aid: getAssetIds(rows)\r\n .map(r => r)\r\n .join('|'),\r\n downTime: 'true',\r\n })}`;\r\n } else {\r\n return undefined;\r\n }\r\n }, [downOrders.length, fetchOrdersState.status, getAssetIds, rows]);\r\n\r\n return fetchOrdersState.status === 'resolved' && downOrders.length > 0 ? (\r\n \r\n {downOrders.length === 1 ? (\r\n \r\n ) : (\r\n [\r\n \r\n {t(translations.BringBackUpOnWorkOrders)}\r\n ,\r\n \r\n {t(translations.BringBackUpOnCalendar)}\r\n ,\r\n ]}\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n },\r\n transformOrigin: {\r\n vertical: 'top',\r\n horizontal: 'left',\r\n },\r\n getContentAnchorEl: null,\r\n }}\r\n addChevron\r\n >\r\n {t(translations.BringBackUp)}\r\n \r\n )}\r\n \r\n ) : (\r\n \r\n );\r\n}\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AddWorkOrder } from './AddWorkOrder';\r\n\r\nexport interface DownWorkOrderProps {\r\n rows: TRow[];\r\n getAssets: (rows: TRow[]) => Promise;\r\n buttonName?: string;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function DownWorkOrder({\r\n rows,\r\n getAssets,\r\n buttonName,\r\n useSidePanel,\r\n}: DownWorkOrderProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import {\r\n CalendarButton,\r\n CalendarButtonProps,\r\n} from 'app/components/CalendarButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface OpenCalendarProps\r\n extends Omit<\r\n CalendarButtonProps,\r\n | 'variant'\r\n | 'size'\r\n | 'equipments'\r\n | 'openToBook'\r\n | 'viewType'\r\n | 'target'\r\n | 'children'\r\n > {\r\n rows: TRow[];\r\n getEquipmentIds: (rows: TRow[]) => number[];\r\n bookMultiple?: boolean;\r\n primary?: boolean;\r\n}\r\n\r\nexport function OpenCalendar({\r\n rows,\r\n getEquipmentIds,\r\n bookMultiple,\r\n primary,\r\n ...props\r\n}: OpenCalendarProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n {t(translations.Reservation)}\r\n \r\n );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface OpenWorkOrdersProps {\r\n rows: TRow[];\r\n getAssetIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function OpenWorkOrders({\r\n rows,\r\n getAssetIds,\r\n}: OpenWorkOrdersProps) {\r\n const { t } = useTranslation();\r\n const alertslink = React.useMemo(() => {\r\n return `/workorders?${toQueryString({\r\n aid: getAssetIds(rows).join('|'),\r\n })}`;\r\n }, [getAssetIds, rows]);\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import { IRow } from 'app/components/BasicTable/IRow';\r\nimport { useConfigurableColumns } from 'app/components/BasicTable/useConfigurableColumns';\r\nimport React from 'react';\r\nimport { Column } from 'react-table';\r\n\r\nconst GetTargetColumns = (\r\n configurableColumns: Column[] | undefined,\r\n target: Column[] | undefined,\r\n): Column[] | undefined => {\r\n if (configurableColumns !== undefined && target !== undefined) {\r\n const res = configurableColumns.map(c => {\r\n const r = target.find(t => t.accessor === c.accessor);\r\n return r !== undefined ? r : c;\r\n });\r\n return res;\r\n } else return undefined;\r\n};\r\nconst ExcludeColumns = (\r\n configurableColumns: Array | undefined,\r\n columnsToRemove: string[] | undefined,\r\n): Array | undefined => {\r\n if (configurableColumns !== undefined) {\r\n if (columnsToRemove !== undefined) {\r\n const res = configurableColumns.filter(\r\n c => columnsToRemove.find(r => r === c) === undefined,\r\n );\r\n return res;\r\n } else {\r\n return configurableColumns;\r\n }\r\n } else {\r\n return undefined;\r\n }\r\n};\r\nexport const useConfigurableColumnsAdvanced = (\r\n screenId: number,\r\n columns: Array>,\r\n excludeFroExport: string[],\r\n) => {\r\n const {\r\n configurableColumns,\r\n configurableColumnsExport: exportConfigurableColumns,\r\n handleConfigurableColumns,\r\n configCompleted,\r\n } = useConfigurableColumns({\r\n screenId: screenId,\r\n columns: columns,\r\n // setGlobalMessage: setGlobalMessage,\r\n });\r\n const getColumnAccessors = React.useCallback(\r\n (columns: Column[] | undefined) =>\r\n columns\r\n ?.filter(c => typeof c.accessor === 'string')\r\n ?.filter(c => c.accessor !== undefined)\r\n ?.map(c => c.accessor as keyof TRow),\r\n [],\r\n );\r\n\r\n const getDisplayColumns = React.useCallback(\r\n ({\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n }): Column[] | undefined => {\r\n if (screenId === undefined) {\r\n return columns;\r\n } else if (configCompleted) {\r\n return configurableColumns;\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n [],\r\n );\r\n const columnAccessors = React.useMemo(() => {\r\n const result = getColumnAccessors(\r\n getDisplayColumns({\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n }),\r\n );\r\n return result;\r\n }, [\r\n getColumnAccessors,\r\n getDisplayColumns,\r\n screenId,\r\n configurableColumns,\r\n configCompleted,\r\n columns,\r\n ]);\r\n const targetColumns = React.useMemo(() => {\r\n return GetTargetColumns(configurableColumns, columns);\r\n }, [columns, configurableColumns]);\r\n const exportColumns = React.useMemo(() => {\r\n return ExcludeColumns(exportConfigurableColumns, excludeFroExport);\r\n }, [excludeFroExport, exportConfigurableColumns]);\r\n return {\r\n configurableColumns: targetColumns,\r\n columnAccessors,\r\n exportConfigurableColumns: exportColumns,\r\n handleConfigurableColumns,\r\n configCompleted,\r\n };\r\n};\r\n","/**\r\n *\r\n * Popover\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Paper, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Popover as MuiPopover } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport clsx from 'clsx';\r\nimport { PopperTitle } from '../Popper/PopperTitle';\r\n\r\nexport interface PopperProps {\r\n id?: string;\r\n title: React.ReactNode;\r\n open: boolean;\r\n anchorEl?: EventTarget & HTMLDivElement;\r\n children: React.ReactNode;\r\n onClose: React.MouseEventHandler;\r\n className?: string;\r\n closeTitle?: string;\r\n}\r\n\r\nexport function Popover(props: PopperProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const classes = useStyles({ isMobile: isMobile });\r\n\r\n return (\r\n \r\n \r\n \r\n {props.children}\r\n \r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n // https://github.com/mui/material-ui/issues/18905\r\n zIndex: 1300,\r\n },\r\n rootMobile: {\r\n width: `100vw`,\r\n height: 'calc(100% - 90px)',\r\n // long content of the Popover overflows Popover box on mobile\r\n overflow: 'auto',\r\n },\r\n selectPaper: {\r\n height: '100%',\r\n },\r\n selectRoot: {\r\n padding: theme.spacing(2),\r\n },\r\n selectTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '8px 8px',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n '&>label': {\r\n width: '100%',\r\n textAlign: 'center',\r\n },\r\n },\r\n selectContent: {\r\n marginTop: theme.spacing(2),\r\n boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n },\r\n }),\r\n);\r\n","/**\r\n *\r\n * BasicDialogContentWithTitle\r\n *\r\n */\r\nimport {\r\n Box,\r\n DialogContent as MuiDialogContent,\r\n DialogContentProps as MuiDialogContentProps,\r\n LinearProgress,\r\n Theme,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport { createStyles, makeStyles } from '@material-ui/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { H4 } from '../Typography';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n margin: 0,\r\n padding: theme.spacing(3, 6, 2, 3),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n borderRadius: '12px 12px 0px 0px',\r\n },\r\n titleContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n gap: '8px',\r\n },\r\n titleSubtitle: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n },\r\n closeButton: {\r\n position: 'absolute',\r\n right: theme.spacing(2),\r\n top: theme.spacing(2),\r\n color: theme.palette.grey[500],\r\n },\r\n title: {\r\n margin: 0,\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n subtitle: {},\r\n }),\r\n);\r\nexport interface TitleProps {\r\n titles: React.ReactNode;\r\n subtitle?: React.ReactNode;\r\n onClose?: () => void;\r\n processing?: boolean;\r\n disabled?: boolean;\r\n}\r\nexport interface BasicDialogContentWithTitleProps\r\n extends MuiDialogContentProps {\r\n children: React.ReactNode;\r\n}\r\nexport function BasicDialogContentWithTitle({\r\n titles,\r\n subtitle,\r\n onClose,\r\n children,\r\n processing,\r\n disabled,\r\n}: BasicDialogContentWithTitleProps & TitleProps) {\r\n const classes = useStyles();\r\n\r\n return (\r\n \r\n \r\n {!!onClose ? (\r\n \r\n ) : null}\r\n

    {titles}

    \r\n {subtitle && (\r\n {subtitle}\r\n )}\r\n {processing && (\r\n \r\n \r\n \r\n )}\r\n
    \r\n {children}\r\n
    \r\n );\r\n}\r\nconst DialogContent = withStyles((theme: Theme) => ({\r\n root: {\r\n padding: theme.spacing(4),\r\n borderTop: 'unset',\r\n '&:first-child': {\r\n paddingTop: theme.spacing(4),\r\n },\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '24px',\r\n },\r\n}))(MuiDialogContent);\r\n","/**\r\n *\r\n * BasicDialog\r\n *\r\n */\r\nimport {\r\n createStyles,\r\n Dialog,\r\n DialogProps,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { BasicDialogActions } from './BasicDialogActions';\r\nimport { BasicDialogContentWithTitle } from './BasicDialogContentWithTitle';\r\nimport { DialogActionsRenderer } from './DialogActionsRender';\r\n\r\nexport interface BasicDialogProps extends Omit {\r\n id: string;\r\n title: React.ReactNode;\r\n subtitle?: React.ReactNode;\r\n body: React.ReactNode;\r\n processing?: boolean;\r\n isopen: boolean;\r\n leftActions: DialogActionsRenderer[];\r\n rightActions: DialogActionsRenderer[];\r\n onClose?: () => void;\r\n onCancel?: () => void;\r\n maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n disabled?: boolean;\r\n dialogRootClassName?: string;\r\n}\r\n\r\nexport function BasicDialog({\r\n id,\r\n title,\r\n body,\r\n isopen,\r\n leftActions,\r\n rightActions,\r\n maxWidth,\r\n subtitle,\r\n processing,\r\n disabled,\r\n dialogRootClassName,\r\n ...props\r\n}: BasicDialogProps) {\r\n const [open, setOpen] = React.useState(isopen);\r\n React.useEffect(() => {\r\n setOpen(isopen);\r\n }, [isopen]);\r\n const classes = dialogStyles();\r\n // const handleClose = () => {\r\n // setOpen(false);\r\n // if (onClose) {\r\n // onClose();\r\n // }\r\n // };\r\n // const defaultActions: DialogActionsRenderer[] = [\r\n // () => (\r\n // \r\n // ),\r\n // ];\r\n // actions.forEach(element => {\r\n // defaultActions.push(element);\r\n // });\r\n\r\n return (\r\n \r\n {/* \r\n {title}\r\n \r\n {body} */}\r\n \r\n {body}\r\n \r\n element)}\r\n rightActions={rightActions.map(element => element)}\r\n />\r\n \r\n );\r\n}\r\nconst dialogStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n paperWidthXs: {\r\n width: '360px',\r\n },\r\n }),\r\n);\r\n","import { Check, CheckProps } from '../BasicInputs/Check';\r\nimport * as React from 'react';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport clsx from 'clsx';\r\nimport FormGroup from '../Forms/FormControls/FormGroup';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FormLabel } from '@material-ui/core';\r\n\r\nexport interface BasicCheckBoxProps\r\n extends Omit {\r\n label?: string;\r\n error?: string;\r\n helperText?: string;\r\n info?: React.ReactNode;\r\n fullWidth?: boolean;\r\n name?: string;\r\n boxed?: boolean;\r\n maxLabelWidth?: string | number;\r\n onChange?: (\r\n value: boolean,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n}\r\n\r\nexport function BasicCheckBox(props: BasicCheckBoxProps) {\r\n // const StyledInfo = styled(InfoIcon)(({ theme }) => ({\r\n // marginLeft: theme.spacing(1),\r\n // }));\r\n const {\r\n label,\r\n error,\r\n helperText,\r\n info,\r\n name,\r\n onChange,\r\n boxed,\r\n fullWidth,\r\n maxLabelWidth = 25,\r\n required,\r\n ...other\r\n } = props;\r\n // const LabelWithInfo = () => {\r\n // return (\r\n // \r\n // {label}\r\n // {info && }\r\n // \r\n // );\r\n // };\r\n const [isChecked, setIsChecked] = React.useState(\r\n props.checked ?? false,\r\n );\r\n const handleChange = (event: React.ChangeEvent) => {\r\n const value = event.target.checked as boolean;\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n setIsChecked(value);\r\n };\r\n const withInfoLabel = React.useMemo(() => {\r\n return !!label && label.length > maxLabelWidth;\r\n }, [label, maxLabelWidth]);\r\n const Label = withInfoLabel ? (\r\n {label}}>\r\n \r\n {label}\r\n \r\n \r\n ) : (\r\n {label}\r\n );\r\n const baseLabelStyle: React.CSSProperties = React.useMemo(() => {\r\n return withInfoLabel\r\n ? { maxWidth: `${maxLabelWidth}ch`, gap: 12 }\r\n : { gap: 12 };\r\n }, [maxLabelWidth, withInfoLabel]);\r\n return (\r\n \r\n \r\n \r\n }\r\n />\r\n {info && }\r\n \r\n {((!!error && error !== '') || (!!helperText && helperText !== '')) && (\r\n \r\n {error || helperText}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { CardPosition } from 'app/components/BasicCards';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TableCardGridProps {\r\n id?: string;\r\n children: React.ReactNodeArray;\r\n isMobile?: boolean;\r\n style?: React.CSSProperties;\r\n cardPosition?: CardPosition;\r\n compact?: boolean;\r\n minCardHeight?: number;\r\n}\r\n\r\nexport const TableCardGrid = ({\r\n id,\r\n children,\r\n isMobile,\r\n style,\r\n cardPosition,\r\n compact,\r\n minCardHeight,\r\n}: TableCardGridProps) => {\r\n const theme = useTheme();\r\n return (\r\n \r\n {children\r\n .filter(f => !!f)\r\n .map((c, ind) => (\r\n \r\n {c}\r\n \r\n ))}\r\n {(isMobile || compact) && children.length > 3 && (\r\n
    \r\n )}\r\n \r\n );\r\n};\r\nconst CardGrid = styled('div')(({ theme }) => ({\r\n '&.gridContainer': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flexWrap: 'wrap',\r\n width: '100%',\r\n height: 'auto',\r\n gap: 32,\r\n overflowY: 'auto',\r\n padding: '8px 2px',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n '&.isMobile': {\r\n gap: '16px',\r\n },\r\n '&.cardVertical': {\r\n // gap: 16,\r\n padding: 0,\r\n },\r\n '& .cardItem': {\r\n //flexBasis: isMobile ? '100%' : '20%',\r\n flex: '1 1 20%',\r\n borderRadius: 8,\r\n width: 0,\r\n //width: 256,\r\n minWidth: '256px',\r\n maxWidth: '360px',\r\n '&.cardHorizontal': {\r\n flex: '1 1 25%',\r\n minWidth: '400px',\r\n maxWidth: '460px',\r\n },\r\n '&.cardVertical': {\r\n flex: '1 1 16%',\r\n },\r\n '&.isMobile': {\r\n flex: '1 1 100%',\r\n maxWidth: '100%',\r\n minWidth: 'unset',\r\n },\r\n },\r\n },\r\n}));\r\n","import styled from 'styled-components';\r\nimport { Theme, Toolbar, ToolbarProps } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n// margin: ${props =>\r\n// props.variant === 'dense' ? props.theme.spacing(1, 1, 0) : '0px'};\r\nexport const StyledToolbar = styled(\r\n ({\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & ToolbarProps) => {children},\r\n)`\r\n box-shadow: unset;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n align-self: stretch;\r\n width: 100%;\r\n padding: ${props =>\r\n props.variant === 'dense' ? '0px' : props.theme.spacing(3, 4, 2)};\r\n margin: 0;\r\n\r\n &.shortview {\r\n box-shadow: inset 0px -1px 0px #e0e5ec;\r\n gap: ${props => props.theme.spacing(1)}px;\r\n padding: ${props =>\r\n props.variant === 'dense' ? '0px' : props.theme.spacing(0, 2)};\r\n & .actionsContainer {\r\n gap: ${props => props.theme.spacing(1)}px;\r\n }\r\n & .titleSection {\r\n & .title {\r\n & .titleText {\r\n max-width: 16ch;\r\n white-space: pre;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n display: inline;\r\n }\r\n }\r\n }\r\n }\r\n &.toptoolbar {\r\n background: ${bookitColors.base.white};\r\n margin: 0px;\r\n padding: 12px 32px;\r\n &.isExpanded {\r\n padding: 12px 32px 12px 24px;\r\n }\r\n }\r\n & .titleSection {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0px;\r\n gap: ${props => props.theme.spacing(1)}px;\r\n &.titleAndIconMobile {\r\n flex-grow: 1;\r\n }\r\n &.titleAsColumn {\r\n flex-direction: column;\r\n align-items: flex-start;\r\n }\r\n & .title {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0px;\r\n gap: ${props => props.theme.spacing(1)}px;\r\n & .titleText {\r\n white-space: pre;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n max-width: 30ch;\r\n display: inherit;\r\n }\r\n & .longTitleText {\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n max-width: 45ch;\r\n display: initial;\r\n }\r\n }\r\n }\r\n & .messageContainer {\r\n margin-inline: ${props => props.theme.spacing(6)}px;\r\n flex-grow: 1;\r\n }\r\n & .actionsContainer {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: start;\r\n gap: ${props => props.theme.spacing(2)}px;\r\n padding: 0px;\r\n & span > a {\r\n & > svg {\r\n font-size: 20px;\r\n }\r\n }\r\n }\r\n`;\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport {\r\n IsEntity,\r\n IsEntityString,\r\n} from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { Condition } from './ODataFilter';\r\n\r\n/**\r\n * Gets the predicates that can be used in ODAta filter from the \"filters\"\r\n * @param filters Applied filters\r\n * @param customParams ???\r\n * @param cp ???\r\n * @returns Odata filter predicate conditions\r\n */\r\nexport function getPredicates(\r\n filters: IFilterSettings[],\r\n customParams:\r\n | ((fieldName: string, Id: number, fn: (p: {}) => void) => void)\r\n | undefined,\r\n cp: (p: {}) => void,\r\n): (string | Condition)[] {\r\n return filters\r\n .filter(f => f.value !== null)\r\n .map(f =>\r\n f.value === undefined || (Array.isArray(f.value) && f.value.length === 0)\r\n ? undefined\r\n : f.customFilter !== undefined\r\n ? f.customFilter(f.value, f, filters)\r\n : IsEntityString(f.value)\r\n ? (f.value as Entity).Id !== ''\r\n ? new Condition(\r\n f.fieldName,\r\n f.operator,\r\n (f.value as Entity).Id,\r\n f.fieldName1,\r\n f.isInversed,\r\n )\r\n : undefined\r\n : IsEntity(f.value)\r\n ? (f.value as Entity).Id >= 0\r\n ? new Condition(\r\n f.fieldName,\r\n f.operator,\r\n (f.value as Entity).Id,\r\n f.fieldName1,\r\n f.isInversed,\r\n )\r\n : customParams !== undefined\r\n ? customParams(\r\n f.fieldName as string,\r\n (f.value as Entity).Id,\r\n cp,\r\n )\r\n : undefined\r\n : new Condition(\r\n f.fieldName,\r\n f.operator,\r\n f.value,\r\n f.fieldName1,\r\n f.isInversed,\r\n ),\r\n )\r\n .filter(f => f !== undefined) as Condition[];\r\n}\r\n","/**\r\n *\r\n * Link\r\n *\r\n */\r\nimport styled from 'styled-components/macro';\r\nimport { Link } from 'react-router-dom';\r\n\r\nexport const RouterLink = styled(Link)`\r\n color: ${p => p.theme.primary};\r\n text-decoration: none;\r\n\r\n &:hover {\r\n text-decoration: underline;\r\n opacity: 0.8;\r\n }\r\n\r\n &:active {\r\n opacity: 0.4;\r\n }\r\n`;\r\n","/**\r\n *\r\n * ArticlLink\r\n *\r\n */\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport { ArticleSource } from '../ArticlesSourcePicker';\r\n\r\nexport interface ArticleLinkProps {\r\n doi: string | undefined | null;\r\n externalId?: string | null;\r\n externalIdSource?: string | null;\r\n}\r\n\r\nexport function ArticleDoiLink({\r\n doi,\r\n externalIdSource,\r\n externalId,\r\n}: ArticleLinkProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const doiId = tryGetDoiFromUrl(doi) ?? doi;\r\n const doiURL = `https://doi.org/${doiId}`;\r\n const externalIdSourceType = externalIdSource as ArticleSource;\r\n const linkURL =\r\n // use pubmed link for pubmed articles\r\n externalIdSourceType === 'PubMed'\r\n ? `https://pubmed.ncbi.nlm.nih.gov/${externalId}/`\r\n : // use dtu findit link for dtu orbit sourced articles\r\n externalIdSourceType === 'DTUOrbit'\r\n ? `https://findit.dtu.dk/en/catalog?q=doi:${doiId}`\r\n : // by default shows the doi url\r\n doiURL;\r\n if (doi === undefined) {\r\n return ;\r\n } else {\r\n return (\r\n <>\r\n \r\n {doi}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst tryGetDoiFromUrl = (s: string | null | undefined) => {\r\n try {\r\n if (s === null) {\r\n return undefined;\r\n }\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const url = new URL(s);\r\n const result = url.pathname.substr(1);\r\n return result;\r\n } catch (error) {\r\n return undefined;\r\n }\r\n};\r\n","/**\r\n *\r\n * PaymentMethodEnumPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { PaymentMethods } from 'app/pages/OnlineBudgetsStatusPage/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface PaymentMethodEnumPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSinglePaymentMethod = (val: number): Entity => {\r\n return enumToEntityArray(PaymentMethods).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initPaymentMethodData = (\r\n initval: number | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSinglePaymentMethod(initval)]);\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(PaymentMethods);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function PaymentMethodEnumPicker(props: PaymentMethodEnumPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { EditorProps } from 'app/pages/Samples/EditableTable/EditableCell';\r\nimport { ISample } from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePickerProps\r\n extends Omit<\r\n AutocompletePickerProps>,\r\n 'loadData' | 'onChange' | 'onBlur' | 'value' | 'name' | 'error'\r\n >,\r\n EditorProps {\r\n serviceGroupId?: number;\r\n placeholder?: string;\r\n helperText?: string;\r\n values?: ISample;\r\n}\r\n\r\nconst url = '/api/odata/v4/SamplePlates';\r\nexport const initSamplePlateData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (serviceGroupId?: number) => (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select: string } = {\r\n $orderby: 'Id asc',\r\n $select: 'Id',\r\n };\r\n const predicates: Condition[] = [\r\n new Condition('Active', ODataOperators.Equals, true),\r\n ];\r\n if (serviceGroupId !== undefined) {\r\n predicates.push(\r\n new Condition('ServiceGroupId', ODataOperators.Equals, serviceGroupId),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates,\r\n stringColumns: ['Id'],\r\n stringSearch: searchTerm ?? undefined,\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response =>\r\n response.value.map(item => ({ Id: item.Id, Name: item.Id })),\r\n );\r\n};\r\nexport function SamplePlatePicker({\r\n parentValue,\r\n serviceGroupId,\r\n value,\r\n values,\r\n onChange,\r\n ...props\r\n}: SamplePlatePickerProps) {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const loadDatax = React.useCallback(loadData(values?.ServiceGroupId), [\r\n values?.serviceGroupId,\r\n ]);\r\n const S2Value = value === null ? null : { Id: value, Name: value };\r\n return (\r\n onChange(value?.Id ?? null)}\r\n value={S2Value}\r\n {...props}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePositionPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { SamplePlatePositionNamingTypes } from 'api/odata/generated/enums/SamplePlatePositionNamingTypes';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { EditorProps } from 'app/pages/Samples/EditableTable/EditableCell';\r\nimport {\r\n ISample,\r\n ISampleRun,\r\n} from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePositionPickerProps\r\n extends Omit<\r\n AutocompletePickerProps>,\r\n 'loadData' | 'onChange' | 'onBlur' | 'value' | 'name' | 'error'\r\n >,\r\n EditorProps {\r\n serviceGroupId?: number;\r\n placeholder?: string;\r\n helperText?: string;\r\n values?: ISample | ISampleRun;\r\n}\r\n\r\nfunction range(x) {\r\n return Array.apply(null, Array(x)).map(function (x, i) {\r\n return i;\r\n });\r\n}\r\nconst loadData = (plateId?: string | null) => async (\r\n searchTerm: string | null,\r\n): Promise[]> => {\r\n const plate = await httpClient.get(\r\n `/api/odata/v4/sampleplates('${plateId}')`,\r\n );\r\n\r\n const rowsCount = plate.SamplePlateTypeRows;\r\n const columnsCount = plate.SamplePlateTypeColumns;\r\n const rows = range(columnsCount)\r\n .map(i =>\r\n plate.SamplePlateTypeColumnsNaming ===\r\n SamplePlatePositionNamingTypes.Alpha\r\n ? String.fromCharCode(65 + i)\r\n : i + 1,\r\n )\r\n .flatMap(column =>\r\n range(rowsCount)\r\n .map(i =>\r\n plate.SamplePlateTypeRowsNaming ===\r\n SamplePlatePositionNamingTypes.Alpha\r\n ? String.fromCharCode(65 + i)\r\n : i + 1,\r\n )\r\n .map(row => `${column}${row}`),\r\n );\r\n const options = rows.map(a => ({ Id: a, Name: a }));\r\n return options;\r\n};\r\n\r\nexport interface ConnectedSamplePlatePositionPickerProps\r\n extends SamplePlatePositionPickerProps {\r\n samplePlateId: string | null;\r\n}\r\nexport function SamplePlatePositionPicker({\r\n serviceGroupId,\r\n samplePlateId,\r\n value,\r\n values,\r\n onChange,\r\n ...props\r\n}: ConnectedSamplePlatePositionPickerProps) {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const loadDatax = React.useCallback(loadData(samplePlateId), [\r\n samplePlateId,\r\n serviceGroupId,\r\n ]);\r\n const S2Value = value === null ? null : { Id: value, Name: value };\r\n return (\r\n onChange(value?.Id ?? null)}\r\n value={S2Value}\r\n {...props}\r\n />\r\n );\r\n}\r\nexport function TargetSamplePlatePositionPicker({\r\n values,\r\n ...props\r\n}: SamplePlatePositionPickerProps) {\r\n const samplePlateId = (values as ISampleRun)?.TargetPlateId ?? null;\r\n return ;\r\n}\r\n\r\nexport function SourceSamplePlatePositionPicker({\r\n values,\r\n ...props\r\n}: SamplePlatePositionPickerProps) {\r\n const samplePlateId = (values as ISample)?.SamplePlateId ?? null;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n return ;\r\n}\r\n","import { PopupImport } from 'app/components/PopupImport';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../RequestSamplesPage/slice';\r\nimport { selectImportState } from '../RequestSamplesPage/slice/selectors';\r\n\r\nexport interface ImportButtonProps {\r\n onDownloadTemplateButtonClick?: () => Promise;\r\n disabled?: boolean;\r\n hideImportButton?: boolean;\r\n serviceRequestId?: number;\r\n}\r\n\r\nexport function ImportButton({\r\n onDownloadTemplateButtonClick,\r\n disabled,\r\n hideImportButton,\r\n serviceRequestId,\r\n}: ImportButtonProps) {\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const state = useSelector(selectImportState);\r\n\r\n const handleConfirm = (_: React.MouseEvent, file: any) => {\r\n if (file !== undefined) {\r\n dispatch(\r\n actions.import({\r\n file: file,\r\n serviceRequestId:\r\n serviceRequestId === undefined ? 0 : serviceRequestId,\r\n }),\r\n );\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n dispatch(actions.toggleImport(true))}\r\n onConfirm={handleConfirm}\r\n onCancel={() => dispatch(actions.toggleImport(false))}\r\n open={state.open}\r\n processing={state.processing}\r\n accept=\".xlsx\"\r\n hideImportButton={hideImportButton}\r\n variant=\"white\"\r\n onDownloadTemplateButtonClick={onDownloadTemplateButtonClick}\r\n />\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * PriceSheetMethodPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { PriceSheetBy } from 'enums/enums';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface PriceSheetMethodPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSinglePriceSheetMethod = (val: number): Entity => {\r\n return enumToEntityArray(PriceSheetBy).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const PriceSheetMethodData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n enumToEntityArray(PriceSheetBy).filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(PriceSheetBy);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function PriceSheetMethodPicker(props: PriceSheetMethodPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst SourceUrl = '/api/odata/v4/ServiceRequestList';\r\nexport const ServiceRequestsApi = {\r\n UpdateStatuses: (status: Entity | null, ids: number[]) => {\r\n const data = {\r\n status: status?.Name,\r\n ids,\r\n };\r\n //console.log(data);\r\n const url = SourceUrl + '/UpdateStatuses';\r\n return httpClient.post(url, data);\r\n },\r\n DeleteRequests: (ids: number[]) => {\r\n const data = { ids };\r\n const url = SourceUrl + '/DeleteRequests';\r\n return httpClient.post(url, data);\r\n },\r\n AddRequest: (\r\n osid: number,\r\n budgetId: number,\r\n userName: string,\r\n userGroupId: string | undefined,\r\n fundingTypeId: number | null,\r\n purchaseOrder: string | null,\r\n ): Promise => {\r\n const data = {\r\n osid,\r\n budgetId,\r\n userName,\r\n userGroupId,\r\n fundingTypeId,\r\n purchaseOrder,\r\n };\r\n const url = SourceUrl + '/AddRequest';\r\n return httpClient.post(url, data);\r\n },\r\n updateAdminOnComment: async (id: number) => {\r\n const url = SourceUrl + '/UpdateAdminOnComment';\r\n try {\r\n await httpClient.post(url, { id });\r\n } catch {}\r\n },\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport function DefaultFilter(user: IAuthenticatedUser) {\r\n const result = new URLSearchParams();\r\n\r\n result.set('active', true.toString());\r\n\r\n return result;\r\n}\r\nexport function getRequiredFilter(search: string) {\r\n const result = isEmptyOrWhitespace(search)\r\n ? new URLSearchParams()\r\n : new URLSearchParams(search);\r\n if (\r\n result.has('active') === false ||\r\n result.get('active') === null ||\r\n result.get('active') === ''\r\n ) {\r\n result.set('active', true.toString());\r\n }\r\n const res = result.toString();\r\n return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { AlignRight } from '../AlignRight';\r\n\r\ntype RecordType = Record;\r\nconst DecimalRenderer: Renderer> = ({ value, row }) => (\r\n {value == null ? null : value.toFixed(2)}\r\n);\r\nexport default DecimalRenderer;\r\n","/**\r\n *\r\n * ServiceTypeEnumPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { useSelector } from 'react-redux';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface ServiceTypeEnumPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSingleServiceTypeEnum = (val: number): Entity => {\r\n return enumToEntityArray(ServiceType, undefined, 'ServiceType_').filter(\r\n item => {\r\n return item.Id === val;\r\n },\r\n )[0];\r\n};\r\n\r\nexport const initServiceTypeEnumData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n const val = parseInt(initval ?? '');\r\n if (initval === undefined || isNaN(val)) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSingleServiceTypeEnum(val)]);\r\n });\r\n }\r\n};\r\nexport const GetAvailableServiceTypes = (\r\n items: Entity[],\r\n appSettings: AppSettings | null,\r\n) => {\r\n return items.filter(f => {\r\n if (f.Id === ServiceType.Offline) {\r\n return IsModuleEnabled(appSettings, KnownModules.OfflineServices);\r\n }\r\n if (f.Id === ServiceType.Sample) {\r\n return IsModuleEnabled(appSettings, KnownModules.ServiceRequests);\r\n }\r\n if (f.Id === ServiceType.Workflow) {\r\n return IsModuleEnabled(appSettings, KnownModules.Workflows);\r\n }\r\n if (f.Id === ServiceType.Online) {\r\n return IsModuleEnabled(appSettings, KnownModules.Instruments);\r\n }\r\n return false;\r\n });\r\n};\r\nexport function ServiceTypeEnumPicker(props: ServiceTypeEnumPickerProps) {\r\n const appSettings = useSelector(selectAppSettings);\r\n const getOptions = (searchTerm: string | null) => {\r\n let items = GetAvailableServiceTypes(\r\n enumToEntityArray(ServiceType, undefined, 'ServiceType_'),\r\n appSettings,\r\n );\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import { EditorProps } from '../../EditableCell';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { omit } from 'lodash';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\n/* Date */\r\n// 'Date':\r\nexport function DateField({\r\n value,\r\n onBlur,\r\n parentValue,\r\n onChange,\r\n info,\r\n autoFocus,\r\n ...props\r\n}: EditorProps) {\r\n const handleChange = value => {\r\n onChange?.(\r\n dateUtils.formatISO(value, { format: 'basic', representation: 'date' }),\r\n );\r\n };\r\n return (\r\n <>\r\n \r\n ) : undefined\r\n }\r\n error={props.error}\r\n fullWidth\r\n {...omit(props, 'helperText')}\r\n />\r\n \r\n );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nconst url = '/api/odata/v4/ServiceRequestStatusFilter';\r\n\r\nexport interface ServiceRequestStatusPickerProps\r\n extends Omit, 'loadData'> {\r\n predicates?: (string | Condition)[];\r\n}\r\n\r\nexport const initServiceRequestStatusData = (\r\n initialValue: string | undefined,\r\n) => {\r\n if (initialValue === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IServiceRequestStatusDto[]);\r\n });\r\n } else {\r\n const id = parseInt(initialValue);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IServiceRequestStatusDto[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates?: (string | Condition)[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'InternalStatusId'],\r\n });\r\n\r\nexport function ServiceRequestStatusPicker(\r\n props: ServiceRequestStatusPickerProps,\r\n) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * DialogForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Form, Formik, FormikConfig, FormikProps, FormikValues } from 'formik';\r\nimport { BasicDialogContent } from 'app/components/BasicDialog/BasicDialogContent';\r\nimport { BasicDialogTitle } from 'app/components/BasicDialog/BasicDialogTitle';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Dialog, DialogActions, DialogProps } from '@material-ui/core';\r\nimport { FormRowProps } from '../Forms/FormsLayout/FormRow';\r\n\r\nexport interface DialogFormProps\r\n extends Pick<\r\n FormikConfig,\r\n 'onSubmit' | 'initialValues' | 'validationSchema'\r\n >,\r\n Pick {\r\n /**\r\n * overrides Dialog's onClose to simplify the function signature since the event target & close reason is not in use currently\r\n * @returns\r\n */\r\n onClose: () => void;\r\n title: string;\r\n subTitle?: string;\r\n /**\r\n * Children have to be of type due to layout constraints\r\n */\r\n children:\r\n | Array>\r\n | React.ReactElement;\r\n}\r\n\r\n/**\r\n * Dialog with a form inside the DialogContent. Useful in cases where a confirmation is needed alongside another input from the user.\r\n * For example, quote rejection that requires a confirmation dialog with a reason for rejection, or an entity is added/updated through a dialog UI.\r\n * Props largely composed from a minimum viable props set from Formik & Dialog.\r\n * Children are expected to \r\n * @example\r\n * \r\n \r\n \r\n \r\n \r\n * @param props\r\n * @returns\r\n */\r\nexport function DialogForm(props: DialogFormProps) {\r\n return (\r\n \r\n \r\n {formik => }\r\n \r\n \r\n );\r\n}\r\nfunction FormContent(\r\n props: DialogFormProps & FormikProps,\r\n) {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n
    \r\n \r\n {props.title}\r\n \r\n \r\n \r\n {props.children}\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Submit)}\r\n \r\n \r\n
    \r\n );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunctionResult } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React, { ReactNode } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ChargeProps } from './index';\r\n\r\nexport const AddChargeButton = ({\r\n children,\r\n tooltip,\r\n ...props\r\n}: ChargeProps & {\r\n children?: ReactNode;\r\n tooltip?: React.ReactNode | TFunctionResult;\r\n}) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const singleAdminServiceGroup =\r\n authenticatedUser?.Roles?.includes(Roles.ServiceGroupBudgetsAdmin) &&\r\n authenticatedUser.AdminServiceGroups.length === 1\r\n ? authenticatedUser.AdminServiceGroups[0]\r\n : null;\r\n props.serviceGroup = props.serviceGroup ?? singleAdminServiceGroup ?? null;\r\n // const budgetF = useAsyncGetWthEffect(\r\n // () =>\r\n // initBudgetData(\r\n // !!props.budget && props.budget !== null\r\n // ? props.budget.Id.toString()\r\n // : undefined,\r\n // ).then(resp => resp[0] ?? null),\r\n // props.budget,\r\n // [props.budget],\r\n // );\r\n const chargesProps: ChargeProps = React.useMemo(() => {\r\n return {\r\n budget: props.budget,\r\n serviceGroup: props.serviceGroup,\r\n invoiceId: props.invoiceId,\r\n rowId: props.rowId,\r\n serviceGroupPredicate: props.serviceGroupPredicate,\r\n closeCover: props.closeCover,\r\n coverClosed: props.coverClosed,\r\n isCover: props.isCover,\r\n };\r\n }, [\r\n props.budget,\r\n props.closeCover,\r\n props.coverClosed,\r\n props.invoiceId,\r\n props.isCover,\r\n props.rowId,\r\n props.serviceGroup,\r\n props.serviceGroupPredicate,\r\n ]);\r\n\r\n return (\r\n \r\n {\r\n dispatch(actions.toggleSidePanel(true));\r\n dispatch(actions.setPageType(RenderPageType.AddCharge));\r\n dispatch(actions.setPageProps(chargesProps));\r\n }}\r\n >\r\n {children ?? t(translations.AddManualInvoiceLine)}\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\n/**\r\n * Hides the global service group filter on a page.\r\n * Example of usage on the page componet:\r\n * ```\r\n * export const SomePage = withoutGlobalServiceGroupFilter(SomePageContent);\r\n * ```\r\n * Usage on loadable:\r\n * ```\r\n * export const SomePage = lazyLoad(\r\n * () => import('./index'),\r\n * module => withoutGlobalServiceGroupFilter(module.SomePage));\r\n * ```\r\n * @param Component Page component\r\n * @returns page component\r\n */\r\nexport function withoutGlobalServiceGroupFilter

    (\r\n Component: React.ComponentType

    ,\r\n): React.FC

    {\r\n return ({ ...props }: P) => {\r\n const dispatch = useDispatch();\r\n\r\n const { actions } = useAppSettingsSlice();\r\n useEffectOnMount(() => {\r\n dispatch(actions.showGlobalServiceGroupFilter(false));\r\n });\r\n\r\n return ;\r\n };\r\n}\r\n","/**\r\n *\r\n * EquipmentReservationPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { IReservationEquipmentDto } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nexport interface ReservationEquipmentsPickerProps\r\n extends Omit<\r\n AutocompleteMultiPickerExProps,\r\n 'loadData'\r\n > {\r\n inputProps?: InputBaseComponentProps;\r\n}\r\nconst url = '/api/odata/v4/ReservationEquipments';\r\nexport const initEquipmentsData = (\r\n initval: string | undefined,\r\n expand: string | undefined,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids = (initval.indexOf(',') !== -1\r\n ? initval.split(',')\r\n : [initval]\r\n ).map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n let foo: string | undefined = undefined;\r\n if (ids.length > 0) {\r\n const predicates: string | Condition[] = [];\r\n\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n\r\n foo = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n $expand?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: foo,\r\n $skip: 0,\r\n $top: 10,\r\n $expand: expand,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n expandedColumns?: string,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'AccServices',\r\n 'AllowOneAccSerOnly',\r\n 'AllowPartialProjectCharges',\r\n 'AllowPartialSingleProjectCharges',\r\n 'AllowReservationCollaborators',\r\n 'ForceFullDayReservations',\r\n 'AssemblyId',\r\n 'HasAssemblyParts',\r\n 'AssetId',\r\n 'Billable',\r\n 'BudgetsTurnedOn',\r\n 'Color',\r\n 'DefaultAccServiceId',\r\n 'DefaultReservationDuration',\r\n 'FirstCustomFormId',\r\n 'ForceTutoring',\r\n 'HasAttendance',\r\n 'HideProjects',\r\n 'HideTrainingSession',\r\n 'IsEquipmentTutoring',\r\n 'MandatoriesEquipments',\r\n 'OfflineServices',\r\n 'MinOrderHours',\r\n 'NotAllowReservations',\r\n 'OptionalsEquipments',\r\n 'ReservationOfflineServicesEnabled',\r\n 'RestrictReservationToTimeSlots',\r\n 'TrainingSignUpApproval',\r\n 'ServiceGroupId',\r\n 'ServiceGroupName',\r\n 'CustomFormId',\r\n 'FirstCustomFormId',\r\n 'CustomForms',\r\n 'AllowModification',\r\n 'AllowExtendReservation',\r\n 'AllowUsersToShortenReservations',\r\n 'AllowedToTransfer',\r\n 'AllowedToTransferAll',\r\n 'EnforceReservationRestrictions',\r\n 'LimitlessReservationAllowed',\r\n 'MaxOrderHours',\r\n 'MinOrderGap',\r\n 'LoanTypeId',\r\n 'StaffUserSelection',\r\n 'StaffUserSelectionRequired',\r\n 'StaffUserSelectionVisible',\r\n 'RequireUserGroupCoordApproval',\r\n 'DraftReservationsTypeId',\r\n ],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n\r\n expand: expandedColumns,\r\n });\r\nexport function ReservationEquipmentsPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n expandedColumns,\r\n ...props\r\n}: ReservationEquipmentsPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n predicates,\r\n globalServiceGroupFilter || [],\r\n expandedColumns,\r\n );\r\n return (\r\n \r\n );\r\n}\r\nexport function ReservationSingleEquipmentPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n expandedColumns,\r\n ...props\r\n}: ReservationEquipmentsPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n predicates,\r\n globalServiceGroupFilter || [],\r\n expandedColumns,\r\n );\r\n return (\r\n {\r\n if (!!onChange) {\r\n if (value !== null) {\r\n return onChange([value]);\r\n } else {\r\n return onChange([]);\r\n }\r\n }\r\n }}\r\n disabled={disabled}\r\n info={info}\r\n id={id || 'reservation-equip-single-picker'}\r\n helperText={helperText}\r\n required={required}\r\n className={className}\r\n onBlur={props.onBlur}\r\n placeholder={placeholder}\r\n defaultValue={\r\n !!defaultValue\r\n ? defaultValue.length > 0\r\n ? (defaultValue[0] as IReservationEquipmentDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n label={label}\r\n value={\r\n !!value\r\n ? value.length > 0\r\n ? (value[0] as IReservationEquipmentDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n ariaLabel={'Equipment search'}\r\n {...props}\r\n error={props.error}\r\n />\r\n );\r\n}\r\nexport function ReservationsEquipmentFilter(\r\n firstInitEquipments: number[],\r\n mandatoryIds: number[],\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [\r\n // assembly parts should not appear in the equipment picker on the reservation side panel\r\n // only regular equipments and those that are at the top of the assembly are bookable directly\r\n new Condition(\r\n 'AssemblyId',\r\n ODataOperators.Equals,\r\n null,\r\n ),\r\n ];\r\n if (firstInitEquipments.length > 0) {\r\n let ids = firstInitEquipments.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (mandatoryIds.length > 0) {\r\n let ids = mandatoryIds.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Excludes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport const loadEquipments = loadData;\r\n","/**\r\n *\r\n * FormReservationEquipmentsPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n ReservationEquipmentsPicker,\r\n ReservationSingleEquipmentPicker,\r\n} from '../pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { IReservationEquipmentDto } from 'app/pages/ReservationDetails/Details/slice/types';\r\n\r\nexport const FormReservationEquipmentsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & { multiple: boolean; autoExpand?: string }) => {\r\n const [field, meta, helpers] = useField(\r\n props,\r\n );\r\n if (props.multiple) {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onChipClick={props.onChipClick}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n expandedColumns={props.autoExpand}\r\n />\r\n );\r\n } else {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onChipClick={props.onChipClick}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n expandedColumns={props.autoExpand}\r\n />\r\n );\r\n }\r\n};\r\n","/**\r\n *\r\n * FormReservationStatusPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ReservationStatusPicker } from '../pickers/AutocompletePickers/ReservationStatusPicker';\r\n\r\nexport const FormReservationStatusPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","import { CustomFormControl } from 'app/components/CustomForm/CusomFormControl';\r\nimport * as React from 'react';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useReservationSlice } from '../slice';\r\nimport { selectAsyncChangeLoading } from '../slice/selectors';\r\n\r\nexport interface ReservationCustomFormProps {\r\n multiple?: boolean;\r\n customForms: ICustomFormDto[];\r\n readonly?: boolean;\r\n isAdmin?: boolean;\r\n customFormRef: React.MutableRefObject;\r\n formIsValid?: (isValid: boolean) => void;\r\n formValues: IFormValueDto[];\r\n disabled?: boolean;\r\n validationEnabled?: boolean;\r\n saveFormValues: (\r\n values: IFormValueDto[],\r\n files: IFormFileValue[],\r\n originalFiles: IFormFileValue[],\r\n ) => void;\r\n}\r\n\r\nexport function ReservationCustomForm(props: ReservationCustomFormProps) {\r\n const {\r\n multiple,\r\n customForms,\r\n readonly,\r\n isAdmin,\r\n customFormRef,\r\n formIsValid,\r\n formValues,\r\n saveFormValues,\r\n disabled,\r\n validationEnabled = true,\r\n } = props;\r\n const dispatch = useDispatch();\r\n const { actions } = useReservationSlice();\r\n const mandatoryForms = React.useMemo(() => {\r\n return customForms.filter(f => f.Mandatory === true);\r\n }, [customForms]);\r\n const optionalForms = React.useMemo(() => {\r\n return customForms.filter(f => !f.Mandatory);\r\n }, [customForms]);\r\n const isAsyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n const selectedForms = React.useMemo(() => {\r\n return customForms.filter(f =>\r\n formValues.some(c => c.CustomFormId === f.Id),\r\n );\r\n }, [customForms, formValues]);\r\n const formValuesForms = React.useMemo(() => {\r\n return formValues.length > 0\r\n ? [\r\n ...new Set(\r\n formValues.map(f => f.CustomFormId || 0).filter(f => f > 0),\r\n ),\r\n ]\r\n : [];\r\n }, [formValues]);\r\n const onLoadCompleted = () => {\r\n if (isAsyncChangeLoading) {\r\n dispatch(actions.setAsyncChangeLoading(false));\r\n }\r\n };\r\n const onLoadStarted = () => {\r\n dispatch(actions.setAsyncChangeLoading(true));\r\n };\r\n const formId = React.useMemo(() => {\r\n return selectedForms.length > 0\r\n ? selectedForms[0].Id\r\n : formValuesForms.length > 0\r\n ? formValuesForms[0]\r\n : mandatoryForms.length > 0\r\n ? mandatoryForms[0].Id\r\n : optionalForms.length > 0\r\n ? optionalForms[0].Id\r\n : 0;\r\n }, [formValuesForms, mandatoryForms, optionalForms, selectedForms]);\r\n return customForms.length > 0 || formId > 0 ? (\r\n \r\n {multiple ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n ) : (\r\n {''}\r\n );\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\n\r\nexport interface BudgetListenerProps {\r\n budget: Entity | null;\r\n ReservationUserGroupGroupByBudgetUserGroup: boolean;\r\n values?: T;\r\n setUserGroup: (value: Entity | null) => void;\r\n}\r\n\r\nexport function BudgetListener(props: BudgetListenerProps) {\r\n const {\r\n budget,\r\n ReservationUserGroupGroupByBudgetUserGroup,\r\n setUserGroup,\r\n } = props;\r\n const [initilized, setInitilized] = React.useState(true);\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n if (!!budget?.Id) {\r\n if (ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (!!(budget as IBudgetFilterDto).UserGroupId) {\r\n setUserGroup({\r\n Id: (budget as IBudgetFilterDto).UserGroupId,\r\n Name: (budget as IBudgetFilterDto).UserGroupName,\r\n } as IUserGroupDto);\r\n }\r\n }\r\n } else {\r\n if (ReservationUserGroupGroupByBudgetUserGroup) {\r\n setUserGroup(null);\r\n }\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [budget]);\r\n\r\n return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectEquipmentsSettings } from '../../slice/selectors';\r\n\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { getWorkFlowName } from '../utils';\r\nimport { ReservationDetailsState } from '../../slice/types';\r\nimport { isMember } from './isMember';\r\n\r\nexport interface UserNameListenerProps {\r\n userName: Entity | null;\r\n equipments: Entity[];\r\n globalSettings: GlobalSettingsType;\r\n user: AuthenticatedUser | undefined;\r\n isEdit: boolean;\r\n changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n values: T;\r\n}\r\nexport function UserNameListener(\r\n props: UserNameListenerProps,\r\n) {\r\n const { userName, equipments, globalSettings } = props;\r\n\r\n const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n const [initilized, setInitilized] = React.useState(true);\r\n const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n return !!equipmentSettings\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n !equipmentSettings.HasHideProjects &&\r\n !equipmentSettings.HasConflictProjects &&\r\n equipmentSettings.BudgetsTurnedOn\r\n : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n }, [\r\n equipmentSettings,\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n ]);\r\n\r\n const { setFieldValue } = useFormikContext();\r\n\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n if (equipments.length > 0) {\r\n //&& !isEdit\r\n if (userName !== null) {\r\n if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (!isMember(userName, props.values.ADGroup))\r\n setFieldValue('ADGroup', {\r\n Id: (userName as IUserFilterDto).UserGroupId,\r\n Name: (userName as IUserFilterDto).UserGroupName,\r\n });\r\n }\r\n if (globalSettings.AllowWorkflowBooking) {\r\n setFieldValue('WorkflowBooking', getWorkFlowName(userName.Id));\r\n }\r\n }\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [userName]);\r\n\r\n return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectEquipmentsSettings } from '../../slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport { getBudgetVisible } from '../../slice/getBudgetVisible';\r\nimport { isMember } from './isMember';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nexport interface UserGroupListenerProps {\r\n userName: Entity | null;\r\n equipments: Entity[];\r\n userGroup: Entity | null | undefined;\r\n startTime: Date | string;\r\n endTime: Date | string;\r\n globalSettings: GlobalSettingsType;\r\n user: AuthenticatedUser | undefined;\r\n isEdit: boolean;\r\n values?: T;\r\n}\r\nexport function UserGroupListener(props: UserGroupListenerProps) {\r\n const { userName, equipments, userGroup, globalSettings, isEdit } = props;\r\n const [initilized, setInitilized] = React.useState(true);\r\n const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n const budgetVisible = React.useMemo(() => {\r\n return getBudgetVisible(\r\n globalSettings,\r\n (equipments as IReservationEquipmentDto[]).map(service => ({\r\n Billable: service.Billable,\r\n BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n HideProjects: service.HideProjects,\r\n ServiceTypeId: ServiceType.Online,\r\n })),\r\n );\r\n }, [equipments, globalSettings]);\r\n\r\n const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n return !!equipmentSettings\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n !equipmentSettings.HasHideProjects &&\r\n !equipmentSettings.HasConflictProjects &&\r\n equipmentSettings.BudgetsTurnedOn\r\n : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n }, [\r\n equipmentSettings,\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n ]);\r\n const { setFieldValue } = useFormikContext();\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n if (userGroup !== null) {\r\n if (\r\n budgetVisible &&\r\n !isEdit &&\r\n equipments.length > 0 &&\r\n userName !== null\r\n ) {\r\n if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n setFieldValue('Budget', null);\r\n }\r\n } else {\r\n if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (!isMember(userName, userGroup)) {\r\n setFieldValue('BookedBy', null);\r\n }\r\n\r\n if (budgetVisible && !isEdit) {\r\n setFieldValue('Budget', null);\r\n }\r\n }\r\n }\r\n } else {\r\n if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n setFieldValue('BookedBy', null);\r\n if (budgetVisible && !isEdit) {\r\n setFieldValue('Budget', null);\r\n }\r\n }\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [userGroup]);\r\n\r\n return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useDispatch } from 'react-redux';\r\nimport { newDate } from '../utils';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceSettingsState } from '../../slice/types';\r\nimport { useRepetitiveSlice } from 'app/components/Forms/FormRepetitive/slice';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CustomDate } from 'types/CustomDate';\r\n\r\nexport interface StartTimeListenerProps {\r\n userName: Entity | null;\r\n equipments: Entity[];\r\n globalSettings: GlobalSettingsType;\r\n user: AuthenticatedUser | undefined;\r\n startTime: Date | string;\r\n endTime: Date | string;\r\n initialStart: Date | string;\r\n initialEnd: Date | string;\r\n changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n equipmentSettings: ServiceSettingsState | undefined;\r\n isEdit: boolean;\r\n values: T;\r\n}\r\nexport function StartTimeListener(props: StartTimeListenerProps) {\r\n const {\r\n userName,\r\n equipments,\r\n startTime,\r\n endTime,\r\n initialStart,\r\n initialEnd,\r\n values,\r\n equipmentSettings,\r\n changeHandler,\r\n } = props;\r\n const [prevStartTime, setPrevStartTime] = React.useState<\r\n Date | string | undefined\r\n >(initialStart);\r\n const [prevEndTime, setPrevEndTime] = React.useState<\r\n Date | string | undefined\r\n >(initialEnd);\r\n const isStartChanged = React.useRef(undefined);\r\n const isEndChanged = React.useRef(undefined);\r\n // const [isStartChanged, setIsStartChanged] = React.useState<\r\n // boolean | undefined\r\n // >(undefined);\r\n // const [isEndChanged, setIsEndChanged] = React.useState(\r\n // undefined,\r\n // );\r\n const dispatch = useDispatch();\r\n const { actions: repetitiveActions } = useRepetitiveSlice();\r\n const [initilized, setInitilized] = React.useState(true);\r\n const { setFieldValue } = useFormikContext();\r\n const { setFieldTouched, validateForm } = useFormikContext();\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n let start = newDate(startTime);\r\n let end =\r\n endTime === null\r\n ? newDate(\r\n dateUtils.set(start, {\r\n hours:\r\n start.getHours() +\r\n (equipmentSettings?.DefaultReservationDuration || 1),\r\n minutes: start.getMinutes(),\r\n }),\r\n )\r\n : newDate(endTime);\r\n //Start Time Changed\r\n if (!!prevStartTime) {\r\n let prev = newDate(prevStartTime);\r\n if (start.getTime() !== prev.getTime()) {\r\n if (end === null) {\r\n end = newDate(\r\n dateUtils.addHours(\r\n start,\r\n equipmentSettings?.DefaultReservationDuration || 1,\r\n ),\r\n );\r\n }\r\n dateUtils.addMilliseconds(end, start.getTime() - prev.getTime());\r\n setTimeout(() => setFieldTouched('EndTime', true, false));\r\n\r\n setTimeout(() =>\r\n validateForm({\r\n ...values,\r\n EndTime: dateUtils.formatISO(dateUtils.dateOrStringToDate(end), {\r\n format: 'basic',\r\n representation: 'complete',\r\n }),\r\n }),\r\n );\r\n setPrevStartTime(start);\r\n isStartChanged.current = true;\r\n isEndChanged.current =\r\n end.getTime() !== newDate(prevEndTime).getTime();\r\n //setIsEndChanged(end.getTime() !== newDate(prevEndTime).getTime());\r\n setPrevEndTime(end);\r\n dispatch(\r\n repetitiveActions.setRepetitiveValue({\r\n fieldKey: 'RecurringEndDate',\r\n fieldValue: dateUtils.formatISO(\r\n new CustomDate(dateUtils.addDays(start, 7), 'date'),\r\n ),\r\n }),\r\n );\r\n } else {\r\n let prevEnd = newDate(prevEndTime);\r\n if (end.getTime() !== prevEnd.getTime()) {\r\n //setIsEndChanged(true);\r\n isEndChanged.current = true;\r\n }\r\n setPrevEndTime(end);\r\n }\r\n }\r\n if (\r\n equipments.length > 0 &&\r\n userName != null &&\r\n (isStartChanged.current === true || isEndChanged.current === true)\r\n ) {\r\n changeHandler({ ...values, EndTime: end }, false);\r\n if (isEndChanged.current === true) {\r\n setFieldValue(\r\n 'EndTime',\r\n dateUtils.formatISO(dateUtils.dateOrStringToDate(end), {\r\n format: 'basic',\r\n representation: 'complete',\r\n }),\r\n );\r\n }\r\n console.log('StartTime Changed');\r\n isEndChanged.current = undefined;\r\n isStartChanged.current = undefined;\r\n // setIsStartChanged(undefined);\r\n // setIsEndChanged(undefined);\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [startTime, endTime]);\r\n\r\n return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAsyncChangeLoading } from '../../slice/selectors';\r\nimport { newDate } from '../utils';\r\n\r\nexport interface EndTimeListenerProps {\r\n userName: Entity | null;\r\n equipments: Entity[];\r\n globalSettings: GlobalSettingsType;\r\n user: AuthenticatedUser | undefined;\r\n endTime: Date | string;\r\n initialEnd: Date | string;\r\n isEdit: boolean;\r\n changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n values: T;\r\n}\r\nexport function EndTimeListener(props: EndTimeListenerProps) {\r\n const {\r\n userName,\r\n equipments,\r\n endTime,\r\n isEdit,\r\n changeHandler,\r\n values,\r\n initialEnd,\r\n } = props;\r\n const [initialized, setInitialized] = React.useState(true);\r\n const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n const [prevEndTime, setPrevEndTime] = React.useState<\r\n Date | string | undefined\r\n >(initialEnd);\r\n React.useEffect(() => {\r\n if (!initialized) {\r\n let newEnd = newDate(endTime);\r\n let prevEnd = newDate(prevEndTime);\r\n if (\r\n equipments.length > 0 &&\r\n userName != null &&\r\n !isEdit &&\r\n !asyncChangeLoading &&\r\n prevEnd.getTime() !== newEnd.getTime()\r\n ) {\r\n changeHandler(values);\r\n }\r\n setPrevEndTime(newEnd);\r\n }\r\n setInitialized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [endTime]);\r\n\r\n return null;\r\n}\r\n","/**\r\n *\r\n * ChipCheckBoxGroup\r\n *\r\n */\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormHelperText,\r\n FormLabel,\r\n styled,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { BookitChipWithCheck } from '.';\r\nimport { CheckEntity } from '../CheckBoxGroup';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface ChipCheckBoxGroupProps {\r\n options: CheckEntity[];\r\n value?: CheckEntity[];\r\n className?: string;\r\n onChange?: (\r\n value: CheckEntity,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n id: string;\r\n //formik\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n disabled?: boolean;\r\n required?: boolean;\r\n helperText?: string;\r\n info?: string;\r\n fullWidth?: boolean;\r\n size?: 'small' | 'medium';\r\n margin?: 'none' | 'dense' | 'normal';\r\n isRow?: boolean;\r\n style?: React.CSSProperties;\r\n}\r\n\r\nexport function ChipCheckBoxGroup({\r\n name,\r\n id,\r\n value,\r\n options,\r\n onChange,\r\n label,\r\n required,\r\n helperText,\r\n disabled,\r\n fullWidth,\r\n margin,\r\n error,\r\n size,\r\n isRow,\r\n style,\r\n ...props\r\n}: ChipCheckBoxGroupProps) {\r\n const handleChange = (event: React.ChangeEvent) => {\r\n const value = {\r\n Id: parseInt(event.target.id),\r\n Name: event.target.name,\r\n checked: event.target.checked,\r\n disabled: event.target.disabled,\r\n } as CheckEntity;\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n };\r\n return (\r\n \r\n {label}\r\n \r\n {options.map((item, index) => (\r\n 24 ? item.Name : undefined}\r\n onChange={handleChange}\r\n size=\"medium\"\r\n color=\"primary\"\r\n />\r\n }\r\n />\r\n ))}\r\n \r\n {helperText}\r\n \r\n );\r\n}\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n color: theme.palette.common.graySubtitle,\r\n inputLabelXS,\r\n '.Mui-focused &': {\r\n color: theme.palette.common.graySubtitle,\r\n },\r\n}));\r\n","/**\r\n *\r\n * ChipLabelGroup\r\n *\r\n */\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n styled,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { BookitChipWithInfo } from '.';\r\nimport { CheckEntity, ChipEntity } from '../CheckBoxGroup';\r\n\r\nexport interface ChipLabelGroupProps {\r\n options: ChipEntity[];\r\n value?: ChipEntity[];\r\n className?: string;\r\n onChipClick?: (chip: ChipEntity) => void;\r\n onChange?: (\r\n value: CheckEntity,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n id: string;\r\n //formik\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n disabled?: boolean;\r\n required?: boolean;\r\n helperText?: string;\r\n info?: string;\r\n fullWidth?: boolean;\r\n size?: 'small' | 'medium';\r\n margin?: 'none' | 'dense' | 'normal';\r\n isRow?: boolean;\r\n style?: React.CSSProperties;\r\n}\r\n\r\nexport function ChipLabelGroup({\r\n name,\r\n id,\r\n value,\r\n options,\r\n onChange,\r\n label,\r\n onChipClick,\r\n required,\r\n helperText,\r\n disabled,\r\n fullWidth,\r\n margin,\r\n error,\r\n size,\r\n isRow,\r\n style,\r\n ...props\r\n}: ChipLabelGroupProps) {\r\n // const handleChange = (event: React.ChangeEvent) => {\r\n // const value = {\r\n // Id: parseInt(event.target.id),\r\n // Name: event.target.name,\r\n // checked: event.target.checked,\r\n // } as CheckEntity;\r\n // if (onChange !== undefined) {\r\n // onChange(value, event);\r\n // }\r\n // };\r\n return (\r\n \r\n {label}\r\n \r\n {options.map((item, index) => (\r\n \r\n !!onChipClick && onChipClick(item)}\r\n //fullwidth={fullWidth}\r\n variant=\"default\"\r\n size={size || 'small'}\r\n label={item.Name}\r\n key={`chip-${item.Id}`}\r\n customwidth={260}\r\n info={item.info}\r\n />\r\n \r\n ))}\r\n \r\n {helperText && {helperText}}\r\n \r\n );\r\n}\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n color: theme.palette.common.graySubtitle,\r\n ...inputLabelXS,\r\n '.Mui-focused &': {\r\n color: theme.palette.common.graySubtitle,\r\n },\r\n}));\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { ChangeEvent } from 'react';\r\nimport {\r\n ChipCheckBoxGroup,\r\n ChipCheckBoxGroupProps,\r\n} from '../BasicChip/ChipChekBoxGroup';\r\nimport {\r\n ChipLabelGroup,\r\n ChipLabelGroupProps,\r\n} from '../BasicChip/ChipLabelGroup';\r\nimport { CheckEntity, ChipEntity } from '../CheckBoxGroup';\r\n\r\n//export type FormCheckBoxGroupProps = FieldHookConfig & CheckBoxGroupProps;\r\n\r\nexport const FormChipCheckBoxGroup = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n ChipCheckBoxGroupProps & { setOnChanged: () => void }) => {\r\n const [field, meta, helpers] = useField(props);\r\n const handleChange = (\r\n value: CheckEntity,\r\n event: ChangeEvent,\r\n ) => {\r\n const val = value as CheckEntity;\r\n helpers.setValue(\r\n field.value.map(f => {\r\n if (f.Id === val.Id) {\r\n return { ...f, checked: val.checked };\r\n }\r\n return f;\r\n }),\r\n true,\r\n );\r\n field.onChange(event);\r\n if (props.onChange !== undefined) {\r\n props.onChange(value, event);\r\n }\r\n props.setOnChanged();\r\n };\r\n return (\r\n \r\n );\r\n};\r\nexport const FormChipLabelGroup = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n ChipLabelGroupProps & { onChipClick?: (value: ChipEntity) => void }) => {\r\n const [field, meta] = useField(props);\r\n const handleChipClick = (value: ChipEntity) => {\r\n !!props.onChipClick && props.onChipClick(value);\r\n };\r\n // const handleChange = (value, event) => {\r\n // const val = value as CheckEntity;\r\n // helpers.setValue(\r\n // field.value.map(f => {\r\n // if (f.Id === val.Id) {\r\n // f.checked = val.checked;\r\n // }\r\n // return f;\r\n // }),\r\n // true,\r\n // );\r\n // if (props.onChange !== undefined) {\r\n // props.onChange(value, event);\r\n // }\r\n // field.onChange(event);\r\n // };\r\n return (\r\n \r\n );\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n loadOfflineServiceData,\r\n ReservationsRelatedFilter,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BookQuickServices } from 'app/pages/OtherServiceDetails/Details/components/BookQuickServices';\r\nimport { useOfflineServiceStateSlice } from 'app/pages/OtherServiceDetails/Details/slice';\r\nimport { selectSavedReservationService } from 'app/pages/OtherServiceDetails/Details/slice/selectors';\r\nimport {\r\n ErrorServices,\r\n OfflineServicesResponse,\r\n} from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useReservationSlice } from '../slice';\r\nimport { combineMandatoryOfflineServices } from '../slice/combineOfflineServiceTypes';\r\nimport {\r\n selectCloneReservations,\r\n selectSavedOfflineServices,\r\n} from '../slice/selectors';\r\nimport {\r\n ReservationDetailsState,\r\n ReservationSettingsState,\r\n ServiceSettingsState,\r\n} from '../slice/types';\r\nimport { GlobalSettingsType } from './useGlobalSettingsHook';\r\n\r\nexport interface ReservationOfflineServicesProps {\r\n values: ReservationDetailsState;\r\n reservationSettings?: ReservationSettingsState;\r\n equipmentSettings: ServiceSettingsState | undefined;\r\n globalSettings: GlobalSettingsType;\r\n isEdit: boolean;\r\n title?: React.ReactNode;\r\n hanleUpdateLocalServices: (\r\n services: IOtherServices[],\r\n operation: 'add' | 'remove' | 'update',\r\n ) => void;\r\n onServiceClick?: (item: IOtherServices) => void;\r\n disabled?: boolean;\r\n onAddBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n setError?: (error: ErrorServices) => void;\r\n}\r\n\r\nexport const ReservationOfflineServices = React.memo(\r\n function ReservationOfflineServices(props: ReservationOfflineServicesProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const isCloned = useSelector(selectCloneReservations);\r\n const savedServices = useSelector(selectSavedOfflineServices);\r\n const savedServiceEditable = useSelector(selectSavedReservationService);\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n const { actions: offActions } = useOfflineServiceStateSlice();\r\n const { actions } = useReservationSlice();\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n\r\n const {\r\n isEdit,\r\n values,\r\n equipmentSettings,\r\n reservationSettings,\r\n hanleUpdateLocalServices,\r\n onServiceClick,\r\n title,\r\n disabled,\r\n onAddBatchClick,\r\n setError,\r\n } = props;\r\n\r\n const optionalServiceTypes = React.useMemo(() => {\r\n const MandatoryOfflineServicesOnTrainingSignUps =\r\n props.globalSettings.MandatoryOfflineServicesOnTrainingSignUps &&\r\n values.TrainingSignUp;\r\n\r\n const result = [\r\n ...(reservationSettings?.OfflineOptional?.map(f => ({\r\n Id: f.Id,\r\n Mandatory: f.Mandatory,\r\n HideProject: f.HideProjects,\r\n })) ?? []),\r\n ...(equipmentSettings?.OfflineServiceTypes?.map(f => ({\r\n Id: f.Id,\r\n Mandatory: f.Mandatory,\r\n HideProject: f.HideProject,\r\n })) ?? []),\r\n ].filter(f =>\r\n MandatoryOfflineServicesOnTrainingSignUps\r\n ? f.Mandatory === true\r\n : !MandatoryOfflineServicesOnTrainingSignUps,\r\n );\r\n return result;\r\n }, [\r\n equipmentSettings?.OfflineServiceTypes,\r\n props.globalSettings.MandatoryOfflineServicesOnTrainingSignUps,\r\n reservationSettings?.OfflineOptional,\r\n values.TrainingSignUp,\r\n ]);\r\n const budgetServiceGroupServicesAllowed = React.useMemo(() => {\r\n return values.Budget === null || values.Budget === undefined\r\n ? undefined\r\n : (values.Budget as IBudgetFilterDto).ServiceGroupServicesAllowed;\r\n }, [values.Budget]);\r\n const fetchServiceType = async (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ) => {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n [\r\n ...ReservationsRelatedFilter(\r\n equipmentSettings?.Groups || [],\r\n optionalServiceTypes,\r\n equipmentSettings?.HasHideProjects,\r\n equipmentSettings?.AllOffServicesAllowed ?? undefined,\r\n values.Budget?.Id,\r\n budgetServiceGroupServicesAllowed,\r\n ),\r\n ...(predicates ?? []),\r\n ],\r\n 'public',\r\n [],\r\n undefined,\r\n 'InventoryBatches',\r\n )(searchTerm, undefined);\r\n return data.value;\r\n } catch {\r\n return [];\r\n }\r\n };\r\n const sortFunc = (a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n return b.Id - a.Id;\r\n };\r\n const prepareService = (\r\n serviceType: IOfflineServiceFilterDto,\r\n reservation: ReservationDetailsState,\r\n ) => {\r\n let batch = serviceType.InventoryBatchesEnabled\r\n ? !!serviceType.InventoryBatches &&\r\n serviceType.InventoryBatches.length > 0\r\n ? serviceType.InventoryBatches.filter(\r\n f =>\r\n (f.ExpirationDate === null ||\r\n getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n f.StokRenewed === true,\r\n ).sort(sortFunc)[0]\r\n : null\r\n : null;\r\n let data = {\r\n Id: 0,\r\n BookedBy: reservation.BookedBy?.Id,\r\n UserDisplayName: reservation.BookedBy?.Name,\r\n BudgetID: reservation.Budget?.Id,\r\n Budget: reservation.Budget?.Name,\r\n BudgetExperimentId: reservation.BudgetExperiment?.Id,\r\n BudgetExperimentName: reservation.BudgetExperiment?.Name,\r\n Quantity: serviceType.DefaultQuantity,\r\n DefaultQuantity: serviceType.DefaultQuantity,\r\n ExternalCustomerId: reservation.ExternalCustomer?.Id,\r\n ExternalCustomerName: reservation.ExternalCustomer?.Name,\r\n FundingType: reservation.FundingType?.Id,\r\n IntQuantityOnly: serviceType.IntQuantityOnly,\r\n DiscountFactor: 1,\r\n InstituteProjectId: reservation.InstituteProject?.Id,\r\n InstituteProjectName: reservation.InstituteProject?.Name,\r\n PurchaseOrder: reservation.PurchaseOrder,\r\n Reference: reservation.Reference,\r\n Mandatory: false,\r\n Remarks:\r\n reservation.Id > 0\r\n ? (t(\r\n translations.ReservationOfflineServiceDefaultRemarks,\r\n ) as string)\r\n .replace('{0}', reservation.Id.toString())\r\n .replace('{1}', reservationSettings?.BaseEquipment?.Name || '')\r\n : null,\r\n ReservationId: reservation.Id,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(reservation.StartTime),\r\n ),\r\n ServiceTypeID: serviceType.Id,\r\n ServiceType: serviceType.Name,\r\n ServiceGroupId: serviceType.ServiceGroupId,\r\n Units: serviceType.UnitTypeName,\r\n UserGroup: reservation.ADGroup?.Id,\r\n UserGroupName: reservation.ADGroup?.Name,\r\n AllowToUser: serviceType.AllowToUser,\r\n BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n StaffOnly: serviceType.StaffOnly,\r\n TrackInventory: serviceType.TrackInventory,\r\n NotLessThanZero: serviceType.NotLessThanZero,\r\n InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n } as IOtherServices;\r\n return data;\r\n };\r\n const createService = async (\r\n serviceType: IOfflineServiceFilterDto,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticService = prepareService(serviceType, values);\r\n hanleUpdateLocalServices([staticService], 'add');\r\n resolve(staticService);\r\n });\r\n };\r\n const initServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n if (savedServices.length < 1) {\r\n if (isEdit) {\r\n try {\r\n const result = await OtherServicesApi.getReservationOfflineServices(\r\n values.Id,\r\n false,\r\n //reservationSettings?.Repeat,\r\n );\r\n resolve(result.value);\r\n hanleUpdateLocalServices(result.value as IOtherServices[], 'add');\r\n } catch {\r\n resolve([]);\r\n }\r\n } else if (isCloned) {\r\n try {\r\n const result = await OtherServicesApi.getReservationOfflineServices(\r\n values.Id,\r\n reservationSettings?.Repeat,\r\n );\r\n resolve(result.value);\r\n hanleUpdateLocalServices(result.value as IOtherServices[], 'add');\r\n } catch {\r\n resolve([]);\r\n }\r\n } else {\r\n //reduce an offline services to select only distinct services in case when several equipments have the same offline services.\r\n let servicesFiltered = !!reservationSettings?.OfflineMandatory\r\n ? combineMandatoryOfflineServices(\r\n reservationSettings?.OfflineMandatory,\r\n ) || []\r\n : [];\r\n resolve(servicesFiltered);\r\n hanleUpdateLocalServices(servicesFiltered, 'add');\r\n }\r\n } else {\r\n resolve(savedServices);\r\n }\r\n });\r\n };\r\n const onRemoveService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (isEdit) {\r\n if (service.Id > 0) {\r\n try {\r\n const responseDel = await OtherServicesApi.deleteService(\r\n service.Id,\r\n );\r\n let response = responseDel as OfflineServicesResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n dispatch(\r\n notifyActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'offlineServiceDeleteError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n reject(response.ErrorMessages[0]);\r\n } else {\r\n dispatch(\r\n notifyActions.addNotification({\r\n key: 'offlineServiceDeleteSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n hanleUpdateLocalServices([service], 'remove');\r\n resolve(response.SuccessMessages[0]);\r\n }\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror\r\n ?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? t(translations.Forbidden)\r\n : undefined) ??\r\n t(translations.errormessage);\r\n dispatch(\r\n notifyActions.addNotification({\r\n key: 'offlineServiceDeleteError',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n reject(message);\r\n }\r\n } else {\r\n hanleUpdateLocalServices([service], 'remove');\r\n resolve(service);\r\n }\r\n } else {\r\n hanleUpdateLocalServices([service], 'remove');\r\n resolve(service);\r\n }\r\n });\r\n };\r\n const onUpdateService = (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n if (isEdit) {\r\n hanleUpdateLocalServices([service], 'update');\r\n // if (\r\n // service.Id > 0 &&\r\n // service.Quantity !== null &&\r\n // service.Quantity > 0\r\n // ) {\r\n // try {\r\n // const responseUp = await OtherServicesApi.updateOtherService(\r\n // service,\r\n // service.Id,\r\n // );\r\n // let response = responseUp as OfflineServicesResponse;\r\n // if (response.ErrorMessages.length > 0) {\r\n // dispatch(\r\n // notifyActions.addNotifications(\r\n // response.ErrorMessages.map(item => {\r\n // return {\r\n // key: 'offlineServiceUpdateError',\r\n // message: item,\r\n // variant: 'error',\r\n // };\r\n // }),\r\n // ),\r\n // );\r\n // reject(response.ErrorMessages[0]);\r\n // } else {\r\n // dispatch(\r\n // notifyActions.addNotification({\r\n // key: 'offlineServiceUpdateSuccess',\r\n // message: response.SuccessMessages[0],\r\n // variant: 'success',\r\n // }),\r\n // );\r\n // resolve(service);\r\n // }\r\n // } catch (error: unknown) {\r\n // const message =\r\n // (error as AxiosError)?.response?.data?.error?.innererror\r\n // ?.message ??\r\n // ((error as AxiosError)?.response?.status === 403\r\n // ? t(translations.Forbidden)\r\n // : undefined) ??\r\n // t(translations.errormessage);\r\n // dispatch(\r\n // notifyActions.addNotification({\r\n // key: 'offlineServiceUpdateError',\r\n // message: message,\r\n // variant: 'error',\r\n // }),\r\n // );\r\n // reject(message);\r\n // }\r\n // }\r\n resolve(service);\r\n } else {\r\n hanleUpdateLocalServices([service], 'update');\r\n resolve(service);\r\n }\r\n });\r\n };\r\n\r\n //check for any services exist to decide if show offline services component\r\n const fetchAnyServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n try {\r\n let data = await initServices();\r\n if (data.length > 0) {\r\n resolve(data.length);\r\n } else {\r\n let potentialData = await fetchServiceType(null, undefined);\r\n if (potentialData.length > 0) {\r\n resolve(potentialData.length);\r\n } else {\r\n resolve(0);\r\n }\r\n }\r\n } catch {\r\n resolve(0);\r\n }\r\n });\r\n };\r\n const [hasAnyServices, setHasAnyServices] = useAsyncExtendedState(\r\n 0,\r\n );\r\n const [fetchAnyServicesState, fetchAnyServicesPromise] = usePromise(\r\n fetchAnyServices,\r\n );\r\n React.useEffect(() => {\r\n if (\r\n !fetchAnyServicesState.status ||\r\n (fetchAnyServicesState.status !== 'pending' &&\r\n fetchAnyServicesState.status !== 'resolved')\r\n ) {\r\n setHasAnyServices(fetchAnyServicesPromise());\r\n }\r\n return () => {};\r\n }, [\r\n fetchAnyServicesPromise,\r\n fetchAnyServicesState.status,\r\n setHasAnyServices,\r\n ]);\r\n React.useEffect(() => {\r\n if (\r\n !!savedServiceEditable &&\r\n savedServices.some(\r\n f => f.ServiceTypeID === savedServiceEditable.ServiceTypeID,\r\n )\r\n ) {\r\n hanleUpdateLocalServices([savedServiceEditable], 'update');\r\n dispatch(offActions.setReservationService(undefined));\r\n dispatch(actions.setRefreshOfflineServices(true));\r\n }\r\n }, [\r\n actions,\r\n dispatch,\r\n hanleUpdateLocalServices,\r\n offActions,\r\n savedServiceEditable,\r\n savedServices,\r\n ]);\r\n return hasAnyServices > 0 ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n );\r\n },\r\n);\r\n","/**\r\n *\r\n * AccompaniedServicesPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n AutocompleteMultiPickerEx,\r\n AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nexport interface AccompaniedServicesPickerProps\r\n extends Omit<\r\n AutocompleteMultiPickerExProps,\r\n 'loadData'\r\n > {\r\n inputProps?: InputBaseComponentProps;\r\n}\r\nconst url = '/api/odata/v4/AccompaniedServices';\r\nexport const initAccompaniedData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n let ids = (initval.indexOf(',') !== -1\r\n ? initval.split(',')\r\n : [initval]\r\n ).map(item => {\r\n return { Id: parseInt(item) };\r\n }) as Identifiable[];\r\n let foo: string | undefined = undefined;\r\n if (ids.length > 0) {\r\n const predicates: string | Condition[] = [];\r\n\r\n predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n\r\n foo = predicates.map(f => f.toString()).join(' and ');\r\n }\r\n\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: foo,\r\n $skip: 0,\r\n $top: 10,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'Active',\r\n 'CustomFormId',\r\n 'EquipmentId',\r\n 'EquipmentName',\r\n 'OverrideTraining',\r\n 'StaffOnly',\r\n 'ServiceGroupId',\r\n 'Color',\r\n 'InstrumentCatId',\r\n 'InstrumentCatName',\r\n 'MaxOrderDuration',\r\n 'MinOrderDuration',\r\n 'MinOrderGap',\r\n 'Inventory',\r\n ],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n });\r\nexport function AccompaniedServicesPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n ...props\r\n}: AccompaniedServicesPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(predicates, globalServiceGroupFilter || []);\r\n return (\r\n \r\n );\r\n}\r\nexport function SingleAccompaniedServicesPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n predicates,\r\n disabled,\r\n inputProps,\r\n ...props\r\n}: AccompaniedServicesPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(predicates, globalServiceGroupFilter || []);\r\n return (\r\n {\r\n if (!!onChange) {\r\n if (value !== null) {\r\n return onChange([value]);\r\n } else {\r\n return onChange([]);\r\n }\r\n }\r\n }}\r\n disabled={disabled}\r\n info={info}\r\n id={id || 'acc-service-single-picker'}\r\n helperText={helperText}\r\n required={required}\r\n className={className}\r\n onBlur={props.onBlur}\r\n placeholder={placeholder}\r\n defaultValue={\r\n !!defaultValue\r\n ? defaultValue.length > 0\r\n ? (defaultValue[0] as IEquipmentAccServiceDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n label={label}\r\n value={\r\n !!value\r\n ? value.length > 0\r\n ? (value[0] as IEquipmentAccServiceDto | undefined | null)\r\n : undefined\r\n : undefined\r\n }\r\n ariaLabel={'Equipment search'}\r\n {...props}\r\n error={props.error}\r\n />\r\n );\r\n}\r\nexport function ReservationsAccServicesFilter(\r\n Equipments: number[],\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n if (Equipments.length > 0) {\r\n let ids = Equipments.map(f => {\r\n return { Id: f } as Identifiable;\r\n });\r\n predicates.push(\r\n new Condition(\r\n 'EquipmentId',\r\n ODataOperators.Includes,\r\n ids,\r\n ),\r\n );\r\n }\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport const loadEquipments = loadData;\r\n","/**\r\n *\r\n * FormAccompaniedServicesPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport {\r\n AccompaniedServicesPicker,\r\n SingleAccompaniedServicesPicker,\r\n} from '../pickers/MultiSelectPickers/AccompaniedServicesPicker';\r\n\r\nexport const FormAccompaniedServicesPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & { multiple: boolean }) => {\r\n const [field, meta, helpers] = useField(\r\n props,\r\n );\r\n if (props.multiple) {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onChipClick={props.onChipClick}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n );\r\n } else {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onChipClick={props.onChipClick}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n );\r\n }\r\n};\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport React from 'react';\r\n\r\nexport interface ReservationFormButtonProps extends ButtonProps {\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function CancelReservationButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function ApproveReservationButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function SaveForLaterButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function TransferButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function TerminateReservationButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function ModificationButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function CreateTrainingButton({\r\n text,\r\n onClick,\r\n ...props\r\n}: ReservationFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport { TerminateReservationButton } from './ReservationActions';\r\nimport * as React from 'react';\r\nimport {\r\n selectTerminateCompleted,\r\n selectTerminateProcessing,\r\n} from '../slice/selectors';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { EndUsageConfirm, EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { HasUsageEndRresult } from '../slice/types';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface TerminateReservationProps {\r\n text: string;\r\n reservationId: number;\r\n serviceId: number;\r\n isLoaanDesc: boolean;\r\n title?: string;\r\n onTerminate: () => void;\r\n}\r\n\r\nexport function TerminateReservation(props: TerminateReservationProps) {\r\n const {\r\n text,\r\n reservationId,\r\n isLoaanDesc,\r\n title,\r\n onTerminate,\r\n serviceId,\r\n } = props;\r\n const dispatch = useDispatch();\r\n const { actions: settingActions } = useAppSettingsSlice();\r\n const { t } = useTranslation();\r\n const terminateProcessing = useSelector(selectTerminateProcessing);\r\n const terminateCompleted = useSelector(selectTerminateCompleted);\r\n const [\r\n endUsageOfflineServiceIds,\r\n setEndUsageOfflineServiceIds,\r\n ] = React.useState([]);\r\n const [showConfirmEndUsage, setShowConfirmEndUsage] = React.useState(\r\n false,\r\n );\r\n const [showEndUsage, setShowEndUsage] = React.useState(false);\r\n const [usageEndProcessing, setUsageEndProcessing] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [hasUsageProcessing, setHasUsageProcessing] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const handleTerminateClick = () => {\r\n (async () => {\r\n setHasUsageProcessing(true);\r\n ReservationsApi.hasUsage({ resId: reservationId, eqId: serviceId })\r\n .then(result => {\r\n let data = result as HasUsageEndRresult;\r\n if (data.HasUsage === true && !isLoaanDesc) {\r\n setShowConfirmEndUsage(true);\r\n setEndUsageOfflineServiceIds(data.OfflineServiceTypeIds);\r\n } else {\r\n onTerminate();\r\n }\r\n setHasUsageProcessing(false);\r\n })\r\n .catch(reason => {\r\n setHasUsageProcessing(false);\r\n });\r\n })();\r\n\r\n //check if has usage\r\n //then\r\n //if yes - show confirm to end usage\r\n\r\n //if confirmed - show usage end popup\r\n //else - cancel termination\r\n // if no - terminate;\r\n };\r\n\r\n const handleEndUsage = (usageData: EndUsageData) => {\r\n setUsageEndProcessing(true);\r\n (async () => {\r\n ReservationsApi.endUsage(reservationId, usageData)\r\n .then(response => {\r\n setUsageEndProcessing(false);\r\n if (response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n settingActions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n } else {\r\n setShowEndUsage(false);\r\n onTerminate();\r\n if (response.SuccessMessages.length > 0) {\r\n response.SuccessMessages.forEach(msg =>\r\n dispatch(\r\n settingActions.addNotification({\r\n variant: 'success',\r\n message: msg,\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n response.WarningMessages.forEach(wrnmsg =>\r\n dispatch(\r\n settingActions.addNotification({\r\n variant: 'warning',\r\n message: wrnmsg,\r\n }),\r\n ),\r\n );\r\n }\r\n }\r\n })\r\n .catch(e => {\r\n console.error(e);\r\n })\r\n .finally(() => setUsageEndProcessing(false));\r\n })();\r\n };\r\n return (\r\n \r\n }\r\n onClick={e => handleTerminateClick()}\r\n disabled={\r\n terminateProcessing || usageEndProcessing || hasUsageProcessing\r\n }\r\n variant=\"white\"\r\n processing={\r\n (terminateProcessing || usageEndProcessing || hasUsageProcessing) &&\r\n !terminateCompleted\r\n }\r\n title={title}\r\n text={text}\r\n />\r\n {\r\n setShowEndUsage(true);\r\n setShowConfirmEndUsage(false);\r\n }}\r\n onCancel={() => setShowConfirmEndUsage(false)}\r\n onClose={() => setShowConfirmEndUsage(false)}\r\n maxWidth=\"sm\"\r\n />\r\n {\r\n setShowEndUsage(false);\r\n }}\r\n onConfirm={handleEndUsage}\r\n />\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormTrainingSessionPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { TrainingSessionPicker } from '../pickers/AutocompletePickers/TrainingSessionPicker';\r\n\r\nexport const FormTrainingSessionPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IBudgetDto } from 'api/odata/generated/entities/IBudgetDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePickerProps,\r\n AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { BudgetExperimentStatuses } from 'enums/BudgetExperimentStatuses';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport function budgetExperimentsFilter(\r\n serviceTypes: number[],\r\n serviceGroups: number[],\r\n serviceType: ServiceType | undefined,\r\n budgetId: number | undefined,\r\n resStart: Date | string | null | undefined,\r\n resEnd: Date | string | null | undefined,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n predicates.push(\r\n new Condition(\r\n 'StatusId',\r\n ODataOperators.Equals,\r\n BudgetExperimentStatuses.Approved,\r\n ),\r\n );\r\n\r\n predicates.push(\r\n new Condition(\r\n 'BudgetTaskActive',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n if (!isNullOrUndefined(budgetId)) {\r\n predicates.push(\r\n new Condition(\r\n 'BudgetTaskBudgetId',\r\n ODataOperators.Equals,\r\n budgetId,\r\n ),\r\n );\r\n }\r\n\r\n if (serviceGroups.length > 0) {\r\n let ids = serviceGroups.filter(f => f !== null);\r\n if (ids.length > 0) {\r\n predicates.push(\r\n `(${new Condition(\r\n 'BudgetTaskAllCoresAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n )} or ${new Condition(\r\n 'BudgetTaskServiceGroupIds',\r\n ODataOperators.AnyIn,\r\n ids,\r\n )})`,\r\n );\r\n predicates.push(\r\n `(BudgetExperimentServiceGroups/any(s: s/ServiceGroupId in ${quoteODataValue(\r\n ids,\r\n )} and s/StatusId eq ${quoteODataValue(\r\n BudgetExperimentStatuses.Approved,\r\n )}))`,\r\n );\r\n }\r\n }\r\n\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\nexport interface ReservationBudgetExperimentParams {\r\n serviceId: Array>;\r\n userId: string | null;\r\n budgetId: number | null;\r\n start: Timestamp | Date;\r\n end: Timestamp | Date;\r\n selectedExpirementId?: number;\r\n}\r\nexport interface ReservationBudgetExperimentPickerProps\r\n extends ReservationBudgetExperimentParams,\r\n Omit, 'loadData'> {\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n}\r\n\r\nconst budgetDtoFields: Array = [\r\n 'Id',\r\n 'Name',\r\n 'UserGroupId',\r\n 'UserGroupName',\r\n 'Active',\r\n 'IsDefault',\r\n 'HideExperiments',\r\n 'ServiceGroupServicesAllowed',\r\n 'StartDate',\r\n 'EndDate',\r\n 'Type',\r\n];\r\nconst budgetExperimentDtoFields: Array = [\r\n 'Id',\r\n 'Name',\r\n 'Active',\r\n 'StatusId',\r\n 'BudgetTaskBudgetId',\r\n];\r\nexport const getLoadData = (p: ReservationBudgetExperimentParams) => {\r\n const { path, search } = getBudgetExperimentsValidForReservationPathInfo(p);\r\n return getAutoCompleteLoadDataFn({\r\n url: path,\r\n queryString: search,\r\n select: budgetExperimentDtoFields,\r\n // expand is needed here for the use on reservation details to auto select the related budget\r\n // otherwise, when the budget is already preselected, expand will just slow things down\r\n expand: getBudgetExpandClause(p),\r\n });\r\n};\r\n\r\nfunction getBudgetExpandClause(\r\n p: ReservationBudgetExperimentParams,\r\n): string | undefined {\r\n return p.budgetId === null\r\n ? `Budget($select=${budgetDtoFields.join(',')})`\r\n : undefined;\r\n}\r\n\r\n/**\r\n * Prepares parameters to fetch budget experiments usable to book something (e.g. reservation, offline service, etc.)\r\n * @param p dependencies used to determine relevant budget experiments\r\n * @returns path/search to fetch the budget experiments\r\n */\r\nexport function getBudgetExperimentsValidForReservationPathInfo(\r\n p: ReservationBudgetExperimentParams,\r\n): IPathAndQuery {\r\n const pp: Record<\r\n keyof Omit,\r\n string | null\r\n > = {\r\n serviceId: JSON.stringify(p.serviceId.map(f => f.Id)),\r\n userId: \"'\" + p.userId?.replaceAll(\"'\", \"''\") + \"'\",\r\n budgetId: JSON.stringify(p.budgetId),\r\n start: '@start',\r\n end: '@end',\r\n };\r\n const BudgetExperimentsValidForReservationURL = `/api/odata/v4/BudgetExperimentsFilter/BudgetExperimentsValidForReservation(serviceId=${pp.serviceId}, budgetId=${pp.budgetId}, userId=${pp.userId}, start=${pp.start}, end=${pp.end})`;\r\n\r\n // start/end parameters are extracted into QueryString to avoid triggering \"A potentially dangerous Request.Path value (:)...\" issue with .net path validation\r\n const params = {\r\n '@start': dateUtils.formatISO(dateUtils.parseISO(p.start), {\r\n representation: 'complete',\r\n }),\r\n '@end': dateUtils.formatISO(dateUtils.parseISO(p.end), {\r\n representation: 'complete',\r\n }),\r\n $select: budgetExperimentDtoFields.join(','),\r\n $expand: getBudgetExpandClause(p),\r\n };\r\n return { path: BudgetExperimentsValidForReservationURL, search: params };\r\n}\r\n\r\nexport function ReservationBudgetExperimentPicker({\r\n serviceId,\r\n budgetId,\r\n userId,\r\n start,\r\n end,\r\n ...props\r\n}: ReservationBudgetExperimentPickerProps) {\r\n const innerLoadData = React.useMemo(\r\n () =>\r\n getLoadData({\r\n serviceId,\r\n budgetId,\r\n userId,\r\n start,\r\n end,\r\n }),\r\n [budgetId, end, serviceId, start, userId],\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport const loadBudgetExperiments = getLoadData;\r\n","import * as React from 'react';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport {\r\n ReservationBudgetExperimentParams,\r\n ReservationBudgetExperimentPicker,\r\n getBudgetExperimentsValidForReservationPathInfo,\r\n} from '../pickers/AutocompletePickers/ReservationBudgetExperimentPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWithBudget } from 'app/pages/ReservationDetails/Details/slice/types';\r\n\r\n/**\r\n * Fetches the default budget experiment matching the dependencies\r\n * @see {@link ReservationBudgetExperimentParams}\r\n * @param p relevant dependencies\r\n * @returns default budget experiment if exists, undefined - otherwise\r\n */\r\nconst getDefaultBudgetExperiment = async (\r\n p: ReservationBudgetExperimentParams,\r\n) => {\r\n const { path, search } = getBudgetExperimentsValidForReservationPathInfo(p);\r\n const result = await httpClient.get<\r\n IODataQueryResponse\r\n >(path, { ...search, ...{ $top: 10 } });\r\n if (result.value.length === 1) {\r\n return result.value[0];\r\n } else if (\r\n !!p.selectedExpirementId &&\r\n result.value.length > 0 &&\r\n result.value.some(f => f.Id === p.selectedExpirementId)\r\n ) {\r\n return result.value.filter(f => f.Id === p.selectedExpirementId)[0];\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nexport const FormReservationBudgetExperimentPicker = ({\r\n label,\r\n isEdit,\r\n serviceId,\r\n budgetId,\r\n userId,\r\n start,\r\n end,\r\n onChange,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps &\r\n ReservationBudgetExperimentParams & { isEdit: boolean }) => {\r\n const formik = useFormikContext();\r\n const [\r\n field,\r\n meta,\r\n { setValue },\r\n ] = useField(props);\r\n const [\r\n fetchDefaultBudgetExperimentState,\r\n fetchDefaultBudgetExperiment,\r\n ] = usePromise(getDefaultBudgetExperiment);\r\n\r\n // setValue goes nuts inside the Reservation Form and spams if used in useEffect directly\r\n const setValueRef = React.useRef(setValue);\r\n React.useEffect(() => {\r\n setValueRef.current = setValue;\r\n }, [setValue]);\r\n\r\n /**\r\n * Handles the user selected budget experiment.\r\n * The budget can be auto populated when the budget experiment is selected first.\r\n * Formik values - budget experiment & optionally budget (if not yet selected) are updated in one go to prevent unnecessary re renders.\r\n */\r\n const handleChange = React.useCallback(\r\n value => {\r\n const v: Record = {\r\n BudgetExperiment: value,\r\n };\r\n if (formik.values.Budget === null && value.Budget !== undefined) {\r\n v.Budget = value.Budget;\r\n }\r\n formik.setValues(values => ({ ...values, ...v }));\r\n\r\n onChange?.(value);\r\n },\r\n [formik, onChange],\r\n );\r\n\r\n /**\r\n * Services array might go wild with array mutations (e.g. when clearing large number of services selected in the reservation service picker)\r\n * Serialize & then deserializing the service ids is intended to guard the useEffect below from drowning in these mutations\r\n */\r\n const serializedServices = React.useMemo(\r\n () => JSON.stringify(serviceId.map(f => ({ Id: f.Id }))),\r\n [serviceId],\r\n );\r\n const deserializedServices = React.useMemo(\r\n () => JSON.parse(serializedServices),\r\n [serializedServices],\r\n );\r\n\r\n /**\r\n * Ref is used to skip the first effect below\r\n */\r\n const componentDidMount = React.useRef(false);\r\n\r\n // set default budget experiment for the given parent deps (service, budget, start/end, service & user)\r\n // budget experiment is considered to be default if it's the only matching one between relevant active experiments (given the deps)\r\n // if there's no default budget experiment - the value is cleared to prevent conflicts and force user to select one\r\n React.useEffect(() => {\r\n // first effect needs to be skipped for showing reservation details, in which case the budget/experiment should be shown as is without fetching the default budget experiment\r\n // here an additional condition might be needed to distinguish between the \"reservation create\" and \"reservation details\" cases\r\n if (componentDidMount.current === false && isEdit) {\r\n componentDidMount.current = true;\r\n return;\r\n }\r\n\r\n /**\r\n * Skips default budget experiment fetching if:\r\n * * budget experiment (either default or non-default) has been selected by the user with the empty budget\r\n * * budget/budget experiment changed but their connection is valid (e.g. budget is present, budget experiment is changed to another experiment within the same budget)\r\n */\r\n if (\r\n field.value?.BudgetTaskBudgetId === budgetId ||\r\n field.value?.Budget?.Id === budgetId\r\n ) {\r\n return;\r\n }\r\n\r\n // nothing to do if the services weren't selected yet\r\n if (deserializedServices.length === 0) {\r\n return;\r\n }\r\n\r\n // budget has to be selected before the budget experiment\r\n // if the budget was not yet populated - also nothing to see here\r\n if (budgetId === null) {\r\n return;\r\n }\r\n\r\n /**\r\n * BudgetId ->\r\n */\r\n fetchDefaultBudgetExperiment({\r\n budgetId: budgetId,\r\n serviceId: deserializedServices,\r\n start: start,\r\n end: end,\r\n userId: userId,\r\n selectedExpirementId: field.value?.Id,\r\n }).then(value => {\r\n setValueRef.current?.(value ?? null);\r\n if (!!value) {\r\n onChange?.(value);\r\n }\r\n });\r\n\r\n // field.value is exluded from the deps in order to allow clearing the current value\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [\r\n fetchDefaultBudgetExperiment,\r\n budgetId,\r\n end,\r\n deserializedServices,\r\n start,\r\n userId,\r\n onChange,\r\n isEdit,\r\n // field.value\r\n ]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { PeriodTypes } from 'app/components/DatePeriods';\r\n\r\n/**\r\n * Filter parameters must match the reservations filter settings\r\n * {@see app/pages/ReservationHistoryPage/Filter}\r\n */\r\ntype getReservationsLinkProps = {\r\n period?: PeriodTypes;\r\n startDate?: string | Date;\r\n endDate?: string | Date;\r\n serviceId?: number | null;\r\n trainingSignUp?: boolean;\r\n TrainingSessionId?: number;\r\n};\r\n\r\n/**\r\n * Helper function to get a link to reservations list page\r\n * @param session\r\n * @param newDate\r\n * @returns\r\n */\r\nexport function getReservationsLink(\r\n props: getReservationsLinkProps,\r\n): IPathAndQuery {\r\n return {\r\n path: '/reservations',\r\n search: {\r\n period: props.period,\r\n st:\r\n props.startDate === undefined\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(props.startDate),\r\n ),\r\n et:\r\n props.endDate === undefined\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(props.endDate),\r\n ),\r\n eid: props.serviceId,\r\n trainingSignUp: props.trainingSignUp,\r\n TrainingSessionId: props.TrainingSessionId,\r\n },\r\n };\r\n}\r\n","import { ExternalLink } from 'app/components/ExternalLink';\r\n\r\n/**\r\n * Link to edit a training session details (admin)\r\n * @param param0\r\n * @returns\r\n */\r\nexport function EditTrainingSessionLink({\r\n trainingSessionId: assetId,\r\n ...props\r\n}: React.PropsWithChildren<{ trainingSessionId: number }>) {\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Link } from 'app/components/BasicLinks/Link';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getReservationsLink } from '../../ReservationForm/getReservationsLink';\r\nimport { EditTrainingSessionLink } from 'app/pages/TrainingSessionsPage/components/EditTrainingSessionsLink';\r\nimport { translations } from 'locales/translations';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { Body } from 'app/components/Typography';\r\nimport { CircularProgress } from '@material-ui/core';\r\n\r\nexport interface TrainingSignUpAdminAlertContentProps {\r\n trainingSessionId: number;\r\n}\r\nexport function TrainingSignUpAdminAlertContent(\r\n props: TrainingSignUpAdminAlertContentProps,\r\n) {\r\n const { trainingSessionId } = props;\r\n const { t } = useTranslation();\r\n const [loading, setLoading] = React.useState(false);\r\n const attendees = useAsyncGetWthEffect(\r\n () => getSessionSlots(trainingSessionId),\r\n {\r\n Attendees: 0,\r\n },\r\n [trainingSessionId],\r\n setLoading,\r\n );\r\n\r\n // const [state, setState] = useAsyncExtendedState<\r\n // TrainingSessionInfo | undefined\r\n // >(undefined);\r\n // const [fetchState, fetch] = usePromise(getSessionSlots);\r\n // const show = React.useMemo(() => {\r\n // return (\r\n // isAdmin && trainingSessionId !== undefined && trainingSessionId !== null\r\n // );\r\n // }, [isAdmin, trainingSessionId]);\r\n\r\n // const bar = React.useMemo(() => {\r\n // if (trainingSessionId === null) {\r\n // return null;\r\n // }\r\n // if (trainingSessionId === undefined) {\r\n // return null;\r\n // }\r\n // if (!show) {\r\n // return null;\r\n // }\r\n // return trainingSessionId;\r\n // }, [show, trainingSessionId]);\r\n // React.useEffect(() => {\r\n // if (trainingSessionId !== undefined && show) {\r\n // setState(fetch(trainingSessionId));\r\n // }\r\n // });\r\n\r\n // if (bar === undefined) {\r\n // return null;\r\n // }\r\n\r\n return (\r\n \r\n \r\n \r\n {t(translations.TrainingSessionsCountMessage, {\r\n count: attendees.Attendees,\r\n })}\r\n \r\n\r\n {/* {t(translations.NotUsingThisReservation)} */}\r\n

    \r\n {loading === true && }\r\n {attendees.Attendees > 0 && (\r\n \r\n {t(translations.ManageSignUps)}\r\n \r\n )}\r\n\r\n \r\n {t(translations.EditTrainingSession)}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n}\r\n\r\ntype TrainingSessionInfo = Pick;\r\nasync function getSessionSlots(trainingSesisonId: number) {\r\n const url = `/api/odata/v4/TrainingSessionSlots`;\r\n //const select: Array = ['Attendees'];\r\n try {\r\n const x = await httpClient.get(url, {\r\n $filter: `Id eq ${trainingSesisonId}`,\r\n });\r\n return { Attendees: x.value[0].Attendees } as TrainingSessionInfo;\r\n } catch (err) {\r\n return { Attendees: 0 } as TrainingSessionInfo;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { useField, useFormikContext } from 'formik';\r\nimport { DatePickerVariants } from 'app/components/DatePicker';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout/FormRow';\r\nimport { ReservationDetailsState } from '../../slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport produce from '@reduxjs/toolkit/node_modules/immer';\r\nimport { DatePickerProps } from '@material-ui/pickers';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\nexport interface ReservationTimePeriodPickerProps {\r\n /**\r\n * Full Day / Regular reservation indicator\r\n */\r\n FullDayReservation: boolean;\r\n /**\r\n * Start time property name of the formik values object\r\n */\r\n StartTimePropertyName: string;\r\n /**\r\n * End time property name of the formik values object\r\n */\r\n EndTimePropertyName: string;\r\n /**\r\n * Disables the start time picker\r\n */\r\n startTimeDisabled: boolean;\r\n /**\r\n * Disables the end time picker\r\n */\r\n endTimeDisabled: boolean;\r\n /**\r\n * Start time change handler\r\n */\r\n onStartTimeChange: DatePickerProps['onChange'];\r\n /**\r\n * End time change handler\r\n */\r\n onEndTimeChange: DatePickerProps['onChange'];\r\n /**\r\n * Start time label & placeholder\r\n */\r\n startTimeLabel: string;\r\n /**\r\n * End time label & placeholder\r\n */\r\n endTimeLabel: string;\r\n}\r\n/**\r\n * Component that handles start/end time period UI on the reservation form.\r\n * Must be inside the formik context as the rest of the FormXXX components.\r\n * FullDayReservation might checkbox might need to also be handled here.\r\n * @param param0\r\n * @returns\r\n */\r\nexport function FormReservationTimePeriodPicker({\r\n FullDayReservation,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const formik = useFormikContext();\r\n const [startField, startMeta] = useField({\r\n name: props.StartTimePropertyName,\r\n });\r\n const [endField, endMeta, endHelpers] = useField({\r\n name: props.EndTimePropertyName,\r\n });\r\n /**\r\n * For legacy reasons the reservation start/end is expected to be stored as string without tz info. for example:\r\n * \"2023-08-09T01:05:00\" = good\r\n * \"2023-08-09T01:05:00z\" = bad (not sure for what reason, but it's not the format being used in other places on reservation side panel)\r\n * @param value {\r\n // return dateUtils.formatQueryStringDate(value, {\r\n // representation: 'complete',\r\n // });\r\n return dateUtils.formatISO(dateUtils.dateOrStringToDate(value), {\r\n format: 'basic',\r\n representation: 'complete',\r\n });\r\n };\r\n\r\n /**\r\n * Handles start time change (triggered by date selection on date picker UI).\r\n * @param value user selected date/time\r\n */\r\n const handleStartTimeChange: DatePickerProps['onChange'] = value => {\r\n // start time value is generally not clearable and should not be empty\r\n if (value !== null) {\r\n formik.setValues(\r\n produce((values: ReservationDetailsState) => {\r\n // set the current start time value\r\n values.StartTime = getStoreValue(value);\r\n // optionally adjust the end time to keep the reservation/period the same length\r\n // for example, changing the start time effectively moves current period to another date/time\r\n if (formik.values.EndTime !== null) {\r\n const endTime = adjustEndByStart(\r\n value,\r\n formik.values.StartTime,\r\n formik.values.EndTime,\r\n );\r\n values.EndTime = getStoreValue(endTime);\r\n }\r\n }),\r\n );\r\n }\r\n // raise the start time change event\r\n props.onStartTimeChange?.(value);\r\n };\r\n\r\n /**\r\n * Handles the end time change (triggered by date selection on date picker UI)\r\n * @param value new user selected end time\r\n */\r\n const handleEndTimeChange: DatePickerProps['onChange'] = value => {\r\n var formattedValue = value === null ? null : getStoreValue(value);\r\n // set the current end\r\n endHelpers.setValue(formattedValue);\r\n // rase the end time change event\r\n props.onEndTimeChange?.(value);\r\n };\r\n\r\n const datePickerVariant: DatePickerVariants = FullDayReservation\r\n ? 'date'\r\n : 'separated';\r\n\r\n return (\r\n <>\r\n \r\n {datePickerVariant === 'separated' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n\r\n \r\n {datePickerVariant === 'separated' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\nfunction adjustEndByStart(\r\n value: Date,\r\n originalStartTime: Date | string,\r\n originalEndTime: Date | string,\r\n) {\r\n const diff = dateUtils.differenceInMinutes(\r\n value,\r\n dateUtils.dateOrStringToDate(originalStartTime),\r\n );\r\n const endTime = dateUtils.addMinutes(\r\n dateUtils.dateOrStringToDate(originalEndTime),\r\n diff,\r\n );\r\n return endTime;\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssemblyPartDto } from 'api/odata/generated/entities/IAssemblyPartDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Popover } from 'app/components/Popover';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { PromiseStatus, usePromise } from 'app/hooks/usePromise';\r\nimport { translations } from 'locales/translations';\r\nimport { orderBy } from 'lodash';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Identifiable } from 'types/common';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IReservationAssemblyPartDto } from 'api/odata/generated/entities/IReservationAssemblyPartDto';\r\n\r\n/**\r\n * Pick minimum required props from the EquipmentsData\r\n */\r\nexport interface EquipmentsDataAssembliesProps {\r\n equipmentsData: Array<\r\n Pick\r\n >;\r\n reservedAssemblyParts: IReservationAssemblyPartDto[] | null;\r\n}\r\n\r\ninterface IAssembly {\r\n /**\r\n * Top assembly instrument\r\n */\r\n assembly: IAssemblyPartDto;\r\n /**\r\n * All of the parts in a flat array\r\n */\r\n parts: IAssemblyPartDto[];\r\n}\r\n\r\n/**\r\n * Intenal React.useState interface used by the component\r\n */\r\ninterface IState {\r\n open: boolean;\r\n assemblyParts?: IAssembly[];\r\n reservedAssemblyParts?: IReservationAssemblyPartDto[];\r\n popperAnchor?: unknown;\r\n}\r\n\r\nconst fetchAssemblies = async (services: Array>) => {\r\n // send batch containing one request per each equipment\r\n const batchResponse = await httpClient.batch(\r\n services.map(service => ({\r\n method: 'GET',\r\n pathName: `/api/odata/v4/servicefilter/${service.Id}/AssemblyParts`,\r\n })),\r\n );\r\n\r\n // server returns selected instrument along it's assembly parts in a flat array\r\n // transform flat array into assembly all assembly parts in a flat array to match the structure displayed to the user\r\n const parts = batchResponse.responses.map(response => {\r\n const data = (response.body as IODataQueryResponse).value;\r\n const sorted = orderBy(data, f => f.Path);\r\n return {\r\n assembly: sorted[0],\r\n parts: sorted.slice(1),\r\n };\r\n });\r\n // return partial plug able into extendState\r\n const result: Partial = { assemblyParts: parts };\r\n return result;\r\n};\r\n\r\n/**\r\n * Enables assembly info processing only for cases where assemblies have been selected.\r\n * Otherwise abort the whole ordeal\r\n * @param props\r\n * @returns\r\n */\r\nexport function EquipmentsDataAssembliesContainer(\r\n props: EquipmentsDataAssembliesProps,\r\n) {\r\n const isAssembly = React.useMemo(\r\n () =>\r\n props.equipmentsData.some(service => service.HasAssemblyParts === true),\r\n [props.equipmentsData],\r\n );\r\n if (isAssembly === false) {\r\n return null;\r\n } else {\r\n return ;\r\n }\r\n}\r\n\r\nexport function EquipmentsDataAssemblies(props: EquipmentsDataAssembliesProps) {\r\n const { t } = useTranslation();\r\n\r\n const [state, , extendState] = useAsyncExtendedState({\r\n open: false,\r\n reservedAssemblyParts: props.reservedAssemblyParts ?? undefined,\r\n });\r\n const [fetchAssembliesPromiseState, fetchAssembliesPromise] = usePromise(\r\n fetchAssemblies,\r\n );\r\n const handleClick = React.useCallback(\r\n (e: React.MouseEvent) => {\r\n // open popover\r\n extendState(state => ({\r\n open: !state.open,\r\n popperAnchor: e.currentTarget,\r\n }));\r\n // we're showing already reserved parts for existing reservations as reserved parts can differ from current assembly configuration\r\n if (state.reservedAssemblyParts === undefined) {\r\n // start fetching data\r\n extendState(fetchAssembliesPromise(props.equipmentsData));\r\n }\r\n },\r\n [\r\n extendState,\r\n fetchAssembliesPromise,\r\n props.equipmentsData,\r\n state.reservedAssemblyParts,\r\n ],\r\n );\r\n if (props.equipmentsData.length === 0) {\r\n return null;\r\n }\r\n return (\r\n <>\r\n \r\n \r\n \r\n\r\n {state.popperAnchor !== null && (\r\n extendState({ open: false })}\r\n >\r\n
    \r\n {props.reservedAssemblyParts !== undefined && (\r\n
      \r\n {props.reservedAssemblyParts?.map(reservedAssemblyPart => (\r\n
    • {reservedAssemblyPart.Name}
    • \r\n ))}\r\n
    \r\n )}\r\n {fetchAssembliesPromiseState.status !== undefined && (\r\n \r\n {state.assemblyParts === undefined ? (\r\n <>{t(translations.NoDataFound)}\r\n ) : (\r\n <>\r\n {state.assemblyParts?.map((item, index) => (\r\n \r\n {t(translations.PartsIncludedWithin)}{' '}\r\n {item.assembly.Name}\r\n
      \r\n {item.parts.map(service => (\r\n
    • {service.Name}
    • \r\n ))}\r\n
    \r\n
    \r\n ))}\r\n \r\n )}\r\n
    \r\n )}\r\n
    \r\n \r\n )}\r\n \r\n );\r\n}\r\n\r\ninterface RenderAssemblyPartsProps {\r\n status?: PromiseStatus;\r\n}\r\n/**\r\n * Renders the current state of assemblies fetch result: e.g. processing/error/data\r\n * @param param0\r\n * @returns\r\n */\r\nfunction RenderAssemblyParts({\r\n status = 'pending',\r\n ...props\r\n}: React.PropsWithChildren): JSX.Element {\r\n const { t } = useTranslation();\r\n\r\n switch (status) {\r\n case 'pending':\r\n return (\r\n <>\r\n \r\n
      \r\n
    • \r\n \r\n
    • \r\n
    • \r\n \r\n
    • \r\n
    • \r\n \r\n
    • \r\n
    • \r\n \r\n
    • \r\n
    • \r\n \r\n
    • \r\n
    \r\n \r\n );\r\n\r\n case 'resolved':\r\n return <>{props.children};\r\n case 'rejected':\r\n return <>{t(translations.err_ErrorOccured)};\r\n default:\r\n assertExhaustive(status);\r\n }\r\n}\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n filteredWorkOrderTypes,\r\n WorkOrderTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport * as React from 'react';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { loadWorkOrders } from 'app/components/pickers/AutocompletePickers/WorkOrdersPicker';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tips } from 'app/components/Typography';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRefreshWorkOrderLink } from '../../slice/selectors';\r\n\r\nexport interface ReservationWorkOrdersProps {\r\n reservationId: number;\r\n equipments: IReservationEquipmentDto[];\r\n onWorkTypeClick: (\r\n event: IWorkOrderTypeDto,\r\n equipmentIds: number[],\r\n reservationId: number,\r\n ) => void;\r\n}\r\n\r\nexport function ReservationWorkOrders(props: ReservationWorkOrdersProps) {\r\n const { equipments, reservationId, onWorkTypeClick } = props;\r\n const refreshWorkOrders = useSelector(selectRefreshWorkOrderLink);\r\n const equipmentIds = React.useMemo(() => {\r\n return equipments.map(f => f.Id);\r\n }, [equipments]);\r\n const { t } = useTranslation();\r\n const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n onWorkTypeClick(event, equipmentIds, reservationId);\r\n };\r\n const relatedAssets = useAsyncGetWthEffect(\r\n async () =>\r\n initAssetsData(equipmentIds.join(',')).then(res => res as IAssetDto[]),\r\n [],\r\n [equipmentIds],\r\n );\r\n const relatedWorkOrders = useAsyncGetWthEffect(\r\n async () =>\r\n loadWorkOrders([`Reservation eq ${quoteODataValue(reservationId)}`])(\r\n null,\r\n undefined,\r\n ).then(res => res.value),\r\n [],\r\n [reservationId, refreshWorkOrders],\r\n );\r\n const workOrdersLink = React.useMemo(() => {\r\n return `/workorders?${toQueryString({\r\n reservationId: reservationId,\r\n })}`;\r\n }, [reservationId]);\r\n const workOrdersLinkTitle = React.useMemo(() => {\r\n return relatedWorkOrders.length > 0\r\n ? (t(translations.ReservationAlertsLink) as string).replace(\r\n '{0}',\r\n relatedWorkOrders.length.toString(),\r\n )\r\n : undefined;\r\n }, [relatedWorkOrders.length, t]);\r\n return (\r\n 0 ? (\r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.NoReservationAlerts) as string}\r\n \r\n \r\n )\r\n }\r\n >\r\n \r\n {\r\n handleWorkTypeClick(value as IWorkOrderTypeDto);\r\n }}\r\n fullWidth={true}\r\n id=\"wotype-id\"\r\n />\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * WokFlowBooking\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { WorkflowBookingPicker } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\nimport { IWorkflowBookingDto } from 'api/odata/generated/entities/IWorkflowBookingDto';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport React from 'react';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\nexport const FormWorkFlowBooking = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n Omit & { useWorkFlowPicker?: boolean }) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n const { t } = useTranslation();\r\n return props.useWorkFlowPicker ? (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n placeholder={props.placeholder}\r\n onBlur={field?.onBlur}\r\n value={field.value as IWorkflowBookingDto}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n disabled={props.disabled}\r\n />\r\n ) : (\r\n {\r\n let val = e.currentTarget.value;\r\n let entityVal =\r\n val === undefined || val === ''\r\n ? null\r\n : ({ Id: -1, Name: val } as Entity);\r\n helpers.setValue(entityVal, true);\r\n if (props.onChange) {\r\n props.onChange(entityVal);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field?.value?.Name ?? ''}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error || props.helperText}\r\n id={props.id || 'workflowtextfieldId'}\r\n inputProps={{\r\n ...props.inputProps,\r\n 'aria-label': `${label ? undefined : 'text input'}`,\r\n }}\r\n color=\"primary\"\r\n InputProps={{\r\n ...props.InputProps,\r\n endAdornment: (\r\n \r\n {props.info ? : null}\r\n {props.InputProps?.endAdornment}\r\n \r\n ),\r\n }}\r\n />\r\n );\r\n};\r\n","import { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport styled from 'styled-components';\r\nimport { ReservationSettingsState } from '../../slice/types';\r\n\r\nexport interface ReadOnlyDetailsProps {\r\n details: ReservationSettingsState;\r\n}\r\n\r\nexport function ReadOnlyDetails(props: ReadOnlyDetailsProps) {\r\n const { details } = props;\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n {t(translations.ReservationAdvancedDetails)}\r\n
    \r\n
    \r\n {t(translations.RecordDate)}\r\n \r\n {dateUtils.longDateTimeFormat(details.RecordDate)}\r\n \r\n
    \r\n {details.LastUpdateDate !== null && !!details.LastUpdateDate && (\r\n
    \r\n {t(translations.LastUpdated)}\r\n \r\n {dateUtils.longDateTimeFormat(details.LastUpdateDate)}\r\n \r\n
    \r\n )}\r\n {details.LastUpdateAdmin !== null && !!details.LastUpdateAdmin.Id && (\r\n
    \r\n {t(translations.LastUpdatedBy)}\r\n \r\n {details.LastUpdateAdmin?.Name}\r\n \r\n
    \r\n )}\r\n
    \r\n
    \r\n
    \r\n );\r\n}\r\nconst DetailsWrapper = styled.div`\r\n &.readonly-root {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n grid-gap: 4px;\r\n padding: 0;\r\n width: 100%;\r\n }\r\n & .readonly-content {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n grid-gap: 16px;\r\n padding: 16px 0px;\r\n width: 100%;\r\n }\r\n & .readonly-row {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n width: inherit;\r\n }\r\n`;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { RequestReservations } from '../../slice/types';\r\n\r\nexport interface ReservationRequestDetailsProps {\r\n reservationId: number;\r\n}\r\n\r\nexport function ReservationRequestDetails(\r\n props: ReservationRequestDetailsProps,\r\n) {\r\n const { reservationId } = props;\r\n const { t } = useTranslation();\r\n const url = `api/odata/v4/Reservations/ReservationRequestData`;\r\n const relatedReservation = useAsyncGetWthEffect<\r\n RequestReservations | undefined\r\n >(\r\n async () => httpClient.post(url, { id: reservationId }).then(res => res),\r\n undefined,\r\n [reservationId],\r\n );\r\n return !!relatedReservation ? (\r\n \r\n \r\n \r\n {relatedReservation.RequestId !== null &&\r\n relatedReservation.RequestId !== undefined && (\r\n
    \r\n \r\n {t(translations.ServiceRequestId)}\r\n \r\n \r\n {`# ${relatedReservation.RequestId}`}\r\n \r\n
    \r\n )}\r\n\r\n {!!relatedReservation.TotalRowsCount &&\r\n relatedReservation.TotalRowsCount !== null && (\r\n
    \r\n \r\n {t(translations.TotalSamples)}\r\n \r\n \r\n {relatedReservation.TotalRowsCount}\r\n \r\n
    \r\n )}\r\n {!!relatedReservation.AssociatedRowsCount &&\r\n relatedReservation.AssociatedRowsCount !== null && (\r\n
    \r\n \r\n {t(translations.SamplesAssociatedWithThisReservation)}\r\n \r\n \r\n {relatedReservation.AssociatedRowsCount}\r\n \r\n
    \r\n )}\r\n
    \r\n
    \r\n \r\n ) : null;\r\n}\r\n\r\nconst RequestWrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n width: 100%;\r\n & .req-row {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n width: inherit;\r\n }\r\n`;\r\n","import { Formik, FormikHelpers, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport {\r\n EquipmentsChangeStateParameters,\r\n getSingleReservationStatus,\r\n IMandatoryEquipmentsDto,\r\n IReservationEquipmentDto,\r\n PrerequisitsResult,\r\n ReservationDetailsState,\r\n ReservationQueryStringParameters,\r\n ReservationSettingsState,\r\n ReservationStatus,\r\n ReservationValidationResult,\r\n TrainingSessionResult,\r\n UserTrainingReservationData,\r\n} from '../slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAsyncChangeLoading,\r\n selectCloneReservations,\r\n selectEquipmentChangeCompleted,\r\n selectEquipmentChangeState,\r\n selectEquipmentsSettings,\r\n selectFieldHandler,\r\n selectSubmitCalculateCredit,\r\n selectIsEdit,\r\n selectRequestedValueFor,\r\n selectReservationCompleted,\r\n selectReservationHasError,\r\n selectReservationSettings,\r\n selectSavedForLater,\r\n selectSavedOfflineServices,\r\n selectReservationProcessing,\r\n} from '../slice/selectors';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport {\r\n FieldHandler,\r\n FieldValue,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { FormReservationEquipmentsPicker } from 'app/components/Forms/FormReservationEquipmentsPicker';\r\nimport { FormReservationStatusPicker } from 'app/components/Forms/FormReservationStatusPicker';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { RepetitiveControl } from 'app/components/Forms/FormRepetitive/RepetitiveControl';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormRestrictedUserGroupPicker } from 'app/components/Forms/FormRestrictedUserGroupPicker';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { RestrictedFilter } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { ReservationCustomForm } from '../components/ReservationCustomForm';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport {\r\n formValueSchema,\r\n IFormFileValue,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { RepetitiveFor } from 'app/components/Forms/FormRepetitive/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n CheckEntityShema,\r\n EntityNumberSchema,\r\n EntityStringSchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n updateFormValues,\r\n validateAccServices,\r\n validateReservation,\r\n} from '../components/utils';\r\nimport { useReservationSlice } from '../slice';\r\nimport {\r\n initEquipmentsData,\r\n ReservationsEquipmentFilter,\r\n} from 'app/components/pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { Body } from 'app/components/Typography';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BudgetListener } from '../components/FormFieldListeners/BudgetListener';\r\nimport { UserNameListener } from '../components/FormFieldListeners/UserNameListener';\r\nimport { isMember } from '../components/FormFieldListeners/isMember';\r\nimport { UserGroupListener } from '../components/FormFieldListeners/UserGroupListener';\r\nimport { StartTimeListener } from '../components/FormFieldListeners/StartTimeListener';\r\nimport { EndTimeListener } from '../components/FormFieldListeners/EndTimeListener';\r\n\r\nimport {\r\n FormChipCheckBoxGroup,\r\n FormChipLabelGroup,\r\n} from 'app/components/Forms/FormChipsGroup';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { ReservationOfflineServices } from '../components/ReservationOfflineServices';\r\nimport { FormAccompaniedServicesPicker } from 'app/components/Forms/FormAccompaniedServicesPicker';\r\nimport { ReservationsAccServicesFilter } from 'app/components/pickers/MultiSelectPickers/AccompaniedServicesPicker';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { TerminateReservation } from '../components/TerminateReservation';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport {\r\n customFormErrorsHandler,\r\n durationErrorsHandler,\r\n otheMessagesHandler,\r\n permissionsErrorsHandler,\r\n prerquisitErrorsHandler,\r\n staffUserChangeHandler,\r\n trainingSessionChangeHandler,\r\n} from './handlers';\r\nimport { FormTrainingSessionPicker } from 'app/components/Forms/FormTrainingSessionPicker';\r\nimport { ReservRelatedFilter } from 'app/components/pickers/AutocompletePickers/TrainingSessionPicker';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { generatePath } from 'react-router-dom';\r\nimport { RUN_DETAILS_PAGE_PATH } from 'app/pages/Samples/RunDetailsPage';\r\nimport { combineOfflineServiceTypes } from '../slice/combineOfflineServiceTypes';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { getReservationCollaboratorsFilter } from './getReservationCollaboratorsFilter';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport produce from 'immer';\r\nimport { FormReservationBudgetExperimentPicker } from 'app/components/Forms/ReservationBudgetExperimentPicker';\r\nimport { TrainingSignUpAdminAlertContent } from '../components/TrainingSignUpAdminAlertContent';\r\nimport { FormReservationTimePeriodPicker } from '../components/ReservationTimePicker';\r\nimport { adjustSchedulerEventTimes } from 'app/pages/CalendarPage/Scheduler/utils/adjustSchedulerEventTimes';\r\nimport { EquipmentsDataAssemblies } from '../components/EquipmentsDataAssemblies';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport {\r\n ListMessagesProps,\r\n SingleMessagesProps,\r\n} from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { ReservationWorkOrders } from '../components/ReservationWorkOrders';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FormWorkFlowBooking } from 'app/components/Forms/FormWorkFlowBooking';\r\nimport { PrintPDFSection } from 'app/components/PrintToPDF/PrintPDFSection';\r\nimport { selectPrintPDFSections } from 'app/components/PrintToPDF/slice/selectors';\r\nimport { ReadOnlyDetails } from '../components/ReadOnlyDetails';\r\nimport { ReservationRequestDetails } from '../components/RequestDetails';\r\nimport { formChangeHandler } from 'app/components/Forms/FormRender/IFormFieldSetting';\r\n\r\nexport interface ReservationFormProps {\r\n onSubmit: (\r\n item: ReservationDetailsState,\r\n customFormFiles: IFormFileValue[],\r\n originalFormFiles: IFormFileValue[],\r\n ) => void;\r\n initialValues: ReservationDetailsState;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n isUserGroupCoordinator?: boolean;\r\n repetitiveFormRef: React.MutableRefObject;\r\n globalSettings: GlobalSettingsType;\r\n customFormRef: React.MutableRefObject;\r\n formRef: React.MutableRefObject | null>;\r\n onEquipmentClicked?: (equipment: Entity) => void;\r\n onRestrictionsClick?: (equipment: Entity) => void;\r\n onOtherSrviceClick?: (service: IOtherServices) => void;\r\n onStatusChange?: (event: any, status: ReservationStatus) => void;\r\n onOfflineServiceClick?: (service: IOtherServices) => void;\r\n onAddBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n onWorkTypeClick: (\r\n event: IWorkOrderTypeDto,\r\n equipmentIds: number[],\r\n reservationId: number,\r\n ) => void;\r\n trainingSignUp?: boolean;\r\n trainingSessionEnabled?: boolean;\r\n editable?: boolean;\r\n endTimeEnabled?: boolean;\r\n cancelTransfer?: () => void;\r\n waitingTransferApproval?: boolean;\r\n transferToUser?: Entity | null;\r\n transferForId?: number;\r\n terminationEnabled?: boolean;\r\n handleTerminate: () => void;\r\n allowEditMultipleEquipments: boolean;\r\n useSidePanel: boolean;\r\n offlineServicesErrors: ErrorServices[];\r\n setError?: (error: ErrorServices) => void;\r\n assistedTrainingData: UserTrainingReservationData | null;\r\n allowOngoingModifications?: boolean;\r\n isCover?: boolean;\r\n print?: boolean;\r\n}\r\n\r\nexport const ReservationForm = React.memo(function ReservationForm({\r\n onSubmit,\r\n initialValues,\r\n bindSubmitForm,\r\n isAdmin,\r\n user,\r\n isUserGroupCoordinator,\r\n repetitiveFormRef,\r\n globalSettings,\r\n customFormRef,\r\n formRef,\r\n onEquipmentClicked,\r\n onRestrictionsClick,\r\n onStatusChange,\r\n onOfflineServiceClick,\r\n onWorkTypeClick,\r\n trainingSessionEnabled,\r\n editable,\r\n endTimeEnabled,\r\n trainingSignUp,\r\n cancelTransfer,\r\n waitingTransferApproval,\r\n transferToUser,\r\n transferForId,\r\n terminationEnabled,\r\n handleTerminate,\r\n allowEditMultipleEquipments,\r\n useSidePanel,\r\n onAddBatchClick,\r\n offlineServicesErrors,\r\n setError,\r\n assistedTrainingData,\r\n allowOngoingModifications,\r\n isCover,\r\n print,\r\n}: ReservationFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useReservationSlice();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const reservationSettings = useSelector(selectReservationSettings);\r\n const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n const fieldHandler = useSelector(selectFieldHandler);\r\n const requestedFor = useSelector(selectRequestedValueFor);\r\n const equipmentChangeState = useSelector(selectEquipmentChangeState);\r\n const equipmentChangeCompleted = useSelector(selectEquipmentChangeCompleted);\r\n const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n const savedOfflineServices = useSelector(selectSavedOfflineServices);\r\n const hasError = useSelector(selectReservationHasError);\r\n const isCloned = useSelector(selectCloneReservations);\r\n const insertUpdateCompleted = useSelector(selectReservationCompleted);\r\n const isEdit = useSelector(selectIsEdit);\r\n const savedForLater = useSelector(selectSavedForLater);\r\n const submitCalculateCredit = useSelector(selectSubmitCalculateCredit);\r\n const printPDFSections = useSelector(selectPrintPDFSections);\r\n\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const { newDate } = useSystemDate();\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const [durationErrors, setDurationErrors] = React.useState([]);\r\n const [permissionErrors, setPermissionErrors] = React.useState(\r\n [],\r\n );\r\n const [prerequisitErrors, setPrerequisitErrors] = React.useState(\r\n [],\r\n );\r\n const [customFormErrors, setCustomFormErrors] = React.useState(\r\n [],\r\n );\r\n const [otherErrors, setOtherErrors] = React.useState([]);\r\n const [otherWarnings, setOtherWarnings] = React.useState([]);\r\n const [otherInfo, setOtherInfo] = React.useState([]);\r\n const [otherSuccess, setOtherSuccess] = React.useState([]);\r\n const errorMessages = React.useMemo(() => {\r\n return [\r\n ...otherErrors,\r\n ...customFormErrors,\r\n ...prerequisitErrors,\r\n ...permissionErrors,\r\n ...durationErrors,\r\n ];\r\n }, [\r\n customFormErrors,\r\n durationErrors,\r\n otherErrors,\r\n permissionErrors,\r\n prerequisitErrors,\r\n ]);\r\n const customFormOnlyPrinted = React.useMemo(() => {\r\n return (\r\n printPDFSections?.some(f => f.id === 'CustomFormDetails' && f.checked) &&\r\n printPDFSections?.some(f => f.id === 'ReservationDetails' && !f.checked)\r\n );\r\n }, [printPDFSections]);\r\n const mandatoryServices = React.useMemo(() => {\r\n if (\r\n !!reservationSettings?.MandatoriesEquipments &&\r\n !isEdit &&\r\n reservationSettings.MandatoriesEquipments.length > 0\r\n ) {\r\n return reservationSettings.MandatoriesEquipments.map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n info: `Mandatory instrument for ${f.ParentName}`,\r\n };\r\n });\r\n } else return [];\r\n }, [isEdit, reservationSettings?.MandatoriesEquipments]);\r\n const resetAllErrors = () => {\r\n setDurationErrors([]);\r\n setPermissionErrors([]);\r\n setPrerequisitErrors([]);\r\n setOtherErrors([]);\r\n setCustomFormErrors([]);\r\n setOtherWarnings([]);\r\n setOtherInfo([]);\r\n setOtherSuccess([]);\r\n };\r\n const handleSubmit = (values: ReservationDetailsState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values, currentFormFiles, originalFormFiles);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetValueHandler());\r\n };\r\n const reserValueKey = () => {\r\n dispatch(actions.resetRequestedFor());\r\n };\r\n const saveRequestedValue = (value: any) => {\r\n dispatch(actions.getAnyValueSuccess(value));\r\n };\r\n /// func Help ///\r\n const addPrerquisitErrors = React.useCallback(\r\n (data: PrerequisitsResult, equipments: Entity[]) => {\r\n if (!data.IsValid) {\r\n prerquisitErrorsHandler(\r\n data,\r\n equipments,\r\n (nodes: IndexNode[]) => setPrerequisitErrors(nodes),\r\n onEquipmentClicked,\r\n onRestrictionsClick,\r\n );\r\n }\r\n },\r\n [onEquipmentClicked, onRestrictionsClick],\r\n );\r\n const addDurationErrors = React.useCallback(\r\n (data: string[], equipments: Entity[]) => {\r\n if (data.length > 0) {\r\n durationErrorsHandler(\r\n data,\r\n equipments,\r\n (nodes: IndexNode[]) => setDurationErrors(nodes),\r\n onRestrictionsClick,\r\n );\r\n }\r\n },\r\n [onRestrictionsClick],\r\n );\r\n const addOtheMessages = React.useCallback(\r\n (data: string[], type: 'warning' | 'error' | 'info' | 'success') => {\r\n if (data.length > 0) {\r\n otheMessagesHandler(data, type, (nodes: IndexNode[]) => {\r\n switch (type) {\r\n case 'error':\r\n setOtherErrors(() => nodes);\r\n break;\r\n case 'warning':\r\n setOtherWarnings(() => nodes);\r\n break;\r\n case 'info':\r\n setOtherInfo(() => nodes);\r\n break;\r\n case 'success':\r\n setOtherSuccess(() => nodes);\r\n break;\r\n }\r\n });\r\n }\r\n },\r\n [],\r\n );\r\n const addCustomFormErrors = React.useCallback((data: string[]) => {\r\n if (data.length > 0) {\r\n customFormErrorsHandler(data, (nodes: IndexNode[]) =>\r\n setCustomFormErrors(nodes),\r\n );\r\n }\r\n }, []);\r\n const addPermissionsErrors = React.useCallback(\r\n (data: string[], equipments: Entity[]) => {\r\n permissionsErrorsHandler(\r\n data,\r\n equipments,\r\n (nodes: IndexNode[]) => setPermissionErrors(nodes),\r\n onRestrictionsClick,\r\n );\r\n },\r\n [onRestrictionsClick],\r\n );\r\n\r\n /// Local State ///\r\n const [userGroupChanged, setUserGroupChanged] = React.useState(false);\r\n const [bookedbyChanged, setBookedByChanged] = React.useState(false);\r\n const [staffChanged, setStaffChanged] = React.useState(false);\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [accServiceChanged, setAccServiceChanged] = React.useState(false);\r\n const [budgetChanged, setBudgetChanged] = React.useState(false);\r\n const [statusChanged, setStatusChanged] = React.useState(false);\r\n const [startTimeChanged, setStartTimeChanged] = React.useState(false);\r\n const [endTimeChanged, setEndTimeChanged] = React.useState(false);\r\n const [tutoringChanged, setTutoringChanged] = React.useState(false);\r\n const [optionalChanged, setOptionalChanged] = React.useState(false);\r\n\r\n const [allIsValid, setAllIsValid] = React.useState(true);\r\n const [trainingSessionChanged, setTrainingSessionChanged] = React.useState(\r\n false,\r\n );\r\n const [originalFormFiles, setOriginalFormFiles] = React.useState<\r\n IFormFileValue[]\r\n >([]);\r\n const [currentFormFiles, setCurrentFormFiles] = React.useState<\r\n IFormFileValue[]\r\n >([]);\r\n\r\n const [firstInitEquipments, setFirstInitEquipments] = React.useState<\r\n number[]\r\n >(reservationSettings?.FirstInitEquipments || []);\r\n const [currentStatus, setCurrentStatus] = React.useState(\r\n initialValues.Status?.Id || 1,\r\n );\r\n const [isTrainingSignUp, setIsTrainingSignUp] = React.useState<\r\n boolean | undefined\r\n >(trainingSignUp);\r\n const changeOfflineServices = React.useCallback(\r\n (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n if (operation === 'add') {\r\n let addedServ = services.filter(\r\n f =>\r\n !savedOfflineServices.some(\r\n s => s.ServiceTypeID === f.ServiceTypeID,\r\n ),\r\n );\r\n dispatch(\r\n actions.setSavedOfflineServices([\r\n ...savedOfflineServices,\r\n ...addedServ,\r\n ]),\r\n );\r\n }\r\n if (operation === 'remove') {\r\n dispatch(\r\n actions.setSavedOfflineServices(\r\n savedOfflineServices.filter(f => {\r\n return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n }),\r\n ),\r\n );\r\n }\r\n if (operation === 'update') {\r\n dispatch(\r\n actions.setSavedOfflineServices(\r\n savedOfflineServices.map(f => {\r\n let service = services.find(\r\n s => s.ServiceTypeID === f.ServiceTypeID,\r\n );\r\n if (!!service && service !== null) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n ),\r\n );\r\n }\r\n },\r\n [actions, dispatch, savedOfflineServices],\r\n );\r\n /// memo ///\r\n const isServiceAdmin = React.useMemo(() => {\r\n return equipmentSettings?.IsAllAdmin;\r\n }, [equipmentSettings?.IsAllAdmin]);\r\n\r\n const readonly = React.useMemo(() => {\r\n return (\r\n equipmentChangeCompleted === false ||\r\n asyncChangeLoading === true ||\r\n waitingTransferApproval === true\r\n );\r\n }, [asyncChangeLoading, equipmentChangeCompleted, waitingTransferApproval]);\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n globalSettings.fundingTypeBudgetEnabled\r\n );\r\n }, [globalSettings]);\r\n const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n return !!equipmentSettings\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n !equipmentSettings.HasHideProjects &&\r\n !equipmentSettings.HasConflictProjects &&\r\n equipmentSettings.BudgetsTurnedOn\r\n : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n }, [\r\n equipmentSettings,\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n ]);\r\n\r\n const userGroupVisible = React.useMemo(() => {\r\n return (\r\n isServiceAdmin &&\r\n (!isEdit ||\r\n (isEdit && !globalSettings.DoNotAllowReservationUserChangeByStaff)) &&\r\n !ReservationUserGroupGroupByBudgetUserGroup\r\n );\r\n }, [\r\n isServiceAdmin,\r\n isEdit,\r\n globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n ReservationUserGroupGroupByBudgetUserGroup,\r\n ]);\r\n const userVisible = React.useMemo(() => {\r\n return (\r\n (isServiceAdmin || isUserGroupCoordinator) &&\r\n (!isEdit ||\r\n (isEdit && !globalSettings.DoNotAllowReservationUserChangeByStaff))\r\n );\r\n }, [\r\n isServiceAdmin,\r\n isUserGroupCoordinator,\r\n isEdit,\r\n globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n ]);\r\n const userProfileVisible = React.useMemo(() => {\r\n return (\r\n (isServiceAdmin || isUserGroupCoordinator) &&\r\n isEdit &&\r\n globalSettings.DoNotAllowReservationUserChangeByStaff\r\n );\r\n }, [\r\n isServiceAdmin,\r\n isUserGroupCoordinator,\r\n isEdit,\r\n globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n ]);\r\n const tutoringVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.assistedReservationsEnabled &&\r\n globalSettings.tutoringModulesEnabled &&\r\n equipmentSettings?.IsEquipmentTutoring &&\r\n !isTrainingSignUp\r\n );\r\n }, [\r\n equipmentSettings?.IsEquipmentTutoring,\r\n globalSettings.assistedReservationsEnabled,\r\n globalSettings.tutoringModulesEnabled,\r\n isTrainingSignUp,\r\n ]);\r\n const tutoringEnabled = React.useMemo(() => {\r\n let tutoringAllowed =\r\n globalSettings.assistedReservationsEnabled &&\r\n globalSettings.tutoringModulesEnabled &&\r\n equipmentSettings?.IsEquipmentTutoring &&\r\n !isTrainingSignUp;\r\n let forceTutoring =\r\n equipmentSettings?.ForceTutoring || reservationSettings?.IsForceTutoring;\r\n let hasValidTraining =\r\n assistedTrainingData === null\r\n ? false\r\n : assistedTrainingData.Equipments.some(f => f.RequiresAdminApproval)\r\n ? false\r\n : isEdit\r\n ? editable\r\n : true;\r\n if (!isEdit) {\r\n return (\r\n (tutoringAllowed && (isServiceAdmin || hasValidTraining)) ||\r\n !forceTutoring\r\n );\r\n } else {\r\n return tutoringAllowed && forceTutoring\r\n ? isServiceAdmin || hasValidTraining\r\n : editable;\r\n }\r\n }, [\r\n globalSettings.assistedReservationsEnabled,\r\n globalSettings.tutoringModulesEnabled,\r\n equipmentSettings?.IsEquipmentTutoring,\r\n equipmentSettings?.ForceTutoring,\r\n isTrainingSignUp,\r\n reservationSettings?.IsForceTutoring,\r\n assistedTrainingData,\r\n isEdit,\r\n editable,\r\n isServiceAdmin,\r\n ]);\r\n const trainingSessionVisible = React.useMemo(() => {\r\n return (\r\n trainingSessionEnabled &&\r\n (reservationSettings?.TrainingSessionOnly || isTrainingSignUp)\r\n );\r\n }, [\r\n reservationSettings?.TrainingSessionOnly,\r\n trainingSessionEnabled,\r\n isTrainingSignUp,\r\n ]);\r\n const workflowBookingVisible = React.useMemo(() => {\r\n return globalSettings.AllowWorkflowBooking;\r\n }, [globalSettings.AllowWorkflowBooking]);\r\n const workflowBookingEnabled = React.useMemo(() => {\r\n return (\r\n workflowBookingVisible &&\r\n (globalSettings.ModifyReservationNameForUsers || isAdmin)\r\n );\r\n }, [\r\n globalSettings.ModifyReservationNameForUsers,\r\n isAdmin,\r\n workflowBookingVisible,\r\n ]);\r\n const trainingSignUpVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.trainingSessionEnabled &&\r\n !equipmentSettings?.HideTrainingSession &&\r\n reservationSettings?.HasTrainingSession\r\n );\r\n }, [\r\n globalSettings.trainingSessionEnabled,\r\n equipmentSettings?.HideTrainingSession,\r\n reservationSettings?.HasTrainingSession,\r\n ]);\r\n const staffVisible = React.useMemo(() => {\r\n return (\r\n equipmentSettings?.StaffUserVisibleAllways ||\r\n (equipmentSettings?.StaffUserVisibleOnPending &&\r\n currentStatus === ReservationStatus.Pending)\r\n );\r\n }, [\r\n equipmentSettings?.StaffUserVisibleAllways,\r\n equipmentSettings?.StaffUserVisibleOnPending,\r\n currentStatus,\r\n ]);\r\n const reservationCollaboratorsVisible = React.useMemo(() => {\r\n return equipmentSettings?.AllowReservationCollaborators;\r\n }, [equipmentSettings?.AllowReservationCollaborators]);\r\n const ForceFullDayReservations = React.useMemo(\r\n () => equipmentSettings?.ForceFullDayReservations,\r\n [equipmentSettings?.ForceFullDayReservations],\r\n );\r\n const budgetExperimentVisible = React.useMemo(\r\n () => equipmentSettings?.budgetExperimentVisible,\r\n [equipmentSettings?.budgetExperimentVisible],\r\n );\r\n const staffRequired = React.useMemo(() => {\r\n return (\r\n equipmentSettings?.StaffUserRequiredAlwais ||\r\n (equipmentSettings?.StaffUserRequiredOnPending &&\r\n currentStatus === ReservationStatus.Pending)\r\n );\r\n }, [\r\n equipmentSettings?.StaffUserRequiredAlwais,\r\n equipmentSettings?.StaffUserRequiredOnPending,\r\n currentStatus,\r\n ]);\r\n const warningMessages: IndexNode[] = React.useMemo(() => {\r\n let nodes: IndexNode[] = [];\r\n if (firstInitEquipments.length > 0) {\r\n nodes.push({\r\n index: 'notMoreThenOneIndex',\r\n node: (\r\n \r\n {t(translations.AvailableInstrumentsMessage) as string}\r\n \r\n ),\r\n });\r\n }\r\n if (isEdit) {\r\n if (\r\n currentStatus !== ReservationStatus.Cancelled &&\r\n currentStatus !== ReservationStatus.CancelledByAdmin\r\n ) {\r\n if (\r\n initialValues.Tutoring &&\r\n currentStatus === ReservationStatus.Pending\r\n ) {\r\n nodes.push({\r\n index: 'pendingApproval',\r\n node: (\r\n \r\n \r\n {t(translations.ReservationPendingApproval) as string}\r\n \r\n {isServiceAdmin && (\r\n \r\n !!onStatusChange &&\r\n onStatusChange(e, ReservationStatus.Approved)\r\n }\r\n >\r\n {t(translations.Approve) as string}\r\n \r\n )}\r\n \r\n {t(translations.res_wrn_NewPendingReservation) as string}\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n } else if (currentStatus === ReservationStatus.PendingCoord) {\r\n nodes.push({\r\n index: 'pendingCoordApproval',\r\n node: (\r\n \r\n \r\n {t(translations.RequireGroupCoordApprovalMessage) as string}\r\n \r\n \r\n {t(translations.res_wrn_NewPendingCoordReservation) as string}\r\n \r\n {isUserGroupCoordinator && (\r\n \r\n !!onStatusChange &&\r\n onStatusChange(e, ReservationStatus.Approved)\r\n }\r\n >\r\n {t(translations.Approve) as string}\r\n \r\n )}\r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (\r\n equipmentSettings?.DraftSaveForLater &&\r\n currentStatus === ReservationStatus.Draft\r\n ) {\r\n nodes.push({\r\n index: 'draftReservation',\r\n node: (\r\n \r\n \r\n {t(translations.res_wrn_DraftReservation) as string}\r\n \r\n {(isServiceAdmin ||\r\n initialValues.BookedBy?.Id === user?.Id) && (\r\n \r\n !!onStatusChange &&\r\n onStatusChange(e, ReservationStatus.Approved)\r\n }\r\n >\r\n {t(translations.MakeFirm) as string}\r\n \r\n )}\r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n }\r\n }\r\n if (\r\n !isEdit &&\r\n initialValues.TransferFromId !== null &&\r\n initialValues.TransferFromId !== undefined\r\n ) {\r\n nodes.push({\r\n index: 'transferWarning',\r\n node: (\r\n \r\n \r\n {t(translations.Transfer) as string}\r\n \r\n \r\n {t(translations.ReservationTransferMessage) as string}\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (\r\n !isEdit &&\r\n (equipmentSettings?.RequireUserGroupCoordApproval ||\r\n user?.RequireUserGroupCoordApproval)\r\n ) {\r\n nodes.push({\r\n index: 'pendingCoordApproval',\r\n node: (\r\n \r\n \r\n {t(translations.RequireGroupCoordApprovalMessage) as string}\r\n \r\n \r\n {t(translations.res_wrn_NewPendingCoordReservation) as string}\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (\r\n reservationSettings?.TrainingSessionOnly === true &&\r\n reservationSettings?.HasTrainingSession !== true\r\n ) {\r\n nodes.push({\r\n index: 'trainingSessionMissingWarning',\r\n node: (\r\n \r\n \r\n {t(translations.TrainingSession) as string}\r\n \r\n \r\n {t(translations.TrainingSessionsRes_warning) as string}\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n return [...nodes, ...otherWarnings];\r\n }, [\r\n currentStatus,\r\n equipmentSettings?.DraftSaveForLater,\r\n equipmentSettings?.RequireUserGroupCoordApproval,\r\n firstInitEquipments.length,\r\n initialValues.BookedBy?.Id,\r\n initialValues.TransferFromId,\r\n initialValues.Tutoring,\r\n isEdit,\r\n isServiceAdmin,\r\n isUserGroupCoordinator,\r\n onStatusChange,\r\n otherWarnings,\r\n reservationSettings?.HasTrainingSession,\r\n reservationSettings?.TrainingSessionOnly,\r\n t,\r\n user?.Id,\r\n user?.RequireUserGroupCoordApproval,\r\n ]);\r\n const infoMessages = React.useMemo(() => {\r\n let nodes: IndexNode[] = [];\r\n if (\r\n globalSettings.assistedReservationsEnabled &&\r\n !equipmentSettings?.IsAllAdmin &&\r\n equipmentSettings?.ForceTutoring &&\r\n !isEdit &&\r\n currentStatus === ReservationStatus.Pending\r\n ) {\r\n nodes.push({\r\n index: 'asiistedTutorInfo',\r\n node: (\r\n \r\n {`${\r\n t(translations.TutoringAssistedReservation) as string\r\n } - ${getSingleReservationStatus(currentStatus).Name}`}\r\n \r\n {\r\n t(\r\n translations.AssistedReservationsPendingApprovalInfo,\r\n ) as string\r\n }\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (\r\n isEdit &&\r\n transferToUser !== null &&\r\n transferToUser !== undefined &&\r\n waitingTransferApproval === true\r\n ) {\r\n nodes.push({\r\n index: 'waitingTraferInfo',\r\n node: (\r\n \r\n \r\n {t(translations.TransferReservation) as string}\r\n \r\n \r\n {(t(translations.TransferredToDetailsMessage) as string).replace(\r\n '{0}',\r\n transferToUser?.Name || '',\r\n )}\r\n \r\n \r\n {editable && (\r\n {\r\n !!cancelTransfer && cancelTransfer();\r\n }}\r\n >\r\n {t(translations.CancelTransfer) as string}\r\n \r\n )}\r\n\r\n {(isServiceAdmin ||\r\n initialValues.TransferredTo?.Id === user?.Id) && (\r\n \r\n {t(translations.TakeOverTransfer) as string}\r\n \r\n )}\r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (isEdit && terminationEnabled) {\r\n nodes.push({\r\n index: 'terminationInfo',\r\n node: (\r\n \r\n \r\n {t(translations.NotUsingThisReservation)}\r\n \r\n {/* {t(translations.NotUsingThisReservation)} */}\r\n \r\n \r\n \r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n if (trainingSessionVisible && isServiceAdmin) {\r\n let reservation = formRef.current?.values || initialValues;\r\n let session =\r\n reservation.TrainingSession !== null\r\n ? (reservation.TrainingSession as ITrainingSessionDto)\r\n : null;\r\n if (session !== null && trainingSignUp) {\r\n nodes.push({\r\n index: 'trainingSignUps',\r\n showMore: false,\r\n node: (\r\n
    \r\n \r\n
    \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n }\r\n if (!isEdit) {\r\n const assemblyPartsSelected = formRef.current?.values.EquipmentsData.some(\r\n service => (service as IReservationEquipmentDto)?.AssemblyId !== null,\r\n );\r\n if (assemblyPartsSelected) {\r\n nodes.push({\r\n index: 'index',\r\n showMore: false,\r\n node: (\r\n <>{t(translations.ReservationSidePanelAssemblyPart_ErrorMessage)}\r\n ),\r\n });\r\n }\r\n }\r\n\r\n return [...nodes, ...otherInfo];\r\n }, [\r\n cancelTransfer,\r\n currentStatus,\r\n editable,\r\n equipmentSettings?.ForceTutoring,\r\n equipmentSettings?.IsAllAdmin,\r\n equipmentSettings?.IsLoanDesc,\r\n formRef,\r\n globalSettings.assistedReservationsEnabled,\r\n handleTerminate,\r\n initialValues,\r\n isEdit,\r\n isServiceAdmin,\r\n otherInfo,\r\n reservationSettings?.BaseEquipment?.Id,\r\n t,\r\n terminationEnabled,\r\n trainingSessionVisible,\r\n trainingSignUp,\r\n transferToUser,\r\n user?.Id,\r\n waitingTransferApproval,\r\n ]);\r\n const successMessages = React.useMemo(() => {\r\n let nodes: IndexNode[] = [];\r\n if (\r\n globalSettings.assistedReservationsEnabled &&\r\n equipmentSettings?.ForceTutoring &&\r\n isEdit &&\r\n currentStatus === ReservationStatus.Approved\r\n ) {\r\n nodes.push({\r\n index: 'asiistedTutorApproved',\r\n node: (\r\n \r\n {t(translations.ReservationAssistedApproved) as string}\r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n return [...nodes, ...otherSuccess];\r\n }, [\r\n currentStatus,\r\n equipmentSettings?.ForceTutoring,\r\n globalSettings.assistedReservationsEnabled,\r\n isEdit,\r\n otherSuccess,\r\n t,\r\n ]);\r\n const equipmentsChangeHandler = React.useCallback(\r\n (\r\n values: ReservationDetailsState,\r\n changeStatus?: boolean,\r\n selectedEqs?: IReservationEquipmentDto[],\r\n ) => {\r\n let allEquipments = !!selectedEqs\r\n ? selectedEqs\r\n : [\r\n ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ...((values.OptionalsEquipments.filter(\r\n f => f.checked === true,\r\n ) as Entity[]) as IReservationEquipmentDto[]),\r\n ];\r\n dispatch(\r\n actions.extendEquipmentSettingsState({\r\n equipments: allEquipments,\r\n mandatories: [],\r\n accServices: values.AccServices as IEquipmentAccServiceDto[],\r\n globalSettings: globalSettings,\r\n settings: equipmentSettings,\r\n }),\r\n );\r\n const payload: EquipmentsChangeStateParameters = {\r\n AccServices: values.AccServices.map(f => f.Id),\r\n Equipments: allEquipments.map(f => f.Id),\r\n ReservationId: (values.Id ?? 0) > 0 ? values.Id : null,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartTime),\r\n { representation: 'complete' },\r\n ),\r\n End: dateUtils.formatISO(dateUtils.dateOrStringToDate(values.EndTime), {\r\n representation: 'complete',\r\n }),\r\n BookedBy: values.BookedBy?.Id || null,\r\n Status: values.Status?.Id || 1,\r\n TrainingSignUp: values.TrainingSignUp,\r\n Tutoring: values.Tutoring,\r\n ADGroup: values.ADGroup?.Id || user?.ActiveUserGroup?.Id || null,\r\n FundingTypeId: values.FundingType?.Id || 0,\r\n CheckStatus: changeStatus || false,\r\n TrainingSessionId: values.TrainingSession?.Id || null,\r\n Remarks: values.Remarks || null,\r\n BudgetId: values.Budget?.Id || null,\r\n CheckSession: !equipmentSettings?.HideTrainingSession,\r\n FullDayReservation: values.FullDayReservation,\r\n };\r\n resetAllErrors();\r\n dispatch(\r\n actions.initValidationData({\r\n parameters: payload,\r\n warnings: [],\r\n errors: [],\r\n }),\r\n );\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n equipmentSettings,\r\n globalSettings,\r\n reservationSettings?.MandatoriesEquipments,\r\n user?.ActiveUserGroup?.Id,\r\n ],\r\n );\r\n const extendStaffMandatoryEquipment = React.useCallback(\r\n (staff: IReservationEquipmentDto | null) => {\r\n dispatch(\r\n actions.extendReservationSettings({\r\n StaffMandatoryEquipment: staff,\r\n }),\r\n );\r\n },\r\n [actions, dispatch],\r\n );\r\n const extendMandatoryEquipments = React.useCallback(\r\n (mandatories: IMandatoryEquipmentsDto[]) => {\r\n dispatch(\r\n actions.extendReservationSettings({\r\n MandatoriesEquipments: mandatories,\r\n }),\r\n );\r\n },\r\n [actions, dispatch],\r\n );\r\n const initStaffReservation = React.useCallback(\r\n (staffEquipmentId: number, values: ReservationDetailsState) => {\r\n resetAllErrors();\r\n dispatch(\r\n actions.initReservation({\r\n query: {\r\n id: undefined,\r\n selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(values.StartTime),\r\n ),\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(values.EndTime),\r\n ),\r\n tsid:\r\n values.TrainingSession === null\r\n ? undefined\r\n : values.TrainingSession.Id.toString(),\r\n remarks: values.Remarks,\r\n accid: values.AccServices.map(f => f.Id).join(','),\r\n singleClick: undefined,\r\n duration: undefined,\r\n ug: values.ADGroup?.Id,\r\n un: values.BookedBy?.Id,\r\n ft:\r\n values.FundingType === null || values.FundingType === undefined\r\n ? undefined\r\n : values.FundingType.Id.toString(),\r\n srid: String(reservationSettings?.AssignToServiceRequestId),\r\n srrid: String(reservationSettings?.AssignToServiceRequestRowIds),\r\n srsid: String(reservationSettings?.AssignToServiceRequestSampleIds),\r\n sampleRunId: undefined,\r\n defaultMulti: undefined,\r\n resIdTransferredFrom: values.TransferFromId?.toString(),\r\n source: undefined,\r\n UpdateToNow: undefined,\r\n terminated: undefined,\r\n resourceChanged: true.toString(),\r\n staffEquipmentId: staffEquipmentId.toString(),\r\n staffUser: values.StaffUser?.Id,\r\n } as ReservationQueryStringParameters,\r\n globalSettings: globalSettings,\r\n prevState: values,\r\n }),\r\n );\r\n setFirstInitEquipments([]);\r\n setServiceChanged(false);\r\n setAccServiceChanged(false);\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n globalSettings,\r\n reservationSettings?.AssignToServiceRequestId,\r\n reservationSettings?.AssignToServiceRequestRowIds,\r\n reservationSettings?.AssignToServiceRequestSampleIds,\r\n ],\r\n );\r\n const initTrainingSession = React.useCallback(\r\n (\r\n trainingSessionData: TrainingSessionResult,\r\n values: ReservationDetailsState,\r\n ) => {\r\n resetAllErrors();\r\n dispatch(\r\n actions.initReservation({\r\n query: {\r\n id: undefined,\r\n selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(trainingSessionData.Start),\r\n ),\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(trainingSessionData.End),\r\n ),\r\n tsid:\r\n trainingSessionData.TrainingSessionId === null\r\n ? undefined\r\n : trainingSessionData.TrainingSessionId.toString(),\r\n remarks: values.Remarks,\r\n accid: undefined,\r\n singleClick: undefined,\r\n duration: undefined,\r\n ug: values.ADGroup?.Id,\r\n un: values.BookedBy?.Id,\r\n ft:\r\n values.FundingType === null || values.FundingType === undefined\r\n ? undefined\r\n : values.FundingType.Id.toString(),\r\n srid: undefined,\r\n srrid: undefined,\r\n srsid: undefined,\r\n sampleRunId: undefined,\r\n defaultMulti: undefined,\r\n resIdTransferredFrom: undefined,\r\n source: undefined,\r\n UpdateToNow: undefined,\r\n terminated: undefined,\r\n resourceChanged: true.toString(),\r\n staffEquipmentId: undefined,\r\n staffUser: trainingSessionData.StaffUser,\r\n } as ReservationQueryStringParameters,\r\n globalSettings: globalSettings,\r\n prevState: values,\r\n }),\r\n );\r\n setFirstInitEquipments([]);\r\n setServiceChanged(false);\r\n setAccServiceChanged(false);\r\n },\r\n [actions, dispatch, globalSettings],\r\n );\r\n const setStaffEquipmentRestricted = React.useCallback(\r\n (staffUserName: string) => {\r\n setOtherErrors(() => [\r\n {\r\n index: 3,\r\n node: (\r\n \r\n \r\n {(t(\r\n translations.err_res_StaffUserEquipmentRestricted,\r\n ) as string).replace('{0}', staffUserName)}\r\n \r\n \r\n ),\r\n },\r\n ]);\r\n },\r\n [t],\r\n );\r\n const staffChangeHandler = React.useCallback(\r\n (\r\n values: ReservationDetailsState,\r\n setFieldValue: FormikHelpers['setFieldValue'],\r\n ) => {\r\n return staffUserChangeHandler(\r\n values,\r\n isEdit,\r\n setFieldValue,\r\n equipmentsChangeHandler,\r\n extendStaffMandatoryEquipment,\r\n extendMandatoryEquipments,\r\n initStaffReservation,\r\n setStaffEquipmentRestricted,\r\n reservationSettings,\r\n );\r\n },\r\n [\r\n equipmentsChangeHandler,\r\n extendMandatoryEquipments,\r\n extendStaffMandatoryEquipment,\r\n initStaffReservation,\r\n isEdit,\r\n reservationSettings,\r\n setStaffEquipmentRestricted,\r\n ],\r\n );\r\n const multipleEquipmentsChangeHandler = React.useCallback(\r\n (\r\n values: ReservationDetailsState,\r\n setValue: (\r\n field: string,\r\n value: any,\r\n shouldValidate?: boolean | undefined,\r\n ) => void,\r\n ) => {\r\n let equipments = values.EquipmentsData as IReservationEquipmentDto[];\r\n let mandatories = (equipments.length > 0 &&\r\n equipments.some(\r\n f => !!f.MandatoriesEquipments && f.MandatoriesEquipments.length > 0,\r\n )\r\n ? equipments.reduce((acc, next) => {\r\n return acc;\r\n }, equipments.filter(f => !!f.MandatoriesEquipments && f.MandatoriesEquipments.length > 0)[0].MandatoriesEquipments)\r\n : []\r\n ).filter(f => !equipments.some(s => f.Id === s.Id));\r\n /**\r\n * Gets the mandatory offline service types attached to reservation services.\r\n * @param services services selected for the reservation\r\n * @returns array of mandatory offline service type details\r\n */\r\n const getMandatoryOfflineServices = (\r\n services: IReservationEquipmentDto[],\r\n ) => {\r\n const MandatoryOfflineServicesOnTrainingSignUps =\r\n globalSettings.MandatoryOfflineServicesOnTrainingSignUps ||\r\n !values.TrainingSignUp;\r\n /**\r\n * If the MandatoryOfflineServicesOnTrainingSignUps system setting is turned off, then no offline service types should be mandatory for training signups\r\n */\r\n\r\n const initialValue: Pick<\r\n ReservationSettingsState,\r\n 'OfflineMandatory' | 'OfflineOptional'\r\n > = {\r\n OfflineMandatory: [],\r\n OfflineOptional: [],\r\n };\r\n const result = combineOfflineServiceTypes(services)?.reduce(\r\n (previousValue, currentValue) => {\r\n const mandatory =\r\n MandatoryOfflineServicesOnTrainingSignUps && currentValue;\r\n\r\n (mandatory\r\n ? previousValue.OfflineMandatory\r\n : previousValue.OfflineOptional\r\n ).push((currentValue as unknown) as IOtherServices);\r\n return previousValue;\r\n },\r\n initialValue,\r\n );\r\n return result;\r\n };\r\n if (mandatories.length > 0) {\r\n (async () => {\r\n try {\r\n const data = (await initEquipmentsData(\r\n mandatories.map(f => f.Id).join(','),\r\n 'AccServices,OfflineServices,StaffUserSelection,MandatoriesEquipments,OptionalsEquipments',\r\n )) as IMandatoryEquipmentsDto[];\r\n\r\n const allEquipments = [\r\n ...values.EquipmentsData,\r\n ...data,\r\n ] as IReservationEquipmentDto[];\r\n dispatch(\r\n actions.extendReservationSettings({\r\n MandatoriesEquipments: data,\r\n ...getMandatoryOfflineServices(allEquipments),\r\n }),\r\n );\r\n\r\n setValue('EquipmentsData', allEquipments);\r\n equipmentsChangeHandler(\r\n Object.assign({}, values, {\r\n EquipmentsData: allEquipments,\r\n }),\r\n true,\r\n );\r\n } catch {}\r\n })();\r\n } else {\r\n dispatch(\r\n actions.extendReservationSettings({\r\n MandatoriesEquipments: mandatories,\r\n ...getMandatoryOfflineServices(equipments),\r\n }),\r\n );\r\n equipmentsChangeHandler(\r\n Object.assign({}, values, {\r\n EquipmentsData: equipments,\r\n }),\r\n true,\r\n );\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n equipmentsChangeHandler,\r\n globalSettings.MandatoryOfflineServicesOnTrainingSignUps,\r\n ],\r\n );\r\n const warnOnTrainingSession = React.useCallback(\r\n (data: TrainingSessionResult | null, values: ReservationDetailsState) => {\r\n trainingSessionChangeHandler(\r\n data,\r\n (nodes: IndexNode[]) => setOtherWarnings(nodes),\r\n (data, values) => {\r\n initTrainingSession(data, values);\r\n setIsTrainingSignUp(true);\r\n },\r\n values,\r\n );\r\n },\r\n [initTrainingSession],\r\n );\r\n const handleFormChange = React.useCallback<\r\n formChangeHandler\r\n >(\r\n (\r\n values,\r\n isValid,\r\n dirty,\r\n setFieldValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (staffChanged) {\r\n staffChangeHandler(values, setFieldValue);\r\n setStaffChanged(false);\r\n }\r\n if ((serviceChanged || accServiceChanged) && !isEdit) {\r\n resetAllErrors();\r\n dispatch(\r\n actions.initReservation({\r\n query: {\r\n id: undefined,\r\n selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(values.StartTime),\r\n ),\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(values.EndTime),\r\n ),\r\n tsid:\r\n values.TrainingSession === null\r\n ? undefined\r\n : values.TrainingSession.Id.toString(),\r\n remarks: values.Remarks,\r\n accid: values.AccServices.map(f => f.Id).join(','),\r\n singleClick: undefined,\r\n duration: undefined,\r\n ug: values.ADGroup?.Id,\r\n un: values.BookedBy?.Id,\r\n ft:\r\n values.FundingType === null || values.FundingType === undefined\r\n ? undefined\r\n : values.FundingType.Id.toString(),\r\n srid: String(reservationSettings?.AssignToServiceRequestId),\r\n srrid: String(reservationSettings?.AssignToServiceRequestRowIds),\r\n srsid: String(\r\n reservationSettings?.AssignToServiceRequestSampleIds,\r\n ),\r\n sampleRunId: values.SampleRunId?.toString(),\r\n defaultMulti: undefined,\r\n resIdTransferredFrom: values.TransferFromId?.toString(),\r\n source: undefined,\r\n UpdateToNow: undefined,\r\n terminated: undefined,\r\n resourceChanged: true.toString(),\r\n staffEquipmentId: (\r\n (values.StaffUser as IUserFilterDto)?.StaffEquipmentId ??\r\n undefined\r\n )?.toString(),\r\n staffUser: values.StaffUser?.Id,\r\n } as ReservationQueryStringParameters,\r\n globalSettings: globalSettings,\r\n prevState: values,\r\n }),\r\n );\r\n setFirstInitEquipments([]);\r\n setServiceChanged(false);\r\n setAccServiceChanged(false);\r\n setStaffChanged(false);\r\n }\r\n if (serviceChanged && isEdit && allowEditMultipleEquipments) {\r\n multipleEquipmentsChangeHandler(values, setFieldValue);\r\n setServiceChanged(false);\r\n }\r\n if (userGroupChanged) {\r\n console.log('User Group Changed', values.ADGroup);\r\n if (!isMember(values.BookedBy, values.ADGroup)) {\r\n setFieldValue('BookedBy', null);\r\n }\r\n setDurationErrors([]);\r\n setPermissionErrors([]);\r\n setPrerequisitErrors([]);\r\n setUserGroupChanged(false);\r\n }\r\n if (bookedbyChanged) {\r\n console.log('BookedBy Changed', values.BookedBy);\r\n if (values.BookedBy !== null) {\r\n equipmentsChangeHandler(values, true);\r\n }\r\n resetAllErrors();\r\n setBookedByChanged(false);\r\n }\r\n if (budgetChanged) {\r\n console.log('Budget Changed', values.Budget);\r\n setBudgetChanged(false);\r\n }\r\n if (statusChanged) {\r\n setCurrentStatus(values.Status?.Id || 1);\r\n console.log('Status Changed', values.Status);\r\n setStatusChanged(false);\r\n }\r\n if (startTimeChanged) {\r\n resetAllErrors();\r\n console.log('Start Time Changed', values.StartTime);\r\n setStartTimeChanged(false);\r\n }\r\n if (endTimeChanged) {\r\n resetAllErrors();\r\n console.log('End Time Changed', values.EndTime);\r\n setEndTimeChanged(false);\r\n }\r\n if (tutoringChanged) {\r\n console.log('Tutoring Changed', values.Tutoring);\r\n if (values.Tutoring === true) {\r\n setFieldValue(\r\n 'Status',\r\n getSingleReservationStatus(ReservationStatus.Pending),\r\n );\r\n setCurrentStatus(\r\n getSingleReservationStatus(ReservationStatus.Pending).Id,\r\n );\r\n } else {\r\n setFieldValue(\r\n 'Status',\r\n getSingleReservationStatus(ReservationStatus.Approved),\r\n );\r\n setCurrentStatus(\r\n getSingleReservationStatus(ReservationStatus.Approved).Id,\r\n );\r\n if (equipmentSettings?.StaffUserVisibleOnPending) {\r\n setFieldValue('StaffUser', null);\r\n }\r\n }\r\n setTutoringChanged(false);\r\n }\r\n if (optionalChanged) {\r\n setOtherErrors([]);\r\n equipmentsChangeHandler(values);\r\n console.log('Optional Changed');\r\n setOptionalChanged(false);\r\n }\r\n if (trainingSessionChanged) {\r\n if (!!values.TrainingSession && values.TrainingSession !== null) {\r\n setFieldValue(\r\n 'StartTime',\r\n (values.TrainingSession as ITrainingSessionDto).StartDate,\r\n );\r\n setFieldValue(\r\n 'EndTime',\r\n (values.TrainingSession as ITrainingSessionDto).EndDate,\r\n );\r\n setFieldValue('StaffUser', {\r\n Id: (values.TrainingSession as ITrainingSessionDto).Trainer,\r\n Name: (values.TrainingSession as ITrainingSessionDto).TrainerName,\r\n });\r\n }\r\n setTrainingSessionChanged(false);\r\n }\r\n },\r\n [\r\n staffChanged,\r\n serviceChanged,\r\n accServiceChanged,\r\n isEdit,\r\n allowEditMultipleEquipments,\r\n userGroupChanged,\r\n bookedbyChanged,\r\n budgetChanged,\r\n statusChanged,\r\n startTimeChanged,\r\n endTimeChanged,\r\n tutoringChanged,\r\n optionalChanged,\r\n trainingSessionChanged,\r\n staffChangeHandler,\r\n dispatch,\r\n actions,\r\n reservationSettings?.AssignToServiceRequestId,\r\n reservationSettings?.AssignToServiceRequestRowIds,\r\n reservationSettings?.AssignToServiceRequestSampleIds,\r\n globalSettings,\r\n multipleEquipmentsChangeHandler,\r\n equipmentsChangeHandler,\r\n equipmentSettings?.StaffUserVisibleOnPending,\r\n ],\r\n );\r\n const validateForms = React.useCallback((isValid: boolean) => {\r\n setAllIsValid(isValid);\r\n }, []);\r\n\r\n /// useEffects\r\n React.useEffect(() => {\r\n if (formRef.current) {\r\n formRef.current.validateForm();\r\n }\r\n }, [formRef]);\r\n React.useEffect(() => {\r\n if (!!equipmentChangeState) {\r\n console.log('equipment settings: ', equipmentSettings);\r\n if (\r\n !!equipmentChangeState.CustomForms &&\r\n equipmentChangeState.CustomForms.ErrorMessages.length > 0\r\n ) {\r\n addCustomFormErrors(equipmentChangeState.CustomForms.ErrorMessages);\r\n }\r\n\r\n if (equipmentChangeState.ErrorMessages.length > 0) {\r\n addOtheMessages(equipmentChangeState.ErrorMessages, 'error');\r\n }\r\n if (equipmentChangeState.WarningMessages.length > 0) {\r\n addOtheMessages(equipmentChangeState.ErrorMessages, 'warning');\r\n }\r\n if (equipmentChangeState.TrainingSessionData !== null) {\r\n if (equipmentChangeState.TrainingSessionData.HasTrainingSession) {\r\n setOtherErrors([]);\r\n warnOnTrainingSession(\r\n equipmentChangeState.TrainingSessionData,\r\n formRef.current?.values || initialValues,\r\n );\r\n }\r\n }\r\n let budget: IBudgetFilterDto | null = null;\r\n let userGroup: Entity | null = null;\r\n if (equipmentSettings?.BudgetVisible && !isEdit) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'Budget',\r\n fieldValue: equipmentChangeState.DefaultBudget,\r\n }),\r\n );\r\n if (\r\n fundingTypeVisible &&\r\n equipmentChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n equipmentChangeState.DefaultBudget?.FundingTypeId !== null\r\n ) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'FundingType',\r\n fieldValue: getSingleInvoiceFundingType(\r\n equipmentChangeState.DefaultBudget?.FundingTypeId,\r\n ),\r\n }),\r\n );\r\n }\r\n budget = equipmentChangeState.DefaultBudget;\r\n if (\r\n ReservationUserGroupGroupByBudgetUserGroup &&\r\n equipmentChangeState.DefaultBudget !== null\r\n ) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'ADGroup',\r\n fieldValue: {\r\n Id: equipmentChangeState.DefaultBudget.UserGroupId,\r\n Name: equipmentChangeState.DefaultBudget.UserGroupName,\r\n },\r\n }),\r\n );\r\n userGroup = {\r\n Id: equipmentChangeState?.DefaultBudget?.UserGroupId ?? '',\r\n Name: equipmentChangeState?.DefaultBudget?.UserGroupName ?? '',\r\n };\r\n }\r\n }\r\n if (equipmentChangeState.StatusChange !== null) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'Status',\r\n fieldValue: getSingleReservationStatus(\r\n equipmentChangeState.StatusChange.Status,\r\n ),\r\n }),\r\n );\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'Tutoring',\r\n fieldValue: equipmentChangeState.StatusChange.Tutoring,\r\n }),\r\n );\r\n setCurrentStatus(equipmentChangeState.StatusChange.Status);\r\n }\r\n let values = formRef.current?.values || initialValues;\r\n if (!!values) {\r\n let allEquipments = [\r\n ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ...((values.OptionalsEquipments.filter(\r\n f => f.checked === true,\r\n ) as Entity[]) as IReservationEquipmentDto[]),\r\n ];\r\n const payload = {\r\n AccServices: values.AccServices.map(f => f.Id),\r\n Equipments: allEquipments.map(f => f.Id),\r\n ReservationId: (values.Id ?? 0) > 0 ? values.Id : null,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartTime),\r\n ),\r\n End: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.EndTime),\r\n ),\r\n BookedBy: values.BookedBy?.Id || null,\r\n Status: values.Status?.Id || 1,\r\n TrainingSignUp: values.TrainingSignUp,\r\n Tutoring: values.Tutoring,\r\n ADGroup: values.ADGroup?.Id || userGroup?.Id || null,\r\n FundingTypeId: fundingTypeVisible ? 0 : values.FundingType?.Id || 0,\r\n CheckStatus: false,\r\n TrainingSessionId: values.TrainingSession?.Id || null,\r\n Remarks: values.Remarks || null,\r\n BudgetId: values.Budget?.Id || budget?.Id || null,\r\n CheckSession: false,\r\n } as EquipmentsChangeStateParameters;\r\n (async () => {\r\n var validations = await validateReservation(payload);\r\n let resultValidation = validations as ReservationValidationResult;\r\n if (!!resultValidation) {\r\n if (!!resultValidation.PrerequisiteTrainings) {\r\n if (!resultValidation.PrerequisiteTrainings.IsValid) {\r\n addPrerquisitErrors(\r\n resultValidation.PrerequisiteTrainings,\r\n values.EquipmentsData,\r\n );\r\n }\r\n }\r\n if (resultValidation.PermissionErrors.length > 0) {\r\n addPermissionsErrors(\r\n resultValidation.PermissionErrors,\r\n values.EquipmentsData,\r\n );\r\n if (\r\n !reservationSettings?.UserRequestedByApproval &&\r\n resultValidation.UserCanRequestApproval\r\n ) {\r\n dispatch(actions.setUserCanRequestApproval(true));\r\n dispatch(\r\n actions.setByApprovalErrors(\r\n resultValidation.PermissionErrors,\r\n ),\r\n );\r\n }\r\n }\r\n if (\r\n resultValidation.ErrorMessages.length > 0 &&\r\n !equipmentChangeState.TrainingSessionData === null\r\n ) {\r\n addOtheMessages(resultValidation.ErrorMessages, 'error');\r\n }\r\n if (resultValidation.WarningMessages.length > 0) {\r\n addOtheMessages(resultValidation.WarningMessages, 'error');\r\n }\r\n }\r\n if (\r\n allEquipments.some(\r\n f => !!f.AccServices && f.AccServices.length > 0,\r\n ) &&\r\n !isTrainingSignUp\r\n ) {\r\n let res = validateAccServices(allEquipments);\r\n if (res.length > 0) {\r\n let error = (t(\r\n translations.err_MultipleEquipmentsWithAndWithoutAccServices,\r\n ) as string).replace('{0}', res.join(', '));\r\n addOtheMessages([error], 'error');\r\n }\r\n }\r\n })();\r\n }\r\n\r\n dispatch(actions.resetEquipmentChangeState());\r\n }\r\n if (reservationSettings?.UserRequestedByApproval) {\r\n setPermissionErrors([]);\r\n }\r\n }, [\r\n ReservationUserGroupGroupByBudgetUserGroup,\r\n actions,\r\n addCustomFormErrors,\r\n addDurationErrors,\r\n addOtheMessages,\r\n addPermissionsErrors,\r\n addPrerquisitErrors,\r\n dispatch,\r\n equipmentChangeState,\r\n equipmentSettings,\r\n formRef,\r\n fundingTypeVisible,\r\n initialValues,\r\n isEdit,\r\n isTrainingSignUp,\r\n reservationSettings?.MandatoriesEquipments,\r\n reservationSettings?.UserRequestedByApproval,\r\n t,\r\n warnOnTrainingSession,\r\n ]);\r\n const computedSchema = React.useMemo(() => {\r\n const reservationSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n FatherId: Yup.number().optional().nullable(),\r\n EquipmentsData: Yup.array()\r\n .of(Yup.mixed() as Yup.SchemaOf)\r\n .min(1)\r\n .label(t(translations.OnlineService) as string)\r\n .required(t(translations.err_OnlineServiceFieldRequired) as string)\r\n .test(\r\n 'assembly',\r\n t(\r\n translations.AssemblyPartReservationCanNotBeUpdatedDirectly,\r\n ) as string,\r\n\r\n (value, context) => {\r\n const isValid = (value as IReservationEquipmentDto[]).every(\r\n service => service.AssemblyId === null,\r\n );\r\n return isValid;\r\n },\r\n ),\r\n Budget: Yup.mixed()\r\n .label(t(translations.BudgetNumber) as string)\r\n .nullable(true),\r\n BudgetExperiment: Yup.mixed()\r\n .label(t(translations.BudgetExperiment) as string)\r\n .nullable(true)\r\n .when('Budget', {\r\n is: (Budget: IBudgetFilterDto | null) =>\r\n equipmentSettings?.BudgetVisible !== false &&\r\n equipmentSettings?.budgetExperimentVisible &&\r\n Budget !== null &&\r\n Budget.HideExperiments !== true,\r\n then: schema =>\r\n schema.required(\r\n t(translations.res_err_BudgetExperimentRequired) as string,\r\n ),\r\n otherwise: schema => schema,\r\n }),\r\n\r\n TrainingSession: Yup.mixed().label(\r\n t(translations.TrainingSession) as string,\r\n ),\r\n StaffUser: Yup.mixed()\r\n .label(t(translations.StaffUser) as string)\r\n .nullable(true),\r\n BookedBy: Yup.mixed()\r\n .label(t(translations.User) as string)\r\n .required(() => t(translations.err_UserFieldRequired) as string),\r\n Remarks: Yup.string()\r\n .nullable()\r\n .label(t(translations.Remarks) as string),\r\n FullDayReservation: Yup.boolean().required(),\r\n StartTime: Yup.date()\r\n .default(newDate())\r\n .label(t(translations.StartTime) as string)\r\n .required(t(translations._errStartTimeRequired) as string),\r\n EndTime: Yup.date()\r\n .label(t(translations.EndTime) as string)\r\n .required(t(translations._errEndTimeRequired) as string)\r\n .test(\r\n 'min',\r\n t(translations.err_EndTimeLowerThanStartTime) as string,\r\n (value, context) => {\r\n let start = (context as any).from[0].value.StartTime;\r\n let end = (context as any).from[0].value.EndTime;\r\n if (\r\n start === null ||\r\n start === undefined ||\r\n value === null ||\r\n value === undefined\r\n ) {\r\n return true;\r\n }\r\n let s = dateUtils.dateOrStringToDate(start);\r\n let e = dateUtils.dateOrStringToDate(end);\r\n if (e.valueOf() < s.valueOf()) {\r\n return false;\r\n }\r\n\r\n return true;\r\n },\r\n ),\r\n Tutoring: Yup.boolean()\r\n .label(t(translations.TutoringAssistedReservation) as string)\r\n .default(false),\r\n TutorName: Yup.string()\r\n .label(t(translations.TutorName) as string)\r\n .nullable(true),\r\n Status: Yup.mixed()\r\n .label(t(translations.OrderStatus) as string)\r\n .required(),\r\n TrainingSignUp: Yup.boolean()\r\n .default(false)\r\n .label(t(translations.TrainingSignUp) as string),\r\n ADGroup: Yup.mixed()\r\n .label(t(translations.UserGroup) as string)\r\n .nullable(true),\r\n DisplayName: Yup.string()\r\n .label(t(translations.Name) as string)\r\n .nullable(),\r\n InstituteProject: Yup.mixed()\r\n .label(t(translations.InstituteProject) as string)\r\n .nullable(true),\r\n ExperimentEln: Yup.mixed()\r\n .label(t(translations.Experiment) as string)\r\n .nullable(true),\r\n WorkflowBooking: Yup.mixed()\r\n .label(t(translations.WorkflowBooking) as string)\r\n .nullable(true),\r\n ExternalCustomer: Yup.mixed()\r\n .label(t(translations.ExternalCustomer) as string)\r\n .nullable(true),\r\n FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n PurchaseOrder: Yup.string()\r\n .label(t(translations.PurchaseOrder) as string)\r\n .nullable(true)\r\n .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n .when('Budget', {\r\n is: budget => {\r\n const result =\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory;\r\n return result;\r\n },\r\n then: schema => schema.required(),\r\n }),\r\n\r\n Reference: Yup.string()\r\n .label(t(translations.Reference) as string)\r\n .nullable(true),\r\n PartialAttendance: Yup.boolean()\r\n .default(false)\r\n .label(t(translations.Attendance) as string),\r\n PartialAttendanceStart: Yup.number()\r\n .label(t(translations.PartialAttendanceStartDuration) as string)\r\n .nullable(true),\r\n PartialAttendanceEnd: Yup.number()\r\n .label(t(translations.PartialAttendanceEndDuration) as string)\r\n .nullable(true),\r\n TransferredTo: Yup.mixed()\r\n .label(t(translations.TransferReservation) as string)\r\n .nullable(true),\r\n SampleRunId: Yup.number()\r\n .label(t(translations.SampleRunId) as string)\r\n .nullable(true),\r\n AccServices: Yup.array()\r\n .of(EntityNumberSchema)\r\n .label(t(translations.AccompaniedService) as string),\r\n FormValues: Yup.array().of(formValueSchema),\r\n CollaboratedUsers: Yup.array()\r\n .of(EntityStringSchema)\r\n .label(t(translations.CollaboratorUsers) as string),\r\n SampleIds: Yup.array()\r\n .of(Yup.number().required())\r\n .label(t(translations.SampleIds) as string),\r\n OptionalsEquipments: Yup.array().of(CheckEntityShema),\r\n WaitingTransferApproval: Yup.boolean().default(false),\r\n TransferFromId: Yup.number().nullable(true).default(null),\r\n // not really needed on the form\r\n AssemblyParts: Yup.mixed().nullable().optional(),\r\n },\r\n );\r\n if (equipmentSettings?.BudgetVisible === true) {\r\n reservationSchema.fields.Budget.withMutation(schema =>\r\n schema.required(t(translations.BudgetIsRequired) as string),\r\n );\r\n }\r\n if (\r\n globalSettings.accServicesEnabled &&\r\n equipmentSettings?.HasAccServices &&\r\n !isTrainingSignUp\r\n ) {\r\n reservationSchema.fields.AccServices.withMutation(schema =>\r\n schema\r\n .min(1, t(translations.err_AccompaniedService_required) as string)\r\n .required(t(translations.err_AccompaniedService_required) as string),\r\n );\r\n }\r\n if (staffRequired) {\r\n reservationSchema.fields.StaffUser.withMutation(schema =>\r\n schema.required(t(translations.StaffUserRequired) as string),\r\n );\r\n }\r\n if (workflowBookingVisible) {\r\n reservationSchema.fields.WorkflowBooking.withMutation(schema =>\r\n schema.required(t(translations.err_WorkflowBookingRequired) as string),\r\n );\r\n }\r\n return reservationSchema;\r\n }, [\r\n equipmentSettings?.BudgetVisible,\r\n equipmentSettings?.HasAccServices,\r\n equipmentSettings?.budgetExperimentVisible,\r\n globalSettings.accServicesEnabled,\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n globalSettings.purchaseOrderLengthSetting,\r\n isTrainingSignUp,\r\n newDate,\r\n staffRequired,\r\n t,\r\n workflowBookingVisible,\r\n ]);\r\n\r\n const processing = useSelector(selectReservationProcessing);\r\n const [prevProcessing, setPrevProcessing] = React.useState(processing);\r\n\r\n const handleFullDayReservationChange = (\r\n event: React.ChangeEvent,\r\n ) => {\r\n // todo: move this to a callback with the formik.values accessible there instead of this mess\r\n const startTime = formRef.current?.values.StartTime;\r\n const endTime = formRef.current?.values.EndTime;\r\n if (\r\n startTime !== null &&\r\n endTime !== null &&\r\n startTime !== undefined &&\r\n endTime !== undefined\r\n ) {\r\n const fullDayReservation = event.target.checked === true;\r\n if (fullDayReservation) {\r\n const currentPeriod = {\r\n start_date: dateUtils.dateOrStringToDate(startTime),\r\n end_date: dateUtils.dateOrStringToDate(endTime),\r\n };\r\n /**\r\n * When full day reservation is being checked, the end time needs to be moved to the end of the day, start - to the start of the day\r\n */\r\n const adjusted = adjustSchedulerEventTimes(\r\n currentPeriod,\r\n fullDayReservation,\r\n );\r\n const partialReservationDetailsState: Pick<\r\n ReservationDetailsState,\r\n 'StartTime' | 'EndTime'\r\n > = {\r\n /**\r\n * TODO: adjust the starttime of the reservation. Currently setting the startTime messes up the end time also\r\n * e.g.\r\n * {start:'2023-08-02T11:05:00', end:'2023-08-02T12:05:00'} -> (original)\r\n * {start:'2023-08-02T00:00:00', end:'2023-08-03T00:00:00'} -> (in setValues)\r\n * {start:'2023-08-02T00:00:00', end:'2023-08-03T22:27:12Z'} -> (final formik Values)\r\n */\r\n StartTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(adjusted.start_date),\r\n {\r\n format: 'basic',\r\n representation: 'complete',\r\n },\r\n ),\r\n EndTime: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(adjusted.end_date),\r\n {\r\n format: 'basic',\r\n representation: 'complete',\r\n },\r\n ),\r\n };\r\n formRef.current?.setValues(values => ({\r\n ...values,\r\n ...partialReservationDetailsState,\r\n }));\r\n }\r\n }\r\n };\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n if (allIsValid) {\r\n console.log(reservationSettings);\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else if (errorMessages.length > 0) {\r\n console.debug('errors', errorMessages);\r\n formikHelpers.setSubmitting(false);\r\n } else if (offlineServicesErrors.length > 0) {\r\n formikHelpers.setSubmitting(false);\r\n dispatch(\r\n appActions.addNotification({\r\n variant: 'error',\r\n message: '',\r\n messageType: SnackBarMessageType.messageList,\r\n messageTypeProps: {\r\n messages: offlineServicesErrors.map(f => {\r\n return {\r\n Id: f.id.toString(),\r\n message: f.error,\r\n } as SingleMessagesProps;\r\n }),\r\n } as ListMessagesProps,\r\n }),\r\n );\r\n if (submitCalculateCredit) {\r\n dispatch(actions.setSubmitCalculateCredit(false));\r\n }\r\n } else {\r\n if (submitCalculateCredit) {\r\n handleSubmit(values);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n dispatch(actions.resetDetailsErrorsState());\r\n if (submitting) {\r\n setSubmitting(undefined);\r\n }\r\n handleSubmit(values);\r\n }\r\n }\r\n });\r\n } else {\r\n formikHelpers.setSubmitting(false);\r\n }\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Reservation errors', formik.errors);\r\n }\r\n\r\n /**\r\n * shared function to disable fields. Additionallyto be disabled during state transitions and readonly state - disablses the most of the fields based on the \"editable\" property (except the end time in reservation extension)\r\n * */\r\n const fieldDisabled = (x = editable) =>\r\n formik.isSubmitting || readonly || (isEdit && !(x === true));\r\n\r\n // this one resets the formik's isSubmitting property once reservation's processing finishes\r\n // reduxe reservation processing transitions from\r\n if (processing !== prevProcessing) {\r\n setPrevProcessing(processing);\r\n if (\r\n processing === false &&\r\n prevProcessing === true &&\r\n formik.isSubmitting === true\r\n ) {\r\n formik.setSubmitting(false);\r\n }\r\n }\r\n\r\n const reservationCollaboratorsFilter = getReservationCollaboratorsFilter(\r\n equipmentSettings,\r\n formik,\r\n );\r\n const staffUserPickerPredicates =\r\n (equipmentSettings?.StaffUserSelection?.length || 0) > 0\r\n ? [\r\n `(Id in ${quoteODataValue(\r\n equipmentSettings?.StaffUserSelection.filter(f =>\r\n (formik.values\r\n .EquipmentsData as IReservationEquipmentDto[]).some(c =>\r\n c.StaffUserSelection.some(u => u.Id === f.Id),\r\n ),\r\n ) || [],\r\n )})`,\r\n ]\r\n : [\r\n `(IsLabTech or isEquipmentAdmin or isGroupAdmin) and ${(formik\r\n .values.EquipmentsData as IReservationEquipmentDto[])\r\n ?.map(\r\n equipment =>\r\n `(Services/any(s:s/Id eq ${equipment.Id}) or (${equipment.ServiceGroupId} in ServiceGroupIds)`,\r\n )\r\n .join(' and ')})`,\r\n ];\r\n\r\n return (\r\n \r\n \r\n \r\n <>\r\n \r\n \r\n \r\n \r\n\r\n \r\n formik.setFieldValue('ADGroup', value)\r\n }\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* */}\r\n {(!print || (!customFormOnlyPrinted && print)) && (\r\n \r\n \r\n f.Id,\r\n )\r\n : [],\r\n )}\r\n name=\"EquipmentsData\"\r\n label={t(translations.OnlineService)}\r\n placeholder={t(translations.PleaseSelectServices)}\r\n disabled={\r\n fieldDisabled() ||\r\n (isEdit && !allowEditMultipleEquipments)\r\n }\r\n onChange={() => setServiceChanged(true)}\r\n onChipClick={onEquipmentClicked}\r\n multiple={\r\n globalSettings.multipleInstrumentsEnabled &&\r\n !trainingSessionVisible\r\n }\r\n autoExpand={\r\n 'MandatoriesEquipments,OptionalsEquipments,AccServices,OfflineServices,StaffUserSelection'\r\n }\r\n fullWidth\r\n />\r\n {globalSettings.AssemblyPartsEnabled && (\r\n \r\n )}\r\n \r\n {globalSettings.accServicesEnabled &&\r\n equipmentSettings?.HasAccServices &&\r\n !isTrainingSignUp && (\r\n \r\n f.Id),\r\n )}\r\n name=\"AccServices\"\r\n label={t(translations.AccompaniedService)}\r\n placeholder={t(\r\n translations.PleaseSelectAnAccompaniedService,\r\n )}\r\n disabled={fieldDisabled()}\r\n onChange={() => setAccServiceChanged(true)}\r\n multiple={\r\n equipmentSettings.HasAccServices &&\r\n !equipmentSettings.AllowOneAccSerOnly\r\n }\r\n fullWidth\r\n />\r\n \r\n )}\r\n {mandatoryServices.length > 0 && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {!!reservationSettings?.OptionalsEquipments &&\r\n !isEdit &&\r\n reservationSettings.OptionalsEquipments.length >\r\n 0 && (\r\n \r\n \r\n {\r\n setOptionalChanged(() => true);\r\n }}\r\n disabled={formik.isSubmitting || readonly}\r\n label={t(\r\n translations.AddingsOptionalEquipments,\r\n )}\r\n size=\"small\"\r\n />\r\n \r\n )}\r\n {trainingSessionVisible && (\r\n \r\n setTrainingSessionChanged(true)}\r\n predicates={ReservRelatedFilter(\r\n formik.values.EquipmentsData[0].Id,\r\n )}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {workflowBookingVisible && (\r\n \r\n \r\n \r\n )}\r\n {!trainingSessionVisible && (\r\n \r\n \r\n \r\n \r\n \r\n setStartTimeChanged(true)\r\n }\r\n onEndTimeChange={() => setEndTimeChanged(true)}\r\n startTimeLabel={t(translations.From)}\r\n endTimeLabel={t(translations.To)}\r\n />\r\n \r\n )}\r\n\r\n {userGroupVisible ? (\r\n \r\n setUserGroupChanged(true)}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {formik.values.ADGroup !== undefined &&\r\n formik.values.ADGroup !== null\r\n ? formik.values.ADGroup.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n )}\r\n {userVisible ? (\r\n \r\n {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: 1,\r\n ServiceGroupId: f.ServiceGroupId,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n },\r\n ),\r\n globalSettings.budgetExperimentModuleEnabled,\r\n formik.values.ADGroup?.Id,\r\n formik.values.Budget?.Id,\r\n globalSettings.defaultBudgetEnabled,\r\n (formik.values.Budget as IBudgetFilterDto)\r\n ?.IsDefault,\r\n )}\r\n label={t(translations.User)}\r\n disabled={fieldDisabled()}\r\n onChange={value => {\r\n setBookedByChanged(true);\r\n }}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {userProfileVisible &&\r\n formik.values.BookedBy !== null && (\r\n \r\n )}\r\n {/* {formik.values.BookedBy !== null\r\n ? formik.values.BookedBy.Name\r\n : (t(translations.NA) as string)} */}\r\n \r\n }\r\n />\r\n \r\n )}\r\n {staffVisible && (\r\n \r\n 0\r\n ? 'full'\r\n : 'admin'\r\n }\r\n predicates={staffUserPickerPredicates}\r\n label={t(translations.StaffUser)}\r\n disabled={fieldDisabled()}\r\n onChange={() => setStaffChanged(true)}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {equipmentSettings?.BudgetVisible &&\r\n fundingTypeVisible && (\r\n \r\n {\r\n formik.setValues(\r\n produce(values => {\r\n // clear budget selection when funding type is changed to an incompatible value\r\n // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n if (\r\n (value as Entity).Id !==\r\n (values.Budget as IBudgetFilterDto)\r\n ?.FundingTypeId\r\n ) {\r\n values.Budget = null;\r\n }\r\n values.FundingType = value;\r\n }),\r\n );\r\n }}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {equipmentSettings?.BudgetVisible && (\r\n <>\r\n \r\n {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: 1,\r\n ServiceGroupId: f.ServiceGroupId,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n },\r\n ),\r\n startTime: dateUtils.dateOrStringToDate(\r\n formik.values.StartTime,\r\n ),\r\n endTime: dateUtils.dateOrStringToDate(\r\n formik.values.EndTime,\r\n ),\r\n user: isServiceAdmin\r\n ? formik.values.BookedBy === null\r\n ? undefined\r\n : formik.values.BookedBy.Id\r\n : user?.Id,\r\n defaultBudgetEnabled:\r\n globalSettings.defaultBudgetEnabled,\r\n userDefaultBudgetEnabled:\r\n globalSettings.userDefaultBudgetEnabled,\r\n hideNonDefaultBudgets:\r\n globalSettings.hideNonDefaultBudgets,\r\n // funding type is set to Internal by default even if it's not in use\r\n fundingType: fundingTypeVisible\r\n ? formik.values.FundingType\r\n : null,\r\n })}\r\n label={t(translations.BudgetNumber)}\r\n onChange={() => {\r\n setBudgetChanged(true);\r\n formik.setFieldValue('CollaboratedUsers', []);\r\n }}\r\n disabled={fieldDisabled()}\r\n useSearchOrPredicate={\r\n globalSettings.hideNonDefaultBudgets\r\n }\r\n fullWidth\r\n />\r\n \r\n {budgetExperimentVisible &&\r\n !(\r\n (formik.values.Budget as IBudgetFilterDto)\r\n ?.HideExperiments ?? true\r\n ) && (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n {reservationCollaboratorsVisible && (\r\n \r\n \r\n \r\n )}\r\n {globalSettings.purchaseOrderBudgetEnabled &&\r\n ((formik.values.Budget as IBudgetFilterDto)\r\n ?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !==\r\n PurchaseOrderOptions.Hidden && (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n\r\n {isEdit &&\r\n (!useSidePanel || (useSidePanel && sidePanelExpanded)) &&\r\n allowOngoingModifications && (\r\n \r\n )}\r\n \r\n\r\n \r\n {(!print || (!customFormOnlyPrinted && print)) && (\r\n \r\n {(!useSidePanel ||\r\n (useSidePanel && sidePanelExpanded)) && (\r\n \r\n \r\n setStatusChanged(true)}\r\n fullWidth\r\n />\r\n \r\n \r\n )}\r\n {tutoringVisible && (\r\n \r\n setTutoringChanged(true)}\r\n />\r\n \r\n )}\r\n {(!useSidePanel ||\r\n (useSidePanel && sidePanelExpanded && !isCover)) && (\r\n \r\n {trainingSignUpVisible && (\r\n \r\n {\r\n setIsTrainingSignUp(!isTrainingSignUp);\r\n }}\r\n />\r\n \r\n )}\r\n \r\n )}\r\n\r\n {!customFormOnlyPrinted && print && (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n {!isEdit && !formik.values.TrainingSignUp && (\r\n \r\n )}\r\n {globalSettings.ServiceRequestReservationEnabled &&\r\n isServiceAdmin &&\r\n isEdit && (\r\n \r\n \r\n \r\n )}\r\n {globalSettings.offlineServiceWithReservation &&\r\n !!reservationSettings &&\r\n (equipmentSettings?.OfflineServicesVisible ||\r\n (reservationSettings?.OfflineMandatory !== undefined &&\r\n reservationSettings?.OfflineMandatory?.length >\r\n 0)) && (\r\n \r\n \r\n \r\n )}\r\n\r\n {globalSettings.resCustomFormEnabled &&\r\n !!reservationSettings &&\r\n (reservationSettings.CustomForms?.length > 0 ||\r\n (isEdit && formik.values.FormValues?.length > 0)) && (\r\n \r\n 0\r\n ? reservationSettings.CustomForms\r\n : []\r\n }\r\n readonly={readonly}\r\n isAdmin={isAdmin}\r\n customFormRef={customFormRef}\r\n formIsValid={validateForms}\r\n disabled={fieldDisabled()}\r\n validationEnabled={!savedForLater}\r\n saveFormValues={(\r\n values: IFormValueDto[],\r\n files: IFormFileValue[],\r\n originalFiles: IFormFileValue[],\r\n ) => {\r\n formik.setFieldValue(\r\n 'FormValues',\r\n updateFormValues(\r\n formik.values.FormValues,\r\n values,\r\n ),\r\n false,\r\n );\r\n setCurrentFormFiles(files);\r\n setOriginalFormFiles(originalFiles);\r\n }}\r\n formValues={formik.values.FormValues}\r\n />\r\n \r\n )}\r\n\r\n {formik.values.SampleRunId !== null &&\r\n formik.values.SampleRunId !== undefined && (\r\n \r\n \r\n {t(translations.SampleRunId)}: \r\n {formik.values.SampleRunId}\r\n \r\n \r\n )}\r\n {!print && (\r\n \r\n \r\n \r\n )}\r\n {isEdit &&\r\n !!reservationSettings &&\r\n (!useSidePanel ||\r\n (useSidePanel && sidePanelExpanded && !isCover)) && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { initEquipmentsData } from 'app/components/pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport {\r\n IMandatoryEquipmentsDto,\r\n IReservationEquipmentDto,\r\n PrerequisitsResult,\r\n ReservationDetailsState,\r\n ReservationSettingsState,\r\n TrainingSessionResult,\r\n} from '../slice/types';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport { Box, Link as MuiLink } from '@material-ui/core';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { Body } from 'app/components/Typography';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { BulletedList } from 'app/components/BasicList/StyledList';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const staffUserChangeHandler = (\r\n values: ReservationDetailsState,\r\n isEdit: boolean,\r\n setValue: (\r\n field: string,\r\n value: any,\r\n shouldValidate?: boolean | undefined,\r\n ) => void,\r\n equipmentsChangeHandler: (\r\n values: ReservationDetailsState,\r\n changeStatus?: boolean | undefined,\r\n selectedEqs?: IReservationEquipmentDto[],\r\n ) => void,\r\n extendStaffMandatoryEquipment: (\r\n staff: IReservationEquipmentDto | null,\r\n ) => void,\r\n extendMandatoryEquipments: (mandatories: IMandatoryEquipmentsDto[]) => void,\r\n initStaffReservation: (\r\n staffEquipmentId: number,\r\n values: ReservationDetailsState,\r\n ) => void,\r\n setStaffEquipmentRestricted: (staffUser: string) => void,\r\n reservationSettings?: ReservationSettingsState,\r\n) => {\r\n let staffEquipmentId =\r\n values.StaffUser !== null\r\n ? (values.StaffUser as IUserFilterDto).StaffEquipmentId\r\n : null;\r\n if (staffEquipmentId !== null) {\r\n let allEquipments = [\r\n ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ...((values.OptionalsEquipments.filter(f => f.checked === true) as Entity<\r\n number\r\n >[]) as IReservationEquipmentDto[]),\r\n ];\r\n if (!allEquipments.some(f => f.Id === staffEquipmentId)) {\r\n if (isEdit) {\r\n (async () => {\r\n try {\r\n let setEquipments: Entity[] = [];\r\n let data = await initEquipmentsData(\r\n staffEquipmentId.toString(),\r\n 'AccServices,OfflineServices,StaffUserSelection,MandatoriesEquipments,OptionalsEquipments',\r\n );\r\n if (data.length > 0) {\r\n let staffEquipment = data[0];\r\n if (\r\n !!reservationSettings &&\r\n reservationSettings.StaffMandatoryEquipment !== null\r\n ) {\r\n setEquipments = [\r\n ...values.EquipmentsData.filter(\r\n f =>\r\n f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n ),\r\n Object.assign({}, staffEquipment, {\r\n noremoved: true,\r\n titleInfo: `Mandatory instrument for ${values.StaffUser?.Name}`,\r\n }),\r\n ];\r\n } else {\r\n setEquipments = [\r\n ...values.EquipmentsData,\r\n Object.assign({}, staffEquipment, {\r\n noremoved: true,\r\n titleInfo: `Mandatory instrument for ${values.StaffUser?.Name}`,\r\n }),\r\n ];\r\n }\r\n setValue('EquipmentsData', setEquipments);\r\n extendStaffMandatoryEquipment(\r\n staffEquipment as IReservationEquipmentDto,\r\n );\r\n equipmentsChangeHandler(\r\n Object.assign({}, values, {\r\n EquipmentsData: setEquipments,\r\n }),\r\n true,\r\n );\r\n } else {\r\n setStaffEquipmentRestricted(values.StaffUser?.Name ?? '');\r\n setValue('StaffUser', null);\r\n }\r\n } catch {}\r\n })();\r\n } else {\r\n (async () => {\r\n try {\r\n let notRestricted = await ReservationsApi.userCanBookEquipment(\r\n staffEquipmentId,\r\n );\r\n\r\n if (notRestricted.value === true) {\r\n initStaffReservation(staffEquipmentId, values);\r\n } else {\r\n setStaffEquipmentRestricted(values.StaffUser?.Name ?? '');\r\n setValue('StaffUser', null);\r\n }\r\n } catch {}\r\n })();\r\n }\r\n }\r\n } else {\r\n if (\r\n !!reservationSettings &&\r\n reservationSettings.StaffMandatoryEquipment !== null\r\n ) {\r\n if (isEdit) {\r\n let setEquipments = values.EquipmentsData.filter(\r\n f => f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n );\r\n setValue('EquipmentsData', setEquipments);\r\n equipmentsChangeHandler(\r\n Object.assign({}, values, { EquipmentsData: setEquipments }),\r\n true,\r\n );\r\n } else {\r\n if (reservationSettings.MandatoriesEquipments.length > 0) {\r\n let mand = reservationSettings.MandatoriesEquipments.filter(\r\n f => f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n );\r\n let alleqs = [\r\n ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n ...((mand as Entity[]) as IReservationEquipmentDto[]),\r\n ...((values.OptionalsEquipments.filter(\r\n f => f.checked === true,\r\n ) as Entity[]) as IReservationEquipmentDto[]),\r\n ];\r\n extendMandatoryEquipments(mand);\r\n equipmentsChangeHandler(values, true, alleqs);\r\n }\r\n }\r\n extendStaffMandatoryEquipment(null);\r\n }\r\n }\r\n};\r\nexport const prerquisitErrorsHandler = (\r\n data: PrerequisitsResult,\r\n equipments: Entity[],\r\n setPrerequisitErrors: (items: IndexNode[]) => void,\r\n onEquipmentClicked?: (equipment: Entity) => void,\r\n onRestrictionsClick?: (equipment: Entity) => void,\r\n) => {\r\n setPrerequisitErrors(\r\n data.PrerequisiteTrainings.length > 0\r\n ? [\r\n {\r\n index: 'prerequisiteIndex',\r\n node: (\r\n \r\n {data.ErrorMessage}\r\n {data.PrerequisiteTrainings.map(pre => (\r\n \r\n {' '}\r\n \r\n !!onEquipmentClicked && onEquipmentClicked(pre)\r\n }\r\n >\r\n {pre.Name}\r\n \r\n \r\n ))}\r\n {equipments.length === 1 ? (\r\n \r\n \r\n !!onRestrictionsClick &&\r\n onRestrictionsClick(equipments[0])\r\n }\r\n >\r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n {\r\n return {\r\n key: per.Id,\r\n node: (\r\n \r\n \r\n !!onRestrictionsClick &&\r\n onRestrictionsClick(per)\r\n }\r\n >\r\n {per.Name}\r\n \r\n \r\n ),\r\n };\r\n })}\r\n />\r\n \r\n )}\r\n \r\n ),\r\n },\r\n ]\r\n : [\r\n {\r\n index: 'pErrorIndex',\r\n node: {data.ErrorMessage},\r\n },\r\n ],\r\n );\r\n};\r\nexport const trainingSessionChangeHandler = (\r\n data: TrainingSessionResult | null,\r\n setMessage: (items: IndexNode[]) => void,\r\n initTrainingSession: (\r\n data: TrainingSessionResult,\r\n values: ReservationDetailsState,\r\n ) => void,\r\n values: ReservationDetailsState,\r\n) => {\r\n if (data !== null && data.HasTrainingSession === true) {\r\n setMessage([\r\n {\r\n index: 'trainingSessionWarning',\r\n node: (\r\n \r\n \r\n {(i18next.t(translations.warn_TrainingSessionsTimeSlot) as string)\r\n .replace('{0}', dateUtils.shortDateTimeFormat(data.Start) ?? '')\r\n .replace('{1}', dateUtils.shortDateTimeFormat(data.End) ?? '')}\r\n \r\n initTrainingSession(data, values)}\r\n >\r\n {i18next.t(translations.SignUp) as string}\r\n \r\n \r\n ),\r\n },\r\n ]);\r\n }\r\n};\r\nexport const durationErrorsHandler = (\r\n data: string[],\r\n equipments: Entity[],\r\n setDurationErrors: (items: IndexNode[]) => void,\r\n onRestrictionsClick?: (equipment: Entity) => void,\r\n) => {\r\n setDurationErrors([\r\n {\r\n index: 'durationErrors',\r\n node: (\r\n \r\n {data.map(dur => (\r\n {dur}\r\n ))}\r\n {equipments.length === 1 ? (\r\n \r\n \r\n !!onRestrictionsClick && onRestrictionsClick(equipments[0])\r\n }\r\n >\r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n {\r\n return {\r\n key: per.Id,\r\n node: (\r\n \r\n \r\n !!onRestrictionsClick && onRestrictionsClick(per)\r\n }\r\n >\r\n {per.Name}\r\n \r\n \r\n ),\r\n };\r\n })}\r\n />\r\n \r\n )}\r\n \r\n ),\r\n },\r\n ]);\r\n};\r\nexport const otheMessagesHandler = (\r\n data: string[],\r\n type: 'warning' | 'error' | 'info' | 'success',\r\n setMessage: (items: IndexNode[]) => void,\r\n) => {\r\n let index = `other_${type}_${data.length}`;\r\n let message = [\r\n {\r\n index: index,\r\n node: (\r\n \r\n {data.map(msg => (\r\n \r\n {msg}\r\n \r\n ))}\r\n \r\n ),\r\n },\r\n ];\r\n setMessage(message);\r\n};\r\nexport const customFormErrorsHandler = (\r\n data: string[],\r\n setMessage: (items: IndexNode[]) => void,\r\n) => {\r\n setMessage([\r\n {\r\n index: 'cutFErrors',\r\n node: (\r\n \r\n {data.map(dur => (\r\n \r\n {dur}\r\n \r\n ))}\r\n \r\n ),\r\n },\r\n ]);\r\n};\r\nexport const permissionsErrorsHandler = (\r\n data: string[],\r\n equipments: Entity[],\r\n setMessage: (items: IndexNode[]) => void,\r\n onRestrictionsClick?: (equipment: Entity) => void,\r\n) => {\r\n setMessage([\r\n {\r\n index: 'permIndex',\r\n node: (\r\n \r\n {data.map((t, index) => (\r\n {t}\r\n ))}\r\n {equipments.length === 1 ? (\r\n \r\n \r\n !!onRestrictionsClick && onRestrictionsClick(equipments[0])\r\n }\r\n >\r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {i18next.t(translations.AllRestrictions)}\r\n \r\n {\r\n return {\r\n key: per.Id,\r\n node: (\r\n \r\n \r\n !!onRestrictionsClick && onRestrictionsClick(per)\r\n }\r\n >\r\n {per.Name}\r\n \r\n \r\n ),\r\n };\r\n })}\r\n />\r\n \r\n )}\r\n \r\n ),\r\n },\r\n ]);\r\n};\r\n","import { FormikProps } from 'formik';\r\nimport { ReservationDetailsState, ServiceSettingsState } from '../slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport function getReservationCollaboratorsFilter(\r\n equipmentSettings: ServiceSettingsState | undefined,\r\n formik: FormikProps,\r\n) {\r\n return [\r\n equipmentSettings?.BudgetVisible === true\r\n ? new Condition(\r\n 'Budgets',\r\n ODataOperators.Any,\r\n formik.values.Budget?.Id ?? 0,\r\n )\r\n : undefined,\r\n formik.values.BookedBy?.Id !== undefined\r\n ? new Condition(\r\n 'Id',\r\n ODataOperators.NotEquals,\r\n formik.values.BookedBy?.Id,\r\n )\r\n : undefined,\r\n ].filter(f => f !== undefined) as Condition[];\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { UserTrainingReservationData } from '../slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { DialogActionsRenderer } from 'app/components/BasicDialog/DialogActionsRender';\r\nimport { useDispatch } from 'react-redux';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { ITrainingReservations } from 'app/pages/ReservationHistoryPage/ITrainingReservations';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\n\r\nexport interface ApproveTrainingRecordsProps {\r\n show: boolean;\r\n data: UserTrainingReservationData;\r\n handleApproveOnce: () => void;\r\n handleEditAssisted: (p: TrainingDetailsProps, reset: boolean) => void;\r\n}\r\nexport function ApproveTrainingRecords(props: ApproveTrainingRecordsProps) {\r\n const { show, data, handleApproveOnce, handleEditAssisted } = props;\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { actions: appSetActions } = useAppSettingsSlice();\r\n const { t } = useTranslation();\r\n const existingTrainings = React.useMemo(() => {\r\n return data.Equipments.filter(f => f.RequiresAdminApproval === true);\r\n }, [data.Equipments]);\r\n const servicesWithoutTraining = React.useMemo(() => {\r\n return data.Equipments.filter(f => f.TrainingRecordId === null);\r\n }, [data.Equipments]);\r\n\r\n //BKT-9144 Customer feedback UiO: Assisted: Toggle “DO NOT SHOW POP UP FOR APPROVING THE USER FOR GOOD/ CREATING TRAINING RECORD” to ON does not hide the pop up.\r\n //setting - DO NOT SHOW POP UP FOR APPROVING THE USER FOR GOOD/ CREATING TRAINING RECORD\r\n const showPopupAccordingToSetting = React.useMemo(() => {\r\n return !data.Equipments.every(f => f.NotShowPopup === true);\r\n }, [data.Equipments]);\r\n\r\n const showPopup = React.useMemo(() => {\r\n return (\r\n (!data.Equipments.every(f => f.NotShowPopup === true) &&\r\n existingTrainings.length > 0) ||\r\n servicesWithoutTraining.length > 0\r\n );\r\n }, [\r\n data.Equipments,\r\n existingTrainings.length,\r\n servicesWithoutTraining.length,\r\n ]);\r\n\r\n const handleEditClick = React.useCallback(() => {\r\n if (existingTrainings.length === 1) {\r\n handleEditAssisted(\r\n {\r\n id: (existingTrainings[0].TrainingRecordId ?? 0).toString(),\r\n equId: undefined,\r\n equIds: undefined,\r\n fatherId: undefined,\r\n rid: undefined,\r\n date: undefined,\r\n user: undefined,\r\n useSidePanel: true,\r\n } as TrainingDetailsProps,\r\n true,\r\n );\r\n } else {\r\n history.push(\r\n `/History?un=${data.UserName}&st=${dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(data.StartTime),\r\n )}&et=${dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(data.EndTime),\r\n )}`,\r\n );\r\n }\r\n }, [\r\n data.EndTime,\r\n data.StartTime,\r\n data.UserName,\r\n existingTrainings,\r\n handleEditAssisted,\r\n history,\r\n ]);\r\n const handleNweCreateClick = React.useCallback(() => {\r\n handleEditAssisted(\r\n {\r\n id: undefined,\r\n equId: undefined,\r\n equIds: data.Equipments.map(f => f.EquipmentId).join(','),\r\n fatherId: data.FatherId !== null ? data.FatherId.toString() : undefined,\r\n rid:\r\n data.FatherId !== null\r\n ? undefined\r\n : data.ReservationId !== null\r\n ? data.ReservationId.toString()\r\n : undefined,\r\n date: dateUtils.formatISO(dateUtils.dateOrStringToDate(data.StartTime)),\r\n user: data.UserName,\r\n useSidePanel: true,\r\n } as TrainingDetailsProps,\r\n true,\r\n );\r\n }, [\r\n handleEditAssisted,\r\n data.Equipments,\r\n data.FatherId,\r\n data.ReservationId,\r\n data.StartTime,\r\n data.UserName,\r\n ]);\r\n const handleCreateTrainings = React.useCallback(() => {\r\n const postData = servicesWithoutTraining.map(item => {\r\n return {\r\n BookedBy: data.UserName,\r\n ReservationId: data.ReservationId,\r\n EquipmentId: item.EquipmentId,\r\n StartTime: data.StartTime,\r\n TrainingLevelId: item.TrainingRecordId,\r\n };\r\n }) as ITrainingReservations[];\r\n (async () => {\r\n try {\r\n let trdata = await ReservationsApi.createTraining(postData);\r\n if (trdata.length > 0) {\r\n let success = t(translations.TrainingsCreatedSuccessfully) as string;\r\n dispatch(\r\n appSetActions.addNotification({\r\n variant: 'success',\r\n message: success.replace('{0}', trdata.length),\r\n key: 'training-created',\r\n }),\r\n );\r\n } else {\r\n let info = t(translations.TrainingsAlreadyExist) as string;\r\n dispatch(\r\n appSetActions.addNotification({\r\n variant: 'warning',\r\n message: info,\r\n key: 'training-warning',\r\n }),\r\n );\r\n }\r\n handleApproveOnce();\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n dispatch(\r\n appSetActions.addNotification({\r\n variant: 'error',\r\n message: message,\r\n key: 'training-error',\r\n }),\r\n );\r\n }\r\n })();\r\n }, [\r\n appSetActions,\r\n data.ReservationId,\r\n data.StartTime,\r\n data.UserName,\r\n dispatch,\r\n handleApproveOnce,\r\n servicesWithoutTraining,\r\n t,\r\n ]);\r\n const actions: DialogActionsRenderer[] = React.useMemo(() => {\r\n let buttons: DialogActionsRenderer[] = [];\r\n buttons.push(() => (\r\n handleApproveOnce()}\r\n />\r\n ));\r\n if (existingTrainings.length > 0) {\r\n buttons.push(() => (\r\n handleEditClick()}\r\n />\r\n ));\r\n }\r\n buttons.push(() => (\r\n handleNweCreateClick()}\r\n />\r\n ));\r\n if (servicesWithoutTraining.length > 0) {\r\n buttons.push(() => (\r\n handleCreateTrainings()}\r\n />\r\n ));\r\n }\r\n return buttons;\r\n }, [\r\n existingTrainings,\r\n handleApproveOnce,\r\n handleCreateTrainings,\r\n handleEditClick,\r\n handleNweCreateClick,\r\n servicesWithoutTraining.length,\r\n t,\r\n ]);\r\n return (\r\n 0\r\n ? t(translations.This_user_already_has_a_valid_training)\r\n : t(translations.CreateNewTrainingRecord_YesNo)\r\n }\r\n maxWidth=\"md\"\r\n actions={actions}\r\n />\r\n );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n ServicesFilter,\r\n UserPicker,\r\n} from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\n\r\nexport interface TransferReservationProps {\r\n show: boolean;\r\n handleTransfer: (value: IUserFilterDto) => void;\r\n transferAllowedToGroup: boolean;\r\n services: IServiceTypeFilterDto[];\r\n adGroup?: string;\r\n budgetExpirementModuleEnabled?: boolean;\r\n trnsferSubmitted?: boolean;\r\n onClose: () => void;\r\n user?: AuthenticatedUser;\r\n}\r\n\r\nexport function TransferReservation(props: TransferReservationProps) {\r\n const {\r\n show,\r\n handleTransfer,\r\n transferAllowedToGroup,\r\n services,\r\n adGroup,\r\n budgetExpirementModuleEnabled,\r\n trnsferSubmitted,\r\n user,\r\n onClose,\r\n } = props;\r\n const { t } = useTranslation();\r\n const [\r\n trasferToUser,\r\n setTranferToUser,\r\n ] = React.useState(null);\r\n\r\n return (\r\n \r\n \r\n {t(translations.TransferReservation_info) as string}\r\n \r\n }\r\n >\r\n \r\n setTranferToUser(value)}\r\n value={trasferToUser}\r\n error={trasferToUser === null || trasferToUser === undefined}\r\n helperText={\r\n trasferToUser === null || trasferToUser === undefined\r\n ? (t(translations.err_UserFieldRequired) as string)\r\n : undefined\r\n }\r\n fullWidth\r\n selectArray={['Id', 'Name', 'UserGroups']}\r\n />\r\n \r\n \r\n \r\n }\r\n onConfirm={ev => {\r\n if (trasferToUser !== null) {\r\n handleTransfer(trasferToUser);\r\n }\r\n }}\r\n onCancel={() => onClose()}\r\n onClose={() => onClose()}\r\n maxWidth=\"sm\"\r\n />\r\n );\r\n}\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { UnconfigurableTable } from 'app/components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\n\r\nexport interface ReservationModificationsProps {\r\n resId: number;\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n}\r\nexport const ReservationModifications = ({\r\n resId,\r\n open,\r\n setOpen,\r\n}: ReservationModificationsProps) => {\r\n const { t } = useTranslation();\r\n const columns = useMemo(() => getColumns(t), [t]);\r\n const url = `/api/odata/v4/ModificationHistory/Reservations`;\r\n return (\r\n \r\n \r\n \r\n }\r\n onCancel={() => setOpen(false)}\r\n maxWidth=\"md\"\r\n />\r\n );\r\n};\r\n\r\nconst TTable = filterHandler(\r\n UnconfigurableTable,\r\n GetFilters,\r\n {\r\n isSidePanel: true,\r\n },\r\n);\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n const res: Column[] = [\r\n // {\r\n // accessor: 'Id',\r\n // Header: t(translations.HashSymbol) as string,\r\n // },\r\n {\r\n accessor: 'Field',\r\n Header: t(translations.Field) as string,\r\n },\r\n {\r\n accessor: 'OldValue',\r\n Header: t(translations.OldValue) as string,\r\n },\r\n {\r\n accessor: 'NewValue',\r\n Header: t(translations.NewValue) as string,\r\n },\r\n {\r\n accessor: 'UserDisplayName',\r\n Header: t(translations.User) as string,\r\n },\r\n {\r\n accessor: 'Date',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport {\r\n getDefaultFilterDatePeriod,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const res: IFilterSettings[] = [\r\n {\r\n fieldName: 'Date',\r\n displayName: t(translations.Period),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { LinearProgress, useTheme } from '@material-ui/core';\r\nimport {\r\n DialogConfirm,\r\n DialogConfirmProps,\r\n} from 'app/components/DialogConfirm';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { PricingState } from '../../slice/types';\r\n\r\nexport interface CalculatePricingProps\r\n extends Pick<\r\n DialogConfirmProps,\r\n 'isOpen' | 'onClose' | 'onConfirm' | 'onCancel' | 'title'\r\n > {\r\n edit: boolean;\r\n credit?: PricingState;\r\n creditProcessing?: boolean;\r\n creditCompleted?: boolean;\r\n}\r\nconst CreditContainer = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n paddingTop: '16px',\r\n gap: 32,\r\n width: '100%',\r\n '& .creditItem': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n gap: 16,\r\n width: '100%',\r\n },\r\n}));\r\nexport function CalculatePricing({\r\n credit,\r\n creditProcessing,\r\n creditCompleted,\r\n edit,\r\n ...props\r\n}: CalculatePricingProps) {\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n \r\n ) : (\r\n \r\n
    \r\n \r\n {t(translations.Pricing_EstimatedCost)}\r\n \r\n \r\n {(\r\n t(\r\n edit\r\n ? translations.PricingConfirmationLabelEditText1\r\n : translations.PricingConfirmationLabelText1,\r\n ) as string\r\n ).replace('{0}', (credit?.credit || 0).toFixed(2))}\r\n \r\n
    \r\n {!!credit?.balance && credit?.balance !== null && (\r\n
    \r\n \r\n {t(translations.Pricing_Balance)}\r\n \r\n \r\n {(t(translations.Pricing_BalanceResult) as string).replace(\r\n '{0}',\r\n (credit?.balance || 0).toFixed(2),\r\n )}\r\n \r\n
    \r\n )}\r\n
    \r\n )\r\n }\r\n maxWidth={'sm'}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * ReservationDetails\r\n *\r\n */\r\nimport React from 'react';\r\nimport { Box } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n getSingleReservationStatus,\r\n IReservationEquipmentDto,\r\n RecurringReservationUpdateOptions,\r\n ReservationDetailsState,\r\n ReservationGlobalState,\r\n ReservationQueryStringParameters,\r\n ReservationStatus,\r\n TransferToReservation,\r\n} from './slice/types';\r\nimport { useReservationSlice } from './slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport {\r\n selectAsyncChangeLoading,\r\n selectByApprovalErrors,\r\n selectCloneReservations,\r\n selectConfirmAssistedReservations,\r\n selectEquipmentChangeCompleted,\r\n selectEquipmentsSettings,\r\n selectSubmitCalculateCredit,\r\n selectIsEdit,\r\n selectProcessing,\r\n selectReservation,\r\n selectReservationCompleted,\r\n selectReservationHasError,\r\n selectReservationNotFound,\r\n selectReservationProcessing,\r\n selectReservationSettings,\r\n selectSavedOfflineServices,\r\n selectTransferProcessing,\r\n selectTransferReservation,\r\n selectTransferStepCompleted,\r\n selectTransferToUser,\r\n selectTransferWaitingApproval,\r\n selectUserCanRequestApproval,\r\n selectUserTrainingData,\r\n selectCalculateCreditState,\r\n selectShowConfirmPricing,\r\n} from './slice/selectors';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { ReservationForm } from './ReservationForm';\r\nimport { selectRepetitiveData } from 'app/components/Forms/FormRepetitive/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport useGlobalSettingsHook from './components/useGlobalSettingsHook';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport {\r\n ApproveReservationButton,\r\n CancelReservationButton,\r\n CreateTrainingButton,\r\n SaveForLaterButton,\r\n SaveFormButton,\r\n TransferButton,\r\n} from './components/ReservationActions';\r\nimport { ApproveTrainingRecords } from './components/ApproveTrainingRecords';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { FormikProps } from 'formik';\r\nimport { TransferReservation } from './components/TransferReservation';\r\nimport { ReservationModifications } from './components/Modifications';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { Body, H3 } from 'app/components/Typography';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n SwitchActionsProps,\r\n SwitchTarget,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions';\r\nimport { Entity } from 'types/common';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { CalculatePricing } from './components/CalculatePricing';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { PrintToPDF } from 'app/components/PrintToPDF';\r\nimport { usePrintPDFSlice } from 'app/components/PrintToPDF/slice';\r\nimport { getPrintPDFDefaultSections } from './components/utils';\r\nimport { GetIsNotBillable } from './slice/getBudgetVisible';\r\n\r\nexport interface ReservationDetailsProps\r\n extends SidePanelContentProps,\r\n CoverProps {\r\n queryParams: ReservationQueryStringParameters;\r\n useSwitchButtons?: boolean;\r\n onCloseReservation?: () => void;\r\n}\r\n\r\nexport const ReservationDetails = React.memo(function ReservationDetails(\r\n props: ReservationDetailsProps,\r\n) {\r\n const {\r\n queryParams,\r\n useSidePanel,\r\n useSwitchButtons,\r\n closeCover,\r\n isCover,\r\n onCloseReservation,\r\n } = props;\r\n\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const { actions } = useReservationSlice();\r\n\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const { actions: printActions } = usePrintPDFSlice();\r\n const isMobile = DetectIsMobile();\r\n\r\n /// Refs ///\r\n const submitFormRef = React.useRef(null);\r\n const repetitiveFormRef = React.useRef(null);\r\n const customFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef | null>(null);\r\n\r\n /// selectors ///\r\n const processing = useSelector(selectProcessing);\r\n const reservation = useSelector(selectReservation);\r\n const reservationId = reservation.data?.Id ?? tryParseInt(queryParams.id);\r\n const reservationSettings = useSelector(selectReservationSettings);\r\n const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const repetitiveValues = useSelector(selectRepetitiveData);\r\n const actionCompleted = useSelector(selectReservationCompleted);\r\n const hasError = useSelector(selectReservationHasError);\r\n const reservationProcessing = useSelector(selectReservationProcessing);\r\n const confirmAssisted = useSelector(selectConfirmAssistedReservations);\r\n const assistedTrainingData = useSelector(selectUserTrainingData);\r\n const equipmentChangeCompleted = useSelector(selectEquipmentChangeCompleted);\r\n const transferProcessing = useSelector(selectTransferProcessing);\r\n const transferStepWaiting = useSelector(selectTransferWaitingApproval);\r\n const transferUser = useSelector(selectTransferToUser);\r\n const transferredForId = useSelector(selectTransferReservation);\r\n const transferStepCompleted = useSelector(selectTransferStepCompleted);\r\n const savedOfflineServices = useSelector(selectSavedOfflineServices);\r\n const {\r\n processing: creditProcessing,\r\n completed: creditCompleted,\r\n data: calculateCredit,\r\n } = useSelector(selectCalculateCreditState);\r\n const isCloned = useSelector(selectCloneReservations);\r\n const edit = useSelector(selectIsEdit);\r\n const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n const submitCalculateCredit = useSelector(selectSubmitCalculateCredit);\r\n const ByApprovalErrors = useSelector(selectByApprovalErrors);\r\n const userCanRequestApproval = useSelector(selectUserCanRequestApproval);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const reservationNotFound = useSelector(selectReservationNotFound);\r\n const showShortView = React.useMemo(() => {\r\n return isMobile || (useSidePanel && !sidePanelExpanded);\r\n }, [isMobile, sidePanelExpanded, useSidePanel]);\r\n const [print, setPrint] = React.useState(false);\r\n const [printExpanded, setPrintExpanded] = React.useState(false);\r\n const handlePrintToPDF = React.useCallback(() => {\r\n setPrint(true);\r\n if (!sidePanelExpanded) {\r\n dispatch(layoutActions.setExpanded(true));\r\n setPrintExpanded(true);\r\n }\r\n }, [dispatch, layoutActions, sidePanelExpanded]);\r\n const handleClosePrintToPDF = React.useCallback(() => {\r\n if (printExpanded) {\r\n dispatch(layoutActions.setExpanded(false));\r\n setPrintExpanded(false);\r\n }\r\n setPrint(false);\r\n }, [dispatch, layoutActions, printExpanded]);\r\n //cover\r\n // const [cover, setCover] = React.useState();\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(\r\n () => {\r\n if (confirmBeforeTransfer) {\r\n setShowTransfer(true);\r\n return false;\r\n } else {\r\n dispatch(actions.resetDetailsState());\r\n if (!!onCloseReservation) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n },\r\n () => {\r\n if (confirmBeforeTransfer) {\r\n setConfirmBeforeTransfer(false);\r\n }\r\n },\r\n useSidePanel,\r\n isCover,\r\n );\r\n /// Settings ///\r\n const globalSettings = useGlobalSettingsHook();\r\n /// Local State ///\r\n const [busy, setBusy] = React.useState(false);\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [showConfirmRecurring, setShowConfirmRecurring] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [showConfirmAssisted, setShowConfirmAssisted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [createTrainingOpen, setCreateTrainingOpen] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [confirmBeforeTransfer, setConfirmBeforeTransfer] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [showTransfer, setShowTransfer] = React.useState(\r\n undefined,\r\n );\r\n const [showCalculateCredit, setShowCalculateCredit] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [confirmCloned, setConfirmCloned] = React.useState(\r\n undefined,\r\n );\r\n const [canceled, setCanceled] = React.useState(\r\n undefined,\r\n );\r\n const showConfirmPricing = useSelector(selectShowConfirmPricing);\r\n const [openModifications, setOpenModifications] = React.useState(\r\n false,\r\n );\r\n const { newDate } = useSystemDate();\r\n /// Memo State ///\r\n const repeat = React.useMemo(() => {\r\n return edit && reservationSettings?.Repeat;\r\n }, [edit, reservationSettings]);\r\n const userReadOnly = IsReadOnlyUser(User);\r\n const IsAdmin = React.useMemo(() => {\r\n return (\r\n equipmentSettings?.IsAllAdmin ||\r\n User?.IsAllGroupOrLabTechAdmin(\r\n reservation?.data?.EquipmentsData.map(\r\n g => (g as IReservationEquipmentDto).ServiceGroupId,\r\n ),\r\n reservation?.data?.EquipmentsData.map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: ServiceType.Online,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n ) ||\r\n false\r\n );\r\n }, [equipmentSettings?.IsAllAdmin, User, reservation?.data?.EquipmentsData]);\r\n const isOwner = React.useMemo(() => {\r\n return reservation?.data?.BookedBy?.Id === User?.Id;\r\n }, [User?.Id, reservation?.data?.BookedBy]);\r\n const isUserGroupCoordinator = React.useMemo(() => {\r\n return (\r\n User &&\r\n User.Roles.includes(Roles.UserGroupCoord) &&\r\n (edit\r\n ? reservation?.data?.ADGroup?.Id === User.ActiveUserGroup?.Id\r\n : true)\r\n );\r\n }, [User, edit, reservation?.data?.ADGroup?.Id]);\r\n const trainingSessionEnabled = React.useMemo(() => {\r\n return (\r\n globalSettings.trainingSessionEnabled &&\r\n !equipmentSettings?.HideTrainingSession\r\n );\r\n }, [\r\n equipmentSettings?.HideTrainingSession,\r\n globalSettings.trainingSessionEnabled,\r\n ]);\r\n const trainingSignUp = React.useMemo(() => {\r\n return (\r\n trainingSessionEnabled &&\r\n (reservation?.data?.TrainingSignUp ||\r\n innerFormRef.current?.values.TrainingSignUp)\r\n //&&\r\n // innerFormRef.current?.values.EquipmentsData.length === 1\r\n );\r\n }, [reservation?.data?.TrainingSignUp, trainingSessionEnabled]);\r\n const allowOngoingModifications = React.useMemo(() => {\r\n return (\r\n isOwner &&\r\n reservationSettings?.Ongoing &&\r\n equipmentSettings?.AllowModification\r\n );\r\n }, [\r\n equipmentSettings?.AllowModification,\r\n isOwner,\r\n reservationSettings?.Ongoing,\r\n ]);\r\n const editable = React.useMemo(() => {\r\n return (\r\n IsAdmin ||\r\n isUserGroupCoordinator ||\r\n (isOwner && reservationSettings?.FutureReservation) ||\r\n (reservationSettings?.Ongoing && allowOngoingModifications)\r\n );\r\n }, [\r\n allowOngoingModifications,\r\n IsAdmin,\r\n isUserGroupCoordinator,\r\n reservationSettings?.FutureReservation,\r\n reservationSettings?.Ongoing,\r\n isOwner,\r\n ]);\r\n const terminationEnabled = React.useMemo(() => {\r\n return (\r\n globalSettings.reservationTerminationEnabled &&\r\n reservationSettings?.Ongoing &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin &&\r\n equipmentSettings?.AllowUsersToShortenReservations &&\r\n (IsAdmin || isOwner)\r\n );\r\n }, [\r\n IsAdmin,\r\n equipmentSettings?.AllowUsersToShortenReservations,\r\n globalSettings.reservationTerminationEnabled,\r\n isOwner,\r\n reservation?.data?.Status?.Id,\r\n reservationSettings?.Ongoing,\r\n ]);\r\n const allowSortenReservation = React.useMemo(() => {\r\n return globalSettings.reservationTerminationEnabled\r\n ? false\r\n : equipmentSettings?.AllowUsersToShortenReservations;\r\n }, [\r\n equipmentSettings?.AllowUsersToShortenReservations,\r\n globalSettings.reservationTerminationEnabled,\r\n ]);\r\n const timeEnabledForOwner = React.useMemo(() => {\r\n if (reservationSettings === undefined) {\r\n return false;\r\n }\r\n if (equipmentSettings === undefined) {\r\n return false;\r\n }\r\n return (\r\n reservationSettings.FutureReservation ||\r\n (reservationSettings.Ongoing &&\r\n (allowSortenReservation ||\r\n equipmentSettings.AllowModification ||\r\n equipmentSettings.AllowExtendReservation))\r\n );\r\n }, [equipmentSettings, reservationSettings, allowSortenReservation]);\r\n const timeEnabled = React.useMemo(() => {\r\n return (\r\n (IsAdmin || isUserGroupCoordinator || (isOwner && timeEnabledForOwner)) &&\r\n !reservationSettings?.TerminateReservation\r\n );\r\n }, [\r\n IsAdmin,\r\n isOwner,\r\n isUserGroupCoordinator,\r\n reservationSettings?.TerminateReservation,\r\n timeEnabledForOwner,\r\n ]);\r\n const canBeCanceled = React.useMemo(() => {\r\n return (\r\n edit &&\r\n editable &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin\r\n );\r\n }, [edit, editable, reservation?.data?.Status?.Id]);\r\n const canBeApproved = React.useMemo(() => {\r\n return (\r\n edit &&\r\n editable &&\r\n ((reservation?.data?.Status?.Id === ReservationStatus.Pending &&\r\n IsAdmin) ||\r\n (reservation?.data?.Status?.Id === ReservationStatus.PendingCoord &&\r\n isUserGroupCoordinator))\r\n );\r\n }, [\r\n IsAdmin,\r\n edit,\r\n editable,\r\n isUserGroupCoordinator,\r\n reservation?.data?.Status?.Id,\r\n ]);\r\n const canSaveForLater = React.useMemo(() => {\r\n return (\r\n globalSettings.draftReservationsEnabled &&\r\n equipmentSettings?.DraftSaveForLater &&\r\n (IsAdmin || isOwner) &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin\r\n );\r\n }, [\r\n IsAdmin,\r\n equipmentSettings?.DraftSaveForLater,\r\n globalSettings.draftReservationsEnabled,\r\n isOwner,\r\n reservation?.data?.Status?.Id,\r\n ]);\r\n const reservationCanceled = React.useMemo(() => {\r\n return (\r\n (edit && reservation?.data?.Status?.Id === ReservationStatus.Cancelled) ||\r\n reservation?.data?.Status?.Id === ReservationStatus.CancelledByAdmin\r\n );\r\n }, [edit, reservation?.data?.Status?.Id]);\r\n\r\n const calculateButtonVisible = React.useMemo(() => {\r\n if (equipmentSettings === undefined) {\r\n return false;\r\n }\r\n const isNotBillable = GetIsNotBillable(\r\n {\r\n budgetModuleEnabled: globalSettings.budgetModuleEnabled,\r\n billingModuleEnabled: globalSettings.billingModuleEnabled,\r\n priceSheetPricing: globalSettings.priceSheetPricing,\r\n },\r\n [\r\n {\r\n Billable: equipmentSettings.Billable,\r\n BudgetsTurnedOn: equipmentSettings.BudgetsTurnedOn,\r\n ServiceTypeId: ServiceType.Online,\r\n },\r\n ],\r\n );\r\n const result = isNotBillable ?? globalSettings.showCalculatePrice;\r\n return result;\r\n }, [\r\n equipmentSettings,\r\n globalSettings.budgetModuleEnabled,\r\n globalSettings.showCalculatePrice,\r\n globalSettings.billingModuleEnabled,\r\n globalSettings.priceSheetPricing,\r\n ]);\r\n const not_restricted = React.useMemo(() => {\r\n if (edit) {\r\n let budget =\r\n reservation?.data?.Budget !== null &&\r\n reservation?.data?.Budget !== undefined\r\n ? reservation.data.Budget\r\n : null;\r\n let noInstumentRestricted = globalSettings.reservationRestricted\r\n ? IsAdmin || isUserGroupCoordinator || isOwner\r\n : globalSettings.userGroupReservationRestricted\r\n ? reservation?.data?.ADGroup?.Id === User?.ActiveUserGroup?.Id ||\r\n IsAdmin ||\r\n isUserGroupCoordinator ||\r\n isOwner\r\n : true;\r\n let confidential =\r\n ((!!reservation?.data?.BudgetExperiment &&\r\n reservation?.data?.BudgetExperiment !== null) ||\r\n globalSettings.confidentialBudgetsEnabled) &&\r\n !!reservation?.data?.Budget &&\r\n (budget === null\r\n ? false\r\n : (budget as IBudgetFilterDto).Confidential ?? false);\r\n let noBudgetRestricted = confidential ? IsAdmin || isOwner : true;\r\n\r\n return noInstumentRestricted && noBudgetRestricted;\r\n }\r\n\r\n return true;\r\n }, [\r\n IsAdmin,\r\n User?.ActiveUserGroup?.Id,\r\n edit,\r\n globalSettings.confidentialBudgetsEnabled,\r\n globalSettings.reservationRestricted,\r\n globalSettings.userGroupReservationRestricted,\r\n isOwner,\r\n isUserGroupCoordinator,\r\n reservation?.data?.ADGroup?.Id,\r\n reservation?.data?.Budget,\r\n reservation?.data?.BudgetExperiment,\r\n ]);\r\n /// get initial state of the equipmentSettings\r\n // const equipmentSettings = React.useMemo(() => {\r\n // if (!!reservation.data) {\r\n // let sett = mapSettingsFromServices(\r\n // reservation.data.EquipmentsData as IReservationEquipmentDto[],\r\n // {} as ServiceSettingsState,\r\n // globalSettings,\r\n // );\r\n // return Object.assign(sett, {\r\n // CustomForms: reservationSettings?.CustomForms,\r\n // });\r\n // } else {\r\n // return {} as ServiceSettingsState;\r\n // }\r\n // }, [globalSettings, reservation.data, reservationSettings?.CustomForms]);\r\n /// mount effect - init ///\r\n React.useEffect(() => {\r\n if (!print && edit) {\r\n dispatch(printActions.setUseSections(true));\r\n dispatch(\r\n printActions.updateSections(\r\n getPrintPDFDefaultSections(\r\n t,\r\n globalSettings.ServiceRequestReservationEnabled && IsAdmin,\r\n (reservation?.data?.FormValues?.length ?? 0) > 0,\r\n ),\r\n ),\r\n );\r\n }\r\n }, [\r\n IsAdmin,\r\n dispatch,\r\n edit,\r\n globalSettings.ServiceRequestReservationEnabled,\r\n print,\r\n printActions,\r\n reservation?.data?.FormValues?.length,\r\n t,\r\n ]);\r\n const workOrderSwithProps = React.useMemo(() => {\r\n if (!edit) {\r\n let eqids = queryParams.selectedIds;\r\n let start = queryParams.Start;\r\n let end = queryParams.singleClick ? undefined : queryParams.End;\r\n let defaultMulti = globalSettings.multipleInstrumentsEnabled;\r\n if (reservation && reservation.data) {\r\n start = dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(reservation.data.StartTime),\r\n );\r\n end = queryParams.singleClick\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(reservation.data.EndTime),\r\n );\r\n defaultMulti =\r\n globalSettings.multipleInstrumentsEnabled &&\r\n reservation.data.EquipmentsData.length > 0;\r\n eqids = reservation.data.EquipmentsData.map(f => f.Id).join(',');\r\n }\r\n\r\n let p = {\r\n queryParams: {\r\n eqid: eqids,\r\n down: 'true',\r\n offH: 'true',\r\n eStart: start,\r\n offStart: start,\r\n offEnd: end,\r\n defaultMulti: defaultMulti.toString(),\r\n source: queryParams.source,\r\n id: undefined,\r\n aType: undefined,\r\n title: undefined,\r\n sympt: undefined,\r\n aStatus: undefined,\r\n aStart: undefined,\r\n desc: undefined,\r\n assetId: undefined,\r\n reason: undefined,\r\n sid: undefined,\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n useSwithButtons: useSwitchButtons,\r\n } as WorkOrderDetailsProps;\r\n return p;\r\n }\r\n return undefined;\r\n }, [\r\n edit,\r\n globalSettings.multipleInstrumentsEnabled,\r\n queryParams.End,\r\n queryParams.Start,\r\n queryParams.selectedIds,\r\n queryParams.singleClick,\r\n queryParams.source,\r\n reservation,\r\n useSwitchButtons,\r\n ]);\r\n const allowEditMultipleEquipments = React.useMemo(() => {\r\n return (\r\n globalSettings.multipleInstrumentsEnabled &&\r\n !trainingSignUp &&\r\n globalSettings.allowAddRemoveOnEditReservation\r\n );\r\n }, [\r\n globalSettings.allowAddRemoveOnEditReservation,\r\n globalSettings.multipleInstrumentsEnabled,\r\n trainingSignUp,\r\n ]);\r\n React.useEffect(() => {\r\n let active = firstLoad && !userReadOnly;\r\n // if (!reservation || !reservation.data) {\r\n\r\n // }\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initReservation({\r\n query: queryParams,\r\n globalSettings: globalSettings,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n firstLoad,\r\n globalSettings,\r\n queryParams,\r\n reservation,\r\n userReadOnly,\r\n ]);\r\n React.useEffect(() => {\r\n if (edit) {\r\n if (\r\n savedOfflineServices.length > 0 &&\r\n savedOfflineServices.some(f => f.Id < 1)\r\n ) {\r\n dispatch(layoutActions.setNotSavedChanges(true));\r\n }\r\n }\r\n }, [dispatch, edit, layoutActions, savedOfflineServices]);\r\n\r\n const handleCloselClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n if (!!onCloseReservation) {\r\n onCloseReservation();\r\n dispatch(actions.resetDetailsState());\r\n } else {\r\n closePanel({\r\n isCover: isCover || !!cover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n dispatch(actions.resetDetailsState());\r\n },\r\n } as SidePanelCloseState);\r\n }\r\n } else {\r\n dispatch(push('/reservations'));\r\n }\r\n }, [\r\n actions,\r\n closePanel,\r\n cover,\r\n dispatch,\r\n hasChanges,\r\n isCover,\r\n onCloseReservation,\r\n useSidePanel,\r\n ]);\r\n\r\n const handleSaveClick = React.useCallback(\r\n (e: any) => {\r\n if (repeat) {\r\n setShowConfirmRecurring(true);\r\n } else {\r\n handleSubmitForm(e);\r\n }\r\n },\r\n [repeat],\r\n );\r\n\r\n const cancelReservation = React.useCallback(() => {\r\n let status = getSingleReservationStatus(\r\n ReservationStatus.Cancelled as number,\r\n );\r\n dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n setCanceled(true);\r\n }, [actions, dispatch]);\r\n const approveReservation = React.useCallback(() => {\r\n let status = getSingleReservationStatus(\r\n ReservationStatus.Approved as number,\r\n );\r\n dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n }, [actions, dispatch]);\r\n const draftReservation = React.useCallback(() => {\r\n let status = getSingleReservationStatus(ReservationStatus.Draft as number);\r\n dispatch(actions.extendReservationSettings({ SaveForLater: true }));\r\n dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n }, [actions, dispatch]);\r\n const handleChangeStatus = React.useCallback(\r\n (event: any, status: ReservationStatus) => {\r\n if (status === ReservationStatus.Cancelled) {\r\n cancelReservation();\r\n } else if (status === ReservationStatus.Approved) {\r\n approveReservation();\r\n } else if (status === ReservationStatus.Draft) {\r\n draftReservation();\r\n }\r\n setTimeout(() => handleSaveClick(event), 10);\r\n },\r\n [approveReservation, cancelReservation, draftReservation, handleSaveClick],\r\n );\r\n const handleSubmitForm = (e: any) => {\r\n if (customFormRef.current) {\r\n customFormRef.current(e);\r\n setTimeout(() => {\r\n if (repetitiveFormRef.current) {\r\n repetitiveFormRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n }, 50);\r\n } else {\r\n if (repetitiveFormRef.current) {\r\n repetitiveFormRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (\r\n values: ReservationDetailsState,\r\n customFormFiles: IFormFileValue[],\r\n originalFormFiles: IFormFileValue[],\r\n ) => {\r\n setBusy(true);\r\n if (submitCalculateCredit) {\r\n setShowCalculateCredit(true);\r\n let value = {\r\n details: values,\r\n settings: reservationSettings,\r\n customFormFiles: [],\r\n RepetitiveOptions: repetitiveValues,\r\n offlineServices: savedOfflineServices,\r\n } as ReservationGlobalState;\r\n dispatch(\r\n actions.createReservation({\r\n state: value,\r\n calcCredit: true,\r\n }),\r\n );\r\n } else {\r\n if (edit) {\r\n dispatch(\r\n actions.updateReservation({\r\n current: values,\r\n original: reservation.data || values,\r\n currentCustomFormFiles: customFormFiles,\r\n originalCustomFormFiles: originalFormFiles,\r\n offlineServices: savedOfflineServices,\r\n settings: reservationSettings,\r\n }),\r\n );\r\n } else {\r\n let value = {\r\n details: {\r\n ...values,\r\n SampleRunId: reservation.data?.SampleRunId,\r\n },\r\n settings: reservationSettings,\r\n customFormFiles: customFormFiles,\r\n RepetitiveOptions: repetitiveValues,\r\n offlineServices: savedOfflineServices,\r\n } as ReservationGlobalState;\r\n dispatch(\r\n actions.createReservation({\r\n state: value,\r\n calcCredit: undefined,\r\n }),\r\n );\r\n }\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n edit,\r\n submitCalculateCredit,\r\n repetitiveValues,\r\n reservation.data,\r\n reservationSettings,\r\n savedOfflineServices,\r\n ],\r\n );\r\n const [offlineServicesErrors, setOfflineServicesErrors] = React.useState<\r\n ErrorServices[]\r\n >([]);\r\n const handleSetError = React.useCallback(\r\n (error: ErrorServices) => {\r\n if (error.error !== undefined) {\r\n setOfflineServicesErrors([\r\n ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n error,\r\n ]);\r\n } else {\r\n setOfflineServicesErrors([\r\n ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n ]);\r\n }\r\n },\r\n [offlineServicesErrors],\r\n );\r\n const handleTerminate = React.useCallback(() => {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'EndTime',\r\n fieldValue: dateUtils.formatISO(newDate()),\r\n }),\r\n );\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'Remarks',\r\n fieldValue: t(translations.AutoEndReservation_remarks) as string,\r\n }),\r\n );\r\n setTimeout(() => {\r\n dispatch(\r\n actions.updateReservation({\r\n current:\r\n innerFormRef?.current?.values ||\r\n reservation.data ||\r\n ({} as ReservationDetailsState),\r\n original: reservation.data || ({} as ReservationDetailsState),\r\n currentCustomFormFiles: [],\r\n originalCustomFormFiles: [],\r\n offlineServices: savedOfflineServices,\r\n settings: reservationSettings,\r\n terminate: true,\r\n }),\r\n );\r\n }, 10);\r\n }, [\r\n actions,\r\n dispatch,\r\n newDate,\r\n reservation.data,\r\n reservationSettings,\r\n savedOfflineServices,\r\n t,\r\n ]);\r\n //------ Confirm Repetitive Update/Delete handlers -------//\r\n const handleUpdateAllRecurrent = (e: any) => {\r\n dispatch(\r\n actions.updateReservationSettings({\r\n RecurringUpdateOption: RecurringReservationUpdateOptions.All,\r\n }),\r\n );\r\n handleSubmitForm(e);\r\n setShowConfirmRecurring(false);\r\n setCanceled(undefined);\r\n };\r\n const handleUpdateFollowing = (e: any) => {\r\n dispatch(\r\n actions.updateReservationSettings({\r\n RecurringUpdateOption: RecurringReservationUpdateOptions.Following,\r\n }),\r\n );\r\n handleSubmitForm(e);\r\n setShowConfirmRecurring(false);\r\n setCanceled(undefined);\r\n };\r\n const handleUpdateJustOne = (e: any) => {\r\n dispatch(\r\n actions.updateReservationSettings({\r\n RecurringUpdateOption:\r\n RecurringReservationUpdateOptions.CurrentReservation,\r\n }),\r\n );\r\n handleSubmitForm(e);\r\n setShowConfirmRecurring(false);\r\n setCanceled(undefined);\r\n };\r\n const assistedApproveOnse = () => {\r\n setShowConfirmAssisted(false);\r\n dispatch(actions.resetAssisteTrainingData());\r\n dispatch(layoutActions.setRefreshTable(true));\r\n if (!isCloned) {\r\n handleCloselClick();\r\n }\r\n };\r\n const handleByApprovalConfirm = React.useCallback(\r\n (e: any) => {\r\n dispatch(\r\n actions.updateReservationSettings({\r\n UserRequestedByApproval: true,\r\n }),\r\n );\r\n dispatch(actions.setByApprovalErrors(undefined));\r\n },\r\n [actions, dispatch],\r\n );\r\n const editAssisted = React.useCallback(\r\n (p: TrainingDetailsProps, reset: boolean) => {\r\n openPanel({\r\n renderPageType: RenderPageType.TrainingDetails,\r\n renderPageProps: {\r\n ...p,\r\n useSidePanel: true,\r\n isCover: useSidePanel,\r\n onTrainingClose: () => {\r\n setCreateTrainingOpen(false);\r\n handleCloselClick();\r\n },\r\n } as TrainingDetailsProps,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n });\r\n setCreateTrainingOpen(true);\r\n dispatch(actions.resetAssisteTrainingData());\r\n },\r\n [openPanel, useSidePanel, dispatch, actions, handleCloselClick],\r\n );\r\n const handleCancelTransfer = () => {\r\n if (transferUser !== null) {\r\n dispatch(\r\n actions.cancelTransfer({\r\n User: transferUser,\r\n ReservtionId: transferredForId || reservation?.data?.Id || 0,\r\n }),\r\n );\r\n }\r\n };\r\n const handleEquipmentClick = React.useCallback(\r\n (equipment: Entity) => {\r\n let assetProps = {\r\n identifier: {\r\n serviceId: equipment.Id,\r\n serviceType: 'Online',\r\n },\r\n useSidePanel: true,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: assetProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const handleRestrictionsClick = React.useCallback(\r\n (equipment: Entity) => {\r\n let restrictProps = {\r\n serviceId: equipment.Id,\r\n showTable: IsAdmin,\r\n serviceGroupId: (equipment as IReservationEquipmentDto).ServiceGroupId,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.RestrictionDetails,\r\n renderPageProps: restrictProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [IsAdmin, useSidePanel, openPanel],\r\n );\r\n const handleOfflineServiceClick = React.useCallback(\r\n (service: IOtherServices) => {\r\n if (edit) {\r\n let otherProps = {\r\n initialService: service,\r\n saveCreatable: true,\r\n queryParams: {\r\n id: '' + service.Id ?? -1,\r\n },\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.OtherServiceDetails,\r\n renderPageProps: otherProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n }\r\n },\r\n [edit, openPanel, useSidePanel],\r\n );\r\n const handleWorkTypeClick = React.useCallback(\r\n (\r\n event: IWorkOrderTypeDto,\r\n equipmentIds: number[],\r\n reservationId: number,\r\n ) => {\r\n let woProps = {\r\n queryParams: {\r\n id: undefined,\r\n aType: event.Id.toString(),\r\n eqid: equipmentIds.join(','),\r\n reservationId: reservationId.toString(),\r\n } as WorkOrderQueryStringParameters,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: woProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n onClose: () => dispatch(actions.setRefreshWorkOrderLink(true)),\r\n } as SidePanelOpenState);\r\n },\r\n [actions, dispatch, openPanel, useSidePanel],\r\n );\r\n const handleAddBatchClick = React.useCallback(\r\n (batch: IInventoryBatchDto | null, serviceTypeId: number) => {\r\n let batchProps = {\r\n initialBatch: batch ?? undefined,\r\n queryParams: {\r\n id: '' + (batch?.Id ?? -1),\r\n stid: '' + serviceTypeId,\r\n },\r\n saveCreatable: useSidePanel,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.InventoryBatch,\r\n renderPageProps: batchProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const handleCalculateCredit = React.useCallback(\r\n (e: any) => {\r\n dispatch(actions.setSubmitCalculateCredit(true));\r\n handleSubmitForm(e);\r\n },\r\n [actions, dispatch],\r\n );\r\n\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (actionCompleted === true) {\r\n setBusy(false);\r\n setRequestCompleted(true);\r\n if (!hasError) {\r\n if (confirmAssisted && assistedTrainingData !== null) {\r\n setShowConfirmAssisted(true);\r\n } else {\r\n setShowConfirmAssisted(false);\r\n if (!isCloned && !createTrainingOpen) {\r\n handleCloselClick();\r\n }\r\n }\r\n }\r\n if (terminationEnabled) {\r\n dispatch(actions.resetTerminateState());\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n actions,\r\n assistedTrainingData,\r\n confirmAssisted,\r\n createTrainingOpen,\r\n dispatch,\r\n handleCloselClick,\r\n hasError,\r\n isCloned,\r\n processing,\r\n reservationId,\r\n terminationEnabled,\r\n ]);\r\n React.useEffect(() => {\r\n let active = creditProcessing === false;\r\n if (showConfirmPricing !== true) {\r\n setBusy(false);\r\n //TODO: simplify following block\r\n if (active) {\r\n if (creditCompleted === true && !showCalculateCredit) {\r\n dispatch(actions.resetCreditState());\r\n }\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n creditCompleted,\r\n creditProcessing,\r\n dispatch,\r\n showCalculateCredit,\r\n showConfirmPricing,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (transferProcessing === false && transferStepCompleted === true) {\r\n setShowTransfer(false);\r\n }\r\n }, [actions, dispatch, transferProcessing, transferStepCompleted]);\r\n /// actions ///\r\n const leftActions = React.useMemo(() => {\r\n let mactions = [] as ActionRenderer[];\r\n if (!edit || (edit && (IsAdmin || isUserGroupCoordinator || isOwner))) {\r\n mactions.push(() => (\r\n \r\n }\r\n onClick={e => {\r\n dispatch(actions.setCloneReservation(false));\r\n dispatch(actions.resetDetailsErrorsState());\r\n handleSaveClick(e);\r\n }}\r\n disabled={\r\n busy ||\r\n equipmentChangeCompleted === false ||\r\n transferStepWaiting === true ||\r\n (edit && reservationCanceled && !IsAdmin)\r\n }\r\n processing={!requestCompleted && busy}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ));\r\n }\r\n if (edit) {\r\n if (!!equipmentSettings && !!reservationSettings) {\r\n if (canBeCanceled) {\r\n mactions.push(() => (\r\n \r\n }\r\n onClick={e =>\r\n handleChangeStatus(e, ReservationStatus.Cancelled)\r\n }\r\n disabled={\r\n busy ||\r\n transferStepWaiting === true ||\r\n equipmentChangeCompleted === false\r\n }\r\n variant=\"white\"\r\n processing={!requestCompleted && busy}\r\n text={\r\n showShortView\r\n ? t(translations.Cancel)\r\n : t(translations.CancelReservation)\r\n }\r\n />\r\n \r\n ));\r\n }\r\n if (canBeApproved) {\r\n mactions.push(() => (\r\n \r\n }\r\n onClick={e => handleChangeStatus(e, ReservationStatus.Approved)}\r\n disabled={\r\n busy ||\r\n transferStepWaiting === true ||\r\n equipmentChangeCompleted === false\r\n }\r\n variant=\"white\"\r\n processing={!requestCompleted && busy}\r\n text={\r\n showShortView\r\n ? t(translations.Approve)\r\n : t(translations.ApproveReservation)\r\n }\r\n />\r\n \r\n ));\r\n }\r\n if (\r\n (equipmentSettings.AllowedToTransfer ||\r\n equipmentSettings.AllowedToTransferAll) &&\r\n !transferStepWaiting &&\r\n !repeat &&\r\n canBeCanceled\r\n ) {\r\n mactions.push(() => (\r\n \r\n {\r\n if (hasChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n setConfirmBeforeTransfer(true);\r\n } else {\r\n setShowTransfer(true);\r\n }\r\n }}\r\n disabled={busy}\r\n variant=\"white\"\r\n title={t(translations.TransferReservation)}\r\n processing={transferProcessing}\r\n text={t(translations.Transfer)}\r\n />\r\n \r\n ));\r\n }\r\n }\r\n }\r\n if (\r\n IsAdmin &&\r\n globalSettings.assistedReservationsEnabled &&\r\n globalSettings.tutoringModulesEnabled &&\r\n equipmentSettings?.IsEquipmentTutoring &&\r\n edit &&\r\n assistedTrainingData !== null &&\r\n assistedTrainingData.Equipments.some(f => f.TrainingRecordId === null)\r\n ) {\r\n mactions.push(() => (\r\n \r\n }\r\n onClick={e =>\r\n editAssisted(\r\n {\r\n id: undefined,\r\n equId: undefined,\r\n equIds: assistedTrainingData.Equipments.map(\r\n f => f.EquipmentId,\r\n ).join(','),\r\n fatherId: reservation.data?.FatherId?.toString() ?? undefined,\r\n rid:\r\n reservation.data?.FatherId !== null &&\r\n reservation.data?.FatherId !== undefined\r\n ? undefined\r\n : reservation.data?.Id !== null\r\n ? reservation.data?.Id.toString()\r\n : undefined,\r\n date: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n reservation.data?.StartTime ?? new Date(),\r\n ),\r\n ),\r\n user: reservation.data?.BookedBy?.Id,\r\n useSidePanel: true,\r\n } as TrainingDetailsProps,\r\n false,\r\n )\r\n }\r\n disabled={busy}\r\n variant=\"white\"\r\n text={t(translations.CreateTraining)}\r\n />\r\n \r\n ));\r\n }\r\n if (calculateButtonVisible) {\r\n mactions.push(() => (\r\n }\r\n onClick={e => handleCalculateCredit(e)}\r\n title={\r\n offlineServicesErrors.length > 0\r\n ? (t(translations.OfflineServicesError_info) as string)\r\n : (t(translations.CalculatePricing_info) as string)\r\n }\r\n disabled={\r\n creditProcessing ||\r\n equipmentChangeCompleted === false ||\r\n offlineServicesErrors.length > 0\r\n }\r\n processing={creditProcessing}\r\n >\r\n {t(translations.CalculatePricing)}\r\n \r\n ));\r\n }\r\n if (canSaveForLater) {\r\n mactions.push(() => (\r\n \r\n }\r\n onClick={e => handleChangeStatus(e, ReservationStatus.Draft)}\r\n disabled={\r\n busy ||\r\n transferStepWaiting === true ||\r\n equipmentChangeCompleted === false\r\n }\r\n variant=\"white\"\r\n processing={!requestCompleted && busy}\r\n text={t(translations.SaveForLater)}\r\n />\r\n \r\n ));\r\n }\r\n if (edit && (IsAdmin || isUserGroupCoordinator || isOwner)) {\r\n mactions.push(() => (\r\n }\r\n aria-label=\"history\"\r\n onClick={() => setOpenModifications(true)}\r\n >\r\n {t(translations.ModificationsHistory)}\r\n \r\n ));\r\n }\r\n if (IsAdmin || isOwner) {\r\n mactions.push(() => (\r\n }\r\n aria-label=\"clone\"\r\n disabled={\r\n busy ||\r\n equipmentChangeCompleted === false ||\r\n transferStepWaiting === true ||\r\n (edit && reservationCanceled && !IsAdmin)\r\n }\r\n title={t(translations.res_SaveAndClone_info)}\r\n onClick={e => {\r\n dispatch(actions.resetDetailsErrorsState());\r\n if (edit) {\r\n if (hasChanges) {\r\n setConfirmCloned(hasChanges);\r\n } else {\r\n dispatch(actions.setCloneReservation(true));\r\n handleSaveClick(e);\r\n }\r\n } else {\r\n dispatch(actions.setCloneReservation(true));\r\n handleSaveClick(e);\r\n }\r\n }}\r\n >\r\n {edit ? t(translations.SaveAndClone) : t(translations.CreateAndClone)}\r\n \r\n ));\r\n }\r\n mactions.push(() => (\r\n \r\n }\r\n size=\"small\"\r\n onClick={e => {\r\n dispatch(\r\n appSettingsActions.navigate(\r\n toLocationDescriptor({\r\n path: '/reservations',\r\n search: { relId: reservationId },\r\n }),\r\n ),\r\n );\r\n if (sidePanelExpanded) {\r\n dispatch(layoutActions.setExpanded(false));\r\n }\r\n }}\r\n >\r\n {t(translations.ShowRelatedReservations)}\r\n \r\n \r\n ));\r\n if (edit) {\r\n mactions.push(() => (\r\n }\r\n aria-label=\"print\"\r\n onClick={handlePrintToPDF}\r\n title={t(translations.PrintPdf)}\r\n disabled={print}\r\n >\r\n {t(translations.PrintPdf)}\r\n \r\n ));\r\n }\r\n return mactions;\r\n }, [\r\n IsAdmin,\r\n actions,\r\n appSettingsActions,\r\n assistedTrainingData,\r\n busy,\r\n calculateButtonVisible,\r\n canBeApproved,\r\n canBeCanceled,\r\n canSaveForLater,\r\n creditProcessing,\r\n dispatch,\r\n edit,\r\n editAssisted,\r\n equipmentChangeCompleted,\r\n equipmentSettings,\r\n globalSettings.assistedReservationsEnabled,\r\n globalSettings.tutoringModulesEnabled,\r\n handleCalculateCredit,\r\n handleChangeStatus,\r\n handlePrintToPDF,\r\n handleSaveClick,\r\n hasChanges,\r\n isOwner,\r\n isUserGroupCoordinator,\r\n layoutActions,\r\n offlineServicesErrors.length,\r\n print,\r\n repeat,\r\n requestCompleted,\r\n reservation.data?.BookedBy?.Id,\r\n reservation.data?.FatherId,\r\n reservation.data?.Id,\r\n reservation.data?.StartTime,\r\n reservationCanceled,\r\n reservationId,\r\n reservationSettings,\r\n showShortView,\r\n sidePanelExpanded,\r\n t,\r\n transferProcessing,\r\n transferStepWaiting,\r\n ]);\r\n\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n \r\n \r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCloselClick, t]);\r\n\r\n const pageTitle = React.useMemo(() => {\r\n return reservation?.data\r\n ? edit\r\n ? ` ${\r\n isCloned\r\n ? t(translations.CloneReservation)\r\n : t(translations.Reservation)\r\n } #${reservationId || 'N/A'}`\r\n : reservation.data.TrainingSignUp\r\n ? t(translations.TrainingSignUp)\r\n : ` ${\r\n isCloned\r\n ? t(translations.CloneReservation)\r\n : t(translations.AddReservation)\r\n }`\r\n : undefined;\r\n }, [edit, isCloned, reservation.data, reservationId, t]);\r\n const pageName = React.useMemo(() => {\r\n return edit\r\n ? t(translations.menu_ReservationDetails)\r\n : t(translations.menu_NewReservation);\r\n }, [edit, t]);\r\n const useSwitchActions = React.useMemo(() => {\r\n return (\r\n !edit && IsAdmin && !reservation.data?.TransferFromId && useSwitchButtons\r\n );\r\n }, [IsAdmin, edit, reservation.data?.TransferFromId, useSwitchButtons]);\r\n\r\n const switchState = React.useMemo(() => {\r\n return !!workOrderSwithProps && !edit && useSwitchButtons\r\n ? ({\r\n target: SwitchTarget.WorkOrder,\r\n getProps: () => workOrderSwithProps,\r\n } as SwitchActionsProps)\r\n : undefined;\r\n }, [edit, useSwitchButtons, workOrderSwithProps]);\r\n const ByApprovalAvailable = React.useMemo(() => {\r\n return (\r\n userCanRequestApproval === true &&\r\n ByApprovalErrors !== undefined &&\r\n ByApprovalErrors.length > 0\r\n );\r\n }, [ByApprovalErrors, userCanRequestApproval]);\r\n\r\n /// render ///\r\n return (\r\n \r\n {\r\n setShowConfirmRecurring(false);\r\n }}\r\n actions={[\r\n () => (\r\n \r\n ),\r\n () => (\r\n \r\n ),\r\n ]}\r\n />\r\n ) : confirmCloned ? (\r\n {\r\n dispatch(actions.setCloneReservation(true));\r\n handleSaveClick(e);\r\n setConfirmCloned(false);\r\n }}\r\n maxWidth=\"md\"\r\n onCancel={() => {\r\n setConfirmCloned(false);\r\n }}\r\n />\r\n ) : requestCompleted &&\r\n confirmAssisted &&\r\n assistedTrainingData !== null ? (\r\n \r\n ) : showTransfer ? (\r\n {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: 1,\r\n ServiceGroupId: f.ServiceGroupId,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n })}\r\n adGroup={reservation?.data?.ADGroup?.Id}\r\n trnsferSubmitted={transferProcessing}\r\n handleTransfer={value => {\r\n let transfer = {\r\n User: value,\r\n ReservtionId: reservation?.data?.Id ?? 0,\r\n } as TransferToReservation;\r\n dispatch(actions.transferReservation(transfer));\r\n }}\r\n user={User}\r\n onClose={() => setShowTransfer(false)}\r\n />\r\n ) : showCalculateCredit ? (\r\n setShowCalculateCredit(false)}\r\n edit={edit}\r\n credit={calculateCredit}\r\n creditCompleted={creditCompleted}\r\n creditProcessing={creditProcessing}\r\n />\r\n ) : showConfirmPricing ? (\r\n dispatch(actions.сonfirmPricing(true))}\r\n onCancel={() => dispatch(actions.сonfirmPricing(false))}\r\n onClose={() => dispatch(actions.сonfirmPricing(false))}\r\n edit={edit}\r\n credit={calculateCredit}\r\n creditCompleted={creditCompleted}\r\n creditProcessing={\r\n creditProcessing || calculateCredit === undefined\r\n }\r\n />\r\n ) : !!openModifications ? (\r\n setOpenModifications(value)}\r\n resId={reservation?.data?.Id ?? 0}\r\n />\r\n ) : ByApprovalAvailable ? (\r\n \r\n {!!ByApprovalErrors &&\r\n ByApprovalErrors.map((error, index) => (\r\n \r\n {error}\r\n \r\n ))}\r\n {t(translations.ReservationConfirmByApproval)}\r\n \r\n }\r\n confirmButtonLabel={t(translations.Confirm)}\r\n onConfirm={handleByApprovalConfirm}\r\n maxWidth=\"md\"\r\n onCancel={() => {\r\n dispatch(actions.setByApprovalErrors(undefined));\r\n dispatch(actions.setUserCanRequestApproval(undefined));\r\n }}\r\n />\r\n ) : (\r\n <>\r\n )\r\n }\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n coverClosed={coverClosed}\r\n >\r\n {reservation?.data !== undefined && !processing ? (\r\n not_restricted ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n

    {t(translations.RestrictedNotAllowed) as string}

    \r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Continue)}\r\n \r\n \r\n
    \r\n )\r\n ) : reservation?.data === undefined &&\r\n !processing &&\r\n (reservationNotFound || userReadOnly) ? (\r\n \r\n \r\n

    {t(translations.RestrictedNotAllowed) as string}

    \r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Continue)}\r\n \r\n \r\n
    \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n
    \r\n );\r\n});\r\n","export enum MinTimeAheadPeriodTypes {\r\n Hours = 0,\r\n Days = 1,\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/Restrictions';\r\n\r\nexport const RestrictionsApi = {\r\n getRestrictionByService: (id: number | undefined) => {\r\n return httpClient.get(url + '/' + (id ?? -1));\r\n },\r\n};\r\n","export enum TrainingStatus {\r\n Passed = 1,\r\n Missing = 2,\r\n Expired = 3,\r\n}\r\nexport enum PrerequisiteFor {\r\n NotAllow = 0,\r\n WithinMyCore = 1,\r\n WithinCorAssetCatGroup = 2,\r\n WithinCoreAssetCat = 3,\r\n WithinSpecificCore = 4,\r\n AccrossSystem = 5,\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { UserPicker } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IRestrictedUserPermissionResult } from 'api/odata/generated/entities/IRestrictedUserPermissionResult';\r\nimport { Entity } from 'types/common';\r\n\r\nimport { translations } from 'locales/translations';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box, makeStyles, Theme, createStyles } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { SimpleList } from 'app/components/BasicList/StyledList';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface UserOwnPermissionsProps {\r\n user: Entity | null;\r\n isAdmin?: boolean;\r\n onUserChange: (value: Entity | null) => void;\r\n permissions: IRestrictedUserPermissionResult[];\r\n permLoading: boolean;\r\n restrictedOption: boolean | null;\r\n EquipmentName: string;\r\n serviceGroupId: number;\r\n serviceId: number;\r\n}\r\n\r\nexport const UserOwnPermissions = React.memo(function UserOwnPermissions(\r\n props: UserOwnPermissionsProps,\r\n) {\r\n const {\r\n user,\r\n isAdmin,\r\n onUserChange,\r\n permissions,\r\n permLoading,\r\n restrictedOption,\r\n EquipmentName,\r\n serviceGroupId,\r\n serviceId,\r\n } = props;\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const handleUserChange = React.useCallback(\r\n (value: Entity | null) => {\r\n onUserChange(value);\r\n },\r\n [onUserChange],\r\n );\r\n const userIsAdmin = React.useMemo(() => {\r\n if (user === null) {\r\n return false;\r\n } else {\r\n return (\r\n (user as IUserFilterDto)?.ServiceGroupIds?.some(\r\n f => f === serviceGroupId,\r\n ) ||\r\n (user as IUserFilterDto)?.Services?.some(f => f.Id === serviceId) ||\r\n (user as IUserFilterDto)?.IsAdminPanel\r\n );\r\n }\r\n }, [serviceGroupId, serviceId, user]);\r\n return (\r\n \r\n {isAdmin && (\r\n \r\n handleUserChange(value)}\r\n selectArray={[\r\n 'Id',\r\n 'Name',\r\n 'UserGroups',\r\n 'Budgets',\r\n 'IsAdminPanel',\r\n 'IsEquipmentAdmin',\r\n 'IsGroupAdmin',\r\n 'IsLabTech',\r\n 'Services',\r\n 'ServiceGroupIds',\r\n ]}\r\n />\r\n \r\n )}\r\n\r\n {user !== null && (\r\n \r\n \r\n {permLoading ? (\r\n \r\n \r\n \r\n \r\n ) : restrictedOption === null && !userIsAdmin ? (\r\n \r\n ) : permissions.length > 0 ? (\r\n \r\n {permissions.filter(x => x.Valid === true).length > 0 && (\r\n \r\n \r\n {'Allowed on:'}\r\n \r\n \r\n {permissions\r\n .filter(x => x.Valid === true)\r\n .map(item => (\r\n \r\n \r\n \r\n \r\n {`${item.PermissionName} - ${item.TimeSlotTypeName}`}\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n )}\r\n {permissions.filter(x => x.Valid === false).length > 0 && (\r\n \r\n \r\n {'Not allowed on:'}\r\n \r\n \r\n {permissions\r\n .filter(x => x.Valid === false)\r\n .map((item, index) => (\r\n \r\n \r\n \r\n \r\n {`${item.TimeSlotTypeName}`}\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n )}\r\n \r\n ) : (\r\n \r\n {user !== null ? (\r\n \r\n {t(translations.NoAdditionalRestrictionsFound)}\r\n \r\n ) : (\r\n <>\r\n )}\r\n \r\n )}\r\n \r\n }\r\n />\r\n \r\n )}\r\n \r\n );\r\n});\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n permRoot: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '8px',\r\n },\r\n cardContent: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n padding: '12px',\r\n width: '100%',\r\n gap: 8,\r\n },\r\n cardTitle: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n height: 20,\r\n },\r\n title: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n gap: 8,\r\n },\r\n titleOverRule: {\r\n display: 'inline-block',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '30ch',\r\n [theme.breakpoints.down('sm')]: {\r\n maxWidth: '25ch',\r\n },\r\n },\r\n cardContentRows: {\r\n padding: 0,\r\n margin: 0,\r\n },\r\n contentRow: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: 8,\r\n },\r\n rowOverRule: {\r\n display: 'inline-block',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '29ch',\r\n },\r\n rowTitle: {\r\n color: theme.palette.common.graySubtitle,\r\n paddingRight: 8,\r\n display: 'inline',\r\n },\r\n rowText: {\r\n color: theme.palette.common.blackRegular,\r\n display: 'inline',\r\n '& > *': {\r\n display: 'inherit',\r\n },\r\n },\r\n cardActions: {\r\n justifyContent: 'space-between',\r\n padding: '0px',\r\n gap: 8,\r\n width: '100%',\r\n },\r\n cardActionsButtons: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n gap: 8,\r\n justifyContent: 'flex-start',\r\n width: '100%',\r\n },\r\n }),\r\n);\r\n","import { httpClient } from './HttpClient';\r\n\r\nvar restUrl = '/api/odata/v4/RestrictedUserPermissions';\r\n\r\nexport const UserPermissionsApi = {\r\n getUserRestrictions: (payload: { serviceId: number; username: string }) => {\r\n return httpClient.post(restUrl + '/UserPermissions', payload);\r\n },\r\n getUserSlotPermissions: (payload: {\r\n serviceId: number;\r\n username: string;\r\n }) => {\r\n return httpClient.post(restUrl + '/UserSlotPermissions', payload);\r\n },\r\n};\r\n","import { Box } from '@material-ui/core';\r\nimport { RestrictionsApi } from 'api/RestrictionsApi';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { MinTimeAheadPeriodTypes } from 'enums/MinTimeAheadPeriodTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { IRestrictions } from '../../AssetPopUp/IAsset';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { UserOwnPermissions } from './components/UserOwnPermissions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { IUserRestrictionsResult } from 'api/odata/generated/entities/IRestrictedUserPermissionResult';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TrainingStatus } from 'enums/TrainingStatus';\r\nimport { UserPermissionsApi } from 'api/UserPermissionsApi';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport {\r\n convertAuthToIUserFilterDto,\r\n IUserFilterDto,\r\n} from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { BasicCard } from 'app/components/BasicCards';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IsAssetImageExist } from 'types/AppSettings';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface InstrumentRestrictionsProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n serviceId?: number;\r\n serviceGroupId?: number;\r\n initUser?: string;\r\n onClose?: () => void;\r\n showTable?: boolean;\r\n assetPickerDisabled?: boolean;\r\n withNoPadding?: boolean;\r\n useShortView?: boolean;\r\n hideEquipmentFormTitle?: boolean;\r\n withNoWrapper?: boolean;\r\n}\r\nexport interface Prerequisites {\r\n Id: number;\r\n Name: string;\r\n ServiceId: number;\r\n StatusName?: string;\r\n StatusId?: number;\r\n ImageName?: string;\r\n}\r\nexport function InstrumentRestrictions(props: InstrumentRestrictionsProps) {\r\n const {\r\n serviceId,\r\n serviceGroupId,\r\n useSidePanel,\r\n initUser,\r\n assetPickerDisabled,\r\n hideEquipmentFormTitle,\r\n withNoPadding,\r\n useShortView,\r\n isCover,\r\n closeCover,\r\n withNoWrapper,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const authuser = useSelector(selectAuthenticatedUser);\r\n const appSettings = useSelector(selectAppSettings);\r\n //const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const isMobile = DetectIsMobile();\r\n const [equipmentId, setEquipmentId] = React.useState(\r\n serviceId,\r\n );\r\n const [equipmentGroupId, setEquipmentGroupId] = React.useState<\r\n number | undefined\r\n >(serviceGroupId);\r\n const [\r\n selectedService,\r\n setSelectedService,\r\n ] = useAsyncExtendedState(null);\r\n const isAdmin = React.useMemo(() => {\r\n return (\r\n authuser !== undefined &&\r\n (authuser.HasAdminServicePermissions(ServiceType.Online, equipmentId) ||\r\n authuser.HasLabTechServicePermissions(\r\n ServiceType.Online,\r\n equipmentId,\r\n ) ||\r\n authuser?.HasAdminGroupPermissions(equipmentGroupId) ||\r\n authuser?.HasLabTechGroupPermissions(equipmentGroupId))\r\n );\r\n }, [equipmentGroupId, equipmentId, authuser]);\r\n const [selectedUser, setSelectedUser] = React.useState(\r\n !!authuser && !isAdmin\r\n ? convertAuthToIUserFilterDto(authuser)\r\n : !!initUser\r\n ? ({ Id: initUser, Name: initUser } as IUserFilterDto)\r\n : null,\r\n );\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState();\r\n const fetchRestrictions = async (\r\n serviceId?: number,\r\n ): Promise => {\r\n return RestrictionsApi.getRestrictionByService(serviceId);\r\n };\r\n const [restrictions, setRestriction] = useAsyncExtendedState<\r\n IRestrictions | undefined\r\n >(undefined);\r\n const [fetchRestrictionsState, fetchRestrictionsPromise] = usePromise(\r\n fetchRestrictions,\r\n );\r\n\r\n const [userRestrictions, setUserRestrictions] = useAsyncExtendedState<\r\n IUserRestrictionsResult | undefined\r\n >(undefined);\r\n\r\n const fetchUserRestrictions = async (\r\n user: Entity,\r\n serviceId: number,\r\n ): Promise => {\r\n return UserPermissionsApi.getUserSlotPermissions({\r\n serviceId: serviceId,\r\n username: user.Id,\r\n });\r\n };\r\n const [fetchUserRestrictionsState, fetchUserRestrictionsPromise] = usePromise(\r\n fetchUserRestrictions,\r\n );\r\n const fetchAsset = async (serviceId: number): Promise => {\r\n return initAssetsData(serviceId.toString(), true, undefined, true).then(\r\n result => result[0],\r\n );\r\n };\r\n const [fetchAssetState, fetchAssetPromise] = usePromise(fetchAsset);\r\n const openAsset = useOpenAssetPopUp();\r\n useEffectOnMount(() => {\r\n setRestriction(fetchRestrictionsPromise(equipmentId));\r\n if (isAdmin) {\r\n if (!!initUser) {\r\n (async () => {\r\n try {\r\n const data = await initUserData(initUser, 'full');\r\n if (!!data && data.length > 0) {\r\n let selected = (data[0] ?? {\r\n Id: initUser,\r\n Name: initUser,\r\n }) as IUserFilterDto;\r\n setSelectedUser(selected);\r\n setUserRestrictions(\r\n fetchUserRestrictionsPromise(selected, equipmentId || -1),\r\n );\r\n }\r\n } catch {}\r\n })();\r\n } else {\r\n setSelectedUser(null);\r\n }\r\n } else {\r\n if (selectedUser !== null) {\r\n setUserRestrictions(\r\n fetchUserRestrictionsPromise(selectedUser, equipmentId || -1),\r\n );\r\n }\r\n }\r\n if (isAdmin) {\r\n setSelectedService(fetchAssetPromise(equipmentId || -1));\r\n }\r\n\r\n return () => {};\r\n });\r\n React.useEffect(() => {\r\n const messageKey = 'QuizLoad';\r\n if (fetchRestrictionsState.error) {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Something went wrong.',\r\n key: messageKey,\r\n }),\r\n );\r\n }\r\n }, [fetchRestrictionsState.error, actions, dispatch]);\r\n const minTimeAhead = (rest: IRestrictions): string => {\r\n if (rest.MinTimeAheadPeriodValue !== null) {\r\n return `${t(translations.Before)}: ${rest.MinTimeAheadPeriodValue.toFixed(\r\n 2,\r\n )}\r\n ${(t(translations.AdvancedReservation) as string).replace(\r\n '{0}',\r\n enumToEntityArray(MinTimeAheadPeriodTypes).filter(\r\n f => f.Id === rest.MinTimeAheadPeriodType,\r\n )[0].Name,\r\n )}`;\r\n } else if (rest.MinTimeAheadMinutesSinceMidnight !== null) {\r\n return `${t(translations.OnTheSameDay)}: ${(t(\r\n translations.ToBeBookedBy,\r\n ) as string).replace(\r\n '{0}',\r\n dateUtils.dateFnsUtils.format(\r\n new Date(0, 0, 0, 0, rest.MinTimeAheadMinutesSinceMidnight),\r\n dateUtils.DateIOFormats.fullDateTime24h,\r\n ),\r\n )}`;\r\n } else {\r\n return '';\r\n }\r\n };\r\n const getStatus = React.useCallback(\r\n (asset: IAssetDto) => {\r\n let validRender =\r\n !!userRestrictions &&\r\n userRestrictions.PrerequisiteTrainingsIndicators.length > 0 &&\r\n userRestrictions.PrerequisiteTrainingsIndicators.some(\r\n f => f.Id === asset.ServiceId,\r\n );\r\n if (!!userRestrictions && validRender) {\r\n let found = userRestrictions.PrerequisiteTrainingsIndicators.find(\r\n f => f.Id === asset.ServiceId,\r\n );\r\n let status = enumToEntityArray(TrainingStatus).find(\r\n f => f.Id === found?.Status,\r\n )?.Name;\r\n let statusName = `${status} ${\r\n asset.PrerequisiteFor === 1\r\n ? ' - ( ' + t(translations.CoreWideRequirement) + ' )'\r\n : ''\r\n }`;\r\n return {\r\n StatusName: statusName,\r\n Status: found?.Status,\r\n };\r\n }\r\n return undefined;\r\n },\r\n [t, userRestrictions],\r\n );\r\n const prerequisites: Prerequisites[] = React.useMemo(() => {\r\n let results: Prerequisites[] = [];\r\n if (!!restrictions && restrictions.PrerequisiteEquipments.length > 0) {\r\n results = restrictions.PrerequisiteEquipments.map(preq => {\r\n let usrrest = getStatus(preq);\r\n return {\r\n Id: preq.Id,\r\n Name: preq.Name,\r\n ServiceId: preq.ServiceId,\r\n ImageName: preq.Image,\r\n StatusId: usrrest?.Status,\r\n StatusName: usrrest?.StatusName,\r\n } as Prerequisites;\r\n });\r\n }\r\n return results;\r\n }, [getStatus, restrictions]);\r\n\r\n // const PrerequisiteWithStatus = ({ asset }: { asset: IAssetDto }) => {\r\n // let validRender =\r\n // !!userRestrictions &&\r\n // userRestrictions.PrerequisiteTrainingsIndicators.length > 0 &&\r\n // userRestrictions.PrerequisiteTrainingsIndicators.some(\r\n // f => f.Id === asset.ServiceId,\r\n // );\r\n\r\n // if (!!userRestrictions && validRender) {\r\n // let found = userRestrictions.PrerequisiteTrainingsIndicators.find(\r\n // f => f.Id === asset.ServiceId,\r\n // );\r\n // let status = enumToEntityArray(TrainingStatus).find(\r\n // f => f.Id === found?.Status,\r\n // )?.Name;\r\n // let statusName = `${status} - ${\r\n // asset.PrerequisiteFor === 1\r\n // ? '( ' + t(translations.CoreWideRequirement) + ' )'\r\n // : ''\r\n // }`;\r\n // return (\r\n // \r\n // {cliTruncate(statusName, 25, { position: 'end' })}\r\n // \r\n // );\r\n // } else {\r\n // return <>;\r\n // }\r\n // };\r\n const handleCloselClick = React.useCallback(() => {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n } as SidePanelCloseState);\r\n }, [closePanel, isCover, useSidePanel]);\r\n const userOnChange = (value: Entity | null) => {\r\n setSelectedUser(value as IUserFilterDto);\r\n if (value === null) {\r\n setUserRestrictions(undefined);\r\n } else {\r\n setUserRestrictions(\r\n fetchUserRestrictionsPromise(value, equipmentId || -1),\r\n );\r\n }\r\n };\r\n const assetOnChange = (value: IAssetDto | null) => {\r\n setSelectedService(value);\r\n setRestriction(fetchRestrictionsPromise(value?.ServiceId ?? undefined));\r\n setSelectedUser(null);\r\n setUserRestrictions(undefined);\r\n };\r\n React.useEffect(() => {\r\n if (fetchAssetState.status !== 'pending') {\r\n setEquipmentId(selectedService?.ServiceId ?? undefined);\r\n setEquipmentGroupId(selectedService?.ServiceGroupId ?? undefined);\r\n }\r\n return () => {};\r\n }, [\r\n fetchAssetState.status,\r\n selectedService?.ServiceGroupId,\r\n selectedService?.ServiceId,\r\n ]);\r\n // const minReservationGap = (rest: IRestrictions): string => {\r\n // let gaps = [\r\n // rest.MinReservationOrderGap,\r\n // rest.UserReservationGap,\r\n // rest.UserGroupReservationGap,\r\n // rest.InstituteReservationGap,\r\n // ];\r\n // if (gaps.filter(g => g > 0).length > 0) {\r\n // return Math.min(...gaps.filter(g => g > 0)).toString();\r\n // }\r\n // return '';\r\n // };\r\n const RenderContent = () => {\r\n return !!restrictions ? (\r\n \r\n \r\n \r\n {isAdmin && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {prerequisites.length > 0 && (\r\n \r\n \r\n \r\n {t(translations.PrerequisiteTrainings)}\r\n \r\n\r\n \r\n {prerequisites.map(item => {\r\n return (\r\n \r\n {item.StatusName}\r\n \r\n //\r\n )\r\n }\r\n imageSrc={getAssetImageThumbSrc(\r\n item.ImageName || null,\r\n 'horizontal',\r\n IsAssetImageExist(\r\n appSettings,\r\n item.ImageName || null,\r\n 'horizontal',\r\n ),\r\n )}\r\n useImage={true}\r\n // status={\r\n // item.StatusId === undefined\r\n // ? 'info'\r\n // : item.StatusId === TrainingStatus.Passed\r\n // ? 'success'\r\n // : item.StatusId === TrainingStatus.Expired\r\n // ? 'warning'\r\n // : 'error'\r\n // }\r\n maxContentHeight={40}\r\n useButtons={false}\r\n primaryAction={() =>\r\n openAsset(\r\n {\r\n id: item.Id,\r\n serviceId: item.ServiceId,\r\n serviceType: 'Online',\r\n useSidePanel: useSidePanel,\r\n },\r\n openPanel,\r\n )\r\n }\r\n backStyle=\"white\"\r\n />\r\n // \r\n // openAsset(item)}\r\n // variant=\"default\"\r\n // size=\"small\"\r\n // label={item.Name}\r\n // key={item.Id}\r\n // />\r\n // \r\n // \r\n );\r\n })}\r\n \r\n \r\n }\r\n />\r\n \r\n )}\r\n\r\n {restrictions.ForceTutoring === true && (\r\n \r\n {t(translations.ApprovalRequired)}\r\n ) : (\r\n \r\n \r\n \r\n {t(translations.PreApproved) as string}\r\n \r\n \r\n \r\n )\r\n }\r\n />\r\n \r\n )}\r\n\r\n {restrictions.MinReservationOrder !== null &&\r\n restrictions.MinReservationOrder > 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {restrictions.MaxReservationOrder !== null &&\r\n restrictions.MaxReservationOrder > 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {restrictions.ReservationMinimumGap !== null &&\r\n restrictions.ReservationMinimumGap > 0 && (\r\n \r\n \r\n \r\n )}\r\n {restrictions.CarryOverTimeSlotTypeId !== null &&\r\n restrictions.CarryOverTimeSlotGap != null && (\r\n \r\n \r\n \r\n )}\r\n {(restrictions.MinTimeAheadPeriodValue !== null ||\r\n restrictions.MinTimeAheadMinutesSinceMidnight != null) && (\r\n \r\n \r\n \r\n )}\r\n {restrictions.RestrictionsOverview !== null &&\r\n restrictions.RestrictionsOverview !== '' && (\r\n \r\n \r\n \r\n )}\r\n {restrictions.BypassQuotas === true && (\r\n \r\n }\r\n />\r\n \r\n )}\r\n {restrictions.BypassUserQuotasAndGaps &&\r\n restrictions.BypassUserQuotasAndGapsD !== null &&\r\n restrictions.BypassUserQuotasAndGapsD > 0 && (\r\n \r\n \r\n \r\n )}\r\n {restrictions.BypassMinResDurationD &&\r\n restrictions.BypassMinResDurationT !== null &&\r\n restrictions.BypassMinResDurationT > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n {!isAdmin && restrictions.LimitlessReservationAllowed !== true && (\r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n \r\n \r\n )}\r\n \r\n {/* this functionallity hidden by the task https://prog4biz.atlassian.net/browse/BKT-6141 */}\r\n {/* {(!showTable || (useSidePanel && !sidePanelExpanded)) && (\r\n \r\n \r\n \r\n }\r\n >\r\n {' '}\r\n \r\n )}\r\n {showTable && (sidePanelExpanded || !useSidePanel) && (\r\n \r\n )} */}\r\n \r\n ) : (\r\n {}\r\n );\r\n };\r\n return withNoWrapper ? (\r\n \r\n ) : (\r\n \r\n {restrictions ? (\r\n \r\n ) : (\r\n <>{t(translations.err_Equipment_NotFound)}\r\n )}\r\n \r\n }\r\n closeSidePanel={handleCloselClick}\r\n //rightTopActions={data?.AmAdmin ? [EditButton] : undefined}\r\n isCover={isCover} //&& !showTable\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n />\r\n );\r\n}\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n prog4biz: () => _t(translations.Prog4biz),\r\n bookitlabCopyrightNotice: () =>\r\n _t(translations.BookitlabCopyrightNoticeTitle),\r\n softwareBy: () => _t(translations.SoftwareBy),\r\n systemTime: () => _t(translations.SystemTime),\r\n lastCodeUpdate: () => _t(translations.LastCodeUpdate),\r\n termOfUse: () => _t(translations.TermsOfUse),\r\n};\r\n","import styled from 'styled-components';\r\n\r\nexport const CopyrightSection = styled('div')(({ theme }) => ({\r\n '&.copyrightSection': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n gap: 8,\r\n alignSelf: 'stretch',\r\n width: 'calc(100% - 16px)',\r\n padding: '0px 16px 0px 32px',\r\n [theme.breakpoints.down('sm')]: {\r\n flexDirection: 'column',\r\n justifyContent: 'flex-start',\r\n padding: '0px 0px',\r\n width: '100%',\r\n gap: 4,\r\n },\r\n },\r\n}));\r\n","/**\r\n *\r\n * Copyright\r\n *\r\n */\r\nimport { useTheme } from '@material-ui/core';\r\nimport {\r\n selectAppTimeZone,\r\n selectAuthenticatedUser,\r\n selectLastCodeUpdate,\r\n selectWebVersion,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Link } from '../ExternalLink';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { messages } from './messages';\r\nimport { CopyrightSection } from './styled';\r\n\r\nexport interface CopyrightProps {\r\n disableVersionOnMobile?: boolean;\r\n}\r\n\r\nexport function Copyright(props: CopyrightProps) {\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const webVersion = useSelector(selectWebVersion);\r\n const lastUpdate = useSelector(selectLastCodeUpdate);\r\n const appTimeZone = useSelector(selectAppTimeZone);\r\n const appOffset = appTimeZone?.TimezoneOffsetMinutes ?? 0;\r\n const getOffset = () => {\r\n const currentDateOffset = new Date().getTimezoneOffset();\r\n const appNow = dateUtils.addMinutes(\r\n new Date(),\r\n appOffset + currentDateOffset,\r\n );\r\n return appNow;\r\n };\r\n const [appNow, setAppNow] = React.useState(getOffset());\r\n React.useEffect(() => {\r\n const interval = setInterval(() => {\r\n // const currentDateOffset = new Date().getTimezoneOffset();\r\n // const appNow = dateUtils.addMinutes(\r\n // new Date(),\r\n // appOffset + currentDateOffset,\r\n // );\r\n setAppNow(getOffset());\r\n }, 60000);\r\n\r\n return () => {\r\n clearInterval(interval);\r\n };\r\n });\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n \r\n {t(messages.bookitlabCopyrightNotice())}\r\n \r\n <>{` `}\r\n {t(messages.softwareBy())}\r\n <>{` `}\r\n \r\n {t(messages.prog4biz())}\r\n {' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n \r\n {!props.disableVersionOnMobile && (\r\n \r\n \r\n {`v${webVersion}; ` || ''}{' '}\r\n {` ${t(messages.systemTime())}: ${dateUtils.longDateTimeFormat(\r\n appNow,\r\n )};`}{' '}\r\n {lastUpdate &&\r\n `${t(messages.lastCodeUpdate())}: ${dateUtils.longDateTimeFormat(\r\n lastUpdate,\r\n )};`}\r\n \r\n \r\n )}\r\n {!!authenticatedUser && (\r\n \r\n \r\n \r\n {t(messages.termOfUse())}\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.messagesState || initialState;\r\n\r\nexport const selectMessages = createSelector([selectSlice], state =>\r\n state.messages.filter(\r\n (val, ind, arr) => arr.findIndex(f => f.key === val.key) === ind,\r\n ),\r\n);\r\nexport const selectMsgInitProcessing = createSelector(\r\n [selectSlice],\r\n state => state.processing,\r\n);\r\n\r\nexport const selectMessagesAlreadyExist = createSelector(\r\n [selectSlice],\r\n state => state.initialized,\r\n);\r\n","import { ReservationQueryStringParameters } from './slice/types';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useCallback } from 'react';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport const useOpenReservationSidePanel = () => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n return useCallback(\r\n (params: ReservationQueryStringParameters, useSwitchButtons?: boolean) => {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ReservationDetails,\r\n props: {\r\n useSidePanel: true,\r\n queryParams: params,\r\n useSwitchButtons: useSwitchButtons,\r\n },\r\n }),\r\n );\r\n },\r\n [actions, dispatch],\r\n );\r\n};\r\n","import parse from 'html-react-parser';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { OptionsObject, SnackbarProvider, useSnackbar } from 'notistack';\r\nimport React, { useEffect, useMemo, useState } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useMessagesSlice } from './slice';\r\nimport { selectMessages, selectMessagesAlreadyExist } from './slice/selector';\r\nimport {\r\n CalendarMessageProps,\r\n LoanDesk,\r\n Message,\r\n messageType,\r\n StartedReservation,\r\n UsageReservation,\r\n} from './slice/type';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { createStyles, Link, makeStyles, Theme } from '@material-ui/core';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport ButtonLink from '../BasicLinks/ButtonLink';\r\nimport { useOpenReservationSidePanel } from 'app/pages/ReservationDetails/Details/useOpenReservationSidePanel';\r\nimport { H3 } from '../Typography';\r\nimport { Entity } from 'types/common';\r\nimport { dashboardKey } from '../Dashboard/slice/types';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\n\r\nconst useMessageStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n zIndex: theme.zIndex.modal,\r\n },\r\n item: {\r\n backgroundColor: theme.palette.background.default + ' !important',\r\n color: theme.palette.text.primary + ' !important',\r\n border: '1px solid ' + theme.palette.info.main,\r\n minWidth: 'auto',\r\n },\r\n base: {\r\n '& > div': {\r\n zIndex: theme.zIndex.modal - 1,\r\n },\r\n //this accesses the div that can effect the justify content.\r\n //if notistack is updated, it will likely not be needed as the bug has been fixed in newer versions.\r\n '&>div>div>div': {\r\n justifyContent: 'flex-end',\r\n },\r\n },\r\n }),\r\n);\r\nconst MaxMessage = 3;\r\nconst closeAllKey = 'closeAllMessagesKey';\r\n\r\nexport type pageNames = dashboardKey | 'calendar' | 'assetDetails';\r\nexport const pageToType: Partial> = {\r\n calendar: [messageType.calendar],\r\n assetDetails: [messageType.reservationStarted, messageType.usageReservation],\r\n};\r\nexport interface MessageProps {\r\n pageName: pageNames;\r\n selectedEquipment?: Entity[];\r\n secondaryPage?: boolean;\r\n}\r\n\r\nexport const Messages = ({ secondaryPage, ...props }: MessageProps) => {\r\n const classes = useMessageStyles();\r\n const alreadyExists = useSelector(selectMessagesAlreadyExist);\r\n\r\n return (\r\n \r\n \r\n 1}\r\n />\r\n \r\n \r\n );\r\n};\r\n\r\nconst MessagesChildren = (props: MessageProps) => {\r\n const { pageName, selectedEquipment } = props;\r\n const dispatch = useDispatch();\r\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\r\n const { actions } = useMessagesSlice();\r\n const allMessages = useSelector(selectMessages);\r\n const classes = useStyles();\r\n const messages = useMemo(() => {\r\n const types = pageToType[props.pageName];\r\n if (types === undefined) return allMessages;\r\n return allMessages.filter(m => types.includes(m.type));\r\n }, [allMessages, props.pageName]);\r\n\r\n useEffectOnMount(() => {\r\n if (props.secondaryPage) return;\r\n dispatch(\r\n actions.init({\r\n pageName: pageName,\r\n selectedEquipment: selectedEquipment,\r\n }),\r\n );\r\n\r\n return () => {\r\n dispatch(actions.clear());\r\n };\r\n });\r\n useEffect(() => {\r\n dispatch(actions.clear());\r\n closeSnackbar();\r\n dispatch(\r\n actions.init({\r\n pageName: pageName,\r\n selectedEquipment: selectedEquipment,\r\n }),\r\n );\r\n }, [actions, closeSnackbar, dispatch, pageName, selectedEquipment]);\r\n useEffect(() => {\r\n if (props.secondaryPage) {\r\n closeSnackbar();\r\n return;\r\n }\r\n if (messages.length > 1) {\r\n const closeAllOptions: OptionsObject = {\r\n persist: true,\r\n key: closeAllKey,\r\n };\r\n\r\n enqueueSnackbar(\r\n {\r\n closeSnackbar();\r\n dispatch(actions.clear());\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n ,\r\n closeAllOptions,\r\n );\r\n } else {\r\n closeSnackbar(closeAllKey);\r\n }\r\n messages.slice(0, MaxMessage).forEach(m => {\r\n const close = () => {\r\n dispatch(actions.remove(m.key));\r\n closeSnackbar(m.key);\r\n };\r\n const options: OptionsObject = {\r\n persist: true,\r\n key: m.key,\r\n action: key => (\r\n \r\n {/* {m.type === messageType.removableAnnouncment && (\r\n {\r\n dispatch(actions.remove(key));\r\n closeSnackbar(key);\r\n dispatch(\r\n actions.gotIt(\r\n AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n ),\r\n );\r\n }}\r\n />\r\n )} */}\r\n \r\n \r\n ),\r\n };\r\n\r\n enqueueSnackbar(\r\n <>\r\n \r\n \r\n \r\n <>\r\n {m.type === messageType.removableAnnouncment && (\r\n {\r\n dispatch(actions.remove(m.key));\r\n closeSnackbar(m.key);\r\n dispatch(\r\n actions.gotIt(\r\n AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n ),\r\n );\r\n }}\r\n />\r\n )}\r\n \r\n ,\r\n options,\r\n );\r\n });\r\n }, [\r\n actions,\r\n classes,\r\n closeSnackbar,\r\n dispatch,\r\n enqueueSnackbar,\r\n messages,\r\n props.secondaryPage,\r\n ]);\r\n return null;\r\n};\r\n\r\nconst CloseAll = () => {\r\n const { t } = useTranslation();\r\n return <>{t(translations.CloseAll)};\r\n};\r\n\r\nconst GotIt = ({ onClick }: { onClick: () => void }) => {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst RenderMessge = ({\r\n message,\r\n close,\r\n}: withClose<{\r\n message: Message;\r\n}>) => {\r\n switch (message.type) {\r\n case messageType.Announcment:\r\n case messageType.removableAnnouncment:\r\n return ;\r\n case messageType.reservationStarted:\r\n const props = message.props as StartedReservation;\r\n return ;\r\n case messageType.usageReservation:\r\n return (\r\n \r\n );\r\n case messageType.loadDesk:\r\n return ;\r\n case messageType.calendar:\r\n return ;\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\ntype withClose = T & { close: () => void };\r\n\r\nconst ReservationStartedMessage = ({\r\n close,\r\n ...props\r\n}: withClose) => {\r\n const { t } = useTranslation();\r\n const openSidePanel = useOpenReservationSidePanel();\r\n const assets = (\r\n \r\n {props.Asset.Name}\r\n \r\n );\r\n if (props.AllowUsersToShortenReservations && props.AllUsagesEnded) {\r\n return (\r\n <>\r\n {assets} {t(translations.InstrumentStillReservered)}\r\n {\r\n openSidePanel({ id: '' + props.Id });\r\n close();\r\n }}\r\n >\r\n {t(translations.ReleaseUnusedReservation)}\r\n \r\n \r\n );\r\n }\r\n let messages: React.ReactNode = '';\r\n if (props.AllowUsersToShortenReservations) {\r\n const message = t(translations.YouHaveOngoingReservations);\r\n messages = message\r\n .split('{0}')\r\n .map((f, i) => (\r\n \r\n {f} \r\n \r\n ))\r\n .reduce((prev, curr) => [prev, assets, curr]);\r\n } else if (props.AllowExtendReservation || props.AllowModification) {\r\n const message = t(translations.ReservationStarted);\r\n const link = (\r\n \r\n openSidePanel({ id: '' + props.Id })}\r\n >\r\n {props.Id}\r\n \r\n \r\n );\r\n messages = message\r\n .split('{0}')\r\n .map((m, idx) => (\r\n \r\n {' '}\r\n {m\r\n .split('{1}')\r\n .map((f, i) => (\r\n \r\n {f} \r\n \r\n ))\r\n .reduce((prev, curr) => [prev, assets, curr])}\r\n \r\n ))\r\n .reduce((prev, curr) => [prev, link, curr]);\r\n }\r\n const canEdit =\r\n props.AllowUsersToShortenReservations ||\r\n props.AllowModification ||\r\n props.AllowExtendReservation;\r\n return (\r\n <>\r\n {messages}\r\n {canEdit && (\r\n {\r\n openSidePanel({ id: '' + props.Id });\r\n close();\r\n }}\r\n >\r\n {t(translations.UpdateOngoingReservations)}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nconst UsageReservationMessage = ({\r\n close,\r\n ...props\r\n}: withClose) => {\r\n const { t } = useTranslation();\r\n const assets = (\r\n \r\n {props.Name}\r\n \r\n );\r\n const message = t(translations.IpRelay_reservationTimeForInstrument);\r\n const messages = message\r\n .split('{0}')\r\n .map((f, i) => (\r\n {f} \r\n ))\r\n .reduce((prev, curr) => [prev, assets, curr]);\r\n return (\r\n <>\r\n {messages}\r\n \r\n {t(translations.IpRelay_LinkToUsage)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst CalendarMessage = (props: CalendarMessageProps) => {\r\n return (\r\n \r\n {props.Body && parse(props.Body)}\r\n \r\n );\r\n};\r\n\r\nconst LoanDeskMessage = (props: LoanDesk) => {\r\n const { t } = useTranslation();\r\n const openSidePanel = useOpenReservationSidePanel();\r\n const message = t(translations.ReservationStartedMessage_LoanDesk);\r\n const link = (\r\n \r\n openSidePanel({ id: '' + props.Id })}>\r\n {props.Id}\r\n \r\n \r\n );\r\n const asset = (\r\n \r\n \r\n {props.AssetDetails.Name}\r\n \r\n \r\n );\r\n const messages = message\r\n .split('{0}')\r\n .map(m =>\r\n m\r\n .split('{1}')\r\n .map((f, i) => (\r\n {f} \r\n ))\r\n .reduce((prev, curr) => [prev, asset, curr]),\r\n )\r\n .reduce((prev, curr) => [prev, link, curr]);\r\n return <>{messages};\r\n};\r\n\r\nconst WithSpace = ({ children }: React.PropsWithChildren<{}>) => {\r\n return (\r\n <>\r\n  \r\n {children}\r\n  \r\n \r\n );\r\n};\r\n\r\nconst Truncicated = ({\r\n value,\r\n title,\r\n children,\r\n}: React.PropsWithChildren<{ value: string; title: string | null }>) => {\r\n const classes = useStyles();\r\n const height = useMemo(() => getSize(value, title, classes.root), [\r\n classes.root,\r\n title,\r\n value,\r\n ]);\r\n const parsed = parse(value);\r\n const moreTitle = useMemo(() => MoreTitle(title), [title]);\r\n if (height > 140) {\r\n return (\r\n {parsed}}>\r\n <>\r\n \r\n \r\n \r\n {children ?? parsed}\r\n \r\n {children ?? parsed}\r\n \r\n \r\n \r\n {children ?? parsed}\r\n \r\n \r\n \r\n );\r\n }\r\n return (\r\n \r\n \r\n {children ?? parsed}\r\n \r\n );\r\n};\r\n\r\nconst getSize = (value: string, title: string | null, style: string) => {\r\n const div = document.createElement('div');\r\n div.classList.add(style);\r\n if (title !== null) {\r\n const h3 = document.createElement('h3');\r\n h3.innerText = title;\r\n div.appendChild(h3);\r\n }\r\n const inner = document.createElement('div');\r\n inner.innerHTML = value;\r\n div.appendChild(inner);\r\n document.body.appendChild(div);\r\n const height = div.clientHeight;\r\n div.parentNode?.removeChild(div);\r\n return height;\r\n};\r\n\r\nconst MoreLink = ({ children }: React.PropsWithChildren<{}>) => {\r\n return {children};\r\n};\r\n\r\nconst TitleIfExists = ({ title }: { title: string | null }) => {\r\n return (title ?? '') === '' ? null :

    {title}

    ;\r\n};\r\n\r\nconst MoreTitle = (title: string | null): MorePopUpLink => {\r\n return ({ onClick }) => {\r\n return (title ?? '') === '' ? null : (\r\n

    \r\n {title}\r\n

    \r\n );\r\n };\r\n};\r\n\r\nconst MoreButton: MorePopUpLink = ({ onClick }) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\ntype MorePopUpLink = React.FC<{ onClick: () => void }>;\r\n\r\nconst MorePopUp = ({\r\n Link,\r\n children,\r\n}: React.PropsWithChildren<{\r\n Link: MorePopUpLink;\r\n}>) => {\r\n const [open, setOpen] = useState(false);\r\n const close = () => setOpen(false);\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n setOpen(true)} />\r\n \r\n \r\n );\r\n};\r\n\r\nconst useStyles = makeStyles(theme =>\r\n createStyles({\r\n root: {\r\n maxWidth: '380px',\r\n maxHeight: '180px',\r\n zIndex: theme.zIndex.drawer,\r\n },\r\n truncate: {\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n height: '150px',\r\n display: '-webkit-box',\r\n WebkitLineClamp: 5,\r\n WebkitBoxOrient: 'vertical',\r\n },\r\n }),\r\n);\r\n","import { AssetBarcodeScanParameters } from 'app/pages/AssetsInventory/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/BarcodeScanLog';\r\nexport const BarcodeScanApi = {\r\n scanBarcode: (payload: AssetBarcodeScanParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n return httpClient.post(`${url}/BarcodeScan`, data);\r\n },\r\n logNoRoomAccess: (payload: number) => {\r\n const data = {\r\n roomId: payload,\r\n };\r\n return httpClient.post(`${url}/LogNoRoomAccess`, data);\r\n },\r\n logRoomScan: (payload: number) => {\r\n const data = {\r\n roomId: payload,\r\n };\r\n return httpClient.post(`${url}/LogRoomScann`, data);\r\n },\r\n logLocationScan: (roomId: number, locationId: number) => {\r\n const data = {\r\n roomId: roomId,\r\n locationId: locationId,\r\n };\r\n return httpClient.post(`${url}/LogLocationScann`, data);\r\n },\r\n logSubLocationScan: (\r\n roomId: number,\r\n locationId: number,\r\n sublocationId: number,\r\n ) => {\r\n const data = {\r\n roomId: roomId,\r\n locationId: locationId,\r\n sublocationId: sublocationId,\r\n };\r\n return httpClient.post(`${url}/LogSubLocationScann`, data);\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n selectAppSettings,\r\n selectBarcodeScanTarget,\r\n selectGlobalSetting,\r\n} from 'app/slice/selectors';\r\nimport { parseBarcode, ScanTarget, ScanTemplateResult } from 'app/slice/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { assetInventoryActions as actions } from '.';\r\nimport {\r\n selectLocationSelected,\r\n selectRoomSelected,\r\n selectScanProcessing,\r\n selectSubLocationSelected,\r\n} from './selectors';\r\nimport { AssetBarcodeScanParameters, AssetBarcodeScanResult } from './types';\r\nimport { BarcodeScanApi as api } from 'api/BarcodeScanApi';\r\n\r\nfunction* doSetSelectedRoom(action: PayloadAction) {\r\n yield put(actions.setSelectedRoom_Success(action.payload));\r\n}\r\nfunction* doSetSelectedLocation(\r\n action: PayloadAction,\r\n) {\r\n yield put(actions.setSelectedLocation_Success(action.payload));\r\n}\r\nfunction* doSetSelectedSubLocation(\r\n action: PayloadAction,\r\n) {\r\n yield put(actions.setSelectedSubLocation_Success(action.payload));\r\n}\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n // const MIN_LENGTH_DEFAULT = 6;\r\n // const minBarcodeLengthString: string | undefined = yield select(state =>\r\n // selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n // );\r\n const minBarcodeAssetLengthString: string | undefined = yield select(state =>\r\n selectGlobalSetting(state, AllowedSettings.QRCodeBaseLength),\r\n );\r\n // const MinBarcodeLength =\r\n // tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n const MinAssetQRLength = tryParseInt(minBarcodeAssetLengthString) ?? 0;\r\n // prevent accidental barcode detection on fast user input\r\n if (action.payload.data.length < MinAssetQRLength) {\r\n return;\r\n }\r\n const scannTarget: ScanTarget | undefined = yield select(\r\n selectBarcodeScanTarget,\r\n );\r\n if (scannTarget === undefined || scannTarget !== ScanTarget.Inventory) {\r\n return;\r\n }\r\n const isScanning = yield select(selectScanProcessing);\r\n if (isScanning === true) {\r\n return;\r\n }\r\n yield put(actions.setScanProcessing(true));\r\n const appSettings: AppSettings = yield select(selectAppSettings);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'info',\r\n message:\r\n i18next.t(translations.BarcodeScanModalBody) +\r\n ' ' +\r\n action.payload.data,\r\n }),\r\n );\r\n try {\r\n const scanResult = parseBarcode(action.payload.data, appSettings);\r\n if (scanResult === undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: (i18next.t(\r\n translations.BarcodeNotFoundEx,\r\n ) as string).replace('{{barcode}}', action.payload.data),\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n } else {\r\n const room: IRoomDto | null = yield select(selectRoomSelected);\r\n const location: ILocationListDto | null = yield select(\r\n selectLocationSelected,\r\n );\r\n const subLocation: ISubLocationListDto | null = yield select(\r\n selectSubLocationSelected,\r\n );\r\n // in case when barcode is entered manually\r\n if (\r\n scanResult.type === ScanTemplateResult.Internal ||\r\n scanResult.type === ScanTemplateResult.Asset\r\n ) {\r\n let params = {\r\n Barcode: scanResult.InternalCode ?? '',\r\n RoomId: room?.Id,\r\n LocationId: location?.Id,\r\n SubLocationId: subLocation?.Id,\r\n } as AssetBarcodeScanParameters;\r\n const result = yield call(api.scanBarcode, params);\r\n let response = result as AssetBarcodeScanResult;\r\n if (response.SuccessMessages.length > 0) {\r\n if (!!response.RoomDetails) {\r\n if (room !== null && room !== undefined) {\r\n if (room.Id !== response.RoomDetails.Id) {\r\n yield put(\r\n actions.setSelectedRoom_Success(response.RoomDetails),\r\n );\r\n yield put(actions.setSelectedLocation_Success(null));\r\n yield put(actions.setSelectedSubLocation_Success(null));\r\n }\r\n } else {\r\n yield put(actions.setSelectedRoom_Success(response.RoomDetails));\r\n yield put(actions.setSelectedLocation_Success(null));\r\n yield put(actions.setSelectedSubLocation_Success(null));\r\n }\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: response.SuccessMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_Success());\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n } else if (scanResult.type === ScanTemplateResult.Room) {\r\n if (\r\n room !== null &&\r\n room !== undefined &&\r\n room.Id === tryParseInt(scanResult.RoomId)\r\n ) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: `Room: ${room.Name} already selected`,\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n } else {\r\n // const roomData = yield call(\r\n // initRoomData,\r\n // scanResult.RoomId,\r\n // undefined,\r\n // undefined,\r\n // [\r\n // 'Id',\r\n // 'Name',\r\n // 'AreaId',\r\n // 'Areaname',\r\n // 'Barcode',\r\n // 'BuildingDescription',\r\n // 'BuildingId',\r\n // 'BuildingName',\r\n // 'Description',\r\n // 'Floor',\r\n // 'CampusId',\r\n // 'CampusName',\r\n // ],\r\n // );\r\n if (scanResult.RoomId !== undefined) {\r\n const roomResult = yield call(\r\n api.logRoomScan,\r\n parseInt(scanResult.RoomId),\r\n );\r\n let response = roomResult as AssetBarcodeScanResult;\r\n if (response.SuccessMessages.length > 0) {\r\n if (!!response.RoomDetails) {\r\n yield put(\r\n actions.setSelectedRoom_Success(response.RoomDetails),\r\n );\r\n yield put(actions.setSelectedLocation_Success(null));\r\n yield put(actions.setSelectedSubLocation_Success(null));\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: response.SuccessMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_Success());\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n // yield put(actions.setSelectedRoom_Success(roomData[0]));\r\n // yield put(actions.setSelectedLocation_Success(null));\r\n // yield put(actions.setSelectedSubLocation_Success(null));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: i18next.t(translations.RoomScanned),\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n }\r\n }\r\n } else if (scanResult.type === ScanTemplateResult.Location) {\r\n if (\r\n location !== null &&\r\n location !== undefined &&\r\n location.Id === tryParseInt(scanResult.LocationId) &&\r\n room?.Id === tryParseInt(scanResult.RoomId)\r\n ) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: `Location: ${location.Name} already selected`,\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n } else {\r\n if (\r\n scanResult.LocationId !== undefined &&\r\n scanResult.RoomId !== undefined\r\n ) {\r\n const roomResult = yield call(\r\n api.logLocationScan,\r\n parseInt(scanResult.RoomId),\r\n parseInt(scanResult.LocationId),\r\n );\r\n let response = roomResult as AssetBarcodeScanResult;\r\n if (response.SuccessMessages.length > 0) {\r\n if (!!response.RoomDetails && !!response.LocationDetails) {\r\n yield put(\r\n actions.setSelectedRoom_Success(response.RoomDetails),\r\n );\r\n yield put(\r\n actions.setSelectedLocation_Success(response.LocationDetails),\r\n );\r\n yield put(actions.setSelectedSubLocation_Success(null));\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: response.SuccessMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_Success());\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: `Scanned Location not found`,\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n // const locationData = yield call(\r\n // initLocationData,\r\n // scanResult.LocationId,\r\n // );\r\n // let locationResults = locationData as ILocationListDto[];\r\n // if (!locationResults || locationResults.length === 0) {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `Scanned Location not found`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // } else {\r\n // let loc = locationResults[0];\r\n // if (\r\n // room === null ||\r\n // room === undefined ||\r\n // (loc.RoomId ?? 0) !== room.Id\r\n // ) {\r\n // if (loc.RoomId !== null && loc.RoomId !== undefined) {\r\n // const roomLocationData = yield call(\r\n // initRoomData,\r\n // loc.RoomId.toString(),\r\n // undefined,\r\n // undefined,\r\n // [\r\n // 'Id',\r\n // 'Name',\r\n // 'AreaId',\r\n // 'Areaname',\r\n // 'Barcode',\r\n // 'BuildingDescription',\r\n // 'BuildingId',\r\n // 'BuildingName',\r\n // 'Description',\r\n // 'Floor',\r\n // 'CampusId',\r\n // 'CampusName',\r\n // ],\r\n // );\r\n // let roomLocData = roomLocationData[0];\r\n // if (!roomLocData) {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `No related Room found, Please select a Room first`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // } else {\r\n // yield put(actions.setSelectedRoom_Success(roomLocData));\r\n // yield put(actions.setSelectedLocation_Success(loc));\r\n // yield put(actions.setSelectedSubLocation_Success(null));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: 'Location Scanned',\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n // }\r\n // } else {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `No related Room found for scanned Location, Please select a Room first`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // }\r\n // } else {\r\n // yield put(actions.setSelectedLocation_Success(loc));\r\n // yield put(actions.setSelectedSubLocation_Success(null));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: 'Location Scanned',\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n // }\r\n // }\r\n }\r\n } else if (scanResult.type === ScanTemplateResult.SubLocation) {\r\n if (\r\n subLocation !== null &&\r\n subLocation !== undefined &&\r\n subLocation.Id === tryParseInt(scanResult.SubLocationId) &&\r\n subLocation.LocationListId === tryParseInt(scanResult.LocationId) &&\r\n subLocation.RoomId === tryParseInt(scanResult.RoomId)\r\n ) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: `Sub Location: ${subLocation.Name} already selected`,\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n } else {\r\n if (\r\n scanResult.SubLocationId !== undefined &&\r\n scanResult.LocationId !== undefined &&\r\n scanResult.RoomId !== undefined\r\n ) {\r\n const roomResult = yield call(\r\n api.logSubLocationScan,\r\n parseInt(scanResult.RoomId),\r\n parseInt(scanResult.LocationId),\r\n parseInt(scanResult.SubLocationId),\r\n );\r\n let response = roomResult as AssetBarcodeScanResult;\r\n if (response.SuccessMessages.length > 0) {\r\n if (\r\n !!response.RoomDetails &&\r\n !!response.LocationDetails &&\r\n !!response.SubLocationDetails\r\n ) {\r\n yield put(\r\n actions.setSelectedRoom_Success(response.RoomDetails),\r\n );\r\n yield put(\r\n actions.setSelectedLocation_Success(response.LocationDetails),\r\n );\r\n yield put(\r\n actions.setSelectedSubLocation_Success(\r\n response.SubLocationDetails,\r\n ),\r\n );\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: response.SuccessMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_Success());\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: `Scanned Sub Location not found`,\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n // const subLocationData = yield call(\r\n // initSubLocationListData,\r\n // scanResult.SubLocationId,\r\n // );\r\n // let subResults = subLocationData as ISubLocationListDto[];\r\n // if (!subResults || subResults.length === 0) {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `Scanned Sub Location not found`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // } else {\r\n // let sub = subResults[0];\r\n // if (\r\n // room === null ||\r\n // room === undefined ||\r\n // (sub.RoomId ?? 0) !== room.Id\r\n // ) {\r\n // if (sub.RoomId !== null && sub.RoomId !== undefined) {\r\n // const roomSubLocData = yield call(\r\n // initRoomData,\r\n // sub.RoomId.toString(),\r\n // undefined,\r\n // undefined,\r\n // [\r\n // 'Id',\r\n // 'Name',\r\n // 'AreaId',\r\n // 'Areaname',\r\n // 'Barcode',\r\n // 'BuildingDescription',\r\n // 'BuildingId',\r\n // 'BuildingName',\r\n // 'Description',\r\n // 'Floor',\r\n // 'CampusId',\r\n // 'CampusName',\r\n // ],\r\n // );\r\n // let roomSubData = roomSubLocData[0];\r\n // if (!roomSubData) {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `No related Room found, Please select a Room first`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // } else {\r\n // const locSubData = yield call(\r\n // initLocationData,\r\n // sub.LocationListId.toString(),\r\n // );\r\n // yield put(actions.setSelectedRoom_Success(roomSubData));\r\n // yield put(actions.setSelectedLocation_Success(locSubData[0]));\r\n // yield put(actions.setSelectedSubLocation_Success(sub));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: 'Sub Location Scanned',\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n // }\r\n // } else {\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'error',\r\n // message: `No related Room found for scanned Sub Location, Please select a Room first`,\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_error());\r\n // }\r\n // } else if (location === null || location === undefined) {\r\n // const locSubData = yield call(\r\n // initLocationData,\r\n // sub.LocationListId.toString(),\r\n // );\r\n // yield put(actions.setSelectedLocation_Success(locSubData[0]));\r\n // yield put(actions.setSelectedSubLocation_Success(sub));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: 'Sub Location Scanned',\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n // } else {\r\n // yield put(actions.setSelectedSubLocation_Success(sub));\r\n // yield put(\r\n // appSettingsActions.addNotification({\r\n // variant: 'success',\r\n // message: 'Sub Location Scanned',\r\n // }),\r\n // );\r\n // yield put(actions.scanManualBarcode_Success());\r\n // }\r\n // }\r\n }\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: (i18next.t(\r\n translations.BarcodeNotFoundEx,\r\n ) as string).replace('{{barcode}}', action.payload.data),\r\n }),\r\n );\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n }\r\n } catch (error) {\r\n console.error(`${action.type}`, action.payload, error);\r\n yield put(actions.scanManualBarcode_error());\r\n }\r\n}\r\nfunction* doSetNoRoomAccess() {\r\n const roomSelected: IRoomDto | null = yield select(selectRoomSelected);\r\n if (roomSelected === null || roomSelected === undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: 'Please select a Room first',\r\n }),\r\n );\r\n yield put(actions.setNoRoomAccess_error());\r\n } else {\r\n const result = yield call(api.logNoRoomAccess, roomSelected.Id);\r\n let response = result as AssetBarcodeScanResult;\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: response.SuccessMessages[0],\r\n }),\r\n );\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: response.WarningMessages[0],\r\n }),\r\n );\r\n }\r\n yield put(actions.setNoRoomAccess_success());\r\n }\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: response.ErrorMessages[0],\r\n }),\r\n );\r\n yield put(actions.setNoRoomAccess_error());\r\n }\r\n }\r\n}\r\nexport function* assetInventoryStateSaga() {\r\n yield takeLatest(\r\n actions.setSelectedSubLocation.type,\r\n doSetSelectedSubLocation,\r\n );\r\n yield takeLatest(actions.setSelectedLocation.type, doSetSelectedLocation);\r\n yield takeLatest(actions.setSelectedRoom.type, doSetSelectedRoom);\r\n yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n yield takeLatest(actions.scanManualBarcode, doBarcodeScan);\r\n yield takeLatest(actions.setNoRoomAccess, doSetNoRoomAccess);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { assetInventoryStateSaga } from './saga';\r\nimport { AssetInventoryState } from './types';\r\n\r\nexport const initialState: AssetInventoryState = {\r\n selectedRoomState: null,\r\n selectedLocationState: null,\r\n selectedSubLocationState: null,\r\n scanProcessing: undefined,\r\n noRoomAccessProcessing: undefined,\r\n logFilters: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'assetInventory',\r\n initialState,\r\n reducers: {\r\n setSelectedRoom(state, action: PayloadAction) {},\r\n setSelectedRoom_Success(state, action: PayloadAction) {\r\n state.selectedRoomState = action.payload;\r\n },\r\n setSelectedLocation(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n setSelectedLocation_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.selectedLocationState = action.payload;\r\n },\r\n setSelectedSubLocation(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n setSelectedSubLocation_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.selectedSubLocationState = action.payload;\r\n },\r\n scanManualBarcode(state, action: PayloadAction<{ data: string }>) {},\r\n scanManualBarcode_Success(state, action: PayloadAction) {\r\n state.scanProcessing = false;\r\n },\r\n scanManualBarcode_error(state, action: PayloadAction) {\r\n state.scanProcessing = false;\r\n },\r\n setNoRoomAccess(state, action: PayloadAction) {\r\n state.noRoomAccessProcessing = true;\r\n },\r\n setNoRoomAccess_success(state, action: PayloadAction) {\r\n state.noRoomAccessProcessing = false;\r\n },\r\n setNoRoomAccess_error(state, action: PayloadAction) {\r\n state.noRoomAccessProcessing = false;\r\n },\r\n setNoRoomAccessProcessing(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.noRoomAccessProcessing = action.payload;\r\n },\r\n setScanProcessing(state, action: PayloadAction) {\r\n state.scanProcessing = action.payload;\r\n },\r\n setLogFilters(\r\n state,\r\n action: PayloadAction | undefined>,\r\n ) {\r\n state.logFilters = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: assetInventoryActions } = slice;\r\n\r\nexport const useAssetInventorySlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: assetInventoryStateSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useAssetInventorySlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { messagesActions as actions } from '.';\r\nimport {\r\n CalendarMessageProps,\r\n LoanDesk,\r\n Message,\r\n messageType,\r\n StartedReservation,\r\n UsageReservation,\r\n} from './type';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { MessageProps, pageNames } from '..';\r\n\r\nconst reservePrefix = 'reservationStarted_';\r\nconst usagePrefix = 'usageReservation_';\r\nconst loanPrefix = 'LoanDeskReservation_';\r\n// const announcePrefix = 'Announcment_';\r\nconst calendarprefix = 'calendar_';\r\n\r\nconst reservationStartedurl = '/api/odata/v4/ReservationStarted';\r\nconst usageReservationUrl = '/api/odata/v4/UsageReservation';\r\nconst LoanDeskReservationUrl = '/api/odata/v4/LoanDeskReservation';\r\nconst calendarUrl = odataUrlPrefix + 'CalendarMessages/Show';\r\nfunction* doInit(action: PayloadAction) {\r\n const messages: Message[] = [];\r\n const page = action.payload.pageName;\r\n const funcs = getPageMessages(page);\r\n for (let index = 0; index < funcs.length; index++) {\r\n const func = funcs[index];\r\n yield* func(messages, action.payload);\r\n }\r\n // if (page !== 'calendar') {\r\n // yield* addReservations(messages);\r\n // yield* addUsages(messages);\r\n // yield* addLoanDesks(messages);\r\n // // yield* doAnnouncement(messages);\r\n // }\r\n // yield* addCalendarMessages(messages, action.payload);\r\n yield put(actions.init_success(messages));\r\n}\r\n\r\ntype MessageGetter = (\r\n messages: Message[],\r\n props: MessageProps,\r\n) => Generator;\r\n\r\nfunction getPageMessages(pageName: pageNames): MessageGetter[] {\r\n switch (pageName) {\r\n case 'calendar':\r\n return [addCalendarMessages];\r\n case 'assetDetails':\r\n return [addReservations, addUsages];\r\n default:\r\n return [addReservations, addUsages, addLoanDesks, addCalendarMessages];\r\n }\r\n}\r\n\r\nfunction* doeRefreshReservations(_action: PayloadAction) {\r\n const messages: Message[] = [];\r\n yield* addReservations(messages);\r\n yield put(actions.init_success(messages));\r\n}\r\n\r\nfunction* addReservations(messages: Message[]) {\r\n const reservationsInValue = yield call(httpClient.get, reservationStartedurl);\r\n const reservations = reservationsInValue.value as StartedReservation[];\r\n messages.push(\r\n ...reservations.map((r, _i) => ({\r\n type: messageType.reservationStarted,\r\n props: r,\r\n key: reservePrefix + r.Id,\r\n })),\r\n );\r\n}\r\n\r\nfunction* addUsages(messages: Message[]) {\r\n const usagesInValue = yield call(httpClient.get, usageReservationUrl);\r\n const usages = usagesInValue.value as UsageReservation[];\r\n messages.push(\r\n ...usages.map((r, _i) => ({\r\n type: messageType.usageReservation,\r\n props: r,\r\n key: usagePrefix + r.Id,\r\n })),\r\n );\r\n}\r\n\r\nfunction* addLoanDesks(messages: Message[]) {\r\n const LoanDeskInValue = yield call(httpClient.get, LoanDeskReservationUrl);\r\n const LoanDesks = LoanDeskInValue.value as LoanDesk[];\r\n messages.push(\r\n ...LoanDesks.map((r, _i) => ({\r\n type: messageType.loadDesk,\r\n props: r,\r\n key: loanPrefix + r.Id,\r\n })),\r\n );\r\n}\r\n\r\nfunction* addCalendarMessages(messages: Message[], props: MessageProps) {\r\n const params: {\r\n $select: string;\r\n $filter?: string;\r\n } = { $select: 'Id,Title,Body' };\r\n const now = new Date();\r\n const groups = yield select(selectGlobalServiceGroupFilter);\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: [\r\n new Condition(\r\n 'StartDate',\r\n ODataOperators.LessThanEqual,\r\n now,\r\n ).withNull() ?? '',\r\n new Condition(\r\n 'EndDate',\r\n ODataOperators.GreaterThanEqual,\r\n now,\r\n ).withNull() ?? '',\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n groups,\r\n ).withNull() ?? '',\r\n new Condition('ShowOn', ODataOperators.Contains, props.pageName),\r\n new Condition(\r\n 'EquipmentId',\r\n ODataOperators.Includes,\r\n props.selectedEquipment,\r\n ).withNull() ?? '',\r\n ],\r\n }).toString();\r\n const calendarInValue = yield call(httpClient.get, calendarUrl, params);\r\n const calendars = calendarInValue.value as CalendarMessageProps[];\r\n messages.push(\r\n ...calendars.map(c => ({\r\n type: messageType.calendar,\r\n key: calendarprefix + c.Id,\r\n props: c,\r\n })),\r\n );\r\n}\r\n\r\n// function* doAnnouncement(messages: Message[]) {\r\n// const settings: GlobalSettings = yield select(selectglobalSettings);\r\n// const userSettings: UserProfile = yield select(selectUserProfileSettings);\r\n// if (\r\n// settings.GetBooleanByKey(AllowedSettings.ShowDashboardAnnouncement) &&\r\n// !userSettings.GetSettingByKey(\r\n// AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n// )\r\n// ) {\r\n// const announcent = settings.GetString(\r\n// AllowedSettings.DashboardAnnouncement,\r\n// );\r\n// if (!!announcent) {\r\n// messages.push({\r\n// type: messageType.removableAnnouncment,\r\n// props: announcent,\r\n// key: announcePrefix + 0,\r\n// });\r\n// }\r\n// }\r\n// const userHelp = settings.GetString(AllowedSettings.Help_Dashboard);\r\n// if (userHelp.trim() !== '') {\r\n// messages.push({\r\n// type: messageType.Announcment,\r\n// props: userHelp,\r\n// key: announcePrefix + 1,\r\n// });\r\n// }\r\n// }\r\n\r\nfunction* doGotIt(action: PayloadAction) {\r\n const authenticatedUser: AuthenticatedUser | undefined = yield select(\r\n selectAuthenticatedUser,\r\n );\r\n yield put(\r\n appSettingsActions.saveUserProfileSetting({\r\n Key: action.payload,\r\n Value: true.toString(),\r\n UserName: authenticatedUser?.Id ?? '',\r\n Enabled: true,\r\n }),\r\n );\r\n}\r\n\r\nexport function* messagesSaga() {\r\n yield takeLatest(actions.init.type, doInit);\r\n yield takeLatest(actions.gotIt.type, doGotIt);\r\n yield takeLatest(actions.refreshUsages.type, doeRefreshReservations);\r\n}\r\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\r\nimport { SnackbarKey } from 'notistack';\r\nimport { useInjectReducer, useInjectSaga } from 'redux-injectors';\r\nimport { messagesSaga } from './saga';\r\nimport { Message, MessagesState } from './type';\r\nimport { MessageProps } from '..';\r\n\r\nexport const initialState: MessagesState = {\r\n messages: [],\r\n initialized: 0,\r\n processing: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'messagesState',\r\n initialState,\r\n reducers: {\r\n init(state, action: PayloadAction) {\r\n state.initialized = state.initialized + 1;\r\n state.processing = true;\r\n },\r\n init_success(state, action: PayloadAction) {\r\n state.messages.push(...action.payload);\r\n state.processing = false;\r\n },\r\n remove(state, action: PayloadAction) {\r\n state.messages = [\r\n ...state.messages.filter(m => m.key !== action.payload),\r\n ];\r\n },\r\n gotIt(state, action: PayloadAction) {},\r\n clear(state, action: PayloadAction) {\r\n state.messages = [];\r\n state.initialized = state.initialized - 1;\r\n },\r\n refreshUsages(state, action: PayloadAction) {},\r\n },\r\n});\r\nexport const { actions: messagesActions } = slice;\r\n\r\nexport const useMessagesSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: messagesSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n loadOfflineServiceData,\r\n UsageRelatedFilter,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BookQuickServices } from 'app/pages/OtherServiceDetails/Details/components/BookQuickServices';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IUsageHistory } from 'app/pages/UsageHistoryPage/IUsageHistory';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface EndUsageOfflineServicesProps {\r\n title: string;\r\n offlineIds: number[];\r\n usageId: number;\r\n onChange: (services: IOtherServices[]) => void;\r\n isProcessing: boolean;\r\n setError?: (error: ErrorServices) => void;\r\n reset?: boolean;\r\n usageData?: IUsageHistory;\r\n}\r\nexport function EndUsageOfflineServices(props: EndUsageOfflineServicesProps) {\r\n const { title, setError, offlineIds, usageId, onChange, usageData } = props;\r\n const { t } = useTranslation();\r\n //const dispatch = useDispatch();\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n //const { actions } = useOfflineServiceStateSlice();\r\n //const { actions: layoutActions } = useLayoutSlice();\r\n const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n IOtherServices[]\r\n >([]);\r\n //const { openPanel } = useSidePanelState(undefined, undefined, false, false);\r\n React.useEffect(() => {\r\n if (props.reset === true) {\r\n setServicesSelected([]);\r\n }\r\n }, [props.reset, setServicesSelected]);\r\n const changeOfflineServices = React.useCallback(\r\n (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n if (operation === 'add') {\r\n let addedServ = services.filter(\r\n f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n setServicesSelected([...servicesSelected, ...addedServ]);\r\n onChange([...servicesSelected, ...addedServ]);\r\n }\r\n if (operation === 'remove') {\r\n let otherServices = servicesSelected.filter(f => {\r\n return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServicesSelected(otherServices);\r\n onChange(otherServices);\r\n }\r\n if (operation === 'update') {\r\n const updated = servicesSelected.map(f => {\r\n let service = services.find(s => s.ServiceTypeID === f.ServiceTypeID);\r\n if (!!service && service !== null) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n });\r\n setServicesSelected(updated);\r\n onChange(updated);\r\n }\r\n },\r\n [onChange, servicesSelected, setServicesSelected],\r\n );\r\n const initServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n resolve(servicesSelected);\r\n });\r\n };\r\n const fetchServiceType = async (\r\n searchTerm: string | null,\r\n predicates: (string | Condition)[] | undefined,\r\n ) => {\r\n try {\r\n const data = await loadOfflineServiceData(\r\n [\r\n ...UsageRelatedFilter(\r\n offlineIds,\r\n servicesSelected.map(f => f.Id),\r\n ),\r\n ...(predicates ?? []),\r\n ],\r\n 'base',\r\n [],\r\n undefined,\r\n 'InventoryBatches',\r\n )(searchTerm, undefined);\r\n return data.value;\r\n } catch {\r\n return [];\r\n }\r\n };\r\n const prepareService = (serviceType: IOfflineServiceFilterDto) => {\r\n let batch = serviceType.InventoryBatchesEnabled\r\n ? !!serviceType.InventoryBatches &&\r\n serviceType.InventoryBatches.length > 0\r\n ? serviceType.InventoryBatches.filter(\r\n f =>\r\n (f.ExpirationDate === null ||\r\n getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n f.StokRenewed === true,\r\n ).sort((a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n return b.Id - a.Id;\r\n })[0]\r\n : null\r\n : null;\r\n let data = {\r\n Id: 0,\r\n BookedBy: usageData?.UserName,\r\n UserDisplayName: usageData?.UserDisplayName,\r\n BudgetID: usageData?.BudgetId,\r\n Budget: usageData?.BudgetNumber,\r\n BudgetExperimentId: usageData?.BudgetExperimentId,\r\n BudgetExperimentName: usageData?.BudgetExperimentName,\r\n Quantity: serviceType.DefaultQuantity,\r\n DefaultQuantity: serviceType.DefaultQuantity,\r\n ExternalCustomerId: null,\r\n ExternalCustomerName: null,\r\n FundingType: null,\r\n IntQuantityOnly: serviceType.IntQuantityOnly,\r\n DiscountFactor: 1,\r\n InstituteProjectId: null,\r\n InstituteProjectName: null,\r\n PurchaseOrder: null,\r\n Reference: null,\r\n Mandatory: false,\r\n Remarks: (t(translations.UsageOfflineServiceDefaultRemarks) as string)\r\n .replace('{0}', String(usageId))\r\n .replace('{1}', ''),\r\n ReservationId: null,\r\n UsageId: usageId,\r\n ServiceDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate())),\r\n ServiceTypeID: serviceType.Id,\r\n ServiceType: serviceType.Name,\r\n ServiceGroupId: serviceType.ServiceGroupId,\r\n Units: serviceType.UnitTypeName,\r\n UserGroup: usageData?.UserGroup,\r\n UserGroupName: usageData?.UserGroupName,\r\n AllowToUser: serviceType.AllowToUser,\r\n BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n StaffOnly: serviceType.StaffOnly,\r\n TrackInventory: serviceType.TrackInventory,\r\n NotLessThanZero: serviceType.NotLessThanZero,\r\n InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n } as IOtherServices;\r\n return data;\r\n };\r\n const createService = async (\r\n serviceType: IOfflineServiceFilterDto,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticService = prepareService(serviceType);\r\n changeOfflineServices([staticService], 'add');\r\n resolve(staticService);\r\n });\r\n };\r\n const onRemoveService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'remove');\r\n resolve(service);\r\n });\r\n };\r\n const onUpdateService = (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'update');\r\n resolve(service);\r\n });\r\n };\r\n // const handleOfflineServiceClick = React.useCallback(\r\n // (service: IOtherServices) => {\r\n // if (edit) {\r\n // let otherProps = {\r\n // initialService: service,\r\n // saveCreatable: true,\r\n // queryParams: {\r\n // id: '' + service.Id ?? -1,\r\n // },\r\n // };\r\n // openPanel({\r\n // renderPageType: RenderPageType.OtherServiceDetails,\r\n // renderPageProps: otherProps,\r\n // expanded: false,\r\n // useSidePanel: useSidePanel,\r\n // isCover: useSidePanel,\r\n // } as SidePanelOpenState);\r\n // }\r\n // },\r\n // [edit, openPanel, useSidePanel],\r\n // );\r\n // const onOfflineServiceClick = React.useCallback(\r\n // (service: IOtherServices) => {\r\n // let otherProps = {\r\n // initialService: Object.assign({}, service, {\r\n // UserGroup: usageData?.UserGroup ?? null,\r\n // UserGroupName: usageData?.UserGroupName ?? null,\r\n // Budget: usageData?.BudgetNumber ?? null,\r\n // BudgetID: usageData?.BudgetId ?? null,\r\n // UserDisplayName: usageData?.UserDisplayName ?? null,\r\n // BookedBy: usageData?.UserName ?? null,\r\n // }),\r\n // editCreatable: true,\r\n // queryParams: {\r\n // id: '' + service.Id ?? -1,\r\n // },\r\n // };\r\n // dispatch(layoutActions.setNotSavedChanges(false));\r\n // openPanel({\r\n // renderPageType: RenderPageType.OtherServiceDetails,\r\n // renderPageProps: otherProps,\r\n // expanded: false,\r\n // useSidePanel: false,\r\n // isCover: false,\r\n // } as SidePanelOpenState);\r\n // },\r\n // [\r\n // dispatch,\r\n // layoutActions,\r\n // openPanel,\r\n // usageData?.BudgetId,\r\n // usageData?.BudgetNumber,\r\n // usageData?.UserDisplayName,\r\n // usageData?.UserGroup,\r\n // usageData?.UserGroupName,\r\n // usageData?.UserName,\r\n // ],\r\n // );\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { useEffect, useState } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledFormFieldsContainer,\r\n} from '../Forms/FormsLayout';\r\nimport { SkeletonIfLoading } from 'app/Layout/FrontendLayout/components/PageWrapper/components/SkeletonIfLoading';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\nimport { Body } from '../Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport styled from 'styled-components';\r\nimport { EndUsageOfflineServices } from './EndUsageOfflineServices';\r\nimport { IUsageHistory } from 'app/pages/UsageHistoryPage/IUsageHistory';\r\nimport { BasicCheckBox } from '../BasicCheckBox';\r\n\r\ninterface OffService {\r\n quantity: number | null;\r\n service: Entity | null;\r\n}\r\n\r\nexport interface EndUsageData {\r\n services: OffService[];\r\n remarks: string | undefined;\r\n}\r\n\r\nexport interface EndUsageConfirmProps {\r\n isopen: boolean;\r\n onClose: () => void;\r\n ids?: number[];\r\n onConfirm: (data: EndUsageData) => void;\r\n usageProcessing?: boolean;\r\n message?: string;\r\n equipmentId?: number;\r\n usageId: number;\r\n}\r\n\r\nexport const EndUsageConfirm = ({\r\n isopen,\r\n onClose,\r\n onConfirm,\r\n usageProcessing,\r\n message,\r\n equipmentId,\r\n usageId,\r\n ...props\r\n}: EndUsageConfirmProps) => {\r\n const [selectedServices, setSelectedServices] = useState([]);\r\n const [remarks, setRemarks] = useState();\r\n const [ids, setIds] = useState(props.ids);\r\n const [loading, setLoading] = useState(false);\r\n const [error, setError] = useState();\r\n const [reset, setReset] = useState(false);\r\n const [usageData, setUsageData] = useState(\r\n undefined,\r\n );\r\n const [confirmUsageEnd, setConfirmUsageEnd] = useState(false);\r\n useEffect(() => {\r\n if (!!ids || !equipmentId || !isopen) return;\r\n let mounted = true;\r\n setLoading(true);\r\n (async () => {\r\n try {\r\n const res = await httpClient.get(\r\n `${odataUrlPrefix}AssetDetails/GetEquipmentServices`,\r\n { equipmentId },\r\n );\r\n const usage = await httpClient.get(`${odataUrlPrefix}UsageHistory`, {\r\n $filter: `Id eq ${usageId}`,\r\n });\r\n if (mounted) {\r\n setIds(res.value);\r\n setLoading(false);\r\n setReset(false);\r\n setUsageData(usage.value[0]);\r\n }\r\n } catch (error) {\r\n } finally {\r\n if (mounted) {\r\n setLoading(false);\r\n }\r\n }\r\n })();\r\n return () => {\r\n mounted = false;\r\n };\r\n }, [ids, equipmentId, isopen, usageId]);\r\n const { t } = useTranslation();\r\n const handleClose = () => {\r\n onClose();\r\n setReset(true);\r\n setError(undefined);\r\n };\r\n const endUsageWithOffline = React.useMemo(() => {\r\n return !!ids && ids.length > 0;\r\n }, [ids]);\r\n const endUsageOfflineValid = React.useMemo(() => {\r\n return (!!remarks && remarks !== '') || selectedServices.length > 0;\r\n }, [remarks, selectedServices]);\r\n return (\r\n \r\n <>\r\n {!!ids && endUsageWithOffline ? (\r\n \r\n {/*

    {t(translations.EndUsageConfirmTitle)}

    */}\r\n \r\n \r\n setError(err.error)}\r\n usageId={usageId}\r\n reset={reset}\r\n usageData={usageData}\r\n onChange={services => {\r\n setSelectedServices(\r\n services.map(s => {\r\n return {\r\n quantity: s.Quantity,\r\n service: {\r\n Id: s.ServiceTypeID,\r\n Name: s.ServiceTypeName,\r\n } as Entity,\r\n };\r\n }),\r\n );\r\n }}\r\n />\r\n \r\n \r\n setRemarks(v.target.value)}\r\n />\r\n \r\n \r\n \r\n setConfirmUsageEnd(e.target.checked)\r\n }\r\n checked={confirmUsageEnd}\r\n name={'Confirm'}\r\n required={confirmUsageEnd !== true}\r\n maxLabelWidth={100}\r\n />\r\n \r\n \r\n {error && {error}}\r\n \r\n \r\n
    \r\n ) : (\r\n {message ?? t(translations.ConfirmEndUsage)}\r\n )}\r\n \r\n \r\n }\r\n disabled={\r\n usageProcessing ||\r\n (endUsageWithOffline &&\r\n (confirmUsageEnd !== true || !endUsageOfflineValid))\r\n }\r\n onConfirm={() => {\r\n if (endUsageWithOffline) {\r\n if (!endUsageOfflineValid) {\r\n setError(t(translations.ConfirmEndUsage_err) as string);\r\n return;\r\n }\r\n }\r\n if (!error) {\r\n onConfirm({ services: selectedServices, remarks: remarks });\r\n }\r\n }}\r\n />\r\n );\r\n};\r\nconst EndUsageRoot = styled.div`\r\n &.end-usage-root {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 16px;\r\n & .end-usage-item {\r\n border: 1px solid ${bookitColors.grayscale.grayBorders};\r\n border-radius: 5px;\r\n gap: 10%;\r\n padding: 10px 0px;\r\n display: flex;\r\n justify-content: space-around;\r\n }\r\n }\r\n`;\r\n","/**\r\n *\r\n * BasicDialogActions\r\n *\r\n */\r\nimport {\r\n Box,\r\n createStyles,\r\n DialogActions as MuiDialogActions,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { DialogActionsRenderer } from './DialogActionsRender';\r\n\r\nconst actionsStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n justifyContent: 'space-between',\r\n margin: 0,\r\n padding: theme.spacing(3, 4),\r\n boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n },\r\n leftActions: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n flexWrap: 'wrap',\r\n gap: 8,\r\n },\r\n rightActions: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n padding: '4px 16px',\r\n flexWrap: 'wrap',\r\n gap: 8,\r\n },\r\n }),\r\n);\r\nexport interface BasicDialogActionsProps {\r\n leftActions: DialogActionsRenderer[];\r\n rightActions: DialogActionsRenderer[];\r\n}\r\n\r\nexport function BasicDialogActions(props: BasicDialogActionsProps) {\r\n const { leftActions, rightActions } = props;\r\n const classes = actionsStyles();\r\n return (\r\n \r\n {leftActions.length > 0 && (\r\n \r\n {leftActions.map((item, index) => (\r\n {item()}\r\n ))}\r\n \r\n )}\r\n \r\n {rightActions.length > 0 &&\r\n rightActions.map((item, index) => {item()})}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * Popper\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n ClickAwayListener,\r\n createStyles,\r\n makeStyles,\r\n Paper,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Popper as MuiPopper } from '@material-ui/core';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { PopperTitle } from './PopperTitle';\r\nimport clsx from 'clsx';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\n\r\nexport interface PopperProps {\r\n id?: string;\r\n title: string;\r\n open: boolean;\r\n anchorEl?: EventTarget & HTMLDivElement;\r\n children: React.ReactNode;\r\n onClose: React.MouseEventHandler;\r\n className?: string;\r\n closeTitle?: string;\r\n clickAway?: boolean;\r\n clickAwayFunc?: (e: any) => void;\r\n minWidth?: string | number;\r\n maxWidth?: string | number;\r\n}\r\n/**\r\n * A Popper with consistent title + close interface\r\n */\r\nexport const Popper = React.forwardRef(function Popper(\r\n props,\r\n ref,\r\n) {\r\n const {\r\n id,\r\n title,\r\n open,\r\n anchorEl,\r\n children,\r\n onClose,\r\n className,\r\n closeTitle,\r\n clickAway,\r\n clickAwayFunc,\r\n minWidth,\r\n maxWidth,\r\n ...other\r\n } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const handleClickAway = e => {\r\n if (clickAway) {\r\n if (e.target.nodeName === 'BODY' && e.type === 'click') {\r\n return;\r\n }\r\n if (!!clickAwayFunc) {\r\n clickAwayFunc(e);\r\n } else {\r\n onClose(e);\r\n }\r\n }\r\n };\r\n const classes = useStyles({\r\n isMobile: isMobile,\r\n minWidth: minWidth,\r\n maxWidth: maxWidth,\r\n })(props);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {props.children}\r\n \r\n \r\n \r\n );\r\n});\r\n\r\nconst useStyles = props =>\r\n makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n // https://github.com/mui/material-ui/issues/18905\r\n zIndex: theme.zIndex.modal,\r\n },\r\n rootMobile: {\r\n width: `100vw`,\r\n height: 'calc(100% - 32px)',\r\n // long content of the popper overflows popper box on mobile\r\n overflow: 'auto',\r\n marginTop: theme.spacing(4),\r\n },\r\n rootMobileHorizontal: {\r\n width: '100%',\r\n height: '100%',\r\n // long content of the popper overflows popper box on mobile\r\n overflow: 'auto',\r\n //marginTop: theme.spacing(4),\r\n },\r\n poperPaper: {\r\n height: '100%',\r\n minWidth: props.minWidth\r\n ? props.minWidth\r\n : props.isMobile\r\n ? '100%'\r\n : '500px',\r\n maxWidth: props.maxWidth\r\n ? props.maxWidth\r\n : props.isMobile\r\n ? '100%'\r\n : '700px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 24,\r\n gap: 16,\r\n boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n maxHeight: '100dvh',\r\n overflow: 'hidden',\r\n },\r\n poperTitle: {},\r\n poperRoot: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n selectTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '8px 8px',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n '&>label': {\r\n width: '100%',\r\n textAlign: 'center',\r\n },\r\n },\r\n selectContent: {\r\n marginTop: theme.spacing(2),\r\n boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n },\r\n }),\r\n );\r\n","/**\r\n *\r\n * Popper\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from '../Typography';\r\n\r\nexport interface PopperTitleProps {\r\n title: React.ReactNode;\r\n onClose: React.MouseEventHandler;\r\n className?: string;\r\n closeButtonTitle?: string;\r\n}\r\n\r\nexport function PopperTitle({ title, onClose, ...props }: PopperTitleProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const classes = useStyles({ isMobile: isMobile });\r\n const closeTitle = props.closeButtonTitle ?? t(translations.Close);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {title}\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n poperTitle: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '8px 8px',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n '&>label': {\r\n width: '100%',\r\n textAlign: 'center',\r\n },\r\n },\r\n }),\r\n);\r\n","/**\r\n *\r\n * RichTextEditor\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { StartRichEditor } from './RichEditor';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface RichTextEditorProps {\r\n value?: string | undefined;\r\n onChange: (value: string | undefined) => void;\r\n placeholder?: string;\r\n autofocus?: boolean;\r\n hasMentions?: boolean;\r\n onChangeMentions?: (mentions: Entity[]) => void;\r\n additionalButtons?: ((classname, key) => React.ReactNode)[];\r\n disabled?: boolean;\r\n isInvoiceTemplateEditor?: boolean;\r\n extendedMode?: boolean;\r\n labelOnTop?: boolean;\r\n info?: NonNullable;\r\n setControlsVisible?: (visible: boolean) => void;\r\n serviceGroups?: Identifiable[];\r\n}\r\n\r\nexport function RichTextEditor(props: RichTextEditorProps) {\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const hasMentions = React.useMemo(() => {\r\n return (\r\n props.hasMentions &&\r\n !globalSettings.GetBooleanByKey(\r\n AllowedSettings.HideCommentSharingForAllUsers,\r\n )\r\n );\r\n }, [globalSettings, props.hasMentions]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AdminUserPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { UserMultiPicker } from '../pickers/AutocompletePickers/UserMultiPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { UserPicker } from '../pickers/AutocompletePickers/UserPicker';\r\n\r\nexport const FormAdminUsersPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & { multiple: boolean }) => {\r\n const [field, meta, helpers] = useField(props);\r\n if (props.multiple) {\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n urlType=\"admin\"\r\n />\r\n );\r\n } else {\r\n return (\r\n {\r\n if (value !== null) {\r\n helpers.setValue([value], true);\r\n } else {\r\n helpers.setValue([], true);\r\n }\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n // value={field.value ?? undefined}\r\n value={\r\n field.value !== null\r\n ? field.value.length > 0\r\n ? (field.value[0] as IUserFilterDto | null | undefined)\r\n : null\r\n : null\r\n }\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n urlType=\"admin\"\r\n />\r\n );\r\n }\r\n};\r\nexport const FormAdminSingleUsersPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field?.value}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n urlType=\"admin\"\r\n />\r\n );\r\n};\r\n","/**\r\n *\r\n * DatesRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\n\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport {\r\n getPeriodTypesEntity,\r\n PeriodTypes,\r\n PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\n\r\nimport { DatePeriodsPicker } from 'app/components/pickers/DatePeriodsPicker';\r\nimport { selectTwoDaysTimelineButtonEnabled } from 'app/pages/CalendarPage/Scheduler/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nexport const DatesPeriodFilter = (props: IFilterComponentProps) => {\r\n const { t } = useTranslation();\r\n const twoDaysEnabled = useSelector(selectTwoDaysTimelineButtonEnabled);\r\n const [value, setValue] = React.useState(\r\n props.value !== undefined ? props.value : new PresetDatesRange(),\r\n );\r\n const handleTypeChange = (value: PeriodTypesEntity | null) => {\r\n let changedValue = Object.assign(\r\n new PresetDatesRange(),\r\n {\r\n type:\r\n (value as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n },\r\n DatesRange.fromPreset(\r\n (value as PeriodTypesEntity) ??\r\n (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n null,\r\n null,\r\n ),\r\n );\r\n setValue(state => changedValue);\r\n props.onChange(changedValue);\r\n };\r\n return (\r\n <>\r\n {value !== undefined && (\r\n <>\r\n twoDaysEnabled === true || f !== 'TodayTomorrow',\r\n )}\r\n value={\r\n props.value instanceof PresetDatesRange\r\n ? (props.value.type as PeriodTypesEntity | undefined)\r\n : (props.value as PeriodTypesEntity | undefined)\r\n }\r\n disableClearable={true}\r\n placeholder={t(translations.Forever)}\r\n size=\"small\"\r\n id=\"datesrangeid\"\r\n aria-label=\"Date Periods select\"\r\n />\r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default DatesPeriodFilter;\r\n\r\nexport const SchedulerDatePositionArray: Array = [\r\n 'Today',\r\n 'Tomorrow',\r\n 'Yesterday',\r\n 'TodayTomorrow',\r\n 'ThisWeek',\r\n 'NextWeek',\r\n 'ThisMonth',\r\n 'NextMonth',\r\n 'LastWeek',\r\n 'LastMonth',\r\n 'ThisQuarter',\r\n 'LastQuarter',\r\n 'NextQuarter',\r\n 'ThisYear',\r\n 'LastYear',\r\n 'NextYear',\r\n 'CustomDate',\r\n];\r\ntype Extends = U;\r\nexport type SchedulerDatePositionUnion = Extends<\r\n PeriodTypes,\r\n | 'Today'\r\n | 'Tomorrow'\r\n | 'Yesterday'\r\n | 'TodayTomorrow'\r\n | 'ThisWeek'\r\n | 'NextWeek'\r\n | 'ThisMonth'\r\n | 'NextMonth'\r\n | 'LastWeek'\r\n | 'LastMonth'\r\n | 'ThisQuarter'\r\n | 'LastQuarter'\r\n | 'NextQuarter'\r\n | 'ThisYear'\r\n | 'LastYear'\r\n | 'NextYear'\r\n | 'CustomDate'\r\n>;\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.ServiceType\r\n *\r\n */\r\n\r\nexport enum ServiceType {\r\n Online = 1,\r\n Offline = 2,\r\n Sample = 3,\r\n Workflow = 4,\r\n}\r\nexport type ServiceTypeUnion = keyof typeof ServiceType;\r\nexport const ServiceTypeUnionArray: Array = [\r\n 'Online',\r\n 'Offline',\r\n 'Sample',\r\n 'Workflow',\r\n];\r\n","export enum WorkWeekDays {\r\n FirstDay = 1,\r\n SecondsDay = 2,\r\n ThirdDay = 3,\r\n FourthDay = 4,\r\n FifthDay = 5,\r\n SixthDay = 6,\r\n}\r\n","import {\r\n IViewState,\r\n ViewLengths,\r\n ViewLengthsArray,\r\n ViewTypes,\r\n} from '../slice/types';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n SchedulerDatePositionArray,\r\n SchedulerDatePositionUnion,\r\n} from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport type SchedulerPosition = SchedulerDatePositionUnion | ViewLengths;\r\n\r\nexport type SchedulerPositionState = Pick<\r\n IViewState,\r\n 'viewLength' | 'date' | 'preset' | 'viewType'\r\n>;\r\n\r\nexport const parsePosition = (\r\n s?: SchedulerPosition,\r\n d?: Timestamp,\r\n vt?: ViewTypes,\r\n): SchedulerPositionState => {\r\n const result: SchedulerPositionState = {\r\n preset: 'ThisWeek',\r\n viewLength: 'week',\r\n date: dateUtils.formatISO(dateUtils.startOfWeek(new Date())),\r\n viewType: vt ?? 'calendar',\r\n };\r\n if (d !== undefined) {\r\n const parsedDate = dateUtils.tryParse(d);\r\n if (parsedDate !== null) {\r\n result.date = dateUtils.formatISO(parsedDate);\r\n }\r\n }\r\n\r\n if (s !== undefined) {\r\n // try parse preset period/position like nextweek\r\n const presetPosition:\r\n | SchedulerDatePositionUnion\r\n | undefined = SchedulerDatePositionArray.find(\r\n f => f.toLowerCase() === s.toLowerCase(),\r\n );\r\n if (presetPosition !== undefined) {\r\n const preset = DatesRange.fromPreset(\r\n { Id: presetPosition, Name: 'dummy' },\r\n null,\r\n null,\r\n );\r\n if (preset.start !== null) {\r\n result.date = dateUtils.formatISO(preset.start);\r\n }\r\n result.viewLength = presetPeriodToViewLength(\r\n presetPosition,\r\n result.viewType,\r\n );\r\n }\r\n const viewLength: ViewLengths | undefined = ViewLengthsArray.find(\r\n f => f.toLowerCase() === s.toLowerCase(),\r\n );\r\n if (viewLength !== undefined) {\r\n result.viewLength = viewLength;\r\n }\r\n }\r\n return result;\r\n};\r\n\r\nexport function presetPeriodToViewLength(\r\n preset: SchedulerDatePositionUnion,\r\n viewType: ViewTypes,\r\n): ViewLengths {\r\n switch (preset) {\r\n case 'Today':\r\n case 'Yesterday':\r\n case 'Tomorrow':\r\n return 'day';\r\n case 'TodayTomorrow':\r\n return 'twodays';\r\n case 'LastWeek':\r\n case 'ThisWeek':\r\n case 'NextWeek':\r\n return 'week';\r\n case 'LastMonth':\r\n case 'ThisMonth':\r\n case 'NextMonth':\r\n return 'month';\r\n case 'LastQuarter':\r\n case 'ThisQuarter':\r\n case 'NextQuarter':\r\n return viewType === 'timeline' ? 'quarter' : 'week';\r\n case 'LastYear':\r\n case 'ThisYear':\r\n case 'NextYear':\r\n return viewType === 'timeline' ? 'year' : 'week';\r\n case 'CustomDate':\r\n return 'customdays';\r\n default:\r\n assertExhaustive(preset);\r\n }\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { pick } from 'lodash';\r\nimport { Period } from 'types/Period';\r\n\r\n/**\r\n * Adjusts start/end times of a reservation to match the ForceFullDayReservations requirements:\r\n * * starts = now if reservation is placed for today, start of the day otherwise\r\n * * ends = midnight of the next day\r\n * @param period\r\n * @returns adjusted start/end times\r\n */\r\nexport function applyForceFullDayReservations(\r\n period: Period,\r\n forceFullDayReservations: boolean | undefined,\r\n): Period {\r\n if (forceFullDayReservations !== true) {\r\n return pick(period, 'start', 'end');\r\n }\r\n\r\n const now = new Date();\r\n const startsToday =\r\n dateUtils.truncateTime(now).getTime() ===\r\n dateUtils.truncateTime(period.start).getTime();\r\n\r\n const startTime = startsToday ? now : dateUtils.truncateTime(period.start);\r\n\r\n const truncatedEndTime = dateUtils.truncateTime(period.end);\r\n const adjustEndTime = period.end.getTime() !== truncatedEndTime.getTime();\r\n const endTime = adjustEndTime\r\n ? dateUtils.addDays(dateUtils.truncateTime(period.end), 1)\r\n : period.end;\r\n const result = {\r\n start: startTime,\r\n end: endTime,\r\n start_date: startTime,\r\n end_date: endTime,\r\n };\r\n return result;\r\n}\r\n","import { flow, partialRight } from 'lodash';\r\nimport { Period } from 'types/Period';\r\nimport { applyForceFullDayReservations } from './applyForceFullDayReservations';\r\nimport { SchedulerPeriod } from '../types/SchedulerPeriod';\r\n\r\n/**\r\n * Intended to adjust new event start/end according to ForceFullDayReservations equipment setting\r\n * @param period\r\n * @param forceFullDayReservations\r\n * @returns\r\n */\r\nexport function adjustSchedulerEventTimes(\r\n period: SchedulerPeriod,\r\n forceFullDayReservations: boolean | undefined,\r\n): SchedulerPeriod {\r\n const p = (period: SchedulerPeriod): Period => ({\r\n start: period.start_date,\r\n end: period.end_date,\r\n });\r\n const pp = (period: Period): SchedulerPeriod => ({\r\n start_date: period.start,\r\n end_date: period.end,\r\n });\r\n\r\n const result = flow(\r\n p,\r\n partialRight(applyForceFullDayReservations, forceFullDayReservations),\r\n pp,\r\n )(period);\r\n return result;\r\n}\r\n","import { useEffect } from 'react';\r\n\r\ntype ListenerProps = {\r\n [key in keyof WindowEventMap]?: EventListenerOrEventListenerObject;\r\n};\r\n\r\nexport default function useGlobalDOMEvents(props: ListenerProps) {\r\n useEffect(() => {\r\n for (let [key, func] of Object.entries(props)) {\r\n window.addEventListener(key, func, false);\r\n }\r\n return () => {\r\n for (let [key, func] of Object.entries(props)) {\r\n window.removeEventListener(key, func, false);\r\n }\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n}\r\n","/**\r\n *\r\n * FiltersGroupDisplay\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { FilterDisplay } from '../FilterDisplay';\r\nimport { IFilterSettings } from '../IFilterSettings';\r\nimport { areSameFilter, filterKey } from '../utils';\r\n\r\nexport interface FiltersGroupDisplayProps {\r\n appliedFilters: IFilterSettings[];\r\n onChange: (items: IFilterSettings[]) => void;\r\n openFilter: () => void;\r\n}\r\n\r\nexport function FiltersGroupDisplay(\r\n props: FiltersGroupDisplayProps,\r\n) {\r\n const [items, setItems] = React.useState(\r\n props.appliedFilters.filter(f => f.value !== null && f.value !== undefined),\r\n );\r\n React.useEffect(() => {\r\n setItems(\r\n props.appliedFilters.filter(\r\n f => f.value !== null && f.value !== undefined,\r\n ),\r\n );\r\n }, [props.appliedFilters]);\r\n const handleDelete = item => {\r\n props.onChange(\r\n props.appliedFilters.map(f =>\r\n !areSameFilter({ f, item }) ? f : { ...f, ...{ value: null } },\r\n ),\r\n );\r\n };\r\n return (\r\n <>\r\n {items\r\n .filter(f => f.value !== undefined)\r\n .map((item, index) => (\r\n \r\n ))}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FilterDisplay\r\n *\r\n */\r\nimport { Chip, ChipProps, Theme, useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IFilterSettings } from '../IFilterSettings';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { Entity } from 'types/common';\r\nimport { IsEntity, IsNotEmptyArray } from '../AppliedFilterComponent';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport styled from 'styled-components';\r\n\r\nexport interface FilterDisplayProps {\r\n filter: IFilterSettings;\r\n onDelete: (item: IFilterSettings) => void;\r\n openFilter: () => void;\r\n}\r\nexport const FilterChip = styled(\r\n ({\r\n theme,\r\n ...other\r\n }: {\r\n theme: Theme;\r\n } & ChipProps) => ,\r\n)`\r\n &.filter-display-root {\r\n gap: ${props => props.theme.spacing(1)}px;\r\n max-width: 58ch;\r\n border-radius: 8px;\r\n background-color: ${props => props.theme.palette.common.grayDividers};\r\n }\r\n`;\r\nexport function FilterDisplay(props: FilterDisplayProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const theme = useTheme();\r\n const isMobile = DetectIsMobile();\r\n const value = props.filter.value;\r\n const displayValue =\r\n typeof value === 'string'\r\n ? value\r\n : typeof value === 'number'\r\n ? value?.toString()\r\n : value instanceof Date\r\n ? dateUtils.shortDateFormat(value)\r\n : value instanceof PresetDatesRange\r\n ? value?.GetPresetDatesRangeDisplayString(t)\r\n : IsEntity(value)\r\n ? (value as Entity).Name\r\n : IsNotEmptyArray(value)\r\n ? (value as Array>).map(v => v.Name).join(', ')\r\n : props.filter.getDisplay !== undefined\r\n ? props.filter.getDisplay(value)\r\n : t(translations.NA);\r\n const isInversed = props.filter.isInversed ? 'Not ' : '';\r\n\r\n const handleDelete = event => {\r\n props.onDelete(props.filter);\r\n };\r\n return !!props.filter.renderFilterDisplay ? (\r\n <>{props.filter.renderFilterDisplay(props)}\r\n ) : (\r\n <>\r\n \r\n \r\n {props.filter.displayName}\r\n \r\n : \r\n {displayValue === undefined || displayValue === null ? (\r\n \r\n ) : props.filter.displayName.length + displayValue.length > 40 ? (\r\n \r\n \r\n \r\n {isInversed}\r\n {displayValue}\r\n \r\n \r\n \r\n ) : (\r\n \r\n {isInversed}\r\n {displayValue}\r\n \r\n )}\r\n \r\n }\r\n onDelete={handleDelete}\r\n />\r\n \r\n );\r\n}\r\n","import { ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useLabelPrintSlice } from '../slice';\r\nimport { Identifiable } from 'types/common';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ICanRaiseBasicTableRefreshEvent } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\n\r\nexport interface PrintAssetLabelsButtonProps\r\n extends ButtonProps,\r\n ICanRaiseBasicTableRefreshEvent {\r\n rows: Array>;\r\n}\r\n\r\nexport function PrintSelectedAssetLabelsButton({\r\n rows,\r\n onRefresh,\r\n onClick,\r\n ...props\r\n}: PrintAssetLabelsButtonProps) {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const allowedRoles = [\r\n Roles.Administrators,\r\n Roles.LabTech,\r\n Roles.GroupAdministrators,\r\n Roles.EquipmentAdministrator,\r\n ];\r\n const systemSettings = useSelector(selectglobalSettings);\r\n // enable print only if any of the supported printers settings has been turned on\r\n const printEnabled =\r\n systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported) ||\r\n systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported);\r\n\r\n const show =\r\n printEnabled &&\r\n authenticatedUser?.Roles?.some(role => allowedRoles.includes(role));\r\n\r\n const dispatch = useDispatch();\r\n const { actions } = useLabelPrintSlice();\r\n\r\n if (!show) {\r\n return <>;\r\n } else {\r\n const assetIds = rows.map(f => f.Id);\r\n props.children = props.children ?? t(translations.PrintLabels);\r\n props.title = props.title ?? t(translations.PrintLabels);\r\n props.disabled = props.disabled || assetIds.length === 0;\r\n return (\r\n {\r\n dispatch(actions.open({ ids: assetIds, type: 'Asset' }));\r\n return Promise.resolve({\r\n ErrorMessages: [],\r\n SuccessMessages: [],\r\n WarningMessages: [],\r\n });\r\n }}\r\n />\r\n );\r\n }\r\n}\r\n","import { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectIsAuthenticated,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { ConfigurableTypes, ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\nimport { Notification } from 'types/Notification';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IRow } from '.';\r\nimport {\r\n getTableColumns,\r\n GetCachedConfigurableColumnsData,\r\n} from './ConfigurableColumns';\r\n\r\nexport interface IUseConfigurableColumnsProps {\r\n columns: Array>;\r\n /**\r\n * Id of the screen that table related to. Required!\r\n */\r\n screenId?: ScreensId;\r\n}\r\nexport const useConfigurableColumns = ({\r\n screenId,\r\n columns,\r\n}: IUseConfigurableColumnsProps) => {\r\n // Configurable columns\r\n // columns will be replaced with configurableColumns\r\n\r\n const { t } = useTranslation();\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const AuthenticatedUser = useSelector(selectAuthenticatedUser);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const dispatch = useDispatch();\r\n const { actions: globalActions } = useAppSettingsSlice();\r\n const setGlobalMessage = React.useCallback(\r\n (message: Notification) => {\r\n dispatch(globalActions.addNotification(message));\r\n },\r\n [dispatch, globalActions],\r\n );\r\n const [configurableColumns, setConfigurableColumns] = useAsyncExtendedState<\r\n Column[] | undefined\r\n >(screenId === undefined ? columns : undefined);\r\n\r\n const loadConfigurableColumns = React.useCallback(\r\n async (props: {\r\n screenId: ScreensId;\r\n columns: Array>;\r\n isAuthenticated?: boolean;\r\n force?: boolean;\r\n }) => {\r\n try {\r\n const config = await GetCachedConfigurableColumnsData(\r\n props.screenId,\r\n ConfigurableTypes.ColumnScreenConfig,\r\n\r\n isAuthenticated,\r\n props.force,\r\n );\r\n\r\n return getTableColumns({\r\n response: config,\r\n ConfigurableColumnsSetUp: columns,\r\n });\r\n } catch (error) {\r\n setGlobalMessage({\r\n key: 'WrongColumnDefinition',\r\n message: t(translations.WrongColumnDefinition_info) as string,\r\n variant: 'warning',\r\n autoHideDuration: 30000,\r\n closable: true,\r\n });\r\n return getTableColumns({\r\n response: [],\r\n ConfigurableColumnsSetUp: columns,\r\n });\r\n }\r\n },\r\n [columns, isAuthenticated, setGlobalMessage, t],\r\n );\r\n const [fetchConfigState, getConfigurableColumns] = usePromise(\r\n loadConfigurableColumns,\r\n );\r\n\r\n const [\r\n configurableColumnsExport,\r\n setConfigurableColumnsExport,\r\n ] = useAsyncExtendedState | undefined>(undefined);\r\n const loadConfigurableColumnsExport = React.useCallback(\r\n async (listId: ScreensId, isAuthenticated: boolean | undefined) => {\r\n const d = await GetCachedConfigurableColumnsData(\r\n listId,\r\n ConfigurableTypes.ColumnExportConfig,\r\n isAuthenticated,\r\n false,\r\n );\r\n const p = d.map(f => f.Id);\r\n return p;\r\n },\r\n [],\r\n );\r\n const [, fetchExport] = usePromise(loadConfigurableColumnsExport);\r\n\r\n // useEffect will only be called once because columns and screenId do not change, it is a trick\r\n React.useEffect(() => {\r\n if (screenId !== undefined) {\r\n setConfigurableColumns(getConfigurableColumns({ screenId, columns }));\r\n }\r\n if (screenId !== undefined) {\r\n setConfigurableColumnsExport(fetchExport(screenId, isAuthenticated));\r\n }\r\n }, [\r\n columns,\r\n fetchExport,\r\n getConfigurableColumns,\r\n isAuthenticated,\r\n screenId,\r\n setConfigurableColumns,\r\n setConfigurableColumnsExport,\r\n ]);\r\n\r\n const refreshConfigurableColumns = React.useCallback(() => {\r\n if (screenId !== undefined) {\r\n setConfigurableColumns(\r\n loadConfigurableColumns({\r\n screenId,\r\n columns,\r\n force: true,\r\n isAuthenticated,\r\n }),\r\n );\r\n }\r\n }, [\r\n screenId,\r\n setConfigurableColumns,\r\n loadConfigurableColumns,\r\n columns,\r\n isAuthenticated,\r\n ]);\r\n\r\n const handleConfigurableColumns = React.useCallback(() => {\r\n if (screenId && AuthenticatedUser) {\r\n let targetUrl = '/ConfigurableColumn.aspx';\r\n // eslint-disable-next-line no-restricted-globals\r\n let path = location.pathname.split('/');\r\n // eslint-disable-next-line no-restricted-globals\r\n const search = location.search;\r\n\r\n let publicSub = publicUrl?.split('/');\r\n path.shift();\r\n if (path.length > 1) {\r\n if (\r\n !!publicSub &&\r\n (publicSub[publicSub.length - 1] === ''\r\n ? publicSub[publicSub.length - 2]\r\n : publicSub[publicSub.length - 1]) === path[0]\r\n ) {\r\n path.shift();\r\n }\r\n }\r\n let returnUrl = '~/' + path.join('/') + search;\r\n let redirUrl = toRootedURL(targetUrl, {\r\n id: screenId,\r\n UserName: AuthenticatedUser.Id,\r\n ReturnUrl: returnUrl,\r\n });\r\n // eslint-disable-next-line no-restricted-globals\r\n window.open(redirUrl, '_blank'); // + returnUrl;\r\n }\r\n }, [AuthenticatedUser, publicUrl, screenId]);\r\n\r\n // The configCompleted variable is used to show the loading indicator while the configurable columns data is being loaded\r\n // There's nothing to complete when there's no screenId and this variable does not need a separate state as it's a derivative of the fetch status.\r\n const configCompleted =\r\n screenId === undefined || fetchConfigState.status === 'resolved';\r\n return {\r\n configurableColumns,\r\n configurableColumnsExport,\r\n handleConfigurableColumns,\r\n configCompleted,\r\n refreshConfigurableColumns,\r\n };\r\n};\r\n","import React from 'react';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { TablePaginationActionsProps } from '@material-ui/core/TablePagination/TablePaginationActions';\r\nimport Box from '@material-ui/core/Box';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: theme.spacing(1.5),\r\n paddingRight: theme.spacing(1.5),\r\n },\r\n}));\r\n\r\nconst TablePaginationActions: React.FC = props => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const { count, page, rowsPerPage, onChangePage } = props;\r\n\r\n const handleFirstPageButtonClick = event => {\r\n onChangePage(event, 0);\r\n };\r\n\r\n const handleBackButtonClick = event => {\r\n onChangePage(event, page - 1);\r\n };\r\n\r\n const handleNextButtonClick = event => {\r\n onChangePage(event, page + 1);\r\n };\r\n\r\n const handleLastPageButtonClick = event => {\r\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\r\n };\r\n\r\n return (\r\n \r\n \r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n = Math.ceil(count / rowsPerPage) - 1}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n size=\"xs\"\r\n aria-label=\"next page\"\r\n >\r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n = Math.ceil(count / rowsPerPage) - 1}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n size=\"xs\"\r\n aria-label=\"last page\"\r\n >\r\n {theme.direction === 'rtl' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\n// TablePaginationActions.propTypes = {\r\n// count: PropTypes.number.isRequired,\r\n// onChangePage: PropTypes.func.isRequired,\r\n// page: PropTypes.number.isRequired,\r\n// rowsPerPage: PropTypes.number.isRequired,\r\n// };\r\n\r\nexport default TablePaginationActions;\r\n","/**\r\n *\r\n * ExportButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Menu, MenuItem } from '@material-ui/core';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useDialogAlertSlice } from 'app/components/DialogAlert/slice';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport fileDownload from 'js-file-download';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface ExportButtonProps {\r\n //selectedRows: T[];\r\n onClick: () => Promise;\r\n onDownloadTemplateClick?: () => void;\r\n useExportForImport?: boolean;\r\n getAllFilteredRowsCallback?: (prop: keyof T) => Promise;\r\n selectedFilterRowProp?: keyof T;\r\n screenId?: ScreensId;\r\n}\r\n\r\nexport function ExportButton(props: ExportButtonProps) {\r\n const { t } = useTranslation();\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const [processing, setProcessing] = React.useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useDialogAlertSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const settings = useSelector(selectglobalSettings);\r\n const handleClick = event => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n const handleExport = async () => {\r\n handleClose();\r\n setProcessing(true);\r\n await props.onClick();\r\n setProcessing(false);\r\n };\r\n\r\n const handleExportForImportClick = async () => {\r\n handleClose();\r\n if (\r\n !!props.getAllFilteredRowsCallback &&\r\n !!props.selectedFilterRowProp &&\r\n !!props.screenId\r\n ) {\r\n setProcessing(true);\r\n await handleExportForImport(\r\n props.getAllFilteredRowsCallback,\r\n props.selectedFilterRowProp,\r\n props.screenId,\r\n );\r\n setProcessing(false);\r\n } else {\r\n dispatch(actions.showAlert('Import for Export is not configured!'));\r\n }\r\n };\r\n const handleExportForImport = async (\r\n rowsCallback: (prop: keyof T) => Promise,\r\n p: keyof T,\r\n screenId: ScreensId,\r\n ) => {\r\n let toBigQS = '';\r\n try {\r\n const selectedRows = await rowsCallback(p);\r\n const exportRows = !!selectedRows\r\n ? selectedRows.map(item => item[p])\r\n : [];\r\n toBigQS = exportRows.join(',');\r\n const res = await ExportImportActions.ExportForImport(\r\n screenId,\r\n exportRows,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined ? cd.split('filename=')[1] : 'ExportForImport.xlsx';\r\n fileDownload(res.data, filename);\r\n if (ScreensId.MyAssets === screenId) {\r\n const MaxRecordsAllowedAssetImport = parseInt(\r\n settings.GetString(AllowedSettings.MaxRecordsAllowedAssetImport),\r\n );\r\n if (exportRows.length > MaxRecordsAllowedAssetImport) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: `Only ${MaxRecordsAllowedAssetImport} rows were exported`,\r\n }),\r\n );\r\n }\r\n }\r\n } catch (error) {\r\n let messageLongQS =\r\n toBigQS.length > 5000\r\n ? (t(translations.err_ImportForExportFailed_longQS) as string)\r\n : undefined;\r\n let deffMessage = t(translations.err_ImportForExportFailed) as string;\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: !!messageLongQS ? messageLongQS : deffMessage,\r\n }),\r\n );\r\n }\r\n };\r\n const handleDownloadTemplateClick = () => {\r\n if (props.onDownloadTemplateClick !== undefined) {\r\n props.onDownloadTemplateClick();\r\n }\r\n };\r\n\r\n const showSingleExportButton = ![\r\n props.useExportForImport === true ? true : undefined,\r\n props.onDownloadTemplateClick,\r\n ].some(item => item !== undefined);\r\n\r\n // render a menu if both set of columns are provided\r\n // render single button if only export columns are present and the \"for import\" is not set\r\n return (\r\n \r\n }\r\n onClick={showSingleExportButton ? handleExport : handleClick}\r\n processing={processing}\r\n title={t(translations.ExportButtonTooltip) as string}\r\n >\r\n {t(translations.Export)}\r\n \r\n {!showSingleExportButton && (\r\n <>\r\n \r\n \r\n {t(translations.ExportToXLSX)}\r\n \r\n {props.useExportForImport === true && (\r\n \r\n {t(translations.ExportForImport)}\r\n \r\n )}\r\n {props.onDownloadTemplateClick !== undefined && (\r\n \r\n {t(translations.DownloadTemplate)}\r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { Box } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../ControlledTable/ControlledTableProps';\r\nimport { SelectedRowsActionRenderer } from '../SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\n\r\nexport interface SelectedActionsProps\r\n extends ICanRaiseBasicTableRefreshEvent {\r\n actions: SelectedRowsActionRenderer[];\r\n selectedArray: TRow[];\r\n toggleAllRowsSelected: (value?: boolean) => void;\r\n totalRows: number;\r\n shortView?: boolean;\r\n}\r\n\r\nexport function SelectedActions({\r\n actions,\r\n onRefresh,\r\n selectedArray,\r\n toggleAllRowsSelected,\r\n totalRows,\r\n shortView,\r\n ...props\r\n}: SelectedActionsProps) {\r\n const { t } = useTranslation();\r\n const clearSelection = () => {\r\n toggleAllRowsSelected(false);\r\n };\r\n const allActions = React.useMemo(() => {\r\n return actions.filter(f => f !== undefined);\r\n }, [actions]);\r\n return shortView ? (\r\n <>\r\n \r\n {`${selectedArray.length} of ${totalRows} Items`}\r\n \r\n <>{allActions[0](selectedArray, onRefresh, toggleAllRowsSelected)}\r\n {allActions.length > 1 && (\r\n {\r\n return indx > 0 && f !== undefined;\r\n })\r\n .map((item, index) =>\r\n item(selectedArray, onRefresh, toggleAllRowsSelected),\r\n )}\r\n >\r\n )}\r\n {/* */}\r\n \r\n ) : (\r\n <>\r\n \r\n {`${selectedArray.length} of ${totalRows} Items`}\r\n \r\n\r\n {allActions.map((item, index) => (\r\n \r\n {item(selectedArray, onRefresh, toggleAllRowsSelected)}\r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nexport interface ConfigureColumnsButtonProps {\r\n onClick?: () => void;\r\n}\r\nexport function ConfigureColumnsButton(props: ConfigureColumnsButtonProps) {\r\n const { t } = useTranslation();\r\n const { onClick } = props;\r\n\r\n return (\r\n }\r\n onClick={onClick}\r\n >\r\n {t(translations.Columns)}\r\n \r\n );\r\n}\r\n","import { useLocation } from 'react-router-dom';\r\nimport { usePrevious } from './usePrevious';\r\nimport { useEffect } from 'react';\r\n//import { Location } from '@types/history';\r\n\r\nexport const useLocationChange = action => {\r\n const location = useLocation();\r\n const prevLocation = usePrevious(location);\r\n useEffect(() => {\r\n action(location, prevLocation);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [location]);\r\n};\r\n","import styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const TabsWrapper = styled('div')(({ theme }) => ({\r\n '&.tabsWrapper': {\r\n display: 'flex',\r\n padding: '0px 32px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n alignSelf: 'stretch',\r\n gap: '32px',\r\n width: '100%',\r\n '&.scrollContent': {\r\n overflow: 'hidden',\r\n },\r\n '&.tabsHorizontal': {\r\n '& .basicTabs': {\r\n flexGrow: 1,\r\n width: '100%',\r\n borderBottom: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n },\r\n },\r\n '&.tabsVertical': {\r\n flexDirection: 'row',\r\n padding: '0px',\r\n },\r\n '& .basicTabs': {\r\n backgroundColor: 'transparent',\r\n },\r\n },\r\n}));\r\nexport const TabPanelWrapper = styled('div')(({ theme }) => ({\r\n '&.tabPanel': {\r\n width: '100%',\r\n '&.scrollablePanel': {\r\n height: '100%',\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: '4px',\r\n backgroundColor: bookitColors.grayscale.grayBorders,\r\n },\r\n },\r\n },\r\n}));\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IFileDto } from 'api/odata/generated/entities/IFileDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { FormInputFile } from 'app/components/Forms/FormInputFile';\r\nimport React from 'react';\r\nimport { Identifiable } from 'types/common';\r\nimport { CustomFormFieldProps } from '../CustomFormFields';\r\n\r\nexport function CustomFormFileUpload({\r\n formField,\r\n readonly,\r\n disabled,\r\n ...props\r\n}: CustomFormFieldProps) {\r\n return (\r\n \r\n );\r\n}\r\nconst url = '/api/odata/v4/Files';\r\nexport const InitFormFiles = (\r\n id: string,\r\n formField: IFormFieldDto | undefined,\r\n) => {\r\n const initids = id\r\n .split(',')\r\n .filter(f => f !== '')\r\n .map(item => {\r\n return { Id: item };\r\n }) as Identifiable[];\r\n if (initids.length > 0) {\r\n let filter: string | undefined = '';\r\n if (formField) {\r\n if (formField.IsMultiple) {\r\n filter = new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n initids,\r\n ).toString();\r\n } else {\r\n filter = `Id eq ${initids[0].Id}`;\r\n }\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filter,\r\n $select: 'Id,Name,Size,TypeId',\r\n $skip: 0,\r\n $top: initids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as IFileDto[]);\r\n } else {\r\n return new Promise((resolve, reject) => {\r\n resolve([] as IFileDto[]);\r\n });\r\n }\r\n};\r\n","import { IRepetitiveDto, RepetitiveInit } from 'types/IRepetitiveDto';\r\nimport { RepetitiveForm } from '.';\r\nimport * as React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRepetitiveSlice } from './slice';\r\nimport { Portal } from '@material-ui/core';\r\nimport { useRef } from 'react';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { MutableRefObject } from 'react';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { RepetitiveFor } from './slice/types';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nexport interface RepetitiveControlProps {\r\n startDate?: Date | null;\r\n saveRepetitive?: (values: IRepetitiveDto) => void;\r\n submitFormRef: MutableRefObject;\r\n title?: string;\r\n type: RepetitiveFor;\r\n disabled?: boolean;\r\n formIsValid?: (isValid: boolean) => void;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n //submitForm: (e) => void;\r\n}\r\n\r\nexport function RepetitiveControl(props: RepetitiveControlProps) {\r\n const {\r\n saveRepetitive,\r\n submitFormRef,\r\n startDate,\r\n title,\r\n type,\r\n disabled,\r\n formIsValid,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n } = props;\r\n //const submitFormRef = React.useRef(null);\r\n const dispatch = useDispatch();\r\n const { actions } = useRepetitiveSlice();\r\n const [initData, setInitData] = React.useState(\r\n undefined,\r\n );\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n // React.useMemo(() => {\r\n // return RepetitiveInit(\r\n // startDate ? dateUtils.dateOrStringToDate(startDate) : new Date(),\r\n // dateUtils.addDays(\r\n // startDate ? dateUtils.dateOrStringToDate(startDate) : new Date(),\r\n // 7,\r\n // ),\r\n // );\r\n // }, [startDate]);\r\n useEffectOnMount(() => {\r\n setInitData(() =>\r\n RepetitiveInit(startDate ? getOffsetDate(startDate) : newDate()),\r\n );\r\n // if (startDate !== undefined && startDate !== null) {\r\n // dispatch(actions.setStartDate(dateUtils.dateOrStringToDate(startDate)));\r\n // } else {\r\n // dispatch(actions.setStartDate(new Date()));\r\n // }\r\n return () => {};\r\n });\r\n // React.useEffect(() => {\r\n // let active = doSubmit;\r\n // if (active) {\r\n // if (submitFormRef.current) {\r\n // submitFormRef.current.Submit();\r\n // dispatch(actions.setSubmit(false));\r\n // }\r\n // }\r\n // return () => {\r\n // active = false;\r\n // };\r\n // }, [actions, dispatch, doSubmit]);\r\n\r\n // const handleSubmitForm = e => {\r\n // if (submitFormRef.current) {\r\n // submitFormRef.current(e);\r\n // }\r\n // };\r\n const portalRef = useRef(null);\r\n const bindSubmitForm = React.useCallback(\r\n submitForm => {\r\n submitFormRef.current = submitForm;\r\n },\r\n [submitFormRef],\r\n );\r\n const handleSubmit = React.useCallback(\r\n (values: IRepetitiveDto) => {\r\n if (saveRepetitive) {\r\n saveRepetitive(values);\r\n } else {\r\n var d = {\r\n StartDate:\r\n values.StartDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartDate),\r\n ),\r\n RecurringEvents: values.RecurringEvents,\r\n RepeatsOnDays: values.RepeatsOnDays,\r\n RecurringEndDate:\r\n values.RecurringEndDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n ),\r\n RepeatsEveryDay: values.RepeatsEveryDay,\r\n RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n } as IRepetitiveDto;\r\n dispatch(actions.saveState(d));\r\n }\r\n },\r\n [actions, dispatch, saveRepetitive],\r\n );\r\n return initData ? (\r\n \r\n
    \r\n \r\n \r\n \r\n {/* */}\r\n \r\n ) : (\r\n \r\n \r\n \r\n );\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Identifiable } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport interface IDeleteSamplesResult {\r\n successCount: number;\r\n errors: Error[];\r\n}\r\nexport async function deleteSamples(\r\n samples: Identifiable[],\r\n): Promise {\r\n let successCount = 0;\r\n const errors: Error[] = [];\r\n // todo: convert to transaction/batch\r\n for (const sample of samples) {\r\n const url = `/api/odata/v4/samples(${sample.Id})`;\r\n try {\r\n await httpClient.delete(url);\r\n successCount++;\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n i18next.t(translations.errormessage);\r\n errors.push(new Error(message));\r\n }\r\n }\r\n\r\n return {\r\n successCount: successCount,\r\n errors: errors,\r\n };\r\n}\r\n","import BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport parse from 'html-react-parser';\r\n\r\nimport { uniqueId } from 'lodash';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface ImportProps {\r\n onDownloadTemplateButtonClick?: React.MouseEventHandler;\r\n processing: boolean;\r\n title?: string;\r\n accept: '.xlsx' | '.xls' | '.csv';\r\n disabled?: boolean;\r\n hideImportButton?: boolean;\r\n hideMessage?: boolean;\r\n}\r\nexport interface ImportComponentProps extends ImportProps {\r\n handleFileChange: (file: File) => void;\r\n}\r\nexport function ImportComponent(props: ImportComponentProps) {\r\n const { t } = useTranslation();\r\n const ref = React.useRef(null);\r\n const handleFileChange = event => {\r\n const file = ref.current?.files?.[0];\r\n if (file !== undefined) {\r\n props.handleFileChange(file);\r\n }\r\n };\r\n\r\n const [fileId] = React.useState(uniqueId('import-file-'));\r\n const [buttonId] = React.useState(uniqueId('import-file-'));\r\n return (\r\n \r\n {props.onDownloadTemplateButtonClick !== undefined && (\r\n \r\n {t(translations.ImportRecordsDescription)}\r\n \r\n \r\n )}\r\n {props.onDownloadTemplateButtonClick !== undefined && (\r\n \r\n \r\n  \r\n \r\n \r\n )}\r\n \r\n {props.hideMessage === undefined ||\r\n (props.hideMessage === false && (\r\n \r\n ))}\r\n  \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { Action } from '@reduxjs/toolkit';\r\nimport { Task } from 'redux-saga';\r\nimport { fork, take, cancel, ActionPattern } from 'redux-saga/effects';\r\n\r\n/**\r\n * Similar to takeEvery, but also filters by the action parameters\r\n * see https://redux-saga.js.org/docs/api/#takelatestpattern-saga-args\r\n * @param patternOrChannel\r\n * @param keyfn\r\n * @param saga\r\n * @param args\r\n * @returns\r\n */\r\nexport const takeLatestByKey = (\r\n patternOrChannel: ActionPattern>,\r\n keyfn: (payload: TPayload) => string | number | symbol,\r\n saga,\r\n ...args\r\n) =>\r\n fork(function* () {\r\n const tasks: Record = {};\r\n while (true) {\r\n const action = yield take(patternOrChannel);\r\n const key = keyfn(action.payload);\r\n const isKeyEmpty = key === null && key === undefined;\r\n if (isKeyEmpty) {\r\n console.warn(\r\n `Empty key (${JSON.stringify(key)}) in takeLatestByKey.`,\r\n patternOrChannel,\r\n );\r\n }\r\n\r\n if (!isKeyEmpty) {\r\n if (tasks[key]) {\r\n yield cancel(tasks[key]); // cancel is no-op if the task has already terminated\r\n }\r\n }\r\n const task: Task = yield fork(saga, ...args.concat(action));\r\n if (!isKeyEmpty) {\r\n tasks[key] = task;\r\n }\r\n }\r\n });\r\n","import { IInvoiceTemplateDto } from 'app/pages/InvoiceTemplates/InvoiceTemplatesPage/IInvoiceTemplateDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/InvoiceTemplates';\r\nexport const InvoiceTemplatesApi = {\r\n insertInvoiceTemplate: invoiceTemplate => {\r\n const form = new FormData();\r\n Object.keys(invoiceTemplate).forEach(k => {\r\n form.append(k, invoiceTemplate[k]);\r\n });\r\n\r\n if (\r\n !!invoiceTemplate.HeaderFile &&\r\n invoiceTemplate.HeaderFile?.length > 0\r\n ) {\r\n form.append(\r\n 'TemplateHeaderFile',\r\n invoiceTemplate.HeaderFile[0].PostedFile,\r\n );\r\n }\r\n if (\r\n !!invoiceTemplate.FooterFile &&\r\n invoiceTemplate.FooterFile?.length > 0\r\n ) {\r\n form.append(\r\n 'TemplateFooterFile',\r\n invoiceTemplate.FooterFile[0].PostedFile,\r\n );\r\n }\r\n return httpClient.post(url, form);\r\n },\r\n updateInvoiceTemplate: (Id: number, invoiceTemplate) => {\r\n const form = new FormData();\r\n Object.keys(invoiceTemplate).forEach(k => {\r\n form.append(k, invoiceTemplate[k]);\r\n });\r\n\r\n if (\r\n !!invoiceTemplate.HeaderFile &&\r\n invoiceTemplate.HeaderFile?.length > 0\r\n ) {\r\n form.append(\r\n 'TemplateHeaderFile',\r\n invoiceTemplate.HeaderFile[0].PostedFile,\r\n );\r\n }\r\n if (\r\n !!invoiceTemplate.FooterFile &&\r\n invoiceTemplate.FooterFile?.length > 0\r\n ) {\r\n form.append(\r\n 'TemplateFooterFile',\r\n invoiceTemplate.FooterFile[0].PostedFile,\r\n );\r\n }\r\n return httpClient.put(url + '(' + Id + ')', form);\r\n },\r\n deleteInvoiceTemplates: (\r\n rows: IInvoiceTemplateDto[],\r\n ): Promise => {\r\n const invoiceTemplatesIds: number[] = rows.map(item => item.Id);\r\n const data = { invoiceTemplatesIds };\r\n const url = '/api/odata/v4/InvoiceTemplates/DeleteInvoiceTemplates';\r\n return httpClient.post(url, data);\r\n },\r\n getInvoiceTemplateById: (Id: number) => {\r\n const params: {\r\n $filter?: string;\r\n $select: string;\r\n } = {\r\n $filter: '(Id eq ' + Id + ')',\r\n $select: [\r\n 'Id',\r\n 'Name',\r\n 'CreatedAt',\r\n 'LastUpdated',\r\n 'FundingType',\r\n 'ServiceGroupId',\r\n 'ServiceGroup',\r\n 'Html',\r\n 'TableHeaderColor',\r\n 'TableBodyColor',\r\n 'HeaderFileName',\r\n 'FooterFileName',\r\n ].join(','),\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n InventoryBatchPicker,\r\n InventoryBatchPickerProps,\r\n} from '../pickers/AutocompletePickers/InventoryBatchesPicker';\r\n\r\nexport const FormInventoryBatchPicker = (\r\n props: FieldHookConfig &\r\n Omit,\r\n) => {\r\n const [field, meta, helpers] = useField(props);\r\n const handleChange = val => {\r\n props.onChange?.(val);\r\n helpers.setValue(val, true);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","export enum ReferenceType {\r\n AllReferences = 0,\r\n Reservation = 1,\r\n Usage = 2,\r\n OfflineService = 3,\r\n ServiceRequest = 4,\r\n Subscription = 5,\r\n}\r\n","/**\r\n *\r\n * BasicDialogContent\r\n *\r\n */\r\nimport {\r\n DialogContent,\r\n DialogContentProps as MuiDialogContentProps,\r\n styled,\r\n} from '@material-ui/core';\r\nexport interface BasicDialogContentProps extends MuiDialogContentProps {\r\n children: React.ReactNode;\r\n}\r\nexport function BasicDialogContent(props: BasicDialogContentProps) {\r\n const { children } = props;\r\n return {children};\r\n}\r\nconst StyledDialogContent = styled(DialogContent)(({ theme }) => ({\r\n padding: theme.spacing(2, 3),\r\n borderTop: 'unset',\r\n}));\r\n","import { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\n\r\nexport function getServiceRequestTicketTitle(item: IServiceRequestTicketDto) {\r\n return `#${item.ServiceRequestId} - ${item.ServiceRequest.CreatedFor?.Name}`;\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useServiceRequestsKanbanSlice } from '../../slice';\r\nimport { Dto } from '../../slice/types';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ParentTicketDetailsButtonProps {\r\n item?: Dto;\r\n}\r\n\r\nexport function ParentTicketDetailsButton({\r\n item,\r\n}: ParentTicketDetailsButtonProps) {\r\n const { t } = useTranslation();\r\n\r\n const dispatch = useDispatch();\r\n const { actions } = useServiceRequestsKanbanSlice();\r\n const handleOpenParentTicketClick = () => {\r\n if (item !== undefined) {\r\n dispatch(actions.showEditParent(item));\r\n }\r\n };\r\n if (\r\n item === undefined ||\r\n item.ParentTicketId === null ||\r\n item.ParentTicketId === undefined\r\n ) {\r\n return null;\r\n }\r\n return (\r\n \r\n );\r\n}\r\n","import { Caption } from 'app/components/Typography';\r\nimport { FormikErrors } from 'formik';\r\nimport styled from 'styled-components';\r\n\r\nexport interface ErrorsSummuryProps {\r\n errors: FormikErrors;\r\n}\r\nconst SummuryBox = styled('div')`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n`;\r\nexport function ErrorsSummury(props: ErrorsSummuryProps) {\r\n const data = Object.entries(props.errors).map(f => {\r\n return { name: f[0], msg: f[1] };\r\n });\r\n return data.length > 0 ? (\r\n \r\n {data.map(item => (\r\n \r\n {item.msg as string}\r\n \r\n ))}\r\n \r\n ) : null;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for ArticlesExternalSearchPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ArticlesExternalSearchPagePath = '/articles/search';\r\nexport const ArticlesExternalSearchPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ArticlesExternalSearchPage,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePickerProps,\r\n AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { BudgetExperimentStatuses } from 'enums/BudgetExperimentStatuses';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport function budgetExperimentsFilter(\r\n serviceTypes: IServiceTypeFilterDto[],\r\n serviceType: ServiceType | undefined,\r\n budgetId: number | undefined,\r\n resStart: Date | string | null | undefined,\r\n resEnd: Date | string | null | undefined,\r\n): (string | Condition)[] {\r\n const predicates: (string | Condition)[] = [];\r\n\r\n predicates.push(\r\n new Condition(\r\n 'Active',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n predicates.push(\r\n new Condition(\r\n 'StatusId',\r\n ODataOperators.Equals,\r\n BudgetExperimentStatuses.Approved,\r\n ),\r\n );\r\n\r\n predicates.push(\r\n new Condition(\r\n 'BudgetTaskActive',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n\r\n if (!isNullOrUndefined(budgetId)) {\r\n predicates.push(\r\n new Condition(\r\n 'BudgetTaskBudgetId',\r\n ODataOperators.Equals,\r\n budgetId,\r\n ),\r\n );\r\n }\r\n\r\n if (serviceTypes.length > 0) {\r\n let ids = serviceTypes\r\n .filter(f => f.ServiceGroupId !== null)\r\n .map(f => {\r\n return { Id: f.ServiceGroupId } as Identifiable;\r\n });\r\n if (ids.length > 0) {\r\n predicates.push(\r\n `(${new Condition(\r\n 'BudgetTaskAllCoresAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n )} or ${new Condition(\r\n 'BudgetTaskServiceGroupIds',\r\n ODataOperators.AnyIn,\r\n ids,\r\n )})`,\r\n );\r\n predicates.push(\r\n `(BudgetExperimentServiceGroups/any(s: s/ServiceGroupId in ${quoteODataValue(\r\n ids,\r\n )} and s/StatusId eq ${quoteODataValue(\r\n BudgetExperimentStatuses.Approved,\r\n )}))`,\r\n );\r\n }\r\n }\r\n\r\n if (predicates.length > 0) {\r\n return predicates;\r\n }\r\n return [];\r\n}\r\n\r\nexport interface BudgetExperimentsPickerProps\r\n extends Omit<\r\n AutocompletePickerProps,\r\n 'loadData'\r\n > {\r\n username?: string;\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n}\r\nconst url = '/api/odata/v4/BudgetExperimentsFilter';\r\nexport const initBudgetExperimentData = (\r\n initval: string | undefined,\r\n username: string,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(`${url}?username=${username}`, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n username: string,\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: `${url}?username=${username}`,\r\n predicates: predicates,\r\n select: ['Id', 'Name', 'Active', 'StatusId'],\r\n });\r\nexport function BudgetExperimentsPicker(props: BudgetExperimentsPickerProps) {\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const { username } = props;\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n username || authenticatedUser?.Id || '',\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport const loadBudgetExperiments = loadData;\r\n","import { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BudgetExperimentsPicker } from '../pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormBudgetExperimentsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n IFieldProps & {\r\n username: string | undefined;\r\n }) => {\r\n const [field, meta, helpers] = useField(\r\n props,\r\n );\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n disabled={props.disabled}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n username={props.username}\r\n />\r\n );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isMember } from 'app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember';\r\n\r\nexport interface UserGroupListenerProps {\r\n userName: Entity | null;\r\n services: Entity[];\r\n userGroup: Entity | null | undefined;\r\n isEdit: boolean;\r\n setUser: (value: Entity | null) => void;\r\n setBudget: (value: Entity | null) => void;\r\n values?: T;\r\n forceDisabled?: boolean;\r\n user: AuthenticatedUser | undefined;\r\n}\r\nexport function UserGroupListener({\r\n userName: selectedUser,\r\n services,\r\n userGroup,\r\n isEdit,\r\n setUser,\r\n setBudget,\r\n forceDisabled,\r\n user,\r\n}: UserGroupListenerProps) {\r\n const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n if (userGroup !== null) {\r\n if (\r\n serviceSettings.budgetVisible &&\r\n !isEdit &&\r\n services.length > 0 &&\r\n selectedUser !== null\r\n ) {\r\n if (!serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (!isMember(selectedUser, userGroup)) {\r\n setUser(null);\r\n if (serviceSettings.budgetVisible && !isEdit) {\r\n setBudget(null);\r\n }\r\n }\r\n }\r\n } else if (!serviceSettings.budgetVisible && !isEdit) {\r\n if (!isMember(selectedUser, userGroup)) {\r\n setUser(null);\r\n }\r\n }\r\n } else {\r\n if (!serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n setUser(null);\r\n if (serviceSettings.budgetVisible && !isEdit) {\r\n setBudget(null);\r\n }\r\n }\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [userGroup]);\r\n\r\n return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\n\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { isMember } from 'app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember';\r\n\r\nexport interface UserNameListenerProps {\r\n userName: Entity | null;\r\n userGroup: Entity | null;\r\n services: Entity[];\r\n user: AuthenticatedUser | undefined;\r\n globalSettings: GlobalSettingsType;\r\n isEdit: boolean;\r\n startTime: Date | string;\r\n endTime?: Date | string;\r\n setUserGroup: (value: Entity | null) => void;\r\n setBudget: (value: Entity | null) => void;\r\n values?: T;\r\n forceDisabled?: boolean;\r\n}\r\nexport function UserNameListener(props: UserNameListenerProps) {\r\n const {\r\n userName: selectedUser,\r\n services,\r\n isEdit,\r\n userGroup: selectedUserGroupo,\r\n globalSettings,\r\n setUserGroup,\r\n forceDisabled,\r\n } = props;\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n return serviceSettings.budgetVisible\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n : false;\r\n }, [\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n serviceSettings.budgetVisible,\r\n ]);\r\n\r\n const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n React.useEffect(() => {\r\n if (!initilized) {\r\n var reservationUserGroupGroupByBudgetUserGroup =\r\n services.length === 0\r\n ? globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n : ReservationUserGroupGroupByBudgetUserGroup;\r\n\r\n if (!isEdit) {\r\n if (selectedUser !== null) {\r\n if (!reservationUserGroupGroupByBudgetUserGroup) {\r\n if (!isMember(selectedUser, selectedUserGroupo)) {\r\n const selectedUserDto = selectedUser as IUserFilterDto;\r\n setUserGroup({\r\n Id: selectedUserDto.UserGroupId,\r\n Name: selectedUserDto.UserGroupName,\r\n } as Entity);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {};\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [selectedUser]);\r\n\r\n return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\nimport {\r\n budgetExperimentsFilter,\r\n loadBudgetExperiments,\r\n} from 'app/components/pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { initBudgetData } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\n\r\nexport interface BudgetListenerProps {\r\n budget: Entity | null;\r\n values?: T;\r\n setUserGroup: (value: Entity | null) => void;\r\n setBudgetExperiment: (value: Entity | null) => void;\r\n setBudget: (value: Entity | null) => void;\r\n userName: Entity | null;\r\n services: Entity[];\r\n isEdit: boolean;\r\n startTime: Date | string;\r\n endTime?: Date | string;\r\n user: AuthenticatedUser | undefined;\r\n serviceTypeEnum?: ServiceType;\r\n forceDisabled?: boolean;\r\n}\r\n\r\nexport function BudgetListener(props: BudgetListenerProps) {\r\n const {\r\n budget,\r\n setUserGroup,\r\n setBudgetExperiment,\r\n setBudget,\r\n services,\r\n userName,\r\n isEdit,\r\n startTime,\r\n endTime,\r\n serviceTypeEnum,\r\n user,\r\n forceDisabled,\r\n } = props;\r\n const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const currentUser =\r\n !!userName && userName !== null ? userName.Id : user?.Id || '';\r\n const fetchBudgetExperiment = async () => {\r\n try {\r\n const budgetExperiments = await loadBudgetExperiments(\r\n budgetExperimentsFilter(\r\n services as IServiceTypeFilterDto[],\r\n serviceTypeEnum,\r\n budget?.Id,\r\n startTime,\r\n endTime,\r\n ),\r\n currentUser,\r\n )(null);\r\n return budgetExperiments.value;\r\n } catch {\r\n return [];\r\n }\r\n };\r\n React.useEffect(() => {\r\n let cancel = false;\r\n if (!initilized) {\r\n if (!!budget?.Id) {\r\n if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n //let budget = values.Budget as IBudgetFilterDto;\r\n if (!!(budget as IBudgetFilterDto).UserGroupId) {\r\n setUserGroup({\r\n Id: (budget as IBudgetFilterDto).UserGroupId,\r\n Name: (budget as IBudgetFilterDto).UserGroupName,\r\n } as IUserGroupDto);\r\n }\r\n }\r\n if (serviceSettings.budgetExpirementVisible && !isEdit) {\r\n if ((budget as IBudgetFilterDto).HideExperiments === false) {\r\n (async () => {\r\n await fetchBudgetExperiment()\r\n .then(experiments => {\r\n if (cancel) {\r\n return;\r\n }\r\n if (experiments.length > 0) {\r\n if (experiments.length === 1) {\r\n setBudgetExperiment(experiments[0]);\r\n } else {\r\n setBudgetExperiment(null);\r\n }\r\n } else {\r\n setBudgetExperiment(null);\r\n }\r\n })\r\n .catch(() => {\r\n setBudgetExperiment(null);\r\n });\r\n })();\r\n } else {\r\n setBudgetExperiment(null);\r\n }\r\n }\r\n } else {\r\n if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n setUserGroup(null);\r\n }\r\n if (serviceSettings.budgetExpirementVisible) {\r\n setBudgetExperiment(null);\r\n }\r\n }\r\n } else {\r\n if (isEdit && budget !== null) {\r\n (async () => {\r\n await initBudgetData(budget.Id.toString())\r\n .then(budg => {\r\n if (cancel) {\r\n return;\r\n }\r\n setBudget(budg[0]);\r\n })\r\n .catch(() => {});\r\n })();\r\n }\r\n }\r\n setInitilized(false);\r\n return () => {\r\n cancel = true;\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [budget]);\r\n\r\n return null;\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useCallback, useRef, useState, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { FieldHandler, FormListener } from '../FormRender/FormRenderer';\r\nimport * as Yup from 'yup';\r\nimport {\r\n BudgetEntitySechema,\r\n BudgetExperimentEntitySechema,\r\n InstituteProjectEntitySechema,\r\n UserEntitySchema,\r\n UserGroupEntitySchema,\r\n} from '../Schemas';\r\nimport { TransformDate } from '../Schemas/SchemaMethods';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Formik, FormikProps, FormikValues } from 'formik';\r\nimport { FormUserPicker } from '../FormUserPicker';\r\nimport { FormFieldsSection, FormRow } from '../FormsLayout';\r\nimport { FormBudgetExperimentsPicker } from '../FormBudgetExperimentsPicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { budgetExperimentsFilter } from 'app/components/pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { FormRestrictedUserGroupPicker } from '../FormRestrictedUserGroupPicker';\r\nimport { RestrictedFilter } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { FormLabelText } from '../FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { ServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { FormFundingTypePicker } from '../FormFundingTypePicker';\r\nimport { FormBudgetPicker } from '../FormBudgetPicker';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport {\r\n selectConnectedFieldHandler,\r\n selectConnectedFiltersData,\r\n selectConnectedSettings,\r\n} from './slice/selectors';\r\nimport { useConnectedFiltersSlice } from './slice';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { UserGroupListener } from './FormFieldListeners/UserGroupListener';\r\nimport { UserNameListener } from './FormFieldListeners/UserNameListener';\r\nimport { BudgetListener } from './FormFieldListeners/BudgetListener';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport React from 'react';\r\nimport { Roles } from 'app/slice/types';\r\nimport { FormBookitDateTimePicker } from '../FormBookitDateTimePicker';\r\nimport produce from 'immer';\r\nimport { Entity } from 'types/common';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from '../FormTextField';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { ChildEntityProps } from '../../../../types/ChildEntityProps';\r\n\r\nexport interface ConnectedFiltersFormProps extends ChildEntityProps {\r\n isEdit: boolean;\r\n onSubmit: (item: IConnectedFiltersDto) => void;\r\n ConnectedFiltersData?: IConnectedFiltersDto;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n serviceTypeEnum?: ServiceType;\r\n serviceTypes: IServiceTypeFilterDto[];\r\n globalSettings: GlobalSettingsType;\r\n startTimeLabel?: string;\r\n endTimeLabel?: string;\r\n startLabelInline?: boolean;\r\n endLabelInline?: boolean;\r\n formIsValid?: (isValid: boolean) => void;\r\n orderForConsumables?: boolean;\r\n forceDisabled?: boolean;\r\n budgetPickerInfo?: string;\r\n}\r\n\r\nexport function ConnectedFiltersForm({\r\n isEdit,\r\n isChildEntry,\r\n onSubmit,\r\n ConnectedFiltersData,\r\n processing,\r\n bindSubmitForm,\r\n serviceTypeEnum,\r\n serviceTypes,\r\n startTimeLabel,\r\n endTimeLabel,\r\n startLabelInline,\r\n endLabelInline,\r\n globalSettings,\r\n formIsValid,\r\n orderForConsumables,\r\n forceDisabled,\r\n budgetPickerInfo,\r\n}: ConnectedFiltersFormProps): JSX.Element {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useConnectedFiltersSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n //USER AUTH\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const connectedSettings = useSelector(selectConnectedSettings);\r\n const connectedData = useSelector(selectConnectedFiltersData);\r\n //PICKER STATES\r\n const [userChanged, setUserChanged] = useState(false);\r\n const [userGroupChanged, setUserGroupChanged] = useState(false);\r\n const [budgetChanged, setBudgetChanged] = useState(false);\r\n const [budgetExpirementChanged, setBudgetExpirementChanged] = useState<\r\n boolean\r\n >(false);\r\n const [startTimeChanged, setStartTimeChanged] = useState(false);\r\n const [endTimeChanged, setEndTimeChanged] = useState(false);\r\n const { newDate } = useSystemDate();\r\n //REFS\r\n const formikRef = useRef>(null);\r\n //SCHEMA\r\n const computedSchema = useMemo(() => {\r\n const ConnectedFiltersSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n StartTime: Yup.date()\r\n .transform(TransformDate)\r\n .default(dateUtils.dateOrStringToDate(newDate())),\r\n EndTime: Yup.date().transform(TransformDate).optional(),\r\n User: UserEntitySchema.label(t(translations.User) as string)\r\n .nullable()\r\n .notRequired(),\r\n UserGroup: UserGroupEntitySchema.label(\r\n t(translations.UserGroup) as string,\r\n )\r\n .nullable()\r\n .default(null),\r\n Budget: BudgetEntitySechema.label(\r\n t(translations.BudgetNumber) as string,\r\n )\r\n .nullable()\r\n .default(null),\r\n //BudgetExperimentId if displayed then should be required\r\n BudgetExperiment: BudgetExperimentEntitySechema.nullable().default(\r\n null,\r\n ),\r\n InstituteProject: InstituteProjectEntitySechema.nullable()\r\n .notRequired()\r\n .optional()\r\n .default(null),\r\n ExternalCustomer: Yup.mixed()\r\n .label(t(translations.ExternalCustomer) as string)\r\n .nullable(true),\r\n FundingType: Yup.mixed()\r\n .default(getSingleInvoiceFundingType(0))\r\n .label(t(translations.FundingType) as string),\r\n PurchaseOrder: Yup.string()\r\n .label(t(translations.PurchaseOrder) as string)\r\n .nullable(true)\r\n .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n .when('Budget', {\r\n is: budget => {\r\n const result =\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory;\r\n return result;\r\n },\r\n then: schema => schema.required(),\r\n }),\r\n Reference: Yup.string()\r\n .label(t(translations.Reference) as string)\r\n .nullable(true),\r\n },\r\n );\r\n if (connectedSettings.budgetVisible === true) {\r\n ConnectedFiltersSchema.fields.Budget.withMutation(schema =>\r\n schema\r\n .required(\r\n `${t(translations.BudgetIsRequired) as string} ${\r\n !!budgetPickerInfo && forceDisabled ? budgetPickerInfo : ''\r\n }`,\r\n )\r\n .label(t(translations.BudgetNumber) as string),\r\n );\r\n }\r\n if (!processing) {\r\n if (\r\n connectedSettings.budgetExpirementVisible &&\r\n !!connectedData &&\r\n !!connectedData.Budget &&\r\n connectedData.Budget !== null &&\r\n (connectedData.Budget as IBudgetFilterDto).HideExperiments !==\r\n undefined &&\r\n (connectedData.Budget as IBudgetFilterDto)?.HideExperiments === false\r\n ) {\r\n ConnectedFiltersSchema.fields.BudgetExperiment.withMutation(schema =>\r\n schema.required(\r\n t(translations.res_err_BudgetExperimentRequired) as string,\r\n ),\r\n );\r\n }\r\n if (\r\n !connectedSettings.budgetVisible ||\r\n (connectedSettings.budgetVisible &&\r\n !connectedSettings.ReservationUserGroupGroupByBudgetUserGroup) ||\r\n connectedSettings.userGroupVisible\r\n ) {\r\n ConnectedFiltersSchema.fields.UserGroup.withMutation(schema =>\r\n schema\r\n .label(t(translations.UserGroup) as string)\r\n .required(t(translations.err_UserGroupRequired) as string),\r\n );\r\n ConnectedFiltersSchema.fields.User.withMutation(schema =>\r\n schema\r\n .label(t(translations.User) as string)\r\n .required(t(translations.err_UserFieldRequired) as string),\r\n );\r\n }\r\n if (connectedSettings.endTimeVisible) {\r\n ConnectedFiltersSchema.fields.EndTime.withMutation(schema =>\r\n schema\r\n .label(t(translations.EndTime) as string)\r\n .required(t(translations._errEndTimeRequired) as string)\r\n .min(\r\n Yup.ref('StartTime'),\r\n t(translations.err_EndTimeLowerThanStartTime) as string,\r\n ),\r\n );\r\n }\r\n if (connectedSettings.userVisible) {\r\n ConnectedFiltersSchema.fields.User.withMutation(schema =>\r\n schema\r\n .label(t(translations.User) as string)\r\n .required(t(translations.err_UserFieldRequired) as string),\r\n );\r\n }\r\n }\r\n\r\n return ConnectedFiltersSchema;\r\n }, [\r\n budgetPickerInfo,\r\n connectedData,\r\n connectedSettings.ReservationUserGroupGroupByBudgetUserGroup,\r\n connectedSettings.budgetExpirementVisible,\r\n connectedSettings.budgetVisible,\r\n connectedSettings.endTimeVisible,\r\n connectedSettings.userGroupVisible,\r\n connectedSettings.userVisible,\r\n forceDisabled,\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n globalSettings.purchaseOrderLengthSetting,\r\n newDate,\r\n processing,\r\n t,\r\n ]);\r\n const fieldHandler = useSelector(selectConnectedFieldHandler);\r\n const isRoleAdmin =\r\n authenticatedUser?.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser?.Roles.includes(Roles.GroupAdministrators) ||\r\n authenticatedUser?.Roles.includes(Roles.LabTech);\r\n const reserFieldHandler = () => {\r\n dispatch(actions.resetConnectedHandler());\r\n };\r\n const updateDataState = useCallback(\r\n (value: IConnectedFiltersDto) => {\r\n dispatch(actions.saveState(value));\r\n dispatch(\r\n actions.extendSettingsState({\r\n services: serviceTypes,\r\n globalSettings: globalSettings,\r\n settings: connectedSettings,\r\n isEdit: isEdit,\r\n data: value,\r\n }),\r\n );\r\n },\r\n [\r\n actions,\r\n connectedSettings,\r\n dispatch,\r\n globalSettings,\r\n isEdit,\r\n serviceTypes,\r\n ],\r\n );\r\n const editAllowed = useMemo(() => {\r\n return (\r\n !isEdit ||\r\n (isEdit &&\r\n (connectedSettings.isServiceAdmin === true ||\r\n authenticatedUser?.Id === connectedData?.User?.Id))\r\n );\r\n }, [\r\n authenticatedUser?.Id,\r\n connectedData?.User?.Id,\r\n connectedSettings.isServiceAdmin,\r\n isEdit,\r\n ]);\r\n const createUpdateAllowed = useMemo(() => {\r\n return (\r\n (isEdit && editAllowed) ||\r\n (!isEdit && (connectedSettings.isServiceAdmin || isRoleAdmin))\r\n );\r\n }, [connectedSettings.isServiceAdmin, editAllowed, isEdit, isRoleAdmin]);\r\n //FUNCTIONS\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n\r\n //ON FORM CHANGE\r\n const handleFormChange = useCallback(\r\n (values: IConnectedFiltersDto, isValid, dirty, setValue) => {\r\n if (userGroupChanged) {\r\n updateDataState(values);\r\n setUserGroupChanged(false);\r\n }\r\n if (userChanged) {\r\n updateDataState(values);\r\n setUserChanged(false);\r\n }\r\n if (startTimeChanged) {\r\n updateDataState(values);\r\n setStartTimeChanged(false);\r\n }\r\n if (endTimeChanged) {\r\n updateDataState(values);\r\n setEndTimeChanged(false);\r\n }\r\n if (budgetChanged) {\r\n updateDataState(values);\r\n\r\n setBudgetChanged(false);\r\n }\r\n if (budgetExpirementChanged) {\r\n updateDataState(values);\r\n setBudgetExpirementChanged(false);\r\n }\r\n },\r\n [\r\n budgetChanged,\r\n budgetExpirementChanged,\r\n endTimeChanged,\r\n startTimeChanged,\r\n updateDataState,\r\n userChanged,\r\n userGroupChanged,\r\n ],\r\n );\r\n\r\n //RENDER\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formIsValid) {\r\n formIsValid(formik.isValid);\r\n }\r\n return (\r\n <>\r\n
    \r\n \r\n \r\n updateDataState(\r\n Object.assign(\r\n {},\r\n formik.values,\r\n value,\r\n ) as IConnectedFiltersDto,\r\n )\r\n }\r\n resetFieldState={reserFieldHandler}\r\n />\r\n {!forceDisabled && (\r\n \r\n {\r\n console.debug('setUser', value);\r\n formik.setFieldValue('User', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n User: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n setBudget={value => {\r\n formik.setFieldValue('Budget', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n Budget: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n forceDisabled={forceDisabled}\r\n />\r\n {\r\n formik.setFieldValue('UserGroup', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n UserGroup: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n setBudget={value => {\r\n formik.setFieldValue('Budget', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n Budget: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n user={authenticatedUser}\r\n globalSettings={globalSettings}\r\n startTime={formik.values.StartTime}\r\n endTime={formik.values.EndTime}\r\n userGroup={formik.values.UserGroup}\r\n forceDisabled={forceDisabled}\r\n />\r\n {\r\n formik.setFieldValue('UserGroup', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n UserGroup: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n setBudgetExperiment={value => {\r\n formik.setFieldValue('BudgetExperiment', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n BudgetExperiment: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n }}\r\n setBudget={value => {\r\n formik.setFieldValue('Budget', value);\r\n updateDataState(\r\n Object.assign({}, formik.values, {\r\n Budget: value,\r\n }) as IConnectedFiltersDto,\r\n );\r\n if (isEdit) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n }\r\n }}\r\n budget={formik.values.Budget}\r\n userName={formik.values.User}\r\n services={serviceTypes}\r\n isEdit={isEdit}\r\n startTime={formik.values.StartTime}\r\n endTime={formik.values.EndTime}\r\n user={authenticatedUser}\r\n forceDisabled={forceDisabled}\r\n />\r\n \r\n )}\r\n\r\n {orderForConsumables ? (\r\n \r\n {connectedSettings.fundingTypeVisible && (\r\n \r\n {\r\n formik.setValues(\r\n produce(values => {\r\n // clear budget selection when funding type is changed to an incompatible value\r\n // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n if (\r\n (value as Entity).Id !==\r\n (values.Budget as IBudgetFilterDto)\r\n ?.FundingTypeId\r\n ) {\r\n values.Budget = null;\r\n }\r\n values.FundingType = value;\r\n }),\r\n );\r\n }}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.budgetVisible && (\r\n \r\n setBudgetChanged(true)}\r\n disabled={\r\n formik.isSubmitting ||\r\n connectedSettings.hideProject ||\r\n !editAllowed ||\r\n forceDisabled\r\n }\r\n info={budgetPickerInfo}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.budgetExpirementVisible &&\r\n formik.values.Budget !== null &&\r\n formik.values.Budget?.HideExperiments !== true && (\r\n \r\n setBudgetExpirementChanged(true)}\r\n disabled={\r\n isChildEntry ||\r\n formik.isSubmitting ||\r\n !editAllowed ||\r\n forceDisabled\r\n }\r\n username={\r\n formik.values.User?.Id ?? authenticatedUser?.Id\r\n }\r\n />\r\n \r\n )}\r\n {globalSettings.purchaseOrderBudgetEnabled &&\r\n ((formik.values.Budget as IBudgetFilterDto)\r\n ?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !==\r\n PurchaseOrderOptions.Hidden && (\r\n \r\n \r\n \r\n )}\r\n \r\n setStartTimeChanged(true)}\r\n disabled={\r\n isChildEntry ||\r\n formik.isSubmitting ||\r\n isEdit ||\r\n forceDisabled\r\n }\r\n />\r\n \r\n {connectedSettings.endTimeVisible && (\r\n \r\n setEndTimeChanged(true)}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.userGroupVisible ? (\r\n \r\n setUserGroupChanged(true)}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {formik.values.UserGroup !== undefined &&\r\n formik.values.UserGroup !== null\r\n ? formik.values.UserGroup.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n )}\r\n {connectedSettings.userVisible ? (\r\n \r\n setUserChanged(true)}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {formik.values.User !== null &&\r\n formik.values.User !== undefined\r\n ? formik.values.User.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n )}\r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n setStartTimeChanged(true)}\r\n disabled={\r\n formik.isSubmitting || isEdit || forceDisabled\r\n }\r\n />\r\n \r\n {connectedSettings.endTimeVisible && (\r\n \r\n setEndTimeChanged(true)}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.userGroupVisible ? (\r\n \r\n setUserGroupChanged(true)}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {formik.values.UserGroup !== undefined &&\r\n formik.values.UserGroup !== null\r\n ? formik.values.UserGroup.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n )}\r\n {connectedSettings.userVisible ? (\r\n \r\n setUserChanged(true)}\r\n fullWidth\r\n />\r\n \r\n ) : (\r\n \r\n \r\n {formik.values.User !== null &&\r\n formik.values.User !== undefined\r\n ? formik.values.User.Name\r\n : (t(translations.NA) as string)}\r\n \r\n }\r\n />\r\n \r\n )}\r\n {connectedSettings.fundingTypeVisible && (\r\n \r\n {\r\n formik.setValues(\r\n produce(values => {\r\n // clear budget selection when funding type is changed to an incompatible value\r\n // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n if (\r\n (value as Entity).Id !==\r\n (values.Budget as IBudgetFilterDto)\r\n ?.FundingTypeId\r\n ) {\r\n values.Budget = null;\r\n }\r\n values.FundingType = value;\r\n }),\r\n );\r\n }}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.budgetVisible && (\r\n \r\n setBudgetChanged(true)}\r\n disabled={\r\n isChildEntry ||\r\n formik.isSubmitting ||\r\n !editAllowed ||\r\n connectedSettings.hideProject ||\r\n forceDisabled\r\n }\r\n useSearchOrPredicate={\r\n globalSettings.hideNonDefaultBudgets\r\n }\r\n info={budgetPickerInfo}\r\n fullWidth\r\n />\r\n \r\n )}\r\n {connectedSettings.budgetExpirementVisible &&\r\n formik.values.Budget !== null &&\r\n formik.values.Budget?.HideExperiments !== true && (\r\n \r\n setBudgetExpirementChanged(true)}\r\n disabled={\r\n formik.isSubmitting ||\r\n !editAllowed ||\r\n forceDisabled\r\n }\r\n username={\r\n formik.values.User?.Id ?? authenticatedUser?.Id\r\n }\r\n />\r\n \r\n )}\r\n {globalSettings.purchaseOrderBudgetEnabled &&\r\n ((formik.values.Budget as IBudgetFilterDto)\r\n ?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !==\r\n PurchaseOrderOptions.Hidden && (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n","import { Portal } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Fragment, MutableRefObject, useCallback, useRef } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ConnectedFiltersForm } from '.';\r\nimport { ChildEntityProps } from '../../../../types/ChildEntityProps';\r\nimport { useConnectedFiltersSlice } from './slice';\r\n\r\nexport interface ConnectedFiltersControlProps extends ChildEntityProps {\r\n initialState?: IConnectedFiltersDto;\r\n saveConnectedFilters?: (values: IConnectedFiltersDto) => void;\r\n submitFormRef: MutableRefObject;\r\n isEdit: boolean;\r\n serviceTypeEnum?: ServiceType;\r\n serviceTypes: IServiceTypeFilterDto[];\r\n formIsValid?: (isValid: boolean) => void;\r\n globalSettings: GlobalSettingsType;\r\n startTimeLabel?: string;\r\n endTimeLabel?: string;\r\n startLabelInline?: boolean;\r\n endLabelInline?: boolean;\r\n orderForConsumables?: boolean;\r\n forceDisabled?: boolean;\r\n budgetPickerInfo?: string;\r\n}\r\n\r\nexport function ConnectedFiltersControl(\r\n props: ConnectedFiltersControlProps,\r\n): JSX.Element {\r\n //PROPS\r\n const {\r\n initialState,\r\n saveConnectedFilters,\r\n submitFormRef,\r\n isEdit,\r\n isChildEntry,\r\n serviceTypeEnum,\r\n serviceTypes,\r\n formIsValid,\r\n globalSettings,\r\n startTimeLabel,\r\n endTimeLabel,\r\n startLabelInline,\r\n endLabelInline,\r\n orderForConsumables,\r\n forceDisabled,\r\n budgetPickerInfo,\r\n } = props;\r\n //REDUX\r\n const dispatch = useDispatch();\r\n const { actions } = useConnectedFiltersSlice();\r\n\r\n //REFS\r\n const portalRef = useRef(null);\r\n //BIND\r\n const bindSubmitForm = useCallback(\r\n submitForm => {\r\n submitFormRef.current = submitForm;\r\n },\r\n [submitFormRef],\r\n );\r\n //ON SUBMIT\r\n const handleSubmit = useCallback(\r\n (values: IConnectedFiltersDto) => {\r\n if (saveConnectedFilters) {\r\n saveConnectedFilters(values);\r\n } else {\r\n var d = {\r\n StartTime:\r\n values.StartTime === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartTime),\r\n ),\r\n User: values.User,\r\n UserGroup: values.UserGroup,\r\n Budget: values.Budget,\r\n BudgetExperiment: values.BudgetExperiment,\r\n InstituteProject: values.InstituteProject,\r\n EndTime: values.EndTime,\r\n ExternalCustomer: values.ExternalCustomer,\r\n FundingType: values.FundingType,\r\n PurchaseOrder: values.PurchaseOrder,\r\n Reference: values.Reference,\r\n } as IConnectedFiltersDto;\r\n dispatch(actions.saveState(d));\r\n }\r\n },\r\n [actions, dispatch, saveConnectedFilters],\r\n );\r\n\r\n //RENDER\r\n return initialState ? (\r\n \r\n
    \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n );\r\n}\r\n","import { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { IResponseType, IResponseTypeWithId } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const RegionsApi = {\r\n getRegion: (payload: { id: number }) => {\r\n const url = '/api/odata/v4/Regions';\r\n const params: {\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $filter: '(Id eq ' + payload.id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n getRegions: () => {\r\n const url = '/api/odata/v4/Regions';\r\n const params: {\r\n $select: string;\r\n } = {\r\n $select: 'Id,Name',\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n insertRegion: (data: IRegionDto) => {\r\n const url = '/api/odata/v4/Regions';\r\n return httpClient.post(url, data);\r\n },\r\n updateRegion: (data: IRegionDto, rowId: number) => {\r\n const url = '/api/odata/v4/Regions';\r\n return httpClient.put(\r\n url + '(' + rowId + ')',\r\n data,\r\n );\r\n },\r\n deleteRegion: (Id: number) => {\r\n const url = `/api/odata/v4/Regions/${Id}`;\r\n return httpClient.deleteCustom(url);\r\n },\r\n deleteSelectedRows: (payload: number[]) => {\r\n const url = `/api/odata/v4/Regions/DeleteIds`;\r\n const data = { ids: payload };\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { regionsActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { RegionsApi as api } from 'api/RegionsApi';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RegionDetailsProps } from '..';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseTypeWithId } from 'types/ResponseType';\r\n\r\nfunction* doInitRegion(\r\n action: PayloadAction<{\r\n id: number;\r\n initial?: IRegionDto;\r\n }>,\r\n) {\r\n try {\r\n let data: IRegionDto | undefined = action.payload.initial;\r\n if (data === undefined) {\r\n const result = yield call(api.getRegion, { id: action.payload.id });\r\n console.debug('region result: ', result);\r\n data = result.value[0];\r\n }\r\n yield put(\r\n actions.initRegion_Success({\r\n hasErrors: data === undefined,\r\n data: data ?? { Id: 0, Name: '' },\r\n isEdit: action.payload.id > 0,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n yield put(actions.initRegion_Error(error));\r\n }\r\n}\r\nfunction* doCreateRegion(action: PayloadAction<{ model: IRegionDto }>) {\r\n try {\r\n const result = yield call(api.insertRegion, action.payload.model);\r\n let response = result as IResponseTypeWithId;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: 'regionInsertError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'regionInsertSuccess',\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.Region),\r\n detailsType: RenderPageType.RegionDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n id: '' + response.Id ?? -1,\r\n initialModel: {\r\n Id: response.Id ?? -1,\r\n Name: action.payload.model.Name,\r\n },\r\n } as RegionDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: 'regionInsertWarning',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n yield put(\r\n actions.createRegion_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'regionInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createRegion_Error(Error));\r\n }\r\n}\r\nfunction* doUpdateRegion(\r\n action: PayloadAction<{\r\n current: IRegionDto;\r\n original: IRegionDto;\r\n }>,\r\n) {\r\n try {\r\n const results = yield call(\r\n api.updateRegion,\r\n action.payload.current,\r\n action.payload.current.Id,\r\n );\r\n let response = results as IResponseTypeWithId;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'regionUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'regionUpdateSuccess',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.Region),\r\n detailsType: RenderPageType.RegionDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialModel: action.payload.current,\r\n } as RegionDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'regionUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateRegion_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'regionUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateRegion_Error(Error));\r\n }\r\n}\r\n\r\nexport function* regionsSaga() {\r\n yield takeLatest(actions.initRegion.type, doInitRegion);\r\n yield takeLatest(actions.createRegion.type, doCreateRegion);\r\n yield takeLatest(actions.updateRegion.type, doUpdateRegion);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { regionsSaga } from './saga';\r\nimport { RegionsState } from './types';\r\n\r\nexport const initialState: RegionsState = {\r\n detailsState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n },\r\n processing: false,\r\n isEdit: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'regions',\r\n initialState,\r\n reducers: {\r\n initRegion(\r\n state,\r\n action: PayloadAction<{\r\n id: number;\r\n initial?: IRegionDto;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initRegion_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n data: IRegionDto;\r\n isEdit: boolean;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.detailsState.data = action.payload.data;\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.isEdit = action.payload.isEdit;\r\n },\r\n initRegion_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n resetRegionState(state, action: PayloadAction) {\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.processing = false;\r\n },\r\n createRegion(\r\n state,\r\n action: PayloadAction<{\r\n model: IRegionDto;\r\n }>,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n createRegion_Success(state, action: PayloadAction<{ hasErrors: boolean }>) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n createRegion_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n updateRegion(\r\n state,\r\n action: PayloadAction<{\r\n current: IRegionDto;\r\n original: IRegionDto;\r\n }>,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n updateRegion_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n updateRegion_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: regionsActions } = slice;\r\n\r\nexport const useRegionsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: regionsSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useRegionsSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.regions || initialState;\r\n\r\nexport const selectRegions = createSelector([selectSlice], state => state);\r\n\r\nexport const selectRegionsProcessing = createSelector(\r\n [selectRegions],\r\n state => state.processing,\r\n);\r\n\r\nexport const selectDataProcessing = createSelector(\r\n [selectRegions],\r\n state => state.detailsState.processing,\r\n);\r\n\r\nexport const selectRegionsData = createSelector(\r\n [selectRegions],\r\n state => state.detailsState.data,\r\n);\r\nexport const selectRegionsHasErrors = createSelector(\r\n [selectRegions],\r\n state => state.detailsState.hasErrors,\r\n);\r\nexport const selectDetailsCompleted = createSelector(\r\n [selectRegions],\r\n state => state.detailsState.completed,\r\n);\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IRegionDto } from '../../IRegionDto';\r\nimport { useRegionsSlice } from './slice';\r\nimport {\r\n selectDetailsCompleted,\r\n selectRegionsData,\r\n selectRegionsHasErrors,\r\n selectRegionsProcessing,\r\n} from './slice/selectors';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface RegionDetailsProps extends CoverProps, SidePanelContentProps {\r\n id?: string;\r\n initialModel?: IRegionDto;\r\n onClose?: () => void;\r\n}\r\n\r\nexport const RegionDetails = React.memo(function RegionDetails(\r\n props: RegionDetailsProps,\r\n) {\r\n const { useSidePanel, id, initialModel, onClose } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useRegionsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n /// Selectors ///\r\n const processing = useSelector(selectRegionsProcessing);\r\n const regionData = useSelector(selectRegionsData);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const continueToOther = useSelector(selectContinueState);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const actionCompleted = useSelector(selectDetailsCompleted);\r\n const hasError = useSelector(selectRegionsHasErrors);\r\n /// Refs ///\r\n const submitFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(null);\r\n //cover\r\n const [cover, setCover] = React.useState();\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [busy, setBusy] = React.useState(false);\r\n const [edit, setEdit] = React.useState(false);\r\n\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initRegion({\r\n id: tryParseInt(id) ?? -1,\r\n initial: initialModel,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actions, dispatch, firstLoad, initialModel, id]);\r\n /// functions, callbacks ///\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n const handleClose = () => {\r\n handleCloselClick();\r\n };\r\n const handleCloselClick = React.useCallback(() => {\r\n if (!!onClose) {\r\n onClose();\r\n } else {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/Regions'));\r\n }\r\n }\r\n dispatch(actions.resetRegionState());\r\n }, [actions, dispatch, layoutActions, onClose, useSidePanel]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: IRegionDto) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateRegion({\r\n current: values,\r\n original: regionData || values,\r\n }),\r\n );\r\n } else {\r\n dispatch(actions.createRegion({ model: values }));\r\n }\r\n },\r\n [actions, dispatch, edit, regionData],\r\n );\r\n /// Use Effects ///\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (id !== undefined && !isNaN(parseInt(id))) {\r\n setEdit(true);\r\n } else {\r\n setEdit(false);\r\n }\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actionCompleted, handleCloselClick, hasError, processing, id]);\r\n React.useEffect(() => {\r\n if (confirmApproved) {\r\n dispatch(actions.resetRegionState());\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n //dispatch(actions.setChangedState(false));\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n const regionSchema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().notRequired().default(-1),\r\n Name: Yup.string().required(t(translations.RegionNameIsRequired)),\r\n });\r\n const leftActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n return actions;\r\n }, [busy, handleSaveClick, requestCompleted, t]);\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCloselClick, t]);\r\n return (\r\n \r\n {\r\n // call setSubmit to finish submit cycle\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'regions/details', { id: id })}\r\n toPageLink={`regions/details?${toQueryString({ id: id })}`}\r\n rightActions={rightActions}\r\n isCover={props.isCover}\r\n cover={cover}\r\n closeCover={props.closeCover || closeCover}\r\n />\r\n \r\n );\r\n});\r\n","import { Dialog } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface PopupPrintToPDFDialogProps {\r\n open: boolean;\r\n content: React.ReactNode;\r\n fullWidth: boolean;\r\n padding: string;\r\n}\r\nexport function PopupPrintToPDFDialog(props: PopupPrintToPDFDialogProps) {\r\n return (\r\n \r\n \r\n {props.content}\r\n \r\n \r\n );\r\n}\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n titleContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n },\r\n closeButton: {\r\n position: 'absolute',\r\n right: theme.spacing(1),\r\n top: theme.spacing(1),\r\n color: theme.palette.grey[500],\r\n },\r\n container: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n boxcontainer: {\r\n display: 'flex',\r\n width: '100%',\r\n height: '100%',\r\n },\r\n selectFileBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n },\r\n infoBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n padding: '10PX',\r\n backgroundColor: '#f0f9ff',\r\n },\r\n }),\r\n);\r\n","import React from 'react';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Check, CheckProps } from 'app/components/BasicInputs/Check';\r\n\r\nexport interface CheckBoxProps\r\n extends Pick {\r\n checked: (name: string | undefined) => boolean;\r\n onChange: (event: React.ChangeEvent) => void;\r\n}\r\n\r\nexport function CheckBox({ checked, ...props }: CheckBoxProps) {\r\n return (\r\n \r\n \r\n {props.label}\r\n \r\n );\r\n}\r\n","/* eslint-disable prettier/prettier */\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport React, { useCallback, useMemo } from 'react';\r\nimport { useStyles } from './styles';\r\nimport { CheckBox } from './CheckBox';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { usePrintPDFSlice } from '../slice';\r\nimport { PrintPDFItem } from '../slice/types';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { LinearProgress } from '@material-ui/core';\r\nimport { selectPrintPDFSections } from '../slice/selectors';\r\n\r\nconst convertItemsToFlags = (items: PrintPDFItem[]) => {\r\n const res = {};\r\n for (const item of items) {\r\n res[item.id] = item.checked;\r\n }\r\n return res;\r\n};\r\n\r\nexport interface PopupPrintToPDFComponentProps {\r\n title: string;\r\n items: PrintPDFItem[];\r\n processing?: boolean;\r\n preparing?: boolean;\r\n disabled?: boolean;\r\n onSubmit: () => void;\r\n close: () => void;\r\n}\r\n\r\nexport function PopupPrintToPDFComponent(props: PopupPrintToPDFComponentProps) {\r\n const {items, close, title, processing, disabled, onSubmit, preparing} = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = usePrintPDFSlice();\r\n const classes = useStyles();\r\n const sections = useSelector(selectPrintPDFSections);\r\n const [checkboxes, setCheckboxes] = React.useState(\r\n convertItemsToFlags(items),\r\n );\r\n const handleCheckboxChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n const id = items.find(\r\n f => f.id === event.target.value,\r\n )?.id ?? items[0].id;\r\n\r\n if (id !== undefined) {\r\n dispatch(\r\n actions.updateSection({ id: id, checked: event.target.checked }),\r\n );\r\n setCheckboxes({\r\n ...checkboxes,\r\n [id]: event.target.checked,\r\n });\r\n }\r\n },\r\n [actions, checkboxes, dispatch, items],\r\n );\r\n const handleCheckboxChecked = useCallback(\r\n name => {\r\n return name !== undefined && checkboxes[name];\r\n },\r\n [checkboxes],\r\n );\r\n const content = useMemo(() => {\r\n if (!!sections && sections.length > 0) {\r\n const res = sections.filter(f=> !f.static).map(item => {\r\n return (\r\n \r\n );\r\n });\r\n return res;\r\n } else {\r\n return <>;\r\n }\r\n }, [handleCheckboxChange, handleCheckboxChecked, sections]);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {title}

    \r\n
    \r\n {preparing !== undefined && preparing && (\r\n \r\n \r\n \r\n )}\r\n {content}\r\n
    \r\n \r\n \r\n onSubmit()}\r\n >\r\n {'Print'}\r\n \r\n \r\n {t(translations.Cancel)}\r\n \r\n \r\n \r\n
    \r\n \r\n );\r\n}\r\n","import { PrintPDFItem } from '../slice/types';\r\nimport { PopupPrintToPDFDialog } from './Dialog';\r\nimport { PopupPrintToPDFComponent } from './PopupPrintToPDFComponent';\r\n\r\nexport interface PrintToPDFPopupProps {\r\n title: string;\r\n show: boolean;\r\n processing?: boolean;\r\n preparing?: boolean;\r\n disabled?: boolean;\r\n items: PrintPDFItem[];\r\n fullWidth?: boolean;\r\n onClose: () => void;\r\n onSubmit: () => void;\r\n}\r\nexport function PrintToPDFPopup({\r\n title,\r\n show,\r\n items,\r\n processing,\r\n preparing,\r\n disabled,\r\n fullWidth,\r\n onClose,\r\n onSubmit,\r\n}: PrintToPDFPopupProps) {\r\n return (\r\n <>\r\n \r\n }\r\n />\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\n\r\nimport {\r\n ServiceRequestMilestoneStatusesUnionArray,\r\n ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport {\r\n EnumPicker,\r\n EnumPickerProps,\r\n withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport type ServiceRequestMilestoneStatusPickerProps = Omit<\r\n EnumPickerProps,\r\n 'EnumNamesArray'\r\n>;\r\nexport const ServiceRequestMilestoneStatusPicker = withEnumOptions<\r\n ServiceRequestMilestoneStatusesUnion\r\n>(ServiceRequestMilestoneStatusesUnionArray)(EnumPicker);\r\n","/**\r\n *\r\n * FormServiceRequestMilestoneStatusPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n ServiceRequestMilestoneStatusPicker,\r\n ServiceRequestMilestoneStatusPickerProps,\r\n} from '../pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusPicker';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\n\r\nexport const FormServiceRequestMilestoneStatusPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig &\r\n Omit &\r\n Pick) => {\r\n const [\r\n field,\r\n meta,\r\n helpers,\r\n ] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","import { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { IServiceRequestMilestoneForm } from '../../RequestSamplesPage/slice/types';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { ServiceRequestMilestoneStatusesUnionArray } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { FormServiceRequestMilestoneStatusPicker } from 'app/components/Forms/FormServiceRequestMilestoneStatusPicker';\r\nimport { selectServiceRequestMilestoneProcessing } from '../../RequestSamplesPage/slice/selectors';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface ServiceRequestMilestoneDetailsProps {\r\n serviceRequestId: number;\r\n type: 'Insert' | 'Update';\r\n value?: IServiceRequestMilestoneDto;\r\n}\r\n\r\nexport function ServiceRequestMilestoneDetails(\r\n props: ServiceRequestMilestoneDetailsProps,\r\n) {\r\n const { t } = useTranslation();\r\n const submitRef = React.useRef<(() => Promise) | undefined>();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const processing = useSelector(selectServiceRequestMilestoneProcessing);\r\n\r\n const formType =\r\n props.value?.Id !== undefined && props.value.Id > 0 ? 'Update' : 'Insert';\r\n const insert = React.useCallback(\r\n (value: IServiceRequestMilestoneForm) => {\r\n dispatch(\r\n actions.insertMilestone({\r\n ...toDto(value),\r\n ...{ ServiceRequestId: props.serviceRequestId },\r\n }),\r\n );\r\n },\r\n\r\n [actions, dispatch, props.serviceRequestId],\r\n );\r\n const updateCharge = React.useCallback(\r\n (value: IServiceRequestMilestoneForm) => {\r\n dispatch(\r\n actions.updateMilestone({\r\n ...toDto(value),\r\n ...{ ServiceRequestId: props.serviceRequestId },\r\n }),\r\n );\r\n },\r\n\r\n [actions, dispatch, props.serviceRequestId],\r\n );\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: IServiceRequestMilestoneForm) => {\r\n switch (formType) {\r\n case 'Insert':\r\n insert(values);\r\n break;\r\n case 'Update':\r\n updateCharge(values);\r\n break;\r\n }\r\n },\r\n [formType, insert, updateCharge],\r\n );\r\n const handleSubmitButtonClick = () => {\r\n submitRef.current?.();\r\n };\r\n const initialValues = toInitialValues(props.value);\r\n const title =\r\n props.type === 'Insert'\r\n ? t(translations.AddMilestone)\r\n : t(translations.Milestone);\r\n const handleClose = () => dispatch(actions.closeSidePanel());\r\n return (\r\n (\r\n }\r\n processing={processing}\r\n >\r\n {t(translations.Submit)}\r\n \r\n ),\r\n ]}\r\n rightActions={[\r\n () => (\r\n dispatch(actions.closeSidePanel())}\r\n size=\"small\"\r\n startIcon={}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n ),\r\n ]}\r\n >\r\n \r\n {formik => {\r\n submitRef.current = formik.submitForm;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {\r\n const currentStatus = formik.values.Status;\r\n const newStatus:\r\n | ServiceRequestMilestoneStatusesUnion\r\n | undefined =\r\n value !== null\r\n ? 'Completed'\r\n : currentStatus === 'Completed'\r\n ? 'NotStarted'\r\n : currentStatus;\r\n formik.setFieldValue('Status', newStatus);\r\n }}\r\n fullWidth\r\n />\r\n \r\n \r\n {\r\n switch (value) {\r\n case 'Completed':\r\n if (\r\n formik.values.CompletionDate === null ||\r\n formik.values.CompletionDate === undefined\r\n ) {\r\n formik.setFieldValue('CompletionDate', new Date());\r\n }\r\n break;\r\n case 'NotStarted':\r\n case 'Started':\r\n formik.setFieldValue('CompletionDate', null);\r\n break;\r\n }\r\n }}\r\n fullWidth\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n\r\nconst serviceRequestMilestoneSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Assignees: Yup.mixed().optional(),\r\n CompletionDate: Yup.date().optional().nullable(),\r\n Id: Yup.number().optional(),\r\n Name: Yup.string().required(),\r\n Status: Yup.string()\r\n .oneOf(ServiceRequestMilestoneStatusesUnionArray)\r\n .optional() as Yup.SchemaOf,\r\n TargetDate: Yup.date().optional().nullable(),\r\n Description: Yup.string().optional(),\r\n },\r\n);\r\n\r\nconst toDto = (\r\n value: IServiceRequestMilestoneForm,\r\n): Partial &\r\n Pick => {\r\n return {\r\n Id: value.Id,\r\n Charged: false,\r\n CompletionDate:\r\n value.CompletionDate === null\r\n ? undefined\r\n : value.CompletionDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(value.CompletionDate),\r\n Description: value.Description,\r\n Name: value.Name ?? null,\r\n Status: value.Status,\r\n TargetDate:\r\n value.TargetDate === null\r\n ? null\r\n : value.TargetDate === undefined\r\n ? null\r\n : dateUtils.formatISO(value.TargetDate),\r\n Assignees: value.Assignees,\r\n };\r\n};\r\nconst toInitialValues = (\r\n value?: IServiceRequestMilestoneDto,\r\n): IServiceRequestMilestoneForm => {\r\n if (value === undefined) {\r\n return {\r\n TargetDate: null,\r\n CompletionDate: null,\r\n };\r\n }\r\n\r\n const result: IServiceRequestMilestoneForm = {\r\n Id: value.Id,\r\n Assignees: value.Assignees,\r\n CompletionDate:\r\n value.CompletionDate === null\r\n ? null\r\n : dateUtils.parseISO(value.CompletionDate),\r\n Description: value.Description ?? undefined,\r\n Name: value.Name ?? undefined,\r\n Status: value.Status ?? undefined,\r\n TargetDate:\r\n value.TargetDate === null\r\n ? null\r\n : dateUtils.parseISO(value.TargetDate) ?? undefined,\r\n };\r\n return result;\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n UnitType,\r\n UnitTypePicker,\r\n UnitTypePickerProps,\r\n} from '../pickers/AutocompletePickers/UnitTypePicker';\r\n\r\nexport const FormUnitTypeTypePicker = (\r\n props: FieldHookConfig &\r\n Omit,\r\n) => {\r\n const [field, meta, helpers] = useField(props);\r\n const handleChange = val => {\r\n props.onChange?.(val);\r\n helpers.setValue(val, true);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from '../BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport const FormServiceRequestMilestoneChargeServicePicker = ({\r\n serviceRequestId,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n Omit>, 'onChange' | 'url'> & {\r\n serviceRequestId: number;\r\n }) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n const handleChange = val => {\r\n props.onChange?.(val);\r\n helpers.setValue(val, true);\r\n };\r\n const url = `/api/odata/v4/ServiceRequests/${serviceRequestId}/ConsumableServices`;\r\n return (\r\n \r\n );\r\n};\r\n","import { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { IServiceRequestMilestoneChargeForm } from '../../RequestSamplesPage/slice/types';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormUnitTypeTypePicker } from 'app/components/Forms/FormUnitTypePicker';\r\nimport { selectServiceRequestMilestoneProcessing } from '../../RequestSamplesPage/slice/selectors';\r\nimport { FormServiceRequestMilestoneChargeServicePicker } from 'app/components/Forms/FormServiceRequestMilestoneChargeServicePicker';\r\nimport { BaseToggleButtonGroup } from 'app/components/BasicButtons/BaseToggleButtonGroup';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nimport {\r\n getUnitTypesData,\r\n UnitType,\r\n} from 'app/components/pickers/AutocompletePickers/UnitTypePicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nexport type ServiceRequestMilestoneChargeType = 'service' | 'charge';\r\nexport interface ServiceRequestMilestoneChargeDetailsProps {\r\n serviceRequestMilestoneId: number;\r\n serviceRequestId: number;\r\n type: ServiceRequestMilestoneChargeType;\r\n enableAddonCharge: boolean;\r\n enableManualCharge: boolean;\r\n value?: IServiceRequestMilestoneChargeDto;\r\n unitType?: Entity;\r\n}\r\nexport function ServiceRequestMilestoneChargeDetails(\r\n props: ServiceRequestMilestoneChargeDetailsProps,\r\n) {\r\n const { t } = useTranslation();\r\n const innerFormRef = React.useRef | null>(null);\r\n const submitRef = React.useRef<(() => Promise) | undefined>();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const processing = useSelector(selectServiceRequestMilestoneProcessing);\r\n const [selectedType, setSelectedType] = React.useState(props.type);\r\n const formType =\r\n props.value?.Id !== undefined && props.value.Id > 0 ? 'Update' : 'Insert';\r\n const title =\r\n formType === 'Insert'\r\n ? selectedType === 'charge'\r\n ? t(translations.AddCharge)\r\n : t(translations.AddService)\r\n : selectedType === 'charge'\r\n ? t(translations.Charge)\r\n : t(translations.Service);\r\n\r\n const insertCharge = React.useCallback(\r\n (value: IServiceRequestMilestoneChargeForm) => {\r\n if (value.Type === 'service' && value.Service === undefined) {\r\n return;\r\n }\r\n\r\n switch (value.Type) {\r\n case 'service':\r\n dispatch(\r\n actions.insertMilestoneCharge({\r\n OfflineServiceType: value.Service, // value.Service?.Id,\r\n Quantity: value.Quantity,\r\n Remarks: value.Remarks,\r\n ServiceRequestId: props.serviceRequestId,\r\n ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n Date:\r\n value.Date === null\r\n ? undefined\r\n : value.Date === undefined\r\n ? undefined\r\n : dateUtils.formatISO(value.Date),\r\n }),\r\n );\r\n break;\r\n case 'charge':\r\n dispatch(\r\n actions.insertMilestoneCharge({\r\n Quantity: value.Quantity,\r\n Rate: value.Rate,\r\n Remarks: value.Remarks,\r\n ServiceRequestId: props.serviceRequestId,\r\n ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n Date:\r\n value.Date === null\r\n ? undefined\r\n : value.Date === undefined\r\n ? undefined\r\n : dateUtils.formatISO(value.Date),\r\n // Id: props.value?.Id,\r\n Name: value.Name,\r\n Unit: value.Unit,\r\n }),\r\n );\r\n break;\r\n }\r\n },\r\n\r\n [\r\n actions,\r\n dispatch,\r\n props.serviceRequestId,\r\n props.serviceRequestMilestoneId,\r\n ],\r\n );\r\n const updateCharge = React.useCallback(\r\n (value: IServiceRequestMilestoneChargeForm) => {\r\n if (props.value?.Id === undefined) {\r\n return;\r\n }\r\n switch (value.Type) {\r\n case 'service':\r\n dispatch(\r\n actions.updateMilestoneCharge({\r\n Id: props.value?.Id,\r\n OfflineServiceType: value.Service, // value.Service?.Id,\r\n Quantity: value.Quantity,\r\n Remarks: value.Remarks,\r\n ServiceRequestId: props.serviceRequestId,\r\n ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n Date:\r\n value.Date === null\r\n ? undefined\r\n : value.Date === undefined\r\n ? undefined\r\n : dateUtils.formatISO(value.Date),\r\n }),\r\n );\r\n break;\r\n case 'charge':\r\n dispatch(\r\n actions.updateMilestoneCharge({\r\n Id: props.value?.Id,\r\n Quantity: value.Quantity,\r\n Rate: value.Rate,\r\n Remarks: value.Remarks,\r\n ServiceRequestId: props.serviceRequestId,\r\n ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n Date:\r\n value.Date === null\r\n ? undefined\r\n : value.Date === undefined\r\n ? undefined\r\n : dateUtils.formatISO(value.Date),\r\n // Id: props.value?.Id,\r\n Name: value.Name,\r\n Unit: value.Unit,\r\n }),\r\n );\r\n break;\r\n }\r\n },\r\n\r\n [\r\n actions,\r\n dispatch,\r\n props.serviceRequestId,\r\n props.serviceRequestMilestoneId,\r\n props.value?.Id,\r\n ],\r\n );\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: IServiceRequestMilestoneChargeForm) => {\r\n switch (formType) {\r\n case 'Insert':\r\n insertCharge(values);\r\n break;\r\n case 'Update':\r\n updateCharge(values);\r\n break;\r\n }\r\n },\r\n [formType, insertCharge, updateCharge],\r\n );\r\n\r\n const initialValues = toInitialValues(props.type, props.value);\r\n\r\n //USE EFFECT ON MOUNT\r\n useEffectOnMount(() => {\r\n let mounted = true;\r\n (async () => {\r\n try {\r\n //According to https://prog4biz.atlassian.net/browse/BKT-10663\r\n if (!!props.unitType) {\r\n if (mounted) {\r\n innerFormRef.current?.setFieldValue(\r\n 'Unit',\r\n props.unitType as UnitType,\r\n );\r\n }\r\n } else {\r\n const initUnitTypeValue: UnitType = await getUnitTypesData().then(\r\n resp => resp.filter(u => u.Name === 'Unit')[0] ?? null,\r\n );\r\n if (mounted) {\r\n innerFormRef.current?.setFieldValue('Unit', initUnitTypeValue);\r\n }\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n })();\r\n return () => {\r\n mounted = false;\r\n };\r\n });\r\n\r\n return (\r\n (\r\n {\r\n submitRef.current?.();\r\n }}\r\n size=\"small\"\r\n processing={processing}\r\n startIcon={}\r\n >\r\n {t(translations.Submit)}\r\n \r\n ),\r\n ]}\r\n closeSidePanel={() => dispatch(actions.closeSidePanel)}\r\n rightActions={[\r\n () => (\r\n dispatch(actions.closeSidePanel())}\r\n size=\"small\"\r\n startIcon={}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n ),\r\n ]}\r\n >\r\n \r\n {formik => {\r\n submitRef.current = formik.submitForm;\r\n if (!formik.isValid) {\r\n console.debug('form errors', formik.errors);\r\n }\r\n\r\n return (\r\n \r\n \r\n {formType === 'Insert' &&\r\n props.enableAddonCharge &&\r\n props.enableManualCharge && (\r\n \r\n {\r\n formik.setFieldValue('Type', value);\r\n setSelectedType(value);\r\n }}\r\n />\r\n \r\n )}\r\n {formik.values.Type === 'charge' && (\r\n \r\n \r\n \r\n )}\r\n {formik.values.Type === 'charge' && (\r\n \r\n \r\n \r\n )}\r\n \r\n {\r\n formik.setFieldValue('Date', value);\r\n }}\r\n />\r\n \r\n {/* todo: filter out the consumable services */}\r\n {formik.values.Type === 'service' && (\r\n \r\n \r\n \r\n )}\r\n {formik.values.Type === 'charge' && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n\r\nconst addServiceSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().optional(),\r\n Date: Yup.date().optional().nullable(),\r\n Unit: Yup.mixed().when('Type', {\r\n is: 'charge',\r\n then: Yup.mixed().required(),\r\n }),\r\n Service: Yup.mixed().when('Type', {\r\n is: 'service',\r\n then: Yup.mixed().required(),\r\n }),\r\n Name: Yup.string().when('Type', {\r\n is: 'charge',\r\n then: Yup.string().required(),\r\n }),\r\n Rate: Yup.number().when('Type', {\r\n is: 'charge',\r\n then: Yup.number().required(),\r\n }),\r\n Quantity: Yup.number().positive().required(),\r\n Type: Yup.string().oneOf(['charge', 'service']).required() as Yup.SchemaOf<\r\n ServiceRequestMilestoneChargeType\r\n >,\r\n Remarks: Yup.mixed().optional(),\r\n },\r\n);\r\n\r\ninterface ChargeTypeToggleProps {\r\n value: ServiceRequestMilestoneChargeType;\r\n onChange?: (value: ServiceRequestMilestoneChargeType) => void;\r\n}\r\nfunction ChargeTypeToggle(props: ChargeTypeToggleProps) {\r\n const { t } = useTranslation();\r\n const options = React.useMemo[]>(\r\n () => [\r\n {\r\n Id: 'service',\r\n Name: t(translations.Service),\r\n },\r\n {\r\n Id: 'charge',\r\n Name: t(translations.Charge),\r\n },\r\n ],\r\n [t],\r\n );\r\n const handleChange = (\r\n value: Entity | null,\r\n ) => {\r\n if (value !== null) {\r\n props.onChange?.(value.Id);\r\n }\r\n };\r\n const entityValue = options.find(f => f.Id === props.value);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nconst toInitialValues = (\r\n type: ServiceRequestMilestoneChargeType,\r\n value?: IServiceRequestMilestoneChargeDto,\r\n) => {\r\n const result: IServiceRequestMilestoneChargeForm =\r\n value === undefined\r\n ? {\r\n Date: null,\r\n }\r\n : {\r\n Id: value.Id,\r\n Service: value.Service ?? undefined,\r\n Quantity: value.Quantity ?? undefined,\r\n Remarks: value.Remarks ?? undefined,\r\n Date: value.Date === null ? null : dateUtils.parseISO(value.Date),\r\n Name: value.Name ?? undefined,\r\n Rate: value.Rate ?? undefined,\r\n Type: type,\r\n Unit: value.UnitType ?? undefined,\r\n };\r\n\r\n result.Type = type;\r\n return result;\r\n};\r\n","import { isEqual } from 'lodash';\r\nimport { Descendant } from 'slate';\r\nimport { jsx } from 'slate-hyperscript';\r\nimport { ParagraphElement } from 'types/Slate';\r\nimport { removeHtml } from 'utils/string-utils';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nconst ELEMENT_TAGS = {\r\n A: el => ({ type: 'link', url: el.getAttribute('href') }),\r\n BLOCKQUOTE: () => ({ type: 'quote' }),\r\n H1: () => ({ type: 'heading-one' }),\r\n H2: () => ({ type: 'heading-two' }),\r\n H3: () => ({ type: 'heading-three' }),\r\n H4: () => ({ type: 'heading-four' }),\r\n H5: () => ({ type: 'heading-five' }),\r\n H6: () => ({ type: 'heading-six' }),\r\n IMG: el => ({ type: 'image', url: el.getAttribute('src') }),\r\n LI: () => ({ type: 'list-item' }),\r\n OL: () => ({ type: 'numbered-list' }),\r\n P: () => ({ type: 'paragraph' }),\r\n PRE: () => ({ type: 'code' }),\r\n UL: () => ({ type: 'bulleted-list' }),\r\n MENTION: el => ({\r\n type: 'mention',\r\n user: {\r\n Id: el.getAttribute('id'),\r\n Name: el.getAttribute('name').split('|').join(' '),\r\n },\r\n }),\r\n TABLE: () => ({ type: 'table' }),\r\n TBODY: () => ({ type: 'tbody' }),\r\n THEAD: () => ({ type: 'thead' }),\r\n TR: () => ({ type: 'table-row' }),\r\n TD: () => ({ type: 'table-cell' }),\r\n TH: () => ({ type: 'table-cell-header' }),\r\n};\r\n\r\n// COMPAT: `B` is omitted here because Google Docs uses `` in weird ways.\r\nconst TEXT_TAGS = {\r\n CODE: () => ({ code: true }),\r\n DEL: () => ({ strikethrough: true }),\r\n EM: () => ({ italic: true }),\r\n I: () => ({ italic: true }),\r\n S: () => ({ strikethrough: true }),\r\n STRONG: () => ({ bold: true }),\r\n U: () => ({ underline: true }),\r\n DATA: () => ({ plain: true }),\r\n};\r\n\r\nexport const deserialize = el => {\r\n if (el.nodeType === 3) {\r\n return el.textContent;\r\n } else if (el.nodeType !== 1) {\r\n return null;\r\n } else if (el.nodeName === 'BR') {\r\n return '\\n';\r\n }\r\n\r\n const { nodeName } = el;\r\n let parent = el;\r\n\r\n if (\r\n nodeName === 'PRE' &&\r\n el.childNodes[0] &&\r\n el.childNodes[0].nodeName === 'CODE'\r\n ) {\r\n parent = el.childNodes[0];\r\n }\r\n let children = Array.from(parent.childNodes).map(deserialize).flat();\r\n\r\n if (children.length === 0) {\r\n children = [{ text: '' }];\r\n }\r\n\r\n if (el.nodeName === 'BODY') {\r\n return jsx('fragment', {}, children);\r\n }\r\n\r\n if (ELEMENT_TAGS[nodeName]) {\r\n const attrs = ELEMENT_TAGS[nodeName](el);\r\n return jsx('element', attrs, children);\r\n }\r\n\r\n if (ELEMENT_TAGS[el.className]) {\r\n const attrs = ELEMENT_TAGS[el.className](el);\r\n return jsx('element', attrs, children);\r\n }\r\n\r\n if (TEXT_TAGS[nodeName]) {\r\n try {\r\n const attrs = TEXT_TAGS[nodeName](el);\r\n return children.map(child => jsx('text', attrs, child));\r\n } catch (error) {\r\n //console.log(error); //If have element, error: The hyperscript tag can only contain text content as children.\r\n return children;\r\n }\r\n }\r\n\r\n return children;\r\n};\r\n\r\nconst deserializeHtml = node => {\r\n if (node) {\r\n return deserialize(node);\r\n } else return [];\r\n};\r\n\r\nexport const deserializeHtmlString = (\r\n htmlString: string | undefined | null,\r\n) => {\r\n let currentSring = htmlString || '';\r\n if (isEmptyOrWhitespace(currentSring)) {\r\n currentSring = '

    ';\r\n } else {\r\n if (currentSring.indexOf('<') === -1) {\r\n currentSring = '

    ' + currentSring + '

    ';\r\n }\r\n }\r\n const parsed = new DOMParser().parseFromString(currentSring, 'text/html');\r\n return deserializeHtml(parsed.body);\r\n};\r\n\r\nconst elementHtmlString = props => {\r\n const { attributes, children, element } = props;\r\n\r\n switch (element.type) {\r\n default:\r\n return '

    ' + children + '

    ';\r\n case 'quote':\r\n return '' + children + '';\r\n case 'code':\r\n return (\r\n '
    ' +\r\n        '' +\r\n        children +\r\n        ' ' +\r\n        '
    '\r\n );\r\n case 'bulleted-list':\r\n return '
      ' + children + '
    ';\r\n case 'heading-one':\r\n return '

    ' + children + '

    ';\r\n case 'heading-two':\r\n return '

    ' + children + '

    ';\r\n case 'heading-three':\r\n return '

    ' + children + '

    ';\r\n case 'heading-four':\r\n return '

    ' + children + '

    ';\r\n case 'heading-five':\r\n return '
    ' + children + '
    ';\r\n case 'heading-six':\r\n return '
    ' + children + '
    ';\r\n case 'list-item':\r\n return '
  • ' + children + '
  • ';\r\n case 'numbered-list':\r\n return '
      ' + children + '
    ';\r\n case 'link':\r\n return (\r\n '' + children + ''\r\n );\r\n case 'mention':\r\n return (\r\n '' +\r\n children +\r\n ''\r\n );\r\n case 'thead':\r\n return '' + children + '';\r\n case 'tbody':\r\n return '' + children + '';\r\n case 'table':\r\n return (\r\n '' +\r\n children +\r\n '
    '\r\n );\r\n case 'table-row':\r\n return (\r\n '' +\r\n children +\r\n ''\r\n );\r\n case 'table-cell':\r\n return (\r\n '' +\r\n children +\r\n ''\r\n );\r\n case 'table-cell-header':\r\n return '' + children + '';\r\n case 'image':\r\n return '';\r\n //case 'image':\r\n //return ;\r\n }\r\n};\r\n\r\nconst leafHtmlString = ({ attributes, children, leaf }) => {\r\n if (children === '\\n') {\r\n return '
    ';\r\n }\r\n\r\n if (leaf.bold) {\r\n children = '' + children + '';\r\n }\r\n\r\n if (leaf.code) {\r\n children = '' + children + '';\r\n }\r\n\r\n if (leaf.italic) {\r\n children = '' + children + '';\r\n }\r\n\r\n if (leaf.underline) {\r\n children = '' + children + '';\r\n }\r\n\r\n if (leaf.strikethrough) {\r\n children = '' + children + '';\r\n }\r\n if (leaf.plain) {\r\n children = '' + children + '';\r\n }\r\n if (attributes !== '') {\r\n return '' + children + '';\r\n } else {\r\n if (children) return children;\r\n else return '';\r\n }\r\n};\r\n\r\nfunction serializeItemHtmlString(item) {\r\n let children = [];\r\n if (item.children !== undefined) {\r\n children = item.children.map(item => {\r\n if (item.type) {\r\n return serializeItemHtmlString(item);\r\n } else {\r\n return leafHtmlString({\r\n attributes: '',\r\n children: item.text,\r\n leaf: item,\r\n });\r\n }\r\n });\r\n }\r\n return elementHtmlString({\r\n attributes: '',\r\n children: children.join(''),\r\n element: item,\r\n });\r\n}\r\n\r\n/**\r\n * This one serves as an empty placeholder since Slate does not accept undefined. When an empty array is passed it throws one of the following errors:\r\n * * Cannot get the start point in the node at path [] because it has no start text node.\r\n * * Cannot resolve a Slate point from DOM point: [object HTMLDivElement],0\r\n */\r\nconst EMPTY_SLATE_NODE: ParagraphElement[] = [\r\n {\r\n type: 'paragraph',\r\n children: [{ text: '', type: 'text' }],\r\n },\r\n];\r\n\r\nexport function serializeHtmlString(\r\n data: Descendant[] | undefined,\r\n): string | undefined {\r\n const emptyValue = undefined;\r\n // data won't be undefined since Slate does not work with it, but nevertheless\r\n if (data === undefined || data === null) {\r\n return emptyValue;\r\n }\r\n // empty array -> empty value\r\n if (data.length === 0) {\r\n return emptyValue;\r\n }\r\n // default empty slate value -> empty value\r\n if (isEqual(data, EMPTY_SLATE_NODE)) {\r\n return emptyValue;\r\n }\r\n const elements = data.map(item => {\r\n return serializeItemHtmlString(item);\r\n });\r\n const result = elements.join('');\r\n // double check that serialized html does have something typed in and is not just a bunch of html entities\r\n if (isEmptyOrWhitespace(removeHtml(result))) {\r\n return emptyValue;\r\n } else {\r\n return result;\r\n }\r\n}\r\n","import Box from '@material-ui/core/Box';\r\nimport ToggleButton from '@material-ui/lab/ToggleButton';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport isHotkey from 'is-hotkey';\r\nimport React, {\r\n ReactNode,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react';\r\nimport {\r\n createEditor,\r\n Descendant,\r\n Editor,\r\n Range,\r\n Transforms,\r\n Point,\r\n Element as SlateElement,\r\n} from 'slate';\r\nimport { withHistory } from 'slate-history';\r\nimport {\r\n Editable,\r\n ReactEditor,\r\n Slate,\r\n useFocused,\r\n useSelected,\r\n useSlate,\r\n withReact,\r\n} from 'slate-react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport {\r\n deserialize,\r\n deserializeHtmlString,\r\n serializeHtmlString,\r\n} from './RichEditorSerializer';\r\nimport { useStyles } from './styles';\r\nimport { CustomEditor, MentionElement } from 'types/Slate';\r\nimport ReactDOM from 'react-dom';\r\nimport {\r\n relevantUrl,\r\n UserPicker,\r\n} from '../pickers/AutocompletePickers/UserPicker';\r\nimport { DropDown } from '../DropDown';\r\nimport { createStyles, makeStyles, MenuItem, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { debounce } from 'lodash';\r\n\r\nimport imageExtensions from 'image-extensions';\r\nimport isUrl from 'is-url';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport clsx from 'clsx';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\n\r\nconst HOTKEYS = {\r\n 'mod+b': 'bold',\r\n 'mod+i': 'italic',\r\n 'mod+u': 'underline',\r\n 'mod+`': 'code',\r\n};\r\n\r\nexport interface RichEditorProps {\r\n value: Descendant[];\r\n setValue: (value: Descendant[]) => void;\r\n onChangeMentions?: (mentions: Entity[]) => void;\r\n placeholder?: string;\r\n info?: NonNullable;\r\n autoFocus?: boolean;\r\n borders?: boolean;\r\n compact?: boolean;\r\n readonly?: boolean;\r\n hasMentions?: boolean;\r\n additionalButtons?: ((className, key) => ReactNode)[];\r\n disabled?: boolean;\r\n useCodeButton?: boolean;\r\n isInvoiceTemplateEditor?: boolean;\r\n extendedMode?: boolean;\r\n setControlsVisible?: (visible: boolean) => void;\r\n labelOnTop?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}\r\n\r\nconst RichTextWithMentions = (props: RichEditorProps) => {\r\n const {\r\n value,\r\n setValue,\r\n placeholder,\r\n info,\r\n autoFocus,\r\n hasMentions,\r\n onChangeMentions,\r\n additionalButtons,\r\n disabled,\r\n useCodeButton,\r\n isInvoiceTemplateEditor,\r\n setControlsVisible,\r\n labelOnTop,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n extendedMode,\r\n } = props;\r\n const { t } = useTranslation();\r\n const renderElement = useCallback(props => , []);\r\n const renderLeaf = useCallback(props => , []);\r\n const editor = useMemo(() => {\r\n return withMentions(\r\n withImages(withTables(withHtml(withHistory(withReact(createEditor()))))),\r\n );\r\n }, []);\r\n const [initValue, setInitValue] = useState(value);\r\n const ref = useRef(null);\r\n const [target, setTarget] = useState();\r\n const [index, setIndex] = useState(0);\r\n const [search, setSearch] = useState('');\r\n const [users, setUsers] = useState[]>([]);\r\n const [mention, setMention] = useState();\r\n const [mentions, setMentions] = useState[]>([]);\r\n const showControlPanel = React.useMemo(() => {\r\n let stringVal = serializeHtmlString(initValue);\r\n return stringVal !== '' && stringVal !== undefined && stringVal !== null;\r\n }, [initValue]);\r\n const servicegroups = useSelector(selectGlobalServiceGroupFilter);\r\n const serviceGroups = useMemo(\r\n () => props.serviceGroups ?? servicegroups,\r\n [props.serviceGroups, servicegroups],\r\n );\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const withoutServiceGroups =\r\n authenticatedUser?.isLabTech() || authenticatedUser?.isGroupAdmin();\r\n useEffect(() => {\r\n if (setControlsVisible) {\r\n setControlsVisible(showControlPanel);\r\n }\r\n }, [setControlsVisible, showControlPanel]);\r\n useEffect(() => {\r\n if (!hasMentions) return;\r\n let unmounted = false;\r\n (search => {\r\n const url = relevantUrl;\r\n const params: {\r\n $orderby: string;\r\n $top: number;\r\n $filter?: string;\r\n $select?: string;\r\n } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name',\r\n $top: 10,\r\n };\r\n if (search !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: search,\r\n globalServiceGroupFilter:\r\n !serviceGroups?.length || withoutServiceGroups\r\n ? undefined\r\n : [\r\n new Condition(\r\n 'ServiceGroups',\r\n ODataOperators.AnyIn,\r\n serviceGroups,\r\n 'Id',\r\n ),\r\n ],\r\n }).toString();\r\n }\r\n\r\n httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[])\r\n .then(v => {\r\n if (!unmounted) {\r\n setUsers(v);\r\n }\r\n })\r\n .catch(e => console.error(e));\r\n })(search);\r\n return () => {\r\n unmounted = true;\r\n };\r\n }, [search, hasMentions, serviceGroups, withoutServiceGroups]);\r\n\r\n useEffect(() => {\r\n if (target && mention && hasMentions) {\r\n Transforms.insertNodes(\r\n editor,\r\n [\r\n { text: '', plain: true } as any,\r\n mention as MentionElement,\r\n { text: ' ', plain: true } as any,\r\n ],\r\n {\r\n at: target,\r\n },\r\n );\r\n Transforms.move(editor, { distance: 2 });\r\n setTarget(undefined);\r\n setMention(undefined);\r\n }\r\n }, [target, mention, editor, hasMentions]);\r\n\r\n const onKeyDown = useCallback(\r\n event => {\r\n if (hasMentions && target && users.length) {\r\n switch (event.key) {\r\n case 'ArrowDown':\r\n event.preventDefault();\r\n const prevIndex = index >= users.length - 1 ? 0 : index + 1;\r\n setIndex(prevIndex);\r\n break;\r\n case 'ArrowUp':\r\n event.preventDefault();\r\n const nextIndex = index <= 0 ? users.length - 1 : index - 1;\r\n setIndex(nextIndex);\r\n break;\r\n case 'Tab':\r\n case 'Enter':\r\n event.preventDefault();\r\n setMention({\r\n type: 'mention',\r\n user: { ...users[index] },\r\n children: [{ text: '' }],\r\n });\r\n break;\r\n case 'Escape':\r\n event.preventDefault();\r\n setTarget(undefined);\r\n break;\r\n }\r\n }\r\n },\r\n [hasMentions, index, target, users],\r\n );\r\n useEffect(() => {\r\n if (target) {\r\n const el = ref.current;\r\n if (!el) return;\r\n const domRange = ReactEditor.toDOMRange(editor, target);\r\n const rect = domRange.getBoundingClientRect();\r\n el.style.top = `${rect.top + window.pageYOffset + 24}px`;\r\n el.style.left = `${rect.left + window.pageXOffset}px`;\r\n }\r\n }, [editor, target]);\r\n const onMentionsChange = () => {\r\n if (!hasMentions) return;\r\n const newMentions = getMentions(editor);\r\n if (newMentions.length !== mentions.length) {\r\n setMentions(newMentions);\r\n onChangeMentions?.(newMentions);\r\n return;\r\n }\r\n if (mentions.every(m => newMentions.map(v => v.Id).includes(m.Id))) return;\r\n setMentions(newMentions);\r\n onChangeMentions?.(newMentions);\r\n };\r\n\r\n const classes = useStyles(props)();\r\n\r\n //const fileUploadRef = useRef(null);\r\n\r\n /* const onChangeUpload = e => {\r\n fnRemoteImage(editor, e.target.files);\r\n }; */\r\n\r\n const styles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n editorBodyStyle: {\r\n width: '100%',\r\n maxHeight: '42vh',\r\n minHeight: '100px',\r\n paddingLeft: '8px',\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n }),\r\n );\r\n const editorClass = styles();\r\n\r\n const debounceValue = React.useCallback(\r\n value =>\r\n debounce(value => {\r\n setValue(value);\r\n }, 50)(value),\r\n [setValue],\r\n );\r\n return (\r\n \r\n {\r\n const { selection } = editor;\r\n if (selection && Range.isCollapsed(selection)) {\r\n const [start] = Range.edges(selection);\r\n const wordBefore = Editor.before(editor, start, { unit: 'word' });\r\n const before = wordBefore && Editor.before(editor, wordBefore);\r\n const beforeRange = before && Editor.range(editor, before, start);\r\n const beforeText =\r\n beforeRange && Editor.string(editor, beforeRange);\r\n const beforeMatch = beforeText && beforeText.match(/^@(\\w+)$/);\r\n const after = Editor.after(editor, start);\r\n const afterRange = Editor.range(editor, start, after);\r\n const afterText = Editor.string(editor, afterRange);\r\n const afterMatch = afterText.match(/^(\\s|$)/);\r\n if (beforeMatch && afterMatch) {\r\n setTarget(beforeRange);\r\n setSearch(beforeMatch[1]);\r\n setIndex(0);\r\n } else {\r\n setTarget(undefined);\r\n }\r\n }\r\n debounceValue(value);\r\n setInitValue(value);\r\n onMentionsChange();\r\n }}\r\n >\r\n {showControlPanel && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {useCodeButton && (\r\n \r\n \r\n \r\n )}\r\n \r\n {/* */}\r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* {\r\n event.preventDefault();\r\n if (!!fileUploadRef.current) {\r\n (fileUploadRef.current as any).click();\r\n }\r\n }}\r\n >\r\n \r\n */}\r\n {/* */}\r\n {hasMentions && (\r\n <>\r\n {\r\n e.preventDefault();\r\n const end = Editor.end(editor, []);\r\n const { selection } = editor;\r\n setTarget(selection ?? { anchor: end, focus: end });\r\n setUsers([]);\r\n }}\r\n menuChildren={close => [\r\n \r\n {\r\n if (!v) return;\r\n setMention({\r\n type: 'mention',\r\n user: v,\r\n children: [{ text: '' }],\r\n });\r\n close();\r\n }}\r\n />\r\n ,\r\n ]}\r\n >\r\n \r\n \r\n \r\n )}\r\n {additionalButtons &&\r\n additionalButtons.map((b, i) =>\r\n b(classes.button, 'richtextbutton' + i),\r\n )}\r\n \r\n \r\n )}\r\n \r\n {\r\n for (const hotkey in HOTKEYS) {\r\n if (isHotkey(hotkey, event.nativeEvent)) {\r\n event.preventDefault();\r\n const mark = HOTKEYS[hotkey];\r\n toggleMark(editor, mark);\r\n }\r\n }\r\n onKeyDown(event);\r\n }}\r\n />\r\n {!!info && (\r\n \r\n \r\n \r\n )}\r\n\r\n {hasMentions && target && users.length > 0 && search !== '' && (\r\n \r\n \r\n {users.map((char, i) => (\r\n {\r\n setIndex(i);\r\n }}\r\n onMouseDown={() =>\r\n setMention({\r\n type: 'mention',\r\n user: char,\r\n children: [{ text: '' }],\r\n })\r\n }\r\n >\r\n {char.Name}\r\n \r\n ))}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst toggleMark = (editor, format) => {\r\n const isActive = isMarkActive(editor, format);\r\n\r\n if (isActive) {\r\n Editor.removeMark(editor, format);\r\n } else {\r\n Editor.addMark(editor, format, true);\r\n }\r\n};\r\n\r\nconst MarkButton = ({ format, children, className, ...props }) => {\r\n const editor = useSlate();\r\n return (\r\n {\r\n event.preventDefault();\r\n toggleMark(editor, format);\r\n }}\r\n style={{ lineHeight: 1 }}\r\n {...props}\r\n >\r\n {children}\r\n \r\n );\r\n};\r\n\r\nconst BlockButton = ({ format, children, className, ...props }) => {\r\n const editor = useSlate();\r\n return (\r\n {\r\n event.preventDefault();\r\n toggleBlock(editor, format);\r\n }}\r\n style={{ lineHeight: 1 }}\r\n {...props}\r\n >\r\n {children}\r\n \r\n );\r\n};\r\n\r\nconst isBlockActive = (editor, format) => {\r\n const [match] = Editor.nodes(editor, {\r\n match: n => n.type === format,\r\n });\r\n return !!match;\r\n};\r\n\r\nconst LIST_TYPES = ['numbered-list', 'bulleted-list'];\r\n\r\nconst toggleBlock = (editor, format) => {\r\n const isActive = isBlockActive(editor, format);\r\n const isList = LIST_TYPES.includes(format);\r\n\r\n Transforms.unwrapNodes(editor, {\r\n match: n => LIST_TYPES.includes(n.type),\r\n split: true,\r\n });\r\n\r\n Transforms.setNodes(editor, {\r\n type: isActive ? 'paragraph' : isList ? 'list-item' : format,\r\n });\r\n\r\n if (!isActive && isList) {\r\n const block = { type: format, children: [] };\r\n Transforms.wrapNodes(editor, block);\r\n }\r\n};\r\n\r\nconst isMarkActive = (editor, format) => {\r\n const marks = editor.marks ? Editor.marks(editor) : null;\r\n return marks ? marks[format] === true : false;\r\n};\r\n\r\nexport const StartRichEditor: React.FC<{\r\n initialValue: string | undefined;\r\n onChange: (value: string | undefined) => void;\r\n placeholder?: string;\r\n autoFocus?: boolean;\r\n hasMentions?: boolean;\r\n onChangeMentions?: (mentions: Entity[]) => void;\r\n additionalButtons?: ((className, key) => ReactNode)[];\r\n disabled?: boolean;\r\n isInvoiceTemplateEditor?: boolean;\r\n extendedMode?: boolean;\r\n info?: NonNullable;\r\n setControlsVisible?: (visible: boolean) => void;\r\n labelOnTop?: boolean;\r\n serviceGroups?: Identifiable[];\r\n}> = ({\r\n initialValue,\r\n onChange,\r\n placeholder,\r\n autoFocus,\r\n hasMentions,\r\n onChangeMentions,\r\n additionalButtons,\r\n disabled,\r\n isInvoiceTemplateEditor,\r\n extendedMode,\r\n info,\r\n setControlsVisible,\r\n labelOnTop,\r\n serviceGroups,\r\n}) => {\r\n const setValue = value => {\r\n onChange(serializeHtmlString(value));\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst withMentions = (editor: CustomEditor) => {\r\n const { isInline, isVoid } = editor;\r\n\r\n editor.isInline = element => {\r\n return element.type === 'mention' ? true : isInline(element);\r\n };\r\n\r\n editor.isVoid = element => {\r\n return element.type === 'mention' ? true : isVoid(element);\r\n };\r\n\r\n return editor;\r\n};\r\n\r\nconst getMentions = editor => {\r\n const mentions = Editor.nodes(editor, {\r\n match: node => node.type === 'mention',\r\n at: [],\r\n });\r\n const set = new Set();\r\n const res: Entity[] = [];\r\n for (const [node] of mentions) {\r\n if (node.type === 'mention') {\r\n const user = (node as MentionElement).user;\r\n if (!set.has(user.Id)) {\r\n res.push(user);\r\n set.add(user.Id);\r\n }\r\n }\r\n }\r\n return res;\r\n};\r\n\r\nconst Portal = ({ children }) => {\r\n return typeof document === 'object'\r\n ? ReactDOM.createPortal(children, document.body)\r\n : null;\r\n};\r\n\r\nconst fnRemoteImage = (editor, files) => {\r\n for (const file of files) {\r\n const [mime] = file.type.split('/');\r\n if (mime === 'image') {\r\n const formData = new FormData();\r\n formData.append('image', file);\r\n //Need fixing - currently this route is commented on server\r\n fetch('/api/odata/v4/Files/InsertFile', {\r\n method: 'POST',\r\n body: formData,\r\n })\r\n .then(response => response.json())\r\n .then(result => {\r\n console.log(result);\r\n insertImage(\r\n editor,\r\n result.data\r\n .uri /* 'file:///C:/bookitlab/web-ui/public/favicon.png' */,\r\n );\r\n })\r\n .catch(error => {\r\n alert('Error:' + error);\r\n });\r\n }\r\n }\r\n};\r\n\r\nconst withImages = editor => {\r\n const { insertData, isVoid } = editor;\r\n\r\n editor.isVoid = element => {\r\n return element.type === 'image' ? true : isVoid(element);\r\n };\r\n\r\n editor.insertData = data => {\r\n const text = data.getData('text/plain');\r\n const { files } = data;\r\n console.log('insertData:', files);\r\n if (files && files.length > 0) {\r\n fnRemoteImage(editor, files);\r\n } else if (isImageUrl(text)) {\r\n insertImage(editor, text);\r\n } else {\r\n insertData(data);\r\n }\r\n };\r\n\r\n return editor;\r\n};\r\n\r\nconst isImageUrl = url => {\r\n if (!url) return false;\r\n if (!isUrl(url)) return false;\r\n const ext = new URL(url).pathname.split('.').pop();\r\n return imageExtensions.includes(ext as string);\r\n};\r\n\r\nconst insertImage = (editor, url) => {\r\n const text = { text: '' };\r\n const image = { type: 'image', url, children: [text] };\r\n Transforms.insertNodes(editor, image as any);\r\n};\r\n\r\nconst withTables = editor => {\r\n const { deleteBackward, deleteForward, insertBreak } = editor;\r\n\r\n editor.deleteBackward = unit => {\r\n const { selection } = editor;\r\n\r\n if (selection && Range.isCollapsed(selection)) {\r\n const [cell] = Editor.nodes(editor, {\r\n match: n =>\r\n !Editor.isEditor(n) &&\r\n SlateElement.isElement(n) &&\r\n n.type === 'table-cell',\r\n });\r\n\r\n if (cell) {\r\n const [, cellPath] = cell;\r\n const start = Editor.start(editor, cellPath);\r\n\r\n if (Point.equals(selection.anchor, start)) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n deleteBackward(unit);\r\n };\r\n\r\n editor.deleteForward = unit => {\r\n const { selection } = editor;\r\n\r\n if (selection && Range.isCollapsed(selection)) {\r\n const [cell] = Editor.nodes(editor, {\r\n match: n =>\r\n !Editor.isEditor(n) &&\r\n SlateElement.isElement(n) &&\r\n n.type === 'table-cell',\r\n });\r\n\r\n if (cell) {\r\n const [, cellPath] = cell;\r\n const end = Editor.end(editor, cellPath);\r\n\r\n if (Point.equals(selection.anchor, end)) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n deleteForward(unit);\r\n };\r\n\r\n editor.insertBreak = () => {\r\n const { selection } = editor;\r\n\r\n if (selection) {\r\n const [table] = Editor.nodes(editor, {\r\n match: n =>\r\n !Editor.isEditor(n) &&\r\n SlateElement.isElement(n) &&\r\n n.type === 'table',\r\n });\r\n\r\n if (table) {\r\n return;\r\n }\r\n }\r\n\r\n insertBreak();\r\n };\r\n\r\n return editor;\r\n};\r\n\r\nconst withHtml = editor => {\r\n const { insertData, isInline, isVoid } = editor;\r\n\r\n editor.isInline = element => {\r\n return element.type === 'link' ? true : isInline(element);\r\n };\r\n\r\n editor.isVoid = element => {\r\n return element.type === 'image' ? true : isVoid(element);\r\n };\r\n\r\n editor.insertData = data => {\r\n const html = data.getData('text/html');\r\n\r\n if (html) {\r\n const parsed = new DOMParser().parseFromString(html, 'text/html');\r\n const fragment = deserialize(parsed.body);\r\n Transforms.insertFragment(editor, fragment);\r\n return;\r\n }\r\n\r\n insertData(data);\r\n };\r\n\r\n return editor;\r\n};\r\n\r\nconst Element = ({ attributes, children, element }) => {\r\n switch (element.type) {\r\n case 'thead':\r\n return {children};\r\n case 'tbody':\r\n return {children};\r\n case 'table':\r\n return {children}
    ;\r\n case 'table-row':\r\n //return {children};\r\n return (\r\n \r\n );\r\n case 'table-cell':\r\n //return {children};\r\n return (\r\n \r\n );\r\n case 'table-cell-header':\r\n return {children};\r\n case 'block-quote':\r\n return
    {children}
    ;\r\n case 'bulleted-list':\r\n return
      {children}
    ;\r\n case 'heading-one':\r\n return

    {children}

    ;\r\n case 'heading-two':\r\n return

    {children}

    ;\r\n case 'heading-three':\r\n return

    {children}

    ;\r\n case 'heading-four':\r\n return

    {children}

    ;\r\n case 'heading-five':\r\n return
    {children}
    ;\r\n case 'heading-six':\r\n return
    {children}
    ;\r\n case 'list-item':\r\n return
  • {children}
  • ;\r\n case 'numbered-list':\r\n return
      {children}
    ;\r\n case 'link':\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n case 'mention':\r\n return (\r\n \r\n );\r\n case 'image':\r\n return (\r\n \r\n );\r\n default:\r\n return

    {children}

    ;\r\n }\r\n};\r\n\r\nconst Leaf = ({ attributes, children, leaf }) => {\r\n if (leaf.bold) {\r\n children = {children};\r\n }\r\n\r\n if (leaf.code) {\r\n children = {children};\r\n }\r\n\r\n if (leaf.italic) {\r\n children = {children};\r\n }\r\n\r\n if (leaf.underline) {\r\n children = {children};\r\n }\r\n if (leaf.plain) {\r\n children = {children};\r\n }\r\n\r\n return {children};\r\n};\r\n\r\nexport const ImageElement = ({ attributes, children, element }) => {\r\n const selected = useSelected();\r\n const focused = useFocused();\r\n return (\r\n
    \r\n {children}\r\n \r\n
    \r\n );\r\n};\r\n\r\nexport const TrStyled = ({ attributes, children, element }) => {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nexport const TdStyled = ({ attributes, children, element }) => {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nexport const Mention = ({ attributes, children, element }) => {\r\n const selected = useSelected();\r\n const focused = useFocused();\r\n return (\r\n \r\n @{element.user.Name}\r\n {children}\r\n \r\n );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const useStyles = props =>\r\n makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n //padding: '0px 0px 0px 1px',\r\n background: theme.palette.common.white,\r\n border: `1px solid ${theme.palette.common.grayComponentsLight}`,\r\n boxSizing: 'border-box',\r\n borderRadius: 8,\r\n },\r\n header: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n //padding: '1px 0px',\r\n width: '100%',\r\n background: theme.palette.common.white,\r\n borderBottom: `1px solid ${theme.palette.common.grayComponentsLight}`,\r\n boxSizing: 'border-box',\r\n borderRadius: '8px 8px 0px 0px',\r\n },\r\n headerControls: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n width: '100%',\r\n flexWrap: 'wrap',\r\n },\r\n button: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n padding: 10,\r\n border: 'none',\r\n borderRadius: 0,\r\n boxShadow: 'inset -1px 0px 0px #E0E5EC',\r\n color: theme.palette.common.blackRegular,\r\n },\r\n text: {\r\n paddingLeft: theme.spacing(1),\r\n width: '100%',\r\n minHeight: 32,\r\n maxHeight: 300,\r\n overflowY: 'auto',\r\n },\r\n textWithControls: {\r\n paddingTop: 8,\r\n },\r\n textWithInfo: {\r\n paddingRight: 24,\r\n },\r\n infoIcon: {\r\n position: 'absolute',\r\n right: '12px',\r\n top: '16px',\r\n },\r\n withTopLabel: {\r\n top: '42px',\r\n },\r\n showControls: {\r\n top: '48px',\r\n },\r\n showControlsWithTop: {\r\n top: '72px',\r\n },\r\n }),\r\n );\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n avatar: {\r\n width: '48px',\r\n height: '48px',\r\n backgroundColor: '#DBF9ED',\r\n color: '#10BD79',\r\n },\r\n withPointer: {\r\n cursor: 'pointer',\r\n },\r\n }),\r\n);\r\n","import { useMemo } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Body } from '../Typography';\r\nimport { useStyles } from './styles';\r\nimport { Avatar as MuiAvatar } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface AvatarProps {\r\n user?: Entity | null;\r\n}\r\nexport const Avatar = ({ user }: AvatarProps) => {\r\n const { t } = useTranslation();\r\n const initials = useMemo(() => {\r\n const defaultText = t(translations.NA);\r\n if (user === null) {\r\n return defaultText;\r\n }\r\n if (user === undefined) {\r\n return defaultText;\r\n }\r\n const split = user.Name.split(' ');\r\n return (split[0][0] + (split[1] ? split[1][0] : '')).toUpperCase();\r\n }, [t, user]);\r\n const classes = useStyles();\r\n const Id = user?.Id ?? undefined;\r\n return (\r\n \r\n {\r\n if (Id !== undefined) {\r\n window.open(toRootedURL('/UserProfile.aspx?id=' + Id), '_blank');\r\n }\r\n }}\r\n >\r\n \r\n {initials}\r\n \r\n \r\n \r\n );\r\n};\r\n","import { Formik, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser, IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n OtherServiceDetailsState,\r\n ServiceChangeStateParameters,\r\n} from '../slice/types';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport {\r\n selectConnectedInitState,\r\n selectFieldHandler,\r\n selectInventoryBatchEditable,\r\n selectServiceChangeState,\r\n selectServiceHasError,\r\n} from '../slice/selectors';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { OfflineServiceRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport {\r\n selectConnectedFiltersData,\r\n selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { ConnectedFiltersControl } from 'app/components/Forms/FormConnectedFilters/ConnectedFiltersControl';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormInventoryBatchPicker } from 'app/components/Forms/FormInventoryBatchPicker';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BatchesByServiceTypeFilter } from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nexport interface OfflineFormProps {\r\n onSubmit: (item: OtherServiceDetailsState) => void;\r\n initialValues: OtherServiceDetailsState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n connectedFiltersFormRef: React.MutableRefObject;\r\n globalSettings: GlobalSettingsType;\r\n editCreatable?: boolean;\r\n onBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n}\r\nexport const OfflineForm = React.memo(function OfflineForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isEdit,\r\n isAdmin,\r\n user,\r\n connectedFiltersFormRef,\r\n globalSettings,\r\n innerFormRef,\r\n editCreatable,\r\n onBatchClick,\r\n}: OfflineFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n //const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const fieldHandler = useSelector(selectFieldHandler);\r\n const hasError = useSelector(selectServiceHasError);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const connectedData = useSelector(selectConnectedFiltersData);\r\n const connectedInit = useSelector(selectConnectedInitState);\r\n const serviceChangeState = useSelector(selectServiceChangeState);\r\n const batchRequested = useSelector(selectInventoryBatchEditable);\r\n const readonly = !isAdmin && isEdit;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (values: OtherServiceDetailsState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetValueHandler());\r\n };\r\n\r\n /// Local State ///\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [quantityChanged, setQuantityChanged] = React.useState(false);\r\n const [batchChanged, setBatchChanged] = React.useState(false);\r\n const [allIsValid, setAllIsValid] = React.useState(true);\r\n const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n IOfflineServiceFilterDto | undefined\r\n >(initialValues.ServiceType ?? undefined);\r\n const minStep = React.useMemo(() => {\r\n return !!serviceTypeSelected\r\n ? serviceTypeSelected.IntQuantityOnly === true\r\n ? 1\r\n : 0.01\r\n : 1;\r\n }, [serviceTypeSelected]);\r\n const step = React.useMemo(() => {\r\n return !!serviceTypeSelected\r\n ? serviceTypeSelected.IntQuantityOnly === true\r\n ? 1\r\n : 0.01\r\n : 1;\r\n }, [serviceTypeSelected]);\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n globalSettings.fundingTypeBudgetEnabled\r\n );\r\n }, [globalSettings]);\r\n // const defaultQuantity = React.useMemo(() => {\r\n // return initialValues.Quantity ?? serviceTypeSelected?.DefaultQuantity;\r\n // }, [initialValues.Quantity, serviceTypeSelected]);\r\n const maxStep = 9999;\r\n const inputProps = {\r\n step: step,\r\n min: minStep,\r\n max: maxStep,\r\n 'aria-label': 'Counter',\r\n };\r\n const IsAdminOfService = React.useMemo(() => {\r\n return user?.IsAdminOf({\r\n ServiceGroupId: serviceTypeSelected?.ServiceGroupId,\r\n ServiceId: serviceTypeSelected?.Id,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IIsAdminOfParams);\r\n }, [serviceTypeSelected, user]);\r\n\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: OtherServiceDetailsState,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (serviceChanged) {\r\n dispatch(\r\n connectedFiltersActions.extendSettingsState({\r\n services:\r\n values.ServiceType === null\r\n ? []\r\n : [\r\n {\r\n Id: values.ServiceType.Id,\r\n Name: values.ServiceType.Name,\r\n ServiceGroupId: values.ServiceType.ServiceGroupId,\r\n ServiceTypeId: ServiceType.Offline,\r\n Active: true,\r\n BudgetsTurnedOn: values.ServiceType.BudgetsTurnedOn,\r\n HideProject: values.ServiceType.HideProjects,\r\n } as IServiceTypeFilterDto,\r\n ],\r\n globalSettings: globalSettings,\r\n settings: serviceSettings,\r\n isEdit: isEdit,\r\n data: connectedData,\r\n }),\r\n );\r\n if (\r\n values.ServiceType !== null &&\r\n !isEdit &&\r\n connectedData?.User !== null\r\n ) {\r\n const parameters = {\r\n ServiceTypes: [values.ServiceType.Id],\r\n ReservationId: values.ReservationId || null,\r\n UsageId: values.UsageId || null,\r\n BookedBy: connectedData?.User?.Id || null,\r\n ADGroup: connectedData?.UserGroup?.Id || null,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n connectedData?.StartTime || new Date(),\r\n ),\r\n ),\r\n BudgetId: connectedData?.Budget?.Id || null,\r\n FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n } as ServiceChangeStateParameters;\r\n dispatch(actions.initServiceChangeStateData(parameters));\r\n }\r\n setServiceTypeSelected(values.ServiceType ?? undefined);\r\n if (\r\n values.ServiceType?.DefaultQuantity !== null &&\r\n values.ServiceType?.DefaultQuantity !== undefined\r\n ) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'Quantity',\r\n fieldValue: values.ServiceType.DefaultQuantity,\r\n }),\r\n );\r\n }\r\n\r\n setServiceChanged(false);\r\n }\r\n if (quantityChanged) {\r\n setQuantityChanged(false);\r\n }\r\n if (batchChanged) {\r\n setBatchChanged(false);\r\n }\r\n },\r\n [\r\n serviceChanged,\r\n quantityChanged,\r\n batchChanged,\r\n dispatch,\r\n connectedFiltersActions,\r\n globalSettings,\r\n serviceSettings,\r\n isEdit,\r\n connectedData,\r\n setServiceTypeSelected,\r\n actions,\r\n ],\r\n );\r\n const validateForms = React.useCallback((isValid: boolean) => {\r\n setAllIsValid(isValid);\r\n }, []);\r\n /// refs\r\n // const formRef = React.useRef | null>(\r\n // null,\r\n // );\r\n /// useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n\r\n React.useEffect(() => {\r\n if (batchRequested !== undefined) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'InventoryBatch',\r\n fieldValue: batchRequested,\r\n }),\r\n );\r\n dispatch(actions.setInventoryBatchEditable(undefined));\r\n }\r\n }, [actions, batchRequested, dispatch]);\r\n\r\n React.useEffect(() => {\r\n if (!!serviceChangeState && !editCreatable) {\r\n console.log('service settings: ', serviceSettings);\r\n if (!!serviceChangeState) {\r\n if (serviceSettings.budgetVisible && !isEdit) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'Budget',\r\n fieldValue: serviceChangeState.DefaultBudget,\r\n }),\r\n );\r\n if (\r\n fundingTypeVisible &&\r\n serviceChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n serviceChangeState.DefaultBudget?.FundingTypeId !== null\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'FundingType',\r\n fieldValue: serviceChangeState.DefaultBudget.FundingTypeId,\r\n }),\r\n );\r\n }\r\n if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (serviceChangeState.DefaultBudget !== null) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n },\r\n }),\r\n );\r\n }\r\n } else {\r\n if (\r\n connectedData?.UserGroup === null ||\r\n connectedData?.UserGroup === undefined\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id:\r\n (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n user?.ActiveUserGroup?.Id,\r\n Name:\r\n (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n user?.ActiveUserGroup?.Name,\r\n },\r\n }),\r\n );\r\n }\r\n }\r\n if (\r\n serviceSettings.budgetExpirementVisible &&\r\n serviceChangeState.DefaultExperiment !== null\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'BudgetExperiment',\r\n fieldValue: serviceChangeState.DefaultExperiment,\r\n }),\r\n );\r\n }\r\n } else {\r\n if (serviceSettings.isUserGroupCoordinator) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id: user?.ActiveUserGroup?.Id,\r\n Name: user?.ActiveUserGroup?.Name,\r\n },\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n dispatch(actions.resetServiceChangeState());\r\n }\r\n }, [\r\n actions,\r\n connectedData?.User,\r\n connectedData?.UserGroup,\r\n connectedFiltersActions,\r\n dispatch,\r\n editCreatable,\r\n fundingTypeVisible,\r\n isEdit,\r\n serviceChangeState,\r\n serviceSettings,\r\n user?.ActiveUserGroup?.Id,\r\n user?.ActiveUserGroup?.Name,\r\n ]);\r\n\r\n const computedSchema = React.useMemo(() => {\r\n const otherServiceSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n ServiceType: ServiceTypeSchema.nullable().required(\r\n t(translations.err_OfflineServiceTypeRequired),\r\n ),\r\n DiscountFactor: Yup.number()\r\n .nullable()\r\n .label(t(translations.DiscountFactor) as string)\r\n .max(maxStep)\r\n .min(0.01)\r\n .default(null),\r\n Remarks: Yup.string()\r\n .nullable()\r\n .label(t(translations.Remarks) as string),\r\n Quantity: Yup.number()\r\n .label(t(translations.Quantity) as string)\r\n .required(t(translations.err_Quantity_required))\r\n .nullable()\r\n .default(null)\r\n .max(maxStep)\r\n .min(minStep)\r\n .test(\r\n 'empty',\r\n t(translations.err_Quantity_required) as string,\r\n (value, context) => {\r\n let currVal = (context as any).from[0].value.Quantity;\r\n if (\r\n currVal === undefined ||\r\n currVal === null ||\r\n isNaN(currVal) ||\r\n currVal === 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n )\r\n .test(\r\n 'integerOnly',\r\n t(translations.err_IntQuantityOnly) as string,\r\n (value, context) => {\r\n let currVal = (context as any).from[0].value.Quantity;\r\n if (\r\n !!serviceTypeSelected &&\r\n serviceTypeSelected.IntQuantityOnly &&\r\n currVal % 1 !== 0\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n ),\r\n ReservationId: Yup.number().nullable().notRequired().optional(),\r\n UsageId: Yup.number().nullable().notRequired().optional(),\r\n SyncReservation: Yup.boolean().nullable().notRequired().optional(),\r\n SyncUsage: Yup.boolean().nullable().notRequired().optional(),\r\n InventoryBatch: (Yup.mixed() as Yup.SchemaOf)\r\n .nullable()\r\n .label(t(translations.Batch) as string),\r\n // ServiceDate: Yup.date()\r\n // .default(dateUtils.dateOrStringToDate(new Date()))\r\n // .label(t(translations.StartTime) as string)\r\n // .required(t(translations._errStartTimeRequired) as string),\r\n // Budget: Yup.mixed()\r\n // .label(t(translations.BudgetNumber) as string)\r\n // .nullable(true),\r\n // BudgetExperiment: Yup.mixed()\r\n // .label(t(translations.BudgetExperiment) as string)\r\n // .nullable(true),\r\n // BookedBy: Yup.mixed()\r\n // .label(t(translations.User) as string)\r\n // .required(() => t(translations.err_UserFieldRequired) as string),\r\n // UserGroup: Yup.mixed()\r\n // .label(t(translations.UserGroup) as string)\r\n // .nullable(true),\r\n // InstituteProject: Yup.mixed()\r\n // .label(t(translations.InstituteProject) as string)\r\n // .nullable(true),\r\n // ExternalCustomer: Yup.mixed()\r\n // .label(t(translations.ExternalCustomer) as string)\r\n // .nullable(true),\r\n // FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n // PurchaseOrder: Yup.string()\r\n // .label(t(translations.PurchaseOrder) as string)\r\n // .nullable(true),\r\n // Reference: Yup.string()\r\n // .label(t(translations.Reference) as string)\r\n // .nullable(true),\r\n },\r\n );\r\n if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n if (serviceTypeSelected?.NotLessThanZero) {\r\n // if (serviceTypeSelected.Inventory === 0) {\r\n // otherServiceSchema.fields.Quantity.withMutation(schema =>\r\n // schema\r\n // .label(t(translations.Quantity) as string)\r\n // .required(t(translations.err_Quantity_required))\r\n // .default(null)\r\n // .nullable()\r\n // .max(maxStep)\r\n // .min(minStep)\r\n // .test(\r\n // 'empty',\r\n // t(translations.err_Quantity_required) as string,\r\n // (value, context) => {\r\n // let currVal = context.from[0].value.Quantity;\r\n // if (\r\n // currVal === undefined ||\r\n // currVal === null ||\r\n // isNaN(currVal) ||\r\n // currVal === 0\r\n // ) {\r\n // return false;\r\n // }\r\n // return true;\r\n // },\r\n // )\r\n // .test(\r\n // 'minQuantWithZero',\r\n // t(\r\n // translations.NotAllowNegativeInventory_currentEqualsZero_err,\r\n // ) as string,\r\n // (value, context) => {\r\n // let currVal = context.from[0].value.Quantity;\r\n // let current = currVal as number;\r\n // if (current < 1) {\r\n // return false;\r\n // }\r\n // return true;\r\n // },\r\n // ),\r\n // );\r\n // } else {\r\n // otherServiceSchema.fields.Quantity.withMutation(schema =>\r\n // schema\r\n // .label(t(translations.Quantity) as string)\r\n // .required(t(translations.err_Quantity_required))\r\n // .max(maxStep)\r\n // .min(minStep)\r\n // .test(\r\n // 'empty',\r\n // t(translations.err_Quantity_required) as string,\r\n // (value, context) => {\r\n // let currVal = context.from[0].value.Quantity;\r\n // if (\r\n // currVal === undefined ||\r\n // currVal === null ||\r\n // isNaN(currVal) ||\r\n // currVal === 0\r\n // ) {\r\n // return false;\r\n // }\r\n // return true;\r\n // },\r\n // )\r\n // .test(\r\n // 'minQuant',\r\n // (t(\r\n // translations.NotAllowNegativeInventory_currentMoreThanZero_err,\r\n // ) as string).replace(\r\n // '{0}',\r\n // serviceTypeSelected.Inventory.toString(),\r\n // ),\r\n // (value, context) => {\r\n // let currVal = context.from[0].value.Quantity;\r\n // let current = currVal as number;\r\n // if (serviceTypeSelected.Inventory - current < 0) {\r\n // return false;\r\n // }\r\n // return true;\r\n // },\r\n // ),\r\n // );\r\n // }\r\n }\r\n if (serviceTypeSelected?.InventoryBatchesEnabled) {\r\n otherServiceSchema.fields.InventoryBatch.withMutation(schema =>\r\n schema\r\n .label(t(translations.Batch) as string)\r\n .nullable()\r\n .required(t(translations.err_InventoryBatch_required) as string),\r\n );\r\n }\r\n }\r\n\r\n return otherServiceSchema;\r\n }, [minStep, serviceTypeSelected, t]);\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n if (allIsValid) {\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n }\r\n // else if (errorMessages.length > 0) {\r\n // console.debug('errors', errorMessages);\r\n // formikHelpers.setSubmitting(false);\r\n // }\r\n else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n } else {\r\n formikHelpers.setSubmitting(false);\r\n }\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Reservation errors', formik.errors);\r\n }\r\n // if (newStatus && !statusUpdated) {\r\n // formik.setFieldValue('Status', newStatus, true);\r\n // statusUpdated = true;\r\n // }\r\n console.log('Reservation submitting', formik.isSubmitting);\r\n const isChildEntry =\r\n (initialValues?.ReservationId ?? initialValues?.UsageId ?? null) !==\r\n null;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n setServiceChanged(true);\r\n }}\r\n />\r\n \r\n \r\n {!!serviceTypeSelected &&\r\n serviceTypeSelected?.InventoryBatchesEnabled &&\r\n IsAdminOfService &&\r\n !isEdit && (\r\n \r\n \r\n {\r\n setBatchChanged(true);\r\n }}\r\n />\r\n \r\n {formik.values.ServiceType !== null &&\r\n formik.values.ServiceType !== undefined &&\r\n IsAdminOfService && (\r\n \r\n {formik.values.InventoryBatch !== null &&\r\n formik.values.InventoryBatch !==\r\n undefined && (\r\n \r\n onBatchClick(\r\n formik.values.InventoryBatch ?? null,\r\n formik.values.ServiceType?.Id ?? 0,\r\n )\r\n }\r\n >\r\n {t(translations.EditSelectedBatch)}\r\n \r\n )}\r\n \r\n onBatchClick(\r\n null,\r\n formik.values.ServiceType?.Id ?? 0,\r\n )\r\n }\r\n >\r\n {t(translations.AddNewBatch)}\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n {\r\n const precision =\r\n formik.values.ServiceType?.IntQuantityOnly === false\r\n ? 2\r\n : 0;\r\n const value = +(+event.target.value).toFixed(\r\n precision,\r\n );\r\n console.log('qyt', value);\r\n // if (value < step) {\r\n // event.preventDefault();\r\n // event.stopPropagation();\r\n // formik.setFieldError(\r\n // 'Quantity',\r\n // (t(\r\n // translations.err_LowQuantity,\r\n // ) as string).replace('{0}', minStep.toString()),\r\n // );\r\n // } else if (value > 0 && value > maxStep) {\r\n // event.preventDefault();\r\n // event.stopPropagation();\r\n // formik.setFieldError(\r\n // 'Quantity',\r\n // (t(\r\n // translations.err_HighQuantity,\r\n // ) as string).replace('{0}', maxStep.toString()),\r\n // );\r\n // }\r\n }}\r\n inputProps={inputProps}\r\n />\r\n \r\n {formik.values.ServiceType !== null &&\r\n formik.values.ServiceType !== undefined &&\r\n IsAdminOfService &&\r\n !globalSettings.priceSheetPricing &&\r\n globalSettings.billingModuleEnabled && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Box, LinearProgress } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { OfflineForm } from './OfflineForm';\r\nimport { useOfflineServiceStateSlice } from './slice';\r\nimport {\r\n selectCredit,\r\n selectCreditCompleted,\r\n selectCreditProcessing,\r\n selectHasCharges,\r\n selectIsEdit,\r\n selectProcessing,\r\n selectService,\r\n selectServiceCompleted,\r\n selectServiceHasError,\r\n} from './slice/selectors';\r\nimport {\r\n OfflineServiceQueryStringParameters,\r\n OtherServiceDetailsState,\r\n} from './slice/types';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { selectConnectedSettings } from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { ReferenceType } from 'enums/ReferenceType';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { Roles } from 'app/slice/types';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface OtherServiceDetailsProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n queryParams: OfflineServiceQueryStringParameters;\r\n initialService?: IOtherServices;\r\n onClose?: () => void;\r\n editCreatable?: boolean;\r\n saveCreatable?: boolean;\r\n}\r\n\r\nexport const OtherServiceDetails = React.memo(function OtherServiceDetails(\r\n props: OtherServiceDetailsProps,\r\n) {\r\n const {\r\n useSidePanel,\r\n queryParams,\r\n initialService,\r\n editCreatable,\r\n saveCreatable,\r\n isCover,\r\n closeCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n\r\n /// Settings ///\r\n const globalSettings = useGlobalSettingsHook();\r\n const history = useHistory();\r\n /// Selectors ///\r\n const processing = useSelector(selectProcessing);\r\n const offlineService = useSelector(selectService);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const actionCompleted = useSelector(selectServiceCompleted);\r\n //const serviceProcessing = useSelector(selectServiceProcessing);\r\n const hasError = useSelector(selectServiceHasError);\r\n const credit = useSelector(selectCredit);\r\n const creditProccessing = useSelector(selectCreditProcessing);\r\n const creditCompleted = useSelector(selectCreditCompleted);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const hasCharges = useSelector(selectHasCharges);\r\n const edit = useSelector(selectIsEdit);\r\n /// Refs ///\r\n const submitFormRef = React.useRef(null);\r\n const connectedFiltersFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(\r\n null,\r\n );\r\n //cover\r\n // const [cover, setCover] = React.useState();\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(\r\n () => {\r\n dispatch(actions.resetDetailsState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [busy, setBusy] = React.useState(false);\r\n const [showCalculateCredit, setShowCalculateCredit] = React.useState(false);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const IsAdmin = React.useMemo(() => {\r\n return (\r\n User?.HasAdminGroupPermissions(\r\n offlineService?.data?.ServiceType?.ServiceGroupId ?? undefined,\r\n ) ||\r\n User?.HasLabTechGroupPermissions(\r\n offlineService?.data?.ServiceType?.ServiceGroupId ?? undefined,\r\n ) ||\r\n User?.HasAdminServicePermissions(\r\n ServiceType.Offline,\r\n offlineService?.data?.ServiceType?.Id,\r\n ) ||\r\n User?.HasLabTechServicePermissions(\r\n ServiceType.Offline,\r\n offlineService?.data?.ServiceType?.Id,\r\n )\r\n );\r\n }, [User, offlineService]);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n\r\n /// mount effect - init ///\r\n // useEffectOnMount(() => {\r\n // setRequestCompleted(undefined);\r\n // dispatch(actions.initDetails(queryParams, ));\r\n // return () => {};\r\n // });\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initDetails({\r\n query: queryParams,\r\n globalSettings: globalSettings,\r\n service: initialService,\r\n editCreatable: editCreatable,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n editCreatable,\r\n firstLoad,\r\n globalSettings,\r\n initialService,\r\n queryParams,\r\n ]);\r\n /// functions, callbacks ///\r\n // const closeCover = () => {\r\n // setCover(undefined);\r\n // };\r\n // const handleClose = () => {\r\n // if (hasChanges && !editCreatable) {\r\n // dispatch(layoutActions.setConfirmOpen(true));\r\n // } else {\r\n // handleCloselClick();\r\n // }\r\n // };\r\n const handleCloselClick = React.useCallback(() => {\r\n // dispatch(actions.resetDetailsState(editCreatable));\r\n // if (!!onClose) {\r\n // onClose();\r\n // } else {\r\n // if (useSidePanel) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(push('/otherServices'));\r\n // }\r\n // }\r\n // if (!editCreatable) {\r\n // dispatch(connectedFiltersActions.resetConnectedState());\r\n // }\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges && !editCreatable,\r\n onClose: () => {\r\n dispatch(actions.resetDetailsState(editCreatable));\r\n if (!editCreatable) {\r\n dispatch(connectedFiltersActions.resetConnectedState());\r\n }\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/otherServices'));\r\n }\r\n }, [\r\n actions,\r\n closePanel,\r\n connectedFiltersActions,\r\n dispatch,\r\n editCreatable,\r\n hasChanges,\r\n isCover,\r\n useSidePanel,\r\n ]);\r\n const handleSaveClick = React.useCallback(\r\n (e: any) => {\r\n if (editCreatable && !!initialService) {\r\n if (\r\n !!innerFormRef.current?.errors &&\r\n !!innerFormRef.current?.errors['Quantity']\r\n ) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: innerFormRef.current?.errors['Quantity'],\r\n }),\r\n );\r\n return;\r\n }\r\n dispatch(\r\n actions.setEditCreatableService(\r\n Object.assign({}, initialService, {\r\n Remarks: innerFormRef.current?.values.Remarks,\r\n Quantity: innerFormRef.current?.values.Quantity || null,\r\n DiscountFactor:\r\n innerFormRef.current?.values.DiscountFactor || null,\r\n InventoryBatchId:\r\n innerFormRef.current?.values.InventoryBatch?.Id || null,\r\n InventoryBatchName:\r\n innerFormRef.current?.values.InventoryBatch?.Name || null,\r\n InventoryBatchAmount:\r\n innerFormRef.current?.values.InventoryBatch?.Inventory || null,\r\n }),\r\n ),\r\n );\r\n handleCloselClick();\r\n } else {\r\n handleSubmitForm(e);\r\n }\r\n },\r\n [\r\n actions,\r\n appSettingsActions,\r\n dispatch,\r\n editCreatable,\r\n handleCloselClick,\r\n initialService,\r\n ],\r\n );\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (connectedFiltersFormRef.current) {\r\n connectedFiltersFormRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: OtherServiceDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateService({\r\n current: values,\r\n original: offlineService.data || values,\r\n saveCreatable: saveCreatable,\r\n }),\r\n );\r\n } else {\r\n dispatch(\r\n actions.createService({\r\n model: values,\r\n saveCreatable: saveCreatable,\r\n }),\r\n );\r\n }\r\n },\r\n [actions, dispatch, edit, offlineService.data, saveCreatable],\r\n );\r\n const handleCalculateCredit = React.useCallback(() => {\r\n setShowCalculateCredit(true);\r\n dispatch(\r\n actions.getCredit(\r\n innerFormRef?.current?.values ||\r\n offlineService?.data ||\r\n ({} as OtherServiceDetailsState),\r\n ),\r\n );\r\n }, [actions, dispatch, offlineService?.data]);\r\n const handleCalculateClose = React.useCallback(() => {\r\n setShowCalculateCredit(false);\r\n dispatch(actions.resetCreditState());\r\n }, [actions, dispatch]);\r\n /// Use Effects ///\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n //setEdit(true);\r\n } else {\r\n //setEdit(false);\r\n }\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n dispatch,\r\n handleCloselClick,\r\n hasError,\r\n layoutActions,\r\n processing,\r\n queryParams.id,\r\n ]);\r\n // React.useEffect(() => {\r\n // if (confirmApproved) {\r\n // dispatch(actions.resetDetailsState());\r\n // if (continueToOther.continueOnApprove) {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // setTimeout(() => {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: continueToOther.pageType,\r\n // props: continueToOther.pageProps,\r\n // expanded: continueToOther.expanded,\r\n // }),\r\n // );\r\n // dispatch(layoutActions.resetContinueState());\r\n // }, 200);\r\n // } else if (continueLink !== undefined) {\r\n // dispatch(appSettingsActions.navigate(continueLink));\r\n // dispatch(layoutActions.resetSidePanel());\r\n // } else {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // }\r\n // //dispatch(actions.setChangedState(false));\r\n // }\r\n // if (confirmRejected) {\r\n // dispatch(layoutActions.resetConfirmState());\r\n // }\r\n\r\n // return () => undefined;\r\n // }, [\r\n // actions,\r\n // appSettingsActions,\r\n // confirmApproved,\r\n // confirmRejected,\r\n // continueLink,\r\n // continueToOther,\r\n // dispatch,\r\n // edit,\r\n // layoutActions,\r\n // ]);\r\n const onBatchClick = React.useCallback(\r\n (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n let batchProps = {\r\n initialBatch: batch ?? undefined,\r\n queryParams: {\r\n id: '' + (batch?.Id ?? -1),\r\n stid: '' + serviceType,\r\n },\r\n saveCreatable: true,\r\n useSidePanel: true,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.InventoryBatch,\r\n renderPageProps: batchProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const leftActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n if (globalSettings.showCalcPriceOnOfflineService && !edit) {\r\n actions.push(() => (\r\n }\r\n title={t(translations.CalculatePricing_info) as string}\r\n onClick={handleCalculateCredit}\r\n disabled={creditProccessing}\r\n processing={creditProccessing}\r\n >\r\n {t(translations.CalculatePricing)}\r\n \r\n ));\r\n }\r\n return actions;\r\n }, [\r\n busy,\r\n creditProccessing,\r\n edit,\r\n globalSettings.showCalcPriceOnOfflineService,\r\n handleCalculateCredit,\r\n handleSaveClick,\r\n requestCompleted,\r\n t,\r\n ]);\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCloselClick, t]);\r\n const topButtons: ActionRenderer[] = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n if (serviceSettings.chargesViewAllowed && edit && hasCharges) {\r\n actions.push(() => (\r\n \r\n history.push(\r\n `/Charges?${toQueryString({\r\n refType: ReferenceType.OfflineService as number,\r\n refId: queryParams.id,\r\n }).toString()}`,\r\n )\r\n }\r\n variant=\"white\"\r\n shape=\"square\"\r\n />\r\n ));\r\n }\r\n return actions;\r\n }, [\r\n edit,\r\n hasCharges,\r\n history,\r\n queryParams.id,\r\n serviceSettings.chargesViewAllowed,\r\n t,\r\n ]);\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'otherServices/details', queryParams)}\r\n toPageLink={`otherServices/details?${toQueryString(queryParams)}`}\r\n rightActions={isReadOnlyUser ? [] : rightActions}\r\n confirm={\r\n showCalculateCredit ? (\r\n handleCalculateClose()}\r\n onClose={() => handleCalculateClose()}\r\n body={\r\n creditProccessing && !creditCompleted ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n {t(translations.Pricing_EstimatedCost)}\r\n \r\n \r\n {(t(\r\n edit\r\n ? translations.PricingConfirmationOfflineEditText1\r\n : translations.PricingConfirmationOfflineText1,\r\n ) as string).replace(\r\n '{0}',\r\n (credit?.credit || 0).toFixed(2),\r\n )}\r\n \r\n \r\n {!!credit?.balance && credit?.balance !== null && (\r\n \r\n \r\n {t(translations.Pricing_Balance)}\r\n \r\n \r\n {(t(\r\n translations.Pricing_BalanceResult,\r\n ) as string).replace(\r\n '{0}',\r\n (credit?.balance || 0).toFixed(2),\r\n )}\r\n \r\n \r\n )}\r\n \r\n )\r\n }\r\n maxWidth={'sm'}\r\n />\r\n ) : (\r\n <>\r\n )\r\n }\r\n isCover={isCover}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n coverClosed={coverClosed}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","import {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/PaymentMethodFilter/WithSystemSettings';\r\nexport interface PaymentMethodPickerProps\r\n extends Omit>, 'url'> {}\r\nexport const PaymentMethodPicker = (props: PaymentMethodPickerProps) => {\r\n return (\r\n \r\n );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n PaymentMethodPicker,\r\n PaymentMethodPickerProps,\r\n} from '../pickers/AutocompletePickers/PaymentMethodPicker';\r\n\r\nexport const FormPaymentMethodPicker = ({\r\n onChange,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n Omit) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined && meta?.touched}\r\n helperText={meta.error}\r\n {...props}\r\n />\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useRowSelect, PluginHook, Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Icon } from 'app/components//BasicIcons/FontAwesome';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport {\r\n getConditionalSelectColumnCheckboxProps,\r\n getConditionalSelectHeaderCheckboxProps,\r\n} from './ConditionalSelectHeaderCheckbox';\r\nimport { defaultCheckIfRowIsSelectable } from './index';\r\n\r\n/**\r\n * Adds useRowSelect with the checkboxes in the first column\r\n * @param tablePlugins table plugins array passed into useTable\r\n * @param isRowSelectable controls row select-ability\r\n * @param onSelectedChange\r\n */\r\nexport function addRowSelect(\r\n tablePlugins: PluginHook[],\r\n isRowSelectable?: (row: Row) => boolean,\r\n onSelectedChange?: (row: TRow, checked: boolean) => void,\r\n) {\r\n tablePlugins.push(useRowSelect);\r\n tablePlugins.push(hooks => {\r\n hooks.visibleColumns.push(columns => [\r\n // Let's make a column for selection\r\n {\r\n id: 'selection',\r\n disableSortBy: true,\r\n // The header can use the table's getToggleAllRowsSelectedProps method\r\n // to render a checkbox\r\n Header: props => {\r\n const checkboxProps = React.useMemo(() => {\r\n return getConditionalSelectHeaderCheckboxProps({\r\n headerProps: props,\r\n checkIfRowIsSelectable:\r\n isRowSelectable || defaultCheckIfRowIsSelectable,\r\n onSelectedChange: onSelectedChange,\r\n shouldSelectPage: false,\r\n });\r\n }, [props]);\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n },\r\n // The cell can use the individual row's getToggleRowSelectedProps method\r\n // to the render a checkbox\r\n Cell: ({ row }) => {\r\n if (!row.original.Rows || row.original.Rows.length <= 1) {\r\n const checkProps = getConditionalSelectColumnCheckboxProps({\r\n row: row,\r\n checkIfRowIsSelectable:\r\n isRowSelectable || defaultCheckIfRowIsSelectable,\r\n onSelectedChange: onSelectedChange,\r\n });\r\n\r\n if (!!isRowSelectable && !isRowSelectable(row)) {\r\n return <>;\r\n } else {\r\n return (\r\n e.stopPropagation()}\r\n style={{ padding: '3px', gap: '10px' }}\r\n >\r\n \r\n \r\n );\r\n }\r\n }\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n },\r\n },\r\n ...columns,\r\n ]);\r\n });\r\n}\r\n","import { HeaderProps, Row } from 'react-table';\r\nimport { IRow } from '.';\r\n\r\ninterface GetConditionalSelectHeaderCheckboxProps {\r\n /** react-table's header props */\r\n headerProps: React.PropsWithChildren>;\r\n /** A predicate - based on your business logic - to determine whether a given row should be selectable */\r\n checkIfRowIsSelectable: (row: Row) => boolean;\r\n /** Whether to allow page selection. Default: true */\r\n shouldSelectPage?: boolean;\r\n onSelectedChange?: (row: TRow, checked: boolean) => void;\r\n}\r\n\r\n/**\r\n * A convenience method for react-table headers for allowing conditional select\r\n * @param headerProps react-table's header props\r\n * @param checkIfRowIsSelectable A predicate - based on your business logic - to determine whether a given row should be selectable\r\n * @param shouldSelectPage Whether to allow page selection. Default: true\r\n * @returns Modified `checkboxProps` to enforce the conditional select\r\n */\r\nexport const getConditionalSelectHeaderCheckboxProps = ({\r\n headerProps,\r\n checkIfRowIsSelectable,\r\n onSelectedChange,\r\n shouldSelectPage = true,\r\n}: GetConditionalSelectHeaderCheckboxProps) => {\r\n // Note that in my comments I differentiate between the standard logic and the logic for the conditional select\r\n const checkIfAllSelectableRowsSelected = (rows: Row[]) =>\r\n rows.filter(checkIfRowIsSelectable).every(row => row.isSelected);\r\n // Standard: Here we define the selection type for the next click: Select Page / Select All\r\n const isSelectPage =\r\n shouldSelectPage &&\r\n headerProps.page\r\n // For conditional select: Filter the rows based on your business logic\r\n .filter(checkIfRowIsSelectable)\r\n // Standard: `isSelectPage === true` if some of the rows are not yet selected\r\n // This (standard) logic might be confusing to understand at first, but - as a side note - the idea is as follows:\r\n // This is the variable that defines whether the header props that will be received FOR THE NEXT CLICK will be for Select Page or for Select All\r\n // Try to play this out in your head:\r\n // - Initially, none of the rows are selected, so when we clicking the button initially, we will select only the (selectable) rows on the page (i.e. Select Page), hence the next click will be for Select All, hence `isSelectPage` will be `false`\r\n // - When clicking again, we will select the rest of the (selectable) rows (i.e. Select All). The next click will again be Select All (for de-selecting all), hence `isSelectPage` will be `false`\r\n // - Finally, when clicking again, we will de-select all rows. The next click will be for Select Page, hence `isSelectPage` will `true`\r\n .some(row => !row.isSelected);\r\n\r\n // Standard: Get the props based on Select Page / Select All\r\n const checkboxProps = isSelectPage\r\n ? headerProps.getToggleAllPageRowsSelectedProps()\r\n : headerProps.getToggleAllRowsSelectedProps();\r\n\r\n // For conditional select: The header checkbox should be:\r\n // - checked if all selectable rows are selected\r\n // - indeterminate if only some selectable rows are selected (but not all)\r\n const disabled = headerProps.rows.filter(checkIfRowIsSelectable).length === 0;\r\n const checked =\r\n !disabled && checkIfAllSelectableRowsSelected(headerProps.rows);\r\n const indeterminate =\r\n !checked && headerProps.rows.some(row => row.isSelected);\r\n\r\n // For conditional select: This is where the magic happens\r\n const onChange = () => {\r\n // If we're in Select All and all selectable rows are already selected: deselect all rows\r\n if (!isSelectPage && checkIfAllSelectableRowsSelected(headerProps.rows)) {\r\n headerProps.rows.forEach(row => {\r\n headerProps.toggleRowSelected(row.id, false);\r\n if (!!onSelectedChange) {\r\n onSelectedChange(row.original, checked);\r\n }\r\n });\r\n } else {\r\n // Otherwise:\r\n // First, define the rows to work with: if we're in Select Page, use `headerProps.page`, otherwise (Select All) use headerProps.rows\r\n const rows = isSelectPage ? headerProps.page : headerProps.rows;\r\n // Then select every selectable row\r\n rows.forEach(row => {\r\n const checked = checkIfRowIsSelectable(row);\r\n headerProps.toggleRowSelected(row.id, checked);\r\n if (!!onSelectedChange) {\r\n onSelectedChange(row.original, checked);\r\n }\r\n });\r\n }\r\n };\r\n\r\n // For conditional select: override checked, indeterminate and onChange - to enforce conditional select based on our business logic\r\n return {\r\n ...checkboxProps,\r\n checked,\r\n indeterminate,\r\n onChange,\r\n disabled,\r\n };\r\n};\r\ninterface GetConditionalSelectColumnCheckboxProps {\r\n /** react-table's header props */\r\n row: Row;\r\n /** A predicate - based on your business logic - to determine whether a given row should be selectable */\r\n checkIfRowIsSelectable: (row: Row) => boolean;\r\n onSelectedChange?: (row: TRow, checked: boolean) => void;\r\n}\r\n\r\nexport const getConditionalSelectColumnCheckboxProps = ({\r\n row,\r\n checkIfRowIsSelectable,\r\n onSelectedChange,\r\n}: GetConditionalSelectColumnCheckboxProps) => {\r\n const checkboxProps = row.getToggleRowSelectedProps();\r\n const disabled = !checkIfRowIsSelectable(row);\r\n const checked = row.isSelected;\r\n const onChange = (ev: React.ChangeEvent) => {\r\n const checked = ev.target.checked && checkIfRowIsSelectable(row);\r\n row.toggleRowSelected(checked);\r\n if (!!onSelectedChange) {\r\n onSelectedChange(row.original, checked);\r\n }\r\n };\r\n return {\r\n ...checkboxProps,\r\n checked,\r\n onChange,\r\n disabled,\r\n };\r\n};\r\n","export enum InvoiceFundingType {\r\n //All,\r\n FundingType_Internal = 0,\r\n FundingType_External = 1,\r\n}\r\n","export enum ScreenToShowOn {\r\n ShowOn_InvoicesList = 1,\r\n ShowOn_InvoiceBatches = 2,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BaseURLPicker } from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nconst url = '/api/odata/v4/InstrumentCatFilter';\r\nexport const initInstrumentCatData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return Promise.resolve([]);\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition>(\r\n 'Id',\r\n ODataOperators.Equals,\r\n initval,\r\n ).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport const InstrumentCatFilter = (props: IFilterComponentProps) => {\r\n const handleChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","import { UserMultiPicker } from 'app/components/pickers/AutocompletePickers/UserMultiPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const UserAssetContactMultiFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default UserAssetContactMultiFilter;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { VariantType } from 'notistack';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport const GetResponseMessages = (\r\n response,\r\n infoText: string,\r\n): IResponseType => {\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n if (response.SuccessMessages && response.SuccessMessages.length > 0) {\r\n response.SuccessMessages.forEach(element => {\r\n messages.SuccessMessages.push(element);\r\n });\r\n }\r\n if (response.ErrorMessages && response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(element => {\r\n messages.ErrorMessages.push(element);\r\n });\r\n }\r\n if (response.WarningMessages && response.WarningMessages.length > 0) {\r\n response.WarningMessages.forEach(element => {\r\n messages.WarningMessages.push(element);\r\n });\r\n }\r\n if (\r\n messages.SuccessMessages.length === 0 &&\r\n response.ErrorMessages.length === 0 &&\r\n response.WarningMessages.length === 0\r\n ) {\r\n messages.SuccessMessages = [infoText];\r\n }\r\n return messages;\r\n};\r\n\r\nconst GetMessagesArray = (response: IResponseType) => {\r\n const res: INotification[] = [];\r\n if (response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(errmsg =>\r\n res.push({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n response.SuccessMessages.forEach(sccmsg =>\r\n res.push({\r\n variant: 'success',\r\n message: sccmsg,\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n response.WarningMessages.forEach(wrnmsg =>\r\n res.push({\r\n variant: 'warning',\r\n message: wrnmsg,\r\n }),\r\n );\r\n }\r\n return res;\r\n};\r\n\r\nexport const DoAction1 = (\r\n f: (item: Model) => Promise,\r\n item: Model,\r\n t: TFunction,\r\n): Promise => {\r\n return new Promise((resolve, reject) => {\r\n return f(item)\r\n .then(response => {\r\n const messages: IResponseType = GetResponseMessages(\r\n response,\r\n t(translations.Success) as string,\r\n );\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(translations.Failed) as string;\r\n reject(err);\r\n });\r\n });\r\n};\r\n\r\nexport interface INotification {\r\n variant?: VariantType;\r\n message: string;\r\n}\r\n\r\nexport const DoAction = async (\r\n f: (item: Model) => Promise,\r\n item: Model,\r\n t: TFunction,\r\n handleSubmitCallResult: (values: INotification[]) => void,\r\n) => {\r\n try {\r\n const response = await DoAction1(f, item, t);\r\n handleSubmitCallResult(GetMessagesArray(response));\r\n } catch (error) {\r\n handleSubmitCallResult([\r\n {\r\n variant: 'error',\r\n message: error as string,\r\n },\r\n ]);\r\n }\r\n};\r\n\r\nexport const insertUserAD = (item: { Name: string }) => {\r\n const params = { Id: -1, Name: item.Name };\r\n return httpClient.post(`/api/odata/v4/UsersADImport`, params);\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { PeriodTypes } from 'app/components/DatePeriods';\r\n\r\nexport interface UpdateModel {\r\n Async: boolean;\r\n Recalculate: boolean;\r\n Item: {\r\n ServiceGroupsCsv: string;\r\n UserGroupsCsv?: string;\r\n PeriodType?: PeriodTypes;\r\n Start: string;\r\n End: string;\r\n Remarks: string;\r\n BudgetIds: number[];\r\n BudgetIncluded?: boolean;\r\n invoiceBy?: number;\r\n CoreInvoiceBy: string;\r\n InvoiceCreatedBy: string;\r\n InvoiceVat: string;\r\n FundingTypeId?: number;\r\n CoreBy: number;\r\n ShowZeroAmountInvoices?: boolean;\r\n ShowInvoicePartialEvents: boolean;\r\n };\r\n}\r\nexport class BillingPreviewApi {\r\n FormView1_UpdateItem = (item: UpdateModel) => {\r\n return httpClient.post(`/api/odata/v4/BillingPreview`, item);\r\n };\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { AlignRight } from '../AlignRight';\r\n\r\nconst PercentageRenderer: Renderer>> = ({\r\n value,\r\n}: {\r\n value: number | null;\r\n}) => (value === null ? null : {value?.toFixed(2)} %);\r\n\r\nexport default PercentageRenderer;\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.labelPrint || initialState;\r\n\r\nexport const selectLabelPrint = createSelector([selectSlice], state => state);\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nconst DateTimeRenderer: Renderer>> = ({\r\n value,\r\n}) => <>{dateUtils.shortDateTimeFormat(value)};\r\nexport default DateTimeRenderer;\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { Link as MuiLink, styled } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useArticlesSlice } from 'app/pages/ArticlesPage/slice';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nconst TruncatedLabel = styled('span')({\r\n width: '30ch',\r\n display: 'inline-block',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n});\r\n\r\nexport const ArticleLink = (props: {\r\n value?: IArticleDto;\r\n Id?: number;\r\n externalId?: string;\r\n externalIdSource?: string;\r\n children: React.ReactNode;\r\n title?: string;\r\n useSidePanel?: boolean;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useArticlesSlice();\r\n const openArticle = useOpenArticlePopUp();\r\n const open = () => {\r\n if (props.Id === 0) {\r\n dispatch(actions.clearArticleDetails());\r\n }\r\n openArticle(\r\n {\r\n value: props.value,\r\n Id: props.Id,\r\n externalId: props.externalId,\r\n externalIdSource: props.externalIdSource,\r\n useSidePanel: props.useSidePanel,\r\n },\r\n props.openPanelWithCover,\r\n );\r\n };\r\n return (\r\n \r\n \r\n open()}\r\n color=\"textPrimary\"\r\n >\r\n {props.children}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const useOpenArticlePopUp = () => {\r\n const { openPanel } = useSidePanelState();\r\n return React.useCallback(\r\n (\r\n props: {\r\n value?: IArticleDto;\r\n Id?: number;\r\n externalId?: string;\r\n externalIdSource?: string;\r\n useSidePanel?: boolean;\r\n },\r\n openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n ) => {\r\n const panelState = {\r\n renderPageType: RenderPageType.Article,\r\n renderPageProps: props,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n } as SidePanelOpenState;\r\n if (!!openPanelWithCover) {\r\n openPanelWithCover(panelState);\r\n } else {\r\n openPanel({\r\n renderPageType: RenderPageType.Article,\r\n renderPageProps: props,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState);\r\n }\r\n },\r\n [openPanel],\r\n );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\nexport const DurationRenderer: Renderer>> = ({\r\n value,\r\n}) => {\r\n const { t } = useTranslation();\r\n if (value === null || value === undefined) {\r\n return t(translations.NA);\r\n }\r\n let totalSeconds = parseInt(value);\r\n if (isNaN(totalSeconds)) {\r\n return t(translations.NA);\r\n }\r\n const hours = Math.floor(totalSeconds / 3600);\r\n totalSeconds -= hours * 3600;\r\n const minutes = Math.floor(totalSeconds / 60);\r\n totalSeconds -= minutes * 60;\r\n const seconds = totalSeconds;\r\n\r\n return [hours, minutes, seconds]\r\n .map(f => String(f).padStart(2, '0'))\r\n .join(':');\r\n};\r\nexport default DurationRenderer;\r\n","export enum DeatilsOperations {\r\n add,\r\n edit,\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.internalIdLogin || initialState;\r\n\r\nexport const selectInternalIdLogin = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\nexport const selectInternalIdLoginUserId = createSelector(\r\n [selectInternalIdLogin],\r\n state => state.identity?.Id,\r\n);\r\nexport const selectInternalIdLoginUserName = createSelector(\r\n [selectInternalIdLogin],\r\n state => state.identity?.Name,\r\n);\r\nexport const selectLoginType = createSelector(\r\n [selectSlice],\r\n state => state.identity?.LoginType,\r\n);\r\n","/**\r\n *\r\n * CustomPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { CustomPicker } from 'app/components/pickers/CustomPicker';\r\n\r\nexport interface CustomPickerFilterProps extends IFilterComponentProps {\r\n disabled?: boolean;\r\n placeholder?: string;\r\n}\r\nexport function CustomPickerFilter(props: CustomPickerFilterProps) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n []}\r\n isOpen={props.open}\r\n onChange={handleOnChange}\r\n size=\"small\"\r\n placeholder={\r\n props.placeholder !== undefined\r\n ? props.placeholder\r\n : t(translations.AllValues)\r\n }\r\n ariaLabel={props.label}\r\n id={props.id}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n );\r\n}\r\nexport default CustomPickerFilter;\r\n","/**\r\n *\r\n * CustomPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nexport interface CustomPickerProps\r\n extends Omit>, 'loadData'> {\r\n disabled?: boolean;\r\n}\r\nexport const initCustomPicker = (initval: string | undefined) => {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n};\r\nexport function CustomPicker(props: CustomPickerProps) {\r\n const loadData = () => {\r\n const options =\r\n props.customData !== undefined\r\n ? ((props.customData as unknown) as Entity[])\r\n : ([] as Entity[]);\r\n return Promise.resolve[]>(options);\r\n };\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.publicAsset || initialState;\r\n\r\nexport const selectPublicAsset = createSelector([selectSlice], state => state);\r\n\r\nexport const selectPublicAssetProcessing = createSelector(\r\n [selectPublicAsset],\r\n state => state.processing,\r\n);\r\n\r\nexport const selectSelectedUnitItem = createSelector(\r\n [selectPublicAsset],\r\n state => state.data,\r\n);\r\nexport const selectSelectedUnits = createSelector(\r\n [selectPublicAsset],\r\n state => state.selectedData,\r\n);\r\nexport const selectSelectedUnitSearch = createSelector(\r\n [selectPublicAsset],\r\n state => state.dataSearch,\r\n);\r\nexport const selectAssetPublicFilter = createSelector(\r\n [selectPublicAsset],\r\n state => state.filters,\r\n);\r\nexport const selectMenuOpen = createSelector(\r\n [selectPublicAsset],\r\n state => state.menuOpen,\r\n);\r\nexport const selectGlobalSearchOpen = createSelector(\r\n [selectPublicAsset],\r\n state => state.globalSearchOpen,\r\n);\r\n","/**\r\n *\r\n * ServiceTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ServiceTypePicker } from 'app/components/pickers/AutocompletePickers/ServiceTypePicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ServiceTypeFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n additionalItem={props.additionalItem as Entity | undefined}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default ServiceTypeFilter;\r\n","import { Entity } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\nimport { EmailTypeUnion } from './odata/generated/enums/EmailType';\r\nconst url = '/api/odata/v4/email';\r\nexport const EmailApi = {\r\n SendEmail: ({ Files, Bcc, Cc, To, ...data }: IEmail) => {\r\n const form = new FormData();\r\n Object.keys(data).forEach(k => {\r\n form.append(k, data[k]);\r\n });\r\n form.append('Bcc', Bcc.map(v => v.Id) as any);\r\n form.append('Cc', Cc.map(v => v.Id) as any);\r\n form.append('To', To.map(v => v.Id) as any);\r\n\r\n for (let i = 0; !!Files && i < Files?.length; i++) {\r\n let item = Files?.item(i);\r\n if (!!item) {\r\n form.append('file' + i, item);\r\n }\r\n }\r\n return httpClient.post(url, form);\r\n },\r\n};\r\n\r\nexport interface IEmail {\r\n Id?: number;\r\n Type: EmailTypeUnion;\r\n To: Entity[];\r\n ExtraTo?: string;\r\n Cc: Entity[];\r\n ExtraCc?: string;\r\n Bcc: Entity[];\r\n ExtraBcc?: string;\r\n Subject: string;\r\n Body?: string;\r\n Files?: FileList;\r\n SaveToLog: boolean;\r\n SaveAsTemlate?: boolean;\r\n ServiceGroup?: number;\r\n}\r\n","import { EmailApi, IEmail } from 'api/EmailApi';\r\nimport { extractErrorMessages } from 'api/utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { useResponseModel } from './useResponseModel';\r\n\r\nexport const useSendMail = (setBusy?: (busy: boolean) => void) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { t } = useTranslation();\r\n const response = useResponseModel();\r\n\r\n return useCallback(\r\n (email: IEmail) => {\r\n try {\r\n setBusy?.(true);\r\n EmailApi.SendEmail(email)\r\n .then(v => {\r\n const value = v as IResponseType;\r\n response(value);\r\n })\r\n .catch(e => {\r\n //console.log(e);\r\n const error = extractErrorMessages(e);\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: !!error\r\n ? error[0]\r\n : (t(translations.err_SendEmailToUserFailed) as string),\r\n }),\r\n );\r\n setBusy?.(false);\r\n })\r\n .finally(() => setBusy?.(false));\r\n } catch (e) {\r\n const error = extractErrorMessages(e);\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: !!error\r\n ? error[0]\r\n : (t(translations.err_SendEmailToUserFailed) as string),\r\n }),\r\n );\r\n setBusy?.(false);\r\n }\r\n },\r\n [actions, dispatch, response, setBusy, t],\r\n );\r\n};\r\n","/**\r\n *\r\n * UserDisciplineFilter\r\n *\r\n */\r\nimport { UserDisciplinePicker } from 'app/components/pickers/AutocompletePickers/UserDisciplinePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserDisciplineFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n onChange={handleOnChange}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default UserDisciplineFilter;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceUserGroupPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ServiceUserGroupFilter';\r\nexport const initServiceUserGroupData = (initval: string) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition>(\r\n 'Id',\r\n ODataOperators.Equals,\r\n initval,\r\n ).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nconst loadData = (\r\n searchTerm: string | null,\r\n predicates?: (string | Condition>)[],\r\n) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null || (predicates && predicates.length > 0)) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates ?? [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm ?? '',\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function ServiceUserGroupPicker(props: ServiceUserGroupPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * InfoIcon\r\n *\r\n */\r\nimport React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Tooltip, TooltipsProps } from '../BasicTooltips/Tooltip';\r\n\r\nexport interface InfoIconProps extends Pick {}\r\n\r\nexport const InfoIcon = React.memo(function BookitlabLoginLogo(\r\n props: InfoIconProps,\r\n) {\r\n const classes = useStyles();\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n});\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n marginLeft: '1ch',\r\n // root css\r\n },\r\n }),\r\n);\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport * as React from 'react';\r\nimport { savedViewsApi as api } from 'api/savedViewsApi';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useSavedViewSlice } from '../SavedViewPage/slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Entity } from 'types/common';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ListItem, MenuItem } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SavedViewDetailsProps } from '../SavedViewPage/Details';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n selectUpdateSavedViewCompleted,\r\n selectUpdateSavedViewHasError,\r\n} from '../SavedViewPage/slice/selectors';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface AddToListsProps {\r\n rows: TRow[];\r\n getEquipments: (rows: TRow[]) => Entity[];\r\n getAssets: (rows: TRow[]) => Promise[]>;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function AddToLists({\r\n rows,\r\n getEquipments,\r\n getAssets,\r\n useSidePanel,\r\n}: AddToListsProps) {\r\n const { t } = useTranslation();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const { openPanel } = useSidePanelState();\r\n const isAdmin = React.useMemo(() => {\r\n return (\r\n user !== undefined &&\r\n (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n user.Roles.indexOf(Roles.LabTech) >= 0)\r\n );\r\n }, [user]);\r\n const dispatch = useDispatch();\r\n const [myViews, setMyViews] = React.useState([]);\r\n const savedActions = useSavedViewSlice();\r\n const [, setLoadingCompleted] = React.useState(false);\r\n const requestUpdateCompleted = useSelector(selectUpdateSavedViewCompleted);\r\n const hasUpdateError = useSelector(selectUpdateSavedViewHasError);\r\n const [input, setInnput] = React.useState();\r\n const options = myViews.filter((item, index) =>\r\n item.Name.toLowerCase().includes((input || '').toLowerCase()),\r\n );\r\n\r\n useEffectOnMount(() => {\r\n api\r\n .getMySavedViews({\r\n user: user,\r\n serviceGroups: undefined,\r\n isAdmin: isAdmin,\r\n onlyMyView: true,\r\n })\r\n .then(response => {\r\n setMyViews(() => {\r\n return response || [];\r\n });\r\n setLoadingCompleted(true);\r\n });\r\n return () => {};\r\n });\r\n const openDetailsList = React.useCallback(\r\n (id?: number) => {\r\n let params = {\r\n id: id,\r\n useSidePanel: true,\r\n eid: getEquipments(rows)\r\n .map(f => f.Id)\r\n .join(','),\r\n } as SavedViewDetailsProps;\r\n openPanel({\r\n renderPageType: RenderPageType.SavedViewDetails,\r\n renderPageProps: params,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [getEquipments, openPanel, rows, useSidePanel],\r\n );\r\n const updateAssets = React.useCallback(\r\n (id: number) => {\r\n let view = myViews.filter(f => f.Id === id)[0];\r\n getAssets(rows).then(assets => {\r\n dispatch(\r\n savedActions.actions.updateViewAssets({\r\n assets: assets,\r\n view: view,\r\n }),\r\n );\r\n });\r\n },\r\n [dispatch, getAssets, myViews, rows, savedActions.actions],\r\n );\r\n React.useEffect(() => {\r\n let active = requestUpdateCompleted && !hasUpdateError;\r\n if (active) {\r\n dispatch(savedActions.actions.resetUpdateSavedViewState());\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [dispatch, hasUpdateError, requestUpdateCompleted, savedActions.actions]);\r\n return (\r\n [\r\n \r\n \r\n }\r\n value={input || ''}\r\n aria-label={t(translations.SearchFilter)}\r\n inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n onChange={e => setInnput(e.target.value)}\r\n autoFocus\r\n fullWidth\r\n />\r\n ,\r\n \r\n }\r\n onClick={() => {\r\n openDetailsList();\r\n onClose();\r\n }}\r\n >\r\n {t(translations.CreateList)}\r\n \r\n ,\r\n ...options.map(s => (\r\n {\r\n updateAssets(s.Id);\r\n onClose();\r\n }}\r\n >\r\n {s.Name}\r\n \r\n )),\r\n ]}\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n },\r\n transformOrigin: {\r\n vertical: 'top',\r\n horizontal: 'left',\r\n },\r\n getContentAnchorEl: null,\r\n }}\r\n addChevron\r\n >\r\n {t(translations.AddToList)}\r\n \r\n );\r\n}\r\n","import { List, ListItem } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface ListRendererProps {\r\n value: string[];\r\n localized?: boolean;\r\n notLocalizedValue?: string[];\r\n row?: any;\r\n}\r\n\r\nexport const ListRenderer = (props: ListRendererProps) => {\r\n const { value, localized, notLocalizedValue } = props;\r\n const { t } = useTranslation();\r\n const onlyone =\r\n (value.length === 1 &&\r\n (notLocalizedValue === undefined || notLocalizedValue.length === 0)) ||\r\n (value.length === 0 &&\r\n notLocalizedValue !== undefined &&\r\n notLocalizedValue.length === 1);\r\n\r\n const title = (\r\n \r\n {value.length > 0 ? (\r\n <>{localized ? (t(value[0].trim()) as string) : value[0].trim()}\r\n ) : notLocalizedValue !== undefined && notLocalizedValue.length > 0 ? (\r\n <>{notLocalizedValue[0].trim()}\r\n ) : (\r\n <>\r\n )}\r\n \r\n );\r\n\r\n const tooltipTitle = (\r\n \r\n \r\n {value.map((item, index) => {\r\n return (\r\n \r\n {localized ? (t(item.trim()) as string) : item.trim()}\r\n \r\n );\r\n })}\r\n {notLocalizedValue !== undefined\r\n ? notLocalizedValue.map((item, index) => {\r\n return {item.trim()};\r\n })\r\n : ''}\r\n \r\n \r\n );\r\n\r\n const listOfItems =\r\n value.length > 0 ||\r\n (notLocalizedValue !== undefined && notLocalizedValue.length > 0) ? (\r\n onlyone ? (\r\n <>{title}\r\n ) : (\r\n \r\n {title}\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n ) : (\r\n <>{''}\r\n );\r\n return listOfItems;\r\n};\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectReservationStatuses } from 'app/slice/selectors';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReservationStatusProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const initReservationStatusData = (t: TFunction) => (\r\n initialValue: string | undefined,\r\n) => {\r\n const id = initialValue === undefined ? NaN : parseInt(initialValue);\r\n if (isNaN(id)) {\r\n return Promise.resolve([] as Entity[]);\r\n } else {\r\n return Promise.resolve([\r\n {\r\n Id: id,\r\n Name: t(translations[ReservationStatus[id]]),\r\n },\r\n ]);\r\n }\r\n};\r\n\r\nexport function ReservationStatusPicker(props: ReservationStatusProps) {\r\n const { t } = useTranslation();\r\n const options = useSelector(state => selectReservationStatuses(state, t));\r\n const getOptions = React.useCallback(() => options, [options]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n RoomPicker,\r\n RoomsUrl,\r\n} from '../pickers/AutocompletePickers/RoomPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\n\r\nexport const FormRoomPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps & { variant?: 'standard' | 'filled' | 'outlined' } & {\r\n urlType?: RoomsUrl;\r\n withoutServiceGroups?: boolean;\r\n }) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value as IRoomDto}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n disabled={props.disabled}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n variant={props.variant}\r\n urlType={props.urlType}\r\n withoutServiceGroups={props.withoutServiceGroups}\r\n />\r\n \r\n );\r\n};\r\n","import { Dialog } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface PopupImportExportDialogProps {\r\n open: boolean;\r\n content: React.ReactNode;\r\n}\r\nexport function PopupImportExportDialog(props: PopupImportExportDialogProps) {\r\n return (\r\n \r\n \r\n {props.content}\r\n \r\n \r\n );\r\n}\r\n","export enum AutomaticAssetImportNaming {\r\n NA = 0,\r\n ByAssetCatModelNumber = 1,\r\n}\r\n","import { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as Excel from 'exceljs';\r\nimport { ValueType } from 'exceljs';\r\nimport Papa from 'papaparse';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ExportImportActions } from '../Actions';\r\nimport { ImportAdditionalData, ImportColumn } from '../Actions/Types';\r\nimport { AutomaticAssetImportNaming } from '../Components/Types';\r\n\r\nexport class CImportData {\r\n private _ScreenId!: ScreensId;\r\n private needReloadTemplateColumns!: boolean;\r\n private _ImportAssetImageFiles: boolean = false;\r\n private _AutoGenerateAssetNamesBasedOn: Entity | null = {\r\n Id: AutomaticAssetImportNaming.NA as number,\r\n Name: 'N/A',\r\n };\r\n private _UpdateQRCode: boolean = false;\r\n private _ImportAdditionalData: ImportAdditionalData =\r\n ImportAdditionalData.none;\r\n public TemplateColumns: Entity[] | undefined;\r\n public File: File | undefined;\r\n public Images: File[] | undefined;\r\n public RowCount: number | undefined;\r\n public Header: ImportColumn[] | undefined;\r\n public Table: string[][] | undefined;\r\n public AddOnly: boolean | undefined = false;\r\n book: Excel.Workbook;\r\n constructor() {\r\n this.book = new Excel.Workbook();\r\n }\r\n public get ScreenId() {\r\n return this._ScreenId;\r\n }\r\n public set ScreenId(screenId: ScreensId) {\r\n if (this._ScreenId !== screenId) {\r\n this.needReloadTemplateColumns = true;\r\n }\r\n this._ScreenId = screenId;\r\n }\r\n public get ImportAssetImageFiles() {\r\n return this._ImportAssetImageFiles;\r\n }\r\n public set ImportAssetImageFiles(value: boolean) {\r\n this._ImportAssetImageFiles = value;\r\n }\r\n public get AutoGenerateAssetNamesBasedOn() {\r\n return this._AutoGenerateAssetNamesBasedOn;\r\n }\r\n public set AutoGenerateAssetNamesBasedOn(value: Entity | null) {\r\n this._AutoGenerateAssetNamesBasedOn = value;\r\n }\r\n public get UpdateQRCode() {\r\n return this._UpdateQRCode;\r\n }\r\n public set UpdateQRCode(value: boolean) {\r\n this._UpdateQRCode = value;\r\n }\r\n public get ImportAdditionalData() {\r\n return this._ImportAdditionalData;\r\n }\r\n public set ImportAdditionalData(value: ImportAdditionalData) {\r\n this._ImportAdditionalData = value;\r\n }\r\n public ColumnCount() {\r\n var count: number = 0;\r\n if (this.Header !== undefined) {\r\n this.Header.forEach(c => {\r\n if (c.Include) {\r\n count++;\r\n }\r\n });\r\n }\r\n return count;\r\n }\r\n private Clear() {\r\n this.AddOnly = false;\r\n this.RowCount = undefined;\r\n this.Header = undefined;\r\n this.Table = undefined;\r\n }\r\n Init(File: File) {\r\n this.File = File;\r\n this.Clear();\r\n }\r\n ClearImages() {\r\n this.Images = undefined;\r\n }\r\n AddImages(Files: File[]) {\r\n if (this.Images === undefined) {\r\n this.Images = Files;\r\n } else {\r\n for (const f of Files) {\r\n const ff = this.Images.find(v => v.name === f.name);\r\n if (ff === undefined) {\r\n this.Images.push(f);\r\n }\r\n }\r\n }\r\n }\r\n RemoveImage(name: string) {\r\n if (this.Images !== undefined) {\r\n const fi = this.Images.findIndex(v => v.name === name);\r\n if (fi >= 0) {\r\n this.Images.splice(fi, 1);\r\n }\r\n }\r\n }\r\n LoadTemplateColumns(): Promise {\r\n if (\r\n this.needReloadTemplateColumns ||\r\n this.TemplateColumns === undefined ||\r\n this.TemplateColumns.length === 0\r\n ) {\r\n if (this.ScreenId !== undefined) {\r\n this.needReloadTemplateColumns = false;\r\n return ExportImportActions.TemplateColumns(\r\n this.ScreenId,\r\n this.ImportAdditionalData,\r\n );\r\n } else {\r\n return Promise.resolve();\r\n }\r\n } else {\r\n return Promise.resolve();\r\n }\r\n }\r\n public InitHeaderByTemplate() {\r\n if (this.TemplateColumns !== undefined && this.TemplateColumns.length > 0) {\r\n this.Header?.forEach((hvalue, cn) => {\r\n const v = this.TemplateColumns?.find(tvalue => {\r\n return tvalue.Name === hvalue.ExcelName;\r\n });\r\n if (this.Header !== undefined && v !== undefined) {\r\n this.Header[cn].Name = v.Id;\r\n }\r\n });\r\n }\r\n }\r\n SetTemplateColumns(values: Entity[] | undefined) {\r\n if (values !== undefined) {\r\n this.TemplateColumns = values.map(value => {\r\n return {\r\n Id: value.Id,\r\n //Name: value.hasCustomName ? value.CustomName : value.DisplayName,\r\n Name: value.Name,\r\n };\r\n });\r\n this.InitHeaderByTemplate();\r\n }\r\n }\r\n private GetCellData(cell: Excel.Cell): string {\r\n let value: any;\r\n if (cell.value === undefined) {\r\n return '';\r\n } else {\r\n value = cell.value;\r\n }\r\n switch (cell.type) {\r\n case ValueType.Null:\r\n return '';\r\n case ValueType.Number:\r\n case ValueType.String:\r\n case ValueType.Boolean:\r\n case ValueType.SharedString:\r\n case ValueType.Formula:\r\n case ValueType.RichText:\r\n return value.toString();\r\n case ValueType.Date:\r\n const d = dateUtils.shortDateTimeFormat(value);\r\n return d !== null ? d : '';\r\n case ValueType.Hyperlink:\r\n return value.text;\r\n case ValueType.Error:\r\n return '';\r\n default:\r\n return '';\r\n }\r\n }\r\n LoadXlsx(): Promise {\r\n if (this.File !== undefined) {\r\n var reader: any;\r\n reader = this.book.xlsx;\r\n return reader\r\n .load(this.File)\r\n .then(() => {\r\n const ws = this.book.getWorksheet(1);\r\n this.RowCount = ws.rowCount - 1;\r\n const row1 = ws.getRow(1);\r\n this.Header = [];\r\n row1.eachCell((cell, cn) => {\r\n this.Header?.push({\r\n Include: true,\r\n ExcelName: cell.value?.toString(),\r\n Name: undefined,\r\n });\r\n });\r\n if (this.Header !== undefined && this.Header.length) {\r\n this.InitHeaderByTemplate();\r\n const rc = ws.rowCount < 7 ? ws.rowCount + 1 : 7;\r\n this.Table = [];\r\n for (let i = 2; i < rc; i++) {\r\n const row = ws.getRow(i);\r\n // init tr\r\n let tr: string[] = this.Header.map(() => '');\r\n row.eachCell((cell, cn) => {\r\n const s = this.GetCellData(cell);\r\n tr[cn - 1] = s !== undefined ? s : '';\r\n });\r\n this.Table?.push(tr);\r\n }\r\n return true;\r\n }\r\n })\r\n .catch(err => {\r\n console.log(err.message);\r\n });\r\n } else {\r\n this.Clear();\r\n return Promise.resolve();\r\n }\r\n }\r\n\r\n LoadCsv(): Promise {\r\n if (this.File !== undefined) {\r\n const file = this.File;\r\n return new Promise((resolve, reject) => {\r\n Papa.parse(file, {\r\n header: true,\r\n dynamicTyping: true,\r\n complete: results => {\r\n this.RowCount = results.data.length - 1;\r\n const row1 = results.meta.fields;\r\n this.Header = [];\r\n row1?.forEach((cell, cn) => {\r\n this.Header?.push({\r\n Include: true,\r\n ExcelName: cell,\r\n Name: undefined,\r\n });\r\n });\r\n this.InitHeaderByTemplate();\r\n const rc = this.RowCount < 6 ? this.RowCount : 5;\r\n this.Table = [];\r\n for (let i = 0; i < rc; i++) {\r\n const obj = results.data[i] as {};\r\n if (obj !== undefined) {\r\n const d = Object.keys(obj).map(key => {\r\n const v = obj[key];\r\n if (typeof v === 'boolean') return v.toString();\r\n else return v;\r\n });\r\n this.Table?.push(d);\r\n }\r\n }\r\n resolve(true);\r\n },\r\n error: error => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n } else {\r\n this.Clear();\r\n return Promise.resolve();\r\n }\r\n }\r\n\r\n LoadExcelfile(): Promise {\r\n if (this.File !== undefined) {\r\n const ext = this.File.name.split('.').pop();\r\n switch (ext) {\r\n case 'xlsx':\r\n return this.LoadXlsx();\r\n case 'csv':\r\n return this.LoadCsv();\r\n default:\r\n this.Clear();\r\n return Promise.resolve();\r\n }\r\n } else {\r\n this.Clear();\r\n return Promise.resolve();\r\n }\r\n }\r\n}\r\nexport const ImprotData = new CImportData();\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\n//import fileDownload from 'js-file-download';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\n//import { Button } from 'app/components/BasicButtons/Button';\r\nimport { ImprotData } from '../Data';\r\n\r\nexport interface SelectFileProps {\r\n accept: any;\r\n downloadFileName?: string;\r\n filesPlaceholder: React.ReactNode;\r\n selectFileHandler: (value: boolean) => void;\r\n}\r\n\r\n/**\r\n * Multiline text field with and option to update value by dropping a file\r\n * @param param0\r\n * @returns\r\n */\r\nexport const SelectFile = ({\r\n label,\r\n onBlur,\r\n value,\r\n name,\r\n error,\r\n helperText,\r\n accept,\r\n downloadFileName,\r\n filesPlaceholder,\r\n selectFileHandler,\r\n ...props\r\n}: FieldHookConfig & TextFieldProps & SelectFileProps) => {\r\n const onDrop = React.useCallback(\r\n (acceptedFiles: File[]) => {\r\n // Do something with the files\r\n const file = acceptedFiles[0];\r\n ImprotData.Init(file);\r\n selectFileHandler(file !== undefined);\r\n },\r\n [selectFileHandler],\r\n );\r\n\r\n const { acceptedFiles, getRootProps, getInputProps } = useDropzone({\r\n onDrop,\r\n maxFiles: 1,\r\n maxSize: 1000000,\r\n accept: {\r\n 'application/imp': [accept],\r\n },\r\n });\r\n\r\n const files = acceptedFiles.map(file => (\r\n
  • \r\n {file.name} - {file.size} bytes\r\n
  • \r\n ));\r\n\r\n /*const handleDownloadClick = () => {\r\n if (downloadFileName !== undefined && fileContent !== null) {\r\n fileDownload(fileContent, downloadFileName);\r\n }\r\n };*/\r\n\r\n return (\r\n <>\r\n \r\n \r\n

    {filesPlaceholder}

    \r\n
    \r\n \r\n \r\n );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n flex: 1,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n padding: '20px',\r\n borderWidth: '2px',\r\n borderRadius: '2px',\r\n borderColor: theme.palette.common.grayBorders,\r\n borderStyle: 'dashed',\r\n backgroundColor: theme.palette.background.paper,\r\n color: '#bdbdbd',\r\n outline: 'none',\r\n transition: 'border .24s ease-in-out',\r\n}));\r\n","import * as React from 'react';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nexport function TypePicker(props) {\r\n return (\r\n \r\n Promise.resolve(['.xlsx', '.csv'].map(s => ({ Id: s, Name: s })))\r\n }\r\n variant=\"filled\"\r\n fullWidth\r\n {...props}\r\n />\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AutomaticAssetImportNaming } from './Types';\r\n\r\nexport function AutomaticAssetImportNamingPicker(props) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n return (\r\n \r\n Promise.resolve([\r\n { Id: AutomaticAssetImportNaming.NA as number, Name: 'N/A' },\r\n {\r\n Id: AutomaticAssetImportNaming.ByAssetCatModelNumber as number,\r\n Name: t(translations.ByAssetCatModelNumber),\r\n },\r\n ])\r\n }\r\n variant=\"filled\"\r\n fullWidth\r\n {...props}\r\n />\r\n );\r\n}\r\n","import { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport './styles.css';\r\nexport interface FileSize {\r\n size: number;\r\n name: string;\r\n}\r\nexport interface Image {\r\n name: string;\r\n path: string;\r\n size: FileSize;\r\n}\r\nexport interface ImageListProps {\r\n data: Image[] | undefined;\r\n removeImage: (name: string) => void;\r\n}\r\nexport const ImageList = (props: ImageListProps) => {\r\n const { t } = useTranslation();\r\n const data: Image[] = props.data !== undefined ? props.data : [];\r\n return (\r\n <>\r\n {data.length > 0 ? (\r\n \r\n {data.map(value => (\r\n <>\r\n \r\n {\r\n props.removeImage(value.name);\r\n }}\r\n size=\"small\"\r\n >\r\n \r\n \r\n {value.name +\r\n ' - ' +\r\n value.size.size.toString() +\r\n ' ' +\r\n value.size.name}\r\n \r\n
    \r\n \r\n
    \r\n \r\n ))}\r\n \r\n ) : (\r\n <>\r\n )}\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport { ImprotData } from '../Data';\r\nimport { ImageList, Image, FileSize } from './ImageList';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExportImportActions } from '../Actions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport fileDownload from 'js-file-download';\r\nimport { AxiosError } from 'axios';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface SelectImageFilesProps {\r\n accept: any;\r\n filesPlaceholder: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Multiline text field with and option to update value by dropping a file\r\n * @param param0\r\n * @returns\r\n */\r\nconst getFileSize = (size): FileSize => {\r\n var string;\r\n if (size >= 1024 * 1024 * 1024 * 1024) {\r\n size = size / (1024 * 1024 * 1024 * 1024);\r\n string = 'TiB';\r\n } else if (size >= 1024 * 1024 * 1024) {\r\n size = size / (1024 * 1024 * 1024);\r\n string = 'GiB';\r\n } else if (size >= 1024 * 1024) {\r\n size = size / (1024 * 1024);\r\n string = 'MiB';\r\n } else if (size >= 1024) {\r\n size = size / 1024;\r\n string = 'KiB';\r\n } else {\r\n string = 'b';\r\n }\r\n return { size: Math.round(size), name: string };\r\n};\r\n\r\nexport const SelectImageFiles = ({\r\n label,\r\n onBlur,\r\n value,\r\n name,\r\n error,\r\n helperText,\r\n accept,\r\n filesPlaceholder,\r\n ...props\r\n}: FieldHookConfig & TextFieldProps & SelectImageFilesProps) => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const settings = useSelector(selectglobalSettings);\r\n const [importing, setImporting] = React.useState(false);\r\n const [paths, setPaths] = React.useState();\r\n const MaximumImagesPerOneUpload =\r\n tryParseInt(\r\n settings?.GetString(AllowedSettings.MaximumImagesPerOneUpload),\r\n ) ?? 10;\r\n const MaxImageSize =\r\n (tryParseInt(\r\n settings?.GetString(AllowedSettings.MaxLoadedAssetImageMbSize),\r\n ) ?? 1) *\r\n 1024 *\r\n 1024;\r\n const setImages = React.useCallback(() => {\r\n if (ImprotData.Images !== undefined) {\r\n setPaths(\r\n ImprotData.Images.map(file => {\r\n return {\r\n name: file.name,\r\n path: URL.createObjectURL(file),\r\n size: getFileSize(file.size),\r\n };\r\n }),\r\n );\r\n } else {\r\n setPaths(undefined);\r\n }\r\n }, []);\r\n React.useEffect(() => {\r\n setImages();\r\n }, [setImages]);\r\n const onDrop = React.useCallback(\r\n (acceptedFiles: File[]) => {\r\n ImprotData.AddImages(acceptedFiles);\r\n setImages();\r\n },\r\n [setImages],\r\n );\r\n const removeImage = React.useCallback(\r\n (name: string) => {\r\n ImprotData.RemoveImage(name);\r\n setImages();\r\n },\r\n [setImages],\r\n );\r\n\r\n const { getRootProps, getInputProps } = useDropzone({\r\n onDrop,\r\n maxFiles: MaximumImagesPerOneUpload,\r\n maxSize: MaxImageSize,\r\n accept: accept,\r\n });\r\n\r\n const importImages = React.useCallback(async () => {\r\n if (ImprotData.Images !== undefined) {\r\n setImporting(true);\r\n try {\r\n const res = await ExportImportActions.ImportImages(\r\n ImprotData.Images,\r\n ScreensId.MyAssets,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined\r\n ? cd.split('filename=')[1]\r\n : 'ExportForImport_Articles.xlsx';\r\n fileDownload(res.data, filename);\r\n ImprotData.ClearImages();\r\n setPaths(undefined);\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: 'Images loaded successfully !',\r\n }),\r\n );\r\n } catch (error) {\r\n if ((error as AxiosError).isAxiosError) {\r\n //var errorCode = (error as AxiosError).response?.status;\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: error as string,\r\n }),\r\n );\r\n }\r\n }\r\n setImporting(false);\r\n }\r\n }, [actions, dispatch]);\r\n\r\n return (\r\n <>\r\n
    \r\n {t(translations.RecommendationsOfLoadImages)}\r\n \r\n \r\n \r\n
    \r\n
    \r\n {t(translations.InformationToLoadImages)}\r\n \r\n \r\n \r\n
    \r\n \r\n \r\n

    {filesPlaceholder}

    \r\n
    \r\n \r\n \r\n \r\n {t(translations.LoadImages)}\r\n \r\n {\r\n ImprotData.ClearImages();\r\n setPaths(undefined);\r\n }}\r\n >\r\n {t(translations.ClearAll)}\r\n \r\n \r\n \r\n );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n flex: 1,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n padding: '20px',\r\n borderWidth: '2px',\r\n borderRadius: '2px',\r\n borderColor: theme.palette.common.grayBorders,\r\n borderStyle: 'dashed',\r\n backgroundColor: theme.palette.background.paper,\r\n color: '#bdbdbd',\r\n outline: 'none',\r\n transition: 'border .24s ease-in-out',\r\n}));\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { SelectFile } from './SelectFile';\r\nimport { TypePicker } from './TypePicker';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport { ImprotData } from '../Data';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { AutomaticAssetImportNamingPicker } from './AutomaticAssetImportNamingPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectAssetFieldSettings,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { AutomaticAssetNamings } from 'enums/enums';\r\nimport { SelectImageFiles } from './SelectImageFiles';\r\nimport { ImportAdditionalData } from '../Actions/Types';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n titleContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n },\r\n closeButton: {\r\n position: 'absolute',\r\n right: theme.spacing(3),\r\n top: theme.spacing(3),\r\n color: theme.palette.grey[500],\r\n },\r\n container: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n boxcontainer: {\r\n display: 'flex',\r\n width: '100%',\r\n height: '100%',\r\n },\r\n selectFileBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n },\r\n selectImageBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n },\r\n infoBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n padding: '10PX',\r\n backgroundColor: '#f0f9ff',\r\n },\r\n }),\r\n);\r\n\r\nexport interface PopupImportExportStep1Props {\r\n title: string;\r\n filetype: Entity | null;\r\n nextName: string;\r\n cancelName: string;\r\n ImportTenplateHandler: () => void;\r\n handleFileTypeChange: (value: Entity | null) => void;\r\n next: () => void;\r\n cancel: () => void;\r\n}\r\nexport function PopupImportExportStep1(props: PopupImportExportStep1Props) {\r\n const [filetype, setFiletype] = React.useState | null>(\r\n props.filetype,\r\n );\r\n const { t } = useTranslation();\r\n const [fileIsSelected, setFileIsSelected] = React.useState(false);\r\n const [importAssetImageFiles, setImportAssetImageFiles] = React.useState<\r\n boolean\r\n >(ImprotData.ImportAssetImageFiles);\r\n const classes = useStyles();\r\n const handleImportAssetImageFiles = React.useCallback((f: boolean) => {\r\n setImportAssetImageFiles(f);\r\n }, []);\r\n const handleFileTypeChange = React.useCallback(\r\n (value: Entity | null) => {\r\n setFiletype(value);\r\n props.handleFileTypeChange(value);\r\n },\r\n [props],\r\n );\r\n const selectFileHandler = React.useCallback((value: boolean) => {\r\n setFileIsSelected(value);\r\n }, []);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {props.title}

    \r\n
    \r\n \r\n \r\n {ImprotData.ScreenId === ScreensId.MyAssets &&\r\n ImprotData.ImportAdditionalData ===\r\n ImportAdditionalData.none && (\r\n \r\n )}\r\n {importAssetImageFiles === false && (\r\n <>\r\n \r\n \r\n {t(translations.BulkImportTitle)}\r\n \r\n \r\n }\r\n variant=\"white\"\r\n onClick={() => {\r\n props.ImportTenplateHandler();\r\n }}\r\n >\r\n {t(translations.GetTheTemplate)}\r\n \r\n \r\n \r\n )}\r\n
    \r\n \r\n \r\n \r\n
    \r\n \r\n {importAssetImageFiles === false && (\r\n \r\n \r\n \r\n {props.cancelName}\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n\r\ninterface AssetPropertiesProps {\r\n ImportAssetImageFiles: (f: boolean) => void;\r\n}\r\nfunction AssetProperties(props: AssetPropertiesProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const [importAssetImageFiles, setImportAssetImageFiles] = React.useState<\r\n boolean\r\n >(ImprotData.ImportAssetImageFiles);\r\n const [\r\n autoGenerateAssetNamesBasedOn,\r\n setAutoGenerateAssetNamesBasedOn,\r\n ] = React.useState | null>(\r\n ImprotData.AutoGenerateAssetNamesBasedOn,\r\n );\r\n const [updateQRCode, setUpdateQRCode] = React.useState(\r\n ImprotData.UpdateQRCode,\r\n );\r\n const classes = useStyles();\r\n //const appSettings = useSelector(selectAppSettings);\r\n const app = useSelector(selectAssetFieldSettings);\r\n\r\n const showInternalCode = React.useMemo(\r\n () => app[AssetAttributes.InternalCode]?.Enabled === true,\r\n [app],\r\n );\r\n\r\n const settings = useSelector(selectglobalSettings);\r\n\r\n const ImportAssetAutoNaming = settings.GetString(\r\n AllowedSettings.AutomaticAssetNamings,\r\n );\r\n\r\n const handleImageChange = React.useCallback(\r\n event => {\r\n const value = event.target.checked;\r\n ImprotData.ImportAssetImageFiles = value;\r\n setImportAssetImageFiles(value);\r\n props.ImportAssetImageFiles(value);\r\n },\r\n [props],\r\n );\r\n const handleAutoNameingChange = React.useCallback(\r\n (value: Entity | null) => {\r\n ImprotData.AutoGenerateAssetNamesBasedOn = value;\r\n setAutoGenerateAssetNamesBasedOn(value);\r\n },\r\n [],\r\n );\r\n const handleUpdateQRCodeChange = React.useCallback(event => {\r\n const value = event.target.checked;\r\n ImprotData.UpdateQRCode = value;\r\n setUpdateQRCode(value);\r\n }, []);\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t(translations.ImportAssetImageFiles)}\r\n \r\n {(ImportAssetAutoNaming === '' ||\r\n parseInt(ImportAssetAutoNaming) ===\r\n (AutomaticAssetNamings.No as number)) && (\r\n \r\n \r\n \r\n )}\r\n {showInternalCode && (\r\n \r\n \r\n {t(translations.ImportAssetsUpdateQRcodes)}\r\n \r\n \r\n \r\n \r\n )}\r\n {importAssetImageFiles && (\r\n {}} />\r\n )}\r\n \r\n \r\n );\r\n}\r\ninterface SelectFileBoxProps {\r\n handleFileTypeChange: (value: Entity | null) => void;\r\n selectFileHandler: (value: boolean) => void;\r\n fileType: Entity | null;\r\n}\r\nfunction SelectFileBox(props: SelectFileBoxProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const [filetype, setFiletype] = React.useState | null>(\r\n props.fileType,\r\n );\r\n const classes = useStyles();\r\n const downloadMime = undefined;\r\n const downloadFileExtension =\r\n downloadMime === undefined ? undefined : filetype;\r\n const downloadFileName =\r\n downloadFileExtension === undefined ? undefined : undefined;\r\n const handleChange = React.useCallback(\r\n (value: Entity | null) => {\r\n setFiletype(value);\r\n props.handleFileTypeChange(value);\r\n },\r\n [props],\r\n );\r\n const fh = React.useMemo((): React.ReactNode => {\r\n let s = t(translations.MaxFileSize);\r\n s = s.replace('{0}', '100');\r\n return (\r\n <>\r\n {t(translations.DragTheFilesOrBrowse)}\r\n
    {s}
    \r\n \r\n );\r\n }, [t]);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\ninterface SelectImageFilesBoxProps {\r\n selectFileHandler: (value: boolean) => void;\r\n}\r\nfunction SelectImageFilesBox(props: SelectImageFilesBoxProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const classes = useStyles();\r\n const fh = React.useMemo((): React.ReactNode => {\r\n let s = t(translations.MaxFileSize);\r\n s = s.replace('{0}', '100');\r\n return (\r\n <>\r\n {t(translations.DragTheImagesOrBrowse)}\r\n
    \r\n
    \r\n {t(translations.AssetImgSupportedTypes)}\r\n
    \r\n
    {s}
    \r\n \r\n );\r\n }, [t]);\r\n const accept = {\r\n 'application/png': ['.png'],\r\n 'application/jpg': ['.jpg'],\r\n 'application/gif': ['.gif'],\r\n 'application/bmp': ['.bmp'],\r\n 'application/jpe': ['.jpe'],\r\n 'application/jpeg': ['.jpeg'],\r\n 'application/ico': ['.ico'],\r\n };\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\ninterface InfoBoxProps {\r\n ImportTenplateHandler: () => void;\r\n}\r\nfunction InfoBox(props: InfoBoxProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const classes = useStyles();\r\n const BulkCreateNewRecords: string[] = React.useMemo(() => {\r\n return t(translations.Bulk_CNR1).split('{0}');\r\n }, [t]);\r\n return (\r\n \r\n \r\n \r\n {t(translations.ExcelImportSpecificRequirements)}\r\n \r\n
      \r\n
    • {t(translations.Excel_ISR1)}
    • \r\n
    • {t(translations.Excel_ISR2)}
    • \r\n
    \r\n
    \r\n \r\n {t(translations.CSVImportSpecificRequirements)}\r\n
      \r\n
    • {t(translations.CSV_ISR1)}
    • \r\n
    \r\n
    \r\n \r\n {t(translations.BulkCreateNewRecords)}\r\n
      \r\n
    • \r\n
      \r\n {BulkCreateNewRecords[0]}\r\n {\r\n props.ImportTenplateHandler();\r\n }}\r\n >\r\n {t(translations.Buli_CNR2)}\r\n \r\n {BulkCreateNewRecords[1]}\r\n
      \r\n
    • \r\n
    \r\n
    \r\n \r\n {t(translations.UpdateExistingRecords)}\r\n
      \r\n
    • {t(translations.Update_ER1)}
    • \r\n
    • {t(translations.Update_ER2)}
    • \r\n
    • {t(translations.Update_ER3)}
    • \r\n
    \r\n
    \r\n
    \r\n );\r\n}\r\n","import {\r\n Box,\r\n createStyles,\r\n LinearProgress,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { H2 } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n container: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n }),\r\n);\r\n\r\nexport interface PopupImportExportProgressProps {\r\n title: string;\r\n info: string;\r\n buttonName: string;\r\n onClick: () => void;\r\n}\r\nexport function PopupImportExportProgress(\r\n props: PopupImportExportProgressProps,\r\n) {\r\n const classes = useStyles();\r\n return (\r\n <>\r\n \r\n \r\n \r\n

    {props.title}

    \r\n \r\n {props.info}\r\n
    \r\n
    \r\n \r\n \r\n \r\n
    \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface NamePickerPrpps\r\n extends Omit>, 'loadData'> {\r\n names: Entity[] | undefined;\r\n}\r\nexport function NamePicker(props: NamePickerPrpps) {\r\n return (\r\n \r\n Promise.resolve(props.names !== undefined ? props.names : [])\r\n }\r\n variant=\"filled\"\r\n fullWidth\r\n {...props}\r\n />\r\n );\r\n}\r\n","import {\r\n createStyles,\r\n makeStyles,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TableRow,\r\n Theme,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { NamePicker } from '../NamePicker';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n height: '100%',\r\n overflowX: 'auto',\r\n overflowY: 'auto',\r\n },\r\n headerRow: {\r\n height: 56,\r\n },\r\n tableRow: {\r\n height: 40,\r\n },\r\n }),\r\n);\r\n\r\nconst StyledTableRow = withStyles(theme => ({\r\n root: {\r\n height: 40,\r\n },\r\n}))(TableRow);\r\n\r\nexport interface HeaderColumnProps {\r\n checked: boolean;\r\n name: string;\r\n cn: number;\r\n onChange: (value: boolean, cn: number) => void;\r\n}\r\nexport function HeaderColumn(props: HeaderColumnProps) {\r\n const [checked, setChecked] = React.useState(props.checked);\r\n const handleCheckChandge = React.useCallback(\r\n (value: boolean, cn: number) => {\r\n setChecked(value);\r\n props.onChange(value, cn);\r\n },\r\n [props],\r\n );\r\n return (\r\n \r\n {\r\n handleCheckChandge(value, props.cn);\r\n }}\r\n checked={checked}\r\n />\r\n \r\n {props.name}\r\n \r\n \r\n );\r\n}\r\nexport interface HeaderColumnPickerProps {\r\n names: Entity[] | undefined;\r\n value?: Entity | null | undefined;\r\n cn: number;\r\n onChange: (value: Entity | null | undefined, cn: number) => void;\r\n}\r\nexport function HeaderColumnPicker(props: HeaderColumnPickerProps) {\r\n const [value, setValue] = React.useState | null | undefined>(\r\n props.value,\r\n );\r\n const [showPicker, setShowPicker] = React.useState(true);\r\n const handleValueChandge = React.useCallback(\r\n (value: Entity | null | undefined, cn: number) => {\r\n setValue(value);\r\n props.onChange(value, cn);\r\n if (value !== null) {\r\n setShowPicker(false);\r\n }\r\n },\r\n [props],\r\n );\r\n return (\r\n <>\r\n {showPicker ? (\r\n handleValueChandge(value, props.cn)}\r\n names={props.names}\r\n />\r\n ) : (\r\n {\r\n setShowPicker(true);\r\n }}\r\n >\r\n {value?.Name}\r\n \r\n )}\r\n \r\n );\r\n}\r\nexport interface BasicTableProps {\r\n header1: JSX.Element[];\r\n header2: JSX.Element[];\r\n rows: string[][];\r\n}\r\n\r\nexport function BasicTable({ header1, header2, rows }: BasicTableProps) {\r\n const classes = useStyles();\r\n return (\r\n \r\n \r\n \r\n \r\n {header1.map(column => (\r\n {column}\r\n ))}\r\n \r\n {header2.length > 0 && (\r\n \r\n {header2.map(column => (\r\n {column}\r\n ))}\r\n \r\n )}\r\n \r\n \r\n {rows.map((row, index) => (\r\n \r\n {row.map(cell => (\r\n {cell}\r\n ))}\r\n \r\n ))}\r\n \r\n
    \r\n
    \r\n );\r\n}\r\n","import React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport clsx from 'clsx';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { BasicTable, HeaderColumn, HeaderColumnPicker } from './Table';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ImprotData } from '../Data';\r\nimport { Entity } from 'types/common';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\n//import { ImportColumn } from '../Actions/Types';\r\n//import { ValuePicker } from './ValuePicker';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n titleContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n },\r\n closeButton: {\r\n position: 'absolute',\r\n right: theme.spacing(3),\r\n top: theme.spacing(3),\r\n color: theme.palette.grey[500],\r\n },\r\n container: {\r\n display: 'flex',\r\n },\r\n containerCenter: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n boxcontainer: {\r\n display: 'flex',\r\n width: '100%',\r\n height: '100%',\r\n },\r\n toggleBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n },\r\n infoBox: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginTop: '24px',\r\n padding: '10PX',\r\n backgroundColor: '#f0f9ff',\r\n },\r\n border: {\r\n borderStyle: 'solid',\r\n borderColor: 'red',\r\n },\r\n }),\r\n);\r\nexport interface PopupImportExportStep3Props {\r\n title: string;\r\n backName: string;\r\n nextName: string;\r\n cancelName: string;\r\n rows: number;\r\n back: () => void;\r\n next: () => void;\r\n cancel: () => void;\r\n}\r\nexport function PopupImportExportStep3(props: PopupImportExportStep3Props) {\r\n const classes = useStyles();\r\n const [toggle1, setToggle1] = React.useState(true);\r\n const handleColumnCheckboxChange = React.useCallback(\r\n (value: boolean, cn: number) => {\r\n if (ImprotData.Header !== undefined) {\r\n ImprotData.Header[cn].Include = value;\r\n }\r\n },\r\n [],\r\n );\r\n const handleColumnPickerChange = React.useCallback(\r\n (value: Entity | null | undefined, cn: number) => {\r\n if (ImprotData.Header !== undefined) {\r\n ImprotData.Header[cn].Name = value?.Id;\r\n }\r\n },\r\n [],\r\n );\r\n /*const getColumnValue = React.useCallback((column: ImportColumn) => {\r\n if (column.ExcelName !== undefined) {\r\n const v = ImprotData.TemplateColumns?.find(value => {\r\n return value.Name === column.ExcelName;\r\n });\r\n return v;\r\n } else {\r\n return undefined;\r\n }\r\n }, []);*/\r\n const handleToggleChange1 = React.useCallback((value: boolean) => {\r\n setToggle1(value);\r\n }, []);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {props.title}

    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n return (\r\n \r\n );\r\n })\r\n : []\r\n }\r\n header2={\r\n ImprotData.Header !== undefined && !toggle1\r\n ? ImprotData.Header.map((value, cn) => {\r\n return (\r\n \r\n );\r\n })\r\n : []\r\n }\r\n rows={ImprotData.Table !== undefined ? ImprotData.Table : []}\r\n />\r\n \r\n \r\n \r\n {/* {}}\r\n names={undefined}\r\n />*/}\r\n {/**/}\r\n \r\n \r\n \r\n {props.backName}\r\n \r\n \r\n \r\n {props.cancelName}\r\n \r\n
    \r\n \r\n \r\n \r\n );\r\n}\r\n\r\ninterface ToggleBoxProps {\r\n rows: number;\r\n toggle1: boolean;\r\n handleToggleChange1: (value: boolean) => void;\r\n}\r\nfunction ToggleBox(props: ToggleBoxProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const [toggle1, setToggle1] = React.useState(props.toggle1);\r\n const [toggle2, setToggle2] = React.useState(true);\r\n const classes = useStyles();\r\n const rows = React.useMemo((): React.ReactNode => {\r\n let s = t(translations.RecordsInTheFile);\r\n s = s.replace('{0}', props.rows.toString());\r\n return (\r\n <>\r\n
    \r\n {s} \r\n
    \r\n \r\n );\r\n }, [props.rows, t]);\r\n const handleChange1 = React.useCallback(\r\n (checked: boolean, event: React.ChangeEvent) => {\r\n setToggle1(checked);\r\n props.handleToggleChange1(checked);\r\n },\r\n [props],\r\n );\r\n const handleChange2 = React.useCallback(\r\n (checked: boolean, event: React.ChangeEvent) => {\r\n setToggle2(checked);\r\n ImprotData.AddOnly = !checked;\r\n },\r\n [],\r\n );\r\n return (\r\n \r\n \r\n {rows}\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n );\r\n}\r\ninterface InfoBoxProps {}\r\nfunction InfoBox(props: InfoBoxProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const classes = useStyles();\r\n return (\r\n \r\n \r\n
  • {t(translations.UncheckColumnIfYouDontWantItToBeImported)}
  • \r\n
  • {t(translations.OnlyFirst5RowsOfTheFileAreDisplayedForPreview)}
  • \r\n
    \r\n
    \r\n );\r\n}\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ImportResult } from '../Actions/Types';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n container: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n containerRows: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n width: '300px',\r\n },\r\n row: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n rowData: {\r\n display: 'flex',\r\n width: '100%',\r\n margin: '3px',\r\n },\r\n divider: {\r\n backgroundColor: theme.palette.divider,\r\n },\r\n color: {\r\n color: theme.palette.primary.main,\r\n },\r\n }),\r\n);\r\n\r\ninterface RowDataProps {\r\n Name: string;\r\n Value: string;\r\n}\r\n\r\nfunction RowData(props: RowDataProps) {\r\n const classes = useStyles();\r\n return (\r\n \r\n {props.Name} \r\n \r\n {props.Value}\r\n \r\n \r\n );\r\n}\r\nexport interface PopupImportExportStep5Props {\r\n state: ImportResult;\r\n newRows: number;\r\n existingRows: number;\r\n errors: number;\r\n errorMessage?: string;\r\n handleDownloadImportErrorReport: () => void;\r\n onClick: () => void;\r\n}\r\nexport function PopupImportExportStep5(props: PopupImportExportStep5Props) {\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const content: React.ReactNode = React.useMemo((): React.ReactNode => {\r\n switch (props.state) {\r\n case ImportResult.success:\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n

    {t(translations.ImportSuccessfullyCompleted)}

    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n props.handleDownloadImportErrorReport()}\r\n title={t(translations.DownloadImportErrorReport)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n aria-label=\"close\"\r\n size=\"small\"\r\n style={{ width: '100%' }}\r\n >\r\n \r\n \r\n {t(translations.DownloadDetailedImportResults)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n case ImportResult.error:\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n

    {t(translations.ImportCompletedWithErrors)}

    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n props.handleDownloadImportErrorReport()}\r\n title={t(translations.DownloadImportErrorReport)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n aria-label=\"close\"\r\n size=\"small\"\r\n style={{ width: '100%' }}\r\n >\r\n \r\n \r\n {t(translations.DownloadImportErrorReport)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n case ImportResult.failed:\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n

    {t(translations.ImportHasFailed)}

    \r\n
    \r\n
    \r\n {t(translations.ImportErrorFailedMessage)}\r\n {props.errorMessage !== undefined && (\r\n \r\n {t(translations.ImportAdditionalDetails)}:{' '}\r\n {props.errorMessage}\r\n \r\n )}\r\n \r\n \r\n );\r\n case ImportResult.default:\r\n return (\r\n <>\r\n \r\n \r\n );\r\n default:\r\n return (\r\n <>\r\n \r\n \r\n );\r\n }\r\n }, [\r\n classes.color,\r\n classes.containerRows,\r\n classes.divider,\r\n classes.row,\r\n props,\r\n t,\r\n ]);\r\n return (\r\n <>\r\n \r\n \r\n {content}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PopupImportExportDialog } from './Components/Dialog';\r\nimport { PopupImportExportStep1 } from './Components/step1';\r\nimport { PopupImportExportProgress } from './Components/step2_4';\r\nimport { PopupImportExportStep3 } from './Components/step3';\r\nimport { PopupImportExportStep5 } from './Components/step5';\r\nimport { ImprotData } from './Data';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { GenericImport } from './Actions/Import';\r\nimport { ImportAdditionalData, ImportResult } from './Actions/Types';\r\nimport fileDownload from 'js-file-download';\r\nimport { ExportImportActions } from './Actions';\r\nimport { Entity } from 'types/common';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useDispatch } from 'react-redux';\r\n\r\n/**\r\n *\r\n * PopupExportImport\r\n *\r\n */\r\nexport interface PopupImportExportProps {\r\n title: string;\r\n show: boolean;\r\n screenId: ScreensId;\r\n budgetType?: number;\r\n iad?: ImportAdditionalData;\r\n close: () => void;\r\n}\r\nexport function PopupImportExport({\r\n title,\r\n show,\r\n screenId,\r\n budgetType,\r\n iad,\r\n close,\r\n}: PopupImportExportProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const [step, setStep] = React.useState(0);\r\n const [rows, setRows] = React.useState(0);\r\n const [columns, setColumns] = React.useState(0);\r\n const [filetype, setFiletype] = React.useState | null>({\r\n Id: '.xlsx',\r\n Name: '.xlsx',\r\n });\r\n const [importResult, setImportResult] = React.useState(\r\n ImportResult.default,\r\n );\r\n const [resultData, setResultData] = React.useState();\r\n const [resultFileName, setResultFileName] = React.useState<\r\n string | undefined\r\n >();\r\n const [newRows, setNewRows] = React.useState(0);\r\n const [existingRows, setExistingRows] = React.useState(0);\r\n const [errors, setErrors] = React.useState(0);\r\n const [errorMessage, setErrorMessage] = React.useState();\r\n React.useEffect(() => {\r\n ImprotData.ClearImages();\r\n ImprotData.ScreenId = screenId;\r\n ImprotData.ImportAdditionalData =\r\n iad !== undefined ? iad : ImportAdditionalData.none;\r\n }, [iad, screenId]);\r\n const cancel = React.useCallback(() => {\r\n setRows(0);\r\n setColumns(0);\r\n setResultData(undefined);\r\n setStep(0);\r\n ImprotData.ClearImages();\r\n close();\r\n }, [close]);\r\n const cancelFileUpload = React.useCallback(() => {\r\n cancel();\r\n }, [cancel]);\r\n const cancelImport = React.useCallback(() => {\r\n cancel();\r\n }, [cancel]);\r\n const back = React.useCallback(() => {\r\n if (step > 1) {\r\n setStep(step - 2);\r\n }\r\n }, [step]);\r\n /*const delay = delayInms => {\r\n return new Promise(resolve => setTimeout(resolve, delayInms));\r\n };*/\r\n const handleFileTypeChange = React.useCallback(\r\n (value: Entity | null) => {\r\n setFiletype(value);\r\n },\r\n [],\r\n );\r\n const ImportTenplateHandler = React.useCallback(async () => {\r\n const res = await ExportImportActions.ImportTemplate(\r\n screenId,\r\n filetype !== null ? filetype.Name : '.xlsx',\r\n iad,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined\r\n ? cd.split('filename=')[1]\r\n : 'template' + (filetype !== null ? filetype.Name : '');\r\n fileDownload(res.data, filename);\r\n }, [filetype, iad, screenId]);\r\n const next = React.useCallback(async () => {\r\n switch (step) {\r\n case 0:\r\n setStep(1);\r\n const res = await ImprotData.LoadExcelfile();\r\n if (res !== undefined) {\r\n setRows(ImprotData.RowCount !== undefined ? ImprotData.RowCount : 0);\r\n const cc = await ImprotData.LoadTemplateColumns();\r\n if (cc !== undefined) {\r\n ImprotData.SetTemplateColumns(cc);\r\n }\r\n //await delay(5000);\r\n setStep(2);\r\n } else {\r\n setStep(0);\r\n }\r\n break;\r\n case 1:\r\n break;\r\n case 2:\r\n setColumns(ImprotData.ColumnCount());\r\n setStep(3);\r\n const importFileResult = await GenericImport(ImprotData.File, {\r\n ScreenId: screenId,\r\n Columns: ImprotData.Header !== undefined ? ImprotData.Header : [],\r\n BudgetType: budgetType ?? 1,\r\n AddOnly: ImprotData.AddOnly ?? false,\r\n Iad: iad ?? ImportAdditionalData.none,\r\n ImportAssetImageFiles: ImprotData.ImportAssetImageFiles,\r\n AutoGenerateAssetNamesBasedOn:\r\n ImprotData.AutoGenerateAssetNamesBasedOn?.Id,\r\n UpdateQRCode: ImprotData.UpdateQRCode,\r\n });\r\n //await delay(5000);\r\n setResultData(\r\n importFileResult !== undefined\r\n ? importFileResult.resultData\r\n : undefined,\r\n );\r\n setResultFileName(\r\n importFileResult !== undefined\r\n ? importFileResult.resultFileName\r\n : undefined,\r\n );\r\n setImportResult(\r\n importFileResult !== undefined\r\n ? importFileResult.importResult\r\n : ImportResult.default,\r\n );\r\n setErrorMessage(\r\n importFileResult !== undefined\r\n ? importFileResult.errorMessage\r\n : undefined,\r\n );\r\n setNewRows(\r\n importFileResult !== undefined\r\n ? importFileResult.NewRecordsImported\r\n : 0,\r\n );\r\n setExistingRows(\r\n importFileResult !== undefined\r\n ? importFileResult.ExistingRecordsUpdated\r\n : 0,\r\n );\r\n setErrors(\r\n importFileResult !== undefined ? importFileResult.ImportErrors : 0,\r\n );\r\n dispatch(actions.setRefreshTable(true));\r\n setStep(4);\r\n break;\r\n case 3:\r\n break;\r\n case 4:\r\n break;\r\n default:\r\n }\r\n }, [actions, budgetType, dispatch, iad, screenId, step]);\r\n const handleDownloadImportErrorReport = React.useCallback(() => {\r\n if (\r\n resultData !== undefined &&\r\n resultFileName !== undefined &&\r\n resultFileName !== ''\r\n ) {\r\n fileDownload(resultData, resultFileName);\r\n setResultData(undefined);\r\n }\r\n }, [resultData, resultFileName]);\r\n const steps = React.useMemo((): React.ReactNode[] => {\r\n return [\r\n ,\r\n ,\r\n ,\r\n ,\r\n ,\r\n ];\r\n }, [\r\n ImportTenplateHandler,\r\n back,\r\n cancel,\r\n cancelFileUpload,\r\n cancelImport,\r\n columns,\r\n errorMessage,\r\n errors,\r\n existingRows,\r\n filetype,\r\n handleDownloadImportErrorReport,\r\n handleFileTypeChange,\r\n importResult,\r\n newRows,\r\n next,\r\n rows,\r\n t,\r\n title,\r\n ]);\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * LoanableFilter\r\n *\r\n */\r\nimport { CampusPicker } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const CampusFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default CampusFilter;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n BaseURLMultiPicker,\r\n BaseURLMultiPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLMultiPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserGroupMultiPickerProps\r\n extends Omit, 'url'> {}\r\n\r\nconst url = '/api/odata/v4/UserGroupFilter';\r\n\r\nexport const initUserGroupMultiData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return Promise.resolve([] as Entity[]);\r\n }\r\n const ids = initval.split('|');\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: '(Id in (' + ids.map(v => \"'\" + v + \"'\").join(',') + '))',\r\n $select: 'Id,Name',\r\n $top: ids.length,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\nexport const UserGroupMultiPicker = (props: UserGroupMultiPickerProps) => {\r\n return ;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { publicAssetActions as actions } from '.';\r\nimport { BrowseByUnitItemDto } from './types';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { selectRouterSearchParams } from 'app/slice/router-selectors';\r\n\r\nfunction* dosetSelectedItem(\r\n action: PayloadAction<{\r\n item: BrowseByUnitItemDto | undefined;\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n) {\r\n const path = '/Assets/Public';\r\n const currentSearch = new URLSearchParams(action.payload.search);\r\n\r\n if (!action.payload.init) {\r\n yield put(\r\n routerActions.push({ pathname: path, search: currentSearch.toString() }),\r\n );\r\n }\r\n yield put(actions.setSelectedItem_Success(action.payload));\r\n}\r\nfunction* dosetSelectedItems(\r\n action: PayloadAction<{\r\n items: BrowseByUnitItemDto[];\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n) {\r\n const path = '/Assets/Public';\r\n const currentSearch = new URLSearchParams(action.payload.search);\r\n //const newSearch = getSearchFromItems(action.payload.items, currentSearch);\r\n if (!action.payload.init) {\r\n yield put(\r\n routerActions.push({ pathname: path, search: currentSearch.toString() }),\r\n );\r\n }\r\n\r\n yield put(actions.setSelectedItems_Success(action.payload));\r\n}\r\nfunction* dosetAssetPublicFilters(\r\n action: PayloadAction | undefined>,\r\n) {\r\n const currentSearch = yield select(selectRouterSearchParams);\r\n\r\n const path = '/Assets/Public';\r\n const newSearch = !!action.payload\r\n ? toQueryString(action.payload)\r\n : currentSearch;\r\n for (const key of newSearch.keys()) {\r\n if ((currentSearch as URLSearchParams).has(key)) {\r\n const filterValue = newSearch.get(key);\r\n if (filterValue !== null) {\r\n let currValue = currentSearch.get(key);\r\n if (filterValue !== currValue) {\r\n currentSearch.set(key, filterValue);\r\n }\r\n } else {\r\n currentSearch.delete(key);\r\n }\r\n } else {\r\n const filterValue = newSearch.get(key);\r\n if (filterValue !== null) {\r\n currentSearch.set(key, filterValue);\r\n }\r\n }\r\n }\r\n yield put(\r\n routerActions.push({\r\n pathname: path,\r\n search: currentSearch.toString(),\r\n }),\r\n );\r\n yield put(actions.setAssetPublicFilters_success(action.payload));\r\n}\r\nexport function* publicAssetSaga() {\r\n yield takeLatest(actions.setSelectedItem.type, dosetSelectedItem);\r\n yield takeLatest(actions.setSelectedItems.type, dosetSelectedItems);\r\n yield takeLatest(actions.setAssetPublicFilters.type, dosetAssetPublicFilters);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { publicAssetSaga } from './saga';\r\nimport { BrowseByUnitItemDto, PublicAssetState } from './types';\r\n\r\nexport const initialState: PublicAssetState = {\r\n processing: false,\r\n error: undefined,\r\n data: undefined,\r\n selectedData: [],\r\n dataSearch: undefined,\r\n filters: undefined,\r\n menuOpen: undefined,\r\n globalSearchOpen: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'publicAsset',\r\n initialState,\r\n reducers: {\r\n setSelectedItem(\r\n state,\r\n action: PayloadAction<{\r\n item: BrowseByUnitItemDto | undefined;\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.error = undefined;\r\n },\r\n setSelectedItem_Success(\r\n state,\r\n action: PayloadAction<{\r\n item: BrowseByUnitItemDto | undefined;\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.error = undefined;\r\n state.data = action.payload.item;\r\n if (!action.payload.init) {\r\n state.dataSearch = action.payload.search;\r\n }\r\n },\r\n setSelectedItems(\r\n state,\r\n action: PayloadAction<{\r\n items: BrowseByUnitItemDto[];\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.error = undefined;\r\n },\r\n setSelectedItems_Success(\r\n state,\r\n action: PayloadAction<{\r\n items: BrowseByUnitItemDto[];\r\n search: string;\r\n init?: boolean;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.error = undefined;\r\n state.selectedData = action.payload.items;\r\n if (!action.payload.init) {\r\n state.dataSearch = action.payload.search;\r\n }\r\n },\r\n setAssetPublicFilters(\r\n state,\r\n action: PayloadAction | undefined>,\r\n ) {},\r\n setAssetPublicFilters_success(\r\n state,\r\n action: PayloadAction | undefined>,\r\n ) {\r\n state.filters = action.payload;\r\n },\r\n setMenuOpen(state, action: PayloadAction) {\r\n state.menuOpen = action.payload;\r\n },\r\n toggleMenuOpen(state, action: PayloadAction) {\r\n state.menuOpen = !state.menuOpen;\r\n },\r\n setGlobalSearchOpen(state, action: PayloadAction) {\r\n state.globalSearchOpen = action.payload;\r\n },\r\n toggleGlobalSearchOpen(state, action: PayloadAction) {\r\n state.globalSearchOpen = !state.globalSearchOpen;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: publicAssetActions } = slice;\r\n\r\nexport const usePublicAssetSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: publicAssetSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = usePublicAssetSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","/**\r\n *\r\n * InvoiceRowReferenceLinks\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { ReservationEditButton } from '../ReservationEditButton';\r\nimport { OtherServiceEditLink } from 'app/pages/OtherServiceDetails/OtherServiceDetailsPage';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\n\r\nexport interface InvoiceRowReferenceLinksProps {\r\n ReservationId: number | null;\r\n UsageId: number | null;\r\n OfflineServiceId: number | null;\r\n ServiceRequestId: number | null;\r\n SubscriptionId: number | null;\r\n useSidePanel: boolean;\r\n}\r\n\r\nexport function InvoiceRowReferenceLinks(props: InvoiceRowReferenceLinksProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n let references: Array<{\r\n id: number | null;\r\n link: string;\r\n title: string;\r\n target?: string;\r\n }> = [];\r\n\r\n if (props.UsageId)\r\n references.push({\r\n id: props.UsageId,\r\n link: '/UsageDetails.aspx?id=' + props.UsageId,\r\n title: t(translations.menu_UsageDetails) as string,\r\n target: '_blank',\r\n });\r\n\r\n if (props.ServiceRequestId)\r\n references.push({\r\n id: props.ServiceRequestId,\r\n link: GetServiceRequestDetailsPath(props.ServiceRequestId),\r\n title: t(translations.ServiceRequestDetails) as string,\r\n target: undefined,\r\n });\r\n\r\n if (props.SubscriptionId)\r\n references.push({\r\n id: props.SubscriptionId,\r\n link: '/Invoices/Subscriptions/Edit.aspx?id=' + props.SubscriptionId,\r\n title: t(translations.SubscriptionDetails) as string,\r\n target: '_blank',\r\n });\r\n\r\n let result = references.map((item, i) => {\r\n return (\r\n \r\n \r\n \r\n \r\n {item.id}\r\n \r\n \r\n \r\n
    \r\n
    \r\n );\r\n });\r\n return (\r\n <>\r\n {props.ReservationId !== null && (\r\n \r\n )}\r\n {props.OfflineServiceId !== null && (\r\n \r\n )}\r\n {result}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { LocationPicker } from '../pickers/AutocompletePickers/LocationPicker';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\n\r\nexport const FormLocationPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & {\r\n label?: string;\r\n fullWidth: boolean;\r\n autoFocus?: boolean;\r\n name: string;\r\n placeholder: string;\r\n disabled?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value as ILocationListDto}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n variant={props.variant}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * PopupImport\r\n *\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\nimport { InfoIcon } from '../InfoIcon';\r\nimport parse from 'html-react-parser';\r\n\r\nimport { uniqueId } from 'lodash';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nexport interface PopupImportProps\r\n extends Pick {\r\n onImportButtonClick: () => void;\r\n onDownloadTemplateButtonClick?: () => Promise;\r\n onConfirm: (event, file: any) => void;\r\n onCancel: () => void;\r\n processing: boolean;\r\n open: boolean;\r\n title?: string;\r\n accept: '.xlsx' | '.xls' | '.csv';\r\n disabled?: boolean;\r\n hideImportButton?: boolean;\r\n hideMessage?: boolean;\r\n}\r\n\r\nexport function PopupImport(props: PopupImportProps) {\r\n const { t } = useTranslation();\r\n const ref = React.useRef(null);\r\n const handleConfirm = event => {\r\n const file = ref.current?.files?.[0];\r\n if (file !== undefined) {\r\n props.onConfirm(event, file);\r\n }\r\n };\r\n const [\r\n downloadTemplateprocessing,\r\n setDownloadTemplateProcessing,\r\n ] = React.useState(false);\r\n const [fileId] = React.useState(uniqueId('import-file-'));\r\n const [buttonId] = React.useState(uniqueId('import-file-'));\r\n return (\r\n <>\r\n {props.hideImportButton === undefined ||\r\n (props.hideImportButton === false && (\r\n \r\n {t(translations.Import)}\r\n \r\n ))}\r\n \r\n {props.onDownloadTemplateButtonClick !== undefined && (\r\n \r\n {t(translations.ImportRecordsDescription)}\r\n \r\n \r\n )}\r\n {props.onDownloadTemplateButtonClick !== undefined && (\r\n \r\n \r\n  \r\n {\r\n if (props.onDownloadTemplateButtonClick !== undefined) {\r\n setDownloadTemplateProcessing(true);\r\n await props.onDownloadTemplateButtonClick();\r\n setDownloadTemplateProcessing(false);\r\n }\r\n }}\r\n processing={downloadTemplateprocessing}\r\n >\r\n {t(translations.DownloadTemplate)}\r\n \r\n \r\n )}\r\n \r\n {props.hideMessage === undefined ||\r\n (props.hideMessage === false && (\r\n \r\n ))}\r\n  \r\n \r\n \r\n \r\n }\r\n />\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * TagsFilter\r\n *\r\n */\r\nimport { TagsPicker } from 'app/components/pickers/AutocompletePickers/TagsPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const TagsFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default TagsFilter;\r\n","/**\r\n *\r\n * LoanableFilter\r\n *\r\n */\r\nimport { LoanablePicker } from 'app/components/pickers/AutocompletePickers/LoanablePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const LoanableFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default LoanableFilter;\r\n","/**\r\n *\r\n * StatusFilter\r\n *\r\n */\r\nimport { StatusPicker } from 'app/components/pickers/AutocompletePickers/StatusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const StatusFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n onChange={handleOnChange}\r\n isOpen={props.open}\r\n size=\"small\"\r\n placeholder={t(translations.AllValues)}\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default StatusFilter;\r\n","/**\r\n *\r\n * LockersFilter\r\n *\r\n */\r\nimport { LockersPicker } from 'app/components/pickers/AutocompletePickers/LockersPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const LockersFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n ariaLabel={props.label}\r\n size=\"small\"\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default LockersFilter;\r\n","/**\r\n *\r\n * AssemblyTypePicker\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { AssemblyTypePicker } from 'app/components/pickers/StaticOptionsPickers/AssemblyTypePicker';\r\n\r\nexport const AssetTypesFilter = (props: IFilterComponentProps): JSX.Element => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n //RENDER\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n onChange={handleOnChange}\r\n ariaLabel={props.label}\r\n id={props.id}\r\n size=\"small\"\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n />\r\n );\r\n};\r\n\r\nexport default AssetTypesFilter;\r\n","/**\r\n *\r\n * AreasFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { AreasPicker } from 'app/components/pickers/AutocompletePickers/AreassPicker';\r\n\r\nexport const AreasFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n | undefined}\r\n size=\"small\"\r\n onChange={handleOnChange}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n />\r\n \r\n );\r\n};\r\nexport default AreasFilter;\r\n","/**\r\n *\r\n * OnlineServiceTypeFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { OnlineServiceTypePicker } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\n\r\nexport const OnlineServiceTypeFilter = (\r\n props: IFilterComponentProps,\r\n): JSX.Element => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n //RENDER\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n onChange={handleOnChange}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n />\r\n );\r\n};\r\n\r\nexport default OnlineServiceTypeFilter;\r\n","/**\r\n *\r\n * MyAssetAvailabilityTypeMultiFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { MyAssetAvailabilityTypeMultiPicker } from 'app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\n\r\nexport const MyAssetAvailabilityTypeMultiFilter = (\r\n props: IFilterComponentProps,\r\n) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport const AvailabilityTypeAvailableMultiFilter = (\r\n props: IFilterComponentProps,\r\n) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport const AvailabilityTypeAvailableOnlineMultiFilter = (\r\n props: IFilterComponentProps,\r\n) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default MyAssetAvailabilityTypeMultiFilter;\r\n","/**\r\n * Internal ServiceRequest Statuses enum. Generated from Bookit.Data.Enums.InternalServiceRequestStatus\r\n */\r\nexport enum InternalServiceRequestStatuses {\r\n Draft = 0,\r\n\r\n WaitingForQuote = 1,\r\n\r\n QuoteSendToUser = 2,\r\n\r\n QuoteApproved = 3,\r\n\r\n Completed = 5,\r\n\r\n Cancelled = 6,\r\n\r\n InProcess = 7,\r\n\r\n ReturnedToUser = 8,\r\n\r\n Pending = 9,\r\n\r\n Started = 10,\r\n\r\n Skipped = 11,\r\n}\r\n\r\nexport type InternalServiceRequestStatusesUnion = keyof typeof InternalServiceRequestStatuses;\r\n","/**\r\n *\r\n * TrainingStatePicker\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { TrainingState } from 'enums/TrainingState';\r\n\r\nexport interface TrainingStatePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nexport function TrainingStatePicker(props: TrainingStatePickerProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const loadData = () => {\r\n const options = enumToEntityArray(TrainingState, t);\r\n return Promise.resolve[]>(options);\r\n };\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * TrainingStatePickerFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { TrainingStatePicker } from 'app/components/pickers/AutocompletePickers/TrainingStatePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetEnum, GetRawValue } from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\n\r\nexport function TrainingStatePickerFilter(props: IFilterComponentProps) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\nexport function getTrainingStatePickerFilter(\r\n accessor: keyof TRow,\r\n params: URLSearchParams,\r\n t: TFunction,\r\n): IFilterSettings {\r\n return {\r\n id: 'TrainingStateId',\r\n fieldName: accessor,\r\n displayName: t(translations.TrainingState),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'TrainingStateId',\r\n value: GetEnum(GetRawValue(params, 'TrainingStateId'), TrainingState, t),\r\n component: TrainingStatePickerFilter,\r\n customFilter: (value, settings) => {\r\n const id = (value as Entity)?.Id;\r\n switch (id) {\r\n case TrainingState.Available:\r\n const x = new Condition(settings.fieldName, ODataOperators.Includes, [\r\n TrainingState.Available,\r\n TrainingState.UnderMinimum,\r\n ]).toString();\r\n return x;\r\n case TrainingState.Maximum:\r\n case TrainingState.SignedUp:\r\n case TrainingState.UnderMinimum:\r\n return new Condition(\r\n settings.fieldName,\r\n ODataOperators.Equals,\r\n id,\r\n ).toString();\r\n }\r\n },\r\n };\r\n}\r\nexport default TrainingStatePickerFilter;\r\n","/**\r\n *\r\n * ReservationOrDowntimePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\n\r\nexport interface ReservationOrDowntimePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nexport function ReservationOrDowntimePicker(\r\n props: ReservationOrDowntimePickerProps,\r\n) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const loadData = () => {\r\n const options = enumToEntityArray(ReservationOrDowntimeEnum, t);\r\n return Promise.resolve[]>(options);\r\n };\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ReservationOrDowntimePickerFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ReservationOrDowntimePicker } from 'app/components/pickers/AutocompletePickers/ReservationOrDowntimePicker';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetEnum, GetRawValue } from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\n\r\nexport function ReservationOrDowntimePickerFilter(\r\n props: IFilterComponentProps,\r\n) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\nexport function getReservationOrDowntimePickerFilter(\r\n accessor: keyof TRow,\r\n params: URLSearchParams,\r\n t: TFunction,\r\n): IFilterSettings {\r\n return {\r\n id: 'ReservationOrDowntime',\r\n fieldName: accessor,\r\n displayName: t(translations.ReservationOrDowntime),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'ReservationOrDowntime',\r\n value: GetEnum(\r\n GetRawValue(params, 'ReservationOrDowntime'),\r\n ReservationOrDowntimeEnum,\r\n t,\r\n ),\r\n component: ReservationOrDowntimePickerFilter,\r\n };\r\n}\r\nexport default ReservationOrDowntimePickerFilter;\r\n","/**\r\n *\r\n * WithReservationsOnlyFilter\r\n *\r\n */\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BooleanPicker } from 'app/components/BooleanPicker';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { URLSearchParams } from 'url';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport {\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n GetRawValue,\r\n URLSearchParamsCI,\r\n} from '../../types/FilterParam';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport interface WithReservationsOnlyFilterProps {}\r\n\r\nexport function WithReservationsOnlyFilter(props: IFilterComponentProps) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\nexport function pushReservationsOnlyFilter<\r\n T extends { WithReservationsOnly: boolean | null }\r\n>(\r\n result: IFilterSettings[],\r\n t: TFunction,\r\n params: URLSearchParamsCI,\r\n notDefault?: boolean,\r\n) {\r\n const id = 'WithReservationsOnly';\r\n result.push({\r\n id: id,\r\n fieldName: 'WithReservationsOnly',\r\n displayName: t(translations.WithEventsOnly),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: id,\r\n value: GetBooleanEntity(GetBooleanOrUndefined(GetRawValue(params, id)), t),\r\n component: WithReservationsOnlyFilter,\r\n defaultValue: false,\r\n urlKey: id,\r\n notDefault,\r\n });\r\n}\r\nexport function getWithReservationsOnlyFilter(\r\n fieldName: keyof TRow,\r\n params: URLSearchParams,\r\n t: TFunction,\r\n): IFilterSettings {\r\n const id = 'WithReservationsOnly';\r\n return {\r\n id: id,\r\n fieldName: fieldName,\r\n queryStringSerializer: id,\r\n displayName: t(translations.WithEventsOnly),\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(GetBooleanOrUndefined(GetRawValue(params, id)), t),\r\n component: WithReservationsOnlyFilter,\r\n urlKey: id,\r\n };\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n pushAssetAvailabilityFilter,\r\n pushAssetCatFilter,\r\n pushAssetCatGroupFilter,\r\n pushBookedByFilter,\r\n pushBudgetManagerFilter,\r\n pushBuildingFilter,\r\n pushCampusFilter,\r\n pushRoomFilter,\r\n pushServicesCalendarFilter,\r\n} from 'app/pages/ReservationHistoryPage/Filter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { getTrainingStatePickerFilter } from 'app/components/BasicTable/Filters/TrainingStatePickerFilter';\r\nimport { getReservationOrDowntimePickerFilter } from 'app/components/BasicTable/Filters/ReservationOrDowntimePickerFilter';\r\nimport { pushReservationsOnlyFilter } from 'app/components/BasicTable/Filters/WithReservationsOnlyFilter';\r\nimport { getBudgetsFilterSettings } from 'app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Identifiable } from 'types/common';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport type CombinedSchedulerTRow = ICalendarReservationDto &\r\n ITrainingSessionDto & {\r\n ReservationOrDowntime: number | null;\r\n WithReservationsOnly: boolean | null;\r\n };\r\n\r\nexport const getFilters: GetPageFilters =\r\n (t, appSettings, user, settings) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n const result: Array> = [];\r\n pushServicesCalendarFilter(result, t, params, false, 'Id', 'reserved');\r\n pushAssetCatFilter(result, t, params);\r\n pushAssetCatGroupFilter(result, t, params);\r\n pushRoomFilter(result, t, params, undefined, {\r\n dependencyProp: ['AssetBuildingId'],\r\n filterPredicates: (value, fieldName) => {\r\n if (isNullOrUndefined(value)) {\r\n return [];\r\n }\r\n if (fieldName === 'AssetBuildingId') {\r\n return [\r\n `${new Condition(\r\n 'BuildingId',\r\n ODataOperators.Equals,\r\n (value as Identifiable).Id,\r\n ).toString()}`,\r\n ];\r\n }\r\n return [];\r\n },\r\n });\r\n pushReservationsOnlyFilter(result, t, params);\r\n // result.push(\r\n // getWithReservationsOnlyFilter(\r\n // 'WithReservationsOnly',\r\n // params,\r\n // t,\r\n // ),\r\n // );\r\n pushCampusFilter(appSettings, result, t, params, true);\r\n pushBuildingFilter(result, t, params, true);\r\n const budgetsFilter = getBudgetsFilterSettings(\r\n params,\r\n 'BudgetId',\r\n t,\r\n appSettings,\r\n );\r\n if (budgetsFilter !== undefined) {\r\n result.push({ ...budgetsFilter, notDefault: true });\r\n }\r\n pushBudgetManagerFilter(appSettings, result, t, params, true);\r\n pushAssetAvailabilityFilter(result, t, params, true);\r\n pushBookedByFilter(result, t, params, true);\r\n\r\n result.push({\r\n ...getTrainingStatePickerFilter(\r\n 'TrainingState',\r\n params,\r\n t,\r\n ),\r\n notDefault: true,\r\n });\r\n result.push({\r\n ...getReservationOrDowntimePickerFilter(\r\n 'ReservationOrDowntime',\r\n params,\r\n t,\r\n ),\r\n notDefault: true,\r\n });\r\n\r\n return result;\r\n };\r\n","/**\r\n *\r\n * SamplePlateTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlateTypePickerProps\r\n extends Omit>, 'loadData'> {\r\n name?: string;\r\n placeholder?: string;\r\n onBlur?: React.FocusEventHandler;\r\n error?: boolean;\r\n helperText?: string;\r\n disabled?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/SamplePlateTypes';\r\nexport const initSamplePlateTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select: string } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function SamplePlateTypePicker(props: SamplePlateTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { SamplePlateTypePicker } from '../pickers/AutocompletePickers/SamplePlateTypePicker';\r\n\r\nexport const FormSamplePlateTypePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & {\r\n label?: string;\r\n fullWidth: boolean;\r\n autoFocus?: boolean;\r\n name: string;\r\n placeholder: string;\r\n disabled?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n variant={props.variant}\r\n />\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FormFieldsBox } from '../wrappers';\r\nimport { Divider, useTheme } from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { BookitTypographyVariant } from '@material-ui/core/styles/createTypography';\r\n\r\nexport interface FormFieldsSectionProps {\r\n children: React.ReactNode;\r\n titleSection?: string | React.ReactNode;\r\n titleLink?: React.ReactNode;\r\n styleSection?: React.CSSProperties;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n titleVariant?: BookitTypographyVariant;\r\n}\r\nexport const FormFieldsSection = (props: FormFieldsSectionProps) => {\r\n const {\r\n children,\r\n titleSection,\r\n titleLink,\r\n styleSection,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n titleVariant,\r\n } = props;\r\n const theme = useTheme();\r\n return (\r\n \r\n {withTopSeparator && (\r\n \r\n )}\r\n {titleSection && (\r\n
    \r\n \r\n {titleSection}\r\n \r\n {titleLink || <>}\r\n
    \r\n )}\r\n\r\n
    {children}
    \r\n {withBottomSeparator && (\r\n \r\n )}\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { IndexNode } from '../StyledForm/index';\r\nimport clsx from 'clsx';\r\nimport { LeftSection } from '../wrappers';\r\n\r\nexport interface FormLeftSectionProps {\r\n pageDescription?: string;\r\n warning?: string;\r\n info?: string;\r\n children: React.ReactNode;\r\n showShortView?: boolean;\r\n errors?: IndexNode[];\r\n warningNodes?: IndexNode[];\r\n infoNodes?: IndexNode[];\r\n successNodes?: IndexNode[];\r\n isCover?: boolean;\r\n}\r\nexport const FormLeftSection = (props: FormLeftSectionProps) => {\r\n const {\r\n pageDescription,\r\n children,\r\n warning,\r\n info,\r\n errors,\r\n warningNodes,\r\n infoNodes,\r\n successNodes,\r\n isCover,\r\n } = props;\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const theme = useTheme();\r\n const showShortView = React.useMemo(() => {\r\n return (\r\n props.showShortView ||\r\n isMobile ||\r\n (sidePanelOpen && !sidePanelExpanded) ||\r\n isCover\r\n );\r\n }, [\r\n isCover,\r\n isMobile,\r\n props.showShortView,\r\n sidePanelExpanded,\r\n sidePanelOpen,\r\n ]);\r\n\r\n const [dataErrors, setDataErrors] = React.useState(errors || []);\r\n const [dataWarnings, setDataWarnings] = React.useState(\r\n warningNodes || [],\r\n );\r\n const [dataSuccess, setDataSuccess] = React.useState(\r\n successNodes || [],\r\n );\r\n const [dataInfos, setDataInfos] = React.useState(\r\n infoNodes || [],\r\n );\r\n const colapsedMinHeight = React.useMemo(() => {\r\n return showShortView ? 60 : 50;\r\n }, [showShortView]);\r\n const handleCloseError = React.useCallback(\r\n (index: number) => {\r\n if (dataErrors.length > 0) {\r\n setDataErrors(() => dataErrors.splice(index, 1));\r\n }\r\n },\r\n [dataErrors],\r\n );\r\n const handleCloseWarning = React.useCallback(\r\n (index: number) => {\r\n if (dataWarnings.length > 0) {\r\n setDataWarnings(() => dataWarnings.splice(index, 1));\r\n }\r\n },\r\n [dataWarnings],\r\n );\r\n const handleCloseInfo = React.useCallback(\r\n (index: number) => {\r\n if (dataInfos.length > 0) {\r\n setDataInfos(() => dataInfos.splice(index, 1));\r\n }\r\n },\r\n [dataInfos],\r\n );\r\n const handleCloseSuccess = React.useCallback(\r\n (index: number) => {\r\n if (dataSuccess.length > 0) {\r\n setDataSuccess(() => dataSuccess.splice(index, 1));\r\n }\r\n },\r\n [dataSuccess],\r\n );\r\n React.useEffect(() => {\r\n if (!!errors && errors.length > 0) {\r\n setDataErrors(errors);\r\n } else {\r\n setDataErrors([]);\r\n }\r\n if (!!warningNodes && warningNodes.length > 0) {\r\n setDataWarnings(warningNodes);\r\n } else {\r\n setDataWarnings([]);\r\n }\r\n if (!!infoNodes && infoNodes.length > 0) {\r\n setDataInfos(infoNodes);\r\n } else {\r\n setDataInfos([]);\r\n }\r\n if (!!successNodes && successNodes.length > 0) {\r\n setDataSuccess(successNodes);\r\n } else {\r\n setDataSuccess([]);\r\n }\r\n }, [errors, infoNodes, successNodes, warningNodes]);\r\n return (\r\n \r\n {pageDescription && (\r\n \r\n )}\r\n {warning && (\r\n \r\n )}\r\n {info && (\r\n \r\n )}\r\n {dataSuccess.length > 0 && (\r\n \r\n {dataSuccess.map((succ, index) => (\r\n handleCloseSuccess(index)}\r\n />\r\n ))}\r\n \r\n )}\r\n {dataInfos.length > 0 && (\r\n \r\n {dataInfos.map((info, index) => (\r\n handleCloseInfo(index)}\r\n />\r\n ))}\r\n \r\n )}\r\n {dataWarnings.length > 0 && (\r\n \r\n {dataWarnings.map((warn, index) => (\r\n handleCloseWarning(index)}\r\n />\r\n ))}\r\n \r\n )}\r\n {dataErrors.length > 0 && (\r\n \r\n {dataErrors.map((err, index) => (\r\n handleCloseError(index)}\r\n />\r\n ))}\r\n \r\n )}\r\n {children}\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\n\r\nexport interface RefreshIconProps extends ICanRaiseBasicTableRefreshEvent {\r\n loading?: boolean;\r\n title: string;\r\n}\r\nexport function RefreshIcon(props: RefreshIconProps) {\r\n const handleClick = React.useCallback(() => {\r\n if (props.loading === true) {\r\n return;\r\n }\r\n\r\n props.onRefresh?.();\r\n }, [props]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * NumbersRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { INumbersRange } from 'types/INumbersRange';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { debounce } from 'lodash';\r\n\r\n/**\r\n * Number picker to be used as a BasicTable filter component\r\n */\r\nexport const NumbersRangeFilter = ({\r\n value: propsValue,\r\n onChange,\r\n additionalItem,\r\n labelFunc,\r\n ...props\r\n}: IFilterComponentProps) => {\r\n const { t } = useTranslation();\r\n\r\n const [value, setValue] = React.useState(propsValue);\r\n const handleStartChange: React.ChangeEventHandler<\r\n HTMLTextAreaElement | HTMLInputElement\r\n > = event => {\r\n setValue(value => {\r\n const newState = {\r\n end: value?.end ?? null,\r\n start: +event.target.value ?? null,\r\n };\r\n d(newState);\r\n return newState;\r\n });\r\n };\r\n const handleEndChange: React.ChangeEventHandler<\r\n HTMLTextAreaElement | HTMLInputElement\r\n > = event => {\r\n setValue(value => {\r\n const newState = {\r\n start: value?.start ?? null,\r\n end: +event.target.value ?? null,\r\n };\r\n d(newState);\r\n return newState;\r\n });\r\n };\r\n const d = debounce(onChange, 250);\r\n return (\r\n <>\r\n {value !== undefined && (\r\n <>\r\n <>\r\n \r\n\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default NumbersRangeFilter;\r\n","/**\r\n *\r\n * AvailabilityTypeFilter\r\n *\r\n */\r\nimport { AvailabilityTypeBookablePicker } from 'app/components/pickers/AutocompletePickers/AvailabilityTypePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AvailabilityTypeBookableFilter = (\r\n props: IFilterComponentProps,\r\n) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n return (\r\n | undefined}\r\n />\r\n );\r\n};\r\nexport default AvailabilityTypeBookableFilter;\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ReservationDetailsProps } from '../ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../ReservationDetails/Details/slice/types';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\n\r\nexport const trainingSessionPrimaryAction: PrimaryActionDynamic = (\r\n openPanel,\r\n row,\r\n toggle,\r\n user,\r\n useSidePanel,\r\n) => {\r\n if (!IsReadOnlyUser(user)) {\r\n const params = (row.original.hasReservation\r\n ? {\r\n id: String(row.original.myReservationId),\r\n }\r\n : {\r\n selectedIds: String(row.original.ServiceId),\r\n tsid: String(row.original.Id),\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(row.original.StartDate ?? new Date()),\r\n ),\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(row.original.EndDate ?? new Date()),\r\n ),\r\n un: user?.Id,\r\n }) as ReservationQueryStringParameters;\r\n openPanel({\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n useSidePanel: true,\r\n queryParams: params,\r\n } as ReservationDetailsProps,\r\n useSidePanel: useSidePanel,\r\n expanded: false,\r\n isCover: useSidePanel,\r\n });\r\n }\r\n};\r\n\r\nexport default trainingSessionPrimaryAction;\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { WorkOrderDetailsProps } from '../WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { allowedToViewAlert } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\n\r\nexport const workOrderPrimaryAction: PrimaryActionDynamic = (\r\n openPanel,\r\n row,\r\n toggle,\r\n user,\r\n useSidePanel,\r\n) => {\r\n if (allowedToViewAlert(user, row.original)) {\r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: {\r\n queryParams: { id: '' + row.original.Id },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n useSidePanel: useSidePanel,\r\n expanded: false,\r\n isCover: useSidePanel,\r\n });\r\n }\r\n};\r\n\r\nexport default workOrderPrimaryAction;\r\n","import * as React from 'react';\r\nimport {\r\n Box,\r\n ListItem,\r\n ListItemSecondaryAction,\r\n ListItemText,\r\n Menu,\r\n MenuList,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport {\r\n BatchesByServiceTypeFilter,\r\n convertInventoryBatchName,\r\n loadInventoryBatchesData,\r\n} from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { GetResponseMessages, IResponseType } from 'types/ResponseType';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\n\r\nexport interface InventoryBatchListProps {\r\n serviceTypeId: number;\r\n isAdmin: boolean;\r\n addNewBatchClick: () => void;\r\n anchorEl: any;\r\n onClose: () => void;\r\n onBatchClick?: (batch: IInventoryBatchDto) => void;\r\n selectedBatch?: IInventoryBatchDto;\r\n batches: IInventoryBatchDto[];\r\n onRenewStockClick?: (batchId?: number) => void;\r\n batchDeletable?: boolean;\r\n showRenewStockButtons?: boolean;\r\n createdRenewal?: IOtherServices;\r\n}\r\n\r\nexport const InventoryBatchList = React.memo(function InventoryBatchList(\r\n props: InventoryBatchListProps,\r\n) {\r\n const {\r\n isAdmin,\r\n serviceTypeId,\r\n addNewBatchClick,\r\n anchorEl,\r\n onClose,\r\n onBatchClick,\r\n selectedBatch,\r\n batches,\r\n onRenewStockClick,\r\n batchDeletable,\r\n showRenewStockButtons,\r\n createdRenewal,\r\n } = props;\r\n const [input, setInnput] = React.useState('');\r\n const { t } = useTranslation();\r\n const [removedBatch, setRemovedBatch] = React.useState<\r\n IInventoryBatchDto | undefined\r\n >(undefined);\r\n const [removeBatchOpen, setRemoveBatchOpen] = React.useState(false);\r\n const dispatch = useDispatch();\r\n\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const onRemoveBatchClick = (batch: IInventoryBatchDto) => {\r\n setRemoveBatchOpen(true);\r\n setRemovedBatch(batch);\r\n };\r\n const handleRemoveBatch = (batch: IInventoryBatchDto) => {\r\n new Promise((resolve, reject) => {\r\n return OtherServicesApi.deleteInventoryBatch(batch)\r\n .then(response => {\r\n const messages: IResponseType = GetResponseMessages(\r\n response,\r\n t(translations.Success) as string,\r\n );\r\n setRemoveBatchOpen(false);\r\n if (messages.ErrorMessages.length > 0) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: messages.ErrorMessages[0],\r\n }),\r\n );\r\n }\r\n if (messages.SuccessMessages.length > 0) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: messages.SuccessMessages[0],\r\n }),\r\n );\r\n }\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(translations.Failed) as string;\r\n reject(err);\r\n })\r\n .finally(() => {\r\n setRemoveBatchOpen(false);\r\n setRemovedBatch(undefined);\r\n });\r\n });\r\n };\r\n const availableBatches = useAsyncGetWthEffect(\r\n async () =>\r\n loadInventoryBatchesData(\r\n BatchesByServiceTypeFilter(\r\n serviceTypeId,\r\n showRenewStockButtons ? undefined : true,\r\n ),\r\n )(input, undefined).then(res => res.value),\r\n batches,\r\n [input, serviceTypeId, selectedBatch, removedBatch, createdRenewal],\r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {t(translations.InventoryBatches)}\r\n \r\n \r\n \r\n \r\n }\r\n value={input || ''}\r\n aria-label={t(translations.SearchFilter)}\r\n inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n onChange={e => setInnput(e.target.value)}\r\n autoFocus\r\n fullWidth\r\n />\r\n \r\n \r\n {!!availableBatches && availableBatches.length > 0 ? (\r\n availableBatches.map(a => (\r\n !!onBatchClick && onBatchClick(a)}\r\n >\r\n \r\n \r\n {convertInventoryBatchName(a.Id, a.Name, a.Inventory)}\r\n \r\n \r\n {a.Id !== selectedBatch?.Id && batchDeletable && (\r\n \r\n onRemoveBatchClick(a)}\r\n >\r\n \r\n \r\n \r\n )}\r\n {showRenewStockButtons && (\r\n \r\n \r\n onRenewStockClick && onRenewStockClick(a.Id)\r\n }\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n ))\r\n ) : (\r\n \r\n \r\n {t(translations.InventoryBatch_notFound)}\r\n \r\n \r\n )}\r\n \r\n {isAdmin && (\r\n \r\n \r\n }\r\n onClick={() => addNewBatchClick()}\r\n >\r\n {t(translations.AddNewBatch)}\r\n \r\n {showRenewStockButtons && !!onRenewStockClick && (\r\n }\r\n onClick={() => onRenewStockClick()}\r\n >\r\n {t(translations.RenewStock)}\r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n !!removedBatch && handleRemoveBatch(removedBatch)}\r\n onCancel={() => {\r\n setRemoveBatchOpen(false);\r\n setRemovedBatch(undefined);\r\n }}\r\n maxWidth=\"md\"\r\n />\r\n \r\n );\r\n});\r\n","import { RadioProps as MuiRadioProps, styled } from '@material-ui/core';\r\nimport { Radio as MuiRadio } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nexport interface RadioProps extends MuiRadioProps {\r\n danger?: boolean;\r\n label?: string;\r\n}\r\n\r\nexport default function Radio(props: RadioProps) {\r\n const { color, danger, label, size = 'medium', ...other } = props;\r\n const RadioIconUnchecked = styled('span')(({ theme, ...other }) => ({\r\n borderRadius: '1000px',\r\n width: 20,\r\n height: 20,\r\n backgroundColor: bookitColors.base.white,\r\n border:\r\n danger || color === 'secondary'\r\n ? `1px solid ${bookitColors.danger.borders}`\r\n : `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n 'input:hover ~ &': {\r\n border:\r\n danger || color === 'secondary'\r\n ? `1px solid ${bookitColors.danger.borders}`\r\n : props.disabled\r\n ? `1px solid ${bookitColors.grayscale.grayBorders}`\r\n : `1px solid ${bookitColors.primary.borders}`,\r\n },\r\n 'input:disabled ~ &': {\r\n //boxShadow: 'none',\r\n background:\r\n danger || color === 'secondary'\r\n ? bookitColors.danger.bgHover\r\n : bookitColors.grayscale.graybgComponents,\r\n },\r\n }));\r\n const RadioIconChecked = styled(RadioIconUnchecked)(({ theme }) => ({\r\n backgroundColor:\r\n danger || color === 'secondary'\r\n ? bookitColors.danger.components\r\n : bookitColors.primary.components,\r\n border: 'none',\r\n '&:before': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n width: 20,\r\n height: 20,\r\n backgroundImage: 'radial-gradient(#fff,#fff 16%,transparent 25%)',\r\n content: '\"\"',\r\n },\r\n 'input:hover ~ &': {\r\n backgroundColor:\r\n danger || color === 'secondary'\r\n ? bookitColors.danger.regular\r\n : bookitColors.primary.regular,\r\n border: 'none',\r\n },\r\n 'input:disabled ~ &': {\r\n background:\r\n danger || color === 'secondary'\r\n ? bookitColors.danger.disabled\r\n : bookitColors.grayscale.grayBorders,\r\n },\r\n }));\r\n return (\r\n }\r\n checkedIcon={}\r\n color={danger ? 'secondary' : color === 'default' ? 'primary' : color}\r\n size={size}\r\n inputProps={{ 'aria-label': !!label ? label : 'decorative radio' }}\r\n {...other}\r\n />\r\n );\r\n}\r\n","import { FormControl, FormLabel, styled } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { buttonM } from 'styles/typography/bookitTypography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\n\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n color: theme.palette.common.blackRegular,\r\n ...buttonM,\r\n '&[class*=\"Mui-focused\"]': {\r\n color: theme.palette.common.blackRegular,\r\n },\r\n}));\r\nexport const FormParagraph = ({\r\n label,\r\n html,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n return (\r\n \r\n \r\n {label}\r\n {props.info && }\r\n \r\n {html}\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * CatRateTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ICatRateTypeFilterDto } from 'api/odata/generated/entities/ICatRateTypeFilterDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface CatRateTypeProps\r\n extends Omit>, 'loadData'> {\r\n /**\r\n * Set this to \"true\" if only \"Manual\" types need to be displayed\r\n *\r\n */\r\n manual?: boolean;\r\n bySystemSetting?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/CatRateTypeFilter';\r\nconst systemUrl = url + '/WithSystemSetting';\r\nexport const initCatRateTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst getLoadData = (manual: boolean, bysSystemSetting?: boolean) => (\r\n searchTerm: string | null,\r\n): Promise[]> => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n\r\n const predicates: Condition[] = [\r\n new Condition('Active', ODataOperators.Equals, true),\r\n ];\r\n if (manual) {\r\n predicates.push(\r\n new Condition(\r\n 'Manual',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm ?? undefined,\r\n }).toString();\r\n\r\n return httpClient\r\n .get(bysSystemSetting ? systemUrl : url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function CatRateTypePicker({\r\n manual,\r\n bySystemSetting,\r\n ...props\r\n}: CatRateTypeProps) {\r\n const loadData = React.useCallback(\r\n (search: string | null) =>\r\n getLoadData(manual === true, bySystemSetting)(search),\r\n [bySystemSetting, manual],\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\ntype RecordType = Record;\r\nconst ImageRenderer: Renderer> = ({ value, row }) => {\r\n const imageExist = useSelector(state => selectImageExist(state, value));\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\nexport default ImageRenderer;\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\n\r\nexport interface BaseURLMultiPickerProps\r\n extends Omit, 'loadData'> {\r\n url: string;\r\n queryfilter?: string | undefined;\r\n}\r\n\r\nexport function BaseURLMultiPicker(props: BaseURLMultiPickerProps) {\r\n const { url, queryfilter, ...other } = props;\r\n const loadData = async (searchTerm: string | null) => {\r\n const params: { $orderby: string; $top: number; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n $top: 100,\r\n };\r\n const predicates: string[] = [];\r\n if (queryfilter !== undefined && queryfilter !== '') {\r\n predicates.push(queryfilter);\r\n }\r\n\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n\r\n const response = await httpClient.get(url, params);\r\n return response.value;\r\n };\r\n return ;\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { IAsset } from 'app/pages/AssetPopUp/IAsset';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nconst ServiceIdRenderer: Renderer> = ({ value, row }) => {\r\n const { allowedToEdit } = useAdminPermissions();\r\n const { t } = useTranslation();\r\n const hrefPath = React.useMemo(() => {\r\n if (row.original.ServiceType === 'Offline') {\r\n return {\r\n path: '/offlineServicetype.aspx',\r\n search: { ID: row.original.ServiceId, back: 'myassets' },\r\n };\r\n } else if (row.original.ServiceType === 'Sample') {\r\n return {\r\n path: '/SampleType.aspx',\r\n search: { id: row.original.ServiceId, back: 'myassets' },\r\n };\r\n } else {\r\n return {\r\n path: '/NewResource.aspx',\r\n search: { Edit: row.original.ServiceId, back: 'myassets' },\r\n };\r\n }\r\n }, [row.original.ServiceId, row.original.ServiceType]);\r\n return allowedToEdit(row.original) ? (\r\n \r\n \r\n \r\n {value}\r\n \r\n \r\n \r\n ) : (\r\n // \r\n // {value}\r\n // \r\n <>{value}\r\n );\r\n};\r\nexport const useServiceIdAction = () => {\r\n const { allowedToEdit } = useAdminPermissions();\r\n return React.useCallback(\r\n row => {\r\n if (!allowedToEdit(row.original)) return;\r\n const hrefPath = (() => {\r\n if (row.original.ServiceType === 'Offline') {\r\n return {\r\n path: '/offlineServicetype.aspx',\r\n search: { ID: row.original.ServiceId, back: 'myassets' },\r\n };\r\n } else if (row.original.ServiceType === 'Sample') {\r\n return {\r\n path: '/SampleType.aspx',\r\n search: { id: row.original.ServiceId, back: 'myassets' },\r\n };\r\n } else {\r\n return {\r\n path: '/NewResource.aspx',\r\n search: { Edit: row.original.ServiceId, back: 'myassets' },\r\n };\r\n }\r\n })();\r\n window.open(toRootedURL(hrefPath.path, hrefPath.search), '_blank');\r\n },\r\n [allowedToEdit],\r\n );\r\n};\r\nexport default ServiceIdRenderer;\r\n","import { getSingleOnlineServiceType } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\nconst OperationTypeIdRenderer: Renderer>> = ({\r\n value,\r\n}: {\r\n value: number | null;\r\n}) => {\r\n const { t } = useTranslation();\r\n if (value === null || value === undefined) {\r\n return <>{t(translations.NA)};\r\n } else {\r\n return <>{getSingleOnlineServiceType(value).Name};\r\n }\r\n};\r\n\r\nexport default OperationTypeIdRenderer;\r\n","import { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\ntype RecordType = Record;\r\nconst AssetImageRenderer: Renderer> = ({\r\n value,\r\n row,\r\n}) => {\r\n const imageExist = useSelector(state => selectImageExist(state, value));\r\n const openAsset = useOpenAssetPopUp();\r\n const open = () => {\r\n openAsset({ id: row.original.Id });\r\n };\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\nexport default AssetImageRenderer;\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ReservationDetailsProps } from '../ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../ReservationDetails/Details/slice/types';\r\n\r\nexport const reservationsPrimaryAction: PrimaryActionDynamic<{\r\n Id: number;\r\n}> = (openPanel, row, toggle, user, useSidePanel) => {\r\n const params = {\r\n id: String(row.original.Id),\r\n un: user?.Id,\r\n } as ReservationQueryStringParameters;\r\n openPanel({\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n useSidePanel: true,\r\n queryParams: params,\r\n } as ReservationDetailsProps,\r\n useSidePanel: useSidePanel,\r\n expanded: false,\r\n isCover: useSidePanel,\r\n });\r\n};\r\n\r\nexport default reservationsPrimaryAction;\r\n","/**\r\n *\r\n * OtherServiceDetailsPage\r\n *\r\n */\r\nimport { OfflineServiceQueryStringParameters } from '../Details/slice/types';\r\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { OtherServiceDetails } from '../Details';\r\nimport { getParams } from './getQueryStringParameter';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport * as React from 'react';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\n\r\nexport interface OtherServiceDetailsPageProps<\r\n Params extends {\r\n [K in keyof OfflineServiceQueryStringParameters]?: string | undefined;\r\n } = {}\r\n> extends RouteComponentProps {}\r\nexport function OtherServiceDetailsPage(props: OtherServiceDetailsPageProps) {\r\n const location = useLocation();\r\n const params = new URLSearchParams(location.search);\r\n const queryProps = getParams(params, props);\r\n return ;\r\n}\r\nexport function OtherServiceEditLink(props: {\r\n id: number;\r\n useSidePanel: boolean;\r\n service?: IOtherServices;\r\n openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) {\r\n const { openPanel } = useSidePanelState();\r\n const handleOfflineServiceClick = React.useCallback(() => {\r\n let otherProps = {\r\n initialService: props.service,\r\n queryParams: {\r\n id: '' + props.id ?? -1,\r\n },\r\n useSidePanel: true,\r\n };\r\n const panelProps = {\r\n renderPageType: RenderPageType.OtherServiceDetails,\r\n renderPageProps: otherProps,\r\n expanded: false,\r\n useSidePanel: props.useSidePanel,\r\n isCover: props.useSidePanel,\r\n } as SidePanelOpenState;\r\n !!props.openPanelWithCover\r\n ? props.openPanelWithCover(panelProps)\r\n : openPanel(panelProps);\r\n }, [openPanel, props]);\r\n return (\r\n handleOfflineServiceClick()}\r\n >\r\n {props.id}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ServiceFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { OnlineServiceSinglePicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport const ServiceFilter = (props: IFilterComponentProps) => {\r\n const handleChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n // OnlineServiceSinglePicker operates on arrays, while ServiceFilter is a single selection picker\r\n const arrayValue =\r\n (props.value as Entity | undefined) === undefined\r\n ? undefined\r\n : Array.isArray(props.value) // check if the value already is an array before wrapping it yet in another array to avoid nested arrays [[{...}]]\r\n ? props.value\r\n : [props.value];\r\n\r\n return (\r\n \r\n );\r\n};\r\nexport default ServiceFilter;\r\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M128 41.522C91.867.049 43.399-.377 11.818.076 5.26.17 0 5.516 0 12.075v23.609c0 6.641 5.393 12.037 12.034 12C39.464 47.528 104 52.257 104 104v128H68c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h36v128c0 51.494-62.335 55.801-92.092 55.985C5.314 464.026 0 469.39 0 475.984v23.943c0 6.558 5.258 11.903 11.815 11.999 31.535.46 80.027.054 116.185-41.448 36.132 41.473 84.601 41.899 116.182 41.446 6.558-.094 11.818-5.44 11.818-11.999v-23.608c0-6.641-5.393-12.037-12.034-12C216.538 464.47 152 459.731 152 408V280h36c6.627 0 12-5.373 12-12v-24c0-6.627-5.373-12-12-12h-36V104c0-51.514 62.301-55.805 92.092-55.985C250.686 47.975 256 42.61 256 36.016V12.073C256 5.515 250.742.17 244.185.074 212.65-.386 164.157.02 128 41.522z\"\n});\n\nfunction SvgICursor(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 256 512\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgICursor);\nexport default __webpack_public_path__ + \"static/media/I-cursor.1deb019e.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"\n});\n\nfunction SvgCheck(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 512 512\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgCheck);\nexport default __webpack_public_path__ + \"static/media/check.53b599c1.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"\n});\n\nfunction SvgTimes(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 352 512\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgTimes);\nexport default __webpack_public_path__ + \"static/media/times.c578e4ea.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"\n});\n\nfunction SvgChevronDown(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 448 512\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChevronDown);\nexport default __webpack_public_path__ + \"static/media/chevron-down.bc213772.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\"\n});\n\nfunction SvgChevronUp(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 448 512\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChevronUp);\nexport default __webpack_public_path__ + \"static/media/chevron-up.6f3cb9a5.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M254.812 101.975C254.631 79.9568 249.072 58.0916 235.287 41.7913C221.503 25.491 199.402 14.6276 176.498 13.7931C176.015 13.7753 175.529 13.7647 175.043 13.754C175.078 13.8393 175.117 13.928 175.153 14.0168C176.008 16.1937 171.833 20.4446 168.227 20.4446C166.118 20.4446 162.902 19.2372 161.961 18.669V18.6299C161.56 20.1017 160.969 21.515 160.204 22.8346C156.775 28.7794 150.658 31.7128 146.271 29.6708C145.611 30.6083 144.851 31.8442 144.166 32.938C147.52 35.47 150.201 39.2344 150.201 43.0094C150.201 43.4604 150.183 43.9363 150.154 44.4299C153.076 46.8092 155.305 54.7286 154.769 58.1449C154.491 58.4684 154.173 58.7548 153.821 58.9972C154.333 62.5485 155.458 70.3612 156.04 71.3911C156.693 72.5453 175.035 101.36 176.512 103.562C178.887 103.31 181.127 105.252 181.532 107.994C181.958 110.803 180.325 113.381 177.882 113.754C175.44 114.127 173.111 112.149 172.685 109.34C172.55 108.477 172.616 107.595 172.877 106.762C172.816 106.765 172.754 106.765 172.693 106.762C171.226 105.718 160.499 92.1838 155.405 85.7027C159.182 94.0837 163.598 103.793 164.609 106.19C166.938 106.293 169.015 108.346 169.441 111.162C169.917 114.28 168.163 117.131 165.536 117.533C162.909 117.934 160.374 115.732 159.902 112.614C159.715 111.437 159.861 110.232 160.325 109.134C160.176 109.098 160.027 109.066 159.87 109.02C157.293 106.914 141.699 86.5621 138.269 80.8623C134.134 89.428 130.023 96.0049 127.893 96.5021C121.202 98.0753 101.23 80.0988 97.9713 74.0901L93.5588 79.9639L67.8115 60.6095C50.9958 73.9729 36.9276 89.95 32.7636 108.481C25.8733 138.752 45.4509 175.766 73.9741 205.32C102.433 234.874 139.899 256.963 169.87 249.558C199.842 242.154 222.362 205.32 236.139 175.766C249.917 146.213 255.053 123.939 254.812 101.975Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M137.421 29.9265C139.085 27.4892 140.604 24.9564 141.972 22.341C141.92 21.3134 141.982 20.2832 142.156 19.2692C138.564 20.4529 134.908 21.8225 131.187 23.378L134.283 25.7076L128.958 32.8101C131.755 30.9635 134.283 29.8626 136.342 29.8626C136.702 29.8615 137.063 29.8828 137.421 29.9265Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M115.387 192.514L113.694 194.045L109.938 189.805C108.529 189.494 107.076 189.438 105.646 189.638L111.081 191.903L119.644 201.137C119.547 199.488 119.121 197.875 118.39 196.394C117.659 194.912 116.638 193.593 115.387 192.514Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.203 167.975L108.128 170.979L96.6547 110.8L92.3594 111.62L103.399 169.591C104.248 168.82 104.919 168.209 105.203 167.975Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.92 199.084C99.92 199.084 103.75 190.426 104.389 189.109L110.573 191.687C110.996 190.501 111.358 189.464 111.638 188.654C111.638 188.654 64.9609 185.671 57.8398 185.671L59.2846 192.024C59.2846 192.024 99.7035 210.8 103.072 211.762C103.072 211.762 104.755 207.373 106.672 202.273L99.92 199.084Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M120.936 202.504L192.565 147.662L188.629 142.512L116.506 197.735L120.936 202.504Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.9202 199.084C99.9202 199.084 102.799 192.571 103.981 189.986C102.02 190.541 100.228 191.573 98.7624 192.99C97.2973 194.407 96.2055 196.164 95.5844 198.106C94.9634 200.047 94.8324 202.113 95.2031 204.117C95.5739 206.122 96.4348 208.003 97.7092 209.594C98.9835 211.185 100.632 212.435 102.507 213.234C104.381 214.033 106.425 214.355 108.454 214.171C110.484 213.988 112.436 213.305 114.138 212.183C115.839 211.061 117.237 209.535 118.206 207.742L99.9202 199.084Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M162.431 16.1689C162.431 16.2438 162.431 16.3187 162.409 16.3935C162.413 16.3115 162.42 16.2367 162.431 16.1689Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.287 73.6427L64.084 47.9351\",\n stroke: \"#EDF0F3\",\n strokeWidth: 7,\n strokeMiterlimit: 10\n});\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M129.576 31.9791L95.373 6.27502\",\n stroke: \"#EDF0F3\",\n strokeWidth: 7,\n strokeMiterlimit: 10\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.6113 48.9968C103.13 48.9968 105.983 46.1429 105.983 42.6223C105.983 39.1018 103.13 36.2478 99.6113 36.2478C96.0921 36.2478 93.2393 39.1018 93.2393 42.6223C93.2393 46.1429 96.0921 48.9968 99.6113 48.9968Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M110.694 50.5636L110.823 50.4067L110.694 50.5636Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M108.319 53.5575L108.483 53.3472L108.319 53.5575Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.529 57.2997L105.753 56.9872L105.529 57.2997Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M106.537 55.9189C106.58 55.8654 106.619 55.8084 106.662 55.7513C106.619 55.8084 106.594 55.8654 106.537 55.9189Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M107.681 54.3912L107.887 54.1213L107.681 54.3912Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref18 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M114.574 46.0115L114.625 45.9534L114.574 46.0115Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref19 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M107.066 55.2116C107.134 55.1192 107.201 55.0234 107.272 54.931C107.201 55.0234 107.134 55.1192 107.066 55.2116Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref20 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.5244 73.0176C97.5288 73.041 97.5348 73.0641 97.5426 73.0866C97.5348 73.0641 97.5288 73.041 97.5244 73.0176Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref21 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M104.95 58.1272C105.035 58.0065 105.121 57.8822 105.209 57.7721C105.121 57.8857 105.035 58.0065 104.95 58.1272Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref22 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.8154 70.9294C97.8651 70.7661 97.9148 70.5992 97.9716 70.4287C97.9148 70.5992 97.8651 70.7661 97.8154 70.9294Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref23 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.5168 72.4067C97.5168 72.5346 97.499 72.6589 97.499 72.7619C97.499 72.6589 97.5061 72.5346 97.5168 72.4067Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref24 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.7802 71.0574C97.7482 71.1746 97.7198 71.2882 97.6914 71.4125C97.7198 71.2882 97.7482 71.1746 97.7802 71.0574Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref25 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.656 71.558C97.6312 71.6574 97.6134 71.7533 97.5957 71.8492C97.6134 71.7533 97.6312 71.6574 97.656 71.558Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref26 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M97.5667 72.002C97.5667 72.0978 97.5419 72.1902 97.5312 72.2825C97.5419 72.1902 97.5525 72.0907 97.5667 72.002Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref27 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M111.351 49.7644L111.465 49.6254L111.351 49.7644Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref28 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.7852 66.3804L100.016 65.9507L99.7852 66.3804Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref29 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.4688 69.1289C98.522 68.9975 98.5788 68.8697 98.6356 68.7383C98.5788 68.8697 98.522 68.9975 98.4688 69.1289Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref30 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.7236 68.5395L98.9544 68.0424L98.7236 68.5395Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref31 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.416 67.0905C99.4941 66.9378 99.5722 66.7887 99.6503 66.6324C99.5722 66.7887 99.4941 66.9378 99.416 67.0905Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref32 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.0078 67.9215C99.1037 67.7156 99.2066 67.506 99.3131 67.293C99.2066 67.506 99.1037 67.7156 99.0078 67.9215Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref33 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.0107 70.315C98.0569 70.1765 98.1066 70.0345 98.1634 69.8925C98.1066 70.0416 98.0746 70.1836 98.0107 70.315Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref34 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.2344 69.7078C98.2805 69.587 98.3302 69.4628 98.3799 69.3527C98.3302 69.4628 98.2805 69.6048 98.2344 69.7078Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref35 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M101.582 63.2445L101.855 62.7935L101.582 63.2445Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref36 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M103.065 60.8971C103.225 60.6521 103.388 60.407 103.555 60.1584C103.399 60.407 103.225 60.6521 103.065 60.8971Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref37 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M102.064 62.4596L102.334 62.0299L102.064 62.4596Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref38 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M102.558 61.682L102.845 61.2345L102.558 61.682Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref39 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M103.808 59.782L104.092 59.3665L103.808 59.782Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref40 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M100.162 65.6985C100.244 65.5493 100.329 65.3966 100.418 65.2439C100.329 65.3788 100.244 65.5315 100.162 65.6985Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref41 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M100.56 64.9882C100.687 64.768 100.815 64.5443 100.95 64.317C100.812 64.5301 100.684 64.7538 100.56 64.9882Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref42 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M101.397 63.5428C101.28 63.7346 101.17 63.9264 101.042 64.1146C101.17 63.9228 101.269 63.7346 101.397 63.5428Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref43 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M104.383 58.951L104.642 58.5746L104.383 58.951Z\",\n fill: \"#EDF0F3\"\n});\n\nvar _ref44 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M93.5981 105.828C91.5357 105.828 77.8118 104.002 77.1622 104.002C76.5126 104.002 74.9258 104.414 74.9258 105.476C74.9258 109.07 86.47 112.252 98.1952 112.252C109.92 112.252 93.5981 105.828 93.5981 105.828Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref45 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M55.1565 234.849C79.8789 234.849 99.9204 214.8 99.9204 190.067C99.9204 165.335 79.8789 145.286 55.1565 145.286C30.4341 145.286 10.3926 165.335 10.3926 190.067C10.3926 214.8 30.4341 234.849 55.1565 234.849Z\",\n stroke: \"#0B1B2D\",\n strokeWidth: 16,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref46 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M214.844 234.849C239.566 234.849 259.608 214.8 259.608 190.067C259.608 165.335 239.566 145.286 214.844 145.286C190.122 145.286 170.08 165.335 170.08 190.067C170.08 214.8 190.122 234.849 214.844 234.849Z\",\n stroke: \"#0B1B2D\",\n strokeWidth: 16,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref47 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M215.543 184.731L174.878 110.426L171.431 112.314L212.096 186.619L215.543 184.731Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref48 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M192.568 144.377H97.499V147.083H192.568V144.377Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref49 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M99.5344 142.226L52.2168 187.194L55.537 190.69L102.855 145.723L99.5344 142.226Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref50 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.203 167.975C104.099 168.934 97.1729 175.39 97.1729 175.39L113.694 194.045L116.747 191.271L110.258 173.16L105.203 167.975Z\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref51 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M155.412 85.6814C160.506 92.1624 171.234 105.696 172.7 106.74C172.762 106.744 172.823 106.744 172.885 106.74C172.624 107.574 172.558 108.456 172.693 109.319C173.119 112.128 175.448 114.102 177.89 113.733C180.332 113.364 181.965 110.782 181.539 107.973C181.121 105.231 178.895 103.289 176.52 103.541C175.043 101.339 156.701 72.5239 156.048 71.3698C155.466 70.3434 154.34 62.5129 153.829 58.9758\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref52 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M150.155 44.4229C153.076 46.8022 155.306 54.7215 154.769 58.1378C153.066 60.1692 149.058 60.9362 146.782 60.8297\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref53 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M144.181 32.9486C147.532 35.4807 150.198 39.245 150.198 43.02C150.198 47.2815 148.778 53.4359 146.63 60.0661\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref54 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M138.267 80.8234C134.135 89.4316 130.024 96.005 127.894 96.5022C120.602 98.2175 97.5176 76.6968 97.5176 72.7762C97.5176 64.6545 124.852 29.8556 136.36 29.8556C136.716 29.8574 137.072 29.8811 137.425 29.9266\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref55 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M139.931 34.22C140.932 34.8557 141.968 35.3138 142.753 35.2854C143.296 34.4544 145 31.4997 146.281 29.6886\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref56 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M141.972 22.3409C140.604 24.957 139.084 27.491 137.421 29.93\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref57 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M141.162 40.7898C139.215 35.8543 136.552 31.2329 133.257 27.0748\",\n stroke: \"#0B1B2D\",\n strokeWidth: 4,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref58 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M98.8057 72.3392C104.358 74.4132 121.482 72.4848 133.967 69.7539\",\n stroke: \"#0B1B2D\",\n strokeWidth: 4,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref59 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M142.21 24.1841C141.888 22.6167 141.861 21.003 142.129 19.4254\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref60 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M162.43 16.1689C162.171 18.5259 161.416 20.8013 160.215 22.8453C156.665 29.0245 150.179 31.9685 145.767 29.4187C144.928 28.9315 144.202 28.2718 143.637 27.4833\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref61 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M143.158 13.7647C143.513 11.634 145.778 5.84897 149.211 4.05203C153.016 2.05267 155.405 3.40925 158.068 3.40925C160.46 3.40925 162.359 2.24444 164.997 2.4078C168.423 2.62087 168.852 6.01588 169.388 7.62461C170.098 9.75536 173.577 9.96844 175.171 14.0169C176.026 16.1938 171.852 20.4447 168.245 20.4447C166.137 20.4447 162.92 19.2372 161.98 18.669C162.178 17.8406 162.335 17.0026 162.448 16.1583C161.174 16.1583 153.286 14.578 152.643 14.6135C152.001 14.649 149.644 17.0426 149.427 17.5433C148.458 17.3803 147.5 17.1621 146.555 16.8899\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref62 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M143.989 19.7344C143.836 19.757 143.681 19.7688 143.527 19.7699C143.019 19.77 142.519 19.6417 142.074 19.3969C141.629 19.152 141.253 18.7987 140.981 18.3696C140.709 17.9405 140.55 17.4496 140.519 16.9425C140.487 16.4354 140.584 15.9285 140.801 15.4689C141.017 15.0094 141.346 14.612 141.758 14.3138C142.169 14.0156 142.649 13.8262 143.153 13.7632C143.657 13.7001 144.168 13.7655 144.64 13.9533C145.112 14.1411 145.529 14.4451 145.852 14.8372\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref63 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M146.374 50.4849C147.286 52.8287 147.847 54.9488 147.914 56.4652C146.661 58.4965 133.449 63.3795 130.768 62.9889C126.864 58.4965 122.174 37.2848 130.293 34.0034C130.737 33.8235 131.209 33.7191 131.688 33.6945\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref64 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M131.798 62.964C133.157 66.7994 136.544 76.8353 137.648 79.687C138.869 82.8476 157.052 106.677 159.852 108.981C160.009 109.028 160.158 109.059 160.307 109.095C159.844 110.193 159.697 111.398 159.884 112.575C160.357 115.693 162.881 117.902 165.518 117.494C168.156 117.085 169.909 114.241 169.423 111.123C168.997 108.324 166.92 106.272 164.592 106.151C162.817 101.953 150.623 75.3544 149.657 72.691C148.791 70.3187 146.796 61.3979 146.175 57.7756\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref65 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M104.39 189.109C103.751 190.426 99.9209 199.084 99.9209 199.084L122.463 209.738L124.177 205.988L111.092 191.9L104.39 189.109Z\",\n stroke: \"#0B1B2D\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref66 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M55.1563 196.208C58.5461 196.208 61.294 193.459 61.294 190.067C61.294 186.676 58.5461 183.927 55.1563 183.927C51.7665 183.927 49.0186 186.676 49.0186 190.067C49.0186 193.459 51.7665 196.208 55.1563 196.208Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref67 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M214.844 196.208C218.234 196.208 220.982 193.459 220.982 190.067C220.982 186.676 218.234 183.927 214.844 183.927C211.454 183.927 208.706 186.676 208.706 190.067C208.706 193.459 211.454 196.208 214.844 196.208Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref68 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M127.893 96.5021C120.871 98.1534 99.2171 78.2699 97.6125 73.2875C94.091 76.4517 86.9629 85.5607 86.9629 95.419C86.9629 109.837 115.919 132.384 126.398 139.455C124.375 144.693 104.336 187.727 103.679 189.751C105.241 191.04 109.931 192.788 111.677 192.788C121.326 185.064 148.166 144.135 148.628 140.19C149.008 136.898 133.289 106.549 127.999 96.4524C127.965 96.4716 127.93 96.4882 127.893 96.5021Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref69 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M131.06 93.5227C129.782 95.2451 128.685 96.314 127.865 96.5022C126.58 96.8041 124.805 96.385 122.753 95.4652C117.485 105.071 126.626 133.229 126.626 133.229C126.626 133.229 106.009 165.628 104.674 167.744C104.674 169.52 107.237 172.652 109.686 174.101C114.255 172.325 159.615 130.175 161.823 120.076C159.324 116.372 138.362 98.395 131.06 93.5227Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref70 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M160.012 113.158L157.013 114.223L158.032 117.089L161.429 115.881C160.74 115.104 160.253 114.168 160.012 113.158Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref71 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M181.539 107.987C181.573 108.229 181.593 108.474 181.6 108.718L186.701 106.907L185.682 104.052L180.733 105.81C181.147 106.473 181.421 107.214 181.539 107.987Z\",\n fill: \"#0B1B2D\"\n});\n\nvar _ref72 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M173.537 111.581C173.1 110.9 172.812 110.133 172.692 109.333C172.661 109.113 172.639 108.893 172.629 108.676L169.143 109.915C169.499 110.912 169.607 111.981 169.459 113.03L173.537 111.581Z\",\n fill: \"#0B1B2D\"\n});\n\nfunction SvgNotavailable(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 270,\n height: 251,\n viewBox: \"0 0 270 251\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33, _ref34, _ref35, _ref36, _ref37, _ref38, _ref39, _ref40, _ref41, _ref42, _ref43, _ref44, _ref45, _ref46, _ref47, _ref48, _ref49, _ref50, _ref51, _ref52, _ref53, _ref54, _ref55, _ref56, _ref57, _ref58, _ref59, _ref60, _ref61, _ref62, _ref63, _ref64, _ref65, _ref66, _ref67, _ref68, _ref69, _ref70, _ref71, _ref72);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgNotavailable);\nexport default __webpack_public_path__ + \"static/media/notavailable.274e4f98.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M269.97 117.824C269.034 86.0372 248.314 53.7649 220.257 41.9969C192.152 30.2847 156.785 39.0662 121.652 39.3596C117.209 39.398 112.769 39.2967 108.358 39.1221L105.381 41.3052L100.697 44.449L99.9987 39.1675L100.159 38.7169L99.6075 38.6854C101.668 44.8332 99.1045 53.9431 99.1045 57.4291C99.0922 58.0934 98.8572 58.7342 98.4373 59.249L98.9717 58.8997L99.2337 57.1322L99.8974 52.3083L100.317 49.8073L103.572 52.0813L109.412 60.4052L110.408 62.4661C118.791 67.9397 126.127 81.4963 126.127 83.7108C126.127 84.2104 125.624 84.9893 124.778 85.9324C125.854 87.3296 129.948 93.3482 130.563 94.7174C131.894 93.5822 174.631 57.754 175.333 57.2685C176.035 56.7829 177.251 56.8214 177.726 57.1427C178.111 57.3954 178.391 57.7806 178.511 58.2255C178.632 58.6703 178.585 59.1439 178.379 59.5564C178.002 60.255 172.689 64.9287 172.689 64.9287C173.122 65.4667 175.34 71.0905 172.5 73.7312C170.569 75.5301 168.379 76.1274 166.272 75.0166C164.875 76.5256 131.475 113.44 125.648 113.44C124.569 113.44 122.431 111.914 119.996 109.626L121.516 111.477C122.057 118.313 121.935 123.21 121.167 124.248C116.769 130.109 85.3034 134.828 72.2639 125.484C71.2544 124.765 70.4195 121.247 69.9724 116.098C63.4404 112.717 59.619 109.612 59.144 104.047C58.8436 100.394 62.8222 91.1231 63.4544 90.1974C62.5846 89.6141 61.9664 89.0936 61.7288 88.6849C60.2722 86.2224 67.7648 72.7776 76.5987 65.9522L76.3507 67.042C77.3167 64.64 78.4598 62.3131 79.7704 60.0804C76.7664 58.1941 74.8802 55.6477 74.8802 51.8892C74.8802 48.8851 76.5254 43.4325 77.5803 37.3825C58.9379 36.4848 42.1014 36.9354 29.3762 44.2289C7.06262 56.9855 -2.65854 90.7109 0.621436 119.637C3.84203 148.629 20.0009 172.923 34.8149 197.458C49.6324 222.05 62.9828 246.934 85.1742 260.683C107.425 274.501 138.457 277.254 164.571 267.358C190.629 257.462 211.825 234.918 231.851 207.976C251.936 181.003 270.851 149.677 269.97 117.824Z\",\n fill: \"#EDF0F4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M70.0039 93.6626L70.2484 93.7954C70.2484 93.6591 70.2728 93.5194 70.2868 93.3832L70.21 93.7534L70.0039 93.6626Z\",\n fill: \"#EDF0F4\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M83.4032 61.7675L89.3414 62.3439L94.05 61.5859L95.0979 60.8663C93.108 61.6577 90.9902 62.0791 88.8489 62.1099C85.1218 62.1099 81.992 61.303 79.6517 59.8324L80.0429 60.3075L83.4032 61.7675Z\",\n fill: \"#EDF0F4\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M72.2778 124.786C72.5049 129.365 72.2778 302.83 72.2778 302.83H84.3812L102.894 188.834\",\n fill: \"#081829\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M63.4858 89.9844C62.8536 90.903 58.875 100.184 59.1754 103.838C59.6365 109.427 63.4719 112.518 70.0318 115.91\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M76.6407 65.7461C67.8067 72.5715 60.3142 86.0058 61.7673 88.4789C62.4659 89.6351 66.1091 91.6959 70.2624 93.5682\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M110.251 12.3689C113.192 16.7527 114.278 22.9948 112.72 29.3696C110.918 36.7399 106.056 42.3288 100.453 44.3163\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M121.558 110.779C122.099 117.614 121.977 122.512 121.208 123.549C116.814 129.41 85.3488 134.13 72.3058 124.786C68.5263 122.082 67.164 80.2388 79.6901 59.8149\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M100.048 49.4929C104.051 51.1836 107.495 55.8677 110.394 62.1098\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M72.2778 302.83V311.154H100.708V306.452L84.3813 302.83\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M100.708 301.345V311.154H130.483V307.339L112.371 301.345\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M124.604 85.4784C125.152 86.0652 129.931 93.0339 130.598 94.5219C131.929 93.3867 174.666 57.555 175.368 57.0694C176.07 56.5839 177.286 56.6258 177.761 56.9472C178.146 57.1992 178.425 57.5838 178.546 58.0281C178.666 58.4723 178.619 58.9453 178.414 59.3574C178.037 60.056 172.724 64.7297 172.724 64.7297C173.157 65.2711 175.372 70.8949 172.535 73.5357C170.6 75.3346 168.414 75.9319 166.304 74.8176C164.907 76.3301 131.509 113.241 125.683 113.241C122.986 113.241 113.733 103.751 109.566 96.6003\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M95.0735 69.7526C95.0735 81.2797 104.155 97.3477 107.299 97.3477C110.443 97.3477 126.162 85.8207 126.162 83.0262C126.162 80.2318 113.936 59.6228 103.457 59.6228C99.2651 59.6228 95.0735 64.1638 95.0735 69.7526Z\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M94.0291 23.6478C100.051 23.6932 110.984 11.8798 110.984 11.4222C110.984 10.3743 109.126 4.83777 98.343 4.83777C90.6408 4.83777 78.5199 10.231 78.5199 27.9443C78.5199 37.0646 74.9535 46.8068 74.9535 51.208C74.9535 57.8972 80.3468 62.1133 88.8593 62.1133C92.9707 62.1133 99.1534 60.0873 99.1534 56.7619C99.1534 51.8996 104.141 36.1006 94.6124 32.6599\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M95.7092 32.1779C95.1397 32.5493 94.475 32.7483 93.795 32.7508C91.6188 32.7508 89.8549 30.7108 89.8549 28.1923C89.8549 25.6738 91.6188 23.6514 93.795 23.6514C94.2013 23.651 94.6044 23.7219 94.9861 23.861\",\n stroke: \"#081829\",\n strokeWidth: 2.5,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n});\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M255.17 0H186.005V51.1313H255.17V0Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref18 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M220.586 124.639C236.849 124.639 250.032 111.455 250.032 95.1925C250.032 78.9297 236.849 65.7461 220.586 65.7461C204.323 65.7461 191.139 78.9297 191.139 95.1925C191.139 111.455 204.323 124.639 220.586 124.639Z\",\n fill: \"#E0E5EC\"\n});\n\nvar _ref19 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M72.2778 124.786C73.3406 125.325 74.3706 125.927 75.3622 126.588L79.6412 128.642L80.235 130.885L104.48 186.745L102.908 188.841\",\n fill: \"#081829\"\n});\n\nvar _ref20 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M121.208 123.549C117.247 128.831 91.301 133.183 76.6581 127.154L110.635 206.977L100.708 301.345H112.371C112.371 301.345 135.076 219.489 135.076 215.884C135.076 212.28 121.208 123.549 121.208 123.549Z\",\n fill: \"#081829\"\n});\n\nfunction SvgNotAllowed(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 270,\n height: 313,\n viewBox: \"0 0 270 313\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgNotAllowed);\nexport default __webpack_public_path__ + \"static/media/notAllowed.57f975c6.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 0H4C1.79086 0 0 1.79086 0 4V16C0 18.2091 1.79086 20 4 20H16C18.2091 20 20 18.2091 20 16V4C20 1.79086 18.2091 0 16 0Z\",\n fill: \"#0086C9\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.12927 14.179L4.3376 10.3873C4.1098 10.1595 4.1098 9.7902 4.3376 9.56238L5.16253 8.73742C5.39033 8.5096 5.7597 8.5096 5.9875 8.73742L8.54175 11.2916L14.0127 5.82075C14.2405 5.59295 14.6098 5.59295 14.8376 5.82075L15.6626 6.64571C15.8904 6.87351 15.8904 7.24285 15.6626 7.47067L8.95423 14.179C8.72641 14.4068 8.35706 14.4068 8.12927 14.179Z\",\n fill: \"white\"\n});\n\nfunction SvgChecked(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 20,\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChecked);\nexport default __webpack_public_path__ + \"static/media/checked.b5d24de9.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4 0.5H16C17.933 0.5 19.5 2.067 19.5 4V16C19.5 17.933 17.933 19.5 16 19.5H4C2.067 19.5 0.5 17.933 0.5 16V4C0.5 2.067 2.067 0.5 4 0.5Z\",\n fill: \"white\",\n stroke: \"#CDD5DF\"\n});\n\nfunction SvgUnchecked(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 20,\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUnchecked);\nexport default __webpack_public_path__ + \"static/media/unchecked.bc2fa9d4.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 0H4C1.79086 0 0 1.79086 0 4V16C0 18.2091 1.79086 20 4 20H16C18.2091 20 20 18.2091 20 16V4C20 1.79086 18.2091 0 16 0Z\",\n fill: \"#0086C9\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.3571 8.75H4.64286C4.14983 8.75 3.75 9.12318 3.75 9.58333V10.4167C3.75 10.8768 4.14983 11.25 4.64286 11.25H15.3571C15.8502 11.25 16.25 10.8768 16.25 10.4167V9.58333C16.25 9.12318 15.8502 8.75 15.3571 8.75Z\",\n fill: \"white\"\n});\n\nfunction SvgUndeterminate(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 20,\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUndeterminate);\nexport default __webpack_public_path__ + \"static/media/undeterminate.f42039b4.svg\";\nexport { ForwardRef as ReactComponent };","import { SvgIcon } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { ReactComponent as IcursorIcon } from './I-cursor.svg';\r\nimport { ReactComponent as CheckIcon } from './check.svg';\r\nimport { ReactComponent as TimesIcon } from './times.svg';\r\nimport { ReactComponent as ChevronDownIcon } from './chevron-down.svg';\r\nimport { ReactComponent as ChevronUpIcon } from './chevron-up.svg';\r\nimport { ReactComponent as NotAvailableIcon } from './notavailable.svg';\r\nimport { ReactComponent as NotAllowedIcon } from './notAllowed.svg';\r\n\r\nimport { ReactComponent as CheckedIcon } from './checked.svg';\r\nimport { ReactComponent as UncheckedIcon } from './unchecked.svg';\r\nimport { ReactComponent as UndeterminateIcon } from './undeterminate.svg';\r\n\r\nexport function Search(props) {\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\nexport function ICursor(props) {\r\n return ;\r\n}\r\nexport function Check(props) {\r\n return ;\r\n}\r\nexport function Times(props) {\r\n return ;\r\n}\r\nexport function ChevronDown(props) {\r\n return (\r\n \r\n );\r\n}\r\nexport function ChevronUp(props) {\r\n return ;\r\n}\r\nexport function TableHeaderIcon(props) {\r\n return ;\r\n}\r\nexport function NotAvailableSVG(props) {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport function NotAllowedSVG(props) {\r\n return (\r\n \r\n );\r\n}\r\nexport function Checked(props) {\r\n return ;\r\n}\r\nexport function Unchecked(props) {\r\n return ;\r\n}\r\nexport function Indeterminate(props) {\r\n return ;\r\n}\r\n","/**\r\n *\r\n * RoomTSPicker\r\n *\r\n */\r\n\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePickerProps,\r\n AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RoomTSPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/RoomFilter';\r\nexport const initRoomTSData = (id: string) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\n\r\n/* const loadData = (searchTerm: string | null) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name',\r\n $top: 1000,\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n}; */\r\n\r\nconst loadData = getAutoCompleteLoadDataFn>({ url });\r\n\r\nexport function RoomTSPicker(props: RoomTSPickerProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * RoomTSFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { RoomTSPicker } from 'app/components/pickers/AutocompletePickers/RoomTSPicker';\r\n\r\nexport const RoomTSFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined | null}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n ariaLabel={props.label}\r\n size=\"small\"\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default RoomTSFilter;\r\n","/**\r\n *\r\n * TrainingProgramPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { TrainingProgramAssetsDto } from 'app/pages/TrainingWaitingListPage/Actions/AddToWaitingList';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IApplyGlobalServiceGroupFilter } from 'types/IApplyGlobalServiceGroupFilter';\r\n\r\nexport interface TrainingProgramsMultiPickerProps\r\n extends Omit, 'loadData'>,\r\n IApplyGlobalServiceGroupFilter {\r\n ServiceGroupId?: number;\r\n}\r\nconst url = '/api/odata/v4/TrainingProgramsFilter';\r\nexport const initTrainingProgramMultiData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const ids = initval.split('|').map(v => parseInt(v));\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id in (' + ids.map(v => \"'\" + v + \"'\").join(',') + '))',\r\n $select: 'Id,Name,ServiceGroupId',\r\n $skip: 0,\r\n $top: ids.length,\r\n };\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport function withServiceGroupFilter(\r\n globalServiceGroupFilter?: Identifiable[],\r\n) {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select: string } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,ServiceGroupId',\r\n };\r\n\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n };\r\n}\r\nexport function TrainingProgramsMultiPicker(\r\n props: TrainingProgramsMultiPickerProps,\r\n) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const loadData = withServiceGroupFilter(\r\n props.applyGlobalServiceGroupFilter\r\n ? globalServiceGroupFilter || []\r\n : props.ServiceGroupId !== undefined\r\n ? [{ Id: props.ServiceGroupId }]\r\n : undefined,\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import { TrainingProgramsMultiPicker } from 'app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const TrainingProgramsMultiFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity[]) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n []}\r\n isOpen={false}\r\n placeholder={t(translations.AllValues)}\r\n size=\"small\"\r\n ariaLabel={props.label}\r\n id={props.id}\r\n />\r\n );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { CampusPickerFilter } from 'app/components/BasicTable/Filters';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport {\r\n arrayToQueryString,\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n getDefaultFilterDatePeriod,\r\n getNumberEntityArray,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetStringOrUndefined,\r\n initMultiPickerValue,\r\n initPickerValue,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { IsAssetFieldEnabled } from 'types/AppSettings';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { initRoomTSData } from 'app/components/pickers/AutocompletePickers/RoomTSPicker';\r\nimport RoomTSFilter from 'app/components/BasicTable/Filters/RoomTSFilter';\r\nimport { TrainingProgramsMultiFilter } from 'app/components/BasicTable/Filters/TrainingProgramsMultiFilter';\r\nimport { initTrainingProgramMultiData } from 'app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { IsEntityType } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport UserFilter from 'app/components/BasicTable/Filters/UserFilter';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\n\r\n//SG=&eqid=1&campus=&building=&room=&defaultSGids=AllCores&nextonly=false&period=5&Start=2021-11-01T00%3A00%3A00&End=2021-12-01T00%3A00%3A00&sSortCol_0=AssetId\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const result: IFilterSettings[] = [\r\n {\r\n fieldName: 'ServiceId',\r\n displayName: t(translations.TrainingProgram),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('eqid'),\r\n value: getNumberEntityArray(params, 'eqid'),\r\n component: TrainingProgramsMultiFilter,\r\n initData: initMultiPickerValue(initTrainingProgramMultiData),\r\n urlKey: 'eqid',\r\n },\r\n {\r\n fieldName: 'StartDate',\r\n displayName: t(translations.CustomDatePeriods),\r\n operator: ODataOperators.Between,\r\n component: DatesRangeFilter,\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'start',\r\n 'end',\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'start', 'end', params),\r\n urlKey: 'period',\r\n },\r\n // hidden filter on the task https://prog4biz.atlassian.net/browse/BKT-8217, due to no relevant to the data source,\r\n // because a source is return only next sessions\r\n // {\r\n // fieldName: 'HasNextSession',\r\n // displayName: t(translations.HasNextSession),\r\n // operator: ODataOperators.Equals,\r\n // component: BooleanPickerFilter,\r\n // queryStringSerializer: 'HNS',\r\n // value: GetBooleanEntity(\r\n // GetBooleanOrUndefined(GetRawValue(params, 'HNS')),\r\n // t,\r\n // ),\r\n // customFilter(value, settings) {\r\n // if (IsEntityType(value) && value.Id === true) {\r\n // return new Condition(\r\n // settings.fieldName,\r\n // settings.operator,\r\n // value,\r\n // ).toString();\r\n // }\r\n // },\r\n // notNullable: true,\r\n // },\r\n {\r\n fieldName: 'TrainingState',\r\n displayName: t(translations.ShowOnlyWithAvailability),\r\n operator: ODataOperators.Includes,\r\n component: BooleanPickerFilter,\r\n queryStringSerializer: 'OWF',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'OWF')),\r\n t,\r\n ),\r\n customFilter(value, settings) {\r\n if (IsEntityType(value) && value.Id === true) {\r\n return new Condition(settings.fieldName, settings.operator, [\r\n TrainingState.Available,\r\n TrainingState.UnderMinimum,\r\n ]).toString();\r\n }\r\n },\r\n urlKey: 'OWF',\r\n },\r\n {\r\n fieldName: 'IsUpcoming',\r\n displayName: t(translations.UpcomingSessionsOnly),\r\n operator: ODataOperators.Equals,\r\n component: BooleanPickerFilter,\r\n queryStringSerializer: 'upcoming',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'upcoming')),\r\n t,\r\n ),\r\n customFilter(value, settings) {\r\n if (IsEntityType(value) && value.Id === true) {\r\n return new Condition(\r\n settings.fieldName,\r\n settings.operator,\r\n value,\r\n settings.fieldName1,\r\n ).toString();\r\n }\r\n },\r\n urlKey: 'upcoming',\r\n },\r\n {\r\n fieldName: 'Trainer',\r\n displayName: t(translations.TrainerName),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'trainer',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'trainer')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n },\r\n ];\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Building)) {\r\n result.push({\r\n fieldName: 'BuildingId',\r\n displayName: t(translations.Building),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'building',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'building')),\r\n ),\r\n initData: initPickerValue(initBuildingData),\r\n component: BuildingPickerFilter,\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Room)) {\r\n result.push({\r\n fieldName: 'Room',\r\n displayName: t(translations.Room),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'room',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'room')),\r\n ),\r\n initData: initPickerValue(initRoomTSData),\r\n component: RoomTSFilter,\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Campus)) {\r\n result.push({\r\n fieldName: 'CampusId',\r\n displayName: t(translations.Campus),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'campus',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'campus')),\r\n ),\r\n initData: initPickerValue(initCampusData),\r\n component: CampusPickerFilter,\r\n });\r\n }\r\n return result;\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { IRequestTypeFilterDto } from 'api/odata/generated/entities/IRequestTypeFilterDto';\r\n\r\nexport interface ActiveSampleTypesPickerProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ActiveSampleTypesFilter';\r\n\r\nexport const initActiveSampleTypesData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'HideProjects',\r\n 'ProjectIsRequired',\r\n ],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n isOptionalServiceGroup: true,\r\n });\r\n\r\nexport const loadActiveSampleTypes = loadData;\r\n\r\nexport function ActiveSampleTypesPicker(props: ActiveSampleTypesPickerProps) {\r\n const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n const innerLoadData = loadData(\r\n props.predicates,\r\n globalServiceGroupFilter || [],\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RelevantBudgetPickerProps\r\n extends Omit>, 'loadData'> {\r\n userGroupId: string;\r\n userName: string;\r\n serviceId?: number;\r\n fundingTypeId?: number;\r\n}\r\n\r\nconst url = '/api/odata/v4/BudgetFilter';\r\n\r\nexport const RelevantBudgetPicker = (props: RelevantBudgetPickerProps) => {\r\n const loadData = (searchTerm: string | null) => {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select?: string;\r\n userGroupId?: string;\r\n userName?: string;\r\n serviceId?: number;\r\n $top?: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,IsDefault,FundingTypeId,PurchaseOrderOptionId',\r\n $top: 200,\r\n };\r\n params.userGroupId = props.userGroupId;\r\n params.userName = props.userName;\r\n params.serviceId = props.serviceId;\r\n if (searchTerm !== null || props.fundingTypeId !== undefined) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates:\r\n props.fundingTypeId !== undefined\r\n ? [\r\n `${new Condition(\r\n 'FundingTypeId',\r\n ODataOperators.Equals,\r\n props.fundingTypeId,\r\n ).toString()}`,\r\n ]\r\n : [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n };\r\n return (\r\n \r\n );\r\n};\r\nexport const DefaultBudget = (\r\n userGroupId: string | null,\r\n userName: string,\r\n selectedBudget: Entity | null,\r\n serviceId?: number,\r\n fundingTypeId?: number,\r\n): Promise | null> => {\r\n return new Promise((resolve, reject) => {\r\n (async () => {\r\n try {\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select?: string;\r\n userGroupId?: string;\r\n userName?: string;\r\n serviceId?: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,IsDefault,FundingTypeId,PurchaseOrderOptionId',\r\n };\r\n params.userGroupId = userGroupId ?? undefined;\r\n params.userName = userName;\r\n params.serviceId = serviceId;\r\n\r\n let budgets = await httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n if (!!budgets && budgets.length > 0) {\r\n let filtered =\r\n fundingTypeId !== undefined\r\n ? budgets.filter(\r\n f => (f as IBudgetFilterDto).FundingTypeId === fundingTypeId,\r\n )\r\n : budgets;\r\n if (selectedBudget !== null) {\r\n if (filtered.some(f => f.Id === selectedBudget.Id)) {\r\n resolve(selectedBudget);\r\n } else {\r\n if (filtered.length === 1) {\r\n resolve(filtered[0]);\r\n } else {\r\n let defaults = filtered.filter(\r\n f => (f as IBudgetFilterDto).IsDefault === true,\r\n );\r\n if (!!defaults && defaults.length > 0) {\r\n resolve(defaults[0]);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n }\r\n } else {\r\n if (filtered.length === 1) {\r\n resolve(filtered[0]);\r\n } else {\r\n let defaults = filtered.filter(\r\n f => (f as IBudgetFilterDto).IsDefault === true,\r\n );\r\n if (!!defaults && defaults.length > 0) {\r\n resolve(defaults[0]);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n }\r\n } else {\r\n resolve(null);\r\n }\r\n } catch {\r\n resolve(null);\r\n }\r\n })();\r\n });\r\n};\r\n","import * as React from 'react';\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { ServiceRequestsApi } from 'api/ServiceRequestsApi';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport {\r\n ActiveSampleTypesPicker,\r\n initActiveSampleTypesData,\r\n} from 'app/components/pickers/AutocompletePickers/ActiveSampleTypesPicker';\r\nimport {\r\n DefaultBudget,\r\n RelevantBudgetPicker,\r\n} from 'app/components/pickers/AutocompletePickers/RelevantBudgetPicker';\r\nimport {\r\n ServicesFilter,\r\n UserPicker,\r\n} from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { Alert, Skeleton } from '@material-ui/lab';\r\nimport {\r\n convertAuthToIUserFilterDto,\r\n IUserFilterDto,\r\n} from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IRequestTypeFilterDto } from 'api/odata/generated/entities/IRequestTypeFilterDto';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { ServiceRequestDetailsProps } from 'app/pages/Samples/RequestSamplesPage';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Roles } from 'app/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport {\r\n FundingTypeIdPicker,\r\n getSingleInvoiceFundingType,\r\n} from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport {\r\n RestrictedFilter,\r\n RestrictedUserGroupPicker,\r\n} from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\n\r\nexport interface CreateNewRequestParams {\r\n isOpen: boolean;\r\n setOpen: (val: boolean) => void;\r\n serviceId?: number;\r\n error?: string;\r\n}\r\nexport const CreateNewRequest = ({\r\n isOpen,\r\n setOpen,\r\n serviceId,\r\n ...props\r\n}: CreateNewRequestParams) => {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const appSettings = useSelector(selectAppSettings);\r\n const [error, setError] = React.useState(props.error);\r\n const [chosenUser, setChosenUser] = useState(\r\n authenticatedUser !== undefined\r\n ? convertAuthToIUserFilterDto(authenticatedUser)\r\n : null,\r\n );\r\n const [chosenUserGroup, setChosenUserGroup] = useState(\r\n !!authenticatedUser\r\n ? {\r\n Id: authenticatedUser.ActiveUserGroup?.Id ?? '',\r\n Name: authenticatedUser.ActiveUserGroup?.Name ?? '',\r\n DepartmentId: null,\r\n DepartmentName: null,\r\n InstituteId: null,\r\n InstituteName: null,\r\n InstituteTypeId: null,\r\n InstituteTypeName: null,\r\n AffiliatedGroups: [],\r\n IsUserOwneGroup: true,\r\n }\r\n : null,\r\n );\r\n const [chosenFundingType, setFundingType] = React.useState | null>(null);\r\n const [chosenPurchaseOrder, setPurchaseOrder] = React.useState(\r\n null,\r\n );\r\n const [chosenBudget, setChosenBudget] = useAsyncExtendedState | null>(null);\r\n const [busy, setBusy] = useState(false);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const globalSettings = useGlobalSettingsHook();\r\n const [service, setService] = useAsyncExtendedState | null>(\r\n null,\r\n );\r\n\r\n const [getServiceRequest, getService] = usePromise(\r\n React.useCallback((serviceId?: number) => {\r\n return initActiveSampleTypesData(serviceId?.toString()).then(d => d[0]);\r\n }, []),\r\n );\r\n const isAdmin = React.useMemo(() => {\r\n return (\r\n authenticatedUser !== undefined &&\r\n authenticatedUser.IsAdminOf({\r\n ServiceTypeId: ServiceType.Sample,\r\n ServiceId: service?.Id,\r\n ServiceGroupId: (service as IRequestTypeFilterDto)?.ServiceGroupId,\r\n } as IIsAdminOfParams)\r\n );\r\n }, [authenticatedUser, service]);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n authenticatedUser !== undefined &&\r\n (authenticatedUser.Roles.includes(Roles.CalendarOnly) ||\r\n authenticatedUser.Roles.includes(Roles.Readonly) ||\r\n authenticatedUser.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [authenticatedUser]);\r\n\r\n const showProject = React.useMemo(() => {\r\n return (\r\n service !== null &&\r\n service !== undefined &&\r\n IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n (service as IRequestTypeFilterDto).HideProjects === false &&\r\n ((service as IRequestTypeFilterDto).ProjectIsRequired !== false ||\r\n isAdmin)) ||\r\n !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n );\r\n }, [appSettings, isAdmin, service]);\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType) &&\r\n IsBudgetFieldEnabled(appSettings, BudgetFields.PurchaseOrderOption) &&\r\n showProject\r\n );\r\n }, [appSettings, showProject]);\r\n const purchaseOrderLength = React.useMemo(() => {\r\n return globalSettings.purchaseOrderLengthSetting ?? 0;\r\n }, [globalSettings.purchaseOrderLengthSetting]);\r\n\r\n const purchaseOrderVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n ((chosenBudget as IBudgetFilterDto)?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden\r\n );\r\n }, [chosenBudget, globalSettings.purchaseOrderBudgetEnabled]);\r\n const purchaseOrderRequired = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n (chosenBudget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory &&\r\n chosenPurchaseOrder === null\r\n );\r\n }, [\r\n chosenBudget,\r\n chosenPurchaseOrder,\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n ]);\r\n const purchaseLengthInvalid = React.useMemo(() => {\r\n return (\r\n purchaseOrderVisible &&\r\n (purchaseOrderRequired ||\r\n (!purchaseOrderRequired && (chosenPurchaseOrder?.length ?? 0) > 0)) &&\r\n (chosenPurchaseOrder?.length ?? 0) < purchaseOrderLength\r\n );\r\n }, [\r\n chosenPurchaseOrder?.length,\r\n purchaseOrderLength,\r\n purchaseOrderRequired,\r\n purchaseOrderVisible,\r\n ]);\r\n const projectIsRequired = React.useMemo(() => {\r\n return (\r\n service !== null &&\r\n service !== undefined &&\r\n IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n (chosenBudget === null || chosenBudget === undefined) &&\r\n ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n (service as IRequestTypeFilterDto).HideProjects === false &&\r\n (service as IRequestTypeFilterDto).ProjectIsRequired === null) ||\r\n !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n );\r\n }, [appSettings, chosenBudget, service]);\r\n\r\n const userGroupEnabled = React.useMemo(() => {\r\n return (\r\n isAdmin && !globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n );\r\n }, [globalSettings.reservationUserGroupGroupByBudgetUserGroup, isAdmin]);\r\n const userGroupRequired = React.useMemo(() => {\r\n return (\r\n isAdmin &&\r\n !globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n chosenUserGroup === null\r\n );\r\n }, [\r\n chosenUserGroup,\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n isAdmin,\r\n ]);\r\n const onUserGroupChange = React.useCallback(\r\n (value: IUserGroupDto | null) => {\r\n setChosenUserGroup(value);\r\n setChosenUser(null);\r\n if (showProject) {\r\n setChosenBudget(null);\r\n }\r\n },\r\n [setChosenBudget, showProject],\r\n );\r\n const onUserChange = React.useCallback(\r\n (value: IUserFilterDto | null) => {\r\n if (showProject) {\r\n if (value === null || value === undefined) {\r\n setChosenBudget(null);\r\n } else {\r\n setChosenBudget(\r\n DefaultBudget(\r\n chosenUserGroup?.Id ?? value.UserGroupId,\r\n value.Id,\r\n chosenBudget,\r\n service?.Id,\r\n chosenFundingType?.Id ?? undefined,\r\n ),\r\n );\r\n }\r\n }\r\n setChosenUser(value);\r\n },\r\n [\r\n chosenBudget,\r\n chosenFundingType?.Id,\r\n chosenUserGroup?.Id,\r\n service?.Id,\r\n setChosenBudget,\r\n showProject,\r\n ],\r\n );\r\n React.useEffect(() => {\r\n if (\r\n fundingTypeVisible &&\r\n chosenBudget !== null &&\r\n chosenFundingType === null\r\n ) {\r\n setFundingType(\r\n getSingleInvoiceFundingType(\r\n (chosenBudget as IBudgetFilterDto).FundingTypeId ?? 0,\r\n ),\r\n );\r\n }\r\n }, [chosenBudget, chosenFundingType, fundingTypeVisible]);\r\n React.useEffect(() => {\r\n if (projectIsRequired && chosenUser !== null) {\r\n setChosenBudget(\r\n DefaultBudget(\r\n chosenUserGroup?.Id ?? chosenUser.UserGroupId,\r\n chosenUser.Id,\r\n null,\r\n service?.Id,\r\n chosenFundingType?.Id ?? undefined,\r\n ),\r\n );\r\n }\r\n }, [\r\n chosenFundingType,\r\n chosenUser,\r\n chosenUserGroup?.Id,\r\n projectIsRequired,\r\n service?.Id,\r\n setChosenBudget,\r\n ]);\r\n React.useEffect(() => {\r\n if (\r\n getServiceRequest.status !== 'pending' &&\r\n getServiceRequest.status !== 'resolved'\r\n ) {\r\n setService(getService(serviceId));\r\n }\r\n }, [serviceId, getService, setService, getServiceRequest.status]);\r\n\r\n return (\r\n // TODO: switch to DialogForm with proper form schema & validation\r\n setOpen(false)}\r\n onConfirm={e => {\r\n e.preventDefault();\r\n setBusy(true);\r\n setError(undefined);\r\n //let user = chosenUser; //(isAdmin && chosenUser) || authenticatedUser;\r\n if (service && chosenUser) {\r\n ServiceRequestsApi.AddRequest(\r\n service?.Id,\r\n chosenBudget === null ? 0 : chosenBudget.Id,\r\n chosenUser?.Id,\r\n chosenUserGroup?.Id ?? undefined,\r\n chosenFundingType?.Id ?? null,\r\n chosenPurchaseOrder,\r\n )\r\n .then(response => {\r\n setBusy(false);\r\n if (response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n const id = tryParseInt(response.SuccessMessages[0]);\r\n if (id === undefined) {\r\n console.error(\r\n 'Invalid service request id returned from the server',\r\n response,\r\n );\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: `${t(\r\n translations.Requests_Created_Failure,\r\n )}. (invalid service request id returned from the server).`,\r\n }),\r\n );\r\n } else {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: t(translations.Requests_Created_Success),\r\n }),\r\n );\r\n setOpen(false);\r\n const propsSide: ServiceRequestDetailsProps = {\r\n id: id,\r\n useSidePanel: true,\r\n };\r\n dispatch(layoutActions.setRefreshTable(true));\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.ServiceRequestDetails,\r\n props: propsSide,\r\n expanded: true,\r\n }),\r\n );\r\n setService(null);\r\n setChosenBudget(null);\r\n //dispatch(push(GetServiceRequestDetailsPath(id)));\r\n }\r\n }\r\n })\r\n .catch(err => {\r\n setBusy(false);\r\n console.error(err);\r\n });\r\n }\r\n }}\r\n disabled={\r\n isReadOnlyUser ||\r\n !service ||\r\n (showProject && projectIsRequired && chosenBudget === null) ||\r\n (fundingTypeVisible &&\r\n projectIsRequired &&\r\n chosenFundingType === null) ||\r\n (purchaseOrderVisible && purchaseLengthInvalid) ||\r\n (userGroupEnabled && userGroupRequired) ||\r\n busy\r\n }\r\n body={\r\n \r\n \r\n \r\n {error !== undefined && (\r\n \r\n {error}{' '}\r\n \r\n )}\r\n \r\n {getServiceRequest.status === 'pending' ? (\r\n \r\n ) : (\r\n {\r\n setService(val);\r\n setChosenBudget(null);\r\n }}\r\n label={t(translations.RequiredLabServiceLabel)}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {fundingTypeVisible && (\r\n \r\n {\r\n setFundingType(value);\r\n if (\r\n value?.Id !==\r\n (chosenBudget as IBudgetFilterDto)?.FundingTypeId\r\n ) {\r\n setChosenBudget(null);\r\n }\r\n }}\r\n fullWidth\r\n />\r\n \r\n )}\r\n\r\n {showProject && (\r\n \r\n setChosenBudget(val)}\r\n label={t(translations.PleaseSelectABudgetNumber)}\r\n placeholder={t(translations.PleaseSelectABudgetNumber)}\r\n error={Boolean(projectIsRequired && chosenBudget === null)}\r\n helperText={\r\n projectIsRequired && chosenBudget === null\r\n ? t(translations.BudgetIsRequired)\r\n : undefined\r\n }\r\n fundingTypeId={chosenFundingType?.Id}\r\n disabled={!!!service}\r\n />\r\n \r\n )}\r\n {purchaseOrderVisible && (\r\n \r\n {\r\n let val = ev.target.value;\r\n setPurchaseOrder(val === '' ? null : val);\r\n }}\r\n value={chosenPurchaseOrder ?? ''}\r\n />\r\n \r\n )}\r\n \r\n \r\n \r\n }\r\n title={t(translations.ServiceRequests_Ordering)}\r\n />\r\n );\r\n};\r\n","import { Theme } from '@material-ui/core';\r\nimport Popper, { PopperProps } from '@material-ui/core/Popper';\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface SidePanelRootProps {\r\n children: React.ReactNode;\r\n className?: string;\r\n}\r\nexport const SidePanelRoot = React.forwardRef(\r\n ({ className, children }: SidePanelRootProps, ref: any) => (\r\n
    \r\n {children}\r\n
    \r\n ),\r\n);\r\nexport const SidePanelPopper = styled(\r\n ({\r\n sidePanelWidth,\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n sidePanelWidth: number;\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & PopperProps) => {children},\r\n)`\r\n &.sidePanelPopper {\r\n z-index: ${props => props.theme.zIndex.modal};\r\n height: 100dvh;\r\n border-left: 1px solid ${bookitColors.grayscale.grayBorders};\r\n &.rootopen {\r\n width: 100%;\r\n transform: unset;\r\n &.mobileroot {\r\n padding-top: 0px;\r\n }\r\n }\r\n &.rootclose {\r\n width: 100vw;\r\n &.mobileroot {\r\n inset-block: 50px auto;\r\n height: calc(100% - 50px);\r\n padding-top: 0px;\r\n }\r\n }\r\n @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n &.rootclose {\r\n width: 100%;\r\n min-width: 600px;\r\n }\r\n }\r\n @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n &.rootclose {\r\n width: 100%;\r\n min-width: 370px;\r\n }\r\n }\r\n @media (min-width: ${props => props.theme.breakpoints.values.md}px) {\r\n &.rootclose {\r\n width: ${props => props.sidePanelWidth}px;\r\n }\r\n }\r\n & .paper {\r\n background: ${bookitColors.base.white};\r\n border-radius: 0;\r\n max-height: 100dvh;\r\n height: auto;\r\n margin: 0;\r\n box-shadow: unset;\r\n }\r\n @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n & .paper {\r\n max-width: 100%;\r\n }\r\n }\r\n }\r\n`;\r\n","import { useTheme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nimport { SidePanelRenderer } from './SidePanelRenderer';\r\nimport { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport { SidePanelPopper, SidePanelRoot } from './wrappers';\r\n\r\nexport interface SidePanelPopupProps {\r\n renderPageType?: RenderPageType;\r\n renderPageProps?: PageTypeProps;\r\n sidePanelOpen: boolean;\r\n sidePanelExpanded: boolean;\r\n sidePanelWidth: number;\r\n}\r\n\r\nexport const SidePanelPopup = (props: SidePanelPopupProps) => {\r\n const { checkIsMobile } = useIsMobile();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const isMobile = checkIsMobile();\r\n const {\r\n renderPageType,\r\n renderPageProps,\r\n sidePanelOpen,\r\n sidePanelExpanded,\r\n sidePanelWidth,\r\n } = props;\r\n const elementRef = React.useRef(null);\r\n const closeSidePanel = React.useCallback(() => {\r\n dispatch(actions.resetSidePanel());\r\n }, [actions, dispatch]);\r\n // manually trigger rerender using a useless usState hook\r\n // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n const countState = React.useState(0);\r\n React.useEffect(() => {\r\n countState[1](c => c + 1);\r\n // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementRef.current]);\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n {isMobile ? (\r\n // \r\n // {\r\n // if (ev.currentTarget.id === (ev.target as any).id && isMobile) {\r\n // closeSidePanel();\r\n // } else {\r\n // //ev.preventDefault();\r\n // }\r\n // }}\r\n // >\r\n \r\n {\r\n if (ev.currentTarget.id === (ev.target as any).id && isMobile) {\r\n closeSidePanel();\r\n } else {\r\n //ev.preventDefault();\r\n }\r\n }}\r\n >\r\n \r\n
    \r\n \r\n {renderPageType !== undefined &&\r\n renderPageProps !== undefined && (\r\n \r\n )}\r\n \r\n
    \r\n \r\n
    \r\n ) : (\r\n // \r\n // \r\n \r\n
    \r\n \r\n {renderPageType !== undefined && renderPageProps ? (\r\n \r\n ) : (\r\n
    \r\n )}\r\n
    \r\n
    \r\n \r\n )}\r\n
    \r\n {/* )} */}\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectPageType,\r\n selectPageTypeProps,\r\n selectSidePanelOpen,\r\n} from '../../slice/selectors';\r\nimport { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport { SidePanelPopup } from './SidePanelPopup';\r\n\r\nexport interface SidePanelProps {\r\n renderPageType?: RenderPageType;\r\n renderPageProps?: PageTypeProps;\r\n}\r\n\r\nexport function SidePanel(props: SidePanelProps) {\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const renderPageType = useSelector(selectPageType);\r\n const renderPageProps = useSelector(selectPageTypeProps);\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import {\r\n FilledInput as MuiFiledInput,\r\n FilledInputClassKey,\r\n //InputBase,\r\n //InputBaseClassKey,\r\n InputBaseProps,\r\n //InputClassKey,\r\n StandardProps,\r\n} from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FilledInputProps\r\n extends StandardProps {\r\n className?: string;\r\n fullWidth?: boolean;\r\n multiline?: boolean;\r\n noBorder?: boolean;\r\n disableUnderline?: boolean;\r\n}\r\nexport const FilledInput = React.forwardRef<\r\n React.HTMLAttributes,\r\n FilledInputProps\r\n>(function FilledInput(props, ref) {\r\n const {\r\n className,\r\n fullWidth = false,\r\n inputComponent = 'input',\r\n multiline = false,\r\n type = 'text',\r\n ...rest\r\n } = props;\r\n return (\r\n \r\n );\r\n});\r\nexport default FilledInput;\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const TermsOfUseAgreementApi = {\r\n getTermsOfUseAgreement: () => {\r\n const url = '/api/odata/v4/TermsOfUseAgreement';\r\n return httpClient.get(url);\r\n },\r\n agreeTermsOfUseAgreement: (versionId: number) => {\r\n const url = '/api/odata/v4/TermsOfUseAgreement/AcceptAgreement';\r\n const data = { versionId: versionId };\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import * as Excel from 'exceljs';\r\nimport fileDownload from 'js-file-download';\r\n\r\nexport interface ColumnTemplate {\r\n key: string;\r\n name: string;\r\n customData?: (v: any) => string;\r\n}\r\n\r\nexport class ExportToExcel {\r\n book: Excel.Workbook;\r\n sheet: Excel.Worksheet;\r\n constructor(sheetName: string) {\r\n this.book = new Excel.Workbook();\r\n this.sheet = this.book.addWorksheet(sheetName);\r\n }\r\n public AddWorkBook(): Excel.Workbook {\r\n return new Excel.Workbook();\r\n }\r\n public AddWorkSheet(\r\n workBook: Excel.Workbook,\r\n sheetName: string,\r\n ): Excel.Worksheet {\r\n return workBook.addWorksheet(sheetName);\r\n }\r\n public SetWorkSheetHeader(columns: string[], workSheet?: Excel.Worksheet) {\r\n const sheet: Excel.Worksheet =\r\n workSheet !== undefined ? workSheet : this.sheet;\r\n sheet.columns = columns.map(e => ({\r\n header: e,\r\n key: e,\r\n width: 30,\r\n }));\r\n }\r\n public InitWorksheetHeader(n: number, workSheet?: Excel.Worksheet) {\r\n const sheet: Excel.Worksheet =\r\n workSheet !== undefined ? workSheet : this.sheet;\r\n var columns: { key: string; width: number }[] = [];\r\n for (let i = 0; i < n; i++) {\r\n columns.push({\r\n key: i.toString(),\r\n width: 30,\r\n });\r\n }\r\n sheet.columns = columns;\r\n }\r\n public AddWorkSheetHeader(columns: string[], workSheet?: Excel.Worksheet) {\r\n const sheet: Excel.Worksheet =\r\n workSheet !== undefined ? workSheet : this.sheet;\r\n sheet.addRow(columns);\r\n }\r\n public AddWorkSheetRow(workSheet?: Excel.Worksheet) {\r\n const sheet: Excel.Worksheet =\r\n workSheet !== undefined ? workSheet : this.sheet;\r\n sheet.addRow('');\r\n }\r\n public AddWorkSheetData(\r\n data: T[],\r\n columns?: ColumnTemplate[],\r\n workSheet?: Excel.Worksheet,\r\n ) {\r\n const sheet: Excel.Worksheet =\r\n workSheet !== undefined ? workSheet : this.sheet;\r\n if (data.length > 0) {\r\n // Add header\r\n if (columns !== undefined) {\r\n const columnNames = this.GetObjectNames(data[0], columns);\r\n this.AddWorkSheetHeader(columnNames, workSheet);\r\n }\r\n // Add rows\r\n data.forEach(e => {\r\n sheet.addRow(this.GetObjectValues(e, columns));\r\n });\r\n }\r\n }\r\n public SetWorkSheetData(\r\n data: T[],\r\n columns?: ColumnTemplate[],\r\n workSheet?: Excel.Worksheet,\r\n ) {\r\n if (data.length > 0) {\r\n // Add header\r\n const columnNames = this.GetObjectNames(data[0], columns);\r\n this.SetWorkSheetHeader(columnNames, workSheet);\r\n // Add rows\r\n this.AddWorkSheetData(data, columns, workSheet);\r\n }\r\n }\r\n public async ExportToExcel(\r\n fileName: string,\r\n workBook?: Excel.Workbook,\r\n ): Promise {\r\n const book: Excel.Workbook = workBook !== undefined ? workBook : this.book;\r\n try {\r\n return await book.xlsx\r\n .writeBuffer()\r\n .then(buffer => {\r\n fileDownload(buffer, fileName + '.xlsx');\r\n })\r\n .catch(err => {\r\n throw err;\r\n });\r\n } catch (err) {\r\n throw err;\r\n }\r\n }\r\n public GetObjectNames(obj: {}, columns?: ColumnTemplate[]): string[] {\r\n var result: string[];\r\n if (columns !== undefined) {\r\n result = columns.map(e => e.name);\r\n } else {\r\n result = Object.keys(obj).map(function (key) {\r\n return key;\r\n });\r\n }\r\n return result;\r\n }\r\n public GetObjectValues(obj: {}, columns?: ColumnTemplate[]) {\r\n var result: {}[];\r\n if (columns !== undefined) {\r\n result = columns.map(function (column) {\r\n if (column.customData !== undefined) {\r\n return column.customData(obj[column.key]);\r\n } else {\r\n return obj[column.key];\r\n }\r\n });\r\n } else {\r\n result = Object.keys(obj).map(function (key) {\r\n return obj[key];\r\n });\r\n }\r\n return result;\r\n }\r\n}\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { getIgnoredSearch, toURLSearchParams } from './withSavedHistory';\r\nimport { SAVEDVIEW_SEARCH_KEY } from 'app/components/BasicTable/BasicFilter/SavedListsDropDown';\r\n\r\n/**\r\n * Converts applied filters to search string\r\n * @param items applied filters\r\n * @param search current search\r\n * @param reservedQueryStringParameterNames reserved search params\r\n * @returns search\r\n */\r\nexport function getNextFilter(\r\n items: IFilterSettings[],\r\n search: string,\r\n reservedQueryStringParameterNames?: string[],\r\n) {\r\n // preserve the saved view value in addition to the reservedQueryStringParameterNames in order to preserve the selected saved view\r\n const ignore = [\r\n ...(reservedQueryStringParameterNames ?? []),\r\n SAVEDVIEW_SEARCH_KEY,\r\n ];\r\n\r\n const currentSearch = getIgnoredSearch(search, ignore);\r\n const filterSearch = toURLSearchParams(items);\r\n\r\n for (const key of filterSearch.keys()) {\r\n const filterValue = filterSearch.get(key);\r\n if (filterValue !== null) {\r\n currentSearch.set(key, filterValue);\r\n }\r\n }\r\n return currentSearch;\r\n}\r\n","import {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nconst url = '/api/odata/v4/InvoiceStatus';\r\nexport interface InvoiceStatusPickerProps\r\n extends Omit>, 'url'> {}\r\n\r\nexport const InvoiceStatusPicker = (props: InvoiceStatusPickerProps) => {\r\n return (\r\n \r\n );\r\n};\r\n","import MenuIcon from '@material-ui/icons/Menu';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\n\r\nexport const OpenMenuButton = ({\r\n iconSize,\r\n}: {\r\n iconSize?: 'medium' | 'small';\r\n}) => {\r\n const { toggle } = useExpandedSideBarState();\r\n return (\r\n {\r\n toggle();\r\n }}\r\n >\r\n \r\n \r\n );\r\n};\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { UserProfileLink } from '../../components/UserProfileLink';\r\n\r\nconst UserRenderer: Renderer>> = ({\r\n value,\r\n row,\r\n}) => {\r\n if (value === null || value === undefined) {\r\n return <>;\r\n }\r\n return ;\r\n};\r\nexport default UserRenderer;\r\n","import {\r\n List,\r\n ListItem,\r\n ListItemIcon,\r\n ListItemText,\r\n ListSubheader,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { TFunctionKeys } from 'i18next';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n getViewLength,\r\n getViewType,\r\n viewLengthOptions,\r\n ViewLengths,\r\n viewTypeOptions,\r\n ViewTypes,\r\n} from '../../slice/types';\r\n\r\nexport interface ViewTypeLengthDropDownProps {\r\n viewType: ViewTypes;\r\n viewLength: ViewLengths;\r\n onTypeLengthChange: (\r\n type: ViewTypes,\r\n length: ViewLengths,\r\n value?: Date,\r\n ) => void;\r\n size?: 'small' | 'large' | 'medium';\r\n /**\r\n * Limit display to a subset of possible options. E.g. options={['day', 'week']} to show only day/week options without the month\r\n */\r\n lengthOptions?: Array;\r\n /**\r\n * Optional show only icons on mobile\r\n */\r\n compact?: boolean;\r\n disabled?: boolean;\r\n haideCalendarViewType?: boolean;\r\n twoDaysEnabled?: boolean;\r\n customDaysEnabled?: boolean;\r\n customDays?: number;\r\n customTimelineDays?: number;\r\n customCalendarDays?: number;\r\n}\r\n\r\nexport function ViewTypeLengthDropDown(props: ViewTypeLengthDropDownProps) {\r\n const {\r\n viewType,\r\n viewLength,\r\n onTypeLengthChange,\r\n lengthOptions = ['day', 'week', 'month'],\r\n compact,\r\n size = 'medium',\r\n disabled,\r\n haideCalendarViewType,\r\n customDays,\r\n customTimelineDays,\r\n customCalendarDays,\r\n } = props;\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const titletext = React.useMemo(() => {\r\n if (compact) {\r\n return t(getViewLength(viewLength)?.shortName as TFunctionKeys).replace(\r\n '{0}',\r\n !!customDays ? customDays.toString() : '',\r\n );\r\n } else {\r\n return `${t(getViewType(viewType)?.Name as TFunctionKeys)} by ${t(\r\n getViewLength(viewLength)?.Name as TFunctionKeys,\r\n ).replace('{0}', !!customDays ? customDays.toString() : '')}`;\r\n }\r\n }, [compact, customDays, t, viewLength, viewType]);\r\n const itemText = React.useCallback(\r\n (type: Entity, length: Entity) => {\r\n if (type.Id === 'calendar') {\r\n if (length.Id === 'customPeriod') {\r\n if (!!customCalendarDays && customCalendarDays > 0) {\r\n return t(length.Name as TFunctionKeys).replace(\r\n '{0}',\r\n customCalendarDays.toString(),\r\n );\r\n } else {\r\n return 'Custom';\r\n }\r\n } else {\r\n return t(length.Name as TFunctionKeys);\r\n }\r\n } else {\r\n if (length.Id === 'customdays') {\r\n return t(length.Name as TFunctionKeys).replace(\r\n '{0}',\r\n !!customDays ? customDays.toString() : '',\r\n );\r\n } else if (length.Id === 'customPeriod') {\r\n if (!!customTimelineDays && customTimelineDays > 0) {\r\n return t(length.Name as TFunctionKeys).replace(\r\n '{0}',\r\n customTimelineDays.toString(),\r\n );\r\n } else {\r\n return 'Custom';\r\n }\r\n } else {\r\n return t(length.Name as TFunctionKeys);\r\n }\r\n }\r\n },\r\n [customCalendarDays, customDays, customTimelineDays, t],\r\n );\r\n const handleChange = (\r\n type: Entity | null,\r\n length: Entity | null,\r\n ) => {\r\n if (type === null || length === null) {\r\n return;\r\n }\r\n onTypeLengthChange(\r\n type.Id,\r\n length.Id,\r\n length.Id === 'customdays' ? newDate() : undefined,\r\n );\r\n };\r\n\r\n return (\r\n \r\n }\r\n addChevron\r\n menuChildren={onClose => [\r\n ...viewTypeOptions\r\n .filter(\r\n f =>\r\n !haideCalendarViewType ||\r\n (haideCalendarViewType === true && f.Id === 'timeline'),\r\n )\r\n .map((vt, index) => {\r\n return (\r\n \r\n \r\n {t(vt.Name as TFunctionKeys)}\r\n \r\n \r\n }\r\n >\r\n {viewLengthOptions\r\n .filter(f => {\r\n if (compact) {\r\n return vt.Id === 'timeline'\r\n ? f.Id !== 'month' &&\r\n f.Id !== 'customdays' &&\r\n lengthOptions.includes(f.Id)\r\n : f.Id !== 'twodays' &&\r\n f.Id !== 'customdays' &&\r\n f.Id !== 'quarter' &&\r\n f.Id !== 'year' &&\r\n lengthOptions.includes(f.Id);\r\n } else {\r\n return vt.Id === 'timeline'\r\n ? lengthOptions.includes(f.Id)\r\n : f.Id !== 'customdays' &&\r\n f.Id !== 'twodays' &&\r\n f.Id !== 'quarter' &&\r\n f.Id !== 'year' &&\r\n lengthOptions.includes(f.Id);\r\n }\r\n })\r\n .map(vl => {\r\n return (\r\n {\r\n handleChange(vt, vl);\r\n onClose();\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n );\r\n }),\r\n ]}\r\n >\r\n {titletext}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { MenuItem } from '@material-ui/core';\r\n\r\nexport interface ExportToPDFProps {\r\n onClick: () => void;\r\n}\r\n\r\nexport function ExportToPDF(props: ExportToPDFProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n return (\r\n \r\n \r\n {t(translations.ExportToPDF)}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * DatePickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nexport const DatePickerFilter = (props: IFilterComponentProps) => {\r\n const [value, setValue] = React.useState(\r\n props.value,\r\n );\r\n const handleOnChange = (value: MaterialUiPickersDate | null) => {\r\n props.onChange(value == null ? null : new CustomDate(value, 'date'));\r\n setValue(value);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default DatePickerFilter;\r\n","/**\r\n *\r\n * TextFieldFilter\r\n *\r\n */\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { debounce } from 'lodash';\r\n\r\nexport const TextFieldFilter = (props: IFilterComponentProps) => {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [value, setValue] = React.useState(props.value);\r\n const onChange = React.useCallback(value => props.onChange(value), [props]);\r\n const debouncedOnChange = React.useMemo(() => debounce(onChange, 250), [\r\n onChange,\r\n ]);\r\n const handleChange: React.ChangeEventHandler<\r\n HTMLInputElement | HTMLTextAreaElement\r\n > = event => {\r\n setValue(event.target.value);\r\n debouncedOnChange(event.target.value);\r\n };\r\n\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default TextFieldFilter;\r\n","import { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { SavedViewSelected } from '../SavedViewsPage/SavedViewPage/slice/types';\r\n\r\nexport function MyListFilter(search: string, selectedView: SavedViewSelected) {\r\n const result = isEmptyOrWhitespace(search)\r\n ? new URLSearchParams()\r\n : new URLSearchParams(search);\r\n result.set('eid', selectedView.ids || '');\r\n const res = result.toString();\r\n return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { IDocumentsDirectoryRow } from './IDocumentsDirectoryRow';\r\nimport React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function DocumentsTable<\r\n TProps extends Omit<\r\n BasicTableProps,\r\n 'api' | 'additionalColumns' | 'searchColumns' | 'screenName'\r\n >\r\n>({ initialState, rowActions, screenId, serviceGroups, ...props }: TProps) {\r\n const { t } = useTranslation();\r\n const newProps = React.useMemo(() => {\r\n const p = { ...props };\r\n Reflect.deleteProperty(p, 'api');\r\n return p;\r\n }, [props]);\r\n const url = '/api/odata/v4/Documents';\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport React from 'react';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface NoTableDataProps {\r\n id?: string;\r\n shortView?: boolean;\r\n}\r\nexport function NoTableData(props: NoTableDataProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n {props.shortView ? (\r\n \r\n \r\n {t(translations.dash_EmptyWidgetTitle) as string}\r\n \r\n \r\n {t(translations.dash_EmptyWidgetBody) as string}\r\n \r\n \r\n ) : (\r\n \r\n

    {t(translations.dash_EmptyWidgetTitle) as string}

    \r\n

    {t(translations.dash_EmptyWidgetBody) as string}

    \r\n
    \r\n )}\r\n
    \r\n
    \r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Alert, AlertProps } from '@material-ui/lab';\r\n\r\nexport interface TableErrorProps extends Pick {}\r\nexport function TableError(props: TableErrorProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n {t(translations.LoadingFailed)}\r\n \r\n );\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { Description } from 'app/components/Description';\r\nimport { BooleanRender } from '../../components/BooleanRender';\r\n\r\n/**\r\n * Type of the record to reference. Record will work for all cases, but can be substituted for specific type if needed.\r\n */\r\ntype recordType = Record;\r\nconst DefaultRenderer: Renderer> = props => {\r\n const value = props.value;\r\n if (value === null || value === undefined) {\r\n return null;\r\n } else if (typeof value === 'string') {\r\n return ;\r\n } else if (typeof value === 'boolean') {\r\n return BooleanRender(props);\r\n }\r\n //TODO: add default renderers for other common types here\r\n else {\r\n return <>{String(value)};\r\n }\r\n};\r\nexport default DefaultRenderer;\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IDocumentsDirectoryRow } from './IDocumentsDirectoryRow';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport FileNameRenderer from 'app/components/BasicTable/CellRenderers/FileNameRenderer';\r\n\r\nconst Available = val => {\r\n if (val === true) {\r\n return translations.StaffUsersFiles;\r\n }\r\n if (val === false) {\r\n return translations.StaffOnlyFiles;\r\n }\r\n return translations.PublicFiles;\r\n};\r\n\r\nexport const getColumns = (\r\n t: TFunction,\r\n appSettings?: AppSettings,\r\n globalSettings?: GlobalSettings,\r\n): Column[] => {\r\n return [\r\n {\r\n Header: t(translations.FileName) as string,\r\n accessor: 'FileName',\r\n //check if the link should be avalibale or not\r\n //logick not finale\r\n Cell: FileNameRenderer,\r\n },\r\n {\r\n Header: t(translations.Title) as string,\r\n accessor: 'Title',\r\n },\r\n {\r\n Header: t(translations.Description) as string,\r\n accessor: 'Description',\r\n },\r\n {\r\n Header: t(translations.DocumentType) as string,\r\n accessor: 'DocumentType',\r\n },\r\n {\r\n Header: t(translations.FileType) as string,\r\n accessor: 'FileType',\r\n },\r\n {\r\n Header: t(translations.ServiceGroup) as string,\r\n accessor: 'ServiceGroup',\r\n },\r\n {\r\n Header: t(translations.AssetName) as string,\r\n accessor: 'AssetName',\r\n Cell: AssetRenderer,\r\n },\r\n {\r\n Header: t(translations.AvailableToUsers) as string,\r\n accessor: 'AvailableToUsers',\r\n\r\n Cell: ({ row }) => <>{t(Available(row.original.AvailableToUsers))},\r\n },\r\n ];\r\n};\r\n","import { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { DownloadFileButon } from 'app/components/DownloadFileButton';\r\n\r\ntype RecordType = Record;\r\nconst FileNameRenderer: Renderer> = ({ value, row }) => {\r\n const { allowedToEdit } = useAdminPermissions();\r\n return (\r\n <>\r\n {row.original.AvailableToUsers === false &&\r\n !allowedToEdit({\r\n ServiceGroupId: row.original.ServiceGroupId,\r\n ServiceType: row.original.ServiceTypeId,\r\n ServiceId: row.original.ServiceId,\r\n }) ? (\r\n <>{value}\r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default FileNameRenderer;\r\n","import { TFunction } from 'i18next';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport DateTimeRenderer from 'app/components/BasicTable/CellRenderers/DateTimeRenderer';\r\nimport { translations } from 'locales/translations';\r\nimport UsedSlotsRenderer from 'app/components/BasicTable/CellRenderers/UsedSlotsRenderer';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport TrainingStateRenderer from 'app/components/BasicTable/CellRenderers/TrainingStateRenderer';\r\n\r\ntype RowType = ITrainingSessionsRow;\r\nexport const getColumns = (\r\n t: TFunction,\r\n appSettings?: AppSettings,\r\n globalSettings?: GlobalSettings,\r\n): Column[] => {\r\n return [\r\n {\r\n Header: t(translations.Signups) as string,\r\n accessor: 'TrainingState',\r\n Cell: TrainingStateRenderer,\r\n },\r\n {\r\n Header: t(translations.TrainingResource) as string,\r\n accessor: 'AssetName',\r\n Cell: AssetRenderer,\r\n },\r\n // {\r\n // Header: t(translations.NextAvailableSession) as string,\r\n // accessor: 'NextSession',\r\n // Cell: NextSessionRenderer,\r\n // },\r\n // {\r\n // Header: t(translations.AllUpcomingSessions) as string,\r\n // accessor: 'AllUpcomingSessions',\r\n // Cell: AllUpcomingSessionsAssetRenderer,\r\n // },\r\n {\r\n Header: t(translations.DurationH) as string,\r\n accessor: 'Duration',\r\n },\r\n {\r\n Header: t(translations.Campus) as string,\r\n accessor: 'Campus',\r\n },\r\n {\r\n Header: t(translations.Building) as string,\r\n accessor: 'Building',\r\n },\r\n {\r\n Header: t(translations.Room) as string,\r\n accessor: 'Room',\r\n },\r\n {\r\n Header: t(translations.MinimumAttendance) as string,\r\n accessor: 'MinAttendance',\r\n },\r\n {\r\n Header: t(translations.MaximumAttendance) as string,\r\n accessor: 'MaxAttendance',\r\n },\r\n {\r\n Header: t(translations.TotalUsedSlots) as string,\r\n accessor: 'TotalUsedSlots',\r\n Cell: UsedSlotsRenderer,\r\n },\r\n {\r\n Header: t(translations.RemainedSlots) as string,\r\n accessor: 'RemainedSlots',\r\n },\r\n {\r\n Header: t(translations.ServiceGroup) as string,\r\n accessor: 'ServiceGroup',\r\n },\r\n {\r\n Header: t(translations.HashSymbol) as string,\r\n accessor: 'Id',\r\n },\r\n {\r\n Header: t(translations.Remarks) as string,\r\n accessor: 'Remarks',\r\n },\r\n {\r\n Header: t(translations.StartTime) as string,\r\n accessor: 'StartDate',\r\n Cell: DateTimeRenderer,\r\n },\r\n {\r\n Header: t(translations.EndTime) as string,\r\n accessor: 'EndDate',\r\n Cell: DateTimeRenderer,\r\n },\r\n {\r\n Header: t(translations.TrainerName) as string,\r\n accessor: 'TrainerName',\r\n },\r\n ];\r\n};\r\n","import { ExternalLink } from 'app/components/ExternalLink';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\ntype RecordType = ITrainingSessionsRow;\r\nconst UsedSlotsRenderer: Renderer> = ({\r\n value,\r\n row: { original },\r\n}) => {\r\n const { newDate } = useSystemDate();\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n};\r\nexport default UsedSlotsRenderer;\r\n","import { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { ReservationLinkAction } from 'app/pages/TrainingSessionsPage/RowActions/ReservationLink';\r\nimport React from 'react';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\ntype RecordType = ITrainingSessionsRow;\r\nconst TrainingStateRenderer: Renderer> = ({\r\n value,\r\n row,\r\n}) => {\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n const hasNextSession =\r\n getOffsetDate(row.original.StartDate) > dateUtils.truncateTime(newDate());\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\nexport default TrainingStateRenderer;\r\n","import { SizeProp } from '@fortawesome/fontawesome-svg-core';\r\nimport { Box } from '@material-ui/core';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { buildURL } from 'utils/url-utils';\r\n\r\nexport interface ReservationLinkProps {\r\n Id: number | null;\r\n HasNextSession: boolean;\r\n TrainingState: number;\r\n hasReservation: boolean;\r\n myReservationId: number | null;\r\n ServiceId: number | null;\r\n NextSession: Date | null;\r\n EndDate: Date | null;\r\n StartDate: Date | null;\r\n iconsize?: SizeProp;\r\n asLinkRendered?: boolean;\r\n}\r\nexport const ReservationLinkAction = React.forwardRef<\r\n any,\r\n ReservationLinkProps\r\n>(function ReservationLinkAction(props, ref) {\r\n const { t } = useTranslation();\r\n const { openPanel } = useSidePanelState();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const isMobile = DetectIsMobile();\r\n const readOnlyUser = IsReadOnlyUser(user);\r\n //const item = props.row;\r\n //const hasSession = props.HasNextSession;\r\n\r\n const state = props.TrainingState as TrainingState;\r\n const params = (props.hasReservation\r\n ? {\r\n id: String(props.myReservationId),\r\n }\r\n : {\r\n selectedIds: String(props.ServiceId),\r\n tsid: String(props.Id),\r\n Start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(props.StartDate ?? new Date()),\r\n ),\r\n End: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(props.EndDate ?? new Date()),\r\n ),\r\n un: user?.Id,\r\n }) as ReservationQueryStringParameters;\r\n\r\n const url = buildURL('/reservations/details', params);\r\n return props.HasNextSession && !readOnlyUser ? (\r\n \r\n openPanel({\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n queryParams: params,\r\n useSidePanel: true,\r\n } as ReservationDetailsProps,\r\n expanded: false,\r\n useSidePanel: false,\r\n isCover: false,\r\n } as SidePanelOpenState)\r\n }\r\n aria-label=\"Session Indicator\"\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n {'N/A'}\r\n );\r\n});\r\n","import React from 'react';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { translations } from 'locales/translations';\r\n\r\ntype RowType = ITrainingSessionsRow;\r\n\r\nexport function TrainingSessionsTable<\r\n TProps extends Omit<\r\n BasicTableProps,\r\n 'api' | 'additionalColumns' | 'searchColumns' | 'screenName'\r\n >\r\n>({\r\n initialState,\r\n rowActions,\r\n serviceGroups,\r\n savedListSettings,\r\n ...props\r\n}: TProps) {\r\n const { t } = useTranslation();\r\n const newProps = React.useMemo(() => {\r\n const p = { ...props };\r\n Reflect.deleteProperty(p, 'api');\r\n return p;\r\n }, [props]);\r\n const url = '/api/odata/v4/TrainingSessions';\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getColumns } from './Columns';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\n\r\nexport function ArticlesTable<\r\n TProps extends Omit<\r\n BasicTableProps,\r\n 'api' | 'additionalColumns' | 'searchColumns' | 'columns' | 'screenName'\r\n > & {\r\n useSidePanel?: boolean;\r\n openPanel?: (state: SidePanelOpenState) => void;\r\n }\r\n>({\r\n initialState,\r\n rowActions,\r\n screenId,\r\n serviceGroups,\r\n predicates,\r\n useSidePanel,\r\n openPanel,\r\n ...props\r\n}: TProps) {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const columns = React.useMemo(\r\n () =>\r\n getColumns(t, authenticatedUser, globalSettings, useSidePanel, openPanel),\r\n [authenticatedUser, globalSettings, openPanel, t, useSidePanel],\r\n );\r\n // add custom global service grups filter since the Article is connected to the service groups through Assets property and does not have ServiceGroupId property used in the basic table filtering\r\n const globalServiceGroupsFilter = React.useMemo(\r\n () =>\r\n serviceGroups !== undefined && serviceGroups.length > 0\r\n ? [\r\n `Assets/any(a: a/Availability/Id eq ${\r\n AvailabilityTypes.ServiceGroup\r\n } and a/ServiceGroupId in (${serviceGroups\r\n .map(f => f.Id)\r\n .join(',')}))`,\r\n ]\r\n : undefined,\r\n [serviceGroups],\r\n );\r\n const newPredicates = React.useMemo(() => {\r\n if (predicates !== undefined && predicates.length > 0) {\r\n const externalPredicates = predicates\r\n .map(p => p.toString())\r\n .filter(r => r !== undefined) as string[];\r\n if (globalServiceGroupsFilter !== undefined) {\r\n globalServiceGroupsFilter.push(...externalPredicates);\r\n return globalServiceGroupsFilter;\r\n } else {\r\n return externalPredicates;\r\n }\r\n } else return globalServiceGroupsFilter;\r\n }, [globalServiceGroupsFilter, predicates]);\r\n const newProps = React.useMemo(() => {\r\n const p = { ...props };\r\n Reflect.deleteProperty(p, 'api');\r\n Reflect.deleteProperty(p, 'columns');\r\n return p;\r\n }, [props]);\r\n const url = '/api/odata/v4/articles';\r\n return (\r\n <>\r\n `Authors/any(a:contains(a, ${s}))`,\r\n // 'Doi',\r\n // 'ISSN',\r\n 'Journal',\r\n //'ORCIDs',\r\n //'ArticleContributionLevelId',\r\n //'Assets',\r\n s => `Assets/any(a:contains(a/Name, ${s}))`,\r\n 'ExternalIdSource',\r\n ]}\r\n screenName={t(translations.Publications)}\r\n serviceGroups={serviceGroups}\r\n predicates={newPredicates}\r\n {...(newProps as TProps)}\r\n />\r\n \r\n );\r\n}\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { ArticleDetailsProps } from './ArticleDetails';\r\n\r\nexport const articlePrimaryAction: PrimaryActionDynamic = (\r\n openPanel,\r\n row,\r\n toggle,\r\n user,\r\n useSidePanel,\r\n) => {\r\n openPanel({\r\n renderPageType: RenderPageType.Article,\r\n renderPageProps: {\r\n value: row.original,\r\n Id: row.original.Id,\r\n externalId: row.original.ExternalId,\r\n externalIdSource: row.original.ExternalIdSource,\r\n useSidePanel: true,\r\n } as ArticleDetailsProps,\r\n useSidePanel: useSidePanel,\r\n expanded: false,\r\n isCover: useSidePanel,\r\n });\r\n};\r\n\r\nexport default articlePrimaryAction;\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function WorkOrdersTable<\r\n TProps extends Omit<\r\n BasicTableProps,\r\n | 'api'\r\n | 'additionalColumns'\r\n | 'searchColumns'\r\n | 'screenName'\r\n | 'expandedColumns'\r\n | 'savedListSettings'\r\n >\r\n>({ initialState, rowActions, serviceGroups, ...props }: TProps) {\r\n const { t } = useTranslation();\r\n const newProps = React.useMemo(() => {\r\n const p = { ...props };\r\n Reflect.deleteProperty(p, 'api');\r\n Reflect.deleteProperty(p, 'expandedColumns');\r\n Reflect.deleteProperty(p, 'savedListSettings');\r\n return p;\r\n }, [props]);\r\n const url = '/api/odata/v4/WorkOrders';\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Body } from '../Typography';\r\n\r\nexport interface ScannerViewProps {\r\n description?: React.ReactNode;\r\n Input?: React.ReactNode;\r\n}\r\n\r\nconst StyledScanView = styled('div')(({ theme }) => ({\r\n '&.scanner-root': {\r\n width: '100%',\r\n minHeight: '144px',\r\n height: 'auto',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n padding: '24px',\r\n gap: 8,\r\n background: theme.palette.common.white,\r\n border: '1px solid #026AA2',\r\n boxShadow: '0px 0px 0px 4px #E2F6FF',\r\n borderRadius: 8,\r\n '& .scanner-icon': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: 8.75,\r\n },\r\n '& .scanner-input': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n width: '100%',\r\n paddingInline: '16px',\r\n gap: 8,\r\n [theme.breakpoints.down('sm')]: {\r\n paddingInline: '0',\r\n },\r\n },\r\n '&.selectRoot': {\r\n padding: theme.spacing(2),\r\n },\r\n '&.selectTitle': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '8px 8px',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n '&>label': {\r\n width: '100%',\r\n textAlign: 'center',\r\n },\r\n },\r\n },\r\n}));\r\nexport function ScannerView(props: ScannerViewProps) {\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n return (\r\n \r\n
    \r\n \r\n
    \r\n \r\n {props.description || t(translations.BarcodeScannViewDescription)}\r\n \r\n {props.Input && (\r\n
    \r\n {'or'}\r\n {props.Input}\r\n
    \r\n )}\r\n
    \r\n );\r\n}\r\n","import { EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { AssetBarcodeScanParameters } from 'app/pages/AssetsInventory/Details/slice/types';\r\nimport { CancelToken } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/AssetDetails';\r\nconst publicUrl = '/api/odata/v4/PublicAsset';\r\nexport const AssetDetailsApi = {\r\n getAssetById: (\r\n id: number | undefined,\r\n serviceId: number | undefined,\r\n columns: string[],\r\n expandable: string[],\r\n cancel?: CancelToken,\r\n isAuthenticated?: boolean,\r\n ) => {\r\n const params: {\r\n $select: string;\r\n serviceId: number;\r\n $expand?: string;\r\n } = {\r\n $select: columns.join(','),\r\n serviceId: serviceId ?? -1,\r\n };\r\n let expand = columns.filter(c => expandable.includes(c));\r\n if (expand && expand.length) {\r\n params.$expand = expand\r\n // articles need 2 level expand which don't fit into the column propName\r\n .map(f => (f === 'Articles' ? 'Articles($expand=Assets)' : f))\r\n .join(',');\r\n }\r\n const sourceUrl = isAuthenticated\r\n ? url + '(' + (id ?? -1) + ')'\r\n : publicUrl + '/' + (id ?? -1);\r\n return httpClient.get(sourceUrl, params, cancel);\r\n },\r\n endUsage: (id: number, data: EndUsageData): Promise => {\r\n const params = {\r\n id: id,\r\n remarks: data.remarks ?? '',\r\n sids:\r\n data.services.map(s => s.service?.Id + ':' + s.quantity).join(',') ??\r\n '',\r\n };\r\n return httpClient.post(url + '/EndUsage', params);\r\n },\r\n downloadImages: (assetIds: string): Promise => {\r\n const downUrl = `api/AssetImages/Selected?selectedIds=${assetIds}`;\r\n return httpClient.get(downUrl);\r\n },\r\n scanBarcode: (payload: AssetBarcodeScanParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n return httpClient.post(`${url}/BarcodeScan`, data);\r\n },\r\n logNoRoomAccess: (payload: number) => {\r\n const data = {\r\n roomId: payload,\r\n };\r\n return httpClient.post(`${url}/LogNoRoomAccess`, data);\r\n },\r\n};\r\n","/**\r\n *\r\n * QuizDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IQuizSubmissionDto } from 'api/odata/generated/entities/IQuizSubmissionDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport parse from 'html-react-parser';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { push } from 'connected-react-router';\r\nimport { ParseFormFieldEnums } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface QuizDetailsProps extends SidePanelContentProps {\r\n id: string;\r\n}\r\n\r\nexport function QuizDetails(props: QuizDetailsProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const { id, useSidePanel } = props;\r\n const quizSubmissionId = +id;\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const isMobile = DetectIsMobile();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const fetchData = async (id: number) =>\r\n httpClient\r\n .get(\r\n `/api/odata/v4/quizsubmissions(${id})?$expand=UserTraining($select=Id,EquipmentName,TrainingLevelName,EquipmentId)`,\r\n )\r\n .then(value => {\r\n ParseFormFieldEnums(value.CustomForm.FormFields);\r\n return value;\r\n });\r\n const [fetchDataPromiseState, fetchDataPromise] = usePromise(fetchData);\r\n const [state, setState] = useAsyncExtendedState<\r\n IQuizSubmissionDto | undefined\r\n >(undefined);\r\n useEffectOnMount(() => {\r\n setState(fetchDataPromise(quizSubmissionId));\r\n return () => {};\r\n });\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n useEffect(() => {\r\n if (fetchDataPromiseState.error !== undefined) {\r\n dispatch(\r\n actions.addNotification({\r\n message: 'Error',\r\n key: 'QuizDetailsDataLoad',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n }, [actions, dispatch, fetchDataPromiseState.error]);\r\n const success = React.useMemo(() => state?.UserTraining !== null, [\r\n state?.UserTraining,\r\n ]);\r\n\r\n const backToQuizess = () => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n dispatch(push(`/quizzes`));\r\n } else {\r\n dispatch(push(`/quizzes`));\r\n }\r\n };\r\n const pageActions = [\r\n () => (\r\n \r\n }\r\n onClick={backToQuizess}\r\n >\r\n {t(translations.BackToQuizzes)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(t(translations.QuizzYourScoreIsXoutofY) as string)\r\n .replace('{0}', (state?.Score ?? 0).toString())\r\n .replace('{1}', (state?.MaxScore ?? 0).toString())}\r\n \r\n \r\n {success ? (\r\n \r\n \r\n \r\n {t(\r\n translations.CongratulationsYouHavePassedTheQuiz,\r\n )}\r\n \r\n {state?.UserTraining?.EquipmentName && (\r\n \r\n {`${t(\r\n translations.YouAreNowCertified,\r\n )} on ${t(translations.Equipment)}: `}\r\n \r\n {state?.UserTraining?.EquipmentName}\r\n \r\n \r\n {state?.UserTraining?.TrainingLevelName\r\n ? ` with ${t(translations.Level)}: ${\r\n state?.UserTraining?.TrainingLevelName\r\n }`\r\n : ''}\r\n \r\n \r\n )}\r\n {state?.CustomForm?.QuizSuccessTestMessage && (\r\n \r\n {parse(\r\n state.CustomForm.QuizSuccessTestMessage || '',\r\n )}\r\n \r\n )}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {t(translations.SorryThisDidNotWorkSoWell)}\r\n \r\n {state?.CustomForm?.QuizFailureTestMessage && (\r\n \r\n {parse(\r\n state.CustomForm.QuizFailureTestMessage || '',\r\n )}\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n leftActions={pageActions}\r\n closable={true}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface IWorkOrderTypeStatusParamsPicker {\r\n typeId?: number;\r\n onlyNew?: boolean;\r\n}\r\nexport interface WorkOrderTypeStatusPickerProps\r\n extends Omit>, 'loadData'>,\r\n IWorkOrderTypeStatusParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/WorkOrderStatus';\r\nexport const initWOTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Order asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n 'Id,Name,Order,New,Closed,StatusId,WorkOrderTypeId,StatusName,Status',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport function withParamsFilter(\r\n typeId: number | undefined,\r\n onlyNew: boolean | undefined,\r\n) {\r\n if (typeId === undefined) {\r\n return (searchTerm: string | null) =>\r\n new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n $orderby: 'Order asc',\r\n $select:\r\n 'Id,Name,Order,New,Closed,StatusId,WorkOrderTypeId,StatusName,Status',\r\n };\r\n const predicates: (string | Condition)[] = [];\r\n predicates.push(\r\n new Condition('WorkOrderTypeId', ODataOperators.Equals, typeId),\r\n );\r\n if (onlyNew !== undefined) {\r\n predicates.push(new Condition('New', ODataOperators.Equals, true));\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response =>\r\n (response.value as IWorkOrderTypeStatusDto[]) as Entity[],\r\n );\r\n };\r\n }\r\n}\r\nexport function WorkOrderTypeStatusPicker(\r\n props: WorkOrderTypeStatusPickerProps,\r\n) {\r\n const loadData = withParamsFilter(props.typeId, props.onlyNew);\r\n return (\r\n \r\n );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface OpenTimelineProps {\r\n rows: TRow[];\r\n getEquipmentIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function OpenTimeline({\r\n rows,\r\n getEquipmentIds,\r\n}: OpenTimelineProps) {\r\n const { t } = useTranslation();\r\n\r\n const link = React.useMemo(() => {\r\n return `/Timeline.aspx?${toQueryString({\r\n services: getEquipmentIds(rows).join(','),\r\n //openToBook: true,\r\n })}`;\r\n }, [getEquipmentIds, rows]);\r\n return (\r\n \r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n all,\r\n call,\r\n put,\r\n select,\r\n takeLatest,\r\n takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { samplePlatesActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { selectSamplePlatesTableState } from './selectors';\r\nimport { getExportParameters, buildURL } from 'utils/url-utils';\r\nimport { AxiosError } from 'axios';\r\nimport {\r\n IBulkSamplePlateCreate,\r\n ISamplePlateCreate,\r\n SamplePlatesTableState,\r\n} from './types';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\nconst baseUrl = `/api/odata/v4/SamplePlates`;\r\nexport function getLoadDataParams(currentTableState: SamplePlatesTableState) {\r\n return {\r\n $count: true,\r\n $top: currentTableState.pageSize,\r\n $skip:\r\n (currentTableState.pageIndex ?? 0) * (currentTableState.pageSize ?? 5),\r\n $orderby:\r\n currentTableState.sortBy\r\n ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n .join(',') || undefined,\r\n $select: currentTableState.visibleColumns?.join(','),\r\n $filter: TableFilterBuilder(\r\n currentTableState.customFilters as Array<\r\n IFilterSettings\r\n >,\r\n currentTableState.globalFilter,\r\n currentTableState.serviceGroups?.length !== 0\r\n ? currentTableState.serviceGroups\r\n : undefined,\r\n [\r\n 'Id',\r\n 'ServiceGroupName',\r\n 'RoomName',\r\n 'LocationTypeName',\r\n 'LocationName',\r\n 'SamplePlateTypeName',\r\n ],\r\n ),\r\n };\r\n}\r\nfunction* doGet(action: PayloadAction) {\r\n try {\r\n const currentTableState = action.payload;\r\n const someResult = yield call(\r\n httpClient.get,\r\n baseUrl,\r\n getLoadDataParams(currentTableState),\r\n );\r\n yield put(actions.get_Success(someResult));\r\n } catch (error) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.errormessage),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.get_Error(Error));\r\n }\r\n\r\n try {\r\n const plateTypes = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/SamplePlateTypes',\r\n );\r\n yield put(actions.getPlateTypes_Success(plateTypes.value));\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\nfunction* doExport(action: PayloadAction) {\r\n try {\r\n const tableState = yield select(selectSamplePlatesTableState);\r\n\r\n const tableParams = getLoadDataParams({\r\n ...tableState,\r\n });\r\n const entitySetURl = '/api/odata/v4/sampleplates';\r\n var params = getExportParameters(tableParams);\r\n const url = buildURL(entitySetURl, params);\r\n yield call(openExportLink, url);\r\n } catch (error) {\r\n console.error('doExport failed', error);\r\n }\r\n}\r\n\r\nfunction* doRefresh(action: PayloadAction) {\r\n const tableState = yield select(selectSamplePlatesTableState);\r\n yield put(actions.get(tableState));\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction) {\r\n const samplePlateId = action.payload.SamplePlateType?.Id ?? null;\r\n if (samplePlateId === null) {\r\n yield put(actions.create_Error('SamplePlateId is required'));\r\n return;\r\n }\r\n const httpPayload: Partial = {\r\n Id: action.payload.Id ?? '',\r\n RoomId: action.payload.Room?.Id ?? null,\r\n LocationId: action.payload.Location?.Id ?? null,\r\n SamplePlateTypeId: samplePlateId,\r\n ServiceGroupId: action.payload.ServiceGroup?.Id ?? null,\r\n Active: action.payload.Active ?? true,\r\n IsRack: action.payload.IsRack ?? false,\r\n };\r\n try {\r\n const someResult = yield call(httpClient.post, baseUrl, httpPayload);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.create_Success(someResult));\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplePlatesCreate',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.create_Error(Error));\r\n }\r\n}\r\n\r\nfunction genratePlatesFromBulk(\r\n item: IBulkSamplePlateCreate,\r\n): ISamplePlateCreate[] {\r\n if (item.LastId === undefined) {\r\n throw new Error('LastId is required');\r\n }\r\n const firstId = item.FirstId;\r\n if (firstId === undefined) {\r\n throw new Error('FirstId is required');\r\n }\r\n const n = item.LastId - firstId + 1;\r\n const d = Math.floor(Math.log10(item.LastId)) + 1;\r\n var result = [...Array(n).keys()]\r\n .map(i => firstId + i)\r\n .map(i => i.toString().padStart(d, '0'))\r\n .map(id => ({\r\n Id: `${item.Prefix}${id}`,\r\n Room: item.Room,\r\n Location: item.Location,\r\n SamplePlateType: item.SamplePlateType,\r\n ServiceGroup: item.ServiceGroup,\r\n Active: item.Active,\r\n IsRack: item.IsRack,\r\n }));\r\n return result;\r\n}\r\n\r\nfunction* doBulkCreate(action: PayloadAction) {\r\n const plates = genratePlatesFromBulk(action.payload);\r\n const errors: string[] = [];\r\n let successCount = 0;\r\n\r\n for (let index = 0; index < plates.length; index++) {\r\n const plate = plates[index];\r\n\r\n const samplePlateId = plate.SamplePlateType?.Id ?? null;\r\n if (samplePlateId === null) {\r\n yield put(actions.create_Error('SamplePlateId is required'));\r\n return;\r\n }\r\n\r\n const httpPayload: Partial = {\r\n Id: plate.Id ?? '',\r\n RoomId: plate.Room?.Id ?? null,\r\n LocationId: plate.Location?.Id ?? null,\r\n SamplePlateTypeId: samplePlateId,\r\n ServiceGroupId: plate.ServiceGroup?.Id ?? null,\r\n Active: plate.Active ?? true,\r\n IsRack: plate.IsRack ?? false,\r\n };\r\n try {\r\n yield call(httpClient.post, baseUrl, httpPayload);\r\n successCount++;\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined);\r\n if (message !== undefined) {\r\n errors.push(message);\r\n }\r\n } finally {\r\n yield put(actions.bulkCreate_SetProgress((100 * index) / plates.length));\r\n }\r\n }\r\n if (errors.length > 0) {\r\n for (const error of errors) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplePlatesCreate',\r\n message: error,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n yield put(actions.create_Error(Error));\r\n }\r\n if (successCount > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.bulkCreate_Success());\r\n }\r\n}\r\n\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n original: ISamplePlateDto;\r\n current: Partial;\r\n }>,\r\n) {\r\n const current = action.payload.current;\r\n const samplePlateId = current.SamplePlateType?.Id ?? null;\r\n if (samplePlateId === null) {\r\n yield put(actions.create_Error('SamplePlateId is required'));\r\n return;\r\n }\r\n const httpPayload: Partial = {\r\n Id: current.Id ?? '',\r\n RoomId: current.Room?.Id ?? null,\r\n LocationId: current.Location?.Id ?? null,\r\n SamplePlateTypeId: samplePlateId,\r\n ServiceGroupId: current.ServiceGroup?.Id ?? null,\r\n LocationName: null,\r\n RoomName: null,\r\n SamplePlateTypeName: null,\r\n ServiceGroupName: null,\r\n Active: current.Active ?? true,\r\n IsRack: current.IsRack ?? false,\r\n };\r\n try {\r\n const someResult = yield call(\r\n httpClient.patch,\r\n `${baseUrl}('${action.payload.original.Id}')`,\r\n httpPayload,\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.update_Success(someResult));\r\n } catch (error) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.errormessage),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.update_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doDelete(action: PayloadAction) {\r\n const messageKey = 'SamplePlatesDelete';\r\n try {\r\n const someResult = yield call(\r\n httpClient.delete,\r\n `${baseUrl}('${action.payload}')`,\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: messageKey,\r\n message: i18next.t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(actions.delete_Success(someResult));\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: messageKey,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.delete_Error(Error));\r\n }\r\n}\r\nfunction* doDeactivatePlates(action: PayloadAction) {\r\n const messageKey = 'SamplePlatesDelete';\r\n try {\r\n const payload: Pick = { Active: false };\r\n yield all(\r\n action.payload\r\n .map(samplePlate => `${baseUrl}('${samplePlate.Id}')`)\r\n .map(url => call(httpClient.patch, url, payload)),\r\n );\r\n yield put(actions.deactivatePlates_Success());\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: messageKey,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.deactivatePlates_Error());\r\n }\r\n}\r\n\r\nfunction* doDeletePlates(action: PayloadAction) {\r\n const messageKey = 'SamplePlatesDelete';\r\n try {\r\n yield all(\r\n action.payload\r\n .map(samplePlate => `${baseUrl}('${samplePlate.Id}')`)\r\n .map(url => call(httpClient.delete, url)),\r\n );\r\n yield put(actions.deletePlates_Success());\r\n } catch (error) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: messageKey,\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.deletePlates_Error());\r\n }\r\n}\r\n\r\nexport function* samplePlatesSaga() {\r\n yield takeLatest(actions.get.type, doGet);\r\n yield takeLatest(actions.create.type, doCreate);\r\n yield takeLatest(actions.create_Success.type, doRefresh);\r\n yield takeLatest(actions.bulkCreate.type, doBulkCreate);\r\n yield takeLatest(actions.bulkCreate_Success.type, doRefresh);\r\n yield takeLatest(actions.update.type, doUpdate);\r\n yield takeLatest(actions.update_Success.type, doRefresh);\r\n yield takeLatest(actions.delete.type, doDelete);\r\n yield takeLatest(actions.delete_Success.type, doRefresh);\r\n yield takeLeading(actions.deactivatePlates.type, doDeactivatePlates);\r\n yield takeLatest(actions.deactivatePlates_Success.type, doRefresh);\r\n yield takeLeading(actions.deletePlates.type, doDeletePlates);\r\n yield takeLatest(actions.deletePlates_Success.type, doRefresh);\r\n yield takeLeading(actions.export, doExport);\r\n}\r\n","import { extractErrorMessages } from 'api/utils';\r\nimport { AxiosError } from 'axios';\r\n//import fileDownload from 'js-file-download';\r\nimport { ExportImportActions } from '.';\r\nimport { ImportData, ImportResult } from './Types';\r\n\r\nexport interface ImportFileResult {\r\n resultData?: any | undefined;\r\n resultFileName?: string | undefined;\r\n importResult: ImportResult;\r\n errorMessage?: string | undefined;\r\n NewRecordsImported: number;\r\n ExistingRecordsUpdated: number;\r\n ImportErrors: number;\r\n SystemErrorMessage?: string | null;\r\n}\r\n\r\nasync function ParseResultBlob(\r\n data: Blob,\r\n): Promise<{ file: Blob | undefined; obj: any | undefined }> {\r\n const size = data.size;\r\n const jsonBlobSize = data.slice(size - 4, size);\r\n const jsonBlobSizeText = await jsonBlobSize.text();\r\n const l = parseInt(jsonBlobSizeText);\r\n const jsonBlob = data.slice(size - l - 4, size - 4);\r\n const s = await jsonBlob.text();\r\n const obj = JSON.parse(s);\r\n return {\r\n file: size - l - 4 > 0 ? data.slice(0, size - l - 4) : undefined,\r\n obj: obj,\r\n };\r\n}\r\nexport async function GenericImport(\r\n file: File | undefined,\r\n data?: ImportData,\r\n url?: string,\r\n): Promise {\r\n var res: ImportFileResult | undefined = undefined;\r\n try {\r\n if (file !== undefined) {\r\n const response = await ExportImportActions.Import(\r\n url ?? '/api/GenericImport/Import',\r\n file,\r\n data,\r\n );\r\n if (response.data !== undefined && response.data.size > 0) {\r\n const cd = response.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined ? cd.split('filename=')[1] : 'ImportResult.xlsx';\r\n const data = await ParseResultBlob(response.data);\r\n res = {\r\n resultData: data.file,\r\n resultFileName: filename,\r\n importResult: data.obj.Result as ImportResult,\r\n NewRecordsImported: data.obj.InsertedRows,\r\n ExistingRecordsUpdated: data.obj.UpdatedRows,\r\n ImportErrors: data.obj.Errors,\r\n SystemErrorMessage: data.obj.SystemErrorMessage,\r\n };\r\n } else {\r\n res = {\r\n importResult: ImportResult.failed,\r\n NewRecordsImported: 0,\r\n ExistingRecordsUpdated: 0,\r\n ImportErrors: 0,\r\n };\r\n }\r\n } else {\r\n return Promise.resolve(res);\r\n }\r\n } catch (error: unknown) {\r\n let testmsg = extractErrorMessages(error);\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n testmsg;\r\n res = {\r\n importResult: ImportResult.failed,\r\n errorMessage: message ?? (error as AxiosError)?.message,\r\n NewRecordsImported: 0,\r\n ExistingRecordsUpdated: 0,\r\n ImportErrors: 0,\r\n };\r\n }\r\n return Promise.resolve(res);\r\n}\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport DecimalRenderer from 'app/components/BasicTable/CellRenderers/DecimalRenderer';\r\nimport ServiceIdRenderer from 'app/components/BasicTable/CellRenderers/EquipmentIdRenderer';\r\nimport OperationTypeIdRenderer from 'app/components/BasicTable/CellRenderers/OperationTypeIdRenderer';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ExternalLink, Link } from 'app/components/ExternalLink';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { IMyAssetsRow } from './IMyAssetsRow';\r\nimport AssetImageRenderer from 'app/components/BasicTable/CellRenderers/AssetImageRenderer';\r\nimport { RegionLink } from '../Regions/RegionLink';\r\n\r\nexport function getColumns(\r\n t: TFunction,\r\n user: AuthenticatedUser | undefined,\r\n appSettings: AppSettings | null,\r\n settings: GlobalSettings | null,\r\n) {\r\n const suppliersLabel = tryParseBool(\r\n settings?.GetString(AllowedSettings.RequireSupplierExternalId),\r\n )\r\n ? t(translations.ExternalCompany)\r\n : t(translations.SupplierExternalId);\r\n const isAdmin = user?.Roles.includes(Roles.Administrators);\r\n const res: ColumnWithDep[] = [\r\n {\r\n Header: t(translations.HashSymbol) as string,\r\n accessor: 'Id',\r\n Cell: ServiceIdRenderer,\r\n },\r\n {\r\n Header: t(translations.Active) as string,\r\n accessor: 'Active',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.Image) as string,\r\n accessor: 'ImageName',\r\n Cell: AssetImageRenderer,\r\n notShowTitle: true,\r\n },\r\n {\r\n Header: t(translations.Asset) as string,\r\n accessor: 'Name',\r\n Cell: ({ value, row }) => {\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Header: t(translations.Created) as string,\r\n accessor: 'AssetRecordDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.LifeDate) as string,\r\n accessor: 'LifeDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.Status) as string,\r\n accessor: 'Status',\r\n Cell: ({ value, row }) => {\r\n let color = 'black';\r\n let backgroundColor = 'white';\r\n switch (row.original.StatusId) {\r\n case 1:\r\n color = bookitColors.success.dark;\r\n backgroundColor = bookitColors.success.background;\r\n break;\r\n case 2:\r\n color = bookitColors.warning.dark;\r\n backgroundColor = bookitColors.warning.background;\r\n break;\r\n case 3:\r\n color = bookitColors.danger.dark;\r\n backgroundColor = bookitColors.danger.background;\r\n break;\r\n default:\r\n color = 'black';\r\n backgroundColor = 'white';\r\n }\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n },\r\n deps: ['StatusId'],\r\n },\r\n {\r\n Header: t(translations.InstrumentCat) as string,\r\n accessor: 'InstrumentCatName',\r\n },\r\n {\r\n Header: t(translations.OperationType) as string,\r\n accessor: 'OperationTypeID',\r\n Cell: OperationTypeIdRenderer,\r\n },\r\n {\r\n Header: t(translations.Availability) as string,\r\n accessor: 'AvailabilityTypeName',\r\n },\r\n {\r\n Header: t(translations.AssetCatName) as string,\r\n accessor: 'AssetCatName',\r\n },\r\n {\r\n Header: t(translations.AssetCatGroupName) as string,\r\n accessor: 'AssetCatGroupName',\r\n },\r\n {\r\n Header: t(translations.AssetType2Counter) as string,\r\n accessor: 'Type2Counter',\r\n },\r\n {\r\n Header: t(translations.AccountingId) as string,\r\n accessor: 'AccountingId',\r\n },\r\n {\r\n Header: t(translations.Overdue) as string,\r\n accessor: 'Overdue',\r\n },\r\n {\r\n Header: t(translations.DueToday) as string,\r\n accessor: 'DueToday',\r\n },\r\n {\r\n Header: t(translations.ShortDescriptionOfInstrument) as string,\r\n accessor: 'ShortDescription',\r\n },\r\n {\r\n Header: t(translations.Description) as string,\r\n accessor: 'Description',\r\n Cell: DescriptionCell({ width: 'medium' }),\r\n },\r\n {\r\n Header: t(translations.Campus) as string,\r\n accessor: 'Campus',\r\n },\r\n {\r\n Header: t(translations.Building) as string,\r\n accessor: 'Building',\r\n Cell: ({ value, row }) => {\r\n if (row.original.AreaMapId === null) {\r\n return <>{value};\r\n } else {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n }\r\n },\r\n deps: ['AreaMapId'],\r\n },\r\n {\r\n Header: t(translations.Room) as string,\r\n accessor: 'Room',\r\n Cell: ({ value, row }) => {\r\n if (row.original.RoomMapId === null) {\r\n return <>{value};\r\n } else {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n }\r\n },\r\n deps: ['RoomId', 'RoomMapId'],\r\n },\r\n {\r\n Header: t(translations.CoreName) as string,\r\n accessor: 'ServiceGroupName',\r\n Cell: ({ value, row }) => {\r\n if (row.original.ServiceGroupAssetId === null) {\r\n return <>{value};\r\n } else {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n }\r\n },\r\n deps: ['ServiceGroupAssetId'],\r\n },\r\n {\r\n Header: t(translations.OtherNames) as string,\r\n accessor: 'OtherNames',\r\n },\r\n {\r\n Header: t(translations.Brand) as string,\r\n accessor: 'Brand',\r\n },\r\n {\r\n Header: t(translations.Raac) as string,\r\n accessor: 'Raac',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.ApprovalRequired) as string,\r\n accessor: 'ApprovalRequired',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.MainSpecRange) as string,\r\n accessor: 'MainSpecRange',\r\n },\r\n {\r\n Header: t(translations.WebLink) as string,\r\n accessor: 'WebLink',\r\n },\r\n {\r\n Header: t(translations.BrandCode) as string,\r\n accessor: 'BrandCode',\r\n },\r\n {\r\n Header: t(translations.InternalCode) as string,\r\n accessor: 'InternalCode',\r\n },\r\n {\r\n Header: t(translations.Rank) as string,\r\n accessor: 'Rank',\r\n },\r\n {\r\n Header: t(translations.ElectricalSpecs) as string,\r\n accessor: 'ElectricalSpecs',\r\n },\r\n {\r\n Header: t(translations.FunctionalCharacteristics) as string,\r\n accessor: 'FunctionalCharacteristics',\r\n },\r\n {\r\n Header: t(translations.Inventory) as string,\r\n accessor: 'inventory',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL0) as string,\r\n accessor: 'ExtraDDL0Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL1) as string,\r\n accessor: 'ExtraDDL1Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL2) as string,\r\n accessor: 'ExtraDDL2Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL3) as string,\r\n accessor: 'ExtraDDL3Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL4) as string,\r\n accessor: 'ExtraDDL4Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL5) as string,\r\n accessor: 'ExtraDDL5Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL6) as string,\r\n accessor: 'ExtraDDL6Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL7) as string,\r\n accessor: 'ExtraDDL7Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL8) as string,\r\n accessor: 'ExtraDDL8Value',\r\n Cell: ({ value, original }) => !!value && <>{original.ExtraDDL8Value},\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL9) as string,\r\n accessor: 'ExtraDDL9Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL10) as string,\r\n accessor: 'ExtraDDL10Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL11) as string,\r\n accessor: 'ExtraDDL11Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL12) as string,\r\n accessor: 'ExtraDDL12Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL13) as string,\r\n accessor: 'ExtraDDL13Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL14) as string,\r\n accessor: 'ExtraDDL14Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDDL15) as string,\r\n accessor: 'ExtraDDL15Value',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText0) as string,\r\n accessor: 'ExtraText0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText1) as string,\r\n accessor: 'ExtraText1',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText2) as string,\r\n accessor: 'ExtraText2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText3) as string,\r\n accessor: 'ExtraText3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText4) as string,\r\n accessor: 'ExtraText4',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText5) as string,\r\n accessor: 'ExtraText5',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText6) as string,\r\n accessor: 'ExtraText6',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText7) as string,\r\n accessor: 'ExtraText7',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText8) as string,\r\n accessor: 'ExtraText8',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText9) as string,\r\n accessor: 'ExtraText9',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText10) as string,\r\n accessor: 'ExtraText10',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText11) as string,\r\n accessor: 'ExtraText11',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText12) as string,\r\n accessor: 'ExtraText12',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText13) as string,\r\n accessor: 'ExtraText13',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText14) as string,\r\n accessor: 'ExtraText14',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraText15) as string,\r\n accessor: 'ExtraText15',\r\n },\r\n {\r\n accessor: 'ExtraDate0',\r\n Header: t(translations.Asset_ExtraDate0) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate1',\r\n Header: t(translations.Asset_ExtraDate1) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate2',\r\n Header: t(translations.Asset_ExtraDate2) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate3',\r\n Header: t(translations.Asset_ExtraDate3) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate4',\r\n Header: t(translations.Asset_ExtraDate4) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate5',\r\n Header: t(translations.Asset_ExtraDate5) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate6',\r\n Header: t(translations.Asset_ExtraDate6) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate7',\r\n Header: t(translations.Asset_ExtraDate7) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate8',\r\n Header: t(translations.Asset_ExtraDate8) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'ExtraDate9',\r\n Header: t(translations.Asset_ExtraDate9) as string,\r\n Cell: DateRenderer,\r\n },\r\n /*{\r\n Header: t(translations.Asset_ExtraInt0) as string,\r\n accessor: 'ExtraInt0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraInt1) as string,\r\n accessor: 'ExtraInt1',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraInt2) as string,\r\n accessor: 'ExtraInt2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraInt3) as string,\r\n accessor: 'ExtraInt3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraInt4) as string,\r\n accessor: 'ExtraInt4',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDec0) as string,\r\n accessor: 'ExtraDec0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDec1) as string,\r\n accessor: 'ExtraDec1',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDec2) as string,\r\n accessor: 'ExtraDec2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDec3) as string,\r\n accessor: 'ExtraDec3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraDec4) as string,\r\n accessor: 'ExtraDec4',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraBool0) as string,\r\n accessor: 'ExtraBool0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraBool1) as string,\r\n accessor: 'ExtraBool1',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraBool2) as string,\r\n accessor: 'ExtraBool2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraBool3) as string,\r\n accessor: 'ExtraBool3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraBool4) as string,\r\n accessor: 'ExtraBool4',\r\n },*/\r\n {\r\n Header: t(translations.Asset_ExtraUrl0) as string,\r\n accessor: 'ExtraUrl0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraUrl1) as string,\r\n accessor: 'ExtraUrl1',\r\n },\r\n /*{\r\n Header: t(translations.Asset_ExtraUrl2) as string,\r\n accessor: 'ExtraUrl2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraUrl3) as string,\r\n accessor: 'ExtraUrl3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraUrl4) as string,\r\n accessor: 'ExtraUrl4',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraRichText0) as string,\r\n accessor: 'ExtraRichText0',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraRichText1) as string,\r\n accessor: 'ExtraRichText1',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraRichText2) as string,\r\n accessor: 'ExtraRichText2',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraRichText3) as string,\r\n accessor: 'ExtraRichText3',\r\n },\r\n {\r\n Header: t(translations.Asset_ExtraRichText4) as string,\r\n accessor: 'ExtraRichText4',\r\n },*/\r\n {\r\n Header: t(translations.NickName) as string,\r\n accessor: 'NickName',\r\n },\r\n {\r\n Header: t(translations.PurchaseOrder) as string,\r\n accessor: 'POnumber',\r\n },\r\n {\r\n Header: t(translations.ServiceContract) as string,\r\n accessor: 'ServiceContract',\r\n },\r\n {\r\n Header: t(translations.GasSource) as string,\r\n accessor: 'GasSource',\r\n },\r\n {\r\n Header: t(translations.ModelNumber) as string,\r\n accessor: 'ModelNumber',\r\n },\r\n {\r\n Header: t(translations.Accessories) as string,\r\n accessor: 'AccessoriesText',\r\n },\r\n {\r\n Header: t(translations.SGA_Public) as string,\r\n accessor: 'Public',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.LocationName) as string,\r\n accessor: 'LocationName',\r\n },\r\n {\r\n Header: t(translations.SubLocationName) as string,\r\n accessor: 'SubLocationName',\r\n },\r\n {\r\n Header: t(translations.UnderOriginalWarranty) as string,\r\n accessor: 'CanViewWarrantyEndDate',\r\n Cell: ({ value, row }) => {\r\n if (\r\n settings?.GetBooleanByKey(\r\n AllowedSettings.WarrantyEndDateVisibleAllUsers,\r\n )\r\n ) {\r\n return ;\r\n } else {\r\n let canview =\r\n user !== undefined &&\r\n (user.Roles.includes(Roles.Administrators) ||\r\n user.Roles.includes(Roles.InstrumentEventsAdmin) ||\r\n (user.Roles.includes(Roles.GroupAdministrators) &&\r\n user.HasAdminGroupPermissions(\r\n row.original.ServiceGroupId ?? undefined,\r\n )));\r\n return ;\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.ExportLicense) as string,\r\n accessor: 'ExportLicense',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.Tags) as string,\r\n accessor: 'TagsText',\r\n },\r\n {\r\n Header: t(translations.EquipmentExperts) as string,\r\n accessor: 'ExpertsText',\r\n },\r\n {\r\n Header: t(translations.ContactsPersonForEquipment) as string,\r\n accessor: 'ContactsText',\r\n },\r\n {\r\n Header: suppliersLabel,\r\n accessor: 'SuppliersText',\r\n },\r\n {\r\n Header: t(translations.AssemblyParent) as string,\r\n accessor: 'AssemblyParent',\r\n },\r\n {\r\n Header: t(translations.AssemblyChilds) as string,\r\n accessor: 'AssemblyChilds',\r\n },\r\n {\r\n Header: t(translations.BookAppVersion) as string,\r\n accessor: 'BookAppVersion',\r\n },\r\n {\r\n Header: t(translations.BookAppVersionUpdateDate) as string,\r\n accessor: 'BookAppVersionUpdateDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.LateTime) as string,\r\n accessor: 'LateTime',\r\n Cell: DecimalRenderer,\r\n },\r\n {\r\n Header: t(translations.EarlyLeaveTime) as string,\r\n accessor: 'EarlyLeaveTime',\r\n Cell: DecimalRenderer,\r\n },\r\n {\r\n Header: t(translations.EarlyStartAllowedMinutes) as string,\r\n accessor: 'EarlyStartAllowed',\r\n Cell: DecimalRenderer,\r\n },\r\n {\r\n Header: t(translations.Model) as string,\r\n accessor: 'Model',\r\n },\r\n ];\r\n\r\n if (IsModuleEnabled(appSettings, KnownModules.EquipmentAssemblies)) {\r\n res.push({\r\n Header: t(translations.InstrumentType) as string,\r\n accessor: 'InstrumentType',\r\n });\r\n }\r\n if (IsModuleEnabled(appSettings, KnownModules.LocationTracking)) {\r\n res.push({\r\n Header: t(translations.LocationUpdatedAt) as string,\r\n accessor: 'LocationUpdatedAt',\r\n Cell: ({ value }) => ,\r\n });\r\n }\r\n if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n res.push({\r\n Header: t(translations.Division) as string,\r\n accessor: 'DivisionName',\r\n Cell: ({ value, row }) => {\r\n if (row.original.DivisionAssetId === null) {\r\n return <>{value};\r\n } else {\r\n return (\r\n <>\r\n {value}\r\n \r\n );\r\n }\r\n },\r\n deps: ['DivisionAssetId'],\r\n });\r\n res.push({\r\n Header: t(translations.Region) as string,\r\n accessor: 'RegionName',\r\n Cell: ({ value, row }) => {\r\n if (isAdmin) {\r\n if (!row.original.RegionId || row.original.RegionId === null) {\r\n return <>{t(translations.NA)};\r\n } else {\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n }\r\n } else {\r\n return <>{value ?? t(translations.NA)};\r\n }\r\n },\r\n });\r\n }\r\n\r\n return res;\r\n}\r\n","/**\r\n *\r\n * ServiceTypeEnumFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ServiceTypeEnumPicker } from 'app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker';\r\n\r\nexport const ServiceTypeEnumFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n | undefined}\r\n isOpen={props.open}\r\n placeholder={t(translations.AllValues)}\r\n additionalItem={props.additionalItem as Entity | undefined}\r\n ariaLabel={props.label}\r\n size=\"small\"\r\n id={props.id}\r\n />\r\n );\r\n};\r\nexport default ServiceTypeEnumFilter;\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface CloneEquipmentSettingsProps {\r\n rows: TRow[];\r\n getEquipmentIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function CloneEquipmentSettings({\r\n rows,\r\n getEquipmentIds,\r\n}: CloneEquipmentSettingsProps) {\r\n const { t } = useTranslation();\r\n\r\n const link = React.useMemo(() => {\r\n return `/CloneEquipmentSettings.aspx?${toQueryString({\r\n target: getEquipmentIds(rows).join(','),\r\n })}`;\r\n }, [getEquipmentIds, rows]);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetPickerFilter\r\n *\r\n */\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\n\r\nexport const AssetPickerFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default AssetPickerFilter;\r\n","import { Link } from 'app/components/ExternalLink';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Column } from 'react-table';\r\nimport DurationRenderer from 'app/components/BasicTable/CellRenderers/DurationRenderer';\r\n//import DurationHoursRenderer from 'app/components/BasicTable/CellRenderers/DurationHoursRenderer';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport BookedByRenderer from 'app/components/BasicTable/CellRenderers/BookedByRenderer';\r\nimport BooleanRenderer from 'app/components/BasicTable/CellRenderers/BooleanRenderer';\r\nimport { Fragment } from 'react';\r\nimport { Guid } from 'guid-typescript';\r\nimport { DateLabel } from 'app/components/DateLabel.tsx';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationLink } from '../Actions/GlobalSelectedActions/OpenReservation';\r\nimport React from 'react';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ReferenceType } from 'enums/ReferenceType';\r\n\r\nexport function getColumns(\r\n t: TFunction,\r\n user: IAuthenticatedUser | undefined,\r\n settings: GlobalSettings,\r\n allowedToView: (row: IReservationHistoryDto) => boolean,\r\n useSidePanel?: boolean,\r\n openSidePanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n if (user === undefined) {\r\n return [];\r\n }\r\n\r\n const result: Column[] = [\r\n {\r\n Header: t(translations.Id) as string,\r\n accessor: 'Id',\r\n Cell: ({ value, row: { original } }) =>\r\n allowedToView(original) ? (\r\n \r\n {useSidePanel && openSidePanel ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n {value}\r\n )}\r\n \r\n ) : (\r\n {value}\r\n ),\r\n },\r\n {\r\n Header: t(translations.EquipmentName) as string,\r\n accessor: 'EquipmentName',\r\n Cell: AssetRenderer,\r\n },\r\n {\r\n Header: t(translations.AvailabilityType) as string,\r\n accessor: 'AvailabilityType',\r\n },\r\n {\r\n Header: t(translations.StartTime) as string,\r\n accessor: 'StartTime',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.EndTime) as string,\r\n accessor: 'EndTime',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.Status) as string,\r\n accessor: 'Status',\r\n },\r\n {\r\n Header: t(translations.DurationH) as string,\r\n accessor: 'DurationH',\r\n Cell: ({ value }) => {\r\n if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n return <>;\r\n },\r\n },\r\n {\r\n Header: t(translations.DurationT) as string,\r\n accessor: 'DurationT',\r\n Cell: DurationRenderer,\r\n },\r\n {\r\n Header: t(translations.AccService) as string,\r\n accessor: 'AccService',\r\n },\r\n {\r\n Header: t(translations.RecordDate) as string,\r\n accessor: 'RecordDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.BudgetNumber) as string,\r\n accessor: 'BudgetNumber',\r\n },\r\n {\r\n Header: t(translations.CancelledBefore) as string,\r\n accessor: 'CancelledBefore',\r\n Cell: DurationRenderer,\r\n /* Cell: ({ value }) =>\r\n value === undefined\r\n ? 'N/A'\r\n : dateUtils.HoursMinutesSecondsFormat(value), */\r\n },\r\n {\r\n Header: t(translations.BudgetTaskName) as string,\r\n accessor: 'BudgetTaskName',\r\n },\r\n {\r\n Header: t(translations.UserGroup) as string,\r\n accessor: 'ADGroupDisplayName',\r\n Cell: ({ value, row }) => {\r\n if (user.Roles.includes(Roles.Administrators)) {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n } else {\r\n return <> {value} ;\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.BookedBy) as string,\r\n accessor: 'BookedBy',\r\n Cell: BookedByRenderer,\r\n },\r\n {\r\n Header: t(translations.BudgetExperiment) as string,\r\n accessor: 'BudgetExperimentName',\r\n },\r\n {\r\n Header: t(translations.Remarks) as string,\r\n accessor: 'Remarks',\r\n // Cell: DescriptonCell({ width: 30 }),\r\n },\r\n {\r\n Header: t(translations.NumberOfUsages) as string,\r\n accessor: 'NumberOfUsages',\r\n },\r\n {\r\n Header: t(translations.LastModifiedAt) as string,\r\n accessor: 'LastModifiedAt',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.WorkflowBookingName) as string,\r\n accessor: 'WorkflowBookingName',\r\n },\r\n {\r\n Header: t(translations.ServiceGroup) as string,\r\n accessor: 'ServiceGroup',\r\n },\r\n {\r\n Header: t(translations.BudgetInternalId) as string,\r\n accessor: 'BudgetInternalId',\r\n },\r\n {\r\n Header: t(translations.RemainingDurationD) as string,\r\n accessor: 'RemainingDurationD',\r\n },\r\n {\r\n Header: t(translations.BookedById) as string,\r\n accessor: 'BookedById',\r\n },\r\n {\r\n Header: t(translations.FullDayReservation) as string,\r\n accessor: 'FullDayReservation',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.ADGroup) as string,\r\n accessor: 'ADGroup',\r\n },\r\n {\r\n Header: t(translations.Tutoring) as string,\r\n accessor: 'Tutoring',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.UserEmail) as string,\r\n accessor: 'UserEmail',\r\n },\r\n {\r\n Header: t(translations.Loanable) as string,\r\n accessor: 'Loanable',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.TrainingSignUp) as string,\r\n accessor: 'TrainingSignUp',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.BudgetRemarks) as string,\r\n accessor: 'BudgetRemarks',\r\n },\r\n {\r\n Header: t(translations.UserGroupMail) as string,\r\n accessor: 'UserGroupMail',\r\n },\r\n {\r\n Header: t(translations.InsertedBy) as string,\r\n accessor: 'InsertedBy',\r\n },\r\n {\r\n Header: t(translations.LastUpdateAdmin) as string,\r\n accessor: 'LastUpdateAdmin',\r\n },\r\n {\r\n Header: t(translations.DivisionDescription) as string,\r\n accessor: 'DivisionDescription',\r\n },\r\n {\r\n Header: t(translations.Division) as string,\r\n accessor: 'Division',\r\n },\r\n {\r\n Header: t(translations.AssetId) as string,\r\n accessor: 'AssetId',\r\n },\r\n {\r\n Header: t(translations.BudgetFund) as string,\r\n accessor: 'BudgetFund',\r\n },\r\n {\r\n Header: t(translations.AssetInternalCode) as string,\r\n accessor: 'AssetInternalCode',\r\n },\r\n {\r\n Header: t(translations.AssetRoom) as string,\r\n accessor: 'AssetRoom',\r\n },\r\n {\r\n Header: t(translations.AssetDescription) as string,\r\n accessor: 'AssetDescription',\r\n },\r\n {\r\n Header: t(translations.AssetModel) as string,\r\n accessor: 'AssetModel',\r\n },\r\n {\r\n Header: t(translations.AssetModelNumber) as string,\r\n accessor: 'AssetModelNumber',\r\n },\r\n {\r\n Header: t(translations.TotalReservations) as string,\r\n accessor: 'TotalReservations',\r\n },\r\n {\r\n Header: t(translations.ServiceType) as string,\r\n accessor: 'ServiceType',\r\n },\r\n {\r\n Header: t(translations.Institute) as string,\r\n accessor: 'Institute',\r\n },\r\n {\r\n Header: t(translations.InstituteType) as string,\r\n accessor: 'InstituteType',\r\n },\r\n {\r\n Header: t(translations.Department) as string,\r\n accessor: 'Department',\r\n },\r\n {\r\n Header: t(translations.Units) as string,\r\n accessor: 'Units',\r\n },\r\n {\r\n Header: t(translations.BudgetInitialCost) as string,\r\n accessor: 'BudgetInitialCost',\r\n Cell: ({ value }) => {\r\n if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n return <>;\r\n },\r\n },\r\n {\r\n Header: t(translations.BudgetLeader) as string,\r\n accessor: 'BudgetLeader',\r\n },\r\n {\r\n Header: t(translations.BudgetExternalUpdatedAt) as string,\r\n accessor: 'BudgetExternalUpdatedAt',\r\n },\r\n {\r\n Header: t(translations.BudgetExternalEndDate) as string,\r\n accessor: 'BudgetExternalEndDate',\r\n },\r\n {\r\n Header: t(translations.BudgetIsOnline) as string,\r\n accessor: 'BudgetIsOnline',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.BudgetEndDate) as string,\r\n accessor: 'BudgetEndDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.BudgetStartDate) as string,\r\n accessor: 'BudgetStartDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.BudgetHideExperiments) as string,\r\n accessor: 'BudgetHideExperiments',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.BudgetManager) as string,\r\n accessor: 'BudgetManager',\r\n },\r\n {\r\n Header: t(translations.BudgetSubsProfCostCenter) as string,\r\n accessor: 'BudgetSubsProfCostCenter',\r\n },\r\n {\r\n Header: t(translations.BudgetSubsProfProjectNumber) as string,\r\n accessor: 'BudgetSubsProfProjectNumber',\r\n },\r\n {\r\n Header: t(translations.FacilityProject) as string,\r\n accessor: 'FacilityProject',\r\n },\r\n {\r\n Header: t(translations.AssetCampus) as string,\r\n accessor: 'AssetCampus',\r\n },\r\n {\r\n Header: t(translations.PartialAttendanceStart) as string,\r\n accessor: 'PartialAttendanceStart',\r\n },\r\n {\r\n Header: t(translations.PartialAttendanceEnd) as string,\r\n accessor: 'PartialAttendanceEnd',\r\n },\r\n {\r\n Header: t(translations.BudgetSubsProfActivity) as string,\r\n accessor: 'BudgetSubsProfActivity',\r\n },\r\n {\r\n Header: t(translations.PartialAttendanceDuration) as string,\r\n accessor: 'PartialAttendanceDuration',\r\n },\r\n {\r\n Header: t(translations.AssetCategory) as string,\r\n accessor: 'AssetCategory',\r\n },\r\n {\r\n Header: t(translations.AssetCategoryGroup) as string,\r\n accessor: 'AssetCategoryGroup',\r\n },\r\n {\r\n Header: t(translations.PartialAttendance) as string,\r\n accessor: 'PartialAttendance',\r\n Cell: BooleanRenderer,\r\n },\r\n {\r\n Header: t(translations.BudgetHardLimit) as string,\r\n accessor: 'BudgetHardLimit',\r\n Cell: ({ value }) => {\r\n if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n return <>;\r\n },\r\n },\r\n {\r\n Header: t(translations.BudgetSoftLimit) as string,\r\n accessor: 'BudgetSoftLimit',\r\n Cell: ({ value }) => {\r\n if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n return <>;\r\n },\r\n },\r\n {\r\n Header: t(translations.BudgetAmount) as string,\r\n accessor: 'BudgetAmount',\r\n Cell: ({ value }) => {\r\n if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n return <>;\r\n },\r\n },\r\n {\r\n Header: t(translations.AssetBuilding) as string,\r\n accessor: 'AssetBuilding',\r\n },\r\n {\r\n Header: t(translations.StaffUser) as string,\r\n accessor: 'StaffUser',\r\n },\r\n {\r\n Header: t(translations.ServiceActivityCode) as string,\r\n accessor: 'ServiceActivityCode',\r\n },\r\n {\r\n Header: t(translations.AssetBrandCode) as string,\r\n accessor: 'AssetBrandCode',\r\n },\r\n {\r\n Header: t(translations.Year) as string,\r\n accessor: 'Year',\r\n },\r\n {\r\n Header: t(translations.Month) as string,\r\n accessor: 'Month',\r\n },\r\n {\r\n Header: t(translations.WeekNumber) as string,\r\n accessor: 'WeekNumber',\r\n },\r\n {\r\n Header: t(translations.UserDiscipline) as string,\r\n accessor: 'UserDiscipline',\r\n },\r\n {\r\n Header: t(translations.ServiceGroupAdminEmail) as string,\r\n accessor: 'ServiceGroupAdminEmail',\r\n },\r\n {\r\n Header: t(translations.CollaboratorUsers) as string,\r\n accessor: 'CollaboratorUsers',\r\n Cell: ({ value }) => {\r\n if (value) {\r\n let result = value.map(item => {\r\n return (\r\n \r\n {item}\r\n
    \r\n
    \r\n );\r\n });\r\n if (result) return <>{result};\r\n }\r\n return t(translations.NA) as string;\r\n },\r\n },\r\n {\r\n Header: t(translations.BudgetBudget) as string,\r\n accessor: 'BudgetBudget',\r\n },\r\n {\r\n Header: t(translations.StartDate) as string,\r\n accessor: 'StartDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.EndDate) as string,\r\n accessor: 'EndDate',\r\n Cell: ({ value }) => ,\r\n },\r\n {\r\n Header: t(translations.BudgetPercent) as string,\r\n accessor: 'BudgetPercent',\r\n },\r\n {\r\n Header: t(translations.Charges) as string,\r\n accessor: 'Charges',\r\n Cell: ({ value, row }) =>\r\n !!value && value !== null ? (\r\n \r\n {roundTwoPlacesAfterDecimalPoint(value)}\r\n \r\n ) : null,\r\n },\r\n ];\r\n return result;\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { UserProfileLink } from '../../components/UserProfileLink';\r\n\r\ntype RecordType = Record;\r\nconst BookedByRenderer: Renderer> = ({ value, row }) => {\r\n if (value === null || value === undefined) {\r\n return <>;\r\n }\r\n return (\r\n \r\n );\r\n};\r\nexport default BookedByRenderer;\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function ReservationHistoryTable<\r\n TProps extends Omit<\r\n BasicTableProps,\r\n | 'api'\r\n | 'additionalColumns'\r\n | 'searchColumns'\r\n | 'screenName'\r\n | 'expandedColumns'\r\n >,\r\n>({\r\n initialState,\r\n rowActions,\r\n serviceGroups,\r\n savedListSettings,\r\n ...props\r\n}: TProps) {\r\n const { t } = useTranslation();\r\n const newProps = React.useMemo(() => {\r\n const p = { ...props };\r\n Reflect.deleteProperty(p, 'api');\r\n return p;\r\n }, [props]);\r\n const addColumns = React.useMemo<(keyof IReservationHistoryDto)[]>(() => {\r\n const cols: (keyof IReservationHistoryDto)[] = [\r\n 'Id',\r\n 'AssetId',\r\n 'ServiceGroupId',\r\n 'LastUpdateAdminId',\r\n 'InsertedById',\r\n 'AvailabilityTypeId',\r\n 'SessionId',\r\n 'AssetCatId',\r\n 'AssetGroupId',\r\n 'BudgetId',\r\n 'BudgetExperimentId',\r\n 'BookedById',\r\n 'BudgetExperimentId',\r\n 'EquipmentId',\r\n 'InstituteTypeId',\r\n 'DepartmentId',\r\n 'InstituteId',\r\n 'AssetCampusId',\r\n 'StaffUserId',\r\n 'AssetRoomId',\r\n 'AssetBuildingId',\r\n 'UserDisciplineId',\r\n 'TopAssemblyReservationId',\r\n 'ServiceRequestIds',\r\n 'RowsRequestIds',\r\n ];\r\n return cols;\r\n }, []);\r\n const url = '/api/odata/v4/ReservationHistory';\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Comments } from 'app/components/Comments';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Renderer } from 'react-table';\r\nimport { IInvoiceBatchesDto } from './IInvoiceBatchesDto';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { intersection } from 'lodash';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nexport interface InvoiceBatchesCommentsProps {\r\n batchId: number;\r\n}\r\n\r\nexport const InvoiceBatchesComments = (props: InvoiceBatchesCommentsProps) => {\r\n const { t } = useTranslation();\r\n const User: AuthenticatedUser | undefined = useSelector(\r\n selectAuthenticatedUser,\r\n );\r\n\r\n //PERMISSIONS\r\n const roles: number[] | undefined = User?.Roles;\r\n\r\n const allowedRoles: Roles[] = [\r\n Roles.Administrators,\r\n Roles.GroupAdministrators,\r\n Roles.FinAdmin,\r\n Roles.CustomRole,\r\n ];\r\n\r\n const adminRoles: Roles[] = [Roles.Administrators, Roles.GroupAdministrators];\r\n\r\n const isAdmin: boolean = intersection(roles, adminRoles).length > 0;\r\n const hasPermissions: boolean = intersection(roles, allowedRoles).length > 0;\r\n const { onCommentAdded } = useUploadToNewComment();\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const InvoiceBatchesCommentsRenderer: Renderer = ({\r\n value,\r\n row: { original },\r\n}) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const User: AuthenticatedUser | undefined = useSelector(\r\n selectAuthenticatedUser,\r\n );\r\n\r\n //PERMISSIONS\r\n const roles: number[] | undefined = User?.Roles;\r\n\r\n const allowedRoles: Roles[] = [\r\n Roles.Administrators,\r\n Roles.GroupAdministrators,\r\n Roles.FinAdmin,\r\n Roles.CustomRole,\r\n ];\r\n const hasPermissions: boolean = intersection(roles, allowedRoles).length > 0;\r\n const onClick = () => {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.InvoiceBatchesComments,\r\n props: { batchId: original.Id },\r\n }),\r\n );\r\n };\r\n if (!hasPermissions) return <>{value};\r\n return {value};\r\n};\r\n","import { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { OtherServiceDetailsPageProps } from '.';\r\nimport { OfflineServiceQueryStringParameters } from '../Details/slice/types';\r\n\r\nexport const getParams = (\r\n params: URLSearchParams,\r\n props: OtherServiceDetailsPageProps,\r\n): OfflineServiceQueryStringParameters => {\r\n return {\r\n id:\r\n props.match.params['ID'] ||\r\n (GetRawValue(params, 'ID') ?? undefined) ||\r\n props.match.params['Id'] ||\r\n (GetRawValue(params, 'Id') ?? undefined) ||\r\n props.match.params['id'] ||\r\n (GetRawValue(params, 'id') ?? undefined),\r\n ipid:\r\n props.match.params['ipid'] || (GetRawValue(params, 'ipid') ?? undefined),\r\n servicedate:\r\n props.match.params['servicedate'] ||\r\n (GetRawValue(params, 'servicedate') ?? undefined),\r\n\r\n user:\r\n props.match.params['user'] || (GetRawValue(params, 'user') ?? undefined),\r\n bid: props.match.params['bid'] || (GetRawValue(params, 'bid') ?? undefined),\r\n remarks:\r\n props.match.params['remarks'] ||\r\n (GetRawValue(params, 'remarks') ?? undefined),\r\n be: props.match.params['be'] || (GetRawValue(params, 'be') ?? undefined),\r\n ecid:\r\n props.match.params['ecid'] || (GetRawValue(params, 'ecid') ?? undefined),\r\n po: props.match.params['po'] || (GetRawValue(params, 'po') ?? undefined),\r\n reference:\r\n props.match.params['ref'] || (GetRawValue(params, 'ref') ?? undefined),\r\n factor:\r\n props.match.params['factor'] ||\r\n (GetRawValue(params, 'factor') ?? undefined),\r\n amount:\r\n props.match.params['amount'] ||\r\n (GetRawValue(params, 'amount') ?? undefined),\r\n adg: props.match.params['adg'] || (GetRawValue(params, 'adg') ?? undefined),\r\n stid:\r\n props.match.params['stid'] || (GetRawValue(params, 'stid') ?? undefined),\r\n ReservationId:\r\n props.match.params['ReservationId'] ||\r\n (GetRawValue(params, 'ReservationId') ?? undefined),\r\n UsageId:\r\n props.match.params['UsageId'] ||\r\n (GetRawValue(params, 'UsageId') ?? undefined),\r\n batchId:\r\n props.match.params['batchId'] ||\r\n (GetRawValue(params, 'batchId') ?? undefined),\r\n };\r\n};\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { translations } from 'locales/translations';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport {\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n getNumberEntityArray,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetStringOrUndefined,\r\n initPickerValue,\r\n URLSearchParamsCI,\r\n arrayToQueryString,\r\n initMultiExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initProjectData } from 'app/components/pickers/AutocompletePickers/ProjectPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { initInstituteData } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport InstituteFilter from 'app/components/BasicTable/Filters/InstituteFilter';\r\nimport InstituteTypeFilter from 'app/components/BasicTable/Filters/InstituteTypeFilter';\r\nimport { initInstituteTypeData } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport DepartmentFilter from 'app/components/BasicTable/Filters/DepartmentFilter';\r\nimport { initDepartmentData } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { initUserGroupData } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport UserGroupFilter from 'app/components/BasicTable/Filters/UserGroupFIlter';\r\nimport { initServiceGroupsMultiData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { ServiceGroupsFilter } from 'app/components/BasicTable/Filters/ServiceGroupsFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { BudgetByUserGroupFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { ProjectFilter } from 'app/components/BasicTable/Filters/ProjectFilter';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n const result: IFilterSettings[] = [];\r\n // Project\r\n if (IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n result.push({\r\n fieldName: 'BudgetId',\r\n displayName: t(translations.BudgetNumber),\r\n operator: ODataOperators.Equals,\r\n // value: getDefaultFilterValue('bid', params),\r\n queryStringSerializer: 'bid',\r\n initData: initPickerValue(initProjectData),\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'bid'))),\r\n component: ProjectFilter,\r\n dependencyProp: ['UserGroupId'],\r\n filterPredicates: BudgetByUserGroupFilter,\r\n });\r\n }\r\n // Online/ offline projects: (online only/ offline only/ All= default)\r\n result.push({\r\n fieldName: 'BudgetOnline',\r\n displayName: t(translations.BudgetIsOnline),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'BudgetIsOnline',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'BudgetIsOnline')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n // Has Balance/ Estimated charges (yes/no/ all, default= all) - is this generating a performance issue (same question as above)\r\n result.push({\r\n fieldName: 'HasBalanceOrEstimatedCharges',\r\n displayName: t(translations.HasBalanceOrEstimatedCharges),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'HasBalanceOrEstimatedCharges',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(\r\n GetRawValue(params, 'HasBalanceOrEstimatedCharges'),\r\n ),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n // User group- as per the project user group.\r\n result.push({\r\n fieldName: 'UserGroupId',\r\n displayName: t(translations.UserGroup),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'adg'))),\r\n component: UserGroupFilter,\r\n queryStringSerializer: 'adg',\r\n initData: initPickerValue(initUserGroupData),\r\n });\r\n // Department- as per the project user group.\r\n result.push({\r\n id: 'DepartmentId',\r\n fieldName: 'DepartmentId',\r\n queryStringSerializer: 'DepartmentId',\r\n displayName: t(translations.Department),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'DepartmentId')),\r\n ),\r\n initData: initPickerValue(initDepartmentData),\r\n component: DepartmentFilter,\r\n });\r\n // Institute- as per the project user group.\r\n result.push({\r\n fieldName: 'InstituteId', // connected to Company\r\n displayName: t(translations.Company),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'InstituteId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'InstituteId')),\r\n ),\r\n initData: initPickerValue(initInstituteData),\r\n component: InstituteFilter,\r\n });\r\n // Institute Type -as per the project user group.\r\n\r\n result.push({\r\n fieldName: 'InstituteTypeId', // Company Type\r\n displayName: t(translations.InstituteType),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'InstituteTypeId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'InstituteTypeId')),\r\n ),\r\n initData: initPickerValue(initInstituteTypeData),\r\n component: InstituteTypeFilter,\r\n });\r\n // Only Active (yes/ no, default= yes)\r\n result.push({\r\n fieldName: 'BudgetActive',\r\n displayName: t(translations.Active),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'Active',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'Active')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n result.push({\r\n fieldName: 'ServiceGroupId',\r\n displayName: t(translations.ServiceGroups),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('ServiceGroupId'),\r\n value: getNumberEntityArray(params, 'ServiceGroupId'),\r\n initData: initMultiExPickerValue(initServiceGroupsMultiData),\r\n component: ServiceGroupsFilter,\r\n urlKey: 'ServiceGroupId',\r\n });\r\n return result;\r\n};\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { FrontendLayout_MainContent_ID } from 'app/Layout/FrontendLayout';\r\nimport Infinite, {\r\n Props as InfiniteProps,\r\n} from 'react-infinite-scroll-component';\r\n\r\nexport interface InfiniteScrollProps\r\n extends Pick<\r\n InfiniteProps,\r\n | 'children'\r\n | 'next'\r\n | 'hasMore'\r\n | 'dataLength'\r\n | 'className'\r\n | 'style'\r\n | 'hasChildren'\r\n | 'scrollableTarget'\r\n | 'scrollThreshold'\r\n > {}\r\n\r\nexport const InfiniteScroll = ({\r\n children,\r\n style,\r\n className,\r\n scrollableTarget = FrontendLayout_MainContent_ID,\r\n ...props\r\n}: InfiniteScrollProps) => {\r\n return (\r\n \r\n \r\n \r\n }\r\n className={className}\r\n scrollableTarget={scrollableTarget}\r\n style={\r\n style ??\r\n (className !== undefined\r\n ? undefined\r\n : {\r\n overflow: 'hidden',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: 16,\r\n })\r\n }\r\n {...props}\r\n >\r\n {children}\r\n \r\n );\r\n};\r\n","export enum JoinStatusEnum {\r\n Undefined = 0,\r\n Approved = 1,\r\n Pending = 2,\r\n Disapproved = 3,\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst RegionRenderer: Renderer>> = ({\r\n value,\r\n row,\r\n}) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const User: AuthenticatedUser | undefined = useSelector(\r\n selectAuthenticatedUser,\r\n );\r\n return !!User && User.isAdmin() ? (\r\n \r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.RegionDetails,\r\n props: {\r\n useSidePanel: true,\r\n id: '' + row.original.Id,\r\n initialModel: row.original,\r\n } as RegionDetailsProps,\r\n }),\r\n )\r\n }\r\n >\r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n );\r\n};\r\nexport default RegionRenderer;\r\n","import * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\n/**\r\n * EventContent props\r\n */\r\nexport interface EventContentProps {\r\n /**\r\n * Background color of the event (instrument color)\r\n */\r\n backgroundColor?: string;\r\n /**\r\n * Width of the container\r\n */\r\n containerWidth: string;\r\n /**\r\n * Width in pixels of the event container element (e.g. event length * time scale)\r\n */\r\n height: number;\r\n /**\r\n * Header content\r\n */\r\n header?: React.ReactNode;\r\n /**\r\n * Body content\r\n */\r\n body?: React.ReactNode;\r\n /**\r\n * Readonly\r\n */\r\n readonly?: boolean;\r\n /**\r\n * calculated top position of the event content on calendar week/unit view\r\n */\r\n offsetTopHeight?: number;\r\n notClickable?: boolean;\r\n}\r\n\r\n/**\r\n * Provides a layout of event element\r\n * @param props props\r\n * @returns Event Content\r\n */\r\nexport function EventContent(props: EventContentProps) {\r\n // overrides .dhx_cal_event .dhx_title height property from dhtmlxscheduler_material.css\r\n const EVENT_TITLE_HEIGHT = 34;\r\n return (\r\n <>\r\n {/* this one is in the dhtmlx's demo/docs, but this element does not appear much */}\r\n {!props.readonly && (\r\n
     
    \r\n )}\r\n {/* drag handle on the event title */}\r\n {props.header !== undefined && (\r\n \r\n {props.header}\r\n \r\n )}\r\n \r\n {props.body}\r\n \r\n {/* resize handle on the bottom of the event */}\r\n {!props.readonly && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Shared funciton used in scheduler to format time labels\r\n * @param d date\r\n * @returns string representation of the time part\r\n */\r\nexport const formatSchedulerTime = (d: Date) => dateUtils.format(d, 'p');\r\n\r\n/**\r\n * Shared funciton used in scheduler to format time labels\r\n * @param d date\r\n * @returns string representation of the time part\r\n */\r\nexport const formatSchedulerDateTime = (d: Date) => dateUtils.format(d, 'Pp');\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { formatSchedulerTime } from '../../utils/formatSchedulerTime';\r\n\r\n/**\r\n * Event header props\r\n */\r\nexport interface EventHeaderProps {\r\n event: ISchedulerEvent;\r\n}\r\n\r\n/**\r\n * Event header element\r\n * @param props props\r\n * @returns Event header\r\n */\r\nexport function EventHeader(props: EventHeaderProps) {\r\n return (\r\n <>\r\n
    \r\n {formatSchedulerTime(props.event.start_date)}\r\n {' - '}\r\n {formatSchedulerTime(props.event.end_date)}\r\n
    \r\n
    {props.event.service_name}
    \r\n \r\n );\r\n}\r\n","import { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon, IconProps } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TrainingState, TrainingStateUnion } from 'enums/TrainingState';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\n\r\nexport interface TrainingSessionStatusProps extends Omit {\r\n event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionStatus({\r\n event,\r\n size,\r\n className,\r\n}: TrainingSessionStatusProps) {\r\n const training = event.original as ITrainingSessionSlotDto;\r\n const stateid = training.TrainingState;\r\n if (stateid === undefined) {\r\n return null;\r\n }\r\n const state = TrainingState[stateid] as TrainingStateUnion;\r\n switch (state) {\r\n case 'SignedUp':\r\n return ;\r\n // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_SignedUp\") %>');\r\n case 'UnderMinimum':\r\n return (\r\n \r\n );\r\n // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_UnderMinimum\") %>');\r\n case 'Available':\r\n return ;\r\n // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_Available\") %>');\r\n case 'Maximum':\r\n return ;\r\n // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_Maximum\") %>');\r\n default:\r\n assertExhaustive(state);\r\n }\r\n}\r\n","import { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { EventHeader } from './EventHeader';\r\nimport { TrainingSessionStatus } from './TrainingSessionStatus';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\nexport interface TrainingSessionEventContentProps extends EventContentProps {\r\n event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventConent(\r\n props: TrainingSessionEventContentProps,\r\n) {\r\n return (\r\n }\r\n body={}\r\n readonly\r\n offsetTopHeight={props.offsetTopHeight}\r\n notClickable={props.notClickable}\r\n />\r\n );\r\n}\r\nexport interface TrainingSessionEventHeaderProps {\r\n event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventHeader(\r\n props: TrainingSessionEventHeaderProps,\r\n) {\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport interface TrainingSessionEventBodyProps {\r\n event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventBody(props: TrainingSessionEventBodyProps) {\r\n const dto = props.event.original as ITrainingSessionSlotDto;\r\n return (\r\n <>\r\n \r\n {dto.TrainerName != null && (\r\n <>\r\n  \r\n {dto.TrainerName}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { Icon, IconProps } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n ReservationStatus,\r\n ReservationStatusUnion,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\n// import { getReservationIconName } from './getReservationIconName';\r\n\r\nexport interface ReservationStatusContentProps extends Omit {\r\n event: ISchedulerEvent;\r\n}\r\nexport function ReservationStatusIcon({\r\n event,\r\n ...props\r\n}: ReservationStatusContentProps) {\r\n const reservation = event.original as ICalendarReservationDto;\r\n const statusId = reservation.StatusId;\r\n if (statusId === undefined) {\r\n return null;\r\n }\r\n if (statusId === null) {\r\n return null;\r\n }\r\n const reservationStatus = ReservationStatus[\r\n statusId\r\n ] as ReservationStatusUnion;\r\n switch (reservationStatus) {\r\n case 'Pending':\r\n case 'PendingCoord':\r\n return ;\r\n case 'Draft':\r\n return ;\r\n case 'Approved':\r\n if (reservation.Tutoring) {\r\n return ;\r\n }\r\n return null;\r\n case 'Cancelled':\r\n case 'AllStatus':\r\n case 'CancelledByAdmin':\r\n case 'Done':\r\n case 'NotDone':\r\n case 'DoneWOBooking':\r\n case 'ApprovedOnce':\r\n case 'Tentative':\r\n return null;\r\n default:\r\n assertExhaustive(reservationStatus);\r\n }\r\n // const iconName = getReservationIconName(\r\n // ReservationStatus[statusid] as ReservationStatusUnion,\r\n // reservation.Tutoring,\r\n // );\r\n\r\n // if (iconName === undefined) {\r\n // return null;\r\n // }\r\n\r\n // return ;\r\n}\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ReservationStatusIcon } from './ReservationStatusIcon';\r\nexport interface ReservationEventContentProps extends EventContentProps {\r\n event: ISchedulerEvent;\r\n}\r\nexport function ReservationEventConent(props: ReservationEventContentProps) {\r\n const x = props.event.original as ICalendarReservationDto;\r\n\r\n return (\r\n }\r\n height={props.height}\r\n //todo: add ediability conditaionally based on premissions/etc.\r\n readonly={props.readonly}\r\n offsetTopHeight={props.offsetTopHeight}\r\n notClickable={props.notClickable}\r\n />\r\n );\r\n}\r\nexport interface ReservationEventBodyProps {\r\n event: ISchedulerEvent;\r\n body: React.ReactNode;\r\n}\r\nexport function ReservationEventBody(props: ReservationEventBodyProps) {\r\n const dto = props.event.original as ICalendarReservationDto;\r\n return !!dto && !!dto.Restricted && dto.Restricted === true ? (\r\n {''}\r\n ) : (\r\n \r\n {!!dto && !!dto.StatusId && }\r\n {props.body}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { EventHeader } from './EventHeader';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nexport interface OfflineEventContentProps extends EventContentProps {\r\n event: ISchedulerEvent;\r\n}\r\nexport function OfflineEventConent(props: OfflineEventContentProps) {\r\n return (\r\n }\r\n body={props.body}\r\n height={props.height}\r\n readonly={props.readonly}\r\n offsetTopHeight={props.offsetTopHeight}\r\n notClickable={props.notClickable}\r\n />\r\n );\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { BookitThemeSettings } from 'styles/theme';\r\nimport { SimplePaletteColorOptions } from '@material-ui/core/styles/createPalette';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { TrainingSessionEventConent } from './TrainingSessionEventConent';\r\nimport { ReservationEventConent } from './ReservationEventContent';\r\nimport { EventType } from '../../slice/types';\r\nimport { EventContentProps } from './EventContent';\r\nimport { OfflineEventConent } from './OfflineEventContent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ISchedulerState } from '../../types/ISchedulerState';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\n/**\r\n * Render fundtion that is used by the scheduler to build event's contents\r\n * see https://docs.dhtmlx.com/scheduler/api__scheduler_renderevent.html for more details\r\n * @param container Container DOM element of the rendered event\r\n * @param ev Event object\r\n * @param width Event width provided by the scheduler\r\n * @param height Event height provided by the scheduler\r\n * @param header_content Event header content\r\n * @param body_content Event body content\r\n * @returns true\r\n */\r\nexport const renderEvent = (scheduler: DHTMLX.SchedulerStatic) => (\r\n container: HTMLDivElement,\r\n ev: ISchedulerEvent,\r\n width: number,\r\n height: number,\r\n header_content: string,\r\n body_content: string,\r\n) => {\r\n try {\r\n var container_width = container.style.width; // e.g. \"105px\"\r\n // set background color on the event container instead of setting it on each child separately\r\n const backgroundColor = getBackgroundColor({\r\n type: ev.type,\r\n color:\r\n (ev.original as ICalendarReservationDto)?.EquipmentColor ?? ev.color,\r\n });\r\n if (backgroundColor !== undefined) {\r\n container.style.backgroundColor = backgroundColor;\r\n }\r\n const topEventHeight = getSlotsFromEvent(\r\n ev.start_date,\r\n ev.end_date,\r\n scheduler.config.scroll_hour,\r\n );\r\n // get original full event obj instead of the cloned one\r\n // start/end on ev might be set to start/end of the day for multi day events get cloned\r\n const originalEvent: ISchedulerEvent = scheduler.getEvent(ev.id);\r\n\r\n // get a render function for each event type type\r\n const RenderFC = RenderEvent(originalEvent.type);\r\n\r\n const state: ISchedulerState = scheduler.getState();\r\n\r\n const readonly =\r\n originalEvent.readonly ||\r\n // set event to be readonly (disables drag/resize) when the start/end is outside of the time period shown on the timeline\r\n // this prevents cpu crunch done by the scheduler in onBeforeDrag event handler for long (multi day/year) reservations\r\n // this prevents dragging multi day event in day calendar when no feedback is provided regarding start/end of the event\r\n originalEvent.start_date < state.min_date ||\r\n originalEvent.end_date > state.max_date;\r\n const notClickable = originalEvent.notClickable;\r\n // render an html and shove it into event container\r\n container.innerHTML = ReactDOMServer.renderToStaticMarkup(\r\n ,\r\n );\r\n } catch (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n // true - the scheduler displays a custom form\r\n return true;\r\n};\r\nconst getSlotsFromEvent = (\r\n start: Date,\r\n end: Date,\r\n scroll_hour: number,\r\n): number => {\r\n let duration = dateUtils.intervalToDuration({\r\n start: start,\r\n end: end,\r\n });\r\n if (\r\n start.getHours() < 8 &&\r\n end > new Date(new Date(start).setHours(10)) &&\r\n ((duration?.hours ?? 0) > 3 || (duration?.days ?? 0) > 0)\r\n ) {\r\n //let totalSlotsHeight = 44 * 24;\r\n let eithSlotsHeight = 44 * scroll_hour;\r\n let startHeight = ((start.getHours() * 60 + start.getMinutes()) / 60) * 44;\r\n // let endHeight = ((end.getHours() * 60 + end.getMinutes()) / 60) * 44;\r\n // if (endHeight <= eithSlotsHeight + 88) {\r\n // startHeight = startHeight - (eithSlotsHeight + 88 - endHeight);\r\n // }\r\n // let calHeight = document?.querySelector('.dhx_cal_data')?.clientHeight;\r\n // let shiftHeight =\r\n // totalSlotsHeight - (calHeight ?? 0) - (totalSlotsHeight - eventHeight);\r\n //return Math.floor(shiftHeight);\r\n return Math.floor(eithSlotsHeight - startHeight);\r\n }\r\n return 0;\r\n};\r\n\r\nconst getBackgroundColor = ({\r\n type,\r\n color,\r\n}: Pick): string | undefined => {\r\n const trainingSessionBackgroundColor = '#99dcfa';\r\n const defaultColor =\r\n (BookitThemeSettings.palette?.primary as SimplePaletteColorOptions)?.main ??\r\n bookitColors.primary.regular;\r\n // new events won't have any type\r\n if (type === undefined) {\r\n return defaultColor;\r\n }\r\n switch (type) {\r\n case 'offline':\r\n return undefined;\r\n case 'reservation':\r\n // todo: set different color for approved/pending/etc.\r\n return color ?? defaultColor;\r\n case 'trainingsession':\r\n return trainingSessionBackgroundColor;\r\n default:\r\n assertExhaustive(type);\r\n }\r\n};\r\n\r\ninterface RenderEventProps extends EventContentProps {\r\n event: ISchedulerEvent;\r\n}\r\n\r\nfunction RenderEvent(eventType?: EventType): React.FC {\r\n if (eventType === undefined) {\r\n return ReservationEventConent;\r\n }\r\n switch (eventType) {\r\n case 'trainingsession':\r\n return TrainingSessionEventConent;\r\n case 'reservation':\r\n return ReservationEventConent;\r\n case 'offline':\r\n return OfflineEventConent;\r\n default:\r\n assertExhaustive(eventType);\r\n }\r\n}\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport produce from 'immer';\r\nimport { chain } from 'lodash';\r\nimport { AppSettings, IsAssetImageExist } from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n ISchedulerAssetCatSection,\r\n ISchedulerSection,\r\n ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\n\r\nexport interface fooProps {\r\n services: IServiceFilterDto[] | undefined;\r\n appSettings: AppSettings | null;\r\n groupBy?: TimelineGroupByUnion;\r\n}\r\n\r\nexport function prepareSchedulerSections(props: fooProps): ISchedulerSection[] {\r\n if (props.services === undefined || props.services.length === 0) {\r\n return [{ label: '', type: 'empty' }];\r\n }\r\n const r1 = props.services.map(setImageName(props.appSettings));\r\n const groupByOption = props.groupBy ?? 'NoTimelineGrouped';\r\n switch (groupByOption) {\r\n case 'GroupByAssemblyPart':\r\n return groupAssemblyParts(r1);\r\n case 'GroupByAssetCat':\r\n return groupAssetCats(r1);\r\n case 'NoTimelineGrouped':\r\n return r1.map(mapServiceToSection);\r\n default:\r\n assertExhaustive(groupByOption);\r\n }\r\n}\r\nfunction mapServiceToSection(\r\n service: IServiceFilterDto,\r\n): ISchedulerServiceSection {\r\n return {\r\n type: 'service',\r\n key: service.Id,\r\n label: service.Name,\r\n data: service,\r\n };\r\n}\r\n\r\nexport function groupAssetCats(\r\n services: Array,\r\n): ISchedulerSection[] {\r\n const result = chain(services)\r\n .groupBy(service =>\r\n JSON.stringify({ Id: service.AssetCatId, Name: service.AssetCatName }),\r\n )\r\n .map((value, key) => {\r\n const assetCat: Entity = JSON.parse(key);\r\n const section: ISchedulerAssetCatSection = {\r\n key: `assetCat_${assetCat.Id}`,\r\n label: assetCat.Name,\r\n open: true,\r\n type: 'assetCat',\r\n children: value.map(mapServiceToSection),\r\n };\r\n return section;\r\n })\r\n .value();\r\n return result;\r\n}\r\n/**\r\n * Groups services by their respective assembly configuration\r\n * @param services\r\n * @returns\r\n */\r\nexport function groupAssemblyParts(\r\n services: Array,\r\n): ISchedulerSection[] {\r\n const sections: ISchedulerServiceSection[] = services.map(item => ({\r\n type: 'service',\r\n key: item.Id,\r\n label: item.Name,\r\n open: false,\r\n data: { ...item },\r\n }));\r\n\r\n const result = sections.reduce(\r\n (accumulator, currentValue, currentIndex, array) => {\r\n const parent =\r\n array.find(f => f.key === currentValue.data.AssemblyId) ??\r\n array.find(f => f.key === currentValue.data.TopAssemblyId);\r\n\r\n if (parent !== undefined) {\r\n accumulator.splice(accumulator.indexOf(currentValue), 1);\r\n if (parent.children === undefined) {\r\n parent.children = [];\r\n }\r\n parent.children?.push(currentValue);\r\n }\r\n return accumulator;\r\n },\r\n [...sections],\r\n );\r\n\r\n return result;\r\n}\r\n\r\nfunction setImageName(appSettings: AppSettings | null | undefined) {\r\n return produce((service: IServiceFilterDto) => {\r\n service.ImageName =\r\n getAssetImageThumbSrc(\r\n service.ImageName || null,\r\n 'thumbSmall',\r\n IsAssetImageExist(\r\n appSettings ?? null,\r\n service.ImageName || null,\r\n 'thumbSmall',\r\n ),\r\n ) ?? null;\r\n });\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerService } from './slice/types';\r\nimport { orderBy } from 'lodash';\r\nimport {\r\n ISchedulerSection,\r\n ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { prepareSchedulerSections } from './servicesToSections';\r\nimport { AppSettings } from 'types/AppSettings';\r\n\r\n/**\r\n * The \"services\" server list name\r\n */\r\nexport const scheduler_services_collection_name = 'services';\r\n/**\r\n * Sets the Services server list\r\n * @param scheduler scheduler instance\r\n * @param services services\r\n */\r\nexport function setServerList(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n services: ISchedulerService[] = [],\r\n appSettings: AppSettings | null,\r\n groupBy?: TimelineGroupByUnion,\r\n) {\r\n const sections = prepareSchedulerSections({\r\n appSettings: appSettings,\r\n groupBy: groupBy ?? 'NoTimelineGrouped',\r\n services: services,\r\n });\r\n // order the services so that they will show up sorted in the timeline/unit\r\n const orderedServerListData = orderBy(sections ?? [], f => f.label);\r\n // set the scheduler's server list\r\n scheduler.serverList(\r\n scheduler_services_collection_name,\r\n orderedServerListData,\r\n );\r\n}\r\n\r\n/**\r\n * Retrieves the Services stored in scheduler's server list.\r\n * @param scheduler\r\n * @returns\r\n */\r\nexport function getServerList(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n): Array {\r\n const serverList = scheduler?.serverList(\r\n scheduler_services_collection_name,\r\n ) as Array;\r\n const result = serverList.filter(\r\n f => (f as ISchedulerSection).type === 'service',\r\n ) as Array;\r\n return result;\r\n}\r\n\r\n/**\r\n * Updates the Services stored in scheduler's server list.\r\n * @param scheduler\r\n * @param services\r\n */\r\nexport function updateServerList(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n services: Array = [],\r\n appSettings: AppSettings | null,\r\n groupBy?: TimelineGroupByUnion,\r\n) {\r\n const sections = prepareSchedulerSections({\r\n appSettings: appSettings,\r\n services: services,\r\n groupBy: groupBy,\r\n });\r\n\r\n scheduler.updateCollection(scheduler_services_collection_name, sections);\r\n}\r\n\r\n/**\r\n * Retrieves a single Service details (if there's any) stored in the scheduler's server list\r\n * @param scheduler\r\n * @param serviceId\r\n * @returns\r\n */\r\nexport function getServerListService(scheduler, serviceId: number | undefined) {\r\n const services = getServerList(scheduler);\r\n const service =\r\n serviceId === undefined\r\n ? undefined\r\n : (services?.find(\r\n f => f.type === 'service' && f.key === serviceId,\r\n ) as ISchedulerServiceSection);\r\n return service?.data;\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport { SimplePaletteColorOptions } from '@material-ui/core/styles/createPalette';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { BookitThemeSettings } from 'styles/theme';\r\nimport { isMobile } from 'react-device-detect';\r\nimport {\r\n ISchedulerSection,\r\n ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\n/**\r\n * Renders static html for service column/header\r\n * @param params\r\n * @returns\r\n */\r\nexport function scheduleServiceTemplate(params: ISchedulerSection) {\r\n const type = params.type;\r\n\r\n switch (type) {\r\n case 'service':\r\n const component = TimelineServiceContent(params);\r\n const html = ReactDOMServer.renderToStaticMarkup(component);\r\n const foo = html.replace(\r\n ';\r\n }\r\n if (props.key === undefined) {\r\n return <>;\r\n }\r\n const backgroundColor =\r\n props.data.Color ??\r\n (BookitThemeSettings.palette?.primary as SimplePaletteColorOptions)?.main;\r\n\r\n const style: React.CSSProperties = {\r\n backgroundColor: backgroundColor,\r\n };\r\n const containerProps = {\r\n className: `${scheduleServiceContainerClassName} ${\r\n mobileView ? scheduleServicePaddingMobile : scheduleServicePadding\r\n }`,\r\n };\r\n containerProps[scheduleServiceIdAttributeName] = props.data?.Id;\r\n const imageProps = {\r\n className: scheduleImageClassName,\r\n };\r\n imageProps[scheduleServiceIdAttributeName] = props.data?.Id;\r\n const labelTextProps = {\r\n className: mobileView\r\n ? scheduleServiceLabelTextMobile\r\n : scheduleServiceLabelText,\r\n };\r\n\r\n /**\r\n * imageName is populated with the ImagePath in the following file\r\n * @see src\\app\\pages\\CalendarPage\\Scheduler\\index.tsx\r\n * @todo use the raw ImageName on IServiceFilterDto object and calculated required image path here\r\n */\r\n // Asset image is set in\r\n const src = props.data.ImageName ?? '';\r\n return (\r\n <>\r\n \r\n {!isMobile && (\r\n \r\n {src === undefined || src.indexOf('Default') > 0 ? (\r\n \r\n ) : (\r\n \"\"\r\n )}\r\n \r\n )}\r\n\r\n
    \r\n {props.label}\r\n
    \r\n
    \r\n \r\n );\r\n } catch (error) {\r\n console.error(error);\r\n return <>;\r\n }\r\n}\r\n","import { ISchedulerEvent } from '../types/ISchedulerEvent';\r\n\r\n/**\r\n * Custom compare function that controls events order on the timeline:\r\n * 1. Earlier events must appear first - this controls the cascading/overlapping display.\r\n * 2. Training sessions must appear on top with signups below\r\n * This function is ultimately plugged as an argument into events.sort after which the events are arranged on the timeline to accomodate for overlapping, row height, etc.\r\n * @param a event\r\n * @param b event\r\n * @returns 1 | -1 | 0\r\n */\r\nexport function timelineEventsSortIteratee(\r\n a: ISchedulerEvent,\r\n b: ISchedulerEvent,\r\n): 1 | -1 | 0 {\r\n return (\r\n // dates sort must appear first for proper arrangement of overlaps\r\n compareFn(a, b, event => event.start_date.valueOf()) ??\r\n // only later same date/time events are arranged so that training session will be on top\r\n compareFn(a, b, event => (event.type === 'trainingsession' ? -1 : 1)) ??\r\n // fallback to event id to ensure stable sorting\r\n compareFn(a, b, event => event.id) ??\r\n 0\r\n );\r\n}\r\n\r\nfunction compareFn(\r\n a: ISchedulerEvent,\r\n b: ISchedulerEvent,\r\n accessor: (c: ISchedulerEvent) => T,\r\n) {\r\n const valueA = accessor(a);\r\n const valueB = accessor(b);\r\n if (valueA === valueB) {\r\n return undefined;\r\n } else if (valueA < valueB) {\r\n return -1;\r\n } else {\r\n return 1;\r\n }\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function NoServices() {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n

    {t(translations.NothingToShowForThisScheduler_Title)}

    \r\n

    {t(translations.NothingToShowForThisScheduler_Message)}

    \r\n
    \r\n
    \r\n );\r\n}\r\n","// https://github.com/OliverJAsh/fp-ts-react-hooks/blob/master/src/index.ts\r\n\r\nimport * as A from 'fp-ts/lib/Array';\r\nimport { Eq, fromEquals, strictEqual } from 'fp-ts/lib/Eq';\r\n//import * as O from 'fp-ts/lib/Option';\r\nimport * as ReadonlyArray from 'fp-ts/lib/ReadonlyArray';\r\nimport * as Record from 'fp-ts/lib/Record';\r\nimport * as React from 'react';\r\nimport {\r\n useCustomCompareCallback,\r\n useCustomCompareEffect,\r\n useCustomCompareMemo,\r\n} from 'use-custom-compare';\r\n\r\nconst eqStrict = fromEquals(strictEqual);\r\n\r\nexport const eq: Eq = fromEquals((a, b) =>\r\n Array.isArray(a) && Array.isArray(b)\r\n ? eqArray.equals(a, b)\r\n : eqStrict.equals(a, b),\r\n);\r\n\r\n//const eqOption = O.getEq(eq);\r\nconst eqArray = A.getEq(eq);\r\n\r\nconst eqDependencies = ReadonlyArray.getEq(eq);\r\n\r\nconst eqProps = Record.getEq(eq);\r\n\r\nexport const useCallback: typeof React.useCallback = (fn, dependencies) =>\r\n useCustomCompareCallback(\r\n fn,\r\n dependencies !== undefined ? dependencies : [],\r\n eqDependencies.equals,\r\n );\r\n\r\nexport const useEffect: typeof React.useEffect = (fn, dependencies) =>\r\n useCustomCompareEffect(\r\n fn,\r\n dependencies !== undefined ? dependencies : [],\r\n eqDependencies.equals,\r\n );\r\n\r\nexport const useMemo: typeof React.useMemo = (fn, dependencies) =>\r\n useCustomCompareMemo(\r\n fn,\r\n dependencies !== undefined ? dependencies : [],\r\n eqDependencies.equals,\r\n );\r\n\r\nexport const memo =

    (Component: React.FC

    ) =>\r\n React.memo(Component, eqProps.equals);\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport * as React from 'react';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventType } from '../../slice/types';\r\nimport {\r\n formatSchedulerDateTime,\r\n formatSchedulerTime,\r\n} from '../../utils/formatSchedulerTime';\r\nimport { ReservationStatusIcon } from './ReservationStatusIcon';\r\nimport { TrainingSessionStatus } from './TrainingSessionStatus';\r\n\r\n/**\r\n * Event Timeline Content props\r\n */\r\nexport interface EventTimelineContentProps {\r\n event: ISchedulerEvent;\r\n viewType: 'calendar' | 'timeline' | 'unit';\r\n body?: string;\r\n isMobile: boolean;\r\n}\r\n\r\n/**\r\n * Event timeline content element\r\n * @param props props\r\n * @returns Event timeline content\r\n */\r\nexport function EventTimelineContent(props: EventTimelineContentProps) {\r\n // get a render function for each event type type\r\n const RenderFC = RenderEvent(\r\n props.viewType,\r\n props.isMobile,\r\n props.event.type,\r\n props.body,\r\n );\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n\r\nfunction RenderEvent(\r\n viewType: 'calendar' | 'timeline' | 'unit',\r\n isMobile: boolean,\r\n eventType?: EventType,\r\n body?: string,\r\n): React.FC {\r\n if (eventType === undefined) {\r\n return ReservationEventConent;\r\n }\r\n switch (eventType) {\r\n case 'trainingsession':\r\n return TrainingSessionEventConent;\r\n case 'reservation':\r\n return ReservationEventConent;\r\n case 'offline':\r\n return OfflineEventConent;\r\n default:\r\n assertExhaustive(eventType);\r\n }\r\n}\r\nfunction OfflineEventConent(props: EventTimelineContentProps) {\r\n const offline = props.event.original as ICalendarReservationDto;\r\n\r\n return (\r\n \r\n \r\n {formatSchedulerDateTime(props.event.start_date)}\r\n {' - '}\r\n {props.event.end_date === null ||\r\n props.event.end_date === undefined ||\r\n props.event.end_date.getTime() >\r\n dateUtils.addYears(props.event.start_date, 5).getTime() ? (\r\n \r\n ) : (\r\n formatSchedulerDateTime(props.event.end_date)\r\n )}\r\n \r\n  \r\n {offline.Remarks != null && offline.Remarks !== undefined && (\r\n \r\n {HTMLReactParser(offline.Remarks)}\r\n \r\n )}\r\n \r\n );\r\n}\r\nfunction TrainingSessionEventConent(props: EventTimelineContentProps) {\r\n const training = props.event.original as ITrainingSessionSlotDto;\r\n\r\n return (\r\n \r\n \r\n

    \r\n {formatSchedulerTime(props.event.start_date)}\r\n {' - '}\r\n {formatSchedulerTime(props.event.end_date)}\r\n

    \r\n \r\n {training.TrainerName != null &&

    {training.TrainerName}

    }\r\n \r\n );\r\n}\r\nfunction ReservationEventConent(props: EventTimelineContentProps) {\r\n const reservation = props.event.original as ICalendarReservationDto;\r\n // const timelineTempl =\r\n // \"{{formatDate StartTime 'h:mm a'}} - {{formatDate EndTime 'h:mm a'}}\";\r\n // let compileTempl = compileHandlebarsTemplate(\r\n // timelineTempl,\r\n // );\r\n // let resTempl = compileTempl?.(reservation);\r\n const bodyContent = !!props.body ? (\r\n HTMLReactParser(props.body)\r\n ) : (\r\n \r\n {formatSchedulerTime(props.event.start_date)}\r\n {' - '}\r\n {formatSchedulerTime(props.event.end_date)}\r\n \r\n );\r\n return !!reservation && reservation.Restricted ? (\r\n {''}\r\n ) : (\r\n \r\n {!!reservation && !!reservation.StatusId && (\r\n \r\n )}\r\n {bodyContent}\r\n {/*  \r\n \r\n {formatSchedulerTime(props.event.start_date)}\r\n {' - '}\r\n {formatSchedulerTime(props.event.end_date)}\r\n */}\r\n \r\n );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { getLogger } from 'loglevel';\r\nimport ReactDOMServer from 'react-dom/server';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventTimelineContent } from '../EventRender/EventTimelineContent';\r\n\r\nconst log = getLogger('Scheduler - event_text');\r\nexport function event_text(\r\n viewType: 'calendar' | 'timeline' | 'unit',\r\n isMobile: boolean,\r\n SchedulerReservationBodyTemplate?: Handlebars.TemplateDelegate<\r\n ICalendarReservationDto\r\n >,\r\n): (start: Date, end: Date, event: ISchedulerEvent) => string {\r\n return function (start: Date, end: Date, event: ISchedulerEvent) {\r\n try {\r\n switch (viewType) {\r\n case 'timeline':\r\n const body =\r\n event.type === 'reservation'\r\n ? SchedulerReservationBodyTemplate?.(\r\n event.original as ICalendarReservationDto,\r\n ) ?? ''\r\n : undefined;\r\n const result = timeline_event_text({\r\n viewType,\r\n isMobile,\r\n body,\r\n event,\r\n });\r\n return result;\r\n case 'calendar':\r\n case 'unit':\r\n try {\r\n switch (event.type) {\r\n case 'reservation':\r\n const reservation = event.original as ICalendarReservationDto;\r\n const r = SchedulerReservationBodyTemplate?.(reservation) ?? '';\r\n return r;\r\n default:\r\n return '';\r\n }\r\n } catch (error) {\r\n log.error('error in event_text', event, error);\r\n return '';\r\n }\r\n default:\r\n return '';\r\n }\r\n } catch (error) {\r\n log.error('error in event_text', event, error);\r\n return '';\r\n }\r\n };\r\n}\r\n\r\nexport function timeline_event_text(props: {\r\n viewType: 'calendar' | 'timeline' | 'unit';\r\n isMobile;\r\n body?: string;\r\n event: ISchedulerEvent;\r\n}): string {\r\n try {\r\n return ReactDOMServer.renderToStaticMarkup(\r\n ,\r\n );\r\n } catch (error) {\r\n log.error('error in event_text', props.event, error);\r\n return '';\r\n }\r\n}\r\n","import { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport interface TooltipLineProps {\r\n label: string;\r\n value: string | number | JSX.Element | JSX.Element[] | null | undefined;\r\n}\r\nexport function TooltipLine({ label: lablel, value }: TooltipLineProps) {\r\n if (value === undefined) {\r\n return null;\r\n }\r\n if (value === null) {\r\n return null;\r\n }\r\n if (typeof value === 'string' && isEmptyOrWhitespace(value)) {\r\n return null;\r\n }\r\n return (\r\n
    \r\n {lablel}: \r\n {value}\r\n
    \r\n );\r\n}\r\n","import BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { TrainingState, TrainingStateUnion } from 'enums/TrainingState';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { formatSchedulerDateTime } from '../../../utils/formatSchedulerTime';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\nimport { TooltipLine } from '../TooltipLine';\r\n\r\nexport function TrainingSessionTooltip(props: SchedulerEventTooltipProps) {\r\n const dto = props.event.original as ITrainingSessionSlotDto;\r\n const statusTextLocalizationKey = statusTextKey(dto.TrainingState);\r\n const footerTextLocalizationKey = statusClickTextKey(dto.TrainingState);\r\n const available = (dto.Attendees ?? 0) < (dto.MaxAttendees ?? 0);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {i18next.t(translations.TrainingSession)}\r\n \r\n {statusTextLocalizationKey !== undefined && available && (\r\n \r\n {i18next.t(statusTextLocalizationKey)}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {footerTextLocalizationKey !== undefined && (\r\n \r\n {i18next.t(footerTextLocalizationKey)}\r\n \r\n )}\r\n \r\n );\r\n}\r\n\r\nconst statusTextKey = (stateid: number) => {\r\n const state = TrainingState[stateid] as TrainingStateUnion;\r\n try {\r\n switch (state) {\r\n case 'SignedUp':\r\n return translations.TrainingSessions_Calendar_SignedUp;\r\n case 'UnderMinimum':\r\n return translations.TrainingSessions_Calendar_UnderMinimum;\r\n case 'Available':\r\n return translations.TrainingSessions_Calendar_Available;\r\n case 'Maximum':\r\n return translations.TrainingSessions_Calendar_Maximum;\r\n default:\r\n assertExhaustive(state);\r\n }\r\n } catch (error) {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst statusClickTextKey = (stateid: number) => {\r\n const state = TrainingState[stateid] as TrainingStateUnion;\r\n try {\r\n switch (state) {\r\n case 'SignedUp':\r\n return translations.TrainingSessions_Calendar_ClickToView;\r\n case 'UnderMinimum':\r\n return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n case 'Available':\r\n return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n case 'Maximum':\r\n return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n default:\r\n assertExhaustive(state);\r\n }\r\n } catch (error) {\r\n return undefined;\r\n }\r\n};\r\n","import { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { formatSchedulerDateTime } from '../../../utils/formatSchedulerTime';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\nimport { TooltipLine } from '../TooltipLine';\r\n\r\nexport function OfflineTooltip(props: SchedulerEventTooltipProps) {\r\n let remarks =\r\n (props.event.original as IWorkingHoursDto).Remarks === null\r\n ? null\r\n : (props.event.original as IWorkingHoursDto).Remarks;\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { Body } from 'app/components/Typography';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReservationStatusIcon } from '../../EventRender/ReservationStatusIcon';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\n\r\nexport function ReservationTooltip(props: SchedulerEventTooltipProps) {\r\n const dto = props.event.original as ICalendarReservationDto;\r\n const statusTextLocalizationKey = statusTextKey(dto);\r\n const reservationHtml = !!props.reservationTooltipTemplate\r\n ? props.reservationTooltipTemplate(props.event.original)\r\n : undefined;\r\n if (!dto || dto.Restricted || dto.StatusId == null) {\r\n return <>{''};\r\n }\r\n\r\n return (\r\n <>\r\n {!!!!dto && !!dto.StatusId && (\r\n \r\n \r\n {statusTextLocalizationKey !== undefined && (\r\n \r\n {i18next.t(statusTextLocalizationKey)}\r\n \r\n )}\r\n \r\n )}\r\n {reservationHtml !== undefined && (\r\n
    {HTMLReactParser(reservationHtml)}
    \r\n )}\r\n {props.IncludeCustomFormInSchedulerReservationTooltip &&\r\n dto.CustomForm !== undefined && (\r\n <>\r\n {dto.CustomForm.map(item => (\r\n

    \r\n {item.Text}: {stripHtml(item.Value)}\r\n

    \r\n ))}\r\n \r\n )}\r\n \r\n );\r\n}\r\nconst statusTextKey = (dto?: ICalendarReservationDto) => {\r\n const statusId = dto?.StatusId;\r\n if (statusId === undefined) {\r\n return undefined;\r\n }\r\n if (statusId === null) {\r\n return undefined;\r\n }\r\n const state = statusId as ReservationStatus;\r\n if (\r\n state === ReservationStatus.Pending ||\r\n state === ReservationStatus.PendingCoord\r\n ) {\r\n return translations.ReservationPendingApproval;\r\n } else if (state === ReservationStatus.Draft) {\r\n return translations.DraftReservationStatus;\r\n } else if (state === ReservationStatus.Approved && dto?.Tutoring === true) {\r\n return translations.ApprovedByStaff;\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * strips html tags from the input. todo: replace with a proper implementation, e.g. string-strip-html\r\n * @param s\r\n * @returns\r\n */\r\nfunction stripHtml(s: string | null | undefined): string | null | undefined {\r\n if (s == null || s === undefined) {\r\n return s;\r\n }\r\n return s.replace(/<[^>]+(>|$)/g, ' ');\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { SchedulerEventTooltipProps } from './SchedulerEventTooltipProps';\r\nimport { TrainingSessionTooltip } from './TrainingSessionTooltip';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { OfflineTooltip } from './OfflineTooltip';\r\nimport { EventType } from '../../slice/types';\r\nimport { ReservationTooltip } from './ReservationTooltip';\r\nimport React from 'react';\r\n\r\n// tooltip template funciton signature\r\ntype ToolTipTextFn = (start: Date, end: Date, e: any) => string | boolean;\r\n\r\nconst log = getLogger('tooltip_text');\r\n/**\r\n * Customizing event tooltip template - https://docs.dhtmlx.com/scheduler/api__scheduler_tooltip_text_template.html\r\n * @param scheduler scheduler instance\r\n * @returns HTML generating function\r\n */\r\nexport function tooltip_text(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n reservationTooltipTemplate,\r\n includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): ToolTipTextFn {\r\n try {\r\n const result = tooltip_text_fn(\r\n scheduler,\r\n reservationTooltipTemplate,\r\n includeCustomFormInSchedulerReservationTooltip,\r\n );\r\n log.debug(result);\r\n return result;\r\n } catch (error) {\r\n log.error('Error compiling tooltip template', error);\r\n return () => '';\r\n }\r\n}\r\n\r\n/**\r\n * This function is called by the scheduler to get the tooltip\r\n * @returns tooltip text thmls\r\n */\r\nfunction tooltip_text_fn(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n reservationTooltipTemplate: HandlebarsTemplateDelegate,\r\n includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): ToolTipTextFn {\r\n return (start: Date, end: Date, event: ISchedulerEvent) => {\r\n const HIDE_TOOLTIP = false;\r\n const schedulerEvent: ISchedulerEvent = scheduler.getEvent(event.id);\r\n const type = schedulerEvent.type;\r\n if (type === undefined) {\r\n return HIDE_TOOLTIP;\r\n }\r\n try {\r\n const TooltipElement = SchedulerEventTooltip(\r\n type,\r\n reservationTooltipTemplate,\r\n );\r\n if (TooltipElement === undefined) {\r\n return HIDE_TOOLTIP;\r\n }\r\n const tooltipElementProps = GetSchedulerEventTooltipProps(\r\n start,\r\n end,\r\n event,\r\n reservationTooltipTemplate,\r\n includeCustomFormInSchedulerReservationTooltip,\r\n );\r\n if (tooltipElementProps === undefined) {\r\n return HIDE_TOOLTIP;\r\n }\r\n const html = ReactDOMServer.renderToStaticMarkup(\r\n React.createElement(TooltipElement, tooltipElementProps),\r\n );\r\n return html;\r\n } catch (error) {\r\n log.error(error);\r\n return HIDE_TOOLTIP;\r\n }\r\n };\r\n}\r\n\r\nfunction GetSchedulerEventTooltipProps(\r\n start: Date,\r\n end: Date,\r\n event: ISchedulerEvent,\r\n reservationTooltipTemplate: HandlebarsTemplateDelegate,\r\n includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): SchedulerEventTooltipProps | undefined {\r\n if (event.type === undefined) {\r\n return undefined;\r\n }\r\n switch (event.type) {\r\n case 'offline':\r\n case 'trainingsession':\r\n return {\r\n start,\r\n end,\r\n event: event,\r\n IncludeCustomFormInSchedulerReservationTooltip: includeCustomFormInSchedulerReservationTooltip,\r\n };\r\n\r\n case 'reservation':\r\n return {\r\n start,\r\n end,\r\n event: event,\r\n reservationTooltipTemplate: reservationTooltipTemplate,\r\n IncludeCustomFormInSchedulerReservationTooltip: includeCustomFormInSchedulerReservationTooltip,\r\n };\r\n default:\r\n assertExhaustive(event.type);\r\n }\r\n}\r\n\r\nfunction SchedulerEventTooltip(\r\n type: EventType,\r\n reservationTooltipTemplate?: HandlebarsTemplateDelegate,\r\n): React.FC | undefined {\r\n switch (type) {\r\n case 'offline':\r\n return OfflineTooltip;\r\n case 'trainingsession':\r\n return TrainingSessionTooltip;\r\n case 'reservation':\r\n if (reservationTooltipTemplate === undefined) {\r\n return undefined;\r\n }\r\n return ReservationTooltip;\r\n default:\r\n assertExhaustive(type);\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { useDebugEffect } from './useDebugEffect';\r\n\r\n/**\r\n * Similar to React.useEffect but skips first callback and fires only for subsequent dependencies changes\r\n * @param callback useEffectCallback\r\n * @param deps dependencies\r\n */\r\nexport const useDidUpdate = (\r\n callback: React.EffectCallback,\r\n deps?: React.DependencyList,\r\n) => {\r\n const hasMount = React.useRef(false);\r\n\r\n React.useEffect(() => {\r\n if (hasMount.current) {\r\n callback();\r\n } else {\r\n hasMount.current = true;\r\n }\r\n // no need to include the callback in dependencies since it's mutation does not really matter as long as the correct dependencies are used\r\n // deps are passed as is (unchanged) for the React.useEffect to track their changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, deps);\r\n};\r\nexport const useDidUpdateDebug = (\r\n callback: React.EffectCallback,\r\n deps?: React.DependencyList,\r\n) => {\r\n const hasMount = React.useRef(false);\r\n\r\n useDebugEffect(\r\n () => {\r\n if (hasMount.current) {\r\n callback();\r\n } else {\r\n hasMount.current = true;\r\n }\r\n },\r\n [callback, deps],\r\n Object.entries(deps ?? {}).map(f => f[0]),\r\n );\r\n};\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ScrollPosition } from './slice/types';\r\n\r\n/**\r\n * Updates the view and preserves scroll position on the timeline.\r\n * Rerenders entire scheduler including scales, headers, etc.\r\n * @param scheduler scheduler instance\r\n */\r\nexport function updateView(\r\n scheduler?: DHTMLX.SchedulerStatic,\r\n currentPosition?: ScrollPosition,\r\n forceUpdate?: boolean,\r\n) {\r\n const currentView = scheduler?.getView();\r\n if (forceUpdate === true) {\r\n scheduler?.updateView();\r\n // updateView causes the mark_now to disappear (inside of the reset_scales fn) for some reason.\r\n // _mark_now is used here to reset the current time (mark_now) marking\r\n try {\r\n (scheduler as any)?._mark_now();\r\n } catch (error) {}\r\n }\r\n if (currentPosition !== undefined) {\r\n currentView.scrollTo(currentPosition);\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\n\r\nexport function deleteTempReservations(\r\n schedulerRef: React.MutableRefObject,\r\n id?: string | number | undefined,\r\n) {\r\n try {\r\n schedulerRef?.current\r\n ?.getEvents()\r\n ?.filter(f => f.type === undefined)\r\n // new events generally have int id and id parameter here can be either int or string\r\n ?.filter(f => String(f.id) !== String(id))\r\n ?.forEach(f => schedulerRef?.current?.deleteEvent(f.id));\r\n } catch (error) {\r\n //noop\r\n }\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ISchedulerState } from './types/ISchedulerState';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\n\r\n/**\r\n * Resets currently shown events to their original positions.\r\n * @param scheduler scheduler instance\r\n * @param event created/updated event\r\n */\r\nexport function resetEventEdits(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n event: ISchedulerEvent,\r\n) {\r\n const state: ISchedulerState = scheduler.getState();\r\n const x = scheduler\r\n .getEvents(state.min_date, state.max_date)\r\n .filter((f: ISchedulerEvent) => f.id !== event.id)\r\n .filter((f: ISchedulerEvent) => f.original?.StartTime !== undefined)\r\n .filter((f: ISchedulerEvent) => f.original?.EndTime !== undefined)\r\n .filter((f: ISchedulerEvent) => {\r\n const dd =\r\n dateUtils.formatISO(f.end_date) !== f.original.EndTime ||\r\n dateUtils.formatISO(f.start_date) !== f.original.StartTime;\r\n return dd;\r\n });\r\n\r\n x.forEach((f: ISchedulerEvent) => {\r\n f.start_date = dateUtils.parseISO(f.original.StartTime);\r\n f.end_date = dateUtils.parseISO(f.original.EndTime);\r\n scheduler.updateEvent(String(f.id));\r\n });\r\n}\r\n","export function findParentTarget(\r\n event: MouseEvent,\r\n selectors: string[],\r\n): Element | null {\r\n // check if the click target is a DOM element so that the closest method is available\r\n if (!(event.target instanceof Element)) {\r\n return null;\r\n }\r\n if (!event.target.closest) {\r\n return null;\r\n }\r\n for (const selector of selectors) {\r\n try {\r\n const container = event.target.closest(selector);\r\n if (container !== null) {\r\n return container;\r\n }\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n }\r\n return null;\r\n}\r\n","import { IEditEvent } from './slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { omit } from 'lodash';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\n/**\r\n * Transforms the scheduler event to common form:\r\n * * dates are converted to timestamps (string)\r\n * * assembly part reservations are redirected to top assembly reservations\r\n * @param event internal scheduler's event\r\n * @returns event consumable by the reservation details components\r\n */\r\nexport const transformToSerializableEvent = (\r\n event: ISchedulerEvent,\r\n): IEditEvent => {\r\n const TopAssemblyReservationId = (event.original as ICalendarReservationDto)\r\n .TopAssemblyReservationId;\r\n /**\r\n * Clicking on the assembly part reservation should open the top assembly reservation\r\n */\r\n const reservation_id = TopAssemblyReservationId ?? event.reservation_id;\r\n const result = {\r\n ...omit(event, 'start_date', 'end_date'),\r\n ...{\r\n start_date: dateUtils.formatISO(event.start_date),\r\n end_date: dateUtils.formatISO(event.end_date),\r\n reservation_id: reservation_id,\r\n },\r\n };\r\n return result;\r\n};\r\n","// https://docs.dhtmlx.com/scheduler/pdf.html\r\n// Include the https://export.dhtmlx.com/scheduler/api.js file on the page to enable the online export service\r\n\r\nfunction defaults(obj, std) {\r\n for (var key in std) if (!obj[key]) obj[key] = std[key];\r\n return obj;\r\n}\r\nfunction getElementSizes(element, scheduler) {\r\n var sizes = { x: 0, y: 0 };\r\n element = scheduler._els[element];\r\n if (element && element[0]) {\r\n sizes.x = element[0].scrollWidth;\r\n sizes.y = element[0].scrollHeight;\r\n } else {\r\n sizes.x = 0;\r\n sizes.y = 0;\r\n }\r\n return sizes;\r\n}\r\nexport function add_export_methods(scheduler) {\r\n scheduler.exportToPDF = function (config) {\r\n config = defaults(config || {}, {\r\n name: 'calendar.pdf',\r\n format: 'A4',\r\n orientation: 'landscape',\r\n dpi: 96,\r\n zoom: 1,\r\n rtl: scheduler.config.rtl,\r\n });\r\n config.html = this._export_html(config);\r\n config.mode = this.getState().mode;\r\n this._send_to_export(config, 'pdf');\r\n };\r\n\r\n scheduler.exportToPNG = function (config) {\r\n config = defaults(config || {}, {\r\n name: 'calendar.png',\r\n format: 'A4',\r\n orientation: 'landscape',\r\n dpi: 96,\r\n zoom: 1,\r\n rtl: scheduler.config.rtl,\r\n });\r\n config.html = this._export_html(config);\r\n config.mode = this.getState().mode;\r\n this._send_to_export(config, 'png');\r\n };\r\n\r\n scheduler.exportToICal = function (config) {\r\n config = defaults(config || {}, {\r\n name: 'calendar.ical',\r\n data: this._serialize_plain(null, config),\r\n });\r\n this._send_to_export(config, 'ical');\r\n };\r\n\r\n scheduler.exportToExcel = function (config) {\r\n config = defaults(config || {}, {\r\n name: 'calendar.xlsx',\r\n title: 'Events',\r\n data: this._serialize_plain(this.templates.xml_format, config),\r\n columns: this._serialize_columns(),\r\n });\r\n this._send_to_export(config, 'excel');\r\n };\r\n\r\n /*scheduler._ajax_to_export = function (data, type, callback) {\r\n delete data.callback;\r\n var url = data.server || 'https://export.dhtmlx.com/scheduler';\r\n\r\n dhtmlxAjax.post(\r\n url,\r\n 'type=' +\r\n type +\r\n '&store=1&data=' +\r\n encodeURIComponent(JSON.stringify(data)),\r\n function (loader) {\r\n var fail = loader.xmlDoc.status > 400;\r\n var info = null;\r\n\r\n if (!fail) {\r\n try {\r\n info = JSON.parse(loader.xmlDoc.responseText);\r\n } catch (e) {}\r\n }\r\n callback(info);\r\n },\r\n );\r\n };*/\r\n\r\n scheduler._plain_export_copy = function (source, format) {\r\n var target = { start_date: null, end_date: null, $text: null };\r\n for (var key in source) target[key] = source[key];\r\n\r\n target.start_date = format(target.start_date);\r\n target.end_date = format(target.end_date);\r\n target.$text = this.templates.event_text(\r\n source.start_date,\r\n source.end_date,\r\n source,\r\n );\r\n\r\n return target;\r\n };\r\n\r\n scheduler._serialize_plain = function (format, config) {\r\n format = format || scheduler.date.date_to_str('%Y%m%dT%H%i%s', true);\r\n\r\n var events;\r\n if (config && config.start && config.end)\r\n events = scheduler.getEvents(config.start, config.end);\r\n else events = scheduler.getEvents();\r\n\r\n var data = [{}];\r\n for (var i = 0; i < events.length; i++)\r\n data[i] = this._plain_export_copy(events[i], format);\r\n\r\n return data;\r\n };\r\n\r\n scheduler._serialize_columns = function () {\r\n return [\r\n { id: 'start_date', header: 'Start Date', width: 30 },\r\n { id: 'end_date', header: 'End Date', width: 30 },\r\n { id: '$text', header: 'Text', width: 100 },\r\n ];\r\n };\r\n\r\n scheduler._send_to_export = function (data, type) {\r\n if (!data.version) {\r\n data.version = scheduler.version;\r\n }\r\n\r\n if (!data.skin) {\r\n data.skin = scheduler.skin;\r\n }\r\n\r\n if (data.callback)\r\n return scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n var form = this._create_hidden_form();\r\n\r\n form.firstChild.action =\r\n data.server || 'https://export.dhtmlx.com/scheduler';\r\n form.firstChild.childNodes[0].value = JSON.stringify(data);\r\n form.firstChild.childNodes[1].value = type;\r\n form.firstChild.submit();\r\n };\r\n\r\n scheduler._create_hidden_form = function () {\r\n if (!this._hidden_export_form) {\r\n var t = (this._hidden_export_form = document.createElement('div'));\r\n t.style.display = 'none';\r\n t.innerHTML =\r\n \"
    \";\r\n document.body.appendChild(t);\r\n }\r\n return this._hidden_export_form;\r\n };\r\n\r\n scheduler._get_export_size = function (\r\n format,\r\n orientation,\r\n zoom,\r\n dpi,\r\n header,\r\n footer,\r\n scales,\r\n ) {\r\n dpi = parseInt(dpi) / 25.4 || 4;\r\n\r\n var sizes = {\r\n A5: { x: 148, y: 210 },\r\n A4: { x: 210, y: 297 },\r\n A3: { x: 297, y: 420 },\r\n A2: { x: 420, y: 594 },\r\n A1: { x: 594, y: 841 },\r\n A0: { x: 841, y: 1189 },\r\n };\r\n\r\n var dataX = getElementSizes('dhx_cal_data', this).x;\r\n var dataY = getElementSizes('dhx_cal_data', this).y;\r\n var headY = getElementSizes('dhx_cal_header', this).y;\r\n var multY = getElementSizes('dhx_multi_day', this).y;\r\n\r\n var cSize = {\r\n x: 0,\r\n y: dataY + headY + multY,\r\n };\r\n\r\n if (format === 'full') {\r\n cSize.x = dataX;\r\n } else {\r\n cSize.x = Math.floor(\r\n (orientation === 'landscape' ? sizes[format].y : sizes[format].x) * dpi,\r\n );\r\n }\r\n\r\n if (scales) {\r\n cSize.x *= parseFloat(scales.x) || 1;\r\n cSize.y *= parseFloat(scales.y) || 1;\r\n }\r\n\r\n return cSize;\r\n };\r\n\r\n function getTimeline() {\r\n var mode = scheduler.getState().mode;\r\n if (scheduler.matrix && scheduler.matrix[mode]) {\r\n return scheduler.matrix[mode];\r\n }\r\n return null;\r\n }\r\n\r\n function getInitialSizes() {\r\n var smartRendering = undefined,\r\n scrollable = undefined;\r\n\r\n var timeline = getTimeline();\r\n if (timeline) {\r\n scrollable = timeline.scrollable;\r\n smartRendering = timeline.smart_rendering;\r\n }\r\n\r\n return {\r\n nav_height: scheduler.xy.nav_height,\r\n scroll_width: scheduler.xy.scroll_width,\r\n style_width: scheduler._obj.style.width,\r\n style_height: scheduler._obj.style.height,\r\n timeline_scrollable: scrollable,\r\n timeline_smart_rendering: smartRendering,\r\n };\r\n }\r\n\r\n function setExportSizes(size, initialSizes) {\r\n scheduler._obj.style.width = size.x + 'px';\r\n scheduler._obj.style.height = size.y + 'px';\r\n\r\n scheduler.xy.nav_height = 0;\r\n scheduler.xy.scroll_width = 0;\r\n\r\n var timeline = getTimeline();\r\n if (\r\n initialSizes.timeline_scrollable ||\r\n initialSizes.timeline_smart_rendering\r\n ) {\r\n timeline.scrollable = false;\r\n timeline.smart_rendering = false;\r\n }\r\n }\r\n\r\n function setInitialSizes(initialSizes) {\r\n scheduler.xy.scroll_width = initialSizes.scroll_width;\r\n scheduler.xy.nav_height = initialSizes.nav_height;\r\n scheduler._obj.style.width = initialSizes.style_width;\r\n scheduler._obj.style.height = initialSizes.style_height;\r\n\r\n var timeline = getTimeline();\r\n if (\r\n initialSizes.timeline_scrollable ||\r\n initialSizes.timeline_smart_rendering\r\n ) {\r\n timeline.scrollable = initialSizes.timeline_scrollable;\r\n timeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n }\r\n }\r\n\r\n scheduler._export_html = function (obj) {\r\n var initialSizes = getInitialSizes();\r\n var size = scheduler._get_export_size(\r\n obj.format,\r\n obj.orientation,\r\n obj.zoom,\r\n obj.dpi,\r\n obj.header,\r\n obj.footer,\r\n obj.scales,\r\n );\r\n\r\n var html = '';\r\n try {\r\n setExportSizes(size, initialSizes);\r\n scheduler.setCurrentView();\r\n html = scheduler._obj.innerHTML;\r\n } catch (e) {\r\n console.error(e);\r\n } finally {\r\n setInitialSizes(initialSizes);\r\n scheduler.setCurrentView();\r\n }\r\n\r\n return html;\r\n };\r\n}\r\n","import { SchedulerStatic } from 'dhtmlx-scheduler';\r\nimport { useDispatch } from 'react-redux';\r\nimport { usePrintPDFSlice } from '../slice';\r\nimport React, { useCallback } from 'react';\r\nimport { PrintToPDFPopup } from '../Components/PrintToPDFPopup';\r\nimport { add_export_methods } from './ExportMethods';\r\n\r\nexport interface PrintSchedulerToPDFProps {\r\n title: string;\r\n print: boolean;\r\n printTitle: string;\r\n saveMarkedSections?: boolean;\r\n scheduler?: SchedulerStatic;\r\n close: () => void;\r\n}\r\nexport function PrintSchedulerToPDF(props: PrintSchedulerToPDFProps) {\r\n const dispatch = useDispatch();\r\n const { actions } = usePrintPDFSlice();\r\n const handleSubmit = useCallback(() => {\r\n add_export_methods(props.scheduler);\r\n props.scheduler?.exportToPDF({\r\n name: props.printTitle + '.pdf',\r\n format: 'A4',\r\n orientation: 'landscape',\r\n zoom: 1,\r\n header: `

    ${props.printTitle}

    `,\r\n //footer: '

    Bottom line

    ',\r\n });\r\n dispatch(actions.setPrinting(false));\r\n props.close();\r\n }, [actions, dispatch, props]);\r\n return (\r\n <>\r\n {props.print && (\r\n {\r\n props.close();\r\n }}\r\n onSubmit={handleSubmit}\r\n />\r\n )}\r\n \r\n );\r\n}\r\nconst styles = `.dhx_timeline_label_column {\r\n justify-content: left;\r\n}\r\n.dhx_cal_navline div {\r\n position: relative;\r\n}\r\n\r\n.medium_lines_section {\r\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAQCAYAAABk1z2tAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjE5OUE3RTM4OTQ0OTExRTFC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\r\n}\r\n\r\n.dhx_title .dhx_training_status {\r\n float: right;\r\n margin: 0px 4px;\r\n}\r\n\r\n.dhx_title > * {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n\r\n.dhx_cal_event .dhx_event_move {\r\n cursor: pointer;\r\n}\r\n.dhx_cal_event_line,\r\n.dhx_cal_event .dhx_body,\r\n.dhx_cal_event.dhx_cal_select_menu .dhx_body {\r\n font-weight: normal;\r\n}\r\n.dhx_scale_holder .dhx_cal_event .dhx_body {\r\n overflow: hidden;\r\n}\r\n.scheduler_tooltip {\r\n max-width: 350px;\r\n}\r\n.dhx_cal_event_line p,\r\n.scheduler_tooltip p {\r\n margin: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n.scheduler_tooltip div span p {\r\n margin: 0;\r\n white-space: pre-wrap;\r\n}\r\n.dhx_cal_event .dhx_body p {\r\n white-space: break-spaces;\r\n margin: 0;\r\n margin-right: 1%;\r\n}\r\n.dhx_cal_event_line {\r\n padding: 0 0 1px 6px;\r\n}\r\n.dhx_cal_event {\r\n z-index: 2;\r\n}\r\n\r\n.dhx_cal_event .dhx_title:not(.dhx_event_move) {\r\n cursor: initial;\r\n}\r\n\r\n.dhx_timeline_label_column .schedule_service_label {\r\n justify-content: start;\r\n align-self: center;\r\n}\r\n.dhx_scale_bar .schedule_service_container {\r\n flex-wrap: wrap-reverse;\r\n}\r\n.dhx_cal_header div.schedule_service_label {\r\n box-sizing: border-box;\r\n}\r\n.dhx_matrix_scell.item .dhx_scell_name {\r\n padding-left: 0px;\r\n}\r\n.schedule_service_container {\r\n box-sizing: border-box;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n flex-direction: row;\r\n padding: 0px;\r\n gap: 10px;\r\n height: 38px;\r\n flex: none;\r\n order: 0;\r\n align-self: stretch;\r\n flex-grow: 0;\r\n}\r\n.schedule_service_image {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 0px;\r\n gap: 10px;\r\n\r\n width: 64px;\r\n height: 38px;\r\n\r\n background: #eef2f6;\r\n border-radius: 4px;\r\n cursor: pointer;\r\n flex: none;\r\n order: 1;\r\n flex-grow: 0;\r\n}\r\n.schedule_service_image svg {\r\n align-self: center;\r\n}\r\n.schedule_service_image img {\r\n max-height: 38px;\r\n height: auto;\r\n width: auto;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image {\r\n width: 24px;\r\n height: 24px;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image img {\r\n max-height: 24px;\r\n max-width: 24px;\r\n height: inherit;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image svg {\r\n align-self: center;\r\n justify-self: center;\r\n}\r\n.dhx_scheduler_day_unit .dhx_scale_bar .schedule_service_container {\r\n gap: 6px;\r\n flex-wrap: nowrap;\r\n}\r\n.schedule_service_label {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 4px;\r\n\r\n height: 24px;\r\n\r\n border-radius: 4px;\r\n\r\n flex: none;\r\n order: 2;\r\n flex-grow: 0;\r\n line-height: initial;\r\n color: white;\r\n cursor: pointer;\r\n\r\n max-width: min(100%, 26ch);\r\n}\r\n.schedule_service_label_padding {\r\n padding: 3px 8px;\r\n}\r\n.schedule_service_label_mobile_padding {\r\n padding: 2px 2px;\r\n}\r\n.schedule_service_label_text_mobile {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n width: 12ch;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n text-transform: none;\r\n font-style: normal;\r\n font-weight: normal;\r\n font-size: 12px;\r\n line-height: 141%;\r\n -webkit-letter-spacing: 0.1px;\r\n -moz-letter-spacing: 0.1px;\r\n -ms-letter-spacing: 0.1px;\r\n letter-spacing: 0.1px;\r\n font-family: 'Lato', sans-serif;\r\n}\r\n.schedule_service_label_text {\r\n overflow: hidden;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n\r\n text-transform: none;\r\n font-style: normal;\r\n font-weight: normal;\r\n font-size: 14px;\r\n line-height: 141%;\r\n -webkit-letter-spacing: 0.1px;\r\n -moz-letter-spacing: 0.1px;\r\n -ms-letter-spacing: 0.1px;\r\n letter-spacing: 0.1px;\r\n font-family: 'Lato', sans-serif;\r\n}\r\n\r\n.dhx_timeline_scale_header.dhx_timeline_second_scale {\r\n width: 300px !important;\r\n height: 30px !important;\r\n}\r\n.dhx_cal_header div .dhx_scale_bar.dhx_second_scale_bar {\r\n border-left: 1px solid #e0e0e0;\r\n text-align: left;\r\n padding-left: 3px;\r\n}\r\n.dhx_timeline_second_scale.dhx_timeline_scale_header {\r\n height: 60px !important;\r\n}\r\n.dhx_cal_mobile .dhx_timeline_second_scale.dhx_timeline_scale_header {\r\n height: 70px !important;\r\n width: 100px !important;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_cell,\r\n.GroupByAssemblyPart .dhx_matrix_scell {\r\n overflow: hidden;\r\n text-align: center;\r\n vertical-align: middle;\r\n border-bottom: 1px solid #e0e0e0;\r\n border-right: 1px solid #e0e0e0;\r\n}\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell {\r\n border-right: 1px solid #e0e0e0;\r\n border-bottom: 1px solid #e0e0e0;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell,\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder.opened .dhx_scell_expand::after,\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder.closed .dhx_scell_expand::after {\r\n background-color: #fff; \r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell {\r\n cursor: auto;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_scell_expand::after,\r\n.GroupByAssemblyPart .dhx_scell_level {\r\n cursor: pointer;\r\n}\r\n`;\r\n","import * as React from 'react';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport 'dhtmlx-scheduler/dhtmlxscheduler_material.css';\r\nimport clsx from 'clsx';\r\nimport './scheduler.css';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n IChangeViewModePayload,\r\n IEditEvent,\r\n INewEvent,\r\n ISchedulerService,\r\n IViewState,\r\n RestrictDuration,\r\n ViewLengths,\r\n ViewModes,\r\n ViewTypes,\r\n} from './slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { assign, isEqual } from 'lodash';\r\nimport {\r\n adjustToTimeSlot,\r\n getSchedulerViewMode,\r\n getSchedulerViewType,\r\n getViewEndDate,\r\n getViewStartDate,\r\n MatchUnitSlotToEnd,\r\n parseViewMode,\r\n} from './utils';\r\nimport {\r\n serializeSchedulerDate,\r\n serializeSchedulerDateOrUndefined,\r\n} from './utils/formatSchedulerDateOrUndefined';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { MouseEventHandler } from 'hoist-non-react-statics/node_modules/@types/react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectExportToPDF,\r\n selectIncludeCustomFormInSchedulerReservationTooltip,\r\n selectSchedulerLoadingEvents,\r\n selectSchedulerReservationBodyTemplate,\r\n selectSchedulerReservationTooltipTemplate,\r\n selectSchedulerTempEvents,\r\n selectSchedulerViewCustomStart,\r\n selectTimelineGroupBy,\r\n selectWithReservationsOnly,\r\n} from './slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nimport {\r\n allowedToViewAlert,\r\n IsReadOnlyUser,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectUseAmPm,\r\n} from 'app/slice/selectors';\r\nimport { ISchedulerState } from './types/ISchedulerState';\r\nimport { IMarkedTimespan as IMarkedTimeSpan } from './types/IMarkedTimespan';\r\nimport { renderEvent } from './components/EventRender';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\nimport { adjustMonthTimelineLength } from './utils/adjustMonthTimelineLength';\r\nimport { createTimelineView } from './createTimelineView';\r\nimport { createUnitsView } from './createUnitsView';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { syncSchedulerEvents } from './utils/syncSchedulerEvents';\r\nimport { useSchedulerSlice } from './slice';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { ISchedulerParseEvent } from './types/ISchedulerParseEvent';\r\nimport { scheduleServiceContainerClassName } from './renderServiceLabel';\r\nimport { NoServices } from './components/NoServices';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n GetNumberOrUndefined,\r\n GetRawValue,\r\n getSplitNumberArray,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { initOnlineServicesData } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useCallback } from 'app/hooks/useComparedHooks';\r\nimport { event_text } from './components/event_text';\r\nimport { tooltip_text } from './components/Tooltips';\r\nimport { CombinedSchedulerTRow } from '../Filter';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { translations } from 'locales/translations';\r\nimport { useDidUpdate } from 'app/hooks/useDidUpdate';\r\nimport { TableRowsSkeleton } from 'app/components/BasicTable/components/TableSkeleton';\r\nimport { updateView } from './updateView';\r\nimport { deleteTempReservations } from './deleteTempReservations';\r\nimport { resetEventEdits } from './resetEventEdits';\r\nimport {\r\n getServerListService,\r\n setServerList,\r\n updateServerList,\r\n} from './serverListUtils';\r\nimport { applyForceFullDayReservations } from './utils/applyForceFullDayReservations';\r\nimport { ISchedulerNewEvent } from './types/ISchedulerNewEvent';\r\nimport { adjustSchedulerEventTimes } from './utils/adjustSchedulerEventTimes';\r\nimport { getEvent } from './utils/getEvent';\r\nimport { getServiceIdFromServiceClickEvent } from './getServiceIdFromServiceClickEvent';\r\nimport { findParentTarget } from './findParentTarget';\r\nimport { transformToSerializableEvent } from './transformToSerializableEvent';\r\nimport { PrintSchedulerToPDF } from 'app/components/PrintToPDF/Scheduler';\r\nimport { SchedulerPeriod } from './types/SchedulerPeriod';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\n\r\nexport interface ViewModeChangeArgs {\r\n previous?: IViewState;\r\n current: IViewState;\r\n}\r\nexport type ViewModeChangeHandler = (args: IChangeViewModePayload) => void;\r\nexport type SchedulerEventCreateHandler = (args: INewEvent) => void;\r\nexport type SchedulerEventEditHandler = ValueChangeHandler<\r\n ISchedulerParseEvent\r\n>;\r\nexport interface SchedulerProps {\r\n onDataUpdated: (s: string, ev: any, id: any) => void;\r\n events?: ISchedulerParseEvent[];\r\n nonWorkingHours?: IEquipmentTimeSlot[];\r\n services?: ISchedulerService[];\r\n viewType: ViewTypes;\r\n viewLength: ViewLengths;\r\n presetPosition: SchedulerDatePositionUnion | null;\r\n search: string;\r\n date: Timestamp;\r\n onViewModeChange?: ViewModeChangeHandler;\r\n onEdit?: SchedulerEventEditHandler;\r\n setFilterValue?: (id: string, value: FilterValueType) => void;\r\n onFilterChange?: (items: IFilterSettings[]) => void;\r\n appliedFilters?: IFilterSettings[];\r\n /**\r\n * Handles create new reservation.\r\n * Must be Memoized.\r\n */\r\n onCreate?: SchedulerEventCreateHandler;\r\n hight?: string;\r\n reservationEditEvents: Array;\r\n defaultDuration?: number;\r\n customDays?: number;\r\n customDaysEnabled?: boolean;\r\n twoDaysEnabled?: boolean;\r\n handleViewTypeLengthChange?: (\r\n type: ViewTypes,\r\n length: ViewLengths,\r\n value?: Date,\r\n noChangeLocation?: boolean,\r\n ) => void;\r\n noChangeLocation?: boolean;\r\n zoomEnabled?: boolean;\r\n}\r\n\r\nconst NEW_EVENT_TEXT = 'New event';\r\nexport const scheduler_services_collection_name = 'services';\r\nconst log = getLogger('Scheduler');\r\n\r\nexport default function Scheduler({\r\n viewLength,\r\n date,\r\n events,\r\n nonWorkingHours,\r\n services,\r\n onCreate,\r\n onEdit,\r\n setFilterValue,\r\n onFilterChange,\r\n appliedFilters,\r\n reservationEditEvents,\r\n customDays,\r\n customDaysEnabled,\r\n twoDaysEnabled,\r\n handleViewTypeLengthChange,\r\n noChangeLocation,\r\n zoomEnabled = false,\r\n ...props\r\n}: SchedulerProps) {\r\n const { t } = useTranslation();\r\n /** Reference to DHTMLX Scheduler instance */\r\n const schedulerRef = React.useRef();\r\n const dispatch = useDispatch();\r\n const { actions } = useSchedulerSlice();\r\n const location = useLocation();\r\n const { actions: globalActions } = useAppSettingsSlice();\r\n /** Reference to Scheduler container DOM element */\r\n const schedulerContainer = React.useRef(null);\r\n const isMobile = DetectIsMobile();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n const viewType = getSchedulerViewType(props.viewType, viewLength, isMobile);\r\n const viewMode = getSchedulerViewMode(props.viewType, viewLength, isMobile);\r\n const appSettings = useSelector(selectAppSettings);\r\n const hasCustomStart = useSelector(selectSchedulerViewCustomStart);\r\n const compiledSchedulerReservationBodyTemplate = useSelector(\r\n selectSchedulerReservationBodyTemplate,\r\n );\r\n const IncludeCustomFormInSchedulerReservationTooltip = useSelector(\r\n selectIncludeCustomFormInSchedulerReservationTooltip,\r\n );\r\n const useAmPm = useSelector(selectUseAmPm);\r\n const compiledSchedulerReservationTooltipTemplate = useSelector(\r\n selectSchedulerReservationTooltipTemplate,\r\n );\r\n const openAsset = useOpenAssetPopUp();\r\n const permissionsError: string = t(\r\n translations.role_err_Permissions,\r\n ) as string;\r\n const { newDate } = useSystemDate();\r\n\r\n const defaultDuration = React.useMemo(() => {\r\n if (services !== undefined && services.length > 0) {\r\n const result =\r\n (services.map(f => f.DefaultDuration).sort((a, b) => a - b)[0] || 1) *\r\n 60;\r\n return result;\r\n }\r\n return 60;\r\n }, [services]);\r\n const restrictTimeSlots = React.useMemo(() => {\r\n if (\r\n services !== undefined &&\r\n services.length === 1 &&\r\n services[0].RestrictReservationToTimeSlots\r\n ) {\r\n return services[0].WorkingHours;\r\n }\r\n return [];\r\n }, [services]);\r\n const minDuration = React.useMemo(() => {\r\n if (services !== undefined && services.length > 0) {\r\n const result =\r\n (services.map(f => f.MinOrderHours).sort((a, b) => a - b)[0] || 0) * 60;\r\n return result;\r\n }\r\n return 0;\r\n }, [services]);\r\n const forceFullDayReservations = React.useMemo(\r\n () => services?.some(service => service.ForceFullDayReservations),\r\n [services],\r\n );\r\n\r\n const restrictDuration = React.useMemo(() => {\r\n if (services !== undefined && services.length > 0) {\r\n if (\r\n services.some(\r\n f =>\r\n (f.RestrictDurationUnitType ?? 0) > 0 &&\r\n (f.RestrictDurationUnitsAmount ?? 0) > 0,\r\n )\r\n ) {\r\n return services\r\n .filter(\r\n f =>\r\n (f.RestrictDurationUnitType ?? 0) > 0 &&\r\n (f.RestrictDurationUnitsAmount ?? 0) > 0,\r\n )\r\n .map(f => {\r\n return {\r\n durationType: (f.RestrictDurationUnitType ??\r\n 0) as RestrictDurationUnitTypes,\r\n durationAmount: f.RestrictDurationUnitsAmount ?? 0,\r\n };\r\n })[0] as RestrictDuration;\r\n }\r\n }\r\n return undefined;\r\n }, [services]);\r\n\r\n const tempReservations = useSelector(selectSchedulerTempEvents);\r\n\r\n React.useEffect(() => {\r\n deleteTempReservations(schedulerRef, tempReservations?.id);\r\n }, [tempReservations]);\r\n\r\n const handleClick = useCallback(\r\n (id: string, e: any) => {\r\n log.debug('handleClick', id, e);\r\n const event: ISchedulerEvent = schedulerRef?.current?.getEvent(id);\r\n if (event === undefined) {\r\n return;\r\n }\r\n if (event.type === undefined) {\r\n return;\r\n }\r\n if (IsReadOnlyUser(authenticatedUser)) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'permissionError',\r\n message: permissionsError,\r\n variant: 'error',\r\n closable: true,\r\n autoHideDuration: 3000,\r\n }),\r\n );\r\n return;\r\n }\r\n if (\r\n event.type === 'reservation' &&\r\n (event.original as ICalendarReservationDto).Restricted === true\r\n ) {\r\n return;\r\n }\r\n // check permissions to disable alert edit\r\n if (event.alert_id !== undefined) {\r\n if (\r\n !allowedToViewAlert(authenticatedUser, {\r\n ReportedBy: '',\r\n ServiceGroupId: event.original.ServiceGroupId,\r\n ServiceId: event.original.EquipmentId,\r\n ServiceTypeId: 1,\r\n })\r\n ) {\r\n return false;\r\n }\r\n }\r\n\r\n if (!!event) {\r\n let transformedEvent = transformToSerializableEvent(event);\r\n deleteTempReservations(schedulerRef);\r\n onEdit?.(transformedEvent);\r\n }\r\n return false;\r\n },\r\n [authenticatedUser, dispatch, globalActions, onEdit, permissionsError],\r\n );\r\n const scheduler = schedulerRef.current;\r\n React.useEffect(() => {\r\n scheduler?.attachEvent('onClick', handleClick, {});\r\n\r\n // cleanup\r\n return () => {\r\n scheduler?.detachEvent('onClick');\r\n };\r\n }, [handleClick, scheduler]);\r\n\r\n const handleBeforeDrag = React.useCallback(\r\n (id: string, mode: 'move' | 'resize' | 'create', e: MouseEventHandler) => {\r\n log.debug('handleBeforeDrag', id, mode, e);\r\n switch (mode) {\r\n case 'create':\r\n console.log('create call: ' + id);\r\n return true;\r\n case 'move':\r\n case 'resize':\r\n const event: ISchedulerEvent = getEvent(scheduler, id);\r\n if (event.readonly === true) {\r\n return false;\r\n }\r\n return true;\r\n default:\r\n assertExhaustive(mode);\r\n }\r\n },\r\n [scheduler],\r\n );\r\n React.useEffect(() => {\r\n const eventName = 'onBeforeDrag';\r\n if (scheduler !== undefined) {\r\n scheduler.detachEvent(eventName);\r\n scheduler.attachEvent(eventName, handleBeforeDrag, {});\r\n }\r\n }, [handleBeforeDrag, scheduler]);\r\n\r\n /**\r\n * @see https://docs.dhtmlx.com/scheduler/api__scheduler_onbeforeeventchanged_event.html\r\n */\r\n const handleBeforeEventChange = React.useCallback(\r\n (\r\n ev: ISchedulerEvent,\r\n e: MouseEventHandler,\r\n is_new: boolean,\r\n original: any,\r\n ) => {\r\n log.debug('handleBeforeEventChange', ev, e, is_new, original);\r\n if (IsReadOnlyUser(authenticatedUser)) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'permissionError',\r\n message: permissionsError,\r\n variant: 'error',\r\n closable: true,\r\n autoHideDuration: 3000,\r\n }),\r\n );\r\n return false;\r\n }\r\n // allow all changes to new events\r\n if (is_new || (original as any).text === NEW_EVENT_TEXT) {\r\n if (forceFullDayReservations === true) {\r\n assign(\r\n ev,\r\n applyForceFullDayReservations(\r\n {\r\n start: ev.start_date,\r\n end: ev.end_date,\r\n },\r\n forceFullDayReservations,\r\n ),\r\n );\r\n return true;\r\n // force the selected duration to fixed time slot defined in service as RestrictDurationUnitType - m/h/d,\r\n // so total duration will be equal RestrictDurationUnitsAmount;\r\n } else if (restrictDuration !== undefined) {\r\n const new_end = MatchUnitSlotToEnd(\r\n dateUtils.formatISO(ev.start_date),\r\n dateUtils.formatISO(ev.end_date),\r\n restrictDuration.durationType,\r\n restrictDuration.durationAmount,\r\n );\r\n ev.end_date = new_end;\r\n return true;\r\n } else if (restrictTimeSlots.length > 0) {\r\n let newSlot = adjustToTimeSlot(\r\n ev.start_date,\r\n ev.end_date,\r\n restrictTimeSlots,\r\n minDuration,\r\n );\r\n ev.start_date = newSlot.start;\r\n ev.end_date = newSlot.end;\r\n }\r\n return true;\r\n }\r\n // prevent service change - will be implemented later on\r\n const serviceChanged = !is_new && ev.service_id !== original.service_id;\r\n if (serviceChanged) {\r\n return false;\r\n }\r\n\r\n if (is_new || (ev as any).text === NEW_EVENT_TEXT) {\r\n // set defaultDuration - not sure if need to do some thing in this case\r\n // - we have a server side correction related to default / min / max durations.\r\n // To do: check if need to include this code on event selection\r\n // comented by Ariel Malov on 05/11/2023\r\n // // if (props.defaultDuration !== undefined && props.defaultDuration > 0) {\r\n // // ev.end_date = dateUtils.addMinutes(\r\n // // ev.start_date,\r\n // // props.defaultDuration,\r\n // // );\r\n // // schedulerRef?.current?.updateEvent(ev.id?.toString());\r\n // // return true;\r\n // // // force the provided duration when user gets to place fixed length duration reservation from the service run\r\n // // } else\r\n // moved to the section if (is_new || (original as any).text === NEW_EVENT_TEXT)\r\n // the above rows didn't run because a 'if' belove - always true.\r\n // if (forceFullDayReservations === true) {\r\n // assign(\r\n // ev,\r\n // applyForceFullDayReservations(\r\n // {\r\n // start: ev.start_date,\r\n // end: ev.end_date,\r\n // },\r\n // forceFullDayReservations,\r\n // ),\r\n // );\r\n // return true;\r\n // // force the selected duration to fixed time slot defined in service as RestrictDurationUnitType - m/h/d,\r\n // // so total duration will be equal RestrictDurationUnitsAmount;\r\n // } else if (restrictDuration !== undefined) {\r\n // const new_end = MatchUnitSlotToEnd(\r\n // dateUtils.formatISO(ev.start_date),\r\n // dateUtils.formatISO(ev.end_date),\r\n // restrictDuration.durationType,\r\n // restrictDuration.durationAmount,\r\n // );\r\n // ev.end_date = new_end;\r\n // return true;\r\n // }\r\n // return true;\r\n }\r\n return true;\r\n },\r\n [\r\n authenticatedUser,\r\n dispatch,\r\n forceFullDayReservations,\r\n globalActions,\r\n minDuration,\r\n permissionsError,\r\n restrictDuration,\r\n restrictTimeSlots,\r\n ],\r\n );\r\n React.useEffect(() => {\r\n const eventName = 'onBeforeEventChanged';\r\n if (\r\n scheduler !== undefined &&\r\n services !== undefined &&\r\n services.length > 0\r\n ) {\r\n scheduler.detachEvent(eventName);\r\n scheduler.attachEvent(eventName, handleBeforeEventChange, {});\r\n }\r\n // cleanup\r\n return () => {\r\n scheduler?.detachEvent(eventName);\r\n };\r\n }, [handleBeforeEventChange, scheduler, services]);\r\n\r\n const onEmptyClick = 'onEmptyClick';\r\n const handleEmptyClick = React.useCallback(\r\n (date: Date, event: MouseEvent) => {\r\n try {\r\n log.debug(onEmptyClick, date, event);\r\n if (scheduler === undefined) {\r\n log.debug(`${onEmptyClick} - scheduler is undefined. Exiting.`);\r\n return;\r\n }\r\n // check if the click target is a DOM element so that the closest method is available\r\n const target = event.target;\r\n if (target instanceof Element) {\r\n if (target.closest('.dhx_scell_level') !== null) {\r\n return true;\r\n }\r\n // check if the click target is a service label rendered in the timeline section\r\n const containerClassName = `.${scheduleServiceContainerClassName}`;\r\n let serviceContainer = target.closest(containerClassName);\r\n if (serviceContainer !== null) {\r\n return false;\r\n }\r\n }\r\n if (IsReadOnlyUser(authenticatedUser)) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'permissionError',\r\n message: permissionsError,\r\n variant: 'error',\r\n closable: true,\r\n autoHideDuration: 3000,\r\n }),\r\n );\r\n return false;\r\n }\r\n var newExisted = scheduler\r\n .getEvents()\r\n .filter(f => !!f.text && f.text === NEW_EVENT_TEXT);\r\n if (newExisted.length > 0) {\r\n return false;\r\n }\r\n let action_data = scheduler?.getActionData(event);\r\n\r\n // verify that the empty click was done inside the calendar/timeline area\r\n // this event is also raised when instrument column is clicked on the timeline in which case the date the date is equal to timeline start date\r\n const state: ISchedulerState = scheduler?.getState();\r\n const clickedInsideVisiblePeriod =\r\n date.getTime() > state.min_date.getTime() &&\r\n date.getTime() < state.max_date.getTime();\r\n if (!clickedInsideVisiblePeriod) {\r\n return false;\r\n }\r\n\r\n // get the instrument data - relevant for timeline/unit mode\r\n // in this case the event is created on specific instrument\r\n const serviceId: number | undefined = action_data.section;\r\n const service = getServerListService(scheduler, serviceId);\r\n\r\n // get the default duration for the instrument if the event placed directly on timeline/unit view\r\n const duration =\r\n props.defaultDuration !== undefined\r\n ? props.defaultDuration\r\n : service !== undefined\r\n ? service.DefaultDuration * 60\r\n : defaultDuration;\r\n let eventDate = dateUtils.truncateSeconds(action_data.date);\r\n let period: SchedulerPeriod = {\r\n start_date: eventDate,\r\n end_date: scheduler.date.add(eventDate, duration, 'minute'),\r\n };\r\n if (restrictDuration !== undefined) {\r\n const new_end = MatchUnitSlotToEnd(\r\n dateUtils.formatISO(period.start_date),\r\n dateUtils.formatISO(period.end_date),\r\n restrictDuration.durationType,\r\n restrictDuration.durationAmount,\r\n );\r\n period.end_date = new_end;\r\n }\r\n if (restrictTimeSlots.length > 0) {\r\n let newSlot = adjustToTimeSlot(\r\n period.start_date,\r\n period.end_date,\r\n restrictTimeSlots,\r\n minDuration,\r\n );\r\n period.start_date = newSlot.start;\r\n period.end_date = newSlot.end;\r\n }\r\n const new_event: ISchedulerNewEvent = {\r\n ...adjustSchedulerEventTimes(\r\n period,\r\n service?.ForceFullDayReservations ?? forceFullDayReservations,\r\n ),\r\n service_id: serviceId,\r\n text: NEW_EVENT_TEXT,\r\n };\r\n\r\n scheduler?.addEvent(new_event);\r\n log.debug(onEmptyClick, new_event);\r\n } catch (error) {\r\n log.error(onEmptyClick, error);\r\n }\r\n },\r\n [\r\n authenticatedUser,\r\n defaultDuration,\r\n dispatch,\r\n forceFullDayReservations,\r\n globalActions,\r\n minDuration,\r\n permissionsError,\r\n props.defaultDuration,\r\n restrictDuration,\r\n restrictTimeSlots,\r\n scheduler,\r\n ],\r\n );\r\n\r\n React.useEffect(() => {\r\n scheduler?.detachEvent(onEmptyClick);\r\n scheduler?.attachEvent(onEmptyClick, handleEmptyClick, {});\r\n return () => {\r\n scheduler?.detachEvent(onEmptyClick);\r\n };\r\n }, [handleEmptyClick, scheduler]);\r\n\r\n /**\r\n * Attach non memoized events\r\n * @returns scheduler instance\r\n */\r\n const initSchedulerEvents = () => {\r\n const scheduler: DHTMLX.SchedulerStatic | undefined = schedulerRef.current;\r\n if (scheduler === undefined) {\r\n return;\r\n }\r\n const onDataUpdated = props.onDataUpdated;\r\n const attachEventSettings = {};\r\n\r\n scheduler.attachEvent(\r\n 'onEventCreated',\r\n (id: number, e: MouseEventHandler) => {\r\n log.debug('onEventCreated', id, e);\r\n return true;\r\n },\r\n attachEventSettings,\r\n );\r\n\r\n scheduler.attachEvent(\r\n 'onEventAdded',\r\n (id: number, event: ISchedulerEvent) => {\r\n log.debug('onEventAdded', id, event);\r\n if (IsReadOnlyUser(authenticatedUser)) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'permissionError',\r\n message: permissionsError,\r\n variant: 'error',\r\n closable: true,\r\n autoHideDuration: 3000,\r\n }),\r\n );\r\n return false;\r\n }\r\n // clear previously created events other than the latest one\r\n deleteTempReservations(schedulerRef, id);\r\n resetEventEdits(scheduler, event);\r\n dispatch(actions.getEmptySlotAdminClick());\r\n const service = getServerListService(scheduler, event.service_id);\r\n const serviceId =\r\n service?.AssemblyId ?? service?.Id ?? event.service_id;\r\n\r\n onCreate?.({\r\n id: id,\r\n start_date: dateUtils.formatISO(event.start_date),\r\n end_date: dateUtils.formatISO(event.end_date),\r\n service_id: serviceId,\r\n alert_type: event.alert_type,\r\n defaultMulti: event.defaultMulti,\r\n });\r\n },\r\n attachEventSettings,\r\n );\r\n\r\n // onBeforeViewChange is triggered on init, on section change, etc.\r\n scheduler.attachEvent(\r\n 'onBeforeViewChange',\r\n function (\r\n old_mode: ViewModes | undefined,\r\n old_date: Date | undefined,\r\n mode: ViewModes,\r\n date: Date,\r\n ) {\r\n log.debug('onBeforeViewChange', { old_mode, old_date, mode, date });\r\n // silence lame events fired after section change\r\n if (\r\n isEqual(\r\n {\r\n viewMode: old_mode,\r\n date: serializeSchedulerDateOrUndefined(old_date),\r\n },\r\n {\r\n viewMode: mode,\r\n date: serializeSchedulerDate(date),\r\n },\r\n )\r\n ) {\r\n return true;\r\n }\r\n\r\n const prev =\r\n old_mode === undefined ? undefined : parseViewMode(old_mode);\r\n const prevViewState: IViewState | undefined =\r\n prev === undefined\r\n ? undefined\r\n : {\r\n preset: props.presetPosition,\r\n viewType: prev.viewType,\r\n viewLength: prev.viewLength,\r\n date: serializeSchedulerDate(date),\r\n search: props.search,\r\n };\r\n const currentViewState: IViewState = {\r\n preset: null,\r\n search: props.search,\r\n ...parseViewMode(mode),\r\n date: serializeSchedulerDate(date),\r\n };\r\n\r\n const x = (f?: IViewState) => ({\r\n viewLength: f?.viewLength,\r\n date: f?.date,\r\n });\r\n if (\r\n prevViewState === undefined ||\r\n isEqual(x(currentViewState), x(prevViewState))\r\n ) {\r\n currentViewState.preset = props.presetPosition;\r\n }\r\n\r\n // adjust timeline length\r\n adjustMonthTimelineLength(mode, date, scheduler);\r\n\r\n return true;\r\n },\r\n attachEventSettings,\r\n );\r\n\r\n // sync view mode state in scheduler -> react state\r\n // is called on date/period change + on after init\r\n scheduler.attachEvent(\r\n 'onViewChange',\r\n function (new_viewMode, new_date, b) {\r\n log.debug('onViewChange', {\r\n new_viewMode,\r\n new_date,\r\n viewType,\r\n viewLength,\r\n });\r\n },\r\n attachEventSettings,\r\n );\r\n\r\n scheduler.attachEvent(\r\n 'onDblClick',\r\n (id, event) => {\r\n log.debug('onDblClick', { id, event });\r\n // just disable double click - edit is triggered on the single click\r\n return false;\r\n },\r\n attachEventSettings,\r\n );\r\n scheduler.attachEvent(\r\n 'onBeforeEventCreated',\r\n event => {\r\n log.debug('onBeforeEventCreated', event);\r\n return true;\r\n },\r\n attachEventSettings,\r\n );\r\n\r\n // onEventChanged is fired immediately after an event is changed on the scheduler, for example - by dragging it over\r\n scheduler.attachEvent(\r\n 'onEventChanged',\r\n (id, event: ISchedulerEvent) => {\r\n log.debug('onEventChanged', id, event);\r\n if (IsReadOnlyUser(authenticatedUser)) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'permissionError',\r\n message: permissionsError,\r\n variant: 'error',\r\n closable: true,\r\n autoHideDuration: 3000,\r\n }),\r\n );\r\n return false;\r\n }\r\n resetEventEdits(scheduler, event);\r\n // either an existing reservation can be edited or a \"new event\" can be moved on the timeline while the sidePanel is still open\r\n const changeNewReservation = event.type === undefined;\r\n if (!changeNewReservation) {\r\n // if existing reservation is edited - drop any \"new events\"\r\n deleteTempReservations(schedulerRef);\r\n // and open the edit sidePanel for through onEdit callback\r\n onEdit?.({\r\n ...event,\r\n ...{\r\n start_date: dateUtils.formatISO(event.start_date),\r\n end_date: dateUtils.formatISO(event.end_date),\r\n },\r\n });\r\n return true;\r\n } else {\r\n // open create reservation sidePanel or adjust time if already opened\r\n onCreate?.({\r\n id: id,\r\n start_date: dateUtils.formatISO(event.start_date),\r\n end_date: dateUtils.formatISO(event.end_date),\r\n service_id: event.service_id,\r\n });\r\n }\r\n\r\n return false;\r\n },\r\n attachEventSettings,\r\n );\r\n scheduler.attachEvent(\r\n 'onEventDeleted',\r\n (id, ev) => {\r\n log.debug('onEventDeleted', { id, ev });\r\n if (onDataUpdated) {\r\n onDataUpdated('delete', ev, id);\r\n }\r\n },\r\n attachEventSettings,\r\n );\r\n scheduler.attachEvent(\r\n 'onTemplatesReady',\r\n () => {\r\n scheduler.templates.event_bar_date = (\r\n start: Date,\r\n end: Date,\r\n event: ISchedulerEvent,\r\n ) => {\r\n return `• ${dateUtils.format(\r\n start,\r\n dateUtils.DateIOFormats.fullTime,\r\n )} - ${dateUtils.format(end, dateUtils.DateIOFormats.fullTime)}`;\r\n };\r\n },\r\n attachEventSettings,\r\n );\r\n };\r\n React.useEffect(() => {\r\n // wait for both scheduler and the services to be initialized\r\n // the services will be needed in the openToBookMode for the default reservation duration\r\n if (!!scheduler && services !== undefined) {\r\n const params = new URLSearchParams(location.search);\r\n let openToBook = GetRawValue(params, 'openToBook') === 'true';\r\n let openToReport = GetRawValue(params, 'openToReport') === 'true';\r\n let serviceIds = GetRawValue(params, 'eid') ?? undefined;\r\n let alertType = GetNumberOrUndefined(\r\n GetRawValue(params, 'aType') ?? undefined,\r\n );\r\n let defaultMulti = GetRawValue(params, 'defaultMulti') === 'true';\r\n if (\r\n (openToBook === true || openToReport === true) &&\r\n serviceIds !== undefined &&\r\n services !== undefined &&\r\n services.length > 0\r\n ) {\r\n initOnlineServicesData(serviceIds, 'reserved').then(result => {\r\n !!setFilterValue && setFilterValue('service', result);\r\n dispatch(actions.getServices_Success(result as IServiceFilterDto[]));\r\n dispatch(\r\n actions.updateEmptySlotSettings(\r\n openToReport\r\n ? EmptySlotAdminClick.DownTimeOnly\r\n : EmptySlotAdminClick.ReservationsOnly,\r\n ),\r\n );\r\n });\r\n if (isMobile) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'ClickToReserve',\r\n message: 'Click to reserve (or click, hold and drag)',\r\n variant: 'info',\r\n closable: true,\r\n autoHideDuration: 5000,\r\n }),\r\n );\r\n } else {\r\n let duration =\r\n props.defaultDuration !== undefined\r\n ? props.defaultDuration\r\n : defaultDuration;\r\n let initDate = dateUtils.truncateSeconds(newDate());\r\n let event = {\r\n start_date: initDate,\r\n end_date: scheduler.date.add(initDate, duration || 60, 'minute'),\r\n service_id: getSplitNumberArray(serviceIds || ''),\r\n alert_type: alertType,\r\n defaultMulti,\r\n };\r\n scheduler.addEventNow(event);\r\n }\r\n\r\n const currentSearch = new URLSearchParams();\r\n [...params.keys()].forEach(key => {\r\n if (\r\n key !== 'openToBook' &&\r\n key !== 'openToReport' &&\r\n key !== 'aType' &&\r\n key !== 'defaultMulti'\r\n ) {\r\n const val = params.get(key);\r\n if (val !== null) {\r\n currentSearch.set(key, val);\r\n }\r\n }\r\n });\r\n dispatch(\r\n routerActions.replace({\r\n pathname: location.pathname,\r\n search: currentSearch.toString(),\r\n }),\r\n );\r\n }\r\n }\r\n }, [\r\n actions,\r\n appliedFilters,\r\n defaultDuration,\r\n dispatch,\r\n globalActions,\r\n isMobile,\r\n location.pathname,\r\n location.search,\r\n newDate,\r\n onFilterChange,\r\n props.defaultDuration,\r\n scheduler,\r\n services,\r\n setFilterValue,\r\n ]);\r\n /**\r\n * Main initialization\r\n */\r\n useEffectOnMount(() => {\r\n schedulerRef.current = DHTMLX.Scheduler.getSchedulerInstance();\r\n const scheduler = schedulerRef.current;\r\n if (scheduler !== undefined && schedulerContainer.current !== undefined) {\r\n scheduler.skin = 'material';\r\n scheduler.locale.labels.timeline_tab = 'Timeline';\r\n scheduler.locale.labels.calendar_tab = 'Calendar';\r\n scheduler.locale.labels.section_custom = 'Section';\r\n // native header can't be removed by removing div.dhx_cal_navline since scheduler creates it anyway\r\n // display:none hides native navline\r\n // scheduler.xy.nav_height = 0 - adjusts the heights\r\n scheduler.xy.nav_height = 0;\r\n\r\n scheduler.plugins({\r\n limit: true,\r\n all_timed: true,\r\n timeline: true,\r\n treetimeline: true,\r\n daytimeline: true,\r\n tooltip: true,\r\n units: true,\r\n multiselect: true,\r\n });\r\n\r\n const configOptions: Partial = {\r\n // show multi day events inside the scheduler body instead of showing as full day events on top\r\n all_timed: true,\r\n multi_day: true,\r\n details_on_create: false,\r\n details_on_dblclick: false,\r\n start_on_monday: tryGetStartOnMonday(),\r\n // disable internal edit on event create\r\n edit_on_create: false,\r\n hour_date: '%g:%i %A',\r\n mark_now: true,\r\n now_date: newDate(),\r\n time_step: 15,\r\n //auto_end_date: true,\r\n //event_duration: 120,\r\n touch: true,\r\n touch_drag: 500,\r\n // sets a timeout (in milliseconds) that wraps the updateView and setCurrentView calls (that cause re-drawing of the scheduler)\r\n // https://docs.dhtmlx.com/scheduler/api__scheduler_delay_render_config.html\r\n // setting delay_render to be > 0 results in timeline (both tree and matrix) not render e.g. blank view\r\n delay_render: 0,\r\n // disable dragging event by it's body element since it's handled in the readonly/move\r\n drag_event_body: false,\r\n // scroll by default to 08:00 on calendar\r\n scroll_hour: 8, // newDate().getHours(), //8,\r\n // prevents check limit cpu crunch on open end offline hours/alerts\r\n check_limits: false,\r\n };\r\n\r\n Object.assign(scheduler.config, configOptions);\r\n log.info('scheduler.config', scheduler.config);\r\n // reduce from default 70 to 40 in order to reduce precious horizontal space on mobile\r\n scheduler.xy.scale_width = isMobile ? 40 : 70;\r\n // this should be large enough to contain 2 text lines on mobile otherwise one is sufficient\r\n scheduler.xy.scale_height = isMobile ? 35 : 30;\r\n\r\n scheduler.config.hour_size_px = 44;\r\n // reduces default min height from 40px to 22px (half an hour height)\r\n scheduler.xy.min_event_height = scheduler.config.hour_size_px / 2;\r\n\r\n // cast is needed since the scheduler renderEvent is typed incompletely. According to definition it has 2 arguments, but in reality it's got 6 - see renderEvent\r\n scheduler.renderEvent = renderEvent(scheduler) as (\r\n container: HTMLElement,\r\n event: any,\r\n ) => boolean;\r\n\r\n Object.assign(scheduler.templates, {\r\n // parse function to match system settings\r\n parse_date: date => dateUtils.parseISO(date),\r\n tooltip_text: tooltip_text(\r\n scheduler,\r\n compiledSchedulerReservationTooltipTemplate,\r\n IncludeCustomFormInSchedulerReservationTooltip,\r\n ),\r\n event_class: function (start: Date, end: Date, event: ISchedulerEvent) {\r\n const eventType = event.type;\r\n if (eventType === 'offline') {\r\n return 'event_offline';\r\n } else {\r\n if (event.id === scheduler.getState().select_id) {\r\n return 'selected';\r\n }\r\n }\r\n },\r\n // sets the calendar event text content\r\n event_text: event_text(\r\n viewType,\r\n isMobile,\r\n compiledSchedulerReservationBodyTemplate,\r\n ),\r\n // todo: set the timeline event text content - this will require rework of timeline display/or separate template since currently the timeline events won't fit the multiline text\r\n event_bar_text: event_text(\r\n viewType,\r\n isMobile,\r\n compiledSchedulerReservationBodyTemplate,\r\n ),\r\n week_scale_date: function (date) {\r\n const text = isMobile\r\n ? // Mon 12 with line break\r\n dateUtils.format(date, 'EEE') +\r\n '
    ' +\r\n dateUtils.format(date, 'dd')\r\n : // Mon, 12 Jan\r\n dateUtils.format(date, 'EEE, d LLL');\r\n\r\n return text;\r\n },\r\n unit_scale_text: function (key, label, unit, date) {\r\n return 'AAAAAAAAAAAA';\r\n },\r\n hour_scale: function (date) {\r\n // no am/pm indicator was found on the date-fns locale\r\n // removes minutes :00 manually in order to preserve precious horizontal space on mobile\r\n return useAmPm\r\n ? isMobile\r\n ? dateUtils.format(date, 'HH')?.replace(':00', '')\r\n : dateUtils.format(date, 'hh aaa')\r\n : isMobile\r\n ? dateUtils.format(date, 'p')?.replace(':00', '')\r\n : dateUtils.format(date, 'p');\r\n },\r\n // work date class\r\n week_date_class: function (date, today) {\r\n return `week_date_${dateUtils.formatISO(date, {\r\n format: 'basic',\r\n representation: 'date',\r\n })}`;\r\n },\r\n });\r\n\r\n // attaches constant events\r\n initSchedulerEvents();\r\n\r\n // serverList is needed to be able to change the \"sections\" in the lifecycle of the scheduler component\r\n // changes in the scheduler.sections is ignored by the scheduler\r\n setServerList(\r\n scheduler,\r\n services,\r\n appSettings,\r\n schedulerSectionsGroupByField,\r\n );\r\n\r\n // create all of the views like weekly calendar, daily calendar (unit) etc.\r\n createTimelineView(\r\n scheduler,\r\n isMobile,\r\n customDays || 2,\r\n useAmPm,\r\n hasCustomStart,\r\n );\r\n createUnitsView(scheduler);\r\n\r\n // initializes the scheduler\r\n scheduler.init(\r\n schedulerContainer.current as HTMLElement,\r\n getViewStartDate(viewLength, date, hasCustomStart),\r\n viewMode,\r\n );\r\n }\r\n return () => {\r\n schedulerRef.current && schedulerRef.current.destructor();\r\n };\r\n\r\n /**\r\n * try to get the monday/sunday week start\r\n * dateUtils.CurrentLocale() might return undefined if it was not initialized properly before this call, e.g. in test\r\n * @returns\r\n */\r\n function tryGetStartOnMonday(): boolean | undefined {\r\n try {\r\n return dateUtils.CurrentLocale()?.options?.weekStartsOn === 1;\r\n } catch (error) {\r\n return true;\r\n }\r\n }\r\n });\r\n\r\n const handleServiceLabelClick = React.useCallback(\r\n (event: MouseEvent, serviceId: number) => {\r\n // open the asset details\r\n openAsset({\r\n serviceId: serviceId,\r\n serviceType: 'Online',\r\n });\r\n },\r\n [openAsset],\r\n );\r\n\r\n /**\r\n * Handles click inside the scheduler.\r\n * Clicking on an asset label/image should open asset side panel\r\n */\r\n const handleSchedulerClick = React.useCallback(\r\n (event: MouseEvent) => {\r\n log.debug('handleSchedulerClick', event);\r\n\r\n const isTimelineColumnCellClick =\r\n findParentTarget(event, ['.dhx_matrix_scell']) !== null;\r\n if (isTimelineColumnCellClick) {\r\n const serviceId = getServiceIdFromServiceClickEvent(event);\r\n if (serviceId !== undefined) {\r\n handleServiceLabelClick(event, serviceId);\r\n // prevent further event propagation if it's already handled\r\n event.preventDefault();\r\n event.stopPropagation();\r\n return false;\r\n }\r\n }\r\n },\r\n [handleServiceLabelClick],\r\n );\r\n React.useEffect(() => {\r\n const dom = schedulerContainer.current;\r\n dom?.addEventListener('click', handleSchedulerClick, { capture: true });\r\n return () => {\r\n dom?.removeEventListener('click', handleSchedulerClick);\r\n };\r\n }, [handleSchedulerClick]);\r\n\r\n /**\r\n * Handles zoom in / out for timeline view only.\r\n * currently commented to develop later\r\n */\r\n // const handleZoomWhell = React.useCallback(\r\n // (event: WheelEvent) => {\r\n // if (!zoomEnabled) {\r\n // return;\r\n // }\r\n // let delta = 0;\r\n // if (!!(event as any).wheelDelta) {\r\n // /* IE/Opera. */\r\n // delta = (event as any).wheelDelta / 120;\r\n // } else if (event.detail) {\r\n // /* Mozilla case. */\r\n // // In Mozilla, sign of delta is different than in IE.\r\n // // Also, delta is multiple of 3.\r\n // delta = -event.detail / 3;\r\n // } else if (event.deltaY) {\r\n // delta = -event.deltaY / 3;\r\n // }\r\n // if (!(viewType === 'timeline' && !!schedulerRef.current && !!scheduler))\r\n // return;\r\n // const target = event.target;\r\n\r\n // if (!(target instanceof Element)) {\r\n // return;\r\n // }\r\n // let dataContainer = target.closest('.dhx_timeline_data_wrapper');\r\n // if (dataContainer === null) {\r\n // return;\r\n // }\r\n // let state = scheduler?.getActionData(event);\r\n // if (!state || !state.date) {\r\n // return;\r\n // }\r\n\r\n // if (delta) {\r\n // const zoomFriction = 5;\r\n // let scale = 0;\r\n // if (delta < 0) {\r\n // scale = 1 - delta / zoomFriction;\r\n // } else {\r\n // scale = 1 / (1 + delta / zoomFriction);\r\n // }\r\n // let pointer = getPointer(\r\n // {\r\n // x: event.clientX,\r\n // y: event.clientY,\r\n // },\r\n // dataContainer,\r\n // scheduler,\r\n // );\r\n // let timeline = scheduler?.matrix[viewMode];\r\n // let currentMode = parseViewMode(scheduler?.getState().mode);\r\n // let newLength = currentMode.viewLength;\r\n // if (false) {\r\n // //currentMode.viewLength === 'week'\r\n // //let pointerDate = timeline.dateFromPos(pointer.x);\r\n\r\n // const hour = 24;\r\n // const divider = 4;\r\n // const minStep = 4;\r\n // const maxStep = 8;\r\n // const column_width = 36;\r\n // //const left = timeline.posFromDate(state.date);\r\n // const top = timeline.getSectionTop(state.section);\r\n // const position = {\r\n // left: pointer.x + (pointer.x - pointer.x * scale) / 2, //Math.ceil(left / 2),\r\n // top: top / 2, //pointer.y - (pointer.y / 2) * scale, //Math.ceil(top / 2),\r\n // } as LeftTop;\r\n // // const position = {\r\n // // date: pointerDate,\r\n // // section: state.section,\r\n // // } as DateSection;\r\n // // const position = timeline.resolvePosition({\r\n // // top: e.y,\r\n // // left: e.x,\r\n // // });\r\n // // zoom in\r\n // if (delta > 0) {\r\n // if (currentStep === 0) {\r\n // timeline.x_step = hour / (divider + scale);\r\n // timeline.x_size = (divider + scale) * 7;\r\n // timeline.x_length = (divider + scale) * 7;\r\n // timeline.column_width =\r\n // timeline.column_width +\r\n // (timeline.column_width - timeline.column_width * scale); //column_width * scale;\r\n // setCurrentPosition(position);\r\n // setCurrentStep(divider + 1);\r\n // setZoomed(true);\r\n\r\n // // timeline.scrollTo(position.date, position.section);\r\n // // scheduler.setCurrentView(position.date);\r\n // } else {\r\n // timeline.x_step =\r\n // currentStep < maxStep\r\n // ? hour / (currentStep + scale)\r\n // : timeline.x_step;\r\n // timeline.x_size =\r\n // currentStep < maxStep\r\n // ? (currentStep + scale) * 7\r\n // : timeline.x_size;\r\n // timeline.x_length =\r\n // currentStep < maxStep\r\n // ? (currentStep + scale) * 7\r\n // : timeline.x_length;\r\n // timeline.column_width =\r\n // currentStep < maxStep\r\n // ? timeline.column_width +\r\n // (timeline.column_width - timeline.column_width * scale)\r\n // : timeline.column_width;\r\n // if (currentStep < maxStep) {\r\n // setCurrentStep(prev => prev + 1);\r\n // setCurrentPosition(position);\r\n // setZoomed(true);\r\n\r\n // // scheduler.setCurrentView(position.date);\r\n // // timeline.scrollTo(position.date, position.section);\r\n // }\r\n // }\r\n // }\r\n // // zoom out\r\n // else {\r\n // if (currentStep >= minStep) {\r\n // timeline.x_step =\r\n // currentStep > minStep\r\n // ? hour / (currentStep - 1)\r\n // : timeline.x_step;\r\n // timeline.x_size =\r\n // currentStep > minStep ? (currentStep - 1) * 7 : timeline.x_size;\r\n // timeline.x_length =\r\n // currentStep > minStep\r\n // ? (currentStep - 1) * 7\r\n // : timeline.x_length;\r\n // timeline.column_width =\r\n // currentStep > minStep\r\n // ? timeline.column_width / 1.5\r\n // : column_width;\r\n // if (currentStep > minStep) {\r\n // setCurrentStep(prev => prev - 1);\r\n // setCurrentPosition(position);\r\n // setZoomed(true);\r\n // }\r\n // }\r\n // }\r\n // console.log('week_timeline', timeline);\r\n // } else {\r\n // if (event.deltaY < 0) {\r\n // newLength = getPrevViewLength(\r\n // currentMode.viewLength,\r\n // customDaysEnabled,\r\n // twoDaysEnabled,\r\n // );\r\n // } else {\r\n // newLength = getNextViewLength(\r\n // currentMode.viewLength,\r\n // customDaysEnabled,\r\n // twoDaysEnabled,\r\n // );\r\n // }\r\n // if (newLength !== currentMode.viewLength) {\r\n // !!handleViewTypeLengthChange &&\r\n // handleViewTypeLengthChange(\r\n // viewType,\r\n // newLength,\r\n // getViewStartDate(newLength, state.date, hasCustomStart),\r\n // noChangeLocation,\r\n // );\r\n // }\r\n // }\r\n // event.preventDefault();\r\n // }\r\n // },\r\n // [\r\n // currentStep,\r\n // customDaysEnabled,\r\n // handleViewTypeLengthChange,\r\n // hasCustomStart,\r\n // noChangeLocation,\r\n // scheduler,\r\n // twoDaysEnabled,\r\n // viewMode,\r\n // viewType,\r\n // ],\r\n // zoomEnabled,\r\n // );\r\n /**\r\n * Bind to scheduler dom in order to handle click on instrument label/image in the timeline\r\n */\r\n\r\n // todo: find the source of services array reference change\r\n // prevent unnecessary useEffect invocations when services array reference changes for whatever reason\r\n const stringifiedServices = React.useMemo(\r\n () => (services === undefined ? undefined : JSON.stringify(services)),\r\n [services],\r\n );\r\n const parsedServices = React.useMemo(\r\n () =>\r\n stringifiedServices === undefined\r\n ? undefined\r\n : JSON.parse(stringifiedServices),\r\n [stringifiedServices],\r\n );\r\n const schedulerSectionsGroupByField = useSelector(selectTimelineGroupBy);\r\n /**\r\n * Sync props.services -> scheduler\r\n */\r\n React.useEffect(() => {\r\n if (parsedServices !== undefined) {\r\n const scheduler = schedulerRef.current;\r\n if (scheduler !== undefined) {\r\n // if (sections?.length === 0) {\r\n // sections.push({ label: '' });\r\n // }\r\n // todo: update grouping on unit->timeline transition\r\n updateServerList(\r\n scheduler,\r\n services,\r\n appSettings,\r\n schedulerSectionsGroupByField,\r\n );\r\n\r\n /**\r\n * units view does not update the service column on it's own after the updateCollection call\r\n * unlike the timeline which manages to reflect the changes immediately on it's own without any help\r\n * calendar view does not need any changes at all since it does not show separate services\r\n */\r\n if (viewType === 'unit') {\r\n updateView(schedulerRef.current);\r\n }\r\n }\r\n }\r\n }, [\r\n appSettings,\r\n parsedServices,\r\n schedulerSectionsGroupByField,\r\n services,\r\n viewType,\r\n ]);\r\n\r\n /**\r\n * Sync props.events -> scheduler\r\n */\r\n React.useEffect(() => {\r\n // return early on initial render\r\n if (events !== undefined) {\r\n syncSchedulerEvents(schedulerRef?.current, events);\r\n }\r\n }, [scheduler, events]);\r\n\r\n /**\r\n * non working hours (gaps between the working hours) need to be tracked separately due to the lack of getMarkedTimespans similar to getEvents on the scheduler API\r\n * todo: find a better way to clear/sync non working hours into the scheduler. Currently shown marked timespans might be queryable through the DOM API.\r\n */\r\n const nonWorkingHoursRef = React.useRef>([]);\r\n React.useEffect(() => {\r\n // return early on initial render\r\n if (nonWorkingHours !== undefined) {\r\n const state: ISchedulerState = schedulerRef?.current?.getState();\r\n // https://docs.dhtmlx.com/scheduler/api__scheduler_addmarkedtimespan.html\r\n const getUnits = item => {\r\n switch (viewType) {\r\n case 'unit':\r\n case 'timeline':\r\n return {\r\n [viewMode]: item.EquipmentId,\r\n };\r\n case 'calendar':\r\n return undefined;\r\n\r\n default:\r\n assertExhaustive(viewType);\r\n }\r\n };\r\n const timeSpans = nonWorkingHoursRef.current.reduce<{\r\n removed: IMarkedTimeSpan[];\r\n current: IMarkedTimeSpan[];\r\n }>(\r\n (prev, item) => {\r\n const match =\r\n item.start_date < state.max_date && item.end_date > state.min_date;\r\n (match ? prev.removed : prev.current).push(item);\r\n return prev;\r\n },\r\n {\r\n removed: [],\r\n current: [],\r\n },\r\n );\r\n timeSpans.removed.forEach(item => {\r\n schedulerRef?.current?.deleteMarkedTimespan(String(item.id));\r\n return item;\r\n });\r\n\r\n const highlights = nonWorkingHours\r\n ?.map(item => {\r\n const timeSpan = {\r\n type: 'dhx_time_block',\r\n css: 'fat_lines_section',\r\n start_date: dateUtils.parseISO(item.Start),\r\n end_date: dateUtils.parseISO(item.End),\r\n sections: getUnits(item),\r\n };\r\n var spanId = schedulerRef.current?.addMarkedTimespan(timeSpan);\r\n if (spanId === undefined) {\r\n return undefined;\r\n }\r\n const r: IMarkedTimeSpan = {\r\n id: spanId,\r\n start_date: timeSpan.start_date,\r\n end_date: timeSpan.end_date,\r\n };\r\n return r;\r\n })\r\n .filter(item => item !== undefined);\r\n nonWorkingHoursRef.current = [\r\n ...timeSpans.current,\r\n ...(highlights as IMarkedTimeSpan[]),\r\n ];\r\n\r\n // updateView here is needed since addMarkedTimespan above is not rendered immediately on the scheduler\r\n updateView(schedulerRef.current, undefined, true);\r\n }\r\n if (viewMode === 'day_timeline' && !!date) {\r\n let startdate = dateUtils.parseISO(date);\r\n const hourSet =\r\n dateUtils.getHours(startdate) < 8 ? dateUtils.getHours(startdate) : 8;\r\n schedulerRef?.current\r\n ?.getView()\r\n ?.scrollTo(\r\n dateUtils.addHours(dateUtils.startOfDay(startdate), hourSet),\r\n );\r\n }\r\n }, [date, nonWorkingHours, viewMode, viewType]);\r\n\r\n /**\r\n * Sync current view props from props to scheduler instance\r\n * useDidUpdate is used here to skip first fire since the scheduler is already initialized with the current view props during initial mount, so nothing needs to be done in this case.\r\n */\r\n useDidUpdate(() => {\r\n const scheduler = schedulerRef.current;\r\n if (scheduler === undefined) {\r\n return;\r\n }\r\n\r\n // TODO: remove following block? looks like the viewType parameter is redundant and resetting the calendar/timeline event text templates with subsequent updateView call just wastes the resources\r\n // TODO: clearly separate of calendar/timeline templates (if it will be possible to untangle the event_text mess)\r\n scheduler.templates.event_text = event_text(\r\n viewType,\r\n isMobile,\r\n compiledSchedulerReservationBodyTemplate,\r\n );\r\n scheduler.templates.event_bar_text = event_text(\r\n viewType,\r\n isMobile,\r\n compiledSchedulerReservationBodyTemplate,\r\n );\r\n const d = dateUtils.parseISO(date);\r\n scheduler.config.now_date = d;\r\n // is this needed to update view to apply updates in event_text & event_bar_text ?\r\n updateView(scheduler);\r\n\r\n scheduler.setCurrentView(\r\n getViewStartDate(viewLength, date, hasCustomStart),\r\n viewMode,\r\n );\r\n // scroll to 08:00 on daily timeline\r\n if (viewMode === 'day_timeline') {\r\n const hourSet = dateUtils.getHours(d) < 8 ? dateUtils.getHours(d) : 8;\r\n scheduler\r\n .getView()\r\n ?.scrollTo(dateUtils.addHours(dateUtils.startOfDay(d), hourSet));\r\n }\r\n if (viewMode === 'twodays_timeline') {\r\n let timeline = scheduler.matrix[viewMode];\r\n timeline.setRange(\r\n getViewStartDate(viewLength, date, hasCustomStart),\r\n getViewEndDate(viewLength, date, undefined, hasCustomStart),\r\n );\r\n }\r\n if (viewMode === 'customdays_timeline') {\r\n let timeline = scheduler.matrix[viewMode];\r\n timeline.setRange(\r\n getViewStartDate(viewLength, date, hasCustomStart),\r\n getViewEndDate(viewLength, date, customDays, hasCustomStart),\r\n );\r\n }\r\n if (hasCustomStart) {\r\n const d = dateUtils.parseISO(date);\r\n if (\r\n viewMode === 'month_timeline' ||\r\n viewMode === 'week_timeline' ||\r\n viewMode === 'quarter_timeline' ||\r\n viewMode === 'year_timeline' ||\r\n viewMode === 'week' ||\r\n viewMode === 'month'\r\n ) {\r\n let timeline = scheduler.matrix[viewMode];\r\n let newStart = getViewStartDate(viewLength, date, hasCustomStart);\r\n let newEnd = getViewEndDate(\r\n viewLength,\r\n date,\r\n customDays,\r\n hasCustomStart,\r\n );\r\n\r\n if (viewMode === 'week_timeline') {\r\n scheduler.date['week_timeline_start'] = () => newStart;\r\n scheduler.date['get_week_timeline_end'] = () => newEnd;\r\n } else if (viewMode === 'week') {\r\n scheduler.date['week_start'] = () => newStart ?? d;\r\n } else if (viewMode === 'month') {\r\n scheduler.date.month_start = () => newStart ?? d;\r\n } else {\r\n timeline.setRange(newStart, newEnd);\r\n }\r\n }\r\n }\r\n }, [\r\n compiledSchedulerReservationBodyTemplate,\r\n customDays,\r\n date,\r\n hasCustomStart,\r\n isMobile,\r\n viewLength,\r\n viewMode,\r\n viewType,\r\n ]);\r\n\r\n const withReservationsOnly = useSelector(selectWithReservationsOnly);\r\n const loadingEvents = useSelector(selectSchedulerLoadingEvents);\r\n const showProgress = withReservationsOnly === true && loadingEvents === true;\r\n const showNoDataPlaceholder = services?.length === 0 && !showProgress;\r\n const hideCalData = showNoDataPlaceholder || showProgress;\r\n const print = useSelector(selectExportToPDF);\r\n const handleClosePrintToPDF = React.useCallback(() => {\r\n dispatch(actions.resetExportToPDF());\r\n }, [actions, dispatch]);\r\n const getTitle = React.useCallback(\r\n (viewType: ViewTypes): string => {\r\n switch (viewType) {\r\n case 'calendar':\r\n return t(translations.Calendar);\r\n case 'timeline':\r\n return t(translations.Timeline);\r\n default:\r\n assertExhaustive(viewType);\r\n }\r\n },\r\n [t],\r\n );\r\n return (\r\n <>\r\n \r\n \r\n {/* \r\n native header can't be removed by removing div.dhx_cal_navline since scheduler creates it anyway\r\n display:none hides native navline\r\n scheduler.xy.nav_height = 0 - adjusts the heights\r\n */}\r\n
    \r\n
    \r\n {showNoDataPlaceholder && }\r\n {showProgress && }\r\n {/* hide the calendar data without unmounting it since it's content is handled by the dhtmlx scheduler */}\r\n \r\n \r\n \r\n );\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerEvent } from '../types/ISchedulerEvent';\r\n\r\n/**\r\n * Retrieves scheduler event by it's id\r\n * @param scheduler\r\n * @param id\r\n * @returns\r\n */\r\nexport function getEvent(\r\n scheduler: DHTMLX.SchedulerStatic | undefined,\r\n id: string,\r\n): ISchedulerEvent {\r\n return scheduler?.getEvent(id);\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport function adjustMonthTimelineLength(\r\n mode: any,\r\n date: any,\r\n scheduler: DHTMLX.SchedulerStatic,\r\n) {\r\n if (mode === 'month_timeline') {\r\n if (date !== undefined) {\r\n var year = date.getFullYear();\r\n var month = date.getMonth() + 1;\r\n var d = new Date(year, month, 0);\r\n scheduler.matrix[mode].x_size = d.getDate();\r\n scheduler.matrix[mode].x_length = d.getDate();\r\n //scheduler.date['timeline_start'] = scheduler.date.month_start;\r\n //scheduler.date.\r\n }\r\n } else if (mode === 'quarter_timeline') {\r\n if (date !== undefined) {\r\n let qst = dateUtils.startOfQuarter(date);\r\n let qet = dateUtils.endOfQuarter(date);\r\n let offsetStart =\r\n dateUtils.startOfWeek(qst) < qst\r\n ? dateUtils.startOfWeek(qst).getDay()\r\n : 0;\r\n\r\n let weeks = Math.round(dateUtils.getWeekDiff(qst, qet));\r\n scheduler.matrix[mode].x_size = weeks;\r\n scheduler.matrix[mode].x_length = weeks;\r\n scheduler.matrix[mode].x_start = offsetStart;\r\n }\r\n }\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { timelineColumnWidth } from './utils';\r\nimport { scheduler_services_collection_name } from './serverListUtils';\r\nimport { scheduleServiceTemplate } from './renderServiceLabel';\r\nimport { ISchedulerServiceSection } from './types/ISchedulerSection';\r\nimport { timelineEventsSortIteratee } from './utils/timelineEventsSortIteratee';\r\n\r\ninterface ITimelineColumn {\r\n name?: string;\r\n css?: string;\r\n label?: string;\r\n width: number;\r\n template: (params: ISchedulerServiceSection) => string;\r\n}\r\n\r\nexport function createTimelineView(\r\n scheduler: DHTMLX.SchedulerStatic,\r\n isMobile: boolean,\r\n customDays: number,\r\n useAmPm?: boolean,\r\n hasCustomStart?: boolean,\r\n) {\r\n const columns: ITimelineColumn[] = [\r\n {\r\n label: '',\r\n width: timelineColumnWidth(isMobile),\r\n template: scheduleServiceTemplate,\r\n },\r\n ];\r\n\r\n const s = {\r\n y_unit: scheduler.serverList(scheduler_services_collection_name),\r\n y_property: 'service_id',\r\n column_width: 70,\r\n scrollable: true,\r\n render: 'tree',\r\n event_min_dy: isMobile ? 20 : 38,\r\n columns: columns,\r\n sort: timelineEventsSortIteratee,\r\n };\r\n\r\n scheduler.createTimelineView({\r\n name: 'day_timeline',\r\n x_unit: 'minute',\r\n x_date: ' ',\r\n x_start: 0,\r\n x_step: 15,\r\n x_size: 24 * 4,\r\n x_length: 24 * 4,\r\n second_scale: {\r\n x_unit: 'hour',\r\n x_date: useAmPm ? '%h %A' : '%H:%i',\r\n },\r\n ...{\r\n ...s,\r\n column_width: 20,\r\n },\r\n });\r\n scheduler.createTimelineView({\r\n name: 'twodays_timeline',\r\n x_unit: 'hour',\r\n x_date: useAmPm ? '%h %A' : '%H:%i', //'%H:%i',\r\n x_start: 0,\r\n x_step: 24 / 6,\r\n x_size: (24 / 6) * 2,\r\n x_length: (24 / 6) * 2,\r\n second_scale: {\r\n x_unit: 'day',\r\n x_date: '%D, %j %M', // date format which should be used for second scale, \"July 01\"\r\n },\r\n ...s,\r\n });\r\n scheduler.createTimelineView({\r\n name: 'customdays_timeline',\r\n x_unit: customDays < 28 ? 'hour' : 'day',\r\n x_date:\r\n customDays < 7\r\n ? useAmPm\r\n ? '%h %A'\r\n : '%H:%i'\r\n : customDays < 28\r\n ? ' '\r\n : '%d',\r\n x_start: 0,\r\n x_step: customDays < 7 ? 24 / 6 : customDays < 28 ? 24 / 4 : 1,\r\n x_size:\r\n customDays < 7 ? (24 / 6) * customDays : customDays < 28 ? 4 * 7 : 31,\r\n x_length:\r\n customDays < 7 ? (24 / 6) * customDays : customDays < 28 ? 4 * 7 : 31,\r\n second_scale: {\r\n x_unit: customDays < 7 ? 'day' : customDays < 28 ? 'day' : 'week',\r\n x_date:\r\n customDays < 7\r\n ? '%D, %j %M'\r\n : customDays < 28\r\n ? '%D, %j %M'\r\n : '%M, W %W', // date format which should be used for second scale, \"July 01\"\r\n },\r\n ...s,\r\n });\r\n scheduler.createTimelineView({\r\n name: 'week_timeline',\r\n x_unit: 'hour',\r\n x_date: ' ',\r\n x_step: 24 / 4,\r\n x_size: 4 * 7,\r\n x_start: 0,\r\n x_length: 4 * 7,\r\n second_scale: {\r\n x_unit: 'day',\r\n x_date: '%D, %j %M', // date format which should be used for second scale, \"July 01\"\r\n },\r\n ...{\r\n ...s,\r\n column_width: 36,\r\n },\r\n });\r\n\r\n // https://docs.dhtmlx.com/scheduler/custom_views.html\r\n // sets the week_timeline period to match the week date falls into: week start -> week end according to scheduler's settings\r\n scheduler.date.week_timeline_start = date =>\r\n hasCustomStart ? date : scheduler.date.week_start(date);\r\n scheduler.date.get_week_timeline_end = start_date =>\r\n scheduler.date.add(start_date, 7, 'day');\r\n\r\n scheduler.createTimelineView({\r\n name: 'month_timeline',\r\n x_unit: 'day',\r\n x_date: '%j',\r\n x_step: 1,\r\n x_size: 31,\r\n x_start: 0,\r\n x_length: 31,\r\n\r\n second_scale: {\r\n x_unit: 'week',\r\n x_date: '%M, W %W', // date format which should be used for second scale, \"July 01\"\r\n },\r\n // sections of the view (titles of Y-Axis)\r\n ...{\r\n ...s,\r\n column_width: 36,\r\n },\r\n });\r\n scheduler.date['timeline_start'] = scheduler.date.month_start;\r\n scheduler.createTimelineView({\r\n name: 'quarter_timeline',\r\n x_unit: 'week',\r\n x_date: '%M, W %W',\r\n x_step: 1,\r\n x_size: 15,\r\n x_start: 0,\r\n x_length: 14,\r\n second_scale: {\r\n x_unit: 'month',\r\n x_date: '%F', // date format which should be used for second scale, \"July 01\"\r\n },\r\n // sections of the view (titles of Y-Axis)\r\n ...{\r\n ...s,\r\n column_width: 70,\r\n },\r\n });\r\n scheduler.createTimelineView({\r\n name: 'year_timeline',\r\n x_unit: 'month',\r\n x_date: '%M',\r\n x_step: 1,\r\n x_size: 12,\r\n x_start: 0,\r\n x_length: 12,\r\n second_scale: {\r\n x_unit: 'year',\r\n x_date: '%Y',\r\n },\r\n // sections of the view (titles of Y-Axis)\r\n ...{\r\n ...s,\r\n column_width: 70,\r\n },\r\n });\r\n return;\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { scheduler_services_collection_name } from './serverListUtils';\r\nimport { scheduleServiceTemplate } from './renderServiceLabel';\r\n\r\nexport function createUnitsView(scheduler: DHTMLX.SchedulerStatic) {\r\n const sharedSettings = {\r\n property: 'service_id',\r\n y_property: 'service_id',\r\n list: scheduler.serverList(scheduler_services_collection_name),\r\n };\r\n const unitsName = 'day_unit';\r\n scheduler.createUnitsView({\r\n ...sharedSettings,\r\n name: unitsName,\r\n days: 1,\r\n xy: {\r\n scale_height: 70,\r\n },\r\n });\r\n // sets the render template for unit header\r\n // https://docs.dhtmlx.com/scheduler/api__scheduler_%7Bunitsname%7D_scale_text_template.html\r\n scheduler.templates[`${unitsName}_scale_text`] = function (\r\n _key,\r\n _label,\r\n unit,\r\n _date,\r\n ) {\r\n return scheduleServiceTemplate(unit);\r\n };\r\n}\r\n","import {\r\n scheduleImageClassName,\r\n scheduleServiceContainerClassName,\r\n scheduleServiceIdAttributeName,\r\n} from './renderServiceLabel';\r\nimport { findParentTarget } from './findParentTarget';\r\n\r\n/**\r\n * Locates the service label container click and extracts service id from the click event\r\n * @param event scheduler click event\r\n * @returns service id if present\r\n */\r\nexport function getServiceIdFromServiceClickEvent(event: MouseEvent) {\r\n // check if the click target is a service label rendered in the timeline section\r\n const containerClassName = `.${scheduleServiceContainerClassName}`;\r\n const imageClassName = `.${scheduleImageClassName}`;\r\n var serviceContainer = findParentTarget(event, [\r\n containerClassName,\r\n imageClassName,\r\n ]);\r\n if (serviceContainer === null) {\r\n return undefined;\r\n }\r\n\r\n var serviceIdAttributeValue = serviceContainer.getAttribute(\r\n scheduleServiceIdAttributeName,\r\n );\r\n if (serviceIdAttributeValue === null) {\r\n return undefined;\r\n }\r\n\r\n var serviceId = parseInt(serviceIdAttributeValue);\r\n if (isNaN(serviceId)) {\r\n return undefined;\r\n } else {\r\n return serviceId;\r\n }\r\n}\r\n","import {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nconst url = '/api/odata/v4/InvoiceTemplateFilter';\r\nexport interface InvoiceTemplatePickerProps\r\n extends Omit>, 'url'> {}\r\n\r\nexport const InvoiceTemplatePicker = (props: InvoiceTemplatePickerProps) => {\r\n return (\r\n \r\n );\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { InvoiceDetailActions as actions } from '.';\r\n\r\nexport function* doGetInvoice(action: PayloadAction) {\r\n yield put(actions.setLoading(true));\r\n try {\r\n const invoice = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/InvoiceDetails(' + action.payload + ')',\r\n {\r\n $expand: 'ServiceGroups',\r\n },\r\n );\r\n yield put(actions.setInvoice(invoice));\r\n yield put(actions.setLoading(false));\r\n } catch {\r\n yield put(actions.notFound());\r\n }\r\n}\r\n\r\nexport function* InvoiceDetailsSaga() {\r\n yield takeLatest(actions.getInvoice.type, doGetInvoice);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { IInvoice } from '../ReadOnly/IInvoice';\r\nimport { InvoiceDetailsSaga } from './saga';\r\nimport { InvoiceDetailsState } from './type';\r\n\r\nexport const initialState: InvoiceDetailsState = {\r\n loading: false,\r\n notFound: false,\r\n invoice: null,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'InvoiceDetails',\r\n initialState,\r\n reducers: {\r\n setLoading(state, action: PayloadAction) {\r\n state.loading = action.payload;\r\n },\r\n notFound(state, action: PayloadAction) {\r\n state.notFound = true;\r\n },\r\n setFilters(state, action: PayloadAction | undefined>) {\r\n state.filters = action.payload;\r\n },\r\n setInvoice(state, action: PayloadAction) {\r\n state.invoice = action.payload;\r\n },\r\n getInvoice(state, action: PayloadAction) {},\r\n reset(state, action: PayloadAction) {\r\n state.filters = undefined;\r\n state.notFound = false;\r\n state.loading = false;\r\n state.invoice = null;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: InvoiceDetailActions } = slice;\r\n\r\nexport const useInvoiceDetailsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: InvoiceDetailsSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n return state.InvoiceDetails || initialState;\r\n};\r\n\r\nexport const selectLoading = createSelector(\r\n [selectSlice],\r\n state => state.loading,\r\n);\r\nexport const selectNotFound = createSelector(\r\n [selectSlice],\r\n state => state.notFound,\r\n);\r\nexport const selectActiveFilters = createSelector(\r\n [selectSlice],\r\n state => state.filters,\r\n);\r\nexport const selectInvoice = createSelector(\r\n [selectSlice],\r\n state => state.invoice,\r\n);\r\n","import { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useMemo } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { Comments } from 'app/components/Comments';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport const InvoiceComments = () => {\r\n const invoice = useSelector(selectInvoice);\r\n const { onCommentAdded } = useUploadToNewComment();\r\n\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const isAdmin = useMemo(() => {\r\n return authenticatedUser?.Roles.includes(Roles.Administrators);\r\n }, [authenticatedUser]);\r\n const referenceId = invoice?.Id;\r\n const link = useAbsolute(`Invoices/Details/${referenceId}`);\r\n if (isAdmin === undefined || referenceId === undefined) {\r\n return null;\r\n }\r\n return (\r\n \r\n );\r\n};\r\n","import { makeStyles } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles(theme => ({\r\n base: {\r\n border: `solid 1px ${theme.palette.divider}`,\r\n borderRadius: '6px',\r\n padding: 'inherit',\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n gap: '10px',\r\n },\r\n}));\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BasicDialog } from 'app/components/BasicDialog';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { InvoiceStatuses } from 'enums/InvoiceStatuses';\r\nimport { Form, Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { uniqueId } from 'lodash';\r\nimport { useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { useStyles } from './styles';\r\nimport * as yup from 'yup';\r\nimport { removeHtml } from 'utils/string-utils';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { InvoiceDetailsUrl } from '..';\r\nimport { useInvoiceDetailsSlice } from '../Slice';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Body } from 'app/components/Typography';\r\n\r\nexport const InvoiceInReview = () => {\r\n const invoice = useSelector(selectInvoice);\r\n const { actions } = useInvoiceDetailsSlice();\r\n const { actions: notifActions } = useAppSettingsSlice();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const [open, setOpen] = useState(false);\r\n const submitForm = useRef();\r\n if (!invoice || invoice.StatusId !== InvoiceStatuses.SentToReview)\r\n return <>;\r\n const admin =\r\n authenticatedUser?.Roles.includes(Roles.Administrators) ||\r\n (authenticatedUser?.Roles.includes(Roles.GroupAdministrators) &&\r\n authenticatedUser.UserGroups.some(g => g.Id === invoice.UserGroupId));\r\n const schema: yup.SchemaOf<{ Text: string }> = yup.object({\r\n Text: yup\r\n .string()\r\n .test({\r\n name: 'not empty p',\r\n test: s => s !== undefined && removeHtml(s).trim() !== '',\r\n message: 'Text is required',\r\n })\r\n .required(),\r\n });\r\n\r\n return (\r\n \r\n {t(translations.InvoiceInReviewMessage)}\r\n {admin && (\r\n <>\r\n {\r\n httpClient\r\n .post(InvoiceDetailsUrl + '/UpdateStatus', {\r\n status: InvoiceStatuses.ReviewApproved,\r\n id: invoice.Id,\r\n })\r\n .then(() => {\r\n dispatch(actions.getInvoice(invoice.Id));\r\n dispatch(\r\n notifActions.addNotification({\r\n variant: 'success',\r\n message: t(translations.InvoiceApprovedMsg),\r\n }),\r\n );\r\n })\r\n .catch(e => console.log(e));\r\n }}\r\n size=\"small\"\r\n variant=\"white\"\r\n >\r\n {t(translations.Approve)}\r\n \r\n \r\n {\r\n CommentsApi.SendComment(\r\n CommentReferenceTypes.Invoice,\r\n invoice.Id,\r\n {\r\n Text:\r\n t(translations.InvoiceRejectReasonPrefix) + value.Text,\r\n },\r\n )\r\n .then(() => {\r\n httpClient\r\n .post(InvoiceDetailsUrl + '/UpdateStatus', {\r\n status: InvoiceStatuses.ReviewRejected,\r\n id: invoice.Id,\r\n })\r\n .then(() => {\r\n dispatch(actions.getInvoice(invoice.Id));\r\n })\r\n .catch(e => console.log(e));\r\n })\r\n .catch(console.error);\r\n setOpen(false);\r\n }}\r\n validationSchema={schema}\r\n >\r\n {formik => {\r\n submitForm.current = formik.submitForm;\r\n return (\r\n
    \r\n \r\n \r\n \r\n
    \r\n );\r\n }}\r\n \r\n }\r\n id={uniqueId()}\r\n isopen={open}\r\n onClose={() => setOpen(false)}\r\n onCancel={() => setOpen(false)}\r\n leftActions={[\r\n () => (\r\n \r\n ),\r\n ]}\r\n rightActions={[\r\n () => (\r\n \r\n ),\r\n ]}\r\n />\r\n \r\n )}\r\n
    \r\n );\r\n};\r\n","import { makeStyles, Theme } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n base: {\r\n paddingInline: theme.spacing(2),\r\n },\r\n}));\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { RichTextEditor } from 'app/components/RichTextEditor';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useStyles } from '../ReadOnly/styles';\r\nimport { selectInvoice } from '../Slice/selector';\r\nconst url = '/api/odata/v4/InvoiceDetails';\r\nexport const InvoiceRemarks = () => {\r\n const classes = useStyles();\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n\r\n const invoice = useSelector(selectInvoice);\r\n const [remarks, setRemarks] = useState(invoice?.Remarks);\r\n if (!invoice) return null;\r\n const updateRemarks = () => {\r\n httpClient\r\n .patch(url + '(' + invoice.Id + ')', { Remarks: remarks })\r\n .then(() =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: t(translations.UpdatedOK),\r\n }),\r\n ),\r\n )\r\n .catch(e =>\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: t(translations.UpdateFailed),\r\n }),\r\n ),\r\n );\r\n };\r\n return (\r\n \r\n {t(translations.Remarks)}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n};\r\n","import { Grid } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { getRows } from './Rows';\r\nimport { useStyles } from './styles';\r\n\r\nexport interface InvoiceReadOnlyProps {\r\n id: number;\r\n openChangeStatus?: () => void;\r\n openChangeInvoiceTemplate?: () => void;\r\n}\r\nexport const ReadOnlyDetails = (props: InvoiceReadOnlyProps) => {\r\n const { id, openChangeStatus, openChangeInvoiceTemplate } = props;\r\n const { t } = useTranslation();\r\n const invoice = useSelector(selectInvoice);\r\n const settings = useSelector(selectglobalSettings);\r\n const rows = useMemo(\r\n () => getRows(t, settings, openChangeStatus, openChangeInvoiceTemplate),\r\n [openChangeStatus, openChangeInvoiceTemplate, settings, t],\r\n );\r\n const classes = useStyles();\r\n\r\n if (!invoice) {\r\n return <>{t(translations.InvoiceNotFound).replace('{0}', id.toString())};\r\n }\r\n\r\n return (\r\n \r\n \r\n {rows.map(r => {\r\n const cell = r.Cell ?? (({ value }) => <>{value});\r\n const val = cell({ original: invoice, value: invoice[r.accessor] });\r\n if (val) {\r\n const header =\r\n typeof r.Header === 'string'\r\n ? () => (\r\n \r\n {r.Header}\r\n \r\n )\r\n : r.Header;\r\n return (\r\n \r\n \r\n {header && (\r\n \r\n {header({\r\n original: invoice,\r\n value: invoice[r.accessor],\r\n })}\r\n \r\n )}\r\n \r\n {val}\r\n \r\n \r\n \r\n );\r\n }\r\n return undefined;\r\n })}\r\n \r\n \r\n );\r\n};\r\n","import { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { DetailRowRenderer } from 'types/DetailRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { IInvoice } from './IInvoice';\r\n\r\nexport const getRows = (\r\n t: TFunction,\r\n settings: GlobalSettings,\r\n openChangeStatus?: () => void,\r\n openChangeInvoiceTemplate?: () => void,\r\n) => {\r\n const currency = settings.GetString(AllowedSettings.ISOCurrencySymbol);\r\n const res: DetailRowRenderer[] = [\r\n {\r\n Header: t(translations.InvoiceId),\r\n accessor: 'Id',\r\n },\r\n {\r\n accessor: 'Amount',\r\n Header: t(translations.Amount),\r\n Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)},\r\n },\r\n {\r\n accessor: 'Balance',\r\n Header: t(translations.InvoiceBalance),\r\n Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)},\r\n },\r\n {\r\n accessor: 'ServiceGroups',\r\n Header: t(translations.ServiceGroup),\r\n Cell: ({ value }) => (\r\n \r\n {value.map(v => (\r\n
  • {v.Name}
  • \r\n ))}\r\n \r\n }\r\n arrow\r\n >\r\n \r\n {value\r\n .slice(0, 3)\r\n .map(v => v.Name)\r\n .join(',')}\r\n {value.length > 3 && , {value.length - 3} more}\r\n \r\n \r\n ),\r\n },\r\n {\r\n accessor: 'UserGroup',\r\n Header: t(translations.UserGroup),\r\n Cell: attrib => (\r\n <>{!!attrib.original.UserGroupId ? attrib.value : t(translations.NA)}\r\n ),\r\n },\r\n {\r\n accessor: 'BudgetNumber',\r\n Header: t(translations.BudgetNumber),\r\n Cell: attrib => (\r\n <>{!!attrib.original.BudgetId ? attrib.value : t(translations.NA)}\r\n ),\r\n },\r\n {\r\n accessor: 'StatusName',\r\n Header: () => (\r\n <>\r\n {' '}\r\n {t(translations.Status)}{' '}\r\n {!!openChangeStatus ? (\r\n \r\n ) : undefined}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'CreatedBy',\r\n Header: t(translations.CreatedBy),\r\n },\r\n {\r\n accessor: 'CreatedAt',\r\n Header: t(translations.CreatedAt),\r\n Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)},\r\n },\r\n {\r\n accessor: 'InvoiceTemplateName',\r\n Header: () => (\r\n <>\r\n {' '}\r\n {t(translations.InvoiceTemplate)}{' '}\r\n {!!openChangeInvoiceTemplate ? (\r\n \r\n ) : undefined}\r\n \r\n ),\r\n Cell: attrib => (\r\n <>\r\n {!!attrib.original.InvoiceTemplateId\r\n ? attrib.value\r\n : `Invoice #${attrib.original.Id} is missing a template`}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'Start',\r\n Header: t(translations.Period),\r\n Cell: ({ original }) => (\r\n <>\r\n {dateUtils.shortDateFormat(original.Start)} -{' '}\r\n {dateUtils.shortDateFormat(\r\n dateUtils.addDays(dateUtils.dateOrStringToDate(original.End), -1),\r\n )}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'LastSentToBilling',\r\n Header: t(translations.LastSentToBilling),\r\n Cell: ({ value }) => (\r\n <>\r\n {!!value ? dateUtils.shortDateTimeFormat(value) : t(translations.NA)}\r\n \r\n ),\r\n },\r\n ];\r\n return res;\r\n};\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport UserRenderer from 'app/components/BasicTable/CellRenderers/UserRenderer';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { PriceSheetBy } from 'enums/enums';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport {\r\n AppSettings,\r\n IsBudgetFieldEnabled,\r\n IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { IInvoiceRow } from './IInvoicRow';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { InvoiceRowReferenceLinks } from 'app/components/InvoiceRowReferenceLinks';\r\n\r\nconst hasSubRows = row => {\r\n return !!row.original.Rows && row.original.Rows.length > 1;\r\n};\r\n\r\nexport const getColumns = (\r\n t: TFunction,\r\n settings: GlobalSettings,\r\n appsettings: AppSettings | null,\r\n openEdit?: (id: number) => void,\r\n useSidePanel?: boolean,\r\n) => {\r\n const currency = settings.GetString(AllowedSettings.ISOCurrencySymbol);\r\n const cols: (Column & { invisible?: boolean })[] = [\r\n {\r\n accessor: 'Id',\r\n Header: t(translations.HashSymbol) as string,\r\n Cell: ({ value }) => {\r\n return !openEdit ? (\r\n <>{value}\r\n ) : (\r\n openEdit(value)}>{value}\r\n );\r\n },\r\n },\r\n {\r\n accessor: 'BudgetCat',\r\n Header: t(translations.BudgetCat) as string,\r\n invisible:\r\n !IsModuleEnabled(appsettings, KnownModules.BudgetCats) &&\r\n settings.TryGet('PriceSheetBy') !== null &&\r\n parseInt(\r\n settings.TryGet('PriceSheetBy') ??\r\n PriceSheetBy.InstrumentsAndServices.toString(),\r\n ) === PriceSheetBy.InstrumentsAndServices,\r\n },\r\n {\r\n accessor: 'Budget',\r\n Header: t(translations.Budget) as string,\r\n invisible: !IsModuleEnabled(appsettings, KnownModules.Budgets),\r\n },\r\n {\r\n Header: t(translations.PurchaseOrder) as string,\r\n accessor: 'PurchaseOrder',\r\n },\r\n {\r\n accessor: 'Task',\r\n Header: t(translations.Task) as string,\r\n invisible: !IsModuleEnabled(appsettings, KnownModules.BudgetExperiments),\r\n },\r\n {\r\n accessor: 'Experiment',\r\n Header: t(translations.Experiment) as string,\r\n invisible: !IsModuleEnabled(appsettings, KnownModules.BudgetExperiments),\r\n },\r\n {\r\n accessor: 'User',\r\n Header: t(translations.User) as string,\r\n Cell: UserRenderer,\r\n },\r\n {\r\n accessor: 'InstrumentCat',\r\n Header: t(translations.InstrumentCat) as string,\r\n invisible:\r\n parseInt(\r\n settings.TryGet('PriceSheetBy') ??\r\n PriceSheetBy.InstrumentsAndServices.toString(),\r\n ) === PriceSheetBy.InstrumentsAndServices,\r\n },\r\n {\r\n accessor: 'EquipmentService',\r\n Header: t(translations.EquipmentService) as string,\r\n },\r\n /* {\r\n accessor: 'OnlineService',\r\n Header: t(translations.EquipmentService) as string,\r\n Cell: ({ row }) => {\r\n const vals = [\r\n row.original.OnlineService,\r\n row.original.SampleService,\r\n row.original.OfflineServiceType,\r\n row.original.AccService,\r\n row.original.SubscriptionName,\r\n ];\r\n if (\r\n !!row.original.ServiceRequestMilestoneChargeId &&\r\n !row.original.OfflineServiceType\r\n ) {\r\n vals.push(t(translations.Charges) as string);\r\n }\r\n return vals.filter(v => !!v).join(' - ');\r\n },\r\n }, */\r\n {\r\n accessor: 'Date',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'CatRateType',\r\n Header: t(translations.FeeType) as string,\r\n Cell: ({ row, value }) => {\r\n if (hasSubRows(row)) return <>{t(translations.Mixed)};\r\n return (\r\n <>\r\n {value +\r\n (!!row.original.TimeSlotType\r\n ? '(' + row.original.TimeSlotType + ')'\r\n : '')}\r\n \r\n );\r\n },\r\n },\r\n {\r\n accessor: 'Quantity',\r\n Header: t(translations.Quantity) as string,\r\n Cell: ({ row, value }) => {\r\n if (hasSubRows(row)) return <>{t(translations.Mixed)};\r\n return <>{value};\r\n },\r\n },\r\n {\r\n accessor: 'Units',\r\n Header: t(translations.Units) as string,\r\n Cell: ({ row, value }) => {\r\n if (hasSubRows(row)) return <>{t(translations.Mixed)};\r\n return <>{value};\r\n },\r\n },\r\n {\r\n accessor: 'BaseRate',\r\n Header: t(translations.BaseRate) as string,\r\n Cell: ({ value, row }) => {\r\n if (hasSubRows(row)) return <>{t(translations.Mixed)};\r\n return <>{currency + (value ?? 0).toFixed(2)};\r\n },\r\n },\r\n {\r\n accessor: 'SubsProfPercentage',\r\n Header: t(translations.SubsProfPercentage) as string,\r\n Cell: ({ value, row }) => {\r\n if (hasSubRows(row)) {\r\n return t(translations.Mixed);\r\n } else if (value === null || value === undefined) {\r\n return t(translations.NA);\r\n } else {\r\n return value.toFixed(2) + '%';\r\n }\r\n },\r\n invisible: !IsBudgetFieldEnabled(appsettings, BudgetFields.SubsidyProfit),\r\n },\r\n {\r\n accessor: 'ActualRate',\r\n Header: t(translations.ActualRate) as string,\r\n Cell: ({ value, row }) => {\r\n if (hasSubRows(row)) return <>{t(translations.Mixed)};\r\n return <>{currency + (value ?? 0).toFixed(2)};\r\n },\r\n invisible: !IsBudgetFieldEnabled(appsettings, BudgetFields.SubsidyProfit),\r\n },\r\n {\r\n accessor: 'Amount',\r\n Header: t(translations.Amount) as string,\r\n Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)},\r\n },\r\n {\r\n accessor: 'InsertedAt',\r\n Header: (\r\n \r\n {t(translations.InsertedAt)}\r\n \r\n ),\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'InsertedBy',\r\n Header: (\r\n \r\n {t(translations.InsertedBy)}\r\n \r\n ),\r\n Cell: ({ value, row }) => {\r\n if (value && row.original.InsertedBy) {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n }\r\n return <>{value};\r\n },\r\n },\r\n {\r\n accessor: 'ServiceGroupName',\r\n Header: (\r\n \r\n {t(translations.ServiceGroup)}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'ReservationId',\r\n Header: t(translations.Reference) as string,\r\n // Cell: InvoiceRowReferenceRenderer,\r\n Cell: ({ value, row }) => (\r\n \r\n ),\r\n },\r\n {\r\n Header: t(translations.Remarks) as string,\r\n accessor: 'Remarks',\r\n Cell: DescriptionCell({ width: 'medium' }),\r\n },\r\n ];\r\n return cols.filter(v => !v.invisible) as Column[];\r\n};\r\n","import { SampleTypePicker } from 'app/components/pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport function SampleTypeFilter(props: IFilterComponentProps) {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { SampleTypeFilter } from 'app/components/BasicTable/Filters/SampleTypeFilter';\r\nimport ServiceFilter from 'app/components/BasicTable/Filters/ServiceFilter';\r\nimport ServiceGroupFilter from 'app/components/BasicTable/Filters/ServiceGroupFilter';\r\nimport ServiceTypeFilter from 'app/components/BasicTable/Filters/ServiceTypeFilter';\r\nimport UserFilter from 'app/components/BasicTable/Filters/UserFilter';\r\nimport {\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetStringOrUndefined,\r\n initExPickerValue,\r\n initPickerValue,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { initSampleTypeData } from 'app/components/pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { initServiceTypeData } from 'app/components/pickers/AutocompletePickers/ServiceTypePicker';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { initOnlineServicesData } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { initServiceGroupsData } from 'app/components/pickers/ServiceGroupPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IInvoiceRow } from './Details/IInvoicRow';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const res: IFilterSettings[] = [\r\n {\r\n displayName: t(translations.ServiceGroup),\r\n queryStringSerializer: 'sgid',\r\n fieldName: 'ServiceGroupId',\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'sgid')),\r\n ),\r\n component: ServiceGroupFilter,\r\n initData: initExPickerValue(initServiceGroupsData),\r\n },\r\n {\r\n fieldName: 'OnlineServiceId',\r\n queryStringSerializer: 'osid',\r\n displayName: t(translations.OnlineService),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'osid')),\r\n ),\r\n component: ServiceFilter,\r\n initData: initPickerValue(initOnlineServicesData),\r\n },\r\n {\r\n fieldName: 'OfflineServiceTypeId',\r\n queryStringSerializer: 'ostid',\r\n displayName: t(translations.OfflineServiceType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'ostid')),\r\n ),\r\n component: ServiceTypeFilter,\r\n initData: initPickerValue(initServiceTypeData),\r\n },\r\n {\r\n fieldName: 'SampleServiceId',\r\n queryStringSerializer: 'ssid',\r\n displayName: t(translations.SampleType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'ssid')),\r\n ),\r\n component: SampleTypeFilter,\r\n initData: initPickerValue(initSampleTypeData),\r\n },\r\n {\r\n fieldName: 'UserId',\r\n queryStringSerializer: 'user',\r\n displayName: t(translations.User),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'user')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n },\r\n {\r\n fieldName: 'Date',\r\n displayName: t(translations.RG_DatePeriod),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'Amount',\r\n displayName: t(translations.ShowZeroAmountRows),\r\n queryStringSerializer: 'showZeroAmountRows',\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'showZeroAmountRows')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n customFilter: (value, setting) => {\r\n if (!!value && value['Id'] === true) {\r\n return 'true';\r\n }\r\n return new Condition(\r\n setting.fieldName,\r\n ODataOperators.NotEquals,\r\n 0,\r\n ).toString();\r\n },\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { toQueryString } from 'utils/url-utils';\r\n\r\nexport const getDefaultFilter = () => {\r\n const result = toQueryString({\r\n showZeroAmountRows: false,\r\n });\r\n return result;\r\n};\r\n","import * as React from 'react';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { IInvoiceRow } from './IInvoicRow';\r\n// import { UnconfigurableTable } from '../UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from '../Filter';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { BudgetPicker } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BasicTable } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { selectInvoice } from '../../Slice/selector';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { getDefaultFilter } from './getDefaultFilters';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\n\r\nexport interface InvoiceDetailsTableProps {\r\n isSidePanel?: boolean;\r\n id: number;\r\n setFilters?: (\r\n appliedFilters: IFilterSettings[] | undefined,\r\n ) => void;\r\n OpenEditRow?: (rowId: number) => void;\r\n}\r\nconst url = '/api/odata/v4/InvoiceRows';\r\nconst groupedUrl = '/api/odata/v4/GroupedInvoiceRows';\r\nexport const DetailsTable = ({\r\n isSidePanel,\r\n id,\r\n setFilters,\r\n OpenEditRow,\r\n}: InvoiceDetailsTableProps) => {\r\n const TTable = useMemo(\r\n () =>\r\n filterHandler(BasicTable, GetFilters, {\r\n isSidePanel,\r\n setFilters,\r\n getDefaultFilter,\r\n reservedQueryStringParameterNames: ['id', 'invoiceId'],\r\n }),\r\n [isSidePanel, setFilters],\r\n );\r\n const invoice = useSelector(selectInvoice);\r\n const [budget, setBudget] = React.useState | null>(null);\r\n\r\n // const rowActions: CellRenderer[] = [\r\n // !!OpenEditRow\r\n // ? ({ row: { original } }) => (\r\n // OpenEditRow(original.Id)}\r\n // >\r\n // \r\n // \r\n // \r\n // ,\r\n // ]}\r\n // />\r\n // )\r\n // : undefined,\r\n // ].filter(v => !!v) as CellRenderer[];\r\n const { t } = useTranslation();\r\n const settings = useSelector(selectglobalSettings);\r\n const appSettings = useSelector(selectAppSettings);\r\n const columns = useMemo(() => {\r\n return getColumns(t, settings, appSettings, OpenEditRow, isSidePanel);\r\n }, [OpenEditRow, appSettings, isSidePanel, settings, t]);\r\n const rowActions: CellRenderer[] = useMemo<\r\n CellRenderer[]\r\n >(\r\n () => [\r\n ({ row }) => {\r\n const items: RowActionsProps[] = [];\r\n if (!!OpenEditRow) {\r\n items.push({\r\n onClick: () => {\r\n OpenEditRow(row.original.Id);\r\n },\r\n text: t(translations.Edit) as string,\r\n title: t(translations.EditInvoiceLine) as string,\r\n icon: 'pencil-alt',\r\n } as RowActionsProps);\r\n }\r\n\r\n if (items.length > 0) {\r\n return (\r\n \r\n );\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n ],\r\n [OpenEditRow, t],\r\n );\r\n const selectedRowActions: SelectedRowsActionRenderer[] = useMemo(\r\n () => [\r\n (rows, onRefresh) => (\r\n \r\n await httpClient.post(url + '/DeleteMany', {\r\n invoiceId: id,\r\n ids: rows.map(v => v.Id),\r\n })\r\n }\r\n />\r\n ),\r\n (rows, onRefresh, toggleAll) => (\r\n setBudget(val)}\r\n variant=\"filled\"\r\n fullWidth\r\n predicates={[\r\n invoice?.UserGroupId\r\n ? new Condition(\r\n 'UserGroupId',\r\n ODataOperators.Equals,\r\n invoice.UserGroupId,\r\n )\r\n : '',\r\n new Condition('Active', ODataOperators.Equals, true),\r\n invoice?.ServiceGroups\r\n ? '(' +\r\n new Condition(\r\n 'ServiceGroupServicesAllowed',\r\n ODataOperators.Equals,\r\n true,\r\n ).toString() +\r\n ' or ' +\r\n new Condition(\r\n 'ServiceGroupIds',\r\n ODataOperators.AnyIn,\r\n invoice.ServiceGroups,\r\n ).toString() +\r\n ')'\r\n : '',\r\n ]}\r\n />\r\n }\r\n confirmTitle={\r\n <>\r\n {t(translations.EditBudgetInvoiceRows)} \r\n \r\n \r\n \r\n \r\n }\r\n confirmButtonLabel={t(translations.Change)}\r\n validConfirm={!!budget}\r\n action={async () => {\r\n setBudget(null);\r\n toggleAll(false);\r\n return await httpClient.post(url + '/UpdateBudget', {\r\n invoiceId: id,\r\n ids: rows.map(v => v.Id),\r\n budgetId: budget?.Id ?? 0,\r\n });\r\n }}\r\n />\r\n ),\r\n ],\r\n [budget, id, invoice, t],\r\n );\r\n /**\r\n * Each row in the table should have a unique Id including the parent and sub rows.\r\n * InvoiceId (Id) can be used on subrows as they are unique, for parent grouped row the grouping key can be used as a unique id provided the goruping is done on exact the same columns\r\n */\r\n const getRowId = React.useCallback(\r\n (row: IInvoiceRow) =>\r\n row.Rows !== undefined && row.Rows.length > 1\r\n ? [\r\n row.ReferenceId,\r\n row.User,\r\n row.UserId,\r\n row.OnlineService,\r\n row.OnlineServiceId,\r\n row.SampleService,\r\n row.SampleServiceId,\r\n row.SubscriptionId,\r\n row.SubscriptionName,\r\n ].join('.')\r\n : String(row.Id),\r\n [],\r\n );\r\n const [isGrouped, setIsGrouped] = React.useState(false);\r\n const api: IPathAndQuery = isGrouped\r\n ? {\r\n path: groupedUrl,\r\n search: {\r\n Id: id,\r\n $expand:\r\n 'Rows($select=' +\r\n [\r\n ...columns\r\n ?.filter(c => typeof c.accessor === 'string')\r\n ?.filter(c => c.accessor !== undefined)\r\n ?.map(c => c.accessor as keyof IInvoiceRow),\r\n ...[\r\n 'UserId',\r\n 'SampleService',\r\n 'OfflineServiceType',\r\n 'AccService',\r\n 'SubscriptionName',\r\n 'ServiceRequestMilestoneChargeId',\r\n 'TimeSlotType',\r\n 'ReservationId',\r\n 'OfflineServiceId',\r\n 'ServiceRequestId',\r\n 'UsageId',\r\n 'SubscriptionId',\r\n ],\r\n ].join(',') +\r\n ')',\r\n },\r\n }\r\n : {\r\n path: url,\r\n search: {\r\n Id: id,\r\n },\r\n };\r\n\r\n return (\r\n 0 ? rowActions : undefined}\r\n selectedRowsActions={selectedRowActions}\r\n pageActions={[\r\n () => (\r\n \r\n setIsGrouped(v => !v)}\r\n title={t(translations.GroupByReferenceDescription)}\r\n variant=\"ghost\"\r\n size=\"small\"\r\n >\r\n {isGrouped\r\n ? t(translations.DoNotGroupByReference)\r\n : t(translations.GroupByReference)}\r\n \r\n ,\r\n ]}\r\n />\r\n ),\r\n ]}\r\n additionalColumns={[\r\n 'UserId',\r\n 'SampleService',\r\n 'OfflineServiceType',\r\n 'AccService',\r\n 'SubscriptionName',\r\n 'ServiceRequestMilestoneChargeId',\r\n 'TimeSlotType',\r\n 'ReservationId',\r\n 'OfflineServiceId',\r\n 'ServiceRequestId',\r\n 'UsageId',\r\n 'SubscriptionId',\r\n 'InsertedByDisplay',\r\n ]}\r\n useRowSelect\r\n searchColumns={[\r\n 'Budget',\r\n 'OnlineService',\r\n 'OfflineServiceType',\r\n 'SampleService',\r\n 'CatRateType',\r\n 'TimeSlotType',\r\n 'User',\r\n 'cast(ReservationId,Edm.String)',\r\n 'cast(UsageId,Edm.String)',\r\n 'cast(OfflineServiceId,Edm.String)',\r\n 'cast(ServiceRequestId,Edm.String)',\r\n 'cast(Id,Edm.String)',\r\n ]}\r\n />\r\n );\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport interface InvoiceHistoryProps {\r\n invoiceId: number;\r\n}\r\nexport const InvoiceHistory = ({ invoiceId }: InvoiceHistoryProps) => {\r\n const { t } = useTranslation();\r\n const columns = useMemo(() => getColumns(t), [t]);\r\n const url = '/api/odata/v4/InvoiceHistory';\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst TTable = filterHandler(\r\n UnconfigurableTable,\r\n GetFilters,\r\n {\r\n isSidePanel: true,\r\n },\r\n);\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n const res: Column[] = [\r\n {\r\n accessor: 'InvoiceId',\r\n Header: t(translations.HashSymbol) as string,\r\n },\r\n {\r\n accessor: 'FieldName',\r\n Header: t(translations.Field) as string,\r\n },\r\n {\r\n accessor: 'OldValue',\r\n Header: t(translations.OldValue) as string,\r\n },\r\n {\r\n accessor: 'NewValue',\r\n Header: t(translations.NewValue) as string,\r\n },\r\n {\r\n accessor: 'DisplayName',\r\n Header: t(translations.User) as string,\r\n },\r\n {\r\n accessor: 'UpdatedAt',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetRawValue,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const res: IFilterSettings[] = [\r\n {\r\n fieldName: 'UpdatedAt',\r\n displayName: t(translations.Period),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'InvoiceId',\r\n queryStringSerializer: 'rowId',\r\n displayName: t(translations.InvoiceId),\r\n operator: ODataOperators.Equals,\r\n value: GetNumberOrUndefined(GetRawValue(params, 'rowId')),\r\n component: NumberFieldFilter,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport interface InvoicePayHistoryProps {\r\n invoiceId: number;\r\n}\r\nexport const PayHistory = ({ invoiceId }: InvoicePayHistoryProps) => {\r\n const { t } = useTranslation();\r\n const columns = useMemo(() => getColumns(t), [t]);\r\n const url = '/api/odata/v4/InvoicePayHistory';\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst TTable = filterHandler(UnconfigurableTable, GetFilters, {\r\n isSidePanel: true,\r\n});\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { parse } from 'app/components/CommentsContainer/commentParser';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n const res: Column[] = [\r\n {\r\n accessor: 'InvoicePaymentId',\r\n Header: t(translations.HashSymbol) as string,\r\n },\r\n {\r\n accessor: 'FieldName',\r\n Header: t(translations.Field) as string,\r\n },\r\n {\r\n accessor: 'OldValue',\r\n Header: t(translations.OldValue) as string,\r\n Cell: ({ value }) => {\r\n if (!value) return <>;\r\n return {parse(value)};\r\n },\r\n },\r\n {\r\n accessor: 'NewValue',\r\n Header: t(translations.NewValue) as string,\r\n Cell: ({ value }) => {\r\n if (!value) return <>;\r\n return {parse(value)};\r\n },\r\n },\r\n {\r\n accessor: 'DisplayName',\r\n Header: t(translations.User) as string,\r\n },\r\n {\r\n accessor: 'UpdatedAt',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetRawValue,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const res: IFilterSettings[] = [\r\n {\r\n fieldName: 'UpdatedAt',\r\n displayName: t(translations.Period),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'InvoicePaymentId',\r\n queryStringSerializer: 'payId',\r\n displayName: t(translations.InvoiceRowId),\r\n operator: ODataOperators.Equals,\r\n value: GetNumberOrUndefined(GetRawValue(params, 'payId')),\r\n component: NumberFieldFilter,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { IInvoicePayment } from './IInvoicePayment';\r\n\r\nexport interface PaymentTableProps {\r\n invoiceId: number;\r\n isSidePanel: boolean;\r\n pageActions?: PageActionRenderer[];\r\n openEditPayment?: (payId: number) => void;\r\n}\r\nconst url = '/api/odata/v4/InvoicePayments';\r\nexport const PaymentTable = ({\r\n invoiceId,\r\n pageActions,\r\n openEditPayment,\r\n}: PaymentTableProps) => {\r\n const { t } = useTranslation();\r\n const columns = useMemo(() => getColumns(t, openEditPayment), [\r\n openEditPayment,\r\n t,\r\n ]);\r\n const rowActions: CellRenderer[] = useMemo<\r\n CellRenderer[]\r\n >(\r\n () => [\r\n ({ row }) => {\r\n const items: RowActionsProps[] = [];\r\n if (!!openEditPayment) {\r\n items.push({\r\n onClick: () => {\r\n openEditPayment(row.original.Id);\r\n },\r\n text: t(translations.Edit) as string,\r\n title: t(translations.EditInvoicePayment) as string,\r\n icon: 'pencil-alt',\r\n } as RowActionsProps);\r\n }\r\n\r\n if (items.length > 0) {\r\n return (\r\n \r\n );\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n ],\r\n [openEditPayment, t],\r\n );\r\n const selectedRowActions: SelectedRowsActionRenderer<\r\n IInvoicePayment\r\n >[] = useMemo(\r\n () => [\r\n (rows, onRefresh) => (\r\n {\r\n try {\r\n await httpClient.post(url + '/DeleteMany', {\r\n invoiceId,\r\n ids: rows.map(v => v.Id),\r\n });\r\n return {\r\n SuccessMessages: [t(translations.PaymentsDelete_success)],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n } catch {\r\n return {\r\n SuccessMessages: [],\r\n WarningMessages: [],\r\n ErrorMessages: [t(translations.PaymentsDelete_err)],\r\n };\r\n }\r\n }}\r\n />\r\n ),\r\n ],\r\n [invoiceId, t],\r\n );\r\n return (\r\n 0 ? rowActions : undefined}\r\n searchColumns={[\r\n 'CreatedByDN',\r\n 'CreatedBy',\r\n 'PaymentMethodName',\r\n 'Remarks',\r\n 'Reference',\r\n ]}\r\n additionalColumns={['CreatedBy']}\r\n exportNotConfigurable={true}\r\n />\r\n );\r\n};\r\n","import parse from 'html-react-parser';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IInvoicePayment } from './IInvoicePayment';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\n\r\nexport const getColumns = (t: TFunction, openEdit?: (id: number) => void) => {\r\n const res: Column[] = [\r\n {\r\n accessor: 'Id',\r\n Header: t(translations.HashSymbol) as string,\r\n Cell: ({ value }) => {\r\n return !openEdit ? (\r\n <>{value}\r\n ) : (\r\n openEdit(value)}>{value}\r\n );\r\n },\r\n },\r\n {\r\n accessor: 'Date',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'Amount',\r\n Header: t(translations.Amount) as string,\r\n Cell: ({ value }) => <>{value.toFixed(2)},\r\n },\r\n {\r\n accessor: 'PaymentMethodName',\r\n Header: t(translations.PaymentMethod) as string,\r\n },\r\n {\r\n accessor: 'CreatedByDN',\r\n Header: t(translations.CreatedBy) as string,\r\n Cell: ({ row: { original }, value }) => (\r\n \r\n {value}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'CreatedAt',\r\n Header: t(translations.CreatedAt) as string,\r\n Cell: DateRenderer,\r\n },\r\n {\r\n accessor: 'Remarks',\r\n Header: t(translations.Remarks) as string,\r\n Cell: ({ value }) => (!!value ? <>{parse(value)} : <>),\r\n },\r\n {\r\n accessor: 'Reference',\r\n Header: t(translations.Reference) as string,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport interface InvoiceRowHistoryProps {\r\n invoiceId: number;\r\n}\r\nexport const RowHistory = ({ invoiceId }: InvoiceRowHistoryProps) => {\r\n const { t } = useTranslation();\r\n const columns = useMemo(() => getColumns(t), [t]);\r\n const url = '/api/odata/v4/InvoiceRowHistory';\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst TTable = filterHandler(UnconfigurableTable, GetFilters, {\r\n isSidePanel: true,\r\n});\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n const res: Column[] = [\r\n {\r\n accessor: 'InvoiceRowId',\r\n Header: t(translations.HashSymbol) as string,\r\n },\r\n {\r\n accessor: 'FieldName',\r\n Header: t(translations.Field) as string,\r\n },\r\n {\r\n accessor: 'OldValue',\r\n Header: t(translations.OldValue) as string,\r\n },\r\n {\r\n accessor: 'NewValue',\r\n Header: t(translations.NewValue) as string,\r\n },\r\n {\r\n accessor: 'DisplayName',\r\n Header: t(translations.User) as string,\r\n },\r\n {\r\n accessor: 'UpdatedAt',\r\n Header: t(translations.Date) as string,\r\n Cell: DateRenderer,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetRawValue,\r\n presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const res: IFilterSettings[] = [\r\n {\r\n fieldName: 'UpdatedAt',\r\n displayName: t(translations.Period),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'InvoiceRowId',\r\n queryStringSerializer: 'rowId',\r\n displayName: t(translations.InvoiceRowId),\r\n operator: ODataOperators.Equals,\r\n value: GetNumberOrUndefined(GetRawValue(params, 'rowId')),\r\n component: NumberFieldFilter,\r\n },\r\n ];\r\n return res;\r\n};\r\n","import { Dialog, DialogActions, DialogContent } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { NotFoundPage } from 'app/pages/NotFoundPage';\r\nimport { InvoiceStatusPicker } from 'app/components/pickers/AutocompletePickers/InvoiceStatusPicker';\r\nimport { InvoiceTemplatePicker } from 'app/components/pickers/AutocompletePickers/InvoiceTemplatePicker';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { buildURL, openExportLink, toRootedURL } from 'utils/url-utils';\r\nimport { ChargeProps } from '../AddChargePage';\r\nimport { PaymentProps } from '../AddPaymentPage';\r\nimport { InvoiceComments } from './InvoiceComments';\r\nimport { InvoiceInReview } from './InvoiceInReview';\r\nimport { InvoiceRemarks } from './InvoiceRemarks';\r\nimport { ReadOnlyDetails } from './ReadOnly';\r\nimport { useInvoiceDetailsSlice } from './Slice';\r\nimport {\r\n selectActiveFilters,\r\n selectInvoice,\r\n selectLoading,\r\n selectNotFound,\r\n} from './Slice/selector';\r\nimport { DetailsTable } from './Tables/Details';\r\nimport { IInvoiceRow } from './Tables/Details/IInvoicRow';\r\nimport { InvoiceHistory } from './Tables/InvoiceHistory';\r\nimport { PayHistory } from './Tables/PayHistory';\r\nimport { PaymentTable } from './Tables/Payments';\r\nimport { RowHistory } from './Tables/RowHistory';\r\nimport { InvoiceIdMultiPicker } from 'app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nconst url = '/api/odata/v4/InvoiceDetails';\r\nexport interface InvoiceDetailsProps extends CoverProps, SidePanelContentProps {\r\n id: number;\r\n}\r\nexport const InvoiceDetails = ({\r\n id,\r\n useSidePanel,\r\n closeCover,\r\n isCover,\r\n}: InvoiceDetailsProps) => {\r\n const { t } = useTranslation();\r\n const loading = useSelector(selectLoading);\r\n const notFound = useSelector(selectNotFound);\r\n const filters = useSelector(selectActiveFilters);\r\n const dispatch = useDispatch();\r\n const { actions } = useInvoiceDetailsSlice();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n const invoice = useSelector(selectInvoice);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const response = useResponseModel();\r\n const [deleteInvoiceOpen, setDeleteInvoiceOpen] = useState(false);\r\n const settings = useSelector(selectglobalSettings);\r\n const allowedFees = settings.GetString(AllowedSettings.AllowedFeeTypes);\r\n const isChargesAllowed = allowedFees && allowedFees.trim() !== '';\r\n useEffectOnMount(() => {\r\n dispatch(actions.reset());\r\n dispatch(actions.getInvoice(id));\r\n });\r\n const pagelink = useMemo(\r\n () => buildURL(`${publicUrl}Invoices/Details/${id}`, filters ?? {}),\r\n [filters, id, publicUrl],\r\n );\r\n const setfilterCallback = useCallback(\r\n (v: IFilterSettings[] | undefined) => {\r\n const res = {};\r\n if (!!v) {\r\n toURLSearchParams(v).forEach((val, name) => {\r\n res[name] = val;\r\n });\r\n }\r\n dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n },\r\n [actions, dispatch],\r\n );\r\n const [invoiceHistoryOpen, setInvoiceHistoryOpen] = useState(false);\r\n const [rowHistoryOpen, setRowHistoryOpen] = useState(false);\r\n const [payHistoryOpen, setPayHistoryOpen] = useState(false);\r\n const [updateStatusOpen, setUpdateStatusOpen] = useState(false);\r\n const [updateInvoiceTemplateOpen, setUpdateInvoiceTemplateOpen] = useState(\r\n false,\r\n );\r\n const [updateInvoiceIdsOpen, setUpdateInvoiceIdsOpen] = useState(false);\r\n // const [cover, setCover] = useState();\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState();\r\n const openNewCharge = useCallback(\r\n (chargProps: ChargeProps) => {\r\n openPanel({\r\n renderPageType: RenderPageType.AddCharge,\r\n renderPageProps: chargProps,\r\n expanded: false,\r\n useSidePanel: true,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n // if (isSidePanel) {\r\n // setCover(\r\n // setCover(undefined)}\r\n // isCover\r\n // {...props}\r\n // />,\r\n // );\r\n // } else {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: RenderPageType.AddCharge,\r\n // props,\r\n // }),\r\n // );\r\n // }\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n const openNewPayment = useCallback(\r\n (paymentProps: PaymentProps) => {\r\n openPanel({\r\n renderPageType: RenderPageType.AddPayment,\r\n renderPageProps: Object.assign({}, paymentProps, {\r\n userGroupId: invoice?.UserGroupId,\r\n }),\r\n expanded: false,\r\n useSidePanel: true,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n // if (isSidePanel) {\r\n // setCover(\r\n // setCover(undefined)}\r\n // isCover\r\n // userGroupId={invoice?.UserGroupId}\r\n // {...props}\r\n // />,\r\n // );\r\n // } else {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: RenderPageType.AddPayment,\r\n // props,\r\n // }),\r\n // );\r\n // }\r\n },\r\n [invoice?.UserGroupId, openPanel, useSidePanel],\r\n );\r\n const deletable = useMemo(() => !!invoice && !invoice.LastSentToBilling, [\r\n invoice,\r\n ]);\r\n const [newStatus, setNewStatus] = useState | null>(null);\r\n const [invoiceTemplate, setInvoiceTemplate] = useState | null>(\r\n null,\r\n );\r\n const [invoiceIds, setInvoiceIds] = useState[] | undefined>(\r\n undefined,\r\n );\r\n\r\n const deleteInvoice = useCallback(() => {\r\n if (deletable) {\r\n httpClient\r\n .delete(url + '(' + id + ')')\r\n .then((v: any) => {\r\n const value = v as IResponseType;\r\n if (value.ErrorMessages.length > 0) {\r\n response(value);\r\n } else {\r\n if (useSidePanel) {\r\n closePanel({\r\n useSidePanel: true,\r\n isCover: isCover,\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(appActions.navigate(toRootedURL('/Billing')));\r\n }\r\n }\r\n })\r\n .catch(e => console.warn(e));\r\n }\r\n }, [\r\n appActions,\r\n closePanel,\r\n deletable,\r\n dispatch,\r\n id,\r\n isCover,\r\n response,\r\n useSidePanel,\r\n ]);\r\n const updateStatus = useCallback(\r\n (status: number) => {\r\n httpClient\r\n .post(url + '/UpdateStatus', {\r\n status,\r\n id,\r\n })\r\n .then(() => {\r\n dispatch(actions.getInvoice(id));\r\n })\r\n .catch(e => console.log(e));\r\n },\r\n [actions, dispatch, id],\r\n );\r\n\r\n const updateInvoiceTemplate = useCallback(\r\n (invoiceTemplateId: number) => {\r\n httpClient\r\n .post(url + '/UpdateInvoiceTemplate', {\r\n invoiceTemplateId,\r\n id,\r\n })\r\n .then(() => {\r\n dispatch(actions.getInvoice(id));\r\n })\r\n .catch(e => console.log(e));\r\n },\r\n [actions, dispatch, id],\r\n );\r\n\r\n const handlePreview = () => {\r\n if (!!invoiceIds) {\r\n const ids: string = invoiceIds.map(item => item.Id).join(',');\r\n var params = {\r\n ids: ids,\r\n };\r\n //BillingController->InvoiceExportPDFs - [Route(\"api/Billing/Invoices/InvoiceExportPDFs\")]\r\n const url = buildURL('api/Billing/Invoices/InvoiceExportPDFs', params);\r\n openExportLink(url);\r\n setInvoiceIds([]);\r\n }\r\n };\r\n\r\n const topButtons: ActionRenderer[] = useMemo(\r\n () => [\r\n () => {\r\n if (!isChargesAllowed) return undefined;\r\n return (\r\n \r\n openNewCharge({\r\n invoiceId: id,\r\n budget:\r\n invoice && invoice.BudgetId\r\n ? { Id: invoice.BudgetId, Name: invoice.BudgetNumber }\r\n : null,\r\n serviceGroup:\r\n authenticatedUser?.Roles?.includes(\r\n Roles.ServiceGroupBudgetsAdmin,\r\n ) && authenticatedUser.AdminServiceGroups.length === 1\r\n ? authenticatedUser.AdminServiceGroups[0]\r\n : null,\r\n serviceGroupPredicate:\r\n invoice &&\r\n invoice.ServiceGroups &&\r\n invoice.ServiceGroups.length > 0\r\n ? [\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n invoice.ServiceGroups,\r\n ),\r\n ]\r\n : undefined,\r\n })\r\n }\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n setUpdateStatusOpen(true)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n setUpdateInvoiceTemplateOpen(true)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n setDeleteInvoiceOpen(true)}\r\n icon=\"trash\"\r\n startIcon=\"trash\"\r\n disabled={!deletable}\r\n size=\"small\"\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n setInvoiceHistoryOpen(true)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n setRowHistoryOpen(true)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n () => {\r\n return (\r\n {\r\n let invoiceIdEntity: Entity = {\r\n Id: id,\r\n Name: id.toString(),\r\n };\r\n !!invoiceIdEntity\r\n ? setInvoiceIds([invoiceIdEntity])\r\n : setInvoiceIds([]);\r\n setUpdateInvoiceIdsOpen(true);\r\n }}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n );\r\n },\r\n ],\r\n [\r\n authenticatedUser,\r\n isChargesAllowed,\r\n deletable,\r\n id,\r\n invoice,\r\n openNewCharge,\r\n t,\r\n ],\r\n );\r\n const paymentPageActions: PageActionRenderer[] = useMemo(\r\n () => [\r\n () => (\r\n \r\n openNewPayment({\r\n invoiceId: id,\r\n budget:\r\n invoice && invoice.BudgetId\r\n ? { Id: invoice.BudgetId, Name: invoice.BudgetNumber }\r\n : null,\r\n serviceGroup: null,\r\n serviceGroupPredicate:\r\n invoice &&\r\n invoice.ServiceGroups &&\r\n invoice.ServiceGroups.length > 0\r\n ? [\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n invoice.ServiceGroups,\r\n ),\r\n ]\r\n : undefined,\r\n })\r\n }\r\n />\r\n ),\r\n () => (\r\n setPayHistoryOpen(true)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n size=\"small\"\r\n />,\r\n ]}\r\n />\r\n ),\r\n ],\r\n [id, invoice, openNewPayment, t],\r\n );\r\n if (notFound) {\r\n return ;\r\n }\r\n return (\r\n {t(translations.Invoices)}\r\n }\r\n titlePage={`${t(translations.Invoices)} #${id}`}\r\n closable\r\n disableExpandToggle\r\n rightTopActions={topButtons}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n isCover={isCover}\r\n coverClosed={coverClosed}\r\n children={\r\n \r\n \r\n setUpdateStatusOpen(true)}\r\n openChangeInvoiceTemplate={() => setUpdateInvoiceTemplateOpen(true)}\r\n />\r\n \r\n openNewCharge({\r\n invoiceId: id,\r\n rowId: rowId,\r\n budget: null,\r\n serviceGroup: null,\r\n })\r\n }\r\n />\r\n {\r\n openNewPayment({\r\n invoiceId: id,\r\n paymentId: PayId,\r\n budget: null,\r\n serviceGroup: null,\r\n });\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n setNewStatus(v)}\r\n />\r\n }\r\n confirmButtonLabel={t(translations.UpdateInvoiceStatus)}\r\n onConfirm={() => {\r\n updateStatus(newStatus?.Id ?? -1);\r\n setUpdateStatusOpen(false);\r\n }}\r\n disabled={!newStatus}\r\n onCancel={() => setUpdateStatusOpen(false)}\r\n isOpen={updateStatusOpen}\r\n />\r\n setInvoiceTemplate(v)}\r\n />\r\n }\r\n confirmButtonLabel={t(translations.UpdateInvoiceTemplate)}\r\n onConfirm={() => {\r\n updateInvoiceTemplate(invoiceTemplate?.Id ?? -1);\r\n setUpdateInvoiceTemplateOpen(false);\r\n }}\r\n disabled={!invoiceTemplate}\r\n onCancel={() => setUpdateInvoiceTemplateOpen(false)}\r\n isOpen={updateInvoiceTemplateOpen}\r\n />\r\n setInvoiceIds(v)}\r\n />\r\n }\r\n confirmButtonLabel={t(translations.Preview)}\r\n onConfirm={() => {\r\n handlePreview();\r\n setUpdateInvoiceIdsOpen(false);\r\n }}\r\n onClose={() => setInvoiceIds([])}\r\n disabled={\r\n invoiceIds === null ||\r\n invoiceIds === undefined ||\r\n invoiceIds.length === 0\r\n }\r\n onCancel={() => {\r\n setUpdateInvoiceIdsOpen(false);\r\n setInvoiceIds([]);\r\n }}\r\n isOpen={updateInvoiceIdsOpen}\r\n />\r\n setDeleteInvoiceOpen(false)}\r\n disabled={!deletable}\r\n />\r\n \r\n }\r\n />\r\n );\r\n};\r\n\r\nexport const InvoiceDetailsUrl = url;\r\n","import { Box, MenuItem } from '@material-ui/core';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\nexport interface CloseWorkOrderButtonProps extends ButtonProps {\r\n text: string;\r\n closedStatuses: IWorkOrderTypeStatusDto[];\r\n handleClose: (e: any, status: IWorkOrderTypeStatusDto) => void;\r\n body?: string;\r\n}\r\nexport interface ReopenOrderButtonProps extends ButtonProps {\r\n text: string;\r\n handleOpen: (e: any) => void;\r\n}\r\nexport interface DeleteButtonProps extends ButtonProps {\r\n text: string;\r\n handleDelete: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function ReopenOrderButton({\r\n text,\r\n handleOpen,\r\n ...props\r\n}: ReopenOrderButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\nexport function DeleteOrderButton({\r\n text,\r\n handleDelete,\r\n ...props\r\n}: DeleteButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport function CloseWorkOrderButton({\r\n text,\r\n closedStatuses,\r\n handleClose,\r\n ...props\r\n}: CloseWorkOrderButtonProps) {\r\n //PROPS\r\n const { t } = useTranslation();\r\n\r\n //STATES\r\n const [open, setOpen] = React.useState(false);\r\n const [closedStatus, setClosedStatus] = React.useState<\r\n IWorkOrderTypeStatusDto | undefined\r\n >(undefined);\r\n const useOpen = React.useMemo(() => {\r\n return open;\r\n }, [open]);\r\n //RENDER\r\n return (\r\n \r\n {closedStatuses.length === 1 ? (\r\n {\r\n setOpen(true);\r\n setClosedStatus(closedStatuses[0]);\r\n }}\r\n >\r\n {text}\r\n \r\n ) : (\r\n \r\n closedStatuses.map(s => (\r\n \r\n {\r\n setOpen(true);\r\n setClosedStatus(s);\r\n }}\r\n >\r\n {s.Name}\r\n \r\n \r\n ))\r\n }\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'top',\r\n horizontal: 'center',\r\n },\r\n transformOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'center',\r\n },\r\n }}\r\n addChevron\r\n {...props}\r\n >\r\n {text}\r\n \r\n )}\r\n {useOpen && (\r\n {\r\n if (!!closedStatus) {\r\n handleClose(e, closedStatus);\r\n }\r\n }}\r\n onCancel={() => {\r\n setClosedStatus(undefined);\r\n setOpen(false);\r\n }}\r\n onClose={() => {\r\n setClosedStatus(undefined);\r\n setOpen(false);\r\n }}\r\n maxWidth=\"md\"\r\n />\r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { WorkOrderTypePicker } from '../pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\n\r\nexport const FormWorkOrderTypePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n disabled={props.disabled}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n predicates={props.predicates}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n IWorkOrderTypeStatusParamsPicker,\r\n WorkOrderTypeStatusPicker,\r\n} from '../pickers/AutocompletePickers/WorkOrderTypeStatusPicker';\r\n\r\nexport const FormWorkOrderTypeStatusPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n IWorkOrderTypeStatusParamsPicker) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RemindBeforePicker } from '../pickers/StaticOptionsPickers/RemindBeforePicker';\r\n\r\nexport const FormRemindBeforePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISymptomCodeDto } from 'api/odata/generated/entities/ISymptomCodeDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface ISymptomCodesParamsPicker {\r\n AssetCats?: number[];\r\n}\r\nexport interface SymptomCodesPickerProps\r\n extends Omit>, 'loadData'>,\r\n ISymptomCodesParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/SymptomCodes';\r\nexport const initSymptomCodesData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: `Id,Name,Active,AssetCatId,AssetCatName`,\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function withParamsFilter(AssetCats: number[] | undefined) {\r\n if (!AssetCats || AssetCats.length < 1) {\r\n return (searchTerm: string | null) =>\r\n new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n }\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,Active,AssetCatId,AssetCatName',\r\n };\r\n const predicates: (string | Condition)[] = [];\r\n if (AssetCats !== undefined && AssetCats.length > 0) {\r\n AssetCats.forEach(a =>\r\n predicates.push(new Condition('AssetCatId', ODataOperators.Equals, a)),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response => (response.value as ISymptomCodeDto[]) as Entity[],\r\n );\r\n };\r\n}\r\nexport function SymptomCodesPicker(props: SymptomCodesPickerProps) {\r\n const loadData = withParamsFilter(props.AssetCats);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormSymptomCodesPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n ISymptomCodesParamsPicker,\r\n SymptomCodesPicker,\r\n} from '../pickers/AutocompletePickers/SymptomCodesPicker';\r\n\r\nexport const FormSymptomCodesPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n ISymptomCodesParamsPicker) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IRepairCodeDto } from 'api/odata/generated/entities/IRepairCodeDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface IRepairCodesParamsPicker {\r\n AssetCatIds?: number[];\r\n}\r\nexport interface RepairCodesPickerProps\r\n extends Omit>, 'loadData'>,\r\n IRepairCodesParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/RepairCodes';\r\nexport const initRepairCodesData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: `Id,Name,Active,AssetCatId,AssetCatName`,\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function withParamsFilter(AssetCatIds: number[] | undefined) {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n $orderby: 'Name asc',\r\n $select: 'Id,Name,Active,AssetCatId,AssetCatName',\r\n };\r\n const predicates: (string | Condition)[] = [];\r\n if (AssetCatIds !== undefined && AssetCatIds.length > 0) {\r\n predicates.push(\r\n AssetCatIds.map(ac =>\r\n new Condition('AssetCatId', ODataOperators.Equals, ac).toString(),\r\n ).join(' or '),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response => (response.value as IRepairCodeDto[]) as Entity[],\r\n );\r\n };\r\n}\r\nexport function RepairCodesPicker(props: RepairCodesPickerProps) {\r\n const loadData = withParamsFilter(props.AssetCatIds);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormRepairCodesPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n IRepairCodesParamsPicker,\r\n RepairCodesPicker,\r\n} from '../pickers/AutocompletePickers/RepairCodesPicker';\r\n\r\nexport const FormRepairCodesPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n IRepairCodesParamsPicker) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReasonTypePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ReasonType';\r\nexport const initReasonTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: `Id,Name`,\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nconst loadData = (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n if (searchTerm !== null) {\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: [],\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm,\r\n }).toString();\r\n }\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n};\r\nexport function ReasonTypePicker(props: ReasonTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ReasonTypePicker } from '../pickers/AutocompletePickers/ReasonTypePicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormReasonTypePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","import { Body } from 'app/components/Typography';\r\nimport { ReservationEditButton } from 'app/components/ReservationEditButton';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { WorkOrderReadonlyState } from '../slice/types';\r\nimport styled from 'styled-components';\r\n\r\nexport interface CreationDetailsProps {\r\n details: WorkOrderReadonlyState;\r\n}\r\n\r\nexport function CreationDetails(props: CreationDetailsProps) {\r\n const { details } = props;\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n {t(translations.WorkOrderAdvancedDetails)}\r\n
    \r\n
    \r\n {t(translations.ReportedBy)}\r\n \r\n {details.ReportedByDisplayName}\r\n \r\n
    \r\n
    \r\n {t(translations.ReportedDate)}\r\n \r\n {dateUtils.longDateTimeFormat(details.CreateDate)}\r\n \r\n
    \r\n
    \r\n {t(translations.LastUpdated)}\r\n \r\n {dateUtils.longDateTimeFormat(details.LastUpdated) ?? 'N/A'}\r\n \r\n
    \r\n
    \r\n {t(translations.AlertType)}\r\n \r\n {details.AlertType ?? 'N/A'}\r\n \r\n
    \r\n
    \r\n {t(translations.EventTypeStatus)}\r\n \r\n {details.StatusName ?? 'N/A'}\r\n \r\n
    \r\n
    \r\n {t(translations.ClosedAt)}\r\n \r\n {dateUtils.longDateTimeFormat(details.DoneDate) ||\r\n t(translations.WorkStillInProgress)}\r\n \r\n
    \r\n
    \r\n {t(translations.ClosedBy)}\r\n \r\n {details.DoneBy ?? 'N/A'}\r\n \r\n
    \r\n {details.Reservation !== null && (\r\n
    \r\n {t(translations.Reservation)}\r\n \r\n {`# ${details.Reservation}`}\r\n \r\n
    \r\n )}\r\n {globalSettings.GetBooleanByKey(AllowedSettings.AssetCatEnabled) &&\r\n !isNullOrUndefined(details.AssetCatName) && (\r\n
    \r\n {t(translations.AssetCatName)}\r\n {`${details.AssetCatName} - ${\r\n details.InternalServiceAvaliable\r\n ? t(translations.InternalServiceAvaliable)\r\n : ''\r\n }`}\r\n
    \r\n )}\r\n
    \r\n
    \r\n
    \r\n );\r\n}\r\nconst DetailsWrapper = styled.div`\r\n &.readonly-root {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n grid-gap: 4px;\r\n padding: 0;\r\n width: 100%;\r\n }\r\n & .readonly-content {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n grid-gap: 16px;\r\n padding: 16px 0px;\r\n width: 100%;\r\n }\r\n & .readonly-row {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n width: inherit;\r\n }\r\n`;\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nexport interface FormUnlimitedDowntimeProps {\r\n onClick: () => void;\r\n}\r\nexport function FormUnlimitedDowntime(props: FormUnlimitedDowntimeProps) {\r\n const { t } = useTranslation();\r\n return (\r\n \r\n \r\n \r\n \r\n }\r\n />\r\n );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport {\r\n BaseURLPicker,\r\n BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nexport interface CustomFormPickerProps\r\n extends Omit>, 'url' | 'queryfilter'> {\r\n formType: CustomFormTypeEnum;\r\n referenceId?: number;\r\n filter?: string;\r\n}\r\n\r\nexport const initCustomFormData = (\r\n initval: string | undefined,\r\n type: CustomFormTypeEnum,\r\n) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const url = `/api/odata/v4/CustomForm(${type})`;\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,FormFields,ServiceGroups,Active,Type',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nexport function AlertFormFilter(\r\n alertTypeId: number,\r\n assetCatId: number,\r\n): string | undefined {\r\n let filter = `(WorkOrderFormMatrices/any(m: m/AlertTypeId eq ${quoteODataValue(\r\n alertTypeId,\r\n )} and m/AssetCatId eq ${assetCatId}))`;\r\n return filter;\r\n}\r\nexport function CustomFormPicker(props: CustomFormPickerProps) {\r\n const { filter, formType } = props;\r\n const url = `/api/odata/v4/CustomForm(${formType})`;\r\n return (\r\n \r\n );\r\n}\r\n","import { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { CustomFormPicker } from '../pickers/AutocompletePickers/CustomFormPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormCustomFormPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps & { formType: CustomFormTypeEnum }) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport { IComment } from 'app/components/CommentsContainer/IComment';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { WorkOrderDetailsState } from '../slice/types';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Portal } from '@material-ui/core';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\nimport { selectLargeFilesUploading } from 'app/components/LargeFilesUpload/slice/selectoes';\r\n\r\nexport interface WorkOrderCommentsProps {\r\n isAdmin?: boolean;\r\n order: WorkOrderDetailsState;\r\n disabled?: boolean;\r\n commentsFormRef: React.MutableRefObject;\r\n isEdit?: boolean;\r\n user?: AuthenticatedUser;\r\n sectionTitle?: React.ReactNode;\r\n onNewCommmentAdded?: (commentId: number) => void;\r\n onCommmentsReady?: () => void;\r\n}\r\n\r\nexport const WorkOrderComments = (props: WorkOrderCommentsProps) => {\r\n const {\r\n order,\r\n isAdmin,\r\n disabled,\r\n commentsFormRef,\r\n isEdit,\r\n sectionTitle,\r\n onNewCommmentAdded,\r\n onCommmentsReady,\r\n } = props;\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const [changed, setchanged] = React.useState(false);\r\n const id = isEdit ? order.Id : -1;\r\n const [newComments, setNewComments] = React.useState([]);\r\n const comments = useAsyncGetWthEffect(\r\n () => CommentsApi.GetComments(CommentReferenceTypes.Alerts, order.Id),\r\n [],\r\n [changed],\r\n );\r\n const bindSubmitComment = React.useCallback(\r\n submitForm => {\r\n commentsFormRef.current = submitForm;\r\n },\r\n [commentsFormRef],\r\n );\r\n const { onCommentAdded } = useUploadToNewComment();\r\n const isUploading = useSelector(selectLargeFilesUploading);\r\n const [formSubmitted, setFormSubitted] = React.useState(false);\r\n React.useEffect(() => {\r\n if (formSubmitted && !isUploading) {\r\n onCommmentsReady?.();\r\n setFormSubitted(false);\r\n }\r\n }, [formSubmitted, isUploading, onCommmentsReady]);\r\n React.useEffect(() => {\r\n dispatch(\r\n largeFileActions.setCommentProperties({\r\n commentType: CommentReferenceTypes.Alerts,\r\n referenceId: id,\r\n }),\r\n );\r\n }, [dispatch, largeFileActions, id]);\r\n\r\n const portalRef = React.useRef(null);\r\n return (\r\n \r\n
    \r\n \r\n {\r\n if (!disabled) {\r\n if (isEdit) {\r\n CommentsApi.SendComment(\r\n CommentReferenceTypes.Alerts,\r\n order.Id,\r\n c,\r\n )\r\n .then(res => onCommentAdded?.(res))\r\n .finally(() => setchanged(prev => !prev));\r\n } else {\r\n CommentsApi.SendComment(CommentReferenceTypes.Alerts, -1, c)\r\n .then(res => {\r\n onNewCommmentAdded?.(res.Id);\r\n onCommentAdded?.(res);\r\n if (!isInner) {\r\n setTimeout(() => {\r\n setFormSubitted(true);\r\n }, 5);\r\n }\r\n return CommentsApi.GetComments(\r\n CommentReferenceTypes.Alerts,\r\n -1,\r\n res.Id,\r\n );\r\n })\r\n .then(c => {\r\n setNewComments(prev => [...prev, ...c]);\r\n });\r\n }\r\n }\r\n }}\r\n isAdmin={isAdmin}\r\n withMentions\r\n pageName={t(translations.menu_EditWorkOrder)}\r\n referenceName={order.Id.toString()}\r\n linkUrl={buildURL(`${publicUrl}workorders/details/${order.Id}`, {})}\r\n emailType={'Alert'}\r\n />\r\n \r\n \r\n );\r\n};\r\n","import Box from '@material-ui/core/Box';\r\nimport Grid from '@material-ui/core/Grid';\r\nimport Popover from '@material-ui/core/Popover';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n bindPopover,\r\n bindTrigger,\r\n usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { AssetsFilterForCalibrationWorkOrder } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { Divider } from '@material-ui/core';\r\nimport {\r\n filteredWorkOrderTypes,\r\n initWOTypeData,\r\n WorkOrderTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport {\r\n WorkOrderPicker,\r\n WorkOrdersCalibrationFilter,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrdersPicker';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\n\r\nexport interface AddCalibrationWorkOrderProps {\r\n saveLinkedOrders: (order: IWorkOrderDetailsDto) => void;\r\n workOrederTypeId?: number;\r\n workOrederIds?: number[];\r\n showProcessing?: boolean;\r\n}\r\n\r\nexport function AddCalibrationWorkOrder(props: AddCalibrationWorkOrderProps) {\r\n const { t } = useTranslation();\r\n\r\n const {\r\n workOrederIds,\r\n workOrederTypeId,\r\n saveLinkedOrders,\r\n showProcessing,\r\n } = props;\r\n const [asset, setAsset] = useAsyncExtendedState(null);\r\n\r\n const [workOrder, setWorkOrder] = React.useState(\r\n null,\r\n );\r\n const [\r\n workOrderType,\r\n setWorkOrderType,\r\n ] = useAsyncExtendedState(null);\r\n\r\n const popupState = usePopupState({\r\n variant: 'popover',\r\n popupId: 'workOrderTypeSelection',\r\n });\r\n const fetchWorkOrderType = async (woId?: number) =>\r\n initWOTypeData(woId === undefined ? undefined : '' + woId).then(\r\n data => (data[0] as IWorkOrderTypeDto) ?? null,\r\n );\r\n useEffectOnMount(() => {\r\n if (workOrederTypeId) {\r\n setWorkOrderType(fetchWorkOrderType(workOrederTypeId));\r\n }\r\n return () => {};\r\n });\r\n const handleAssetChange = React.useCallback(\r\n (value: IAssetDto | null) => {\r\n setAsset(value);\r\n },\r\n [setAsset],\r\n );\r\n const handleWorkTypeChange = React.useCallback(\r\n (value: IWorkOrderTypeDto | null) => {\r\n setWorkOrderType(value);\r\n },\r\n [setWorkOrderType],\r\n );\r\n const handleWorkOrderChange = React.useCallback(\r\n (value: IWorkOrderDetailsDto | null) => {\r\n setWorkOrder(value);\r\n },\r\n [],\r\n );\r\n const handleSaveLinked = (value: IWorkOrderDetailsDto | null) => {\r\n if (value !== null) {\r\n saveLinkedOrders(value);\r\n popupState.close();\r\n }\r\n };\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n {/* \r\n \r\n \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n \r\n \r\n {t(translations.AddCalibrationReference)}\r\n \r\n {\r\n popupState.close();\r\n setAsset(null);\r\n setWorkOrderType(null);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n handleWorkTypeChange(value as IWorkOrderTypeDto);\r\n }}\r\n fullWidth={true}\r\n id=\"wotype-id\"\r\n value={workOrderType}\r\n />\r\n \r\n \r\n {\r\n handleAssetChange(value);\r\n }}\r\n placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n fullWidth={true}\r\n name=\"assets\"\r\n variant=\"filled\"\r\n id=\"asset-id\"\r\n showOnlyActiveAssets={true}\r\n label={t(translations.Asset)}\r\n value={asset || undefined}\r\n />\r\n \r\n\r\n \r\n {\r\n handleWorkOrderChange(value);\r\n }}\r\n predicates={WorkOrdersCalibrationFilter(\r\n asset?.Id,\r\n workOrderType?.Id,\r\n workOrederIds,\r\n )}\r\n fullWidth={true}\r\n id=\"wo-id\"\r\n />\r\n \r\n \r\n \r\n handleSaveLinked(workOrder)}\r\n >\r\n {t(translations.LinkWorkOrder)}\r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n );\r\n}\r\n","import { IconProp } from 'app/AllIcons';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\n\r\nexport interface HoverLinkedItemProps {\r\n linked: Entity;\r\n children: React.ReactChild;\r\n onHoverClick?: (linked: Entity) => void;\r\n useHoverButton?: boolean;\r\n hoverIcon?: IconProp;\r\n}\r\n\r\nexport function HoverLinkedItem(props: HoverLinkedItemProps) {\r\n const { linked, children, useHoverButton, onHoverClick, hoverIcon } = props;\r\n\r\n const [hover, setHover] = React.useState(false);\r\n return (\r\n setHover(true)}\r\n onMouseLeave={() => setHover(false)}\r\n >\r\n {children}\r\n {useHoverButton && hover && (\r\n !!onHoverClick && onHoverClick(linked)}\r\n >\r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","import Collapse from '@material-ui/core/Collapse';\r\nimport List from '@material-ui/core/List';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\r\nimport { Box, LinearProgress, ListItem, ListItemText } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { HoverLinkedItem } from './HoverLinkItem';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useTranslation } from 'react-i18next';\r\nimport cliTruncate from 'cli-truncate';\r\n\r\nexport interface LinkedList extends Entity {\r\n Id: number;\r\n Name: string;\r\n ParentId: number;\r\n Linked: LinkedList[];\r\n}\r\nexport interface WorkOrderLinksCollapsedProps {\r\n links: LinkedList[];\r\n hoverIcon?: IconProp;\r\n onHoverClick?: (linked: LinkedList) => void;\r\n onItemClcik?: (linked: Entity) => void;\r\n}\r\n\r\nexport function WorkOrderLinksCollapsed(props: WorkOrderLinksCollapsedProps) {\r\n const { links, hoverIcon, onHoverClick, onItemClcik } = props;\r\n const { t } = useTranslation();\r\n return (\r\n {t(translations.AllLinkedWorkOrders)}}\r\n >\r\n {links.map(link => (\r\n \r\n ))}\r\n \r\n );\r\n}\r\nexport interface HoverLinkedItemsProps {\r\n linked: LinkedList;\r\n onHoverClick?: (linked: LinkedList) => void;\r\n onItemClcik?: (linked: Entity) => void;\r\n hoverIcon?: IconProp;\r\n}\r\n\r\nexport function HoverLinkedCollapsedItems(props: HoverLinkedItemsProps) {\r\n const { linked, onHoverClick, onItemClcik, hoverIcon } = props;\r\n\r\n const [open, setOpen] = React.useState(false);\r\n return linked.Linked.length > 0 ? (\r\n \r\n setOpen(!open)}\r\n style={{ cursor: 'pointer' }}\r\n disableGutters\r\n >\r\n \r\n {}\r\n \r\n \r\n {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n \r\n \r\n {}\r\n \r\n \r\n \r\n {/* */}\r\n \r\n {linked.Linked.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n {}\r\n \r\n !!onHoverClick && onHoverClick(linked)}\r\n >\r\n !!onItemClcik && onItemClcik(linked)}\r\n >\r\n {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport function HoverLinkedItems(props: HoverLinkedItemsProps) {\r\n const { linked, onHoverClick, onItemClcik, hoverIcon } = props;\r\n\r\n return linked.Linked.length > 0 ? (\r\n \r\n \r\n \r\n {}\r\n \r\n !!onHoverClick && onHoverClick(linked)}\r\n >\r\n !!onItemClcik && onItemClcik(linked)}\r\n >\r\n {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n \r\n \r\n \r\n \r\n {linked.Linked.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {}\r\n \r\n !!onHoverClick && onHoverClick(linked)}\r\n >\r\n !!onItemClcik && onItemClcik(linked)}\r\n >\r\n {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n \r\n \r\n \r\n );\r\n}\r\nexport interface WorkOrderLinksProps {\r\n links: LinkedList[];\r\n hoverIcon?: IconProp;\r\n onHoverClick?: (linked: LinkedList) => void;\r\n onItemClcik?: (linked: Entity) => void;\r\n showProcessing?: boolean;\r\n}\r\nconst getLength = (link: LinkedList) => {\r\n let count = link.Linked.length;\r\n if (link.Linked.length > 0) {\r\n link.Linked.forEach(item => {\r\n count += getLength(item);\r\n });\r\n }\r\n return count;\r\n};\r\nexport function WorkOrderLinks(props: WorkOrderLinksProps) {\r\n const { links, hoverIcon, onHoverClick, onItemClcik, showProcessing } = props;\r\n const { t } = useTranslation();\r\n const [open, setOpen] = React.useState(true);\r\n const countLinks = React.useMemo(() => {\r\n let count = links.length;\r\n if (links.length > 0) {\r\n links.forEach(item => {\r\n count += getLength(item);\r\n });\r\n }\r\n return count;\r\n }, [links]);\r\n return (\r\n \r\n \r\n setOpen(!open)}\r\n style={{ cursor: 'pointer' }}\r\n disableGutters\r\n >\r\n \r\n {\r\n \r\n {t(translations.LinkedWorkOrders).replace(\r\n '{0}',\r\n countLinks.toString(),\r\n )}\r\n \r\n }\r\n \r\n \r\n {}\r\n \r\n \r\n {showProcessing && (\r\n \r\n \r\n \r\n )}\r\n \r\n {/* */}\r\n \r\n {links.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport {\r\n getAlertStart,\r\n WorkOrderDetailsState,\r\n WorkOrderReadonlyState,\r\n} from '../slice/types';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { FormWorkOrderTypePicker } from 'app/components/Forms/FormWorkOrderTypePicker';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormWorkOrderTypeStatusPicker } from 'app/components/Forms/FormWorkOrderTypeStatusPicker';\r\nimport { FormRemindBeforePicker } from 'app/components/Forms/FormRemindBeforePicker';\r\nimport { FormSymptomCodesPicker } from 'app/components/Forms/FormSymptomCodesPicker';\r\nimport { FormRepairCodesPicker } from 'app/components/Forms/FormRepairCodesPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n IAssetDto,\r\n mapAssetsToServiceFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormReasonTypePicker } from 'app/components/Forms/FormReasonTypePicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormAdminUsersPicker } from 'app/components/Forms/FormAdminUserPicker';\r\nimport { getWorkOrdersShema } from './validationSchema';\r\nimport { AssetsFilterForWorkOrder } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { initReasonTypeData } from 'app/components/pickers/AutocompletePickers/ReasonTypePicker';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectSystemFirstDayOfWeek } from 'app/slice/selectors';\r\nimport { GetAutoCreateTitle } from 'types/IRepetitiveDto';\r\nimport { getSingleReminder } from 'app/components/pickers/StaticOptionsPickers/RemindBeforePicker';\r\nimport { Entity } from 'types/common';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { RepetitiveControl } from 'app/components/Forms/FormRepetitive/RepetitiveControl';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { CreationDetails } from '../CreationDetails';\r\nimport { FormUnlimitedDowntime } from './FormUnlimitedDowntime';\r\nimport { CustomFormControl } from '../../../../../components/CustomForm/CusomFormControl';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FormCustomFormPicker } from 'app/components/Forms/FormCustomFormPicker';\r\nimport { AlertFormFilter } from 'app/components/pickers/AutocompletePickers/CustomFormPicker';\r\nimport { WorkOrderComments } from './WorkOrderComments';\r\nimport { isEmpty } from 'lodash';\r\nimport { RepetitiveFor } from 'app/components/Forms/FormRepetitive/slice/types';\r\n\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { WorkOrderDetailsProps } from '..';\r\nimport { useWorkOrderSlice } from '../slice';\r\n\r\nimport {\r\n selectDowntimeOverlaps,\r\n selectFieldHandler,\r\n selectLinksProcessing,\r\n selectOfflineEventEnd,\r\n selectOfflineEventStart,\r\n selectSavedLinkedOrders,\r\n} from '../slice/selectors';\r\nimport produce from 'immer';\r\nimport {\r\n AdminServicesFilter,\r\n initAssigneeAdminUsers,\r\n} from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { AddCalibrationWorkOrder } from './WorkOrderLinks/AddCalibrationWorkOrder';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { LinkedList, WorkOrderLinks } from './WorkOrderLinks/WorkOrderLinks';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { WorkOrderApi } from 'api/WorkOrderApi';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport { Body, Caption } from 'app/components/Typography';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface WorkOrderFormProps {\r\n onSubmit: (\r\n item: WorkOrderDetailsState,\r\n subFormFiles: IFormFileValue[],\r\n staffFormFiles: IFormFileValue[],\r\n ) => void;\r\n initialValues: WorkOrderDetailsState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n repetitiveFormRef: React.MutableRefObject;\r\n workOrderTypeFormRef: React.MutableRefObject;\r\n workOrderStaffFormRef: React.MutableRefObject;\r\n readonlyDetails?: WorkOrderReadonlyState;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n handleTypeChange: (type: IWorkOrderTypeDto | undefined) => void;\r\n canView?: boolean;\r\n commentsFormRef: React.MutableRefObject;\r\n onAssetClicked?: (asset: Entity) => void;\r\n onLinkedClick?: (linked: Entity) => void;\r\n expanded: boolean;\r\n formRef: React.MutableRefObject | null>;\r\n setWorkOrderOfflineStartChangedValue: React.Dispatch<\r\n React.SetStateAction\r\n >;\r\n setWorkOrderOfflineEndChangedValue: React.Dispatch<\r\n React.SetStateAction\r\n >;\r\n useSidePanel?: boolean;\r\n pageLink?: string;\r\n showShortView?: boolean;\r\n isCover?: boolean;\r\n bringUp?: boolean;\r\n onNewCommmentAdded?: (commentId: number) => void;\r\n onCommmentsReady?: () => void;\r\n}\r\n\r\nexport const WorkOrderForm = React.memo(function WorkOrderForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isEdit,\r\n isAdmin,\r\n user,\r\n handleTypeChange,\r\n repetitiveFormRef,\r\n workOrderTypeFormRef,\r\n workOrderStaffFormRef,\r\n readonlyDetails,\r\n canView,\r\n commentsFormRef,\r\n setWorkOrderOfflineStartChangedValue,\r\n setWorkOrderOfflineEndChangedValue,\r\n onAssetClicked,\r\n expanded,\r\n formRef,\r\n onLinkedClick,\r\n useSidePanel,\r\n pageLink,\r\n showShortView,\r\n isCover,\r\n bringUp,\r\n onNewCommmentAdded,\r\n onCommmentsReady,\r\n}: WorkOrderFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { actions: workOrderActions } = useWorkOrderSlice();\r\n // const [addToLinked, setAddToLinked] = React.useState | null>(\r\n // null,\r\n // );\r\n const readonly = !isAdmin && isEdit;\r\n const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n const fieldHandler = useSelector(selectFieldHandler);\r\n const savedLinkedOrders = useSelector(selectSavedLinkedOrders);\r\n const linksProcessing = useSelector(selectLinksProcessing);\r\n const overlaps = useSelector(selectDowntimeOverlaps);\r\n // const linkedCalibrationsChanged = useSelector(selectCalibrationsChanged);\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value, originalSubFormFiles, originalStaffFormFiles);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(workOrderActions.resetValueHandler());\r\n };\r\n const [unlimitedDowntime, setUnlimitedDowntime] = React.useState(\r\n isEdit &&\r\n initialValues.OfflineEventEnd !== null &&\r\n initialValues.OfflineEventEnd !== undefined &&\r\n dateUtils\r\n .dateOrStringToDate(initialValues.OfflineEventEnd)\r\n .getFullYear() === 9999,\r\n );\r\n const [typeChanged, setTypeChanged] = React.useState(false);\r\n const [downTimeChanged, setDownTimeChanged] = React.useState(false);\r\n const [allIsValid, setAllIsValid] = React.useState(true);\r\n const [remindBeforeChanged, setRemindBeforeChanged] =\r\n React.useState(false);\r\n const [originalSubFormFiles, setOriginalSubFormFiles] = React.useState<\r\n IFormFileValue[]\r\n >([]);\r\n const [originalStaffFormFiles, setOriginalStaffFormFiles] = React.useState<\r\n IFormFileValue[]\r\n >([]);\r\n const linkedWorkOrders = useAsyncGetWthEffect(\r\n //WorkOrderApi.getLinkedToCalibration(initialValues.Id),\r\n async (): Promise => {\r\n if (isEdit) {\r\n if (linksProcessing === true) {\r\n return new Promise(resolve => {\r\n resolve(linkedWorkOrders);\r\n });\r\n } else {\r\n return WorkOrderApi.getLinkedToCalibration(initialValues.Id).then(\r\n res => {\r\n return res.Links as LinkedList[];\r\n },\r\n );\r\n }\r\n } else {\r\n return new Promise(resolve => {\r\n resolve(\r\n savedLinkedOrders.map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: `#${f.Id}: ${f.AssetName} - ${f.Name}`,\r\n ParentId: -1,\r\n Linked: [],\r\n };\r\n }),\r\n );\r\n });\r\n }\r\n },\r\n [],\r\n [savedLinkedOrders, linksProcessing],\r\n );\r\n const { newDate } = useSystemDate();\r\n const updateFormValues = (\r\n original: IFormValueDto[],\r\n coming: IFormValueDto[],\r\n alertId: number | null,\r\n typeId: number | null,\r\n ) => {\r\n const result = coming.map(v => {\r\n let orn = original.find(o => o.FormFieldId === v.FormFieldId);\r\n if (!!orn) {\r\n return Object.assign({}, orn, {\r\n Value: v.Value,\r\n AlertId: alertId,\r\n AlertTypeId: typeId,\r\n });\r\n } else {\r\n return Object.assign(v, {\r\n AlertId: alertId,\r\n AlertTypeId: typeId,\r\n });\r\n }\r\n });\r\n //console.log('form values:', result);\r\n return result;\r\n };\r\n const workOrderSchema = React.useMemo(() => {\r\n return getWorkOrdersShema(t);\r\n }, [t]);\r\n const handleFormChange = React.useCallback(\r\n (values: WorkOrderDetailsState, isValid, dirty, setValue) => {\r\n if (typeChanged) {\r\n let type = values.WorkOrderType as IWorkOrderTypeDto;\r\n handleTypeChange(type);\r\n if (!!type) {\r\n if (type.DefaultSubject !== null) {\r\n setValue('AlertTitle', type.DefaultSubject, false);\r\n }\r\n if (initialValues.ToDown) {\r\n setValue('Downtime', true, false);\r\n setValue('OfflineEventStart', newDate(), true);\r\n (async () => {\r\n try {\r\n let id = type.DowntimeReasonTypeId ?? 3; // - Unexpected Malfunction\r\n const reason = await initReasonTypeData(id.toString());\r\n if (!!reason && reason.length > 0) {\r\n setValue('ReasonType', reason[0], false);\r\n }\r\n } catch {}\r\n })();\r\n } else if (type.DowntimeDuration !== null) {\r\n setValue('Downtime', true, false);\r\n if (values.EventStart !== null) {\r\n let endTime = dateUtils.addHours(\r\n dateUtils.dateOrStringToDate(values.EventStart),\r\n type.DowntimeDuration,\r\n );\r\n setValue('OfflineEventStart', values.EventStart, false);\r\n setValue('OfflineEventEnd', endTime, false);\r\n if (type.DowntimeReasonTypeId != null) {\r\n (async () => {\r\n try {\r\n let id = type.DowntimeReasonTypeId ?? 0;\r\n const reason = await initReasonTypeData(id.toString());\r\n if (!!reason && reason.length > 0) {\r\n setValue('ReasonType', reason[0], false);\r\n }\r\n } catch {}\r\n })();\r\n }\r\n }\r\n } else {\r\n setValue('Downtime', false, false);\r\n }\r\n setValue(\r\n 'AutoCreateTitle',\r\n GetAutoCreateTitle(\r\n type,\r\n values.EventStart,\r\n firstDayOfWeek as WeekStartsOn,\r\n ),\r\n false,\r\n );\r\n if (type.DefaultRemaindBefore !== null) {\r\n let remb = getSingleReminder(type.DefaultRemaindBefore);\r\n if (!!remb) {\r\n setValue('RemindBefore', remb, false);\r\n setValue('AlertStart', getAlertStart(remb.Id, values.EventStart));\r\n }\r\n }\r\n let assignee: Entity[] = [];\r\n if (type.AssignedUsers.length > 0) {\r\n assignee.concat(type.AssignedUsers);\r\n }\r\n if (type.AssignedToCreator && !!user) {\r\n assignee.push({\r\n Id: user.Id,\r\n Name: user.FormatedName || user.Id,\r\n });\r\n }\r\n (async () => {\r\n try {\r\n let assets = values.Assets as IAssetDto[]; // - Unexpected Malfunction\r\n const users = await initAssigneeAdminUsers(\r\n type,\r\n mapAssetsToServiceFilterDto(assets),\r\n );\r\n assignee.concat(users);\r\n if (assignee.length > 0) {\r\n setValue('AssignUsers', assignee, false);\r\n }\r\n } catch {}\r\n })();\r\n }\r\n setTypeChanged(false);\r\n }\r\n if (downTimeChanged) {\r\n if (values.Downtime) {\r\n setValue('OfflineEventStart', newDate(), true);\r\n }\r\n setDownTimeChanged(false);\r\n }\r\n if (remindBeforeChanged) {\r\n setValue(\r\n 'AlertStart',\r\n getAlertStart(values.RemindBefore?.Id ?? 0, values.EventStart),\r\n );\r\n setRemindBeforeChanged(false);\r\n }\r\n },\r\n [\r\n downTimeChanged,\r\n firstDayOfWeek,\r\n handleTypeChange,\r\n initialValues.ToDown,\r\n newDate,\r\n remindBeforeChanged,\r\n typeChanged,\r\n user,\r\n ],\r\n );\r\n React.useEffect(() => {\r\n if (formRef.current) {\r\n formRef.current.validateForm();\r\n }\r\n }, [formRef]);\r\n const validateForms = React.useCallback((isValid: boolean) => {\r\n setAllIsValid(isValid);\r\n }, []);\r\n const changeLinkedOrders = React.useCallback(\r\n (\r\n orders: IWorkOrderDetailsDto[],\r\n operation: 'add' | 'remove' | 'update',\r\n ) => {\r\n if (operation === 'add') {\r\n let addedOrders = orders.filter(\r\n f => !savedLinkedOrders.some(s => s.Id === f.Id),\r\n );\r\n dispatch(\r\n workOrderActions.setSavedLinkedOrders([\r\n ...savedLinkedOrders,\r\n ...addedOrders,\r\n ]),\r\n );\r\n }\r\n if (operation === 'remove') {\r\n let removedOrders = savedLinkedOrders.filter(f => {\r\n return !orders.some(a => a.Id === f.Id);\r\n });\r\n dispatch(workOrderActions.setSavedLinkedOrders(removedOrders));\r\n }\r\n if (operation === 'update') {\r\n dispatch(\r\n workOrderActions.setSavedLinkedOrders(\r\n savedLinkedOrders.map(f => {\r\n let order = orders.find(s => s.Id === f.Id);\r\n if (!!order && order !== null) {\r\n return Object.assign({}, f, order);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n ),\r\n );\r\n }\r\n },\r\n [dispatch, savedLinkedOrders, workOrderActions],\r\n );\r\n const removeCalibrationOrder = React.useCallback(\r\n (linked: LinkedList) => {\r\n dispatch(\r\n workOrderActions.removeLinkedCalibration({\r\n id: linked.ParentId,\r\n link: linked.Id,\r\n }),\r\n );\r\n },\r\n [dispatch, workOrderActions],\r\n );\r\n const addCalibrationOrder = React.useCallback(\r\n (linked: Entity) => {\r\n dispatch(\r\n workOrderActions.addLinkedCalibration({\r\n id: initialValues.Id,\r\n link: linked.Id,\r\n }),\r\n );\r\n },\r\n [dispatch, initialValues.Id, workOrderActions],\r\n );\r\n const handleOfflineEventStartChange = (v: any) => {\r\n dispatch(\r\n workOrderActions.setOfflineEventStart(\r\n dateUtils.tryParse(v) === null\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(v),\r\n ),\r\n );\r\n };\r\n const handleOfflineEventEndChange = (v: any) => {\r\n dispatch(\r\n workOrderActions.setOfflineEventEnd(\r\n // dateUtils.tryFormatIso(dateUtils.tryParse(v)) ?? undefined,\r\n dateUtils.tryParse(v) === null\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(v),\r\n ),\r\n );\r\n };\r\n const OfflineEventStart = useSelector(selectOfflineEventStart);\r\n const OfflineEventEnd = useSelector(selectOfflineEventEnd);\r\n const warningMessages: IndexNode[] = React.useMemo(() => {\r\n let nodes: IndexNode[] = [];\r\n if (!!overlaps && overlaps.length > 0) {\r\n nodes.push({\r\n index: 'overlapsLinks',\r\n node: (\r\n \r\n \r\n {t(translations.InstrumentHasOverlappingDowntimeEvents) as string}\r\n \r\n \r\n {t(translations.ShowAllDowntimeEventsOn) as string}\r\n \r\n \r\n f.AssetId !== -1)\r\n .map(f => f.AssetId)\r\n .join(',')}&downTime=2`}\r\n aria-label=\"work orders\"\r\n target=\"_blank\"\r\n >\r\n {t(translations.menu_WorkOrders) as string}\r\n \r\n f.ServiceId !== -1)\r\n .map(f => f.ServiceId)}\r\n >\r\n {t(translations.Calendar) as string}\r\n \r\n
    \r\n\r\n {/* f.ServiceId !== -1)\r\n .map(f => f.ServiceId)\r\n .join(',')}`}\r\n aria-label=\"calendar\"\r\n target=\"_blank\"\r\n >\r\n {t(translations.Calendar) as string}\r\n */}\r\n \r\n ),\r\n variant: 'outlined',\r\n });\r\n }\r\n return nodes;\r\n }, [overlaps, t]);\r\n // React.useEffect(() => {\r\n // if (linkedCalibrationsChanged === true) {\r\n // dispatch(workOrderActions.setCalibrationChanged(undefined));\r\n // }\r\n // }, [dispatch, linkedCalibrationsChanged, workOrderActions]);\r\n React.useEffect(() => {\r\n if (\r\n isEdit &&\r\n !!initialValues.OfflineEventStart &&\r\n initialValues.OfflineEventStart !== null\r\n ) {\r\n dispatch(workOrderActions.checkDowntimeOverlaps(initialValues.Id));\r\n }\r\n }, [\r\n bringUp,\r\n dispatch,\r\n initialValues.Id,\r\n initialValues.OfflineEventStart,\r\n isEdit,\r\n workOrderActions,\r\n ]);\r\n React.useEffect(() => {\r\n formRef.current?.setValues(\r\n produce(v => {\r\n if (OfflineEventStart !== undefined) {\r\n v.OfflineEventStart = dateUtils.parseISOOrNull(OfflineEventStart);\r\n }\r\n if (OfflineEventEnd !== undefined) {\r\n v.OfflineEventEnd = dateUtils.parseISOOrNull(OfflineEventEnd);\r\n }\r\n }),\r\n );\r\n }, [OfflineEventStart, OfflineEventEnd, formRef]);\r\n\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n if (allIsValid) {\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n } else {\r\n formikHelpers.setSubmitting(false);\r\n }\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Work order errors', formik.errors);\r\n }\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n setAssetChanged(true)}\r\n fullWidth\r\n />\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n setTypeChanged(true)}\r\n fullWidth\r\n />\r\n \r\n \r\n setStatusChanged(true)}\r\n fullWidth\r\n />\r\n \r\n \r\n 0\r\n ? formik.values.Assets.filter(\r\n f =>\r\n !isNullOrUndefined(\r\n (f as IAssetDto).AssetCatId,\r\n ),\r\n ).map(\r\n asset => (asset as IAssetDto).AssetCatId ?? 0,\r\n )\r\n : undefined\r\n }\r\n label={t(translations.SymptomCodes)}\r\n placeholder={t(\r\n translations.PleaseSelectAnAlertSymptomCode,\r\n )}\r\n disabled={\r\n formik.isSubmitting ||\r\n readonly ||\r\n ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n .NotEditable === true &&\r\n formik.values.IsClosed === true)\r\n }\r\n fullWidth\r\n />\r\n \r\n \r\n 0\r\n ? formik.values.Assets.filter(\r\n f =>\r\n !isNullOrUndefined(\r\n (f as IAssetDto).AssetCatId,\r\n ),\r\n ).map(\r\n asset => (asset as IAssetDto).AssetCatId ?? 0,\r\n )\r\n : undefined\r\n }\r\n label={t(translations.RepairCodes)}\r\n placeholder={t(\r\n translations.PleaseSelectAnAlertRepairCode,\r\n )}\r\n disabled={\r\n formik.isSubmitting ||\r\n readonly ||\r\n ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n .NotEditable === true &&\r\n formik.values.IsClosed === true)\r\n }\r\n fullWidth\r\n />\r\n \r\n \r\n \r\n \r\n \r\n setRemindBeforeChanged(true)}\r\n fullWidth\r\n />\r\n \r\n \r\n \r\n \r\n \r\n {formik.values.Assets.length > 0 &&\r\n (formik.values.Assets as IAssetDto[])[0].ServiceTypeId ===\r\n ServiceType.Online &&\r\n ((isEdit &&\r\n (isAdmin || initialValues.OfflineEventStart !== null)) ||\r\n (!isEdit && isAdmin)) && (\r\n \r\n \r\n setDownTimeChanged(true)}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n formik.setFieldValue(\r\n 'OfflineEventEnd',\r\n dateUtils.formatISO(newDate()),\r\n );\r\n setUnlimitedDowntime(false);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n */}\r\n \r\n )}\r\n {formik.values.WorkOrderType !== null &&\r\n (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n .CustomFormId !== null && (\r\n {\r\n formik.setFieldValue(\r\n 'SubmissionFormValues',\r\n updateFormValues(\r\n formik.values.SubmissionFormValues,\r\n values,\r\n formik.values.Id > 0 ? formik.values.Id : null,\r\n formik.values.WorkOrderType?.Id || null,\r\n ),\r\n false,\r\n );\r\n formik.setFieldValue(\r\n 'SubmissionFormFiles',\r\n files,\r\n false,\r\n );\r\n setOriginalSubFormFiles(originalFiles);\r\n }}\r\n />\r\n )}\r\n \r\n \r\n {!isEdit && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n {isEdit && formik.values.HasAletForm && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {formik.values.StuffCustomForm !== null &&\r\n formik.values.StuffCustomForm.Id !== 0 && (\r\n {\r\n formik.setFieldValue(\r\n 'StaffFormValues',\r\n updateFormValues(\r\n formik.values.StaffFormValues,\r\n values,\r\n formik.values.Id > 0\r\n ? formik.values.Id\r\n : null,\r\n null,\r\n ),\r\n false,\r\n );\r\n formik.setFieldValue(\r\n 'StaffFormFiles',\r\n files,\r\n false,\r\n );\r\n setOriginalStaffFormFiles(originalFiles);\r\n }}\r\n />\r\n )}\r\n \r\n )}\r\n\r\n {readonlyDetails !== undefined && isEdit && expanded && (\r\n \r\n \r\n \r\n )}\r\n {(isEdit\r\n ? !!linkedWorkOrders && linkedWorkOrders.length > 0\r\n : savedLinkedOrders.length > 0) && (\r\n {\r\n return {\r\n Id: f.Id,\r\n Name: `${f.AssetName} - ${f.Name}`,\r\n ParentId: -1,\r\n Linked: [],\r\n };\r\n })\r\n }\r\n onHoverClick={item => {\r\n isEdit\r\n ? removeCalibrationOrder(item)\r\n : changeLinkedOrders(\r\n [item as Entity as IWorkOrderDetailsDto],\r\n 'remove',\r\n );\r\n }}\r\n onItemClcik={item => {\r\n isEdit\r\n ? dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.WorkOrderDetails,\r\n props: {\r\n queryParams: { id: '' + item.Id },\r\n useSidePanel: true,\r\n continueTo: {\r\n pageType: useSidePanel\r\n ? RenderPageType.WorkOrderDetails\r\n : undefined,\r\n pageProps: useSidePanel\r\n ? {\r\n queryParams: {\r\n id: '' + formik.values.Id,\r\n },\r\n useSidePanel: true,\r\n }\r\n : undefined,\r\n continueToLink: useSidePanel\r\n ? undefined\r\n : pageLink,\r\n },\r\n } as WorkOrderDetailsProps,\r\n }),\r\n )\r\n : !!onLinkedClick && onLinkedClick(item);\r\n }}\r\n showProcessing={linksProcessing}\r\n />\r\n )}\r\n {isAdmin &&\r\n formik.values.WorkOrderType !== null &&\r\n formik.values.Assets.length > 0 && (\r\n \r\n f.Id),\r\n ...[formik.values.Id],\r\n ]\r\n : savedLinkedOrders.map(f => f.Id)\r\n }\r\n saveLinkedOrders={value => {\r\n if (isEdit) {\r\n addCalibrationOrder({\r\n Id: value.Id,\r\n Name: value.Name,\r\n });\r\n } else {\r\n changeLinkedOrders([value], 'add');\r\n }\r\n }}\r\n />\r\n \r\n )}\r\n {/* {readonlyDetails !== undefined &&\r\n readonlyDetails.LinkedAlerts.length > 0 &&\r\n isEdit && (\r\n <>\r\n {expanded ? (\r\n \r\n <>\r\n {readonlyDetails.LinkedAlerts.map((l, i) => {\r\n return (\r\n \r\n dispatch(\r\n workOrderActions.removeFromLinked(\r\n item.Id,\r\n ),\r\n )\r\n }\r\n >\r\n \r\n dispatch(\r\n actions.openSidePanel({\r\n type:\r\n RenderPageType.WorkOrderDetails,\r\n props: {\r\n queryParams: { id: '' + l.Id },\r\n useSidePanel: true,\r\n } as WorkOrderDetailsProps,\r\n }),\r\n )\r\n }\r\n >\r\n #{l.Id} - {l.Name}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n \r\n dispatch(actions.setExpanded(true))\r\n }\r\n >\r\n {t(translations.LinkedWorkOrders).replace(\r\n '{0}',\r\n readonlyDetails.LinkedAlerts.length.toString(),\r\n )}\r\n \r\n \r\n )}\r\n \r\n )}\r\n {initialValues.RecurringAssetId &&\r\n isEdit &&\r\n isAdmin &&\r\n expanded && (\r\n \r\n setAddToLinked(v)}\r\n value={addToLinked}\r\n />\r\n \r\n dispatch(\r\n workOrderActions.addToLinked({\r\n id: addToLinked!.Id,\r\n link: initialValues.RecurringAssetId!,\r\n }),\r\n )\r\n }\r\n >\r\n Add to linked\r\n \r\n \r\n )} */}\r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import {\r\n formFileSchema,\r\n formValueSchema,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport {\r\n EntityNumberSchema,\r\n EntityStringSchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport * as Yup from 'yup';\r\nimport { WorkOrderDetailsState } from '../slice/types';\r\n\r\nexport const getWorkOrdersShema = (\r\n t: TFunction,\r\n): Yup.SchemaOf => {\r\n return Yup.object({\r\n Id: Yup.number().notRequired().default(-1),\r\n Assets: Yup.array()\r\n .of(EntityNumberSchema)\r\n .label(t(translations.Asset) as string)\r\n .min(1)\r\n .required(t(translations.err_AssetRequired)),\r\n WorkOrderType: Yup.mixed()\r\n .label(t(translations.AlertType) as string)\r\n .required(t(translations.errEvent_Type_Required) as string)\r\n .typeError(t(translations.errEvent_Type_Required) as string),\r\n AlertTitle: Yup.string()\r\n .label(t(translations.AlertName) as string)\r\n .nullable(true)\r\n .required(t(translations.err_AlertNameRequired) as string),\r\n WorkOrderTypeStatus: Yup.mixed()\r\n .label(t(translations.EventTypeStatus) as string)\r\n .required(t(translations.errEvent_Type_Status_Required) as string),\r\n EventStart: Yup.date()\r\n .label(t(translations.EventDueDate) as string)\r\n .default(dateUtils.dateOrStringToDate(new Date()))\r\n\r\n .required(() => t(translations.err_EventDueDateRequired) as string),\r\n EventEnd: Yup.date().notRequired().nullable(),\r\n RemindBefore: Yup.mixed().label(t(translations.RemindMeBefore) as string),\r\n AlertStart: Yup.date()\r\n .label(t(translations.AlertStartTimeLabel) as string)\r\n .nullable()\r\n .when('RemindBefore', {\r\n is: val => val.Id === 6,\r\n then: Yup.date()\r\n .label(t(translations.AlertStartTimeLabel) as string)\r\n .default(\r\n dateUtils.addDays(dateUtils.dateOrStringToDate(new Date()), -1),\r\n )\r\n .nullable()\r\n .required(\r\n `${t(translations.AlertStartTimeLabel) as string} is required.`,\r\n )\r\n .max(Yup.ref('EventStart')),\r\n }),\r\n SymptomCodes: Yup.array()\r\n .of(EntityNumberSchema)\r\n .label(t(translations.SymptomCodes) as string),\r\n\r\n AssignUsers: Yup.array()\r\n .of(EntityStringSchema)\r\n .label(t(translations.AssignedUsers) as string),\r\n RepairCodes: Yup.array()\r\n .of(EntityNumberSchema)\r\n .label(t(translations.RepairCodes) as string),\r\n Description: Yup.string()\r\n .label(t(translations.Description) as string)\r\n .nullable(),\r\n Downtime: Yup.boolean().label(t(translations.Downtime) as string),\r\n OfflineEventStart: Yup.date()\r\n .label(t(translations.OfflineEventStartLabel) as string)\r\n .nullable()\r\n .when('Downtime', {\r\n is: check => check === true,\r\n then: Yup.date()\r\n .label(t(translations.OfflineEventStartLabel) as string)\r\n .nullable()\r\n .required(t(translations.OfflineEventStartRequired) as string),\r\n }),\r\n OfflineEventEnd: Yup.date()\r\n .label(t(translations.OfflineEventEndLabel) as string)\r\n .nullable()\r\n .when('OfflineEventStart', {\r\n is: start => start != null,\r\n then: Yup.date()\r\n .label(t(translations.OfflineEventEndLabel) as string)\r\n .nullable()\r\n .min(\r\n Yup.ref('OfflineEventStart'),\r\n t(translations.err_DownTimeEndGreaterThenStart) as string,\r\n ),\r\n }),\r\n OfflineRemarks: Yup.string().nullable(),\r\n ReasonType: Yup.mixed(),\r\n ToDown: Yup.boolean().default(false),\r\n AutoCreateTitle: Yup.string().nullable(true).notRequired(),\r\n RecurringAssetId: Yup.number().nullable(true).notRequired().default(null),\r\n RecurringGroupId: Yup.number().nullable(true).notRequired().default(null),\r\n StaffFormValues: Yup.array().of(formValueSchema),\r\n SubmissionFormValues: Yup.array().of(formValueSchema),\r\n SubmissionFormFiles: Yup.array().of(formFileSchema),\r\n StaffFormFiles: Yup.array().of(formFileSchema),\r\n StuffCustomForm: Yup.mixed().nullable(true).notRequired().default(null),\r\n HasAletForm: Yup.boolean().default(false),\r\n IsClosed: Yup.boolean().default(false),\r\n ClosedStatuses: Yup.array().of(EntityNumberSchema),\r\n ReportedBy: Yup.string().nullable(true),\r\n ShowOnCalibrationHistory: Yup.boolean().default(false),\r\n NotEditable: Yup.boolean().default(false),\r\n ReservationId: Yup.number().nullable(true).notRequired().default(null),\r\n });\r\n};\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectExpandedSidePanel,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useWorkOrderSlice } from './slice';\r\nimport {\r\n selectCreateWorkOrder,\r\n selectCreateWorkOrderCompleted,\r\n selectCreateWorkOrderHasError,\r\n selectCreateWorkOrderProcessing,\r\n selectReadonlyWorkOrder,\r\n selectReservationOfflineCompleted,\r\n selectReservationOfflineData,\r\n selectReservationOfflineProcessing,\r\n selectSendEmailOnResOffline,\r\n selectUpdateWorkOrder,\r\n selectUpdateWorkOrderCompleted,\r\n selectUpdateWorkOrderHasError,\r\n selectUpdateWorkOrderProcessing,\r\n selectWorkOrderProcessing,\r\n} from './slice/selectors';\r\nimport {\r\n ContinueToState,\r\n WorkOrderDetailsState,\r\n WorkOrderGlobalState,\r\n WorkOrderQueryStringParameters,\r\n} from './slice/types';\r\nimport * as React from 'react';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { push, routerActions } from 'connected-react-router';\r\nimport {\r\n DeleteOrderButton,\r\n ReopenOrderButton,\r\n SaveFormButton,\r\n} from './Actions/WorkOrderActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { WorkOrderForm } from './WorkOrderForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport {\r\n IAssetDto,\r\n mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectRepetitiveData } from 'app/components/Forms/FormRepetitive/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport Box from '@material-ui/core/Box';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { WorkOrderApi as api } from 'api/WorkOrderApi';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ActionIconButton } from 'app/components/BasicButtons/ActionIconButton';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { RadioGroup } from 'app/components/RadioGroup';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport {\r\n SwitchActionsProps,\r\n SwitchTarget,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions';\r\nimport { FormikProps } from 'formik';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { MenuItem } from '@material-ui/core';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nexport type NotifyUsersRadioGroupOptionTypes =\r\n | 'No'\r\n | 'JustBookedUsers'\r\n | 'AllAffectedUsers';\r\n\r\nexport type CancelAffectedReservationsRadioGroupOptionTypes = 'No' | 'Yes';\r\nexport type ContinueWOAction = 'list' | 'edit';\r\nexport interface WorkOrderDetailsProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n queryParams: WorkOrderQueryStringParameters;\r\n useSwithButtons?: boolean;\r\n continueTo?: ContinueToState;\r\n onClose?: () => void;\r\n}\r\nexport function WorkOrderDetails(props: WorkOrderDetailsProps) {\r\n const {\r\n queryParams,\r\n useSidePanel,\r\n useSwithButtons,\r\n continueTo,\r\n closeCover,\r\n isCover,\r\n } = props;\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const { actions } = useWorkOrderSlice();\r\n const { actions: globalActions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n /// Use Effect on Mount ///\r\n\r\n /// Selectors ///\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const loading = useSelector(selectWorkOrderProcessing);\r\n const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const repetitiveValues = useSelector(selectRepetitiveData);\r\n const readonlyDetails = useSelector(selectReadonlyWorkOrder);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const sendOfflineEmail = useSelector(selectSendEmailOnResOffline);\r\n const sendOfflineProcessing = useSelector(selectReservationOfflineProcessing);\r\n const sendOfflineData = useSelector(selectReservationOfflineData);\r\n const sendEmailCompleted = useSelector(selectReservationOfflineCompleted);\r\n const createModel = useSelector(selectCreateWorkOrder, shallowEqual);\r\n const editModel = useSelector(selectUpdateWorkOrder, shallowEqual);\r\n const requestCreateCompleted = useSelector(selectCreateWorkOrderCompleted);\r\n const requestUpdateCompleted = useSelector(selectUpdateWorkOrderCompleted);\r\n const hasCreateProcessing = useSelector(selectCreateWorkOrderProcessing);\r\n const hasUpdateUpdateProcessing = useSelector(\r\n selectUpdateWorkOrderProcessing,\r\n );\r\n const hasCreateError = useSelector(selectCreateWorkOrderHasError);\r\n const hasUpdateError = useSelector(selectUpdateWorkOrderHasError);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const globalSettings = useGlobalSettingsHook();\r\n //cover\r\n const { cover, openPanel, closePanel, coverClosed, onCloseCover } =\r\n useSidePanelState(\r\n () => {\r\n if (edit) {\r\n dispatch(actions.resetUpdateWorkOrderState());\r\n } else {\r\n dispatch(actions.resetCreateWorkOrderState());\r\n }\r\n dispatch(actions.resetReservationsOfflineState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n\r\n /// Local State ///\r\n const [busy, setBusy] = React.useState(false);\r\n const [edit, setEdit] = React.useState(false);\r\n const innerFormRef = React.useRef | null>(\r\n null,\r\n );\r\n const [showConfirmRecurring, setShowConfirmRecurring] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [showDeleteRecurring, setShowDeleteRecurring] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [showSendEmail, setShowSendEmail] = React.useState(\r\n undefined,\r\n );\r\n const [showCloseStatus, setShowCloseStatus] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [closedStatus, setClosedStatus] = React.useState<\r\n IWorkOrderTypeStatusDto | undefined\r\n >(undefined);\r\n const [radioNotifyUsersValue, setRadioNotifyUsersValue] = React.useState<\r\n NotifyUsersRadioGroupOptionTypes | undefined\r\n >('JustBookedUsers');\r\n\r\n const [\r\n radioCancelAffectedReservationsValue,\r\n setRadioCancelAffectedReservationsValue,\r\n ] = React.useState<\r\n CancelAffectedReservationsRadioGroupOptionTypes | undefined\r\n >('No');\r\n\r\n const [\r\n workOrderOfflineStartChangedValue,\r\n setWorkOrderOfflineStartChangedValue,\r\n ] = React.useState();\r\n\r\n const [workOrderOfflineEndChangedValue, setWorkOrderOfflineEndChangedValue] =\r\n React.useState();\r\n\r\n const [isCloseWorkOrderClicked, setIsCloseWorkOrderClicked] =\r\n React.useState(false);\r\n\r\n /// Memo variables ///\r\n const hasProcessing = React.useMemo(() => {\r\n return hasCreateProcessing || hasUpdateUpdateProcessing;\r\n }, [hasCreateProcessing, hasUpdateUpdateProcessing]);\r\n\r\n const hasError = React.useMemo(() => {\r\n return hasCreateError || hasUpdateError;\r\n }, [hasCreateError, hasUpdateError]);\r\n\r\n const baseModel = React.useMemo(() => {\r\n return createModel || editModel || undefined;\r\n }, [createModel, editModel]);\r\n\r\n const showShortView = React.useMemo(() => {\r\n return isMobile || (useSidePanel && !sidePanelExpanded);\r\n }, [isMobile, useSidePanel, sidePanelExpanded]);\r\n\r\n const IsAdmin = React.useMemo(() => {\r\n return (\r\n User?.Roles?.includes(Roles.InstrumentEventsAdmin) ||\r\n User?.IsAllGroupOrLabTechAdmin(\r\n baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n mapAssetsToServiceTypeFilterDto(\r\n (baseModel?.Assets === undefined\r\n ? []\r\n : baseModel?.Assets) as IAssetDto[],\r\n ),\r\n ) ||\r\n User?.IsAllInstrumentEventsGroupPermissions(\r\n baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n )\r\n );\r\n }, [User, baseModel]);\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n const viewPermissions = React.useMemo(() => {\r\n return (\r\n !edit ||\r\n (edit &&\r\n (IsAdmin ||\r\n (baseModel?.ReportedBy === (User?.Id || '') &&\r\n !(baseModel?.WorkOrderType as IWorkOrderTypeDto).StaffOnly)))\r\n );\r\n }, [\r\n IsAdmin,\r\n User?.Id,\r\n baseModel?.ReportedBy,\r\n baseModel?.WorkOrderType,\r\n edit,\r\n ]);\r\n const openAsset = useOpenAssetPopUp();\r\n const repeat = React.useMemo(() => {\r\n return (\r\n edit &&\r\n (!isNullOrUndefined(baseModel?.RecurringAssetId) ||\r\n !isNullOrUndefined(baseModel?.RecurringGroupId))\r\n );\r\n }, [edit, baseModel]);\r\n\r\n const [typeName, setTypeName] = React.useState(\r\n baseModel?.WorkOrderType?.Name,\r\n );\r\n\r\n const newCommentIds = React.useRef();\r\n const onNewCommmentAdded = React.useCallback((commentId: number) => {\r\n newCommentIds.current = [...(newCommentIds.current ?? []), commentId];\r\n }, []);\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n if (\r\n queryParams.id !== undefined &&\r\n !isNaN(parseInt(queryParams.id || ''))\r\n ) {\r\n dispatch(actions.initUpdateWorkOrder(queryParams));\r\n } else {\r\n dispatch(actions.initWorkOrder(queryParams));\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actions, dispatch, firstLoad, globalSettings, queryParams]);\r\n React.useEffect(() => {\r\n setTypeName(\r\n innerFormRef.current?.values.WorkOrderType?.Name ??\r\n baseModel?.WorkOrderType?.Name,\r\n );\r\n }, [\r\n baseModel?.WorkOrderType?.Name,\r\n innerFormRef.current?.values.WorkOrderType?.Name,\r\n ]);\r\n\r\n const reservationSwithProps = React.useMemo(() => {\r\n if (!edit && baseModel) {\r\n let eqids = queryParams.eqid;\r\n let start = queryParams.eStart || queryParams.offStart;\r\n let end = queryParams.offEnd;\r\n let defaultMulti = globalSettings.multipleInstrumentsEnabled;\r\n if (!!baseModel) {\r\n start = dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel.EventStart),\r\n );\r\n end =\r\n baseModel.OfflineEventEnd !== null &&\r\n baseModel.OfflineEventEnd !== undefined\r\n ? dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel.OfflineEventEnd),\r\n )\r\n : undefined;\r\n defaultMulti =\r\n globalSettings.multipleInstrumentsEnabled &&\r\n baseModel.Assets.length > 0;\r\n eqids = (baseModel.Assets as IAssetDto[])\r\n .map(f => f.ServiceId)\r\n .filter(f => f !== undefined && f !== null)\r\n .join(',');\r\n }\r\n\r\n let p = {\r\n useSidePanel: true,\r\n queryParams: {\r\n selectedIds: eqids,\r\n Start: start,\r\n End: end,\r\n defaultMulti: defaultMulti.toString(),\r\n source: queryParams.source,\r\n } as ReservationQueryStringParameters,\r\n useSwitchButtons: useSwithButtons,\r\n } as ReservationDetailsProps;\r\n return p;\r\n }\r\n return undefined;\r\n }, [\r\n baseModel,\r\n edit,\r\n globalSettings.multipleInstrumentsEnabled,\r\n queryParams.eStart,\r\n queryParams.eqid,\r\n queryParams.offEnd,\r\n queryParams.offStart,\r\n queryParams.source,\r\n useSwithButtons,\r\n ]);\r\n /// Refs ///\r\n const submitFormRef = React.useRef(null);\r\n const repetitiveFormRef = React.useRef(null);\r\n const workOrderTypeFormRef = React.useRef(null);\r\n const workOrderStaffFormRef = React.useRef(null);\r\n const submitCommentRef = React.useRef(null);\r\n\r\n /// Handlers ///\r\n const handleSaveClick = React.useCallback(\r\n (e: any) => {\r\n if (repeat) {\r\n setShowConfirmRecurring(true);\r\n } else {\r\n handleSubmitForm(e);\r\n }\r\n },\r\n [repeat],\r\n );\r\n const handleSubmitForm = async (e: any) => {\r\n if (submitCommentRef.current) {\r\n await submitCommentRef.current(e);\r\n }\r\n if (workOrderTypeFormRef.current) {\r\n workOrderTypeFormRef.current(e);\r\n }\r\n if (workOrderStaffFormRef.current) {\r\n workOrderStaffFormRef.current(e);\r\n }\r\n if (repetitiveFormRef.current) {\r\n repetitiveFormRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const [commentsReady, setCommentsReady] = React.useState(false);\r\n const onCommentsReady = React.useCallback(() => {\r\n setCommentsReady(true);\r\n }, []);\r\n const [createValue, setCreateValue] = React.useState();\r\n React.useEffect(() => {\r\n if (commentsReady && createValue) {\r\n dispatch(\r\n actions.createWorkOrder({\r\n ...createValue,\r\n commmentIds: newCommentIds.current,\r\n }),\r\n );\r\n setCommentsReady(false);\r\n setCreateValue(undefined);\r\n }\r\n }, [actions, commentsReady, createValue, dispatch]);\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (\r\n values: WorkOrderDetailsState,\r\n subFormFiles: IFormFileValue[],\r\n staffFormFiles: IFormFileValue[],\r\n ) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateWorkOrder({\r\n current: values,\r\n original: baseModel,\r\n originalSubFormFiles: subFormFiles,\r\n originalStaffFormFiles: staffFormFiles,\r\n }),\r\n );\r\n } else {\r\n let value = {\r\n workOrderDetails: values,\r\n RepetitiveOptions: repetitiveValues,\r\n commmentIds: newCommentIds.current,\r\n } as WorkOrderGlobalState;\r\n if (submitCommentRef.current) {\r\n setCreateValue(value);\r\n } else {\r\n dispatch(actions.createWorkOrder(value));\r\n }\r\n }\r\n },\r\n [actions, baseModel, dispatch, edit, repetitiveValues],\r\n );\r\n\r\n const handleCancelClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n if (edit) {\r\n dispatch(actions.resetUpdateWorkOrderState());\r\n } else {\r\n dispatch(actions.resetCreateWorkOrderState(newCommentIds.current));\r\n }\r\n dispatch(actions.resetReservationsOfflineState());\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/workorders'));\r\n }\r\n }, [actions, closePanel, dispatch, edit, hasChanges, isCover, useSidePanel]);\r\n const handleTypeChange = React.useCallback(\r\n (orderType: IWorkOrderTypeDto | undefined) => {},\r\n [],\r\n );\r\n //------ Confirm Repetitive Update/Delete handlers -------//\r\n const handleUpdateAllRecurrent = (e: any) => {\r\n dispatch(actions.setUpdateAllRecurrent(true));\r\n handleSubmitForm(e);\r\n setShowConfirmRecurring(false);\r\n };\r\n const handleUpdateJustOne = (e: any) => {\r\n dispatch(actions.setUpdateAllRecurrent(false));\r\n handleSubmitForm(e);\r\n setShowConfirmRecurring(false);\r\n };\r\n const handleDeleteOrder = React.useCallback(\r\n (action: boolean | null) => {\r\n var payload = {\r\n Id: baseModel?.Id || 0,\r\n all: action,\r\n };\r\n api\r\n .deleteOrders(payload)\r\n .then(response => {\r\n // const messages: IResponseType = GetResponseMessages(\r\n // response,\r\n // t(translations.Success) as string,\r\n // );\r\n //console.log(response);\r\n handleCancelClick();\r\n if (response.ErrorMessages.length > 0) {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'deleteOrderError',\r\n message: t(\r\n translations.OnlyMainOrResourceWorkOrdersAdminCanDeleteCalibrationRecords,\r\n ) as string,\r\n variant: 'error',\r\n }),\r\n );\r\n } else {\r\n dispatch(\r\n globalActions.addNotification({\r\n key: 'deleteOrder',\r\n message: 'Item deleted successfully',\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n dispatch(layoutActions.setRefreshTable(true));\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(translations.Failed) as string;\r\n dispatch(\r\n globalActions.addNotification({\r\n variant: 'error',\r\n message:\r\n 'Some thing went wrong. Item can not be deleted.: ' + !!err\r\n ? err\r\n : '',\r\n key: 'deleteOrder',\r\n }),\r\n );\r\n });\r\n },\r\n [baseModel, dispatch, globalActions, handleCancelClick, layoutActions, t],\r\n );\r\n //------ Send Emails on Reservation Downtime handlets ------//\r\n const handleSendEmailClick = React.useCallback(() => {\r\n if (sendOfflineData && sendOfflineData.length > 0) {\r\n dispatch(\r\n actions.sendReservationsOfflineEmail({\r\n cancel: radioCancelAffectedReservationsValue === 'Yes' ? true : false,\r\n deleted: false,\r\n insert: !edit,\r\n doNotNotifyUsers: radioNotifyUsersValue === 'No' ? true : false,\r\n allAffectedUsers:\r\n radioNotifyUsersValue === 'AllAffectedUsers' ? true : false,\r\n reservationOffline: sendOfflineData,\r\n }),\r\n );\r\n }\r\n setIsCloseWorkOrderClicked(false);\r\n }, [\r\n actions,\r\n dispatch,\r\n edit,\r\n radioCancelAffectedReservationsValue,\r\n radioNotifyUsersValue,\r\n sendOfflineData,\r\n ]);\r\n /* const handleSendEmailWithCancel = React.useCallback(() => {\r\n if (sendOfflineData && sendOfflineData.length > 0) {\r\n dispatch(\r\n actions.sendReservationsOfflineEmail({\r\n cancel: true,\r\n deleted: false,\r\n insert: !edit,\r\n reservationOffline: sendOfflineData,\r\n }),\r\n );\r\n }\r\n }, [actions, dispatch, edit, sendOfflineData]); */\r\n const handleCancelSend = React.useCallback(() => {\r\n dispatch(actions.resetReservationsOfflineState());\r\n setIsCloseWorkOrderClicked(false);\r\n }, [actions, dispatch]);\r\n const handleCloseOrder = React.useCallback(\r\n (event: any, status: IWorkOrderTypeStatusDto) => {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'WorkOrderTypeStatus',\r\n fieldValue: status,\r\n }),\r\n );\r\n //setChangedStatus(status);\r\n handleSaveClick(event);\r\n setIsCloseWorkOrderClicked(true);\r\n },\r\n [actions, dispatch, handleSaveClick],\r\n );\r\n const handleOpenOrder = React.useCallback(\r\n (event: any) => {\r\n api\r\n .getNewWorkOrderStatus(baseModel?.WorkOrderType?.Id || 0)\r\n .then(result => {\r\n let res = result as IWorkOrderTypeStatusDto[];\r\n if (res.length > 0) {\r\n dispatch(\r\n actions.setAnyValue({\r\n fieldKey: 'WorkOrderTypeStatus',\r\n fieldValue: res[0],\r\n }),\r\n );\r\n //setChangedStatus(res[0]);\r\n handleSaveClick(event);\r\n }\r\n });\r\n },\r\n [actions, baseModel?.WorkOrderType?.Id, dispatch, handleSaveClick],\r\n );\r\n const handleDeleteClick = React.useCallback(() => {\r\n if (repeat) {\r\n setShowDeleteRecurring(true);\r\n } else {\r\n handleDeleteOrder(null);\r\n }\r\n }, [handleDeleteOrder, repeat]);\r\n\r\n const handleDeleteAllNext = (e: any) => {\r\n handleDeleteOrder(false);\r\n setShowDeleteRecurring(false);\r\n };\r\n const handleDeleteAll = (e: any) => {\r\n handleDeleteOrder(true);\r\n setShowDeleteRecurring(false);\r\n };\r\n const handleNotifyUsersChange = event => {\r\n setRadioNotifyUsersValue(event);\r\n console.log(radioNotifyUsersValue);\r\n };\r\n\r\n const handleCancelAffectedReservationsChange = event => {\r\n setRadioCancelAffectedReservationsValue(event);\r\n console.log(radioCancelAffectedReservationsValue);\r\n };\r\n\r\n const isChangedDowntimeShorter = (): boolean => {\r\n let isChangedStartDowntimeShorter: boolean = true;\r\n let isChangedEndDowntimeShorter: boolean = true;\r\n if (\r\n !!workOrderOfflineStartChangedValue &&\r\n !!baseModel &&\r\n !!baseModel.OfflineEventStart\r\n ) {\r\n isChangedStartDowntimeShorter =\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(workOrderOfflineStartChangedValue ?? ''),\r\n ) <\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel?.OfflineEventStart ?? ''),\r\n );\r\n }\r\n if (\r\n !!workOrderOfflineEndChangedValue &&\r\n !!baseModel &&\r\n !!baseModel.OfflineEventEnd\r\n ) {\r\n isChangedEndDowntimeShorter =\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(workOrderOfflineEndChangedValue ?? ''),\r\n ) >\r\n dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel?.OfflineEventEnd ?? ''),\r\n );\r\n }\r\n //return workOrderOfflineStartChangedValue < OfflineEventStart || workOrderOfflineEndChangedValue > OfflineEventEnd\r\n return isChangedStartDowntimeShorter && isChangedEndDowntimeShorter;\r\n };\r\n\r\n /// Use Effects ///\r\n React.useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n setEdit(true);\r\n } else {\r\n setEdit(false);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n if (sendOfflineEmail) {\r\n setShowSendEmail(true);\r\n } else {\r\n setShowSendEmail(false);\r\n handleCancelClick();\r\n }\r\n }\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n if (sendEmailCompleted) {\r\n handleCancelClick();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n baseModel,\r\n handleCancelClick,\r\n hasError,\r\n queryParams,\r\n loading,\r\n requestCompleted,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n sendEmailCompleted,\r\n sendOfflineEmail,\r\n ]);\r\n // To do: implement confirmSendEmails when downtime pass on existing reservation\r\n\r\n const leftActions = React.useMemo(() => {\r\n let actions = [\r\n () => (\r\n \r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy || (baseModel?.NotEditable && baseModel?.IsClosed)}\r\n processing={!requestCompleted && busy}\r\n edit={edit || false}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n if (\r\n edit &&\r\n IsAdmin &&\r\n baseModel &&\r\n !baseModel.IsClosed &&\r\n baseModel.ClosedStatuses.length > 0\r\n ) {\r\n actions.push(() => (\r\n \r\n {baseModel.ClosedStatuses.length === 1 ? (\r\n {\r\n setShowCloseStatus(true);\r\n setClosedStatus(\r\n baseModel.ClosedStatuses[0] as IWorkOrderTypeStatusDto,\r\n );\r\n }}\r\n >\r\n {showShortView\r\n ? t(translations.CloseIncident)\r\n : t(translations.CloseEvent)}\r\n \r\n ) : (\r\n \r\n (baseModel.ClosedStatuses as IWorkOrderTypeStatusDto[]).map(\r\n s => (\r\n
    \r\n {\r\n setShowCloseStatus(true);\r\n setClosedStatus(s);\r\n }}\r\n >\r\n {s.Name}\r\n \r\n
    \r\n ),\r\n )\r\n }\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'top',\r\n horizontal: 'center',\r\n },\r\n transformOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'center',\r\n },\r\n }}\r\n addChevron\r\n >\r\n {showShortView\r\n ? t(translations.CloseIncident)\r\n : t(translations.CloseEvent)}\r\n \r\n )}\r\n
    \r\n // \r\n ));\r\n }\r\n if (edit && IsAdmin && baseModel && baseModel.IsClosed) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n if (edit && IsAdmin && baseModel) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n return actions;\r\n }, [\r\n IsAdmin,\r\n baseModel,\r\n busy,\r\n edit,\r\n handleDeleteClick,\r\n handleOpenOrder,\r\n handleSaveClick,\r\n requestCompleted,\r\n showShortView,\r\n t,\r\n ]);\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCancelClick, t]);\r\n\r\n const topActions = React.useMemo(() => {\r\n let actions = [] as ActionRenderer[];\r\n if (edit) {\r\n if (baseModel?.Downtime) {\r\n if (IsAdmin) {\r\n actions.push(() => (\r\n }\r\n href={`/SendEmailToUsers?eid=${\r\n (baseModel.Assets[0] as IAssetDto).ServiceId || ''\r\n }&rf=${\r\n !isNullOrUndefined(baseModel.OfflineEventStart)\r\n ? dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel.OfflineEventStart),\r\n )\r\n : ''\r\n }&rt=${\r\n !isNullOrUndefined(baseModel.OfflineEventEnd)\r\n ? dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel.OfflineEventEnd),\r\n )\r\n : ''\r\n }`}\r\n >\r\n {showShortView\r\n ? t(translations.SendCustomEmail_short)\r\n : t(translations.SendCustomEmail)}\r\n \r\n ));\r\n }\r\n actions.push(() => (\r\n }\r\n variant=\"white\"\r\n target={'_blank'}\r\n start={\r\n !isNullOrUndefined(baseModel.OfflineEventStart)\r\n ? dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(baseModel.OfflineEventStart),\r\n )\r\n : ''\r\n }\r\n equipments={[\r\n (baseModel.Assets[0] as IAssetDto)?.ServiceId ?? undefined,\r\n ]}\r\n >\r\n {showShortView\r\n ? t(translations.ViewCalendar_short)\r\n : t(translations.ViewCalendar)}\r\n \r\n ));\r\n }\r\n if (!isNullOrUndefined(baseModel?.RecurringGroupId)) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n }\r\n return actions;\r\n }, [IsAdmin, baseModel, edit, showShortView, t]);\r\n\r\n const notifyUsersRadioGroupOptions = [\r\n {\r\n Id: 'No',\r\n Name: t(translations.No),\r\n Info: '',\r\n },\r\n {\r\n Id: 'JustBookedUsers',\r\n Name: t(translations.JustBookedUsers),\r\n Info: '',\r\n },\r\n {\r\n Id: 'AllAffectedUsers',\r\n Name: t(translations.AllAffectedUsers),\r\n Info: t(translations.AllAffectedUsers_info),\r\n },\r\n ];\r\n\r\n const cancelAffectedReservationsRadioGroupOptions = [\r\n {\r\n Id: 'No',\r\n Name: t(translations.No),\r\n Info: '',\r\n },\r\n {\r\n Id: 'Yes',\r\n Name: t(translations.Yes),\r\n Info: '',\r\n },\r\n ];\r\n\r\n return (\r\n \r\n reservationSwithProps,\r\n } as SwitchActionsProps)\r\n : undefined\r\n }\r\n closeSidePanel={handleCancelClick}\r\n leftTopActions={viewPermissions ? topActions : []}\r\n pageLink={buildURL(publicUrl + 'workorders/details', props.queryParams)}\r\n toPageLink={`workorders/details?${toQueryString(props.queryParams)}`}\r\n leftActions={isReadOnlyUser || !viewPermissions ? [] : leftActions}\r\n rightActions={isReadOnlyUser || !viewPermissions ? [] : rightActions}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n isCover={isCover}\r\n coverClosed={coverClosed}\r\n children={\r\n baseModel !== undefined && !loading ? (\r\n \r\n {viewPermissions || isReadOnlyUser ? (\r\n \r\n openAsset(\r\n { id: e.Id, useSidePanel: useSidePanel },\r\n openPanel,\r\n )\r\n }\r\n onLinkedClick={linked =>\r\n openPanel({\r\n renderPageType: RenderPageType.WorkOrderDetails,\r\n renderPageProps: {\r\n queryParams: {\r\n id: '' + (linked.Id ?? -1),\r\n },\r\n },\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState)\r\n }\r\n user={User}\r\n canView={viewPermissions}\r\n readonlyDetails={readonlyDetails}\r\n commentsFormRef={submitCommentRef}\r\n expanded={!showShortView}\r\n setWorkOrderOfflineStartChangedValue={\r\n setWorkOrderOfflineStartChangedValue\r\n }\r\n setWorkOrderOfflineEndChangedValue={\r\n setWorkOrderOfflineEndChangedValue\r\n }\r\n onNewCommmentAdded={onNewCommmentAdded}\r\n onCommmentsReady={onCommentsReady}\r\n />\r\n ) : (\r\n // \r\n \r\n \r\n

    \r\n {t(translations.WorkOrderRestrictedNotAllowed) as string}\r\n

    \r\n }\r\n onClick={() => {\r\n if (!!continueTo) {\r\n if (!!continueTo.pageProps && !!continueTo.pageType) {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueTo.pageType,\r\n props: continueTo.pageProps,\r\n }),\r\n );\r\n } else if (!!continueTo.continueToLink) {\r\n dispatch(\r\n routerActions.push(continueTo.continueToLink),\r\n );\r\n } else {\r\n handleCancelClick();\r\n }\r\n } else {\r\n handleCancelClick();\r\n }\r\n }}\r\n >\r\n {t(translations.Continue)}\r\n \r\n \r\n \r\n )}\r\n
    \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n confirm={\r\n requestCompleted && sendOfflineEmail ? (\r\n \r\n \r\n {edit\r\n ? t(translations.TheDowntimePeriodHasChangedNotifyUsers)\r\n : t(translations.NotifyUsers)}\r\n \r\n \r\n {isChangedDowntimeShorter() &&\r\n isCloseWorkOrderClicked === false && (\r\n \r\n \r\n {t(translations.CancelAffectedReservations)}\r\n \r\n \r\n \r\n )}\r\n
    \r\n }\r\n confirmButtonLabel={\r\n edit\r\n ? t(translations.UpdateDowntime)\r\n : t(translations.CreateDowntime)\r\n }\r\n cancelButtonLabel={t(translations.Cancel)}\r\n onConfirm={handleSendEmailClick}\r\n onCancel={handleCancelSend}\r\n maxWidth=\"md\"\r\n /* actions={[\r\n () => (\r\n \r\n ),\r\n ]} */\r\n />\r\n ) : showConfirmRecurring ? (\r\n {\r\n setShowConfirmRecurring(false);\r\n }}\r\n actions={[\r\n () => (\r\n \r\n ),\r\n ]}\r\n />\r\n ) : showDeleteRecurring ? (\r\n {\r\n setShowConfirmRecurring(false);\r\n }}\r\n actions={[\r\n () => (\r\n handleDeleteOrder(null)}\r\n />\r\n ),\r\n () => (\r\n \r\n ),\r\n ]}\r\n />\r\n ) : showCloseStatus ? (\r\n {\r\n if (!!closedStatus) {\r\n handleCloseOrder(e, closedStatus);\r\n }\r\n }}\r\n onCancel={() => {\r\n setClosedStatus(undefined);\r\n setShowCloseStatus(false);\r\n }}\r\n onClose={() => {\r\n setClosedStatus(undefined);\r\n setShowCloseStatus(false);\r\n }}\r\n maxWidth=\"md\"\r\n />\r\n ) : (\r\n <>\r\n )\r\n }\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n
    \r\n );\r\n}\r\n","/**\r\n *\r\n * ScreenToShowOnPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { ScreenToShowOn } from 'enums/ScreenToShowOn';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface ScreenToShowOnPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSingleScreenToShowOn = (val: number): Entity => {\r\n return enumToEntityArray(ScreenToShowOn).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initScreenToShowOnData = (\r\n initval: number | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSingleScreenToShowOn(initval)]);\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(ScreenToShowOn);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function ScreenToShowOnPicker(props: ScreenToShowOnPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * InvoiceStatusWithStaticOptionsPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { InvoiceStatuses } from 'enums/InvoiceStatuses';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface InvoiceStatusWithStaticOptionsPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const getSingleInvoiceStatusWithStaticOptions = (\r\n val: number,\r\n): Entity => {\r\n return enumToEntityArray(InvoiceStatuses).filter(item => {\r\n return item.Id === val;\r\n })[0];\r\n};\r\n\r\nexport const initInvoiceStatusWithStaticOptionsData = (\r\n initval: number | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([getSingleInvoiceStatusWithStaticOptions(initval)]);\r\n });\r\n }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(InvoiceStatuses);\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\n\r\nexport function InvoiceStatusWithStaticOptionsPicker(\r\n props: InvoiceStatusWithStaticOptionsPickerProps,\r\n) {\r\n return (\r\n \r\n );\r\n}\r\n","import { getSingleScreenToShowOn } from 'app/components/pickers/StaticOptionsPickers/ScreenToShowOnPicker';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IBillingActionsDto } from '../../../BillingActionsPage/IBillingActionsDto';\r\nimport { getSingleInvoiceFundingType } from '../../../../../components/pickers/StaticOptionsPickers/FundingTypeIdPicker/index';\r\nimport { getSingleInvoiceStatusWithStaticOptions } from '../../../../../components/pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker/index';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { getSinglePaymentMethod } from 'app/components/pickers/StaticOptionsPickers/PaymentMethodEnumPicker';\r\nimport { IEmailRecipientTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailRecipientTypesDto';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\nimport i18next from 'i18next';\r\n\r\n/* --- STATE --- */\r\nexport interface BillingActionsState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n processing: boolean;\r\n}\r\n\r\nexport interface BillingActionsDetailsState {\r\n Id: number;\r\n OperationName: string | null;\r\n ShowOn: Entity | null; //Enum\r\n FundingType: Entity | null; //Enum\r\n IsSendEmail: boolean;\r\n IsSftpUpload: boolean;\r\n EmailRecipientTypes: Entity[];\r\n SpecificEmailAddresses: string | null | undefined;\r\n Body: string | null | undefined;\r\n Subject: string | null | undefined;\r\n EmailAttachmentTypes: Entity[];\r\n ChangeStatusTo: Entity | null; //Enum\r\n GeneratePayment: Entity | null; //Enum\r\n}\r\n\r\nexport interface BillingActionsDetailsQStringParameters {\r\n id?: string; //Id\r\n opName?: string; //OperationName\r\n showOn?: string; //ShowOn\r\n fundingT?: string; //FundingType\r\n isSendEmail?: string; //IsSendEmail\r\n isSftpUpload?: string;\r\n //emailRecTypes?: string;\r\n specEmailAd?: string; //SpecificEmailAddresses\r\n body?: string; //Body\r\n sub?: string; //Subject\r\n //emailAttTypes?: string;\r\n chgStatTo?: string; //ChangeStatusTo\r\n genPay?: string; //Generate Payment\r\n}\r\n\r\nexport interface BillingActionsDetailsResponse extends IResponseType {\r\n Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityBillingActionsDetails(\r\n entity: IBillingActionsDto,\r\n): BillingActionsDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: entity.Id,\r\n OperationName: entity.OperationName,\r\n ShowOn: getSingleScreenToShowOn(entity.ShowOn),\r\n FundingType: getSingleInvoiceFundingType(entity.FundingType),\r\n IsSendEmail: entity.IsSendEmail ?? false,\r\n IsSftpUpload: entity.IsSftpUpload ?? false,\r\n SpecificEmailAddresses: entity.SpecificEmailAddresses,\r\n Body: entity.Body,\r\n Subject: entity.Subject,\r\n EmailRecipientTypes: entity.EmailRecipientTypes.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailRecipientTypesDto;\r\n }) as IEmailRecipientTypesDto[],\r\n EmailAttachmentTypes: entity.EmailAttachmentTypes.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailAttachmentTypesDto;\r\n }) as IEmailAttachmentTypesDto[],\r\n ChangeStatusTo: getSingleInvoiceStatusWithStaticOptions(\r\n entity.ChangeStatusTo,\r\n ),\r\n GeneratePayment: getSinglePaymentMethod(entity.GeneratePayment),\r\n } as BillingActionsDetailsState;\r\n }\r\n}\r\n\r\nexport function ConvertEntityToModelBillingActionsDetails(\r\n model: BillingActionsDetailsState,\r\n original: BillingActionsDetailsState | undefined,\r\n): IBillingActionsDto {\r\n let entity = {\r\n Id: original?.Id === undefined ? model.Id : original.Id,\r\n OperationName: model.OperationName,\r\n ShowOn: model.ShowOn?.Id,\r\n FundingType: model.FundingType?.Id,\r\n IsSendEmail: model.IsSendEmail ?? false,\r\n IsSftpUpload: model.IsSftpUpload ?? false,\r\n SpecificEmailAddresses: model.SpecificEmailAddresses,\r\n Body: model.Body,\r\n Subject: model.Subject,\r\n EmailRecipientTypes: model.EmailRecipientTypes.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailRecipientTypesDto;\r\n }) as IEmailRecipientTypesDto[],\r\n EmailAttachmentTypes: model.EmailAttachmentTypes.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailAttachmentTypesDto;\r\n }) as IEmailAttachmentTypesDto[],\r\n ChangeStatusTo: model.ChangeStatusTo?.Id,\r\n GeneratePayment: model.GeneratePayment?.Id,\r\n } as IBillingActionsDto;\r\n return entity;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n BillingActionsDetailsQStringParameters,\r\n BillingActionsDetailsResponse,\r\n BillingActionsDetailsState,\r\n ConvertEntityToModelBillingActionsDetails,\r\n //ConvertNewBillingActionsDetailsToModel,\r\n} from './types';\r\nimport { BillingActionsApi } from '../../../../../../api/BillingActionsApi';\r\nimport { billingActionsDetailsActions as actions } from '.';\r\nimport { IBillingActionsDto } from '../../../BillingActionsPage/IBillingActionsDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { BillingActionsDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitCreate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(BillingActionsApi.initCreateData, action.payload);\r\n yield put(actions.initBillingActionsDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initBillingActionsDetails_Error(error));\r\n }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(BillingActionsApi.initUpdateData, action.payload);\r\n yield put(actions.initUpdateBillingActionsDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initUpdateBillingActionsDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction) {\r\n const httpPayloads: IBillingActionsDto = ConvertEntityToModelBillingActionsDetails(\r\n action.payload,\r\n undefined,\r\n );\r\n try {\r\n const result = yield call(\r\n BillingActionsApi.insertBillingActionsDetails,\r\n httpPayloads,\r\n );\r\n let response: BillingActionsDetailsResponse = result as BillingActionsDetailsResponse;\r\n\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'billingActionsInsert',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'billingActionsInsert',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n if (response.Id) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'billingActionsInsert',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: true,\r\n itemName: i18next.t(translations.WorkOrdersPageName),\r\n detailsType: RenderPageType.AddBillingAction,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as BillingActionsDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as BillingActionsDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'billingActionsInsertSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.createBillingActionsDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'billingActionsInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createBillingActionsDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: BillingActionsDetailsState;\r\n original: BillingActionsDetailsState | undefined;\r\n }>,\r\n) {\r\n const httpPayloads: IBillingActionsDto = ConvertEntityToModelBillingActionsDetails(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n try {\r\n const results = yield call(\r\n BillingActionsApi.updateBillingActionsDetails,\r\n httpPayloads,\r\n );\r\n let response = results as BillingActionsDetailsResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'billingActionsUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'billingActionsUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'billingActionsUpdate',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: i18next.t(translations.BillingActionsPageName),\r\n detailsType: RenderPageType.AddBillingAction,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as BillingActionsDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as BillingActionsDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateBillingActionsDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'billingActionsUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateBillingActionsDetails_Error(Error));\r\n }\r\n}\r\n\r\nexport function* billingActionsDetailsSaga() {\r\n yield takeLatest(actions.initBillingActionsDetails.type, doInitCreate);\r\n yield takeLatest(actions.initUpdateBillingActionsDetails.type, doInitUpdate);\r\n yield takeLatest(actions.createBillingActionsDetails.type, doCreate);\r\n yield takeLatest(actions.updateBillingActionsDetails.type, doUpdate);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IBillingActionsDto } from 'app/pages/BillingActions/BillingActionsPage/IBillingActionsDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { billingActionsDetailsSaga } from './saga';\r\nimport {\r\n //BillingActionsDetailsGlobalState,\r\n BillingActionsDetailsState,\r\n BillingActionsDetailsQStringParameters,\r\n BillingActionsState,\r\n ConvertModelToEntityBillingActionsDetails,\r\n} from './types';\r\n\r\nexport const initialState: BillingActionsState = {\r\n processing: false,\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'billingActionsDetail',\r\n initialState,\r\n reducers: {\r\n initBillingActionsDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateBillingActionsDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initBillingActionsDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.createState.data = ConvertModelToEntityBillingActionsDetails(\r\n action.payload,\r\n );\r\n },\r\n initUpdateBillingActionsDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.updateState.data = ConvertModelToEntityBillingActionsDetails(\r\n action.payload,\r\n );\r\n },\r\n initBillingActionsDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n initUpdateBillingActionsDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n //====================================================================\r\n resetUpdateBillingActionsDetailsState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n resetCreateBillingActionsDetailsState(state, action: PayloadAction) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n //====================================================================\r\n updateBillingActionsDetails(\r\n state,\r\n action: PayloadAction<{\r\n current: BillingActionsDetailsState;\r\n original: BillingActionsDetailsState | undefined;\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateBillingActionsDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n },\r\n updateBillingActionsDetails_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n //====================================================================\r\n createBillingActionsDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createBillingActionsDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.createState.processing = false;\r\n state.createState.hasErrors = action.payload.hasErrors;\r\n state.createState.completed = true;\r\n },\r\n createBillingActionsDetails_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n state.createState.hasErrors = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: billingActionsDetailsActions } = slice;\r\n\r\nexport const useBillingActionsDetailsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: billingActionsDetailsSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.billingActionsDetail || initialState;\r\n\r\nexport const selectBillingActionsDetails = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateBillingActionsDetails = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateBillingActionsDetailsCompleted = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateBillingActionsDetailsHasError = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateBillingActionsDetails = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateBillingActionsDetailsCompleted = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectUpdateBillingActionsDetailsHasError = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectBillingActionsDetailsProcessing = createSelector(\r\n [selectBillingActionsDetails],\r\n state => state.processing,\r\n);\r\n","/**\r\n *\r\n * MultiSelectBasicPicker for EmailAttachmentTypePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\n\r\nexport interface EATBaseURLMultiPickerProps\r\n extends Omit, 'loadData'> {\r\n url: string;\r\n queryfilter?: string | undefined;\r\n}\r\n\r\nexport function EATBaseURLMultiPicker(props: EATBaseURLMultiPickerProps) {\r\n const { url, queryfilter, ...other } = props;\r\n const loadData = async (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: string[] = [];\r\n if (queryfilter !== undefined && queryfilter !== '') {\r\n predicates.push(queryfilter);\r\n }\r\n\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n\r\n const response = await httpClient.get(url, params);\r\n return response.value.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailAttachmentTypesDto;\r\n });\r\n };\r\n return ;\r\n}\r\n","/**\r\n *\r\n * EmailAttachmentTypePicker(multi)\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\nimport { EATBaseURLMultiPicker } from './EATBaseURLMultiPicker';\r\n\r\nexport interface EmailAttachmentTypePickerProps {\r\n value?: Entity[] | null;\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n className?: string | undefined;\r\n helperText?: string;\r\n placeholder?: string | undefined;\r\n // value: Entity[];\r\n defaultValue?: Entity[];\r\n onChange: (value: Entity[]) => void;\r\n onBlur?: React.FocusEventHandler;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n info?: string;\r\n id?: string;\r\n required?: boolean;\r\n fullWidth?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/EmailAttachmentTypesFilter';\r\n\r\nexport const initEmailAttachmentTypesData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params).then(\r\n response =>\r\n response.value.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailAttachmentTypesDto;\r\n }) as Entity[],\r\n );\r\n }\r\n};\r\n\r\nexport function EmailAttachmentTypePicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n ...props\r\n}: EmailAttachmentTypePickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormEmailAttachmentTypePicker(multi) AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EmailAttachmentTypePicker } from '../pickers/MultiSelectPickers/EmailAttachmentTypePicker';\r\n\r\nexport const FormEmailAttachmentTypePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig[] | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField[] | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * FormInvoiceStatusPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InvoiceStatusWithStaticOptionsPicker } from '../pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker';\r\n\r\nexport const FormInvoiceStatusPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * FormScreenToShowOnPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ScreenToShowOnPicker } from '../pickers/StaticOptionsPickers/ScreenToShowOnPicker';\r\n\r\nexport const FormScreenToShowOnPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * FormPaymentMethodEnumPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { PaymentMethodEnumPicker } from '../pickers/StaticOptionsPickers/PaymentMethodEnumPicker';\r\n\r\nexport const FormPaymentMethodEnumPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disabled={props.disabled}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * MultiSelectBasicPicker for EmailRecipientTypePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n AutocompleteMultiPicker,\r\n AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailRecipientTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailRecipientTypesDto';\r\n\r\nexport interface ERTBaseURLMultiPickerProps\r\n extends Omit, 'loadData'> {\r\n url: string;\r\n queryfilter?: string | undefined;\r\n}\r\n\r\nexport function ERTBaseURLMultiPicker(props: ERTBaseURLMultiPickerProps) {\r\n const { url, queryfilter, ...other } = props;\r\n const loadData = async (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: string[] = [];\r\n if (queryfilter !== undefined && queryfilter !== '') {\r\n predicates.push(queryfilter);\r\n }\r\n\r\n params.$filter = new ODataFilterBuilder>({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n }).toString();\r\n\r\n const response = await httpClient.get(url, params);\r\n return response.value.map(i => {\r\n return {\r\n Id: i.Id,\r\n Name: i18next.t(i.Name) as string,\r\n } as IEmailRecipientTypesDto;\r\n });\r\n };\r\n return ;\r\n}\r\n","/**\r\n *\r\n * EmailRecipientTypesPicker(multi)\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { ERTBaseURLMultiPicker } from './ERTBaseURLMultiPicker';\r\n\r\nexport interface EmailRecipientTypesPickerProps {\r\n value?: Entity[] | null;\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n className?: string | undefined;\r\n helperText?: string;\r\n placeholder?: string | undefined;\r\n // value: Entity[];\r\n defaultValue?: Entity[];\r\n onChange: (value: Entity[]) => void;\r\n onBlur?: React.FocusEventHandler;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n info?: string;\r\n id?: string;\r\n required?: boolean;\r\n fullWidth?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/EmailRecipientTypesFilter';\r\n\r\nexport const initEmailRecipientTypesData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n $select: 'Id,Name',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\n\r\nexport function EmailRecipientTypesPicker({\r\n label,\r\n defaultValue,\r\n placeholder,\r\n className,\r\n required,\r\n helperText,\r\n onChange,\r\n variant,\r\n info,\r\n id,\r\n value,\r\n ...props\r\n}: EmailRecipientTypesPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormEmailRecipientTypes(multi) AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EmailRecipientTypesPicker } from '../pickers/MultiSelectPickers/EmailRecipientTypesPicker';\r\n\r\nexport const FormEmailRecipientTypesPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig[] | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField[] | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n />\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FormEmailAttachmentTypePicker } from 'app/components/Forms/FormEmailAttachmentTypePicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { FormInvoiceStatusPicker } from 'app/components/Forms/FormInvoiceStatusPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormScreenToShowOnPicker } from 'app/components/Forms/FormScreenToShowOnPicker';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { BillingActionsDetailsState } from '../slice/types';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormPaymentMethodEnumPicker } from '../../../../../components/Forms/FormPaymentMethodEnumPicker';\r\nimport { FormEmailRecipientTypesPicker } from 'app/components/Forms/FormEmailRecipientTypesPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport i18next from 'i18next';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface BillingActionsFormProps {\r\n initialValues: BillingActionsDetailsState;\r\n onSubmit: (item: BillingActionsDetailsState) => void;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n bindSubmitForm: any;\r\n}\r\n\r\nexport const BillingActionsForm = React.memo(function BillingActionsForm({\r\n initialValues,\r\n onSubmit,\r\n isEdit,\r\n isAdmin,\r\n bindSubmitForm,\r\n}: BillingActionsFormProps): JSX.Element {\r\n //SETTINGS\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const isSftpEnabled = IsModuleEnabled(\r\n appSettings ?? null,\r\n KnownModules.SAP_SFTP,\r\n ) as boolean;\r\n const budgetFieldFundingTypeEnabled:\r\n | boolean\r\n | undefined = IsBudgetFieldEnabled(\r\n appSettings ?? null,\r\n BudgetFields.FundingType,\r\n );\r\n\r\n //STATES\r\n const [IsSendEmailChanged, setIsSendEmailChanged] = React.useState(\r\n false,\r\n );\r\n const [IsSftpUploadChanged, setIsSftpUploadChanged] = React.useState(\r\n false,\r\n );\r\n //FUNCTIONS\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n\r\n const handleFormChange = React.useCallback(\r\n (values: BillingActionsDetailsState, isValid, dirty, setValue) => {\r\n if (IsSendEmailChanged) {\r\n setValue('EmailRecipientTypes', [], false);\r\n setValue('EmailAttachmentTypes', [], false);\r\n setValue('SpecificEmailAddresses', '', false);\r\n setValue('Subject', '', false);\r\n setValue('Body', '', false);\r\n setIsSendEmailChanged(false);\r\n }\r\n if (IsSftpUploadChanged) {\r\n setValue('EmailRecipientTypes', [], false);\r\n setValue('EmailAttachmentTypes', [], false);\r\n setValue('SpecificEmailAddresses', '', false);\r\n setValue('Subject', '', false);\r\n setValue('Body', '', false);\r\n setIsSftpUploadChanged(false);\r\n }\r\n },\r\n [IsSendEmailChanged, IsSftpUploadChanged],\r\n );\r\n\r\n //VALIDATION SCHEMA for BillingActionsDetails Form\r\n const isMultipleEmails = {\r\n name: 'isMultipleEmails',\r\n // eslint-disable-next-line no-template-curly-in-string\r\n message: '${path} not all are a valid email',\r\n test: async value => {\r\n if (!value) return true;\r\n let values = value.split(',');\r\n //let values = value.replace(/\\s/g, '').split(',');\r\n let res = await Promise.all(\r\n values.map(\r\n async v => (await Yup.string().email().isValid(v)) && v !== '',\r\n ),\r\n );\r\n return res.every(v => !!v);\r\n },\r\n };\r\n\r\n const billingActionsDetailsSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n OperationName: Yup.string()\r\n .nullable()\r\n .default('')\r\n .required(i18next.t(translations.err_OperationNameRequired))\r\n .label(i18next.t(translations.OperationName)),\r\n ShowOn: Yup.mixed()\r\n .label(i18next.t(translations.ShowOn))\r\n .required(i18next.t(translations.err_ShowOn)),\r\n FundingType: Yup.mixed()\r\n .label(i18next.t(translations.FundingType))\r\n .when(['YupFundingType'], {\r\n is: () => budgetFieldFundingTypeEnabled === true,\r\n then: schema =>\r\n schema.required(i18next.t(translations.FundingTypeIsRequired)),\r\n otherwise: schema => schema.notRequired(),\r\n }),\r\n ChangeStatusTo: Yup.mixed().label(i18next.t(translations.ChangeStatusTo)),\r\n GeneratePayment: Yup.mixed().label(\r\n i18next.t(translations.GeneratePayment),\r\n ),\r\n IsSendEmail: Yup.boolean()\r\n .default(false)\r\n .label(i18next.t(translations.IsSendEmail)),\r\n IsSftpUpload: Yup.boolean()\r\n .default(false)\r\n .label(i18next.t(translations.IsSftpUpload)),\r\n EmailRecipientTypes: Yup.array()\r\n .of(EntityNumberSchema)\r\n .label(i18next.t(translations.EmailRecipientTypes)),\r\n SpecificEmailAddresses: Yup.string()\r\n .nullable()\r\n .test(isMultipleEmails)\r\n .default('')\r\n .label(i18next.t(translations.SpecificEmailAddresses))\r\n .when(['EmailRecipientTypes', 'IsSendEmail'], {\r\n is: (EmailRecipientTypes, IsSendEmail) =>\r\n EmailRecipientTypes.length <= 0 && IsSendEmail === true,\r\n then: schema => schema.required(i18next.t(translations.Required)),\r\n otherwise: schema => schema.notRequired(),\r\n }),\r\n Body: Yup.string()\r\n .nullable()\r\n .notRequired()\r\n .label(i18next.t(translations.Body)),\r\n Subject: Yup.string()\r\n .nullable()\r\n //.required(i18next.t(translations.EmailSubject_RequiredField))\r\n .label(i18next.t(translations.Subject)),\r\n EmailAttachmentTypes: Yup.array()\r\n .of(EntityNumberSchema)\r\n .when(['IsSftpUpload'], {\r\n is: IsSftpUpload => IsSftpUpload === true,\r\n then: schema => schema.required(i18next.t(translations.Required)),\r\n otherwise: schema => schema.notRequired(),\r\n })\r\n .label(i18next.t(translations.EmailAttachmentTypes)),\r\n },\r\n );\r\n\r\n //RENDER\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('Submitting: ', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n //console.log('Billing Actions Details Errors: ', formik.errors);\r\n }\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n setIsSendEmailChanged(true)}\r\n />\r\n \r\n {isSftpEnabled && (\r\n \r\n setIsSftpUploadChanged(true)}\r\n />\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {/* to make it visible only if specific email is choosen */}\r\n \r\n {!!formik.errors.Id && (\r\n \r\n \r\n {formik.errors.Id}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * BillingActions_Actions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n BillingActionsDetailsState,\r\n BillingActionsDetailsQStringParameters,\r\n} from './slice/types';\r\nimport { useBillingActionsDetailsSlice } from './slice/index';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n selectBillingActionsDetailsProcessing,\r\n selectCreateBillingActionsDetails,\r\n selectCreateBillingActionsDetailsCompleted,\r\n selectUpdateBillingActionsDetails,\r\n selectUpdateBillingActionsDetailsCompleted,\r\n //selectCreateBillingActionsDetailsHasError,\r\n //selectUpdateBillingActionsDetailsHasError,\r\n} from './slice/selectors';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { push } from 'connected-react-router';\r\nimport Box from '@material-ui/core/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { BillingActionsForm } from './BillingActionsForm/index';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { SaveFormButton } from './Actions/BillingActions_Actions';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface BillingActionsDetailsProps extends SidePanelContentProps {\r\n queryParams: BillingActionsDetailsQStringParameters;\r\n}\r\n\r\nexport function BillingActionsDetails(\r\n props: BillingActionsDetailsProps,\r\n): JSX.Element {\r\n //PROPS\r\n const { queryParams, useSidePanel } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n //PERMISSIONS\r\n const User = useSelector(selectAuthenticatedUser);\r\n const IsAdmin =\r\n User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n //SLICES\r\n const { actions } = useBillingActionsDetailsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n //SELECTORS\r\n const publicUrl = useSelector(selectPublicUrl);\r\n //====================================================================\r\n const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const loading = useSelector(selectBillingActionsDetailsProcessing);\r\n //====================================================================\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const continueToOther = useSelector(selectContinueState);\r\n //====================================================================\r\n const requestCreateCompleted = useSelector(\r\n selectCreateBillingActionsDetailsCompleted,\r\n );\r\n const requestUpdateCompleted = useSelector(\r\n selectUpdateBillingActionsDetailsCompleted,\r\n );\r\n //====================================================================\r\n //const hasCreateError = useSelector(selectCreateBillingActionsDetailsHasError);\r\n //const hasUpdateError = useSelector(selectUpdateBillingActionsDetailsHasError);\r\n //const hasError = hasCreateError || hasUpdateError;\r\n //====================================================================\r\n const createModel = useSelector(\r\n selectCreateBillingActionsDetails,\r\n shallowEqual,\r\n );\r\n const editModel = useSelector(\r\n selectUpdateBillingActionsDetails,\r\n shallowEqual,\r\n );\r\n const baseModel = createModel || editModel;\r\n //====================================================================\r\n\r\n //STATES\r\n const [edit, setEdit] = useState(false);\r\n const [busy, setBusy] = useState(false);\r\n const [requestCompleted, setRequestCompleted] = useState(\r\n undefined,\r\n );\r\n\r\n //REF\r\n const submitFormRef = useRef(null);\r\n\r\n //FUNCTIONS\r\n const bindSubmitForm = useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n\r\n const handleSaveClick = (e: any) => {\r\n handleSubmitForm(e);\r\n };\r\n\r\n const handleSubmit = useCallback(\r\n (values: BillingActionsDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateBillingActionsDetails({\r\n current: values,\r\n original: baseModel,\r\n }),\r\n );\r\n } else {\r\n let value = values as BillingActionsDetailsState;\r\n console.debug('Data: ', value);\r\n dispatch(actions.createBillingActionsDetails(values));\r\n }\r\n },\r\n [actions, baseModel, dispatch, edit],\r\n );\r\n\r\n const handleCancelClick = useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/BillingActions'));\r\n }\r\n if (edit) {\r\n dispatch(actions.resetUpdateBillingActionsDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateBillingActionsDetailsState());\r\n }\r\n }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n const handleClose = () => {\r\n if (hasUnsavedChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n\r\n //USE EFFECT ON MOUNT\r\n useEffectOnMount(() => {\r\n if (\r\n queryParams.id !== undefined &&\r\n !isNaN(parseInt(queryParams.id || ''))\r\n ) {\r\n dispatch(actions.initUpdateBillingActionsDetails(queryParams));\r\n } else {\r\n dispatch(actions.initBillingActionsDetails(queryParams));\r\n }\r\n setBusy(false);\r\n setEdit(false);\r\n setRequestCompleted(undefined);\r\n return () => {};\r\n });\r\n\r\n //USE EFFECT\r\n useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n setEdit(true);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n handleCancelClick();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n handleCancelClick,\r\n loading,\r\n queryParams.id,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n ]);\r\n\r\n //USE EFFECT 2\r\n useEffect(() => {\r\n if (confirmApproved) {\r\n if (edit) {\r\n dispatch(actions.resetUpdateBillingActionsDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateBillingActionsDetailsState());\r\n }\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n\r\n //LEFT ACTIONS\r\n const leftActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RIGHT ACTIONS\r\n const rightActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n />\r\n {hasUnsavedChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\nimport { ServiceGroupsFilter } from 'app/components/BasicTable/Filters/ServiceGroupsFilter';\r\nimport { SuperGroupFilter } from 'app/components/BasicTable/Filters/SuperGroupFilter';\r\nimport {\r\n arrayToQueryString,\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n getNumberEntityArray,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n initExPickerValue,\r\n initMultiExPickerValue,\r\n initPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport { initSuperGroupData } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { initServiceGroupsMultiData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParams(search);\r\n const isAdmin =\r\n !!user &&\r\n (user.Roles.includes(Roles.Administrators) ||\r\n user.Roles.includes(Roles.GroupAdministrators));\r\n const hasOwnedGroups =\r\n !!user && user.AdminServiceGroups && user.AdminServiceGroups.length > 0;\r\n const res: IFilterSettings[] = [\r\n {\r\n fieldName: 'Id',\r\n displayName: t(translations.ServiceGroup),\r\n operator: ODataOperators.Includes,\r\n queryStringSerializer: arrayToQueryString('sgids'),\r\n value: getNumberEntityArray(params, 'sgids'),\r\n initData: initMultiExPickerValue(initServiceGroupsMultiData),\r\n component: ServiceGroupsFilter,\r\n urlKey: 'sgids',\r\n },\r\n ];\r\n if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n res.push({\r\n fieldName: 'DivisionId',\r\n displayName: t(translations.Division),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'divisionId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'divisionId')),\r\n ),\r\n component: SuperGroupFilter,\r\n initData: initPickerValue(initSuperGroupData),\r\n });\r\n res.push({\r\n fieldName: 'RegionId',\r\n displayName: t(translations.Region),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'regionid',\r\n initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n ),\r\n component: RegionFilter,\r\n urlType: 'base',\r\n });\r\n }\r\n if (hasOwnedGroups) {\r\n res.push({\r\n fieldName: 'OwnedByMe',\r\n displayName: t(translations.OnlyMyCores),\r\n queryStringSerializer: 'ownedbyme',\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'ownedbyme')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n }\r\n if (isAdmin) {\r\n res.push({\r\n fieldName: 'Active',\r\n displayName: t(translations.Active),\r\n queryStringSerializer: 'Active',\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'Active')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n }\r\n return res;\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport const getDefaultFilter = (onlyMyCores: boolean) => {\r\n const result = (user: IAuthenticatedUser) =>\r\n toQueryString({\r\n ownedbyme: onlyMyCores === true ? true : undefined,\r\n });\r\n return result;\r\n};\r\nexport function getRequiredFilter(search: string) {\r\n const result = isEmptyOrWhitespace(search)\r\n ? new URLSearchParams()\r\n : new URLSearchParams(search);\r\n if (\r\n result.has('Active') === false ||\r\n result.get('Active') === null ||\r\n result.get('Active') === ''\r\n ) {\r\n result.set('Active', true.toString());\r\n }\r\n const res = result.toString();\r\n return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IPermissionLevelDto } from 'api/odata/generated/entities/IPermissionLevelDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface PermissionLevelPickerProps\r\n extends Omit, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/PermissionLevelFilter';\r\nexport const initPermissionLevelData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n globalServiceGroupFilter: Entity[],\r\n) =>\r\n getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name', 'ServiceGroupId'],\r\n globalServiceGroupFilter:\r\n !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n ? [\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n globalServiceGroupFilter.map(f => f.Id),\r\n ),\r\n ]\r\n : [],\r\n isOptionalServiceGroup: true,\r\n });\r\nexport const loadPermissionLevels = loadData;\r\nexport function PermissionLevelPicker(props: PermissionLevelPickerProps) {\r\n const innerLoadData = loadData(props.predicates, []);\r\n return (\r\n \r\n );\r\n}\r\n// export function TrainingLevelFilter(\r\n// equipments: IServiceFilterDto[],\r\n// trainingLevelPermissionsEnabled,\r\n// userPermissionsEnabled,\r\n// ): (string | Condition)[] {\r\n// const predicates: (string | Condition)[] = [];\r\n// if (!!equipments && equipments.length > 0) {\r\n// if (trainingLevelPermissionsEnabled) {\r\n// predicates.push(\r\n// equipments\r\n// .map(eq => {\r\n// if (eq.UseServiceGroupTrainingLevels) {\r\n// return `(ServiceGroupId eq null or ServiceGroupId eq ${quoteODataValue(\r\n// eq.ServiceGroupId,\r\n// )})`;\r\n// } else {\r\n// return `LevelEquipments/any(g: g eq ${quoteODataValue(eq.Id)})`;\r\n// }\r\n// })\r\n// .join(' or '),\r\n// );\r\n// } else if (userPermissionsEnabled) {\r\n// // noop - clients could not select training level that was not part of user or group permissions on selected equipment they needed on uchicago\r\n// // should be properly resolved in https://prog4biz.atlassian.net/browse/BKT-8190\r\n// }\r\n// if (predicates.length > 0) {\r\n// return predicates;\r\n// }\r\n// return [];\r\n// } else {\r\n// return [];\r\n// }\r\n// }\r\n","/**\r\n *\r\n * FormPermissionLevelPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IPermissionLevelDto } from 'api/odata/generated/entities/IPermissionLevelDto';\r\nimport { PermissionLevelPicker } from 'app/components/pickers/AutocompletePickers/PermissionLevelPicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\nexport const FormPermissionLevelPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n disabled={props.disabled}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TimeSlotTypePickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/TimeSlotTypeFilter';\r\nexport const initTimeSlotTypeData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition>)[] | undefined,\r\n) =>\r\n getAutoCompleteLoadDataFn>({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: ['Id', 'Name'],\r\n });\r\nexport const loadTimeSlotTypes = loadData;\r\nexport function TimeSlotTypePicker(props: TimeSlotTypePickerProps) {\r\n const innerLoadData = loadData(props.predicates);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FormTimeSlotTypePicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport { Entity } from 'types/common';\r\nimport { TimeSlotTypePicker } from 'app/components/pickers/AutocompletePickers/TimeSlotTypePicker';\r\n\r\nexport const FormTimeSlotTypePicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n disabled={props.disabled}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","import { UserGroupMultiPicker } from 'app/components/pickers/AutocompletePickers/UserGroupMultiPicker';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\nexport const FormUserGroupsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig[] | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField[] | null>(props);\r\n return (\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onChipClick={props.onChipClick}\r\n onBlur={field?.onBlur}\r\n value={field.value ?? undefined}\r\n error={meta?.error !== undefined}\r\n variant=\"filled\"\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n info={props.info}\r\n queryfilter={\r\n !!props.predicates\r\n ? props.predicates.map(f => f.toString()).join(' and ')\r\n : undefined\r\n }\r\n disabled={props.disabled}\r\n />\r\n );\r\n};\r\n","import { FormPermissionLevelPicker } from 'app/components/Forms/FormPermissionLevelPicker';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTimeSlotTypePicker } from 'app/components/Forms/FormTimeSlotTypePicker';\r\nimport { FormUserGroupsPicker } from 'app/components/Forms/FormUserGroupsPicker';\r\nimport { EntityStringSchema } from 'app/components/Forms/Schemas';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport * as yup from 'yup';\r\nimport { GroupPermissionsModel } from '.';\r\n\r\nexport interface UpdateGroupPermissionsFormProps {\r\n groups: ICoresDirectoryRow[];\r\n handleSubmitForm: (submit: any) => void;\r\n onSubmit: (model: GroupPermissionsModel) => void;\r\n}\r\n\r\nexport function UpdateGroupPermissionsForm(\r\n props: UpdateGroupPermissionsFormProps,\r\n) {\r\n const { t } = useTranslation();\r\n const schema: yup.SchemaOf = yup.object({\r\n AdGroups: yup\r\n .array()\r\n .of(EntityStringSchema)\r\n .label(t(translations.UserGroup) as string)\r\n .min(1)\r\n .required(t(translations.err_UserGroupRequired) as string),\r\n PermissionLevel: yup\r\n .mixed()\r\n .label(t(translations.PermissionLevel) as string)\r\n .required(t(translations.err_SelectPermissionLevelException) as string),\r\n TimeSlotType: yup\r\n .mixed()\r\n .label(t(translations.TimeSlotType) as string)\r\n .required(t(translations.err_TimeSlotTypeRequired) as string),\r\n });\r\n return (\r\n \r\n {formik => {\r\n props.handleSubmitForm(formik.submitForm);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { UpdateGroupPermissionsForm } from './UpdateGroupPermissions';\r\nimport { Entity } from 'types/common';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\n\r\nexport interface UpdateUserGroupPermissionsProps {\r\n rows: ICoresDirectoryRow[];\r\n user?: AuthenticatedUser;\r\n}\r\nexport interface GroupPermissionsModel {\r\n AdGroups: Entity[];\r\n PermissionLevel?: Entity;\r\n TimeSlotType?: Entity;\r\n}\r\nexport interface GroupPermissionsUpdate {\r\n ServiceGroups: string;\r\n AdGroups: string;\r\n PermissionLevelId: number;\r\n TimeSlotTypeId: number;\r\n}\r\nexport function UpdateUserGroupPermissions(\r\n props: UpdateUserGroupPermissionsProps,\r\n) {\r\n const { rows } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const [updtPermissionOpen, setUpdtPermissionOpen] = React.useState(false);\r\n const [submitted, setSubmitted] = React.useState(\r\n undefined,\r\n );\r\n const submitFormRef = React.useRef();\r\n const bindSubmitForm = React.useCallback(value => {\r\n submitFormRef.current = value;\r\n }, []);\r\n const updatePermission = React.useCallback(\r\n (model: GroupPermissionsModel, groups: ICoresDirectoryRow[]) => {\r\n setSubmitted(true);\r\n const params = {\r\n ServiceGroups: groups.map(f => f.Id).join(','),\r\n AdGroups: model.AdGroups.map(f => f.Id).join(','),\r\n PermissionLevelId: model.PermissionLevel?.Id ?? -1,\r\n TimeSlotTypeId: model.TimeSlotType?.Id ?? -1,\r\n } as GroupPermissionsUpdate;\r\n const url =\r\n '/api/odata/v4/RestrictedUserPermissions/UpdateGroupPermissions';\r\n httpClient\r\n .post(url, { params: params })\r\n .then(v => {\r\n setSubmitted(undefined);\r\n if (v.ErrorMessages.length > 0) {\r\n dispatch(\r\n actions.addNotifications(\r\n v.ErrorMessages.map(e => ({ message: e, variant: 'error' })),\r\n ),\r\n );\r\n }\r\n if (v.WarningMessages.length > 0) {\r\n dispatch(\r\n actions.addNotifications(\r\n v.WarningMessages.map(e => ({\r\n message: e,\r\n variant: 'warning',\r\n })),\r\n ),\r\n );\r\n }\r\n if (v.SuccessMessages.length > 0) {\r\n dispatch(\r\n actions.addNotifications(\r\n v.SuccessMessages.map(e => ({\r\n message: e,\r\n variant: 'success',\r\n })),\r\n ),\r\n );\r\n setUpdtPermissionOpen(false);\r\n }\r\n })\r\n .catch(e => {\r\n console.error(e);\r\n setSubmitted(undefined);\r\n })\r\n .finally(() => {\r\n setSubmitted(undefined);\r\n });\r\n },\r\n [actions, dispatch],\r\n );\r\n return (\r\n \r\n {updtPermissionOpen && (\r\n submitFormRef.current()}\r\n confirmButtonLabel={t(translations.CreateUpdateGroupPermissions)}\r\n processing={submitted}\r\n onCancel={() => {\r\n setUpdtPermissionOpen(false);\r\n }}\r\n onClose={() => {\r\n setUpdtPermissionOpen(false);\r\n }}\r\n body={\r\n
    \r\n {\r\n updatePermission(group, rows);\r\n }}\r\n />\r\n
    \r\n }\r\n />\r\n )}\r\n setUpdtPermissionOpen(true)}\r\n title={t(translations.SetPermissionsOnSelectedServiceGroups)}\r\n text={t(translations.SetPermissions) as string}\r\n processing={submitted}\r\n />\r\n
    \r\n );\r\n}\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { GetResponseMessages } from 'app/pages/UsersPage/PageActions/Actions';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { UpdateUserGroupPermissions } from './UpdateUserGroupPermissions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport fileDownload from 'js-file-download';\r\n\r\nconst SelectedActions = {\r\n Delete: (rows: ICoresDirectoryRow[]): Promise => {\r\n const groupIds: number[] = rows.map(item => item.Id);\r\n const data = { groupIds };\r\n const url = '/api/odata/v4/ServiceGroups/DeleteGroups';\r\n return httpClient.post(url, data);\r\n },\r\n Deactivate: (rows: ICoresDirectoryRow[]): Promise => {\r\n const groupIds: number[] = rows.map(item => item.Id);\r\n const data = { groupIds };\r\n const url = '/api/odata/v4/ServiceGroups/DeactivateGroups';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\nexport function GetSelectedActions(\r\n t: TFunction,\r\n user?: AuthenticatedUser,\r\n): SelectedRowsActionRenderer[] {\r\n const { allowedToEditGroup } = useAdminPermissions();\r\n const SelectedRowActions: SelectedRowsActionRenderer<\r\n ICoresDirectoryRow\r\n >[] = useMemo(\r\n () => [\r\n (rows, refresh) =>\r\n rows.length > 0 &&\r\n rows.every(allowedToEditGroup) && (\r\n \r\n new Promise(async (resolve, reject) => {\r\n const selectedRows = rows.map(item => item.Id);\r\n const res = await ExportImportActions.ExportForImport(\r\n ScreensId.CoresDirectory,\r\n selectedRows,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined\r\n ? cd.split('filename=')[1]\r\n : 'ExportForImport_serviceGroups.xlsx';\r\n fileDownload(res.data, filename);\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n })\r\n }\r\n />\r\n ),\r\n (rows, onRefresh) =>\r\n rows.length > 0 &&\r\n rows.every(allowedToEditGroup) && (\r\n \r\n new Promise((resolve, reject) => {\r\n //here make request to DeleteOtherServices Action in Controller\r\n return SelectedActions.Delete(rows)\r\n .then(response => {\r\n //GetResponseMessages is from UsersPage\r\n const messages: IResponseType = GetResponseMessages(\r\n response,\r\n t(translations.Success) as string,\r\n );\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(\r\n translations.err_ServiceGroupCanNotBeDeleted,\r\n ) as string;\r\n reject(err);\r\n });\r\n })\r\n }\r\n />\r\n ),\r\n (rows, onRefresh) =>\r\n rows.length > 0 &&\r\n rows.every(allowedToEditGroup) && (\r\n \r\n new Promise((resolve, reject) => {\r\n return SelectedActions.Deactivate(rows)\r\n .then(response => {\r\n const messages: IResponseType = GetResponseMessages(\r\n response,\r\n t(translations.Success) as string,\r\n );\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(\r\n translations.err_ServiceGroupCanNotBeDeactivated,\r\n ) as string;\r\n reject(err);\r\n });\r\n })\r\n }\r\n />\r\n ),\r\n rows =>\r\n rows.length > 0 &&\r\n rows.every(allowedToEditGroup) && (\r\n \r\n ),\r\n ],\r\n [allowedToEditGroup, t],\r\n );\r\n return SelectedRowActions;\r\n}\r\n","import { BasicTable } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { GetFilters } from './getFilters';\r\nimport * as React from 'react';\r\nimport { getColumns } from './Columns';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { IBasicTableState } from 'app/components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { translations } from 'locales/translations';\r\nimport { IdType, Row } from 'react-table';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport {\r\n SelectedRowsActionExtRenderer,\r\n SelectedRowsActionRenderer,\r\n} from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAppSettings,\r\n selectGlobalServiceGroupFilter,\r\n selectGlobalSettingBool,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TabsActionRenderer } from 'app/components/BasicTable/components/TabsToolbar/TabsActionRender';\r\nimport { Tab } from '@material-ui/core';\r\nimport { getDefaultFilter, getRequiredFilter } from './getDefaultFilters';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport FormControlLabel from 'app/components/Forms/FormControls/FormControlLabel';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AdminActions } from 'app/components/Admin/AdminActions';\r\nimport { GetSelectedActions } from '../SelectedBulkActions/GetSelectedActions';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { PopupImportExport } from 'app/components/PopupImportExport';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport htmlParse from 'html-react-parser';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\n// import { RowsCountPicker } from 'app/components/Dashboard/TableViewEdit/RowsCountPicker';\r\n\r\nexport interface CoreSelectionTableProps {\r\n isSidePanel?: boolean;\r\n authenticatedUser?: AuthenticatedUser;\r\n closeSidePanel: () => void;\r\n setFilters?: (\r\n appliedFilters: IFilterSettings[] | undefined,\r\n ) => void;\r\n updtFirstLogin: (val: boolean) => void;\r\n updtOptOut: (val: boolean) => void;\r\n //primaryAction?: (row: Row) => void;\r\n isRowSelectable: (row: Row) => boolean;\r\n redirectToDash: boolean;\r\n isFirstLogin?: boolean;\r\n optOutCoreSelection?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n}\r\n\r\nexport function CoreSelectionTable(props: CoreSelectionTableProps) {\r\n const {\r\n isSidePanel,\r\n setFilters,\r\n authenticatedUser,\r\n closeSidePanel,\r\n updtFirstLogin,\r\n updtOptOut,\r\n //primaryAction,\r\n isRowSelectable,\r\n redirectToDash,\r\n optOutCoreSelection,\r\n openPanel,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: serviceGroupActions } = useAppSettingsSlice();\r\n const hideNavigation = useSelector(selectHideNavigation);\r\n const settings = useSelector(selectglobalSettings);\r\n const history = useHistory();\r\n const location = useLocation();\r\n const isMobile = DetectIsMobile();\r\n //const publicUrl = useSelector(selectPublicUrl);\r\n const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const appSettings = useSelector(selectAppSettings);\r\n const [onlyMyCores, setOnlyMyCores] = React.useState(false);\r\n const [tabNumber, setTubNumber] = React.useState(0);\r\n const [showImportConfirm, setShowImportConfirm] = React.useState(false);\r\n const { allowedToEditGroup } = useAdminPermissions();\r\n const userHelp = settings.GetNullableByKey(\r\n AllowedSettings.Help_ServiceGroupRegistration,\r\n );\r\n const [multiCoresSelectionMode, setMultiCoresselectionMode] = React.useState<\r\n boolean\r\n >(false);\r\n const skipCoreSelectionScreen = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.SkipCoreSelectionScreen),\r\n );\r\n const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n Record, boolean>\r\n >({});\r\n const [loacalServiceGroups, setLoacalServiceGroups] = useAsyncExtendedState<\r\n Entity[]\r\n >([]);\r\n useEffectOnMount(() => {\r\n dispatch(serviceGroupActions.loadGlobalServiceGroupFilter());\r\n });\r\n const openAsset = useOpenAssetPopUp();\r\n React.useEffect(() => {\r\n let obj = {};\r\n if (!!savedServiceGroups && savedServiceGroups.length > 0) {\r\n for (const key of savedServiceGroups) {\r\n obj[key.Id] = true;\r\n }\r\n setMultiCoresselectionMode(savedServiceGroups.length > 1);\r\n setLoacalServiceGroups(savedServiceGroups);\r\n }\r\n setSelectedRowIds(obj);\r\n }, [savedServiceGroups, setLoacalServiceGroups]);\r\n\r\n const showMyCoresOptions = React.useMemo(() => {\r\n return (\r\n !!authenticatedUser &&\r\n !!authenticatedUser.AdminServiceGroups &&\r\n authenticatedUser.AdminServiceGroups.length > 0\r\n );\r\n }, [authenticatedUser]);\r\n const handleRemoveGroup = React.useCallback(\r\n (value: Entity) => {\r\n setLoacalServiceGroups(oldGroups => {\r\n let newGroups = oldGroups.filter(group => group.Id !== value.Id);\r\n return newGroups;\r\n });\r\n // if (loacalServiceGroups) {\r\n // let newGroups = loacalServiceGroups.filter(\r\n // group => group.Id !== value.Id,\r\n // );\r\n\r\n // //dispatch(actions.saveGlobalServiceGroupFilter(newGroups || []));\r\n // }\r\n },\r\n [setLoacalServiceGroups],\r\n );\r\n const handleRowsServiceGroupsChange = React.useCallback(\r\n (rows: Row[], selected: boolean) => {\r\n let selectable = rows.map(f => {\r\n return {\r\n Id: f.original.Id,\r\n Name: f.original.Name,\r\n } as Entity;\r\n });\r\n if (selected) {\r\n setLoacalServiceGroups([\r\n ...loacalServiceGroups,\r\n ...selectable.filter(\r\n f => !loacalServiceGroups.some(s => s.Id === f.Id),\r\n ),\r\n ]);\r\n } else {\r\n setLoacalServiceGroups([\r\n ...loacalServiceGroups.filter(\r\n f => !selectable.some(s => s.Id === f.Id),\r\n ),\r\n ]);\r\n }\r\n\r\n //dispatch(actions.saveGlobalServiceGroupFilter(selectable || []));\r\n },\r\n [loacalServiceGroups, setLoacalServiceGroups],\r\n );\r\n const handleServiceGroupsChange = React.useCallback(\r\n (value: Entity[] | []) => {\r\n dispatch(actions.saveGlobalServiceGroupFilter(value || []));\r\n },\r\n [actions, dispatch],\r\n );\r\n\r\n const handleSingleGroupChange = React.useCallback(\r\n (value: Entity, added: boolean) => {\r\n if (added) {\r\n if (loacalServiceGroups.length + 1 > 1) {\r\n setMultiCoresselectionMode(true);\r\n }\r\n setLoacalServiceGroups(oldGroups => [...oldGroups, value]);\r\n // dispatch(\r\n // actions.saveGlobalServiceGroupFilter(\r\n // !!savedServiceGroups ? [...savedServiceGroups, value] : [value],\r\n // ),\r\n // );\r\n } else {\r\n if (loacalServiceGroups.length - 1 < 2) {\r\n setMultiCoresselectionMode(false);\r\n }\r\n handleRemoveGroup(value);\r\n }\r\n },\r\n [handleRemoveGroup, loacalServiceGroups.length, setLoacalServiceGroups],\r\n );\r\n const onSelectChange = React.useCallback(\r\n (row: ICoresDirectoryRow, checked: boolean) => {\r\n handleSingleGroupChange(\r\n {\r\n Id: row.Id,\r\n Name: row.Name,\r\n } as Entity,\r\n checked,\r\n );\r\n },\r\n [handleSingleGroupChange],\r\n );\r\n const primaryAction = React.useCallback(\r\n (row: Row) => {\r\n //dispatch(layoutActions.setUpSnackBarIndex(true));\r\n let canSwitch = isRowSelectable(row);\r\n if (!multiCoresSelectionMode) {\r\n if (canSwitch) {\r\n // handleRowsServiceGroupsChange([row]);\r\n if (hideNavigation) {\r\n handleServiceGroupsChange([\r\n {\r\n Id: row.original.Id,\r\n Name: row.original.Name,\r\n } as Entity,\r\n ]);\r\n updtFirstLogin(false);\r\n dispatch(layoutActions.setHideNavigation(false));\r\n history.push('/dashboards/core/' + row.original.Id);\r\n } else if (isSidePanel) {\r\n handleServiceGroupsChange([\r\n {\r\n Id: row.original.Id,\r\n Name: row.original.Name,\r\n } as Entity,\r\n ]);\r\n if (redirectToDash) {\r\n dispatch(layoutActions.resetSidePanel());\r\n history.push('/dashboards/core/' + row.original.Id);\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n } else {\r\n handleServiceGroupsChange([\r\n {\r\n Id: row.original.Id,\r\n Name: row.original.Name,\r\n } as Entity,\r\n ]);\r\n if (redirectToDash) {\r\n history.push('/dashboards/core/' + row.original.Id);\r\n }\r\n }\r\n } else {\r\n if (row.original.CanRequestAccess) {\r\n if (hideNavigation) {\r\n updtFirstLogin(false);\r\n setTimeout(() => {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n dispatch(layoutActions.setHideNavigation(false));\r\n }, 20);\r\n } else if (isSidePanel) {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n }\r\n } else {\r\n dispatch(\r\n actions.addNotification({\r\n key: 'coreSelection_error',\r\n message: (t(\r\n translations.OnSelectNotRegisteredCore_error,\r\n ) as string).replace('{0}', row.original.Name),\r\n variant: 'error',\r\n autoHideDuration: 10000,\r\n }),\r\n );\r\n }\r\n }\r\n } else {\r\n if (canSwitch) {\r\n handleSingleGroupChange(\r\n {\r\n Id: row.original.Id,\r\n Name: row.original.Name,\r\n } as Entity,\r\n !row.isSelected,\r\n );\r\n row.toggleRowSelected(!row.isSelected);\r\n } else {\r\n if (row.original.CanRequestAccess) {\r\n if (hideNavigation) {\r\n updtFirstLogin(false);\r\n dispatch(layoutActions.setHideNavigation(false));\r\n setTimeout(() => {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n }, 20);\r\n } else if (isSidePanel) {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n window.open(\r\n toRootedURL(\r\n `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n ),\r\n '_blank',\r\n );\r\n }\r\n } else {\r\n dispatch(\r\n actions.addNotification({\r\n key: 'coreSelection_error',\r\n message: (t(\r\n translations.OnSelectNotRegisteredCore_error,\r\n ) as string).replace('{0}', row.original.Name),\r\n variant: 'error',\r\n autoHideDuration: 10000,\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n handleServiceGroupsChange,\r\n handleSingleGroupChange,\r\n hideNavigation,\r\n history,\r\n isRowSelectable,\r\n isSidePanel,\r\n layoutActions,\r\n multiCoresSelectionMode,\r\n redirectToDash,\r\n t,\r\n updtFirstLogin,\r\n ],\r\n );\r\n const primaryMultipleAction = React.useCallback(() => {\r\n handleServiceGroupsChange(loacalServiceGroups);\r\n if (hideNavigation) {\r\n updtFirstLogin(false);\r\n dispatch(layoutActions.setHideNavigation(false));\r\n history.push('/systemdash');\r\n } else if (isSidePanel) {\r\n if (redirectToDash) {\r\n history.push('/systemdash');\r\n }\r\n updtFirstLogin(false);\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n // if (redirectToDash) {\r\n // history.push('/systemdash');\r\n // }\r\n updtFirstLogin(false);\r\n history.push('/systemdash');\r\n }\r\n }, [\r\n dispatch,\r\n handleServiceGroupsChange,\r\n hideNavigation,\r\n history,\r\n isSidePanel,\r\n layoutActions,\r\n loacalServiceGroups,\r\n redirectToDash,\r\n updtFirstLogin,\r\n ]);\r\n\r\n const TTable = React.useMemo(\r\n () =>\r\n filterHandler(BasicTable, GetFilters, {\r\n isSidePanel: isSidePanel,\r\n setFilters: setFilters,\r\n reservedQueryStringParameterNames: ['ownedbyme'],\r\n getDefaultFilter: getDefaultFilter(onlyMyCores),\r\n getRequiredFilter: getRequiredFilter,\r\n }),\r\n [isSidePanel, onlyMyCores, setFilters],\r\n );\r\n\r\n const columns = React.useMemo(() => {\r\n return getColumns(\r\n t,\r\n isRowSelectable,\r\n authenticatedUser,\r\n settings,\r\n appSettings,\r\n isSidePanel,\r\n );\r\n }, [\r\n appSettings,\r\n authenticatedUser,\r\n isRowSelectable,\r\n isSidePanel,\r\n settings,\r\n t,\r\n ]);\r\n\r\n const rowActions: CellRenderer[] = React.useMemo<\r\n CellRenderer[]\r\n >(() => {\r\n let actions: CellRenderer[] = [];\r\n\r\n actions.push(({ row }) => {\r\n // let canSwitch = isRowSelectable(row);\r\n let canRequestAccess = row.original.CanRequestAccess;\r\n if (canRequestAccess) {\r\n return (\r\n {\r\n primaryAction(row);\r\n }}\r\n >\r\n {t(translations.RequestAccess)}\r\n \r\n );\r\n } else if (isRowSelectable(row)) {\r\n return (\r\n {\r\n primaryAction(row);\r\n }}\r\n >\r\n {row.isSelected\r\n ? t(translations.DeSelectServiceGroup)\r\n : t(translations.SelectServiceGroup)}\r\n \r\n );\r\n } else if (\r\n row.original.ApprovalStatusId ===\r\n (ServiceGroupRegistrationStatus.Pending as number)\r\n ) {\r\n return (\r\n
    \r\n \r\n \r\n {t(\r\n translations[\r\n ServiceGroupRegistrationStatus[\r\n row.original.ApprovalStatusId ?? 0\r\n ]\r\n ],\r\n )}\r\n \r\n
    \r\n );\r\n } else {\r\n return ;\r\n }\r\n });\r\n actions.push(({ row }) => {\r\n let canSwitch = isRowSelectable(row);\r\n let canRequestAccess = row.original.CanRequestAccess;\r\n if (canRequestAccess || canSwitch) {\r\n return (\r\n {\r\n const id = row.original.AssetId ?? undefined;\r\n if (id !== undefined) {\r\n openAsset(\r\n {\r\n id: id,\r\n useSidePanel: isSidePanel,\r\n },\r\n openPanel,\r\n );\r\n }\r\n }}\r\n >\r\n {t(translations.ViewServiceGroupDetails)}\r\n \r\n );\r\n } else {\r\n return ;\r\n }\r\n });\r\n return actions;\r\n }, [isRowSelectable, isSidePanel, openAsset, openPanel, primaryAction, t]);\r\n\r\n const selectedRowActions: SelectedRowsActionExtRenderer<\r\n ICoresDirectoryRow\r\n >[] = React.useMemo(() => {\r\n let actions: SelectedRowsActionExtRenderer[] =\r\n loacalServiceGroups.length > 0\r\n ? loacalServiceGroups.map(\r\n sg => (\r\n _selectedRows,\r\n _rows,\r\n _onRefresh,\r\n _toggleAll,\r\n toggleSingle,\r\n ) => (\r\n f.id === sg.Id.toString()).length > 0\r\n ? undefined\r\n : t(translations.DeleteSelectedCard_info)\r\n }\r\n onDelete={() => {\r\n handleRemoveGroup(sg);\r\n _rows\r\n .filter(f => f.id === sg.Id.toString())\r\n .forEach(f => {\r\n f.toggleRowSelected(false);\r\n });\r\n // toggleSingle(sg.Id.toString(), false);\r\n }}\r\n disabled={\r\n !(_rows.filter(f => f.id === sg.Id.toString()).length > 0)\r\n }\r\n variant=\"default\"\r\n customsize={isMobile ? 'small' : 'medium'}\r\n label={sg.Name}\r\n customwidth={isMobile ? 100 : 180}\r\n custombgcolor={bookitColors.primary.disabled}\r\n customcolor={bookitColors.grayscale.blackComponents}\r\n customiconcolor={bookitColors.grayscale.blackComponents}\r\n shape=\"circle\"\r\n key={`selected_${sg.Id}`}\r\n />\r\n ),\r\n )\r\n : [];\r\n return actions;\r\n }, [handleRemoveGroup, isMobile, loacalServiceGroups, t]);\r\n\r\n const tabLeftActions: TabsActionRenderer<\r\n ICoresDirectoryRow\r\n >[] = React.useMemo(() => {\r\n return [\r\n (count, _rows) => (\r\n {\r\n setOnlyMyCores(false);\r\n setTubNumber(0);\r\n if (!isSidePanel && location.search.indexOf('ownedbyme') !== -1) {\r\n const originalSearch = new URLSearchParamsCI(location.search);\r\n originalSearch.delete('ownedbyme');\r\n dispatch(\r\n routerActions.replace({\r\n pathname: location.pathname,\r\n search: originalSearch.toString(),\r\n }),\r\n );\r\n }\r\n }}\r\n />\r\n ),\r\n (_count, rows) => (\r\n f.original.OwnedByMe === true).length})`\r\n }\r\n onClick={() => {\r\n setOnlyMyCores(true);\r\n setTubNumber(1);\r\n }}\r\n />\r\n ),\r\n ];\r\n }, [dispatch, isSidePanel, location.pathname, location.search, t]);\r\n\r\n const tabRightActions: TabsActionRenderer<\r\n ICoresDirectoryRow\r\n >[] = React.useMemo(() => {\r\n return hideNavigation\r\n ? [\r\n (_count, _rows) => (\r\n {\r\n updtOptOut(checked);\r\n if (checked) {\r\n dispatch(\r\n actions.addNotification({\r\n key: 'coreSelection_optOut',\r\n message: t(\r\n translations.CoreSelectionOptOut_info,\r\n ) as string,\r\n variant: 'info',\r\n autoHideDuration: 3000,\r\n closable: true,\r\n }),\r\n );\r\n }\r\n }}\r\n checked={optOutCoreSelection}\r\n />\r\n }\r\n />\r\n ),\r\n ]\r\n : [];\r\n }, [actions, dispatch, hideNavigation, optOutCoreSelection, t, updtOptOut]);\r\n\r\n const selectedBulkActions: SelectedRowsActionRenderer<\r\n ICoresDirectoryRow\r\n >[] = GetSelectedActions(t, authenticatedUser);\r\n const allowedToUseBulkActions = React.useMemo(() => {\r\n return (\r\n !isSidePanel &&\r\n !!authenticatedUser &&\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators) &&\r\n loacalServiceGroups.every(allowedToEditGroup)\r\n );\r\n }, [allowedToEditGroup, authenticatedUser, isSidePanel, loacalServiceGroups]);\r\n const useFloatingActions = React.useMemo(() => {\r\n return multiCoresSelectionMode\r\n ? loacalServiceGroups.length > 0 || skipCoreSelectionScreen\r\n : loacalServiceGroups.length > 1;\r\n }, [\r\n loacalServiceGroups.length,\r\n multiCoresSelectionMode,\r\n skipCoreSelectionScreen,\r\n ]);\r\n const url = '/api/odata/v4/servicegroups';\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Name', desc: false }],\r\n selectedRowIds: selectedRowIds,\r\n pageIndex: 0,\r\n pageSize: 200,\r\n }),\r\n [selectedRowIds],\r\n );\r\n\r\n const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n let acts: PageActionRenderer[] = [];\r\n if (\r\n !isMobile &&\r\n !!authenticatedUser &&\r\n authenticatedUser.Roles.includes(Roles.Administrators)\r\n ) {\r\n acts.push(() => (\r\n \r\n ));\r\n }\r\n if (isSidePanel) {\r\n acts.push(() => (\r\n 0 || skipCoreSelectionScreen)\r\n }\r\n onClick={() => {\r\n handleServiceGroupsChange(loacalServiceGroups);\r\n if (hideNavigation) {\r\n updtFirstLogin(false);\r\n history.push('/systemdash');\r\n } else if (isSidePanel) {\r\n if (redirectToDash) {\r\n history.push('/systemdash');\r\n }\r\n closeSidePanel();\r\n } else {\r\n history.push('/systemdash');\r\n updtFirstLogin(false);\r\n }\r\n }}\r\n title={\r\n !(loacalServiceGroups.length > 0 || skipCoreSelectionScreen)\r\n ? t(translations.SelectDeffServiceGroups)\r\n : t(translations.CloseSidePanel)\r\n }\r\n >\r\n \r\n \r\n ));\r\n } else {\r\n if (\r\n !isMobile &&\r\n !!authenticatedUser &&\r\n (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n ) {\r\n acts.push(() => (\r\n \r\n ));\r\n }\r\n }\r\n return acts;\r\n }, [\r\n authenticatedUser,\r\n closeSidePanel,\r\n handleServiceGroupsChange,\r\n hideNavigation,\r\n history,\r\n isMobile,\r\n isSidePanel,\r\n loacalServiceGroups,\r\n redirectToDash,\r\n skipCoreSelectionScreen,\r\n t,\r\n updtFirstLogin,\r\n ]);\r\n // const detailsRowActions: CellRenderer<\r\n // ICoresDirectoryRow\r\n // >[] = GetDetailsRowActions(t, isRowSelectable, openPanel, isSidePanel);\r\n const addColumns = React.useMemo(() => {\r\n const adds: (keyof ICoresDirectoryRow)[] = [\r\n 'Id',\r\n 'AssetId',\r\n 'CanRequestAccess',\r\n 'UserRegistrationEnabled',\r\n 'ApprovalStatusId',\r\n 'Private',\r\n 'DivisionId',\r\n 'OwnedByMe',\r\n 'AdminsTotal',\r\n 'LabTechTotal',\r\n 'RegionId',\r\n ];\r\n if (\r\n !!authenticatedUser &&\r\n (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n ) {\r\n adds.push('AdminsTotal');\r\n adds.push('LabTechTotal');\r\n }\r\n return adds;\r\n }, [authenticatedUser]);\r\n const ImportHandler = React.useCallback(() => {\r\n setShowImportConfirm(true);\r\n }, []);\r\n\r\n const handleImportClose = React.useCallback(() => {\r\n setShowImportConfirm(false);\r\n }, []);\r\n\r\n return (\r\n \r\n \r\n 0 ? rowActions : undefined}\r\n //rowActions={detailsRowActions}\r\n selectedRowsActions={\r\n allowedToUseBulkActions ? selectedBulkActions : undefined\r\n }\r\n initialState={initialState}\r\n useImportLink={\r\n !isMobile &&\r\n !!authenticatedUser &&\r\n (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n }\r\n importHandler={ImportHandler}\r\n isRowSelectable={isRowSelectable}\r\n isContentEditable={row => {\r\n return (\r\n (row.original.CanRequestAccess &&\r\n (row.original.ApprovalStatusId === null ||\r\n row.original.ApprovalStatusId === undefined) &&\r\n row.original.ApprovalStatusId !==\r\n ServiceGroupRegistrationStatus.Rejected) ||\r\n row.original.ApprovalStatusId ===\r\n ServiceGroupRegistrationStatus.Pending\r\n );\r\n }}\r\n hideMenuOnMobile={isSidePanel}\r\n // viewCardsCheck={multiCoresSelectionMode || isMobile}\r\n viewCardsCheck={true}\r\n onSelectedChange={onSelectChange}\r\n // onSelectedRowsChange={rows => {\r\n // handleServiceGroupsChange(\r\n // rows.map(f => {\r\n // return {\r\n // Id: f.Id,\r\n // Name: f.Name,\r\n // } as Entity;\r\n // }),\r\n // );\r\n // }}\r\n imageSrcKey=\"ImageName\"\r\n titleKey=\"Name\"\r\n allowCards={true}\r\n primaryAction={(row, _toggleAllRowsSelected) => {\r\n primaryAction(row);\r\n }}\r\n useCardsByDefault={true}\r\n floatingTabSettings={{\r\n useFloatingActions: useFloatingActions,\r\n selectedFloatingActions: selectedRowActions,\r\n buttonFloatingActions: [\r\n _rows => (\r\n primaryMultipleAction()}\r\n >\r\n {isMobile ? 'Continue' : 'Continue with Selected'}\r\n \r\n ),\r\n ],\r\n useSidePanel: isSidePanel,\r\n }}\r\n pageActions={pageActions}\r\n additionalColumns={addColumns}\r\n useRowSelect={true}\r\n preventInnerClicks\r\n searchColumns={['Name', 'Description']}\r\n tabSectionSettings={{\r\n useTabsSection: true,\r\n leftTabs: showMyCoresOptions ? tabLeftActions : undefined,\r\n selectedTabValue: tabNumber,\r\n defaultMultiMode: multiCoresSelectionMode === true,\r\n getMultiMode: value => setMultiCoresselectionMode(value),\r\n showClear: !multiCoresSelectionMode && skipCoreSelectionScreen,\r\n onAllRowsSelected: handleRowsServiceGroupsChange,\r\n rightTabActions: tabRightActions,\r\n }}\r\n />\r\n \r\n );\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column, Row } from 'react-table';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\n\r\nimport ImageRenderer from 'app/components/BasicTable/CellRenderers/ImageRenderer';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { RegionLink } from 'app/pages/Regions/RegionLink';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\nexport const getColumns = (\r\n t: TFunction,\r\n isRowSelectable: (row: Row) => boolean,\r\n user: AuthenticatedUser | undefined,\r\n settings: GlobalSettings | null,\r\n appSettings: AppSettings | null,\r\n useSidePanel?: boolean,\r\n) => {\r\n const isAdmin = !!user && user.Roles.includes(Roles.Administrators);\r\n const isGroupAdmin = !!user && user.Roles.includes(Roles.GroupAdministrators);\r\n const cols: (Column & { invisible?: boolean })[] = [\r\n {\r\n Header: t(translations.Name) as string,\r\n accessor: 'Name',\r\n Cell: ({ value, row }) => {\r\n const id = row.original.AssetId ?? undefined;\r\n if (id !== undefined) {\r\n return (\r\n //isRowSelectable(row) ? (\r\n \r\n {value}\r\n \r\n );\r\n } else {\r\n return <>{value};\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.Image) as string,\r\n accessor: 'ImageName',\r\n Cell: ImageRenderer,\r\n },\r\n {\r\n Header: t(translations.Description) as string,\r\n accessor: 'Description',\r\n Cell: DescriptionCell({ width: 'long' }),\r\n },\r\n ];\r\n if (isAdmin || isGroupAdmin) {\r\n cols.push({\r\n Header: t(translations.HashSymbol) as string,\r\n accessor: 'Id',\r\n Cell: ({ value, row }) => {\r\n if (row.original.OwnedByMe) {\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n } else {\r\n return <>{value};\r\n }\r\n },\r\n });\r\n cols.push({\r\n Header: t(translations.Active) as string,\r\n accessor: 'Active',\r\n Cell: ({ value }) => ,\r\n });\r\n cols.push({\r\n Header: t(translations.AdminEmail) as string,\r\n accessor: 'AdminEmail',\r\n });\r\n if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n cols.push({\r\n Header: t(translations.Division) as string,\r\n accessor: 'DivisionName',\r\n Cell: ({ value, row }) => {\r\n if (isAdmin) {\r\n if (!row.original.DivisionId || row.original.DivisionId === null) {\r\n return <>{t(translations.NA)};\r\n } else {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n }\r\n } else {\r\n return <>{value ?? t(translations.NA)};\r\n }\r\n },\r\n });\r\n cols.push({\r\n Header: t(translations.Region) as string,\r\n accessor: 'RegionName',\r\n Cell: ({ value, row }) => {\r\n if (isAdmin) {\r\n if (!row.original.RegionId || row.original.RegionId === null) {\r\n return <>{t(translations.NA)};\r\n } else {\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n }\r\n } else {\r\n return <>{value ?? t(translations.NA)};\r\n }\r\n },\r\n });\r\n }\r\n cols.push({\r\n Header: t(translations.OnlineServicesCount) as string,\r\n accessor: 'OnlineServicesCount',\r\n Cell: ({ value }) =>\r\n !!value && value !== null ? <>{value} : <>{t(translations.NA)},\r\n });\r\n cols.push({\r\n Header: t(translations.OfflineServicesCount) as string,\r\n accessor: 'OfflineServicesCount',\r\n Cell: ({ value }) =>\r\n !!value && value !== null ? <>{value} : <>{t(translations.NA)},\r\n });\r\n cols.push({\r\n Header: t(translations.RequestTypesCount) as string,\r\n accessor: 'RequestTypesCount',\r\n Cell: ({ value }) =>\r\n !!value && value !== null ? <>{value} : <>{t(translations.NA)},\r\n });\r\n if (\r\n tryParseBool(\r\n settings?.GetString(AllowedSettings.LimitServiceGroupLicenses),\r\n ) === true\r\n ) {\r\n cols.push({\r\n Header: t(translations.ServiceGroupAdminsLimit) as string,\r\n accessor: 'AdminsLimit',\r\n Cell: ({ value, row }) => {\r\n return (\r\n \r\n {`${row.original.AdminsTotal} / `}\r\n {value === undefined || value === null || value === 0 ? (\r\n \r\n ) : (\r\n value\r\n )}\r\n \r\n );\r\n },\r\n });\r\n cols.push({\r\n Header: t(translations.LabTechsLimit) as string,\r\n accessor: 'LabTechLimit',\r\n Cell: ({ value, row }) => {\r\n return (\r\n \r\n {`${row.original.LabTechTotal} / `}\r\n {value === undefined || value === null || value === 0 ? (\r\n \r\n ) : (\r\n value\r\n )}\r\n \r\n );\r\n },\r\n });\r\n }\r\n }\r\n return cols.filter(v => !v.invisible) as Column[];\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\n// import { coreSelectionSaga } from './saga';\r\nimport { CoreSelectionState } from './types';\r\n\r\nexport const initialState: CoreSelectionState = {\r\n filters: undefined,\r\n loading: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'coreSelection',\r\n initialState,\r\n reducers: {\r\n setFilters(state, action: PayloadAction | undefined>) {\r\n state.filters = action.payload;\r\n },\r\n setLoading(state, action: PayloadAction) {\r\n state.loading = action.payload;\r\n },\r\n reset(state, action: PayloadAction) {\r\n state.filters = undefined;\r\n state.loading = undefined;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: coreSelectionActions } = slice;\r\n\r\nexport const useCoreSelectionSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n // useInjectSaga({ key: slice.name, saga: coreSelectionSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useCoreSelectionSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.coreSelection || initialState;\r\n\r\nexport const selectCoreSelection = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectCoreSelectionLoading = createSelector(\r\n [selectCoreSelection],\r\n state => state.loading,\r\n);\r\n\r\nexport const selectCoreSelectionFilters = createSelector(\r\n [selectCoreSelection],\r\n state => state.filters,\r\n);\r\n","import {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\n//import { selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n////import { useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { CoreSelectionTable } from './Table/CoreSelectionTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useCoreSelectionSlice } from './slice';\r\nimport { selectCoreSelectionFilters } from './slice/selectors';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Row } from 'react-table';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface CoreSelectionProps extends SidePanelContentProps, CoverProps {}\r\n\r\nexport function CoreSelection(props: CoreSelectionProps) {\r\n const { useSidePanel, isCover, closeCover } = props;\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const { t } = useTranslation();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const settings = useSelector(selectglobalSettings);\r\n const noDashboardRedirectByClick =\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.NoDashboardRedirectOnCoreSelection],\r\n ) === true;\r\n const redirectToDash = React.useMemo(() => {\r\n return (\r\n window.location.pathname.indexOf('/dashboards/core/') >= 0 ||\r\n window.location.pathname.indexOf('/systemdash') >= 0 ||\r\n !noDashboardRedirectByClick\r\n );\r\n }, [noDashboardRedirectByClick]);\r\n\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const filters = useSelector(selectCoreSelectionFilters);\r\n const hideNavigation = useSelector(selectHideNavigation);\r\n const dispatch = useDispatch();\r\n const { actions } = useCoreSelectionSlice();\r\n // const openAsset = useOpenAssetPopUp();\r\n // const history = useHistory();\r\n // const [cover, setCover] = React.useState();\r\n const {\r\n cover,\r\n closePanel,\r\n openPanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState();\r\n const {\r\n savedEnabled: isFirstLogin,\r\n updateEnabled: updateIsFirstLogin,\r\n } = useProfileSetting({\r\n profileSettingKey: 'IsFirstLoginUser',\r\n });\r\n const {\r\n savedEnabled: OptOutCoreSelection,\r\n updateEnabled: updateIsOptOut,\r\n } = useProfileSetting({\r\n profileSettingKey: 'CoreSelectionOptOut',\r\n });\r\n const pagelink = React.useMemo(\r\n () => buildURL(`${publicUrl}coreselection`, filters ?? {}),\r\n [filters, publicUrl],\r\n );\r\n useEffectOnMount(() => {\r\n dispatch(\r\n layoutActions.setHideNavigation(\r\n !!authenticatedUser &&\r\n !authenticatedUser.HasOptOutCoreSelection &&\r\n !useSidePanel &&\r\n isFirstLogin,\r\n ),\r\n );\r\n });\r\n // const closeCover = () => {\r\n // setCover(undefined);\r\n // };\r\n\r\n const closeSidePanel = React.useCallback(() => {\r\n if (isFirstLogin && hideNavigation) {\r\n updateIsFirstLogin(false);\r\n }\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n } as SidePanelCloseState);\r\n }, [\r\n closePanel,\r\n hideNavigation,\r\n isCover,\r\n isFirstLogin,\r\n updateIsFirstLogin,\r\n useSidePanel,\r\n ]);\r\n const isRowSelectable = (row: Row): boolean => {\r\n let isAdmin = authenticatedUser?.AdminServiceGroups?.some(\r\n sg => sg.Id === row.original.Id,\r\n );\r\n let canSwitch =\r\n row.original.Private === false ||\r\n isAdmin === true ||\r\n row.original.ApprovalStatusId === ServiceGroupRegistrationStatus.Approved;\r\n return canSwitch;\r\n };\r\n\r\n const setfilterCallback = React.useCallback(\r\n (v: IFilterSettings[] | undefined) => {\r\n const res = {};\r\n if (!!v) {\r\n toURLSearchParams(v).forEach((val, name) => {\r\n res[name] = val;\r\n });\r\n }\r\n dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n },\r\n [actions, dispatch],\r\n );\r\n return (\r\n {t(translations.menu_CoreSelection)}}\r\n titlePage={t(translations.menu_CoreSelection)}\r\n closable={useSidePanel}\r\n //disableExpandToggle={true}\r\n //rightTopActions={topButtons}\r\n isCover={false}\r\n coverClosed={coverClosed}\r\n hideTitleBar={true}\r\n cover={cover}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n children={\r\n \r\n }\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * RadioGroup\r\n *\r\n */\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormHelperText,\r\n FormLabel,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { Check } from '../BasicInputs/Check';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface CheckEntity extends Entity {\r\n checked: boolean;\r\n disabled?: boolean;\r\n}\r\nexport interface ChipEntity extends Entity {\r\n info?: string;\r\n disabled?: boolean;\r\n}\r\nexport interface CheckBoxGroupProps {\r\n options: CheckEntity[];\r\n value?: CheckEntity[];\r\n className?: string;\r\n onChange?: (\r\n value: CheckEntity,\r\n event: React.ChangeEvent,\r\n ) => void;\r\n id: string;\r\n //formik\r\n name?: string;\r\n error?: boolean;\r\n label?: string;\r\n disabled?: boolean;\r\n required?: boolean;\r\n helperText?: string;\r\n info?: string;\r\n fullWidth?: boolean;\r\n size?: 'small' | 'medium';\r\n margin?: 'none' | 'dense' | 'normal';\r\n isRow?: boolean;\r\n}\r\n\r\nexport function CheckBoxGroup({\r\n name,\r\n id,\r\n value,\r\n options,\r\n onChange,\r\n label,\r\n required,\r\n helperText,\r\n disabled,\r\n fullWidth,\r\n margin,\r\n error,\r\n size,\r\n isRow,\r\n ...props\r\n}: CheckBoxGroupProps) {\r\n const handleChange = (event: React.ChangeEvent) => {\r\n const value = {\r\n Id: parseInt(event.target.id),\r\n Name: event.target.name,\r\n checked: event.target.checked,\r\n } as CheckEntity;\r\n if (onChange !== undefined) {\r\n onChange(value, event);\r\n }\r\n };\r\n return (\r\n \r\n {label}\r\n \r\n {options.map((item, index) => (\r\n \r\n }\r\n label={item.Name}\r\n />\r\n ))}\r\n \r\n {helperText}\r\n \r\n // \r\n // {options.map((option, index) => (\r\n // \r\n // }\r\n // label={option.Name}\r\n // disabled={props.disabled}\r\n // />\r\n // {(option as any).Info && (\r\n // \r\n // \r\n // \r\n // \r\n // \r\n // )}\r\n // \r\n // ))}\r\n // \r\n );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n CheckBoxGroup,\r\n CheckBoxGroupProps,\r\n CheckEntity,\r\n} from '../CheckBoxGroup';\r\n\r\n//export type FormCheckBoxGroupProps = FieldHookConfig & CheckBoxGroupProps;\r\n\r\nexport const FormCheckBoxGroup = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & CheckBoxGroupProps) => {\r\n const [field, meta, helpers] = useField(props);\r\n const handleChange = (value, event) => {\r\n const val = value as CheckEntity;\r\n helpers.setValue(\r\n field.value.map(f => {\r\n if (f.Id === val.Id) {\r\n f.checked = val.checked;\r\n }\r\n return f;\r\n }),\r\n true,\r\n );\r\n if (props.onChange !== undefined) {\r\n props.onChange(value, event);\r\n }\r\n field.onChange(event);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * EveryDaysPicker\r\n *\r\n */\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface EveryDaysPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const initEveryDaysData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n Array.from(Array(100))\r\n .map((e, i) => {\r\n return { Id: i, Name: i.toString() };\r\n })\r\n .filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = Array.from(Array(100))\r\n .map((e, i) => {\r\n return { Id: i, Name: i.toString() };\r\n })\r\n .filter(d => d.Id !== 0) as Entity[];\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\nexport function EveryDaysPicker(props: EveryDaysPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EveryDaysPicker } from '../pickers/StaticOptionsPickers/EveryDaysPicker';\r\n\r\nexport const FormEveryDaysPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * RepeatMonthlyByPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RepeatMonthlyBy } from 'enums/RepetitiveOptions';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RepeatMonthlyByPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const initRepeatMonthlyByData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n enumToEntityArray(RepeatMonthlyBy).filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(RepeatMonthlyBy);\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\nexport function RepeatMonthlyByPicker(props: RepeatMonthlyByPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * RepeatMonthlyByPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RepeatMonthlyByPicker } from '../pickers/StaticOptionsPickers/RepeatMonthlyBy';\r\n\r\nexport const FormRepeatMonthlyByPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * RepeatPeriodPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RepeatPeriod } from 'enums/RepetitiveOptions';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RepeatPeriodPickerProps\r\n extends Omit>, 'getOptions'> {}\r\n\r\nexport const initRemindBeforeData = (\r\n initval: number | string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n enumToEntityArray(RepeatPeriod).filter(item => {\r\n return item.Id.toString() === initval;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n let items = enumToEntityArray(RepeatPeriod);\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n};\r\nexport function RepeatPeriodPicker(props: RepeatPeriodPickerProps) {\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * RepeatPeriodPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RepeatPeriodPicker } from '../pickers/StaticOptionsPickers/RepeatPeriodPicker';\r\n\r\nexport const FormRepeatPeriodPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> & IFieldProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n disableClearable={props.disableClearable}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * RepetitiveOptionsPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\n// import { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { selectSystemFirstDayOfWeek } from 'app/slice/selectors';\r\nimport { GetRepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nexport interface IRepetitiveOptionsParamsPicker {\r\n startDate: Date | null;\r\n}\r\nexport interface RepetitiveOptionsPickerProps\r\n extends Omit>, 'getOptions'>,\r\n IRepetitiveOptionsParamsPicker {}\r\n\r\n// export const initRepetitiveOptionsData = (\r\n// initval: number | string | undefined,\r\n// ): Promise[]> => {\r\n// if (initval === undefined) {\r\n// return new Promise[]>((resolve, reject) => {\r\n// resolve([] as Entity[]);\r\n// });\r\n// } else {\r\n// return new Promise[]>((resolve, reject) => {\r\n// resolve(\r\n// enumToEntityArray(RepetitiveOptions).filter(item => {\r\n// return item.Id.toString() === initval;\r\n// }),\r\n// );\r\n// });\r\n// }\r\n// };\r\n// const getOptions = (searchTerm: string | null) => {\r\n// let items = enumToEntityArray(RepetitiveOptions);\r\n\r\n// if (searchTerm !== null && searchTerm !== '') {\r\n// return items.filter(\r\n// f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n// );\r\n// }\r\n// return items;\r\n// };\r\nexport function withParamsFilter(\r\n startDate: Date | null,\r\n firstDayOfWeek: number,\r\n) {\r\n let date = startDate || new Date();\r\n let items = GetRepetitiveOptions(date, firstDayOfWeek);\r\n\r\n return (searchTerm: string | null) => {\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n };\r\n}\r\nexport function RepetitiveOptionsPicker(props: RepetitiveOptionsPickerProps) {\r\n const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n // const { getOffsetDate } = useSystemDate();\r\n let getOptions = withParamsFilter(\r\n props.startDate === null\r\n ? null\r\n : dateUtils.dateOrStringToDate(props.startDate),\r\n firstDayOfWeek || 0,\r\n );\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n IRepetitiveOptionsParamsPicker,\r\n RepetitiveOptionsPicker,\r\n} from '../pickers/StaticOptionsPickers/RepetitiveOptionsPicker';\r\n\r\nexport const FormRepetitiveOptionsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n IRepetitiveOptionsParamsPicker) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","import { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { every } from 'lodash';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport * as Yup from 'yup';\r\nimport { CheckEntityShema } from '.';\r\nimport { TransformDate } from './SchemaMethods';\r\n\r\nexport const RepetitiveSchema: Yup.SchemaOf = Yup.object({\r\n StartDate: Yup.date()\r\n .transform(TransformDate)\r\n .default(dateUtils.dateOrStringToDate(new Date())),\r\n RecurringEndDate: Yup.date()\r\n .label(i18next.t(translations.Until))\r\n .when('RecurringEvents', {\r\n is: val =>\r\n val !== null && val.Id !== (RepetitiveOptions.DoNotRepeat as number),\r\n then: Yup.date()\r\n .min(\r\n Yup.ref('StartDate'),\r\n i18next.t(translations.err_RepeatUntilDateLessThanStart) as string,\r\n )\r\n .required(i18next.t(translations.err_AlertInvalidRecurringUntilDate)),\r\n }),\r\n RecurringEvents: Yup.mixed(),\r\n RepeatsEveryDay: Yup.mixed(),\r\n RepeatsEveryPeriod: Yup.mixed(),\r\n RepeatsMonthlyBy: Yup.mixed(),\r\n RepeatsOnDays: Yup.array()\r\n .of(CheckEntityShema)\r\n .test({\r\n name: i18next.t(translations.RepeatsBy),\r\n message: i18next.t(translations.err_PepeatsOnDaysRequired),\r\n test: val => !every(val, ['checked', false]),\r\n }),\r\n});\r\n","import { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport {\r\n RepeatMonthlyBy,\r\n RepeatPeriod,\r\n RepetitiveOptions,\r\n} from 'enums/RepetitiveOptions';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IRepetitiveDto, ShortWeekDays } from 'types/IRepetitiveDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { FormBookitDatePicker } from '../FormBookitDatePicker';\r\nimport { FormCheckBoxGroup } from '../FormCheckBoxGroup';\r\nimport { FormEveryDaysPicker } from '../FormEveryDaysPicker';\r\nimport {\r\n FieldHandler,\r\n FormFieldProps,\r\n FormikSection,\r\n FormListener,\r\n IFieldSection,\r\n} from '../FormRender/FormRenderer';\r\nimport { FormRepeatMonthlyByPicker } from '../FormRepeatMonthlyByPicker';\r\nimport { FormRepeatPeriodPicker } from '../FormRepeatPeriodPicker';\r\nimport { FormRepetitiveOptionsPicker } from '../FormRepetitiveOptionsPicker';\r\nimport { RepetitiveSchema } from '../Schemas/RepititiveSchema';\r\nimport { useRepetitiveSlice } from './slice';\r\nimport { selectRepetitiveFieldHandler } from './slice/selectors';\r\nimport { RepetitiveFor } from './slice/types';\r\n\r\nexport interface FormRepetitiveProps {\r\n onSubmit: (item: IRepetitiveDto) => void;\r\n RepetitiveData?: IRepetitiveDto;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n StartDate?: Date;\r\n title: string | undefined;\r\n type: RepetitiveFor;\r\n disabled?: boolean;\r\n formIsValid?: (isValid: boolean) => void;\r\n withTopSeparator?: boolean;\r\n withBottomSeparator?: boolean;\r\n onFormChange?: (\r\n values: IRepetitiveDto,\r\n isValid: boolean,\r\n dirty: boolean,\r\n setValue?: (field: string, value: any, shouldValidate?: boolean) => void,\r\n ) => void;\r\n setTouched?: (dirty: boolean) => void;\r\n}\r\n\r\nexport function RepetitiveForm({\r\n onSubmit,\r\n processing,\r\n RepetitiveData,\r\n bindSubmitForm,\r\n StartDate,\r\n title,\r\n type,\r\n disabled,\r\n withTopSeparator,\r\n withBottomSeparator,\r\n formIsValid,\r\n setTouched,\r\n}: FormRepetitiveProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useRepetitiveSlice();\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n const { newDate } = useSystemDate();\r\n const [recurringChanged, setRecurringChanged] = React.useState(\r\n false,\r\n );\r\n const [repeatPeriodChanged, setRepeatPeriodChanged] = React.useState(\r\n false,\r\n );\r\n const [repeatEndChanged, setRepeatEndChanged] = React.useState(\r\n false,\r\n );\r\n const fieldHandler = useSelector(selectRepetitiveFieldHandler);\r\n const reserFieldHandler = () => {\r\n dispatch(actions.resetRepetitiveHandler());\r\n };\r\n const handleFormChange = React.useCallback(\r\n (values: IRepetitiveDto, isValid, dirty, setValue) => {\r\n if (recurringChanged) {\r\n if (\r\n !!values.RecurringEvents &&\r\n values.RecurringEvents.Id ===\r\n (RepetitiveOptions.RepeatCustom as number)\r\n ) {\r\n setValue('RepeatsEveryDay', { Id: 1, Name: '1' }, false);\r\n setValue(\r\n 'RepeatsEveryPeriod',\r\n enumToEntityArray(RepeatPeriod, t).filter(f => f.Id === 2)[0],\r\n false,\r\n );\r\n setValue(\r\n 'RepeatsOnDays',\r\n ShortWeekDays().map(f => {\r\n if (f.Id === 1) f.checked = true;\r\n return f;\r\n }),\r\n false,\r\n );\r\n setValue('RepeatsMonthlyBy', null, false);\r\n }\r\n dispatch(\r\n actions.saveState({\r\n StartDate:\r\n values.StartDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartDate),\r\n ),\r\n RecurringEvents: values.RecurringEvents,\r\n RepeatsOnDays: values.RepeatsOnDays,\r\n RecurringEndDate:\r\n values.RecurringEndDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n ),\r\n RepeatsEveryDay: values.RepeatsEveryDay,\r\n RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n } as IRepetitiveDto),\r\n );\r\n setRecurringChanged(false);\r\n }\r\n if (repeatPeriodChanged) {\r\n let period = values.RepeatsEveryPeriod;\r\n if (period !== null && period !== undefined) {\r\n if (period.Id === (RepeatPeriod.Days as number)) {\r\n setValue('RepeatsMonthlyBy', null, false);\r\n setValue(\r\n 'RepeatsOnDays',\r\n ShortWeekDays().map(f => {\r\n if (f.Id === 1) f.checked = true;\r\n return f;\r\n }),\r\n false,\r\n );\r\n } else if (period.Id === (RepeatPeriod.Weeks as number)) {\r\n setValue('RepeatsMonthlyBy', null, false);\r\n setValue(\r\n 'RepeatsOnDays',\r\n ShortWeekDays().map(f => {\r\n if (f.Id === 1) f.checked = true;\r\n return f;\r\n }),\r\n false,\r\n );\r\n } else if (period.Id === (RepeatPeriod.Months as number)) {\r\n setValue(\r\n 'RepeatsMonthlyBy',\r\n enumToEntityArray(RepeatMonthlyBy, t)[0],\r\n false,\r\n );\r\n setValue(\r\n 'RepeatsOnDays',\r\n ShortWeekDays().map(f => {\r\n if (f.Id === 1) f.checked = true;\r\n return f;\r\n }),\r\n false,\r\n );\r\n }\r\n }\r\n dispatch(\r\n actions.saveState({\r\n StartDate:\r\n values.StartDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartDate),\r\n ),\r\n RecurringEvents: values.RecurringEvents,\r\n RepeatsOnDays: values.RepeatsOnDays,\r\n RecurringEndDate:\r\n values.RecurringEndDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n ),\r\n RepeatsEveryDay: values.RepeatsEveryDay,\r\n RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n } as IRepetitiveDto),\r\n );\r\n setRepeatPeriodChanged(false);\r\n }\r\n if (repeatEndChanged) {\r\n dispatch(\r\n actions.saveState({\r\n StartDate:\r\n values.StartDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.StartDate),\r\n ),\r\n RecurringEvents: values.RecurringEvents,\r\n RepeatsOnDays: values.RepeatsOnDays,\r\n RecurringEndDate:\r\n values.RecurringEndDate === undefined\r\n ? undefined\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n ),\r\n RepeatsEveryDay: values.RepeatsEveryDay,\r\n RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n } as IRepetitiveDto),\r\n );\r\n setRepeatEndChanged(false);\r\n }\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n recurringChanged,\r\n repeatEndChanged,\r\n repeatPeriodChanged,\r\n t,\r\n ],\r\n );\r\n const leftSideSections = (\r\n values: IRepetitiveDto,\r\n isSubmitting: boolean,\r\n title: string | undefined,\r\n ): IFieldSection[] => {\r\n return [\r\n {\r\n title: title,\r\n order: 1,\r\n withBottomSeparator: withBottomSeparator,\r\n withTopSeparator: withTopSeparator,\r\n fields: [\r\n {\r\n id: 'RecurringEvents',\r\n name: 'RecurringEvents',\r\n startDate: dateUtils.dateOrStringToDate(\r\n values.StartDate || newDate(),\r\n ),\r\n label: undefined,\r\n ariaLabel:\r\n type === RepetitiveFor.WorkOrder\r\n ? t(translations.RecurringEvents)\r\n : type === RepetitiveFor.Reservations\r\n ? t(translations.RepetitiveReservation)\r\n : t(translations.Repeat),\r\n disabled: isSubmitting || disabled,\r\n disableClearable: true,\r\n onChange: () => setRecurringChanged(true),\r\n fullWidth: true,\r\n component: FormRepetitiveOptionsPicker,\r\n order: 1,\r\n } as FormFieldProps | null>,\r\n {\r\n minRow: true,\r\n hide:\r\n values.RecurringEvents?.Id ===\r\n (RepetitiveOptions.DoNotRepeat as number),\r\n id: 'RecurringEndDate',\r\n name: 'RecurringEndDate',\r\n label: t(translations.Until),\r\n disabled: isSubmitting || disabled,\r\n fullWidth: true,\r\n component: FormBookitDatePicker,\r\n onChange: () => setRepeatEndChanged(true),\r\n order: 2,\r\n } as FormFieldProps,\r\n {\r\n hide:\r\n values.RecurringEvents?.Id !==\r\n (RepetitiveOptions.RepeatCustom as number),\r\n id: 'RepeatsEveryDay',\r\n name: 'RepeatsEveryDay',\r\n label: t(translations.RepeatsEvery),\r\n disabled: isSubmitting || disabled,\r\n disableClearable: true,\r\n fullWidth: true,\r\n component: FormEveryDaysPicker,\r\n order: 3,\r\n } as FormFieldProps | null>,\r\n {\r\n hide:\r\n values.RecurringEvents?.Id !==\r\n (RepetitiveOptions.RepeatCustom as number),\r\n id: 'RepeatsEveryPeriod',\r\n name: 'RepeatsEveryPeriod',\r\n label: t(translations.RepeatsEveryPeriod),\r\n onChange: () => setRepeatPeriodChanged(true),\r\n disabled: isSubmitting || disabled,\r\n disableClearable: true,\r\n fullWidth: true,\r\n component: FormRepeatPeriodPicker,\r\n order: 4,\r\n } as FormFieldProps | null>,\r\n {\r\n hide:\r\n values.RecurringEvents?.Id !==\r\n (RepetitiveOptions.RepeatCustom as number) ||\r\n values.RepeatsEveryPeriod?.Id !== (RepeatPeriod.Months as number),\r\n id: 'RepeatsMonthlyBy',\r\n name: 'RepeatsMonthlyBy',\r\n label: t(translations.RepeatsBy),\r\n disabled: isSubmitting || disabled,\r\n disableClearable: true,\r\n fullWidth: true,\r\n component: FormRepeatMonthlyByPicker,\r\n order: 5,\r\n } as FormFieldProps | null>,\r\n {\r\n fullRow: true,\r\n hide:\r\n values.RecurringEvents?.Id !==\r\n (RepetitiveOptions.RepeatCustom as number) ||\r\n values.RepeatsEveryPeriod?.Id !== (RepeatPeriod.Weeks as number),\r\n id: 'RepeatsOnDays',\r\n name: 'RepeatsOnDays',\r\n label: t(translations.RepeatsOn),\r\n options: values.RepeatsOnDays,\r\n disabled: isSubmitting || disabled,\r\n fullWidth: true,\r\n component: FormCheckBoxGroup,\r\n order: 6,\r\n } as FormFieldProps,\r\n ],\r\n item: values,\r\n } as IFieldSection,\r\n ];\r\n };\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n // if (formik.errors) {\r\n // console.log('Repetitive errors', formik.errors);\r\n // }\r\n if (formIsValid) {\r\n formIsValid(formik.isValid);\r\n }\r\n setTouched?.(formik.dirty);\r\n return (\r\n <>\r\n
    \r\n \r\n \r\n \r\n {leftSideSections(formik.values, formik.isSubmitting, title)\r\n .sort((a, b) => a.order - b.order)\r\n .map((section, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n // return (\r\n // \r\n // );\r\n}\r\n","import { httpClient } from './HttpClient';\r\nimport { IUserTrainingDto } from './odata/generated/entities/IUserTrainingDto';\r\n\r\nexport const UserTrainingApi = {\r\n initCreateData: (payload: {\r\n equId?: string | null;\r\n equIds?: string | null;\r\n fatherId?: string | null;\r\n user?: string | null;\r\n rid?: string | null;\r\n date?: string | null;\r\n }) => {\r\n const url = `/api/odata/v4/usertrainings/initNewTraining`;\r\n return httpClient.post(url, payload);\r\n },\r\n initUpdateData: (payload: { Id: number }) => {\r\n const url = '/api/odata/v4/usertrainings';\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Id asc',\r\n $filter: '(Id eq ' + payload.Id + ')',\r\n $select:\r\n 'Id,AttachmentExist,EquipmentId,UserGroupId,AllowBookingFromTrainingDate,MustOrderEveryDays,MustUseEveryDays,ReservationName,TrainerId' +\r\n ',AssetId,UserDisplayName,UserId,ServiceGroupId,ExpiredDate,UserGroupName,Active,Remarks,RequiresAdminApproval,ReservationId,TrainingLevelName,TrainingLevelId,TrainerName' +\r\n ',TrainingDate,EquipmentName,ServiceGroupName,ReservationStart,ReservationEnd',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient.get(url, params);\r\n },\r\n\r\n submitTrainings: (payload: IUserTrainingDto[]) => {\r\n const data = {\r\n trainings: payload,\r\n };\r\n const url = '/api/odata/v4/usertrainings/SubmitTrainings';\r\n return httpClient.post(url, data);\r\n },\r\n approveRejectReservations: (payload: {\r\n trainings: number[];\r\n approve: boolean;\r\n }) => {\r\n const data = {\r\n rows: payload.trainings,\r\n };\r\n const url = payload.approve\r\n ? `/api/odata/v4/usertrainings/ApproveReservations`\r\n : `/api/odata/v4/usertrainings/RejectReservations`;\r\n return httpClient.post(url, data);\r\n },\r\n hasUntrainedNotAllowed: (payload: { services: string; users: string }) => {\r\n const url = `/api/odata/v4/usertrainings/UntrainedNotAllowed`;\r\n return httpClient.post(url, payload);\r\n },\r\n activateTraining: (payload: { Id?: number; activate?: boolean }) => {\r\n const url = `/api/odata/v4/usertrainings/ActivateDeactivateTraining`;\r\n return httpClient.post(url, payload);\r\n },\r\n};\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { toNumberOrNull } from 'utils/typeUtils';\r\n\r\n/* --- STATE --- */\r\nexport interface TrainingReservationsState {\r\n showApproveReservations: boolean;\r\n showRejectReservations: boolean;\r\n ApproveRejectRecords: number[];\r\n processing: boolean;\r\n completed?: boolean;\r\n}\r\nexport interface TrainingState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n reservationsUpdateState: TrainingReservationsState;\r\n processing: boolean;\r\n}\r\n\r\nexport interface TrainingDetailsState {\r\n Id: number | null | undefined;\r\n Users: Entity[];\r\n Equipments: Entity[];\r\n UnhideServiceGroup: boolean | null | undefined;\r\n TrainingDate: Date | string | null | undefined;\r\n ExpiredDate: Date | string | null | undefined;\r\n Trainer: Entity | null | undefined;\r\n MustOrderEveryDays: number | null | undefined;\r\n MustUseEveryDays: number | null | undefined;\r\n RequiresAdminApproval: boolean | null | undefined;\r\n AllowBookingFromTrainingDate: boolean | null | undefined;\r\n Reservations: Entity | null | undefined;\r\n TrainingLevel: Entity | null | undefined;\r\n Remarks?: string | null;\r\n Active: boolean | null | undefined;\r\n FatherId: number | null | undefined;\r\n ServiceGroupId: number | null | undefined;\r\n TrainingProgram: Entity | null | undefined;\r\n}\r\n\r\nexport interface TrainingsResponse extends IResponseType {\r\n ShowApproveReservationsMessage: boolean;\r\n ShowReviseToPendingMessage: boolean;\r\n ApproveRejectRecords: number[];\r\n Id?: number;\r\n}\r\nexport function ConvertEntityToModel(\r\n entity: IUserTrainingDto,\r\n): TrainingDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: entity.Id,\r\n Active: entity.Active,\r\n AllowBookingFromTrainingDate: entity.AllowBookingFromTrainingDate,\r\n Equipments: [\r\n {\r\n Id: entity.EquipmentId,\r\n Name: entity.EquipmentName,\r\n ServiceGroupId: entity.ServiceGroupId,\r\n ServiceTypeId: 1,\r\n } as IServiceFilterDto,\r\n ] as Entity[],\r\n ExpiredDate:\r\n entity.ExpiredDate === null\r\n ? null\r\n : dateUtils.formatISO(dateUtils.parseISO(entity.ExpiredDate), {\r\n representation: 'date',\r\n }),\r\n FatherId: null,\r\n MustOrderEveryDays: entity.MustOrderEveryDays,\r\n MustUseEveryDays: entity.MustUseEveryDays,\r\n Remarks: entity.Remarks,\r\n RequiresAdminApproval: entity.RequiresAdminApproval,\r\n Reservations:\r\n entity.ReservationId == null\r\n ? null\r\n : toEntity(\r\n entity.ReservationId,\r\n dateUtils.shortDateTimeFormat(entity.ReservationStart) +\r\n ' - ' +\r\n dateUtils.shortDateTimeFormat(entity.ReservationEnd),\r\n ),\r\n Trainer: toEntity(entity.TrainerId, entity.TrainerName) as IUserFilterDto,\r\n TrainingDate: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(entity.TrainingDate),\r\n {\r\n representation: 'date',\r\n },\r\n ),\r\n TrainingLevel: toEntity(entity.TrainingLevelId, entity.TrainingLevelName),\r\n Users: [{ Id: entity.UserId, Name: entity.UserDisplayName }],\r\n ServiceGroupId: entity.ServiceGroupId,\r\n UnhideServiceGroup: entity.UnhideServiceGroup,\r\n TrainingProgram: toEntity(\r\n entity.TrainingProgramId,\r\n entity.TrainingProgramName,\r\n ),\r\n } as TrainingDetailsState;\r\n }\r\n}\r\nexport function ConvertModelToEntity(\r\n model: TrainingDetailsState,\r\n original: TrainingDetailsState | undefined,\r\n): IUserTrainingDto[] {\r\n let entities = [] as IUserTrainingDto[];\r\n model.Equipments.forEach(eq => {\r\n model.Users.forEach(ur => {\r\n entities.push({\r\n Id:\r\n original === undefined\r\n ? -1\r\n : original?.Equipments[0].Id === eq.Id &&\r\n original.Users[0].Id === ur.Id\r\n ? model.Id ?? -1\r\n : -1,\r\n EquipmentId: eq.Id,\r\n EquipmentName: eq.Name,\r\n ServiceGroupId: (eq as IServiceFilterDto).ServiceGroupId ?? null,\r\n UserId: ur.Id,\r\n UserDisplayName: ur.Name,\r\n Active: model.Active ?? false,\r\n AllowBookingFromTrainingDate:\r\n model.AllowBookingFromTrainingDate ?? true,\r\n ExpiredDate:\r\n model.ExpiredDate === null || model.ExpiredDate === undefined\r\n ? null\r\n : dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.ExpiredDate),\r\n ),\r\n MustOrderEveryDays: toNumberOrNull(model.MustOrderEveryDays),\r\n MustUseEveryDays: toNumberOrNull(model.MustUseEveryDays),\r\n Remarks: model.Remarks ?? null,\r\n RequiresAdminApproval: model.RequiresAdminApproval ?? false,\r\n ReservationId: model.Reservations?.Id ?? null,\r\n TrainerId: model.Trainer?.Id ?? null,\r\n TrainingDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.TrainingDate || new Date()),\r\n ),\r\n TrainingLevelId: model.TrainingLevel?.Id ?? null,\r\n TrainingLevelName: model.TrainingLevel?.Name ?? null,\r\n FatherId: model.FatherId ?? null,\r\n UnhideServiceGroup: model.UnhideServiceGroup ?? false,\r\n TrainingProgramId: model.TrainingProgram?.Id ?? null,\r\n TrainingProgramName: model.TrainingProgram?.Name ?? null,\r\n } as IUserTrainingDto);\r\n });\r\n });\r\n return entities.filter(item => item !== undefined && item !== null);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { trainingActions as actions } from '.';\r\nimport { UserTrainingApi as api } from 'api/UserTrainingApi';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport {\r\n ConvertModelToEntity,\r\n TrainingDetailsState,\r\n TrainingsResponse,\r\n} from './types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { TrainingDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\n\r\nfunction* doInitCreate(\r\n action: PayloadAction<{\r\n equId?: string | null;\r\n equIds?: string | null;\r\n fatherId?: string | null;\r\n rid?: string | null;\r\n date?: string | null;\r\n user?: string | null;\r\n }>,\r\n) {\r\n try {\r\n const data = yield call(api.initCreateData, action.payload);\r\n yield put(actions.initCreateTraining_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initCreateTraining_Error(Error));\r\n }\r\n}\r\nfunction* doInitUpdate(action: PayloadAction<{ Id: number }>) {\r\n try {\r\n const data = yield call(api.initUpdateData, action.payload);\r\n yield put(actions.initUpdateTraining_Success(data.value[0]));\r\n } catch (error: unknown) {\r\n yield put(actions.initUpdateTraining_Error(Error));\r\n }\r\n}\r\nfunction* doCreate(action: PayloadAction) {\r\n const httpPayloads: IUserTrainingDto[] = ConvertModelToEntity(\r\n action.payload,\r\n undefined,\r\n );\r\n try {\r\n const result = yield call(api.submitTrainings, httpPayloads);\r\n let trainingsResponse = result as TrainingsResponse;\r\n if (trainingsResponse.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n trainingsResponse.ErrorMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (trainingsResponse.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n trainingsResponse.WarningMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (trainingsResponse.SuccessMessages.length > 0) {\r\n if (trainingsResponse.Id) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'insertedSuccess',\r\n message: trainingsResponse.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: trainingsResponse.Id,\r\n created: true,\r\n itemName: i18next.t(translations.UserTraining),\r\n detailsType: RenderPageType.TrainingDetails,\r\n detailsTypeProps: {\r\n id: '' + trainingsResponse.Id,\r\n useSidePanel: true,\r\n } as TrainingDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'insertedSuccess',\r\n message: trainingsResponse.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n yield put(actions.createTraining_Success(trainingsResponse));\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'UserTrainingCreate',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createTraining_Error(Error));\r\n }\r\n}\r\nfunction* duUpdateTraining(\r\n action: PayloadAction<{\r\n current: TrainingDetailsState;\r\n original: TrainingDetailsState | undefined;\r\n }>,\r\n) {\r\n const httpPayloads: IUserTrainingDto[] = ConvertModelToEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n try {\r\n const result = yield call(api.submitTrainings, httpPayloads);\r\n let trainingsResponse = result as TrainingsResponse;\r\n if (trainingsResponse.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n trainingsResponse.ErrorMessages.map(item => {\r\n return {\r\n key: 'UpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (trainingsResponse.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'updateWarning',\r\n message: trainingsResponse.WarningMessages[0],\r\n variant: 'warning',\r\n }),\r\n );\r\n }\r\n if (trainingsResponse.SuccessMessages.length > 0) {\r\n if (trainingsResponse.Id) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'updatedSuccess',\r\n message: trainingsResponse.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: trainingsResponse.Id,\r\n created: false,\r\n itemName: i18next.t(translations.UserTraining),\r\n detailsType: RenderPageType.TrainingDetails,\r\n detailsTypeProps: {\r\n id: '' + trainingsResponse.Id,\r\n useSidePanel: true,\r\n } as TrainingDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'updatedSuccess',\r\n message: trainingsResponse.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n yield put(actions.updateTraining_Success(trainingsResponse));\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'UserTrainingUpdate',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateTraining_Error(Error));\r\n }\r\n}\r\nfunction* doApproveRejectReservations(\r\n action: PayloadAction<{\r\n trainings: number[];\r\n approve: boolean;\r\n }>,\r\n) {\r\n try {\r\n const result = yield call(api.approveRejectReservations, action.payload);\r\n let response = result as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(actions.approveRejectReservations_success());\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'UserTrainingResUpdate',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.approveRejectReservations_error(Error));\r\n }\r\n}\r\nfunction* doActivate(\r\n action: PayloadAction<{ Id?: number; activate?: boolean }>,\r\n) {\r\n try {\r\n const result = yield call(api.activateTraining, action.payload);\r\n let response = result as IResponseType;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(\r\n actions.activateDeactivateTraining_success(action.payload.activate),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'UserTrainingResUpdate',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.activateDeactivateTraining_error(Error));\r\n }\r\n}\r\nexport function* trainingSaga() {\r\n yield takeLatest(actions.initCreateTraining.type, doInitCreate);\r\n yield takeLatest(actions.initUpdateTraining.type, doInitUpdate);\r\n yield takeLatest(actions.createTraining.type, doCreate);\r\n yield takeLatest(actions.updateTraining.type, duUpdateTraining);\r\n yield takeLatest(\r\n actions.approveRejectReservations.type,\r\n doApproveRejectReservations,\r\n );\r\n yield takeLatest(actions.activateDeactivateTraining.type, doActivate);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { trainingSaga } from './saga';\r\nimport {\r\n ConvertEntityToModel,\r\n TrainingDetailsState,\r\n TrainingReservationsState,\r\n TrainingsResponse,\r\n TrainingState,\r\n} from './types';\r\n\r\nexport const initialState: TrainingState = {\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n reservationsUpdateState: {\r\n showApproveReservations: false,\r\n showRejectReservations: false,\r\n ApproveRejectRecords: [],\r\n processing: false,\r\n completed: undefined,\r\n },\r\n processing: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'training',\r\n initialState,\r\n reducers: {\r\n initCreateTraining(\r\n state,\r\n action: PayloadAction<{\r\n equId?: string | null;\r\n equIds?: string | null;\r\n fatherId?: string | null;\r\n rid?: string | null;\r\n date?: string | null;\r\n user?: string | null;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initCreateTraining_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.createState.data = {\r\n Id: null,\r\n Active: action.payload.Active,\r\n AllowBookingFromTrainingDate: true,\r\n Equipments: action.payload.Equipments,\r\n RequiresAdminApproval: false,\r\n Reservations: action.payload.Reservations,\r\n UnhideServiceGroup: false,\r\n Users: action.payload.Users,\r\n TrainingDate: action.payload.TrainingDate,\r\n ExpiredDate: null,\r\n MustOrderEveryDays: undefined,\r\n MustUseEveryDays: undefined,\r\n Remarks: undefined,\r\n Trainer: action.payload.Trainer,\r\n TrainingLevel: undefined,\r\n FatherId: action.payload.FatherId ?? null,\r\n ServiceGroupId: null,\r\n TrainingProgram: undefined,\r\n };\r\n },\r\n initCreateTraining_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.createState.data = {\r\n Id: null,\r\n Active: true,\r\n AllowBookingFromTrainingDate: true,\r\n Equipments: [],\r\n RequiresAdminApproval: false,\r\n Reservations: undefined,\r\n UnhideServiceGroup: false,\r\n Users: [],\r\n TrainingDate: new Date(),\r\n ExpiredDate: null,\r\n MustOrderEveryDays: undefined,\r\n MustUseEveryDays: undefined,\r\n Remarks: undefined,\r\n Trainer: undefined,\r\n TrainingLevel: undefined,\r\n FatherId: null,\r\n ServiceGroupId: null,\r\n TrainingProgram: undefined,\r\n };\r\n },\r\n createTraining(state, action: PayloadAction) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createTraining_Success(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.reservationsUpdateState.ApproveRejectRecords =\r\n action.payload.ApproveRejectRecords;\r\n state.reservationsUpdateState.showApproveReservations =\r\n action.payload.ShowApproveReservationsMessage;\r\n state.reservationsUpdateState.showRejectReservations =\r\n action.payload.ShowReviseToPendingMessage;\r\n state.createState.hasErrors = action.payload.ErrorMessages.length > 0;\r\n state.createState.completed = true;\r\n },\r\n createTraining_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n },\r\n resetCreateTrainingState(state, action: PayloadAction) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n resetReservationsState(state, action: PayloadAction) {\r\n state.reservationsUpdateState = {\r\n showApproveReservations: false,\r\n showRejectReservations: false,\r\n ApproveRejectRecords: [],\r\n processing: false,\r\n completed: undefined,\r\n };\r\n },\r\n resetUpdateTrainingState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateTraining(\r\n state,\r\n action: PayloadAction<{\r\n Id: number;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateTraining_Success(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.updateState.data = ConvertEntityToModel(action.payload);\r\n },\r\n initUpdateTraining_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.updateState.data = undefined;\r\n },\r\n updateTraining(\r\n state,\r\n action: PayloadAction<{\r\n current: TrainingDetailsState;\r\n original: TrainingDetailsState | undefined;\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateTraining_Success(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.reservationsUpdateState.ApproveRejectRecords =\r\n action.payload.ApproveRejectRecords;\r\n state.reservationsUpdateState.showApproveReservations =\r\n action.payload.ShowApproveReservationsMessage;\r\n state.reservationsUpdateState.showRejectReservations =\r\n action.payload.ShowReviseToPendingMessage;\r\n state.updateState.hasErrors = action.payload.ErrorMessages.length > 0;\r\n state.updateState.completed = true;\r\n },\r\n updateTraining_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n },\r\n setReservationsUpdateState(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.reservationsUpdateState.ApproveRejectRecords =\r\n action.payload.ApproveRejectRecords;\r\n state.reservationsUpdateState.showApproveReservations =\r\n action.payload.showApproveReservations;\r\n state.reservationsUpdateState.showRejectReservations =\r\n action.payload.showRejectReservations;\r\n },\r\n approveRejectReservations(\r\n state,\r\n action: PayloadAction<{\r\n trainings: number[];\r\n approve: boolean;\r\n }>,\r\n ) {\r\n state.reservationsUpdateState.processing = true;\r\n state.reservationsUpdateState.completed = false;\r\n },\r\n approveRejectReservations_success(state, action: PayloadAction) {\r\n state.reservationsUpdateState.processing = false;\r\n state.reservationsUpdateState.completed = true;\r\n },\r\n approveRejectReservations_error(state, action: PayloadAction) {\r\n state.reservationsUpdateState.processing = false;\r\n state.reservationsUpdateState.completed = true;\r\n },\r\n activateDeactivateTraining(\r\n state,\r\n action: PayloadAction<{ Id?: number; activate?: boolean }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = false;\r\n },\r\n activateDeactivateTraining_success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n if (state.updateState.data) {\r\n state.updateState.data.Active = action.payload;\r\n }\r\n },\r\n activateDeactivateTraining_error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: trainingActions } = slice;\r\n\r\nexport const useTrainingSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: trainingSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useTrainingSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.training || initialState;\r\n\r\nexport const selectTraining = createSelector([selectSlice], state => state);\r\n\r\nexport const selectInitTrainingProcessing = createSelector(\r\n [selectTraining],\r\n state => state.processing,\r\n);\r\nexport const selectCreateTrainingProcessing = createSelector(\r\n [selectTraining],\r\n state => state.createState.processing,\r\n);\r\nexport const selectUpdateTrainingProcessing = createSelector(\r\n [selectTraining],\r\n state => state.updateState.processing,\r\n);\r\nexport const selectCreateTraining = createSelector(\r\n [selectTraining],\r\n state => state.createState.data,\r\n);\r\nexport const selectUpdateTraining = createSelector(\r\n [selectTraining],\r\n state => state.updateState.data,\r\n);\r\nexport const selectCreateTrainingCompleted = createSelector(\r\n [selectTraining],\r\n state => state.createState.completed,\r\n);\r\nexport const selectUpdateTrainingCompleted = createSelector(\r\n [selectTraining],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectCreateTrainingHasError = createSelector(\r\n [selectTraining],\r\n state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateTrainingHasError = createSelector(\r\n [selectTraining],\r\n state => state.updateState.hasErrors,\r\n);\r\nexport const selectShowApproveReservatiions = createSelector(\r\n [selectTraining],\r\n state => state.reservationsUpdateState.showApproveReservations,\r\n);\r\nexport const selectShowRejectReservatiions = createSelector(\r\n [selectTraining],\r\n state => state.reservationsUpdateState.showRejectReservations,\r\n);\r\nexport const selectReservatiionsData = createSelector(\r\n [selectTraining],\r\n state => state.reservationsUpdateState.ApproveRejectRecords,\r\n);\r\nexport const selectReservatiionsProcessing = createSelector(\r\n [selectTraining],\r\n state => state.reservationsUpdateState.processing,\r\n);\r\nexport const selectReservatiionsUpdateCompleted = createSelector(\r\n [selectTraining],\r\n state => state.reservationsUpdateState.completed,\r\n);\r\n","/**\r\n *\r\n * RoomPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IReservationFilterDto } from 'api/odata/generated/entities/IReservationFilterDto';\r\nimport {\r\n Condition,\r\n ODataFilterBuilder,\r\n ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface ITrainingResFilterProps {\r\n equipment?: Entity;\r\n user?: Entity;\r\n trainingDate?: Date;\r\n}\r\n\r\nexport interface TrainingResevationsPickerProps\r\n extends Omit>, 'loadData'>,\r\n ITrainingResFilterProps {}\r\n\r\nconst url = '/api/odata/v4/ReservationFilter';\r\nconst formatName = (\r\n reservations: IReservationFilterDto[],\r\n): IReservationFilterDto[] => {\r\n reservations.forEach(item => {\r\n item.Name =\r\n dateUtils.shortDateTimeFormat(item.Start) +\r\n ' - ' +\r\n dateUtils.shortDateTimeFormat(item.End);\r\n });\r\n return reservations;\r\n};\r\nexport function withUserTrainingFilter(\r\n equipment: Entity | undefined,\r\n user: Entity | undefined,\r\n trainingDate: Date | undefined,\r\n) {\r\n return (searchTerm: string | null) => {\r\n const params: { $orderby: string; $filter?: string } = {\r\n $orderby: 'Name asc',\r\n };\r\n const predicates: Condition[] = [];\r\n if (equipment !== undefined) {\r\n predicates.push(\r\n new Condition('EquipmentId', ODataOperators.Equals, equipment.Id),\r\n );\r\n }\r\n if (user !== undefined) {\r\n predicates.push(\r\n new Condition('UserName', ODataOperators.Equals, user.Id),\r\n );\r\n }\r\n if (trainingDate !== undefined) {\r\n let tDate = dateUtils.parseISO(trainingDate);\r\n let strDate = new Date() > tDate ? new Date() : tDate;\r\n let endDate = new CustomDate(\r\n new Date(\r\n strDate.getFullYear(),\r\n strDate.getMonth(),\r\n strDate.getDate() + 1,\r\n ),\r\n 'date',\r\n );\r\n predicates.push(\r\n new Condition('Start', ODataOperators.GreaterThanEqual, strDate),\r\n );\r\n predicates.push(\r\n new Condition('End', ODataOperators.LessThanEqual, endDate),\r\n );\r\n }\r\n params.$filter = new ODataFilterBuilder({\r\n predicates: predicates,\r\n stringColumns: ['Name'],\r\n stringSearch: searchTerm === null ? undefined : searchTerm,\r\n globalServiceGroupFilter: [],\r\n }).toString();\r\n\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response =>\r\n formatName(response.value as IReservationFilterDto[]) as Entity<\r\n number\r\n >[],\r\n );\r\n };\r\n}\r\nexport const initTrainingResevationsData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select: 'Id,Name,Start,End',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(\r\n response =>\r\n formatName(response.value as IReservationFilterDto[]) as Entity<\r\n number\r\n >[],\r\n );\r\n }\r\n};\r\n\r\nexport function TrainingResevationsPicker(\r\n props: TrainingResevationsPickerProps,\r\n) {\r\n const loadData = withUserTrainingFilter(\r\n props.equipment,\r\n props.user,\r\n props.trainingDate,\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n ITrainingResFilterProps,\r\n TrainingResevationsPicker,\r\n} from '../pickers/AutocompletePickers/TrainingReservationsPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormTrainingReservationsPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n IFieldProps &\r\n ITrainingResFilterProps) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * FormTrainingLevelPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { TrainingLevelPicker } from '../pickers/AutocompletePickers/TrainingLevelPicker';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\n\r\nexport const FormTrainingLevelPicker = ({\r\n label,\r\n ...props\r\n}: FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField(\r\n props,\r\n );\r\n return (\r\n <>\r\n {\r\n helpers.setValue(value, true);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }}\r\n info={props.info}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n error={meta?.error !== undefined}\r\n helperText={meta.error}\r\n disabled={props.disabled}\r\n fullWidth={props.fullWidth}\r\n />\r\n \r\n );\r\n};\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport { IComment } from 'app/components/CommentsContainer/IComment';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Portal } from '@material-ui/core';\r\nimport { TrainingDetailsState } from '../../slice/types';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\n\r\nexport interface UserTrainingCommentsProps {\r\n isAdmin?: boolean;\r\n training: TrainingDetailsState;\r\n disabled?: boolean;\r\n commentsFormRef: React.MutableRefObject;\r\n}\r\n\r\nexport const UserTrainingComments = (props: UserTrainingCommentsProps) => {\r\n const { training, isAdmin, disabled, commentsFormRef } = props;\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const { t } = useTranslation();\r\n const [changed, setchanged] = React.useState(false);\r\n const dispatch = useDispatch();\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const comments = useAsyncGetWthEffect(\r\n () =>\r\n CommentsApi.GetComments(\r\n CommentReferenceTypes.UserTraining,\r\n training.Id ?? 0,\r\n ),\r\n [],\r\n [changed],\r\n );\r\n const bindSubmitComment = React.useCallback(\r\n submitForm => {\r\n commentsFormRef.current = submitForm;\r\n },\r\n [commentsFormRef],\r\n );\r\n const { onCommentAdded } = useUploadToNewComment();\r\n const portalRef = React.useRef(null);\r\n React.useEffect(() => {\r\n dispatch(\r\n largeFileActions.setCommentProperties({\r\n commentType: CommentReferenceTypes.UserTraining,\r\n referenceId: training.Id ?? 0,\r\n }),\r\n );\r\n }, [dispatch, largeFileActions, training.Id]);\r\n return (\r\n \r\n
    \r\n \r\n {\r\n CommentsApi.SendComment(\r\n CommentReferenceTypes.UserTraining,\r\n training.Id ?? 0,\r\n c,\r\n )\r\n .then(res => onCommentAdded?.(res))\r\n .finally(() => setchanged(prev => !prev));\r\n }}\r\n isAdmin={isAdmin}\r\n withMentions\r\n pageName={t(translations.menu_EditUserTraining)}\r\n referenceName={(training.Id ?? 0).toString()}\r\n linkUrl={buildURL(\r\n `${publicUrl}usertraining/details/${training.Id ?? 0}`,\r\n {},\r\n )}\r\n emailType={'Alert'}\r\n />\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { Formik } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { translations } from 'locales/translations';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { UserTrainingApi as api } from 'api/UserTrainingApi';\r\nimport { FormTrainingReservationsPicker } from 'app/components/Forms/FormTrainingReservationsPicker';\r\nimport { FormTrainingLevelPicker } from 'app/components/Forms/FormTrainingLevelPicker';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { TrainingDetailsState } from '../slice/types';\r\nimport {\r\n FormRightSection,\r\n FormLeftSection,\r\n StyledForm,\r\n FormFieldsSection,\r\n FormRow,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { UserTrainingComments } from './UserTrainingComments';\r\nimport { FormAdminSingleUsersPicker } from 'app/components/Forms/FormAdminUserPicker';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormOnlineServicesComboPicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { RestrictedByAdminFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { TrainingLevelFilter } from 'app/components/pickers/AutocompletePickers/TrainingLevelPicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { AdminServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface UserTrainingFormProps {\r\n onSubmit: (item: TrainingDetailsState) => void;\r\n onCancel?: () => void;\r\n initialValues: TrainingDetailsState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n onEquipmentClicked?: (equipment: Entity) => void;\r\n commentsFormRef: React.MutableRefObject;\r\n isAdmin?: boolean;\r\n}\r\n\r\nexport const UserTrainingForm = React.memo(function UserTrainingForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n onCancel,\r\n bindSubmitForm,\r\n isEdit,\r\n onEquipmentClicked,\r\n commentsFormRef,\r\n isAdmin,\r\n}: UserTrainingFormProps) {\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const trainingLevelPermissionsEnabled = React.useMemo(() => {\r\n return IsModuleEnabled(appSettings, KnownModules.TrainingLevelPermissions);\r\n }, [appSettings]);\r\n const userPermissionsEnabled = React.useMemo(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.UserPermission) ||\r\n IsModuleEnabled(appSettings, KnownModules.GroupPermissions)\r\n );\r\n }, [appSettings]);\r\n const usersShema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.string().ensure(),\r\n Name: Yup.string().ensure(),\r\n });\r\n const equipmentShema: Yup.SchemaOf> = Yup.object({\r\n Id: Yup.number().defined(),\r\n Name: Yup.string().ensure(),\r\n });\r\n const schema: Yup.SchemaOf = Yup.object({\r\n Id: Yup.number().notRequired().nullable(),\r\n Users: Yup.array()\r\n .of(usersShema)\r\n .required(t(translations.err_UserNameRequired))\r\n .label(t(translations.User))\r\n .min(1),\r\n Equipments: Yup.array()\r\n .of(equipmentShema)\r\n .min(1)\r\n .required(t(translations.err_OnlineServiceFieldRequired))\r\n .label(t(translations.ServiceType_Online)),\r\n UnhideServiceGroup: Yup.boolean(),\r\n TrainingDate: Yup.date()\r\n .required(t(translations.err_TrainingDateFieldRequired))\r\n .label(t(translations.TrainingDate)),\r\n ExpiredDate: Yup.date().nullable(true),\r\n Trainer: Yup.mixed()\r\n .required(t(translations.err_TrainerIsRequired))\r\n .label(t(translations.Trainer)),\r\n MustOrderEveryDays: Yup.number()\r\n .integer()\r\n .nullable()\r\n .notRequired()\r\n .label(t(translations.MustOrderEveryDays))\r\n .min(0)\r\n .max(365),\r\n MustUseEveryDays: Yup.number()\r\n .integer()\r\n .nullable()\r\n .notRequired()\r\n .label(t(translations.MustUseEveryDays))\r\n .min(0)\r\n .max(365),\r\n RequiresAdminApproval: Yup.boolean(),\r\n AllowBookingFromTrainingDate: Yup.boolean().default(true),\r\n Reservations: Yup.mixed(),\r\n TrainingLevel: Yup.mixed(),\r\n Remarks: Yup.string().nullable(),\r\n Active: Yup.boolean(),\r\n FatherId: Yup.number().notRequired().nullable(),\r\n ServiceGroupId: Yup.number().notRequired().nullable(),\r\n TrainingProgram: Yup.mixed(),\r\n });\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n const activeDisabled =\r\n isEdit &&\r\n settings.GetBooleanByKey(\r\n AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n );\r\n const [resDisbaled, setResDisbaled] = React.useState(false);\r\n const [allowBookingDisbaled, setAllowBookingDisbaled] = React.useState<\r\n boolean | undefined\r\n >(false);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [allowBookingVisible, setAllowBookingVisible] = React.useState<\r\n boolean | undefined\r\n >(true);\r\n const [equipmentChanged, setEquipmentChanged] = React.useState(\r\n false,\r\n );\r\n const [userChanged, setUserChanged] = React.useState(false);\r\n const [trDateChanged, setTrDateChanged] = React.useState(false);\r\n const [trLevelChanged, setTrLevelChanged] = React.useState(false);\r\n const handleEquipmentChange = value => {\r\n setEquipmentChanged(true);\r\n };\r\n const handleUserChange = value => {\r\n setUserChanged(true);\r\n };\r\n const handleTrDateChange = value => {\r\n setTrDateChanged(true);\r\n };\r\n const handleTrLevelChange = value => {\r\n setTrLevelChanged(true);\r\n };\r\n const { newDate } = useSystemDate();\r\n const handleFormChange = React.useCallback(\r\n (values, isValid, dirty, setValue) => {\r\n setResDisbaled(\r\n values.Equipments.length !== 1 ||\r\n values.Users.length !== 1 ||\r\n !values.TrainingDate,\r\n );\r\n if (equipmentChanged || userChanged || trDateChanged) {\r\n setValue('Reservations', undefined, false);\r\n if (values.Equipments.length > 0 && values.Users.length > 0) {\r\n const params: {\r\n services: string;\r\n users: string;\r\n } = {\r\n services: values.Equipments.map(item => item.Id).join(','),\r\n users: values.Users.map(item => item.Id).join(','),\r\n };\r\n api.hasUntrainedNotAllowed(params).then(data => {\r\n let value = data.value;\r\n if (value === 0) {\r\n setAllowBookingVisible(false);\r\n setValue('AllowBookingFromTrainingDate', true, false);\r\n } else {\r\n if (isEdit) {\r\n setAllowBookingDisbaled(true);\r\n } else {\r\n if (value === 1) {\r\n setAllowBookingDisbaled(false);\r\n } else {\r\n setAllowBookingDisbaled(true);\r\n setValue('AllowBookingFromTrainingDate', true, false);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n if (equipmentChanged) {\r\n setValue('TrainingLevel', null);\r\n setValue('Trainer', null);\r\n }\r\n setUserChanged(false);\r\n setEquipmentChanged(false);\r\n setTrDateChanged(false);\r\n }\r\n if (trLevelChanged) {\r\n let level = values.TrainingLevel as ITrainingLevelFilterDto;\r\n if (level) {\r\n if (level.MustOrderEveryDays !== undefined) {\r\n if (\r\n values.MustOrderEveryDays === undefined ||\r\n values.MustOrderEveryDays === null\r\n ) {\r\n setValue('MustOrderEveryDays', level.MustOrderEveryDays, false);\r\n }\r\n }\r\n if (level.MustUseEveryDays !== undefined) {\r\n if (\r\n values.MustUseEveryDays === undefined ||\r\n values.MustUseEveryDays === null\r\n ) {\r\n setValue('MustUseEveryDays', level.MustUseEveryDays, false);\r\n }\r\n }\r\n if (\r\n level.ExpiredDays !== undefined &&\r\n level.ExpiredDays != null &&\r\n level.ExpiredDays > 0\r\n ) {\r\n let date = newDate();\r\n let trainingDate = dateUtils.parseISO(values.TrainingDate);\r\n date.setDate(trainingDate.getDate() + level.ExpiredDays);\r\n setValue('ExpiredDate', date, false);\r\n }\r\n }\r\n setTrLevelChanged(false);\r\n }\r\n },\r\n [\r\n equipmentChanged,\r\n isEdit,\r\n newDate,\r\n trDateChanged,\r\n trLevelChanged,\r\n userChanged,\r\n ],\r\n );\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n return (\r\n <>\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {IsModuleEnabled(\r\n appSettings,\r\n KnownModules.TrainingExpiration,\r\n ) && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n {IsModuleEnabled(\r\n appSettings,\r\n KnownModules.HideInstrumentsFromUntrainedUsers,\r\n ) && (\r\n \r\n \r\n \r\n )}\r\n {/* //!allowBookingVisible */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {isEdit && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\n\r\nimport { push } from 'connected-react-router';\r\n//import { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { useTrainingSlice } from './slice';\r\nimport {\r\n selectCreateTraining,\r\n selectCreateTrainingCompleted,\r\n selectCreateTrainingHasError,\r\n selectInitTrainingProcessing,\r\n selectReservatiionsData,\r\n selectReservatiionsProcessing,\r\n selectReservatiionsUpdateCompleted,\r\n selectShowApproveReservatiions,\r\n selectShowRejectReservatiions,\r\n selectUpdateTraining,\r\n selectUpdateTrainingCompleted,\r\n selectUpdateTrainingHasError,\r\n} from './slice/selectors';\r\nimport { TrainingDetailsState } from './slice/types';\r\nimport { UserTrainingForm } from './UserTrainingForm';\r\nimport { SaveFormButton, ActivateButton } from './Actions/TrainingActions';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\n\r\nexport interface TrainingDetailsProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n id?: string;\r\n equId?: string;\r\n equIds?: string;\r\n fatherId?: string;\r\n rid?: string;\r\n date?: string;\r\n user?: string;\r\n onClose?: () => void;\r\n onTrainingClose?: () => void;\r\n}\r\n\r\nexport function TrainingDetails(props: TrainingDetailsProps) {\r\n const {\r\n id,\r\n equId,\r\n equIds,\r\n fatherId,\r\n rid,\r\n date,\r\n user,\r\n useSidePanel,\r\n onClose,\r\n onTrainingClose,\r\n } = props;\r\n const { t } = useTranslation();\r\n const loading = useSelector(selectInitTrainingProcessing);\r\n const dispatch = useDispatch();\r\n const { actions } = useTrainingSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n const [busy, setBusy] = React.useState(false);\r\n const [edit, setEdit] = React.useState(false);\r\n const [showApprove, setShowApprove] = React.useState(false);\r\n const [showReject, setShowReject] = React.useState(false);\r\n const requestCreateCompleted = useSelector(selectCreateTrainingCompleted);\r\n const requestUpdateCompleted = useSelector(selectUpdateTrainingCompleted);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const approveReservations = useSelector(selectShowApproveReservatiions);\r\n const rejectReservations = useSelector(selectShowRejectReservatiions);\r\n const reservationProcessing = useSelector(selectReservatiionsProcessing);\r\n const relatedReservations = useSelector(selectReservatiionsData);\r\n const updateResCompleted = useSelector(selectReservatiionsUpdateCompleted);\r\n const hasCreateError = useSelector(selectCreateTrainingHasError);\r\n const hasUpdateError = useSelector(selectUpdateTrainingHasError);\r\n const hasError = hasCreateError || hasUpdateError;\r\n const createTraining = useSelector(selectCreateTraining, shallowEqual);\r\n const editTraining = useSelector(selectUpdateTraining, shallowEqual);\r\n const training = createTraining || editTraining;\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const continueToOther = useSelector(selectContinueState);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const settings = useSelector(selectglobalSettings);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const currenTrainingServiceGroupId = training?.ServiceGroupId ?? undefined;\r\n const activateAllowed = React.useMemo(() => {\r\n return User?.HasAdminGroupPermissions(currenTrainingServiceGroupId);\r\n }, [User, currenTrainingServiceGroupId]);\r\n const IsAdmin = React.useMemo(() => {\r\n return User?.IsAllGroupOrLabTechAdmin(\r\n (training?.Equipments || []).map(\r\n g => (g as IServiceFilterDto).ServiceGroupId,\r\n (training?.Equipments || []).map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: ServiceType.Online,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n ),\r\n );\r\n }, [User, training?.Equipments]);\r\n\r\n useEffectOnMount(() => {\r\n if (id !== undefined && !isNaN(parseInt(id))) {\r\n dispatch(actions.initUpdateTraining({ Id: parseInt(id) }));\r\n } else {\r\n dispatch(\r\n actions.initCreateTraining({\r\n equId,\r\n equIds,\r\n fatherId,\r\n rid,\r\n date,\r\n user,\r\n }),\r\n );\r\n }\r\n setBusy(false);\r\n setEdit(false);\r\n setShowApprove(false);\r\n setShowReject(false);\r\n setRequestCompleted(undefined);\r\n return () => {};\r\n });\r\n const handleCancelClick = React.useCallback(() => {\r\n if (!!onClose) {\r\n onClose();\r\n if (!!onTrainingClose) {\r\n onTrainingClose();\r\n }\r\n } else {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n if (!!onTrainingClose) {\r\n onTrainingClose();\r\n }\r\n } else {\r\n dispatch(push('/usertraining'));\r\n }\r\n }\r\n if (edit) {\r\n dispatch(actions.resetUpdateTrainingState());\r\n } else {\r\n dispatch(actions.resetCreateTrainingState());\r\n }\r\n dispatch(actions.resetReservationsState());\r\n }, [\r\n actions,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n onClose,\r\n onTrainingClose,\r\n useSidePanel,\r\n ]);\r\n React.useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (id !== undefined && !isNaN(parseInt(id))) {\r\n setEdit(true);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n if (approveReservations || rejectReservations) {\r\n setShowApprove(approveReservations);\r\n setShowReject(rejectReservations);\r\n } else {\r\n handleCancelClick();\r\n }\r\n }\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n if (updateResCompleted) {\r\n handleCancelClick();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n approveReservations,\r\n handleCancelClick,\r\n hasError,\r\n id,\r\n loading,\r\n rejectReservations,\r\n requestCompleted,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n updateResCompleted,\r\n ]);\r\n React.useEffect(() => {\r\n if (confirmApproved) {\r\n if (edit) {\r\n dispatch(actions.resetUpdateTrainingState());\r\n } else {\r\n dispatch(actions.resetCreateTrainingState());\r\n }\r\n dispatch(actions.resetReservationsState());\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n //dispatch(actions.setChangedState(false));\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n const handleSubmit = React.useCallback(\r\n (values: TrainingDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateTraining({ current: values, original: training }),\r\n );\r\n } else {\r\n dispatch(actions.createTraining(values));\r\n }\r\n },\r\n [actions, dispatch, edit, training],\r\n );\r\n\r\n const submitFormRef = React.useRef(null);\r\n const submitCommentRef = React.useRef(null);\r\n const handleSubmitForm = e => {\r\n if (submitCommentRef.current) {\r\n submitCommentRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const handleClose = () => {\r\n if (hasChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n const handleActivateTraining = React.useCallback(() => {\r\n dispatch(\r\n actions.activateDeactivateTraining({\r\n Id: training?.Id ?? undefined,\r\n activate: !(training?.Active ?? undefined),\r\n }),\r\n );\r\n }, [actions, dispatch, training]);\r\n const handleReject = React.useCallback(() => {\r\n dispatch(\r\n actions.approveRejectReservations({\r\n trainings: relatedReservations,\r\n approve: false,\r\n }),\r\n );\r\n }, [actions, dispatch, relatedReservations]);\r\n const handleApprove = React.useCallback(() => {\r\n dispatch(\r\n actions.approveRejectReservations({\r\n trainings: relatedReservations,\r\n approve: true,\r\n }),\r\n );\r\n }, [actions, dispatch, relatedReservations]);\r\n const handleResCancel = React.useCallback(() => {\r\n dispatch(actions.resetReservationsState());\r\n }, [actions, dispatch]);\r\n const [cover, setCover] = React.useState();\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n\r\n const leftActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleSubmitForm}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n if (\r\n edit &&\r\n settings.GetBooleanByKey(\r\n AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n ) &&\r\n activateAllowed\r\n ) {\r\n leftActions.push(() => (\r\n \r\n ));\r\n }\r\n if (edit && IsAdmin) {\r\n leftActions.push(() => (\r\n \r\n ));\r\n }\r\n const rightActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n return (\r\n <>\r\n \r\n setCover(\r\n ,\r\n )\r\n }\r\n commentsFormRef={submitCommentRef}\r\n isAdmin={IsAdmin}\r\n />\r\n ) : (\r\n \r\n )\r\n }\r\n pageLink={buildURL(\r\n publicUrl + 'usertraining/details',\r\n omit(props, ['useSidePanel']),\r\n )}\r\n toPageLink={`usertraining/details?${toQueryString(\r\n omit(props, ['useSidePanel']),\r\n )}`}\r\n leftActions={leftActions}\r\n rightActions={rightActions}\r\n confirm={\r\n requestCompleted && rejectReservations ? (\r\n \r\n ) : approveReservations ? (\r\n \r\n ) : (\r\n <>\r\n )\r\n }\r\n isCover={props.isCover}\r\n cover={cover}\r\n //closeCover={closeCover}\r\n closeCover={props.closeCover || closeCover}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { IWithSavedHistoryComponentProps } from 'app/components/BasicTable/withSavedHistory';\r\nimport { FiltersButton } from 'app/components/BasicTable/BasicFilter/FiltersButton';\r\nimport { FilterContainer } from 'app/components/BasicTable/FilterContainer';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { BasicFilterGroup } from 'app/components/BasicTable/BasicFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { CombinedSchedulerTRow } from './Filter';\r\n\r\nexport interface FiltersComponentProps\r\n extends IWithSavedHistoryComponentProps,\r\n Pick {\r\n filtersButtonAnchorEl: HTMLElement | null;\r\n onFilterOpen: React.MouseEventHandler;\r\n filterOpen: boolean;\r\n onFilterClose: () => void;\r\n filterRef?: React.RefObject;\r\n}\r\nexport function FiltersComponent({\r\n filterOpen,\r\n onFilterClose,\r\n onFilterOpen,\r\n filtersButtonAnchorEl,\r\n\r\n ...props\r\n}: FiltersComponentProps) {\r\n const isMobile = DetectIsMobile();\r\n\r\n const handleFilterChange = React.useCallback(\r\n (items: IFilterSettings[]) => {\r\n props.onFilterChange?.(items);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [],\r\n );\r\n\r\n return (\r\n <>\r\n {!isMobile &&\r\n props.availableFilters &&\r\n props.availableFilters.length > 0 && (\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * MultiToggleProps\r\n *\r\n */\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface MultiToggleProps {\r\n value?: boolean;\r\n onchange: ValueChangeHandler;\r\n}\r\n\r\nexport function MultiToggle(props: MultiToggleProps) {\r\n const { t } = useTranslation();\r\n\r\n const handleChange = (value: boolean) => {\r\n props?.onchange(value);\r\n };\r\n return (\r\n <>\r\n handleChange(!props.value)}\r\n >\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FullScreenButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { selectIsFullScreen } from 'app/slice/selectors';\r\nimport { TopActionButton } from '../BasicButtons/TopActionButton';\r\nimport { IconProp } from 'app/AllIcons';\r\n\r\nexport interface FullScreenButtonProps {\r\n selector?: string;\r\n}\r\n\r\n/**\r\n * Icon button to switch elemnt/document into full screen mode in the browser\r\n * @param props.selector element selector to show in full screen mode. optionnal - documentElement is used if undefined\r\n * @returns\r\n */\r\nexport function FullScreenButton(props: FullScreenButtonProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const dispatch = useDispatch();\r\n const isFullScreen = useSelector(selectIsFullScreen);\r\n const handleClick = () => {\r\n if (isFullScreen) {\r\n dispatch(appSettingsActions.exitFullScreen());\r\n } else {\r\n dispatch(\r\n appSettingsActions.enterFullScreen({ selector: props.selector }),\r\n );\r\n }\r\n };\r\n const icon = isFullScreen\r\n ? (['fal', 'minimize'] as IconProp)\r\n : (['fal', 'maximize'] as IconProp);\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * FullScreenSchedulerButton\r\n *\r\n */\r\nimport { FullScreenButton } from 'app/components/FullScreenButton';\r\n\r\nexport interface FullScreenSchedulerButtonProps {}\r\n\r\nexport function FullScreenSchedulerButton(\r\n props: FullScreenSchedulerButtonProps,\r\n) {\r\n return ;\r\n}\r\n","import React from 'react';\r\nimport { DatePicker } from '@material-ui/pickers';\r\nimport { Dialog, DialogActions } from '@material-ui/core';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ViewLengths, ViewTypes } from '../../slice/types';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getPeriodDisplayLabel } from '../../utils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\n/**\r\n * Internal componnent state interface\r\n */\r\ninterface ICalendarDatePickerState extends CalendarDateValue {\r\n open: boolean;\r\n}\r\n/**\r\n * Period value including the period length and the date\r\n */\r\nexport interface CalendarDateValue {\r\n date: Timestamp;\r\n viewLength: ViewLengths;\r\n customDays?: number;\r\n customStart?: boolean;\r\n}\r\nexport interface CalendarDateProps extends ICalendarDatePickerState {\r\n onChange: (value: CalendarDateValue) => void;\r\n size?: 'small' | 'large' | 'medium';\r\n compact?: boolean;\r\n customDays?: number;\r\n customStart?: boolean;\r\n viewType: ViewTypes;\r\n}\r\n// const makeJSDateObject = (date: Date | string): Date => {\r\n// return dateUtils.parseISO(date);\r\n// };\r\n\r\nexport function CalendarDatePicker(props: CalendarDateProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n //const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n // set initial state\r\n const [state, , extendState] = useAsyncExtendedState<\r\n ICalendarDatePickerState\r\n >({\r\n date: props.date,\r\n open: props.open,\r\n viewLength: props.viewLength,\r\n customDays: props.customDays,\r\n customStart: props.customStart,\r\n });\r\n // handle date change based on the period length\r\n const handleDateChange = date => {\r\n switch (state.viewLength) {\r\n case 'day':\r\n case 'twodays':\r\n extendState({ date: date, customStart: true });\r\n break;\r\n case 'customdays':\r\n extendState({\r\n date: date,\r\n customDays: props.customDays,\r\n customStart: true,\r\n });\r\n break;\r\n case 'week':\r\n extendState({\r\n date: date,\r\n customStart: props.viewType === 'timeline' ? true : undefined,\r\n });\r\n break;\r\n case 'month':\r\n case 'quarter':\r\n case 'year':\r\n extendState({ date: date, customStart: true });\r\n break;\r\n\r\n default:\r\n extendState({ date: date, customStart: true });\r\n //assertExhaustive(state.viewLength);\r\n }\r\n };\r\n\r\n const handleAccept = () => {\r\n // close the dialog\r\n extendState({ open: false });\r\n // raise change event\r\n props.onChange({\r\n date: state.date,\r\n viewLength: props.viewLength,\r\n customStart: state.customStart,\r\n });\r\n };\r\n const handleReject = React.useCallback(() => {\r\n extendState({\r\n // close dialog\r\n open: false,\r\n // reset internal state\r\n viewLength: props.viewLength,\r\n date: state.date,\r\n customStart: state.customStart,\r\n });\r\n }, [extendState, props.viewLength, state.customStart, state.date]);\r\n return (\r\n <>\r\n \r\n extendState({ open: true })}\r\n onClose={() => extendState({ open: false })}\r\n onChange={handleDateChange}\r\n // renderDay={renderDay}\r\n />\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n }\r\n onClick={() => extendState({ open: true })}\r\n >\r\n {getPeriodDisplayLabel(\r\n props.viewLength,\r\n props.date,\r\n props.compact ?? false,\r\n props.customDays,\r\n state.customStart,\r\n )}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * TimelineGroupByPicker\r\n *\r\n */\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSchedulerSlice } from '../../slice';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { selectTimelineGroupBy } from '../../slice/selectors';\r\nimport { EnumPicker } from 'app/components/BasicPickers/EnumPicker';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport React from 'react';\r\n\r\nexport interface TimelineGroupByPickerProps {\r\n EnumNamesArray: TimelineGroupByUnion[];\r\n}\r\n\r\nexport function TimelineGroupByPicker(props: TimelineGroupByPickerProps) {\r\n const dispatch = useDispatch();\r\n const { actions } = useSchedulerSlice();\r\n const value = useSelector(selectTimelineGroupBy);\r\n const { t } = useTranslation();\r\n\r\n const handleChange = (value: TimelineGroupByUnion | null) => {\r\n dispatch(actions.changeViewModePartial({ groupBy: value ?? undefined }));\r\n };\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * CalendarHeader\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ViewLengths, ViewTypes } from '../../slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSchedulerSlice } from '../../slice';\r\nimport { useLocation } from 'react-router';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { FiltersComponent } from 'app/pages/CalendarPage/FiltersComponent';\r\nimport { IWithSavedHistoryComponentProps } from 'app/components/BasicTable/withSavedHistory';\r\nimport { MultiToggle } from '../MultiToggle';\r\nimport {\r\n selectMultipleModeState,\r\n selectSchedulerViewCustomStart,\r\n selectSchedulerViewType,\r\n} from '../../slice/selectors';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FiltersGroupDisplay } from 'app/components/BasicTable/BasicFilter/FiltersGroupDisplay';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalSetting,\r\n selectIsFullScreen,\r\n selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { FullScreenSchedulerButton } from '../FullScreenSchedulerButton';\r\nimport { CalendarActionRenderer } from '../CalendarToolbar/CalendarActionRenderer';\r\nimport { AddReservation } from 'app/pages/Actions/PageTopActions/AddReservation';\r\nimport { ViewTypeLengthDropDown } from '../ViewTypeLengthDropDown';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { getPeriodFromViewLength, viewStateFromFilter } from '../../utils';\r\nimport { CombinedSchedulerTRow } from 'app/pages/CalendarPage/Filter';\r\nimport { CalendarDatePicker, CalendarDateValue } from '../CalendarDatePicker';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { TimelineGroupByPicker } from '../TimelineGroupByPicker';\r\nimport { ExportToPDF } from '../ExportToPDF';\r\nimport { useRefreshInterval } from '../useRefreshInterval';\r\n\r\nexport interface CalendarHeaderProps\r\n extends IWithSavedHistoryComponentProps {\r\n viewType: ViewTypes;\r\n viewLength: ViewLengths;\r\n date: Timestamp;\r\n onMultipleModeChange: ValueChangeHandler;\r\n //range: Range;\r\n filtersButtonAnchorEl: HTMLElement | null;\r\n filterRef?: React.RefObject;\r\n onFilterOpen: () => void;\r\n filterOpen: boolean;\r\n onFilterClose: () => void;\r\n withoutHeader?: boolean;\r\n noChangeLocation?: boolean;\r\n noTypeChange?: boolean;\r\n haideCalendarViewType?: boolean;\r\n pageActions?: CalendarActionRenderer[];\r\n setFilterValue?: (id: string, value: FilterValueType) => void;\r\n showPeriodPicker?: boolean;\r\n customDays?: number;\r\n customDaysEnabled?: boolean;\r\n twoDaysEnabled?: boolean;\r\n handleSetPeriodFilter: (length: ViewLengths, value?: Date) => void;\r\n handleViewTypeLengthChange: (\r\n type: ViewTypes,\r\n length: ViewLengths,\r\n value?: Date,\r\n noChangeLocation?: boolean,\r\n ) => void;\r\n updateSearchPeriod: (\r\n preset: SchedulerDatePositionUnion | null,\r\n search?: string,\r\n ) => string | undefined;\r\n onRefresh?: () => void;\r\n loading: boolean;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function CalendarHeader({\r\n customDays,\r\n handleSetPeriodFilter,\r\n handleViewTypeLengthChange,\r\n updateSearchPeriod,\r\n showPeriodPicker = true,\r\n customDaysEnabled = false,\r\n twoDaysEnabled = false,\r\n useSidePanel,\r\n ...props\r\n}: CalendarHeaderProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const log = React.useMemo(() => getLogger('CalendarHeader'), []);\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const classes = useStyles({ isMobile: isMobile });\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n const { actions } = useSchedulerSlice();\r\n const multipleMode = useSelector(selectMultipleModeState);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n const isFullScreen = useSelector(selectIsFullScreen);\r\n const hasCustomStart = useSelector(selectSchedulerViewCustomStart);\r\n const { newDate } = useSystemDate();\r\n useEffectOnMount(() => {\r\n dispatch(actions.setNotUseLocation(props.noChangeLocation));\r\n });\r\n useRefreshInterval();\r\n const handleCalendarDateChange: ValueChangeHandler = value => {\r\n dispatch(\r\n actions.changeViewMode({\r\n current: {\r\n viewType: props.viewType,\r\n viewLength: value.viewLength,\r\n date: dateUtils.formatISO(dateUtils.dateOrStringToDate(value.date)),\r\n preset: null,\r\n search: location.search,\r\n customDays: customDaysEnabled ? customDays : undefined,\r\n customStart: value.customStart,\r\n },\r\n withNoChangeLocation: props.noChangeLocation,\r\n }),\r\n );\r\n };\r\n const moveToDate = React.useCallback(\r\n (value: Date, viewLength?: ViewLengths) => {\r\n let presetValue = getPeriodFromViewLength(\r\n viewLength ?? props.viewLength,\r\n value ?? dateUtils.parseISO(props.date),\r\n customDays,\r\n );\r\n handleSetPeriodFilter(viewLength ?? props.viewLength, value);\r\n dispatch(\r\n actions.changeViewMode({\r\n current: {\r\n viewType: props.viewType,\r\n viewLength: viewLength ?? props.viewLength,\r\n date: dateUtils.formatISO(value),\r\n preset: viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n search:\r\n updateSearchPeriod(\r\n viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n location.search,\r\n ) ?? location.search,\r\n customDays: customDays,\r\n customStart: hasCustomStart,\r\n },\r\n withNoChangeLocation: props.noChangeLocation,\r\n }),\r\n );\r\n },\r\n [\r\n actions,\r\n customDays,\r\n dispatch,\r\n handleSetPeriodFilter,\r\n hasCustomStart,\r\n location.search,\r\n props.date,\r\n props.noChangeLocation,\r\n props.viewLength,\r\n props.viewType,\r\n updateSearchPeriod,\r\n ],\r\n );\r\n const move = React.useCallback(\r\n (a: 'next' | 'prev') => {\r\n const diff = a === 'next' ? 1 : a === 'prev' ? -1 : undefined;\r\n if (diff === undefined) {\r\n return;\r\n }\r\n const customDiff =\r\n props.viewLength === 'day'\r\n ? diff\r\n : props.viewLength === 'twodays'\r\n ? a === 'next'\r\n ? 2\r\n : -2\r\n : props.viewLength === 'customdays'\r\n ? a === 'next'\r\n ? customDays ?? 2\r\n : -(customDays ?? 2)\r\n : props.viewLength === 'week'\r\n ? diff\r\n : props.viewLength === 'month'\r\n ? diff\r\n : props.viewLength === 'quarter'\r\n ? diff\r\n : props.viewLength === 'year'\r\n ? diff\r\n : undefined;\r\n\r\n const addDateFn =\r\n props.viewLength === 'day'\r\n ? dateUtils.addDays\r\n : props.viewLength === 'twodays'\r\n ? dateUtils.addDays\r\n : props.viewLength === 'customdays'\r\n ? dateUtils.addDays\r\n : props.viewLength === 'week'\r\n ? dateUtils.addWeeks\r\n : props.viewLength === 'month'\r\n ? dateUtils.addMonths\r\n : props.viewLength === 'quarter'\r\n ? dateUtils.addQuarters\r\n : props.viewLength === 'year'\r\n ? dateUtils.addYears\r\n : undefined;\r\n if (addDateFn === undefined) {\r\n return undefined;\r\n }\r\n const newDate = addDateFn(\r\n dateUtils.parseISO(props.date),\r\n customDiff || diff,\r\n );\r\n return moveToDate(newDate);\r\n },\r\n [customDays, moveToDate, props.date, props.viewLength],\r\n );\r\n const handleMultipleModeChange: ValueChangeHandler = value => {\r\n props.onMultipleModeChange(value);\r\n };\r\n const handlePreviousPeriodClick = () => {\r\n move('prev');\r\n };\r\n\r\n const handleNextPeriodClick = () => {\r\n move('next');\r\n };\r\n\r\n const handleTodayClick = value => {\r\n handleSetPeriodFilter('day');\r\n dispatch(\r\n actions.changeViewMode({\r\n current: {\r\n viewType: props.viewType,\r\n viewLength: 'day',\r\n date: dateUtils.formatISO(newDate()),\r\n preset: 'Today',\r\n search:\r\n updateSearchPeriod('Today', location.search) ?? location.search,\r\n customDays: undefined,\r\n customStart: undefined,\r\n },\r\n withNoChangeLocation: props.noChangeLocation,\r\n forceEvents: true,\r\n }),\r\n );\r\n };\r\n const handleFilterChange = (\r\n filters: IFilterSettings[],\r\n ) => {\r\n props.onFilterChange?.(filters);\r\n };\r\n\r\n const getTitle = (viewType: ViewTypes) => {\r\n switch (viewType) {\r\n case 'calendar':\r\n return t(translations.Calendar);\r\n case 'timeline':\r\n return t(translations.Timeline);\r\n default:\r\n assertExhaustive(viewType);\r\n }\r\n };\r\n\r\n const lengthOptions = React.useMemo(() => {\r\n let lengths: Array = ['day'];\r\n if (twoDaysEnabled) {\r\n lengths.push('twodays');\r\n }\r\n if (customDaysEnabled) {\r\n lengths.push('customdays');\r\n }\r\n lengths.push('week');\r\n lengths.push('month');\r\n if (!isMobile) {\r\n lengths.push('quarter');\r\n lengths.push('year');\r\n }\r\n return lengths;\r\n }, [customDaysEnabled, isMobile, twoDaysEnabled]);\r\n\r\n const viewType = useSelector(selectSchedulerViewType);\r\n const AssetCatEnabled = useSelector(\r\n state =>\r\n tryParseBool(\r\n selectGlobalSetting(state, AllowedSettings.AssetCatEnabled),\r\n ) === true,\r\n );\r\n const EquipmentAssembliesEnabled = useSelector(\r\n state =>\r\n selectKnownModule(state, KnownModules.EquipmentAssemblies) === true,\r\n );\r\n\r\n const TimelineGroupByEnumsArray = React.useMemo(() => {\r\n const result: TimelineGroupByUnion[] = [];\r\n if (EquipmentAssembliesEnabled) {\r\n result.push('GroupByAssemblyPart');\r\n }\r\n if (AssetCatEnabled) {\r\n result.push('GroupByAssetCat');\r\n }\r\n if (result.length === 0) {\r\n return undefined;\r\n } else {\r\n result.unshift('NoTimelineGrouped');\r\n }\r\n return result;\r\n }, [AssetCatEnabled, EquipmentAssembliesEnabled]);\r\n\r\n // page level actions shown behind kebab menu\r\n const secondaryPageActions: CalendarActionRenderer[] = React.useMemo(() => {\r\n const calendarActions: CalendarActionRenderer[] = [];\r\n // const hasCalendarAndOtherRoles =\r\n // authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n // authenticatedUser?.Roles?.length > 1;\r\n if (TimelineGroupByEnumsArray !== undefined && viewType === 'timeline') {\r\n calendarActions.push(() => (\r\n \r\n ));\r\n }\r\n\r\n if (!authenticatedUser?.Roles?.includes(Roles.CalendarOnly) && !isMobile) {\r\n calendarActions.push(() => );\r\n }\r\n if (!isMobile) {\r\n calendarActions.push(() => (\r\n {\r\n dispatch(actions.exportToPDF());\r\n }}\r\n />\r\n ));\r\n }\r\n\r\n return calendarActions.concat(props.pageActions ?? []);\r\n }, [\r\n TimelineGroupByEnumsArray,\r\n actions,\r\n authenticatedUser?.Roles,\r\n dispatch,\r\n isMobile,\r\n props.pageActions,\r\n viewType,\r\n ]);\r\n const primaryPageActions: CalendarActionRenderer[] = React.useMemo(() => {\r\n const actions: CalendarActionRenderer[] = [];\r\n if (isMobile && props.availableFilters !== undefined) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n if (!isFullScreen && isMobile && !IsReadOnlyUser(authenticatedUser)) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n\r\n return actions;\r\n }, [\r\n authenticatedUser,\r\n isFullScreen,\r\n isMobile,\r\n props.appliedFilters?.length,\r\n props.availableFilters,\r\n props.filterRef,\r\n props.onFilterOpen,\r\n t,\r\n useSidePanel,\r\n ]);\r\n const handleRefresh = () => {\r\n props.onRefresh?.();\r\n };\r\n return (\r\n <>\r\n {!props.withoutHeader && (\r\n \r\n {primaryPageActions.length > 0 &&\r\n primaryPageActions.map((item, index) => (\r\n {item()}\r\n ))}\r\n {authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n !isMobile &&\r\n !isFullScreen && }\r\n {secondaryPageActions.length > 0 &&\r\n !(\r\n authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n isFullScreen\r\n ) && (\r\n (\r\n {item()}\r\n ))}\r\n />\r\n )}\r\n \r\n )}\r\n \r\n \r\n {/* hide the menu in fullscreen mode since it's not functional (autocompletes do not show up) */}\r\n {!isFullScreen && props.availableFilters !== undefined && (\r\n <>\r\n {isMobile ? (\r\n \r\n ) : (\r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {props.viewType === 'calendar' && !isMobile && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* todo: implement settings */}\r\n {false && (\r\n \r\n \r\n \r\n )}\r\n {/* todo: implement \"save selection\" */}\r\n {false && (\r\n \r\n {t(translations.SaveSelection)}\r\n \r\n )}\r\n \r\n {showPeriodPicker && (\r\n \r\n \r\n handleViewTypeLengthChange(\r\n type,\r\n length,\r\n value,\r\n props.noChangeLocation,\r\n )\r\n }\r\n customDays={customDays}\r\n customDaysEnabled={customDaysEnabled}\r\n twoDaysEnabled={twoDaysEnabled}\r\n lengthOptions={lengthOptions}\r\n />\r\n \r\n )}\r\n \r\n {!isMobile &&\r\n props.availableFilters !== undefined &&\r\n (props.appliedFilters ?? []).length > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n padding: 8,\r\n gap: 8,\r\n },\r\n column: {\r\n display: 'flex',\r\n width: 'auto', //props => timelineColumnWidth(props.isMobile),\r\n alignItems: 'center',\r\n },\r\n toolbar: {\r\n flex: 1,\r\n display: 'flex',\r\n padding: props => (props.isMobile ? '8px 0px' : '0px'),\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n [theme.breakpoints.down('sm')]: {\r\n flexWrap: 'wrap',\r\n gap: 0,\r\n // flexDirection: 'column',\r\n // alignItems: 'flex-start',\r\n },\r\n },\r\n left: {\r\n // flex: 1,\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: theme.spacing(1),\r\n },\r\n right: {\r\n flex: 1,\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n },\r\n periodControls: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n flexDirection: 'row',\r\n gap: props => (props.isMobile ? theme.spacing(0.5) : theme.spacing(1)),\r\n },\r\n viewTypeControls: {\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n gap: theme.spacing(1),\r\n },\r\n otherControls: {},\r\n search: {\r\n width: 150,\r\n },\r\n filterDisplayRoot: {\r\n gap: 8,\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n flexWrap: 'wrap',\r\n },\r\n }),\r\n);\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalSetting,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Roles } from 'app/slice/types';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { schedulerActions } from '../slice';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport const useRefreshInterval = () => {\r\n const dispatch = useDispatch();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const intervalRefreshingCalendar = useSelector(state =>\r\n selectGlobalSetting(state, AllowedSettings.IntervalRefreshingCalendar),\r\n );\r\n const calendarOnly = authenticatedUser?.Roles?.includes(Roles.CalendarOnly);\r\n const { newDate } = useSystemDate();\r\n const isMobile = DetectIsMobile();\r\n const DEFAULT_REFRESH_INTERVAL_MINUTES = 2;\r\n const MAX_REFRESH_INTERVAL_MINUTES = 120;\r\n const MILLISECONDS_IN_MINUTE = 60000;\r\n\r\n const configuredRefreshInterval = React.useMemo(() => {\r\n return (\r\n tryParseInt(intervalRefreshingCalendar) ??\r\n DEFAULT_REFRESH_INTERVAL_MINUTES\r\n );\r\n }, [intervalRefreshingCalendar]);\r\n\r\n const refreshIntervalNumber = React.useMemo(() => {\r\n return configuredRefreshInterval < DEFAULT_REFRESH_INTERVAL_MINUTES ||\r\n configuredRefreshInterval > MAX_REFRESH_INTERVAL_MINUTES\r\n ? DEFAULT_REFRESH_INTERVAL_MINUTES\r\n : configuredRefreshInterval;\r\n }, [configuredRefreshInterval]);\r\n const refreshInterval = React.useCallback(() => {\r\n try {\r\n const date = dateUtils.formatISO(newDate());\r\n dispatch(schedulerActions.setDate(date));\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }, [dispatch, newDate]);\r\n React.useEffect(() => {\r\n let handle = 0;\r\n\r\n if (calendarOnly === true && !isMobile) {\r\n handle = setInterval(\r\n refreshInterval,\r\n refreshIntervalNumber * MILLISECONDS_IN_MINUTE,\r\n );\r\n }\r\n\r\n return () => clearInterval(handle);\r\n }, [calendarOnly, isMobile, refreshInterval, refreshIntervalNumber]);\r\n return { refreshInterval };\r\n};\r\n","import { getSinglePriceSheetMethod } from 'app/components/pickers/StaticOptionsPickers/PriceSheetMethodPicker';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\n\r\n/* --- STATE --- */\r\nexport interface PricePeriodState {\r\n detailsState: AsyncDataState;\r\n processing: boolean;\r\n}\r\n\r\nexport interface IPriceSheetPeriodDto {\r\n Id: number;\r\n ServiceGroupId: number | null;\r\n ServiceGroupName: string | null;\r\n StartDate: Date | string;\r\n EndDate: Date | string | null;\r\n Method: number | null;\r\n PriceSheetLink: string | null;\r\n}\r\n\r\nexport interface PricePeriodQueryParams {\r\n id?: string;\r\n groupId?: string;\r\n start?: string;\r\n end?: string;\r\n method?: string;\r\n}\r\nexport interface PricePeriodsDetailsState {\r\n Id: number;\r\n ServiceGroup: Entity | null;\r\n StartDate: Date | string;\r\n EndDate: Date | string | null;\r\n Method: Entity | null;\r\n}\r\nexport interface PricePeriodsResponse extends IResponseType {\r\n Id: number | null;\r\n data: IPriceSheetPeriodDto | null;\r\n IsValid: boolean;\r\n}\r\nexport const ConvertDtoToModel = (\r\n entity: IPriceSheetPeriodDto,\r\n): PricePeriodsDetailsState => {\r\n let model = {\r\n Id: entity.Id,\r\n ServiceGroup:\r\n entity.ServiceGroupId !== null\r\n ? toEntity(entity.ServiceGroupId, entity.ServiceGroupName)\r\n : null,\r\n StartDate: dateUtils.formatQueryStringDate(\r\n dateUtils.parseISO(entity.StartDate),\r\n ),\r\n EndDate:\r\n entity.EndDate === null\r\n ? null\r\n : dateUtils.formatQueryStringDate(dateUtils.parseISO(entity.EndDate)),\r\n Method:\r\n entity.Method !== null\r\n ? getSinglePriceSheetMethod(entity.Method ?? 0)\r\n : null,\r\n } as PricePeriodsDetailsState;\r\n return model;\r\n};\r\n\r\nexport const ConvertModelToInsertEntity = (model: PricePeriodsDetailsState) => {\r\n let data = {\r\n Id: model.Id,\r\n ServiceGroupId: model.ServiceGroup?.Id || null,\r\n ServiceGroupName: model.ServiceGroup?.Name,\r\n StartDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.StartDate),\r\n ),\r\n EndDate:\r\n model.EndDate === null\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n Method: model.Method?.Id,\r\n } as IPriceSheetPeriodDto;\r\n return data;\r\n};\r\nexport const ConvertModelToUpdateEntity = (\r\n model: PricePeriodsDetailsState,\r\n original: PricePeriodsDetailsState,\r\n) => {\r\n let data = {\r\n Id: original.Id,\r\n ServiceGroupId: model.ServiceGroup?.Id || null,\r\n ServiceGroupName: model.ServiceGroup?.Name,\r\n StartDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(model.StartDate),\r\n ),\r\n EndDate:\r\n model.EndDate === null\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n Method: model.Method?.Id,\r\n } as IPriceSheetPeriodDto;\r\n return data;\r\n};\r\nexport const getDefaultPricePeriod = () => {\r\n return {\r\n Id: 0,\r\n ServiceGroupId: null,\r\n ServiceGroupName: null,\r\n StartDate: dateUtils.formatISO(new Date()),\r\n EndDate: null,\r\n Method: null,\r\n } as IPriceSheetPeriodDto;\r\n};\r\n","import {\r\n IPriceSheetPeriodDto,\r\n PricePeriodQueryParams,\r\n PricePeriodsResponse,\r\n} from 'app/pages/PriceSheetPeriodDetails/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const PriceSheetApi = {\r\n initPeriodDetails: (payload: PricePeriodQueryParams) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = `/api/odata/v4/PriceSheetPeriod/InitPeriods`;\r\n return httpClient.post(url, data);\r\n },\r\n insertPricePeriod: (period: IPriceSheetPeriodDto) => {\r\n const url = '/api/odata/v4/PriceSheetPeriod';\r\n return httpClient.post(url, period);\r\n },\r\n updatePricePeriod: (period: IPriceSheetPeriodDto, rowId: number) => {\r\n const url = '/api/odata/v4/PriceSheetPeriod';\r\n return httpClient.put(\r\n url + '(' + rowId + ')',\r\n period,\r\n );\r\n },\r\n deletePricePeriod: (Id: number) => {\r\n const url = `/api/odata/v4/PriceSheetPeriod/${Id}`;\r\n return httpClient.deleteCustom(url);\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { pricePeriodActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport {\r\n ConvertModelToInsertEntity,\r\n ConvertModelToUpdateEntity,\r\n getDefaultPricePeriod,\r\n IPriceSheetPeriodDto,\r\n PricePeriodQueryParams,\r\n PricePeriodsDetailsState,\r\n PricePeriodsResponse,\r\n} from './types';\r\nimport { PriceSheetApi as api } from 'api/PriceSheetApi';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PricePeriodDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitDetails(\r\n action: PayloadAction<{\r\n query: PricePeriodQueryParams;\r\n model?: IPriceSheetPeriodDto;\r\n }>,\r\n) {\r\n try {\r\n let data: IPriceSheetPeriodDto | null = action.payload.model || null;\r\n let hasError: boolean = false;\r\n if (data === null) {\r\n const result = yield call(api.initPeriodDetails, action.payload.query);\r\n let response = result as PricePeriodsResponse;\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'initPeriodsErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'initPeriodWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.SuccessMessages.map(item => {\r\n return {\r\n key: 'initPeriodSucc',\r\n message: item,\r\n variant: 'success',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n data = response.data ?? getDefaultPricePeriod();\r\n hasError = !response.IsValid;\r\n }\r\n yield put(\r\n actions.initDetails_Success({\r\n hasErrors: hasError,\r\n data: data,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n yield put(actions.initDetails_Error(error));\r\n }\r\n}\r\nfunction* doCreatePeriod(action: PayloadAction) {\r\n const httpPayloads: IPriceSheetPeriodDto = ConvertModelToInsertEntity(\r\n action.payload,\r\n );\r\n try {\r\n const result = yield call(api.insertPricePeriod, httpPayloads);\r\n let response = result as PricePeriodsResponse;\r\n let responseErrors = response.ErrorMessages;\r\n let responseWarnings = response.WarningMessages;\r\n let responseSuccess = response.SuccessMessages;\r\n if (responseErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseErrors.map(item => {\r\n return {\r\n key: 'periodInsertError',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (responseSuccess.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'periodInsertSuccess',\r\n message: responseSuccess[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: true,\r\n itemName: i18next.t(translations.menu_PriceSheetPeriod),\r\n detailsType: RenderPageType.PricePeriodsDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialPeriod: response.data,\r\n } as PricePeriodDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (responseWarnings.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n responseWarnings.map(item => {\r\n return {\r\n key: 'periodInsertWarning',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = responseErrors.length > 0;\r\n yield put(\r\n actions.createPeriod_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'periodInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createPeriod_Error(Error));\r\n }\r\n}\r\nfunction* doUpdatePeriod(\r\n action: PayloadAction<{\r\n current: PricePeriodsDetailsState;\r\n original: PricePeriodsDetailsState;\r\n }>,\r\n) {\r\n let updatedPeriod = ConvertModelToUpdateEntity(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n\r\n try {\r\n const results = yield call(\r\n api.updatePricePeriod,\r\n updatedPeriod,\r\n action.payload.current.Id,\r\n );\r\n let response = results as PricePeriodsResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'periodUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n } else {\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'periodUpdateSuccess',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id ?? undefined,\r\n created: false,\r\n itemName: i18next.t(translations.menu_PriceSheetPeriod),\r\n detailsType: RenderPageType.PricePeriodsDetails,\r\n detailsTypeProps: {\r\n useSidePanel: true,\r\n queryParams: {\r\n id: '' + response.Id ?? -1,\r\n },\r\n initialPeriod: response.data,\r\n } as PricePeriodDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'periodUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updatePeriod_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'periodUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updatePeriod_Error(Error));\r\n }\r\n}\r\n\r\nexport function* pricePeriodSaga() {\r\n yield takeLatest(actions.initDetails.type, doInitDetails);\r\n yield takeLatest(actions.createPeriod.type, doCreatePeriod);\r\n yield takeLatest(actions.updatePeriod.type, doUpdatePeriod);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { pricePeriodSaga } from './saga';\r\nimport {\r\n ConvertDtoToModel,\r\n IPriceSheetPeriodDto,\r\n PricePeriodQueryParams,\r\n PricePeriodsDetailsState,\r\n PricePeriodState,\r\n} from './types';\r\n\r\nexport const initialState: PricePeriodState = {\r\n detailsState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n error: undefined,\r\n },\r\n processing: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'pricePeriod',\r\n initialState,\r\n reducers: {\r\n initDetails(\r\n state,\r\n action: PayloadAction<{\r\n query: PricePeriodQueryParams;\r\n model?: IPriceSheetPeriodDto;\r\n }>,\r\n ) {\r\n state.processing = true;\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n data: IPriceSheetPeriodDto;\r\n }>,\r\n ) {\r\n state.processing = false;\r\n state.detailsState.data = ConvertDtoToModel(action.payload.data);\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n },\r\n initDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n resetDetailsState(state, action: PayloadAction) {\r\n state.detailsState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n state.processing = false;\r\n },\r\n createPeriod(state, action: PayloadAction) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n createPeriod_Success(state, action: PayloadAction<{ hasErrors: boolean }>) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n createPeriod_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n updatePeriod(\r\n state,\r\n action: PayloadAction<{\r\n current: PricePeriodsDetailsState;\r\n original: PricePeriodsDetailsState;\r\n }>,\r\n ) {\r\n state.detailsState.processing = true;\r\n state.detailsState.completed = undefined;\r\n state.detailsState.hasErrors = undefined;\r\n },\r\n updatePeriod_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.detailsState.processing = false;\r\n state.detailsState.hasErrors = action.payload.hasErrors;\r\n state.detailsState.completed = true;\r\n },\r\n updatePeriod_Error(state, action: PayloadAction) {\r\n state.detailsState.processing = false;\r\n state.detailsState.completed = true;\r\n state.detailsState.hasErrors = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: pricePeriodActions } = slice;\r\n\r\nexport const usePricePeriodSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: pricePeriodSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = usePricePeriodSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.pricePeriod || initialState;\r\n\r\nexport const selectPricePeriod = createSelector([selectSlice], state => state);\r\n\r\nexport const selectProcessing = createSelector(\r\n [selectPricePeriod],\r\n state => state.processing,\r\n);\r\nexport const selectDetails = createSelector(\r\n [selectPricePeriod],\r\n state => state.detailsState,\r\n);\r\nexport const selectDetailsProcessing = createSelector(\r\n [selectDetails],\r\n state => state.processing,\r\n);\r\nexport const selectDetailsError = createSelector(\r\n [selectDetails],\r\n state => state.error,\r\n);\r\nexport const selectDetailsHasError = createSelector(\r\n [selectDetails],\r\n state => state.hasErrors,\r\n);\r\nexport const selectDetailsCompleted = createSelector(\r\n [selectDetails],\r\n state => state.completed,\r\n);\r\nexport const selectDetailsData = createSelector(\r\n [selectDetails],\r\n state => state.data,\r\n);\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n PriceSheetMethodPicker,\r\n PriceSheetMethodPickerProps,\r\n} from '../pickers/StaticOptionsPickers/PriceSheetMethodPicker';\r\n\r\nexport const FormPriceSheetMethodPicker = ({\r\n onChange,\r\n ...props\r\n}: FieldHookConfig | null> &\r\n Omit) => {\r\n const [field, meta, helpers] = useField | null>(props);\r\n return (\r\n <>\r\n helpers.setValue(value, true)}\r\n onBlur={field?.onBlur}\r\n value={field.value}\r\n variant=\"filled\"\r\n error={meta?.error !== undefined && meta?.touched}\r\n helperText={meta.error}\r\n {...props}\r\n />\r\n \r\n );\r\n};\r\n","import { Formik, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PricePeriodsDetailsState } from '../slice/types';\r\nimport { selectDetailsHasError } from '../slice/selectors';\r\n\r\nimport i18next from 'i18next';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormPriceSheetMethodPicker } from 'app/components/Forms/FormPriceSheetMethodPicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nexport interface PricePeriodsFormProps {\r\n onSubmit: (item: PricePeriodsDetailsState) => void;\r\n initialValues: PricePeriodsDetailsState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n globalPriceSheetEnabled: boolean;\r\n priceEnabled: boolean;\r\n}\r\n\r\nexport const PricePeriodsForm = React.memo(function PricePeriodsForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isEdit,\r\n isAdmin,\r\n user,\r\n globalPriceSheetEnabled,\r\n innerFormRef,\r\n priceEnabled,\r\n}: PricePeriodsFormProps) {\r\n const { t } = useTranslation();\r\n const hasError = useSelector(selectDetailsHasError);\r\n const readonly = !isAdmin && isEdit;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (values: PricePeriodsDetailsState) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values);\r\n }\r\n };\r\n const { newDate } = useSystemDate();\r\n /// Local State ///\r\n const [serviceGroupChanged, setServiceGroupChanged] = React.useState(false);\r\n const [startChanged, setStartChanged] = React.useState(false);\r\n const [endChanged, setEndChanged] = React.useState(false);\r\n\r\n const handleFormChange = React.useCallback(\r\n (values: PricePeriodsDetailsState) => {\r\n if (serviceGroupChanged) {\r\n setServiceGroupChanged(false);\r\n }\r\n if (endChanged) {\r\n setEndChanged(false);\r\n }\r\n if (startChanged) {\r\n setStartChanged(false);\r\n }\r\n },\r\n [serviceGroupChanged, endChanged, startChanged],\r\n );\r\n\r\n /// useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n\r\n const computedSchema = React.useMemo(() => {\r\n const pricPeriodsSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n StartDate: Yup.date()\r\n .default(newDate())\r\n .label(i18next.t(translations.StartDate) as string)\r\n .required(i18next.t(translations._errStartTimeRequired) as string),\r\n EndDate: Yup.date()\r\n .nullable()\r\n .default(null)\r\n .label(i18next.t(translations.EndDate) as string)\r\n .notRequired()\r\n .min(\r\n Yup.ref('StartDate'),\r\n i18next.t(translations.err_EndTimeLowerThanStartTime) as string,\r\n ),\r\n ServiceGroup: Yup.mixed().nullable(),\r\n Method: Yup.mixed()\r\n .label(t(translations.PriceSheetMethod) as string)\r\n .nullable(),\r\n },\r\n );\r\n if (!globalPriceSheetEnabled) {\r\n pricPeriodsSchema.fields.ServiceGroup.withMutation(schema =>\r\n schema.required(t(translations.err_ServiceGroupRequired) as string),\r\n );\r\n }\r\n if (!priceEnabled) {\r\n pricPeriodsSchema.fields.Method.withMutation(schema =>\r\n schema.required(\r\n t(translations.err_PriceSheetMethod_isrequired) as string,\r\n ),\r\n );\r\n }\r\n return pricPeriodsSchema;\r\n }, [globalPriceSheetEnabled, newDate, priceEnabled, t]);\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }\r\n });\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {!globalPriceSheetEnabled && (\r\n \r\n {\r\n setServiceGroupChanged(true);\r\n }}\r\n />\r\n \r\n )}\r\n\r\n \r\n setStartChanged(true)}\r\n disabled={formik.isSubmitting || readonly}\r\n />\r\n \r\n \r\n setEndChanged(true)}\r\n disabled={formik.isSubmitting || readonly}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n selectContinueToLink,\r\n selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { buildURL, toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { PricePeriodsForm } from './PricePeriodsForm';\r\nimport { usePricePeriodSlice } from './slice';\r\nimport {\r\n selectDetails,\r\n selectDetailsCompleted,\r\n selectDetailsHasError,\r\n selectProcessing,\r\n} from './slice/selectors';\r\nimport {\r\n IPriceSheetPeriodDto,\r\n PricePeriodQueryParams,\r\n PricePeriodsDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface PricePeriodDetailsProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n queryParams: PricePeriodQueryParams;\r\n initialPeriod?: IPriceSheetPeriodDto;\r\n onClose?: () => void;\r\n}\r\n\r\nexport const PricePeriodDetails = React.memo(function PricePeriodDetails(\r\n props: PricePeriodDetailsProps,\r\n) {\r\n const { useSidePanel, queryParams, initialPeriod, onClose } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = usePricePeriodSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n /// Selectors ///\r\n const processing = useSelector(selectProcessing);\r\n const pricePeriod = useSelector(selectDetails);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const continueToOther = useSelector(selectContinueState);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const actionCompleted = useSelector(selectDetailsCompleted);\r\n const settings = useSelector(selectglobalSettings);\r\n const hasError = useSelector(selectDetailsHasError);\r\n /// Refs ///\r\n const submitFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(\r\n null,\r\n );\r\n //cover\r\n const [cover, setCover] = React.useState();\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [busy, setBusy] = React.useState(false);\r\n const [edit, setEdit] = React.useState(false);\r\n\r\n const globalPriceSheetEnabled = settings?.GetBooleanByKey(\r\n AllowedSettings.GlobalPriceSheetPeriods,\r\n );\r\n const priceSheetByEnabled = React.useMemo(() => {\r\n const priceSheetBy =\r\n settings !== null && settings !== undefined\r\n ? settings?.GetString(AllowedSettings.PriceSheetBy)\r\n : '';\r\n\r\n return priceSheetBy !== '' && priceSheetBy !== '3';\r\n }, [settings]);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const fullAdmin = React.useMemo(() => {\r\n return User !== undefined && User.Roles.includes(Roles.Administrators);\r\n }, [User]);\r\n const IsAdmin = React.useMemo(() => {\r\n return (\r\n fullAdmin ||\r\n (!globalPriceSheetEnabled &&\r\n User?.HasAdminGroupPermissions(pricePeriod?.data?.ServiceGroup?.Id))\r\n );\r\n }, [\r\n fullAdmin,\r\n globalPriceSheetEnabled,\r\n User,\r\n pricePeriod?.data?.ServiceGroup?.Id,\r\n ]);\r\n\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initDetails({\r\n query: queryParams,\r\n model: initialPeriod,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [actions, dispatch, firstLoad, initialPeriod, queryParams]);\r\n /// functions, callbacks ///\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n const handleClose = () => {\r\n if (hasChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCloselClick();\r\n }\r\n };\r\n const handleCloselClick = React.useCallback(() => {\r\n if (!!onClose) {\r\n onClose();\r\n } else {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/PricePeriods'));\r\n }\r\n }\r\n dispatch(actions.resetDetailsState());\r\n }, [actions, dispatch, layoutActions, onClose, useSidePanel]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: PricePeriodsDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updatePeriod({\r\n current: values,\r\n original: pricePeriod.data || values,\r\n }),\r\n );\r\n } else {\r\n dispatch(actions.createPeriod(values));\r\n }\r\n },\r\n [actions, dispatch, edit, pricePeriod.data],\r\n );\r\n /// Use Effects ///\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n setEdit(true);\r\n } else {\r\n setEdit(false);\r\n }\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n handleCloselClick,\r\n hasError,\r\n processing,\r\n queryParams.id,\r\n ]);\r\n React.useEffect(() => {\r\n if (confirmApproved) {\r\n dispatch(actions.resetDetailsState());\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n //dispatch(actions.setChangedState(false));\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n\r\n const leftActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n return actions;\r\n }, [busy, handleSaveClick, requestCompleted, t]);\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCloselClick, t]);\r\n const topButtons: ActionRenderer[] = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n let data =\r\n pricePeriod.data ||\r\n innerFormRef.current?.values ||\r\n ({} as PricePeriodsDetailsState);\r\n if (edit && IsAdmin && data !== undefined) {\r\n actions.push(() => (\r\n \r\n window.open(\r\n toRootedURL(\r\n `/Admin/PriceSheet.aspx?${toQueryString({\r\n periodId: queryParams.id,\r\n start: dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(data.StartDate),\r\n ),\r\n end:\r\n data.EndDate === null\r\n ? undefined\r\n : dateUtils.formatQueryStringDate(\r\n dateUtils.dateOrStringToDate(data.EndDate),\r\n ),\r\n groupId: globalPriceSheetEnabled\r\n ? undefined\r\n : data.ServiceGroup?.Id ?? undefined,\r\n gName: globalPriceSheetEnabled\r\n ? undefined\r\n : data.ServiceGroup?.Name ?? undefined,\r\n priceBy: data.Method?.Id ?? undefined,\r\n }).toString()}`,\r\n ),\r\n '_blank',\r\n )\r\n }\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n />\r\n ));\r\n }\r\n return actions;\r\n }, [\r\n IsAdmin,\r\n edit,\r\n globalPriceSheetEnabled,\r\n pricePeriod.data,\r\n queryParams.id,\r\n t,\r\n ]);\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'pricePeriods/details', queryParams)}\r\n toPageLink={`pricePeriods/details?${toQueryString(queryParams)}`}\r\n rightActions={rightActions}\r\n isCover={props.isCover}\r\n cover={cover}\r\n closeCover={props.closeCover || closeCover}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * CalendarMessagesActions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\n\r\n/* --- STATE --- */\r\nexport interface CalendarMessagesState {\r\n createState: AsyncDataState;\r\n updateState: AsyncDataState;\r\n processing: boolean;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsState {\r\n Id: number;\r\n ServiceGroup: Entity | null;\r\n Equipment: Entity | null;\r\n Title: string;\r\n StartDate?: Date | null;\r\n EndDate?: Date | null;\r\n PlantDate?: Date | null;\r\n Body?: string | null;\r\n Description: string | null;\r\n DisplaySeconds: number | null;\r\n ShowOn?: string | null;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsQStringParameters {\r\n id?: string;\r\n servGrId?: string;\r\n servGr?: string;\r\n eqId?: string;\r\n eq?: string;\r\n title?: string;\r\n sDate?: string;\r\n eDate?: string;\r\n plantDate?: string;\r\n body?: string;\r\n desc?: string;\r\n dispSec?: string;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsResponse extends IResponseType {\r\n Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityCalendarMessagesDetails(\r\n entity: ICalendarMessagesDto,\r\n): CalendarMessagesDetailsState | undefined {\r\n if (!entity) {\r\n return undefined;\r\n } else {\r\n return {\r\n Id: entity.Id,\r\n ServiceGroup:\r\n entity.ServiceGroupId !== null\r\n ? toEntity(entity.ServiceGroupId, entity.ServiceGroup)\r\n : null,\r\n Equipment:\r\n entity.EquipmentId !== null\r\n ? toEntity(entity.EquipmentId, entity.Equipment)\r\n : null,\r\n Title: entity.Title,\r\n /* StartDate: entity.StartDate ?? new Date(),\r\n EndDate:\r\n entity.EndDate ??\r\n new Date(new Date().setHours(new Date().getHours() + 1)), */\r\n StartDate:\r\n entity.StartDate === null\r\n ? null\r\n : dateUtils.formatISO(\r\n dateUtils.parseISO(entity.StartDate ?? new Date()),\r\n {\r\n representation: 'complete',\r\n },\r\n ),\r\n EndDate:\r\n entity.EndDate === null\r\n ? null\r\n : dateUtils.formatISO(\r\n dateUtils.parseISO(\r\n entity.EndDate ??\r\n new Date(new Date().setHours(new Date().getHours() + 1)),\r\n ),\r\n {\r\n representation: 'complete',\r\n },\r\n ),\r\n PlantDate: entity.PlantDate,\r\n Body: entity.Body,\r\n Description: entity.Description,\r\n DisplaySeconds: entity.DisplaySeconds ?? 60,\r\n ShowOn: entity.ShowOn,\r\n } as CalendarMessagesDetailsState;\r\n }\r\n}\r\n\r\nexport function ConvertEntityToModelCalendarMessagesDetails(\r\n model: CalendarMessagesDetailsState,\r\n original: CalendarMessagesDetailsState | undefined,\r\n): ICalendarMessagesDto {\r\n let entity = {\r\n Id: original?.Id === undefined ? model.Id : original.Id,\r\n ServiceGroupId: model.ServiceGroup?.Id,\r\n ServiceGroup: model.ServiceGroup?.Name,\r\n EquipmentId: model.Equipment?.Id,\r\n Equipment: model.Equipment?.Name,\r\n Title: model.Title,\r\n StartDate:\r\n model.StartDate === null || model.StartDate === undefined\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.StartDate)),\r\n //model.StartDate,\r\n EndDate:\r\n model.EndDate === null || model.EndDate === undefined\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n //model.EndDate,\r\n PlantDate:\r\n model.PlantDate === null || model.PlantDate === undefined\r\n ? null\r\n : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.PlantDate)),\r\n //model.PlantDate,\r\n Body: model.Body,\r\n Description: model.Description,\r\n DisplaySeconds: model.DisplaySeconds ?? 60,\r\n ShowOn: model.ShowOn,\r\n } as ICalendarMessagesDto;\r\n return entity;\r\n}\r\n","import { CalendarMessagesDetailsQStringParameters } from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/types';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const CalendarMessagesApi = {\r\n initCreateData: (payload: CalendarMessagesDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n const url = '/api/odata/v4/CalendarMessages/InitCalendarMessages';\r\n return httpClient.post(url, data);\r\n },\r\n initUpdateData: (payload: CalendarMessagesDetailsQStringParameters) => {\r\n const data = {\r\n params: payload,\r\n };\r\n console.log(data);\r\n const url = '/api/odata/v4/CalendarMessages/InitCalendarMessages';\r\n return httpClient.post(url, data);\r\n },\r\n insertCalendarMessagesDetails: (payload: ICalendarMessagesDto) => {\r\n const url = '/api/odata/v4/CalendarMessages'; //POST action in Controller\r\n return httpClient.post(url, payload);\r\n },\r\n updateCalendarMessagesDetails: (payload: ICalendarMessagesDto) => {\r\n const url = `/api/odata/v4/CalendarMessages(${payload.Id})`; //PUT action in Controller\r\n return httpClient.put(url, payload);\r\n },\r\n deleteCalendarMessagesDetails: (\r\n rows: ICalendarMessagesDto[],\r\n ): Promise => {\r\n const calendarMessagesIds: number[] = rows.map(item => item.Id);\r\n const data = { calendarMessagesIds };\r\n const url = '/api/odata/v4/CalendarMessages/DeleteCalendarMessages';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n ConvertEntityToModelCalendarMessagesDetails,\r\n CalendarMessagesDetailsQStringParameters,\r\n CalendarMessagesDetailsResponse,\r\n CalendarMessagesDetailsState,\r\n} from './types';\r\nimport { calendarMessagesDetailsActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { CalendarMessagesApi } from 'api/CalendarMessagesApi';\r\nimport { CalendarMessagesDetailsProps } from '..';\r\n\r\nfunction* doInitCreate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(CalendarMessagesApi.initCreateData, action.payload);\r\n yield put(actions.initCalendarMessagesDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initCalendarMessagesDetails_Error(error));\r\n }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const data = yield call(CalendarMessagesApi.initUpdateData, action.payload);\r\n yield put(actions.initUpdateCalendarMessagesDetails_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.initUpdateCalendarMessagesDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction) {\r\n const httpPayloads: ICalendarMessagesDto = ConvertEntityToModelCalendarMessagesDetails(\r\n action.payload,\r\n undefined,\r\n );\r\n try {\r\n const result = yield call(\r\n CalendarMessagesApi.insertCalendarMessagesDetails,\r\n httpPayloads,\r\n );\r\n let response: CalendarMessagesDetailsResponse = result as CalendarMessagesDetailsResponse;\r\n\r\n if (response.ErrorMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.ErrorMessages.map(item => {\r\n return {\r\n key: 'calendarMessagesInsert',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'calendarMessagesInsert',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n if (response.Id) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'calendarMessagesInsert',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: true,\r\n itemName: i18next.t(translations.menu_CalendarMessages),\r\n detailsType: RenderPageType.CalendarMessagesDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as CalendarMessagesDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as CalendarMessagesDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n } else {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'calendarMessagesInsertSuccess',\r\n message: response.SuccessMessages[0],\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n }\r\n\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.createCalendarMessagesDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'calendarMessagesInsert',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.createCalendarMessagesDetails_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: CalendarMessagesDetailsState;\r\n original: CalendarMessagesDetailsState | undefined;\r\n }>,\r\n) {\r\n const httpPayloads: ICalendarMessagesDto = ConvertEntityToModelCalendarMessagesDetails(\r\n action.payload.current,\r\n action.payload.original,\r\n );\r\n try {\r\n const results = yield call(\r\n CalendarMessagesApi.updateCalendarMessagesDetails,\r\n httpPayloads,\r\n );\r\n let response = results as CalendarMessagesDetailsResponse;\r\n let respErrors = response.ErrorMessages;\r\n if (respErrors.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n respErrors.map(item => {\r\n return {\r\n key: 'calendarMessagesUpdateErr',\r\n message: item,\r\n variant: 'error',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.WarningMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotifications(\r\n response.WarningMessages.map(item => {\r\n return {\r\n key: 'calendarMessagesUpdateWarn',\r\n message: item,\r\n variant: 'warning',\r\n };\r\n }),\r\n ),\r\n );\r\n }\r\n if (response.SuccessMessages.length > 0) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'calendarMessagesUpdate',\r\n message: response.SuccessMessages[0],\r\n messageType: SnackBarMessageType.openSidepanelDetails,\r\n messageTypeProps: {\r\n Id: response.Id,\r\n created: false,\r\n itemName: i18next.t(translations.menu_CalendarMessages),\r\n detailsType: RenderPageType.CalendarMessagesDetails,\r\n detailsTypeProps: {\r\n queryParams: {\r\n id: '' + response.Id,\r\n } as CalendarMessagesDetailsQStringParameters,\r\n useSidePanel: true,\r\n } as CalendarMessagesDetailsProps,\r\n },\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n let hasErrors = response.ErrorMessages.length > 0;\r\n yield put(\r\n actions.updateCalendarMessagesDetails_Success({\r\n hasErrors: hasErrors,\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const message =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n ((error as AxiosError)?.response?.status === 403\r\n ? i18next.t(translations.Forbidden)\r\n : undefined) ??\r\n i18next.t(translations.errormessage);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'calendarMessagesUpdateErr',\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.updateCalendarMessagesDetails_Error(Error));\r\n }\r\n}\r\n\r\nexport function* calendarMessagesDetailsSaga() {\r\n yield takeLatest(actions.initCalendarMessagesDetails.type, doInitCreate);\r\n yield takeLatest(\r\n actions.initUpdateCalendarMessagesDetails.type,\r\n doInitUpdate,\r\n );\r\n yield takeLatest(actions.createCalendarMessagesDetails.type, doCreate);\r\n yield takeLatest(actions.updateCalendarMessagesDetails.type, doUpdate);\r\n}\r\n","import {\r\n CalendarMessagesDetailsQStringParameters,\r\n CalendarMessagesDetailsState,\r\n CalendarMessagesState,\r\n ConvertModelToEntityCalendarMessagesDetails,\r\n} from './types';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { calendarMessagesDetailsSaga } from './saga';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\n\r\nexport const initialState: CalendarMessagesState = {\r\n processing: false,\r\n createState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n updateState: {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n },\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'calendarMessagesDetail',\r\n initialState,\r\n reducers: {\r\n initCalendarMessagesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initUpdateCalendarMessagesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = true;\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n initCalendarMessagesDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.createState.data = ConvertModelToEntityCalendarMessagesDetails(\r\n action.payload,\r\n );\r\n },\r\n initUpdateCalendarMessagesDetails_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.processing = false;\r\n state.updateState.data = ConvertModelToEntityCalendarMessagesDetails(\r\n action.payload,\r\n );\r\n },\r\n initCalendarMessagesDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n initUpdateCalendarMessagesDetails_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n },\r\n //====================================================================\r\n resetUpdateCalendarMessagesDetailsState(state, action: PayloadAction) {\r\n state.updateState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n resetCreateCalendarMessagesDetailsState(state, action: PayloadAction) {\r\n state.createState = {\r\n data: undefined,\r\n processing: undefined,\r\n completed: undefined,\r\n hasErrors: undefined,\r\n };\r\n },\r\n //====================================================================\r\n updateCalendarMessagesDetails(\r\n state,\r\n action: PayloadAction<{\r\n current: CalendarMessagesDetailsState;\r\n original: CalendarMessagesDetailsState | undefined;\r\n }>,\r\n ) {\r\n state.updateState.processing = true;\r\n state.updateState.completed = undefined;\r\n state.updateState.hasErrors = undefined;\r\n },\r\n updateCalendarMessagesDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.updateState.processing = false;\r\n state.updateState.hasErrors = action.payload.hasErrors;\r\n state.updateState.completed = true;\r\n },\r\n updateCalendarMessagesDetails_Error(state, action: PayloadAction) {\r\n state.updateState.processing = false;\r\n state.updateState.completed = true;\r\n state.updateState.hasErrors = true;\r\n },\r\n //====================================================================\r\n createCalendarMessagesDetails(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.createState.processing = true;\r\n state.createState.completed = undefined;\r\n state.createState.hasErrors = undefined;\r\n },\r\n createCalendarMessagesDetails_Success(\r\n state,\r\n action: PayloadAction<{\r\n hasErrors: boolean;\r\n }>,\r\n ) {\r\n state.createState.processing = false;\r\n state.createState.hasErrors = action.payload.hasErrors;\r\n state.createState.completed = true;\r\n },\r\n createCalendarMessagesDetails_Error(state, action: PayloadAction) {\r\n state.createState.processing = false;\r\n state.createState.completed = true;\r\n state.createState.hasErrors = true;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: calendarMessagesDetailsActions } = slice;\r\n\r\nexport const useCalendarMessagesDetailsSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: calendarMessagesDetailsSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.calendarMessagesDetail || initialState;\r\n\r\nexport const selectCalendarMessagesDetails = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateCalendarMessagesDetails = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateCalendarMessagesDetailsCompleted = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateCalendarMessagesDetailsHasError = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateCalendarMessagesDetails = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateCalendarMessagesDetailsCompleted = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.updateState.completed,\r\n);\r\nexport const selectUpdateCalendarMessagesDetailsHasError = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectCalendarMessagesDetailsProcessing = createSelector(\r\n [selectCalendarMessagesDetails],\r\n state => state.processing,\r\n);\r\n","import * as React from 'react';\r\nimport { useCallback, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CalendarMessagesDetailsState } from '../slice/types';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BaseOptionsMultiPicker } from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { Entity } from 'types/common';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\n\r\nexport interface CalendarMessagesFormProps {\r\n initialValues: CalendarMessagesDetailsState;\r\n onSubmit: (item: CalendarMessagesDetailsState) => void;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n bindSubmitForm: any;\r\n}\r\n\r\nexport const CalendarMessagesForm = React.memo(function CalendarMessagesForm({\r\n initialValues,\r\n onSubmit,\r\n isEdit,\r\n isAdmin,\r\n bindSubmitForm,\r\n}: CalendarMessagesFormProps): JSX.Element {\r\n //SETTINGS\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const initValues = React.useMemo(() => {\r\n if (isEdit) return initialValues;\r\n return { ...initialValues, StartDate: newDate(), EndDate: newDate() };\r\n }, [initialValues, isEdit, newDate]);\r\n\r\n //STATES\r\n const [IsServiceGroupChanged, setIsServiceGroupChanged] = useState(\r\n false,\r\n );\r\n const [IsEquipmentChanged, setIsEquipmentChanged] = useState(false);\r\n\r\n //FUNCTIONS\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n\r\n const handleFormChange = useCallback(\r\n (values: CalendarMessagesDetailsState, isValid, dirty, setValue) => {\r\n if (IsServiceGroupChanged) {\r\n setValue('Equipment', null, false);\r\n }\r\n if (IsEquipmentChanged) {\r\n setValue('ServiceGroup', null, false);\r\n }\r\n setIsServiceGroupChanged(false);\r\n setIsEquipmentChanged(false);\r\n },\r\n [IsEquipmentChanged, IsServiceGroupChanged],\r\n );\r\n\r\n //SCHEMA\r\n const calendarMessagesDetailsSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n ServiceGroup: Yup.mixed()\r\n .nullable()\r\n .label(i18next.t(translations.Laboratory)),\r\n Equipment: Yup.mixed()\r\n .nullable()\r\n .label(i18next.t(translations.Equipment)),\r\n Title: Yup.string()\r\n .nullable()\r\n .default('')\r\n .required()\r\n //.required(i18next.t(translations.err_AttributeRequired))\r\n .label(i18next.t(translations.Title)),\r\n StartDate: Yup.date()\r\n .default(newDate())\r\n .nullable()\r\n .notRequired()\r\n .label(i18next.t(translations.StartDate)),\r\n EndDate: Yup.date()\r\n .default(newDate())\r\n .nullable()\r\n .notRequired()\r\n .label(i18next.t(translations.EndDate)),\r\n PlantDate: Yup.date()\r\n .nullable()\r\n .notRequired()\r\n .label(i18next.t(translations.PlantDate)),\r\n Body: Yup.string()\r\n .nullable()\r\n .default('')\r\n .label(i18next.t(translations.Body)),\r\n Description: Yup.string()\r\n .default('')\r\n .nullable()\r\n .notRequired()\r\n .label(i18next.t(translations.Description)),\r\n DisplaySeconds: Yup.number()\r\n .notRequired()\r\n .default(60)\r\n .label(i18next.t(translations.Group)),\r\n ShowOn: Yup.string()\r\n .default(null)\r\n .nullable()\r\n .required('Please select at least one option for Show On.')\r\n .label('Show on'),\r\n },\r\n );\r\n const getDisabledInfo = useCallback(\r\n (entity: Entity) => {\r\n const id = entity.Id;\r\n if (\r\n id === 'system' &&\r\n !authenticatedUser?.Roles.includes(Roles.Administrators)\r\n ) {\r\n return 'Disabled: You need to be a main admin';\r\n }\r\n if (\r\n id === 'core' &&\r\n !authenticatedUser?.Roles.includes(Roles.GroupAdministrators)\r\n ) {\r\n return 'Disabled: You need to be a core admin';\r\n }\r\n return undefined;\r\n },\r\n [authenticatedUser?.Roles],\r\n );\r\n\r\n //RENDER\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('Submitting: ', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n //console.log('User Attributes Details Errors: ', formik.errors);\r\n }\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n return options.filter(o => {\r\n if (!!getDisabledInfo(o)) return false;\r\n if ((search ?? '') === '') return true;\r\n return o.Name.includes(search ?? '');\r\n });\r\n }}\r\n onChange={val => {\r\n formik.setFieldValue(\r\n 'ShowOn',\r\n undefinedIfIsEmpty(val?.map(o => o.Id).join(',')),\r\n );\r\n }}\r\n value={\r\n formik.values.ShowOn?.split(',')\r\n .map(o => options.find(f => f.Id === o))\r\n .filter(f => f !== undefined) as Entity[]\r\n }\r\n placeholder=\"Select where to show\"\r\n disabled={formik.isSubmitting}\r\n label=\"Show on\"\r\n fullWidth\r\n variant=\"filled\"\r\n error={!!formik.errors.ShowOn}\r\n helperText={formik.errors.ShowOn}\r\n />\r\n \r\n \r\n \r\n setIsServiceGroupChanged(true)}\r\n fullWidth\r\n />\r\n \r\n \r\n setIsEquipmentChanged(true)}\r\n disabled={formik.isSubmitting}\r\n predicates={ServiceGroupFilter(\r\n formik.values.ServiceGroup?.Id,\r\n )}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n\r\nconst options = [\r\n { Id: 'system', Name: 'System Dashboard' },\r\n { Id: 'core', Name: 'Core Dashboard' },\r\n { Id: 'calendar', Name: 'Schedule' },\r\n];\r\n","import Box from '@material-ui/core/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectHasNotSavedChanges,\r\n selectContinueToLink,\r\n selectConfirmApproved,\r\n selectConfirmRejected,\r\n selectContinueState,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { SaveFormButton } from './Actions/CalendarMessagesActions';\r\nimport { useCalendarMessagesDetailsSlice } from './slice';\r\nimport {\r\n selectCalendarMessagesDetailsProcessing,\r\n selectCreateCalendarMessagesDetailsCompleted,\r\n selectUpdateCalendarMessagesDetailsCompleted,\r\n selectCreateCalendarMessagesDetails,\r\n selectUpdateCalendarMessagesDetails,\r\n} from './slice/selectors';\r\nimport {\r\n CalendarMessagesDetailsQStringParameters,\r\n CalendarMessagesDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { CalendarMessagesForm } from './CalendarMessagesForm';\r\n\r\nexport interface CalendarMessagesDetailsProps {\r\n useSidePanel: boolean;\r\n queryParams: CalendarMessagesDetailsQStringParameters;\r\n}\r\n\r\nexport function CalendarMessagesDetails(\r\n props: CalendarMessagesDetailsProps,\r\n): JSX.Element {\r\n //PROPS\r\n const { queryParams, useSidePanel } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n //PERMISSIONS\r\n const User = useSelector(selectAuthenticatedUser);\r\n const IsAdmin =\r\n User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n //SLICES\r\n const { actions } = useCalendarMessagesDetailsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n //SELECTORS\r\n const publicUrl = useSelector(selectPublicUrl);\r\n //====================================================================\r\n const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n const continueLink = useSelector(selectContinueToLink);\r\n const loading = useSelector(selectCalendarMessagesDetailsProcessing);\r\n //====================================================================\r\n const confirmRejected = useSelector(selectConfirmRejected);\r\n const confirmApproved = useSelector(selectConfirmApproved);\r\n const continueToOther = useSelector(selectContinueState);\r\n //====================================================================\r\n const requestCreateCompleted = useSelector(\r\n selectCreateCalendarMessagesDetailsCompleted,\r\n );\r\n const requestUpdateCompleted = useSelector(\r\n selectUpdateCalendarMessagesDetailsCompleted,\r\n );\r\n //====================================================================\r\n const createModel = useSelector(\r\n selectCreateCalendarMessagesDetails,\r\n shallowEqual,\r\n );\r\n const editModel = useSelector(\r\n selectUpdateCalendarMessagesDetails,\r\n shallowEqual,\r\n );\r\n const baseModel = createModel || editModel;\r\n //====================================================================\r\n\r\n //STATES\r\n const [edit, setEdit] = useState(false);\r\n const [busy, setBusy] = useState(false);\r\n const [requestCompleted, setRequestCompleted] = useState(\r\n undefined,\r\n );\r\n\r\n //REF\r\n const submitFormRef = useRef(null);\r\n\r\n //FUNCTIONS\r\n const bindSubmitForm = useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n\r\n const handleSaveClick = (e: any) => {\r\n handleSubmitForm(e);\r\n };\r\n\r\n const handleSubmit = useCallback(\r\n (values: CalendarMessagesDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateCalendarMessagesDetails({\r\n current: values,\r\n original: baseModel,\r\n }),\r\n );\r\n } else {\r\n let value = values as CalendarMessagesDetailsState;\r\n console.debug('Data: ', value);\r\n dispatch(actions.createCalendarMessagesDetails(values));\r\n }\r\n },\r\n [actions, baseModel, dispatch, edit],\r\n );\r\n\r\n const handleCancelClick = useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/CalendarMessages'));\r\n }\r\n if (edit) {\r\n dispatch(actions.resetUpdateCalendarMessagesDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateCalendarMessagesDetailsState());\r\n }\r\n }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n const handleClose = () => {\r\n if (hasUnsavedChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n\r\n //USE EFFECT ON MOUNT\r\n useEffectOnMount(() => {\r\n if (\r\n queryParams.id !== undefined &&\r\n !isNaN(parseInt(queryParams.id || ''))\r\n ) {\r\n dispatch(actions.initUpdateCalendarMessagesDetails(queryParams));\r\n } else {\r\n dispatch(actions.initCalendarMessagesDetails(queryParams));\r\n }\r\n setBusy(false);\r\n setEdit(false);\r\n setRequestCompleted(undefined);\r\n return () => {};\r\n });\r\n\r\n //USE EFFECT\r\n useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n setEdit(true);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n handleCancelClick();\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n handleCancelClick,\r\n loading,\r\n queryParams.id,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n ]);\r\n\r\n //USE EFFECT 2\r\n useEffect(() => {\r\n if (confirmApproved) {\r\n if (edit) {\r\n dispatch(actions.resetUpdateCalendarMessagesDetailsState());\r\n } else {\r\n dispatch(actions.resetCreateCalendarMessagesDetailsState());\r\n }\r\n if (continueToOther.continueOnApprove) {\r\n dispatch(layoutActions.resetSidePanel());\r\n setTimeout(() => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: continueToOther.pageType,\r\n props: continueToOther.pageProps,\r\n expanded: continueToOther.expanded,\r\n }),\r\n );\r\n dispatch(layoutActions.resetContinueState());\r\n }, 200);\r\n } else if (continueLink !== undefined) {\r\n dispatch(appSettingsActions.navigate(continueLink));\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n }\r\n if (confirmRejected) {\r\n dispatch(layoutActions.resetConfirmState());\r\n }\r\n return () => undefined;\r\n }, [\r\n actions,\r\n appSettingsActions,\r\n confirmApproved,\r\n confirmRejected,\r\n continueLink,\r\n continueToOther,\r\n dispatch,\r\n edit,\r\n layoutActions,\r\n ]);\r\n\r\n //LEFT ACTIONS\r\n const leftActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RIGHT ACTIONS\r\n const rightActions = [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n />\r\n {hasUnsavedChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nimport { CampusPickerFilter } from 'app/components/BasicTable/Filters/CampusPickerFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\n\r\nimport { TagsFilter } from 'app/components/BasicTable/Filters/TagsFilter';\r\nimport { LoanableFilter } from 'app/components/BasicTable/Filters/LoanableFilter';\r\nimport { StatusFilter } from 'app/components/BasicTable/Filters/StatusFilter';\r\nimport { LockersFilter } from 'app/components/BasicTable/Filters/LockersFilter';\r\nimport { AssetCatGroupFilter } from 'app/components/BasicTable/Filters/AssetCatGroupFilter';\r\nimport { AssetCatFilter } from 'app/components/BasicTable/Filters/AssetCatFilter';\r\nimport {\r\n arrayToQueryString,\r\n assetRangeSerializer,\r\n getAssetRange,\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n GetDateOrUndefined,\r\n getNumberEntityArray,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n getStringEntityArray,\r\n GetStringOrUndefined,\r\n initExPickerValue,\r\n initMultiExPickerValue,\r\n initMultiPickerValue,\r\n initPickerValue,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport { initLockersData } from 'app/components/pickers/AutocompletePickers/LockersPicker';\r\nimport { initTagsData } from 'app/components/pickers/AutocompletePickers/TagsPicker';\r\nimport { initAssetCatData } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport { initAssetCatGroupData } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport { initLoanableData } from 'app/components/pickers/AutocompletePickers/LoanablePicker';\r\nimport { IsAssetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { initStatusData } from 'app/components/pickers/AutocompletePickers/StatusPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n DatePickerFilter,\r\n TextFieldFilter,\r\n} from 'app/components/BasicTable/Filters';\r\nimport { initAssetMultiData } from 'app/components/pickers/AutocompletePickers/AssetMultiPicker';\r\nimport { AssetMultiFilter } from 'app/components/BasicTable/Filters/AssetMultiFilter';\r\nimport { AssetTypesFilter } from 'app/components/BasicTable/Filters/AssemblyTypesFilter';\r\nimport { initAssemblyTypeData } from 'app/components/pickers/StaticOptionsPickers/AssemblyTypePicker';\r\nimport { AreasFilter } from 'app/components/BasicTable/Filters/AreasFilter';\r\nimport { initAreasData } from 'app/components/pickers/AutocompletePickers/AreassPicker';\r\nimport { initLocationData } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\nimport { LocationPickerFilter } from 'app/components/BasicTable/Filters/LocationPickerFilter';\r\nimport { SubLocationFilter } from 'app/components/BasicTable/Filters/SubLocationListFilter';\r\nimport { initSubLocationListData } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\nimport {\r\n initInstrumentCatData,\r\n InstrumentCatFilter,\r\n} from 'app/components/BasicTable/Filters/InstrumentCatFilter';\r\nimport { OnlineServiceTypeFilter } from 'app/components/BasicTable/Filters/OnlineServiceTypeFilter';\r\nimport { initOnlineServiceTypeData } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { initUserMultiData } from 'app/components/pickers/AutocompletePickers/UserMultiPicker';\r\nimport UserAssetContactMultiFilter from 'app/components/BasicTable/Filters/UserAssetContactMultiFilter';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { initMyAssetAvailabilityTypeMultiData } from 'app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker';\r\nimport {\r\n assetRangeCustomFilter,\r\n assetRangeDisplay,\r\n AssetRangeFilter,\r\n initAssetRangeData,\r\n} from 'app/components/BasicTable/Filters/AssetRangeFilter';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { AvailabilityTypeAvailableMultiFilter } from 'app/components/BasicTable/Filters/MyAssetAvailabilityTypeMultiPickerFilter';\r\nimport ServiceTypeEnumFilter from 'app/components/BasicTable/Filters/ServiceTypeEnumFilter';\r\nimport { initServiceTypeEnumData } from 'app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker';\r\nimport ExtraDDLFilter from 'app/components/BasicTable/Filters/ExtraDDLFilter';\r\nimport { initExtraDDLData } from 'app/components/pickers/AutocompletePickers/ExtraddlPicker';\r\nimport { SuperGroupFilter } from 'app/components/BasicTable/Filters/SuperGroupFilter';\r\nimport { initSuperGroupData } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const myAssetsDefaultFilters: string[] = [\r\n ...(settings as GlobalSettings)\r\n .GetString(AllowedSettings.AdvancedAssetSearchFilterAttributes)\r\n .split(','),\r\n ];\r\n\r\n const params = new URLSearchParamsCI(search);\r\n var result: IFilterSettings[] = [\r\n {\r\n fieldName: 'Id',\r\n queryStringSerializer: arrayToQueryString('aid'),\r\n displayName: t(translations.AssetName), //(displayed as Resource Name)\r\n operator: ODataOperators.Includes,\r\n value: getNumberEntityArray(params, 'aid'),\r\n initData: initMultiPickerValue(initAssetMultiData),\r\n component: AssetMultiFilter,\r\n urlKey: 'aid',\r\n },\r\n {\r\n fieldName: 'CampusId',\r\n displayName: t(translations.Campus),\r\n queryStringSerializer: 'CampusId',\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'CampusId')),\r\n ),\r\n initData: initPickerValue(initCampusData),\r\n component: CampusPickerFilter,\r\n },\r\n {\r\n fieldName: 'LocationId',\r\n queryStringSerializer: 'LocationId',\r\n displayName: t(translations.LocationsList),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'LocationId')),\r\n ),\r\n initData: initPickerValue(initLockersData),\r\n component: LockersFilter,\r\n },\r\n {\r\n fieldName: 'AssetRecordDate',\r\n queryStringSerializer: 'AssetRecordDate',\r\n displayName: t(translations.CreatedSince),\r\n operator: ODataOperators.GreaterThanEqual,\r\n defaultValue: new CustomDate(),\r\n value: GetDateOrUndefined(GetRawValue(params, 'AssetRecordDate'), 'date'),\r\n component: DatePickerFilter,\r\n },\r\n {\r\n fieldName: 'Active',\r\n queryStringSerializer: 'active',\r\n displayName: t(translations.ActiveAssets),\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'active')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n },\r\n {\r\n fieldName: 'InstrumentTypeId',\r\n queryStringSerializer: 'typeId',\r\n displayName: t(translations.InstrumentType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'typeId')),\r\n ),\r\n initData: initPickerValue(initAssemblyTypeData),\r\n component: AssetTypesFilter,\r\n },\r\n {\r\n fieldName: 'OperationTypeID',\r\n queryStringSerializer: 'OperationTypeID',\r\n displayName: t(translations.OperationType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'OperationTypeID')),\r\n ),\r\n customFilter: (value, setting) => {\r\n return `${new Condition(\r\n 'AutoMode',\r\n ODataOperators.Equals,\r\n 1,\r\n ).toString()} and ${new Condition(\r\n setting.fieldName,\r\n ODataOperators.Equals,\r\n value,\r\n ).toString()}`;\r\n },\r\n initData: initPickerValue(initOnlineServiceTypeData),\r\n component: OnlineServiceTypeFilter,\r\n },\r\n {\r\n fieldName: 'RoomAreaId',\r\n queryStringSerializer: 'areaId',\r\n displayName: t(translations.Areas),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'areaId')),\r\n ),\r\n initData: initPickerValue(initAreasData),\r\n component: AreasFilter,\r\n },\r\n {\r\n fieldName: 'LocationId',\r\n queryStringSerializer: 'locationid',\r\n displayName: t(translations.LocationList),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'locationid')),\r\n ),\r\n initData: initPickerValue(initLocationData),\r\n component: LocationPickerFilter,\r\n },\r\n {\r\n fieldName: 'SubLocationId',\r\n queryStringSerializer: 'sublocationid',\r\n displayName: t(translations.SubLocationsList),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'sublocationid')),\r\n ),\r\n initData: initPickerValue(initSubLocationListData),\r\n component: SubLocationFilter,\r\n },\r\n {\r\n fieldName: 'InstrumentCatId',\r\n displayName: t(translations.InstrumentCat),\r\n queryStringSerializer: 'instrumentCatId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'instrumentCatId')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: InstrumentCatFilter,\r\n initData: initPickerValue(initInstrumentCatData),\r\n },\r\n {\r\n fieldName: 'StatusId',\r\n queryStringSerializer: 'StatusId',\r\n displayName: t(translations.Status),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'StatusId')),\r\n ),\r\n initData: initPickerValue(initStatusData),\r\n component: StatusFilter,\r\n },\r\n {\r\n fieldName: 'ApprovalRequired',\r\n queryStringSerializer: 'approval',\r\n displayName: t(translations.ApprovalRequired),\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'approval')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n },\r\n ];\r\n if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n result.push({\r\n fieldName: 'DivisionId',\r\n displayName: t(translations.Division),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'divid',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'divid')),\r\n ),\r\n component: SuperGroupFilter,\r\n initData: initExPickerValue(initSuperGroupData, undefined, 'base'),\r\n urlType: 'base',\r\n urlKey: 'divid',\r\n });\r\n result.push({\r\n fieldName: 'RegionId',\r\n displayName: t(translations.Region),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'regionid',\r\n initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n ),\r\n component: RegionFilter,\r\n urlType: 'base',\r\n });\r\n }\r\n if (IsModuleEnabled(appSettings, KnownModules.LocationTracking)) {\r\n result.push({\r\n fieldName: 'LocationUpdatedAt',\r\n queryStringSerializer: 'locationNotUpdatedSince',\r\n displayName: t(translations.LocationNotUpdatedSince),\r\n operator: ODataOperators.LessThan,\r\n defaultValue: new CustomDate(),\r\n value: GetDateOrUndefined(\r\n GetRawValue(params, 'locationNotUpdatedSince'),\r\n 'date',\r\n ),\r\n component: DatePickerFilter,\r\n });\r\n }\r\n if (\r\n IsModuleEnabled(appSettings, KnownModules.LoanDesk) &&\r\n myAssetsDefaultFilters.includes('Loanable')\r\n ) {\r\n result.push({\r\n fieldName: 'LoanTypeId',\r\n queryStringSerializer: 'LoanTypeId',\r\n displayName: t(translations.Loanable),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'loantypeId')),\r\n ),\r\n initData: initPickerValue(initLoanableData),\r\n component: LoanableFilter,\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('Tags')) {\r\n result.push({\r\n fieldName: 'TagsText',\r\n queryStringSerializer: arrayToQueryString('TagsText'),\r\n displayName: t(translations.Tags),\r\n operator: ODataOperators.ContainsM,\r\n value: getNumberEntityArray(params, 'TagsText'),\r\n initData: initMultiPickerValue(initTagsData),\r\n component: TagsFilter,\r\n urlKey: 'TagsText',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('AssetCatGroup')) {\r\n result.push({\r\n fieldName: 'AssetCatGroupId',\r\n queryStringSerializer: 'AssetCatGroupId',\r\n displayName: t(translations.AssetCatGroupName),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'AssetCatGroupId')),\r\n ),\r\n initData: initPickerValue(initAssetCatGroupData),\r\n component: AssetCatGroupFilter,\r\n urlType: 'assetBase',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('AssetCat')) {\r\n result.push({\r\n fieldName: 'AssetCatId',\r\n queryStringSerializer: 'AssetCatId',\r\n displayName: t(translations.AssetCatName),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'AssetCatId')),\r\n ),\r\n initData: initPickerValue(initAssetCatData),\r\n component: AssetCatFilter,\r\n urlType: 'assetBase',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('Building')) {\r\n result.push({\r\n fieldName: 'BuildingId',\r\n displayName: t(translations.Building),\r\n queryStringSerializer: 'BuildingId',\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'BuildingId')),\r\n ),\r\n initData: initPickerValue(initBuildingData),\r\n component: BuildingPickerFilter,\r\n urlType: 'assetBase',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('Room')) {\r\n result.push({\r\n fieldName: 'RoomId',\r\n queryStringSerializer: 'RoomId',\r\n displayName: t(translations.Room),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'RoomId')),\r\n ),\r\n initData: initPickerValue(initRoomData),\r\n component: RoomPickerFilter,\r\n });\r\n }\r\n //if (myAssetsDefaultFilters.includes('Availability')) {\r\n result.push({\r\n fieldName: 'AvailabilityTypeId',\r\n queryStringSerializer: arrayToQueryString('AvailabilityTypeId'),\r\n displayName: t(translations.AvailabilityType),\r\n operator: ODataOperators.Includes,\r\n value: getNumberEntityArray(params, 'AvailabilityTypeId'),\r\n initData: initMultiPickerValue(initMyAssetAvailabilityTypeMultiData),\r\n component: AvailabilityTypeAvailableMultiFilter,\r\n urlKey: 'AvailabilityTypeId',\r\n });\r\n result.push({\r\n fieldName: 'ServiceTypeId',\r\n queryStringSerializer: 'stid',\r\n displayName: t(translations.ResourceServiceType),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'stid'))),\r\n initData: initPickerValue(initServiceTypeEnumData),\r\n component: ServiceTypeEnumFilter,\r\n urlKey: 'stid',\r\n });\r\n\r\n //}\r\n if (myAssetsDefaultFilters.includes('ContactsPersonForEquipment')) {\r\n result.push({\r\n fieldName: 'Contacts',\r\n displayName: t(translations.ContactsPersonForEquipment),\r\n operator: ODataOperators.AnyIn,\r\n queryStringSerializer: arrayToQueryString('contacts'),\r\n value: getStringEntityArray(params, 'contacts'),\r\n component: UserAssetContactMultiFilter,\r\n initData: initMultiExPickerValue(initUserMultiData),\r\n urlKey: 'contacts',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('Experts')) {\r\n result.push({\r\n fieldName: 'Experts',\r\n displayName: t(translations.EquipmentExperts),\r\n operator: ODataOperators.AnyIn,\r\n queryStringSerializer: arrayToQueryString('experts'),\r\n value: getStringEntityArray(params, 'experts'),\r\n component: UserAssetContactMultiFilter,\r\n initData: initMultiExPickerValue(initUserMultiData),\r\n urlKey: 'experts',\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('OtherNames')) {\r\n result.push({\r\n fieldName: 'OtherNames',\r\n displayName: t(translations.OtherNames),\r\n operator: ODataOperators.Contains,\r\n queryStringSerializer: 'otherNames',\r\n value: GetStringOrUndefined(GetRawValue(params, 'otherNames')),\r\n component: TextFieldFilter,\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('InternalCode')) {\r\n result.push({\r\n fieldName: 'InternalCode',\r\n displayName: t(translations.InternalEquipmentBarcodeNumber),\r\n operator: ODataOperators.Contains,\r\n queryStringSerializer: 'internalCode',\r\n value: GetStringOrUndefined(GetRawValue(params, 'internalCode')),\r\n component: TextFieldFilter,\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('ShowAssemblyParts')) {\r\n result.push({\r\n fieldName: 'HasAssemblyParts',\r\n displayName: t(translations.ShowAssemblyParts),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'showAssemblyParts',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'showAssemblyParts')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n }\r\n if (myAssetsDefaultFilters.includes('IsUsageOpen')) {\r\n result.push({\r\n fieldName: 'HasActiveUsage',\r\n displayName: t(translations.UsageStatus),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'isUsageOpen',\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'isUsageOpen')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangeWeight'),\r\n value: getAssetRange(params, 'RangeWeight'),\r\n displayName: t(translations.RangeWeight),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 1,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangeWeight',\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangekN'),\r\n value: getAssetRange(params, 'RangekN'),\r\n displayName: t(translations.RangekN),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 2,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangekN',\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangeTemperature'),\r\n value: getAssetRange(params, 'RangeTemperature'),\r\n displayName: t(translations.RangeTemperature),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 3,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangeTemperature',\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangeArea'),\r\n value: getAssetRange(params, 'RangeArea'),\r\n displayName: t(translations.RangeArea),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 4,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangeArea',\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangeVolume'),\r\n value: getAssetRange(params, 'RangeVolume'),\r\n displayName: t(translations.RangeVolume),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 5,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangeVolume',\r\n });\r\n }\r\n if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n result.push({\r\n fieldName: 'Ranges',\r\n queryStringSerializer: assetRangeSerializer('RangeAmount'),\r\n value: getAssetRange(params, 'RangeAmount'),\r\n displayName: t(translations.RangeAmount),\r\n operator: ODataOperators.In,\r\n component: AssetRangeFilter,\r\n initData: initAssetRangeData,\r\n customData: 6,\r\n customFilter: assetRangeCustomFilter,\r\n getDisplay: assetRangeDisplay,\r\n urlKey: 'RangeAmount',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL0) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL0')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL0',\r\n displayName: t(translations.Asset_ExtraDDL0),\r\n queryStringSerializer: 'extddl0',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl0')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL0'),\r\n urlType: 'ExtraDDL0',\r\n urlKey: 'extddl0',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL1) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL1')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL1',\r\n displayName: t(translations.Asset_ExtraDDL1),\r\n queryStringSerializer: 'extddl1',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl1')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL1'),\r\n urlType: 'ExtraDDL1',\r\n urlKey: 'extddl1',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL2) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL2')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL2',\r\n displayName: t(translations.Asset_ExtraDDL2),\r\n queryStringSerializer: 'extddl2',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl2')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL2'),\r\n urlType: 'ExtraDDL2',\r\n urlKey: 'extddl2',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL3) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL3')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL3',\r\n displayName: t(translations.Asset_ExtraDDL3),\r\n queryStringSerializer: 'extddl3',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl3')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL3'),\r\n urlType: 'ExtraDDL3',\r\n urlKey: 'extddl3',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL4) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL4')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL4',\r\n displayName: t(translations.Asset_ExtraDDL4),\r\n queryStringSerializer: 'extddl4',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl4')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL4'),\r\n urlType: 'ExtraDDL4',\r\n urlKey: 'extddl4',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL5) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL5')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL5',\r\n displayName: t(translations.Asset_ExtraDDL5),\r\n queryStringSerializer: 'extddl5',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl5')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL5'),\r\n urlType: 'ExtraDDL5',\r\n urlKey: 'extddl5',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL6) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL6')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL6',\r\n displayName: t(translations.Asset_ExtraDDL6),\r\n queryStringSerializer: 'extddl6',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl6')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL6'),\r\n urlType: 'ExtraDDL6',\r\n urlKey: 'extddl6',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL7) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL7')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL7',\r\n displayName: t(translations.Asset_ExtraDDL7),\r\n queryStringSerializer: 'extddl7',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl7')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL7'),\r\n urlType: 'ExtraDDL7',\r\n urlKey: 'extddl7',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL8) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL8')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL8',\r\n displayName: t(translations.Asset_ExtraDDL8),\r\n queryStringSerializer: 'extddl8',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl8')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL8'),\r\n urlType: 'ExtraDDL8',\r\n urlKey: 'extddl8',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL9) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL9')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL9',\r\n displayName: t(translations.Asset_ExtraDDL9),\r\n queryStringSerializer: 'extddl9',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl9')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL9'),\r\n urlType: 'ExtraDDL9',\r\n urlKey: 'extddl9',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL10) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL10')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL10',\r\n displayName: t(translations.Asset_ExtraDDL10),\r\n queryStringSerializer: 'extddl10',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl10')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL10'),\r\n urlType: 'ExtraDDL10',\r\n urlKey: 'extddl10',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL11) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL11')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL11',\r\n displayName: t(translations.Asset_ExtraDDL11),\r\n queryStringSerializer: 'extddl11',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl11')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL11'),\r\n urlType: 'ExtraDDL11',\r\n urlKey: 'extddl11',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL12) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL12')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL12',\r\n displayName: t(translations.Asset_ExtraDDL12),\r\n queryStringSerializer: 'extddl12',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl12')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL12'),\r\n urlType: 'ExtraDDL12',\r\n urlKey: 'extddl12',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL13) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL13')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL13',\r\n displayName: t(translations.Asset_ExtraDDL13),\r\n queryStringSerializer: 'extddl13',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl13')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL13'),\r\n urlType: 'ExtraDDL13',\r\n urlKey: 'extddl13',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL14) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL14')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL14',\r\n displayName: t(translations.Asset_ExtraDDL14),\r\n queryStringSerializer: 'extddl14',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl14')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL14'),\r\n urlType: 'ExtraDDL14',\r\n urlKey: 'extddl14',\r\n });\r\n }\r\n if (\r\n IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL15) &&\r\n myAssetsDefaultFilters.includes('ExtraDDL15')\r\n ) {\r\n result.push({\r\n fieldName: 'ExtraDDL5',\r\n displayName: t(translations.Asset_ExtraDDL15),\r\n queryStringSerializer: 'extddl15',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'extddl15')),\r\n ),\r\n operator: ODataOperators.Equals,\r\n component: ExtraDDLFilter,\r\n initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL15'),\r\n urlType: 'ExtraDDL15',\r\n urlKey: 'extddl15',\r\n });\r\n }\r\n return result;\r\n};\r\n","import { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as React from 'react';\r\nimport { Column, IdType, Row } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from '../Columns';\r\nimport { DefaultFilter } from '../DefaultFilter';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectAppSettings,\r\n selectglobalSettings,\r\n selectIsAuthenticated,\r\n selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport {\r\n SelectedRowsActionExtRenderer,\r\n SelectedRowsActionRenderer,\r\n} from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport {\r\n AppSettings,\r\n IsAssetFieldEnabled,\r\n IsAssetFieldIsPublic,\r\n IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { GetFilters } from './Filter';\r\nimport { AssetActionType } from './AssetsSelection';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport useState from 'react-usestateref';\r\nimport { TableMode } from 'app/components/BasicTable/ControlledTable';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { GetSelectedActions } from '../SelectedRowActions/GetSelectedActions';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { translations } from 'locales/translations';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { getOnlineServiceTypeAssetFilter } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface AssetsSelectionTableProps {\r\n useSidePanel?: boolean;\r\n authenticatedUser?: AuthenticatedUser;\r\n closeSidePanel: () => void;\r\n setFilters?: (\r\n appliedFilters: IFilterSettings[] | undefined,\r\n ) => void;\r\n allowMultiToggle: boolean;\r\n primaryAction?: (row: Row) => void;\r\n primaryMultiAction: (rows: IMyAssetsRow[]) => void;\r\n isRowSelectable: (row: Row) => boolean;\r\n getRequiredFilter?: (\r\n search: string,\r\n appSettings?: AppSettings | null,\r\n ) => string | undefined;\r\n assets?: Entity[];\r\n screenName: string;\r\n multiModeDisabled?: boolean;\r\n openAsset: (id: number) => void;\r\n useRecentAssets?: boolean;\r\n RecentAssets?: React.ReactNode;\r\n actionType: AssetActionType;\r\n customPredicates?: (string | Condition)[];\r\n isShortView?: boolean;\r\n emptyTable?: CustomEmptyTableProps;\r\n searchTerm?: string;\r\n}\r\n\r\nexport function AssetsSelectionTable(props: AssetsSelectionTableProps) {\r\n const {\r\n useSidePanel,\r\n authenticatedUser,\r\n setFilters,\r\n isRowSelectable,\r\n getRequiredFilter,\r\n assets,\r\n primaryAction,\r\n primaryMultiAction,\r\n screenName,\r\n multiModeDisabled,\r\n // openAsset,\r\n useRecentAssets,\r\n RecentAssets,\r\n actionType,\r\n customPredicates,\r\n isShortView = false,\r\n emptyTable,\r\n searchTerm,\r\n } = props;\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const showAllCores = useSelector(selectShowAllCores);\r\n const isMobile = DetectIsMobile();\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const roomsEnabled = settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.RoomUserRoleEnabled],\r\n );\r\n const canExportAssetRanges = IsAssetFieldEnabled(\r\n appSettings,\r\n AssetAttributes.Range,\r\n );\r\n const assetFieldEnabled = React.useCallback(\r\n (AssetField: AssetAttributes): boolean => {\r\n if (isAuthenticated) {\r\n return IsAssetFieldEnabled(appSettings, AssetField);\r\n } else {\r\n return (\r\n IsAssetFieldEnabled(appSettings, AssetField) &&\r\n IsAssetFieldIsPublic(appSettings, AssetField)\r\n );\r\n }\r\n },\r\n [appSettings, isAuthenticated],\r\n );\r\n const searchColumns = React.useMemo(() => {\r\n let result: string[] = [\r\n 'Name',\r\n 'AvailabilityTypeName',\r\n 'DivisionName',\r\n 'ServiceGroupName',\r\n 'InstrumentType',\r\n //'RoomAreaName',\r\n //'InstrumentCatName',\r\n ];\r\n if (assetFieldEnabled(AssetAttributes.Building)) {\r\n result.push('Building');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Room)) {\r\n result.push('Room');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AssetCat)) {\r\n result.push('AssetCatName');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.LocationsList)) {\r\n result.push('LocationName');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.SubLocationsList)) {\r\n result.push('SubLocationName');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AssetCatGroup)) {\r\n result.push('AssetCatGroupName');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.POnumber)) {\r\n result.push('POnumber');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AssetAccessories)) {\r\n result.push('AccessoriesText');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Contacts)) {\r\n result.push('ContactsText');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Experts)) {\r\n result.push('ExpertsText');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Suppliers)) {\r\n result.push('SuppliersText');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.OtherNames)) {\r\n result.push('OtherNames');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Brand)) {\r\n result.push('Brand');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Description)) {\r\n result.push('Description');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ShortDescription)) {\r\n result.push('ShortDescription');\r\n }\r\n\r\n if (assetFieldEnabled(AssetAttributes.ServiceContract)) {\r\n result.push('ServiceContract');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Campus)) {\r\n result.push('Campus');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Tags)) {\r\n result.push('TagsText');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.MainSpecRange)) {\r\n result.push('MainSpecRange');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AccountingId)) {\r\n result.push('AccountingId');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ModelNumber)) {\r\n result.push('ModelNumber');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.FunctionalCharacteristics)) {\r\n result.push('FunctionalCharacteristics');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.WebLink)) {\r\n result.push('WebLink');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.Model)) {\r\n result.push('Model');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL0)) {\r\n result.push('ExtraDDL0Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL1)) {\r\n result.push('ExtraDDL1Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL2)) {\r\n result.push('ExtraDDL2Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL3)) {\r\n result.push('ExtraDDL3Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL4)) {\r\n result.push('ExtraDDL4Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL5)) {\r\n result.push('ExtraDDL5Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL6)) {\r\n result.push('ExtraDDL6Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL7)) {\r\n result.push('ExtraDDL7Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL8)) {\r\n result.push('ExtraDDL8Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL9)) {\r\n result.push('ExtraDDL9Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL10)) {\r\n result.push('ExtraDDL10Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL11)) {\r\n result.push('ExtraDDL11Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL12)) {\r\n result.push('ExtraDDL12Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL13)) {\r\n result.push('ExtraDDL13Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL14)) {\r\n result.push('ExtraDDL14Value');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL15)) {\r\n result.push('ExtraDDL15Value');\r\n }\r\n return result;\r\n }, [assetFieldEnabled]);\r\n\r\n const additionalColumns = React.useMemo(() => {\r\n let result: string[] = [\r\n 'Id',\r\n 'ServiceId',\r\n 'AvailabilityTypeId',\r\n 'ServiceGroupId',\r\n 'ServiceTypeId',\r\n 'AutoMode',\r\n 'AvailabilityTypeName',\r\n 'TrainingSessionsEnabled',\r\n 'HideProjects',\r\n 'AllowToUser',\r\n 'StaffOnly',\r\n 'AssetCatId',\r\n 'AssetCatGroupId',\r\n 'BuildingId',\r\n 'FloorName',\r\n 'RoomAreaId',\r\n 'RegionId',\r\n 'RemoteControlEnabled',\r\n ];\r\n if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n result.push('DivisionAssetId');\r\n result.push('DivisionId');\r\n result.push('RegionId');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AssetCat)) {\r\n result.push('AssetCatId');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.AssetCatGroup)) {\r\n result.push('AssetCatGroupId');\r\n }\r\n\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL0)) {\r\n result.push('ExtraDDL0');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL1)) {\r\n result.push('ExtraDDL1');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL2)) {\r\n result.push('ExtraDDL2');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL3)) {\r\n result.push('ExtraDDL3');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL4)) {\r\n result.push('ExtraDDL4');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL5)) {\r\n result.push('ExtraDDL5');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL6)) {\r\n result.push('ExtraDDL6');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL7)) {\r\n result.push('ExtraDDL7');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL8)) {\r\n result.push('ExtraDDL8');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL9)) {\r\n result.push('ExtraDDL9');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL10)) {\r\n result.push('ExtraDDL10');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL11)) {\r\n result.push('ExtraDDL11');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL12)) {\r\n result.push('ExtraDDL12');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL13)) {\r\n result.push('ExtraDDL13');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL14)) {\r\n result.push('ExtraDDL14');\r\n }\r\n if (assetFieldEnabled(AssetAttributes.ExtraDDL15)) {\r\n result.push('ExtraDDL15');\r\n }\r\n return result;\r\n }, [appSettings, assetFieldEnabled]);\r\n const [multiAssetSelectionMode, setMultiAssetSelectionMode] = React.useState<\r\n boolean\r\n >(false);\r\n const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n Record, boolean>\r\n >({});\r\n const [, setCurrentMode, currentModeRef] = useState('card');\r\n const [loacalAssets, setLoacalAssets, localAssetsRef] = useState<\r\n Entity[]\r\n >([]);\r\n React.useEffect(() => {\r\n let obj = {};\r\n if (!!assets && assets.length > 0) {\r\n for (const key of assets) {\r\n obj[key.Id] = true;\r\n }\r\n setMultiAssetSelectionMode(assets.length > 1);\r\n setLoacalAssets(assets);\r\n }\r\n setSelectedRowIds(obj);\r\n }, [assets, setLoacalAssets]);\r\n\r\n function getMyListFilter(search: string, selectedView: SavedViewSelected) {\r\n const result = isEmptyOrWhitespace(search)\r\n ? new URLSearchParams()\r\n : new URLSearchParams(search);\r\n result.set('aid', selectedView.assetIds || '');\r\n const res = result.toString();\r\n return isEmptyOrWhitespace(res) ? undefined : res;\r\n }\r\n\r\n const columns: Column[] = React.useMemo(\r\n () => getColumns(t, authenticatedUser, appSettings, settings),\r\n [t, authenticatedUser, appSettings, settings],\r\n );\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Name', desc: false }],\r\n selectedRowIds: selectedRowIds,\r\n globalFilter: searchTerm,\r\n }),\r\n [searchTerm, selectedRowIds],\r\n );\r\n // const selectedRowActions: SelectedRowsActionRenderer<\r\n // IMyAssetsRow\r\n // >[] = GetSelectedActions(t, {\r\n // enableSavedLists: false,\r\n // canExport: false,\r\n // canExportAssetRanges: false,\r\n // });\r\n const selectedRowActions: SelectedRowsActionExtRenderer<\r\n IMyAssetsRow\r\n >[] = React.useMemo(() => {\r\n let actions: SelectedRowsActionExtRenderer[] =\r\n loacalAssets.length > 0\r\n ? loacalAssets.map(\r\n sg => (selectedRws, rows, refresh, toggleAll, toggleSingle) => (\r\n f.id === sg.Id.toString()).length > 0\r\n ? undefined\r\n : t(translations.DeleteSelectedCard_info)\r\n }\r\n onDelete={() => {\r\n onSelectChange(\r\n selectedRws.filter(f => f.Id === sg.Id)[0],\r\n false,\r\n );\r\n rows\r\n .filter(f => f.id === sg.Id.toString())\r\n .forEach(f => {\r\n f.toggleRowSelected(false);\r\n });\r\n //toggleSingle(sg.Id.toString(), false);\r\n }}\r\n disabled={\r\n !(rows.filter(f => f.id === sg.Id.toString()).length > 0)\r\n }\r\n // onClick={() => {\r\n // openAsset(sg.Id);\r\n // }}\r\n variant=\"default\"\r\n customsize={isShortView ? 'small' : 'medium'}\r\n label={sg.Name}\r\n customwidth={isShortView ? 100 : 180}\r\n custombgcolor={bookitColors.primary.disabled}\r\n customcolor={bookitColors.grayscale.blackComponents}\r\n customiconcolor={bookitColors.grayscale.blackComponents}\r\n shape=\"circle\"\r\n key={sg.Id}\r\n />\r\n ),\r\n )\r\n : [];\r\n return actions;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [isShortView, loacalAssets]);\r\n\r\n const selectedRowDefaultActions: SelectedRowsActionRenderer<\r\n IMyAssetsRow\r\n >[] = GetSelectedActions(t, {\r\n enableSavedLists: isAuthenticated,\r\n canExportAssetRanges: canExportAssetRanges,\r\n isShowAllCores: showAllCores,\r\n authenticatedUser: authenticatedUser,\r\n useSidePanel: useSidePanel,\r\n });\r\n const handleRowsChange = (rows: Row[]) => {\r\n let selectable = rows.map(f => {\r\n return {\r\n Id: f.original.Id,\r\n Name: f.original.Name,\r\n } as Entity;\r\n });\r\n setLoacalAssets(selectable);\r\n };\r\n const toggleAllRows = (rows: Row[], checked: boolean) => {\r\n if (checked) {\r\n handleRowsChange(rows);\r\n } else {\r\n handleRowsChange([]);\r\n }\r\n };\r\n const handleSingleChange = React.useCallback(\r\n (value: Entity, added: boolean) => {\r\n if (added) {\r\n if (\r\n !!localAssetsRef.current &&\r\n localAssetsRef.current.length + 1 >\r\n (currentModeRef.current === 'card' ? 0 : 0)\r\n ) {\r\n setMultiAssetSelectionMode(true);\r\n }\r\n setLoacalAssets(oldAssets => [\r\n ...oldAssets,\r\n {\r\n Id: value.Id,\r\n Name: value.Name,\r\n } as Entity,\r\n ]);\r\n } else {\r\n if (\r\n !!localAssetsRef.current &&\r\n localAssetsRef.current.length - 1 <\r\n (currentModeRef.current === 'card' ? 1 : 1)\r\n ) {\r\n setMultiAssetSelectionMode(false);\r\n }\r\n setLoacalAssets(oldAssets => {\r\n let newAsset = oldAssets.filter(ass => ass.Id !== value.Id);\r\n return newAsset;\r\n });\r\n }\r\n },\r\n [currentModeRef, localAssetsRef, setLoacalAssets],\r\n );\r\n const onSelectChange = React.useCallback(\r\n (row: IMyAssetsRow, checked: boolean) => {\r\n handleSingleChange(\r\n {\r\n Id: row.Id,\r\n Name: row.Name,\r\n } as Entity,\r\n checked,\r\n );\r\n },\r\n [handleSingleChange],\r\n );\r\n const customFilter = React.useMemo(() => {\r\n let filter: (string | Condition)[] = customPredicates ?? [];\r\n if (actionType === 'StartUsage') {\r\n filter.push(\r\n new Condition('AutoMode', ODataOperators.Equals, 1),\r\n );\r\n filter.push(getOnlineServiceTypeAssetFilter(appSettings, roomsEnabled));\r\n }\r\n if (actionType === 'TrainingSession') {\r\n filter.push(\r\n new Condition(\r\n 'TrainingSessionsEnabled',\r\n ODataOperators.Equals,\r\n true,\r\n ),\r\n );\r\n }\r\n return filter.length > 0 ? filter : undefined;\r\n }, [actionType, appSettings, customPredicates, roomsEnabled]);\r\n const useFloatingActions = React.useMemo(() => {\r\n return multiAssetSelectionMode\r\n ? loacalAssets.length > 0\r\n : loacalAssets.length > 1;\r\n }, [loacalAssets.length, multiAssetSelectionMode]);\r\n\r\n const url = '/api/odata/v4/MyAssets';\r\n const { serviceGroups } = useGlobalServiceGroupsFilter(!showAllCores);\r\n const TTable = React.useMemo(\r\n () =>\r\n filterHandler(BasicTable, GetFilters, {\r\n isSidePanel: useSidePanel,\r\n setFilters: setFilters,\r\n reservedQueryStringParameterNames: ['active'],\r\n getDefaultFilter: DefaultFilter,\r\n getRequiredFilter: getRequiredFilter,\r\n getSelectedViewFilter: getMyListFilter,\r\n enableSavedLists: true,\r\n }),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [useSidePanel],\r\n );\r\n return (\r\n \r\n setCurrentMode(mode === true ? 'card' : 'table')}\r\n primaryAction={row => {\r\n let canSwitch = isRowSelectable(row);\r\n if (!multiAssetSelectionMode) {\r\n if (canSwitch) {\r\n primaryAction?.(row);\r\n }\r\n } else {\r\n if (canSwitch) {\r\n row.toggleRowSelected(!row.isSelected);\r\n onSelectChange(row.original, !row.isSelected);\r\n }\r\n }\r\n }}\r\n savedListSettings={{\r\n enableSavedLists: isAuthenticated,\r\n savedListRelatedPickerName: 'Id',\r\n savedListSerializedKey: 'aid',\r\n listViewbyAsset: true,\r\n }}\r\n useConfigurable={actionType === 'AssetSearch'}\r\n useCardsByDefault={true}\r\n selectedRowsActions={\r\n actionType === 'AssetSearch' ? selectedRowDefaultActions : undefined\r\n }\r\n floatingTabSettings={{\r\n useFloatingActions:\r\n useFloatingActions && actionType !== 'AssetSearch',\r\n selectedFloatingActions: selectedRowActions,\r\n buttonFloatingActions: [\r\n rows => (\r\n {\r\n primaryMultiAction(rows);\r\n }}\r\n >\r\n {isShortView ? 'Continue' : 'Continue with Selected'}\r\n \r\n ),\r\n ],\r\n useSidePanel: useSidePanel,\r\n }}\r\n //pageActions={pageActions}\r\n useRowSelect={true}\r\n withToolBar={false}\r\n customEmptyTableSettings={emptyTable}\r\n tabSectionSettings={{\r\n useTabsSection: isAuthenticated,\r\n getMultiMode: value => setMultiAssetSelectionMode(value),\r\n selectedTabValue: undefined,\r\n onAllRowsSelected: toggleAllRows,\r\n disableMultiMode: multiModeDisabled,\r\n defaultMultiMode: !multiModeDisabled,\r\n // defaultMultiMode:\r\n // multiAssetSelectionMode === true ||\r\n // (!!localAssetsRef.current && localAssetsRef.current.length > 0),\r\n }}\r\n customToolbarSettings={{\r\n useCustomToolbar: useRecentAssets,\r\n CustomToolbar: RecentAssets,\r\n }}\r\n predicates={customFilter}\r\n preventInnerClicks={isMobile}\r\n />\r\n \r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\nimport { AssetsSelectionState } from './types';\r\n\r\nexport const initialState: AssetsSelectionState = {\r\n filters: undefined,\r\n loading: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'assetsSelection',\r\n initialState,\r\n reducers: {\r\n setFilters(state, action: PayloadAction | undefined>) {\r\n state.filters = action.payload;\r\n },\r\n setLoading(state, action: PayloadAction) {\r\n state.loading = action.payload;\r\n },\r\n reset(state, action: PayloadAction) {\r\n state.filters = undefined;\r\n state.loading = undefined;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: assetsSelectionActions } = slice;\r\n\r\nexport const useAssetsSelectionSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n // useInjectSaga({ key: slice.name, saga: assetsSelectionSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useAssetsSelectionSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.assetsSelection || initialState;\r\n\r\nexport const selectAssetsSelection = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectAssetsSelectionLoading = createSelector(\r\n [selectAssetsSelection],\r\n state => state.loading,\r\n);\r\n\r\nexport const selectAssetsSelectionFilters = createSelector(\r\n [selectAssetsSelection],\r\n state => state.filters,\r\n);\r\n","import { Box, Collapse, useTheme } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AssetQuickSearchDetails } from 'app/components/AssetQuickSearch/slice/types';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Body } from 'app/components/Typography';\r\nimport { BasicCard } from 'app/components/BasicCards';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AssetActionType } from './AssetsSelection';\r\nimport * as React from 'react';\r\nimport { IsAssetImageExist } from 'types/AppSettings';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\n\r\nexport interface RecentAssetsProps {\r\n actionType: AssetActionType;\r\n primaryAction?: (row: AssetQuickSearchDetails) => void;\r\n useSidePanel?: boolean;\r\n shortView?: boolean;\r\n}\r\nconst RecentContent = styled('div')(({ theme }) => ({\r\n '&.recentRoot': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n width: '100%',\r\n gap: 16,\r\n '& .recentTitle': {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n gap: 8,\r\n },\r\n '& .recentContainer': {\r\n width: '100%',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '32px',\r\n '&.recentShort': {\r\n flexDirection: 'column',\r\n alignItems: 'start',\r\n gap: '16px',\r\n '& .recentItem': {\r\n flex: '1 1 100%',\r\n maxWidth: '100%',\r\n width: '100%',\r\n '& .nameOverRule': {\r\n maxWidth: '25ch',\r\n },\r\n },\r\n },\r\n '& .recentItem': {\r\n flex: '1 1 10%',\r\n borderRadius: 8,\r\n width: 0,\r\n minWidth: '256px',\r\n maxWidth: '360px',\r\n '& .nameOverRule': {\r\n display: 'inline-block',\r\n whiteSpace: 'pre',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '30ch',\r\n // [theme.breakpoints.down('sm')]: {\r\n // maxWidth: '25ch',\r\n // },\r\n },\r\n },\r\n },\r\n },\r\n}));\r\nexport function RecentAssets(props: RecentAssetsProps) {\r\n const { actionType, primaryAction, shortView } = props;\r\n const isMobile = DetectIsMobile();\r\n const appSettings = useSelector(selectAppSettings);\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n const [collapseOpen, setCollapseOpen] = React.useState(\r\n shortView ? false : true,\r\n );\r\n React.useEffect(() => {\r\n setCollapseOpen(shortView ? false : true);\r\n }, [shortView]);\r\n const fetchRecentAssets = async (\r\n type: AssetActionType,\r\n ): Promise => {\r\n let url =\r\n actionType === 'WorkOrder'\r\n ? '/api/assets/recentReported?top=5'\r\n : actionType === 'StartUsage'\r\n ? '/api/assets/recentUsed?top=5'\r\n : '/api/assets/recentBook?top=5';\r\n return new Promise(async resolve => {\r\n try {\r\n const data = await httpClient.get(url);\r\n let result = data as AssetQuickSearchDetails[];\r\n if (data.length > 0) {\r\n resolve(result);\r\n } else {\r\n resolve([] as AssetQuickSearchDetails[]);\r\n }\r\n } catch {\r\n resolve([] as AssetQuickSearchDetails[]);\r\n }\r\n });\r\n };\r\n const [recentAssets, setRecentAssets] = useAsyncExtendedState<\r\n AssetQuickSearchDetails[]\r\n >([]);\r\n const [fetchRecentAssetsState, fetchRecentAssetsPromise] = usePromise(\r\n fetchRecentAssets,\r\n );\r\n useEffectOnMount(() => {\r\n setRecentAssets(fetchRecentAssetsPromise(actionType));\r\n });\r\n return recentAssets.length > 0 &&\r\n fetchRecentAssetsState.status === 'resolved' ? (\r\n \r\n
    \r\n \r\n \r\n {t(translations.RecentAssets)}\r\n \r\n setCollapseOpen(previousState => !previousState)}\r\n >\r\n \r\n \r\n
    \r\n \r\n \r\n {recentAssets.map(item => {\r\n return (\r\n
    \r\n \r\n \r\n {item.Name}\r\n \r\n \r\n }\r\n imageSrc={getAssetImageThumbSrc(\r\n item.Image || null,\r\n 'thumb',\r\n IsAssetImageExist(appSettings, item.Image || null, 'thumb'),\r\n )}\r\n useImage={true}\r\n maxContentHeight={20}\r\n useButtons={false}\r\n primaryAction={() => !!primaryAction && primaryAction(item)}\r\n backStyle=\"white\"\r\n />\r\n
    \r\n );\r\n })}\r\n
    \r\n \r\n \r\n ) : (\r\n <>\r\n );\r\n}\r\n","import { AssetQuickSearchDetails } from 'app/components/AssetQuickSearch/slice/types';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { CreateNewRequest } from 'app/pages/ServiceRequestListPage/CreateNewRequest';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectIsAuthenticated,\r\n selectPublicUrl,\r\n selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Row } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { getRequiredFilter } from '../DefaultFilter';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { AssetsSelectionTable } from './AssetsSelectionTable';\r\nimport { useAssetsSelectionSlice } from './slice';\r\nimport { selectAssetsSelectionFilters } from './slice/selectors';\r\nimport { useAddNewActions } from './useAddNewActions';\r\nimport { RecentAssets } from './RecentAssets';\r\nimport { useSchedulerSlice } from 'app/pages/CalendarPage/Scheduler/slice';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AdminActions } from 'app/components/Admin/AdminActions';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport type AssetActionType =\r\n | 'Reservation'\r\n | 'WorkOrder'\r\n | 'OfflineService'\r\n | 'Request'\r\n | 'StartUsage'\r\n | 'TrainingSession'\r\n | 'AssetSearch';\r\nexport interface AssetsSelectionProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n assetIds?: number[];\r\n serviceIds?: number[];\r\n offTypeIds?: number[];\r\n requestTypeIds?: number[];\r\n actionType?: AssetActionType;\r\n customPredicates?: (string | Condition)[];\r\n pageLink?: string;\r\n onClose?: () => void;\r\n useCustomFilter?: boolean;\r\n customAppliedFilters?: IFilterSettings[];\r\n customAvailableFilters?: IFilterSettings[];\r\n customFilterChange?: (items: IFilterSettings[]) => void;\r\n serviceTypeId?: number;\r\n assetCatId?: number;\r\n assetCatGroupId?: number;\r\n searchTerm?: string;\r\n hideCoresToggle?: boolean;\r\n}\r\n\r\nexport function AssetsSelection(props: AssetsSelectionProps) {\r\n const {\r\n useSidePanel,\r\n actionType = 'AssetSearch',\r\n assetIds,\r\n serviceIds,\r\n offTypeIds,\r\n requestTypeIds,\r\n customPredicates,\r\n onClose,\r\n serviceTypeId,\r\n searchTerm,\r\n hideCoresToggle,\r\n assetCatId,\r\n assetCatGroupId,\r\n closeCover,\r\n // useCustomFilter,\r\n // customAppliedFilters,\r\n // customAvailableFilters,\r\n // customFilterChange\r\n } = props;\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const filters = useSelector(selectAssetsSelectionFilters);\r\n const showAllCores = useSelector(selectShowAllCores);\r\n //const hideNavigation = useSelector(selectHideNavigation);\r\n const dispatch = useDispatch();\r\n const { actions } = useAssetsSelectionSlice();\r\n const { t } = useTranslation();\r\n const { actions: appSettingsAction } = useAppSettingsSlice();\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const isMobile = DetectIsMobile();\r\n // const [cover, setCover] = React.useState();\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState();\r\n const [openRequest, setOpenRequest] = React.useState(\r\n undefined,\r\n );\r\n const [requestId, setRequestId] = React.useState(\r\n undefined,\r\n );\r\n const [selectedAssets, setSelectedAssets] = React.useState[]>(\r\n [],\r\n );\r\n const showShortView =\r\n isMobile || (useSidePanel && !sidePanelExpanded) || props.isCover;\r\n const { actions: schedActions } = useSchedulerSlice();\r\n // const multipleMode = useSelector(selectMultipleModeState);\r\n const pagelink = React.useMemo(\r\n () =>\r\n !!props.pageLink\r\n ? props.pageLink\r\n : buildURL(\r\n `${publicUrl}AssetSearch`,\r\n Object.assign({}, filters, {\r\n serviceTypeId: serviceTypeId,\r\n searchTerm: searchTerm,\r\n actionType: actionType,\r\n AssetCatGroupId: assetCatGroupId,\r\n AssetCatId: assetCatId,\r\n }),\r\n ),\r\n [\r\n actionType,\r\n assetCatGroupId,\r\n assetCatId,\r\n filters,\r\n props.pageLink,\r\n publicUrl,\r\n searchTerm,\r\n serviceTypeId,\r\n ],\r\n );\r\n // const closeCover = () => {\r\n // setCover(undefined);\r\n // };\r\n\r\n const closeSidePanel = React.useCallback(() => {\r\n closePanel({\r\n isCover: props.isCover,\r\n useSidePanel: true,\r\n onClose: () => {\r\n if (hideCoresToggle) {\r\n dispatch(appSettingsAction.setShowAllCores(false));\r\n }\r\n },\r\n } as SidePanelCloseState);\r\n // if (props.isCover) {\r\n // if (!!onClose) {\r\n // onClose();\r\n // } else {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // }\r\n // if (hideCoresToggle) {\r\n // dispatch(appSettingsAction.setShowAllCores(false));\r\n // }\r\n // } else {\r\n // dispatch(layoutActions.resetSidePanel());\r\n // if (hideCoresToggle) {\r\n // dispatch(appSettingsAction.setShowAllCores(false));\r\n // }\r\n // }\r\n }, [appSettingsAction, closePanel, dispatch, hideCoresToggle, props.isCover]);\r\n const openAsset = React.useCallback(\r\n (id: number) => {\r\n let assetProps = {\r\n identifier: {\r\n id: id,\r\n },\r\n showAllCores: showAllCores,\r\n useSidePanel: true,\r\n };\r\n openPanel({\r\n renderPageType: RenderPageType.AssetDetails,\r\n renderPageProps: assetProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [openPanel, showAllCores, useSidePanel],\r\n );\r\n // const saveCalendarMultiMode = React.useCallback((value: boolean) => {\r\n // dispatch(\r\n // appSettingsAction.updateUserProfileSettings({\r\n // key: 'BookMultipleInstruments',\r\n // model: {\r\n // UserName: authenticatedUser?.Id,\r\n // Key: 'BookMultipleInstruments',\r\n // IsMultiple: value,\r\n // } as UserProfileSettings,\r\n // }),\r\n // );\r\n // }, [appSettingsAction, authenticatedUser?.Id, dispatch]);\r\n const IsAdmin = React.useCallback(\r\n (asset: IMyAssetsRow) => {\r\n return isAuthenticated\r\n ? authenticatedUser?.IsAllGroupOrLabTechAdmin(\r\n [asset.ServiceGroupId ?? 0],\r\n [\r\n {\r\n Id: asset.ServiceId,\r\n Name: asset.Name,\r\n ServiceTypeId: asset.ServiceTypeId,\r\n } as IServiceTypeFilterDto,\r\n ],\r\n )\r\n : false;\r\n },\r\n [isAuthenticated, authenticatedUser],\r\n );\r\n const isRowSelectable = (row: Row): boolean => {\r\n if (actionType === 'OfflineService') {\r\n return (\r\n IsAdmin(row.original) ||\r\n (row.original.AllowToUser === true && row.original.StaffOnly !== true)\r\n );\r\n }\r\n return true;\r\n };\r\n const {\r\n createOffline,\r\n createReservation,\r\n createWorkOrder,\r\n startUsage,\r\n addTrainingSession,\r\n } = useAddNewActions();\r\n const allowMultiToggle = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'Reservation':\r\n case 'WorkOrder':\r\n case 'OfflineService':\r\n return true;\r\n case 'Request':\r\n case 'StartUsage':\r\n case 'TrainingSession':\r\n case 'AssetSearch':\r\n default:\r\n return false;\r\n }\r\n }, [actionType]);\r\n const allowAllCoresToggle = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'AssetSearch':\r\n return !hideCoresToggle;\r\n case 'Request':\r\n case 'StartUsage':\r\n case 'TrainingSession':\r\n case 'Reservation':\r\n case 'WorkOrder':\r\n case 'OfflineService':\r\n default:\r\n return false;\r\n }\r\n }, [actionType, hideCoresToggle]);\r\n const setfilterCallback = React.useCallback(\r\n (v: IFilterSettings[] | undefined) => {\r\n const res = {};\r\n if (!!v) {\r\n toURLSearchParams(v).forEach((val, name) => {\r\n res[name] = val;\r\n });\r\n }\r\n dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n },\r\n [actions, dispatch],\r\n );\r\n const availabilityTypesArray = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'Reservation':\r\n case 'StartUsage':\r\n return [\r\n AvailabilityTypes.FreelyBookable as number,\r\n AvailabilityTypes.TrainingProgram as number,\r\n AvailabilityTypes.LoanableEquipment as number,\r\n AvailabilityTypes.LectureRoom as number,\r\n ];\r\n case 'OfflineService':\r\n return [AvailabilityTypes.ServiceRelated as number];\r\n case 'Request':\r\n return [AvailabilityTypes.RequestRelated as number];\r\n case 'WorkOrder':\r\n return [\r\n AvailabilityTypes.FreelyBookable as number,\r\n AvailabilityTypes.TrainingProgram as number,\r\n AvailabilityTypes.LoanableEquipment as number,\r\n AvailabilityTypes.LectureRoom as number,\r\n AvailabilityTypes.ServiceRelated as number,\r\n AvailabilityTypes.RequestRelated as number,\r\n ];\r\n case 'TrainingSession':\r\n return [\r\n AvailabilityTypes.FreelyBookable as number,\r\n AvailabilityTypes.TrainingProgram as number,\r\n AvailabilityTypes.LoanableEquipment as number,\r\n AvailabilityTypes.LectureRoom as number,\r\n ];\r\n // case 'AssetSearch':\r\n // if (!!serviceTypeId) {\r\n // switch (serviceTypeId) {\r\n // case ServiceType.Online:\r\n // return [\r\n // AvailabilityTypes.FreelyBookableBillable as number,\r\n // AvailabilityTypes.ApprovalRequiredBillable as number,\r\n // AvailabilityTypes.FreelyBookable as number,\r\n // AvailabilityTypes.BookableWApproval as number,\r\n // AvailabilityTypes.TrainingProgram as number,\r\n // AvailabilityTypes.LoanableEquipment as number,\r\n // AvailabilityTypes.LectureRoom as number,\r\n // ];\r\n // case ServiceType.Offline:\r\n // return [AvailabilityTypes.ServiceRelated as number];\r\n // case ServiceType.Sample:\r\n // return [AvailabilityTypes.RequestRelated as number];\r\n // default:\r\n // return [];\r\n // }\r\n // }\r\n // return [];\r\n default:\r\n return [];\r\n }\r\n }, [actionType]);\r\n const screenName = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'Reservation':\r\n return t(translations.CreateReservation) as string;\r\n case 'StartUsage':\r\n return t(translations.StartUsage) as string;\r\n case 'OfflineService':\r\n return t(translations.SelectConsumables) as string;\r\n case 'Request':\r\n return t(translations.CreateRequest) as string;\r\n case 'WorkOrder':\r\n return t(translations.CreateAWorkOrder) as string;\r\n case 'TrainingSession':\r\n return t(translations.AddTrainingSession);\r\n case 'AssetSearch':\r\n return t(translations.InstrumentAssetSearch) as string;\r\n default:\r\n return t(translations.CreateReservation) as string;\r\n }\r\n }, [actionType, t]);\r\n const noTableData = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'OfflineService':\r\n return {\r\n headTitle: t(translations.NoConsumablesHeadTitle) as string,\r\n title: t(translations.NoConsumablesTitle) as string,\r\n } as CustomEmptyTableProps;\r\n case 'Reservation':\r\n case 'StartUsage':\r\n case 'Request':\r\n case 'WorkOrder':\r\n case 'TrainingSession':\r\n default:\r\n return undefined;\r\n }\r\n }, [actionType, t]);\r\n const requiredFilter = (search: string) => {\r\n const result = new URLSearchParams(getRequiredFilter(search));\r\n if (availabilityTypesArray.length > 0) {\r\n if (\r\n result.has('AvailabilityTypeId') === false ||\r\n result.get('AvailabilityTypeId') === null ||\r\n result.get('AvailabilityTypeId') === ''\r\n ) {\r\n result.set('AvailabilityTypeId', availabilityTypesArray.join('|'));\r\n }\r\n }\r\n if (!!serviceTypeId) {\r\n if (\r\n result.has('stid') === false ||\r\n result.get('stid') === null ||\r\n result.get('stid') === ''\r\n ) {\r\n result.set('stid', serviceTypeId.toString());\r\n }\r\n }\r\n const res = result.toString();\r\n return isEmptyOrWhitespace(res) ? undefined : res;\r\n };\r\n const primaryRecentAction = React.useCallback(\r\n (row: AssetQuickSearchDetails) => {\r\n if (actionType === 'Reservation') {\r\n dispatch(schedActions.updateMultiMode(false));\r\n setTimeout(\r\n () =>\r\n createReservation(row.ServiceId !== null ? [row.ServiceId] : []),\r\n 10,\r\n );\r\n if (useSidePanel) {\r\n closeSidePanel();\r\n }\r\n } else if (actionType === 'WorkOrder') {\r\n createWorkOrder([row.Id], useSidePanel);\r\n if (useSidePanel) {\r\n closeSidePanel();\r\n }\r\n } else if (actionType === 'StartUsage') {\r\n startUsage(row.ServiceId ?? 0);\r\n if (useSidePanel) {\r\n closeSidePanel();\r\n }\r\n } else if (actionType === 'AssetSearch') {\r\n openAsset(row.Id);\r\n }\r\n },\r\n [\r\n actionType,\r\n closeSidePanel,\r\n createReservation,\r\n createWorkOrder,\r\n dispatch,\r\n openAsset,\r\n schedActions,\r\n startUsage,\r\n useSidePanel,\r\n ],\r\n );\r\n const primaryAction = React.useCallback(\r\n (row: Row) => {\r\n if (\r\n availabilityTypesArray.includes(row.original.AvailabilityTypeId) ||\r\n actionType === 'AssetSearch'\r\n ) {\r\n if (useSidePanel && !(actionType === 'AssetSearch')) {\r\n closeSidePanel();\r\n }\r\n switch (actionType) {\r\n case 'Reservation':\r\n dispatch(schedActions.updateMultiMode(false));\r\n setTimeout(\r\n () =>\r\n createReservation(\r\n row.original.ServiceId !== null\r\n ? [row.original.ServiceId]\r\n : [],\r\n ),\r\n 10,\r\n );\r\n break;\r\n case 'OfflineService':\r\n createOffline(\r\n row.original.ServiceId !== null ? [row.original.ServiceId] : [],\r\n false,\r\n );\r\n break;\r\n case 'StartUsage':\r\n startUsage(row.original.ServiceId ?? 0);\r\n break;\r\n case 'WorkOrder':\r\n createWorkOrder([row.original.Id], useSidePanel);\r\n break;\r\n case 'Request':\r\n setRequestId(row.original.ServiceId ?? undefined);\r\n setOpenRequest(true);\r\n break;\r\n case 'TrainingSession':\r\n addTrainingSession(row.original.ServiceId as number);\r\n break;\r\n case 'AssetSearch':\r\n openAsset(row.original.Id);\r\n break;\r\n }\r\n } else {\r\n dispatch(\r\n appSettingsAction.addNotification({\r\n key: 'availability_error',\r\n message: `Can not perform this action for resource with Availability Type ${row.original.AvailabilityTypeName}.\r\n Please change filters and try again.`,\r\n variant: 'error',\r\n persist: true,\r\n }),\r\n );\r\n }\r\n },\r\n [\r\n actionType,\r\n addTrainingSession,\r\n appSettingsAction,\r\n availabilityTypesArray,\r\n closeSidePanel,\r\n createOffline,\r\n createReservation,\r\n createWorkOrder,\r\n dispatch,\r\n openAsset,\r\n schedActions,\r\n startUsage,\r\n useSidePanel,\r\n ],\r\n );\r\n const primaryMultiAction = React.useCallback(\r\n (rows: IMyAssetsRow[]) => {\r\n if (\r\n !rows.some(f => availabilityTypesArray.includes(f.AvailabilityTypeId))\r\n ) {\r\n let notAvailable = rows\r\n .filter(f => !availabilityTypesArray.includes(f.AvailabilityTypeId))\r\n .map(f => f.AvailabilityTypeName);\r\n dispatch(\r\n appSettingsAction.addNotification({\r\n key: 'availability_error',\r\n message: `Can not perform this action for resources with Availability Type ${notAvailable.join(\r\n `, `,\r\n )}.\r\n Please change filters and try again.`,\r\n variant: 'error',\r\n persist: true,\r\n }),\r\n );\r\n } else {\r\n switch (actionType) {\r\n case 'Reservation':\r\n dispatch(schedActions.updateMultiMode(true));\r\n setTimeout(\r\n () =>\r\n createReservation(\r\n rows.map(f => f.ServiceId ?? 0).filter(f => f > 0),\r\n true,\r\n ),\r\n 10,\r\n );\r\n break;\r\n case 'OfflineService':\r\n //if (rows.length === 1) {\r\n createOffline(\r\n rows.map(f => f.ServiceId ?? 0).filter(f => f > 0),\r\n true,\r\n );\r\n // } else {\r\n // dispatch(\r\n // appSettingsAction.addNotification({\r\n // key: 'multiSelect_error',\r\n // message:\r\n // 'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n // variant: 'error',\r\n // }),\r\n // );\r\n // }\r\n break;\r\n case 'StartUsage':\r\n if (rows.length === 1) {\r\n startUsage(rows[0].ServiceId ?? 0);\r\n } else {\r\n dispatch(\r\n appSettingsAction.addNotification({\r\n key: 'multiSelect_error',\r\n message:\r\n 'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n break;\r\n case 'TrainingSession':\r\n if (rows.length === 1) {\r\n addTrainingSession(rows[0].ServiceId ?? 0);\r\n } else {\r\n dispatch(\r\n appSettingsAction.addNotification({\r\n key: 'multiSelect_error',\r\n message:\r\n 'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n break;\r\n case 'WorkOrder':\r\n createWorkOrder(\r\n rows.map(f => f.Id),\r\n useSidePanel,\r\n );\r\n break;\r\n case 'Request':\r\n if (rows.length === 1) {\r\n setRequestId(rows[0].ServiceId ?? undefined);\r\n setOpenRequest(true);\r\n } else {\r\n dispatch(\r\n appSettingsAction.addNotification({\r\n key: 'multiSelect_error',\r\n message:\r\n 'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n break;\r\n }\r\n if (useSidePanel) {\r\n closeSidePanel();\r\n }\r\n }\r\n },\r\n [\r\n actionType,\r\n addTrainingSession,\r\n appSettingsAction,\r\n availabilityTypesArray,\r\n closeSidePanel,\r\n createOffline,\r\n createReservation,\r\n createWorkOrder,\r\n dispatch,\r\n schedActions,\r\n startUsage,\r\n useSidePanel,\r\n ],\r\n );\r\n const handleSearchAllCores = React.useCallback(\r\n (value: boolean) => {\r\n dispatch(appSettingsAction.setShowAllCores(value));\r\n //dispatch(layoutActions.setRefreshTable(true));\r\n },\r\n [appSettingsAction, dispatch],\r\n );\r\n const multiModeDisabled = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'Reservation':\r\n case 'WorkOrder':\r\n case 'TrainingSession':\r\n case 'OfflineService':\r\n case 'AssetSearch':\r\n return false;\r\n\r\n case 'Request':\r\n case 'StartUsage':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }, [actionType]);\r\n const useRecentAssets = React.useMemo(() => {\r\n switch (actionType) {\r\n case 'Reservation':\r\n case 'StartUsage':\r\n case 'WorkOrder':\r\n return !isMobile;\r\n case 'OfflineService':\r\n case 'Request':\r\n case 'TrainingSession':\r\n case 'AssetSearch':\r\n default:\r\n return false;\r\n }\r\n }, [actionType, isMobile]);\r\n const pageActions: ActionRenderer[] = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n if (allowAllCoresToggle) {\r\n actions.push(() => (\r\n handleSearchAllCores(value)}\r\n />\r\n ));\r\n }\r\n\r\n if (\r\n !isMobile &&\r\n actionType === 'AssetSearch' &&\r\n !!authenticatedUser &&\r\n (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n ) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n return actions;\r\n }, [\r\n actionType,\r\n allowAllCoresToggle,\r\n authenticatedUser,\r\n handleSearchAllCores,\r\n isMobile,\r\n showAllCores,\r\n t,\r\n ]);\r\n useEffectOnMount(() => {\r\n //dispatch(layoutActions.setUpSnackBarIndex(true));\r\n if (!!assetIds && assetIds.length > 0) {\r\n (async () => {\r\n try {\r\n const data = await initAssetsData(assetIds.join(','), false);\r\n setSelectedAssets(\r\n data.map(f => {\r\n return { Id: f.Id, Name: f.Name };\r\n }),\r\n );\r\n } catch {}\r\n })();\r\n } else if (!!serviceIds && serviceIds.length > 0) {\r\n (async () => {\r\n try {\r\n const data = await initAssetsData(serviceIds.join(','), true);\r\n setSelectedAssets(\r\n data.map(f => {\r\n return { Id: f.Id, Name: f.Name };\r\n }),\r\n );\r\n } catch {}\r\n })();\r\n } else if (!!offTypeIds && offTypeIds.length > 0) {\r\n (async () => {\r\n try {\r\n const data = await initAssetsData(offTypeIds.join(','), true, [\r\n { Id: 2 },\r\n ]);\r\n setSelectedAssets(\r\n data.map(f => {\r\n return { Id: f.Id, Name: f.Name };\r\n }),\r\n );\r\n } catch {}\r\n })();\r\n } else if (!!requestTypeIds && requestTypeIds.length > 0) {\r\n (async () => {\r\n try {\r\n const data = await initAssetsData(requestTypeIds.join(','), true, [\r\n { Id: 3 },\r\n ]);\r\n setSelectedAssets(\r\n data.map(f => {\r\n return { Id: f.Id, Name: f.Name };\r\n }),\r\n );\r\n } catch {}\r\n })();\r\n }\r\n return () => {\r\n //dispatch(layoutActions.setUpSnackBarIndex(false));\r\n };\r\n });\r\n return (\r\n {t(translations.menu_CoreSelection)}}\r\n titlePage={t(translations.menu_MyInstrumentsAssets)}\r\n closable={useSidePanel || props.isCover}\r\n //disableExpandToggle={true}\r\n //rightTopActions={topButtons}\r\n isCover={props.isCover}\r\n coverClosed={coverClosed}\r\n hideTitleBar={false}\r\n cover={cover}\r\n closeCover={!props.isCover ? onCloseCover : closeCover}\r\n closeSidePanel={props.isCover ? onClose : undefined}\r\n leftTopActions={pageActions}\r\n children={\r\n \r\n \r\n }\r\n actionType={actionType}\r\n />\r\n \r\n \r\n }\r\n />\r\n );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { useOfflineServiceStateSlice } from 'app/pages/OtherServiceDetails/Details/slice';\r\n\r\nexport function useAddNewActions() {\r\n const history = useHistory();\r\n const dispatch = useDispatch();\r\n const { newDate } = useSystemDate();\r\n const isMobile = DetectIsMobile();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: offActions } = useOfflineServiceStateSlice();\r\n const EnableLegacyScheduler = useSelector(\r\n selectGlobalDbSetting_EnableLegacyScheduler,\r\n );\r\n\r\n const createReservation = React.useCallback(\r\n (services: number[], multiple?: boolean) => {\r\n if (EnableLegacyScheduler) {\r\n window.open(\r\n toRootedURL('/Reservation.aspx', {\r\n id: services.join(','),\r\n }),\r\n '_blank',\r\n );\r\n return;\r\n }\r\n history.push(\r\n `/schedule/calendar?${toQueryString({\r\n eid: services.join(','),\r\n period: getPeriodTypesEntity(\r\n isMobile ? 'Today' : 'ThisWeek',\r\n ).Id.toString(),\r\n openToBook: true,\r\n defaultMulti: multiple,\r\n })}`,\r\n );\r\n },\r\n [EnableLegacyScheduler, history, isMobile],\r\n );\r\n const createWorkOrder = React.useCallback(\r\n (assetIds: number[], useSidePanel?: boolean) => {\r\n let p = {\r\n queryParams: {\r\n eqid: undefined,\r\n down: undefined,\r\n offH: undefined,\r\n eStart: dateUtils.formatQueryStringDate(newDate(), {\r\n representation: 'complete',\r\n }),\r\n offStart: undefined,\r\n offEnd: undefined,\r\n defaultMulti: undefined,\r\n source: undefined,\r\n id: undefined,\r\n aType: undefined,\r\n title: undefined,\r\n sympt: undefined,\r\n aStatus: undefined,\r\n aStart: undefined,\r\n desc: undefined,\r\n assetId: assetIds.join(','),\r\n reason: undefined,\r\n sid: undefined,\r\n Up: undefined,\r\n continueTo: 'edit',\r\n } as WorkOrderQueryStringParameters,\r\n useSidePanel: true,\r\n continueTo: 'edit',\r\n } as WorkOrderDetailsProps;\r\n if (useSidePanel) {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.WorkOrderDetails,\r\n props: p,\r\n }),\r\n );\r\n } else {\r\n history.push(`/workorders/details?${toQueryString(p.queryParams)}`);\r\n }\r\n },\r\n [dispatch, history, layoutActions, newDate],\r\n );\r\n // const createOffline = React.useCallback(\r\n // (serviceTypeId: number, useSidePanel?: boolean) => {\r\n // let params = {\r\n // useSidePanel: true,\r\n // queryParams: {\r\n // stid: serviceTypeId.toString(),\r\n // user: authuser?.Id,\r\n // },\r\n // } as OtherServiceDetailsProps;\r\n\r\n // if (useSidePanel) {\r\n // dispatch(\r\n // layoutActions.openSidePanel({\r\n // type: RenderPageType.OtherServiceDetails,\r\n // props: params,\r\n // }),\r\n // );\r\n // }\r\n // history.push(\r\n // `/otherServices/details?${toQueryString(params.queryParams)}`,\r\n // );\r\n // },\r\n // [authuser?.Id, dispatch, history, layoutActions],\r\n // );\r\n const createOffline = React.useCallback(\r\n (services: number[], multiple: boolean) => {\r\n dispatch(offActions.setSelectedServiceType(services));\r\n if (!multiple) {\r\n dispatch(offActions.setBarcodeScanned(true));\r\n }\r\n },\r\n [dispatch, offActions],\r\n );\r\n const addTrainingSession = React.useCallback((eqid: number) => {\r\n window.open(\r\n toRootedURL('/TrainingSession/AddNew.aspx', {\r\n eqid: eqid,\r\n }),\r\n '_blank',\r\n );\r\n }, []);\r\n const startUsage = React.useCallback((serviceId: number) => {\r\n window.open(\r\n toRootedURL('/Usage.aspx', {\r\n id: serviceId,\r\n }),\r\n '_blank',\r\n );\r\n }, []);\r\n return {\r\n createReservation,\r\n createWorkOrder,\r\n createOffline,\r\n startUsage,\r\n addTrainingSession,\r\n };\r\n}\r\n","/**\r\n *\r\n * BarcodeLogStatusPicker\r\n *\r\n */\r\n\r\nimport {\r\n BaseOptionsPicker,\r\n BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport i18next from 'i18next';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface BarcodeLogStatusPickerProps\r\n extends Omit>, 'getOptions'> {}\r\nconst Statuses = [\r\n 'Updated',\r\n 'Failed',\r\n 'RoomScanned',\r\n 'LocationScanned',\r\n 'SubLocationScanned',\r\n 'NoRoomAccess',\r\n];\r\nexport const initLogStatusesData = (\r\n initval: string | undefined,\r\n): Promise[]> => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve(\r\n Statuses.filter(item => {\r\n return item === initval;\r\n }).map(f => {\r\n return {\r\n Id: f,\r\n Name: i18next.t(f) as string,\r\n } as Entity;\r\n }),\r\n );\r\n });\r\n }\r\n};\r\n\r\nexport function BarcodeLogStatusPicker(props: BarcodeLogStatusPickerProps) {\r\n const { t } = useTranslation();\r\n const getOptions = (searchTerm: string | null) => {\r\n let items = Statuses.map(f => {\r\n return {\r\n Id: f,\r\n Name: t(f) as string,\r\n } as Entity;\r\n });\r\n\r\n if (searchTerm !== null && searchTerm !== '') {\r\n return items.filter(\r\n f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n );\r\n }\r\n return items;\r\n };\r\n return (\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * BarcodeLogStatusFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { BarcodeLogStatusPicker } from 'app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker';\r\n\r\nexport const BarcodeLogStatusFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: Entity | null) => {\r\n props.onChange(value);\r\n };\r\n\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default BarcodeLogStatusFilter;\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\n\r\nimport {\r\n arrayToQueryString,\r\n GetBooleanEntity,\r\n GetBooleanOrUndefined,\r\n getDefaultFilterDatePeriod,\r\n getNumberEntityArray,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetStringOrUndefined,\r\n initExPickerValue,\r\n initMultiPickerValue,\r\n initPickerValue,\r\n presetDatesRangeToQueryString,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\n\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { TextFieldFilter } from 'app/components/BasicTable/Filters';\r\nimport { initAssetMultiData } from 'app/components/pickers/AutocompletePickers/AssetMultiPicker';\r\nimport { AssetMultiFilter } from 'app/components/BasicTable/Filters/AssetMultiFilter';\r\nimport { initLocationData } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\nimport { LocationPickerFilter } from 'app/components/BasicTable/Filters/LocationPickerFilter';\r\nimport { SubLocationFilter } from 'app/components/BasicTable/Filters/SubLocationListFilter';\r\nimport { initSubLocationListData } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\n\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { initLogStatusesData } from 'app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker';\r\nimport BarcodeLogStatusFilter from 'app/components/BasicTable/Filters/BarcodeLogStatusFilter';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { Roles } from 'api/odata/generated/enums/Roles';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n const hideRoomFloor =\r\n tryParseBool(\r\n settings?.GetString(AllowedSettings.HideRoomFloorTextBoxes),\r\n ) === true;\r\n const isAdmin =\r\n user !== undefined &&\r\n user !== null &&\r\n (user?.Roles?.includes(Roles.Administrators) ||\r\n user?.Roles?.includes(Roles.InventoryAdmin));\r\n var result: IFilterSettings[] = [\r\n {\r\n fieldName: 'AssetId',\r\n queryStringSerializer: arrayToQueryString('aid'),\r\n displayName: t(translations.AssetName), //(displayed as Resource Name)\r\n operator: ODataOperators.Includes,\r\n value: getNumberEntityArray(params, 'aid'),\r\n initData: initMultiPickerValue(initAssetMultiData),\r\n component: AssetMultiFilter,\r\n urlKey: 'aid',\r\n },\r\n {\r\n fieldName: 'Date',\r\n displayName: t(translations.EntryDate),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromInitPreset(\r\n getPeriodTypesEntity('CustomDate'),\r\n dateUtils.addMonths(new Date(), -1),\r\n new Date(),\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n dateTimeClear: true,\r\n component: DatesRangeFilter,\r\n inversionDisabled: true,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'BuildingId',\r\n displayName: t(translations.BuildingName),\r\n queryStringSerializer: 'BuildingId',\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'BuildingId')),\r\n ),\r\n initData: initExPickerValue(\r\n initBuildingData,\r\n undefined,\r\n 'locations',\r\n true,\r\n ),\r\n component: BuildingPickerFilter,\r\n urlType: 'locations',\r\n },\r\n {\r\n fieldName: 'RoomId',\r\n displayName: t(translations.Room),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'roomId',\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'roomId')),\r\n ),\r\n initData: initExPickerValue(initRoomData, undefined, 'base', true),\r\n urlType: 'base',\r\n withoutServiceGroups: true,\r\n component: RoomPickerFilter,\r\n urlKey: 'roomId',\r\n },\r\n {\r\n fieldName: 'StatusName',\r\n queryStringSerializer: 'status',\r\n displayName: t(translations.StatusName),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'status')),\r\n ),\r\n initData: initPickerValue(initLogStatusesData),\r\n component: BarcodeLogStatusFilter,\r\n urlKey: 'status',\r\n },\r\n {\r\n fieldName: 'LocationId',\r\n queryStringSerializer: 'locationid',\r\n displayName: t(translations.LocationList),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'locationid')),\r\n ),\r\n initData: initPickerValue(initLocationData),\r\n component: LocationPickerFilter,\r\n },\r\n {\r\n fieldName: 'SubLocationId',\r\n queryStringSerializer: 'sublocationid',\r\n displayName: t(translations.SubLocationsList),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'sublocationid')),\r\n ),\r\n initData: initPickerValue(initSubLocationListData),\r\n component: SubLocationFilter,\r\n },\r\n ];\r\n if (!hideRoomFloor) {\r\n result.push({\r\n fieldName: 'FloorName',\r\n displayName: t(translations.FloorName),\r\n operator: ODataOperators.Contains,\r\n queryStringSerializer: 'floor',\r\n value: GetStringOrUndefined(GetRawValue(params, 'floor')),\r\n component: TextFieldFilter,\r\n urlKey: 'floor',\r\n });\r\n }\r\n if (isAdmin) {\r\n result.push({\r\n fieldName: 'Id',\r\n queryStringSerializer: 'empty',\r\n displayName: t(translations.ShowBarcodesWithoutAssetsOrRooms),\r\n operator: ODataOperators.Equals,\r\n value: GetBooleanEntity(\r\n GetBooleanOrUndefined(GetRawValue(params, 'empty')),\r\n t,\r\n ),\r\n component: BooleanPickerFilter,\r\n customFilter: (value, settings, filters) => {\r\n if ((value as Identifiable)?.Id === true) {\r\n return `${new Condition(\r\n 'AssetId',\r\n ODataOperators.Equals,\r\n null,\r\n ).toString()} and ${new Condition(\r\n 'RoomId',\r\n ODataOperators.Equals,\r\n null,\r\n ).toString()}`;\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n inversionDisabled: true,\r\n });\r\n }\r\n return result;\r\n};\r\n","import { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as React from 'react';\r\nimport { Column } from 'react-table';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { translations } from 'locales/translations';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { getColumns } from './GetColumns';\r\nimport { GetFilters } from './GetFilters';\r\n\r\nexport interface InventoryLogTableProps {\r\n useSidePanel?: boolean;\r\n authenticatedUser?: AuthenticatedUser;\r\n closeSidePanel: () => void;\r\n setFilters?: (\r\n appliedFilters: IFilterSettings[] | undefined,\r\n ) => void;\r\n // primaryAction?: (row: Row) => void;\r\n // primaryMultiAction: (rows: IMyAssetsRow[]) => void;\r\n screenName?: string;\r\n openAsset: (id: number) => void;\r\n customPredicates?: (string | Condition)[];\r\n isShortView?: boolean;\r\n emptyTable?: CustomEmptyTableProps;\r\n searchTerm?: string;\r\n defaultFilter?: (user: IAuthenticatedUser) => URLSearchParams;\r\n}\r\n\r\nexport function InventoryLogTable(props: InventoryLogTableProps) {\r\n const {\r\n useSidePanel,\r\n authenticatedUser,\r\n setFilters,\r\n screenName,\r\n isShortView = false,\r\n emptyTable,\r\n searchTerm,\r\n defaultFilter,\r\n } = props;\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const isMobile = DetectIsMobile();\r\n // const admins =\r\n // authenticatedUser !== undefined &&\r\n // (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n // authenticatedUser.Roles.includes(Roles.GroupAdministrators) ||\r\n // authenticatedUser.Roles.includes(Roles.LabTech) ||\r\n // authenticatedUser.Roles.includes(Roles.InventoryAdmin));\r\n\r\n const searchColumns = React.useMemo(() => {\r\n let result: string[] = [\r\n 'Username',\r\n 'UserDisplayName',\r\n 'Barcode',\r\n 'ServiceGroupName',\r\n 'AssetName',\r\n 'RoomName',\r\n 'FloorName',\r\n 'BuildingName',\r\n 'LocationName',\r\n 'SubLocationName',\r\n 'StatusName',\r\n 'Remarks',\r\n ];\r\n return result;\r\n }, []);\r\n\r\n const additionalColumns = React.useMemo(() => {\r\n let result: string[] = [\r\n 'Id',\r\n 'ServiceId',\r\n 'AssetId',\r\n 'ServiceGroupId',\r\n 'RoomId',\r\n 'ServiceTypeId',\r\n 'BuildingId',\r\n 'LocationId',\r\n 'SubLocationId',\r\n 'Username',\r\n ];\r\n return result;\r\n }, []);\r\n // const [multiAssetSelectionMode, setMultiAssetSelectionMode] = React.useState<\r\n // boolean\r\n // >(false);\r\n // const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n // Record, boolean>\r\n // >({});\r\n // const [, setCurrentMode, currentModeRef] = useState('card');\r\n // const [loacalAssets, setLoacalAssets, localAssetsRef] = useState<\r\n // Entity[]\r\n // >([]);\r\n // React.useEffect(() => {\r\n // let obj = {};\r\n // if (!!assets && assets.length > 0) {\r\n // for (const key of assets) {\r\n // obj[key.Id] = true;\r\n // }\r\n // setMultiAssetSelectionMode(assets.length > 1);\r\n // setLoacalAssets(assets);\r\n // }\r\n // setSelectedRowIds(obj);\r\n // }, [assets, setLoacalAssets]);\r\n\r\n const columns: Column[] = React.useMemo(\r\n () => getColumns(t, authenticatedUser, appSettings, settings),\r\n [t, authenticatedUser, appSettings, settings],\r\n );\r\n const initialState: IBasicTableState = React.useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Date', desc: true }],\r\n //selectedRowIds: selectedRowIds,\r\n globalFilter: searchTerm,\r\n }),\r\n [searchTerm],\r\n );\r\n\r\n // const customFilter = React.useMemo(() => {\r\n // let filter: (string | Condition)[] = customPredicates ?? [];\r\n // if (actionType === 'StartUsage') {\r\n // filter.push(\r\n // new Condition('AutoMode', ODataOperators.Equals, 1),\r\n // );\r\n // }\r\n // if (actionType === 'TrainingSession') {\r\n // filter.push(\r\n // new Condition(\r\n // 'TrainingSessionsEnabled',\r\n // ODataOperators.Equals,\r\n // true,\r\n // ),\r\n // );\r\n // }\r\n // return filter.length > 0 ? filter : undefined;\r\n // }, [actionType, customPredicates]);\r\n\r\n const url = '/api/odata/v4/BarcodeScanLog';\r\n const { serviceGroups } = useGlobalServiceGroupsFilter(false);\r\n const TTable = React.useMemo(\r\n () =>\r\n filterHandler(BasicTable, GetFilters, {\r\n isSidePanel: useSidePanel,\r\n setFilters: setFilters,\r\n reservedQueryStringParameterNames: undefined,\r\n getDefaultFilter: defaultFilter,\r\n getRequiredFilter: undefined,\r\n getSelectedViewFilter: undefined,\r\n enableSavedLists: false,\r\n }),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [useSidePanel],\r\n );\r\n return (\r\n \r\n setMultiAssetSelectionMode(value),\r\n // selectedTabValue: undefined,\r\n // onAllRowsSelected: toggleAllRows,\r\n // disableMultiMode: multiModeDisabled,\r\n // defaultMultiMode: !multiModeDisabled,\r\n // // defaultMultiMode:\r\n // // multiAssetSelectionMode === true ||\r\n // // (!!localAssetsRef.current && localAssetsRef.current.length > 0),\r\n // }}\r\n //predicates={customFilter}\r\n preventInnerClicks={isMobile}\r\n />\r\n \r\n );\r\n}\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\n\r\nexport function getColumns(\r\n t: TFunction,\r\n user: AuthenticatedUser | undefined,\r\n appSettings: AppSettings | null,\r\n settings: GlobalSettings | null,\r\n) {\r\n const hideRoomFloor =\r\n tryParseBool(\r\n settings?.GetString(AllowedSettings.HideRoomFloorTextBoxes),\r\n ) === true;\r\n const res: ColumnWithDep[] = [\r\n {\r\n Header: t(translations.HashSymbol) as string,\r\n accessor: 'Id',\r\n },\r\n {\r\n Header: t(translations.UserName) as string,\r\n accessor: 'UserDisplayName',\r\n Cell: ({ value, row }) => (\r\n <>\r\n \r\n \r\n ),\r\n },\r\n {\r\n Header: t(translations.EntryDate) as string,\r\n accessor: 'Date',\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Header: t(translations.AssetName) as string,\r\n accessor: 'AssetName',\r\n Cell: ({ value, row }) => {\r\n if (!!value && value !== null) {\r\n if (\r\n row.original.AssetId !== null &&\r\n row.original.AssetId !== undefined\r\n ) {\r\n return (\r\n \r\n {value}\r\n \r\n );\r\n } else {\r\n return <>{value};\r\n }\r\n } else {\r\n return <>{'N/A'};\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.BarCode) as string,\r\n accessor: 'Barcode',\r\n },\r\n {\r\n Header: t(translations.Room) as string,\r\n accessor: 'RoomName',\r\n },\r\n {\r\n Header: t(translations.Building) as string,\r\n accessor: 'BuildingName',\r\n },\r\n {\r\n Header: t(translations.LocationName) as string,\r\n accessor: 'LocationName',\r\n },\r\n {\r\n Header: t(translations.SubLocationName) as string,\r\n accessor: 'SubLocationName',\r\n },\r\n {\r\n Header: t(translations.StatusName) as string,\r\n accessor: 'StatusName',\r\n },\r\n {\r\n Header: t(translations.Remarks) as string,\r\n accessor: 'Remarks',\r\n },\r\n {\r\n Header: t(translations.ServiceGroupName) as string,\r\n accessor: 'ServiceGroupName',\r\n },\r\n ];\r\n\r\n if (!hideRoomFloor) {\r\n res.push({\r\n Header: t(translations.FloorName) as string,\r\n accessor: 'FloorName',\r\n });\r\n }\r\n return res;\r\n}\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { selectInventoryLogFilters } from 'app/pages/AssetsInventory/Details/slice/selectors';\r\nimport { useAssetInventorySlice } from 'app/pages/AssetsInventory/Details/slice';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { InventoryLogTable } from './InventoryLogTable';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { presetDatesRangeToQueryString } from 'app/components/BasicTable/types/FilterParam';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface InventoryLogProps extends CoverProps, SidePanelContentProps {\r\n roomId?: number;\r\n customPredicates?: (string | Condition)[];\r\n pageLink?: string;\r\n onClose?: () => void;\r\n searchTerm?: string;\r\n}\r\n\r\nexport function InventoryLog(props: InventoryLogProps) {\r\n const { useSidePanel, roomId, customPredicates, onClose, searchTerm } = props;\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const filters = useSelector(selectInventoryLogFilters);\r\n const dispatch = useDispatch();\r\n const { actions } = useAssetInventorySlice();\r\n const { t } = useTranslation();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const isMobile = DetectIsMobile();\r\n const [cover, setCover] = React.useState();\r\n\r\n const showShortView =\r\n isMobile || (useSidePanel && !sidePanelExpanded) || props.isCover;\r\n const pagelink = React.useMemo(\r\n () =>\r\n !!props.pageLink\r\n ? props.pageLink\r\n : buildURL(\r\n `${publicUrl}Assets/Inventory/Log`,\r\n Object.assign({}, filters, {\r\n RoomId: roomId,\r\n searchTerm: searchTerm,\r\n }),\r\n ),\r\n [filters, props.pageLink, publicUrl, roomId, searchTerm],\r\n );\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n\r\n const closeSidePanel = React.useCallback(() => {\r\n if (props.isCover) {\r\n if (!!onClose) {\r\n onClose();\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n } else {\r\n dispatch(layoutActions.resetSidePanel());\r\n }\r\n }, [dispatch, layoutActions, onClose, props.isCover]);\r\n const openAsset = React.useCallback((id: number) => {\r\n setCover(\r\n ,\r\n );\r\n }, []);\r\n\r\n // const IsAdmin = React.useCallback(\r\n // (log: IBarcodeScanLogDto) => {\r\n // return (\r\n // authenticatedUser?.IsAllGroupOrLabTechAdmin(\r\n // [log.ServiceGroupId ?? 0],\r\n // [\r\n // {\r\n // Id: log.ServiceId,\r\n // Name: log.AssetName,\r\n // ServiceTypeId: log.ServiceTypeId,\r\n // } as IServiceTypeFilterDto,\r\n // ],\r\n // ) ||\r\n // authenticatedUser?.Roles?.includes(Roles.Administrators) ||\r\n // authenticatedUser?.Roles?.includes(Roles.InventoryAdmin)\r\n // );\r\n // },\r\n // [authenticatedUser],\r\n // );\r\n\r\n const setfilterCallback = React.useCallback(\r\n (v: IFilterSettings[] | undefined) => {\r\n const res = {};\r\n if (!!v) {\r\n toURLSearchParams(v).forEach((val, name) => {\r\n res[name] = val;\r\n });\r\n }\r\n dispatch(actions.setLogFilters(!v || v.length === 0 ? undefined : res));\r\n },\r\n [actions, dispatch],\r\n );\r\n const defaultFilterSearch = React.useCallback(\r\n (user: IAuthenticatedUser) => {\r\n let dateFilter = presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n )(\r\n PresetDatesRange.fromInitPreset(\r\n getPeriodTypesEntity('CustomDate'),\r\n dateUtils.addMonths(new Date(), -1),\r\n new Date(),\r\n ),\r\n );\r\n if (roomId !== undefined) {\r\n dateFilter.set('roomId', roomId.toString());\r\n }\r\n return dateFilter;\r\n },\r\n [roomId],\r\n );\r\n return (\r\n {t(translations.menu_CoreSelection)}}\r\n titlePage={t(translations.menu_AssetInventoryLog)}\r\n closable={useSidePanel || props.isCover}\r\n //disableExpandToggle={true}\r\n //rightTopActions={topButtons}\r\n isCover={props.isCover}\r\n hideTitleBar={false}\r\n cover={cover}\r\n closeCover={props.closeCover || closeCover}\r\n closeSidePanel={props.isCover ? onClose : undefined}\r\n //leftTopActions={pageActions}\r\n children={\r\n \r\n \r\n \r\n }\r\n />\r\n );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n edit: boolean;\r\n text: string;\r\n onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n edit,\r\n text,\r\n onClick,\r\n ...props\r\n}: SaveFormButtonProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { SavedViewDetailsState, SavedViewExtraData } from '../slice/types';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Formik } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { getsavedViewSchema } from './validationSchema';\r\nimport { AssetsFilterForSavedView } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n IAssetDto,\r\n mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { Body } from 'app/components/Typography';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface SavedViewFormProps {\r\n onSubmit: (item: SavedViewDetailsState) => void;\r\n initialValues: SavedViewDetailsState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isEdit: boolean;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n onEquipmentClicked?: (equipment: Entity) => void;\r\n viewOnly: boolean;\r\n ExtraData?: SavedViewExtraData;\r\n}\r\n\r\nexport const SavedViewForm = React.memo(function SavedViewForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isEdit,\r\n isAdmin,\r\n user,\r\n viewOnly,\r\n ExtraData,\r\n onEquipmentClicked,\r\n}: SavedViewFormProps) {\r\n const { t } = useTranslation();\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n // const areTheSameServiceGroup = (assets: IAssetDto[]): boolean => {\r\n // let groupId = assets.filter(\r\n // f => f.ServiceGroupId != null && f.ServiceGroupId !== undefined,\r\n // )[0].ServiceGroupId;\r\n // return assets.every(\r\n // v =>\r\n // v.ServiceGroupId === null ||\r\n // v.ServiceGroupId === undefined ||\r\n // v.ServiceGroupId === groupId,\r\n // );\r\n // };\r\n const userIsServiceGroupAdmin = (assets: IAssetDto[]): boolean => {\r\n return (\r\n user?.IsAllGroupOrLabTechAdmin(\r\n assets.map(g => g.ServiceGroupId ?? 0),\r\n mapAssetsToServiceTypeFilterDto(assets),\r\n ) || false\r\n );\r\n };\r\n const savedViewSchema = React.useMemo(() => getsavedViewSchema(t), [t]);\r\n return (\r\n <>\r\n {\r\n if (viewOnly) return;\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n return (\r\n <>\r\n \r\n \r\n {isEdit && !!ExtraData && (\r\n \r\n <>\r\n \r\n {t(translations.CreatedBy)}\r\n {ExtraData.userName}\r\n \r\n \r\n {t(translations.CreatedAt)}\r\n \r\n {dateUtils.shortDateTimeFormat(ExtraData.createdAt)}\r\n \r\n \r\n \r\n {t(translations.TimesUsed)}\r\n {ExtraData.usages}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 0 &&\r\n userIsServiceGroupAdmin(formik.values.Assets)\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { SavedViewDetailsState } from '../slice/types';\r\n\r\nexport const getsavedViewSchema: (\r\n t: TFunction,\r\n) => Yup.SchemaOf = t =>\r\n Yup.object({\r\n Id: Yup.number().notRequired().default(-1),\r\n Name: Yup.string()\r\n .required(t(translations.err_SavedViewNameRequired))\r\n .typeError(t(translations.err_SavedViewNameRequired))\r\n .label(t(translations.SavedViewName)),\r\n Assets: Yup.array()\r\n .of(EntityNumberSchema)\r\n .min(1)\r\n .required(t(translations.err_savedViewAssetRequired))\r\n .label(t(translations.SavedViewAssets))\r\n .typeError(t(translations.err_savedViewAssetRequired)),\r\n Shared: Yup.boolean().label(t(translations.SavedViewShared)),\r\n Multiple: Yup.boolean().label(t(translations.SavedViewBookMultiple)),\r\n // SharedTo: Yup.mixed().label(i18next.t(translations.SavedViewSharedTo)),\r\n // SharedCores: Yup.array()\r\n // .of(EntityNumberSchema)\r\n // .label(i18next.t(translations.SavedViewSharedCores)),\r\n // SharedUsers: Yup.array()\r\n // .of(EntityStringSchema)\r\n // .label(i18next.t(translations.SavedViewSharedUsers)),\r\n });\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useSavedViewSlice } from '../slice';\r\nimport {\r\n selectCreateSavedView,\r\n selectCreateSavedViewCompleted,\r\n selectCreateSavedViewHasError,\r\n selectExtraData,\r\n selectSavedViewProcessing,\r\n selectUpdateSavedView,\r\n selectUpdateSavedViewCompleted,\r\n selectUpdateSavedViewHasError,\r\n selectUpdateUserName,\r\n} from '../slice/selectors';\r\nimport { SavedViewDetailsState } from '../slice/types';\r\nimport * as React from 'react';\r\n//import { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport {\r\n IAssetDto,\r\n mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { push } from 'connected-react-router';\r\nimport { SaveFormButton } from './Actions/SavedViewActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { SavedViewForm } from './SavedViewForm';\r\nimport { Box } from '@material-ui/core';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLeftTopActions } from './Actions/RightTopActions';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\n\r\nexport interface SavedViewDetailsProps extends SidePanelContentProps {\r\n id?: string;\r\n eid?: string;\r\n}\r\n\r\nexport function SavedViewDetails(props: SavedViewDetailsProps) {\r\n const { id, useSidePanel, eid } = props;\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const { actions } = useSavedViewSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const loading = useSelector(selectSavedViewProcessing);\r\n const [busy, setBusy] = React.useState(false);\r\n const [edit, setEdit] = React.useState(false);\r\n\r\n // const [currentScreen, setCurrentScreen] = React.useState<\r\n // ScreensId | undefined\r\n // >(undefined);\r\n // const hasCreateProcessing = useSelector(selectCreateSavedViewProcessing);\r\n // const hasUpdateUpdateProcessing = useSelector(\r\n // selectUpdateSavedViewProcessing,\r\n // );\r\n //const hasProcessing = hasCreateProcessing || hasUpdateUpdateProcessing;\r\n const hasCreateError = useSelector(selectCreateSavedViewHasError);\r\n const hasUpdateError = useSelector(selectUpdateSavedViewHasError);\r\n const hasError = hasCreateError || hasUpdateError;\r\n const requestCreateCompleted = useSelector(selectCreateSavedViewCompleted);\r\n const requestUpdateCompleted = useSelector(selectUpdateSavedViewCompleted);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const createModel = useSelector(selectCreateSavedView, shallowEqual);\r\n const editModel = useSelector(selectUpdateSavedView, shallowEqual);\r\n const baseModel = createModel || editModel;\r\n\r\n const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n\r\n //const continueToOther = useSelector(selectContinueState);\r\n\r\n // const isMobile = DetectIsMobile();\r\n // const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n //const showShortView = isMobile || (useSidePanel && !sidePanelExpanded);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const fullAdmin =\r\n User !== undefined && User.Roles.includes(Roles.Administrators);\r\n const IsAdmin = React.useMemo(() => {\r\n return (\r\n fullAdmin ||\r\n User?.IsAllGroupOrLabTechAdmin(\r\n baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n mapAssetsToServiceTypeFilterDto(\r\n (baseModel?.Assets === undefined\r\n ? []\r\n : baseModel?.Assets) as IAssetDto[],\r\n ),\r\n )\r\n );\r\n }, [fullAdmin, User, baseModel]);\r\n\r\n const savedViewUserName = useSelector(selectUpdateUserName);\r\n const extraData = useSelector(selectExtraData);\r\n const viewOnly = React.useMemo(() => {\r\n return edit && !fullAdmin && User?.Id !== savedViewUserName;\r\n }, [User?.Id, edit, fullAdmin, savedViewUserName]);\r\n\r\n const publicUrl = useSelector(selectPublicUrl);\r\n useEffectOnMount(() => {\r\n if (id !== undefined && !isNaN(parseInt(id || ''))) {\r\n dispatch(actions.initDetails(parseInt(id || '')));\r\n } else {\r\n dispatch(actions.initNewDetails(eid));\r\n }\r\n setBusy(false);\r\n setEdit(false);\r\n setRequestCompleted(undefined);\r\n return () => {};\r\n });\r\n const submitFormRef = React.useRef(null);\r\n\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n const handleSubmitForm = (e: any) => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: SavedViewDetailsState) => {\r\n setBusy(true);\r\n if (edit) {\r\n dispatch(\r\n actions.updateView({\r\n current: values,\r\n original: baseModel,\r\n }),\r\n );\r\n } else {\r\n dispatch(actions.createView(values));\r\n }\r\n },\r\n [actions, baseModel, dispatch, edit],\r\n );\r\n const handleClose = () => {\r\n if (hasChanges) {\r\n dispatch(layoutActions.setConfirmOpen(true));\r\n } else {\r\n handleCancelClick();\r\n }\r\n };\r\n const handleCancelClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push('/SavedViews'));\r\n }\r\n if (edit) {\r\n dispatch(actions.resetUpdateSavedViewState());\r\n } else {\r\n dispatch(actions.resetCreateSavedViewState());\r\n }\r\n }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n React.useEffect(() => {\r\n let active = loading === false;\r\n if (active) {\r\n if (id !== undefined && !isNaN(parseInt(id))) {\r\n setEdit(true);\r\n }\r\n if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n handleCancelClick();\r\n }\r\n } else if (\r\n requestCreateCompleted === false ||\r\n requestUpdateCompleted === false\r\n ) {\r\n setRequestCompleted(false);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n baseModel,\r\n handleCancelClick,\r\n hasError,\r\n id,\r\n loading,\r\n requestCompleted,\r\n requestCreateCompleted,\r\n requestUpdateCompleted,\r\n ]);\r\n\r\n const leftActions = React.useMemo(() => {\r\n if (viewOnly) return [];\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleSaveClick}\r\n disabled={busy}\r\n processing={!requestCompleted && busy}\r\n edit={edit}\r\n text={t(translations.Save)}\r\n />\r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [busy, edit, handleSaveClick, requestCompleted, t, viewOnly]);\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCancelClick}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCancelClick, t]);\r\n\r\n const leftTopActions = useLeftTopActions({\r\n savedView: baseModel as ISavedViewDto,\r\n isNew: !edit,\r\n useSidePanel: useSidePanel,\r\n extraData: extraData,\r\n });\r\n const [cover, setCover] = React.useState();\r\n const closeCover = () => {\r\n setCover(undefined);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n {\r\n setCover(\r\n ,\r\n );\r\n }}\r\n />\r\n
    \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'mylists/details', { id: id })}\r\n toPageLink={`mylists/details?${toQueryString({ id: id })}`}\r\n leftActions={leftActions}\r\n rightActions={rightActions}\r\n leftTopActions={leftTopActions}\r\n maxLeftTopButtonsLength={1}\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n}\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { savedViewsApi } from 'api/savedViewsApi';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { AddWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/AddWorkOrder';\r\nimport { BringBackUp } from 'app/pages/Actions/GlobalSelectedActions/BringBackUp';\r\nimport { DownWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/DownWorkOrder';\r\nimport { OpenCalendar } from 'app/pages/Actions/GlobalSelectedActions/OpenCalendar';\r\nimport { OpenTimeline } from 'app/pages/Actions/GlobalSelectedActions/OpenTimeline';\r\nimport { OpenWorkOrders } from 'app/pages/Actions/GlobalSelectedActions/OpenWrokOrders';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { GetResponseMessages, IResponseType } from 'types/ResponseType';\r\nimport { useSavedViewSlice } from '../../slice';\r\nimport { SavedViewExtraData } from '../../slice/types';\r\n\r\nexport interface GetLeftTopActionsProps {\r\n savedView?: ISavedViewDto;\r\n isNew: boolean;\r\n useSidePanel?: boolean;\r\n extraData?: SavedViewExtraData;\r\n}\r\n\r\ntype filterableArray = Array<{ notShown?: boolean; value: T }>;\r\n\r\nexport const useLeftTopActions: (\r\n props: GetLeftTopActionsProps,\r\n) => ActionRenderer[] = ({\r\n savedView,\r\n isNew,\r\n useSidePanel,\r\n extraData,\r\n}: GetLeftTopActionsProps) => {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const isAdmin = useMemo(() => {\r\n return authenticatedUser?.Roles.includes(Roles.Administrators);\r\n }, [authenticatedUser]);\r\n const isServiceGroupAdmin = useMemo(() => {\r\n return authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n }, [authenticatedUser]);\r\n const { allowedToView } = useAssetsPermissions();\r\n const rows = useMemo(() => (savedView === undefined ? [] : [savedView]), [\r\n savedView,\r\n ]);\r\n const dispatch = useDispatch();\r\n const { actions } = useSavedViewSlice();\r\n\r\n const useView = useCallback(() => {\r\n dispatch(actions.useSavedView(savedView?.Id));\r\n }, [actions, dispatch, savedView?.Id]);\r\n\r\n const result = useMemo(() => {\r\n if (savedView === undefined || isNew) return [];\r\n const res: filterableArray = [\r\n {\r\n notShown:\r\n !allowedToView(savedView.Assets, RenderTypes.OpenCalendar) ||\r\n !savedView.Assets.some(a => a.BookableAsset),\r\n value: () => (\r\n \r\n rows.flatMap(r =>\r\n r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n ) || []\r\n }\r\n startIcon={}\r\n primary\r\n bookMultiple={savedView.Multiple}\r\n onClick={useView}\r\n />\r\n ),\r\n },\r\n {\r\n notShown:\r\n !(isAdmin || isServiceGroupAdmin) ||\r\n !allowedToView(savedView.Assets, RenderTypes.AddWorkOrder),\r\n value: () => (\r\n \r\n new Promise((resolve, reject) => {\r\n resolve(rows.flatMap(a => a.Assets) || []);\r\n })\r\n }\r\n buttonName={t(translations.AddEvent)}\r\n primary={!savedView.Assets.some(a => a.BookableAsset)}\r\n useSidePanel={useSidePanel}\r\n onClick={useView}\r\n />\r\n ),\r\n },\r\n {\r\n notShown: authenticatedUser?.Name !== extraData?.userName && !isAdmin,\r\n value: submit => (\r\n submit?.()}\r\n variantButton=\"button\"\r\n action={() =>\r\n new Promise((resolve, reject) => {\r\n return savedViewsApi\r\n .deleteSavedViews(rows)\r\n .then(response => {\r\n const messages: IResponseType = GetResponseMessages(\r\n response,\r\n t(translations.Success) as string,\r\n );\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('Error: ', error);\r\n let err = t(translations.Failed) as string;\r\n reject(err);\r\n });\r\n })\r\n }\r\n />\r\n ),\r\n },\r\n {\r\n notShown: !allowedToView(savedView.Assets, RenderTypes.OpenTimeline),\r\n value: () => (\r\n \r\n rows.flatMap(r =>\r\n r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n ) || []\r\n }\r\n />\r\n ),\r\n },\r\n {\r\n notShown: !allowedToView(savedView.Assets, RenderTypes.NewReservation),\r\n value: () => (\r\n a.ServiceId ?? 0).filter(f => f > 0) ||\r\n []\r\n }\r\n >\r\n {t(translations.AddReservation)}\r\n \r\n ),\r\n },\r\n {\r\n notShown:\r\n !(isAdmin || isServiceGroupAdmin) ||\r\n !allowedToView(savedView.Assets, RenderTypes.OpenWorkOrders),\r\n value: () => (\r\n r.flatMap(a => a.Assets).map(a => a.Id) || []}\r\n />\r\n ),\r\n },\r\n {\r\n notShown:\r\n !(isAdmin || isServiceGroupAdmin) ||\r\n !allowedToView(savedView.Assets, RenderTypes.DownWorkOrder),\r\n value: () => (\r\n \r\n new Promise((resolve, reject) => {\r\n resolve(rows.flatMap(a => a.Assets) || []);\r\n })\r\n }\r\n buttonName={t(translations.TakeDown)}\r\n useSidePanel={useSidePanel}\r\n />\r\n ),\r\n },\r\n {\r\n notShown:\r\n !(isAdmin || isServiceGroupAdmin) ||\r\n !allowedToView(savedView.Assets, RenderTypes.BringBackUp),\r\n value: () => (\r\n r.flatMap(a => a.Assets).map(a => a.Id) || []}\r\n getEquipmentIds={rows =>\r\n rows.flatMap(r =>\r\n r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n ) || []\r\n }\r\n />\r\n ),\r\n },\r\n ];\r\n return res.filter(f => !f.notShown).map(f => f.value);\r\n }, [\r\n allowedToView,\r\n authenticatedUser?.Name,\r\n extraData?.userName,\r\n isAdmin,\r\n isNew,\r\n isServiceGroupAdmin,\r\n rows,\r\n savedView,\r\n t,\r\n useSidePanel,\r\n useView,\r\n ]);\r\n return result;\r\n};\r\n","/* eslint-disable prettier/prettier */\r\nimport {\r\n makeStyles,\r\n Theme,\r\n createStyles,\r\n Paper,\r\n List,\r\n ListItem,\r\n Grid,\r\n ListItemText,\r\n Divider,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport const HtmlDefaultTemplate: string =\r\n '

    Company name, IL 60637

    Invoice ID: {@InvoiceLinkId}

    Dates: From {@InvoiceFromDate} To {@InvoiceToDate}

    Invoice DateProcessed ByUser GroupCoreTotal Cost

    {@InvoiceDate}

    {@InvoiceProcessedUser}

    {@InvoiceUserGroup}

    {@InvoiceCore}

    {@InvoiceTotalCost}

    Customer Misc
    Name{@InvoiceProcessedUser}
    Billing Adress{@BillingAddress1}
    City{@BillingAddress2}
    State{@BillingAddress3}
    Country{@BillingAddress4}

    {@InvoiceSummaryTable}

    Remarks: {@InvoiceRemarks}

    ';\r\n\r\n/* export const HtmlDefaultTemplate: string =\r\n '

    ' +\r\n 'Company name, IL 60637' +\r\n '

    ' +\r\n '

    Invoice ID: {@InvoiceLinkId}

    ' +\r\n '

    Dates: From {@InvoiceFromDate} To {@InvoiceToDate}

    ' +\r\n '

    ' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '
    Invoice DateProcessed ByUser GroupCoreTotal Cost
    ' +\r\n '

    {@InvoiceDate}

    ' +\r\n '
    ' +\r\n '

    {@InvoiceProcessedUser}

    ' +\r\n '
    ' +\r\n '

    {@InvoiceUserGroup}

    ' +\r\n '
    ' +\r\n '

    {@InvoiceCore}

    ' +\r\n '
    {@InvoiceTotalCost}
    ' +\r\n '

    ' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '
    Customer Misc
    Name{@InvoiceProcessedUser}
    Billing Adress{@BillingAddress1}
    City{@BillingAddress2}
    State{@BillingAddress3}
    Country{@BillingAddress4}
    ' +\r\n '

    ' +\r\n '

    {@InvoiceSummaryTable}

    ' +\r\n '

    {@InvoiceSummury_BudgetUserService}

    ' +\r\n '

    Remarks: {@InvoiceRemarks}

    ' +\r\n '

    More details can be obtained by clicking on the Invoice ID. The statement total will be charged to your budget accounts as detailed above 5 business days after the statement date. Please contact your facility management with any billing questions.

    ';\r\n */\r\nexport function PopUpListItems(): JSX.Element {\r\n //SETTINGS\r\n const { t } = useTranslation();\r\n\r\n //CSS\r\n const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n invoiceTemplateRightSection: {\r\n width: '100%',\r\n //maxWidth: 570,\r\n backgroundColor: theme.palette.background.default,\r\n position: 'relative',\r\n overflow: 'auto',\r\n maxHeight: '63vh',\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n paper: {\r\n padding: theme.spacing(2),\r\n backgroundColor: theme.palette.background.default,\r\n border: '1px solid #E3E3E3',\r\n },\r\n }),\r\n );\r\n const classes = useStyles();\r\n\r\n //RENDER\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import {\r\n Dialog,\r\n DialogTitle,\r\n DialogContent,\r\n //DialogContentText,\r\n DialogActions,\r\n createStyles,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport React, { Dispatch, SetStateAction, useCallback } from 'react';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IInvoiceTemplatePopUp } from '../IInvoiceTemplatePopUp';\r\n\r\nexport interface HtmlTextBoxProps extends ButtonProps {\r\n Id: number | undefined;\r\n className?: string | undefined;\r\n setInitialValue: Dispatch>;\r\n isEdit: boolean;\r\n setBusy: (value: SetStateAction) => void;\r\n formikValues: IInvoiceTemplatePopUp;\r\n}\r\n\r\nexport const HtmlTextBox = ({\r\n Id,\r\n className,\r\n setInitialValue,\r\n isEdit,\r\n setBusy,\r\n formikValues,\r\n}: HtmlTextBoxProps): JSX.Element => {\r\n //PROPS\r\n const { t } = useTranslation();\r\n\r\n //REDUX\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n\r\n //STATES\r\n const [open, setOpen] = useState(false);\r\n const [textBoxValue, setTextBoxValue] = useState(\r\n formikValues.Html,\r\n );\r\n\r\n //FUNCTIONS\r\n const OnUpdate = useCallback(\r\n (invoiceTemplate: IInvoiceTemplatePopUp) => {\r\n setBusy(true);\r\n setInitialValue(invoiceTemplate);\r\n dispatch(actions.resetSidePanel());\r\n //if Add mode\r\n if (!isEdit) {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.InvoiceTemplatePopUp,\r\n expanded: true,\r\n props: {},\r\n }),\r\n );\r\n } else {\r\n //if Edit mode\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.InvoiceTemplatePopUp,\r\n expanded: true,\r\n props: {\r\n Id: Id,\r\n },\r\n }),\r\n );\r\n }\r\n setBusy(false);\r\n },\r\n [Id, actions, dispatch, isEdit, setBusy, setInitialValue],\r\n );\r\n\r\n //CSS\r\n const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n invoiceTemplateHtmlTextBox: {\r\n width: '100%',\r\n minWidth: 500,\r\n backgroundColor: theme.palette.background.default,\r\n //position: 'relative',\r\n //overflow: 'auto',\r\n maxHeight: '63vh',\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n }),\r\n );\r\n const classes = useStyles();\r\n\r\n //RENDER\r\n return (\r\n \r\n }\r\n onClick={() => {\r\n setOpen(true);\r\n }}\r\n >\r\n {}}\r\n aria-labelledby=\"form-dialog-title\"\r\n >\r\n \r\n {t(translations.InvoiceTemplateHtmlSource)}\r\n \r\n \r\n {/* \r\n {t(translations.InvoiceTemplateHtmlSource)}\r\n */}\r\n {\r\n setTextBoxValue(event.target.value);\r\n }}\r\n />\r\n \r\n \r\n {\r\n setOpen(false);\r\n }}\r\n variant=\"ghost\"\r\n >\r\n {t(translations.Cancel)}\r\n \r\n {\r\n setOpen(false);\r\n let values = { ...formikValues };\r\n values.Html = textBoxValue;\r\n OnUpdate(values);\r\n }}\r\n variant=\"main\"\r\n >\r\n {t(translations.Update)}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { FormControl, FormGroup } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { HexColorPicker } from 'react-colorful';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { TextField, TextFieldProps } from '../TextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const FormColorPicker = ({\r\n label,\r\n name,\r\n onBlur,\r\n onChange,\r\n value,\r\n ...props\r\n}: TextFieldProps & FieldHookConfig & IFieldProps) => {\r\n const { t } = useTranslation();\r\n const [field, meta, helpers] = useField({ name, ...props });\r\n\r\n const handleChange = e => {\r\n if (onChange !== undefined) {\r\n onChange(e);\r\n }\r\n field.onChange(e);\r\n };\r\n\r\n const handleColorPickerChange = (e: string) => {\r\n helpers.setValue(e);\r\n };\r\n\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n \r\n {props.info ? : null}\r\n {props.InputProps?.endAdornment}\r\n \r\n ),\r\n }}\r\n {...props}\r\n />\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { Box, Divider, Grid, Popover } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Body } from 'app/components/Typography';\r\nimport { InvoiceIdMultiPicker } from 'app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n bindPopover,\r\n bindTrigger,\r\n usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { useCallback } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { buildURL, openExportLink } from 'utils/url-utils';\r\n\r\nexport interface PreviewButtonProps {}\r\n\r\nexport function PreviewButton() {\r\n //PROPS\r\n const { t } = useTranslation();\r\n\r\n const popupState = usePopupState({\r\n variant: 'popover',\r\n popupId: 'previewInvoiceSelection',\r\n });\r\n\r\n //STATES\r\n const [invoiceIds, setInvoiceIds] = useAsyncExtendedState<\r\n Entity[] | undefined\r\n >(undefined);\r\n\r\n //FUNCTIONS\r\n const handleInvoiceIdChange = useCallback(\r\n (value: Entity[] | undefined) => {\r\n setInvoiceIds(value);\r\n },\r\n [setInvoiceIds],\r\n );\r\n\r\n const handlePreview = () => {\r\n if (!!invoiceIds) {\r\n const ids: string = invoiceIds.map(item => item.Id).join(',');\r\n var params = {\r\n ids: ids,\r\n };\r\n //BillingController->InvoiceExportPDFs - [Route(\"api/Billing/Invoices/InvoiceExportPDFs\")]\r\n const url = buildURL('api/Billing/Invoices/InvoiceExportPDFs', params);\r\n openExportLink(url);\r\n popupState.close();\r\n setInvoiceIds([]);\r\n }\r\n };\r\n\r\n //RENDER\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Invoice)}\r\n \r\n {\r\n popupState.close();\r\n setInvoiceIds([]);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n handleInvoiceIdChange(value);\r\n }}\r\n />\r\n \r\n \r\n \r\n handlePreview()}\r\n >\r\n {t(translations.Preview)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import Link from '@material-ui/core/Link';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactNode, useCallback, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { Formik } from 'formik';\r\nimport * as Yup from 'yup';\r\nimport { IInvoiceTemplatePopUp } from './IInvoiceTemplatePopUp';\r\nimport { InvoiceTemplatesApi } from 'api/InvoiceTemplatesApi';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n StyledForm,\r\n FormLeftSection,\r\n FormFieldsSection,\r\n FormRow,\r\n FormRightSection,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { createStyles, makeStyles, Theme, Paper } from '@material-ui/core';\r\nimport { HtmlDefaultTemplate, PopUpListItems } from './PopUpListItems';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormInputFile } from 'app/components/Forms/FormInputFile';\r\nimport { formFileSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { HtmlTextBox } from './HtmlTextBox';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { IsBudgetFieldEnabled } from 'types/AppSettings';\r\nimport { FormColorPicker } from 'app/components/Forms/FormColorPicker';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { PreviewButton } from './PreviewButton';\r\n\r\nexport interface InvoiceTemplatePopUpProps extends CoverProps {\r\n Id?: number;\r\n serviceGroup?: Entity | null;\r\n isMainAdmin?: boolean | null;\r\n onClose?: () => void;\r\n}\r\n\r\nexport const InvoiceTemplatePopUpLink = ({\r\n children,\r\n ...props\r\n}: InvoiceTemplatePopUpProps & { children: ReactNode }) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const onClick = () => {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.InvoiceTemplatePopUp,\r\n expanded: true,\r\n props: {\r\n Id: props.Id,\r\n } as InvoiceTemplatePopUpProps,\r\n }),\r\n );\r\n };\r\n return {children};\r\n};\r\n\r\nexport const InvoiceTemplatePopUp = ({\r\n Id,\r\n serviceGroup,\r\n isMainAdmin,\r\n onClose,\r\n ...props\r\n}: InvoiceTemplatePopUpProps) => {\r\n //SETTINGS\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const appSettings = useSelector(selectAppSettings);\r\n const budgetFieldFundingTypeEnabled:\r\n | boolean\r\n | undefined = IsBudgetFieldEnabled(\r\n appSettings ?? null,\r\n BudgetFields.FundingType,\r\n );\r\n\r\n //PROPS\r\n const isEdit = !!Id;\r\n const submitRef = useRef();\r\n\r\n //REDUX\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n\r\n //STATES\r\n const [busy, setBusy] = useState(false);\r\n const [initialValues, setInitialValue] = useState({\r\n Id: -1,\r\n Name: null,\r\n CreatedAt: newDate(),\r\n LastUpdated: newDate(),\r\n FundingType: null,\r\n ServiceGroup: null,\r\n Html: HtmlDefaultTemplate,\r\n TableHeaderColor: '#8D8BC9',\r\n TableBodyColor: '#ffffff',\r\n HeaderFile: [],\r\n FooterFile: [],\r\n HeaderFileName: null,\r\n FooterFileName: null,\r\n });\r\n\r\n //SCHEMAS\r\n async function testHex(input: string | null | undefined) {\r\n let result = false;\r\n if (!!input) {\r\n const regHex = /^#([0-9a-f]{3}){1,2}$/i;\r\n result = regHex.test(input);\r\n }\r\n return result;\r\n }\r\n\r\n const InvoiceTemplatePopUpSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n Name: Yup.string().required(),\r\n CreatedAt: Yup.date().required().default(newDate()),\r\n LastUpdated: Yup.date().notRequired().nullable(),\r\n FundingType: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n ServiceGroup: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n Html: Yup.string().notRequired().nullable(),\r\n TableHeaderColor: Yup.string().notRequired().nullable().test({\r\n name: 'TableHeaderColor',\r\n test: testHex,\r\n }),\r\n TableBodyColor: Yup.string().notRequired().nullable().test({\r\n name: 'TableBodyColor',\r\n test: testHex,\r\n }),\r\n HeaderFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n FooterFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n HeaderFileName: Yup.string().notRequired().nullable(),\r\n FooterFileName: Yup.string().notRequired().nullable(),\r\n },\r\n );\r\n /* const InvoiceTemplatePopUpSGASchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Id: Yup.number().notRequired().default(-1),\r\n Name: Yup.string().required(),\r\n CreatedAt: Yup.date().required().default(new Date()),\r\n LastUpdated: Yup.date().notRequired().nullable(),\r\n FundingType: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n ServiceGroup: Yup.mixed().required(),\r\n Html: Yup.string().notRequired().nullable(),\r\n TableHeaderColor: Yup.string().notRequired().nullable(),\r\n TableBodyColor: Yup.string().notRequired().nullable(),\r\n HeaderFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n FooterFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n },\r\n ); */\r\n\r\n const close = useCallback(() => {\r\n if (props.isCover) {\r\n props.closeCover?.();\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }, [props, dispatch, actions]);\r\n\r\n const refreshTable = useCallback(() => {\r\n dispatch(actions.setRefreshTable(true));\r\n }, [dispatch, actions]);\r\n\r\n function html_replace(html: string, valueToReplace: string) {\r\n const patrn = /background-color: #(?:[A-Fa-f0-9]{3}){1,2}\\b/;\r\n if (html.match(patrn)) {\r\n //console.log(html.match(patrn)?.toString());\r\n let originalValue: string = html.match(patrn)?.toString() as string;\r\n html = html.replaceAll(originalValue, valueToReplace);\r\n }\r\n return html;\r\n }\r\n\r\n const OnSubmit = useCallback(\r\n (invoiceTemplate: IInvoiceTemplatePopUp) => {\r\n setBusy(true);\r\n let invoiceTemplateHtml = html_replace(\r\n invoiceTemplate.Html as string,\r\n 'background-color: ' + invoiceTemplate.TableHeaderColor ??\r\n 'background-color: #FFFFFF',\r\n );\r\n //if Add mode\r\n if (!isEdit) {\r\n let formValues = {\r\n Id: invoiceTemplate.Id,\r\n Name: invoiceTemplate.Name,\r\n CreatedAt: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(invoiceTemplate.CreatedAt),\r\n ),\r\n LastUpdated: !!invoiceTemplate.LastUpdated\r\n ? dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(invoiceTemplate.LastUpdated),\r\n )\r\n : null,\r\n FundingType: invoiceTemplate.FundingType?.Id,\r\n ServiceGroupId: invoiceTemplate.ServiceGroup?.Id,\r\n ServiceGroup: invoiceTemplate.ServiceGroup?.Name ?? '',\r\n Html: invoiceTemplateHtml,\r\n TableHeaderColor: invoiceTemplate.TableHeaderColor,\r\n TableBodyColor: invoiceTemplate.TableBodyColor,\r\n HeaderFile: invoiceTemplate.HeaderFile,\r\n FooterFile: invoiceTemplate.FooterFile,\r\n HeaderFileName: invoiceTemplate.HeaderFileName,\r\n FooterFileName: invoiceTemplate.FooterFileName,\r\n };\r\n InvoiceTemplatesApi.insertInvoiceTemplate(formValues)\r\n .then(response => {\r\n if (response.ErrorMessages.length > 0) {\r\n response.ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n notifyActions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n } else {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.InvoiceTemplateAddedSuccessfully),\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n })\r\n .catch(e => console.error(e))\r\n .finally(() => {\r\n close();\r\n refreshTable();\r\n });\r\n } else {\r\n //if Edit mode\r\n let formValues = {\r\n Id: invoiceTemplate.Id,\r\n Name: invoiceTemplate.Name,\r\n CreatedAt: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(invoiceTemplate.CreatedAt),\r\n ),\r\n LastUpdated: !!invoiceTemplate.LastUpdated\r\n ? dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(invoiceTemplate.LastUpdated),\r\n )\r\n : null,\r\n FundingType: invoiceTemplate.FundingType?.Id,\r\n ServiceGroupId: invoiceTemplate.ServiceGroup?.Id,\r\n ServiceGroup: invoiceTemplate.ServiceGroup?.Name ?? '',\r\n Html: invoiceTemplateHtml,\r\n TableHeaderColor: invoiceTemplate.TableHeaderColor,\r\n TableBodyColor: invoiceTemplate.TableBodyColor,\r\n HeaderFile: invoiceTemplate.HeaderFile,\r\n FooterFile: invoiceTemplate.FooterFile,\r\n HeaderFileName: invoiceTemplate.HeaderFileName,\r\n FooterFileName: invoiceTemplate.FooterFileName,\r\n };\r\n InvoiceTemplatesApi.updateInvoiceTemplate(Id, formValues)\r\n .then(response => {\r\n if (response.ErrorMessages.length > 0) {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: response.ErrorMessages[0],\r\n variant: 'error',\r\n }),\r\n );\r\n setBusy(false);\r\n return;\r\n }\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.InvoiceTemplateUpdateSuccess),\r\n variant: 'success',\r\n }),\r\n );\r\n close();\r\n refreshTable();\r\n })\r\n .catch(e => console.error(e));\r\n }\r\n },\r\n [Id, close, dispatch, isEdit, notifyActions, refreshTable, t],\r\n );\r\n\r\n //USE EFFECT ON MOUNT\r\n useEffectOnMount(() => {\r\n //if Edit mode\r\n if (isEdit) {\r\n setBusy(true);\r\n let mounted = true;\r\n (async () => {\r\n try {\r\n const invoiceTemplate = await InvoiceTemplatesApi.getInvoiceTemplateById(\r\n Id,\r\n );\r\n if (mounted) {\r\n setInitialValue({\r\n Id: invoiceTemplate.value[0].Id ?? -1,\r\n Name: invoiceTemplate.value[0].Name ?? null,\r\n CreatedAt: invoiceTemplate.value[0].CreatedAt ?? null,\r\n LastUpdated: invoiceTemplate.value[0].LastUpdated ?? null,\r\n FundingType:\r\n getSingleInvoiceFundingType(\r\n invoiceTemplate.value[0].FundingType,\r\n ) ?? null,\r\n ServiceGroup: invoiceTemplate.value[0].ServiceGroup\r\n ? {\r\n Id: invoiceTemplate.value[0].ServiceGroupId,\r\n Name: invoiceTemplate.value[0].ServiceGroup,\r\n }\r\n : null,\r\n //\"split\"-\"join\" is to avoid breaking the RichTextEditor (path, offset problems)\r\n Html:\r\n invoiceTemplate.value[0].Html.split(/[\\r\\n]+/).join('') ?? null,\r\n //Html: invoiceTemplate.value[0].Html ?? null,\r\n TableHeaderColor:\r\n invoiceTemplate.value[0].TableHeaderColor ?? null,\r\n TableBodyColor: invoiceTemplate.value[0].TableBodyColor ?? null,\r\n HeaderFile: [],\r\n FooterFile: [],\r\n HeaderFileName: invoiceTemplate.value[0].HeaderFileName,\r\n FooterFileName: invoiceTemplate.value[0].FooterFileName,\r\n });\r\n setBusy(false);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n })();\r\n return () => {\r\n mounted = false;\r\n };\r\n } else {\r\n //if Add mode\r\n //if (!!serviceGroup) {\r\n setBusy(true);\r\n let isMounted = true;\r\n if (isMounted) {\r\n const values = { ...initialValues };\r\n values.Name = t(translations.InvoiceTemplate) as string;\r\n if (!!serviceGroup && isMainAdmin === false) {\r\n //set first service group\r\n values.ServiceGroup = serviceGroup;\r\n }\r\n setInitialValue(values);\r\n setBusy(false);\r\n }\r\n return () => {\r\n isMounted = false;\r\n };\r\n //}\r\n //return;\r\n }\r\n });\r\n\r\n //CSS\r\n const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n leftSectionH6Image: {\r\n padding: theme.spacing(1),\r\n backgroundColor: '#026AA2',\r\n color: '#FFFFFF',\r\n marginRight: 10,\r\n },\r\n rightSectionH5Title: {\r\n padding: theme.spacing(2),\r\n backgroundColor: '#026AA2',\r\n },\r\n row: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n width: '100%',\r\n },\r\n }),\r\n );\r\n const classes = useStyles();\r\n\r\n //FORM\r\n const InvoiceTemplateForm = () => {\r\n return (\r\n \r\n {formik => {\r\n submitRef.current = formik.submitForm;\r\n const additionalButtons = [\r\n (classname, key) => {\r\n return (\r\n \r\n );\r\n },\r\n ];\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(\r\n translations.ReservedWordsForInvoiceLetterTemplateMsg,\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n };\r\n\r\n const leftActions = [\r\n () => (\r\n <>\r\n submitRef.current?.()}\r\n size=\"small\"\r\n disabled={busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n \r\n ),\r\n ];\r\n\r\n const rightActions = [\r\n () => (\r\n <>\r\n }\r\n onClick={close}\r\n size=\"small\"\r\n disabled={busy}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n \r\n ),\r\n ];\r\n\r\n //RENDER\r\n return (\r\n }\r\n leftActions={leftActions}\r\n rightActions={rightActions}\r\n disableExpandToggle={true}\r\n /* closeSidePanel={() => {\r\n if (hasChanges) {\r\n dispatch(actions.setConfirmOpen(true));\r\n } else {\r\n dispatch(actions.resetSidePanel());\r\n }\r\n }} */\r\n isCover={props.isCover}\r\n closeCover={props.closeCover}\r\n />\r\n );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const uploadStyle = makeStyles((theme: Theme) =>\r\n createStyles({\r\n buttonRoot: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n gap: theme.spacing(1.25),\r\n padding: '6px 8px',\r\n boxShadow: 'unset',\r\n lineHeight: 'normal',\r\n height: '48px',\r\n backgroundColor: theme.palette.common.white,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n '&:hover': {\r\n backgroundColor: theme.palette.common.grayDividers,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n },\r\n '&$disabled': {\r\n backgroundColor: theme.palette.common.grayDividers,\r\n color: theme.palette.common.grayComponents,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n },\r\n '&>[class*=\"MuiButton-label\"]': {\r\n gap: theme.spacing(1),\r\n pointerEvents: 'none',\r\n },\r\n '&.shrinkLabel': {\r\n padding: '20px 8px 0px 8px',\r\n },\r\n },\r\n buttonLabel: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n margin: 0,\r\n height: '24px',\r\n justifyContent: 'flex-start',\r\n },\r\n startIcon: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 0,\r\n flexGrow: 0,\r\n margin: 0,\r\n // margin: props =>\r\n // props.size === 'large'\r\n // ? '0px 12px 0px 0px'\r\n // : props.size === 'medium'\r\n // ? '0px 8px 0px 0px'\r\n // : props.size === 'small'\r\n // ? '0px 8px'\r\n // : props.size === 'xs'\r\n // ? '0px 8px 0px 0px'\r\n // : '0px 12px 0px 0px',\r\n '&$iconSizeSmall': {\r\n marginLeft: 'unset',\r\n },\r\n },\r\n endIcon: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: '0px',\r\n flex: 'none',\r\n order: 2,\r\n flexGrow: 0,\r\n marginLeft: 'auto',\r\n marginRight: 0,\r\n },\r\n disabled: {\r\n backgroundColor: theme.palette.common.grayDividers,\r\n color: theme.palette.common.grayComponents,\r\n border: `1px solid ${theme.palette.common.grayBorders}`,\r\n },\r\n dividerRoot: {\r\n backgroundColor: theme.palette.common.grayComponents,\r\n },\r\n previewContainer: {\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n alignItems: 'center',\r\n flexDirection: 'row',\r\n gap: theme.spacing(1),\r\n height: '48px',\r\n padding: '0px 10px 0px 0px',\r\n '&.shrinkLabel': {\r\n alignItems: 'flex-end',\r\n },\r\n },\r\n previewIconAndText: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n padding: 0,\r\n gap: theme.spacing(1.5),\r\n width: '100%',\r\n },\r\n previewIcon: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: '12px',\r\n gap: theme.spacing(1.25),\r\n cursor: 'pointer',\r\n backgroundColor: theme.palette.common.white,\r\n borderRadius: '8px',\r\n color: theme.palette.common.grayComponents,\r\n '& svg': {\r\n width: '24px',\r\n height: '24px',\r\n },\r\n '& img': {\r\n height: '24px',\r\n },\r\n '.shrinkLabel &': {\r\n padding: 0,\r\n },\r\n },\r\n previewText: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n width: '100%',\r\n },\r\n previewTextSize: {\r\n color: theme.palette.common.grayComponents,\r\n },\r\n previewCloseButton: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 2,\r\n gap: theme.spacing(1.25),\r\n },\r\n previewCloseButtonIcon: {\r\n color: theme.palette.common.grayComponents,\r\n width: '16px',\r\n height: '16px',\r\n fontSize: '16px',\r\n },\r\n }),\r\n);\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { uploadStyle } from './styles';\r\nimport * as React from 'react';\r\nimport { lookup } from 'mime-types';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { openExportLink, toRootedURL } from 'utils/url-utils';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport prettyBytes from 'pretty-bytes';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FileViewProps {\r\n file: IFormFileValue;\r\n onRemove: (value: any) => void;\r\n withShrinkLabel?: boolean;\r\n}\r\n\r\nexport function FileView(props: FileViewProps) {\r\n const { file, onRemove, withShrinkLabel } = props;\r\n const { t } = useTranslation();\r\n\r\n const fileName =\r\n file.DisplayValue !== null && file.DisplayValue !== undefined\r\n ? file.DisplayValue\r\n : '';\r\n const fileSize =\r\n file.Size == null\r\n ? null\r\n : prettyBytes(file.Size, { maximumFractionDigits: 2 });\r\n const mimeType = lookup(fileName);\r\n const fileUrl =\r\n file.PostedFile === null || file.PostedFile === undefined\r\n ? toRootedURL(`/file.ashx?id=${file.Id}&ap=true`)\r\n : file.PostedFile.webkitRelativePath;\r\n const previewImg =\r\n !isEmptyOrWhitespace(file.DisplayValue) &&\r\n mimeType !== false &&\r\n mimeType.startsWith('image/');\r\n const downloadClick = async () => {\r\n if (file.PostedFile === null || file.PostedFile === undefined) {\r\n await openExportLink(fileUrl);\r\n }\r\n };\r\n // const fileDownloadClick = async () => {\r\n // fileDownload(res.data, filename)\r\n // };\r\n\r\n const classes = uploadStyle();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n return (\r\n \r\n \r\n
    \r\n {file.Value !== null ? (\r\n \r\n downloadClick()}\r\n >\r\n {previewImg ? (\r\n {fileName}\r\n ) : (\r\n \r\n )}\r\n
    \r\n \r\n ) : (\r\n
    \r\n \r\n
    \r\n )}\r\n
    \r\n \r\n {cliTruncate(fileName, sidePanelExpanded ? 40 : 25, {\r\n position: 'middle',\r\n })}\r\n \r\n\r\n {fileSize && (\r\n \r\n {fileSize}\r\n \r\n )}\r\n
    \r\n \r\n
    \r\n onRemove(fileName)}\r\n >\r\n \r\n \r\n
    \r\n \r\n
    \r\n );\r\n}\r\n","import {\r\n Button,\r\n Divider,\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n Input,\r\n InputLabel,\r\n InputProps,\r\n styled,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport * as React from 'react';\r\n\r\nimport cliTruncate from 'cli-truncate';\r\nimport { uploadStyle } from './styles';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileView } from './FileView';\r\nimport { buttonM } from 'styles/typography/bookitTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FileInputProps extends InputProps {\r\n className?: string;\r\n onFileChange?: (file: FileList | null) => void;\r\n label?: string;\r\n multiple?: boolean;\r\n uploadLabel?: string;\r\n showPreview?: boolean;\r\n removeable?: boolean;\r\n onRemove?: (value: string) => void;\r\n acceptedFiles?: string;\r\n isRequired?: string;\r\n helperText?: string;\r\n errorMesage?: string;\r\n info?: string;\r\n referenceId?: number;\r\n file?: IFormFileValue;\r\n shrinkLabel?: boolean;\r\n}\r\n\r\nconst StyledFormHelperText = styled(FormHelperText)(props => ({\r\n // empty helperText results in zero element height. So when field is validated the appearance of the\r\n // error message in the helperText causes the form element to increase in height and forces a redraw\r\n // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n '&::before': {\r\n content: '\"\\\\00a0\"',\r\n },\r\n}));\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n color: theme.palette.common.blackRegular,\r\n ...buttonM,\r\n '&[class*=\"Mui-focused\"]': {\r\n color: theme.palette.common.blackRegular,\r\n },\r\n}));\r\nexport function FileInput(props: FileInputProps) {\r\n const {\r\n className,\r\n onFileChange,\r\n onRemove,\r\n id,\r\n multiple,\r\n uploadLabel,\r\n helperText,\r\n errorMesage,\r\n onChange,\r\n label,\r\n file,\r\n required,\r\n shrinkLabel,\r\n acceptedFiles,\r\n } = props;\r\n const classes = uploadStyle();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n //const [file, setFile] = React.useState(undefined);\r\n\r\n const handleChange = (event: React.ChangeEvent) => {\r\n if (onChange) {\r\n onChange(event);\r\n } else {\r\n const files = event.target.files;\r\n if (onFileChange) {\r\n onFileChange(files);\r\n }\r\n }\r\n // if (event.target.files?.length) {\r\n // setFileName(event.target.files[event.target.files?.length - 1].name);\r\n // }\r\n };\r\n const removeFile = (fileName: string) => {\r\n if (onRemove) {\r\n onRemove(fileName);\r\n }\r\n //setFileName(undefined);\r\n };\r\n return (\r\n \r\n {/* {label && (\r\n \r\n {label}\r\n \r\n )} */}\r\n {label && (\r\n \r\n {shrinkLabel ? (\r\n \r\n {label}\r\n \r\n ) : (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n )}\r\n removeFile(file.DisplayValue || '')}\r\n children={}\r\n size=\"small\"\r\n />\r\n ) : props.info ? (\r\n \r\n ) : undefined\r\n }\r\n >\r\n {uploadLabel ? uploadLabel : 'Upload File'}\r\n \r\n {multiple && file ? (\r\n \r\n {cliTruncate(file.DisplayValue || '', sidePanelExpanded ? 35 : 22, {\r\n position: 'middle',\r\n })}\r\n \r\n ) : (\r\n {'Please select a file...'}\r\n )}\r\n \r\n \r\n {!multiple && file !== undefined && (\r\n removeFile(file.DisplayValue || ' ')}\r\n withShrinkLabel={shrinkLabel}\r\n />\r\n )}\r\n {(!!errorMesage || !!helperText) && (\r\n \r\n {errorMesage ? (\r\n {errorMesage}\r\n ) : helperText ? (\r\n {helperText}\r\n ) : undefined}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileView } from './FileView';\r\nimport * as React from 'react';\r\n\r\nexport interface FilesPreviewProps {\r\n files: IFormFileValue[] | null;\r\n multiple?: boolean;\r\n onRemove?: (value: any) => void;\r\n}\r\nexport function FilesPreview(props: FilesPreviewProps) {\r\n const { files, onRemove } = props;\r\n const handleRemove = (value: any) => {\r\n if (onRemove) onRemove(value);\r\n };\r\n return (\r\n \r\n {files !== null &&\r\n files.length > 0 &&\r\n files.map(file => )}\r\n \r\n );\r\n}\r\n","import { Box } from '@material-ui/core';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport * as React from 'react';\r\nimport { FileInput, FileInputProps } from './FileInput';\r\nimport { FilesPreview } from './FilesPreview';\r\n\r\nexport interface FileUploadProps {\r\n values: IFormFileValue[];\r\n multiple?: boolean;\r\n uploadLabel?: string;\r\n showPreview?: boolean;\r\n fileSizeLimit?: number;\r\n saveFiles?: (files: IFormFileValue[]) => void;\r\n fileInputProps: FileInputProps;\r\n}\r\n\r\nexport function FileUpload(props: FileUploadProps) {\r\n const { values, multiple, showPreview, saveFiles, fileInputProps } = props;\r\n\r\n const [innerFiles, setInnerFiles] = React.useState>({});\r\n const [fileValues, setFileValues] = React.useState(\r\n values,\r\n );\r\n const referenceId = fileInputProps.referenceId;\r\n const convertFilesToArray = (files: Record) =>\r\n Object.keys(files).map(key => files[key]);\r\n\r\n const addNewFiles = (newFiles: FileList) => {\r\n let files = multiple ? innerFiles : {};\r\n for (let file of newFiles) {\r\n if (!multiple) {\r\n // return { file };\r\n files[file.name] = file;\r\n return { ...files };\r\n }\r\n files[file.name] = file;\r\n }\r\n return { ...files };\r\n };\r\n const updateState = (files: File[], deleteFileName?: string) => {\r\n let savedFiles = fileValues ?? [];\r\n if (deleteFileName) {\r\n savedFiles =\r\n fileValues?.filter(f => f.DisplayValue !== deleteFileName) ?? [];\r\n } else {\r\n files?.forEach(file => {\r\n if (\r\n savedFiles?.filter(f => f.DisplayValue === file.name)?.length === 0\r\n ) {\r\n savedFiles?.push({\r\n Id: referenceId || -1,\r\n Value: null,\r\n DisplayValue: file.name,\r\n Size: file.size,\r\n PostedFile: file,\r\n } as IFormFileValue);\r\n }\r\n });\r\n }\r\n return savedFiles;\r\n };\r\n const updateFiles = (\r\n files: Record,\r\n deleteFileName?: string,\r\n ) => {\r\n const filesAsArray = convertFilesToArray(files);\r\n const savedFiles = updateState(filesAsArray, deleteFileName);\r\n setFileValues(savedFiles);\r\n if (saveFiles !== undefined) {\r\n saveFiles(savedFiles ?? []);\r\n }\r\n };\r\n const handleChange = (files: FileList | null) => {\r\n let updatedFiles = {};\r\n if (files?.length) {\r\n updatedFiles = addNewFiles(files);\r\n setInnerFiles(updatedFiles);\r\n } else {\r\n setInnerFiles({});\r\n }\r\n updateFiles(updatedFiles);\r\n };\r\n const removeFile = (fileName: string) => {\r\n let files = innerFiles;\r\n delete files[fileName];\r\n setInnerFiles({ ...files });\r\n\r\n updateFiles({ ...files }, fileName);\r\n };\r\n return (\r\n \r\n 0 ? fileValues[0] : undefined}\r\n {...fileInputProps}\r\n />\r\n {multiple && showPreview && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * EmailTypePicker\r\n *\r\n */\r\n\r\nimport {\r\n EmailTypeUnionArray,\r\n EmailTypeUnion,\r\n} from 'api/odata/generated/enums/EmailType';\r\nimport {\r\n EnumPicker,\r\n EnumPickerProps,\r\n withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport type EmailTypePickerProps = Omit<\r\n EnumPickerProps,\r\n 'EnumNamesArray'\r\n>;\r\nexport const EmailTypePicker = withEnumOptions(\r\n EmailTypeUnionArray,\r\n)(EnumPicker);\r\n","/**\r\n *\r\n * EmailTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { EmailTypePicker } from 'app/components/pickers/StaticOptionsPickers/EmailTypePicker';\r\nimport { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\n\r\nexport const EmailTypeFilter = (props: IFilterComponentProps) => {\r\n const handleOnChange = (value: EmailTypeUnion | null) => {\r\n props.onChange(value);\r\n };\r\n const { t } = useTranslation();\r\n return (\r\n \r\n );\r\n};\r\nexport default EmailTypeFilter;\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { AssetPickerFilter } from 'app/components/BasicTable/Filters/AssetFilter';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { UserFilter } from 'app/components/BasicTable/Filters/UserFilter';\r\nimport {\r\n getDefaultFilterDatePeriod,\r\n GetNumberOrUndefined,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetStringOrUndefined,\r\n getStringUnionOrUndefined,\r\n initPickerValue,\r\n presetDatesRangeToQueryString,\r\n URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { initAssetData } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IEmailNotificationsRow } from './IEmailNotificationsRow';\r\nimport { EmailTypeUnionArray } from 'api/odata/generated/enums/EmailType';\r\nimport EmailTypeFilter from 'app/components/BasicTable/Filters/EmailTypeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n var result: IFilterSettings[] = [\r\n {\r\n fieldName: 'Recipient',\r\n displayName: t(translations.Recipient),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'recipient',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'recipient')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n },\r\n {\r\n fieldName: 'AssetId',\r\n queryStringSerializer: 'aid',\r\n displayName: t(translations.Asset),\r\n operator: ODataOperators.Equals,\r\n value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'aid'))),\r\n initData: initPickerValue(initAssetData),\r\n component: AssetPickerFilter,\r\n },\r\n {\r\n fieldName: 'CreatedBy',\r\n displayName: t(translations.CreatedBy),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'createdby',\r\n value: GetPartialEntity(\r\n GetStringOrUndefined(GetRawValue(params, 'createdby')),\r\n ),\r\n component: UserFilter,\r\n initData: initPickerValue(initUserData),\r\n },\r\n {\r\n fieldName: 'Timestamp',\r\n displayName: t(translations.Timestamp),\r\n operator: ODataOperators.Between,\r\n defaultValue: PresetDatesRange.fromPreset(\r\n getPeriodTypesEntity('ThisMonth'),\r\n ),\r\n queryStringSerializer: presetDatesRangeToQueryString(\r\n 'period',\r\n 'st',\r\n 'et',\r\n ),\r\n value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n component: DatesRangeFilter,\r\n urlKey: 'period',\r\n },\r\n {\r\n fieldName: 'NotificationTypeId',\r\n displayName: t(translations.NotificationType),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'NotificationTypeId',\r\n value: getStringUnionOrUndefined(\r\n GetRawValue(params, 'NotificationTypeId'),\r\n EmailTypeUnionArray,\r\n ),\r\n component: EmailTypeFilter,\r\n },\r\n {\r\n fieldName: 'ReferenceId',\r\n displayName: t(translations.Reference),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'ReferenceId',\r\n value: GetNumberOrUndefined(GetRawValue(params, 'ReferenceId')),\r\n component: NumberFieldFilter,\r\n },\r\n ];\r\n return result;\r\n};\r\n","import { Skeleton } from '@material-ui/lab';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\n\r\nexport interface CustomFormSkeletonProps {\r\n formFields: IFormFieldDto[];\r\n}\r\nexport function CustomFormSkeleton(props: CustomFormSkeletonProps) {\r\n // TODO: add skeleton based on the formfields definition\r\n return ;\r\n}\r\n","/**\r\n *\r\n * QuizCustomForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Formik } from 'formik';\r\nimport { Grid } from '@material-ui/core';\r\nimport { CustomFormField } from './CustomFormFields';\r\nimport { ValidationSchemaProvider } from '../Forms/ValidationSchemaProvider';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport {\r\n getCustomFormInitialValues,\r\n useCustomFormSchema,\r\n} from './CustomFormUtils';\r\nimport { CustomFormSkeleton } from './CustomFormSkeleton';\r\n\r\nexport interface QuizCustomFormProps {\r\n formFields: IFormFieldDto[];\r\n formValues?: IFormValueDto[];\r\n readonly?: boolean;\r\n onSubmit: (value: CustomFormValue) => void;\r\n bindSubmitForm: any;\r\n}\r\n\r\nexport interface CustomFormValue extends Record {}\r\n\r\nexport function QuizCustomForm({\r\n formFields,\r\n formValues,\r\n onSubmit,\r\n readonly,\r\n bindSubmitForm,\r\n}: QuizCustomFormProps) {\r\n const schema = useCustomFormSchema(formFields, false);\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n const initialValues = getCustomFormInitialValues(\r\n formFields,\r\n formValues,\r\n true,\r\n );\r\n if (initialValues === undefined) {\r\n // show progress while form values are being fetched\r\n return ;\r\n }\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n return (\r\n \r\n <>\r\n
    \r\n \r\n {formFields.map((formField, index) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { IQuizDto } from 'api/odata/generated/entities/IQuizDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IQuizSubmissionDto } from 'api/odata/generated/entities/IQuizSubmissionDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { push } from 'connected-react-router';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Box } from '@material-ui/core';\r\nimport parse from 'html-react-parser';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { Body } from 'app/components/Typography';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { QuizDetailsProps } from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { QuizCustomForm } from 'app/components/CustomForm/QuizCustomForm';\r\nimport { ParseFormFieldEnums } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nexport interface StartQuizProps extends SidePanelContentProps {\r\n id: string;\r\n closable: boolean;\r\n}\r\nexport function StartQuiz(props: StartQuizProps) {\r\n const { id, useSidePanel } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const User = useSelector(selectAuthenticatedUser);\r\n const fetchQuiz = async (quizId: number) =>\r\n httpClient\r\n .get(`/api/odata/v4/quizzes(${quizId})`, {\r\n $expand: ['Submissions', 'ServiceGroups'].join(','),\r\n })\r\n .then(value => {\r\n // Enums are serialized using string representations\r\n // parse enum values\r\n ParseFormFieldEnums(value.FormFields);\r\n // shuffle questions according to quiz settings\r\n if (value.ShuffleFields) {\r\n value.FormFields = value.FormFields.sort(() => 0.5 - Math.random());\r\n }\r\n // enumerate questions\r\n value.FormFields.forEach(\r\n (formField, index) =>\r\n (formField.Label = `${t(translations.Question)} ${index + 1}. ${\r\n formField.Label\r\n }`),\r\n );\r\n value.UsedAttempts = value.Submissions.filter(\r\n item =>\r\n item.SubmittedById === User?.Id &&\r\n (item.Score ?? 0) < (value.QuizTrainingPassingScore ?? 0),\r\n ).length;\r\n value.UserCanStartQuiz =\r\n value.UsedAttempts === 0 ||\r\n (value.QuizNumberOfAttempts ?? 0) === 0 ||\r\n value.UsedAttempts < (value.QuizNumberOfAttempts ?? 0);\r\n return value;\r\n });\r\n const [fetchQuizPromiseState, fetchQuizPromise] = usePromise(fetchQuiz);\r\n const [state, setState] = useAsyncExtendedState(\r\n undefined,\r\n );\r\n const [startQuiz, setStartQuiz] = React.useState(true);\r\n useEffectOnMount(() => {\r\n setState(fetchQuizPromise(+id));\r\n return () => {};\r\n });\r\n const isMobile = DetectIsMobile();\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n React.useEffect(() => {\r\n const messageKey = 'QuizLoad';\r\n if (fetchQuizPromiseState.error) {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Something went wrong.',\r\n key: messageKey,\r\n }),\r\n );\r\n }\r\n }, [fetchQuizPromiseState.error, actions, dispatch]);\r\n\r\n const [submitStatus, submitQuiz] = usePromise(\r\n async (values: Record) => {\r\n const formValues: IFormValueDto[] = Object.entries(values).map(\r\n ([formFieldId, value]) => ({\r\n Id: -1,\r\n FormFieldId: +formFieldId,\r\n Value: value,\r\n SourceValueId: null,\r\n AlertId: null,\r\n AlertTypeId: null,\r\n Readonly: false,\r\n CustomFormId: null,\r\n CustomFormName: null,\r\n DisplayValue: null,\r\n RequestId: null,\r\n ReservationId: null,\r\n ExperimentItemId: null,\r\n BudgetExperimentId: null,\r\n ServiceGroupUserId: null,\r\n ServiceGroupId: null,\r\n }),\r\n );\r\n const quizSubmission: Partial = {\r\n CustomFormId: +id,\r\n FormValues: formValues,\r\n };\r\n return httpClient.post>(\r\n `/api/odata/v4/quizsubmissions`,\r\n quizSubmission,\r\n );\r\n },\r\n );\r\n const [readonly] = React.useState(false);\r\n const [submission, setSubmission] = useAsyncExtendedState<\r\n Partial | undefined\r\n >(undefined);\r\n\r\n React.useEffect(() => {\r\n const messageKey = 'QuizSubmission';\r\n if (submitStatus.status === 'resolved') {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'success',\r\n message: 'Submission success.',\r\n key: messageKey,\r\n }),\r\n );\r\n }\r\n if (submitStatus.status === 'rejected') {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: 'Submission failed.',\r\n key: messageKey,\r\n }),\r\n );\r\n }\r\n }, [actions, dispatch, submitStatus.status]);\r\n\r\n const submissionId = submission?.Id;\r\n const resultQuiz = React.useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.QuizzDetails,\r\n props: {\r\n id: '' + submissionId,\r\n useSidePanel: useSidePanel,\r\n } as QuizDetailsProps,\r\n }),\r\n );\r\n } else {\r\n dispatch(push(`/quizzes/details/${submissionId}`));\r\n }\r\n }, [dispatch, layoutActions, submissionId, useSidePanel]);\r\n React.useEffect(() => {\r\n if (submissionId !== undefined) {\r\n resultQuiz();\r\n }\r\n }, [resultQuiz, submissionId]);\r\n const handleSubmit = (values: Record) =>\r\n setSubmission(submitQuiz(values));\r\n const submitFormRef = React.useRef(null);\r\n const handleSubmitForm = e => {\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const leftActions = React.useMemo(\r\n () => [\r\n () =>\r\n readonly !== true && startQuiz ? (\r\n \r\n }\r\n onClick={() => setStartQuiz(false)}\r\n >\r\n {isMobile || !sidePanelExpanded\r\n ? t(translations.Continue)\r\n : t(translations.ContinueToQuiz)}\r\n \r\n \r\n ) : (\r\n \r\n }\r\n onClick={handleSubmitForm}\r\n >\r\n {t(translations.Submit)}\r\n \r\n \r\n ),\r\n ],\r\n [isMobile, readonly, sidePanelExpanded, startQuiz, t],\r\n );\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () =>\r\n readonly !== true && (\r\n \r\n }\r\n onClick={() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n } else {\r\n dispatch(push(`/quizzes`));\r\n }\r\n }}\r\n >\r\n {state?.UserCanStartQuiz\r\n ? isMobile || !sidePanelExpanded\r\n ? t(translations.Cancel)\r\n : t(translations.CancelYourSubmission)\r\n : t(translations.BackToQuizzes)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [\r\n dispatch,\r\n isMobile,\r\n layoutActions,\r\n readonly,\r\n sidePanelExpanded,\r\n state?.UserCanStartQuiz,\r\n t,\r\n useSidePanel,\r\n ]);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {state.UserCanStartQuiz ? (\r\n \r\n \r\n {(t(translations.QuizDescription) as string)\r\n .replace(\r\n '{0}',\r\n state?.FormFields?.length.toString(),\r\n )\r\n .replace(\r\n '{1}',\r\n (state.QuizTrainingPassingScore ?? 0).toString(),\r\n )}\r\n \r\n\r\n \r\n {startQuiz ? (\r\n \r\n \r\n {parse(state?.QuizInstructions || '')}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {\r\n \r\n }\r\n \r\n \r\n )}\r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n {t(translations.QuizFiledAttemptsMessage).replace(\r\n '{0}',\r\n state.UsedAttempts.toString(),\r\n )}\r\n \r\n \r\n {state.EquipmentName && (\r\n \r\n \r\n \r\n {t(\r\n translations.QuizFiledAttemptsInstrumentMessage,\r\n )}\r\n \r\n \r\n {state.EquipmentName}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n leftActions={state?.UserCanStartQuiz ? leftActions : undefined}\r\n rightActions={rightActions}\r\n closable={true}\r\n />\r\n );\r\n}\r\n","import { Chip, ChipProps, Theme, withStyles } from '@material-ui/core';\r\n\r\nexport interface StatusChipProps extends ChipProps {}\r\n\r\nconst StyledChip = withStyles((theme: Theme) => ({\r\n // root: {\r\n // borderRadius: 4,\r\n // backgroundColor: theme.palette.primary.main,\r\n // height: 24,\r\n // color: theme.palette.common.white,\r\n // gap: 4,\r\n // paddingBlock: '2px',\r\n // '&$disabled': {\r\n // opacity: 1,\r\n // backgroundColor: theme.palette.common.grayComponents,\r\n // color: theme.palette.common.white,\r\n // pointerEvents: 'none',\r\n // },\r\n // '&:hover, &:focus': {\r\n // backgroundColor: theme.palette.primary.dark,\r\n // color: theme.palette.common.white,\r\n // },\r\n // },\r\n // disabled: {\r\n // backgroundColor: theme.palette.common.grayComponents,\r\n // color: theme.palette.common.white,\r\n // },\r\n // label: {\r\n // fontFamily: `'Lato', sans-serif`,\r\n // fontStyle: 'normal',\r\n // fontWeight: 400,\r\n // fontSize: '14px',\r\n // lineHeight: '141%',\r\n // letterSpacing: '0.1px',\r\n // },\r\n // labelSmall: {\r\n // fontFamily: `'Lato', sans-serif`,\r\n // fontStyle: 'normal',\r\n // fontWeight: 400,\r\n // fontSize: '14px',\r\n // lineHeight: '141%',\r\n // letterSpacing: '0.1px',\r\n // },\r\n // clickable: {\r\n // backgroundColor: theme.palette.primary.main,\r\n // color: theme.palette.common.white,\r\n // },\r\n // sizeSmall: {\r\n // height: 20,\r\n // },\r\n // deleteIcon: {\r\n // color: theme.palette.primary.contrastText,\r\n // height: 18,\r\n // width: 18,\r\n // '&:hover': {\r\n // color: fade(theme.palette.primary.contrastText, 0.8),\r\n // },\r\n // },\r\n}))(Chip);\r\n\r\nexport const StatusChip = (props: StatusChipProps) => {\r\n return ;\r\n};\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { StatusChip } from 'app/components/BasicChip/StatusChip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetLink } from '../AssetPopUp/OpenAssetDetails';\r\nimport {\r\n allowedToViewAlert,\r\n IAlertPermissionCheckRecord,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { WorkOrderLink } from '../Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport const getColumns = (\r\n t: TFunction,\r\n appSettings?: AppSettings,\r\n globalSettings?: GlobalSettings,\r\n user?: AuthenticatedUser,\r\n useSidePanel?: boolean,\r\n openPanel?: (state: SidePanelOpenState) => void,\r\n): Column[] => {\r\n return [\r\n {\r\n Header: t(translations.Id) as string,\r\n accessor: 'Id',\r\n //for testing comments component\r\n //Cell: WorkOrderIdRenderer,\r\n Cell: ({ value, row }) => {\r\n return allowedToViewAlert(\r\n user,\r\n row.original as IAlertPermissionCheckRecord,\r\n ) && value !== null ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n );\r\n },\r\n },\r\n //Attachment of Comment\r\n {\r\n Header: () => (\r\n <>\r\n {t(translations.Attachment) as string} \r\n \r\n ),\r\n accessor: 'AttachmentExist',\r\n Cell: ({ value, row }) => (\r\n <>{value === true ? : <>}\r\n ),\r\n },\r\n {\r\n Header: t(translations.AssetName) as string,\r\n accessor: 'AssetName', // AssetName\r\n Cell: ({ value, row }) =>\r\n !!row.original.AssetId ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n ),\r\n },\r\n {\r\n Header: t(translations.ServiceGroup) as string,\r\n accessor: 'ServiceGroup', // Laboratory\r\n },\r\n {\r\n Header: t(translations.AlertDescription) as string,\r\n accessor: 'AlertDescription', // Description\r\n Cell: DescriptionCell({ width: 'short' }),\r\n },\r\n {\r\n Header: t(translations.AlertTitle) as string,\r\n accessor: 'AlertTitle', // Subject\r\n },\r\n {\r\n Header: t(translations.StatusName) as string,\r\n accessor: 'StatusName', // StatusName\r\n },\r\n {\r\n Header: t(translations.AlertType) as string,\r\n accessor: 'AlertType', // WorkOrderType\r\n },\r\n {\r\n Header: t(translations.EventDueDate) as string,\r\n accessor: 'EventStart', // WorkOrderStart\r\n Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)},\r\n },\r\n {\r\n Header: t(translations.EventEnd) as string,\r\n accessor: 'EventEnd', // WorkOrderEnd\r\n Cell: ({ value }) => {\r\n if (value !== null) {\r\n return <>{dateUtils.shortDateTimeFormat(value)};\r\n } else {\r\n return <>;\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.ReportedBy) as string,\r\n accessor: 'ReportedBy',\r\n Cell: ({ value, row }) => (\r\n <>\r\n \r\n \r\n ),\r\n },\r\n {\r\n Header: t(translations.AssignedUsers) as string,\r\n accessor: 'AssignedUsers',\r\n Cell: ({ value, row }) => {\r\n if (value !== undefined) {\r\n let users = value.map((item, i) => {\r\n return (\r\n \r\n \r\n
    \r\n
    \r\n );\r\n });\r\n return <>{users};\r\n }\r\n return t(translations.NA) as string;\r\n },\r\n },\r\n {\r\n Header: t(translations.LastUpdated) as string,\r\n accessor: 'LastUpdated', // UpdatedAt\r\n Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)},\r\n },\r\n {\r\n Header: t(translations.Reservation) as string,\r\n accessor: 'Reservation', // ReservationId\r\n },\r\n {\r\n Header: t(translations.LastComment) as string,\r\n accessor: 'LastComment',\r\n Cell: DescriptionCell({ width: 'medium' }),\r\n },\r\n {\r\n Header: t(translations.LastCommentBy) as string,\r\n accessor: 'LastCommentBy',\r\n },\r\n {\r\n Header: t(translations.LastCommentAt) as string,\r\n accessor: 'LastCommentAt',\r\n Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)},\r\n },\r\n {\r\n Header: t(translations.AlertOfflineTime) as string,\r\n accessor: 'AlertOfflineTime', // OfflineTime (h)\r\n Cell: ({ value, row }) => {\r\n if (value) {\r\n if (value > 69000000) {\r\n return (\r\n }\r\n variant=\"outlined\"\r\n />\r\n );\r\n } else {\r\n return value;\r\n }\r\n } else {\r\n return <>{'N/A'};\r\n }\r\n // let startTime: Date | null = value;\r\n // let endTime: Date | null = row.original.OfflineEnd;\r\n // if (startTime !== null && endTime !== null) {\r\n // let newStartTime = new Date(startTime);\r\n // let newEndTime = new Date(endTime);\r\n // let timeDiff =\r\n // (newEndTime.getTime() - newStartTime.getTime()) / 36e5;\r\n // return <> {roundTwoPlacesAfterDecimalPoint(value)} ;\r\n // } else return <>;\r\n },\r\n },\r\n ];\r\n};\r\n","import fileDownload from 'js-file-download';\r\nimport * as Papa from 'papaparse';\r\n\r\nexport type CsvColumnsMapType = { [key in keyof T]: 'string' };\r\n\r\nexport async function writeCsvFile(\r\n fields: string[],\r\n data: string[][],\r\n): Promise {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const csv = Papa.unparse({ fields: fields, data: data });\r\n resolve(csv);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\nexport async function exportCsv({\r\n data,\r\n fields,\r\n fileName = 'file.csv',\r\n}: {\r\n data: unknown[][];\r\n fields: string[];\r\n fileName: string;\r\n}): Promise {\r\n const stringData = data.map(row =>\r\n row.map(value => (value as any)?.toString()),\r\n );\r\n const csvContent = await writeCsvFile(fields, stringData);\r\n fileDownload(csvContent, fileName);\r\n}\r\n","import {\r\n call,\r\n put,\r\n takeLatest,\r\n debounce,\r\n select,\r\n takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { samplesListActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n IRunDetails,\r\n ISample,\r\n ISampleListTableState,\r\n ISampleRun,\r\n ISampleRunUpdate,\r\n ISampleTarget,\r\n} from './types';\r\nimport { push } from 'connected-react-router';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { AxiosError } from 'axios';\r\nimport * as Papa from 'papaparse';\r\nimport { Identifiable } from 'types/common';\r\nimport { selectRunDetails, selectSamplesTableState } from './selectors';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\n\r\nimport { getExportParameters, buildURL } from 'utils/url-utils';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { selectSamplePlatesTableState } from '../../SamplePlatesPage/slice/selectors';\r\nimport { deleteSamples, IDeleteSamplesResult } from 'api/SamplesApi';\r\nimport { exportCsv } from 'utils/export';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicTableRefreshEventHandler } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\ninterface ODataParams {\r\n $top: number | undefined;\r\n $skip: number | undefined;\r\n $count?: boolean;\r\n $orderby?: string;\r\n $filter?: string;\r\n $select?: string;\r\n}\r\nexport function getLoadDataParams(\r\n currentTableState: Partial,\r\n): ODataParams {\r\n const params = {\r\n $count: true,\r\n $top: currentTableState.pageSize,\r\n $skip:\r\n (currentTableState.pageIndex ?? 1) * (currentTableState.pageSize ?? 5),\r\n $orderby:\r\n currentTableState.sortBy\r\n ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n .join(',') || undefined,\r\n //$select: ,\r\n $filter: TableFilterBuilder(\r\n currentTableState.customFilters as Array>,\r\n currentTableState.globalFilter,\r\n currentTableState.serviceGroups,\r\n currentTableState.searchColumns,\r\n ),\r\n $select:\r\n currentTableState.visibleColumns === undefined\r\n ? undefined\r\n : currentTableState.visibleColumns.join(','),\r\n };\r\n return params;\r\n}\r\nasync function loadData(currentTableState) {\r\n const url = '/api/odata/v4/samples';\r\n const params = getLoadDataParams(currentTableState);\r\n const result = await httpClient.get(url, params);\r\n return result;\r\n}\r\nfunction* doExport(action: PayloadAction) {\r\n try {\r\n const tableState = yield select(selectSamplesTableState);\r\n const tableParams = getLoadDataParams({\r\n ...tableState,\r\n ...{ visibleColumns: action.payload.visibleColumns },\r\n });\r\n const entitySetURl = '/api/odata/v4/samples';\r\n var params = getExportParameters(tableParams);\r\n const url = buildURL(entitySetURl, params);\r\n yield call(openExportLink, url);\r\n } catch (error) {\r\n console.error('doExport failed', error);\r\n }\r\n}\r\nasync function loadIds(currentTableState) {\r\n const url = '/api/odata/v4/samples';\r\n const params = getLoadDataParams(currentTableState);\r\n params.$top = undefined;\r\n params.$skip = undefined;\r\n params.$count = undefined;\r\n params.$orderby = undefined;\r\n params.$select = 'Id';\r\n const result = await httpClient.get(url, params);\r\n return result;\r\n}\r\nfunction* doLoadData(\r\n action: PayloadAction<{\r\n tableState: ISampleListTableState;\r\n columns: (keyof ISample)[] | undefined;\r\n }>,\r\n) {\r\n try {\r\n const data = yield call(loadData, action.payload);\r\n yield put(actions.loadSamplesList_Success(data));\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\nfunction* doUpdateField(action: PayloadAction>) {\r\n const url = `/api/odata/v4/samples(${action.payload.Id})`;\r\n const payload: Partial = { ...action.payload };\r\n delete payload.Id;\r\n try {\r\n yield call(httpClient.patch, url, payload);\r\n yield put(actions.updateField_Success());\r\n } catch (error) {\r\n const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n ?.message;\r\n if (msg !== undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplesListPage.saga.updateField',\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n yield put(actions.updateField_Error());\r\n }\r\n}\r\nfunction* doRunSelectedSamples(\r\n action: PayloadAction<{ runType?: string; samples: ISample[] | undefined }>,\r\n) {\r\n try {\r\n const httpUrl = '/api/odata/v4/sampleruns';\r\n let samples = action.payload.samples;\r\n if (samples === undefined) {\r\n const tableState = yield select(selectSamplesTableState);\r\n const allsamples = yield call(loadIds, tableState);\r\n samples = allsamples.value;\r\n }\r\n if (samples === undefined) {\r\n return;\r\n }\r\n const httpPayload = {\r\n RunType: action.payload.runType,\r\n Samples: samples.map(f => ({\r\n Id: f.Id,\r\n })),\r\n };\r\n const response = yield call(httpClient.post, httpUrl, httpPayload);\r\n yield put(push(`/samples/runs/details/${response.Id}`));\r\n } catch (error: unknown) {\r\n console.error(error);\r\n }\r\n}\r\nfunction* doCompleteRun(action: PayloadAction) {\r\n try {\r\n const url = `/api/odata/v4/sampleruns(${action.payload.Id})`;\r\n // note that api call does not return dto but rater a custom summary of the operation\r\n const completeRunResponse: {\r\n derivativesCount: number;\r\n skippedSamplesCount: number;\r\n } = yield call(httpClient.put, url, action.payload);\r\n yield put(actions.completeRun_Success);\r\n const msg = [\r\n i18next.t(translations.XSamplesWereProcessed, completeRunResponse),\r\n ];\r\n if (completeRunResponse.skippedSamplesCount > 0) {\r\n msg.push(\r\n i18next.t(translations.XSamplesWereSkipped, completeRunResponse),\r\n );\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: msg.join(' '),\r\n variant:\r\n completeRunResponse.skippedSamplesCount === 0 &&\r\n completeRunResponse.derivativesCount > 0\r\n ? 'success'\r\n : completeRunResponse.skippedSamplesCount > 0 &&\r\n completeRunResponse.derivativesCount > 0\r\n ? 'warning'\r\n : 'error',\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const msg =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n 'Operation Failed';\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplesListPage.saga.updateField',\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doUpdateRun(action: PayloadAction) {\r\n try {\r\n const url = '/api/odata/v4/SampleRuns/SampleRunUpdate';\r\n const data = {\r\n runupdate: action.payload,\r\n };\r\n const result = yield call(httpClient.post, url, data);\r\n yield put(actions.updateRun_Success(result));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: 'success',\r\n variant: 'success',\r\n }),\r\n );\r\n } catch (error: unknown) {\r\n const msg =\r\n (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n 'Operation Failed';\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'SamplesListPage.saga.updateField',\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n}\r\nfunction* doLoadRunDetqails(\r\n action: PayloadAction<{ id: number; columns: Array | undefined }>,\r\n) {\r\n try {\r\n const url = `/api/odata/v4/sampleruns(${action.payload.id})`;\r\n const runDetails: IRunDetails = yield call(httpClient.get, url);\r\n\r\n const samples_url = `/api/odata/v4/sampleruns(${action.payload.id})/Samples`;\r\n const samples_response = yield call(httpClient.get, samples_url);\r\n runDetails.Samples = samples_response.value;\r\n yield put(actions.loadRunDetqails_Success(runDetails));\r\n } catch (error: unknown) {\r\n console.error(error);\r\n yield put(actions.completeRun_Success);\r\n }\r\n}\r\n/**\r\n * Reads a csv file and returns parse results\r\n * todo: move to shared utils location\r\n * @param file File\r\n * @returns parse results\r\n */\r\nfunction readCsvFile(file: File): Promise> {\r\n return new Promise((resolve, reject) => {\r\n Papa.parse(file, {\r\n header: true,\r\n dynamicTyping: true,\r\n\r\n complete: results => {\r\n resolve(results);\r\n },\r\n error: error => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n}\r\nconst platesUrl = `/api/odata/v4/SamplePlates`;\r\nasync function createPlate(samplePlateId: string, plate: ISampleCreateBase) {\r\n const httpPayload: Partial = {\r\n Id: samplePlateId,\r\n RoomId: plate.Room?.Id ?? null,\r\n LocationId: plate.Location?.Id ?? null,\r\n SamplePlateTypeId: plate.SamplePlateType?.Id,\r\n ServiceGroupId: plate.ServiceGroup?.Id ?? null,\r\n Active: plate.Active ?? true,\r\n IsRack: plate.IsRack ?? false,\r\n };\r\n try {\r\n return await httpClient.post(platesUrl, httpPayload);\r\n } catch (error: unknown) {}\r\n}\r\nfunction createPlates(\r\n runSamples: (Identifiable & ISampleTarget)[],\r\n plate: ISampleCreateBase,\r\n) {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n for (const record of runSamples) {\r\n const tpid = record.TargetPlateId;\r\n if (tpid !== undefined && tpid !== null && tpid !== '') {\r\n const params: {\r\n $filter: string;\r\n } = {\r\n // eslint-disable-next-line no-useless-concat\r\n $filter: '(Id eq ' + \"'\" + tpid + \"'\" + ')',\r\n };\r\n try {\r\n const count = await httpClient.get(`${platesUrl}/$count`, params);\r\n if (count === 0) {\r\n await createPlate(tpid, plate);\r\n }\r\n } catch {}\r\n }\r\n }\r\n resolve(true);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\n\r\nfunction* doImportRunDetails(\r\n action: PayloadAction<{ file: File; plate: ISampleCreateBase | null }>,\r\n) {\r\n try {\r\n const file = action.payload.file;\r\n const result: Papa.ParseResult> = yield call(\r\n readCsvFile,\r\n file,\r\n );\r\n type t = Identifiable & ISampleTarget;\r\n const records = result.data\r\n .filter(record => record['Id'] !== null)\r\n .map(\r\n record =>\r\n ({\r\n Id: record['Id'] as number,\r\n TargetPlateId: record['target sample plate id']?.toString()?.trim(),\r\n TargetPosition: record['target sample plate position']\r\n ?.toString()\r\n ?.trim(),\r\n TargetConcentration: record['target sample concentration (mg/mL)'],\r\n TargetVolume: record['target sample volume (ul)'],\r\n TargetTubeLabel: record['target tube id']?.toString()?.trim(),\r\n TargetSampleType: record['target sample type']?.toString()?.trim(),\r\n } as t),\r\n );\r\n const runDetails: IRunDetails = yield select(selectRunDetails);\r\n\r\n const runSamples = records\r\n .filter(record =>\r\n runDetails.Samples.find(sample => sample.Id === record.Id),\r\n )\r\n .map(record => {\r\n const result: Partial = { Id: record.Id };\r\n const runType = runDetails.RunType;\r\n const positionImport: RunTypesUnion[] = [\r\n 'Fractioning',\r\n 'Labeling',\r\n 'StandardRun',\r\n ];\r\n if (positionImport.includes(runType)) {\r\n result.TargetPlateId = record?.TargetPlateId;\r\n result.TargetPosition = record?.TargetPosition;\r\n result.TargetTubeLabel = record?.TargetTubeLabel;\r\n result.TargetSampleType = record?.TargetSampleType;\r\n }\r\n const volumeImport: RunTypesUnion[] = [\r\n 'Fractioning',\r\n 'Labeling',\r\n 'MassSpec',\r\n ];\r\n if (volumeImport.includes(runType)) {\r\n result.TargetVolume = record.TargetVolume;\r\n result.TargetConcentration = record.TargetConcentration;\r\n }\r\n return record;\r\n });\r\n\r\n // Checking and creating missing Plates\r\n if (action.payload.plate !== null) {\r\n yield call(createPlates, runSamples, action.payload.plate);\r\n }\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'runsamples_import',\r\n variant: records.length === runSamples.length ? 'success' : 'warning',\r\n message:\r\n 'Import finished: Matching sample IDs were updated with the related target plate ID and target plate positions as per the file. Violations for samples already existing in the target plate position will be done on clicking Complete',\r\n }),\r\n );\r\n yield put(actions.readImportFile_Success(runSamples));\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\n\r\nfunction* doLoadAllSelectedSamples(\r\n action: PayloadAction,\r\n) {\r\n try {\r\n const tablestate = yield select(selectSamplesTableState);\r\n const foo = yield call(loadIds, tablestate);\r\n yield put(actions.loadAllFilteredSamples_Success(foo));\r\n } catch {}\r\n}\r\n\r\nfunction* doExportRun(action: PayloadAction) {\r\n try {\r\n const fields = [\r\n 'Id',\r\n 'analytical sample id',\r\n 'TMT Label',\r\n 'TMT Run Set',\r\n 'source sample type',\r\n 'source sample plate id',\r\n 'source sample plate position',\r\n 'source tube id',\r\n 'source sample volume (ul)',\r\n 'source sample concentration (mg/mL)',\r\n 'target sample type',\r\n 'target sample plate id',\r\n 'target sample plate position',\r\n 'target tube id',\r\n 'target sample volume (ul)',\r\n 'target sample concentration (mg/mL)',\r\n ];\r\n const data = action.payload.map(item => [\r\n item.Id,\r\n item.AnalyticalSampleId,\r\n item.TMT_Label,\r\n item.TMT_Set,\r\n item.TMT_Type,\r\n item.SamplePlateId,\r\n item.Position,\r\n item.TubeLabel,\r\n item.Volume,\r\n item.Concentration,\r\n item.TargetSampleType,\r\n item.TargetPlateId,\r\n item.TargetPosition,\r\n item.TargetTubeLabel,\r\n item.TargetVolume,\r\n item.TargetConcentration,\r\n ]);\r\n\r\n yield call(() =>\r\n exportCsv({\r\n fields: fields,\r\n data: data,\r\n fileName: 'file.csv',\r\n }),\r\n );\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\n\r\nfunction* doDeleteSamples(\r\n action: PayloadAction<{\r\n selectedRows: ISample[];\r\n refresh: BasicTableRefreshEventHandler | undefined;\r\n }>,\r\n) {\r\n let r: IDeleteSamplesResult = yield call(\r\n deleteSamples,\r\n action.payload.selectedRows,\r\n );\r\n action.payload.refresh?.();\r\n for (const error of r.errors) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: error.message,\r\n }),\r\n );\r\n }\r\n if (r.successCount > 0) {\r\n // reload table data\r\n const tableState = yield select(selectSamplePlatesTableState);\r\n yield put(actions.loadSamplesList(tableState));\r\n\r\n // post success notification of deleted records\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.XRecordsWereBeDeleted, {\r\n x: r.successCount,\r\n }),\r\n }),\r\n );\r\n }\r\n}\r\n\r\nexport function* samplesListSaga() {\r\n yield debounce(500, actions.loadSamplesList.type, doLoadData);\r\n yield debounce(500, actions.updateField.type, doUpdateField);\r\n yield takeLatest(actions.runSelectedSamples.type, doRunSelectedSamples);\r\n yield takeLatest(actions.completeRun.type, doCompleteRun);\r\n yield takeLatest(actions.updateRun.type, doUpdateRun);\r\n yield takeLatest(actions.loadRunDetqails.type, doLoadRunDetqails);\r\n yield takeLatest(actions.readImportFile.type, doImportRunDetails);\r\n yield takeLatest(\r\n actions.loadAllFilteredSamples.type,\r\n doLoadAllSelectedSamples,\r\n );\r\n yield takeLatest(actions.exportRun.type, doExportRun);\r\n yield takeLeading(actions.deleteSamples.type, doDeleteSamples);\r\n yield takeLatest(actions.export.type, doExport);\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nexport const AssetsApi = {\r\n LocalAppUpgrade: (ids: number[]) => {\r\n const data = { ids };\r\n const url = '/api/odata/v4/MyAssets/StartUpgradeIds';\r\n return httpClient.post(url, data);\r\n },\r\n};\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport { AddWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/AddWorkOrder';\r\n//import { AssetRangesExportForImport } from 'app/pages/Actions/GlobalSelectedActions/AssetRangesExportForImport';\r\nimport { BringBackUp } from 'app/pages/Actions/GlobalSelectedActions/BringBackUp';\r\nimport { CloneEquipmentSettings } from 'app/pages/Actions/GlobalSelectedActions/CloneEquipments';\r\nimport { DownWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/DownWorkOrder';\r\nimport { OpenCalendar } from 'app/pages/Actions/GlobalSelectedActions/OpenCalendar';\r\nimport { OpenWorkOrders } from 'app/pages/Actions/GlobalSelectedActions/OpenWrokOrders';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { AddToLists } from 'app/pages/SavedViewsPage/AddToLists';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TFunction } from 'i18next';\r\nimport fileDownload from 'js-file-download';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport { ImportAdditionalData } from 'app/components/PopupImportExport/Actions/Types';\r\nimport { PrintSelectedAssetLabelsButton } from 'app/components/LabelPrint/PrintSelectedAssetLabelsButton';\r\nimport { mapToAssetDto } from 'app/pages/AssetPopUp/IAsset';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { ExportQRCodesButton } from 'app/components/QrCodeExport';\r\nimport { AssetsApi } from '../Actions/Api';\r\n\r\nexport interface GetSelectedActionsProps {\r\n enableSavedLists?: boolean;\r\n canExportAssetRanges?: boolean;\r\n isShowAllCores?: boolean;\r\n authenticatedUser?: AuthenticatedUser;\r\n useSidePanel?: boolean;\r\n}\r\n\r\nexport function GetSelectedActions(\r\n t: TFunction,\r\n props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer[] {\r\n const { allowedToView } = useAssetsPermissions();\r\n const ap = useAdminPermissions();\r\n const allowedToImport = React.useCallback(\r\n (rows: any[]): any[] => {\r\n return rows.filter(r => ap.allowedToAdd(r) && ap.allowedToEdit(r));\r\n },\r\n [ap],\r\n );\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const enabledByCores = React.useCallback(\r\n (rows: IMyAssetsRow[]) => {\r\n return !props.isShowAllCores\r\n ? true\r\n : rows.every(f =>\r\n selectedServiceGroups?.some(g => g.Id === f.ServiceGroupId),\r\n );\r\n },\r\n [props.isShowAllCores, selectedServiceGroups],\r\n );\r\n const SelectedActions: SelectedRowsActionRenderer[] = useMemo(\r\n () => [\r\n rows =>\r\n props.enableSavedLists &&\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.AddToList) &&\r\n enabledByCores(rows) && (\r\n \r\n rows.map(item => {\r\n return {\r\n Id: item.ServiceId,\r\n Name: item.Name,\r\n } as Entity;\r\n })\r\n }\r\n getAssets={rows => {\r\n let ids = rows.map(item => item.Id).join(',');\r\n return initAssetsData(ids);\r\n }}\r\n />\r\n ),\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenCalendar) &&\r\n enabledByCores(rows) && (\r\n \r\n rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n }\r\n bookMultiple\r\n />\r\n ),\r\n /* Commented according to BKT-7297 */\r\n /* (rows, refresh) =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenTimeline) && (\r\n \r\n rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n }\r\n />\r\n ), */\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenWorkOrders) &&\r\n enabledByCores(rows) && (\r\n r.map(a => a.Id) || []}\r\n />\r\n ),\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.AddWorkOrder) &&\r\n enabledByCores(rows) && (\r\n {\r\n let ids = rows.map(item => item.Id).join(',');\r\n return initAssetsData(ids);\r\n }}\r\n buttonName={t(translations.AddEvent)}\r\n useSidePanel={props.useSidePanel}\r\n />\r\n ),\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.DownWorkOrder) &&\r\n enabledByCores(rows) && (\r\n {\r\n let ids = rows.map(item => item.Id).join(',');\r\n return initAssetsData(ids);\r\n }}\r\n buttonName={t(translations.TakeDown)}\r\n useSidePanel={props.useSidePanel}\r\n />\r\n ),\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.CloneEquipments) && (\r\n \r\n rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n }\r\n />\r\n ),\r\n (rows, onRefresh) => {\r\n if (\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportForImport)\r\n ) {\r\n const exportRows = allowedToImport(rows);\r\n if (exportRows.length > 0) {\r\n return (\r\n \r\n new Promise(async (resolve, reject) => {\r\n const selectedRows = exportRows.map(item => item.Id);\r\n const res = await ExportImportActions.ExportForImport(\r\n ScreensId.MyAssets,\r\n selectedRows,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined\r\n ? cd.split('filename=')[1]\r\n : 'ExportForImport_assets.xlsx';\r\n fileDownload(res.data, filename);\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n })\r\n }\r\n />\r\n );\r\n } else {\r\n return <>;\r\n }\r\n } else {\r\n return <>;\r\n }\r\n },\r\n (rows, onRefresh) => {\r\n if (\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportForImport) &&\r\n props.canExportAssetRanges\r\n ) {\r\n const exportRows = allowedToImport(rows);\r\n if (exportRows.length > 0) {\r\n return (\r\n // rows.map(r => r.Id)}\r\n ///>\r\n \r\n new Promise(async (resolve, reject) => {\r\n const selectedRows = exportRows.map(item => item.Id);\r\n const res = await ExportImportActions.ExportForImport(\r\n ScreensId.MyAssets,\r\n selectedRows,\r\n ImportAdditionalData.AssetRanges,\r\n );\r\n const cd = res.headers['content-disposition'];\r\n const filename =\r\n cd !== undefined\r\n ? cd.split('filename=')[1]\r\n : 'ExportForImport_assetRanges.xlsx';\r\n fileDownload(res.data, filename);\r\n let messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n })\r\n }\r\n />\r\n );\r\n } else {\r\n return <>;\r\n }\r\n } else {\r\n return <>;\r\n }\r\n },\r\n (rows, onRefresh) => {\r\n if (\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.DownloadImages)\r\n ) {\r\n return (\r\n \r\n new Promise(async (resolve, reject) => {\r\n const rowHasNoImages =\r\n rows.filter(f => f.ImageName === null).length > 0;\r\n if (rowHasNoImages) {\r\n const messages: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: ['One or more row has no image file'],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n } else {\r\n const downUrl = `api/AssetImages/Selected?selectedIds=${rows\r\n .map(r => r.Id)\r\n .join(',')}`;\r\n await openExportLink(downUrl);\r\n const messages: IResponseType = {\r\n SuccessMessages: [t(translations.Success)],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n }\r\n })\r\n }\r\n />\r\n );\r\n } else return <>;\r\n },\r\n rows =>\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.BringBackUp) &&\r\n enabledByCores(rows) &&\r\n rows.some(f => f.StatusId === 2 || f.StatusId === 3) && (\r\n \r\n rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n }\r\n getAssetIds={rows => rows.map(r => r.Id ?? 0).filter(f => f > 0)}\r\n useSidePanel={props.useSidePanel}\r\n />\r\n ),\r\n (rows, onRefresh) => {\r\n if (\r\n allowedToView(rows.map(mapToAssetDto), RenderTypes.PrintAssetLabels)\r\n ) {\r\n return (\r\n \r\n );\r\n }\r\n },\r\n (rows, onRefresh, toggleAllRowsSelected) => {\r\n if (allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportQRCodes)) {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n } else {\r\n }\r\n },\r\n (rows, onRefresh) => (\r\n \r\n new Promise((resolve, reject) => {\r\n const ids = rows.map(r => r.Id);\r\n return AssetsApi.LocalAppUpgrade(ids)\r\n .then(response => {\r\n const messages: IResponseType = {\r\n SuccessMessages: [t(translations.Success) as string],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n resolve(messages);\r\n })\r\n .catch(error => {\r\n console.log('status error', error);\r\n let err = t(translations.Failed) as string;\r\n reject(err);\r\n });\r\n })\r\n }\r\n />\r\n ),\r\n ],\r\n [\r\n allowedToImport,\r\n allowedToView,\r\n enabledByCores,\r\n props.canExportAssetRanges,\r\n props.enableSavedLists,\r\n props.useSidePanel,\r\n t,\r\n ],\r\n );\r\n\r\n return SelectedActions;\r\n}\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n ErrorServices,\r\n ReportConsumablesState,\r\n ServiceChangeStateParameters,\r\n} from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport {\r\n selectConnectedFiltersData,\r\n selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport {\r\n selectConnectedInitState,\r\n selectConsumablesHasErrors,\r\n selectConsumablesValueHandler,\r\n selectEditCreatableService,\r\n selectServiceChangeState,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { isEmpty } from 'lodash';\r\nimport { ConnectedFiltersControl } from 'app/components/Forms/FormConnectedFilters/ConnectedFiltersControl';\r\nimport {\r\n FieldHandler,\r\n FormListener,\r\n SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { BookQuickServices } from '../Details/components/BookQuickServices';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { ErrorsSummury } from 'app/components/Forms/FormsLayout/FormErrorSummury';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport {\r\n ListMessagesProps,\r\n SingleMessagesProps,\r\n} from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\n\r\nexport interface ConsumablesFormProps {\r\n onSubmit: (\r\n item: ReportConsumablesState,\r\n factor?: number,\r\n remarks?: string,\r\n ) => void;\r\n onAddServiceClick: (services: number[]) => void;\r\n initialValues: ReportConsumablesState;\r\n processing?: boolean;\r\n bindSubmitForm: any;\r\n isAdmin: boolean;\r\n user?: AuthenticatedUser;\r\n innerFormRef: React.RefObject>;\r\n connectedFiltersFormRef: React.MutableRefObject;\r\n globalSettings: GlobalSettingsType;\r\n onOfflineServiceClick?: (\r\n service: IOtherServices,\r\n discountFactor?: number,\r\n remarks?: string,\r\n ) => void;\r\n editCreatable?: boolean;\r\n onAddBatchClick: (\r\n batch: IInventoryBatchDto | null,\r\n serviceTypeId: number,\r\n ) => void;\r\n onRenewStockClick?: (service: IOtherServices) => void;\r\n setError?: (errors: ErrorServices) => void;\r\n offlineServicesErrors: ErrorServices[];\r\n}\r\n\r\nexport const ConsumablesForm = React.memo(function ConsumablesForm({\r\n onSubmit,\r\n processing,\r\n initialValues,\r\n bindSubmitForm,\r\n isAdmin,\r\n user,\r\n connectedFiltersFormRef,\r\n globalSettings,\r\n innerFormRef,\r\n onOfflineServiceClick,\r\n onAddServiceClick,\r\n editCreatable,\r\n onAddBatchClick,\r\n onRenewStockClick,\r\n offlineServicesErrors,\r\n setError,\r\n}: ConsumablesFormProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n\r\n const fieldHandler = useSelector(selectConsumablesValueHandler);\r\n const hasError = useSelector(selectConsumablesHasErrors);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const connectedData = useSelector(selectConnectedFiltersData);\r\n const connectedInit = useSelector(selectConnectedInitState);\r\n const serviceChangeState = useSelector(selectServiceChangeState);\r\n const editCreatableService = useSelector(selectEditCreatableService);\r\n const { newDate, getOffsetDate } = useSystemDate();\r\n // const readonly = !isAdmin;\r\n const [submitting, setSubmitting] = React.useState(\r\n undefined,\r\n );\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n globalSettings.fundingTypeBudgetEnabled\r\n );\r\n }, [globalSettings]);\r\n const resetSubmitting = () => {\r\n setSubmitting(true);\r\n };\r\n const handleSubmit = (\r\n values: ReportConsumablesState,\r\n factor?: number,\r\n remarks?: string,\r\n ) => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(values, factor, remarks);\r\n }\r\n };\r\n const resetFieldHandler = () => {\r\n dispatch(actions.resetConsumableValueHandler());\r\n };\r\n /// Local State ///\r\n const [serviceChanged, setServiceChanged] = React.useState(false);\r\n const [allIsValid, setAllIsValid] = React.useState(true);\r\n const [innerDiscountFactor, setDiscountFactor] = React.useState<\r\n number | null\r\n >(1);\r\n const [innerRemarks, setRemarks] = React.useState(null);\r\n const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n IOtherServices[]\r\n >(initialValues.Services ?? []);\r\n\r\n const validateForms = React.useCallback((isValid: boolean) => {\r\n setAllIsValid(isValid);\r\n }, []);\r\n\r\n /// useEffects\r\n React.useEffect(() => {\r\n if (innerFormRef.current) {\r\n innerFormRef.current.validateForm();\r\n }\r\n }, [innerFormRef]);\r\n React.useEffect(() => {\r\n if (!!serviceChangeState) {\r\n console.log('service settings: ', serviceSettings);\r\n if (!!serviceChangeState) {\r\n if (serviceSettings.budgetVisible) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'Budget',\r\n fieldValue: serviceChangeState.DefaultBudget,\r\n }),\r\n );\r\n if (\r\n fundingTypeVisible &&\r\n serviceChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n serviceChangeState.DefaultBudget?.FundingTypeId !== null\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'FundingType',\r\n fieldValue: serviceChangeState.DefaultBudget.FundingTypeId,\r\n }),\r\n );\r\n }\r\n if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n if (serviceChangeState.DefaultBudget !== null) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n },\r\n }),\r\n );\r\n }\r\n } else {\r\n if (\r\n connectedData?.UserGroup === null ||\r\n connectedData?.UserGroup === undefined\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id:\r\n (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n user?.ActiveUserGroup?.Id,\r\n Name:\r\n (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n user?.ActiveUserGroup?.Name,\r\n },\r\n }),\r\n );\r\n }\r\n }\r\n if (\r\n serviceSettings.budgetExpirementVisible &&\r\n serviceChangeState.DefaultExperiment !== null\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'BudgetExperiment',\r\n fieldValue: serviceChangeState.DefaultExperiment,\r\n }),\r\n );\r\n }\r\n } else {\r\n if (serviceSettings.isUserGroupCoordinator) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id: user?.ActiveUserGroup?.Id,\r\n Name: user?.ActiveUserGroup?.Name,\r\n },\r\n }),\r\n );\r\n } else if (\r\n connectedData?.UserGroup === null ||\r\n connectedData?.UserGroup === undefined\r\n ) {\r\n dispatch(\r\n connectedFiltersActions.setConnectedValue({\r\n fieldKey: 'UserGroup',\r\n fieldValue: {\r\n Id:\r\n (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n user?.ActiveUserGroup?.Id,\r\n Name:\r\n (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n user?.ActiveUserGroup?.Name,\r\n },\r\n }),\r\n );\r\n }\r\n }\r\n }\r\n dispatch(actions.resetServiceChangeState());\r\n }\r\n }, [\r\n actions,\r\n connectedData?.User,\r\n connectedData?.UserGroup,\r\n connectedFiltersActions,\r\n dispatch,\r\n fundingTypeVisible,\r\n serviceChangeState,\r\n serviceSettings,\r\n user?.ActiveUserGroup?.Id,\r\n user?.ActiveUserGroup?.Name,\r\n ]);\r\n React.useEffect(() => {\r\n dispatch(\r\n actions.setConsumableValue({\r\n fieldKey: 'Services',\r\n fieldValue: servicesSelected,\r\n }),\r\n );\r\n dispatch(actions.extendConsumablesData(servicesSelected));\r\n }, [actions, dispatch, servicesSelected]);\r\n\r\n const otherServicesSchema = Yup.array().of(\r\n Yup.mixed() as Yup.SchemaOf,\r\n );\r\n const reportConsumableSchema: Yup.SchemaOf = Yup.object(\r\n {\r\n Services: otherServicesSchema\r\n .min(1)\r\n .label(t(translations.Consumables) as string)\r\n .required(t(translations.err_OfflineServiceTypeRequired) as string),\r\n DiscountFactor: Yup.number()\r\n .nullable()\r\n .label(t(translations.DiscountFactor) as string)\r\n .max(9999)\r\n .min(0.01),\r\n Remarks: Yup.string()\r\n .nullable()\r\n .label(t(translations.Remarks) as string),\r\n },\r\n );\r\n const changeOfflineServices = React.useCallback(\r\n (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n if (operation === 'add') {\r\n let addedServ = services.filter(\r\n f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n setServicesSelected([...servicesSelected, ...addedServ]);\r\n setServiceChanged(true);\r\n }\r\n if (operation === 'remove') {\r\n let otherServices = servicesSelected.filter(f => {\r\n return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServicesSelected(otherServices);\r\n setServiceChanged(true);\r\n }\r\n if (operation === 'update') {\r\n setServicesSelected(\r\n servicesSelected.map(f => {\r\n let service = services.find(\r\n s => s.ServiceTypeID === f.ServiceTypeID,\r\n );\r\n if (!!service && service !== null) {\r\n return Object.assign({}, f, service);\r\n } else {\r\n return f;\r\n }\r\n }),\r\n );\r\n }\r\n },\r\n [servicesSelected, setServicesSelected],\r\n );\r\n const initServices = async (): Promise => {\r\n return new Promise(async resolve => {\r\n resolve(servicesSelected);\r\n });\r\n };\r\n const sortFunc = (a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n return b.Id - a.Id;\r\n };\r\n const prepareService = (\r\n serviceType: IOfflineServiceFilterDto,\r\n otherData?: IConnectedFiltersDto,\r\n discountFactor?: number,\r\n remarks?: string,\r\n ) => {\r\n let batch = serviceType.InventoryBatchesEnabled\r\n ? !!serviceType.InventoryBatches &&\r\n serviceType.InventoryBatches.length > 0\r\n ? serviceType.InventoryBatches.filter(\r\n f =>\r\n (f.ExpirationDate === null ||\r\n getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n f.StokRenewed,\r\n ).sort(sortFunc)[0]\r\n : null\r\n : null;\r\n let data = {\r\n Id: 0,\r\n BookedBy: otherData?.User?.Id,\r\n UserDisplayName: otherData?.User?.Name,\r\n BudgetID: otherData?.Budget?.Id,\r\n Budget: otherData?.Budget?.Name,\r\n BudgetExperimentId: otherData?.BudgetExperiment?.Id,\r\n BudgetExperimentName: otherData?.BudgetExperiment?.Name,\r\n Quantity: serviceType.DefaultQuantity,\r\n DefaultQuantity: serviceType.DefaultQuantity,\r\n ExternalCustomerId: otherData?.ExternalCustomer?.Id,\r\n ExternalCustomerName: otherData?.ExternalCustomer?.Name,\r\n FundingType: otherData?.FundingType?.Id,\r\n IntQuantityOnly: serviceType.IntQuantityOnly,\r\n DiscountFactor: Number(discountFactor),\r\n InstituteProjectId: otherData?.InstituteProject?.Id,\r\n InstituteProjectName: otherData?.InstituteProject?.Name,\r\n PurchaseOrder: otherData?.PurchaseOrder,\r\n Reference: otherData?.Reference,\r\n Mandatory: false,\r\n Remarks: remarks ?? null,\r\n ReservationId: null,\r\n ServiceDate: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(otherData?.StartTime ?? newDate()),\r\n ),\r\n ServiceTypeID: serviceType.Id,\r\n ServiceType: serviceType.Name,\r\n ServiceGroupId: serviceType.ServiceGroupId,\r\n Units: serviceType.UnitTypeName,\r\n UserGroup: otherData?.UserGroup?.Id,\r\n UserGroupName: otherData?.UserGroup?.Name,\r\n AllowToUser: serviceType.AllowToUser,\r\n BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n StaffOnly: serviceType.StaffOnly,\r\n HideProjects: serviceType.HideProjects,\r\n InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n InventoryBatchId: batch === null ? null : batch.Id,\r\n InventoryBatchName: batch === null ? null : batch.Name,\r\n InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n } as IOtherServices;\r\n return data;\r\n };\r\n const createService = async (\r\n serviceType: IOfflineServiceFilterDto,\r\n discountFactor?: number,\r\n remarks?: string,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticService = prepareService(\r\n serviceType,\r\n connectedData,\r\n discountFactor,\r\n remarks,\r\n );\r\n changeOfflineServices([staticService], 'add');\r\n resolve(staticService);\r\n });\r\n };\r\n const createServices = async (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n discountFactor?: number,\r\n remarks?: string,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticServices = serviceTypes.map(f =>\r\n prepareService(f, connectedData, discountFactor, remarks),\r\n );\r\n changeOfflineServices(staticServices, 'add');\r\n resolve(staticServices);\r\n });\r\n };\r\n const onRemoveService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'remove');\r\n resolve(service);\r\n });\r\n };\r\n const onRemoveServices = async (services: IOtherServices[]) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices(services, 'remove');\r\n resolve(services);\r\n });\r\n };\r\n const onUpdateService = async (service: IOtherServices) => {\r\n return new Promise(async (resolve, reject) => {\r\n changeOfflineServices([service], 'update');\r\n resolve(service);\r\n });\r\n };\r\n const onAddAndRemoveServices = async (\r\n serviceTypes: IOfflineServiceFilterDto[],\r\n removed: IOtherServices[],\r\n discountFactor?: number,\r\n remarks?: string,\r\n ): Promise => {\r\n return new Promise(async (resolve, reject) => {\r\n let staticServices = serviceTypes.map(f =>\r\n prepareService(f, connectedData, discountFactor, remarks),\r\n );\r\n let addedServ = staticServices.filter(\r\n f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n );\r\n let otherServices = servicesSelected.filter(f => {\r\n return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n });\r\n setServicesSelected([...otherServices, ...addedServ]);\r\n setServiceChanged(true);\r\n resolve([...otherServices, ...addedServ]);\r\n });\r\n };\r\n React.useEffect(() => {\r\n let active =\r\n editCreatableService !== undefined &&\r\n servicesSelected.some(\r\n f => f.ServiceTypeID === editCreatableService.ServiceTypeID,\r\n );\r\n if (active && editCreatableService !== undefined) {\r\n changeOfflineServices([editCreatableService], 'update');\r\n dispatch(actions.setEditCreatableService(undefined));\r\n dispatch(actions.setRefreshConsumableOfflineServices(true));\r\n setServiceChanged(true);\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n changeOfflineServices,\r\n dispatch,\r\n editCreatableService,\r\n servicesSelected,\r\n ]);\r\n const handleFormChange = React.useCallback(\r\n (\r\n values: ReportConsumablesState,\r\n isValid,\r\n dirty,\r\n setValue,\r\n setTouched,\r\n validateField,\r\n setError,\r\n validate,\r\n ) => {\r\n if (serviceChanged) {\r\n dispatch(\r\n connectedFiltersActions.extendSettingsState({\r\n services:\r\n values.Services.length < 1\r\n ? []\r\n : values.Services.map(f => {\r\n return {\r\n Id: f.ServiceTypeId,\r\n Name: f.ServiceTypeName,\r\n ServiceGroupId: f.ServiceGroupId,\r\n ServiceTypeId: ServiceType.Offline,\r\n Active: true,\r\n BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n globalSettings: globalSettings,\r\n settings: serviceSettings,\r\n isEdit: false,\r\n data: connectedData,\r\n }),\r\n );\r\n if (values.Services.length > 0 && connectedData?.User !== null) {\r\n const parameters = {\r\n ServiceTypes: values.Services.map(f => f.ServiceTypeID),\r\n ReservationId: null,\r\n UsageId: null,\r\n BookedBy: connectedData?.User?.Id || null,\r\n ADGroup: connectedData?.UserGroup?.Id || null,\r\n Start: dateUtils.formatISO(\r\n dateUtils.dateOrStringToDate(\r\n connectedData?.StartTime || newDate(),\r\n ),\r\n ),\r\n BudgetId: connectedData?.Budget?.Id || null,\r\n FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n } as ServiceChangeStateParameters;\r\n dispatch(actions.initServiceChangeStateData(parameters));\r\n // if (!!connectedData) {\r\n // dispatch(connectedFiltersActions.saveState(connectedData));\r\n // }\r\n }\r\n //setServiceTypesSelected(values.Services);\r\n setServiceChanged(false);\r\n }\r\n // if (factorChanged) {\r\n // if (Number(values.DiscountFactor) > 0) {\r\n // changeOfflineServices(\r\n // servicesSelected.map(f => {\r\n // return Object.assign({}, f, {\r\n // DiscountFactor: Number(values.DiscountFactor),\r\n // });\r\n // }),\r\n // 'update',\r\n // );\r\n // }\r\n // setFactorChanged(false);\r\n // }\r\n },\r\n [\r\n serviceChanged,\r\n dispatch,\r\n connectedFiltersActions,\r\n globalSettings,\r\n serviceSettings,\r\n connectedData,\r\n newDate,\r\n actions,\r\n ],\r\n );\r\n return (\r\n <>\r\n {\r\n // call setSubmit to finish submit cycle\r\n if (allIsValid) {\r\n formikHelpers.validateForm(values).then(responseErrors => {\r\n if (!isEmpty(responseErrors)) {\r\n formikHelpers.setSubmitting(false);\r\n console.debug('errors', responseErrors);\r\n } else if (values.Services.length < 1) {\r\n formikHelpers.setErrors({\r\n Services: t(\r\n translations.err_OfflineServiceTypeRequired,\r\n ) as string,\r\n });\r\n formikHelpers.setSubmitting(false);\r\n } else if (offlineServicesErrors.length > 0) {\r\n formikHelpers.setSubmitting(false);\r\n dispatch(\r\n appActions.addNotification({\r\n variant: 'error',\r\n message: '',\r\n messageType: SnackBarMessageType.messageList,\r\n messageTypeProps: {\r\n messages: offlineServicesErrors.map(f => {\r\n return {\r\n Id: f.id.toString(),\r\n message: f.error,\r\n } as SingleMessagesProps;\r\n }),\r\n } as ListMessagesProps,\r\n }),\r\n );\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(\r\n values,\r\n innerDiscountFactor ?? undefined,\r\n innerRemarks ?? undefined,\r\n );\r\n }\r\n });\r\n } else {\r\n formikHelpers.setSubmitting(false);\r\n }\r\n }}\r\n >\r\n {formik => {\r\n bindSubmitForm(formik.submitForm);\r\n if (formik.errors) {\r\n console.log('Consumables errors', formik.errors);\r\n }\r\n console.log('Consumables submitting', formik.isSubmitting);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n createService(\r\n st,\r\n innerDiscountFactor ?? undefined,\r\n innerRemarks ?? undefined,\r\n )\r\n }\r\n createServicesFromServiceType={st =>\r\n createServices(\r\n st,\r\n innerDiscountFactor ?? undefined,\r\n innerRemarks ?? undefined,\r\n )\r\n }\r\n onAddAndRemoveServices={(st, removed) =>\r\n onAddAndRemoveServices(\r\n st,\r\n removed,\r\n innerDiscountFactor ?? undefined,\r\n innerRemarks ?? undefined,\r\n )\r\n }\r\n initServicesFunc={initServices}\r\n onServiceRemove={onRemoveService}\r\n onServicesRemove={onRemoveServices}\r\n onServiceUpdate={onUpdateService}\r\n onServiceClick={service =>\r\n onOfflineServiceClick?.(\r\n service,\r\n innerDiscountFactor ?? undefined,\r\n innerRemarks ?? undefined,\r\n )\r\n }\r\n isEditMode={false}\r\n disabled={false}\r\n useAssetSelection={true}\r\n onAddClick={onAddServiceClick}\r\n userName={connectedData?.User?.Id}\r\n createdEditable={editCreatable}\r\n onAddBatchClick={onAddBatchClick}\r\n onRenewStockClick={onRenewStockClick}\r\n setError={setError}\r\n />\r\n \r\n \r\n {\r\n return {\r\n Id: s.ServiceTypeID,\r\n Name: s.ServiceType,\r\n Active: true,\r\n BudgetsTurnedOn: s.BudgetsTurnedOn,\r\n HideProject: s.HideProjects,\r\n ServiceGroupId: s.ServiceGroupId,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IServiceTypeFilterDto;\r\n })\r\n }\r\n globalSettings={globalSettings}\r\n formIsValid={validateForms}\r\n startTimeLabel={\r\n t(translations.LogDateTimeLabel) as string\r\n }\r\n startLabelInline={true}\r\n //orderForConsumables={true}\r\n //forceDisabled={servicesSelected.length > 1}\r\n budgetPickerInfo={\r\n t(translations.ConsumableProject_info) as string\r\n }\r\n />\r\n {formik.values.Services.length > 0 &&\r\n isAdmin &&\r\n !globalSettings.priceSheetPricing &&\r\n globalSettings.billingModuleEnabled && (\r\n \r\n {\r\n setDiscountFactor(Number(e.target.value));\r\n if (Number(e.target.value) > 0) {\r\n changeOfflineServices(\r\n servicesSelected.map(f => {\r\n return Object.assign({}, f, {\r\n DiscountFactor: Number(e.target.value),\r\n });\r\n }),\r\n 'update',\r\n );\r\n }\r\n }}\r\n inputMode=\"decimal\"\r\n label={t(translations.DiscountFactor)}\r\n placeholder={t(translations.DiscountFactor)}\r\n disabled={formik.isSubmitting}\r\n />\r\n \r\n )}\r\n \r\n setRemarks(String(val))}\r\n disabled={formik.isSubmitting}\r\n fullWidth={true}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport {\r\n CoverProps,\r\n PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n selectConsumablesCompleted,\r\n selectConsumablesData,\r\n selectConsumablesHasErrors,\r\n selectCredit,\r\n selectCreditCompleted,\r\n selectCreditProcessing,\r\n selectInitConsumablesProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n ErrorServices,\r\n OfflineServiceQueryStringParameters,\r\n ReportConsumablesState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ConsumablesForm } from './ConsumablesForm';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Roles, ScanTarget } from 'app/slice/types';\r\nimport {\r\n selectConnectedFiltersData,\r\n selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { LinearProgress } from '@material-ui/core';\r\nimport useSidePanelState, {\r\n SidePanelCloseState,\r\n SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport interface ReportConsumablesProps\r\n extends CoverProps,\r\n SidePanelContentProps {\r\n queryParams: OfflineServiceQueryStringParameters;\r\n initialServices: IOtherServices[];\r\n onClose?: () => void;\r\n}\r\nexport const ReportConsumables = React.memo(function ReportConsumables(\r\n props: ReportConsumablesProps,\r\n) {\r\n const {\r\n useSidePanel,\r\n queryParams,\r\n initialServices,\r\n closeCover,\r\n isCover,\r\n } = props;\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOfflineServiceStateSlice();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const processing = useSelector(selectInitConsumablesProcessing);\r\n // const consumablesProcessing = useSelector(selectConsumablesProcessing);\r\n const actionCompleted = useSelector(selectConsumablesCompleted);\r\n const User = useSelector(selectAuthenticatedUser);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const hasError = useSelector(selectConsumablesHasErrors);\r\n const consumableServicesData = useSelector(selectConsumablesData);\r\n const connectedData = useSelector(selectConnectedFiltersData);\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const serviceSettings = useSelector(selectConnectedSettings);\r\n const credit = useSelector(selectCredit);\r\n const creditProccessing = useSelector(selectCreditProcessing);\r\n const creditCompleted = useSelector(selectCreditCompleted);\r\n // const { checkIsMobile } = useIsMobile();\r\n // const mobile = checkIsMobile();\r\n const globalSettings = useGlobalSettingsHook();\r\n //Local State\r\n const {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n onCloseCover,\r\n } = useSidePanelState(\r\n () => {\r\n dispatch(actions.resetConsumablesState());\r\n dispatch(connectedFiltersActions.resetConnectedState());\r\n return true;\r\n },\r\n undefined,\r\n useSidePanel,\r\n isCover,\r\n );\r\n const [busy, setBusy] = React.useState(false);\r\n const [firstLoad, setFirstLoad] = React.useState(true);\r\n const [showCalculateCredit, setShowCalculateCredit] = React.useState(false);\r\n const [requestCompleted, setRequestCompleted] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n\r\n //Refs\r\n const submitFormRef = React.useRef(null);\r\n const connectedFiltersFormRef = React.useRef(null);\r\n const innerFormRef = React.useRef>(null);\r\n\r\n const isReadOnlyUser = React.useMemo(() => {\r\n return (\r\n User !== undefined &&\r\n (User.Roles.includes(Roles.CalendarOnly) ||\r\n User.Roles.includes(Roles.Readonly) ||\r\n User.Roles.includes(Roles.RoomOnly))\r\n );\r\n }, [User]);\r\n\r\n //Methods\r\n const handleCloselClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n closePanel({\r\n isCover: isCover,\r\n useSidePanel: useSidePanel,\r\n showConfirm: hasChanges,\r\n onClose: () => {\r\n dispatch(actions.resetConsumablesState());\r\n dispatch(connectedFiltersActions.resetConnectedState());\r\n },\r\n } as SidePanelCloseState);\r\n } else {\r\n dispatch(push('/otherServices'));\r\n }\r\n }, [\r\n actions,\r\n closePanel,\r\n connectedFiltersActions,\r\n dispatch,\r\n hasChanges,\r\n isCover,\r\n useSidePanel,\r\n ]);\r\n const handleSaveClick = React.useCallback((e: any) => {\r\n handleSubmitForm(e);\r\n }, []);\r\n\r\n const handleSubmitForm = (e: any) => {\r\n if (connectedFiltersFormRef.current) {\r\n connectedFiltersFormRef.current(e);\r\n }\r\n if (submitFormRef.current) {\r\n submitFormRef.current(e);\r\n }\r\n };\r\n const bindSubmitForm = React.useCallback(submitForm => {\r\n submitFormRef.current = submitForm;\r\n }, []);\r\n\r\n const handleSubmit = React.useCallback(\r\n (values: ReportConsumablesState, factor?: number, remarks?: string) => {\r\n setBusy(true);\r\n dispatch(\r\n actions.createConsumables({\r\n Services: values.Services,\r\n DiscountFactor: factor,\r\n Remarks: remarks,\r\n }),\r\n );\r\n },\r\n [actions, dispatch],\r\n );\r\n const handleCalculateCredit = React.useCallback(() => {\r\n if (!!innerFormRef?.current?.values?.Services) {\r\n setShowCalculateCredit(true);\r\n dispatch(actions.getTotalCredit(innerFormRef?.current?.values.Services));\r\n }\r\n }, [actions, dispatch]);\r\n const handleCalculateClose = React.useCallback(() => {\r\n setShowCalculateCredit(false);\r\n dispatch(actions.resetTotalCreditState());\r\n }, [actions, dispatch]);\r\n //effects\r\n useEffectOnMount(() => {\r\n dispatch(\r\n appSettingsActions.setBarcodeScannigTarget(ScanTarget.Consumables),\r\n );\r\n return () => {\r\n dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.All));\r\n };\r\n });\r\n React.useEffect(() => {\r\n let active = firstLoad;\r\n if (globalSettings.loadCompleted && active) {\r\n setFirstLoad(false);\r\n dispatch(\r\n actions.initConsumables({\r\n query: queryParams,\r\n globalSettings: globalSettings,\r\n services: initialServices,\r\n }),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actions,\r\n dispatch,\r\n firstLoad,\r\n globalSettings,\r\n initialServices,\r\n queryParams,\r\n ]);\r\n React.useEffect(() => {\r\n let active = processing === false;\r\n if (active) {\r\n if (actionCompleted === true) {\r\n setRequestCompleted(true);\r\n setBusy(false);\r\n if (!hasError) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n handleCloselClick();\r\n }\r\n } else if (actionCompleted === false) {\r\n setRequestCompleted(undefined);\r\n setBusy(false);\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n actionCompleted,\r\n dispatch,\r\n handleCloselClick,\r\n hasError,\r\n layoutActions,\r\n processing,\r\n queryParams.id,\r\n ]);\r\n const assetsFilter = React.useMemo(() => {\r\n let filter: (string | Condition)[] | undefined = [];\r\n if (globalSettings.budgetModuleEnabled && serviceSettings.budgetVisible) {\r\n if (\r\n connectedData?.Budget === null ||\r\n connectedData?.Budget === undefined\r\n ) {\r\n filter.push(\r\n new Condition(\r\n 'HideProjects',\r\n ODataOperators.Equals,\r\n serviceSettings.hideProject ?? false,\r\n ),\r\n );\r\n } else {\r\n let budget = connectedData?.Budget as IBudgetFilterDto;\r\n let byService = '';\r\n let byGroup = '';\r\n if (!budget.ServiceGroupServicesAllowed) {\r\n if (!!budget.AllowedServices && budget.AllowedServices.length > 0) {\r\n byService = `(${new Condition(\r\n 'ServiceId',\r\n ODataOperators.Includes,\r\n budget.AllowedServices.map(f => f.Id),\r\n ).toString()} and ServiceTypeId eq 2)`;\r\n }\r\n if (!!budget.ServiceGroupIds && budget.ServiceGroupIds.length > 0) {\r\n byGroup = `(${new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n budget.ServiceGroupIds,\r\n ).toString()})`;\r\n }\r\n let res = `(${[byService, byGroup]\r\n .filter(f => f !== '')\r\n .join(' or ')})`;\r\n if (res !== '()') {\r\n filter.push(res);\r\n }\r\n } else {\r\n filter.push('ServiceTypeId eq 2');\r\n }\r\n }\r\n }\r\n return filter.length > 0 ? filter : undefined;\r\n }, [\r\n connectedData?.Budget,\r\n globalSettings.budgetModuleEnabled,\r\n serviceSettings.budgetVisible,\r\n serviceSettings.hideProject,\r\n ]);\r\n\r\n const onRenewStockClick = React.useCallback(\r\n (service: IOtherServices) => {\r\n let renewProps = {\r\n saveCreatable: true,\r\n preventRefreshTable: true,\r\n initialService: undefined,\r\n queryParams: {\r\n id: '-1',\r\n stid: '' + service.ServiceTypeID,\r\n batchId:\r\n !!service.InventoryBatchId && service.InventoryBatchId !== null\r\n ? '' + service.InventoryBatchId\r\n : undefined,\r\n },\r\n };\r\n if (!useSidePanel) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n }\r\n openPanel({\r\n renderPageType: RenderPageType.RenewStock,\r\n renderPageProps: renewProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [dispatch, layoutActions, openPanel, useSidePanel],\r\n );\r\n const onAddBatchClick = React.useCallback(\r\n (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n let batchProps = {\r\n initialBatch: batch ?? undefined,\r\n preventRefreshTable: true,\r\n queryParams: {\r\n id: '' + (batch?.Id ?? -1),\r\n stid: '' + serviceType,\r\n },\r\n saveCreatable: true,\r\n };\r\n if (!useSidePanel) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n }\r\n openPanel({\r\n renderPageType: RenderPageType.InventoryBatch,\r\n renderPageProps: batchProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [dispatch, layoutActions, openPanel, useSidePanel],\r\n );\r\n const onOfflineServiceClick = React.useCallback(\r\n (service: IOtherServices, discountFactor?: number, remarks?: string) => {\r\n let updatedRemarks = isEmptyOrWhitespace(service.Remarks)\r\n ? remarks ?? null\r\n : service.Remarks;\r\n let factor =\r\n Number(service.DiscountFactor) !== Number(discountFactor)\r\n ? Number(discountFactor)\r\n : Number(service.DiscountFactor);\r\n let otherProps = {\r\n initialService: Object.assign({}, service, {\r\n UserGroup: connectedData?.UserGroup?.Id ?? null,\r\n UserGroupName: connectedData?.UserGroup?.Name ?? null,\r\n Budget: connectedData?.Budget?.Name ?? null,\r\n BudgetID: connectedData?.Budget?.Id ?? null,\r\n UserDisplayName: connectedData?.User?.Name ?? null,\r\n BookedBy: connectedData?.User?.Id ?? null,\r\n Remarks: updatedRemarks,\r\n DiscountFactor: factor,\r\n }),\r\n editCreatable: true,\r\n queryParams: {\r\n id: '' + service.Id ?? -1,\r\n },\r\n };\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n openPanel({\r\n renderPageType: RenderPageType.OtherServiceDetails,\r\n renderPageProps: otherProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [\r\n connectedData?.Budget?.Id,\r\n connectedData?.Budget?.Name,\r\n connectedData?.User?.Id,\r\n connectedData?.User?.Name,\r\n connectedData?.UserGroup?.Id,\r\n connectedData?.UserGroup?.Name,\r\n dispatch,\r\n layoutActions,\r\n openPanel,\r\n useSidePanel,\r\n ],\r\n );\r\n const onAddServiceClick = React.useCallback(\r\n (services: number[]) => {\r\n let selParams = {\r\n actionType: 'OfflineService',\r\n offTypeIds: services,\r\n customPredicates: assetsFilter,\r\n } as AssetsSelectionProps;\r\n if (!useSidePanel) {\r\n dispatch(layoutActions.setNotSavedChanges(false));\r\n }\r\n openPanel({\r\n renderPageType: RenderPageType.AssetsSelection,\r\n renderPageProps: selParams,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState);\r\n },\r\n [assetsFilter, dispatch, layoutActions, openPanel, useSidePanel],\r\n );\r\n\r\n const [offlineServicesErrors, setOfflineServicesErrors] = React.useState<\r\n ErrorServices[]\r\n >([]);\r\n const handleSetError = React.useCallback(\r\n (error: ErrorServices) => {\r\n if (error.error !== undefined) {\r\n setOfflineServicesErrors(prev => [...prev, error]);\r\n } else {\r\n setOfflineServicesErrors([\r\n ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n ]);\r\n }\r\n },\r\n [offlineServicesErrors],\r\n );\r\n //memo\r\n const IsAdmin = React.useMemo(() => {\r\n return !!consumableServicesData &&\r\n consumableServicesData.Services.length > 0\r\n ? User?.IsAllGroupOrLabTechAdmin(\r\n consumableServicesData.Services.map(g => g.ServiceGroupId || 0),\r\n consumableServicesData.Services.map(f => {\r\n return {\r\n Id: f.ServiceTypeId,\r\n Name: f.ServiceTypeName,\r\n ServiceTypeId: ServiceType.Offline,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n )\r\n : false;\r\n }, [User, consumableServicesData]);\r\n const leftActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n actions.push(() => (\r\n }\r\n onClick={handleSaveClick}\r\n disabled={\r\n busy ||\r\n !(\r\n !!consumableServicesData &&\r\n consumableServicesData.Services.length > 0\r\n )\r\n }\r\n processing={!requestCompleted && busy}\r\n >\r\n {t(translations.Save)}\r\n \r\n ));\r\n if (\r\n globalSettings.showCalcPriceOnOfflineService &&\r\n !!consumableServicesData &&\r\n consumableServicesData.Services.length > 0 &&\r\n offlineServicesErrors.length < 1\r\n ) {\r\n actions.push(() => (\r\n }\r\n title={t(translations.CalculatePricing_info) as string}\r\n onClick={handleCalculateCredit}\r\n disabled={creditProccessing}\r\n processing={creditProccessing}\r\n >\r\n {t(translations.CalculatePricing)}\r\n \r\n ));\r\n }\r\n return actions;\r\n }, [\r\n busy,\r\n consumableServicesData,\r\n creditProccessing,\r\n globalSettings.showCalcPriceOnOfflineService,\r\n handleCalculateCredit,\r\n handleSaveClick,\r\n offlineServicesErrors.length,\r\n requestCompleted,\r\n t,\r\n ]);\r\n const rightActions = React.useMemo(() => {\r\n let actions: ActionRenderer[] = [];\r\n\r\n actions.push(() => (\r\n }\r\n onClick={handleCloselClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n ));\r\n\r\n return actions;\r\n }, [handleCloselClick, t]);\r\n\r\n return (\r\n \r\n \r\n ) : (\r\n \r\n {' '}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n pageLink={buildURL(publicUrl + 'reportConsumables', queryParams)}\r\n toPageLink={`reportConsumables?${toQueryString(queryParams)}`}\r\n isCover={isCover}\r\n cover={cover}\r\n coverClosed={coverClosed}\r\n closeCover={!isCover ? onCloseCover : closeCover}\r\n confirm={\r\n showCalculateCredit ? (\r\n handleCalculateClose()}\r\n onClose={() => handleCalculateClose()}\r\n body={\r\n creditProccessing && !creditCompleted ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n {t(translations.Pricing_EstimatedCost)}\r\n \r\n \r\n {(t(\r\n translations.PricingConfirmationOfflineText1,\r\n ) as string).replace(\r\n '{0}',\r\n (credit?.credit || 0).toFixed(2),\r\n )}\r\n \r\n \r\n {!!credit?.balance && credit?.balance !== null && (\r\n \r\n \r\n {t(translations.Pricing_Balance)}\r\n \r\n \r\n {(t(\r\n translations.Pricing_BalanceResult,\r\n ) as string).replace(\r\n '{0}',\r\n (credit?.balance || 0).toFixed(2),\r\n )}\r\n \r\n \r\n )}\r\n \r\n )\r\n }\r\n maxWidth={'sm'}\r\n />\r\n ) : (\r\n <>\r\n )\r\n }\r\n />\r\n {hasChanges && (\r\n 'Youll lose your data!'} />\r\n )}\r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * ArticeDatasetlLink\r\n *\r\n */\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\n\r\nexport interface ArticleLinkProps {\r\n dataset: string | undefined | null;\r\n externalId?: string | null;\r\n externalIdSource?: string | null;\r\n}\r\n\r\nexport function ArticleDatasetLink({\r\n dataset,\r\n externalIdSource,\r\n externalId,\r\n}: ArticleLinkProps) {\r\n if (dataset !== undefined && dataset !== null) {\r\n return (\r\n <>\r\n \r\n {dataset}\r\n \r\n \r\n );\r\n } else {\r\n return <>;\r\n }\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { ListRenderer } from 'app/components/BasicTable/CellRenderers/ListRenderer';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { ArticleSource } from './ArticlesSourcePicker';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { ArticleDoiLink } from './ArticleDoiLink';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { ArticleDatasetLink } from './AricleDatasetLink';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetLink } from '../AssetPopUp/OpenAssetDetails';\r\nimport htmlParse from 'html-react-parser';\r\nimport {\r\n allowedToViewAlert,\r\n IAlertPermissionCheckRecord,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { WorkOrderLink } from '../Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport { ArticleLink } from '../Actions/GlobalSelectedActions/OpenArticleDetails';\r\n\r\nexport const ArticleServiceGroupsColumnId /*: keyof IArticleDto*/ =\r\n 'FirstServiceGroupAssetName';\r\nexport const ArticleInstrumentsColumnId /*: keyof IArticleDto*/ =\r\n 'FirstInstrumentAssetName';\r\n\r\nexport function getColumns(\r\n t: TFunction,\r\n user: AuthenticatedUser | undefined,\r\n settings: GlobalSettings,\r\n useSidePanel?: boolean,\r\n openPanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n if (user === undefined) {\r\n return [];\r\n }\r\n\r\n const result: ColumnWithDep[] = [\r\n {\r\n Header: t(translations.Id) as string,\r\n accessor: 'Id',\r\n },\r\n {\r\n Header: t(translations.Title) as string,\r\n accessor: 'Title',\r\n Cell: ({ value, row }) => {\r\n return (\r\n value !== null && (\r\n \r\n {htmlParse(value)}\r\n \r\n )\r\n );\r\n },\r\n },\r\n {\r\n Header: t(translations.Authors) as string,\r\n accessor: 'Authors',\r\n Cell: ListRenderer,\r\n },\r\n {\r\n Header: t(translations.Journal) as string,\r\n accessor: 'Journal',\r\n },\r\n {\r\n Header: t(translations.ArticlePageNumber) as string,\r\n accessor: 'PageNumber',\r\n },\r\n {\r\n id: ArticleServiceGroupsColumnId,\r\n accessor: ArticleServiceGroupsColumnId,\r\n Header: t(translations.ServiceGroups) as string,\r\n Cell: ({ row }) => {\r\n let groups =\r\n row.original.Assets?.filter(\r\n f => f.Availability?.Id === AvailabilityTypes.ServiceGroup,\r\n )?.map(item => item) ?? [];\r\n if (groups.length > 0) {\r\n const res = groups.map((v, index) => (\r\n <>\r\n \r\n {v.Name}\r\n \r\n {index < groups.length - 1 &&
    }\r\n \r\n ));\r\n return res;\r\n } else {\r\n return <>;\r\n }\r\n //return ListRenderer({ value: groups });\r\n },\r\n },\r\n {\r\n id: ArticleInstrumentsColumnId,\r\n accessor: ArticleInstrumentsColumnId,\r\n Header: t(translations.Instruments) as string,\r\n Cell: ({ row }) => {\r\n const groups =\r\n row.original.Assets?.filter(\r\n f => f.ServiceTypeId === ServiceType.Online,\r\n )?.map(item => item) ?? [];\r\n if (groups.length > 0) {\r\n const res = groups.map((v, index) => (\r\n <>\r\n \r\n {v.Name}\r\n \r\n\r\n {index < groups.length - 1 &&
    }\r\n \r\n ));\r\n return res;\r\n } else {\r\n return <>;\r\n }\r\n // return ListRenderer({ value: groups });\r\n },\r\n },\r\n {\r\n id: 'PubMedId',\r\n Header: t(translations.PubMedId) as string,\r\n accessor: 'ExternalId',\r\n Cell: ({ value, row }) => {\r\n const pubmedType: ArticleSource = 'PubMed';\r\n return (\r\n row.original.ExternalIdSource === pubmedType && (\r\n \r\n {value}\r\n \r\n )\r\n );\r\n },\r\n },\r\n {\r\n id: 'Doi',\r\n Header: t(translations.Doi) as string,\r\n accessor: 'Doi',\r\n Cell: ({ value, row }) => {\r\n return (\r\n value !== null && (\r\n \r\n )\r\n );\r\n },\r\n },\r\n {\r\n id: 'Dataset',\r\n Header: t(translations.ArticleDataset) as string,\r\n accessor: 'Dataset',\r\n Cell: ({ value, row }) => {\r\n return (\r\n value !== null && (\r\n \r\n )\r\n );\r\n },\r\n },\r\n {\r\n Header: t(translations.InsertedBy) as string,\r\n accessor: 'UserDisplayName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.InsertedAt) as string,\r\n accessor: 'EnteredAt',\r\n Cell: ({ value, row }) => {\r\n return ;\r\n },\r\n },\r\n {\r\n Header: t(translations.RelatedUser) as string,\r\n accessor: 'RelatedUserDisplayName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.UserGroup) as string,\r\n accessor: 'UserGroupName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.Department) as string,\r\n accessor: 'DepartmentName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.Institute) as string,\r\n accessor: 'InstituteName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.InstituteType) as string,\r\n accessor: 'InstituteTypeName',\r\n Cell: ({ value, row }) => {\r\n const res = value ?? '';\r\n return <> {res} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.ArticleStatus) as string,\r\n accessor: 'Status',\r\n Cell: ({ value, row }) => {\r\n const key = 'Article' + ArticleStatus[value];\r\n return <> {t(key)} ;\r\n },\r\n },\r\n {\r\n Header: t(translations.FileComment) as string,\r\n accessor: 'FileComment',\r\n // Cell: ArticleHTMLLinkRenderer,\r\n Cell: ({ value, row }) => {\r\n let v =\r\n value !== null && value !== undefined && value !== ''\r\n ? value[0] === '<'\r\n ? (htmlParse(value) as JSX.Element).props.children\r\n : value\r\n : '';\r\n return (\r\n \r\n {v}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Header: t(translations.CalibrationRecord) as string,\r\n accessor: 'CalibrationRecord',\r\n Cell: ({ value, row }) => {\r\n const checkRow = {\r\n ServiceGroupId:\r\n row.original.Assets?.length > 0\r\n ? row.original.Assets[0].ServiceGroupId\r\n : null,\r\n ReportedBy: row.original.EnteredBy,\r\n } as IAlertPermissionCheckRecord;\r\n return allowedToViewAlert(user, checkRow) && value !== null ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n );\r\n },\r\n deps: ['CalibrationRecordName'],\r\n },\r\n ];\r\n return result;\r\n}\r\n","import { Select } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\nexport const StyledSelect = styled(Select)`\r\n min-width: 9em;\r\n margin: 0;\r\n background: transparent;\r\n`;\r\n","/**\r\n *\r\n * TmtType\r\n *\r\n */\r\nimport { MenuItem } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { RUN_TYPES } from '../RunTypePicker';\r\nimport { StyledSelect } from '../../EditableTable/Fields/StyledSelect';\r\nimport { BaseInputProps } from '../../EditableTable/EditableCell';\r\n\r\nexport interface TmtTypeProps extends BaseInputProps {}\r\nexport function TmtType({ value, onChange, onBlur }: TmtTypeProps) {\r\n const options = ['TMT Pro'];\r\n return (\r\n onChange(e.target.value as RUN_TYPES)}\r\n onBlur={onBlur}\r\n displayEmpty\r\n autoWidth\r\n inputProps={{ 'aria-label': 'Without label' }}\r\n >\r\n \r\n None\r\n \r\n {options.map((item, index) => (\r\n \r\n {item}\r\n \r\n ))}\r\n \r\n );\r\n}\r\n","import { Tab, TabProps } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BasicTabProps extends TabProps {\r\n mainIcon?: React.ReactElement;\r\n startIcon?: React.ReactElement;\r\n endIcon?: React.ReactElement;\r\n processing?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\nexport const BasicTab = React.forwardRef(function TabButton(\r\n {\r\n disabled,\r\n processing,\r\n size = 'medium',\r\n mainIcon,\r\n startIcon,\r\n endIcon,\r\n label,\r\n className,\r\n ...props\r\n },\r\n ref,\r\n) {\r\n const startIconComponent = startIcon && (\r\n \r\n {startIcon}\r\n \r\n );\r\n const endIconComponent = endIcon && (\r\n \r\n {endIcon}\r\n \r\n );\r\n return (\r\n \r\n {mainIcon}\r\n \r\n ) : undefined\r\n }\r\n disableRipple\r\n label={\r\n \r\n {!!startIcon || !!endIcon ? (\r\n \r\n {!!startIconComponent && startIconComponent}\r\n {label}\r\n {!!endIconComponent && endIconComponent}\r\n \r\n ) : (\r\n {label}\r\n )}\r\n \r\n }\r\n {...props}\r\n />\r\n );\r\n});\r\n","import { TabContent } from './TabContent';\r\nimport * as React from 'react';\r\nimport { Tabs, useTheme } from '@material-ui/core';\r\nimport { TabPanel, TabPanelProps } from './TabPanel';\r\nimport { BasicTab } from './BasicTab';\r\nimport clsx from 'clsx';\r\nimport { capitalize } from 'lodash';\r\nimport { TabsWrapper } from './TabsWrapper';\r\n\r\nexport interface BasicTabsProps {\r\n tabs: Array;\r\n selectedTabIndex?: number;\r\n tabsId: string;\r\n tabsPanelId: string;\r\n textColor?: 'secondary' | 'primary' | 'inherit';\r\n scrollButtons?: 'auto' | 'desktop' | 'on' | 'off';\r\n indicatorColor?: 'secondary' | 'primary';\r\n variant?: 'standard' | 'scrollable' | 'fullWidth';\r\n selectionFollowsFocus?: boolean;\r\n centered?: boolean;\r\n orientation?: 'horizontal' | 'vertical';\r\n ariaLabel?: string;\r\n size?: 'small' | 'medium';\r\n scrollableContent?: boolean;\r\n className?: string;\r\n handleTabChange?: (tab: TabContent) => void;\r\n tabPanels?: Array>;\r\n}\r\n\r\nexport function BasicTabs(props: BasicTabsProps) {\r\n const {\r\n selectedTabIndex,\r\n tabs,\r\n tabsId,\r\n tabsPanelId,\r\n textColor,\r\n scrollButtons,\r\n indicatorColor,\r\n variant,\r\n selectionFollowsFocus,\r\n centered,\r\n orientation,\r\n ariaLabel,\r\n size = 'medium',\r\n className,\r\n scrollableContent,\r\n handleTabChange,\r\n tabPanels,\r\n } = props;\r\n const theme = useTheme();\r\n const [tabIndex, setTabIndex] = React.useState(selectedTabIndex ?? 0);\r\n // used for case when state is managed otside this component\r\n React.useEffect(() => {\r\n if (!!handleTabChange) {\r\n setTabIndex(selectedTabIndex ?? 0);\r\n }\r\n }, [handleTabChange, selectedTabIndex]);\r\n\r\n const handleSelectedTabIndexChange = (\r\n event: React.ChangeEvent<{}>,\r\n newValue: number,\r\n ) => {\r\n //when state is managed outside the index is come from the parrent component\r\n if (!!handleTabChange) {\r\n handleTabChange(tabs[newValue]);\r\n } else {\r\n setTabIndex(newValue);\r\n }\r\n };\r\n const getTabProps = React.useCallback(\r\n (item: TabContent) => {\r\n return {\r\n id: `${tabsId}-${item.Id}`,\r\n 'aria-controls': `${tabsPanelId}-${item.Id}`,\r\n label: item.Name,\r\n };\r\n },\r\n [tabsId, tabsPanelId],\r\n );\r\n return (\r\n \r\n \r\n {tabs.map(item => (\r\n \r\n ))}\r\n \r\n {!!tabPanels && tabPanels.length > 0 ? (\r\n {tabPanels}\r\n ) : (\r\n \r\n {tabs.map((item, index) => (\r\n \r\n {item.Content}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","import { styled } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectEventsCount,\r\n selectEventsCountLoading,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Roles } from 'app/slice/types';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nexport interface EventsCountProps {}\r\n\r\nexport const EventsCount = React.memo(function EventsCount(\r\n props: EventsCountProps,\r\n) {\r\n const count = useSelector(selectEventsCount);\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const eventsLoading = useSelector(selectEventsCountLoading);\r\n const isAdmin = React.useMemo(() => {\r\n return (\r\n user !== undefined &&\r\n (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n user.Roles.indexOf(Roles.InstrumentEventsAdmin) >= 0)\r\n );\r\n }, [user]);\r\n\r\n const appSettings = useSelector(selectAppSettings);\r\n const isMaintenanceAssetsEnabled = IsModuleEnabled(\r\n appSettings,\r\n KnownModules.MaintenanceAssets,\r\n );\r\n\r\n const StyledSpanIcon = styled('span')(({ theme }) => ({\r\n fontSize: '20px',\r\n color: bookitColors.grayscale.graySubtitles,\r\n width: '20px',\r\n height: '20px',\r\n }));\r\n\r\n //RENDER\r\n return isAdmin && isMaintenanceAssetsEnabled && !eventsLoading ? (\r\n \r\n \r\n \r\n \r\n \r\n {count}\r\n \r\n \r\n \r\n \r\n ) : null;\r\n});\r\n","import {\r\n AssetQuickSearchDetails,\r\n IQuickAssetsSearchResult,\r\n} from 'app/components/AssetQuickSearch/slice/types';\r\nimport { Identifiable } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\n\r\nexport const AssetQuickSearchApi = {\r\n getAssetSearch: async (payload: {\r\n q: string;\r\n serviceGroups: Identifiable[];\r\n serviceTypeId?: number;\r\n }) => {\r\n const url = `/api/odata/v4/AssetQuickSearch`;\r\n let filters: Array = [];\r\n if (payload.serviceGroups.length > 0) {\r\n filters.push(\r\n `${new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n payload.serviceGroups,\r\n ).toString()}`,\r\n );\r\n }\r\n if (!!payload.serviceTypeId) {\r\n filters.push(\r\n `${new Condition(\r\n 'ServiceTypeId',\r\n ODataOperators.Equals,\r\n payload.serviceTypeId,\r\n ).toString()}`,\r\n );\r\n }\r\n const params: {\r\n q: string;\r\n $orderby: string;\r\n $filter?: string;\r\n $count: boolean;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n q: payload.q,\r\n $filter: filters.length > 0 ? filters.join(' and ') : undefined,\r\n $count: true,\r\n $select:\r\n 'Id,Name,Image,AvailabilityTypeId,AvailabilityTypeName,BookableAsset,ServiceId,ServiceGroupId,ApprovalRequired',\r\n $skip: 0,\r\n $top: 5,\r\n $orderby: 'Rank desc',\r\n };\r\n try {\r\n const response = await httpClient.get(url, params);\r\n return {\r\n Results: response.value,\r\n TotalResultsLength: response['@odata.count'],\r\n ServiceType: payload.serviceTypeId,\r\n } as IQuickAssetsSearchResult;\r\n } catch {\r\n return {\r\n Results: [],\r\n TotalResultsLength: 0,\r\n ServiceType: undefined,\r\n } as IQuickAssetsSearchResult;\r\n }\r\n },\r\n getRecentAssets: async (payload: {\r\n serviceGroups: Identifiable[];\r\n }) => {\r\n const url = `/api/odata/v4/AssetQuickSearch/RecentAssets`;\r\n let filters: Array = [];\r\n if (payload.serviceGroups.length > 0) {\r\n filters.push(\r\n `${new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Includes,\r\n payload.serviceGroups,\r\n ).toString()}`,\r\n );\r\n }\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $count: boolean;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: filters.length > 0 ? filters.join(' and ') : undefined,\r\n $count: true,\r\n $select:\r\n 'Id,Name,Image,AvailabilityTypeId,AvailabilityTypeName,BookableAsset,ServiceId,ServiceGroupId,ApprovalRequired',\r\n $skip: 0,\r\n $top: 10,\r\n };\r\n try {\r\n const response = await httpClient.get(url, params);\r\n return {\r\n Results: response.value,\r\n TotalResultsLength: response['@odata.count'],\r\n ServiceType: undefined,\r\n } as IQuickAssetsSearchResult;\r\n } catch {\r\n return {\r\n Results: [],\r\n TotalResultsLength: 0,\r\n ServiceType: undefined,\r\n } as IQuickAssetsSearchResult;\r\n }\r\n },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest, debounce, select } from 'redux-saga/effects';\r\nimport { assetQuickSearchActions as actions } from '.';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectShowAllCores,\r\n selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport { Identifiable } from 'types/common';\r\nimport { AssetQuickSearchApi } from 'api/assetQuickSearchApi';\r\nimport {\r\n IMenuItemsSearchResult,\r\n IQuickAssetsSearchResult,\r\n IQuickSearchResults,\r\n} from './types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { SiteMapNode, SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { AuthenticatedUser, isInRole } from 'types/AuthenticatedUser';\r\nimport { Roles } from 'app/slice/types';\r\nimport { uniqBy } from 'lodash';\r\n\r\nfunction* doShowSearchInput(action: PayloadAction) {\r\n yield put(actions.setOpen(action.payload));\r\n}\r\nfunction* doSetOpen(action: PayloadAction) {\r\n if (action.payload) {\r\n yield put(actions.getRecentAssets());\r\n yield put(actions.getRecentSearchTerms());\r\n }\r\n}\r\nfunction* doSearchAssets(action: PayloadAction) {\r\n const topServiceGroups: Array> | undefined =\r\n yield select(selectGlobalServiceGroupFilter);\r\n const payload = {\r\n q: action.payload,\r\n serviceGroups: topServiceGroups ?? [],\r\n };\r\n try {\r\n const data = yield call(AssetQuickSearchApi.getAssetSearch, payload);\r\n yield put(actions.searchAssets_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.searchAssets_Error({ error: error }));\r\n }\r\n}\r\nfunction* doSearchAllAssets(action: PayloadAction) {\r\n const topServiceGroups: Array> | undefined =\r\n yield select(selectGlobalServiceGroupFilter);\r\n const allCores = yield select(selectShowAllCores);\r\n const sett = yield select(selectSiteMapSettings);\r\n const user = yield select(selectAuthenticatedUser);\r\n let siteMapProvider = new SiteMapProvider(sett);\r\n let searchMenus: SiteMapNode[] = searchMenu(\r\n action.payload,\r\n siteMapProvider,\r\n siteMapProvider.getUserNodes(),\r\n user,\r\n );\r\n\r\n let menuResult: IMenuItemsSearchResult = {\r\n Results: searchMenus,\r\n TotalResultsLength: searchMenus.length,\r\n };\r\n yield put(actions.setMenuSearchResults(menuResult));\r\n try {\r\n let responses: IQuickAssetsSearchResult[] = [];\r\n for (let idx = 1; idx <= 3; idx++) {\r\n let payload = {\r\n q: action.payload,\r\n serviceGroups: allCores ? [] : topServiceGroups ?? [],\r\n serviceTypeId: idx,\r\n };\r\n const result = yield call(AssetQuickSearchApi.getAssetSearch, payload);\r\n if (result.ServiceType === ServiceType.Online) {\r\n yield put(actions.setOnlineSearchResults(result));\r\n } else if (result.ServiceType === ServiceType.Offline) {\r\n yield put(actions.setOfflineSearchResults(result));\r\n } else if (result.ServiceType === ServiceType.Sample) {\r\n yield put(actions.setRequestSearchResults(result));\r\n }\r\n responses.push(result);\r\n }\r\n yield put(\r\n actions.setTotalSearchCount(\r\n responses.reduce((part, a) => part + a.TotalResultsLength, 0),\r\n ),\r\n );\r\n const data = {\r\n online: responses.filter(f => f.ServiceType === ServiceType.Online)[0],\r\n offline: responses.filter(f => f.ServiceType === ServiceType.Offline)[0],\r\n request: responses.filter(f => f.ServiceType === ServiceType.Sample)[0],\r\n totalRresults: responses.reduce(\r\n (part, a) => part + a.TotalResultsLength,\r\n 0,\r\n ),\r\n } as IQuickSearchResults;\r\n yield put(actions.searchAllAssets_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.searchAllAssets_Error({ error: error }));\r\n }\r\n}\r\nfunction* doGetRecentAssets(action: PayloadAction) {\r\n const topServiceGroups: Array> | undefined =\r\n yield select(selectGlobalServiceGroupFilter);\r\n const allCores = yield select(selectShowAllCores);\r\n const payload = {\r\n serviceGroups: allCores ? [] : topServiceGroups ?? [],\r\n };\r\n try {\r\n const data = yield call(AssetQuickSearchApi.getRecentAssets, payload);\r\n yield put(actions.getRecentAssets_Success(data.Results));\r\n } catch (error: unknown) {\r\n yield put(actions.getRecentAssets_Error({ error: error }));\r\n }\r\n}\r\nfunction* doGetRecentSearchTerms(payload: PayloadAction) {\r\n try {\r\n const data = yield call(\r\n httpClient.get,\r\n '/api/assets/recenttextsearchterms',\r\n );\r\n yield put(actions.getRecentSearchTerms_Success(data));\r\n } catch (error: unknown) {\r\n yield put(actions.getRecentSearchTerms_Error({ error: error }));\r\n }\r\n}\r\nconst searchMenu = (\r\n searchTerm: string,\r\n siteMapProvider: SiteMapProvider,\r\n menuNodes: SiteMapNode[],\r\n user?: AuthenticatedUser,\r\n): SiteMapNode[] => {\r\n let searchMenus: SiteMapNode[] = [];\r\n const isAdmin =\r\n isInRole(user, Roles.Administrators) ||\r\n isInRole(user, Roles.GroupAdministrators) ||\r\n isInRole(user, Roles.EquipmentAdministrator) ||\r\n isInRole(user, Roles.CustomRole);\r\n if (searchTerm !== '') {\r\n menuNodes.forEach(item => {\r\n if (\r\n item.Hide === false &&\r\n (!item.isAdminNode ||\r\n (item.isAdminNode &&\r\n isAdmin &&\r\n siteMapProvider.nodeAccesibleByRole(item, user)))\r\n ) {\r\n let childItems = item.ChildNodes.filter(\r\n ch =>\r\n ch.HideReact === false &&\r\n ch.Hide === false &&\r\n (!ch.isAdminNode ||\r\n (ch.isAdminNode &&\r\n isAdmin &&\r\n siteMapProvider.nodeAccesibleByRole(ch, user))),\r\n );\r\n if (childItems.length > 0) {\r\n childItems.forEach(c => {\r\n if (c.Title.toLowerCase().indexOf(searchTerm.toLowerCase()) >= 0) {\r\n searchMenus.push(c);\r\n }\r\n });\r\n }\r\n if (item.Title.toLowerCase().indexOf(searchTerm.toLowerCase()) >= 0) {\r\n searchMenus.push(item);\r\n }\r\n }\r\n });\r\n }\r\n let results =\r\n searchMenus.length > 0 ? uniqBy(searchMenus, f => f.Title) : searchMenus;\r\n return results;\r\n};\r\nexport function* assetQuickSearchSaga() {\r\n yield takeLatest(actions.setOpen.type, doSetOpen);\r\n yield takeLatest(actions.showSearchInput.type, doShowSearchInput);\r\n yield takeLatest(actions.getRecentAssets.type, doGetRecentAssets);\r\n yield takeLatest(actions.getRecentSearchTerms.type, doGetRecentSearchTerms);\r\n yield debounce(500, actions.searchAssets.type, doSearchAssets);\r\n yield debounce(500, actions.searchAllAssets.type, doSearchAllAssets);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { assetQuickSearchSaga } from './saga';\r\nimport {\r\n AssetQuickSearchDetails,\r\n AssetQuickSearchState,\r\n IMenuItemsSearchResult,\r\n IQuickAssetsSearchResult,\r\n IQuickSearchResults,\r\n} from './types';\r\n\r\nexport const initialState: AssetQuickSearchState = {\r\n open: false,\r\n showSearchInSidebar: false,\r\n showSearchResults: false,\r\n recentAssets: { status: undefined },\r\n recentSearchTerms: { status: undefined },\r\n searchResults: { status: undefined },\r\n allSearchResults: { status: undefined },\r\n onlineSearchResults: undefined,\r\n offlineSearchResults: undefined,\r\n requestSearchResults: undefined,\r\n totalSearchCount: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'assetQuickSearch',\r\n initialState,\r\n reducers: {\r\n showSearchInput(state, action: PayloadAction) {\r\n state.showSearchInSidebar = action.payload;\r\n state.searchTerm = undefined;\r\n },\r\n setOpen(state, action: PayloadAction) {\r\n state.open = action.payload;\r\n },\r\n searchAssets(state: AssetQuickSearchState, action: PayloadAction) {\r\n state.searchTerm = action.payload;\r\n state.showSearchResults = action.payload?.length > 0;\r\n state.searchResults.status = 'pending';\r\n state.searchResults.error = undefined;\r\n },\r\n searchAssets_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.searchResults.status = 'resolved';\r\n state.searchResults.error = undefined;\r\n state.searchResults.value = action.payload;\r\n },\r\n searchAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n state.searchResults.status = 'rejected';\r\n state.searchResults.error = action.payload;\r\n state.searchResults.value = undefined;\r\n },\r\n getRecentAssets(state, action: PayloadAction) {\r\n state.recentAssets.status = 'pending';\r\n state.recentAssets.error = undefined;\r\n },\r\n getRecentAssets_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.recentAssets.status = 'resolved';\r\n state.recentAssets.error = undefined;\r\n state.recentAssets.value = action.payload;\r\n },\r\n getRecentAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n state.recentAssets.status = 'rejected';\r\n state.recentAssets.error = action.payload;\r\n state.recentAssets.value = [];\r\n },\r\n getRecentSearchTerms(state, action: PayloadAction) {\r\n state.recentSearchTerms.status = 'pending';\r\n state.recentSearchTerms.error = undefined;\r\n },\r\n getRecentSearchTerms_Success(state, action: PayloadAction) {\r\n state.recentSearchTerms.status = 'resolved';\r\n state.recentSearchTerms.error = undefined;\r\n state.recentSearchTerms.value = action.payload;\r\n },\r\n getRecentSearchTerms_Error(\r\n state,\r\n action: PayloadAction<{ error: unknown }>,\r\n ) {\r\n state.recentSearchTerms.status = 'rejected';\r\n state.recentSearchTerms.error = action.payload;\r\n state.recentSearchTerms.value = [];\r\n },\r\n searchAllAssets(\r\n state: AssetQuickSearchState,\r\n action: PayloadAction,\r\n ) {\r\n state.searchTerm = action.payload;\r\n state.showSearchResults = action.payload?.length > 0;\r\n state.allSearchResults.status = 'pending';\r\n state.allSearchResults.error = undefined;\r\n },\r\n searchAllAssets_Success(state, action: PayloadAction) {\r\n state.allSearchResults.status = 'resolved';\r\n state.allSearchResults.error = undefined;\r\n state.allSearchResults.value = action.payload;\r\n },\r\n searchAllAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n state.allSearchResults.status = 'rejected';\r\n state.allSearchResults.error = action.payload;\r\n state.allSearchResults.value = undefined;\r\n },\r\n setOnlineSearchResults(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.onlineSearchResults = action.payload;\r\n },\r\n setOfflineSearchResults(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.offlineSearchResults = action.payload;\r\n },\r\n setRequestSearchResults(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.requestSearchResults = action.payload;\r\n },\r\n setTotalSearchCount(state, action: PayloadAction) {\r\n state.totalSearchCount = action.payload;\r\n },\r\n setMenuSearchResults(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.menuItemsSearchResult = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: assetQuickSearchActions } = slice;\r\n\r\nexport const useAssetQuickSearchSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: assetQuickSearchSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useAssetQuickSearchSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.someAction());\r\n * };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.assetQuickSearch || initialState;\r\n\r\nexport const selectAssetQuickSearch = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectRecentAssets = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.recentAssets,\r\n);\r\nexport const selectRecentSearchTerms = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.recentSearchTerms,\r\n);\r\nexport const selectSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.searchResults,\r\n);\r\nexport const selectAllSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.allSearchResults,\r\n);\r\nexport const selectSearchTerm = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.searchTerm,\r\n);\r\nexport const selectOpen = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.open,\r\n);\r\nexport const selectShowSearchInSidebar = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.showSearchInSidebar,\r\n);\r\nexport const selectOnlineSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.onlineSearchResults,\r\n);\r\nexport const selectOfflineSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.offlineSearchResults,\r\n);\r\nexport const selectRequestSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.requestSearchResults,\r\n);\r\nexport const selectTotalSearchCount = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.totalSearchCount,\r\n);\r\nexport const selectMenuSearchResults = createSelector(\r\n [selectAssetQuickSearch],\r\n state => state.menuItemsSearchResult,\r\n);\r\n","/**\r\n *\r\n * ListItemLink\r\n *\r\n */\r\nimport { ListItem, ListItemProps } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\n\r\nexport interface ListItemLinkProps extends ListItemProps {\r\n info?: string;\r\n}\r\n\r\nexport function ListItemLink(props) {\r\n return !!props.info ? (\r\n {props.info}}>\r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetListItem\r\n *\r\n */\r\nimport {\r\n Avatar,\r\n ListItemIcon,\r\n ListItemSecondaryAction,\r\n ListItemText,\r\n} from '@material-ui/core';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { AssetThumbImage } from 'app/components/AssetThumbImage';\r\nimport { AssetQuickSearchDetails } from '../slice/types';\r\nimport { ListItemLink } from 'app/components/ListItemLink';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalSetting, selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body, Tips } from 'app/components/Typography';\r\nimport React from 'react';\r\nimport { ActionIconButton } from 'app/components/BasicButtons/ActionIconButton';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { Entity } from 'types/common';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\n\r\nexport interface AssetListItemProps {\r\n item: AssetQuickSearchDetails;\r\n useAssetPopup?: boolean;\r\n isMobile?: boolean;\r\n selectedServiceGroups?: Entity[];\r\n}\r\n\r\nconst DefaultQuickAssetSearchAction = [\r\n 'AssetDetails',\r\n 'Calendar',\r\n 'Timeline',\r\n] as const;\r\n\r\nconst getAssetDetailsLink = (item: AssetQuickSearchDetails) =>\r\n `/assets/details?id=${item.Id}`;\r\nconst getCalendarLink = (\r\n item: AssetQuickSearchDetails,\r\n EnableLegacyScheduler: boolean,\r\n) => {\r\n if (EnableLegacyScheduler) {\r\n return toRootedURL('/Weekly.aspx', { id: `os${item.ServiceId}` });\r\n }\r\n\r\n return toRootedURL(\r\n `${GetSchedulerPagePath('calendar')}?${toQueryString({\r\n eid: item.ServiceId,\r\n openToBook: true,\r\n })}`,\r\n );\r\n};\r\n\r\nconst getTimelineLink = (\r\n item: AssetQuickSearchDetails,\r\n EnableLegacyScheduler: boolean,\r\n) => {\r\n if (EnableLegacyScheduler) {\r\n return toRootedURL('/Timeline.aspx', { services: item.ServiceId });\r\n }\r\n return toRootedURL(\r\n `${GetSchedulerPagePath('timeline')}?eid=${item.ServiceId}&openToBook=true`,\r\n );\r\n};\r\n\r\nfunction getSettingValue(\r\n g: GlobalSettings,\r\n selectedServiceGroups?: Entity[],\r\n): (item: AssetQuickSearchDetails) => { t: string; url: string } {\r\n const s = g.GetString(AllowedSettings.DefaultQuickAssetSearchAction);\r\n const t = g.GetBooleanByKey(AllowedSettings.EnableLegacyScheduler);\r\n var validKey =\r\n DefaultQuickAssetSearchAction.find(f => f === s) || 'AssetDetails';\r\n return (item: AssetQuickSearchDetails) => {\r\n if (\r\n !item.BookableAsset ||\r\n (item.BookableAsset &&\r\n !selectedServiceGroups?.some(f => f.Id === item.ServiceGroupId))\r\n ) {\r\n return { t: 'AssetDetails', url: getAssetDetailsLink(item) };\r\n }\r\n switch (validKey) {\r\n case 'AssetDetails':\r\n return { t: validKey, url: getAssetDetailsLink(item) };\r\n case 'Calendar':\r\n return { t: validKey, url: getCalendarLink(item, t) };\r\n case 'Timeline':\r\n return { t: validKey, url: getTimelineLink(item, t) };\r\n }\r\n };\r\n}\r\n\r\nexport function AssetListItem({\r\n item,\r\n useAssetPopup,\r\n isMobile,\r\n selectedServiceGroups,\r\n}: AssetListItemProps) {\r\n const { t } = useTranslation();\r\n const history = useHistory();\r\n const truncateName = isMobile\r\n ? item.Name?.length > 25\r\n : item.Name?.length > 50;\r\n const app = useSelector(selectglobalSettings);\r\n const defaultLink = getSettingValue(app);\r\n const EnableLegacyScheduler = useSelector(\r\n state =>\r\n tryParseBool(\r\n selectGlobalSetting(state, AllowedSettings.EnableLegacyScheduler),\r\n ) === true,\r\n );\r\n const showCalendarLinks = React.useMemo(() => {\r\n return (\r\n (selectedServiceGroups === undefined && item.BookableAsset) ||\r\n (!!selectedServiceGroups &&\r\n selectedServiceGroups.some(f => f.Id === item.ServiceGroupId))\r\n );\r\n }, [item.BookableAsset, item.ServiceGroupId, selectedServiceGroups]);\r\n const href = React.useMemo(() => {\r\n return defaultLink(item);\r\n }, [defaultLink, item]);\r\n const handleAssetClick = React.useCallback(() => {\r\n history.push(href.url);\r\n }, [history, href.url]);\r\n return (\r\n \r\n \r\n {item.Image !== null ? (\r\n \r\n ) : (\r\n {'A'}\r\n )}\r\n \r\n {cliTruncate(item.Name, 25, { position: 'end' })}\r\n ) : (\r\n <>\r\n {truncateName ? (\r\n \r\n {item.Name?.substr(0, 50) + '...'}\r\n \r\n ) : (\r\n <>{item.Name}\r\n )}\r\n \r\n )\r\n }\r\n secondary={\r\n isMobile ? (\r\n cliTruncate(item.AvailabilityTypeName, 15, { position: 'middle' })\r\n ) : item.ApprovalRequired ? (\r\n \r\n {item.AvailabilityTypeName}\r\n {t(translations.ApprovalRequired) as string}\r\n \r\n ) : (\r\n item.AvailabilityTypeName\r\n )\r\n }\r\n />\r\n \r\n
    \r\n {item.BookableAsset && showCalendarLinks && (\r\n \r\n )}\r\n {/* {item.BookableAsset && showCalendarLinks && (\r\n \r\n )} */}\r\n {/* */}\r\n
    \r\n
    \r\n \r\n );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const QuickSearchSection = styled('div')`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 8px;\r\n align-self: stretch;\r\n width: 100%;\r\n`;\r\nexport const QuickSearchSectionTitle = styled('div')`\r\n display: flex;\r\n padding: 0px 8px;\r\n align-items: center;\r\n gap: 10px;\r\n align-self: stretch;\r\n`;\r\nexport const QuickSearchSearchesItems = styled('div')`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: flex-start;\r\n flex-wrap: wrap;\r\n gap: 8px;\r\n align-self: stretch;\r\n`;\r\nexport const QuickSearchRecentItems = styled('div')`\r\n display: flex;\r\n padding: 4px 0px;\r\n flex-direction: column;\r\n align-items: stretch;\r\n gap: 4px;\r\n align-self: stretch;\r\n width: 100%;\r\n`;\r\nexport const QuickSearchEmptySection = styled('div')`\r\n display: flex;\r\n width: 100%;\r\n height: 260px;\r\n padding: 0px 16px 16px 16px;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n flex-shrink: 0;\r\n`;\r\nexport const QuickSearchEmptyContent = styled('div')`\r\n display: flex;\r\n padding: 0px 8px;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 8px;\r\n align-self: stretch;\r\n`;\r\nexport const QuickSearchSeeAll = styled('div')`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n align-self: stretch;\r\n`;\r\nexport const QuickSearchMainTitleSection = styled('div')`\r\n display: flex;\r\n padding: 0px 8px;\r\n align-items: center;\r\n gap: 10px;\r\n align-self: stretch;\r\n`;\r\nexport const QuickSearchAllInstrumentsSection = styled('div')`\r\n display: flex;\r\n padding: 0px 8px;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 10px;\r\n align-self: stretch;\r\n`;\r\nexport const MenuSearchEmptyContent = styled('div')`\r\n display: flex;\r\n width: 100%;\r\n padding: 0px 16px 16px 16px;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n flex-shrink: 0;\r\n`;\r\n","/**\r\n *\r\n * RecentAssetsList\r\n *\r\n */\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRecentAssets } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AssetListItem } from '../AssetListItem';\r\nimport {\r\n QuickSearchSection,\r\n QuickSearchRecentItems,\r\n QuickSearchSectionTitle,\r\n} from '../RecentWrappers/wrappers';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RecentAssetsListProps {\r\n useAssetPopup?: boolean;\r\n isMobile?: boolean;\r\n selectedServiceGroups?: Entity[];\r\n}\r\n\r\nexport function RecentAssetsList(props: RecentAssetsListProps) {\r\n const { t } = useTranslation();\r\n const data = useSelector(selectRecentAssets);\r\n const { useAssetPopup, isMobile, selectedServiceGroups } = props;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {t(translations.RecentAssets)}\r\n \r\n \r\n \r\n {data.status === 'pending' ? (\r\n
    \r\n \r\n
    \r\n ) : data.status === 'rejected' ||\r\n (data.status === 'resolved' && data.value?.length === 0) ? (\r\n
    \r\n {'No recent data'}\r\n
    \r\n ) : (\r\n \r\n {data.value?.map((item, index) => (\r\n \r\n ))}\r\n \r\n )}\r\n
    \r\n
    \r\n
    \r\n );\r\n}\r\n","import Chip from '@material-ui/core/Chip';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport React from 'react';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface RecentItemProps {\r\n label: React.ReactNode;\r\n icon?: IconProp;\r\n link?: string | IPathAndQuery;\r\n searchTerm?: string;\r\n onClick?: (searchTerm?: string) => void;\r\n}\r\nexport function RecentItem(props: RecentItemProps) {\r\n const { label, icon, onClick, searchTerm, link } = props;\r\n const handleClick = React.useCallback(() => {\r\n !!onClick && onClick(searchTerm);\r\n }, [onClick, searchTerm]);\r\n const absolutePath =\r\n link === undefined\r\n ? undefined\r\n : typeof link === 'string'\r\n ? toRootedURL(link)\r\n : toRootedURL(\r\n (link as IPathAndQuery).path,\r\n (link as IPathAndQuery).search,\r\n );\r\n return (\r\n handleClick()}\r\n component={'a'}\r\n avatar={}\r\n href={absolutePath}\r\n clickable\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * RecentSearchTermsList\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRecentSearchTerms } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RecentItem } from '../RecentItem';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport {\r\n QuickSearchSection,\r\n QuickSearchSearchesItems,\r\n QuickSearchSectionTitle,\r\n QuickSearchEmptyContent,\r\n} from '../RecentWrappers/wrappers';\r\n\r\nexport interface RecentSearchTermsListProps {\r\n onClick: (searchTerm?: string) => void;\r\n}\r\n\r\nexport function RecentSearchTermsList(props: RecentSearchTermsListProps) {\r\n const { t } = useTranslation();\r\n const recentSearchTermsState = useSelector(selectRecentSearchTerms);\r\n const { onClick } = props;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {t(translations.RecentSearches)}\r\n \r\n \r\n \r\n {recentSearchTermsState.status === 'pending' ? (\r\n
    \r\n \r\n
    \r\n ) : recentSearchTermsState.status === 'rejected' ||\r\n (recentSearchTermsState.status === 'resolved' &&\r\n recentSearchTermsState.value?.length === 0) ? (\r\n \r\n \r\n \r\n {t(translations.NoSearchTermFound)}\r\n \r\n \r\n \r\n ) : (\r\n <>\r\n {recentSearchTermsState.value?.map((item, index) => (\r\n onClick(search)}\r\n // link={toRootedURL(`/assets/`, { q: item })}\r\n />\r\n ))}\r\n \r\n )}\r\n
    \r\n
    \r\n
    \r\n \r\n );\r\n}\r\n","import { SiteMapNode } from 'types/SiteMapSettings';\r\nimport * as React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\n\r\nexport interface MenuSearchItemProps {\r\n item: SiteMapNode;\r\n}\r\n\r\nexport function MenuSearchItem(props: MenuSearchItemProps) {\r\n const { item } = props;\r\n const convertUrl = (url: string): string => {\r\n if (url !== null) {\r\n if (url.indexOf(process.env.PUBLIC_URL) !== -1) {\r\n return url.replace(process.env.PUBLIC_URL, '');\r\n }\r\n return url;\r\n }\r\n return url;\r\n };\r\n const link: string = React.useMemo(() => {\r\n return item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length > 0\r\n ? item.LinkWithChildren ?? item.reactUrl ?? convertUrl(item.Url)\r\n : item.reactUrl ?? convertUrl(item.Url);\r\n }, [item.ChildNodes, item.LinkWithChildren, item.Url, item.reactUrl]);\r\n\r\n const external = React.useMemo(() => {\r\n return (\r\n link.includes('aspx') ||\r\n (isNullOrUndefined(item.reactUrl) &&\r\n item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length === 0)\r\n );\r\n }, [item.ChildNodes, item.reactUrl, link]);\r\n return (\r\n \r\n {item.Title}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * MenuSearchResultList\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectMenuSearchResults } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport {\r\n QuickSearchSection,\r\n QuickSearchSearchesItems,\r\n QuickSearchSectionTitle,\r\n QuickSearchEmptyContent,\r\n MenuSearchEmptyContent,\r\n} from '../RecentWrappers/wrappers';\r\nimport { MenuSearchItem } from '../MenuSearchItem';\r\n\r\nexport interface MenuSearchResultListProps {}\r\n\r\nexport function MenuSearchResultList(props: MenuSearchResultListProps) {\r\n const { t } = useTranslation();\r\n const menuSearchState = useSelector(selectMenuSearchResults);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {t(translations.RelatedScreens)}\r\n \r\n \r\n \r\n {menuSearchState === undefined ||\r\n menuSearchState.Results.length === 0 ? (\r\n \r\n \r\n \r\n \r\n {t(translations.NoRelatedScreensFound)}\r\n \r\n \r\n \r\n \r\n ) : (\r\n <>\r\n {menuSearchState.Results.map((item, index) => (\r\n \r\n ))}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetSearchResultsByType\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n selectAllSearchResults,\r\n selectMenuSearchResults,\r\n selectOfflineSearchResults,\r\n selectOnlineSearchResults,\r\n selectRequestSearchResults,\r\n selectSearchTerm,\r\n selectTotalSearchCount,\r\n} from '../slice/selectors';\r\nimport { AssetListItem } from '../AssetListItem';\r\nimport {\r\n QuickSearchEmptyContent,\r\n QuickSearchEmptySection,\r\n QuickSearchRecentItems,\r\n QuickSearchSection,\r\n QuickSearchSectionTitle,\r\n QuickSearchSeeAll,\r\n} from '../RecentWrappers/wrappers';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Entity } from 'types/common';\r\nimport { MenuSearchResultList } from '../MenuSearchResultList';\r\n\r\nexport interface AssetSearchResultsByTypeProps {\r\n onAllAssetsClick: (serviceTypeId?: number, searchTerm?: string) => void;\r\n isMobile?: boolean;\r\n selectedServiceGroups?: Entity[];\r\n}\r\n\r\nexport function AssetSearchResultsByType(props: AssetSearchResultsByTypeProps) {\r\n const { t } = useTranslation();\r\n const { onAllAssetsClick, isMobile, selectedServiceGroups } = props;\r\n // const searchTerm = useSelector(selectSearchTerm);\r\n const state = useSelector(selectAllSearchResults);\r\n const onlineState = useSelector(selectOnlineSearchResults);\r\n const offlineState = useSelector(selectOfflineSearchResults);\r\n const requestState = useSelector(selectRequestSearchResults);\r\n const totalRresults = useSelector(selectTotalSearchCount);\r\n const searchTerm = useSelector(selectSearchTerm);\r\n const menuItemsState = useSelector(selectMenuSearchResults);\r\n // const resultsLength = React.useMemo(() => {\r\n // return state.value?.totalRresults;\r\n // }, [state.value?.totalRresults]);\r\n\r\n const OnlineServiceLabel = React.useMemo(() => {\r\n return (t(translations.InstrumentsFound) as string).replace(\r\n '{0}',\r\n `(${(onlineState?.TotalResultsLength ?? 0).toString()})`,\r\n );\r\n }, [onlineState?.TotalResultsLength, t]);\r\n const RequestServiceLabel = React.useMemo(() => {\r\n return (t(translations.RequestsFound) as string).replace(\r\n '{0}',\r\n `(${(requestState?.TotalResultsLength ?? 0).toString()})`,\r\n );\r\n }, [requestState?.TotalResultsLength, t]);\r\n const OfflineServiceLabel = React.useMemo(() => {\r\n return (t(translations.ConsumablesFound) as string).replace(\r\n '{0}',\r\n `(${(offlineState?.TotalResultsLength ?? 0).toString()})`,\r\n );\r\n }, [offlineState?.TotalResultsLength, t]);\r\n\r\n const showOnline = React.useMemo(() => {\r\n return (\r\n (state.status === 'pending' &&\r\n !!onlineState &&\r\n onlineState.Results.length > 0) ||\r\n (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n );\r\n }, [onlineState, state.status, totalRresults]);\r\n\r\n const showOffline = React.useMemo(() => {\r\n return (\r\n (state.status === 'pending' &&\r\n !!offlineState &&\r\n offlineState.Results.length > 0) ||\r\n (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n );\r\n }, [offlineState, state.status, totalRresults]);\r\n const showRequests = React.useMemo(() => {\r\n return (\r\n (state.status === 'pending' &&\r\n !!requestState &&\r\n requestState.Results.length > 0) ||\r\n (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n );\r\n }, [requestState, state.status, totalRresults]);\r\n // const error = React.useMemo(() => {\r\n // return state.error !== undefined\r\n // ? typeof state.error === 'string'\r\n // ? state.error\r\n // : undefined\r\n // : undefined;\r\n // }, [state.error]);\r\n return (\r\n <>\r\n {!state.status ||\r\n (state.status === 'pending' && (\r\n
    \r\n \r\n
    \r\n ))}\r\n {state.status === 'resolved' && totalRresults === 0 && (\r\n \r\n \r\n \r\n \r\n \r\n {t(translations.NothingFound)}\r\n \r\n \r\n \r\n \r\n {`Try to `}\r\n \r\n \r\n \r\n {` or change the query`}\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n\r\n \r\n {showOnline && (\r\n \r\n \r\n {OnlineServiceLabel}\r\n \r\n }\r\n onClick={() =>\r\n onAllAssetsClick(ServiceType.Online, searchTerm)\r\n }\r\n >\r\n {t(translations.FullResults)}\r\n \r\n \r\n \r\n \r\n \r\n {onlineState?.Results?.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n )}\r\n\r\n {showOffline && (\r\n \r\n \r\n {OfflineServiceLabel}\r\n \r\n }\r\n onClick={() =>\r\n onAllAssetsClick(ServiceType.Offline, searchTerm)\r\n }\r\n >\r\n {t(translations.FullResults)}\r\n \r\n \r\n \r\n \r\n \r\n {offlineState?.Results?.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n )}\r\n\r\n {showRequests && (\r\n \r\n \r\n {RequestServiceLabel}\r\n \r\n }\r\n onClick={() =>\r\n onAllAssetsClick(ServiceType.Sample, searchTerm)\r\n }\r\n >\r\n {t(translations.FullResults)}\r\n \r\n \r\n \r\n \r\n \r\n {requestState?.Results?.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n )}\r\n {!!menuItemsState && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * AssetQuickSearch\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n ClickAwayListener,\r\n createStyles,\r\n Fade,\r\n List,\r\n makeStyles,\r\n Paper,\r\n Popper,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useAssetQuickSearchSlice } from './slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAssetQuickSearch,\r\n selectOpen,\r\n selectSearchTerm,\r\n} from './slice/selectors';\r\nimport { RecentAssetsList } from './RecentAssetsList';\r\nimport { RecentSearchTermsList } from './RecentSearchTermsList';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { TextControlField } from '../BasicInputs/TextControlField';\r\nimport { useRef } from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useEffect } from 'react';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Body } from '../Typography';\r\nimport useGlobalDOMEvents from 'app/hooks/useGlobalDomEvents';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { box_shadow_s } from 'styles/shadows/bookitShadow';\r\nimport { BasicToggle } from '../BasicToggle';\r\nimport { AssetSearchResultsByType } from './AssetSearchResultsByType';\r\nimport {\r\n QuickSearchAllInstrumentsSection,\r\n QuickSearchMainTitleSection,\r\n} from './RecentWrappers/wrappers';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AssetQuickSearchProps {\r\n showInSideBar?: boolean;\r\n}\r\n\r\nexport const AssetQuickSearch = React.memo(function AssetQuickSearch(\r\n props: AssetQuickSearchProps,\r\n) {\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const { actions } = useAssetQuickSearchSlice();\r\n const { actions: appSettingsAction } = useAppSettingsSlice();\r\n const open = useSelector(selectOpen);\r\n const isMobile = DetectIsMobile();\r\n const searchAllCores = useSelector(selectShowAllCores);\r\n const searchTerm = useSelector(selectSearchTerm);\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const handleInputChange = e => {\r\n if (!open) {\r\n dispatch(actions.setOpen(true));\r\n }\r\n dispatch(actions.searchAllAssets(e.target.value));\r\n };\r\n const state = useSelector(selectAssetQuickSearch);\r\n const elementRef = useRef(null);\r\n\r\n const handleClick = event => {\r\n dispatch(actions.setOpen(true));\r\n };\r\n\r\n const handleSearchAllCores = (value: boolean) => {\r\n dispatch(appSettingsAction.setShowAllCores(value));\r\n if (!!searchTerm && searchTerm !== '') {\r\n dispatch(actions.searchAllAssets(searchTerm));\r\n } else {\r\n dispatch(actions.getRecentSearchTerms());\r\n dispatch(actions.getRecentAssets());\r\n }\r\n };\r\n\r\n const handleClose = () => {\r\n if (open) {\r\n dispatch(actions.setOpen(false));\r\n }\r\n };\r\n const handleHideAssetQuickSearchClick = () => {\r\n dispatch(actions.showSearchInput(false));\r\n };\r\n const handleOpenAssets = (serviceTypeId?: number, searchTerm?: string) => {\r\n let selParams = {\r\n useSidePanel: true,\r\n actionType: 'AssetSearch',\r\n serviceTypeId: serviceTypeId,\r\n searchTerm: searchTerm,\r\n //offTypeIds: services,\r\n } as AssetsSelectionProps;\r\n if (isMobile) {\r\n dispatch(\r\n appSettingsAction.navigate(\r\n `/AssetSearch?${toQueryString({\r\n actionType: 'AssetSearch',\r\n serviceTypeId: serviceTypeId,\r\n searchTerm: searchTerm,\r\n })}`,\r\n ),\r\n );\r\n } else {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.AssetsSelection,\r\n props: selParams,\r\n expanded: true,\r\n }),\r\n );\r\n }\r\n };\r\n // manually trigger rerender using a useless usState hook\r\n // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n const countState = React.useState(0);\r\n useEffect(() => {\r\n countState[1](c => c + 1);\r\n // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementRef.current]);\r\n useGlobalDOMEvents({\r\n keyup(ev) {\r\n if ((ev as KeyboardEvent).key === 'Escape') {\r\n dispatch(actions.setOpen(false));\r\n }\r\n },\r\n });\r\n\r\n return (\r\n handleClose()}>\r\n \r\n
    \r\n {isMobile && (\r\n handleHideAssetQuickSearchClick()}\r\n title={t(translations.Close)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n size=\"small\"\r\n >\r\n \r\n \r\n )}\r\n handleInputChange(e)}\r\n onFocus={e => handleClick(e)}\r\n onClick={e => handleClick(e)}\r\n autoFocus={false}\r\n size=\"small\"\r\n value={state.searchTerm || ''}\r\n classes={{\r\n root: props.showInSideBar\r\n ? classes.inputRootMobile\r\n : classes.inputRoot,\r\n }}\r\n autoComplete=\"off\"\r\n aria-label=\"search\"\r\n inputProps={{ 'aria-label': 'search' }}\r\n endIcon={}\r\n fullWidth\r\n />\r\n {elementRef.current !== null && (\r\n \r\n {({ TransitionProps }) => (\r\n \r\n \r\n \r\n \r\n {isMobile\r\n ? t(translations.AssetsSearch)\r\n : t(translations.InstrumentAssetSearch)}\r\n \r\n handleSearchAllCores(value)}\r\n />\r\n \r\n {state.searchTerm !== undefined &&\r\n state.searchTerm?.length > 0 ? (\r\n \r\n {\r\n handleOpenAssets(serviceType, searchTerm);\r\n handleClose();\r\n }}\r\n selectedServiceGroups={selectedServiceGroups}\r\n isMobile={isMobile}\r\n />\r\n \r\n ) : (\r\n \r\n {\r\n handleOpenAssets(undefined, searchTerm);\r\n handleClose();\r\n }}\r\n />\r\n {/* \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.AdvancedAssetSearch)}\r\n \r\n \r\n \r\n handleClose()}\r\n title={t(translations.Close)}\r\n variant=\"ghost\"\r\n shape=\"square\"\r\n aria-label=\"close\"\r\n size=\"small\"\r\n >\r\n \r\n \r\n \r\n */}\r\n {/* */}\r\n \r\n \r\n {\r\n handleOpenAssets();\r\n handleClose();\r\n }}\r\n >\r\n {t(translations.SeeAllInstruments)}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n )}\r\n
    \r\n \r\n
    \r\n );\r\n});\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n // root css\r\n },\r\n menuButton: {\r\n marginRight: theme.spacing(2),\r\n },\r\n title: {\r\n flexGrow: 1,\r\n display: 'none',\r\n [theme.breakpoints.up('sm')]: {\r\n display: 'block',\r\n },\r\n },\r\n search: {\r\n position: 'relative',\r\n display: 'flex',\r\n alignItems: 'center',\r\n borderRadius: theme.shape.borderRadius,\r\n // backgroundColor: alpha(theme.palette.common.white, 0.15),\r\n // '&:hover': {\r\n // backgroundColor: alpha(theme.palette.common.white, 0.25),\r\n // },\r\n marginLeft: 0,\r\n [theme.breakpoints.up('sm')]: {\r\n width: 355,\r\n },\r\n [theme.breakpoints.up('lg')]: {\r\n width: 463,\r\n },\r\n paddingTop: 2,\r\n paddingBottom: 2,\r\n gap: 8,\r\n // [theme.breakpoints.up('sm')]: {\r\n // marginLeft: theme.spacing(1),\r\n // width: 'auto',\r\n // },\r\n },\r\n searchIcon: {\r\n padding: theme.spacing(0, 2),\r\n height: '100%',\r\n position: 'absolute',\r\n pointerEvents: 'none',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n },\r\n inputRoot: {\r\n color: 'inherit',\r\n flexGrow: 1,\r\n },\r\n inputRootMobile: {\r\n color: 'inherit',\r\n flexGrow: 1,\r\n flexShrink: 1,\r\n },\r\n inputInput: {\r\n padding: theme.spacing(1, 1, 1, 0),\r\n // vertical padding + font size from searchIcon\r\n paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,\r\n transition: theme.transitions.create('width'),\r\n width: '100%',\r\n [theme.breakpoints.up('sm')]: {\r\n width: '30ch',\r\n '&:focus': {\r\n width: '50ch',\r\n },\r\n },\r\n },\r\n popper: {\r\n // +1 from the appBar (zIndex: theme.zIndex.drawer + 1)\r\n zIndex: theme.zIndex.drawer + 2,\r\n '&.isMobile': {\r\n zIndex: theme.zIndex.modal + 2,\r\n height: 'calc(100% - 92px)',\r\n },\r\n\r\n [theme.breakpoints.up('lg')]: {\r\n width: 700,\r\n },\r\n [theme.breakpoints.down('lg')]: {\r\n width: 600,\r\n },\r\n [theme.breakpoints.down('sm')]: {\r\n width: '100%',\r\n },\r\n },\r\n paper: {\r\n display: 'flex',\r\n width: '672px',\r\n padding: '16px 12px',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '24px',\r\n\r\n borderRadius: '12px',\r\n border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n background: bookitColors.base.white,\r\n /* Shadow/box-shadow-s */\r\n boxShadow: box_shadow_s,\r\n '&.isMobile': {\r\n width: '100%',\r\n height: '100%',\r\n },\r\n },\r\n paperTitleSection: {},\r\n }),\r\n);\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n userDetails: () => _t(translations.UserDetails),\r\n changePassword: () => _t(translations.reg_ChangePassword),\r\n changeUserGroup: () => _t(translations.changeUserGroup),\r\n logout: () => _t(translations.main_master_LogOutLinkText),\r\n help: () => _t(translations.Help),\r\n optOutNotifications: () => _t(translations.OptOutNotifications),\r\n optOutNotificationsTitle: () => _t(translations.OptOutNotifications_info),\r\n coreRegistration: () => _t(translations.ServiceGroupRegistration),\r\n googleCalendar: () => _t(translations.menu_GoogleCalendar),\r\n outlookCalendar: () => _t(translations.menu_OutlookCalendar),\r\n notifications: () => _t(translations.Notifications),\r\n};\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface UserMenuButtonProps extends ButtonProps {\r\n children: React.ReactNode;\r\n open: boolean;\r\n isMobile?: boolean;\r\n}\r\n\r\nexport default function UserMenuButton(props: UserMenuButtonProps) {\r\n const { children, isMobile, open, ...other } = props;\r\n return isMobile ? (\r\n \r\n {children}\r\n \r\n ) : (\r\n }\r\n startIcon={\r\n \r\n }\r\n {...other}\r\n >\r\n {children}\r\n \r\n );\r\n}\r\n","import {\r\n MenuItem,\r\n Divider,\r\n ListItemIcon,\r\n ListItemText,\r\n} from '@material-ui/core';\r\n\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { messages } from '../messages';\r\nimport UserMenuButton from './UserMenuButton';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { translations } from 'locales/translations';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { StyledUserMenu } from '../../styled';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\nimport { Roles } from 'app/slice/types';\r\n\r\nexport interface UserMenuProps {}\r\n\r\nexport function UserMenu(props: UserMenuProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const [open, setOpen] = React.useState(false);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const settings = useSelector(selectglobalSettings);\r\n const appSettings = useSelector(selectAppSettings);\r\n const googleCalendarModuleEnabled = IsModuleEnabled(\r\n appSettings,\r\n KnownModules.GoogleCalendar,\r\n );\r\n const multipleAdGroupsModuleEnabled = IsModuleEnabled(\r\n appSettings,\r\n KnownModules.MultipleAdGroups,\r\n );\r\n const serviceGroupRegistrationModuleEnabled = IsModuleEnabled(\r\n appSettings,\r\n KnownModules.ServiceGroupRegistration,\r\n );\r\n const isAdmin =\r\n isInRole(authenticatedUser, Roles.Administrators) ||\r\n isInRole(authenticatedUser, Roles.GroupAdministrators);\r\n const googleCalendar = googleCalendarModuleEnabled; // && authenticatedUser?.CalendarType === 0;\r\n const outlookCalendar = googleCalendarModuleEnabled; // && authenticatedUser?.CalendarType === 1;\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const handleClick = (event: React.MouseEvent) => {\r\n setAnchorEl(event.currentTarget);\r\n setOpen(true);\r\n };\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n setOpen(false);\r\n };\r\n const Opt_Out = settings.GetBooleanByKey(AllowedSettings.AllowUsersToOpt_Out);\r\n const theme = useTheme();\r\n return (\r\n \r\n handleClick(event)}\r\n open={open}\r\n isMobile={isMobile}\r\n >\r\n {isMobile && (\r\n \r\n )}\r\n {!isMobile && authenticatedUser?.DisplayName}\r\n \r\n handleClose()}\r\n >\r\n {isMobile && (\r\n handleClose()}>\r\n \r\n \r\n \r\n \r\n {authenticatedUser?.DisplayName}\r\n \r\n \r\n )}\r\n {isMobile && }\r\n handleClose()}\r\n >\r\n \r\n \r\n \r\n {t(messages.userDetails())}\r\n \r\n {googleCalendar && (\r\n handleClose()}\r\n >\r\n \r\n \r\n \r\n {t(messages.googleCalendar())}\r\n \r\n )}\r\n {outlookCalendar && (\r\n handleClose()}\r\n >\r\n \r\n \r\n \r\n {t(messages.outlookCalendar())}\r\n \r\n )}\r\n handleClose()}\r\n >\r\n \r\n \r\n \r\n {t(messages.changePassword())}\r\n \r\n handleClose()}\r\n component={'a'}\r\n href={toRootedURL('/ActiveUserGroup/shrink')}\r\n disabled={\r\n !(\r\n (authenticatedUser?.UserGroups?.length || 1) > 1 &&\r\n multipleAdGroupsModuleEnabled\r\n )\r\n }\r\n >\r\n \r\n \r\n \r\n 1 &&\r\n multipleAdGroupsModuleEnabled\r\n ? //t(messages.changeUserGroup()) +\r\n t(translations.SwitchFromToAnotherUserGroup).replace(\r\n '{0}',\r\n (authenticatedUser?.ActiveUserGroup?.Name as string) ??\r\n (authenticatedUser?.ActiveUserGroup?.Id as string),\r\n )\r\n : authenticatedUser?.ActiveUserGroup?.Name ??\r\n authenticatedUser?.ActiveUserGroup?.Id\r\n }\r\n >\r\n \r\n {(authenticatedUser?.UserGroups?.length || 1) > 1 &&\r\n multipleAdGroupsModuleEnabled\r\n ? //t(messages.changeUserGroup()) +\r\n t(translations.SwitchFrom).replace(\r\n '{0}',\r\n (authenticatedUser?.ActiveUserGroup?.Name as string) ??\r\n (authenticatedUser?.ActiveUserGroup?.Id as string),\r\n )\r\n : authenticatedUser?.ActiveUserGroup?.Name ??\r\n authenticatedUser?.ActiveUserGroup?.Id}\r\n \r\n \r\n }\r\n >
    \r\n \r\n {Opt_Out && (\r\n handleClose()}>\r\n t(messages.optOutNotificationsTitle())}\r\n />\r\n \r\n )}\r\n {(authenticatedUser?.HasRegisterableServiceGroups || false) &&\r\n serviceGroupRegistrationModuleEnabled && (\r\n handleClose()}\r\n component={'a'}\r\n href={toRootedURL('/ServiceGroupRegistrations.aspx')}\r\n target={'_blank'}\r\n >\r\n \r\n \r\n \r\n {t(messages.coreRegistration())}\r\n \r\n )}\r\n handleClose()}\r\n component={'a'}\r\n href={toRootedURL('/NotificationSettings.aspx')}\r\n target={'_blank'}\r\n >\r\n \r\n \r\n \r\n {t(messages.notifications())}\r\n \r\n\r\n handleClose()}\r\n component={'a'}\r\n href={\r\n isAdmin\r\n ? toRootedURL('/Admin/default.aspx')\r\n : toRootedURL('/help.aspx')\r\n }\r\n target={'_blank'}\r\n >\r\n \r\n \r\n \r\n {t(messages.help())}\r\n \r\n handleClose()}\r\n component={'a'}\r\n href={toRootedURL('/account/signout')}\r\n >\r\n \r\n \r\n \r\n {t(messages.logout())}\r\n \r\n \r\n \r\n );\r\n}\r\n","import {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport * as React from 'react';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { MenuItem } from '@material-ui/core';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface SwitchSitesProps {}\r\n\r\nexport function SwitchSites(props: SwitchSitesProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const settings = useSelector(selectglobalSettings);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n const allowToSwitchToOtherSites = settings.GetBooleanByKey(\r\n AllowedSettings.AllowToSwitchToOtherSites,\r\n );\r\n const externalTitleOne = settings.GetNullableByKey(\r\n AllowedSettings.ExternalSwitchTitle1,\r\n );\r\n const externalUrlOne = settings.GetNullableByKey(\r\n AllowedSettings.ExternalSwitchUrl1,\r\n );\r\n const externalTitleTwo = settings.GetNullableByKey(\r\n AllowedSettings.ExternalSwitchTitle2,\r\n );\r\n const externalUrlTwo = settings.GetNullableByKey(\r\n AllowedSettings.ExternalSwitchUrl2,\r\n );\r\n const externalSitesIcon = settings.GetNullableByKey(\r\n AllowedSettings.ExternalSitesIcon,\r\n );\r\n const buttonIcon = React.useMemo(() => {\r\n if (externalSitesIcon !== null) {\r\n if (externalSitesIcon.indexOf('globe-europe') !== -1) {\r\n return 'earth-europe' as IconProp;\r\n } else if (externalSitesIcon.indexOf(' fa-') !== -1) {\r\n let tmpIcon = externalSitesIcon.substring(\r\n externalSitesIcon.indexOf(' fa-') + 4,\r\n externalSitesIcon.length,\r\n );\r\n return tmpIcon as IconProp;\r\n } else {\r\n return 'earth-europe' as IconProp;\r\n }\r\n } else {\r\n return 'earth-europe' as IconProp;\r\n }\r\n }, [externalSitesIcon]);\r\n const hasExternalOne = React.useMemo(() => {\r\n return !(\r\n isEmptyOrWhitespace(externalTitleOne) ||\r\n isEmptyOrWhitespace(externalUrlOne)\r\n );\r\n }, [externalTitleOne, externalUrlOne]);\r\n const hasExternalTwo = React.useMemo(() => {\r\n return !(\r\n isEmptyOrWhitespace(externalTitleTwo) ||\r\n isEmptyOrWhitespace(externalUrlTwo)\r\n );\r\n }, [externalTitleTwo, externalUrlTwo]);\r\n const useExternalLinks = React.useMemo(() => {\r\n return (\r\n allowToSwitchToOtherSites &&\r\n (hasExternalOne || hasExternalTwo) &&\r\n authenticatedUser?.IsActiveDirectory\r\n );\r\n }, [\r\n allowToSwitchToOtherSites,\r\n authenticatedUser?.IsActiveDirectory,\r\n hasExternalOne,\r\n hasExternalTwo,\r\n ]);\r\n const items: React.ReactNode[] = React.useMemo(() => {\r\n let actions: React.ReactNode[] = [];\r\n if (hasExternalOne && externalUrlOne !== null) {\r\n actions.push(\r\n \r\n {externalTitleOne}\r\n ,\r\n );\r\n }\r\n if (hasExternalTwo && externalUrlTwo !== null) {\r\n actions.push(\r\n \r\n {externalTitleTwo}\r\n ,\r\n );\r\n }\r\n return actions;\r\n }, [\r\n externalTitleOne,\r\n externalTitleTwo,\r\n externalUrlOne,\r\n externalUrlTwo,\r\n hasExternalOne,\r\n hasExternalTwo,\r\n ]);\r\n return useExternalLinks ? (\r\n items}\r\n iconButton={isMobile}\r\n menuProps={{\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n },\r\n transformOrigin: {\r\n vertical: 'top',\r\n horizontal: 'left',\r\n },\r\n getContentAnchorEl: null,\r\n }}\r\n >\r\n \r\n \r\n ) : null;\r\n}\r\n","/**\r\n *\r\n * ProfileMenu\r\n *\r\n */\r\nimport React from 'react';\r\nimport { EventsCount } from './EventsCount';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { UserMenu } from './UserMenu';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { ProfileSection } from '../styled';\r\nimport { SwitchSites } from './SwitchSites';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectShowGlobalServiceGroupFilter } from 'app/slice/selectors';\r\n\r\nexport const ProfileMenu = React.memo(function ProfileMenu() {\r\n const theme = useTheme();\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n return (\r\n \r\n {!showGroups && }\r\n \r\n \r\n \r\n {/*
    \r\n \r\n
    */}\r\n\r\n {/*
    \r\n \r\n
    \r\n\r\n
    \r\n {/* \r\n \r\n
    */}\r\n\r\n {/*
    \r\n \r\n
    \r\n
    \r\n \r\n
    */}\r\n
    \r\n );\r\n});\r\n","import { IconProp } from 'app/AllIcons';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\n\r\nexport interface ToggleSideMenuButtonProps {\r\n icon?: IconProp;\r\n}\r\nexport function ToggleSideMenuButton(props: ToggleSideMenuButtonProps) {\r\n const { toggle } = useExpandedSideBarState();\r\n const { icon } = props;\r\n return (\r\n {\r\n toggle();\r\n }}\r\n >\r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * TopToolbar\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { ToolbarProps } from '@material-ui/core/Toolbar';\r\nimport { CustomerLogo } from '../../CustomerLogo';\r\nimport { ProfileMenu } from '../ProfileMenu';\r\nimport styled from 'styled-components';\r\nimport { StyledToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar/styled';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { ToggleSideMenuButton } from '../components/ToggleSideMenuButton';\r\nimport clsx from 'clsx';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface TopToolbarProps extends ToolbarProps {}\r\nconst Separator = styled('div')`\r\n flex-grow: 1;\r\n`;\r\nexport const TopToolbar = React.memo(function TopToolbar(\r\n props: TopToolbarProps,\r\n) {\r\n const isMobile = DetectIsMobile();\r\n\r\n const expanded = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n
    \r\n {/* \r\n \r\n */}\r\n {!expanded && }\r\n \r\n
    \r\n {/* acts as a separator between visually left and right components of the side bar */}\r\n \r\n \r\n \r\n
    \r\n );\r\n});\r\n","import { Badge, styled } from '@material-ui/core';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TopGroupButtonProps extends ButtonProps {\r\n savedServiceGroups: Entity[] | undefined;\r\n firstServiceGroupName: string | undefined;\r\n fullWidth?: boolean;\r\n}\r\n\r\nexport default function TopGroupButton(props: TopGroupButtonProps) {\r\n const {\r\n children,\r\n savedServiceGroups,\r\n firstServiceGroupName,\r\n fullWidth,\r\n ...other\r\n } = props;\r\n const { t } = useTranslation();\r\n return (\r\n \r\n {savedServiceGroups === undefined || savedServiceGroups.length === 0 ? (\r\n {t(translations.AllServiceGroups)}\r\n ) : savedServiceGroups.length === 1 ? (\r\n {firstServiceGroupName}\r\n ) : (\r\n 1\r\n ? `+${savedServiceGroups?.length - 1}`\r\n : undefined\r\n }\r\n >\r\n {firstServiceGroupName}\r\n \r\n )}\r\n \r\n );\r\n}\r\nconst TruncatedLabel = styled('span')({\r\n width: '10ch',\r\n display: 'inline-block',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n});\r\n","/**\r\n *\r\n * CoreDashboardMenu\r\n *\r\n */\r\nimport {\r\n Avatar,\r\n Box,\r\n LinearProgress,\r\n List,\r\n ListItem,\r\n ListItemIcon,\r\n ListItemSecondaryAction,\r\n ListItemText,\r\n Paper,\r\n Popover,\r\n} from '@material-ui/core';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { AssetThumbImage } from 'app/components/AssetThumbImage';\r\nimport { Body } from 'app/components/Typography';\r\nimport { RouterLink } from 'app/components/BasicLinks/RouterLink';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { initFiltersServiceGroupsData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectShowGlobalServiceGroupsAsList,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Entity } from 'types/common';\r\nimport { useListStyles, useStyles } from '../styles';\r\nimport TopGroupButton from '../TopGroupButton';\r\nimport cliTruncate from 'cli-truncate';\r\nexport interface CoreDashboardMenuProps {}\r\n\r\nexport function CoreDashboardMenu(props: CoreDashboardMenuProps) {\r\n const [open, setOpen] = React.useState(false);\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupsAsList);\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const { checkIsMobile } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const history = useHistory();\r\n const classes = useStyles({\r\n isMobile,\r\n })();\r\n const ddlClasses = useListStyles({ isMobile })();\r\n const [selectedServiceGroups, setSelectedServiceGroups] = React.useState<\r\n Entity[]\r\n >(savedServiceGroups || []);\r\n const [\r\n availableServiceGroups,\r\n setAvailableServiceGroups,\r\n ] = useAsyncExtendedState[]>([]);\r\n const [availableLoading, setAvailableLoading] = React.useState<\r\n boolean | undefined\r\n >(undefined);\r\n const [show, setShow] = React.useState(false);\r\n React.useEffect(() => {\r\n setOpen(false);\r\n setSelectedServiceGroups(savedServiceGroups || []);\r\n }, [savedServiceGroups]);\r\n React.useEffect(() => {\r\n setShow(showGroups);\r\n }, [showGroups]);\r\n React.useEffect(() => {\r\n let active = availableLoading === undefined && open;\r\n if (active) {\r\n setAvailableLoading(true);\r\n initFiltersServiceGroupsData(`(CanRequestAccess eq false)`).then(data => {\r\n setAvailableServiceGroups(data);\r\n setAvailableLoading(false);\r\n });\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [availableLoading, open, setAvailableServiceGroups]);\r\n const handleClick = event => {\r\n setAnchorEl(event.currentTarget);\r\n setOpen(prev => !prev);\r\n };\r\n const handleSaveItemClick = (item: Entity) => {\r\n dispatch(actions.saveGlobalServiceGroupFilter([item]));\r\n setOpen(false);\r\n setAvailableServiceGroups([]);\r\n setAvailableLoading(undefined);\r\n history.push('/dashboards/core/' + item.Id);\r\n };\r\n\r\n const handleItemClick = (item: Entity) => {\r\n setSelectedServiceGroups([item]);\r\n //history.push('/dashboards/core/' + item.Id);\r\n // dispatch(actions.navigate({\r\n // search: '/dashboards/core/' + item.Id,\r\n // }));\r\n dispatch(actions.saveGlobalServiceGroupFilter_Success([item]));\r\n setOpen(false);\r\n setAvailableServiceGroups([]);\r\n setAvailableLoading(undefined);\r\n };\r\n\r\n const firstServiceGroupName = React.useMemo(() => {\r\n return selectedServiceGroups.length > 0\r\n ? selectedServiceGroups[0]?.Name\r\n : undefined;\r\n }, [selectedServiceGroups]);\r\n return show ? (\r\n \r\n 0\r\n ? 'primary'\r\n : 'black'\r\n }\r\n />\r\n }\r\n endIcon={}\r\n onClick={handleClick}\r\n />\r\n\r\n \r\n \r\n {\r\n setOpen(false);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Dashboard_ServiceGroupSelection) as string}\r\n \r\n \r\n\r\n \r\n {availableLoading && (\r\n \r\n \r\n \r\n )}\r\n \r\n {availableServiceGroups.length > 0 &&\r\n availableServiceGroups.map(item => (\r\n f.Id === item.Id) !==\r\n undefined\r\n }\r\n className={ddlClasses.root}\r\n // component={'a'}\r\n // href={buildURL(`${publicUrl}dashboards/core/${item.Id}`, {})}\r\n button\r\n onClick={() => handleItemClick(item)}\r\n >\r\n \r\n {(item as IServiceGroupDto).ImageName !== null ? (\r\n \r\n ) : (\r\n \r\n {'C'}\r\n \r\n )}\r\n \r\n \r\n {cliTruncate(item.Name, 16, { position: 'end' })}\r\n \r\n \r\n handleSaveItemClick(item)}\r\n >\r\n {\r\n t(\r\n translations.Dashboard_ServiceGroupSwith,\r\n ) as string\r\n }\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null;\r\n}\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const useStyles = props =>\r\n makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n '&::-webkit-scrollbar': {\r\n width: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n paper: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: theme.spacing(2),\r\n background: theme.palette.common.white,\r\n boxShadow: 'unset', //'0px 4px 20px rgba(39, 51, 65, 0.2)',\r\n borderRadius: theme.spacing(1),\r\n width: props.isMobile ? 'auto' : '360px',\r\n maxHeight: props.isMobile ? '100%' : '400px',\r\n },\r\n popoverPaper: {\r\n width: '100%',\r\n height: '100%',\r\n maxHeight: 'calc(100% - 32px)',\r\n maxWidth: 'calc(100% - 0px)',\r\n },\r\n mainContentAndScroll: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n gap: theme.spacing(2.5),\r\n //borderRadius: theme.spacing(1),\r\n width: '100%',\r\n },\r\n mainContent: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: theme.spacing(1),\r\n gap: theme.spacing(1),\r\n width: '100%',\r\n },\r\n searchAndHeader: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: theme.spacing(1),\r\n width: '100%',\r\n padding: '4px 8px',\r\n },\r\n controlButtons: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n gap: theme.spacing(2),\r\n width: '100%',\r\n },\r\n coresAndServices: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: theme.spacing(2, 1, 0),\r\n gap: theme.spacing(6),\r\n width: '100%',\r\n },\r\n coreCheks: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n alignItems: 'flex-start',\r\n padding: 0,\r\n flexWrap: 'wrap',\r\n boxSizing: 'border-box',\r\n // paddingBottom: '36px',\r\n width: '100%',\r\n },\r\n check: {\r\n flex: '1 1 49%',\r\n display: 'flex',\r\n gap: theme.spacing(2),\r\n },\r\n scrollPaddings: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: theme.spacing(1, 0),\r\n gap: theme.spacing(1.25),\r\n width: '13px',\r\n },\r\n scroll: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n padding: '7px 3px 100px',\r\n gap: theme.spacing(1.25),\r\n background: theme.palette.common.white,\r\n boxShadow: 'inset 1px 0px 0px #E3E8EF',\r\n borderRadius: theme.spacing(0, 1, 1, 0),\r\n },\r\n }),\r\n );\r\nexport const useListStyles = props =>\r\n makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n fontSize: '14px',\r\n gap: 8,\r\n },\r\n listItemText: {\r\n [theme.breakpoints.up('sm')]: {\r\n display: 'flex',\r\n },\r\n [theme.breakpoints.down('sm')]: {\r\n overflow: 'hidden',\r\n },\r\n },\r\n primary: {\r\n [theme.breakpoints.up('sm')]: {\r\n flexGrow: 1,\r\n },\r\n display: 'inline-block',\r\n maxWidth: '100%',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n },\r\n avatar: {\r\n color: theme.palette.getContrastText(\r\n bookitColors.grayscale.grayBorders,\r\n ),\r\n backgroundColor: theme.palette.common.grayDividers,\r\n },\r\n secondary: {},\r\n }),\r\n );\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectShowGlobalServiceGroupFilter,\r\n selectShowGlobalServiceGroupsAsList,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { CoreSelectionProps } from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport TopGroupButton from '../TopGroupButton';\r\nimport { Icon } from '../../BasicIcons/FontAwesome';\r\nimport { CoreDashboardMenu } from '../CoreDashboardButton';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface CoreSelectionButtonProps {}\r\nexport function CoreSelectionButton(props) {\r\n const dispatch = useDispatch();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n const showInlineGroups = useSelector(selectShowGlobalServiceGroupsAsList);\r\n\r\n const { expandLocal } = useExpandedSideBarState();\r\n const isMobile = DetectIsMobile();\r\n const [show, setShow] = React.useState(false);\r\n React.useEffect(() => {\r\n setShow(showGroups);\r\n }, [showGroups]);\r\n\r\n const handleClick = event => {\r\n dispatch(\r\n layoutActions.openSidePanel({\r\n type: RenderPageType.CoreSelection,\r\n props: { useSidePanel: true } as CoreSelectionProps,\r\n expanded: !isMobile,\r\n }),\r\n );\r\n expandLocal(false);\r\n };\r\n\r\n const firstServiceGroupName = React.useMemo(() => {\r\n return savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n ? savedServiceGroups[0]?.Name\r\n : undefined;\r\n }, [savedServiceGroups]);\r\n\r\n return show ? (\r\n 0\r\n ? 'primary'\r\n : 'black'\r\n }\r\n />\r\n }\r\n endIcon={}\r\n onClick={handleClick}\r\n />\r\n ) : showInlineGroups ? (\r\n \r\n ) : null;\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { CoreSelectionButton } from 'app/components/GlobalServiceGroupFilter/CoreSelectionButton';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectGlobalServiceGroupFilter,\r\n selectIsSubBarCollapsed,\r\n selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SubTopBar } from '../styled';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface SubTopToolbarProps {}\r\n\r\nexport function SubTopToolbar(props: SubTopToolbarProps) {\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { t } = useTranslation();\r\n const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n const serviceGroupsCount = React.useMemo(() => {\r\n return savedServiceGroups !== undefined && savedServiceGroups?.length > 1\r\n ? `+${savedServiceGroups?.length - 1}`\r\n : undefined;\r\n }, [savedServiceGroups]);\r\n const firstServiceGroupName = React.useMemo(() => {\r\n return savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n ? savedServiceGroups[0]?.Name\r\n : undefined;\r\n }, [savedServiceGroups]);\r\n const singleCore = React.useMemo(() => {\r\n return savedServiceGroups !== undefined && savedServiceGroups?.length === 1;\r\n }, [savedServiceGroups]);\r\n\r\n const isAdminOfSingle = React.useMemo(() => {\r\n return (\r\n singleCore &&\r\n !!savedServiceGroups &&\r\n authenticatedUser?.HasAdminGroupPermissions(savedServiceGroups[0].Id)\r\n );\r\n }, [authenticatedUser, savedServiceGroups, singleCore]);\r\n\r\n const handleCollapse = React.useCallback(() => {\r\n dispatch(actions.collapseSubBar(!collapsedBar));\r\n }, [actions, collapsedBar, dispatch]);\r\n const theme = useTheme();\r\n\r\n return showGroups ? (\r\n \r\n {\r\n handleCollapse();\r\n }}\r\n shape=\"circle\"\r\n >\r\n \r\n {collapsedBar && !!firstServiceGroupName && (\r\n \r\n \r\n {`${firstServiceGroupName} ${serviceGroupsCount ?? ''}`}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n {isAdminOfSingle && !!savedServiceGroups && (\r\n }\r\n href={{\r\n search: { Edit: savedServiceGroups[0].Id },\r\n path: '/newGroup.aspx',\r\n }}\r\n target=\"_blank\"\r\n >\r\n {t(translations.OpenCore)}\r\n \r\n )}\r\n
    \r\n \r\n
    \r\n ) : null;\r\n}\r\n","/**\r\n *\r\n * TopBar\r\n *\r\n */\r\nimport { AppBarProps, useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { TopToolbar } from './TopToolbar';\r\nimport { StyledTopBar } from './styled';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\n\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { SubTopToolbar } from './SubTopToolbar';\r\nexport interface StyleTopBarProps {\r\n isOpen: boolean;\r\n drawerWidth: number;\r\n sidePanelCollapsed?: boolean;\r\n}\r\nexport interface TopBarProps extends AppBarProps {\r\n isOpen: boolean;\r\n drawerWidth: number;\r\n sidePanelCollapsed?: boolean;\r\n}\r\n\r\nexport function TopBar(props: TopBarProps) {\r\n const { children, isOpen, drawerWidth, sidePanelCollapsed, ...rest } = props;\r\n const isMobile = DetectIsMobile();\r\n const theme = useTheme();\r\n return (\r\n <>\r\n \r\n \r\n {!isMobile && }\r\n \r\n \r\n );\r\n}\r\n","import React from 'react';\r\nimport { ListItem, ListItemProps } from '@material-ui/core';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { Link } from 'react-router-dom';\r\n\r\nexport interface MenuItemComponentProps\r\n extends Pick {\r\n link?: string | null; // because the InferProps props allows alows null value\r\n onClick: (event: React.MouseEvent, index: number) => void;\r\n external: boolean;\r\n selected: boolean;\r\n currentIndex: number;\r\n onKeyDown?: (event: React.KeyboardEvent, index: number) => void;\r\n onExternalClick?: (link: string) => void;\r\n}\r\nconst MenuItemComponent: React.FC = props => {\r\n const {\r\n className,\r\n link,\r\n onClick,\r\n children,\r\n external,\r\n selected,\r\n currentIndex: currentindex,\r\n onKeyDown,\r\n onExternalClick,\r\n ...other\r\n } = props;\r\n // If link is not set return the orinary ListItem\r\n if (!link || typeof link !== 'string') {\r\n return (\r\n onClick(event, currentindex)}\r\n onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n selected={selected}\r\n disableTouchRipple\r\n {...other}\r\n />\r\n );\r\n } else {\r\n if (external) {\r\n return (\r\n {\r\n if (!!onExternalClick) {\r\n onExternalClick(link);\r\n }\r\n onClick(event, currentindex);\r\n }}\r\n onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n component={!!onExternalClick ? 'button' : LinkBehavior}\r\n href={!!onExternalClick ? undefined : link}\r\n target={'_blank'}\r\n selected={selected}\r\n disableTouchRipple\r\n {...other}\r\n />\r\n );\r\n }\r\n return (\r\n onClick(event, currentindex)}\r\n onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n selected={selected}\r\n disableTouchRipple\r\n {...other}\r\n />\r\n );\r\n }\r\n\r\n // Return a LitItem with a link component\r\n};\r\n\r\nexport default MenuItemComponent;\r\n","import * as React from 'react';\r\nimport { SidebarMenuItemProps } from './MenuItem';\r\nimport { bindHover, bindMenu } from 'material-ui-popup-state';\r\nimport { Fade, ListItemIcon, makeStyles, MenuItem } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport MenuItemComponent from './MenuItemComponent';\r\nimport {\r\n anchorRef,\r\n bindFocus,\r\n usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport HoverMenu from 'material-ui-popup-state/HoverMenu';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { NavLink, NavLinkProps } from 'react-router-dom';\r\nimport { setTimeout } from 'timers';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { Icon as AwesomeIcon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface HoverSideMenuProps {\r\n items: SidebarMenuItemProps[];\r\n handleChildClick: (event, index) => void;\r\n handleClick: (event, index) => void;\r\n selected: boolean;\r\n id: string;\r\n name: string;\r\n Icon?: PropTypes.ReactElementLike | null;\r\n link?: string | null;\r\n external: boolean;\r\n onExternalClick?: (link: string) => void;\r\n index: number;\r\n}\r\nconst styles = makeStyles(theme => ({\r\n paper: {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n borderRadius: 0,\r\n },\r\n list: {\r\n padding: 0,\r\n },\r\n childRoot: {\r\n '& > .menuItem': {\r\n minWidth: '200px',\r\n boxShadow: '0px 1px 0px 0px #e0e5ec',\r\n color: theme.palette.common.blackRegular,\r\n '&.active': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n },\r\n '&:focus': {\r\n textDecoration: 'underline',\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n },\r\n '&:hover': {\r\n textDecoration: 'underline',\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n },\r\n '& > .menuItemTextInset': {\r\n paddingLeft: theme.spacing(2),\r\n marginTop: 0,\r\n marginBottom: 0,\r\n '& > *': {\r\n fontSize: '13px',\r\n fontWeight: 700,\r\n },\r\n },\r\n },\r\n },\r\n focusVisible: {\r\n backgroundColor: theme.palette.common.grayDividers,\r\n '&::focus': {\r\n textDecoration: 'underline',\r\n },\r\n },\r\n menuItem: {\r\n '&::focus': {\r\n textDecoration: 'underline',\r\n },\r\n },\r\n}));\r\nexport const createMenuItemRefs = (items, rowInd) => {\r\n // obj\r\n let menuItemRefs = {};\r\n // loop each\r\n for (let i = 0; i < Object.keys(items).length; i++) {\r\n // When assign createRef, no current\r\n menuItemRefs[rowInd + i] = React.createRef();\r\n }\r\n return menuItemRefs;\r\n};\r\nexport const HoverSideMenu = React.forwardRef(\r\n function HoverSideMenu(props, ref) {\r\n const {\r\n items,\r\n selected,\r\n handleChildClick,\r\n id,\r\n name,\r\n Icon,\r\n link,\r\n handleClick,\r\n external,\r\n index,\r\n onExternalClick,\r\n } = props;\r\n const popupState = usePopupState({\r\n variant: 'popper',\r\n popupId: id,\r\n });\r\n const classes = styles();\r\n const [childActiveIndex, setChildActiveIndex] = React.useState(-1);\r\n const menuItemRefs = React.useRef(createMenuItemRefs(items, index));\r\n React.useEffect(() => {\r\n if (selected && childActiveIndex >= 0) {\r\n setTimeout(() => {\r\n menuItemRefs.current[index + childActiveIndex]?.focus();\r\n }, 0);\r\n }\r\n }, [childActiveIndex, selected, index]);\r\n const buttonIconKeyDown = (event, parentRowIndex) => {\r\n if (event.keyCode === 13) {\r\n // Enter pressed\r\n console.log('enter is pressed');\r\n setChildActiveIndex(0);\r\n } else if (event.keyCode === 9) {\r\n // tab away\r\n console.log('tab away');\r\n\r\n //handleClick(event, parentRowIndex + 1);\r\n setChildActiveIndex(-1);\r\n //setCurrRowInd('');\r\n } else if (event.keyCode === 40) {\r\n //test\r\n console.log('down arrow');\r\n\r\n // 38 is up arrow\r\n if (selected) {\r\n // No scrolling\r\n event.preventDefault();\r\n\r\n // set to 1st item in 0 index\r\n setChildActiveIndex(prev => {\r\n return prev !== items.length - 1 ? prev + 1 : 0;\r\n });\r\n }\r\n } else if (event.keyCode === 38) {\r\n //test\r\n console.log('up arrow');\r\n\r\n // 38 is up arrow\r\n if (selected) {\r\n // No scrolling\r\n event.preventDefault();\r\n\r\n // set to 1st item in 0 index\r\n setChildActiveIndex(prev => {\r\n return prev > 0 ? prev - 1 : items.length - 1;\r\n });\r\n }\r\n }\r\n };\r\n return (\r\n \r\n
    \r\n \r\n {/* Display an icon if any */}\r\n
    \r\n {!!Icon && (\r\n {Icon}\r\n )}\r\n {/* */}\r\n
    \r\n \r\n\r\n {items && items.length > 0 && (\r\n \r\n {/* */}\r\n \r\n \r\n {name}\r\n \r\n \r\n {items.map(\r\n (item, cindex) => {\r\n if (!item.link || typeof item.link !== 'string') {\r\n return (\r\n {\r\n console.log('child-div-click', event);\r\n handleChildClick(event, cindex);\r\n }}\r\n ref={element =>\r\n (menuItemRefs.current[index + cindex] = element)\r\n }\r\n >\r\n
    \r\n \r\n \r\n \r\n \r\n {item.name}\r\n \r\n
    \r\n {/* */}\r\n \r\n );\r\n } else {\r\n if (item.external) {\r\n return (\r\n {\r\n console.log('child-external-click', event);\r\n if (\r\n !!onExternalClick &&\r\n item.link !== null &&\r\n item.link !== undefined\r\n ) {\r\n onExternalClick(item.link);\r\n }\r\n handleChildClick(event, cindex);\r\n }}\r\n selected={selected && item.selected}\r\n component={!!onExternalClick ? 'li' : LinkBehavior}\r\n href={!!onExternalClick ? undefined : item.link}\r\n target={'_blank'}\r\n ref={element =>\r\n (menuItemRefs.current[index + cindex] = element)\r\n }\r\n >\r\n
    \r\n \r\n \r\n \r\n \r\n {item.name}\r\n \r\n
    \r\n {/* */}\r\n \r\n );\r\n } else {\r\n return (\r\n {\r\n console.log('child-react-click', event);\r\n handleChildClick(event, cindex);\r\n }}\r\n component={React.forwardRef(\r\n (props: NavLinkProps, ref: any) => (\r\n \r\n (menuItemRefs.current[\r\n index + cindex\r\n ] = element)\r\n }\r\n />\r\n ),\r\n )}\r\n focusVisibleClassName={classes.focusVisible}\r\n to={item.link}\r\n ref={element =>\r\n (menuItemRefs.current[index + cindex] = element)\r\n }\r\n >\r\n
    \r\n \r\n \r\n \r\n \r\n {item.name}\r\n \r\n
    \r\n {/* */}\r\n \r\n );\r\n }\r\n }\r\n },\r\n // \r\n )}\r\n {/*
    */}\r\n \r\n )}\r\n
    \r\n
    \r\n );\r\n },\r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport MenuItemComponent from './MenuItemComponent';\r\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\r\nimport List from '@material-ui/core/List';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectIsExpandedSideBar,\r\n selectSiteMapProvider,\r\n selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport { HoverSideMenu } from './HoverMenu';\r\nimport {\r\n AssetsSubTabUnionArray,\r\n MainTabsUnion,\r\n SiteMapProvider,\r\n} from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { useLocation } from 'react-router-dom';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport clsx from 'clsx';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { Icon as AwesomeIcon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Roles } from 'app/slice/types';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\n\r\nexport const MenuItemPropTypes = {\r\n name: PropTypes.string.isRequired,\r\n link: PropTypes.string,\r\n external: PropTypes.bool.isRequired,\r\n Icon: PropTypes.element,\r\n items: PropTypes.array,\r\n selected: PropTypes.bool.isRequired,\r\n indexChanged: PropTypes.func,\r\n index: PropTypes.number.isRequired,\r\n chIndex: PropTypes.number,\r\n onChange: PropTypes.func,\r\n closeOnClick: PropTypes.bool,\r\n};\r\ntype MenuItemPropTypesItems = PropTypes.InferProps;\r\ntype MenuItemPropTypesNoItems = Omit;\r\n\r\nexport type SidebarMenuItemProps = MenuItemPropTypesNoItems & {\r\n items?: SidebarMenuItemProps[];\r\n mainTab?: MainTabsUnion;\r\n groupTab?: number;\r\n hasAdminSettings?: boolean;\r\n};\r\nconst SidbarMenuItem = React.forwardRef(\r\n function SidbarMenuItem(props, ref) {\r\n const {\r\n name,\r\n link,\r\n external,\r\n Icon,\r\n items = [],\r\n selected,\r\n indexChanged,\r\n index,\r\n chIndex,\r\n mainTab,\r\n hasAdminSettings,\r\n closeOnClick,\r\n } = props;\r\n //const classes = useStyles();\r\n const isExpandable = items && items.length > 0;\r\n const isMobile = DetectIsMobile();\r\n const [open, setOpen] = React.useState(selected);\r\n const [isSelected, setSelected] = React.useState(selected);\r\n const [, setChildIndex] = React.useState(chIndex);\r\n const hasChanges = useSelector(selectHasNotSavedChanges);\r\n const siteMapProvider = useSelector(selectSiteMapProvider);\r\n const user = useSelector(selectAuthenticatedUser);\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const sidebarExpanded = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n const { expandLocal } = useExpandedSideBarState();\r\n const siteMapSettings = useSelector(selectSiteMapSettings);\r\n const location = useLocation();\r\n const isAdmin =\r\n isInRole(user, Roles.Administrators) ||\r\n isInRole(user, Roles.GroupAdministrators) ||\r\n isInRole(user, Roles.CustomRole);\r\n const [urlLink, setUrlLink] = React.useState(\r\n link,\r\n );\r\n // const handleSettingClick = React.useCallback(\r\n // (link: string) => {\r\n // dispatch(\r\n // actions.openAdminPanel({\r\n // url: link,\r\n // }),\r\n // );\r\n // },\r\n // [actions, dispatch],\r\n // );\r\n const adminSettings = React.useMemo(() => {\r\n let actions: RowActionsProps[] = [];\r\n if (!!mainTab && isAdmin && hasAdminSettings) {\r\n if (mainTab === 'Assets') {\r\n AssetsSubTabUnionArray.forEach(ar => {\r\n actions = [\r\n ...actions,\r\n ...siteMapProvider.adminSettingsActions(\r\n mainTab,\r\n user,\r\n ar,\r\n undefined, // handleSettingClick,\r\n ),\r\n ];\r\n });\r\n } else {\r\n if (mainTab === 'Budgets') {\r\n return siteMapProvider.adminSettingsActions(\r\n mainTab,\r\n user,\r\n 'BudgetTabSetting',\r\n undefined, // handleSettingClick,\r\n );\r\n }\r\n return siteMapProvider.adminSettingsActions(\r\n mainTab,\r\n user,\r\n undefined,\r\n undefined, // handleSettingClick,\r\n );\r\n }\r\n }\r\n return actions;\r\n }, [hasAdminSettings, isAdmin, mainTab, siteMapProvider, user]);\r\n React.useEffect(() => {\r\n let active =\r\n !isNullOrUndefined(siteMapSettings) && link === location?.pathname;\r\n if (active) {\r\n let siteMapProvider = new SiteMapProvider(siteMapSettings);\r\n let node = siteMapProvider.findNode(\r\n location?.pathname || window.location.pathname,\r\n );\r\n\r\n setUrlLink(() => {\r\n if (node !== undefined) {\r\n const reactUrl = node.reactUrl;\r\n if (reactUrl !== undefined && reactUrl !== null) {\r\n const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n if (elementPath === location.pathname) {\r\n return reactUrl;\r\n } else {\r\n return link;\r\n }\r\n } else {\r\n return link;\r\n }\r\n } else {\r\n return link;\r\n }\r\n });\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [link, location.pathname, siteMapSettings]);\r\n function handleClick(event, index) {\r\n if (\r\n !!event.target &&\r\n !!event.target.parentNode &&\r\n 'className' in event.target.parentNode &&\r\n event.target.parentNode.className !== undefined &&\r\n event.target.parentNode.className !== null &&\r\n event.target.parentNode.className !== '' &&\r\n typeof event.target.parentNode.className === 'string' &&\r\n event.target.parentNode.className.indexOf('MuiPopover') > -1\r\n ) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else {\r\n if (\r\n hasChanges &&\r\n (props.items === undefined || props.items.length < 1)\r\n ) {\r\n dispatch(\r\n actions.setContinueToLink(\r\n props.link === null || props.link === undefined\r\n ? location.pathname\r\n : props.link,\r\n ),\r\n );\r\n dispatch(actions.setConfirmOpen(true));\r\n event.preventDefault();\r\n } else {\r\n setOpen(!open);\r\n if (props.index !== index) {\r\n setSelected(!isSelected);\r\n } else {\r\n if (props.items !== undefined && props.items?.length > 0) {\r\n setSelected(!selected);\r\n }\r\n }\r\n if (indexChanged !== undefined && indexChanged !== null) {\r\n indexChanged(event, index);\r\n }\r\n }\r\n if (isMobile && closeOnClick) {\r\n expandLocal(false);\r\n }\r\n }\r\n }\r\n const handleChildClick = (event, index) => {\r\n if (hasChanges) {\r\n dispatch(\r\n actions.setContinueToLink(\r\n props.link === null || props.link === undefined\r\n ? location.pathname\r\n : props.link,\r\n ),\r\n );\r\n dispatch(actions.setConfirmOpen(true));\r\n event.preventDefault();\r\n } else {\r\n if (isMobile) {\r\n expandLocal(false);\r\n }\r\n setChildIndex(prev => {\r\n if (props.chIndex !== index) {\r\n return index;\r\n }\r\n });\r\n setChildIndex(index);\r\n }\r\n };\r\n\r\n const parentId = `menuitem-${index}`;\r\n return !sidebarExpanded ? ( //isExpandable &&\r\n \r\n ) : (\r\n <>\r\n \r\n {/* Display an icon if any */}\r\n
    \r\n {!!Icon && (\r\n {Icon}\r\n )}\r\n {/* */}\r\n \r\n {name}\r\n \r\n
    \r\n {!!mainTab &&\r\n hasAdminSettings &&\r\n !isMobile &&\r\n adminSettings.length > 0 && (\r\n // \r\n\r\n // \r\n {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }}\r\n items={adminSettings}\r\n // items={settingItems.map(row => {\r\n // return {\r\n // //href: row.link,\r\n // text: row.name,\r\n // icon: 'circle-small',\r\n // onClick: () => handleSettingClick(row.link ?? ''),\r\n // } as RowActionsProps;\r\n // })}\r\n />\r\n )}\r\n {isExpandable && (\r\n \r\n )}\r\n \r\n\r\n {/* Display the expand menu if the item has children */}\r\n {isExpandable && (open || isSelected) && selected && (\r\n \r\n {items.map((item, chIndex) => (\r\n \r\n ))}\r\n \r\n )}\r\n \r\n );\r\n },\r\n);\r\n\r\nexport default SidbarMenuItem;\r\n","import { css } from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const verticalScrolling = css`\r\n &::-webkit-scrollbar {\r\n width: 4px;\r\n }\r\n &::-webkit-scrollbar-thumb {\r\n box-shadow: inset 0 0 2px ${bookitColors.grayscale.grayBorders};\r\n border-radius: 16px;\r\n background-color: ${bookitColors.grayscale.grayBorders};\r\n }\r\n`;\r\n","import { List } from '@material-ui/core';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Roles } from 'app/slice/types';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\n// import styled from 'styled-components';\r\n// import { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\nimport { AuthenticatedUser, isInRole } from 'types/AuthenticatedUser';\r\nimport {\r\n MainTabsUnion,\r\n SiteMapNode,\r\n SiteMapProvider,\r\n} from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { createMenuItemRefs } from './HoverMenu';\r\nimport SidbarMenuItem, { SidebarMenuItemProps } from './MenuItem';\r\nimport clsx from 'clsx';\r\nimport { groupBy, values } from 'lodash';\r\nimport styled from 'styled-components';\r\nimport { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\nimport { selectRouterPathname } from 'app/slice/router-selectors';\r\n\r\nexport interface SideBarMenuItemProps {\r\n menuItems: SiteMapNode[];\r\n currentIndex?: number;\r\n currentNode?: SiteMapNode | undefined;\r\n isOpen: boolean;\r\n loading: boolean;\r\n isMobile?: boolean;\r\n}\r\nconst NavWrapper = styled('div')`\r\n height: calc(100% - 50px);\r\n overflow-y: auto;\r\n width: 100%;\r\n overflow-x: hidden;\r\n ${verticalScrolling}\r\n`;\r\nconst MainMenuItem = styled('div')`\r\n &.mainMenuItem {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n &.mainMenuItemExpanded {\r\n align-items: flex-start;\r\n align-self: stretch;\r\n }\r\n &.mainMenuItemCollapsed {\r\n align-items: center;\r\n }\r\n }\r\n`;\r\nconst replaceIcon = (icon: string): IconProp => {\r\n if (icon.indexOf(' fa-') !== -1) {\r\n let tmpIcon = icon.substring(icon.indexOf(' fa-') + 4, icon.length);\r\n return tmpIcon as IconProp;\r\n }\r\n return icon as IconProp;\r\n};\r\nconst convertUrl = (url: string): string => {\r\n if (url !== null) {\r\n if (url.indexOf(process.env.PUBLIC_URL) !== -1) {\r\n return url.replace(process.env.PUBLIC_URL, '');\r\n }\r\n return url;\r\n }\r\n return url;\r\n};\r\nexport const getAdminNodeSettings = (\r\n item: SiteMapNode,\r\n siteMapProvider: SiteMapProvider,\r\n user?: AuthenticatedUser,\r\n): SidebarMenuItemProps[] => {\r\n let result: SidebarMenuItemProps[] = [];\r\n const isAdmin =\r\n isInRole(user, Roles.Administrators) ||\r\n isInRole(user, Roles.GroupAdministrators) ||\r\n isInRole(user, Roles.EquipmentAdministrator) ||\r\n isInRole(user, Roles.CustomRole);\r\n if (\r\n isAdmin &&\r\n item.ChildNodes.length > 0 &&\r\n !!item.MainTab &&\r\n item.ChildNodes.some(f => f.IsAdminSettings)\r\n ) {\r\n let filtered = item.ChildNodes.filter(\r\n f => f.IsAdminSettings && siteMapProvider.nodeAccesibleByRole(f, user),\r\n ).map((it, index) => {\r\n return {\r\n name: it.Title,\r\n link: it.reactUrl ?? convertUrl(it.Url),\r\n Icon: isNullOrUndefined(it.icon) ? undefined : (\r\n \r\n ),\r\n items: [] as SidebarMenuItemProps[],\r\n external: isNullOrUndefined(it.reactUrl),\r\n index: index,\r\n selected: false,\r\n } as SidebarMenuItemProps;\r\n });\r\n return filtered;\r\n }\r\n return result;\r\n};\r\n\r\nexport function SideBarMenu(props: SideBarMenuItemProps) {\r\n // const classes = useStyles({ isOpen: props.isOpen });\r\n const location = useLocation();\r\n const routerPathName = useSelector(selectRouterPathname);\r\n const { menuItems, currentIndex, currentNode, isOpen, isMobile } = props;\r\n const [selectedIndex, setSelectedIndex] = React.useState(currentIndex || -1);\r\n // const [mapItems, setMapItems] = React.useState([]);\r\n const mapItems = React.useMemo(() => {\r\n return menuItems.map((item, index) => {\r\n const link: string | null | undefined =\r\n item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length > 0\r\n ? item.LinkWithChildren ?? null\r\n : item.reactUrl ?? convertUrl(item.Url);\r\n return {\r\n name: item.Title,\r\n link: link,\r\n Icon: isNullOrUndefined(item.icon) ? undefined : (\r\n \r\n ),\r\n items:\r\n item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length > 0\r\n ? item.ChildNodes.filter(citem => {\r\n // filter to exclude '/usertraininghistory' url from sidebar\r\n return citem.HideReact === false && citem.Hide === false;\r\n }).map((chItem, chIndex) => {\r\n return {\r\n name: chItem.Title,\r\n link: chItem.reactUrl ?? convertUrl(chItem.Url),\r\n Icon: isNullOrUndefined(chItem.icon) ? undefined : (\r\n \r\n ),\r\n items: [] as SidebarMenuItemProps[],\r\n external: isNullOrUndefined(chItem.reactUrl),\r\n index: chIndex,\r\n selected:\r\n location.pathname\r\n .toLowerCase()\r\n .indexOf(\r\n (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n ) !== -1 ||\r\n (!!routerPathName &&\r\n routerPathName\r\n .toLowerCase()\r\n .indexOf(\r\n (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n ) !== -1),\r\n };\r\n })\r\n : ([] as SidebarMenuItemProps[]),\r\n hasAdminSettings: item.ChildNodes.some(f => f.IsAdminSettings === true),\r\n mainTab: !!item.MainTab ? (item.MainTab as MainTabsUnion) : undefined,\r\n groupTab: item.GroupTab,\r\n external:\r\n link?.includes('aspx') ||\r\n (isNullOrUndefined(item.reactUrl) &&\r\n item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length === 0),\r\n index: index,\r\n selected:\r\n currentNode === undefined\r\n ? false\r\n : selectedIndex === -1\r\n ? currentNode.Key === item.Key\r\n : selectedIndex === index,\r\n closeOnClick:\r\n !isNullOrUndefined(item.LinkWithChildren) ||\r\n item.ChildNodes.filter(\r\n ch => ch.HideReact === false && ch.Hide === false,\r\n ).length < 1,\r\n };\r\n });\r\n }, [\r\n currentNode,\r\n location.pathname,\r\n menuItems,\r\n routerPathName,\r\n selectedIndex,\r\n ]);\r\n // const isAdmin =\r\n // isInRole(authenticatedUser, Roles.Administrators) ||\r\n // isInRole(authenticatedUser, Roles.GroupAdministrators) ||\r\n // isInRole(authenticatedUser, Roles.EquipmentAdministrator);\r\n const handleListItemClick = (event, index) => {\r\n setSelectedIndex(index);\r\n };\r\n React.useEffect(() => {\r\n if (!!currentNode) {\r\n const idx = menuItems.findIndex(f => f.Key === currentNode.Key);\r\n if (idx !== -1) {\r\n setSelectedIndex(idx);\r\n }\r\n }\r\n }, [currentNode, menuItems]);\r\n // React.useEffect(() => {\r\n // setMapItems(\r\n // menuItems.map((item, index) => {\r\n // const link: string | null | undefined =\r\n // item.ChildNodes.filter(\r\n // ch => ch.HideReact === false && ch.Hide === false,\r\n // ).length > 0\r\n // ? item.LinkWithChildren ?? null\r\n // : item.reactUrl ?? convertUrl(item.Url);\r\n // return {\r\n // name: item.Title,\r\n // link: link,\r\n // Icon: isNullOrUndefined(item.icon) ? undefined : (\r\n // \r\n // ),\r\n // items:\r\n // item.ChildNodes.filter(\r\n // ch => ch.HideReact === false && ch.Hide === false,\r\n // ).length > 0\r\n // ? item.ChildNodes.filter(citem => {\r\n // // filter to exclude '/usertraininghistory' url from sidebar\r\n // return citem.HideReact === false && citem.Hide === false;\r\n // }).map((chItem, chIndex) => {\r\n // return {\r\n // name: chItem.Title,\r\n // link: chItem.reactUrl ?? convertUrl(chItem.Url),\r\n // Icon: isNullOrUndefined(chItem.icon) ? undefined : (\r\n // \r\n // ),\r\n // items: [] as SidebarMenuItemProps[],\r\n // external: isNullOrUndefined(chItem.reactUrl),\r\n // index: chIndex,\r\n // selected:\r\n // location.pathname\r\n // .toLowerCase()\r\n // .indexOf(\r\n // (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n // ) !== -1 ||\r\n // (!!routerPathName &&\r\n // routerPathName\r\n // .toLowerCase()\r\n // .indexOf(\r\n // (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n // ) !== -1),\r\n // };\r\n // })\r\n // : ([] as SidebarMenuItemProps[]),\r\n // hasAdminSettings: item.ChildNodes.some(\r\n // f => f.IsAdminSettings === true,\r\n // ),\r\n // mainTab: !!item.MainTab ? (item.MainTab as MainTabsUnion) : undefined,\r\n // groupTab: item.GroupTab,\r\n // external:\r\n // link?.includes('aspx') ||\r\n // (isNullOrUndefined(item.reactUrl) &&\r\n // item.ChildNodes.filter(\r\n // ch => ch.HideReact === false && ch.Hide === false,\r\n // ).length === 0),\r\n // index: index,\r\n // selected:\r\n // currentNode === undefined\r\n // ? false\r\n // : selectedIndex === -1\r\n // ? currentNode.Key === item.Key\r\n // : selectedIndex === index,\r\n // closeOnClick:\r\n // !isNullOrUndefined(item.LinkWithChildren) ||\r\n // item.ChildNodes.filter(\r\n // ch => ch.HideReact === false && ch.Hide === false,\r\n // ).length < 1,\r\n // };\r\n // }),\r\n // );\r\n // }, [\r\n // authenticatedUser,\r\n // location.pathname,\r\n // menuItems,\r\n // currentNode,\r\n // selectedIndex,\r\n // siteMapProvider,\r\n // routerPathName,\r\n // ]);\r\n const menuItemRefs = React.useRef(\r\n createMenuItemRefs(menuItems, currentIndex ?? 0),\r\n );\r\n return (\r\n \r\n \r\n {values(groupBy(mapItems, f => f.groupTab)).map((f, key) => {\r\n return (\r\n
    \r\n {f.map((item, index) => (\r\n \r\n \r\n (menuItemRefs.current[item.index] = element)\r\n }\r\n indexChanged={handleListItemClick}\r\n />\r\n \r\n ))}\r\n
    \r\n );\r\n })}\r\n \r\n
    \r\n );\r\n}\r\n","/**\r\n *\r\n * BookitlabLogo\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { messages } from './messages';\r\n\r\nexport interface BookitlabShortLogoProps {}\r\n\r\nexport const BookitlabShortLogo = React.memo(function BookitlabShortLogo(\r\n props: BookitlabShortLogoProps,\r\n) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n\r\n return (\r\n \r\n {t(messages.bookitlab())}\r\n \r\n \r\n );\r\n});\r\n","import { useAssetQuickSearchSlice } from 'app/components/AssetQuickSearch/slice';\r\nimport { selectShowSearchInSidebar } from 'app/components/AssetQuickSearch/slice/selectors';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { EventsCount } from '../../TopBar/ProfileMenu/EventsCount';\r\nimport { SwitchSites } from '../../TopBar/ProfileMenu/SwitchSites';\r\nimport { UserMenu } from '../../TopBar/ProfileMenu/UserMenu';\r\nimport React from 'react';\r\n\r\nexport interface UserProfileMobileProps {}\r\nexport function UserProfileMobile(props: UserProfileMobileProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions: assetSearchActions } = useAssetQuickSearchSlice();\r\n const showSearchInSidebar = useSelector(selectShowSearchInSidebar);\r\n return (\r\n \r\n {\r\n dispatch(assetSearchActions.showSearchInput(!showSearchInSidebar));\r\n }}\r\n title={t(translations.SearchAssets)}\r\n shape=\"square\"\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { BookitlabLogo } from 'app/components/BookitlabLogo';\r\nimport { BookitlabShortLogo } from 'app/components/BookitlabLogo/BookitlabShortLogo';\r\nimport { selectMinimizedBookitlabLogo } from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CustomerLogo } from '../../CustomerLogo';\r\nimport clsx from 'clsx';\r\nimport { ToggleSideMenuButton } from '../../TopBar/components/ToggleSideMenuButton';\r\nimport { UserProfileMobile } from '../UserProfileMobile';\r\n\r\nexport interface SideBarHeaderProps {\r\n children?: React.ReactNode;\r\n isOpen: boolean;\r\n}\r\n\r\nexport const SideBarHeader = React.memo(function SideBarHeader(\r\n props: SideBarHeaderProps,\r\n) {\r\n const { children, isOpen } = props;\r\n const isMobile = DetectIsMobile();\r\n const logoMinimized = useSelector(selectMinimizedBookitlabLogo);\r\n return (\r\n \r\n \r\n {isMobile ? (\r\n \r\n ) : isOpen && !logoMinimized ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n {isMobile && isOpen && }\r\n\r\n {/* {isMobile && isOpen && showSearchInSidebar && (\r\n \r\n \r\n \r\n )} */}\r\n {/* {isMobile && isOpen && (\r\n \r\n \r\n \r\n )} */}\r\n {isOpen && !isMobile && }\r\n \r\n {children}\r\n \r\n \r\n );\r\n});\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\n\r\nexport const useStyles = makeStyles(\r\n (theme: Theme) => ({\r\n root: {\r\n backgroundColor: theme.palette.background.default,\r\n padding: 0,\r\n marginTop: 40,\r\n '& .Mui-selected': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n '& > .menuItemContent': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.background.paper,\r\n '& svg': {\r\n color: theme.palette.background.paper,\r\n },\r\n },\r\n },\r\n '& .Mui-selected:hover': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n '& > .menuItemContent': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.background.paper,\r\n '& svg': {\r\n color: theme.palette.background.paper,\r\n },\r\n },\r\n },\r\n '& > .menuItem': {\r\n padding: 0,\r\n '& > .menuItemContent': {\r\n display: 'flex',\r\n width: '100%',\r\n position: 'relative',\r\n boxSizing: 'border-box',\r\n textAlign: 'left',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n textDecoration: 'none',\r\n padding: '6px 8px 6px 26px',\r\n fontWeight: '900', //theme.typography.fontWeightBold,\r\n color: theme.palette.common.graySubtitle,\r\n textTransform: 'uppercase',\r\n backgroundColor: theme.palette.background.default,\r\n gap: 16,\r\n marginBottom: '8px',\r\n '&:hover': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n '& > .menuItemIcon': {\r\n color: theme.palette.common.white,\r\n },\r\n },\r\n '& *': {\r\n fontWeight: '900', //theme.typography.fontWeightBold,\r\n whiteSpace: props => (props.isOpen ? 'initial' : 'inherit'),\r\n },\r\n '& > .menuItemIcon': {\r\n color: theme.palette.common.grayComponents,\r\n minWidth: props => (props.isOpen ? 'initial' : '48px'),\r\n '& > svg': {\r\n width: '19px',\r\n },\r\n },\r\n '& > .menuItemText': {\r\n margin: 0,\r\n '& > *': {\r\n fontSize: '13px',\r\n },\r\n },\r\n '& > .menuItemTextInset': {\r\n paddingLeft: 0,\r\n },\r\n },\r\n },\r\n '& > .hoverItem': {\r\n marginBottom: '8px',\r\n '& .Mui-selected': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n '& > .menuItemHoverContent': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.background.paper,\r\n '& svg': {\r\n color: theme.palette.background.paper,\r\n },\r\n },\r\n },\r\n '& .Mui-selected:hover': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n '& > .menuItemHoverContent': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.background.paper,\r\n '& svg': {\r\n color: theme.palette.background.paper,\r\n },\r\n },\r\n },\r\n '& > .menuItem': {\r\n padding: 0,\r\n '& > .menuItemHoverContent': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n fontWeight: '900', //theme.typography.fontWeightBold,\r\n color: theme.palette.common.graySubtitle,\r\n textTransform: 'uppercase',\r\n paddingLeft: 16,\r\n '&:hover': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n '& > .menuItemIcon': {\r\n color: theme.palette.common.white,\r\n },\r\n },\r\n '&:focus': {\r\n backgroundColor: theme.palette.primary.main,\r\n color: theme.palette.common.white,\r\n '& > .menuItemIcon': {\r\n color: theme.palette.common.white,\r\n },\r\n },\r\n '& *': {\r\n fontWeight: '900', //theme.typography.fontWeightBold,\r\n whiteSpace: props => (props.isOpen ? 'initial' : 'inherit'),\r\n },\r\n '& > .menuItemIcon': {\r\n color: theme.palette.common.grayComponents,\r\n minWidth: props => (props.isOpen ? '32px' : '48px'),\r\n '& > svg': {\r\n width: '1.5em',\r\n },\r\n },\r\n '& > .menuItemText': {\r\n '& > *': {\r\n fontSize: '13px',\r\n },\r\n },\r\n '& > .menuItemTextInset': {\r\n paddingLeft: 0,\r\n },\r\n },\r\n },\r\n },\r\n '& .childRoot': {\r\n padding: '12px 0px 12px 0',\r\n backgroundColor: theme.palette.primary.bgHover,\r\n '& .Mui-selected': {\r\n '& > .menuItemContent': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n color: theme.palette.primary.main,\r\n },\r\n },\r\n '& .Mui-selected:hover': {\r\n '& > .menuItemContent': {\r\n color: theme.palette.primary.main,\r\n backgroundColor: theme.palette.primary.bgHover,\r\n },\r\n },\r\n '&:hover': {\r\n backgroundColor: theme.palette.primary.bgHover,\r\n color: theme.palette.primary.main,\r\n },\r\n '&>.active': {\r\n '& > .menuItemContent': {\r\n color: theme.palette.primary.main,\r\n backgroundColor: theme.palette.primary.bgHover,\r\n },\r\n },\r\n '& > .menuItem': {\r\n padding: 0,\r\n paddingLeft: '26px',\r\n '& > .menuItemContent': {\r\n display: 'flex',\r\n width: '100%',\r\n position: 'relative',\r\n boxSizing: 'border-box',\r\n textAlign: 'left',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n textDecoration: 'none',\r\n color: theme.palette.common.blackRegular,\r\n '&.active': {\r\n color: theme.palette.primary.main,\r\n },\r\n '& > .menuItemTextInset': {\r\n paddingLeft: props => (props.isOpen ? '0px' : '40px'),\r\n paddingBlock: '6px',\r\n margin: 0,\r\n },\r\n '& *': {\r\n fontWeight: '900', //theme.typography.fontWeightBold,\r\n fontSize: '13px',\r\n },\r\n '&:hover': {\r\n color: theme.palette.primary.main,\r\n },\r\n },\r\n },\r\n },\r\n },\r\n selected: {},\r\n sideBarHeader: {\r\n minHeight: '48px',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n padding: props => (props.isOpen ? '0px 16px' : '0px 8px'),\r\n gap: 16,\r\n },\r\n sideBarFooter: {\r\n minHeight: '48px',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n padding: '0px 16px',\r\n fontSize: '12px',\r\n gap: 16,\r\n },\r\n }),\r\n);\r\n","import { Box, Divider } from '@material-ui/core';\r\nimport { BookitlabShortLogo } from 'app/components/BookitlabLogo/BookitlabShortLogo';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectWebVersion } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { useStyles } from '../styles';\r\n\r\nexport interface SideBarFooterProps {\r\n isOpen?: boolean;\r\n}\r\n\r\nexport const SideBarFooter = React.memo(function SideBarFooter(\r\n props: SideBarFooterProps,\r\n) {\r\n const classes = useStyles({ isOpen: props.isOpen ?? false });\r\n const { t } = useTranslation();\r\n const webVersion = useSelector(selectWebVersion);\r\n return (\r\n \r\n \r\n
    \r\n \r\n {`V: ${webVersion} `}\r\n \r\n \r\n {t(translations.TermsOfUse)}\r\n \r\n \r\n
    \r\n
    \r\n );\r\n});\r\n","import { AddReservation } from 'app/pages/Actions/PageTopActions/AddReservation';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { CoreSelectionButton } from 'app/components/GlobalServiceGroupFilter/CoreSelectionButton';\r\nimport clsx from 'clsx';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectShowSearchInSidebar } from 'app/components/AssetQuickSearch/slice/selectors';\r\nimport * as React from 'react';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectGlobalSetting,\r\n selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { toEntityEnumArray } from 'utils/enumKeys';\r\nimport { SideBarQuickActionsEnum } from 'enums/enums';\r\nimport { NewWorkOrderButton } from 'app/pages/WorkOrdersPage/Actions/NewWorkOrder';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nexport interface SideBarQuickActionProps {\r\n isOpen?: boolean;\r\n isMobile?: boolean;\r\n}\r\n\r\nexport function SideBarQuickAction(props: SideBarQuickActionProps) {\r\n const { isOpen, isMobile } = props;\r\n const { t } = useTranslation();\r\n const showSearchInSidebar = useSelector(selectShowSearchInSidebar);\r\n const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n const actionOptions = toEntityEnumArray(SideBarQuickActionsEnum, t);\r\n const fetchCoreQuickAction = (\r\n serviceGroupId: number | undefined,\r\n ): Promise => {\r\n return new Promise((resolve, reject) => {\r\n if (!serviceGroupId) {\r\n resolve(undefined);\r\n } else {\r\n (async () => {\r\n try {\r\n const url =\r\n '/api/odata/v4/servicegroups/GetGlobalServiceGroupsFilter';\r\n const params = {\r\n $select: 'Id,Name,SidebarQuickAction',\r\n $filter: `Id eq ${quoteODataValue(serviceGroupId)}`,\r\n };\r\n\r\n let groups = await httpClient\r\n .get(url, params)\r\n .then(response => response.value as IServiceGroupDto[]);\r\n resolve(groups[0]);\r\n } catch {\r\n resolve(undefined);\r\n }\r\n })();\r\n }\r\n });\r\n };\r\n const defaultSystemAction = useSelector(state =>\r\n selectGlobalSetting(state, AllowedSettings.SideBarQuickActions),\r\n );\r\n const systemAction = React.useMemo(() => {\r\n if (defaultSystemAction === 'NA') {\r\n return undefined;\r\n }\r\n return actionOptions.some(f => f.OriginalName === defaultSystemAction)\r\n ? actionOptions.filter(f => f.OriginalName === defaultSystemAction)[0].Id\r\n : 1;\r\n }, [actionOptions, defaultSystemAction]);\r\n\r\n const serviceGroup = React.useMemo(() => {\r\n return showGroups && !!savedServiceGroups && savedServiceGroups.length === 1\r\n ? savedServiceGroups[0]\r\n : undefined;\r\n }, [savedServiceGroups, showGroups]);\r\n\r\n const coreSelected = useAsyncGetWthEffect(\r\n () => fetchCoreQuickAction(serviceGroup?.Id),\r\n undefined,\r\n [serviceGroup],\r\n );\r\n\r\n const baseAction = React.useMemo(() => {\r\n return !!coreSelected &&\r\n coreSelected.SidebarQuickAction !== null &&\r\n coreSelected.SidebarQuickAction !== undefined &&\r\n coreSelected.SidebarQuickAction > 0\r\n ? coreSelected.SidebarQuickAction\r\n : !!systemAction\r\n ? systemAction\r\n : undefined;\r\n }, [coreSelected, systemAction]);\r\n return (\r\n \r\n {isMobile && isOpen && showSearchInSidebar && (\r\n \r\n )}\r\n {isMobile && }\r\n {!!baseAction && (\r\n \r\n {baseAction === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * SideBar\r\n *\r\n */\r\nimport * as React from 'react';\r\n\r\nimport { useSelector } from 'react-redux';\r\nimport { selectSiteMapSettings } from 'app/slice/selectors';\r\nimport { SideBarMenu } from './SideBarMenu';\r\nimport { SideBarHeader } from './SideBarHeader';\r\nimport { SiteMapNode, SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { SideBarFooter } from './SideBarFooter';\r\nimport { SideBarQuickAction } from './SideBarQuickAction';\r\nimport { selectRouterPathname } from 'app/slice/router-selectors';\r\ninterface Props {\r\n isOpen: boolean;\r\n isMobile?: boolean;\r\n}\r\n\r\nconst SideBarComponent = (props: Props) => {\r\n const { isOpen, isMobile } = props;\r\n const siteMapSettings = useSelector(selectSiteMapSettings);\r\n const [currentNode, setCurrentNode] = React.useState(\r\n undefined,\r\n );\r\n const routerPathName = useSelector(selectRouterPathname);\r\n const location = useLocation();\r\n const [currentNodes, setCurrentNodes] = React.useState([]);\r\n const loading = isNullOrUndefined(siteMapSettings);\r\n React.useEffect(() => {\r\n setCurrentNode(() =>\r\n new SiteMapProvider(siteMapSettings).getCurrentMainNode(\r\n location?.pathname || routerPathName || window.location.pathname,\r\n ),\r\n );\r\n }, [location?.pathname, routerPathName, siteMapSettings]);\r\n React.useEffect(() => {\r\n let active = !isNullOrUndefined(siteMapSettings);\r\n if (currentNodes.length > 0) {\r\n return undefined;\r\n }\r\n if (active) {\r\n let siteMapProvider = new SiteMapProvider(siteMapSettings);\r\n setCurrentNode(() =>\r\n siteMapProvider.getCurrentMainNode(\r\n location?.pathname || routerPathName || window.location.pathname,\r\n ),\r\n );\r\n setCurrentNodes(\r\n siteMapProvider.getCurrentNodes(\r\n location?.pathname || routerPathName || window.location.pathname,\r\n ),\r\n );\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [currentNodes, loading, location, routerPathName, siteMapSettings]);\r\n return (\r\n \r\n \r\n \r\n \r\n {isMobile && }\r\n \r\n );\r\n};\r\nexport const SideBar = React.memo(SideBarComponent);\r\n","import * as React from 'react';\r\nimport Drawer from '@material-ui/core/Drawer';\r\nimport { SideBar } from 'app/Layout/FrontendLayout/components/SideBar';\r\nimport clsx from 'clsx';\r\nimport { ClickAwayListener } from '@material-ui/core';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\n\r\nexport interface SideBarDrawerProps {\r\n hideNavigation: boolean | undefined;\r\n isMobile: boolean;\r\n isLandscape?: boolean;\r\n handleDrawerClose: (event: any, reason: any) => void;\r\n}\r\nexport const SideBarDrawer = React.memo(function SideBarDrawer(\r\n props: SideBarDrawerProps,\r\n) {\r\n const { isMobile, handleDrawerClose, isLandscape } = props;\r\n const expanded = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n const { toggle } = useExpandedSideBarState();\r\n return !props.hideNavigation ? (\r\n {\r\n console.log('menu target: ', (event.target as any).nodeName);\r\n if (\r\n ((event.target as any).nodeName === 'path' ||\r\n (event.target as any).nodeName === 'svg' ||\r\n (event.target as any).nodeName === 'BODY') &&\r\n event.type === 'click'\r\n ) {\r\n return;\r\n }\r\n if (isMobile) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n if (expanded) {\r\n toggle();\r\n }\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n ) : null;\r\n});\r\n","import { Theme } from '@material-ui/core';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\n// width: 370px;\r\n// left: calc(100vw - 370px);\r\n// transition: ${transitions.create('width', {\r\n// easing: transitions.easing.sharp,\r\n// duration: 500,\r\n// })};\r\nexport const LayoutRoot = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.layoutroot {\r\n direction: ltr;\r\n @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n display: flex;\r\n }\r\n &.layoutRootMobile {\r\n display: inline-flex;\r\n justify-content: flex-end;\r\n align-items: flex-start;\r\n width: 100%;\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n }\r\n & .sidePanelRoot {\r\n height: 0;\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n }\r\n & .sidePanelMobileRoot {\r\n height: 0;\r\n position: absolute;\r\n top: 50px;\r\n left: 0;\r\n max-height: calc(100dvh - 50px);\r\n width: 100%;\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n margin-top: env(safe-area-inset-top);\r\n }\r\n & .backdropOpen {\r\n height: 50px;\r\n position: absolute;\r\n top: -50px;\r\n left: 0;\r\n width: 100%;\r\n background: ${bookitColors.overlays.overlayBlack};\r\n }\r\n & .sidePanelRootExpanded {\r\n width: 100%;\r\n transition: ${transitions.create('width', {\r\n easing: transitions.easing.easeInOut,\r\n duration: 500,\r\n })};\r\n }\r\n & .sidePanelRootCollapsed {\r\n }\r\n }\r\n`;\r\nexport const Main = styled.main.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n direction: ltr;\r\n @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n display: flex;\r\n }\r\n\r\n flex-grow: 1;\r\n min-height: 100dvh;\r\n background: ${bookitColors.grayscale.grayBackground};\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: space-between;\r\n margin-right: 0;\r\n overflow: hidden;\r\n height: 100dvh;\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n ${verticalScrolling}\r\n &.shiftLeft {\r\n margin-right: ${SIDE_PANEL_WIDTH}px;\r\n }\r\n & .appBarSpacer {\r\n min-height: 60px;\r\n &.subBarExpanded {\r\n min-height: 118px;\r\n }\r\n }\r\n & .container {\r\n padding: 0px;\r\n position: relative;\r\n background-color: ${bookitColors.grayscale.grayBackground};\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n margin-right: auto;\r\n margin-left: auto;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n &.mobileOpen {\r\n position: relative;\r\n margin-left: calc(100% - 44px);\r\n }\r\n &.useselectable {\r\n overflow-y: hidden;\r\n }\r\n }\r\n & .footer {\r\n margin-top: auto;\r\n & .copyRight {\r\n padding-top: 8px;\r\n margin-top: auto;\r\n margin-inline: '8px';\r\n }\r\n }\r\n`;\r\nexport const AssetWrapperRoot = styled.div.attrs(props => ({ props }))<{\r\n theme: Theme;\r\n}>`\r\n &.publicLayoutroot {\r\n display: inline-flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n width: 100%;\r\n gap: 24px;\r\n padding: 32px;\r\n background-color: ${bookitColors.grayscale.graybgComponents};\r\n overflow-y: hidden;\r\n direction: ltr;\r\n @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n display: flex;\r\n }\r\n &.isAuthPanel {\r\n padding: 24px;\r\n }\r\n &.publicLayoutRootMobile {\r\n display: inline-flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n width: 100%;\r\n padding: 0;\r\n overflow: hidden;\r\n background-color: ${bookitColors.grayscale.graybgComponents};\r\n\r\n justify-content: flex-end;\r\n align-items: flex-start;\r\n width: 100%;\r\n }\r\n & .sidePanelRoot {\r\n height: 0;\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n }\r\n & .sidePanelMobileRoot {\r\n height: 0;\r\n position: absolute;\r\n top: 50px;\r\n left: 0;\r\n max-height: calc(100dvh - 50px);\r\n width: 100%;\r\n }\r\n & .backdropOpen {\r\n height: 50px;\r\n position: absolute;\r\n top: -50px;\r\n left: 0;\r\n width: 100%;\r\n background: ${bookitColors.overlays.overlayBlack};\r\n }\r\n & .sidePanelRootExpanded {\r\n width: 100%;\r\n transition: ${transitions.create('width', {\r\n easing: transitions.easing.easeInOut,\r\n duration: 500,\r\n })};\r\n }\r\n & .sidePanelRootCollapsed {\r\n }\r\n }\r\n`;\r\n","import {\r\n LinearProgress,\r\n Popper,\r\n PopperProps,\r\n Theme,\r\n useTheme,\r\n} from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAdminPanelOpen,\r\n selectAdminPanelUrl,\r\n} from '../../slice/selectors';\r\nimport { DRAWER_WIDTH } from 'styles/constantVariables';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n// import Frame from 'react-frame-component';\r\n\r\nexport interface AdminPanelProps {}\r\nexport const AdminPanelPopper = styled(\r\n ({\r\n sideBarOpen,\r\n theme,\r\n children,\r\n ...other\r\n }: {\r\n sideBarOpen: boolean;\r\n theme: Theme;\r\n children: React.ReactNode;\r\n } & PopperProps) => {children},\r\n)`\r\n &.admin-panel {\r\n z-index: ${props => props.theme.zIndex.modal};\r\n height: 100dvh;\r\n width: 100%;\r\n margin-left: ${props => (props.sideBarOpen ? DRAWER_WIDTH : 56)}px;\r\n & .admin-panel-paper {\r\n background: ${props => props.theme.palette.common.white};\r\n border-radius: 0;\r\n height: 100%;\r\n width: calc(100% - ${props => (props.sideBarOpen ? DRAWER_WIDTH : 56)}px);\r\n margin: 0;\r\n box-shadow: unset;\r\n & .admin-panel-header {\r\n display: flex;\r\n justify-content: flex-end;\r\n padding: 8px;\r\n }\r\n }\r\n }\r\n`;\r\nexport function AdminPanel(props: AdminPanelProps) {\r\n const adminPanelOpen = useSelector(selectAdminPanelOpen);\r\n const adminUrl = useSelector(selectAdminPanelUrl);\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const { actions: layoutActions } = useLayoutSlice();\r\n const isMobile = DetectIsMobile();\r\n const sideBarOpen = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n const [iframeLoaded, setIframeLoaded] = React.useState(false);\r\n const elementRef = React.useRef(null);\r\n\r\n const iframeRef = React.useRef(null);\r\n const absolutePath = React.useMemo(() => {\r\n return adminUrl !== undefined\r\n ? typeof adminUrl === 'string'\r\n ? toRootedURL(adminUrl)\r\n : toRootedURL(\r\n (adminUrl as IPathAndQuery).path,\r\n (adminUrl as IPathAndQuery).search,\r\n )\r\n : undefined;\r\n }, [adminUrl]);\r\n const theme = useTheme();\r\n const countState = React.useState(0);\r\n React.useEffect(() => {\r\n countState[1](c => c + 1);\r\n // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementRef.current]);\r\n const closeAdminPanel = React.useCallback(() => {\r\n dispatch(layoutActions.resetAdminPanel());\r\n }, [dispatch, layoutActions]);\r\n const handleIfarameLoad = () => {\r\n setIframeLoaded(true);\r\n };\r\n // React.useEffect(() => {\r\n // if (!!iframeRef.current) {\r\n // let doc = iframeRef.current.contentWindow;\r\n // }\r\n // return () => {};\r\n // }, []);\r\n return (\r\n \r\n
    \r\n \r\n {adminPanelOpen && !!absolutePath ? (\r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n {!iframeLoaded && (\r\n
    \r\n \r\n
    \r\n )}\r\n \r\n
    \r\n ) : (\r\n
    \r\n )}\r\n
    \r\n
    \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * Layout\r\n *\r\n */\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { Copyright } from 'app/components/Copyright';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SidePanel } from './components/SidePanel';\r\nimport {\r\n selectConfirmOpen,\r\n selectExpandedSidePanel,\r\n selectHideNavigation,\r\n selectSidePanelOpen,\r\n} from './slice/selectors';\r\nimport { TopBar } from './components/TopBar';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useLayoutSlice } from './slice';\r\nimport { translations } from 'locales/translations';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useRequiredRedirect } from 'app/hooks/useRequiredRedirectToCoreSelection';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { SideBarDrawer } from './SideBarDrawer';\r\nimport { LayoutRoot, Main } from './styled';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { DRAWER_MOBILE_WIDTH, DRAWER_WIDTH } from 'styles/constantVariables';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n selectIsExpandedSideBar,\r\n selectIsSubBarCollapsed,\r\n selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AdminPanel } from './components/AdminPanel';\r\n\r\ninterface Props {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const FrontendLayout_MainContent_ID = 'main_div_content';\r\nexport function FrontendLayout({ children }: Props) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { actions: appActions } = useAppSettingsSlice();\r\n const { checkIsMobile, isLandscape } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const expanded = useSelector(state =>\r\n selectIsExpandedSideBar(state, isMobile),\r\n );\r\n const { expand } = useExpandedSideBarState();\r\n\r\n const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n const appSettings = useSelector(selectAppSettings);\r\n const isBudgets = IsModuleEnabled(appSettings, KnownModules.Budgets);\r\n const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n const confirmOpen = useSelector(selectConfirmOpen);\r\n const hideNavigation = useSelector(selectHideNavigation);\r\n const {\r\n redirectToCoreSelection,\r\n redirectToTermsOfUseAgreement,\r\n redirectToActiveUserGroup,\r\n redirectToUsageKiosk,\r\n redirectToUsageRoom,\r\n redirectToConsumableKiosk,\r\n redirectToJoinAdGroup,\r\n } = useRequiredRedirect();\r\n const drawerWidth = React.useMemo(() => {\r\n return isMobile ? DRAWER_MOBILE_WIDTH : DRAWER_WIDTH;\r\n }, [isMobile]);\r\n const marginRight = React.useMemo(() => {\r\n return sidePanelOpen && !sidePanelExpanded && !isMobile;\r\n }, [isMobile, sidePanelExpanded, sidePanelOpen]);\r\n React.useEffect(() => {\r\n let isRedirectToTermsOfUseAgreement =\r\n redirectToTermsOfUseAgreement === true;\r\n let isRedirectToActiveUserGroup = redirectToActiveUserGroup === true;\r\n let isRedirectToCoreSelection = redirectToCoreSelection === true;\r\n let isRedirectToUsageKiosk = redirectToUsageKiosk === true;\r\n let isRedirectToUsageRoom = redirectToUsageRoom === true;\r\n let isRedirectToConsumableKiosk = redirectToConsumableKiosk === true;\r\n let isRedirectToJoinAdGroup = redirectToJoinAdGroup === true;\r\n if (isRedirectToTermsOfUseAgreement === true) {\r\n dispatch(appActions.navigate('/TermsOfUseAgreement/exp'));\r\n return;\r\n } else {\r\n if (isRedirectToActiveUserGroup === true) {\r\n dispatch(appActions.navigate('/ActiveUserGroup'));\r\n return;\r\n }\r\n }\r\n if (isRedirectToUsageKiosk) {\r\n window.open(toRootedURL('/UsageKiosk.aspx'));\r\n return;\r\n }\r\n if (isRedirectToUsageRoom) {\r\n window.open(toRootedURL('/InstrumentRoom.aspx'));\r\n return;\r\n }\r\n if (isRedirectToConsumableKiosk) {\r\n dispatch(\r\n appActions.navigate(\r\n isBudgets ? '/kiosk/projects' : '/kiosk/projects/consumables',\r\n ),\r\n );\r\n return;\r\n }\r\n if (isRedirectToJoinAdGroup) {\r\n let url: string = '/join';\r\n if (!!authenticatedUser?.ActiveUserGroup?.Id) {\r\n url = `${url}?${toQueryString({\r\n un: authenticatedUser?.Id,\r\n adg: authenticatedUser?.ActiveUserGroup?.Id,\r\n action: 'join',\r\n })}`;\r\n }\r\n dispatch(appActions.navigate(url));\r\n return;\r\n }\r\n if (isRedirectToCoreSelection) {\r\n dispatch(appActions.navigate('/coreselection'));\r\n dispatch(\r\n appActions.addNotification({\r\n key: 'coreSelection_error',\r\n message: 'Please select core/s',\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n\r\n return () => {\r\n isRedirectToCoreSelection = false;\r\n isRedirectToTermsOfUseAgreement = false;\r\n isRedirectToActiveUserGroup = false;\r\n isRedirectToUsageKiosk = false;\r\n isRedirectToUsageRoom = false;\r\n isRedirectToConsumableKiosk = false;\r\n isRedirectToJoinAdGroup = false;\r\n };\r\n }, [\r\n actions,\r\n appActions,\r\n dispatch,\r\n redirectToCoreSelection,\r\n redirectToTermsOfUseAgreement,\r\n redirectToActiveUserGroup,\r\n redirectToUsageKiosk,\r\n redirectToUsageRoom,\r\n redirectToConsumableKiosk,\r\n isBudgets,\r\n redirectToJoinAdGroup,\r\n authenticatedUser?.ActiveUserGroup,\r\n authenticatedUser?.Id,\r\n ]);\r\n\r\n const handleDrawerClose = React.useCallback(\r\n (event, reason) => {\r\n expand(!expanded);\r\n },\r\n [expand, expanded],\r\n );\r\n\r\n React.useEffect(() => {\r\n dispatch(actions.setIsMobileView(isMobile));\r\n }, [actions, dispatch, isMobile]);\r\n const handleRejectConfirm = React.useCallback(() => {\r\n dispatch(actions.setConfirmRejected(true));\r\n }, [actions, dispatch]);\r\n const handleApproveConfirm = React.useCallback(() => {\r\n dispatch(actions.setConfirmApproved(true));\r\n }, [actions, dispatch]);\r\n const theme = useTheme();\r\n return (\r\n \r\n {!isMobile && !hideNavigation && (\r\n \r\n )}\r\n\r\n \r\n {/* id is required on main in order for infinite scroll to work according to main's scrollbar*/}\r\n \r\n {!isMobile && (\r\n \r\n )}\r\n \r\n {children}\r\n {!isMobile && (\r\n
    \r\n \r\n
    \r\n )}\r\n \r\n \r\n\r\n \r\n \r\n {\r\n handleApproveConfirm();\r\n }}\r\n onCancel={() => {\r\n handleRejectConfirm();\r\n }}\r\n id=\"confirm_sidepanel\"\r\n aria-labelledby=\"side-panel-confirm\"\r\n />\r\n \r\n );\r\n}\r\n","import { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport {\r\n selectGlobalServiceGroupFilter,\r\n selectIsAuthenticated,\r\n selectLoading,\r\n selectGlobalSettingBool,\r\n selectShowGlobalServiceGroupFilter,\r\n selectAuthenticatedUser,\r\n selectAppSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { UserGroupsProviderTypes } from 'enums/GlobalEnums';\r\nimport { JoinStatusEnum } from 'enums/JoinStatus';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useLocationChange } from './useLocationChange';\r\n\r\nexport const useRequiredRedirect = () => {\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n const globalCoreVisible = useSelector(selectShowGlobalServiceGroupFilter);\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const loading = useSelector(selectLoading);\r\n const topServiceGroupsIsHidden = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n );\r\n const appSettings = useSelector(selectAppSettings);\r\n const termsOfUseAgreementEnabled = React.useMemo(\r\n () => IsModuleEnabled(appSettings, KnownModules.TermsOfUseAgreement),\r\n [appSettings],\r\n );\r\n const multipleAdGroupsModuleEnabled = React.useMemo(\r\n () => IsModuleEnabled(appSettings, KnownModules.MultipleAdGroups),\r\n [appSettings],\r\n );\r\n const joinAdGroupEnabled = React.useMemo(\r\n () => IsModuleEnabled(appSettings, KnownModules.JoinAdGroup),\r\n [appSettings],\r\n );\r\n const UserGroupsProviderType = React.useMemo(\r\n () => appSettings?.UserGroupsProviderType,\r\n [appSettings],\r\n );\r\n const { savedEnabled: isFirstLogin } = useProfileSetting({\r\n profileSettingKey: 'IsFirstLoginUser',\r\n });\r\n const { savedEnabled: OptOutCoreSelection } = useProfileSetting({\r\n profileSettingKey: 'CoreSelectionOptOut',\r\n });\r\n const { savedEnabled: isFirstActiveUserGroupSelected } = useProfileSetting({\r\n profileSettingKey: 'IsFirstActiveUserGroupSelected',\r\n });\r\n const skipCoreSelectionScreen = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.SkipCoreSelectionScreen),\r\n );\r\n const usageKioskRoleEnabled = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.UsageKioskRoleEnabled),\r\n );\r\n const roomUserRoleEnabled = useSelector(state =>\r\n selectGlobalSettingBool(state, AllowedSettings.RoomUserRoleEnabled),\r\n );\r\n const [\r\n redirectToTermsOfUseAgreement,\r\n setRedirectToTermsOfUseAgreement,\r\n ] = React.useState(false);\r\n const [\r\n redirectToActiveUserGroup,\r\n setRedirectToActiveUserGroup,\r\n ] = React.useState(false);\r\n const [redirectToCoreSelection, setRedirectToCoreSelection] = React.useState<\r\n boolean\r\n >(false);\r\n const [redirectToUsageKiosk, setRedirectToUsageKiosk] = React.useState<\r\n boolean\r\n >(false);\r\n const [redirectToUsageRoom, setRedirectToUsageRoom] = React.useState(\r\n false,\r\n );\r\n const [\r\n redirectToConsumableKiosk,\r\n setRedirectToConsumableKiosk,\r\n ] = React.useState(false);\r\n const [redirectToJoinAdGroup, setRedirectToJoinAdGroup] = React.useState<\r\n boolean\r\n >(false);\r\n React.useEffect(() => {\r\n if (!loading && isAuthenticated) {\r\n if (\r\n !topServiceGroupsIsHidden &&\r\n !skipCoreSelectionScreen &&\r\n globalCoreVisible\r\n ) {\r\n if (\r\n !selectedServiceGroups ||\r\n selectedServiceGroups.length < 1 ||\r\n (!OptOutCoreSelection && isFirstLogin)\r\n ) {\r\n if (window.location.pathname.indexOf('/coreselection') === -1) {\r\n setRedirectToCoreSelection(true);\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n return () => {\r\n setRedirectToCoreSelection(false);\r\n };\r\n }, [\r\n OptOutCoreSelection,\r\n globalCoreVisible,\r\n isAuthenticated,\r\n isFirstLogin,\r\n loading,\r\n selectedServiceGroups,\r\n skipCoreSelectionScreen,\r\n topServiceGroupsIsHidden,\r\n ]);\r\n\r\n useLocationChange((current: Location, previus: Location) => {\r\n if (!previus || current.pathname !== previus.pathname) {\r\n if (!loading && isAuthenticated && !!authenticatedUser) {\r\n if (termsOfUseAgreementEnabled) {\r\n if (authenticatedUser.HasSignedTermsOfUse === true) {\r\n setRedirectToTermsOfUseAgreement(false);\r\n } else {\r\n setRedirectToTermsOfUseAgreement(true);\r\n }\r\n } else {\r\n setRedirectToTermsOfUseAgreement(false);\r\n }\r\n if (\r\n (UserGroupsProviderType === UserGroupsProviderTypes.SQL ||\r\n !authenticatedUser.IsActiveDirectory) &&\r\n joinAdGroupEnabled &&\r\n (!authenticatedUser.ActiveUserGroup?.Id ||\r\n authenticatedUser.JoinStatus !== JoinStatusEnum.Approved)\r\n ) {\r\n setRedirectToJoinAdGroup(true);\r\n } else {\r\n setRedirectToJoinAdGroup(false);\r\n }\r\n if (\r\n (isFirstActiveUserGroupSelected === false ||\r\n isFirstActiveUserGroupSelected === undefined) &&\r\n multipleAdGroupsModuleEnabled &&\r\n (authenticatedUser.UserGroups?.length || 1) > 1\r\n ) {\r\n setRedirectToActiveUserGroup(true);\r\n } else {\r\n setRedirectToActiveUserGroup(false);\r\n }\r\n if (\r\n usageKioskRoleEnabled &&\r\n authenticatedUser.Roles.includes(Roles.KioskAdmin)\r\n ) {\r\n setRedirectToUsageKiosk(true);\r\n } else {\r\n setRedirectToUsageKiosk(false);\r\n }\r\n if (\r\n roomUserRoleEnabled &&\r\n authenticatedUser.Roles.includes(Roles.RoomOnly)\r\n ) {\r\n setRedirectToUsageRoom(true);\r\n } else {\r\n setRedirectToUsageRoom(false);\r\n }\r\n if (authenticatedUser.Roles.includes(Roles.ConsumableKiosk)) {\r\n setRedirectToConsumableKiosk(true);\r\n } else {\r\n setRedirectToConsumableKiosk(false);\r\n }\r\n if (\r\n !topServiceGroupsIsHidden &&\r\n !skipCoreSelectionScreen &&\r\n globalCoreVisible\r\n ) {\r\n if (\r\n !selectedServiceGroups ||\r\n selectedServiceGroups.length < 1 ||\r\n (!OptOutCoreSelection && isFirstLogin)\r\n ) {\r\n if (\r\n current.pathname.indexOf('/coreselection') === -1 &&\r\n !redirectToUsageKiosk &&\r\n !redirectToUsageRoom &&\r\n !redirectToConsumableKiosk\r\n ) {\r\n setRedirectToCoreSelection(true);\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n } else {\r\n setRedirectToCoreSelection(false);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n return {\r\n redirectToCoreSelection,\r\n redirectToTermsOfUseAgreement,\r\n redirectToActiveUserGroup,\r\n redirectToUsageKiosk,\r\n redirectToUsageRoom,\r\n redirectToConsumableKiosk,\r\n redirectToJoinAdGroup,\r\n };\r\n};\r\n","/**\r\n *\r\n * SamplesTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { EditableCell } from '../../EditableTable/EditableCell';\r\nimport { TmtType } from 'app/pages/Samples/components/TmtType';\r\nimport { DateField as CellDateField } from '../../EditableTable/Fields/DateField';\r\nimport { NumberField as CellNumberField } from '../../EditableTable/Fields/NumberField';\r\nimport { TextField as CellTextField } from '../../EditableTable/Fields/TextField';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ISample } from '../../SamplesListPage/slice/types';\r\nimport { MouseEventHandler } from 'react';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\nimport { SamplePlatePicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePicker';\r\nimport { SourceSamplePlatePositionPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionPicker';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DateLabel } from 'app/components/DateLabel.tsx';\r\nimport {\r\n selectSamplesData,\r\n selectSamplesTableState,\r\n selectSelectedSamples,\r\n} from '../../RequestSamplesPage/slice/selectors';\r\nimport { useConfigurableColumnsAdvanced } from 'app/components/BasicTable/useConfigurableColumnsAdvanced';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\n\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { ImportButton as SamplesImportButton } from '../../SamplesListPage/ImportButton';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { Column } from 'react-table';\r\n\r\nexport interface SamplesTableProps {\r\n serviceRequestId?: number;\r\n processing: boolean;\r\n isEditable: boolean;\r\n isAdmin: boolean;\r\n pageSize?: number;\r\n printing?: Printing;\r\n sectionStyles?: React.CSSProperties;\r\n}\r\n\r\nconst READONLY_COLUMNS = ['Status'];\r\n\r\nexport const SamplesTable = React.memo(function SamplesTable({\r\n serviceRequestId,\r\n isAdmin,\r\n isEditable,\r\n pageSize,\r\n printing,\r\n sectionStyles,\r\n ...props\r\n}: SamplesTableProps) {\r\n const samplesTableState = useSelector(selectSamplesTableState);\r\n const samples = useSelector(selectSamplesData);\r\n const selectedSamples = useSelector(selectSelectedSamples);\r\n const appSettings = useSelector(selectAppSettings);\r\n const { actions: requestactions } = useRequestSamplesSlice();\r\n const history = useHistory();\r\n const { actions } = useRequestSamplesSlice();\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n const columns: Column[] = React.useMemo(() => {\r\n var result = [\r\n {\r\n Header: t(translations.SampleId),\r\n accessor: 'Id', // accessor is the \"key\" in the data\r\n },\r\n {\r\n Header: 'Request ID',\r\n accessor: 'ServiceRequestId',\r\n },\r\n {\r\n Header: 'Status',\r\n accessor: 'StatusName',\r\n Cell: ({ row, value }) => {\r\n /*switch (value) {\r\n case 0:\r\n return 'New';\r\n case 1:\r\n return 'In Work';\r\n case 2:\r\n return 'Done';\r\n default:\r\n return 'N/A';\r\n }*/\r\n return row.original.StatusName;\r\n },\r\n },\r\n {\r\n Header: t(translations.AnalyticalSampleId),\r\n accessor: 'AnalyticalSampleId',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.BiologicalSampleId),\r\n accessor: 'BiologicalSampleId',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.SubjectId),\r\n accessor: 'SubjectId',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.SampleType),\r\n accessor: 'SampleType',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.TaxaId),\r\n accessor: 'TaxaId',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.Grouping),\r\n accessor: 'Grouping',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: 'Date Received',\r\n accessor: 'DateReceived',\r\n Cell: !isEditable ? DateLabel : EditableCell(CellDateField),\r\n },\r\n {\r\n Header: 'Tube label',\r\n accessor: 'TubeLabel',\r\n Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n },\r\n {\r\n Header: t(translations.TMT_Type),\r\n accessor: 'TMT_Type',\r\n Cell: !isEditable ? undefined : EditableCell(TmtType),\r\n },\r\n {\r\n Header: t(translations.TMT_Label),\r\n accessor: 'TMT_Label',\r\n Cell: !isEditable ? undefined : React.memo(EditableCell(CellTextField)),\r\n },\r\n {\r\n Header: t(translations.TMT_Set),\r\n accessor: 'TMT_Set',\r\n Cell: !isEditable ? undefined : React.memo(EditableCell(CellTextField)),\r\n },\r\n {\r\n Header: t(translations.SamplePlateId),\r\n accessor: 'SamplePlateId',\r\n Cell: !isEditable\r\n ? undefined\r\n : React.memo(EditableCell(SamplePlatePicker)),\r\n },\r\n {\r\n Header: t(translations.PlatePosition),\r\n accessor: 'Position',\r\n Cell: !isEditable\r\n ? undefined\r\n : React.memo(EditableCell(SourceSamplePlatePositionPicker)),\r\n },\r\n {\r\n Header: t(translations.Volume),\r\n accessor: 'Volume',\r\n Cell: !isEditable\r\n ? undefined\r\n : React.memo(EditableCell(CellNumberField)),\r\n },\r\n {\r\n Header: t(translations.Concentration),\r\n accessor: 'Concentration',\r\n Cell: !isEditable\r\n ? undefined\r\n : React.memo(EditableCell(CellNumberField)),\r\n },\r\n {\r\n Header: t(translations.ServiceGroup),\r\n accessor: 'ServiceGroup',\r\n },\r\n ];\r\n /**\r\n * { Cell: undefined } causes \"Renderer Error\"\r\n */\r\n result\r\n .filter(column => column.Cell === undefined)\r\n .forEach(column => delete column.Cell);\r\n return result;\r\n }, [isEditable, t]);\r\n\r\n const {\r\n configurableColumns,\r\n columnAccessors,\r\n exportConfigurableColumns,\r\n handleConfigurableColumns,\r\n configCompleted,\r\n } = useConfigurableColumnsAdvanced(\r\n ScreensId.SampleRequests,\r\n columns,\r\n READONLY_COLUMNS,\r\n );\r\n const pageCount = React.useMemo(() => {\r\n return Math.ceil(\r\n (samples.value?.dataLength ?? 0) / (samplesTableState.pageSize ?? 10),\r\n );\r\n }, [samples.value?.dataLength, samplesTableState.pageSize]);\r\n const customPageSize = React.useMemo(() => {\r\n return printing !== undefined && printing.printing === true\r\n ? 10000\r\n : pageSize ?? 10;\r\n }, [pageSize, printing]);\r\n // const dispatch = useDispatch();\r\n // const { actions } = useSamplesListSlice();\r\n const updateMyData = item => {\r\n // We also turn on the flag to not reset the page\r\n // setSkipPageReset(true);\r\n dispatch(actions.updateServiceRequestSampleField(item));\r\n };\r\n\r\n const handleCreateButtonClick: MouseEventHandler = e => {\r\n if (serviceRequestId === undefined) {\r\n return;\r\n }\r\n const data: ISample = {\r\n Id: 0,\r\n ServiceRequestId: serviceRequestId,\r\n BudgetId: null,\r\n BudgetName: null,\r\n SourceRunIds: [],\r\n TargetRunIds: [],\r\n Status: 0,\r\n StatusName: null,\r\n AnalyticalSampleId: null,\r\n BiologicalSampleId: null,\r\n TMT_Type: null,\r\n TMT_Label: null,\r\n TMT_Set: null,\r\n SubjectId: null,\r\n Concentration: null,\r\n Volume: null,\r\n SamplePlateId: null,\r\n Position: null,\r\n SampleType: null,\r\n TaxaId: null,\r\n };\r\n dispatch(actions.createSample(data));\r\n };\r\n\r\n const handleChangeState = React.useCallback(\r\n state => {\r\n if (!!columnAccessors) {\r\n dispatch(\r\n actions.loadSamples({ ...state, ...{ columns: columnAccessors } }),\r\n );\r\n }\r\n },\r\n [actions, columnAccessors, dispatch],\r\n );\r\n\r\n const openExportUrl = React.useCallback(\r\n (readWriteOnly: boolean): Promise => {\r\n if (\r\n exportConfigurableColumns !== undefined &&\r\n exportConfigurableColumns.length > 0\r\n ) {\r\n const exportColumns = exportConfigurableColumns;\r\n if (readWriteOnly) exportColumns.concat(READONLY_COLUMNS);\r\n const downloadTemplateUrl = toRootedURL('/api/odata/v4/samples', {\r\n $format: 'application/xlsx',\r\n $filter:\r\n '(not SourceRunIds/any()) and ' +\r\n (selectedSamples?.length > 0\r\n ? `Id in (${selectedSamples.map(f => f.Id).join(',')})`\r\n : `ServiceRequestId eq ${serviceRequestId}`),\r\n $select: exportColumns.join(','),\r\n });\r\n return openExportLink(downloadTemplateUrl);\r\n } else\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n },\r\n [exportConfigurableColumns, selectedSamples, serviceRequestId],\r\n );\r\n const handleExportClick = (): Promise => openExportUrl(false);\r\n /*const handleExportForImportClick = React.useCallback(\r\n () => openExportUrl(true),\r\n [openExportUrl],\r\n );*/\r\n const handleDownloadTemplateClick = React.useCallback((): Promise => {\r\n if (\r\n exportConfigurableColumns !== undefined &&\r\n exportConfigurableColumns.length > 0\r\n ) {\r\n if (serviceRequestId === undefined) {\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n }\r\n const downloadTemplateUrl = toRootedURL('/api/odata/v4/samples', {\r\n $format: 'application/xlsx',\r\n $filter: `ServiceRequestId eq ${serviceRequestId}`,\r\n $top: 0,\r\n $select: exportConfigurableColumns.join(','),\r\n });\r\n return openExportLink(downloadTemplateUrl);\r\n } else\r\n return new Promise((resolve, reject) => {\r\n resolve();\r\n });\r\n }, [exportConfigurableColumns, serviceRequestId]);\r\n const goToSamplesList = React.useCallback(() => {\r\n history.push(`/samples?ServiceRequestId=${serviceRequestId}`);\r\n }, [history, serviceRequestId]);\r\n const handelDeleteSamplesClick = (\r\n selectedRows: ISample[],\r\n toggleAllRowsSelected,\r\n ) => {\r\n dispatch(actions.deleteSamples(selectedRows));\r\n toggleAllRowsSelected(false);\r\n };\r\n const handleSelectedRowsChange = React.useCallback(\r\n rows => {\r\n dispatch(actions.setSelected(rows));\r\n },\r\n [actions, dispatch],\r\n );\r\n const menuItems: React.ReactNode[] = React.useMemo(() => {\r\n let items: React.ReactNode[] = [];\r\n\r\n /*items.push(\r\n \r\n \r\n ,\r\n );\r\n /*items.push(\r\n \r\n {t(translations.ExportForImport)}\r\n ,\r\n );*/\r\n return items;\r\n }, []);\r\n\r\n const getActions = (): PageActionRenderer[] => {\r\n const result: PageActionRenderer[] = [\r\n /*() => (\r\n \r\n ),*/\r\n () => (\r\n \r\n ),\r\n ];\r\n if (isAdmin && menuItems.length > 0) {\r\n result.push(() => (\r\n [...menuItems]}\r\n >\r\n \r\n \r\n ));\r\n }\r\n return result;\r\n };\r\n const importHandler = () => {\r\n dispatch(requestactions.toggleImport(true));\r\n };\r\n const customScreenName: React.ReactNode = React.useMemo(() => {\r\n const result = (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n );\r\n return result;\r\n }, [goToSamplesList, t]);\r\n return (\r\n <>\r\n \r\n | null;\r\n // TargetRunIds: Array | null;\r\n //\"cast(Status , 'Edm.String')\",\r\n 'AnalyticalSampleId',\r\n 'BiologicalSampleId',\r\n 'TMT_Type',\r\n 'TMT_Label',\r\n 'TMT_Set',\r\n 'SubjectId',\r\n \"cast(Concentration , 'Edm.String')\",\r\n \"cast(Volume , 'Edm.String')\",\r\n 'SamplePlateId',\r\n 'Position',\r\n ]}\r\n compact={false}\r\n // updateMyData={updateMyData}\r\n selectedRowsActions={[\r\n (rows: ISample[], _refresh, toggleAllRowsSelected) => (\r\n <>\r\n \r\n handelDeleteSamplesClick(rows, toggleAllRowsSelected)\r\n }\r\n confirmationDialogBody={t(\r\n translations.ThisCannotBeUndoneAreYouSure,\r\n )}\r\n >\r\n {t(translations.Delete)} ({rows.length})\r\n \r\n \r\n ),\r\n ]}\r\n pageActions={getActions()}\r\n printing={printing}\r\n tableContainerSyles={sectionStyles}\r\n />\r\n \r\n );\r\n});\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { FormikProps } from 'formik';\r\nimport {\r\n CustomFormValueType,\r\n getFieldsVisibilities,\r\n getSerializableIsRequired,\r\n isRequired,\r\n SerializeValue,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport { Box } from '@material-ui/core';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { IServiceRequestDetailsFormModel } from '../../slice/types';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { selectServiceRequestCustomFormFields } from '../../slice/selectors';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { CustomFormField } from 'app/components/CustomForm/CustomFormFields';\r\nimport { sortBy } from 'lodash';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\n\r\nexport interface ServiceRequestCustomFormProps\r\n extends FormikProps {\r\n serviceRequestId?: number;\r\n customForm: ICustomFormDto;\r\n isAdmin: boolean;\r\n disabled: boolean;\r\n allowUserUpload?: boolean;\r\n sectionStyles?: React.CSSProperties;\r\n}\r\nconst log = getLogger('ServiceRequestCustomForm');\r\nexport const ServiceRequestCustomForm = React.memo(\r\n function ServiceRequestCustomForm({\r\n isAdmin,\r\n disabled,\r\n allowUserUpload,\r\n sectionStyles,\r\n ...props\r\n }: ServiceRequestCustomFormProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const formFields = useSelector(selectServiceRequestCustomFormFields);\r\n const handleChange = React.useCallback(\r\n (value, formField: IFormFieldDto) => {\r\n const serviceRequestId = props.serviceRequestId;\r\n if (serviceRequestId === undefined) {\r\n log.info('handleSubmit - serviceRequestId is empty');\r\n return;\r\n }\r\n dispatch(\r\n actions.saveFormValues({\r\n RequestId: serviceRequestId,\r\n FormFieldId: formField.Id,\r\n Value:\r\n formField.Type === 'File'\r\n ? value\r\n : SerializeValue(formField, value?.target?.value ?? value),\r\n DisplayValue: null,\r\n Type: formField.Type,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, props.serviceRequestId],\r\n );\r\n\r\n const isVisibleField = (\r\n field: IFormFieldDto,\r\n isAdmin: boolean,\r\n values: Record | undefined,\r\n visibleOnCompletion?: () => boolean,\r\n ): boolean => {\r\n let visibilities = getFieldsVisibilities(\r\n formFields,\r\n isAdmin,\r\n values,\r\n visibleOnCompletion,\r\n );\r\n if (visibilities) {\r\n return visibilities[field.Id];\r\n }\r\n return true;\r\n };\r\n const sortedActiveFormFields = React.useMemo(\r\n () =>\r\n sortBy(\r\n formFields.filter(f => f.Active === true),\r\n f => f.Index,\r\n ).map(f => {\r\n return {\r\n fieldRequired:\r\n isRequired(\r\n f,\r\n isAdmin || false,\r\n props?.values?.FormValues?.[f.Id],\r\n ) &&\r\n getSerializableIsRequired(\r\n f,\r\n props?.values?.FormValues?.[f.Id] as CustomFormValueType,\r\n ),\r\n field: f,\r\n };\r\n }),\r\n [formFields, isAdmin, props?.values?.FormValues],\r\n );\r\n\r\n return props.values.FormValues === undefined ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n {sortedActiveFormFields.map((formField, index, arr) => {\r\n // paragraphs & form sections deserve to start from the new line in 2 column layout (full screen)\r\n const fullRow =\r\n formField.field.Type !== null &&\r\n ['Paragraph', 'FormSection'].includes(formField.field.Type);\r\n const name = `FormValues.${String(formField.field.Id)}`;\r\n const nextField = arr[index + 1];\r\n const nextFullRow =\r\n !!nextField &&\r\n nextField.field.Type !== null &&\r\n ['Paragraph', 'FormSection'].includes(nextField.field.Type);\r\n const prevField = arr[index - 1];\r\n const prevFullRow =\r\n !!prevField &&\r\n prevField.field.Type !== null &&\r\n ['Paragraph', 'FormSection'].includes(prevField.field.Type);\r\n const nextIsEmpty =\r\n !fullRow &&\r\n ((arr[index - 1] === undefined &&\r\n (nextFullRow || arr[index + 1] === undefined)) ||\r\n (arr[index - 1] !== undefined &&\r\n !prevFullRow &&\r\n nextFullRow &&\r\n index % 2 === 0) ||\r\n (prevFullRow && nextFullRow) ||\r\n (prevFullRow && arr[index + 1] === undefined));\r\n return (\r\n \r\n {/* {!fullRow && index % 2 === 1 && (\r\n \r\n )} */}\r\n \r\n handleChange(value, formField.field)}\r\n />\r\n \r\n {nextIsEmpty && (\r\n \r\n )}\r\n \r\n );\r\n })}\r\n {/* {sortedActiveFormFields.filter(f =>\r\n isVisibleField(\r\n f.field,\r\n isAdmin || false,\r\n props.values.FormValues,\r\n undefined,\r\n ),\r\n ).length %\r\n 2 ===\r\n 1 && } */}\r\n \r\n );\r\n },\r\n);\r\n","/**\r\n *\r\n * BudgetPicker\r\n *\r\n */\r\nimport { IServiceBaseDto } from 'api/odata/generated/entities/IServiceBaseDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n BudgetPicker,\r\n BudgetPickerProps,\r\n restrictedBudgetFilter,\r\n} from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface EventBudgetPickerProps extends BudgetPickerProps {\r\n service: IServiceBaseDto;\r\n userGroupId: string;\r\n userId: string;\r\n isAdmin: boolean;\r\n fundingType: number | null;\r\n}\r\n\r\n/**\r\n * Budget picker that can be used to select a budget applicable to bookable events like reservations, offline services, requests, etc.\r\n * @param param0\r\n * @returns\r\n */\r\nexport function EventBudgetPicker({\r\n predicates,\r\n ...props\r\n}: EventBudgetPickerProps) {\r\n const globalSettings = useGlobalSettingsHook();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n return (\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n !props.service.HideProjects\r\n );\r\n }, [\r\n props.service,\r\n globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n ]);\r\n const eventPredicates = React.useMemo(() => {\r\n const result = restrictedBudgetFilter({\r\n budgetLimitedByUsers: globalSettings.budgetLimitedByUsers,\r\n isBudgetsWithoutUserGroup: globalSettings.isBudgetsWithoutUserGroup,\r\n userGroupId: ReservationUserGroupGroupByBudgetUserGroup\r\n ? undefined\r\n : props.userGroupId,\r\n serviceGroupId: undefined,\r\n services: [props.service].map(f => {\r\n return {\r\n Id: f.Id,\r\n Name: f.Name,\r\n ServiceTypeId: ServiceType[f.ServiceType],\r\n ServiceGroupId: f.ServiceGroup.Id,\r\n HideProject: f.HideProjects,\r\n } as IServiceTypeFilterDto;\r\n }),\r\n startTime: undefined,\r\n endTime: undefined,\r\n user: props.isAdmin\r\n ? props.userId === null\r\n ? undefined\r\n : props.userId\r\n : authenticatedUser?.Id,\r\n defaultBudgetEnabled: globalSettings.defaultBudgetEnabled,\r\n userDefaultBudgetEnabled: globalSettings.userDefaultBudgetEnabled,\r\n hideNonDefaultBudgets: globalSettings.hideNonDefaultBudgets,\r\n // funding type is set to Internal by default even if it's not in use\r\n fundingType:\r\n props.fundingType === null\r\n ? null\r\n : getSingleInvoiceFundingType(props.fundingType),\r\n });\r\n return result.concat(predicates ?? []);\r\n }, [\r\n globalSettings.budgetLimitedByUsers,\r\n globalSettings.isBudgetsWithoutUserGroup,\r\n globalSettings.defaultBudgetEnabled,\r\n globalSettings.userDefaultBudgetEnabled,\r\n globalSettings.hideNonDefaultBudgets,\r\n ReservationUserGroupGroupByBudgetUserGroup,\r\n props.userGroupId,\r\n props.service,\r\n props.isAdmin,\r\n props.userId,\r\n props.fundingType,\r\n authenticatedUser?.Id,\r\n predicates,\r\n ]);\r\n return ;\r\n}\r\n","import { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InputLabel, InputValue } from 'app/components/Typography';\r\n\r\nexport function ReadonlyField(props: {\r\n title: string;\r\n value: string | undefined | null;\r\n}) {\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n {props.title}\r\n \r\n \r\n {props.value ?? t(translations.NA)}\r\n \r\n \r\n \r\n );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { selectServiceRequestDetailsFieldState } from '../../RequestSamplesPage/slice/selectors';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\nexport interface IUseServiceRequestStatusUpdateProps {\r\n serviceRequestStatusId: number;\r\n}\r\nexport function useServiceRequestStatusUpdate(\r\n props: IUseServiceRequestStatusUpdateProps,\r\n) {\r\n const { actions } = useRequestSamplesSlice();\r\n const dispatch = useDispatch();\r\n const changeStatus = (value: {\r\n status: IServiceRequestStatusDto;\r\n reason?: string;\r\n }) => {\r\n value !== null &&\r\n dispatch(\r\n actions.updateStatus({\r\n Id: props.serviceRequestStatusId,\r\n Status: value.status,\r\n Reason: value.reason,\r\n }),\r\n );\r\n };\r\n const fieldState = useSelector(state =>\r\n selectServiceRequestDetailsFieldState(state, 'Status'),\r\n );\r\n return { changeStatus, fieldState };\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.InternalServiceRequestStatus\r\n *\r\n */\r\n\r\nexport enum InternalServiceRequestStatus {\r\n Draft = 0,\r\n WaitingForQuote = 1,\r\n QuoteSendToUser = 2,\r\n QuoteApproved = 3,\r\n Completed = 5,\r\n Cancelled = 6,\r\n InProcess = 7,\r\n ReturnedToUser = 8,\r\n Pending = 9,\r\n Started = 10,\r\n Skipped = 11,\r\n}\r\nexport type InternalServiceRequestStatusUnion = keyof typeof InternalServiceRequestStatus;\r\nexport const InternalServiceRequestStatusUnionArray: Array = [\r\n 'Draft',\r\n 'WaitingForQuote',\r\n 'QuoteSendToUser',\r\n 'QuoteApproved',\r\n 'Completed',\r\n 'Cancelled',\r\n 'InProcess',\r\n 'ReturnedToUser',\r\n 'Pending',\r\n 'Started',\r\n 'Skipped',\r\n];\r\n","/**\r\n *\r\n * ServiceRequestSubmissionDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ServiceRequestStatusPicker } from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusPicker';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectRequestDetailsFieldsState } from '../../RequestSamplesPage/slice/selectors';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { EventBudgetPicker } from '../EventBudgetPicker';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRightSection,\r\n FormRow,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ReadonlyField } from '../ReadonlyField';\r\nimport { useServiceRequestStatusUpdate } from '../Utils';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n selectAppSettings,\r\n selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { IRequestDetailsModel } from '../../RequestSamplesPage/slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport {\r\n FundingTypeIdPicker,\r\n getSingleInvoiceFundingType,\r\n} from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { debounce } from 'lodash';\r\nimport { InternalServiceRequestStatus } from 'api/odata/generated/enums/InternalServiceRequestStatus';\r\n\r\nexport interface ServiceRequestSubmissionDetailsProps {\r\n requestDetails: IRequestDetailsModel;\r\n isAdmin: boolean;\r\n isOwner: boolean;\r\n sectionStyles?: React.CSSProperties;\r\n}\r\n\r\nexport function ServiceRequestSubmissionDetails({\r\n requestDetails,\r\n ...props\r\n}: ServiceRequestSubmissionDetailsProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const fieldsState = useSelector(selectRequestDetailsFieldsState);\r\n const { actions } = useRequestSamplesSlice();\r\n const dispatch = useDispatch();\r\n const authUser = useSelector(selectAuthenticatedUser);\r\n const appSettings = useSelector(selectAppSettings);\r\n const globalSettings = useGlobalSettingsHook();\r\n const [poLocal, setPoLocal] = React.useState(\r\n requestDetails.PurchaseOrder,\r\n );\r\n const [internalLocal, setInternalLocal] = React.useState(\r\n requestDetails.ExternalInternalNumber || null,\r\n );\r\n\r\n const showProject = React.useMemo(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n requestDetails.Service.HideProjects === false) ||\r\n !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n );\r\n }, [appSettings, requestDetails.Service.HideProjects]);\r\n const projectFieldVisibleToUser = React.useMemo(() => {\r\n return (\r\n showProject &&\r\n (requestDetails.Service.ProjectIsRequired === null ||\r\n requestDetails.Service.ProjectIsRequired === true\r\n ? true\r\n : props.isAdmin ||\r\n (props.isOwner &&\r\n ![\r\n InternalServiceRequestStatus[InternalServiceRequestStatus.Draft],\r\n InternalServiceRequestStatus[\r\n InternalServiceRequestStatus.ReturnedToUser\r\n ],\r\n InternalServiceRequestStatus[\r\n InternalServiceRequestStatus.Pending\r\n ],\r\n ].includes(requestDetails.Status.InternalStatusId)))\r\n );\r\n }, [\r\n props.isAdmin,\r\n props.isOwner,\r\n requestDetails.Service.ProjectIsRequired,\r\n requestDetails.Status.InternalStatusId,\r\n showProject,\r\n ]);\r\n const projectIsRequired = React.useMemo(() => {\r\n return (\r\n projectFieldVisibleToUser &&\r\n (requestDetails.Service.ProjectIsRequired === null ||\r\n requestDetails.Service.ProjectIsRequired === false)\r\n );\r\n }, [projectFieldVisibleToUser, requestDetails.Service.ProjectIsRequired]);\r\n const fundingTypeVisible = React.useMemo(() => {\r\n return (\r\n IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType) &&\r\n IsBudgetFieldEnabled(appSettings, BudgetFields.PurchaseOrderOption) &&\r\n projectFieldVisibleToUser\r\n );\r\n }, [appSettings, projectFieldVisibleToUser]);\r\n\r\n const purchaseOrderLength = React.useMemo(() => {\r\n return globalSettings.purchaseOrderLengthSetting ?? 0;\r\n }, [globalSettings.purchaseOrderLengthSetting]);\r\n\r\n const purchaseOrderVisible = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n (requestDetails.Budget?.PurchaseOrderOptionId ??\r\n PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden\r\n );\r\n }, [\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n requestDetails.Budget?.PurchaseOrderOptionId,\r\n ]);\r\n const purchaseOrderMandatory = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n requestDetails.Budget?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory\r\n );\r\n }, [\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n requestDetails.Budget?.PurchaseOrderOptionId,\r\n ]);\r\n const purchaseLengthInvalid = React.useMemo(() => {\r\n return (\r\n purchaseOrderVisible &&\r\n (purchaseOrderMandatory ||\r\n (!purchaseOrderMandatory && (poLocal?.length ?? 0) > 0)) &&\r\n (poLocal?.length ?? 0) < purchaseOrderLength\r\n );\r\n }, [\r\n purchaseOrderLength,\r\n purchaseOrderMandatory,\r\n purchaseOrderVisible,\r\n poLocal?.length,\r\n ]);\r\n const purchaseOrderRequired = React.useMemo(() => {\r\n return (\r\n globalSettings.purchaseOrderBudgetEnabled &&\r\n requestDetails.Budget?.PurchaseOrderOptionId ===\r\n PurchaseOrderOptions.Mandatory &&\r\n poLocal === null\r\n );\r\n }, [\r\n globalSettings.purchaseOrderBudgetEnabled,\r\n requestDetails.Budget?.PurchaseOrderOptionId,\r\n poLocal,\r\n ]);\r\n\r\n const excludedQuoteStatuses: Array = [\r\n 'QuoteSendToUser',\r\n 'QuoteApproved',\r\n 'WaitingForQuote',\r\n ];\r\n\r\n useEffectOnMount(() => {\r\n dispatch(actions.init());\r\n });\r\n const {\r\n changeStatus,\r\n fieldState: statusFieldState,\r\n } = useServiceRequestStatusUpdate({\r\n serviceRequestStatusId: requestDetails.Id,\r\n });\r\n const handleBudgetChange = value => {\r\n if (value !== null) {\r\n dispatch(\r\n actions.updateBudget({\r\n Id: requestDetails.Id,\r\n Budget: value,\r\n }),\r\n );\r\n if (\r\n requestDetails.FundingTypeId === null &&\r\n value.FundingTypeId !== null &&\r\n fundingTypeVisible\r\n ) {\r\n dispatch(\r\n actions.patch({\r\n Id: requestDetails.Id,\r\n FundingTypeId: value.FundingTypeId,\r\n }),\r\n );\r\n }\r\n }\r\n };\r\n const handleFundingTypeChange = value => {\r\n value !== null &&\r\n dispatch(\r\n actions.patch({\r\n Id: requestDetails.Id,\r\n FundingTypeId: value.Id,\r\n Budget: undefined,\r\n PurchaseOrder: null,\r\n }),\r\n );\r\n // if (value?.Id !== requestDetails.Budget?.FundingTypeId) {\r\n // //setChosenBudget(null);\r\n // }\r\n };\r\n const handlePurchaseOrderSave = React.useCallback(\r\n value => {\r\n if (\r\n (value?.length ?? 0) === 0 ||\r\n (value?.length ?? 0) >= purchaseOrderLength\r\n ) {\r\n dispatch(\r\n actions.patch({\r\n Id: requestDetails.Id,\r\n PurchaseOrder: value,\r\n }),\r\n );\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n message: `${t(translations.PurchaseOrder)} updated to: ${\r\n value ?? 'null'\r\n }`,\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n },\r\n [actions, dispatch, purchaseOrderLength, requestDetails.Id, t],\r\n );\r\n const debouncedPoChange = React.useMemo(\r\n () => debounce(handlePurchaseOrderSave, 500),\r\n [handlePurchaseOrderSave],\r\n );\r\n const handlePurchaseOrderChange = value => {\r\n setPoLocal(value);\r\n debouncedPoChange(value);\r\n };\r\n\r\n const handleStatusChange = value => {\r\n changeStatus({\r\n status: value,\r\n });\r\n };\r\n const handleExternalInternalNumberSave = React.useCallback(\r\n value => {\r\n dispatch(\r\n actions.patch({\r\n Id: requestDetails.Id,\r\n ExternalInternalNumber: value,\r\n }),\r\n );\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n message: t(translations.ExternalInternalNumberUpdatedTo, {\r\n Name: value as string,\r\n }),\r\n variant: 'success',\r\n }),\r\n );\r\n },\r\n [actions, dispatch, requestDetails.Id, t],\r\n );\r\n const debouncedInterChange = React.useMemo(\r\n () => debounce(handleExternalInternalNumberSave, 500),\r\n [handleExternalInternalNumberSave],\r\n );\r\n const handleExternalInternalNumberChange = value => {\r\n setInternalLocal(value);\r\n debouncedInterChange(value);\r\n };\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.isAdmin ? (\r\n (\r\n 'InternalStatusId',\r\n ODataOperators.Excludes,\r\n excludedQuoteStatuses,\r\n ),\r\n ]\r\n : undefined\r\n }\r\n value={requestDetails.Status}\r\n disabled={statusFieldState?.status === 'pending'}\r\n disableClearable={true}\r\n onChange={handleStatusChange}\r\n fullWidth\r\n variant=\"filled\"\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n {fundingTypeVisible && (\r\n \r\n {props.isAdmin || (props.isOwner && projectFieldVisibleToUser) ? (\r\n {\r\n handleFundingTypeChange(value);\r\n }}\r\n fullWidth\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n {projectFieldVisibleToUser && (\r\n \r\n {props.isAdmin || props.isOwner ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n {purchaseOrderVisible && (\r\n \r\n {props.isAdmin ? (\r\n {\r\n let val = ev.target.value;\r\n handlePurchaseOrderChange(val === '' ? null : val);\r\n }}\r\n value={poLocal ?? ''}\r\n disabled={fieldsState['PurchaseOrder']?.status === 'pending'}\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n {requestDetails.ShowInternalNumber && (\r\n \r\n {props.isAdmin ? (\r\n {\r\n let val = ev.target.value;\r\n handleExternalInternalNumberChange(val === '' ? null : val);\r\n }}\r\n value={internalLocal ?? ''}\r\n disabled={\r\n fieldsState['ExternalInternalNumber']?.status === 'pending'\r\n }\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IRequestDetailsModel } from '../../slice/types';\r\nimport { useFormikContext } from 'formik';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nexport interface ISubmitServiceRequestButtonProps {\r\n serviceRequest?: IRequestDetailsModel;\r\n getRowsErrors?: (hasRowErrors: boolean) => void;\r\n disabled?: boolean;\r\n}\r\nexport function SubmitServiceRequestButton(\r\n props: ISubmitServiceRequestButtonProps,\r\n) {\r\n const { t } = useTranslation();\r\n const { serviceRequest, getRowsErrors } = props;\r\n const formik = useFormikContext();\r\n const submitEnabled = React.useMemo(() => {\r\n return (\r\n serviceRequest?.Status.InternalStatusId === 'Draft' ||\r\n serviceRequest?.Status.InternalStatusId === 'ReturnedToUser'\r\n );\r\n }, [serviceRequest?.Status.InternalStatusId]);\r\n\r\n const handleSubmit = React.useCallback(async () => {\r\n if (!formik.isValid) {\r\n return;\r\n }\r\n if (serviceRequest !== undefined) {\r\n await formik.submitForm();\r\n setOpen(false);\r\n }\r\n }, [formik, serviceRequest]);\r\n\r\n const [open, setOpen] = React.useState(false);\r\n\r\n const title = React.useMemo(() => {\r\n return submitEnabled\r\n ? t(translations.ServiceRequestSubmitButtonTooltip_Enabled)\r\n : t(translations.ServiceRequestSubmitButtonTooltip_Disabled);\r\n }, [submitEnabled, t]);\r\n const handleClick = React.useCallback(async () => {\r\n // TODO: move to the page level into formik submit handler\r\n const x = await formik.validateForm();\r\n const isValid = Object.keys(x).length === 0;\r\n if (isValid) {\r\n setOpen(true);\r\n } else {\r\n if (!!getRowsErrors) {\r\n getRowsErrors(Object.entries(x).some(f => f[0] === 'Rows'));\r\n }\r\n }\r\n }, [formik, getRowsErrors]);\r\n return (\r\n <>\r\n }\r\n disabled={!submitEnabled || props.disabled}\r\n aria-label={t(translations.Submit)}\r\n >\r\n {t(translations.Submit)}\r\n \r\n setOpen(false)}\r\n onConfirm={handleSubmit}\r\n />\r\n \r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\n\r\nexport interface ICancelServiceRequestButtonProps {\r\n serviceRequestId?: number;\r\n}\r\nexport function CancelServiceRequestButton(\r\n props: ICancelServiceRequestButtonProps,\r\n) {\r\n const { t } = useTranslation();\r\n const { actions } = useRequestSamplesSlice();\r\n const dispatch = useDispatch();\r\n const statuses = useSelector(state =>\r\n selectServiceRequestStatusesByInternalId(state, 'Cancelled'),\r\n );\r\n const handleClick = () => {\r\n const status = statuses?.[0];\r\n if (props.serviceRequestId !== undefined && status !== undefined) {\r\n dispatch(\r\n actions.cancelServiceRequest({\r\n Id: props.serviceRequestId,\r\n Status: status,\r\n Reason: 'Canceled',\r\n }),\r\n );\r\n }\r\n };\r\n return (\r\n }\r\n aria-label=\"history\"\r\n onClick={handleClick}\r\n variant=\"white\"\r\n title={t(translations.CancelRequest)}\r\n confirmationDialogBody={t(translations.AreYouSure)}\r\n >\r\n {t(translations.CancelRequest)}\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * ServiceRequestAddons\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useDispatch } from 'react-redux';\r\nimport { CellProps } from 'react-table';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport {\r\n ServiceRequestMilestoneChargeDetailsProps,\r\n ServiceRequestMilestoneChargeType,\r\n} from '../ServiceRequestMilestoneChargeDetails';\r\nimport { showAddonCharge, showManualCharge } from './utils';\r\nimport { RowActionsMenu } from 'app/components/BasicTable/RowActions';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { ColumnWithStrictAccessor } from 'react-table';\r\nimport { IUnitTypeDto } from 'api/odata/generated/entities/IUnitTypeDto';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { InvoiceDetailsSidePanelLink } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Entity } from 'types/common';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\n\r\nexport interface ServiceRequestAddonsProps {\r\n charges: IServiceRequestMilestoneChargeDto[];\r\n milestone?: IServiceRequestMilestoneDto;\r\n isAdmin: boolean;\r\n AddonType: AddonTypesUnion;\r\n InternalStatus: InternalServiceRequestStatusesUnion;\r\n pageName?: string;\r\n tableContainerSyles?: React.CSSProperties;\r\n // indicates if this component is opened through side panel\r\n printing?: Printing;\r\n useSidePanel: boolean;\r\n UnitType?: Entity;\r\n}\r\n\r\nexport function ServiceRequestAddons(props: ServiceRequestAddonsProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const columns: Array> = React.useMemo(\r\n () => [\r\n { Header: 'Id', accessor: 'Id' },\r\n {\r\n Header: t(translations.Date) as string,\r\n accessor: 'Date',\r\n\r\n Cell: DateRenderer,\r\n },\r\n {\r\n Header: t(translations.ServiceOrCharge) as string,\r\n accessor: 'Service',\r\n Cell: ({\r\n value,\r\n row,\r\n }: CellProps<\r\n IServiceRequestMilestoneChargeDto,\r\n IConsumableServiceDto\r\n >) => value?.Name ?? row.original.Name ?? t(translations.NA),\r\n },\r\n { Header: t(translations.Quantity) as string, accessor: 'Quantity' },\r\n {\r\n Header: t(translations.Unit) as string,\r\n accessor: 'UnitType',\r\n Cell: ({\r\n value,\r\n row,\r\n }: CellProps) =>\r\n (value ?? row.original.Service?.UnitType)?.Name ?? t(translations.NA),\r\n },\r\n {\r\n Header: t(translations.Rate) as string,\r\n accessor: 'Rate',\r\n Cell: ({ value, row }) => {\r\n return (\r\n <>\r\n {roundTwoPlacesAfterDecimalPoint(\r\n value ?? row.original.Service?.Rate,\r\n )}\r\n \r\n );\r\n },\r\n },\r\n {\r\n Header: t(translations.Amount) as string,\r\n accessor: 'Amount',\r\n Cell: ({ value }) => {\r\n return <>{roundTwoPlacesAfterDecimalPoint(value)};\r\n },\r\n },\r\n {\r\n Header: t(translations.InvoiceId) as string,\r\n accessor: 'InvoiceId',\r\n Cell: ({ value, row }) =>\r\n value !== null && value !== undefined && typeof value === 'number' ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n ),\r\n },\r\n {\r\n Header: t(translations.Remarks) as string,\r\n accessor: 'Remarks',\r\n Cell: DescriptionCell({ width: 'medium' }),\r\n },\r\n {\r\n Header: t(translations.UpdatedBy) as string,\r\n accessor: 'UpdatedBy',\r\n Cell: ({\r\n value,\r\n }: CellProps) =>\r\n value?.Name ?? t(translations.NA),\r\n },\r\n ],\r\n [props.useSidePanel, t],\r\n );\r\n\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n\r\n const show_newAddonCharge = React.useMemo(() => {\r\n const result = showAddonCharge({\r\n Charged: props.milestone?.Charged,\r\n isAdmin: props.isAdmin,\r\n ServiceRequestAddonTypes: props.AddonType,\r\n ServiceRequestInternalStatus: props.InternalStatus,\r\n });\r\n return result;\r\n }, [\r\n props.AddonType,\r\n props.InternalStatus,\r\n props.isAdmin,\r\n props.milestone?.Charged,\r\n ]);\r\n\r\n const show_newManualCharge = React.useMemo(() => {\r\n const result = showManualCharge({\r\n Charged: props.milestone?.Charged,\r\n isAdmin: props.isAdmin,\r\n ServiceRequestAddonTypes: props.AddonType,\r\n ServiceRequestInternalStatus: props.InternalStatus,\r\n });\r\n return result;\r\n }, [\r\n props.AddonType,\r\n props.InternalStatus,\r\n props.isAdmin,\r\n props.milestone?.Charged,\r\n ]);\r\n const handleAddServiceClick = React.useCallback(() => {\r\n if (props.milestone === undefined) {\r\n return;\r\n }\r\n const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n serviceRequestId: props.milestone?.ServiceRequestId,\r\n serviceRequestMilestoneId: props.milestone.Id,\r\n type: 'service',\r\n enableAddonCharge: show_newAddonCharge,\r\n enableManualCharge: show_newManualCharge,\r\n };\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ServiceRequestMilestoneCharge,\r\n props: payload,\r\n }),\r\n );\r\n }, [\r\n actions,\r\n dispatch,\r\n props.milestone,\r\n show_newAddonCharge,\r\n show_newManualCharge,\r\n ]);\r\n const handleAddChargeClick = React.useCallback(() => {\r\n if (props.milestone === undefined) {\r\n return;\r\n }\r\n const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n serviceRequestId: props.milestone?.ServiceRequestId,\r\n serviceRequestMilestoneId: props.milestone.Id,\r\n type: 'charge',\r\n enableAddonCharge: show_newAddonCharge,\r\n enableManualCharge: show_newManualCharge,\r\n unitType: props.UnitType,\r\n };\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ServiceRequestMilestoneCharge,\r\n props: payload,\r\n }),\r\n );\r\n }, [\r\n actions,\r\n dispatch,\r\n props.UnitType,\r\n props.milestone,\r\n show_newAddonCharge,\r\n show_newManualCharge,\r\n ]);\r\n\r\n const handleEditClick = React.useCallback(\r\n (value: IServiceRequestMilestoneChargeDto) => {\r\n if (props.milestone === undefined) {\r\n return;\r\n }\r\n const type: ServiceRequestMilestoneChargeType =\r\n value.OfflineServiceTypeId === null ? 'charge' : 'service';\r\n const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n serviceRequestId: props.milestone?.ServiceRequestId,\r\n serviceRequestMilestoneId: props.milestone.Id,\r\n type: type,\r\n enableAddonCharge: show_newAddonCharge,\r\n enableManualCharge: show_newManualCharge,\r\n value: value,\r\n };\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ServiceRequestMilestoneCharge,\r\n props: payload,\r\n }),\r\n );\r\n },\r\n [\r\n actions,\r\n dispatch,\r\n props.milestone,\r\n show_newAddonCharge,\r\n show_newManualCharge,\r\n ],\r\n );\r\n\r\n const handleDeleteClick = React.useCallback(\r\n (value: IServiceRequestMilestoneChargeDto) => {\r\n dispatch(actions.deleteMilestoneCharge(value));\r\n },\r\n [actions, dispatch],\r\n );\r\n const rowActions = React.useMemo(() => {\r\n if (show_newAddonCharge) {\r\n return [\r\n ({ value, row, updateMyData }) =>\r\n show_newAddonCharge && (\r\n Promise.resolve(handleEditClick(row.original)),\r\n },\r\n {\r\n icon: 'times',\r\n text: t(translations.Delete),\r\n title: t(translations.Delete),\r\n onClick: () =>\r\n Promise.resolve(handleDeleteClick(row.original)),\r\n },\r\n ]}\r\n />\r\n ),\r\n ];\r\n }\r\n }, [handleDeleteClick, handleEditClick, show_newAddonCharge, t]);\r\n const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n const result: PageActionRenderer[] = [];\r\n if (show_newManualCharge) {\r\n result.push(() => (\r\n \r\n ));\r\n }\r\n if (show_newAddonCharge) {\r\n result.push(() => (\r\n \r\n ));\r\n }\r\n return result;\r\n }, [\r\n handleAddChargeClick,\r\n handleAddServiceClick,\r\n show_newAddonCharge,\r\n show_newManualCharge,\r\n t,\r\n ]);\r\n return (\r\n <>\r\n \r\n columns={columns as Array>}\r\n //withToolBar={false}\r\n data={props.charges ?? []}\r\n useRowSelect={false}\r\n hideMenuOnMobile={true}\r\n screenName={props.pageName ?? t(translations.AddOnServices)}\r\n useGlobalFilter={false}\r\n api={'foo'}\r\n customEmptyTableSettings={{\r\n headTitle: t(translations.dash_EmptyWidgetTitle),\r\n title:\r\n show_newAddonCharge || show_newManualCharge\r\n ? t(translations.AddonCharges_Empty_AddEnabled)\r\n : undefined,\r\n }}\r\n manualPagination={false}\r\n manualSorting={false}\r\n compactTable={false}\r\n enablePagination={false}\r\n compact={isMobile}\r\n screenNameVariant=\"section\"\r\n dataLength={props.charges?.length ?? 0}\r\n loading={props.charges === undefined}\r\n onChangeState={() => void 0}\r\n onExport={() => Promise.resolve()}\r\n useExport={false}\r\n pageCount={123}\r\n initialPageSize={1000}\r\n serviceGroups={[]}\r\n rowActions={rowActions}\r\n pageActions={pageActions}\r\n tableContainerSyles={props.tableContainerSyles}\r\n printing={props.printing}\r\n />\r\n \r\n );\r\n}\r\n// const Container = styled(Box)(({ theme }) => ({\r\n// // margin is needed here to replace the containing cell padding because of a disappearing border there\r\n// margin: theme.spacing(2),\r\n// }));\r\n// const ButtonsContainer = styled(Box)(({ theme }) => ({\r\n// display: 'flex',\r\n// gap: theme.spacing(1),\r\n// marginTop: theme.spacing(1),\r\n// }));\r\n","import { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport interface showAddonChargeProps {\r\n ServiceRequestInternalStatus: InternalServiceRequestStatusesUnion;\r\n Charged?: boolean;\r\n ServiceRequestAddonTypes: AddonTypesUnion;\r\n isAdmin: boolean;\r\n}\r\nexport function showAddonCharge(props: showAddonChargeProps) {\r\n if (props.Charged === true) {\r\n return false;\r\n }\r\n if (props.ServiceRequestInternalStatus === 'Completed') {\r\n return false;\r\n }\r\n\r\n if (!props.isAdmin) {\r\n const userEditableStatuses: Array = [\r\n 'Draft',\r\n 'ReturnedToUser',\r\n ];\r\n if (!userEditableStatuses.includes(props.ServiceRequestInternalStatus)) {\r\n return false;\r\n }\r\n }\r\n\r\n switch (props.ServiceRequestAddonTypes) {\r\n case 'Addons':\r\n case 'Milestones':\r\n return props.isAdmin;\r\n case 'UserAddons':\r\n return true;\r\n case 'NA':\r\n return false;\r\n default:\r\n assertExhaustive(props.ServiceRequestAddonTypes);\r\n }\r\n}\r\n\r\nexport function showManualCharge(props: showAddonChargeProps) {\r\n if (props.ServiceRequestAddonTypes === 'Milestones') {\r\n return !props.Charged && props.isAdmin;\r\n } else {\r\n return false;\r\n }\r\n}\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n Chip,\r\n ChipProps,\r\n Menu,\r\n MenuItem,\r\n Theme,\r\n makeStyles,\r\n} from '@material-ui/core';\r\nimport {\r\n ServiceRequestMilestoneStatusesUnionArray,\r\n ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { TypeColor, getColor } from 'styles/colors/types';\r\n\r\nexport interface ServiceRequestMilestoneStatusMenuPickerProps {\r\n name?: string;\r\n value: ServiceRequestMilestoneStatusesUnion;\r\n onChange: (value: ServiceRequestMilestoneStatusesUnion) => void;\r\n}\r\nexport function ServiceRequestMilestoneStatusMenuPicker({\r\n onChange,\r\n ...props\r\n}: ServiceRequestMilestoneStatusMenuPickerProps) {\r\n const { t } = useTranslation();\r\n\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const handleChipClick = event => {\r\n console.debug(event);\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n const getChipColor = (\r\n status: ServiceRequestMilestoneStatusesUnion,\r\n ): TypeColor => {\r\n switch (status) {\r\n case 'Completed':\r\n return 'success';\r\n case 'NotStarted':\r\n return 'default';\r\n case 'Started':\r\n return 'info';\r\n }\r\n };\r\n const handleMenuItemClick = (\r\n status: ServiceRequestMilestoneStatusesUnion,\r\n ) => {\r\n onChange(status);\r\n handleClose();\r\n };\r\n return (\r\n <>\r\n \r\n \r\n {ServiceRequestMilestoneStatusesUnionArray.map(status => (\r\n handleMenuItemClick(status)}>\r\n {t(status) ?? status}\r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\nconst StyledChip = ({\r\n color,\r\n ...props\r\n}: Omit & { color: TypeColor }) => {\r\n const classes = useStyles({ color: color });\r\n return ;\r\n};\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n backgroundColor: props => getColor(theme, props.color, 'light'),\r\n color: props => getColor(theme, props.color, 'dark'),\r\n '&:hover, &:focus': {\r\n backgroundColor: props => getColor(theme, props.color, 'bgHover'),\r\n color: props => getColor(theme, props.color, 'textHover'),\r\n },\r\n },\r\n}));\r\n","/**\r\n *\r\n * ServiceRequestMilestones\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport {\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableHead,\r\n TableRow,\r\n makeStyles,\r\n styled,\r\n TableContainer,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport produce from 'immer';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ServiceRequestMilestoneDetailsProps } from '../ServiceRequestMilestoneDetails';\r\nimport { RowActionsMenu } from 'app/components/BasicTable/RowActions';\r\nimport { InvoiceDetailsSidePanelLink } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { sum } from 'lodash';\r\nimport { ServiceRequestAddons } from '../ServiceRequestAddons';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { TruncatedDescriptionText } from 'app/components/Description';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { ServiceRequestMilestoneStatusMenuPicker } from 'app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusMenuPicker';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport clsx from 'clsx';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceRequestMilestonesProps {\r\n milestones?: Array;\r\n isAdmin: boolean;\r\n AddonType: AddonTypesUnion;\r\n InternalStatus: InternalServiceRequestStatusesUnion;\r\n ServiceRequestId: number;\r\n pageName?: string;\r\n tableContainerSyles?: React.CSSProperties;\r\n // indicates if this component is opened through side panel\r\n printing?: Printing;\r\n useSidePanel: boolean;\r\n UnitType?: Entity;\r\n}\r\n\r\ninterface IState {\r\n expanded: Record;\r\n}\r\n\r\nexport function ServiceRequestMilestones({\r\n milestones,\r\n pageName,\r\n tableContainerSyles,\r\n useSidePanel,\r\n ...props\r\n}: ServiceRequestMilestonesProps) {\r\n const { t } = useTranslation();\r\n const classes = useStyles();\r\n const [state, , extendState] = useAsyncExtendedState({\r\n expanded: {},\r\n });\r\n const { checkIsMobile } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const handleToggleClick = (id: number, expand: boolean) => {\r\n extendState(state => {\r\n const n = produce(expanded => {\r\n expanded[id] = expand;\r\n })(state.expanded);\r\n\r\n return { expanded: n };\r\n });\r\n };\r\n const handleAddMilestoneClick = React.useCallback(() => {\r\n const sidePanelProps: ServiceRequestMilestoneDetailsProps = {\r\n serviceRequestId: props.ServiceRequestId,\r\n type: 'Insert',\r\n };\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ServiceRequestMilestone,\r\n props: sidePanelProps,\r\n }),\r\n );\r\n }, [actions, dispatch, props.ServiceRequestId]);\r\n\r\n const handleEditClick = React.useCallback(\r\n (milestone: IServiceRequestMilestoneDto) => {\r\n const sidePanelProps: ServiceRequestMilestoneDetailsProps = {\r\n serviceRequestId: props.ServiceRequestId,\r\n type: 'Update',\r\n value: milestone,\r\n };\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.ServiceRequestMilestone,\r\n props: sidePanelProps,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, props.ServiceRequestId],\r\n );\r\n const handleDeleteClick = React.useCallback(\r\n (milestone: IServiceRequestMilestoneDto) => {\r\n dispatch(actions.deleteMilestone(milestone));\r\n },\r\n [actions, dispatch],\r\n );\r\n const columnsCount = 9;\r\n const showActionsColumn =\r\n props.isAdmin &&\r\n milestones?.some(milestone => (milestone.InvoiceId ?? 0) === 0);\r\n const colSpan = columnsCount + (showActionsColumn ? 1 : 0);\r\n const handleStatusChange = (\r\n milestone: IServiceRequestMilestoneDto,\r\n value: ServiceRequestMilestoneStatusesUnion | null,\r\n ) => {\r\n if (value !== null) {\r\n dispatch(\r\n actions.updateMilestone({\r\n ...milestone,\r\n ...{ Status: value },\r\n }),\r\n );\r\n }\r\n };\r\n const print = React.useMemo(() => {\r\n return props.printing !== undefined && props.printing.printing === true;\r\n }, [props.printing]);\r\n return (\r\n \r\n \r\n {milestones?.length} {t(translations.Records)}\r\n \r\n }\r\n >\r\n {print === false ? (\r\n <>\r\n {props.isAdmin && (\r\n \r\n \r\n \r\n )}\r\n \r\n ) : (\r\n <>\r\n )}\r\n {<>}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(translations.Milestone)}\r\n \r\n \r\n {t(translations.TargetDate)}\r\n \r\n {t(translations.Total)}\r\n \r\n {t(translations.AssignedTo)}\r\n \r\n \r\n {t(translations.CompletionDate)}\r\n \r\n \r\n {t(translations.Description)}\r\n \r\n \r\n {t(translations.InvoiceId)}\r\n \r\n {t(translations.Status)}\r\n {showActionsColumn && }\r\n \r\n \r\n \r\n {milestones?.map(milestone => {\r\n const isExpanded = state.expanded[milestone.Id] === true;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n handleToggleClick(milestone.Id, !isExpanded)\r\n }\r\n >\r\n \r\n \r\n \r\n {milestone.Name}\r\n \r\n {dateUtils.shortDateFormat(milestone.TargetDate)}\r\n \r\n \r\n {roundTwoPlacesAfterDecimalPoint(\r\n sum(\r\n milestone.ServiceRequestMilestoneCharges.map(\r\n f => f.Amount ?? 0,\r\n ),\r\n ),\r\n )}\r\n \r\n \r\n {milestone.Assignees?.map(f => f.Name)?.join(', ')}\r\n \r\n \r\n {dateUtils.shortDateFormat(milestone.CompletionDate)}\r\n \r\n \r\n \r\n \r\n \r\n {milestone.InvoiceId !== null && (\r\n \r\n {milestone.InvoiceId}\r\n \r\n )}\r\n \r\n \r\n {milestone.Status !== null &&\r\n (props.isAdmin && milestone.InvoiceId === null ? (\r\n \r\n handleStatusChange(milestone, value)\r\n }\r\n />\r\n ) : (\r\n t(milestone.Status)\r\n ))}\r\n \r\n\r\n {showActionsColumn && (\r\n \r\n {milestone.InvoiceId === null && (\r\n \r\n Promise.resolve(handleEditClick(milestone)),\r\n },\r\n {\r\n icon: 'times',\r\n text: t(translations.Delete),\r\n title: t(translations.Delete),\r\n onClick: () =>\r\n Promise.resolve(\r\n handleDeleteClick(milestone),\r\n ),\r\n },\r\n ]}\r\n />\r\n )}\r\n \r\n )}\r\n \r\n {isExpanded && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n })}\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n );\r\n}\r\nconst ServicesRow = styled(TableCell)(({ theme }) => ({\r\n // setting the background color on the cell causes it's borders to disappear\r\n backgroundColor: theme.palette.background.default,\r\n backgroundClip: 'content-box',\r\n // unsets 56px cell height set on TableCell\r\n height: 'unset',\r\n padding: '1px',\r\n}));\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n table: {\r\n backgroundColor: theme.palette.background.paper,\r\n width: '100%',\r\n whiteSpace: 'pre',\r\n },\r\n tableContent: {\r\n padding: theme.spacing(0, 4, 4),\r\n },\r\n tableContentShort: {\r\n padding: theme.spacing(0, 2),\r\n },\r\n tableScrolling: {\r\n width: '100%',\r\n overflow: 'auto',\r\n '&::-webkit-scrollbar': {\r\n height: '6px',\r\n },\r\n '&::-webkit-scrollbar-thumb': {\r\n boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n borderRadius: '6px',\r\n backgroundColor: theme.palette.common.grayBorders,\r\n },\r\n },\r\n}));\r\n\r\n// interface ToolbarProps {\r\n// left?: React.ReactNode;\r\n// right?: React.ReactNode;\r\n// }\r\n\r\n// function Toolbar(props: ToolbarProps) {\r\n// return (\r\n// \r\n// {props.left}\r\n// {props.right}\r\n// \r\n// );\r\n// }\r\n// const Container = styled(Box)(({ theme }) => ({\r\n// margin: theme.spacing(1),\r\n// display: 'flex',\r\n// justifyContent: 'space-between',\r\n// alignItems: 'center',\r\n// }));\r\n","import * as React from 'react';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { ServiceRequestMilestones } from '../ServiceRequestMilestones';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectServiceRequestMilestones } from '../../RequestSamplesPage/slice/selectors';\r\nimport { ServiceRequestAddons } from '../ServiceRequestAddons';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { TableRowsSkeleton } from 'app/components/BasicTable/components/TableSkeleton';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceRequestMilestonesSectionProps {\r\n AddonType: AddonTypesUnion;\r\n ServiceRequestId: number;\r\n isAdmin: boolean;\r\n InternalStatus: InternalServiceRequestStatusesUnion;\r\n pageName?: string;\r\n tableContainerStyles?: React.CSSProperties;\r\n // indicates if this component is opened through side panel\r\n printing?: Printing;\r\n useSidePanel: boolean;\r\n UnitType?: Entity;\r\n}\r\n\r\nexport function ServiceRequestMilestonesSection(\r\n props: ServiceRequestMilestonesSectionProps,\r\n) {\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n React.useEffect(() => {\r\n dispatch(actions.loadMilestones({ Id: props.ServiceRequestId }));\r\n }, [actions, dispatch, props.ServiceRequestId]);\r\n const milestones = useSelector(selectServiceRequestMilestones);\r\n const data = React.useMemo(() => {\r\n switch (props.AddonType) {\r\n case 'Milestones':\r\n return milestones;\r\n case 'Addons':\r\n case 'UserAddons':\r\n return milestones?.flatMap(f => f.ServiceRequestMilestoneCharges);\r\n case 'NA':\r\n return undefined;\r\n default:\r\n assertExhaustive(props.AddonType);\r\n }\r\n }, [milestones, props.AddonType]);\r\n\r\n const print = React.useMemo(() => {\r\n return props.printing !== undefined && props.printing.printing === true;\r\n }, [props.printing]);\r\n React.useEffect(() => {\r\n if (\r\n props.printing !== undefined &&\r\n print &&\r\n props.printing.onLoading !== undefined\r\n ) {\r\n props.printing.onLoading(props.printing.id, milestones === undefined);\r\n }\r\n }, [milestones, print, props.printing]);\r\n\r\n if (milestones === undefined) {\r\n return ;\r\n }\r\n\r\n switch (props.AddonType) {\r\n case 'Milestones':\r\n return (\r\n \r\n );\r\n case 'Addons':\r\n case 'UserAddons':\r\n return (\r\n \r\n );\r\n case 'NA':\r\n return <>Milestones are disabled for this service;\r\n default:\r\n assertExhaustive(props.AddonType);\r\n }\r\n}\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface CloneServiceRequestButtonProps {\r\n item?: Identifiable;\r\n}\r\nexport function CloneServiceRequestButton(\r\n props: CloneServiceRequestButtonProps,\r\n) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n\r\n const handleCloneButtonClick = React.useCallback(() => {\r\n if (props.item !== undefined) {\r\n dispatch(actions.cloneServiceRequest(props.item.Id));\r\n }\r\n }, [actions, dispatch, props.item]);\r\n\r\n if (props.item === undefined) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n selectServiceRequestCustomFormColumns,\r\n selectServiceRequestRowInsertStatus,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport {\r\n IServiceRequestRelated,\r\n IServiceRequestTableFormComponent,\r\n} from '../..';\r\nimport {\r\n prepareServiceRequestRowModel,\r\n serviceRequestModelToDto,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/prepareServiceRequestRowModel';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceRequestTableRowModel } from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { ArrayHelpers } from 'formik';\r\nimport { omit } from 'lodash';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { ServiceRequestTableColumnsCollection } from 'app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\n\r\nexport interface AddServiceRequestRowButtonProps\r\n extends IServiceRequestTableFormComponent,\r\n IServiceRequestRelated {\r\n /**\r\n * Should be connected to service request's edit-ability state\r\n */\r\n disabled: boolean;\r\n}\r\nexport function AddServiceRequestRowButton({\r\n serviceRequestId,\r\n ...props\r\n}: AddServiceRequestRowButtonProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const processing = useSelector(selectServiceRequestRowInsertStatus);\r\n const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n const handleCreateButtonClick: React.MouseEventHandler = React.useCallback(\r\n async e => {\r\n if (serviceRequestId === undefined) {\r\n return;\r\n }\r\n if (columns === null) {\r\n return;\r\n }\r\n try {\r\n await AddNewCustomTableRow({\r\n index: 0,\r\n serviceRequestId,\r\n columns,\r\n model: {\r\n ServiceRequestId: serviceRequestId,\r\n },\r\n arrayHelpers: props.arrayHelpers,\r\n });\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: t(translations.ServiceRequestRow_InsertSuccess),\r\n }),\r\n );\r\n } catch (error) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: t(translations.ServiceRequestRow_InsertError),\r\n }),\r\n );\r\n }\r\n },\r\n [columns, dispatch, props.arrayHelpers, serviceRequestId, t],\r\n );\r\n\r\n return (\r\n \r\n );\r\n}\r\nexport async function AddNewCustomTableRow(props: {\r\n serviceRequestId: number;\r\n columns: ServiceRequestTableColumnsCollection;\r\n arrayHelpers: ArrayHelpers;\r\n model: Partial;\r\n index: number | undefined;\r\n}) {\r\n const url = `api/odata/v4/ServiceRequests(${props.serviceRequestId})/Rows`;\r\n const dto = serviceRequestModelToDto(props.model, props.columns);\r\n const response: IServiceRequestRowDto = await httpClient.post(\r\n url,\r\n omit(dto, '@odata.context'),\r\n {\r\n params: { $expand: 'Status' },\r\n },\r\n );\r\n const models = prepareServiceRequestRowModel([response], props.columns);\r\n models.forEach(item => {\r\n props.arrayHelpers.insert(props.index ?? 0, item);\r\n });\r\n}\r\n","import { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport * as React from 'react';\r\nimport {\r\n EditorProps,\r\n EditableCellProps,\r\n} from '../../EditableTable/EditableCell/index';\r\nimport { FastFieldProps, getIn } from 'formik';\r\nimport {\r\n CustomFormColumnTypes,\r\n IServiceRequestTableRowModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { Column } from 'react-table';\r\nimport { ServiceRequestTableColumn } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\n/**\r\n * Custom function passed through react-table for updating row values\r\n */\r\nexport type UpdateServiceRequestRowValue = (props: {\r\n serviceRequestRowId: number;\r\n columnId: number;\r\n value: TValue;\r\n}) => void;\r\n\r\nexport interface IServiceRequestRowEditableCellProps\r\n extends EditableCellProps<\r\n IServiceRequestRowValueDto,\r\n Column,\r\n IServiceRequestRowDto\r\n > {\r\n fieldProps: FastFieldProps;\r\n}\r\nexport function ServiceRequestRowEditableCell(\r\n WrappedComponent: React.FunctionComponent>,\r\n props: {\r\n column: ServiceRequestTableColumn;\r\n focused?: boolean;\r\n },\r\n) {\r\n return React.memo(function Comp({\r\n value: initialValue,\r\n row,\r\n column,\r\n updateMyData, // This is a custom function that we supplied to our table instance\r\n fieldProps,\r\n }: IServiceRequestRowEditableCellProps) {\r\n const name = fieldProps?.field.name;\r\n const handleBlur = event => {\r\n event.target.name = name;\r\n fieldProps?.field.onBlur(event);\r\n };\r\n\r\n /**\r\n * debounced handleChange intended to reduce the number of rerenders & http requests in text based fields.\r\n */\r\n const { value, handleChange } = useDebounce({\r\n value: fieldProps.field.value,\r\n timeout: getDebounceValue(props.column.ColumnType),\r\n handleChange: value => {\r\n try {\r\n // updates form value\r\n fieldProps?.field.onChange({\r\n target: { value: value, name },\r\n });\r\n\r\n // clear child columns values (connected dropdowns)\r\n props.column.Children?.forEach(childColumn => {\r\n fieldProps?.form.setFieldValue(\r\n getServiceRequestRowFieldName(\r\n row.index,\r\n childColumn.getFieldName(),\r\n ),\r\n null,\r\n );\r\n });\r\n\r\n // persists data on the server\r\n updateMyData({\r\n columnId: props.column.Id,\r\n value: value,\r\n serviceRequestRowId: row.original.Id,\r\n });\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n },\r\n });\r\n\r\n /**\r\n * after arrayHelpers.insert, the new row gets inserted with null as the validation error on the whole row\r\n * e.g. formik.errors become (notice null as the first element in the array)\r\n * {\r\n \"friends\": [\r\n null,\r\n {\r\n \"Values\": {\r\n \"column_1006\": \"Positive Decimal must be greater than or equal to 0\",\r\n \"column_1008\": \"Email must be a valid email\"\r\n }\r\n }\r\n ]\r\n }\r\n */\r\n const hasError = !isNullOrUndefined(fieldProps?.meta?.error);\r\n\r\n /**\r\n * parent value - extracted from the current row according to column configuration. used for connected drop downs.\r\n */\r\n const parentValue =\r\n props.column.Parent === null\r\n ? undefined\r\n : getIn(\r\n fieldProps?.form.values,\r\n getServiceRequestRowFieldName(\r\n row.index,\r\n props.column.Parent.getFieldName(),\r\n ),\r\n ) ?? undefined;\r\n return (\r\n <>\r\n \r\n \r\n );\r\n });\r\n}\r\nexport function getServiceRequestRowName(\r\n rowIndex: number,\r\n key: keyof IServiceRequestTableRowModel,\r\n) {\r\n return `Rows[${rowIndex}]${key}`;\r\n}\r\nexport function getServiceRequestRowFieldName(\r\n rowIndex: number,\r\n columnFieldName: string,\r\n) {\r\n return `${getServiceRequestRowName(rowIndex, 'Values')}[${columnFieldName}]`;\r\n}\r\n\r\nfunction getDebounceValue(columnType: CustomFormColumnTypes) {\r\n switch (columnType) {\r\n case 'CheckBox':\r\n case 'Date':\r\n case 'DropDownList':\r\n case 'UserSelection':\r\n case 'Serial':\r\n return;\r\n case 'Email':\r\n case 'Number':\r\n case 'PositiveDecimal':\r\n case 'PositiveInteger':\r\n case 'ShortText':\r\n return 100;\r\n default:\r\n assertExhaustive(columnType);\r\n }\r\n}\r\n\r\ninterface useDebounceProps {\r\n value: any;\r\n handleChange: (value: any) => void;\r\n timeout?: number;\r\n}\r\nfunction useDebounce(props: useDebounceProps) {\r\n // tracks inner state in between the debounced updates\r\n const [innerValue, setInnerValue] = React.useState(props.value);\r\n\r\n // sync value changes from the outside of current field\r\n React.useEffect(() => {\r\n setInnerValue(props.value);\r\n }, [props.value]);\r\n\r\n // active timeout tracker\r\n const timeout = React.useRef();\r\n\r\n if (props.timeout === undefined || props.timeout <= 0) {\r\n return props;\r\n }\r\n\r\n return {\r\n value: innerValue,\r\n handleChange: value => {\r\n setInnerValue(value);\r\n if (timeout.current !== undefined) {\r\n clearTimeout(timeout.current);\r\n }\r\n\r\n timeout.current = setTimeout(() => {\r\n props.handleChange(value);\r\n timeout.current = undefined;\r\n }, props.timeout);\r\n },\r\n };\r\n}\r\n","import * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { EditorProps } from '../../EditableCell';\r\nimport { Autocomplete, AutocompleteProps, Value } from '@material-ui/lab';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { InputAdornment } from '@material-ui/core';\r\nimport { omit } from 'lodash';\r\n\r\n// 'DropDownList':\r\nexport interface IWithOptions> {\r\n options: TEntity[];\r\n}\r\nexport interface DropDownListProps>\r\n extends Omit, 'value'>,\r\n IWithOptions {\r\n value: EditorProps['value'] | null;\r\n}\r\n\r\n/**\r\n * Injects options into options prop of a component e.g DropDownList above\r\n * @param Component component that accepts options array\r\n * @param options options\r\n * @returns\r\n */\r\nexport function withOptions, TProps>(\r\n Component: React.FC>,\r\n options: IWithOptions['options'],\r\n): React.FC {\r\n const WithOptionsComponent = (props: TProps) => {\r\n return ;\r\n };\r\n\r\n return WithOptionsComponent;\r\n}\r\n\r\nexport interface SRSelectProps<\r\n TKey,\r\n T extends Entity,\r\n Multiple extends boolean | undefined\r\n> extends Omit<\r\n AutocompleteProps,\r\n | 'onChange'\r\n | 'getOptionLabel'\r\n | 'getOptionSelected'\r\n | 'filterOptions'\r\n | 'renderInput'\r\n | 'options'\r\n >,\r\n IWithOptions {\r\n onChange: (value: Value) => void;\r\n parentValue?: any;\r\n error?: boolean;\r\n helperText?: string;\r\n info?: string;\r\n autoFocus?: boolean;\r\n}\r\n\r\nexport function SRSelect<\r\n TKey,\r\n T extends Entity,\r\n Multiple extends boolean | undefined\r\n>({\r\n parentValue,\r\n onChange,\r\n error,\r\n helperText,\r\n info,\r\n autoFocus,\r\n ...props\r\n}: SRSelectProps) {\r\n return (\r\n <>\r\n {\r\n onChange?.(value);\r\n }}\r\n value={props.value ?? undefined}\r\n getOptionLabel={option => option.Name}\r\n className=\"atable\"\r\n getOptionSelected={(a, b) => a?.Id === b?.Id}\r\n size=\"small\"\r\n renderInput={params => (\r\n \r\n {params.InputProps.endAdornment}\r\n {((!!info && info !== '') || (error && !!helperText)) && (\r\n \r\n {!!info && info !== '' && (\r\n \r\n )}\r\n {error && (\r\n \r\n )}\r\n \r\n )}\r\n \r\n ),\r\n\r\n ...omit(params.InputProps, 'endAdornment'),\r\n }}\r\n variant=\"standard\"\r\n error={error}\r\n />\r\n )}\r\n {...props}\r\n />\r\n \r\n );\r\n}\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getGetUserSelectionsAutocompleteFn } from 'app/components/CustomForm/CustomFormFields/CustomFormUserSelection';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IWithOptions, SRSelectProps } from './index';\r\nimport { useAsyncOptions } from './useAsyncOptions';\r\n\r\n/**\r\n * Injects async options into options prop of a component e.g DropDownList above\r\n * @param Component component that accepts options array\r\n * @param options options\r\n * @returns\r\n */\r\nexport function withAsyncOptions<\r\n TKey,\r\n TEntity extends Entity,\r\n TMultiple extends boolean | undefined,\r\n TProps extends SRSelectProps\r\n>(\r\n Component: React.FC>,\r\n hocProps: {\r\n multiple: TMultiple;\r\n } & Pick,\r\n): React.FC {\r\n const WithOptionsComponent = ({ ...props }: TProps) => {\r\n const fetchOptionsCallback = React.useCallback(async search => {\r\n const fn = getGetUserSelectionsAutocompleteFn({\r\n CustomRoles: hocProps.CustomRoles,\r\n FixedRoles: hocProps.FixedRoles,\r\n UserSelectionType: hocProps.UserSelectionType,\r\n });\r\n const options = await fn(search);\r\n return options;\r\n }, []);\r\n const asyncOptionProps = useAsyncOptions>({\r\n fetchOptions: fetchOptionsCallback,\r\n });\r\n return (\r\n \r\n );\r\n };\r\n\r\n return WithOptionsComponent;\r\n}\r\n","import * as React from 'react';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { debounce } from 'lodash';\r\n\r\nexport interface useAsyncOptionsProps {\r\n fetchOptions: (search: string) => Promise>;\r\n}\r\n\r\nexport interface IState {\r\n async: boolean;\r\n options: TOption[];\r\n open: boolean;\r\n search: string | null;\r\n}\r\n\r\nexport function useAsyncOptions(\r\n options: useAsyncOptionsProps,\r\n) {\r\n const [state, , extendState] = useAsyncExtendedState>({\r\n search: null,\r\n async: !Array.isArray(options),\r\n options: Array.isArray(options) ? options : [],\r\n open: false,\r\n });\r\n\r\n const optionsPromise = React.useCallback(\r\n async search => {\r\n if (Array.isArray(options)) {\r\n return { options: options };\r\n } else {\r\n const response = await options.fetchOptions(search);\r\n return { options: response };\r\n }\r\n },\r\n [options],\r\n );\r\n const [promiseState, fetch] = usePromise(optionsPromise);\r\n\r\n const debounced = React.useMemo(() => {\r\n //debounced?.cancel();\r\n return debounce(\r\n e => {\r\n console.debug('foo zz');\r\n extendState(fetch(e.target.value));\r\n },\r\n 250,\r\n {\r\n trailing: true,\r\n maxWait: 2500,\r\n },\r\n );\r\n }, [extendState, fetch]);\r\n\r\n const handleInputChange = e => {\r\n console.debug('handleInputChange', e);\r\n if (e === null) {\r\n return;\r\n }\r\n extendState({ search: e.target.value });\r\n promiseState.reset();\r\n debounced(e);\r\n };\r\n\r\n const handleOpen = () => {\r\n extendState({ open: true });\r\n extendState(fetch(null));\r\n };\r\n\r\n return {\r\n onOpen: handleOpen,\r\n onInputChange: handleInputChange,\r\n options: state.options,\r\n loading: promiseState.status !== 'resolved',\r\n };\r\n}\r\n","import * as React from 'react';\r\nimport { EditorProps } from '../EditableCell';\r\nimport { IServiceRequestTableColumnModel } from '../../RequestSamplesPage/slice/types';\r\nimport { DateField } from './DateField';\r\nimport { NumberField, withMinMax } from './NumberField';\r\nimport { TextField } from './TextField';\r\nimport { SRSelect, withOptions } from './DropDownList';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { withAsyncOptions } from './DropDownList/IWithAsyncOptions';\r\n\r\nexport function getCellComponent(\r\n props: IServiceRequestTableColumnModel,\r\n): React.FC & any> | null {\r\n switch (props.ColumnType) {\r\n case 'ShortText':\r\n return TextField;\r\n /* Drop Down List */\r\n case 'DropDownList':\r\n return withOptions<\r\n string,\r\n IFormFieldOptionDto,\r\n EditorProps | null>\r\n >(SRSelect, props.Options ?? []);\r\n case 'UserSelection':\r\n return withAsyncOptions(SRSelect, {\r\n CustomRoles: props.CustomRoles,\r\n FixedRoles: props.FixedRoles,\r\n UserSelectionType: props.UserSelectionType,\r\n multiple: props.IsMultiple,\r\n });\r\n //return CustomFormDropDown\r\n /* User Selection */\r\n // case 'UserSelection':\r\n // return UserPickerField;\r\n /* Project Name */\r\n case 'Number':\r\n return withMinMax(NumberField, {\r\n min: -props.SizeLimit,\r\n max: props.SizeLimit,\r\n step: 0.01,\r\n });\r\n /* Positive Integer */\r\n case 'PositiveInteger':\r\n return withMinMax(NumberField, {\r\n min: 0,\r\n max: props.SizeLimit,\r\n step: 1,\r\n });\r\n /* Positive Decimal */\r\n case 'PositiveDecimal':\r\n return withMinMax(NumberField, {\r\n min: 0,\r\n max: props.SizeLimit,\r\n step: 0.01,\r\n });\r\n /* Date */\r\n case 'Date':\r\n return DateField;\r\n /* Email */\r\n case 'Email':\r\n return TextField;\r\n /* Serial */\r\n case 'Serial':\r\n return null;\r\n default:\r\n return null;\r\n }\r\n}\r\n","import { CustomFormColumnTypes } from '../../RequestSamplesPage/slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport function getValueRenderer(props: { columnType: CustomFormColumnTypes }) {\r\n switch (props.columnType) {\r\n case 'CheckBox':\r\n return (value: boolean | null) => String(value?.toString());\r\n case 'Date':\r\n return (value: Date | null) => String(dateUtils.shortDateFormat(value));\r\n case 'DropDownList':\r\n case 'UserSelection':\r\n return (value: Entity | null) => String(value?.Name);\r\n case 'ShortText':\r\n return (value: string | null) => String(value);\r\n case 'Serial':\r\n return (value: any) => {\r\n return String(value);\r\n };\r\n case 'Email':\r\n return (value: string | null) => String(value);\r\n case 'PositiveInteger':\r\n case 'Number':\r\n case 'PositiveDecimal':\r\n return (value: number | null) => String(value);\r\n default:\r\n assertExhaustive(props.columnType);\r\n }\r\n}\r\n\r\nexport function getReadonlyCell(props: { columnType: CustomFormColumnTypes }) {\r\n return ({ value }) =>\r\n value === null || value === undefined ? '' : getValueRenderer(props)(value);\r\n}\r\n","import { Accessor, Column, Renderer, CellProps, Row } from 'react-table';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport {\r\n getServiceRequestRowFieldName,\r\n ServiceRequestRowEditableCell,\r\n} from '../ServiceRequestRowEditableCell';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { getCellComponent } from '../../EditableTable/Fields/getCellComponent';\r\nimport { getReadonlyCell } from '../../EditableTable/Fields/getReadonlyCell';\r\nimport { ColumnType } from './getTableColumns';\r\nimport {\r\n ServiceRequestTableColumn,\r\n ServiceRequestTableColumnsCollection,\r\n} from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport function getCustomFormTableColumns(props: {\r\n columns: ServiceRequestTableColumnsCollection;\r\n isEditable: boolean;\r\n}): Column[] {\r\n return props.columns.getArray().map((column, index) => {\r\n const accessor: Accessor = originalRow => {\r\n const result = originalRow.Values[column.getFieldName()];\r\n return result;\r\n };\r\n const cell = getCell({\r\n column: column,\r\n isEditable: props.isEditable,\r\n isFocused: index === 0 && props.isEditable,\r\n });\r\n\r\n const result: ColumnType = {\r\n id: column.getFieldName(),\r\n Header: column.Label,\r\n accessor: accessor,\r\n Cell: cell,\r\n enableHide: true,\r\n // TODO: add min/max/width based on the column type\r\n // minWidth:\r\n // maxWidth:\r\n // width:\r\n name: (row: Row) =>\r\n getServiceRequestRowFieldName(row.index, column.getFieldName()),\r\n column: column,\r\n };\r\n return result;\r\n });\r\n}\r\n\r\nfunction getCell(props: {\r\n isEditable: boolean;\r\n column: ServiceRequestTableColumn;\r\n isFocused?: boolean;\r\n}):\r\n | Renderer<\r\n CellProps\r\n >\r\n | undefined {\r\n if (props.isEditable) {\r\n const fieldComponent = getCellComponent(props.column);\r\n if (fieldComponent !== null) {\r\n return ServiceRequestRowEditableCell(fieldComponent, {\r\n column: props.column,\r\n focused: props.isFocused,\r\n });\r\n }\r\n }\r\n return getReadonlyCell({ columnType: props.column.ColumnType });\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectServiceRequestRowStatues } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { SRSelect } from '../../EditableTable/Fields/DropDownList';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { CellProps } from 'react-table';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { FastFieldProps } from 'formik';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport interface ServiceRequestRowStatusPickerProps {\r\n value: IServiceRequestRowStatusDto | null;\r\n serviceRequestId: number;\r\n serviceRequestRowId: number;\r\n onChange: (value: IServiceRequestRowStatusDto | null) => void;\r\n error?: boolean;\r\n helperText?: string;\r\n}\r\n\r\nexport function ServiceRequestRowStatusPicker(\r\n props: ServiceRequestRowStatusPickerProps,\r\n) {\r\n const statuses = useSelector(selectServiceRequestRowStatues);\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const handleChange = React.useCallback(\r\n (value: IServiceRequestRowStatusDto | null) => {\r\n props.onChange?.(value);\r\n dispatch(\r\n actions.updateServiceRequestRowStatus({\r\n serviceRequestId: props.serviceRequestId,\r\n serviceRequestRowId: props.serviceRequestRowId,\r\n status: value,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, props],\r\n );\r\n const handleBlur = React.useCallback(e => {}, []);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const ServiceREquestRowStatusCell = React.memo(\r\n function ServiceREquestRowStatusCell(\r\n props: Pick<\r\n CellProps,\r\n 'value'\r\n > & {\r\n isEditable: boolean;\r\n serviceRequestId: number;\r\n serviceRequestRowId: number;\r\n } & {\r\n fieldProps: FastFieldProps;\r\n onChange?: (value: IServiceRequestRowStatusDto | null) => void;\r\n },\r\n ) {\r\n const handleChange = React.useCallback(\r\n value => {\r\n props.fieldProps?.field?.onChange({\r\n target: { value: value, name: props.fieldProps?.field?.name },\r\n });\r\n props.onChange?.(value);\r\n },\r\n [props],\r\n );\r\n\r\n if (props.isEditable) {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n } else {\r\n return <>{props.value.Name};\r\n }\r\n },\r\n);\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { CellProps, Column, Row } from 'react-table';\r\nimport { getCustomFormTableColumns } from './getCustomFormTableColumns';\r\nimport {\r\n IServiceRequestTableColumnModel,\r\n IServiceRequestTableRowModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { ServiceREquestRowStatusCell as ServiceRequestRowStatusCell } from '../ServiceRequestRowStatusPicker';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { IServiceRequestTableFormComponent } from '.';\r\nimport { AddNewCustomTableRow } from './components/AddServiceRequestRowButton';\r\nimport { selectServiceRequestCustomFormColumns } from '../../RequestSamplesPage/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { getServiceRequestRowName } from '../ServiceRequestRowEditableCell';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport styled from 'styled-components';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationLink } from 'app/pages/Actions/GlobalSelectedActions/OpenReservation';\r\n\r\nexport interface ColumnTypeExtension {\r\n name?: (row: Row) => string;\r\n column?: IServiceRequestTableColumnModel;\r\n /**\r\n * Enables show / hide column through columns selection\r\n */\r\n enableHide?: boolean;\r\n}\r\nconst RowGap = styled('div')`\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n`;\r\nexport type ColumnType = Column &\r\n ColumnTypeExtension;\r\nexport function getTableColumns(\r\n customFormColumns: ServiceRequestTableColumnsCollection,\r\n isEditable: boolean,\r\n t,\r\n serviceRequestId: number,\r\n reservationEnabled?: boolean,\r\n useSidePanel?: boolean,\r\n openSidePanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n const dynamicColumns: Array = getCustomFormTableColumns({\r\n columns: customFormColumns,\r\n isEditable,\r\n });\r\n var staticColumns: Array = [\r\n {\r\n id: 'Id',\r\n Header: t(translations.RowId) as string,\r\n accessor: 'Id',\r\n },\r\n ];\r\n if (reservationEnabled) {\r\n staticColumns.push({\r\n id: 'ReservationId',\r\n Header: t(translations.ReservationId) as string,\r\n accessor: 'ReservationId',\r\n Cell: ({ row, value, fieldProps }) => (\r\n <>\r\n {value !== null ? (\r\n <>\r\n {useSidePanel && openSidePanel ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n {value}\r\n )}\r\n \r\n ) : null}\r\n \r\n ),\r\n });\r\n }\r\n staticColumns.push({\r\n Header: t(translations.Status) as string,\r\n accessor: 'Status',\r\n name: (row: Row) =>\r\n getServiceRequestRowName(row.index, 'Status'),\r\n Cell: ({ row, value, fieldProps }) => (\r\n <>\r\n \r\n \r\n ),\r\n });\r\n var result: Array = [...staticColumns, ...dynamicColumns];\r\n result.push({\r\n Header: t(translations.Comments),\r\n id: 'comments',\r\n accessor: 'CommentsCount',\r\n disableSortBy: true,\r\n Cell: (props: CellProps) => (\r\n \r\n {props.value}\r\n \r\n \r\n ),\r\n });\r\n if (isEditable) {\r\n result.push(\r\n ...[\r\n {\r\n id: 'actions',\r\n Cell: (cellProps: CellProps) => (\r\n \r\n ),\r\n },\r\n ],\r\n );\r\n }\r\n return result;\r\n}\r\n\r\ninterface ActionsCellProps extends IServiceRequestTableFormComponent {\r\n rowIndex: number;\r\n original: IServiceRequestTableRowModel;\r\n pageSize: number;\r\n setPageSize;\r\n}\r\nconst ActionsCell = React.memo(function ActionsCell(props: ActionsCellProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n});\r\ninterface DeleteButtonProps\r\n extends Pick {\r\n rowId: number;\r\n}\r\nfunction DeleteButton(props: DeleteButtonProps) {\r\n const handleClick = React.useCallback(() => {\r\n httpClient.delete(`/api/ServiceRequestRows/${props.rowId}`).then(() => {\r\n props.arrayHelpers.remove(props.rowIndex);\r\n });\r\n }, [props.rowId, props.arrayHelpers, props.rowIndex]);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nfunction CloneButton(props: ActionsCellProps) {\r\n const { t } = useTranslation();\r\n const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n const dispatch = useDispatch();\r\n const [processing, setProcessing] = React.useState(false);\r\n const handleCloneClick = React.useCallback(async () => {\r\n if (columns === null) {\r\n console.warn('no columns accessible for current user');\r\n return;\r\n }\r\n setProcessing(true);\r\n try {\r\n await AddNewCustomTableRow({\r\n serviceRequestId: props.original.ServiceRequestId,\r\n columns,\r\n model: props.original,\r\n arrayHelpers: props.arrayHelpers,\r\n index: props.rowIndex + 1,\r\n });\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: t(translations.ServiceRequestRow_InsertSuccess),\r\n }),\r\n );\r\n props.setPageSize(props.pageSize + 1);\r\n setProcessing(false);\r\n } catch (error) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: t(translations.ServiceRequestRow_InsertError),\r\n }),\r\n );\r\n setProcessing(false);\r\n }\r\n }, [columns, dispatch, props, t]);\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.InternalServiceRequestRowStatus\r\n *\r\n */\r\n\r\nexport enum InternalServiceRequestRowStatus {\r\n New = 0,\r\n InWork = 1,\r\n Done = 2,\r\n Skip = 3,\r\n}\r\nexport type InternalServiceRequestRowStatusUnion = keyof typeof InternalServiceRequestRowStatus;\r\nexport const InternalServiceRequestRowStatusUnionArray: Array = [\r\n 'New',\r\n 'InWork',\r\n 'Done',\r\n 'Skip',\r\n];\r\n","import { Comments, CommentsProps } from 'app/components/Comments';\r\nimport {\r\n selectCommentIsInternal,\r\n selectIsServiceRequestAdmin,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\nimport { IServiceRequestRelated } from '../..';\r\nimport styled from 'styled-components';\r\nimport { useFormikContext } from 'formik';\r\nimport { IServiceRequestTableRowModel } from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { getServiceRequestRowName } from '../../../ServiceRequestRowEditableCell';\r\nimport { Row } from 'react-table';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\nimport { ServiceRequestsApi } from 'api/ServiceRequestsApi';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport interface ServiceRequestRowCommentsProps\r\n extends Pick<\r\n CommentsProps,\r\n 'referenceId' | 'commentType' | 'disableFileUpload' | 'serviceGroups'\r\n >,\r\n IServiceRequestRelated {\r\n row?: Row;\r\n canUserEdit?: Boolean;\r\n}\r\nconst CommentsWrap = styled('div')`\r\n padding: 16px;\r\n`;\r\nexport function ServiceRequestRowComments({\r\n serviceRequestId,\r\n canUserEdit,\r\n disableFileUpload,\r\n ...props\r\n}: ServiceRequestRowCommentsProps) {\r\n const { isAdmin } = useSelector(selectIsServiceRequestAdmin);\r\n const CommentIsInternal = useSelector(selectCommentIsInternal);\r\n const formik = useFormikContext();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const { onCommentAdded } = useUploadToNewComment();\r\n const handleCommentAdded = newComment => {\r\n if (props.row !== undefined) {\r\n formik.setFieldValue(\r\n getServiceRequestRowName(props.row.index, 'CommentsCount'),\r\n props.row.original.CommentsCount + 1,\r\n false,\r\n );\r\n }\r\n ServiceRequestsApi.updateAdminOnComment(serviceRequestId);\r\n dispatch(actions.setHasFiles(true));\r\n onCommentAdded(newComment);\r\n };\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { InternalServiceRequestRowStatus } from 'api/odata/generated/enums/InternalServiceRequestRowStatus';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nimport {\r\n IServiceRequestTableRowModel,\r\n IServiceRequestTableRowValueModel,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { ImportComponent } from 'app/pages/Samples/RunDetailsPage/ImportComponents/ImportComponent';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { useFormikContext } from 'formik';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { translations } from 'locales/translations';\r\nimport { chain, Dictionary } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport {\r\n IServiceRequestRelated,\r\n IServiceRequestTableFormComponent,\r\n} from '../..';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { selectServiceRequestCustomFormColumns } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { ServiceRequestTableColumnsCollection } from 'app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport interface ServiceRequestRowsImportProps\r\n extends IServiceRequestRelated,\r\n IServiceRequestTableFormComponent {}\r\nexport function ServiceRequestRowsImport(props: ServiceRequestRowsImportProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const formik = useFormikContext();\r\n const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n const { serviceRequestId } = props;\r\n const handleFileChange = async (file: File) => {\r\n const url = `/api/Requests/${serviceRequestId}/tabledata`;\r\n try {\r\n const response = await httpClient.uploadFile(url, file, {\r\n responseType: 'json',\r\n });\r\n switch (response.status) {\r\n case StatusCodes.OK:\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: t(translations.ImportSuccessMessage),\r\n }),\r\n );\r\n const model = convertImportResponse(\r\n response.data,\r\n\r\n columns,\r\n serviceRequestId,\r\n );\r\n model.forEach(item => {\r\n const index = formik.values.Rows.findIndex(\r\n row => row.Id === item.Id,\r\n );\r\n if (index === -1) {\r\n props.arrayHelpers.push(item);\r\n } else {\r\n props.arrayHelpers.replace(index, item);\r\n }\r\n });\r\n setOpen(false);\r\n break;\r\n default:\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message:\r\n response.data.ExceptionMessage ??\r\n t(translations.ImportErrorMessage),\r\n }),\r\n );\r\n break;\r\n }\r\n } catch (error) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: t(translations.ImportErrorMessage),\r\n }),\r\n );\r\n }\r\n };\r\n const [open, setOpen] = React.useState(false);\r\n const handleClose = () => {\r\n setOpen(false);\r\n };\r\n return (\r\n
    \r\n }\r\n variant=\"white\"\r\n size=\"small\"\r\n onClick={() => setOpen(true)}\r\n >\r\n {t(translations.Import)}\r\n \r\n \r\n \r\n {t(translations.ImportTemplate)}\r\n \r\n
    \r\n \r\n \r\n }\r\n cancelButtonLabel={t(translations.Close)}\r\n onCancel={handleClose}\r\n onClose={handleClose}\r\n />\r\n
    \r\n );\r\n}\r\n\r\ninterface DownloadFileButtonProps extends ButtonProps {\r\n url: string;\r\n}\r\nfunction DownloadImportTemplate({\r\n url,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const handleClick = async () => {\r\n try {\r\n await openExportLink(url);\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n };\r\n return ;\r\n}\r\nexport function ExportRows({\r\n url,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const handleClick = async () => {\r\n try {\r\n await openExportLink(url);\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n };\r\n return (\r\n }\r\n {...props}\r\n >\r\n );\r\n}\r\n/**\r\n * Response example:\r\n * [\r\n {\r\n Id: 0,\r\n CommentsCount: 0,\r\n FilesCount: 0,\r\n Status: { Id: 0, InternalStatusId: 0, Name: 'New' },\r\n ReservationId: null,\r\n '1001': null,\r\n '1002': { id: 'a1', text: 'a1', isValid: true, SourceValueId: null },\r\n '1011': null,\r\n '1003': null,\r\n '1004': '1',\r\n '1005': null,\r\n '1006': null,\r\n '1007': null,\r\n '1008': null,\r\n '1010': '1',\r\n }\r\n ...\r\n]\r\n * @param importResponse \r\n * @param arrayHelpers \r\n * @param values \r\n * @param serviceRequestId \r\n * @returns \r\n */\r\nfunction convertImportResponse(\r\n importResponse: Array<\r\n {\r\n Id: number;\r\n Status: any;\r\n ReservationId: any;\r\n CommentsCount: any;\r\n FilesCount: any;\r\n } & Record\r\n >,\r\n columns: ServiceRequestTableColumnsCollection | null,\r\n serviceRequestId: number,\r\n): Array {\r\n const result = importResponse.map(item => {\r\n const values =\r\n columns === null\r\n ? {}\r\n : (chain(columns.columnsObj)\r\n .mapValues(column => {\r\n const value = item[column.Id.toString()];\r\n if (value === null) {\r\n return null;\r\n } else if (typeof value === 'string') {\r\n return value;\r\n } else if (\r\n typeof value === 'object' &&\r\n typeof value.id === 'string' &&\r\n typeof value.text === 'string'\r\n ) {\r\n return {\r\n Id: value.id,\r\n Name: value.text,\r\n };\r\n } else {\r\n return null;\r\n }\r\n })\r\n .value() as Dictionary);\r\n const model: IServiceRequestTableRowModel = {\r\n Id: item.Id,\r\n Status: {\r\n Id: item.Status.Id,\r\n Name: item.Status.Name,\r\n InternalStatus:\r\n InternalServiceRequestRowStatus[item.Status.InternalStatusId],\r\n },\r\n Values: values,\r\n Charged: false,\r\n CommentsCount: item.CommentsCount,\r\n Completed: false,\r\n InsertDate: '',\r\n ReservationId: null,\r\n Serial: 1,\r\n ServiceRequestId: serviceRequestId,\r\n SourceLinkId: null,\r\n SourceRowId: null,\r\n StatusId: item.Status.Id,\r\n UpdateDate: '',\r\n };\r\n return model;\r\n });\r\n\r\n return result;\r\n}\r\n","import * as Yup from 'yup';\r\nimport { SRSelect } from 'app/pages/Samples/EditableTable/Fields/DropDownList';\r\nimport { selectServiceRequestCustomFormColumns } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { useFormikContext, Field, FieldProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { getCustomFormColumnSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceRequestRelated, IServiceRequestSelectedRows } from '../..';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { getServiceRequestRowFieldName } from '../../../ServiceRequestRowEditableCell';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { DialogForm } from 'app/components/DialogForm';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { getCellComponent } from 'app/pages/Samples/EditableTable/Fields/getCellComponent';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\n\r\nexport interface BulkUpdateProps\r\n extends IServiceRequestRelated,\r\n IServiceRequestSelectedRows {}\r\n\r\nexport function BulkUpdate(props: BulkUpdateProps) {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n const options = React.useMemo(\r\n () =>\r\n columns === null\r\n ? []\r\n : columns\r\n .getArray()\r\n .filter(column => column.ColumnType !== 'Serial')\r\n .map(column => ({\r\n Id: column.Id,\r\n Name: column.Label,\r\n Column: column,\r\n })),\r\n [columns],\r\n );\r\n\r\n const schema = React.useMemo(\r\n () =>\r\n Yup.object({\r\n column: Yup.mixed().required(),\r\n value: Yup.mixed().when(['column'], (column, schema) =>\r\n column === null || column === undefined\r\n ? schema\r\n : getCustomFormColumnSchema(column).required().nullable(),\r\n ),\r\n }),\r\n [],\r\n );\r\n const formikContext = useFormikContext();\r\n\r\n const handleSubmit = React.useCallback(\r\n async values => {\r\n const column = values.column;\r\n if (column === null) {\r\n return;\r\n }\r\n try {\r\n const rowIdentifiers = props.selectedFlatRows.map(\r\n row => row.original.Id,\r\n );\r\n await httpClient.put(\r\n `/api/requests/${props.serviceRequestId}/column/${column?.Id}`,\r\n {\r\n value: postValue(values.value),\r\n rowids: rowIdentifiers,\r\n },\r\n );\r\n props.selectedFlatRows.forEach(row =>\r\n formikContext.setFieldValue(\r\n getServiceRequestRowFieldName(row.index, column.getFieldName()),\r\n values.value,\r\n ),\r\n );\r\n setOpen(false);\r\n } catch (error) {\r\n dispatch(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: t(translations.GenericUpdateErrorMessage),\r\n }),\r\n );\r\n }\r\n },\r\n [\r\n dispatch,\r\n formikContext,\r\n props.selectedFlatRows,\r\n props.serviceRequestId,\r\n t,\r\n ],\r\n );\r\n const [open, setOpen] = React.useState(false);\r\n return (\r\n <>\r\n setOpen(x => !x)}\r\n text={t(translations.Update)}\r\n />\r\n setOpen(false)}\r\n open={open}\r\n title={t(translations.UpdateColumnValueAcrossMultipleRows)}\r\n >\r\n \r\n \r\n {({\r\n field, // { name, value, onChange, onBlur }\r\n meta,\r\n form,\r\n }: FieldProps) => (\r\n {\r\n field.onChange({\r\n target: {\r\n value: value?.Column,\r\n name: 'column',\r\n },\r\n });\r\n form.setFieldValue('value', null, false);\r\n }}\r\n />\r\n )}\r\n \r\n \r\n\r\n \r\n \r\n {({\r\n field, // { name, value, onChange, onBlur }\r\n form,\r\n meta,\r\n }: FieldProps) => {\r\n if (\r\n form.values.column !== null &&\r\n form.values.column !== undefined\r\n ) {\r\n const component = getCellComponent(form.values.column);\r\n if (component !== null) {\r\n return component({\r\n name: field.name,\r\n //error: meta.error !== undefined,\r\n onBlur: field.onBlur,\r\n onChange: event => {\r\n field.onChange({\r\n target: {\r\n name: field.name,\r\n value: event?.target?.value ?? event ?? null,\r\n },\r\n });\r\n },\r\n value: field.value,\r\n helperText: meta.error,\r\n });\r\n }\r\n }\r\n return null;\r\n }}\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\n/**\r\n * Formats custom form value in the format expected by the v3 api:\r\n * * ddl values are expected to be in {id:\"xxx\", text:\"yyy\"} format,\r\n * * dates - yyyy-MM-dd\r\n * * other primitive values - string\r\n * @param value custom form value\r\n * @returns\r\n */\r\nfunction postValue(value: any) {\r\n if (value instanceof Date) {\r\n return dateUtils.formatISO(value, {\r\n representation: 'date',\r\n format: 'basic',\r\n });\r\n }\r\n if (value?.Id !== undefined && value?.Name !== undefined) {\r\n return { id: value.Id, text: value.text };\r\n } else {\r\n return value;\r\n }\r\n}\r\n","import {\r\n Checkbox,\r\n List,\r\n ListItem,\r\n ListItemIcon,\r\n ListItemText,\r\n} from '@material-ui/core';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { Popover } from 'app/components/Popover';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column, TableState, UseTableInstanceProps } from 'react-table';\r\nimport { ColumnTypeExtension } from '../../getTableColumns';\r\n\r\nexport interface ColumnsSelectProps\r\n extends Pick, 'allColumns' | 'toggleHideColumn'>,\r\n Pick, 'hiddenColumns'> {}\r\n\r\nexport function ColumnsSelect(props: ColumnsSelectProps) {\r\n const { t } = useTranslation();\r\n\r\n const [anchorEl, setAnchorEl] = React.useState(undefined);\r\n\r\n const handleOpen = event => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(undefined);\r\n };\r\n\r\n const open = Boolean(anchorEl);\r\n const id = open ? 'simple-popover' : undefined;\r\n const handleToggle = (column: Column) => {\r\n if (column.id !== undefined) {\r\n props.toggleHideColumn(column.id);\r\n }\r\n };\r\n const columns = React.useMemo(() => getHidableColumns(props.allColumns), [\r\n props.allColumns,\r\n ]);\r\n return (\r\n <>\r\n \r\n \r\n \r\n {columns.map(column => {\r\n const labelId = `checkbox-list-label-${column.id}`;\r\n return (\r\n column.id !== undefined && (\r\n handleToggle(column)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n )\r\n );\r\n })}\r\n \r\n \r\n \r\n );\r\n}\r\nfunction getHidableColumns(columns: Array>) {\r\n return columns\r\n .filter(column => column.id !== undefined)\r\n .filter(column => (column as ColumnTypeExtension)?.enableHide === true);\r\n}\r\nfunction getHiddenColumnsKey(serviceId: number) {\r\n return `hidden_columns_${serviceId}`;\r\n}\r\nexport function getHiddenColumns(\r\n serviceId: number,\r\n allColumns: Array & ColumnTypeExtension>,\r\n) {\r\n try {\r\n const s = localStorage.getItem(getHiddenColumnsKey(serviceId));\r\n if (s === null) {\r\n return [];\r\n }\r\n const x = JSON.parse(s);\r\n if (Array.isArray(x) && x.every(item => typeof item === 'string')) {\r\n const columnIds = getHidableColumns(allColumns).map(column => column.id);\r\n\r\n return x.filter(id => columnIds.includes(id));\r\n }\r\n return [];\r\n } catch (error) {\r\n return [];\r\n }\r\n}\r\nexport function setHiddenColumns(serviceId: number, value?: Array) {\r\n try {\r\n const key = getHiddenColumnsKey(serviceId);\r\n if (value === undefined) {\r\n localStorage.removeItem(key);\r\n } else {\r\n localStorage.setItem(key, JSON.stringify(value));\r\n }\r\n } catch (error) {\r\n //noop\r\n }\r\n}\r\n","/**\r\n *\r\n * ServiceRequestRowsTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\n\r\nimport {\r\n Column,\r\n Row,\r\n useExpanded,\r\n UsePaginationInstanceProps,\r\n UsePaginationState,\r\n useTable,\r\n} from 'react-table';\r\nimport { AddServiceRequestRowButton } from './components/AddServiceRequestRowButton';\r\nimport {\r\n FieldArray,\r\n FormikProps,\r\n ArrayHelpers,\r\n FastFieldProps,\r\n FastField,\r\n} from 'formik';\r\nimport {\r\n IServiceRequestDetailsFormModel,\r\n IServiceRequestTableRowModel,\r\n IServiceRequestTableRowValueModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { ColumnTypeExtension, getTableColumns } from './getTableColumns';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { UpdateServiceRequestRowValue } from '../ServiceRequestRowEditableCell';\r\nimport { serializeCustomFormRowValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport styled from 'styled-components';\r\nimport {\r\n TableBody,\r\n TableHead,\r\n TableRow,\r\n TableCell,\r\n TableContainer,\r\n Table,\r\n} from '@material-ui/core/index';\r\nimport TablePagination from '@material-ui/core/TablePagination';\r\nimport { usePagination, PluginHook } from 'react-table';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport TablePaginationActions from 'app/components/BasicTable/TablePaginationActions';\r\nimport { tableSectionStyles } from '../../RequestSamplesPage';\r\nimport clsx from 'clsx';\r\nimport { ServiceRequestRowComments } from './components/ServiceRequestComments';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport {\r\n ExportRows,\r\n ServiceRequestRowsImport,\r\n} from './components/ServiceRequestRowsImport';\r\nimport { BulkUpdate } from './components/BulkUpdate';\r\nimport { addRowSelect } from 'app/components/BasicTable/ControlledTable/addRowSelect';\r\nimport {\r\n ColumnsSelect,\r\n getHiddenColumns,\r\n setHiddenColumns,\r\n} from './components/ColumnsSelect';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Body } from 'app/components/Typography';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AlertContentType } from 'app/components/BasicAlert';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface IServiceRequestRelated {\r\n serviceRequestId: number;\r\n}\r\nexport interface IServiceRequestTableFormComponent {\r\n arrayHelpers: ArrayHelpers;\r\n updateMyData: UpdateServiceRequestRowValue;\r\n}\r\n\r\nexport interface IServiceRequestSelectedRows {\r\n selectedFlatRows: Array>;\r\n}\r\nexport interface ServiceRequestRowsTableProps\r\n extends IServiceRequestRelated,\r\n FormikProps {\r\n processing: boolean;\r\n isEditable: boolean;\r\n isAdmin: boolean;\r\n pageSize?: number;\r\n formFields: ServiceRequestTableColumnsCollection;\r\n serviceRequestTypeId: number;\r\n hasErrors?: boolean;\r\n printing?: Printing;\r\n reservationEnabled?: boolean;\r\n openSidePanel: (state: SidePanelOpenState) => void;\r\n useSidePanel: boolean;\r\n serviceRequestId: number;\r\n serviceGroups?: Identifiable[];\r\n onCreateReservation: (rows: IServiceRequestTableRowModel[]) => void;\r\n}\r\n/**\r\n * \"Custom Form\" based table section\r\n */\r\nexport const ServiceRequestRowsTable = React.memo(\r\n function ServiceRequestRowsTable({\r\n serviceRequestId,\r\n isAdmin,\r\n isEditable,\r\n formFields: customFormColumns,\r\n hasErrors,\r\n openSidePanel,\r\n //pageSize,\r\n ...props\r\n }: ServiceRequestRowsTableProps) {\r\n const { actions } = useRequestSamplesSlice();\r\n\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n\r\n // TODO: server side pagination\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const handleChangeState = React.useCallback(\r\n changeState => {\r\n dispatch(\r\n actions.loadServiceRequestRows({\r\n serviceRequestId: serviceRequestId,\r\n state: changeState,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, serviceRequestId],\r\n );\r\n\r\n // TODO: server side pagination\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const handleSelectedRowsChange = React.useCallback(\r\n rows => {\r\n dispatch(actions.setSelected(rows));\r\n },\r\n [actions, dispatch],\r\n );\r\n\r\n // useEffectOnMount(() => {\r\n // if (!!serviceRequestId) {\r\n // dispatch(\r\n // actions.loadServiceRequestRows({\r\n // serviceRequestId: serviceRequestId,\r\n // state: {\r\n // pageIndex: 0,\r\n // pageSize: 10,\r\n // },\r\n // }),\r\n // );\r\n // }\r\n // });\r\n\r\n const openPanel = React.useCallback(\r\n (state: SidePanelOpenState) => {\r\n openSidePanel(state);\r\n },\r\n [openSidePanel],\r\n );\r\n\r\n const tableColumns = React.useMemo<\r\n Array>\r\n >(() => {\r\n return getTableColumns(\r\n customFormColumns,\r\n isEditable,\r\n t,\r\n serviceRequestId,\r\n props.reservationEnabled,\r\n props.useSidePanel,\r\n openPanel,\r\n );\r\n }, [\r\n customFormColumns,\r\n isEditable,\r\n openPanel,\r\n props.reservationEnabled,\r\n props.useSidePanel,\r\n serviceRequestId,\r\n t,\r\n ]);\r\n\r\n const updateMyData = React.useCallback<\r\n UpdateServiceRequestRowValue\r\n >(\r\n args => {\r\n const column = customFormColumns.get(args.columnId);\r\n\r\n // dispatch(\r\n // actions.updateServiceRequestRowValue({\r\n // serviceRequestId: serviceRequestId,\r\n // serviceRequestValue: {\r\n // RowId: args.serviceRequestRowId,\r\n // ColumnId: column.Id,\r\n // ...serializeCustomFormRowValue(args.value),\r\n // },\r\n // }),\r\n // );\r\n\r\n const value = serializeCustomFormRowValue(args.value);\r\n\r\n // TODO: migrate value updates to the new api\r\n // const url = `/api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows(${action.payload.serviceRequestValue.RowId})/Values`;\r\n const url = `/api/requests/${serviceRequestId}/tabledata/${args.serviceRequestRowId}/${column.Id}`;\r\n const payload =\r\n value.DisplayValue === null\r\n ? value.Value\r\n : {\r\n id: value.Value,\r\n text: value.DisplayValue,\r\n };\r\n\r\n try {\r\n httpClient.post(url, JSON.stringify(payload), {\r\n headers: { 'Content-Type': 'application/json' },\r\n });\r\n } catch (error) {}\r\n },\r\n [customFormColumns, serviceRequestId],\r\n );\r\n\r\n const print = React.useMemo(() => {\r\n return props.printing !== undefined && props.printing.printing === true;\r\n }, [props.printing]);\r\n React.useEffect(() => {\r\n if (\r\n props.printing !== undefined &&\r\n print &&\r\n props.printing.onLoading !== undefined\r\n ) {\r\n props.printing.onLoading(\r\n props.printing.id,\r\n props.values.Rows === undefined || props.values.Rows === null,\r\n );\r\n }\r\n }, [print, props.printing, props.values.Rows]);\r\n\r\n if (props.values.Rows === undefined || props.values.Rows === null) {\r\n return <>;\r\n }\r\n return (\r\n <>\r\n <>\r\n \r\n \r\n dispatch(\r\n actions.loadServiceRequestRows({\r\n serviceRequestId: serviceRequestId,\r\n state: state,\r\n }),\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n );\r\n },\r\n);\r\n\r\ninterface SRFormContentProps\r\n extends FormikProps,\r\n IServiceRequestRelated {\r\n tableColumns: Array>;\r\n updateMyData: UpdateServiceRequestRowValue;\r\n isEditable: boolean;\r\n isAdmin: boolean;\r\n serviceRequestTypeId: number;\r\n hasError?: boolean;\r\n reservationEnabled?: boolean;\r\n openSidePanel: (state: SidePanelOpenState) => void;\r\n useSidePanel: boolean;\r\n serviceGroups?: Identifiable[];\r\n onRefresh: (state: any) => void;\r\n onCreateReservation: (rows: IServiceRequestTableRowModel[]) => void;\r\n}\r\nconst SRFormContent = React.memo(function SRFormContent({\r\n tableColumns,\r\n updateMyData,\r\n onCreateReservation,\r\n ...props\r\n}: SRFormContentProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n const tablePlugins = React.useMemo(() => {\r\n const plugins: PluginHook[] = [\r\n // useSortBy,\r\n useExpanded,\r\n usePagination,\r\n ];\r\n if (props.isEditable) {\r\n addRowSelect(plugins);\r\n }\r\n return plugins;\r\n }, [props.isEditable]);\r\n\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n page, // Instead of using 'rows', we'll use page,\r\n prepareRow,\r\n //pagination\r\n gotoPage,\r\n setPageSize,\r\n allColumns,\r\n toggleHideColumn,\r\n state: { pageIndex, pageSize, hiddenColumns },\r\n selectedFlatRows,\r\n } = useTable(\r\n {\r\n columns: tableColumns,\r\n data: props.values.Rows ?? [],\r\n updateMyData: updateMyData,\r\n autoResetPage: false,\r\n autoResetExpanded: false,\r\n initialState: {\r\n // sortBy: [{ id: 'Id' }],\r\n hiddenColumns: getHiddenColumns(\r\n props.serviceRequestTypeId,\r\n tableColumns,\r\n ),\r\n },\r\n },\r\n ...tablePlugins,\r\n );\r\n React.useEffect(() => {\r\n setHiddenColumns(props.serviceRequestTypeId, hiddenColumns);\r\n }, [hiddenColumns, props.serviceRequestTypeId]);\r\n\r\n const handleRefresh = () => {\r\n props.onRefresh({ pageIndex, pageSize });\r\n };\r\n const classes = useStyles();\r\n\r\n return (\r\n \r\n {arrayHelpers => {\r\n return (\r\n <>\r\n \r\n {props.values.Rows !== undefined && (\r\n <>\r\n {props.values.Rows.length} {t(translations.Records)}\r\n \r\n )}\r\n \r\n }\r\n alertContent={\r\n props.hasError\r\n ? ({\r\n type: 'error',\r\n message: t(translations.RequestRows_error) as string,\r\n closable: true,\r\n } as AlertContentType)\r\n : undefined\r\n }\r\n showAlert={props.hasError}\r\n >\r\n {props.isAdmin &&\r\n selectedFlatRows.length > 0 &&\r\n props.reservationEnabled && (\r\n \r\n onCreateReservation(selectedFlatRows.map(f => f.original))\r\n }\r\n text={t(translations.CreateReservation)}\r\n />\r\n // f.original)}\r\n // />\r\n )}\r\n {props.isEditable && selectedFlatRows.length > 0 && (\r\n \r\n )}\r\n {props.isEditable && !isMobile && (\r\n \r\n )}\r\n {props.isEditable && !isMobile && (\r\n \r\n {t(translations.Export)}\r\n \r\n )}\r\n {props.isAdmin && (\r\n \r\n )}\r\n {props.isEditable && (\r\n \r\n )}\r\n \r\n
    \r\n
    \r\n \r\n \r\n {\r\n // Loop over the header rows\r\n headerGroups.map(headerGroup => (\r\n // Apply the header row props\r\n \r\n {\r\n // Loop over the headers in each row\r\n headerGroup.headers.map(column => (\r\n // Apply the header cell props\r\n\r\n \r\n {\r\n // Render the header\r\n \r\n {column.render('Header')}\r\n \r\n }\r\n \r\n ))\r\n }\r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n\r\n {props.values.Rows !== undefined && (\r\n \r\n \r\n
    \r\n )}\r\n \r\n \r\n );\r\n }}\r\n
    \r\n );\r\n});\r\n\r\ninterface SRTableBodyProps\r\n extends IServiceRequestRelated,\r\n IServiceRequestTableFormComponent {\r\n page: Array>;\r\n prepareRow: (row: Row) => void;\r\n serviceGroups?: Identifiable[];\r\n}\r\nconst SRTableBody = React.memo(function SRTableBody({\r\n page,\r\n prepareRow,\r\n arrayHelpers,\r\n serviceGroups,\r\n updateMyData,\r\n}: SRTableBodyProps) {\r\n return (\r\n <>\r\n {page.map(row => {\r\n prepareRow(row);\r\n\r\n const rowProps = row.getRowProps();\r\n return (\r\n \r\n \r\n {row.cells.map((cell, index) => (\r\n \r\n {(fieldProps?: FastFieldProps) => {\r\n const hasError = !isNullOrUndefined(\r\n fieldProps?.meta?.error,\r\n );\r\n return (\r\n \r\n {cell.render('Cell', {\r\n arrayHelpers,\r\n updateMyData,\r\n fieldProps,\r\n })}\r\n \r\n );\r\n }}\r\n \r\n ))}\r\n \r\n {row.isExpanded && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n })}\r\n \r\n );\r\n});\r\n\r\ninterface SRTableCellProps {\r\n error?: boolean;\r\n title?: string;\r\n key?: string;\r\n className?: string;\r\n children: React.ReactNode;\r\n}\r\nfunction SRTableCell({\r\n error,\r\n children,\r\n title,\r\n key,\r\n className,\r\n ...other\r\n}: React.PropsWithChildren) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\nconst StyledTableCell = styled(SRTableCell)`\r\n background: ${props =>\r\n props.error ? bookitColors.danger.background : 'transparent'};\r\n\r\n border-bottom: ${props => (props.error ? '1px solid #F78F8B' : 'unset')};\r\n &.editcell:hover {\r\n background: ${props =>\r\n props.error\r\n ? bookitColors.danger.bgHover\r\n : bookitColors.grayscale.grayBackground};\r\n cursor: pointer;\r\n & > * {\r\n cursor: pointer;\r\n & > * {\r\n cursor: pointer;\r\n & > * {\r\n cursor: pointer;\r\n & > * {\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n > .Mui-focused & {\r\n border: 1px solid ${bookitColors.primary.regular};\r\n background: ${bookitColors.grayscale.grayBackground};\r\n }\r\n &:focus-within {\r\n border: 1px solid ${bookitColors.primary.regular};\r\n background: ${bookitColors.grayscale.grayBackground};\r\n }\r\n`;\r\n// box-shadow: ${props =>\r\n// props.error\r\n// ? '-1px 0px 0px #e0e5ec, 0px 1px 0px #C42E52'\r\n// : '-1px 1px 0px #e0e5ec'};\r\nconst TableHeaderCellLabel = styled('span')`\r\n white-space: break-spaces;\r\n word-break: normal;\r\n`;\r\ninterface SRTablePaginationProps\r\n extends Pick<\r\n UsePaginationState,\r\n 'pageSize' | 'pageIndex'\r\n >,\r\n Pick<\r\n UsePaginationInstanceProps,\r\n 'gotoPage' | 'setPageSize'\r\n > {\r\n isEditable: boolean;\r\n dataLength: number;\r\n}\r\nconst SRTablePagination = React.memo(function SRTablePagination(\r\n props: SRTablePaginationProps,\r\n) {\r\n return (\r\n props.gotoPage(newPage)}\r\n onChangeRowsPerPage={event =>\r\n props.setPageSize(Number(event.target.value))\r\n }\r\n ActionsComponent={TablePaginationActions}\r\n />\r\n );\r\n});\r\n\r\ninterface EditableCellProps {\r\n name?: string;\r\n children: (fieldProps?: FastFieldProps) => React.ReactElement;\r\n}\r\nfunction EditableCellField({\r\n name,\r\n ...props\r\n}: EditableCellProps): React.ReactElement {\r\n if (name === undefined) {\r\n return props.children(undefined);\r\n } else {\r\n return ;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { Alert } from '@material-ui/lab';\r\nimport * as Yup from 'yup';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useServiceRequestStatusUpdate } from 'app/pages/Samples/components/Utils';\r\nimport {\r\n InternalServiceRequestStatuses,\r\n InternalServiceRequestStatusesUnion,\r\n} from 'enums/InternalServiceRequestStatuses';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport {\r\n FormRow,\r\n StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { DialogForm, DialogFormProps } from 'app/components/DialogForm';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { IReason } from '../../slice/types';\r\n\r\nexport interface QuoteSentToUserAlertProps {\r\n ServiceRequestId: number;\r\n ServiceRequestInternalStatus: InternalServiceRequestStatusesUnion;\r\n}\r\nexport function QuoteSentToUserAlert(props: QuoteSentToUserAlertProps) {\r\n const { t } = useTranslation();\r\n\r\n const { changeStatus } = useServiceRequestStatusUpdate({\r\n serviceRequestStatusId: props.ServiceRequestId,\r\n });\r\n const approvedStatus = {\r\n Id: InternalServiceRequestStatuses.QuoteApproved as number,\r\n Name: 'QuoteApproved',\r\n InternalStatusId: 'QuoteApproved',\r\n } as IServiceRequestStatusDto;\r\n // const approvedStatus = useSelector(\r\n // state =>\r\n // selectServiceRequestStatusesByInternalId(state, 'QuoteApproved')?.[0],\r\n // );\r\n const cancelledStatuses = useSelector(state =>\r\n selectServiceRequestStatusesByInternalId(state, 'Cancelled'),\r\n );\r\n const handleApproveQuoteClick = (value: IServiceRequestStatusDto) =>\r\n changeStatus({\r\n status: value,\r\n });\r\n const handleRejectClick = (values: IReason) => {\r\n const firstCancelledStatus = cancelledStatuses?.[0];\r\n if (firstCancelledStatus !== undefined) {\r\n changeStatus({\r\n status: firstCancelledStatus,\r\n reason: values.Reason,\r\n });\r\n }\r\n };\r\n if (props.ServiceRequestInternalStatus !== 'QuoteSendToUser') {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \r\n {t(translations.Request_SendQuoteToUser_PendingMessage)}\r\n  \r\n handleApproveQuoteClick(approvedStatus)}\r\n >\r\n {t(translations.Request_SendQuoteToUser_ApproveQuote)}\r\n \r\n  \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\ninterface RejectProps extends Pick {}\r\nfunction Reject(props: RejectProps) {\r\n const [dialogOpen, setDialogOpen] = React.useState(false);\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n setDialogOpen(false)}\r\n onSubmit={props.onSubmit}\r\n open={dialogOpen}\r\n />\r\n \r\n );\r\n}\r\n\r\ninterface DialogConfirmWithReasonProps\r\n extends Pick, 'onSubmit' | 'onClose' | 'open'> {}\r\nfunction ConfirmRejectDialog(props: DialogConfirmWithReasonProps) {\r\n const { t } = useTranslation();\r\n const validationSchema: Yup.SchemaOf = Yup.object({\r\n Reason: Yup.string().required(t(translations.RejectReasonEmpty_err)),\r\n });\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useServiceRequestStatusUpdate } from 'app/pages/Samples/components/Utils';\r\nimport { IRequestDetailsModel } from '../../slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport function canSendQuote(\r\n isAdmin: boolean,\r\n serviceRequest?: IRequestDetailsModel,\r\n) {\r\n return (\r\n serviceRequest?.Service.SendQuoteToUser === true &&\r\n isAdmin === true &&\r\n ['InProcess', 'Draft'].includes(serviceRequest?.Status.InternalStatusId)\r\n );\r\n}\r\nexport interface ISendQuoteButtonButtonProps {\r\n serviceRequest: IRequestDetailsModel;\r\n}\r\nexport function SendQuoteButtonButton(props: ISendQuoteButtonButtonProps) {\r\n const { t } = useTranslation();\r\n const statuses = useSelector(state =>\r\n selectServiceRequestStatusesByInternalId(state, 'QuoteSendToUser'),\r\n );\r\n\r\n const { changeStatus } = useServiceRequestStatusUpdate({\r\n serviceRequestStatusId: props.serviceRequest?.Id,\r\n });\r\n\r\n // const submitEnabled = React.useMemo(() => canSendQuote(props), [props]);\r\n\r\n const handleClick = () => {\r\n const status = statuses?.[0];\r\n if (status !== undefined) {\r\n changeStatus({\r\n status: status,\r\n });\r\n }\r\n };\r\n\r\n return (\r\n }\r\n variant=\"ghost\"\r\n aria-label={t(translations.SendQuote)}\r\n disabled={statuses === undefined || statuses.length === 0}\r\n onClick={handleClick}\r\n title={t(translations.SendQuote)}\r\n >\r\n {t(translations.SendQuote)}\r\n \r\n );\r\n}\r\n","import { getCustomFormColumnSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { transform } from 'lodash';\r\nimport * as Yup from 'yup';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport const getSchema = (props: {\r\n columns: ServiceRequestTableColumnsCollection;\r\n isAdmin: boolean;\r\n}) =>\r\n // TODO: fix custom form schema typings starting from the getFieldSchema. In the end this : Yup.SchemaOf>\r\n {\r\n const columnSchema = (result, column, key) =>\r\n (result[column.getFieldName()] = getCustomFormColumnSchema({\r\n ColumnType: column.ColumnType,\r\n Label: column.Label,\r\n SizeLimit: column.SizeLimit,\r\n isRequired: column.isRequired,\r\n Options: column.Options,\r\n }).nullable());\r\n\r\n const x = transform(props.columns.columnsObj, columnSchema);\r\n\r\n const dynamicValuesSchema = Yup.object(x);\r\n\r\n return Yup.array(\r\n Yup.object({\r\n Values: dynamicValuesSchema,\r\n }),\r\n );\r\n };\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { downloadFile } from 'utils/url-utils';\r\n\r\ninterface DownloadAllFilesProps {\r\n serviceRequestId: number;\r\n}\r\n\r\nexport function DownloadAllFiles(props: DownloadAllFilesProps) {\r\n const { t } = useTranslation();\r\n const url = `/api/odata/v4/ServiceRequests(${props.serviceRequestId})/Files`;\r\n const [busy, setBusy] = React.useState(false);\r\n const handleClick = React.useCallback(\r\n async event => {\r\n event.preventDefault();\r\n if (busy) {\r\n return;\r\n }\r\n setBusy(true);\r\n try {\r\n await downloadFile({ path: url });\r\n setBusy(false);\r\n } catch (error) {\r\n setBusy(false);\r\n }\r\n\r\n return false;\r\n },\r\n [busy, url],\r\n );\r\n return (\r\n \r\n {t(translations.DownloadAllFiles)}\r\n \r\n );\r\n}\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { getColumns } from 'app/pages/ReservationHistoryPage/Columns';\r\nimport { reservationsPrimaryAction } from 'app/pages/ReservationHistoryPage/PrimaryAction';\r\nimport { ReservationHistoryTable } from 'app/pages/ReservationHistoryPage/ReservationHistoryTable';\r\nimport { useReservationPermissions } from 'app/permissions/Reservations/reservationPermissions';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\n\r\nexport interface ServiceRequestReservationsProps {\r\n serviceRequestId: number;\r\n isMobile?: boolean;\r\n useSidePanel?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n tableContainerStyles?: React.CSSProperties;\r\n onCreateReservation: () => void;\r\n isAdmin: boolean;\r\n}\r\n\r\nexport const ServiceRequestReservations = React.memo(\r\n function ServiceRequestReservations(props: ServiceRequestReservationsProps) {\r\n const { t } = useTranslation();\r\n const user = useSelector(selectAuthenticatedUser);\r\n const settings = useSelector(selectglobalSettings);\r\n const { allowedToView } = useReservationPermissions();\r\n const {\r\n serviceRequestId,\r\n isMobile,\r\n useSidePanel,\r\n openPanel,\r\n onCreateReservation,\r\n isAdmin,\r\n } = props;\r\n const SRReservationColumns = React.useMemo(\r\n () => [\r\n 'Id',\r\n 'EquipmentName',\r\n 'StartTime',\r\n 'EndTime',\r\n 'Status',\r\n 'DurationH',\r\n 'Remarks',\r\n 'Charges',\r\n ],\r\n [],\r\n );\r\n const predicates = React.useMemo(() => {\r\n return [\r\n `(${new Condition(\r\n 'ServiceRequestIds',\r\n ODataOperators.In,\r\n serviceRequestId,\r\n ).toString()} or ${new Condition(\r\n 'RowsRequestIds',\r\n ODataOperators.In,\r\n serviceRequestId,\r\n ).toString()})`,\r\n ];\r\n }, [serviceRequestId]);\r\n const reservationsColumns: Column[] = React.useMemo(\r\n () =>\r\n getColumns(t, user, settings, allowedToView, useSidePanel, openPanel),\r\n [t, user, settings, allowedToView, useSidePanel, openPanel],\r\n );\r\n const columns = React.useMemo(() => {\r\n let res: Column[] = [];\r\n for (const c of SRReservationColumns) {\r\n const column = reservationsColumns.find(f => f.accessor === c);\r\n if (column !== undefined) {\r\n res.push(column);\r\n }\r\n }\r\n return res;\r\n }, [SRReservationColumns, reservationsColumns]);\r\n const PageActions: PageActionRenderer[] = [\r\n () => (\r\n onCreateReservation()}\r\n text={t(translations.CreateReservation)}\r\n />\r\n ),\r\n ];\r\n // const initialState: IBasicTableState = React.useMemo(\r\n // () => ({\r\n // sortBy: [{ id: 'Id', desc: true }],\r\n // }),\r\n // [],\r\n // );\r\n const primaryAction: PrimaryAction = React.useCallback(\r\n (...args) => {\r\n reservationsPrimaryAction(\r\n openPanel,\r\n args[0],\r\n args[1],\r\n args[2],\r\n useSidePanel,\r\n );\r\n },\r\n [openPanel, useSidePanel],\r\n );\r\n return (\r\n <>\r\n \r\n }\r\n hideMenuOnMobile={true}\r\n useRowSelect={false}\r\n screenNameVariant=\"section\"\r\n //tablePaddingVariant={'dense'}\r\n compactTable={isMobile}\r\n primaryAction={primaryAction}\r\n tableContainerSyles={props.tableContainerStyles}\r\n />\r\n \r\n );\r\n },\r\n);\r\n","/**\r\n *\r\n * GradientsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IGradientsDto } from 'api/odata/IGradientsDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n AutocompletePicker,\r\n AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface GradientsPickerProps\r\n extends Omit>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/Gradients';\r\nexport const initGradientsData = (initval: string | undefined) => {\r\n if (initval === undefined) {\r\n return new Promise[]>((resolve, reject) => {\r\n resolve([] as Entity[]);\r\n });\r\n } else {\r\n const id = parseInt(initval);\r\n const params: {\r\n $orderby: string;\r\n $filter?: string;\r\n $select: string;\r\n $top: number;\r\n $skip: number;\r\n } = {\r\n $orderby: 'Name asc',\r\n $filter: '(Id eq ' + id + ')',\r\n $select:\r\n 'Id,Name,ServiceGroupId,ServiceGroupName,EstimatedRuntimeMinutes',\r\n $skip: 0,\r\n $top: 1,\r\n };\r\n return httpClient\r\n .get(url, params)\r\n .then(response => response.value as Entity[]);\r\n }\r\n};\r\nconst loadData = (\r\n predicates: (string | Condition)[] | undefined,\r\n) => {\r\n return getAutoCompleteLoadDataFn({\r\n url: url,\r\n predicates: predicates,\r\n // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n // TODO: narrow down used properties list\r\n select: [\r\n 'Id',\r\n 'Name',\r\n 'ServiceGroupId',\r\n 'ServiceGroupName',\r\n 'EstimatedRuntimeMinutes',\r\n ],\r\n globalServiceGroupFilter: [],\r\n isOptionalServiceGroup: true,\r\n });\r\n};\r\nexport function GradientsPicker(props: GradientsPickerProps) {\r\n const innerLoadData = loadData(props.predicates);\r\n return (\r\n \r\n );\r\n}\r\n","import { Dialog } from '@material-ui/core';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { OnlineServiceSinglePicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { useDispatch } from 'react-redux';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { IGradientsDto } from 'api/odata/IGradientsDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { GradientsPicker } from 'app/components/pickers/AutocompletePickers/GradientsPicker';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport React from 'react';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport {\r\n Condition,\r\n ODataOperators,\r\n quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { debounce } from 'lodash';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { BasicDialogTitle } from 'app/components/BasicDialog/BasicDialogTitle';\r\nimport { BasicDialogActions } from 'app/components/BasicDialog/BasicDialogActions';\r\nimport { BasicDialogContent } from 'app/components/BasicDialog/BasicDialogContent';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nexport interface CreateRequestReservationProps {\r\n serviceRequestId: number;\r\n requestOverheadMinutes: number | null;\r\n gradient: IGradientsDto | null;\r\n userName: string;\r\n budgetId?: number;\r\n serviceGroupId: number;\r\n serviceRequestRelatedEquipments: number[];\r\n rows: IServiceRequestTableRowModel[];\r\n useSidePanel?: boolean;\r\n openPanel: (state: SidePanelOpenState) => void;\r\n createOpen: boolean;\r\n onClose: () => void;\r\n}\r\n\r\nexport const CreateRequestReservation = ({\r\n serviceRequestId,\r\n requestOverheadMinutes,\r\n gradient,\r\n userName,\r\n budgetId,\r\n serviceGroupId,\r\n serviceRequestRelatedEquipments,\r\n useSidePanel,\r\n rows,\r\n openPanel,\r\n createOpen,\r\n onClose,\r\n}: CreateRequestReservationProps) => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useRequestSamplesSlice();\r\n const [open, setOpen] = React.useState(createOpen);\r\n React.useEffect(() => {\r\n setOpen(createOpen);\r\n }, [createOpen]);\r\n const equipmentsPredicates = React.useMemo(() => {\r\n const predicates: string | Condition[] = [];\r\n predicates.push(\r\n new Condition(\r\n 'ServiceGroupId',\r\n ODataOperators.Equals,\r\n serviceGroupId,\r\n ),\r\n );\r\n if (serviceRequestRelatedEquipments.length > 0) {\r\n predicates.push(\r\n new Condition(\r\n 'Id',\r\n ODataOperators.Includes,\r\n serviceRequestRelatedEquipments,\r\n ),\r\n );\r\n }\r\n return predicates;\r\n }, [serviceGroupId, serviceRequestRelatedEquipments]);\r\n const [overheadMinText, setOverheadMinText] = React.useState(\r\n String(requestOverheadMinutes ?? ''),\r\n );\r\n const [\r\n selectedGradient,\r\n setSelectedGradient,\r\n ] = React.useState(gradient);\r\n const [selectedEquipment, setSelectedEquipment] = React.useState | null>(null);\r\n const duration = React.useMemo(() => {\r\n return rows.length > 0\r\n ? ((selectedGradient?.EstimatedRuntimeMinutes ?? 0) + +overheadMinText) *\r\n rows.length\r\n : +overheadMinText;\r\n }, [overheadMinText, rows.length, selectedGradient?.EstimatedRuntimeMinutes]);\r\n const handleOverheadSave = React.useCallback(\r\n (value?: number) => {\r\n dispatch(\r\n actions.patch({\r\n Id: serviceRequestId,\r\n OverheadMinutes: value || null,\r\n }),\r\n );\r\n },\r\n [actions, dispatch, serviceRequestId],\r\n );\r\n const debouncedPoChange = React.useMemo(\r\n () => debounce(handleOverheadSave, 500),\r\n [handleOverheadSave],\r\n );\r\n\r\n const handleOverheadChange = React.useCallback(\r\n (value: string) => {\r\n setOverheadMinText(value);\r\n debouncedPoChange(tryParseInt(value));\r\n },\r\n [debouncedPoChange],\r\n );\r\n const validToCreate = React.useMemo(() => {\r\n return selectedEquipment !== null && open;\r\n }, [open, selectedEquipment]);\r\n const handleCreateReservationButtonClick = React.useCallback(\r\n (openIn: 'reservation' | 'calendar') => {\r\n if (!selectedEquipment) return;\r\n if (openIn === 'reservation') {\r\n const params: Record = {\r\n selectedIds: String(selectedEquipment.Id),\r\n un: userName,\r\n bid: String(budgetId),\r\n srid: String(serviceRequestId),\r\n srrid: String(rows?.map(f => f.Id).join(',')),\r\n duration: String(duration),\r\n };\r\n const openProps = {\r\n renderPageType: RenderPageType.ReservationDetails,\r\n renderPageProps: {\r\n useSidePanel: useSidePanel ?? false,\r\n queryParams: params as ReservationQueryStringParameters,\r\n } as ReservationDetailsProps,\r\n expanded: false,\r\n useSidePanel: useSidePanel,\r\n isCover: useSidePanel,\r\n } as SidePanelOpenState;\r\n openPanel(openProps);\r\n onClose();\r\n } else {\r\n var p: Record = {\r\n bid: budgetId,\r\n un: userName,\r\n srid: serviceRequestId,\r\n srrid: rows?.map(r => r.Id).join(','),\r\n eid: selectedEquipment.Id,\r\n duration: duration,\r\n openToBook: true,\r\n };\r\n window.open(\r\n toRootedURL(\r\n `${GetSchedulerPagePath('calendar')}?${toQueryString(p)}`,\r\n ),\r\n '_blank',\r\n );\r\n // dispatch(\r\n // push({\r\n // pathname: GetSchedulerPagePath('calendar'),\r\n // search: toQueryString(p).toString(),\r\n // }),\r\n // );\r\n onClose();\r\n }\r\n },\r\n [\r\n budgetId,\r\n duration,\r\n onClose,\r\n openPanel,\r\n rows,\r\n selectedEquipment,\r\n serviceRequestId,\r\n useSidePanel,\r\n userName,\r\n ],\r\n );\r\n return (\r\n <>\r\n {/* */}\r\n onClose()}>\r\n \r\n {t(translations.ServiceRequestCreateRservation)}\r\n \r\n \r\n \r\n \r\n {rows.length > 0 && (\r\n \r\n {\r\n dispatch(\r\n actions.updateGradient({\r\n Id: serviceRequestId,\r\n Gradient: value as IGradientsDto,\r\n }),\r\n );\r\n setSelectedGradient(value as IGradientsDto);\r\n }}\r\n predicates={[\r\n `ServiceGroupId eq ${quoteODataValue(serviceGroupId)}`,\r\n ]}\r\n />\r\n \r\n )}\r\n\r\n \r\n handleOverheadChange(event.target.value)}\r\n label={t(\r\n rows.length > 0\r\n ? translations.RequestReservationOverallOverheadTime\r\n : translations.RequestReservationTime,\r\n )}\r\n />\r\n \r\n \r\n {\r\n setSelectedEquipment(value[0] ?? null);\r\n }}\r\n value={\r\n selectedEquipment === null\r\n ? undefined\r\n : [selectedEquipment as IServiceFilterDto]\r\n }\r\n error={selectedEquipment === null}\r\n variant=\"filled\"\r\n helperText={\r\n selectedEquipment === null\r\n ? t(translations.PleaseSelectAnEquipmentAndSamples)\r\n : undefined\r\n }\r\n fullWidth\r\n info={t(translations.PleaseSelectAnEquipmentAndSamples)}\r\n />\r\n \r\n \r\n \r\n \r\n (\r\n {\r\n handleCreateReservationButtonClick('reservation');\r\n }}\r\n >\r\n {t(translations.Continue)}\r\n \r\n ),\r\n () => (\r\n {\r\n handleCreateReservationButtonClick('calendar');\r\n }}\r\n >\r\n {t(translations.OpenInSchedule)}\r\n \r\n ),\r\n ]}\r\n rightActions={[\r\n () => (\r\n onClose()}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n ),\r\n ]}\r\n >\r\n \r\n \r\n );\r\n};\r\n","/**\r\n *\r\n * RequestSamplesPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Redirect, RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from './slice';\r\nimport {\r\n selectIsServiceRequestAdmin,\r\n selectRequestDetails,\r\n selectRequestDetailsData,\r\n selectServiceRequestCustomFormColumns,\r\n selectServiceRequestCustomFormFields,\r\n selectServiceRequestFormData,\r\n selectServiceRequestSidePanel,\r\n selectSubmitting,\r\n} from './slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SamplesTable } from '../components/SamplesTable';\r\nimport { translations } from 'locales/translations';\r\nimport { ServiceRequestCustomForm } from './components/ServiceRequestCustomForm';\r\nimport { PrintToPDF } from 'app/components/PrintToPDF';\r\nimport { PrintPDFSection } from 'app/components/PrintToPDF/PrintPDFSection';\r\nimport { usePrintPDFSlice } from 'app/components/PrintToPDF/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { NotFoundPage } from 'app/pages/NotFoundPage';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport {\r\n RenderPageType,\r\n SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { GetServiceRequestDetailsPath } from './slice/path';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { push } from 'connected-react-router';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { ServiceRequestSubmissionDetails } from '../components/ServiceRequestSubmissionDetails';\r\nimport { SubmitServiceRequestButton } from './components/SubmitServiceRequestButton';\r\nimport { CancelServiceRequestButton } from './components/CancelServiceRequestButton';\r\nimport { getServiceRequestTitle } from './getServiceRequestTitle';\r\nimport { getPrintPDFSections } from 'app/components/PrintToPDF/getPrintPDFSections';\r\nimport { ServiceRequestMilestonesSection } from '../components/ServiceRequestMilestonesSection';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ServiceRequestMilestoneDetailsProps } from '../components/ServiceRequestMilestoneDetails';\r\nimport { ServiceRequestMilestoneDetails } from '../components/ServiceRequestMilestoneDetails';\r\nimport {\r\n ServiceRequestMilestoneChargeDetails,\r\n ServiceRequestMilestoneChargeDetailsProps,\r\n} from '../components/ServiceRequestMilestoneChargeDetails';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { CloneServiceRequestButton } from './components/CloneServiceRequestButton';\r\nimport {\r\n selectAppSettings,\r\n selectForbiddenFileExtensions,\r\n selectglobalSettings,\r\n selectKnownModule,\r\n selectUploadFileSizeLimit,\r\n selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { getNotificationsLogPageLocation } from 'app/pages/EmailNotificationsPage/getNotificationsLogPageLocation';\r\nimport { Box } from '@material-ui/core';\r\nimport { ServiceRequestRowsTable } from '../components/ServiceRequestRowsTable';\r\nimport { QuoteSentToUserAlert } from './components/QuoteSentToUserAlert';\r\nimport { SendQuoteButtonButton } from './components/SendQuoteButton';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { StyledFormFieldsContainer } from 'app/components/Forms/FormsLayout';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ServiceRequestRowComments as ServiceRequestComments } from '../components/ServiceRequestRowsTable/components/ServiceRequestComments';\r\nimport { getRequestDetailsSchema } from './utils/validationSchema';\r\nimport { Formik } from 'formik';\r\nimport {\r\n IServiceRequestDetailsFormModel,\r\n IServiceRequestTableRowModel,\r\n} from './slice/types';\r\nimport { InternalServiceRequestStatus } from 'api/odata/generated/enums/InternalServiceRequestStatus';\r\nimport { DownloadAllFiles } from './components/DownloadAllFiles';\r\nimport { Body, H4 } from 'app/components/Typography';\r\nimport {\r\n ReservationDetails,\r\n ReservationDetailsProps,\r\n} from 'app/pages/ReservationDetails/Details';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ServiceRequestReservations } from '../components/ServiceRequestReservations';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CreateRequestReservation } from '../components/CreateRequestReservation';\r\n\r\nexport interface RequestSamplesPageProps\r\n extends RouteComponentProps<{ id: string }> {}\r\nexport interface ServiceRequestDetailsProps extends SidePanelContentProps {\r\n id: number;\r\n}\r\n\r\nexport function RequestSamplesPage(props: RequestSamplesPageProps) {\r\n const serviceRequestId = parseInt(props.match.params.id);\r\n if (isNaN(serviceRequestId)) {\r\n return null;\r\n }\r\n return ;\r\n}\r\nexport function RequestDetailsPage() {\r\n const location = useLocation();\r\n const id = React.useMemo(\r\n () => new URLSearchParams(location.search).get('id') ?? '',\r\n [location.search],\r\n );\r\n const serviceRequestId = parseInt(id);\r\n if (isNaN(serviceRequestId)) {\r\n return ;\r\n }\r\n return ;\r\n}\r\nexport function ServiceRequestDetails({\r\n id,\r\n useSidePanel,\r\n}: ServiceRequestDetailsProps) {\r\n const requestDetails = useSelector(selectRequestDetails);\r\n const requestDetailsData = useSelector(selectRequestDetailsData);\r\n const serviceRequestFormData = useSelector(selectServiceRequestFormData);\r\n const userProfileSettings = useSelector(selectUserProfileSettings);\r\n const appSettings = useSelector(selectAppSettings);\r\n const settings = useSelector(selectglobalSettings);\r\n const samplesAutomationEnabled = appSettings?.Modules.includes(\r\n KnownModules.SamplesAutomation,\r\n );\r\n const submittingRequest = useSelector(selectSubmitting);\r\n /**\r\n * custom form table section enabled/disabled\r\n */\r\n const SampleManagementTablesEnabled = useSelector(state =>\r\n selectKnownModule(state, KnownModules.SampleManagementTables),\r\n );\r\n const requestReservationEnabled = React.useMemo(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.ServiceRequestReservations],\r\n ) && (requestDetailsData?.ServiceRequestRelatedEquipments.length ?? 0) > 0\r\n );\r\n }, [requestDetailsData?.ServiceRequestRelatedEquipments.length, settings]);\r\n const { actions } = useRequestSamplesSlice();\r\n const { actions: printActions } = usePrintPDFSlice();\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const isMobile = DetectIsMobile();\r\n //todo\r\n const { isAdmin, isOwner, isEditable } = useSelector(\r\n selectIsServiceRequestAdmin,\r\n );\r\n const sidePanel = useSelector(selectServiceRequestSidePanel);\r\n\r\n React.useEffect(() => {\r\n dispatch(actions.loadRequestDetails(id));\r\n }, [actions, dispatch, id]);\r\n\r\n const [print, setPrint] = React.useState(false);\r\n const [reservationOpen, setReservationOpen] = React.useState(false);\r\n const [selectedRows, setSelectedRows] = React.useState<\r\n IServiceRequestTableRowModel[]\r\n >([]);\r\n const showCancelRequest = React.useMemo(() => {\r\n return (\r\n !!requestDetailsData &&\r\n requestDetailsData.Status.InternalStatusId !== 'Cancelled' &&\r\n (isAdmin ||\r\n (isOwner &&\r\n ['Draft', 'ReturnedToUser', 'Pending', 'QuoteSendToUser'].includes(\r\n requestDetailsData.Status.InternalStatusId,\r\n )))\r\n );\r\n }, [isAdmin, isOwner, requestDetailsData]);\r\n const handleCreateResClose = React.useCallback(() => {\r\n setReservationOpen(false);\r\n setSelectedRows([]);\r\n }, []);\r\n const handleCreateRowReservation = React.useCallback(\r\n (rows: IServiceRequestTableRowModel[]) => {\r\n setReservationOpen(true);\r\n setSelectedRows(rows);\r\n },\r\n [],\r\n );\r\n React.useEffect(() => {\r\n if (!print) {\r\n const printSections = getPrintPDFSections(\r\n t,\r\n userProfileSettings.GetSettingByKey('/RequestSamples.pdf')?.Value ?? '',\r\n );\r\n dispatch(printActions.setUseSections(true));\r\n dispatch(printActions.updateSections(printSections));\r\n }\r\n }, [dispatch, print, printActions, t, userProfileSettings]);\r\n\r\n const customFormFields = useSelector(selectServiceRequestCustomFormFields);\r\n const customFormColumns = useSelector(selectServiceRequestCustomFormColumns);\r\n const handlePrintToPDF = React.useCallback(() => {\r\n setPrint(true);\r\n }, []);\r\n\r\n const ForbiddenFileExtensions = useSelector(selectForbiddenFileExtensions);\r\n const UploadFileSizeLimit = useSelector(selectUploadFileSizeLimit);\r\n const schema = React.useMemo(\r\n () =>\r\n getRequestDetailsSchema({\r\n columns: customFormColumns,\r\n fields: customFormFields,\r\n isAdmin,\r\n SampleManagementTablesEnabled,\r\n ForbiddenFileExtensions,\r\n UploadFileSizeLimit,\r\n }),\r\n [\r\n ForbiddenFileExtensions,\r\n SampleManagementTablesEnabled,\r\n UploadFileSizeLimit,\r\n customFormColumns,\r\n customFormFields,\r\n isAdmin,\r\n ],\r\n );\r\n const [hasRowsErrors, setHasRowsErrors] = React.useState(\r\n undefined,\r\n );\r\n\r\n // const submitAction = React.useMemo(() => {\r\n // const x = () => (\r\n // ) =>\r\n // setErrors(errors)\r\n // }\r\n // />\r\n // );\r\n // return x;\r\n // }, [isEditable, requestDetails?.value]);\r\n // const cancelAction = React.useMemo(\r\n // () => () => (\r\n // \r\n // ),\r\n // [isAdmin, requestDetailsData?.Id],\r\n // );\r\n // const sendQuoteAction = React.useMemo(() => {\r\n // const serviceRequest = requestDetailsData;\r\n // if (serviceRequest === undefined) {\r\n // return undefined;\r\n // } else if (\r\n // !canSendQuote({ isAdmin: isAdmin, serviceRequest: serviceRequest })\r\n // ) {\r\n // return undefined;\r\n // } else {\r\n // return () => (\r\n // \r\n // );\r\n // }\r\n // }, [isAdmin, requestDetailsData]);\r\n\r\n const rightTopActions: ActionRenderer[] = React.useMemo(\r\n () => [\r\n () => (\r\n \r\n ),\r\n () => (\r\n \r\n ),\r\n () =>\r\n requestDetailsData?.Id !== undefined && (\r\n \r\n ),\r\n () => ,\r\n ],\r\n [handlePrintToPDF, requestDetailsData, t],\r\n );\r\n const leftActions = React.useMemo(() => {\r\n let actions = [] as ActionRenderer[];\r\n if (!!requestDetailsData) {\r\n if (isEditable) {\r\n actions.push(() => (\r\n \r\n \r\n setHasRowsErrors(hasErrors)\r\n }\r\n disabled={\r\n requestDetails.status === 'pending' || submittingRequest\r\n }\r\n />\r\n \r\n ));\r\n }\r\n if (showCancelRequest) {\r\n actions.push(() => (\r\n \r\n \r\n \r\n ));\r\n }\r\n if (\r\n requestDetailsData.Service.SendQuoteToUser === true &&\r\n isAdmin === true &&\r\n ['InProcess', 'Draft'].includes(\r\n requestDetailsData.Status.InternalStatusId,\r\n )\r\n ) {\r\n actions.push(() => (\r\n \r\n \r\n \r\n ));\r\n }\r\n if (\r\n isAdmin &&\r\n requestDetailsData !== undefined &&\r\n requestDetailsData?.HasFiles === true\r\n ) {\r\n actions.push(() => (\r\n \r\n ));\r\n }\r\n }\r\n return [...actions, ...rightTopActions];\r\n }, [\r\n isAdmin,\r\n isEditable,\r\n requestDetails.status,\r\n requestDetailsData,\r\n rightTopActions,\r\n showCancelRequest,\r\n submittingRequest,\r\n ]);\r\n const handleClosePrintToPDF = React.useCallback(() => {\r\n setPrint(false);\r\n }, []);\r\n\r\n const handleCloseClick = React.useCallback(() => {\r\n if (useSidePanel) {\r\n dispatch(layoutActions.resetSidePanel());\r\n dispatch(layoutActions.setRefreshTable(true));\r\n } else {\r\n dispatch(push('/ServiceRequests'));\r\n }\r\n dispatch(actions.resetRequestDetails());\r\n }, [actions, dispatch, useSidePanel]);\r\n\r\n const handleSubmit = React.useCallback(\r\n async (values: IServiceRequestDetailsFormModel) => {\r\n if (requestDetailsData === undefined) {\r\n return;\r\n }\r\n dispatch(actions.submitStep({ ...requestDetailsData, ...values }));\r\n },\r\n [actions, dispatch, requestDetailsData],\r\n );\r\n\r\n const closeCover = () => dispatch(actions.setCover(undefined));\r\n const rightActions = React.useMemo(() => {\r\n return [\r\n () => (\r\n \r\n }\r\n onClick={handleCloseClick}\r\n >\r\n {t(translations.Close)}\r\n \r\n \r\n ),\r\n ] as ActionRenderer[];\r\n }, [handleCloseClick, t]);\r\n\r\n const openRowsSidePanel = React.useCallback(\r\n state => {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: state.renderPageType,\r\n props: state.renderPageProps,\r\n }),\r\n );\r\n },\r\n [actions, dispatch],\r\n );\r\n\r\n if (requestDetails.status !== 'pending') {\r\n if (requestDetails.error !== undefined) {\r\n const statusCode = (requestDetails.error as AxiosError)?.response?.status;\r\n switch (statusCode) {\r\n case StatusCodes.NOT_FOUND:\r\n return ;\r\n }\r\n }\r\n }\r\n const getTitle = (addonType?: AddonTypesUnion) => {\r\n if (addonType === undefined) {\r\n return undefined;\r\n }\r\n switch (addonType) {\r\n case 'Milestones':\r\n return t(translations.Milestones);\r\n case 'Addons':\r\n case 'UserAddons':\r\n return t(translations.AddonCharges);\r\n case 'NA':\r\n return undefined;\r\n\r\n default:\r\n assertExhaustive(addonType);\r\n }\r\n };\r\n const sectionStyles = {\r\n background: bookitColors.base.white,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: 12,\r\n padding: '20px 24px 24px 24px',\r\n width: '100%',\r\n };\r\n\r\n if (requestDetailsData === undefined) {\r\n // nothing to show if the request details are empty but it's neither processing nor errored but the data for whatever reason is still not there\r\n return null;\r\n }\r\n const title = getServiceRequestTitle(requestDetailsData);\r\n const loading = requestDetails.status === 'pending';\r\n const cover =\r\n useSidePanel === false ? undefined : sidePanel?.type ===\r\n RenderPageType.ServiceRequestMilestone ? (\r\n \r\n ) : sidePanel?.type === RenderPageType.ServiceRequestMilestoneCharge ? (\r\n \r\n ) : sidePanel?.type === RenderPageType.ReservationDetails ? (\r\n {\r\n closeCover();\r\n dispatch(\r\n actions.loadServiceRequestRows({\r\n serviceRequestId: id,\r\n state: {\r\n pageIndex: 0,\r\n pageSize: 10,\r\n },\r\n }),\r\n );\r\n },\r\n onCloseReservation: () => {\r\n closeCover();\r\n dispatch(\r\n actions.loadServiceRequestRows({\r\n serviceRequestId: id,\r\n state: {\r\n pageIndex: 0,\r\n pageSize: 10,\r\n },\r\n }),\r\n );\r\n },\r\n ...sidePanel.props,\r\n } as ReservationDetailsProps)}\r\n />\r\n ) : undefined;\r\n\r\n return (\r\n <>\r\n \r\n {formik => (\r\n \r\n \r\n \r\n {print ? (\r\n \r\n \r\n {t(translations.ServiceRequest)}\r\n \r\n

    {title}

    \r\n
    \r\n ) : (\r\n <>\r\n )}\r\n {isEditable && (\r\n \r\n )}\r\n\r\n {/* */}\r\n {requestDetailsData !== undefined && (\r\n \r\n \r\n \r\n )}\r\n\r\n {customFormFields.length > 0 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n\r\n {requestDetailsData?.Id !== undefined &&\r\n customFormColumns?.getArray()?.length > 0 &&\r\n (requestDetailsData.Service?.CustomForm\r\n ?.VisibleToAdminOnly !== true ||\r\n isAdmin === true) && (\r\n \r\n \r\n {\r\n dispatch(\r\n printActions.setLoading({\r\n id: id,\r\n loading: loading,\r\n }),\r\n );\r\n },\r\n printing: print,\r\n }}\r\n />\r\n \r\n \r\n )}\r\n {requestReservationEnabled && (\r\n \r\n setReservationOpen(true)}\r\n isAdmin={isAdmin}\r\n />\r\n \r\n )}\r\n {samplesAutomationEnabled && (\r\n \r\n {\r\n dispatch(\r\n printActions.setLoading({\r\n id: id,\r\n loading: loading,\r\n }),\r\n );\r\n },\r\n printing: print,\r\n }}\r\n sectionStyles={tableSectionStyles}\r\n />\r\n \r\n )}\r\n\r\n {requestDetailsData !== undefined && (\r\n \r\n \r\n {\r\n dispatch(\r\n printActions.setLoading({\r\n id: id,\r\n loading: loading,\r\n }),\r\n );\r\n },\r\n printing: print,\r\n }}\r\n useSidePanel={useSidePanel}\r\n UnitType={requestDetailsData.UnitType}\r\n />\r\n \r\n \r\n )}\r\n {requestDetailsData?.Id !== undefined && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {requestReservationEnabled && !!requestDetailsData && isAdmin && (\r\n {\r\n dispatch(\r\n actions.openSidePanel({\r\n type: state.renderPageType,\r\n props: state.renderPageProps,\r\n }),\r\n );\r\n }}\r\n useSidePanel={useSidePanel}\r\n rows={selectedRows}\r\n />\r\n )}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\nexport const tableSectionStyles = {\r\n background: bookitColors.base.white,\r\n border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n borderRadius: 12,\r\n paddingBottom: 24,\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { PrintPDFItem } from './slice/types';\r\n\r\nexport function getPrintPDFSections(\r\n t: TFunction,\r\n userProfileSettingsSections: string,\r\n): PrintPDFItem[] {\r\n let sections = [\r\n {\r\n id: 'SubmissionsDetails',\r\n label: t(translations.ExportPDF_SubmissionsDetails),\r\n checked: true,\r\n },\r\n {\r\n id: 'RequestForm_Table',\r\n label: t(translations.ExportPDF_RequestForm_Table),\r\n checked: true,\r\n },\r\n {\r\n id: 'Comments',\r\n label: t(translations.ExportPDF_Comments),\r\n checked: true,\r\n },\r\n {\r\n id: 'RequestRows_Table',\r\n label: t(translations.ExportPDF_RequestRows_Table),\r\n checked: true,\r\n },\r\n {\r\n id: 'Milestones_Services',\r\n label: t(translations.ExportPDF_Milestones_Services),\r\n checked: true,\r\n },\r\n {\r\n id: 'ModificationHistory',\r\n label: t(translations.ExportPDF_ModificationHistory),\r\n checked: false,\r\n },\r\n ];\r\n if (userProfileSettingsSections.trim() !== '') {\r\n const selected = userProfileSettingsSections.split(',');\r\n if (selected.length > 0) {\r\n for (const s of sections) {\r\n const found = selected.find(f => f === s.id);\r\n s.checked = found !== undefined;\r\n }\r\n }\r\n }\r\n return sections;\r\n}\r\n","import * as Yup from 'yup';\r\nimport { ServiceRequestTableColumnsCollection } from '../slice/utils/ServiceRequestTableColumn';\r\nimport { getSchema } from 'app/pages/Samples/components/ServiceRequestRowsTable/getServiceRequestRowSchema';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getFieldSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { chain } from 'lodash';\r\n\r\nexport const getRequestDetailsSchema = (props: {\r\n columns: ServiceRequestTableColumnsCollection | null;\r\n fields: IFormFieldDto[];\r\n isAdmin: boolean;\r\n SampleManagementTablesEnabled: boolean;\r\n ForbiddenFileExtensions: string[];\r\n UploadFileSizeLimit: number;\r\n}) => {\r\n const customFormSchema = Yup.object(\r\n chain(\r\n props.fields\r\n .concat(({\r\n Id: 'NA',\r\n Active: true,\r\n Label: 'NA',\r\n } as unknown) as IFormFieldDto)\r\n .filter(f => f.Active),\r\n )\r\n .keyBy(f => f.Id)\r\n .mapValues(field =>\r\n getFieldSchema(\r\n field,\r\n props.isAdmin,\r\n props.UploadFileSizeLimit,\r\n props.ForbiddenFileExtensions,\r\n ),\r\n )\r\n .value(),\r\n );\r\n customFormSchema.omit(['NA']);\r\n let result = Yup.object({\r\n Rows:\r\n props.columns === null\r\n ? Yup.mixed()\r\n : getSchema({\r\n columns: props.columns,\r\n isAdmin: props.isAdmin,\r\n }).nullable(),\r\n FormValues: customFormSchema,\r\n });\r\n\r\n return result;\r\n};\r\n","import { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { NOTIFICATIONS_LOG_PAGE_PATH } from '.';\r\n\r\nexport const getNotificationsLogPageLocation = (props: {\r\n NotificationTypeId: EmailTypeUnion;\r\n ReferenceId: number;\r\n}): string => {\r\n return buildURL(NOTIFICATIONS_LOG_PAGE_PATH, {\r\n NotificationTypeId: props.NotificationTypeId,\r\n ReferenceId: props.ReferenceId,\r\n });\r\n};\r\n","import { IRequestDetailsModel } from './slice/types';\r\n\r\nexport function getServiceRequestTitle(\r\n requestDetails: Partial,\r\n) {\r\n return `#${requestDetails.Id} - ${requestDetails.Service?.Name}`;\r\n}\r\n","import {\r\n Card,\r\n CardActions,\r\n CardContent,\r\n CardHeader,\r\n Grid,\r\n styled,\r\n} from '@material-ui/core';\r\nimport { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';\r\nimport { ServiceRequestKanbanItemType } from '../..';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { TypeColor } from 'styles/colors/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Avatar } from 'app/components/Avatar';\r\nimport { useServiceRequestsKanbanSlice } from '../../slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getServiceRequestTicketTitle } from '../getServiceRequestTicketTitle';\r\nimport { ParentTicketDetailsButton } from '../ParentTicketDetailsButton';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconName } from 'app/AllIcons';\r\n\r\nexport interface IServiceRequestCardProps {\r\n item: ServiceRequestKanbanItemType;\r\n dragHandleProps?: DraggableProvidedDragHandleProps;\r\n}\r\nexport function ServiceRequestCard({\r\n item,\r\n ...props\r\n}: IServiceRequestCardProps) {\r\n const { t } = useTranslation();\r\n const title = getServiceRequestTicketTitle(item);\r\n const dispatch = useDispatch();\r\n const { actions } = useServiceRequestsKanbanSlice();\r\n const handleDetailsClick = () => {\r\n dispatch(actions.showEdit(item));\r\n };\r\n const samplesAutomationEnabled = useSelector(state =>\r\n selectKnownModule(state, KnownModules.SamplesAutomation),\r\n );\r\n\r\n return (\r\n \r\n \r\n {item.ParentTicketId !== null && (\r\n <>\r\n \r\n  \r\n \r\n )}\r\n {title}\r\n \r\n }\r\n {...props.dragHandleProps}\r\n />\r\n \r\n \r\n \r\n \r\n {item.ServiceRequest.Service?.Name}\r\n \r\n \r\n {item.ServiceRequest.Budget?.Name}\r\n \r\n {samplesAutomationEnabled && (\r\n \r\n {item.SamplesCount}\r\n {' / '}\r\n {item.TotalSamplesCount}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nfunction PriorityIcon({ priority = 'Medium' }: { priority?: PrioritiesUnion }) {\r\n const getIcon = (priority: PrioritiesUnion): IconName => {\r\n switch (priority) {\r\n case 'Highest':\r\n return 'chevrons-up';\r\n case 'High':\r\n return 'chevron-up';\r\n case 'Low':\r\n return 'chevron-down';\r\n case 'Lowest':\r\n return 'chevrons-down';\r\n case 'Medium':\r\n return 'equals';\r\n default:\r\n assertExhaustive(priority);\r\n }\r\n };\r\n const getIconColor = (priority: PrioritiesUnion): TypeColor => {\r\n switch (priority) {\r\n case 'Highest':\r\n case 'High':\r\n return 'danger';\r\n\r\n case 'Low':\r\n case 'Lowest':\r\n return 'primary';\r\n case 'Medium':\r\n return 'primary';\r\n default:\r\n assertExhaustive(priority);\r\n }\r\n };\r\n return ;\r\n}\r\n\r\nconst StyledCardContentRow = styled('div')(({ theme }) => ({\r\n width: '100%',\r\n overflow: 'hidden',\r\n whiteSpace: 'nowrap',\r\n textOverflow: 'ellipsis',\r\n}));\r\n\r\nconst StyledFoo = styled(Grid)(({ theme }) => ({\r\n display: 'flex',\r\n justifyContent: 'center',\r\n gap: theme.spacing(1),\r\n alignItems: 'center',\r\n}));\r\n","import { Box, Paper, styled } from '@material-ui/core';\r\nimport {\r\n DragDropContext,\r\n Draggable,\r\n DraggableProvidedDragHandleProps,\r\n DropResult,\r\n Droppable,\r\n ResponderProvided,\r\n} from 'react-beautiful-dnd';\r\nimport { Identifiable } from 'types/common';\r\nimport { ISection } from '../../slice/types';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { InfiniteScroll } from 'app/components/InfiniteScroll';\r\n\r\nexport type KanbanChangeEvent = {\r\n Id: number;\r\n sourceIndex: number;\r\n destinationIndex: number;\r\n sourceSectionId: number;\r\n destinationSectionId: number;\r\n};\r\n\r\nexport interface IKanbanProps<\r\n TSection extends Identifiable,\r\n TItem extends Identifiable\r\n> {\r\n data: Array>;\r\n renderTitle: (section: ISection) => React.ReactNode;\r\n renderItem: (\r\n item: TItem,\r\n section: ISection,\r\n\r\n dragHandleProps?: DraggableProvidedDragHandleProps,\r\n ) => React.ReactNode;\r\n onChange: ValueChangeHandler;\r\n onLoadMore: (sectionId: number) => void;\r\n}\r\nexport function Kanban<\r\n TSection extends Identifiable,\r\n TItem extends Identifiable\r\n>(props: IKanbanProps) {\r\n const handleDragEnd = (result: DropResult, provided: ResponderProvided) => {\r\n console.debug(result, provided);\r\n if (result.destination === undefined) {\r\n return;\r\n }\r\n const itemId = tryParseInt(result.draggableId);\r\n if (itemId === undefined) {\r\n return;\r\n }\r\n const sourceSectionId = tryParseInt(result.source.droppableId);\r\n if (sourceSectionId === undefined) {\r\n return;\r\n }\r\n const destinationSectionId = tryParseInt(result.destination.droppableId);\r\n if (destinationSectionId === undefined) {\r\n return;\r\n }\r\n const sourceIndex = result.source.index;\r\n if (sourceIndex === undefined) {\r\n return;\r\n }\r\n const destinationIndex = result.destination.index;\r\n if (destinationIndex === undefined) {\r\n return;\r\n }\r\n\r\n props.onChange({\r\n Id: itemId,\r\n sourceIndex,\r\n destinationIndex: destinationIndex,\r\n sourceSectionId,\r\n destinationSectionId: destinationSectionId,\r\n });\r\n };\r\n\r\n const next = (sectionId: number) => {\r\n props.onLoadMore(sectionId);\r\n };\r\n return (\r\n \r\n \r\n {props.data.map(section => (\r\n \r\n \r\n {(droppableProvided, droppableSnapshot) => (\r\n next(section.id)}\r\n >\r\n \r\n {props.renderTitle(section)}\r\n {section.data !== undefined &&\r\n section.data.items.map((item, index) => {\r\n return (\r\n \r\n {(\r\n draggableProvided,\r\n draggableSnapshot,\r\n draggableRubric,\r\n ) => (\r\n \r\n {props.renderItem(\r\n item,\r\n section,\r\n draggableProvided.dragHandleProps,\r\n )}\r\n \r\n )}\r\n \r\n );\r\n })}\r\n {droppableProvided.placeholder}\r\n \r\n \r\n )}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\nconst StyledGridContainer = styled(Box)(({ theme }) => ({\r\n marginTop: theme.spacing(2),\r\n display: 'flex',\r\n flexDirection: 'row',\r\n gap: theme.spacing(2),\r\n width: '100%',\r\n overflowX: 'scroll',\r\n}));\r\nconst StyledColumn = styled(Box)(({ theme }) => ({\r\n width: 323,\r\n}));\r\nconst CardsContainer = styled(Paper)(({ theme }) => ({\r\n backgroundColor: theme.palette.background.default,\r\n padding: theme.spacing(2),\r\n display: 'flex',\r\n gap: theme.spacing(2),\r\n flexDirection: 'column',\r\n margin: '3px',\r\n}));\r\n","/**\r\n *\r\n * ContentBox\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n createStyles,\r\n makeStyles,\r\n Theme,\r\n Box,\r\n BoxProps,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { isMobile } from 'react-device-detect';\r\n\r\n/**\r\n * Provides standard spacing for direct children of FrontendLayout\r\n */\r\nexport function FrontendLayoutContentBox({ className, ...props }: BoxProps) {\r\n const isMobile = DetectIsMobile();\r\n const classes = useStyles({ isMobile: isMobile });\r\n return ;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n margin: isMobile ? theme.spacing(2, 2, 0) : theme.spacing(4, 4, 0),\r\n },\r\n }),\r\n);\r\n","/**\r\n *\r\n * ServiceRequestsKanbanPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n Box,\r\n Chip,\r\n createStyles,\r\n Grid,\r\n makeStyles,\r\n styled,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n DragDropContext,\r\n DropResult,\r\n ResponderProvided,\r\n} from 'react-beautiful-dnd';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { ServiceRequestStatusMultiPicker } from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker';\r\nimport { ServiceRequestCard } from './components/ServiceRequestCard';\r\nimport { TitlePage } from 'app/Layout/FrontendLayout/components/PageWrapper/components/TitlePage';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { useFilters } from 'app/components/BasicTable/withSavedHistory';\r\nimport { GetFilters, StatusFilterId } from './Filter';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useServiceRequestsKanbanSlice } from './slice';\r\nimport { selectServiceRequestsKanbanData } from './slice/selectors';\r\nimport { Kanban, KanbanChangeEvent } from './components/Kanban';\r\nimport { FrontendLayoutContentBox } from 'app/Layout/FrontendLayout/components/ContentBox';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\n\r\nexport interface ServiceRequestsKanbanPageProps extends IBasePageProps {}\r\n\r\nexport type ServiceRequestKanbanItemType = IServiceRequestTicketDto;\r\n\r\ninterface IState {\r\n statuses?: IServiceRequestStatusDto[];\r\n selectedStatuses: IServiceRequestStatusDto[];\r\n tickets: Array;\r\n}\r\nexport const ServiceRequestsKanbanPagePath = '/serviceRequests/kanban';\r\nexport interface ServiceRequestsKanbanProps extends IState {\r\n onDragEnd: (result: DropResult, provided: ResponderProvided) => void;\r\n}\r\nexport function ServiceRequestsKanban(props: ServiceRequestsKanbanProps) {\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n}\r\n\r\nconst SERVICE_REQUEST_KANBAN_IGNORED_STATUSES: Array = [\r\n 'Draft',\r\n 'Pending',\r\n 'ReturnedToUser',\r\n 'Cancelled',\r\n 'Completed',\r\n];\r\nexport function ServiceRequestsKanbanPage(\r\n props: ServiceRequestsKanbanPageProps,\r\n) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const classes = useStyles({ isMobile: isMobile });\r\n const dispatch = useDispatch();\r\n const { actions } = useServiceRequestsKanbanSlice();\r\n // const [state, , extendState] = useAsyncExtendedState({\r\n // selectedStatuses: [],\r\n // tickets: [],\r\n // });\r\n\r\n useEffectOnMount(() => {\r\n //todo\r\n });\r\n\r\n const { appliedFilters, setFilterValue } = useFilters(\r\n ServiceRequestsKanbanPagePath,\r\n GetFilters,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n true,\r\n );\r\n\r\n const handleSelectedStatusesChange = (value: FilterValueType) => {\r\n setFilterValue(StatusFilterId, value as FilterValueType);\r\n };\r\n\r\n const selectedStatuses = (appliedFilters?.find(f => f.id === StatusFilterId)\r\n ?.value as IServiceRequestStatusDto[] | undefined)?.filter(\r\n status =>\r\n !SERVICE_REQUEST_KANBAN_IGNORED_STATUSES.includes(\r\n status.InternalStatusId,\r\n ),\r\n );\r\n\r\n React.useEffect(() => {\r\n const selectedStatuses = appliedFilters?.find(f => f.id === StatusFilterId)\r\n ?.value as IServiceRequestStatusDto[] | undefined;\r\n dispatch(actions.setSelectedStatuses(selectedStatuses));\r\n }, [actions, appliedFilters, dispatch]);\r\n\r\n const kanban = useSelector(selectServiceRequestsKanbanData);\r\n const handleChange = React.useCallback(\r\n (value: KanbanChangeEvent) => {\r\n dispatch(actions.reorder(value));\r\n },\r\n [actions, dispatch],\r\n );\r\n const handleMore = (sectionId: number) => {\r\n dispatch(actions.getMoreItems(sectionId));\r\n };\r\n\r\n return (\r\n
    \r\n \r\n \r\n\r\n \r\n\r\n {kanban !== undefined && (\r\n (\r\n \r\n )}\r\n renderTitle={section => (\r\n \r\n \r\n \r\n )}\r\n onChange={handleChange}\r\n onLoadMore={handleMore}\r\n />\r\n )}\r\n \r\n
    \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n // root css\r\n },\r\n }),\r\n);\r\n\r\nconst StyledServiceRequestStatusMultiPicker = styled(\r\n ServiceRequestStatusMultiPicker,\r\n)(({ theme }) => ({\r\n marginTop: theme.spacing(2),\r\n}));\r\n","import { createGlobalStyle } from 'styled-components';\r\n\r\nexport const GlobalStyle = createGlobalStyle`\r\n \r\n/* heebo-300 - latin_hebrew */\r\n@font-face {\r\n font-family: 'Heebo';\r\n font-style: normal;\r\n font-weight: 300;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-regular - latin_hebrew */\r\n@font-face {\r\n font-family: 'Heebo';\r\n font-style: normal;\r\n font-weight: 400;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-500 - latin_hebrew */\r\n@font-face {\r\n font-family: 'Heebo';\r\n font-style: normal;\r\n font-weight: 500;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-700 - latin_hebrew */\r\n@font-face {\r\n font-family: 'Heebo';\r\n font-style: normal;\r\n font-weight: 700;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n /* open-sans-regular - latin */\r\n @font-face {\r\n font-family: 'Open Sans';\r\n font-style: normal;\r\n font-weight: 400;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/open-sans-v20-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n url('${process.env.PUBLIC_URL}/fonts/open-sans-v20-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n }\r\n/* open-sans-hebrew */\r\n @font-face {\r\n font-family: 'Open Sans Hebrew', serif;\r\n font-style: normal;\r\n font-weight: 400;\r\n src: local(''),\r\n url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Regular.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Regular-1.woff') format('woff'), \r\n url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Bold.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-ExtraBold.woff') format('woff'),\r\n url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Light.woff') format('woff');\r\n }\r\n`;\r\nexport const LatoStyle = createGlobalStyle`\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BoldItalic.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BoldItalic.woff') format('woff');\r\n font-weight: bold;\r\n font-style: italic;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BlackItalic.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BlackItalic.woff') format('woff');\r\n font-weight: 900;\r\n font-style: italic;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff') format('woff');\r\n font-weight: 900;\r\n font-style: normal;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff') format('woff');\r\n font-weight: bold;\r\n font-style: normal;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff') format('woff');\r\n font-weight: 300;\r\n font-style: normal;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff');\r\n font-weight: normal;\r\n font-style: normal;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-LightItalic.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-LightItalic.woff') format('woff');\r\n font-weight: 300;\r\n font-style: italic;\r\n font-display: swap;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Lato', sans-serif;\r\n src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Italic.woff2') format('woff2'),\r\n url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Italic.woff') format('woff');\r\n font-weight: normal;\r\n font-style: italic;\r\n font-display: swap;\r\n}\r\n`;\r\nexport const CustomStyle = createGlobalStyle`\r\n body {\r\n margin-bottom: env(safe-area-inset-bottom);\r\n }\r\n #root {\r\n @media (max-width: 960px) {\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n }\r\n }\r\n :root {\r\n --box-shadow-xs: 0px 1px 2px 0px rgba(16, 24, 40, 0.10), 0px 1px 3px 0px rgba(16, 24, 40, 0.10);\r\n --box-shadow-s: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10);\r\n --box-shadow-m: 0px 4px 4px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08);\r\n --box-shadow-l: 0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08);\r\n --box-shadow-xl: 0px 24px 48px -12px rgba(16, 24, 40, 0.18);\r\n --box-shadow-border-top: 0px 1px 0px 0px #E3E8EF inset;\r\n }\r\n\r\n body {\r\n margin-bottom: env(safe-area-inset-bottom);\r\n }\r\n\r\n #root {\r\n @media (max-width: 960px) {\r\n margin-bottom: env(safe-area-inset-bottom, 50px);\r\n }\r\n }\r\n`;\r\n","/**\r\n * Asynchronously loads the component for NotFoundPage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotFoundPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.NotFoundPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const FrontendLayout = lazyLoad(\r\n () => import('./index'),\r\n module => module.FrontendLayout,\r\n);\r\n","import i18next from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\n// import LanguageDetector from 'i18next-browser-languagedetector';\r\nimport Backend from 'i18next-http-backend';\r\n\r\nimport en from './en/GRes.json';\r\nimport { convertLanguageJsonToObject } from './translations';\r\n\r\nexport const translationsJson = {\r\n en: {\r\n translation: en,\r\n },\r\n};\r\n\r\n// Create the 'translations' object to provide full intellisense support for the static json files.\r\nconvertLanguageJsonToObject(en);\r\n\r\n// https://github.com/i18next/i18next-http-backend\r\nconst backendOptions = {\r\n // path where resources get loaded from, or a function\r\n // '/api/locales/{{lng}}/{{ns}}.json',\r\n // returning a path:\r\n // function(lngs, namespaces) { return customPath; }\r\n // the returned path will interpolate lng, ns if provided like giving a static path\r\n //\r\n // If allowMultiLoading is false, lngs and namespaces will have only one element each,\r\n // If allowMultiLoading is true, lngs and namespaces can have multiple elements\r\n loadPath: function (lngs, namespaces) {\r\n console.log('i18next-httpBackend', lngs, namespaces);\r\n return process.env.PUBLIC_URL + '/api/locales?lng={{lng}}&ns={{ns}}';\r\n },\r\n};\r\n\r\nexport const i18n = i18next\r\n // use i18next-http-backend to fetch localization files from the server\r\n .use(Backend)\r\n // pass the i18n instance to react-i18next.\r\n .use(initReactI18next)\r\n // detect user language\r\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\r\n // .use(LanguageDetector)\r\n // init i18next\r\n // for all options read: https://www.i18next.com/overview/configuration-options\r\n .init({\r\n // The whole Animals Kiosk must be localized to he\r\n // TODO: use the system/app setting to set initial locale here\r\n lng: 'en',\r\n fallbackLng: 'en',\r\n // defaultNS: 'GRes',\r\n // fallbackNS: 'GRes',\r\n debug:\r\n process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test',\r\n\r\n // defaultNS: 'tran',\r\n appendNamespaceToMissingKey: true,\r\n interpolation: {\r\n escapeValue: false, // not needed for react as it escapes by default\r\n },\r\n backend: backendOptions,\r\n });\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalTypes\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalTypesPage,\r\n);\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n alert: () => _t(translations.Alert, 'Alert'),\r\n ok: () => _t(translations.OK, 'OK'),\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.dialogAlert || initialState;\r\n\r\nexport const selectDialogAlert = createSelector([selectSlice], state => state);\r\n","/**\r\n *\r\n * Alert\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n Dialog,\r\n DialogTitle,\r\n DialogContent,\r\n DialogContentText,\r\n DialogActions,\r\n useTheme,\r\n useMediaQuery,\r\n} from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { messages } from './messages';\r\nimport { useDialogAlertSlice } from './slice';\r\nimport { selectDialogAlert } from './slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport const DialogAlert = () => {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useDialogAlertSlice();\r\n const { open, content } = useSelector(selectDialogAlert);\r\n const handleClose = () => {\r\n dispatch(actions.hideAlert());\r\n };\r\n const theme = useTheme();\r\n const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\r\n\r\n return (\r\n \r\n {t(messages.alert())}\r\n \r\n \r\n {content}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SnackbarManager = lazyLoad(\r\n () => import('./index'),\r\n module => module.default,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InternalIdLoginPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InternalIdLoginPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.InternalIdLoginPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalsListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalsListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalsListPage,\r\n);\r\n","/**\r\n *\r\n * PosLayout\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport interface PosLayoutProps {\r\n children: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Empty Layout optimized for touch enabled devices - medium screen size\r\n * Originally developed for a POS (large anminals - technion anm)\r\n */\r\nexport function PosLayout({ children }: PosLayoutProps) {\r\n return (\r\n \r\n
    {children}
    \r\n
    \r\n );\r\n}\r\nconst PosWrapper = styled.div`\r\n &.pos-root {\r\n display: flex;\r\n & .pos-content {\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n height: 100dvh;\r\n overflow: auto;\r\n }\r\n }\r\n`;\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCaseConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCaseConsumablesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalCaseConsumablesPage,\r\n);\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const FlexColumnDiv = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n`;\r\n","/**\r\n *\r\n * LoginLayout\r\n *\r\n */\r\nimport { Copyright } from 'app/components/Copyright';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { makeStyles, Theme, useTheme } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport {\r\n AppBar,\r\n Box,\r\n ListItemIcon,\r\n ListItemText,\r\n MenuItem,\r\n Toolbar,\r\n} from '@material-ui/core';\r\nimport { BookitlabLogo } from 'app/components/BookitlabLogo';\r\nimport { FlexColumnDiv } from '../../components/basic/Wrappers/FlexWrappers/flexColumn';\r\nimport { StyledUserMenu } from '../FrontendLayout/components/TopBar/styled';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface LoginLayoutProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n root: {\r\n flexGrow: 1,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n minHeight: '100dvh',\r\n },\r\n main: {\r\n //marginTop: theme.spacing(3),\r\n flexGrow: 1,\r\n },\r\n mainWrapper: {\r\n height: '80dvh',\r\n },\r\n footer: {},\r\n paper: {\r\n //marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n minWidth: '40%',\r\n '& p,h1': {\r\n padding: theme.spacing(1),\r\n },\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n}));\r\n\r\nexport function LoginLayout({ children }: LoginLayoutProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const theme = useTheme();\r\n const handleClick = (event: React.MouseEvent) => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n const classes = useStyles();\r\n return (\r\n
    \r\n \r\n \r\n handleClick(event)}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {children}\r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n}\r\n\r\nexport interface LogoMenuProps {\r\n anchorEl: HTMLElement | null;\r\n handleClose: () => void;\r\n theme: Theme;\r\n}\r\nconst LogoMenu = React.memo(function LogoMenuFunc(props: LogoMenuProps) {\r\n const { t } = useTranslation();\r\n const isMobile = DetectIsMobile();\r\n return (\r\n <>\r\n props.handleClose()}\r\n >\r\n props.handleClose()}\r\n component={'a'}\r\n href={toRootedURL('/account/signout')}\r\n >\r\n \r\n \r\n \r\n \r\n {t(translations.main_master_LogOutLinkText)}\r\n \r\n \r\n \r\n \r\n );\r\n});\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalsHomePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalsHomePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalsHomePage,\r\n);\r\n","/**\r\n *\r\n * PrivateAnimalRoute\r\n *\r\n */\r\nimport { selectInternalIdLogin } from 'app/pages/Animals/InternalIdLoginPage/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Redirect, Route, RouteProps, useLocation } from 'react-router';\r\nimport { useInternalIdLoginSlice } from '../InternalIdLoginPage/slice';\r\n\r\nexport interface PrivateAnimalRouteProps extends RouteProps {}\r\n\r\nexport function PrivateAnimalRoute(props: PrivateAnimalRouteProps) {\r\n const login = useSelector(selectInternalIdLogin);\r\n const location = useLocation();\r\n const isAuthenticated = login.identity?.Id !== undefined;\r\n const isInitialized = login.initialized;\r\n const dispatch = useDispatch();\r\n const { actions } = useInternalIdLoginSlice();\r\n React.useEffect(() => {\r\n if (!isInitialized) {\r\n dispatch(actions.init({ isLargeAnimals: true }));\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n if (!isInitialized) {\r\n return <>Inintializing...;\r\n }\r\n if (isAuthenticated) {\r\n return ;\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for CreateNewCasePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CreateNewCasePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CreateNewCasePage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SamplesListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SamplesListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SamplesListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RunPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RunDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.RunDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RequestSamplesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RequestSamplesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.RequestSamplesPage,\r\n);\r\n\r\nexport const RequestDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.RequestDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for TrainingSessionsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TrainingSessionsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.TrainingSessionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Buildings Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BuildingsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BuildingsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Reservations History Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const History = lazyLoad(\r\n () => import('./index'),\r\n module => module.HistoryPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AddNewReportPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AddNewReportPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for WaitingListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TrainingWaitingListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.TrainingWaitingListPage,\r\n);\r\n","import { createBrowserHistory } from 'history';\r\n\r\nexport const history = createBrowserHistory({\r\n basename: process.env.PUBLIC_URL,\r\n});\r\n","/**\r\n *\r\n * Asynchronously loads the component for EmailNotifications\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const EmailNotificationsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.EmailNotificationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ExperimentTemplates\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ExperimentTemplatesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ExperimentTemplatesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UsersHistory\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UsersHistoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.UsersHistory,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.UserTrainingPage,\r\n);\r\n","/*\r\n * Asynchronously loads the component for NotAvailable\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotAvailable = lazyLoad(\r\n () => import('./index'),\r\n module => module.NotAvailable,\r\n);\r\n","/**\r\n *\r\n * RestrictedRoute\r\n *\r\n */\r\nimport {\r\n selectAuthenticatedUser,\r\n selectSiteMapProvider,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router';\r\nimport { RouteProps, Redirect, Route } from 'react-router-dom';\r\n\r\nexport function RestrictedRoute(props: RouteProps): React.ReactElement {\r\n const User = useSelector(selectAuthenticatedUser);\r\n const { pathname } = useLocation();\r\n const siteMapProvider = useSelector(selectSiteMapProvider);\r\n\r\n const { component: Component, ...rest } = props;\r\n\r\n const render = propss => {\r\n let allowedNode = siteMapProvider.accesibleByRole(pathname, User);\r\n if (allowedNode === false) {\r\n return ;\r\n } else if (allowedNode === true) {\r\n return ;\r\n } else {\r\n return undefined;\r\n }\r\n };\r\n return ;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for Users Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Users = lazyLoad(\r\n () => import('./index'),\r\n module => module.UsersPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalExtendedBillingReportPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalExtendedBillingReportPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalExtendedBillingReportPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for User Training (Modification) History Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingHistoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.UserTrainingHistory,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OtherService Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OtherServicesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.OtherServicesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BudgetsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BudgetsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BudgetsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Reservations History Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ServiceRequestListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for WorkOrders Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const WorkOrdersPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.WorkOrders,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const DocumentsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.DocumentsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.QuizPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.QuizDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CreateUserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.TrainingDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SampleModificationsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SampleModificationsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SampleModificationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UsageHistory Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UsageHistory = lazyLoad(\r\n () => import('./index'),\r\n module => module.UsageHistoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RunsListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RunsListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.RunsListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCasesHistoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCasesHistoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalCasesHistoryPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SendEmailToUsersPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SendEmailToUsers,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Charges Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Charges = lazyLoad(\r\n () => import('./index'),\r\n module => module.ChargesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for MyAssetsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const MyAssetsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.MyAssetsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Locations Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Locations = lazyLoad(\r\n () => import('./index'),\r\n module => module.LocationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Building Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BuildingPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BuildingPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Campuses Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CampusesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CampusesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Areas Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AreasPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AreasPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationList Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LocationListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LocationListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationList Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubLocationListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SubLocationListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InvoiceBatches Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceBatches = lazyLoad(\r\n () => import('./index'),\r\n module => module.InvoiceBatchesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CategoriesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CategoriesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CategoriesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CategoryGroupsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CategoryGroupsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CategoryGroupsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingPreviewPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingPreviewPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BillingPreviewPage,\r\n);\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n state.onlineBudgetsStatus || initialState;\r\n\r\nexport const selectOnlineBudgetsStatus = createSelector(\r\n [selectSlice],\r\n state => state,\r\n);\r\n\r\nexport const selectOnlineBudgetsStatusTableState = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.tableState,\r\n);\r\nexport const selectOnlineBudgetsStatusSelected = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.selected,\r\n);\r\nexport const selectPayState = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.pay,\r\n);\r\n\r\nexport const selectGenerateInvoicesState = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.generateInvoicesState,\r\n);\r\nexport const selectChargeOnlineBudgetsState = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.charge,\r\n);\r\nexport const selectEndDate = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.endDate,\r\n);\r\n\r\nexport const selectIGenerateInvoicesAndSendToSapState = createSelector(\r\n [selectOnlineBudgetsStatus],\r\n state => state.generateInvoicesAndSendToSap,\r\n);\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest, takeLeading } from 'redux-saga/effects';\r\nimport { onlineBudgetsStatusActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { AxiosError } from 'axios';\r\nimport { selectEndDate } from './selectors';\r\nimport { SnackBarActionType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { IPaymentPayload, PaymentApi } from 'api/PaymentApi';\r\nimport {\r\n ChargeOnlineBudgetResponse,\r\n IPayActionPayload,\r\n PaymentMethods,\r\n} from './types';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport {\r\n BillingPreviewApi,\r\n UpdateModel,\r\n} from 'app/pages/BillingPreviewPage/Actions/Apis';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { ExportToExcel } from 'utils/ExportToExcel';\r\n\r\nfunction* doGetTableData(action: PayloadAction<{ endDate: Date }>) {\r\n try {\r\n const response: IODataQueryResponse = yield call(\r\n httpClient.get,\r\n '/api/odata/v4/InvoiceBudgetBalances',\r\n {\r\n endDate: action.payload.endDate,\r\n },\r\n );\r\n yield put(actions.getTableData_Success(response.value));\r\n } catch (error: unknown) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n message: i18next.t(translations.errormessage),\r\n variant: 'error',\r\n }),\r\n );\r\n yield put(actions.getTableData_Error(Error));\r\n }\r\n}\r\n\r\nfunction* doGenerateInvoices(action: PayloadAction<{ endDate: Date }>) {\r\n try {\r\n const api = new BillingPreviewApi();\r\n const payload: UpdateModel = {\r\n Item: {\r\n ServiceGroupsCsv: '',\r\n UserGroupsCsv: '',\r\n PeriodType: getPeriodTypesEntity('CustomDate')?.Id,\r\n Start: new Date(\r\n dateUtils.addYears(action.payload.endDate, -2),\r\n ).toISOString(),\r\n End: new Date(action.payload.endDate).toISOString(),\r\n Remarks: '',\r\n BudgetIds: [],\r\n BudgetIncluded: true,\r\n invoiceBy: undefined,\r\n CoreInvoiceBy: '',\r\n InvoiceCreatedBy: '',\r\n InvoiceVat: '',\r\n FundingTypeId: undefined,\r\n CoreBy: 0,\r\n ShowZeroAmountInvoices: false,\r\n ShowInvoicePartialEvents: false,\r\n },\r\n Async: false,\r\n Recalculate: false,\r\n };\r\n\r\n const result: IResponseType = yield call(api.FormView1_UpdateItem, payload);\r\n for (const message of result.SuccessMessages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: message,\r\n }),\r\n );\r\n }\r\n for (const message of result.WarningMessages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'warning',\r\n message: message,\r\n }),\r\n );\r\n }\r\n for (const message of result.ErrorMessages) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: message,\r\n }),\r\n );\r\n }\r\n\r\n yield put(actions.generateInvoices_Success());\r\n yield put(actions.getTableData({ endDate: action.payload.endDate }));\r\n } catch {\r\n yield put(actions.generateInvoices_Error());\r\n }\r\n}\r\n\r\nfunction* doChargeOnlineBudgets(\r\n action: PayloadAction,\r\n) {\r\n const endDate = yield select(selectEndDate);\r\n if (endDate == null) {\r\n return;\r\n }\r\n const url = '/api/odata/v4/InvoiceBudgetBalances';\r\n const processed: IInvoiceBudgetBalanceDto[] = [];\r\n const errorMessages: string[] = [];\r\n const messageKey = 'chargeOnlineBudgets';\r\n for (let index = 0; index < action.payload.length; index++) {\r\n const charge = action.payload[index];\r\n yield put(actions.chargeOnlineBudgets_SetCurrentRecord(charge));\r\n yield put(\r\n actions.chargeOnlineBudgets_SetStatus(\r\n (100 * (index + 1)) / action.payload.length,\r\n ),\r\n );\r\n try {\r\n const response: ChargeOnlineBudgetResponse = yield call(\r\n httpClient.post,\r\n url,\r\n charge,\r\n { params: { endDate: endDate } },\r\n );\r\n let success = response.SuccessTransactionsCount === 1;\r\n if (success) {\r\n processed.push(charge);\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n key: messageKey,\r\n //todo: add to gres\r\n\r\n message: `Successfully processed ${charge.HostBudgetNumber} ${charge.ServiceGroup}`,\r\n }),\r\n );\r\n }\r\n\r\n for (const message of response.Messages) {\r\n errorMessages.push(\r\n `${charge.UserGroup} ${charge.Budget} ${charge.ServiceGroup}: ${message}`,\r\n );\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n key: messageKey,\r\n message: message,\r\n }),\r\n );\r\n }\r\n } catch (error) {\r\n //todo: extract error message from error response\r\n const errorMessage = (error as AxiosError)?.response?.data?.error.message;\r\n yield put(actions.chargeOnlineBudgets_Error([errorMessage]));\r\n return;\r\n }\r\n }\r\n yield put(actions.chargeOnlineBudgets_SetCurrentRecord(undefined));\r\n yield put(actions.chargeOnlineBudgets_Success(processed));\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: messageKey,\r\n variant:\r\n processed.length === action.payload.length\r\n ? 'success'\r\n : processed.length === 0\r\n ? 'error'\r\n : 'warning',\r\n message: `Processed successfully ${processed.length} out of ${action.payload.length}`,\r\n }),\r\n );\r\n if (errorMessages.length === 0) {\r\n yield put(actions.chargeOnlineBudgets_SetDialogOpen(false));\r\n }\r\n if (errorMessages.length > 0) {\r\n yield put(actions.chargeOnlineBudgets_Error(errorMessages));\r\n }\r\n // refresh table only if any of the rows were processed successfully\r\n if (processed.length > 0) {\r\n // yield put(actions.getTableData({ endDate: endDate }));\r\n\r\n yield put(\r\n appSettingsActions.addNotification({\r\n key: 'updatedSuccess',\r\n message: i18next.t(translations.ProcessingFinished),\r\n variant: 'success',\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n}\r\nfunction* doDownloadChargeOnlineBudgetsErrors(\r\n action: PayloadAction,\r\n) {\r\n if (action.payload !== undefined) {\r\n var fields = ['Errors'];\r\n const x = new ExportToExcel('Errors');\r\n x.AddWorkSheetHeader(fields);\r\n x.AddWorkSheetData(action.payload.map(err => ({ errors: err })));\r\n yield call(x.ExportToExcel, 'errors', x.book);\r\n }\r\n}\r\nfunction* doPay(action: PayloadAction) {\r\n const paymentDate = new Date();\r\n const payments = action.payload.Rows.map(balanceRow =>\r\n JSON.parse(balanceRow.Invoices ?? '[]').map(invoice => {\r\n const payment: IPaymentPayload = {\r\n InvoiceId: invoice.Id ?? undefined,\r\n Method: {\r\n Id: action.payload.PaymentMethod,\r\n Name: PaymentMethods[action.payload.PaymentMethod],\r\n },\r\n Amount: invoice.Charges - invoice.Payments,\r\n Budget: toEntity(balanceRow.BudgetId, balanceRow.Budget),\r\n Date: paymentDate,\r\n ServiceGroup: toEntity(\r\n balanceRow.ServiceGroupId,\r\n balanceRow.ServiceGroup,\r\n ),\r\n ShouldCloseInvoice: true,\r\n };\r\n return payment;\r\n }),\r\n )\r\n .reduce((accumulator, value) => accumulator?.concat(value ?? []), [])\r\n ?.filter(payment => payment.Amount !== undefined && payment.Amount > 0);\r\n if (payments === undefined) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: i18next.t(translations.AnErrorOccurred),\r\n actionType: SnackBarActionType.refreshTable,\r\n }),\r\n );\r\n return;\r\n }\r\n\r\n const messages: IResponseType[] = [];\r\n for (const [index, payment] of payments.entries()) {\r\n try {\r\n const result: IResponseType = yield call(PaymentApi.AddPayment, payment);\r\n yield put(actions.pay_setStatus((100 * (index + 1)) / payments.length));\r\n messages.push(result);\r\n } catch (error) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: (error as AxiosError).response?.data?.error?.message,\r\n actionType: SnackBarActionType.refreshTable,\r\n }),\r\n );\r\n yield put(actions.pay_Finish([]));\r\n return;\r\n }\r\n }\r\n yield put(actions.pay_Finish(messages));\r\n const success =\r\n messages.filter(\r\n message =>\r\n message.SuccessMessages.length > 0 &&\r\n message.ErrorMessages.length === 0,\r\n ).length === payments.length;\r\n if (success) {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'success',\r\n message: i18next.t(translations.PaymentCreatedSuccess),\r\n }),\r\n );\r\n yield put(layoutActions.setRefreshTable(true));\r\n }\r\n}\r\n\r\nfunction* doGenerateSelectedInvoices(\r\n action: PayloadAction<{\r\n endDate: Date;\r\n selected: IInvoiceBudgetBalanceDto[];\r\n chargeOnlineBudgets: boolean;\r\n }>,\r\n) {\r\n const result: IResponseType = {\r\n SuccessMessages: [],\r\n ErrorMessages: [],\r\n WarningMessages: [],\r\n };\r\n try {\r\n for (const [index, item] of action.payload.selected.entries()) {\r\n yield put(\r\n actions.GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord(item),\r\n );\r\n yield put(\r\n actions.GenerateInvoicesAndChargeOnlineBudgets_SetProgress(\r\n Math.floor((100 * index) / action.payload.selected.length),\r\n ),\r\n );\r\n const api = new BillingPreviewApi();\r\n const payload: UpdateModel = {\r\n Item: {\r\n ServiceGroupsCsv: item.ServiceGroupId.toString(),\r\n PeriodType: getPeriodTypesEntity('CustomDate')?.Id,\r\n Start: new Date(\r\n dateUtils.addYears(action.payload.endDate, -2),\r\n ).toISOString(),\r\n End: new Date(action.payload.endDate).toISOString(),\r\n Remarks: '',\r\n BudgetIds: [item.BudgetId],\r\n BudgetIncluded: true,\r\n invoiceBy: undefined,\r\n CoreInvoiceBy: '',\r\n InvoiceCreatedBy: '',\r\n InvoiceVat: '',\r\n FundingTypeId: undefined,\r\n CoreBy: 0,\r\n ShowZeroAmountInvoices: false,\r\n ShowInvoicePartialEvents: false,\r\n },\r\n Async: false,\r\n Recalculate: false,\r\n };\r\n\r\n const response: IResponseType = yield call(\r\n api.FormView1_UpdateItem,\r\n payload,\r\n );\r\n Object.keys(result).forEach(key =>\r\n response[key].forEach(message => result[key].push(message)),\r\n );\r\n }\r\n } catch {\r\n yield put(\r\n appSettingsActions.addNotification({\r\n variant: 'error',\r\n message: 'An error occurred',\r\n }),\r\n );\r\n yield put(actions.GenerateSelectedInvoices_Error());\r\n return;\r\n }\r\n yield put(actions.GenerateSelectedInvoices_Success());\r\n if (action.payload.chargeOnlineBudgets) {\r\n yield put(actions.chargeOnlineBudgets(action.payload.selected));\r\n }\r\n}\r\n\r\nexport function* onlineBudgetsStatusSaga() {\r\n yield takeLatest(actions.getTableData.type, doGetTableData);\r\n yield takeLeading(actions.generateInvoices.type, doGenerateInvoices);\r\n yield takeLeading(actions.chargeOnlineBudgets.type, doChargeOnlineBudgets);\r\n yield takeLeading(actions.pay.type, doPay);\r\n yield takeLeading(\r\n actions.chargeOnlineBudgets_DownloadErrors,\r\n doDownloadChargeOnlineBudgetsErrors,\r\n );\r\n yield takeLeading(\r\n actions.GenerateInvoicesAndChargeOnlineBudgets.type,\r\n doGenerateSelectedInvoices,\r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { onlineBudgetsStatusSaga } from './saga';\r\nimport { IPayActionPayload, OnlineBudgetsStatusState } from './types';\r\n\r\nexport const initialState: OnlineBudgetsStatusState = {\r\n endDate: null,\r\n needTableRefresh: false,\r\n tableState: {\r\n processing: false,\r\n },\r\n selected: [],\r\n generateInvoicesState: {\r\n processing: false,\r\n },\r\n charge: {\r\n processing: false,\r\n },\r\n pay: {},\r\n generateInvoicesAndSendToSap: {},\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'onlineBudgetsStatus',\r\n initialState,\r\n reducers: {\r\n setEndDate(state, action: PayloadAction) {\r\n state.endDate = action.payload;\r\n },\r\n setneedTableRefresh(state, action: PayloadAction) {\r\n state.needTableRefresh = action.payload;\r\n },\r\n getTableData(state, action: PayloadAction<{ endDate: Date }>) {\r\n state.tableState.processing = true;\r\n state.tableState.error = undefined;\r\n },\r\n getTableData_Success(\r\n state,\r\n action: PayloadAction>,\r\n ) {\r\n state.tableState.processing = false;\r\n state.tableState.error = undefined;\r\n state.tableState.data = action.payload;\r\n },\r\n getTableData_Error(state, action: PayloadAction) {\r\n state.tableState.processing = false;\r\n state.tableState.error = 'ERROR';\r\n },\r\n\r\n setSelected(state, action: PayloadAction>) {\r\n state.selected = action.payload;\r\n },\r\n\r\n generateInvoices(\r\n state,\r\n action: PayloadAction<{\r\n endDate: Date;\r\n }>,\r\n ) {\r\n state.generateInvoicesState.processing = true;\r\n },\r\n generateInvoices_Success(state, action: PayloadAction) {\r\n state.generateInvoicesState.processing = false;\r\n },\r\n generateInvoices_Error(state, action: PayloadAction) {\r\n state.generateInvoicesState.processing = false;\r\n },\r\n\r\n chargeOnlineBudgets(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.charge = {\r\n data: action.payload,\r\n processing: true,\r\n dialogOpen: true,\r\n };\r\n },\r\n\r\n chargeOnlineBudgets_SetCurrentRecord(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.charge.currentRecord = action.payload;\r\n },\r\n chargeOnlineBudgets_SetStatus(state, action: PayloadAction) {\r\n state.charge.progress = action.payload;\r\n },\r\n chargeOnlineBudgets_SetDialogOpen(state, action: PayloadAction) {\r\n state.charge.dialogOpen = action.payload;\r\n },\r\n\r\n chargeOnlineBudgets_Success(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.charge.processing = false;\r\n },\r\n chargeOnlineBudgets_Error(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.charge.processing = false;\r\n state.charge.errors = action.payload;\r\n },\r\n chargeOnlineBudgets_DownloadErrors(\r\n state,\r\n action: PayloadAction,\r\n ) {},\r\n\r\n pay(state, action: PayloadAction) {\r\n state.pay.data = action.payload;\r\n state.pay.dialogOpen = true;\r\n state.pay.status = 'pending';\r\n },\r\n pay_setStatus(state, action: PayloadAction) {\r\n state.pay.progress = action.payload;\r\n },\r\n pay_Open(state, action: PayloadAction) {\r\n state.pay = {\r\n dialogOpen: true,\r\n selected: action.payload,\r\n };\r\n },\r\n pay_SetSelected(state, action: PayloadAction) {\r\n state.pay.selected = action.payload;\r\n },\r\n\r\n pay_Finish(state, action: PayloadAction) {\r\n state.pay.status = 'resolved';\r\n state.pay.messages = action.payload;\r\n // action.payload.reduce((acc, val) => ({\r\n // SuccessMessages: acc.SuccessMessages.concat(val.SuccessMessages),\r\n // ErrorMessages: acc.ErrorMessages.concat(val.ErrorMessages),\r\n // WarningMessages: acc.WarningMessages.concat(val.WarningMessages),\r\n // }));\r\n },\r\n pay_Close(state, action: PayloadAction) {\r\n state.pay = {\r\n dialogOpen: false,\r\n };\r\n },\r\n\r\n GenerateInvoicesAndChargeOnlineBudgets(\r\n state,\r\n action: PayloadAction<{\r\n endDate: Date;\r\n selected: IInvoiceBudgetBalanceDto[];\r\n chargeOnlineBudgets: boolean;\r\n }>,\r\n ) {\r\n state.generateInvoicesAndSendToSap = {\r\n dialogOpen: true,\r\n progress: 0,\r\n processing: true,\r\n selected: action.payload.selected,\r\n endDate: action.payload.endDate,\r\n };\r\n },\r\n GenerateSelectedInvoices_Success(state, action: PayloadAction) {\r\n state.generateInvoicesAndSendToSap = {};\r\n state.charge = {};\r\n },\r\n GenerateSelectedInvoices_Error(state, action: PayloadAction) {\r\n state.generateInvoicesAndSendToSap = {};\r\n state.charge = {};\r\n },\r\n GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.generateInvoicesAndSendToSap.currentRecord = action.payload;\r\n },\r\n GenerateInvoicesAndChargeOnlineBudgets_SetProgress(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.generateInvoicesAndSendToSap.progress = action.payload;\r\n },\r\n GenerateSelectedInvoices_SetDialogOpen(\r\n state,\r\n action: PayloadAction,\r\n ) {\r\n state.generateInvoicesAndSendToSap.dialogOpen = action.payload;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: onlineBudgetsStatusActions } = slice;\r\n\r\nexport const useOnlineBudgetsStatusSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: onlineBudgetsStatusSaga });\r\n return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n * const { actions } = useOnlineBudgetsStatusSlice();\r\n *\r\n * const onButtonClick = (evt) => {\r\n * dispatch(actions.getTableData());\r\n * };\r\n * }\r\n */\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport {\r\n selectChargeOnlineBudgetsState,\r\n selectOnlineBudgetsStatusSelected,\r\n} from '../slice/selectors';\r\nimport {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n LinearProgress,\r\n List,\r\n ListItem,\r\n} from '@material-ui/core';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nconst maxErrorsToShow = 5;\r\nexport interface ChargeOnlineBudgetsButtonProps {\r\n disabled?: boolean;\r\n disabledTitle?: string;\r\n}\r\nexport const ChargeOnlineBudgetsButton = ({\r\n disabled,\r\n disabledTitle,\r\n ...props\r\n}: ChargeOnlineBudgetsButtonProps) => {\r\n const { t } = useTranslation();\r\n const selected = useSelector(selectOnlineBudgetsStatusSelected);\r\n const state = useSelector(selectChargeOnlineBudgetsState);\r\n const dispatch = useDispatch();\r\n const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n const handleChargeOnlineBudgetsButtonClick = () => {\r\n dispatch(actions.chargeOnlineBudgets(selected));\r\n };\r\n const handleDialogClose = () => {\r\n if (state.processing) {\r\n return;\r\n }\r\n dispatch(actions.chargeOnlineBudgets_SetDialogOpen(false));\r\n };\r\n const confirmationMessage = `${\r\n selected.length\r\n } records will be processed. ${t(translations.AreYouSure)}`;\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t(translations.ChargeBalanceOnline)}\r\n {selected.length > 0 && <> - {selected.length}}\r\n \r\n \r\n \r\n \r\n {state.processing && (\r\n \r\n )}\r\n {t(translations.ChargeBalanceOnline)}\r\n \r\n {state.currentRecord !== undefined && (\r\n {`Processing ${state.currentRecord?.ServiceGroup} ${state.currentRecord?.Budget}`}\r\n )}\r\n <>\r\n {state.errors !== undefined && (\r\n \r\n {state?.errors\r\n ?.slice(0, maxErrorsToShow)\r\n ?.map((message, index) => (\r\n {message}\r\n ))}\r\n \r\n )}\r\n {(state?.errors?.length ?? 0) > maxErrorsToShow && (\r\n \r\n dispatch(\r\n actions.chargeOnlineBudgets_DownloadErrors(state.errors),\r\n )\r\n }\r\n >\r\n {t(translations.DownloadErrors)}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {t(translations.Close)}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport { selectGenerateInvoicesState } from '../slice/selectors';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\n\r\nexport interface GenerateInvoicesButtonProps {\r\n endDate: Date;\r\n selected: IInvoiceBudgetBalanceDto[];\r\n disabled?: boolean;\r\n disabledTitle?: string;\r\n}\r\nexport const GenerateInvoicesButton = ({\r\n endDate,\r\n selected,\r\n disabled,\r\n disabledTitle,\r\n}: GenerateInvoicesButtonProps) => {\r\n const { t } = useTranslation();\r\n const generateInvoicesState = useSelector(selectGenerateInvoicesState);\r\n const dispatch = useDispatch();\r\n const { actions } = useOnlineBudgetsStatusSlice();\r\n return (\r\n <>\r\n \r\n \r\n \r\n dispatch(\r\n selected.length > 0\r\n ? actions.GenerateInvoicesAndChargeOnlineBudgets({\r\n endDate: endDate,\r\n selected: selected,\r\n chargeOnlineBudgets: false,\r\n })\r\n : actions.generateInvoices({ endDate: endDate }),\r\n )\r\n }\r\n processing={generateInvoicesState.processing}\r\n disabled={disabled === true || selected.length === 0}\r\n >\r\n {t(translations.GenerateInvoiceForEstimatedCharges)}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport * as Yup from 'yup';\r\nimport { selectPayState } from '../slice/selectors';\r\nimport {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n LinearProgress,\r\n} from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { PaymentMethodEntitySchema } from 'app/components/Forms/Schemas';\r\nimport { Form, Formik } from 'formik';\r\nimport { FormPaymentMethodPicker } from 'app/components/Forms/FormPaymentMethodPicker';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { Entity } from 'types/common';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { sum } from 'lodash';\r\nimport { Alert } from '@material-ui/lab';\r\n\r\nexport interface PayButtonProps {\r\n endDate: Date;\r\n selected: IInvoiceBudgetBalanceDto[];\r\n disabled?: boolean;\r\n disabledTitle?: string;\r\n}\r\nexport const PayButton = ({\r\n selected,\r\n disabled,\r\n disabledTitle,\r\n ...props\r\n}: PayButtonProps) => {\r\n const { t } = useTranslation();\r\n const state = useSelector(selectPayState);\r\n const dispatch = useDispatch();\r\n const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n const handlePayButtonClick = () => {\r\n if (selected.length > 0) {\r\n dispatch(actions.pay_Open(selected));\r\n }\r\n };\r\n const handleDialogClose = () => {\r\n if (state.status === 'pending') {\r\n return;\r\n }\r\n dispatch(actions.pay_Close());\r\n };\r\n const totalUpaidBalance = sum(state.selected?.map(row => row.UnpaidBalance));\r\n\r\n const confirmationMessage = `${state.selected?.length} records will be processed.`;\r\n\r\n const handleSubmit = (values: IValues, formikHelpers) => {\r\n const paymentMethod = values?.PaymentMethod?.Id;\r\n if (paymentMethod !== undefined && state.selected !== undefined) {\r\n dispatch(\r\n actions.pay({\r\n EndDate: props.endDate,\r\n PaymentMethod: paymentMethod,\r\n Rows: state.selected,\r\n }),\r\n );\r\n }\r\n };\r\n const initialValues: IValues = {\r\n PaymentMethod: null,\r\n };\r\n const title = disabled ? disabledTitle : t(translations.PayDescription);\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t(translations.Pay)}\r\n \r\n \r\n \r\n\r\n \r\n {state.status === 'pending' && (\r\n \r\n )}\r\n \r\n initialValues={initialValues}\r\n validationSchema={validationSchema}\r\n onSubmit={handleSubmit}\r\n >\r\n {formik => (\r\n
    \r\n {t(translations.ChargeBalanceOnline)}\r\n \r\n {confirmationMessage}\r\n\r\n \r\n \r\n {[\r\n \r\n \r\n ,\r\n ]}\r\n \r\n \r\n {[\r\n \r\n {t(translations.TotalPayments)}:{' '}\r\n {totalUpaidBalance.toFixed(2)}\r\n ,\r\n ]}\r\n \r\n \r\n {state.messages?.map((responseType, index) => (\r\n <>\r\n {responseType.SuccessMessages.map(message => (\r\n \r\n {message}\r\n \r\n ))}\r\n {responseType.ErrorMessages.map(message => (\r\n \r\n {message}\r\n \r\n ))}\r\n {responseType.WarningMessages.map(message => (\r\n \r\n {message}\r\n \r\n ))}\r\n \r\n ))}\r\n \r\n \r\n \r\n {t(translations.PaySelected)}\r\n \r\n {state.status === 'resolved' ? (\r\n dispatch(actions.pay_Close())}\r\n >\r\n {t(translations.Close)}\r\n \r\n ) : (\r\n dispatch(actions.pay_Close())}\r\n disabled={state.status === 'pending'}\r\n >\r\n {t(translations.Cancel)}\r\n \r\n )}\r\n \r\n
    \r\n )}\r\n \r\n
    \r\n \r\n );\r\n};\r\ninterface IValues {\r\n PaymentMethod?: Entity | null;\r\n}\r\nconst validationSchema: Yup.SchemaOf = Yup.object({\r\n PaymentMethod: PaymentMethodEntitySchema.required(),\r\n});\r\n","/**\r\n *\r\n * GenerateInvoicesAndSendToSap\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nimport {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n LinearProgress,\r\n} from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport { selectIGenerateInvoicesAndSendToSapState } from '../slice/selectors';\r\n\r\nexport interface GenerateInvoicesAndSendToSapProps {\r\n selected: IInvoiceBudgetBalanceDto[];\r\n endDate: Date;\r\n disabled?: boolean;\r\n disabledTitle?: string;\r\n}\r\n\r\nexport function GenerateInvoicesAndSendToSap({\r\n disabled,\r\n disabledTitle,\r\n ...props\r\n}: GenerateInvoicesAndSendToSapProps) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { t, i18n } = useTranslation();\r\n const state = useSelector(selectIGenerateInvoicesAndSendToSapState);\r\n const { actions } = useOnlineBudgetsStatusSlice();\r\n const dispatch = useDispatch();\r\n const handleButtonClick = () => {\r\n dispatch(\r\n actions.GenerateInvoicesAndChargeOnlineBudgets({\r\n endDate: props.endDate,\r\n selected: props.selected,\r\n chargeOnlineBudgets: true,\r\n }),\r\n );\r\n };\r\n const handleDialogClose = () => {\r\n //todo\r\n };\r\n const title = disabled ? disabledTitle : t(translations.PayDescription);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t(translations.GenerateInvoicesAndSendToSap)}\r\n \r\n \r\n \r\n \r\n {state.progress !== undefined && (\r\n \r\n )}\r\n {t(translations.GenerateInvoices)}\r\n \r\n {state.currentRecord !== undefined && (\r\n {`Processing ${state.currentRecord?.ServiceGroup} ${state.currentRecord?.Budget}`}\r\n )}\r\n \r\n \r\n \r\n dispatch(actions.GenerateSelectedInvoices_SetDialogOpen(false))\r\n }\r\n >\r\n {t(translations.Close)}\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport React, { ReactNode } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { PaymentProps } from './index';\r\n\r\nexport const AddPaymentButton = ({\r\n children,\r\n ...props\r\n}: { children?: ReactNode } & PaymentProps) => {\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n const singleAdminServiceGroup =\r\n authenticatedUser?.Roles?.includes(Roles.ServiceGroupBudgetsAdmin) &&\r\n authenticatedUser.AdminServiceGroups.length === 1\r\n ? authenticatedUser.AdminServiceGroups[0]\r\n : null;\r\n props.serviceGroup = props.serviceGroup ?? singleAdminServiceGroup ?? null;\r\n return (\r\n \r\n {\r\n dispatch(actions.toggleSidePanel(true));\r\n dispatch(actions.setPageType(RenderPageType.AddPayment));\r\n dispatch(actions.setPageProps(props));\r\n }}\r\n >\r\n {children ?? t(translations.AddPaymentInvoice)}\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { uniqueId } from 'lodash';\r\nimport { InvoiceDetailsSidePanelLink } from '../InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { AddChargeButton } from '../AddChargePage/AddChargeButton';\r\nimport { AddPaymentButton } from '../AddPaymentPage/AddPaymentButton';\r\nimport { IInvoiceBalanceDto } from 'api/odata/generated/complexTypes/IInvoiceBalanceDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Box } from '@material-ui/core';\r\n\r\nconst tryParseInvoicesData = (s: string | null): IInvoiceBalanceDto[] => {\r\n try {\r\n const invoices = JSON.parse(s ?? '[]') as IInvoiceBalanceDto[];\r\n return invoices;\r\n } catch {\r\n return [] as IInvoiceBalanceDto[];\r\n }\r\n};\r\nexport const useRowActions = () => {\r\n const { t } = useTranslation();\r\n const settings = useSelector(selectglobalSettings);\r\n const allowedFees = settings.GetString(AllowedSettings.AllowedFeeTypes);\r\n const accumulateInvoices = settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AccumulateNewChargesToExistingInvoice],\r\n );\r\n const isChargesAllowed = allowedFees && allowedFees.trim() !== '';\r\n const rowActions = React.useMemo[]>(\r\n () => [\r\n ({ row }) => {\r\n const invoices = tryParseInvoicesData(row.original.Invoices);\r\n const actions: JSX.Element[] = [];\r\n if (invoices.length === 0) {\r\n // add charge/payment by service group & budget\r\n if (isChargesAllowed && accumulateInvoices) {\r\n actions.push(\r\n \r\n \r\n \r\n {t(translations.AddACharge)}\r\n \r\n ,\r\n );\r\n }\r\n if (accumulateInvoices) {\r\n actions.push(\r\n \r\n \r\n \r\n {t(translations.AddPayment)}\r\n \r\n ,\r\n );\r\n }\r\n } else if (invoices.length === 1) {\r\n // combine all differnet actions into single list for single invoice row\r\n actions.push();\r\n if (isChargesAllowed && accumulateInvoices) {\r\n actions.push(\r\n \r\n \r\n \r\n {t(translations.AddACharge)}\r\n \r\n ,\r\n );\r\n }\r\n if (accumulateInvoices) {\r\n actions.push(\r\n \r\n \r\n \r\n {t(translations.AddPayment)}\r\n \r\n ,\r\n );\r\n }\r\n } else if (invoices?.length ?? 0 > 1) {\r\n // show nested actions per each invoice row:\r\n // invoice label + all actions behind the \"ReactActions\"\r\n\r\n invoices.forEach(invoice => {\r\n let subActions: JSX.Element[] = [];\r\n subActions.push();\r\n if (isChargesAllowed && accumulateInvoices) {\r\n subActions.push(\r\n \r\n \r\n \r\n {t(translations.AddACharge)}\r\n \r\n ,\r\n );\r\n }\r\n if (accumulateInvoices) {\r\n subActions.push(\r\n \r\n \r\n \r\n {t(translations.AddPayment)}\r\n \r\n ,\r\n );\r\n }\r\n actions.push(\r\n <>\r\n \r\n {`#${invoice.Id} ${dateUtils.shortDateFormat(\r\n invoice.InvoiceStart,\r\n )} - ${dateUtils.shortDateFormat(invoice.InvoiceEnd)}`}\r\n \r\n \r\n ,\r\n );\r\n });\r\n }\r\n if (actions.length === 0) return <>;\r\n return ;\r\n },\r\n ],\r\n [accumulateInvoices, isChargesAllowed, t],\r\n );\r\n return rowActions;\r\n};\r\n\r\ninterface InvoiceDetailsLinkProps {\r\n invoiceId: number | null;\r\n}\r\nconst InvoiceDetailsLink = ({ invoiceId }: InvoiceDetailsLinkProps) => {\r\n const { t } = useTranslation();\r\n if (invoiceId == null) {\r\n return invoiceId;\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n {t(translations.BudgetDetailsBudgetTransfer)}\r\n \r\n \r\n \r\n // \r\n );\r\n};\r\nfunction getPaymentAmount(invoice: IInvoiceBalanceDto) {\r\n const balance = invoice.Charges - invoice.Payments;\r\n if (balance > 0) {\r\n return balance;\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n\r\ninterface IRowWithFlatBudget {\r\n BudgetId: number | null;\r\n Budget: string | null;\r\n}\r\nconst getBudget = (row: IRowWithFlatBudget) => {\r\n return toEntity(row.BudgetId, row.Budget);\r\n};\r\ninterface IRowWithFlatServiceGroup {\r\n ServiceGroupId: number | null;\r\n ServiceGroup: string | null;\r\n}\r\nconst getServiceGroup = (row: IRowWithFlatServiceGroup) => {\r\n return toEntity(row.ServiceGroupId, row.ServiceGroup);\r\n};\r\n","/**\r\n *\r\n * OnlineBudgetsStatusPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from './slice';\r\nimport { useLocation } from 'react-router';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useColumns } from './columns';\r\nimport { usePageActions } from './pageActions';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { useRowActions } from './useRowActions';\r\nimport { BasicTable } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport { GetFilters } from './Filter';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { getDefaultFilter } from './getDefaultFitlers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\n\r\nimport { push } from 'connected-react-router';\r\nimport { defaults } from 'lodash';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\n\r\nexport interface OnlineBudgetsStatusPageParams {\r\n endDate: string;\r\n}\r\nexport interface OnlineBudgetsStatusPageProps\r\n extends IBasePageProps {}\r\n\r\nexport const InvoiceBudgetBalanceKeyAccessor = (\r\n row: IInvoiceBudgetBalanceDto,\r\n) => {\r\n return JSON.stringify({\r\n serviceGroupId: row.ServiceGroupId,\r\n budgetId: row.BudgetId,\r\n });\r\n};\r\nexport function OnlineBudgetsStatusPage(props: OnlineBudgetsStatusPageProps) {\r\n const { t } = useTranslation();\r\n const params = defaults(props.match.params, {\r\n endDate: dateUtils.formatISO(new Date(), {\r\n format: 'basic',\r\n representation: 'date',\r\n }),\r\n });\r\n const location = useLocation();\r\n const dispatch = useDispatch();\r\n const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n const endDate = React.useMemo(() => dateUtils.parseISO(params.endDate), [\r\n params.endDate,\r\n ]);\r\n const columns = useColumns(endDate);\r\n const rowActions = useRowActions();\r\n const endDateString =\r\n endDate == null\r\n ? null\r\n : dateUtils.formatISO(endDate, {\r\n format: 'basic',\r\n representation: 'date',\r\n });\r\n const memoedColumns = React.useMemo(() => columns, [columns]);\r\n const isMobile = DetectIsMobile();\r\n const pageActions = usePageActions({\r\n endDate: endDate as Date | null,\r\n isMobile,\r\n });\r\n\r\n React.useEffect(() => {\r\n dispatch(actions.setEndDate(endDateString));\r\n }, [actions, dispatch, endDateString]);\r\n\r\n const handleEndDateChange = React.useCallback(\r\n (value: MaterialUiPickersDate) => {\r\n if (value != null) {\r\n dispatch(\r\n push({\r\n pathname:\r\n '/OnlineBudgetsStatus/' +\r\n dateUtils.formatISO(value, {\r\n format: 'basic',\r\n representation: 'date',\r\n }),\r\n search: location.search,\r\n }),\r\n );\r\n }\r\n },\r\n [dispatch, location.search],\r\n );\r\n const subHeader = (\r\n <>\r\n \r\n \r\n {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark0)}\r\n \r\n \r\n {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark1)}\r\n \r\n \r\n {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark2)}\r\n \r\n \r\n \r\n {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark3)}\r\n \r\n \r\n );\r\n const rowAccessor = React.useCallback(InvoiceBudgetBalanceKeyAccessor, []);\r\n if (endDate == null) {\r\n return null;\r\n }\r\n const apiURL = '/api/odata/v4/InvoiceBudgetBalances';\r\n return (\r\n <>\r\n \r\n dispatch(actions.setSelected(selected))\r\n }\r\n additionalColumns={[\r\n 'UserGroupId',\r\n 'ServiceGroupId',\r\n 'BudgetId',\r\n 'Invoices',\r\n ]}\r\n searchColumns={[\r\n 'ServiceGroup',\r\n 'UserGroup',\r\n 'UserGroupId',\r\n 'UsergroupIDNO',\r\n 'Budget',\r\n 'HostBudgetNumber',\r\n 'Department',\r\n 'Institute',\r\n 'InstituteType',\r\n ]}\r\n />\r\n \r\n );\r\n}\r\n\r\nconst OnlineBudgetsStatusTable = withSavedHistoryT(\r\n BasicTable,\r\n '/OnlineBudgetStatus',\r\n GetFilters,\r\n getDefaultFilter,\r\n ['endDate'],\r\n);\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column } from 'react-table';\r\nimport htmlParse from 'html-react-parser';\r\nimport { Link } from 'react-router-dom';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { AlignRight } from '../../components/BasicTable/CellRenderers/AlignRight';\r\nimport PercentageRenderer from 'app/components/BasicTable/CellRenderers/PercentageRenderer';\r\n\r\nexport const useColumns = (endDate: Date) => {\r\n const { t } = useTranslation();\r\n const columns: Column[] = [\r\n {\r\n accessor: 'ServiceGroup',\r\n Header: t(translations.ServiceGroup),\r\n },\r\n {\r\n accessor: 'HostBudgetNumber',\r\n Header: t(translations.HostBudgetNumber),\r\n },\r\n {\r\n accessor: 'UserGroup',\r\n Header: t(translations.UserGroup),\r\n },\r\n // Institute- tool tip “By Project User Group”\r\n {\r\n accessor: 'Institute',\r\n Header: (\r\n \r\n {t(translations.Institute)}\r\n \r\n ),\r\n Cell: ({ row, value }) => (\r\n \r\n \r\n {value}\r\n \r\n \r\n ),\r\n },\r\n // Department- tool tip “By Project User Group”\r\n {\r\n accessor: 'Department',\r\n Header: (\r\n \r\n {t(translations.Department)}\r\n \r\n ),\r\n Cell: ({ row, value }) => (\r\n \r\n \r\n {value}\r\n \r\n \r\n ),\r\n },\r\n // User Group- tool tip “Project User Group”\r\n {\r\n accessor: 'UsergroupIDNO',\r\n Header: t(translations.IDNo),\r\n },\r\n {\r\n accessor: 'Budget',\r\n Header: t(translations.BudgetNumber),\r\n Cell: ({ value, row }) => (\r\n \r\n {value}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'BudgetAmount',\r\n Header: t(translations.BudgetAmount),\r\n Cell: ({ value }) => (\r\n \r\n {value?.toFixed(2)}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'BudgetAmount',\r\n Header: t(translations.BudgetAmount),\r\n Cell: ({ value }) => (\r\n \r\n {value?.toFixed(2)}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'BudgetHardLimit',\r\n Header: t(translations.BudgetHardLimit),\r\n Cell: PercentageRenderer,\r\n },\r\n {\r\n accessor: 'BudgetSoftLimit',\r\n Header: t(translations.BudgetSoftLimit),\r\n Cell: PercentageRenderer,\r\n },\r\n {\r\n accessor: 'InvoicedAmount',\r\n Header: t(translations.TotalInvoiced),\r\n Cell: ({ value, row }) => (\r\n \r\n \r\n {value?.toFixed(2)}\r\n \r\n \r\n ),\r\n },\r\n {\r\n accessor: 'PaidAmount',\r\n Header: t(translations.TotlaPaid),\r\n Cell: ({ value }) => (\r\n \r\n {value?.toFixed(2)}\r\n \r\n ),\r\n },\r\n {\r\n accessor: 'UnpaidBalance',\r\n Header: (\r\n <>\r\n \r\n {t(translations.UnpaidBalance)}\r\n \r\n \r\n ),\r\n Cell: ({ row, value }) => (\r\n \r\n \r\n {value?.toFixed(2)}\r\n \r\n \r\n ),\r\n },\r\n {\r\n accessor: 'OverallEstimatedBalance',\r\n Header: (\r\n \r\n {t(translations.OverallEstimatedBalance)}\r\n \r\n ),\r\n Cell: ({ value }) => (\r\n \r\n \r\n {String(value.toFixed(2))}\r\n \r\n \r\n ),\r\n },\r\n {\r\n accessor: 'EstimatedCharges',\r\n Header: (\r\n \r\n {t(translations.EstimatedCharges)}\r\n \r\n ),\r\n Cell: ({ value, row }) => (\r\n \r\n \r\n \r\n \r\n {value?.toFixed(2)}\r\n \r\n \r\n \r\n \r\n ),\r\n },\r\n ];\r\n return columns;\r\n};\r\n","import * as React from 'react';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ChargeOnlineBudgetsButton } from './ChargeOnlineBudgetsButton';\r\nimport { GenerateInvoicesButton } from './GenerateInvoicesButton';\r\nimport { PayButton } from './PayButton';\r\nimport { GenerateInvoicesAndSendToSap } from './GenerateInvoicesAndSendToSap';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { PageActionRenderer2 } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\n\r\nexport interface usePageActionsProps {\r\n endDate: Date | null;\r\n isMobile: boolean;\r\n}\r\nexport const usePageActions = ({ endDate, isMobile }: usePageActionsProps) => {\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const { newDate } = useSystemDate();\r\n const disableActionButtons =\r\n endDate === null ||\r\n dateUtils.truncateTime(endDate) > dateUtils.truncateTime(newDate())\r\n ? true\r\n : undefined;\r\n const disabledTitle = disableActionButtons\r\n ? t(translations.EndDateMustBeSetToTodayOrEarlier)\r\n : undefined;\r\n const pageActions = React.useMemo(() => {\r\n if (endDate == null) {\r\n return [];\r\n }\r\n const accumulateInvoices = globalSettings.GetBoolean(\r\n AllowedSettings[AllowedSettings.AccumulateNewChargesToExistingInvoice],\r\n );\r\n // TODO: provide properly typed actions: PageActionRenderer\r\n const actions: PageActionRenderer2[] = [];\r\n\r\n if (accumulateInvoices) {\r\n actions.unshift((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n \r\n ));\r\n }\r\n if (IsModuleEnabled(appSettings, KnownModules.WS_Billing)) {\r\n actions.unshift(() => (\r\n \r\n ));\r\n actions.unshift((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n \r\n ));\r\n }\r\n if (accumulateInvoices) {\r\n actions.push((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n \r\n ));\r\n }\r\n if (isMobile) {\r\n return [\r\n (dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n (\r\n \r\n {item(dataCount, onRefresh, appliedFilters, selectedRows)}\r\n \r\n ))}\r\n />\r\n ),\r\n ];\r\n }\r\n return actions;\r\n }, [\r\n appSettings,\r\n disableActionButtons,\r\n disabledTitle,\r\n endDate,\r\n globalSettings,\r\n isMobile,\r\n ]);\r\n return pageActions;\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport function getDefaultFilter(user: IAuthenticatedUser) {\r\n const result = toQueryString({\r\n HasBalanceOrEstimatedCharges: true,\r\n BudgetIsOnline: true,\r\n });\r\n return result;\r\n}\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceDetailsPage = lazyLoad(\r\n () => import('./InvoiceDetailsPage/index'),\r\n module => module.InvoiceDetailsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const WorkOrderDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.WorkOrderDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Billing Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Billing = lazyLoad(\r\n () => import('./index'),\r\n module => module.BillingPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActions Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingActions = lazyLoad(\r\n () => import('./index'),\r\n module => module.BillingActionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActionsDetails Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingActionsDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BillingActionsDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LocationTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LocationTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubLocationTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SubLocationTypesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\nimport { withoutGlobalServiceGroupFilter } from 'app/components/BasicTable/withoutGlobalServiceGroupFilter';\r\n\r\nexport const SavedViewDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => withoutGlobalServiceGroupFilter(module.SavedViewDetailsPage),\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActions Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\nimport { withoutGlobalServiceGroupFilter } from 'app/components/BasicTable/withoutGlobalServiceGroupFilter';\r\n\r\nexport const SavedViews = lazyLoad(\r\n () => import('./index'),\r\n module => withoutGlobalServiceGroupFilter(module.SavedViewsPage),\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LabelTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AssetDetailsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelPrintDialog = lazyLoad(\r\n () => import('./index'),\r\n module => module.LabelPrintDialog,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const KioskProjectsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.KioskProjectsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const KioskProjectConsumablesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.KioskProjectConsumablesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PrivateKioskProjectsRoute = lazyLoad(\r\n () => import('./index'),\r\n module => module.PrivateKioskProjectsRoute,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nconst SESSIONTIMEOUT_ASHX_CACHE_BUST = new Date().getTime();\r\n\r\nfunction GetData(\r\n url: string,\r\n Fulfilled: (value: string) => void,\r\n Rejected: () => null,\r\n) {\r\n httpClient\r\n .get(url, { _: SESSIONTIMEOUT_ASHX_CACHE_BUST })\r\n .then(response => Fulfilled(response as string), Rejected);\r\n}\r\n\r\nvar checkFailCount: number = 0;\r\nexport const CheckSessionTimeout = function (\r\n loginUrl: string,\r\n appRoot: string,\r\n showWarning: () => void,\r\n /*, hideWarning*/\r\n) {\r\n var checkInterval: number = 60000;\r\n var redirectAction = function () {\r\n window.onbeforeunload = null;\r\n var currentUrl = window.location.pathname + window.location.search;\r\n var redirUrl = loginUrl + '?ReturnUrl=' + encodeURIComponent(currentUrl);\r\n console.log('redirecting to login page');\r\n window.location.href = redirUrl;\r\n };\r\n var check = function () {\r\n GetData(\r\n appRoot,\r\n (data: string) => {\r\n checkFailCount = 0;\r\n switch (data) {\r\n case 'ok':\r\n //showWarning(); //for test\r\n break;\r\n case 'logout':\r\n redirectAction();\r\n break;\r\n case 'alert':\r\n showWarning();\r\n break;\r\n default:\r\n redirectAction();\r\n break;\r\n }\r\n setTimeout(check, checkInterval);\r\n },\r\n () => {\r\n checkFailCount++;\r\n console.error(\r\n 'Failed to check active session on the server x' + checkFailCount,\r\n );\r\n if (checkFailCount > 2) {\r\n redirectAction();\r\n }\r\n return null;\r\n },\r\n );\r\n };\r\n setTimeout(check, checkInterval);\r\n};\r\n\r\nexport function ExtendSessionTimeout(Fulfilled: (value: string) => void) {\r\n httpClient\r\n .post('/svc/Script/AjaxService.svc/ExtendSessionTimeout', {\r\n dataType: 'json',\r\n contentType: 'application/json; charset=utf-8',\r\n })\r\n .then(response => Fulfilled(response as string));\r\n}\r\n","/**\r\n *\r\n * DialogAlert\r\n *\r\n */\r\nimport React from 'react';\r\nimport {\r\n Dialog,\r\n DialogTitle,\r\n DialogContent,\r\n DialogContentText,\r\n DialogActions,\r\n useTheme,\r\n useMediaQuery,\r\n} from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface DialogAlertProps {\r\n title: string;\r\n value: string | undefined;\r\n buttonText: string;\r\n show: boolean;\r\n onButtonClick: () => void;\r\n onClose: () => void;\r\n}\r\n\r\nexport const DialogAlert = ({\r\n title,\r\n value,\r\n buttonText,\r\n show,\r\n onButtonClick,\r\n onClose,\r\n}: DialogAlertProps) => {\r\n const handleClose = () => {\r\n onClose();\r\n };\r\n const handleButtonClick = () => {\r\n onButtonClick();\r\n };\r\n const theme = useTheme();\r\n const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\r\n\r\n if (show) {\r\n return (\r\n \r\n {title}\r\n \r\n \r\n {value}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return <> ;\r\n }\r\n};\r\n","/**\r\n *\r\n * SessionTimeout\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useState } from 'react';\r\nimport { CheckSessionTimeout, ExtendSessionTimeout } from './SessionTimeout';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { DialogAlert } from './DialogAlert';\r\nimport { Roles } from 'app/slice/types';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface SessionTimeoutProps {}\r\n\r\nexport function SessionTimeout() {\r\n const { t } = useTranslation();\r\n const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n var loginUrl = toRootedURL('/login.aspx');\r\n // math.random is needed to bust the cache for clients with cached result\r\n var checkUrl = `/sessionTimeout.ashx`;\r\n var ignoreSession = React.useMemo(() => {\r\n return (\r\n authenticatedUser !== undefined &&\r\n (authenticatedUser.Roles.indexOf(Roles.CalendarOnly) >= 0 ||\r\n authenticatedUser.Roles.indexOf(Roles.RoomOnly) >= 0 ||\r\n authenticatedUser.Roles.indexOf(Roles.KioskAdmin) >= 0)\r\n );\r\n }, [authenticatedUser]);\r\n const [show, setShow] = useState(false);\r\n React.useEffect(() => {\r\n CheckSessionTimeout(loginUrl, checkUrl, () => {\r\n setShow(true);\r\n });\r\n if (ignoreSession) {\r\n ExtendSessionTimeout((value: string) => {});\r\n }\r\n }, [checkUrl, ignoreSession, loginUrl]);\r\n\r\n function onClose() {\r\n setShow(false);\r\n }\r\n\r\n function onButtonClick() {\r\n ExtendSessionTimeout((value: string) => {});\r\n setShow(false);\r\n }\r\n return ignoreSession ? (\r\n \r\n ) : (\r\n onButtonClick()}\r\n onClose={() => onClose()}\r\n />\r\n );\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for SubmissionsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubmissionsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SubmissionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizzesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizzesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.QuizzesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AdHocReportListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AdHocReportListPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AdHocReportListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Rooms Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Rooms = lazyLoad(\r\n () => import('./index'),\r\n module => module.Rooms,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CalendarMessages Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CalendarMessages = lazyLoad(\r\n () => import('./index'),\r\n module => module.CalendarMessagesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CoresDirectoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoresDirectoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CoresDirectoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SamplePlatesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SamplePlatesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SamplePlatesPage,\r\n);\r\n","import {\r\n //selectAppSettings,\r\n selectglobalSettings,\r\n selectIsAuthenticated,\r\n selectLoading,\r\n selectSiteMapProvider,\r\n selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\n//import { AppSettings } from 'types/AppSettings';\r\nimport { NoAuthNodes } from 'types/SiteMapSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { toLowerCaseSafely } from 'utils/typeUtils';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface TabTitleProps {\r\n isDispatcherLoading: boolean;\r\n i18Language: string;\r\n}\r\n\r\nexport const useTabTitle = (): [\r\n string | undefined, //pageTitle:\r\n string | undefined, //pageIcon:\r\n (string) => void, //setPageTitle:\r\n (string) => void, //setPageIcon:\r\n boolean,\r\n] => {\r\n const location = useLocation();\r\n const [loaded, setLoaded] = React.useState(false);\r\n const selectorLoading = useSelector(selectLoading);\r\n const { t } = useTranslation();\r\n //const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n const siteMapSettings = useSelector(selectSiteMapSettings);\r\n const siteMapProvider = useSelector(selectSiteMapProvider);\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const [title, setTitle] = React.useState(undefined);\r\n //const favIconImg: string | undefined = appSettings?.FavIconImg;\r\n //const favIconTitle: string | undefined = appSettings?.FavIconTitle;\r\n const globalSettings = useSelector(selectglobalSettings);\r\n const favIconImg: string | undefined = globalSettings.GetString(\r\n AllowedSettings.FavIconImg,\r\n );\r\n const favIconTitle: string | undefined = globalSettings.GetString(\r\n AllowedSettings.FavIconTitle,\r\n );\r\n const getFavIconLink = () =>\r\n document.getElementById('tabFavIcon') as HTMLLinkElement;\r\n\r\n const handleFavIconChange = (favIcon: string | undefined) => {\r\n let favLink = getFavIconLink();\r\n if (favLink !== null) {\r\n if (favIcon !== undefined && favIcon !== '') {\r\n favLink.href = toRootedURL('/uploads/Branding/' + favIcon);\r\n } else {\r\n favLink.href = process.env.PUBLIC_URL + '/favicon.png';\r\n }\r\n }\r\n };\r\n const handleTitleChange = (title: string | undefined) => {\r\n if (title !== undefined && title !== '') {\r\n document.title = title;\r\n } else {\r\n document.title = 'BookitLab!';\r\n }\r\n };\r\n React.useEffect(() => {\r\n let active = !selectorLoading && !loaded;\r\n if (active) {\r\n if (isAuthenticated === true) {\r\n if (!!siteMapSettings && siteMapSettings !== null) {\r\n let node = siteMapProvider.findNode(location.pathname);\r\n if (node !== undefined && !!favIconImg && !!favIconTitle) {\r\n setTitle(\r\n () => `${favIconTitle} - ${node === undefined ? '' : node.Title}`,\r\n );\r\n setLoaded(true);\r\n }\r\n }\r\n } else {\r\n let node = NoAuthNodes(t).find(element => {\r\n if (element !== undefined) {\r\n const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n if (reactUrl !== null) {\r\n let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n return location.pathname.toLowerCase().indexOf(rpath) > -1;\r\n } else {\r\n return (\r\n element.Url.toLowerCase().indexOf(\r\n location.pathname.toLowerCase(),\r\n ) > -1\r\n );\r\n }\r\n }\r\n return undefined;\r\n });\r\n if (node !== undefined && !!favIconImg && !!favIconTitle) {\r\n setTitle(\r\n () => `${favIconTitle} - ${node === undefined ? '' : node.Title}`,\r\n );\r\n setLoaded(true);\r\n }\r\n }\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n favIconImg,\r\n favIconTitle,\r\n isAuthenticated,\r\n loaded,\r\n location.pathname,\r\n selectorLoading,\r\n siteMapProvider,\r\n siteMapSettings,\r\n t,\r\n ]);\r\n return [favIconImg, title, handleFavIconChange, handleTitleChange, loaded];\r\n};\r\n","import * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { selectLoading } from 'app/slice/selectors';\r\n\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useTabTitle } from './useTabTitle';\r\n\r\nexport interface HeadTitleProps {\r\n isDispatcherLoading: boolean;\r\n i18Language: string;\r\n}\r\n\r\nexport function HeadTitle() {\r\n const { i18n } = useTranslation();\r\n const isDispatcherLoading = useSelector(selectLoading);\r\n\r\n const [\r\n favIcon,\r\n title,\r\n handleFavIconChange,\r\n handleTitleChange,\r\n loaded,\r\n ] = useTabTitle();\r\n useEffect(() => {\r\n let active = !isDispatcherLoading && loaded;\r\n\r\n if (active) {\r\n handleFavIconChange(favIcon);\r\n handleTitleChange(title);\r\n }\r\n return () => {\r\n active = false;\r\n };\r\n }, [\r\n favIcon,\r\n handleFavIconChange,\r\n handleTitleChange,\r\n isDispatcherLoading,\r\n loaded,\r\n title,\r\n ]);\r\n\r\n // const globalSettings = useSelector(selectglobalSettings);\r\n // const siteMapProvider = useSelector(selectSiteMapProvider);\r\n // const [currentNode, setCurrentNode] = React.useState(\r\n // undefined,\r\n // );\r\n // const [favIcon, setFavIcon] = React.useState(undefined);\r\n // const [favIconTitle, setFavIconTitle] = React.useState(\r\n // undefined,\r\n // );\r\n // const [, setLink] = React.useState(null);\r\n // const createLink = React.useMemo(() => {\r\n // let link: HTMLLinkElement | null = document.querySelector(\r\n // \"link[rel~='icon']\",\r\n // );\r\n // if (link === null) {\r\n // link = document.createElement('link');\r\n // link.rel = 'icon';\r\n // document.getElementsByTagName('head')[0].appendChild(link);\r\n // }\r\n // if (favIcon !== undefined && favIcon !== '') {\r\n // link.href = toRootedURL('/uploads/Branding/' + favIcon);\r\n // } else {\r\n // link.href = process.env.PUBLIC_URL + '/favicon.png';\r\n // }\r\n // return link;\r\n // }, [favIcon]);\r\n // React.useMemo(() => {\r\n // return siteMapProvider.findNode(location.pathname);\r\n // }, [siteMapProvider, location.pathname]);\r\n // const [pageTitle, setPageTitle] = useState(undefined);\r\n // useEffect(() => {\r\n // let active = !isDispatcherLoading;\r\n // if (active) {\r\n // setCurrentNode(() => siteMapProvider.findNode(location.pathname));\r\n // setFavIcon(() => globalSettings.GetString(AllowedSettings.FavIconImg));\r\n // setFavIconTitle(() =>\r\n // globalSettings.GetString(AllowedSettings.FavIconTitle),\r\n // );\r\n // setPageTitle(\r\n // () =>\r\n // `${favIconTitle} - ${\r\n // currentNode === undefined ? '' : currentNode?.Title\r\n // }`,\r\n // );\r\n // setLink(() => createLink);\r\n // }\r\n // return () => {\r\n // active = false;\r\n // };\r\n // // eslint-disable-next-line react-hooks/exhaustive-deps\r\n // }, [\r\n // currentNode,\r\n // favIcon,\r\n // favIconTitle,\r\n // globalSettings,\r\n // isDispatcherLoading,\r\n // location.pathname,\r\n // ]);\r\n //RENDER\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InstrumentRestrictionsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.InstrumentRestrictionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypeDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypeDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LabelTypeDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ConfigurableColumnExportImport Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ConfigurableColumnExportImportPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ConfigurableColumnExportImportPage,\r\n);\r\n","/**\r\n *\r\n * ShortURLRoute\r\n *\r\n */\r\nimport React from 'react';\r\nimport { RouteComponentProps, useHistory, useLocation } from 'react-router';\r\nimport { RouteProps, Route } from 'react-router-dom';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface ShortURLRouteProps extends Omit {}\r\n/**\r\n * Forces url reload for external pages after navigation from react router (push/Redirect/etc.) and the page needs server side reload\r\n * @param props route props\r\n * @returns redirect\r\n */\r\nexport function ShortURLRoute(props: ShortURLRouteProps): React.ReactElement {\r\n const location = useLocation();\r\n const render = (propss: RouteComponentProps) => {\r\n const path =\r\n propss.location.pathname + propss.location.search + propss.location.hash;\r\n const rooted = toRootedURL(path);\r\n console.info(`Reloading external url ${path}`);\r\n if (\r\n propss.location.pathname.toLowerCase() === location.pathname.toLowerCase()\r\n ) {\r\n return null;\r\n }\r\n window.location.href = rooted;\r\n return null;\r\n };\r\n\r\n return ;\r\n}\r\n\r\nexport const DebugRouter = ({ children }: { children: any }) => {\r\n const { location } = useHistory();\r\n if (process.env.NODE_ENV === 'development') {\r\n console.log(\r\n `Route: ${location.pathname}${location.search}, State: ${JSON.stringify(\r\n location.state,\r\n )}`,\r\n );\r\n }\r\n\r\n return children;\r\n};\r\n","/**\r\n *\r\n * ServerBarcodeRoute\r\n *\r\n */\r\nimport React from 'react';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ShortURLRoute } from '../ShortURLRoute';\r\n\r\nexport interface ServerBarcodeRouteProps {\r\n appSettings: AppSettings | null;\r\n}\r\n\r\n/**\r\n * Forces url reload for external pages after navigation from react router (push/Redirect/etc.) and the page needs server side reload\r\n * @param props route props\r\n * @returns redirect\r\n */\r\nexport function ServerBarcodeRoute({\r\n appSettings,\r\n}: ServerBarcodeRouteProps): React.ReactElement {\r\n // collect short url templates from system settings\r\n const templates: Array = [\r\n appSettings?.AssetBarcodeRelativeUrlTemplate,\r\n appSettings?.RoomBarcodeRelativeUrlTemplate,\r\n appSettings?.LocationBarcodeRelativeUrlTemplate,\r\n appSettings?.SubLocationBarcodeRelativeUrlTemplate,\r\n ]\r\n .map(p => p ?? '')\r\n .filter(p => p !== '');\r\n\r\n // replace handlebars based templates to react format\r\n // e.g. /location/{{RoomId}}/{{LocationId}} => /location/:param1?/:param2?\r\n const replaceHandlebarTokens = function (s) {\r\n let index = 0;\r\n const result = s.replace(/({{[^}]+}})/g, function () {\r\n return `:param${index++}?`;\r\n });\r\n return result;\r\n };\r\n if (appSettings == null) {\r\n return <>;\r\n }\r\n\r\n const paths = templates\r\n .map(p =>\r\n // react router path should start with /\r\n replaceHandlebarTokens(p),\r\n )\r\n .map(p => (p.startsWith('/') ? p : '/' + p));\r\n\r\n // use the paths matching the shorturltemplates and use the dedicated route for all\r\n return ;\r\n}\r\n","/**\r\n * Asynchronously loads the component for NewMessagePage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NewMessagePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.NewMessagePage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OtherServiceDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OtherServiceDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.OtherServiceDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InvoiceTemplates Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceTemplates = lazyLoad(\r\n () => import('./index'),\r\n module => module.InvoiceTemplatesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Expenses Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Expenses = lazyLoad(\r\n () => import('./index'),\r\n module => module.ExpensesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PricePeriods Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PricePeriodsPagePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.PricePeriods,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PriceSheetPeriodDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PriceSheetPeriodDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.PriceSheetPeriodDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ArticlesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ArticlesPagePath = '/articles';\r\nexport const ArticlesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ArticlesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AccountLayout = lazyLoad(\r\n () => import('./index'),\r\n module => module.AccountLayout,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RegisterPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.RegisterPage,\r\n);\r\n","/**\r\n * Asynchronously loads the component for CalendarPage\r\n */\r\nimport { withGlobalServiceGroupFilter } from 'app/components/BasicTable/withGlobalServiceGroupFilter';\r\nimport { lazyLoad } from 'utils/loadable';\r\nimport { withSaveAsLastVisitedPage } from '../../hocs/withSaveAsLastVisitedPage';\r\n\r\nexport const CalendarPage = lazyLoad(\r\n () => import('./index'),\r\n module =>\r\n withSaveAsLastVisitedPage(\r\n withGlobalServiceGroupFilter(module.CalendarPage, true),\r\n ),\r\n);\r\n\r\nexport const CalendarPageDefaultRedir = lazyLoad(\r\n () => import('./index'),\r\n module => module.CalendarPageDefaultRedir,\r\n);\r\n","import * as React from 'react';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { IBasePageProps } from '../pages/IBasePageProps';\r\nimport { getLogger } from 'utils/logLevel';\r\n\r\n/**\r\n * Enables wrapped page to be saved as the Last Visited Page. This is used to redirect users after login to the last visited page\r\n * @param Component Page component\r\n * @returns\r\n */\r\n\r\nexport function withSaveAsLastVisitedPage(\r\n Component: React.FC,\r\n) {\r\n const log = getLogger('withSaveAsLastVisitedPage');\r\n return (props: TProps) => {\r\n const LAST_SAVED_PAGE_PROFILE_KEY = 'LastVisitedPage';\r\n // reconstruct back the location in the aspnet compatible relative path e.g. ~/schedule/calendar?id=1#foobar\r\n const location = [\r\n '~',\r\n props.location.pathname,\r\n props.location.search,\r\n props.location.hash,\r\n ].join('');\r\n\r\n // warning: updateY might mutate after the \"savedValue\" change inside the useProfileSetting\r\n // this might lead to useEffect firing 2 times for each location change -\r\n // first time when location changes, and then once again on update function change\r\n const { updateValue: updateY } = useProfileSetting({\r\n profileSettingKey: LAST_SAVED_PAGE_PROFILE_KEY,\r\n });\r\n\r\n // update the profile setting on each location change on current page\r\n React.useEffect(() => {\r\n updateY(location);\r\n log.info('LastVisitedPage', location);\r\n }, [location, updateY]);\r\n\r\n // wrapped component render\r\n return ;\r\n };\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for ReservationDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReservationDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ReservationDetailsPage,\r\n);\r\n","/**\r\n * Asynchronously loads the component for HomePage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const HomePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.HomePage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SystemPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SystemPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const DashboardPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.DefaultDashboardPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CoreSelectionPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreSelectionPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CoreSelectionPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreHomePage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CoreHomeByRoutePage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreStatsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CoreStatsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReportingPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ReportingPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BookitLabDashboadPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BookitLabDashboadPage,\r\n);\r\n","/**\r\n *\r\n * RedirectWithSearch\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Redirect, RedirectProps, useLocation } from 'react-router';\r\n\r\nexport interface RedirectWithSearchProps extends RedirectProps {\r\n preserveSearch?: boolean;\r\n}\r\n\r\nexport function RedirectWithSearch({\r\n preserveSearch = true,\r\n\r\n to,\r\n ...props\r\n}: RedirectWithSearchProps) {\r\n const location = useLocation();\r\n to.search = location.search;\r\n return ;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetSelectionPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetSelectionPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AssetSelectionPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TermsOfUseAgreementPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.TermsOfUseAgreementPage,\r\n);\r\n","import { makeStyles, Theme } from '@material-ui/core';\r\nimport Box, { BoxProps } from '@material-ui/core/Box';\r\nimport { createStyles } from '@material-ui/styles';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectSnackBarIndex } from '../../slice/selectors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface SnackWrapperProps extends BoxProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport function SnackWrapper(props: SnackWrapperProps) {\r\n const upSnackbarIndex = useSelector(selectSnackBarIndex);\r\n const classes = useStyles();\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n}\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n zindex301: {\r\n '& > div': {\r\n zIndex: 1301,\r\n },\r\n },\r\n }),\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ActiveUserGroupPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ActiveUserGroupPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CannedReportsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CannedReports,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserAttributes Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserAttributes = lazyLoad(\r\n () => import('./index'),\r\n module => module.UserAttributesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ReportConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReportConsumablesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ReportConsumablesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LoginPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.LoginPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CalendarMessagesDetails\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CalendarMessagesDetailsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.CalendarMessagesDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ServiceRequestsKanbanPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestsKanbanPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ServiceRequestsKanbanPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OfflineServiceTypes Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OfflineServiceTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.OfflineServiceTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCasePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCaseEditPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AnimalCaseEditPage,\r\n);\r\n","import {\r\n IconLookup,\r\n IconPrefix,\r\n library,\r\n} from '@fortawesome/fontawesome-svg-core';\r\n/*\r\nIt is important to declare icons in the following way:\r\nimport { faName } from '@fortawesome/pro-solid-svg-icons/faName';\r\nThis prevents the entire icon pack from loading and only loads one specific icon.\r\n*/\r\nimport { faUserCircle } from '@fortawesome/pro-solid-svg-icons/faUserCircle';\r\nimport { faChevronUp } from '@fortawesome/pro-solid-svg-icons/faChevronUp';\r\nimport { faPencil } from '@fortawesome/pro-solid-svg-icons/faPencil';\r\nimport { faLock } from '@fortawesome/pro-solid-svg-icons/faLock';\r\nimport { faUsers } from '@fortawesome/pro-solid-svg-icons/faUsers';\r\nimport { faBell } from '@fortawesome/pro-solid-svg-icons/faBell';\r\nimport { faQuestionCircle } from '@fortawesome/pro-solid-svg-icons/faQuestionCircle';\r\nimport { faSignOutAlt } from '@fortawesome/pro-solid-svg-icons/faSignOutAlt';\r\nimport { faHome } from '@fortawesome/pro-solid-svg-icons/faHome';\r\nimport { faLayerGroup } from '@fortawesome/pro-solid-svg-icons/faLayerGroup';\r\nimport { faBookmark } from '@fortawesome/pro-solid-svg-icons/faBookmark';\r\nimport { faCalendarAlt } from '@fortawesome/pro-solid-svg-icons/faCalendarAlt';\r\nimport { faDumbbell } from '@fortawesome/pro-solid-svg-icons/faDumbbell';\r\nimport { faCommentAltDots } from '@fortawesome/pro-solid-svg-icons/faCommentAltDots';\r\nimport { faBolt } from '@fortawesome/pro-solid-svg-icons/faBolt';\r\nimport { faListUl } from '@fortawesome/pro-solid-svg-icons/faListUl';\r\nimport { faChartBar } from '@fortawesome/pro-solid-svg-icons/faChartBar';\r\nimport { faChartColumn } from '@fortawesome/pro-solid-svg-icons/faChartColumn';\r\nimport { faChartLine } from '@fortawesome/pro-solid-svg-icons/faChartLine';\r\nimport { faChartPie } from '@fortawesome/pro-solid-svg-icons/faChartPie';\r\nimport { faChartPieAlt } from '@fortawesome/pro-solid-svg-icons/faChartPieAlt';\r\nimport { faMegaphone } from '@fortawesome/pro-solid-svg-icons/faMegaphone';\r\nimport { faFileInvoiceDollar } from '@fortawesome/pro-solid-svg-icons/faFileInvoiceDollar';\r\nimport { faCog } from '@fortawesome/pro-solid-svg-icons/faCog';\r\nimport { faTimes } from '@fortawesome/pro-solid-svg-icons/faTimes';\r\nimport { faCircle } from '@fortawesome/pro-solid-svg-icons/faCircle';\r\nimport { faCircleSmall } from '@fortawesome/pro-solid-svg-icons/faCircleSmall';\r\nimport { faCircleCheck } from '@fortawesome/pro-solid-svg-icons/faCircleCheck';\r\nimport { faPrint } from '@fortawesome/pro-solid-svg-icons/faPrint';\r\nimport { faSearch } from '@fortawesome/pro-solid-svg-icons/faSearch';\r\nimport { faChevronDoubleUp } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleUp';\r\nimport { faChevronDoubleDown } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleDown';\r\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons/faCheck';\r\nimport { faCheckDouble } from '@fortawesome/pro-solid-svg-icons/faCheckDouble';\r\nimport { faInfo } from '@fortawesome/pro-solid-svg-icons/faInfo';\r\nimport { faTriangleExclamation } from '@fortawesome/pro-solid-svg-icons/faTriangleExclamation';\r\nimport { faXmark } from '@fortawesome/pro-solid-svg-icons/faXmark';\r\nimport { faChevronDown } from '@fortawesome/pro-solid-svg-icons/faChevronDown';\r\nimport { faCircleXmark } from '@fortawesome/pro-solid-svg-icons/faCircleXmark';\r\nimport { faEllipsisV } from '@fortawesome/pro-solid-svg-icons/faEllipsisV';\r\nimport { faPlus } from '@fortawesome/pro-solid-svg-icons/faPlus';\r\nimport { faFilter } from '@fortawesome/pro-solid-svg-icons/faFilter';\r\nimport { faTable } from '@fortawesome/pro-solid-svg-icons/faTable';\r\nimport { faMinus } from '@fortawesome/pro-solid-svg-icons/faMinus';\r\nimport { faFileImport } from '@fortawesome/pro-solid-svg-icons/faFileImport';\r\nimport { faGlobe } from '@fortawesome/pro-solid-svg-icons/faGlobe';\r\nimport { faLockOpen } from '@fortawesome/pro-solid-svg-icons/faLockOpen';\r\nimport { faEdit } from '@fortawesome/pro-solid-svg-icons/faEdit';\r\nimport { faTrash } from '@fortawesome/pro-solid-svg-icons/faTrash';\r\nimport { faInfoCircle } from '@fortawesome/pro-solid-svg-icons/faInfoCircle';\r\nimport { faGripVertical } from '@fortawesome/pro-solid-svg-icons/faGripVertical';\r\nimport { faBellSlash } from '@fortawesome/pro-solid-svg-icons/faBellSlash';\r\nimport { faExclamationCircle } from '@fortawesome/pro-solid-svg-icons/faExclamationCircle';\r\nimport { faTimesCircle } from '@fortawesome/pro-solid-svg-icons/faTimesCircle';\r\nimport { faArrowLeft } from '@fortawesome/pro-solid-svg-icons/faArrowLeft';\r\nimport { faTools } from '@fortawesome/pro-solid-svg-icons/faTools';\r\nimport { faPlay } from '@fortawesome/pro-solid-svg-icons/faPlay';\r\nimport { faHistory } from '@fortawesome/pro-solid-svg-icons/faHistory';\r\nimport { faAdd } from '@fortawesome/pro-solid-svg-icons/faAdd';\r\nimport { faStream } from '@fortawesome/pro-solid-svg-icons/faStream';\r\nimport { faRulerTriangle } from '@fortawesome/pro-solid-svg-icons/faRulerTriangle';\r\nimport { faThList } from '@fortawesome/pro-solid-svg-icons/faThList';\r\nimport { faPencilAlt } from '@fortawesome/pro-solid-svg-icons/faPencilAlt';\r\nimport { faCalendarPlus } from '@fortawesome/pro-solid-svg-icons/faCalendarPlus';\r\nimport { faPause } from '@fortawesome/pro-solid-svg-icons/faPause';\r\nimport { faSave } from '@fortawesome/pro-solid-svg-icons/faSave';\r\nimport { faCalendars } from '@fortawesome/pro-solid-svg-icons/faCalendars';\r\nimport { faListTimeline } from '@fortawesome/pro-solid-svg-icons/faListTimeline';\r\nimport { faCode } from '@fortawesome/pro-solid-svg-icons/faCode';\r\nimport { faBan } from '@fortawesome/pro-solid-svg-icons/faBan';\r\nimport { faFloppyDiskCircleArrowRight } from '@fortawesome/pro-solid-svg-icons/faFloppyDiskCircleArrowRight';\r\nimport { faCalculator } from '@fortawesome/pro-solid-svg-icons/faCalculator';\r\nimport { faRefresh } from '@fortawesome/pro-solid-svg-icons/faRefresh';\r\nimport { faSquare } from '@fortawesome/pro-solid-svg-icons/faSquare';\r\nimport { faClone } from '@fortawesome/pro-solid-svg-icons/faClone';\r\nimport { faClock } from '@fortawesome/pro-solid-svg-icons/faClock';\r\nimport { faChevronRight } from '@fortawesome/pro-solid-svg-icons/faChevronRight';\r\nimport { faClipboardList } from '@fortawesome/pro-solid-svg-icons/faClipboardList';\r\nimport { faEnvelope } from '@fortawesome/pro-solid-svg-icons/faEnvelope';\r\nimport { faCalendar } from '@fortawesome/pro-solid-svg-icons/faCalendar';\r\nimport { faCheckCircle } from '@fortawesome/pro-solid-svg-icons/faCheckCircle';\r\nimport { faLink } from '@fortawesome/pro-solid-svg-icons/faLink';\r\nimport { faChevronDoubleRight } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleRight';\r\nimport { faChevronDoubleLeft } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleLeft';\r\nimport { faChevronLeft } from '@fortawesome/pro-solid-svg-icons/faChevronLeft';\r\nimport { faChevronsLeft } from '@fortawesome/pro-solid-svg-icons/faChevronsLeft';\r\nimport { faChevronsRight } from '@fortawesome/pro-solid-svg-icons/faChevronsRight';\r\nimport { faList } from '@fortawesome/pro-solid-svg-icons/faList';\r\nimport { faUser } from '@fortawesome/pro-solid-svg-icons/faUser';\r\nimport { faGripHorizontal } from '@fortawesome/pro-solid-svg-icons/faGripHorizontal';\r\nimport { faArrowFromLeft } from '@fortawesome/pro-solid-svg-icons/faArrowFromLeft';\r\nimport { faVial } from '@fortawesome/pro-solid-svg-icons/faVial';\r\nimport { faStopwatch } from '@fortawesome/pro-solid-svg-icons/faStopwatch';\r\nimport { faWrench } from '@fortawesome/pro-solid-svg-icons/faWrench';\r\nimport { faArrowUpRightFromSquare } from '@fortawesome/pro-solid-svg-icons/faArrowUpRightFromSquare';\r\nimport { faExternalLink } from '@fortawesome/pro-solid-svg-icons/faExternalLink';\r\nimport { faExternalLinkAlt } from '@fortawesome/pro-solid-svg-icons/faExternalLinkAlt';\r\nimport { faClose } from '@fortawesome/pro-solid-svg-icons/faClose';\r\nimport { faDownload } from '@fortawesome/pro-solid-svg-icons/faDownload';\r\nimport { faBold } from '@fortawesome/pro-solid-svg-icons/faBold';\r\nimport { faItalic } from '@fortawesome/pro-solid-svg-icons/faItalic';\r\nimport { faUnderline } from '@fortawesome/pro-solid-svg-icons/faUnderline';\r\nimport { faH1 } from '@fortawesome/pro-solid-svg-icons/faH1';\r\nimport { faH2 } from '@fortawesome/pro-solid-svg-icons/faH2';\r\nimport { faQuoteRight } from '@fortawesome/pro-solid-svg-icons/faQuoteRight';\r\nimport { faListOl } from '@fortawesome/pro-solid-svg-icons/faListOl';\r\nimport { faFileAlt } from '@fortawesome/pro-solid-svg-icons/faFileAlt';\r\nimport { faAt } from '@fortawesome/pro-solid-svg-icons/faAt';\r\nimport { faBarcode } from '@fortawesome/pro-solid-svg-icons/faBarcode';\r\nimport { faChain } from '@fortawesome/pro-solid-svg-icons/faChain';\r\nimport { faPowerOff } from '@fortawesome/pro-solid-svg-icons/faPowerOff';\r\nimport { faPlug } from '@fortawesome/pro-solid-svg-icons/faPlug';\r\nimport { faMicroscope } from '@fortawesome/pro-solid-svg-icons/faMicroscope';\r\nimport { faCalendarCheck } from '@fortawesome/pro-solid-svg-icons/faCalendarCheck';\r\nimport { faCalendarExclamation } from '@fortawesome/pro-solid-svg-icons/faCalendarExclamation';\r\nimport { faCalendarTimes } from '@fortawesome/pro-solid-svg-icons/faCalendarTimes';\r\nimport { faFileUpload } from '@fortawesome/pro-solid-svg-icons/faFileUpload';\r\nimport { faSpinner } from '@fortawesome/pro-solid-svg-icons/faSpinner';\r\nimport { faMoneyCheckEdit } from '@fortawesome/pro-solid-svg-icons/faMoneyCheckEdit';\r\nimport { faLevelUpAlt } from '@fortawesome/pro-solid-svg-icons/faLevelUpAlt';\r\nimport { faPaperclip } from '@fortawesome/pro-solid-svg-icons/faPaperclip';\r\nimport { faAbacus } from '@fortawesome/pro-solid-svg-icons/faAbacus';\r\nimport { faAlbum } from '@fortawesome/pro-solid-svg-icons/faAlbum';\r\nimport { faFile } from '@fortawesome/pro-solid-svg-icons/faFile';\r\nimport { faSync } from '@fortawesome/pro-solid-svg-icons/faSync';\r\nimport { faRectangleVerticalHistory } from '@fortawesome/pro-solid-svg-icons/faRectangleVerticalHistory';\r\nimport { faUniversity } from '@fortawesome/pro-solid-svg-icons/faUniversity';\r\nimport { faShopSlash } from '@fortawesome/pro-solid-svg-icons/faShopSlash';\r\nimport { faDollarSign } from '@fortawesome/pro-solid-svg-icons/faDollarSign';\r\nimport { faExchange } from '@fortawesome/pro-solid-svg-icons/faExchange';\r\nimport { faClipboardListCheck } from '@fortawesome/pro-solid-svg-icons/faClipboardListCheck';\r\nimport { faSms } from '@fortawesome/pro-solid-svg-icons/faSms';\r\nimport { faUserPlus } from '@fortawesome/pro-solid-svg-icons/faUserPlus';\r\nimport { faUserShield } from '@fortawesome/pro-solid-svg-icons/faUserShield';\r\nimport { faWarning } from '@fortawesome/pro-solid-svg-icons/faWarning';\r\nimport { faLocationCrosshairs } from '@fortawesome/pro-solid-svg-icons/faLocationCrosshairs';\r\nimport { faCircleDollarToSlot } from '@fortawesome/pro-solid-svg-icons/faCircleDollarToSlot';\r\nimport { faCopy } from '@fortawesome/pro-solid-svg-icons/faCopy';\r\nimport { faCodeBranch } from '@fortawesome/pro-solid-svg-icons/faCodeBranch';\r\nimport { faChevronsUp } from '@fortawesome/pro-solid-svg-icons/faChevronsUp';\r\nimport { faChevronsDown } from '@fortawesome/pro-solid-svg-icons/faChevronsDown';\r\nimport { faEquals } from '@fortawesome/pro-solid-svg-icons/faEquals';\r\nimport { faFileSpreadsheet } from '@fortawesome/pro-solid-svg-icons/faFileSpreadsheet';\r\nimport { faFilePdf } from '@fortawesome/pro-solid-svg-icons/faFilePdf';\r\nimport { faFileImage } from '@fortawesome/pro-solid-svg-icons/faFileImage';\r\n\r\nimport { faCircleCheck as falCircleCheck } from '@fortawesome/pro-light-svg-icons/faCircleCheck';\r\nimport { faTriangleExclamation as falTriangleExclamation } from '@fortawesome/pro-light-svg-icons/faTriangleExclamation';\r\nimport { faCircleQuarters as falCircleQuarters } from '@fortawesome/pro-light-svg-icons/faCircleQuarters';\r\nimport { faCircleExclamation as falCircleExclamation } from '@fortawesome/pro-light-svg-icons/faCircleExclamation';\r\nimport { faMinimize as falMinimize } from '@fortawesome/pro-light-svg-icons/faMinimize';\r\nimport { faMaximize as falMaximize } from '@fortawesome/pro-light-svg-icons/faMaximize';\r\nimport { faTable as falTable } from '@fortawesome/pro-light-svg-icons/faTable';\r\nimport { faCalendars as falCalendars } from '@fortawesome/pro-light-svg-icons/faCalendars';\r\n\r\nimport { faTelescope as fadTelescope } from '@fortawesome/pro-duotone-svg-icons/faTelescope';\r\nimport { faInfinity as fadInfinity } from '@fortawesome/pro-duotone-svg-icons/faInfinity';\r\n\r\nimport { faCalendarCheck as fadCalendarCheck } from '@fortawesome/pro-duotone-svg-icons/faCalendarCheck';\r\nimport { faCalendarExclamation as fadCalendarExclamation } from '@fortawesome/pro-duotone-svg-icons/faCalendarExclamation';\r\nimport { faCalendarTimes as fadCalendarTimes } from '@fortawesome/pro-duotone-svg-icons/faCalendarTimes';\r\nimport { faCalendarPlus as fadCalendarPlus } from '@fortawesome/pro-duotone-svg-icons/faCalendarPlus';\r\n\r\nimport { faMaximize as farMaximize } from '@fortawesome/pro-regular-svg-icons/faMaximize';\r\nimport { faCommentQuestion as farCommentQuestion } from '@fortawesome/pro-regular-svg-icons/faCommentQuestion';\r\nimport { faCircleExclamation as farcircleExclamation } from '@fortawesome/pro-regular-svg-icons/faCircleExclamation';\r\nimport { faCircleCheck as farCircleCheck } from '@fortawesome/pro-regular-svg-icons/faCircleCheck';\r\n\r\nimport { faGoogle as fabGoogle } from '@fortawesome/free-brands-svg-icons/faGoogle';\r\nimport { faWindows as fabWindows } from '@fortawesome/free-brands-svg-icons/faWindows';\r\nimport { faNewspaper } from '@fortawesome/pro-solid-svg-icons/faNewspaper';\r\nimport { faFlag } from '@fortawesome/pro-solid-svg-icons/faFlag';\r\nimport { faBarcodeScan } from '@fortawesome/pro-solid-svg-icons/faBarcodeScan';\r\nimport { faMap } from '@fortawesome/pro-solid-svg-icons/faMap';\r\nimport { faBars } from '@fortawesome/pro-solid-svg-icons/faBars';\r\nimport { faMagnifyingGlass } from '@fortawesome/pro-solid-svg-icons/faMagnifyingGlass';\r\nimport { faGrid2 } from '@fortawesome/pro-solid-svg-icons/faGrid2';\r\nimport { faScrewdriver } from '@fortawesome/pro-solid-svg-icons/faScrewdriver';\r\nimport { faBullhorn } from '@fortawesome/pro-solid-svg-icons/faBullhorn';\r\nimport { faMoneyBill } from '@fortawesome/pro-solid-svg-icons/faMoneyBill';\r\nimport { faFileArrowUp } from '@fortawesome/pro-solid-svg-icons/faFileArrowUp';\r\nimport { faEarthEurope } from '@fortawesome/pro-solid-svg-icons/faEarthEurope';\r\nimport { faShare } from '@fortawesome/pro-solid-svg-icons/faShare';\r\nimport { faScannerKeyboard } from '@fortawesome/pro-solid-svg-icons/faScannerKeyboard';\r\nimport { faCircleNotch } from '@fortawesome/pro-solid-svg-icons/faCircleNotch';\r\nimport { faMapLocation } from '@fortawesome/pro-solid-svg-icons/faMapLocation';\r\nimport { faScrewdriverWrench } from '@fortawesome/pro-solid-svg-icons/faScrewdriverWrench';\r\nimport { faBandage } from '@fortawesome/pro-solid-svg-icons/faBandage';\r\nimport { faHourglassHalf } from '@fortawesome/pro-solid-svg-icons/faHourglassHalf';\r\nimport { faInfinity as fasInfinity } from '@fortawesome/pro-solid-svg-icons/faInfinity';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport type IconName =\r\n | 'circle-user'\r\n | 'user-circle'\r\n | 'chevron-up'\r\n | 'pencil'\r\n | 'lock'\r\n | 'users'\r\n | 'bell'\r\n | 'question-circle'\r\n | 'sign-out-alt'\r\n | 'home'\r\n | 'layer-group'\r\n | 'bookmark'\r\n | 'calendar-alt'\r\n | 'dumbbell'\r\n | 'comment-alt-dots'\r\n | 'bolt'\r\n | 'list-ul'\r\n | 'chart-bar'\r\n | 'chart-column'\r\n | 'chart-line'\r\n | 'chart-pie'\r\n | 'chart-pie-alt'\r\n | 'megaphone'\r\n | 'file-invoice-dollar'\r\n | 'cog'\r\n | 'times'\r\n | 'circle'\r\n | 'circle-small'\r\n | 'circle-check'\r\n | 'print'\r\n | 'search'\r\n | 'chevron-double-up'\r\n | 'chevron-double-down'\r\n | 'check'\r\n | 'check-double'\r\n | 'info'\r\n | 'triangle-exclamation'\r\n | 'xmark'\r\n | 'chevron-down'\r\n | 'circle-xmark'\r\n | 'ellipsis-v'\r\n | 'plus'\r\n | 'filter'\r\n | 'table'\r\n | 'minus'\r\n | 'file-import'\r\n | 'globe'\r\n | 'lock-open'\r\n | 'edit'\r\n | 'trash'\r\n | 'info-circle'\r\n | 'grip-vertical'\r\n | 'bell-slash'\r\n | 'exclamation-circle'\r\n | 'times-circle'\r\n | 'arrow-left'\r\n | 'tools'\r\n | 'play'\r\n | 'history'\r\n | 'add'\r\n | 'stream'\r\n | 'ruler-triangle'\r\n | 'th-list'\r\n | 'clipboard-list-check'\r\n | 'pencil-alt'\r\n | 'calendar-plus'\r\n | 'pause'\r\n | 'save'\r\n | 'calendars'\r\n | 'list-timeline'\r\n | 'code'\r\n | 'ban'\r\n | 'floppy-disk-circle-arrow-right'\r\n | 'calculator'\r\n | 'refresh'\r\n | 'square'\r\n | 'clone'\r\n | 'clock'\r\n | 'chevron-right'\r\n | 'clipboard-list'\r\n | 'envelope'\r\n | 'calendar'\r\n | 'check-circle'\r\n | 'link'\r\n | 'chevron-double-right'\r\n | 'chevron-double-left'\r\n | 'chevron-left'\r\n | 'chevrons-left'\r\n | 'chevrons-right'\r\n | 'list'\r\n | 'user'\r\n | 'grip-horizontal'\r\n | 'arrow-from-left'\r\n | 'vial'\r\n | 'stopwatch'\r\n | 'wrench'\r\n | 'arrow-up-right-from-square'\r\n | 'external-link'\r\n | 'external-link-alt'\r\n | 'close'\r\n | 'download'\r\n | 'bold'\r\n | 'italic'\r\n | 'underline'\r\n | 'h1'\r\n | 'h2'\r\n | 'quote-right'\r\n | 'list-ol'\r\n | 'file-alt'\r\n | 'at'\r\n | 'barcode'\r\n | 'chain'\r\n | 'power-off'\r\n | 'plug'\r\n | 'microscope'\r\n | 'calendar-check'\r\n | 'calendar-exclamation'\r\n | 'calendar-times'\r\n | 'file-upload'\r\n | 'spinner'\r\n | 'money-check-edit'\r\n | 'level-up-alt'\r\n | 'paperclip'\r\n | 'abacus'\r\n | 'album'\r\n | 'file'\r\n | 'sync'\r\n | 'rectangle-vertical-history'\r\n | 'university'\r\n | 'shop-slash'\r\n | 'dollar-sign'\r\n | 'exchange'\r\n | 'sms'\r\n | 'circle-check'\r\n | 'triangle-exclamation'\r\n | 'circle-quarters'\r\n | 'circle-exclamation'\r\n | 'minimize'\r\n | 'maximize'\r\n | 'table'\r\n | 'calendars'\r\n | 'telescope'\r\n | 'infinity'\r\n | 'calendar-check'\r\n | 'calendar-exclamation'\r\n | 'calendar-times'\r\n | 'calendar-plus'\r\n | 'maximize'\r\n | 'comment-question'\r\n | 'circle-exclamation'\r\n | 'circle-check'\r\n | 'google'\r\n | 'user-plus'\r\n | 'user-shield'\r\n | 'warning'\r\n | 'windows'\r\n | 'location-crosshairs'\r\n | 'circle-dollar-to-slot'\r\n | 'code-branch'\r\n | 'copy'\r\n | 'chevrons-up'\r\n | 'chevrons-down'\r\n | 'equals'\r\n | 'file-spreadsheet'\r\n | 'file-pdf'\r\n | 'newspaper'\r\n | 'file-image'\r\n | 'flag'\r\n | 'barcode-scan'\r\n | 'map'\r\n | 'bars'\r\n | 'magnifying-glass'\r\n | 'grid-2'\r\n | 'screwdriver'\r\n | 'bullhorn'\r\n | 'money-bill'\r\n | 'file-arrow-up'\r\n | 'earth-europe'\r\n | 'share'\r\n | 'scanner-keyboard'\r\n | 'circle-notch'\r\n | 'map-location'\r\n | 'screwdriver-wrench'\r\n | 'bandage'\r\n | 'hourglass-half';\r\n\r\n//library.add(fas, fad, far, fal, faGoogle, faWindows);\r\nlibrary.add(\r\n //fas\r\n faUserCircle,\r\n faChevronUp,\r\n faPencil,\r\n faLock,\r\n faUsers,\r\n faBell,\r\n faQuestionCircle,\r\n faSignOutAlt,\r\n faHome,\r\n faLayerGroup,\r\n faBookmark,\r\n faCalendarAlt,\r\n faDumbbell,\r\n faCommentAltDots,\r\n faBolt,\r\n faListUl,\r\n faChartBar,\r\n faChartColumn,\r\n faChartLine,\r\n faChartPie,\r\n faChartPieAlt,\r\n faMegaphone,\r\n faFileInvoiceDollar,\r\n faCog,\r\n faTimes,\r\n faCircle,\r\n faCircleSmall,\r\n faCircleCheck,\r\n faPrint,\r\n faSearch,\r\n faChevronDoubleUp,\r\n faChevronDoubleDown,\r\n faCheck,\r\n faCheckDouble,\r\n faInfo,\r\n faTriangleExclamation,\r\n faXmark,\r\n faChevronDown,\r\n faCircleXmark,\r\n faEllipsisV,\r\n faPlus,\r\n faFilter,\r\n faTable,\r\n faMinus,\r\n faFileImport,\r\n faGlobe,\r\n faLockOpen,\r\n faEdit,\r\n faTrash,\r\n faInfoCircle,\r\n faGripVertical,\r\n faBellSlash,\r\n faExclamationCircle,\r\n faTimesCircle,\r\n faArrowLeft,\r\n faTools,\r\n faPlay,\r\n faHistory,\r\n faAdd,\r\n faStream,\r\n faRulerTriangle,\r\n faThList,\r\n faClipboardListCheck,\r\n faPencilAlt,\r\n faCalendarPlus,\r\n faPause,\r\n faSave,\r\n faCalendars,\r\n faListTimeline,\r\n faCode,\r\n faBan,\r\n faFloppyDiskCircleArrowRight,\r\n faCalculator,\r\n faRefresh,\r\n faSquare,\r\n faClone,\r\n faClock,\r\n faChevronRight,\r\n faClipboardList,\r\n faEnvelope,\r\n faCalendar,\r\n faCheckCircle,\r\n faLink,\r\n faChevronDoubleRight,\r\n faChevronDoubleLeft,\r\n faChevronLeft,\r\n faList,\r\n faUser,\r\n faGripHorizontal,\r\n faArrowFromLeft,\r\n faVial,\r\n faStopwatch,\r\n faWrench,\r\n faArrowUpRightFromSquare,\r\n faExternalLink,\r\n faExternalLinkAlt,\r\n faClose,\r\n faDownload,\r\n faBold,\r\n faItalic,\r\n faUnderline,\r\n faH1,\r\n faH2,\r\n faQuoteRight,\r\n faListOl,\r\n faFileAlt,\r\n faAt,\r\n faBarcode,\r\n faChain,\r\n faPowerOff,\r\n faPlug,\r\n faMicroscope,\r\n faCalendarCheck,\r\n faCalendarExclamation,\r\n faCalendarTimes,\r\n faFileUpload,\r\n faSpinner,\r\n faMoneyCheckEdit,\r\n faLevelUpAlt,\r\n faPaperclip,\r\n faAbacus,\r\n faAlbum,\r\n faFile,\r\n faSync,\r\n faRectangleVerticalHistory,\r\n faUniversity,\r\n faShopSlash,\r\n faDollarSign,\r\n faExchange,\r\n faSms,\r\n faUserPlus,\r\n faUserShield,\r\n faWarning,\r\n faLocationCrosshairs,\r\n faCircleDollarToSlot,\r\n faCopy,\r\n faCodeBranch,\r\n faChevronsUp,\r\n faChevronsDown,\r\n faEquals,\r\n faFileSpreadsheet,\r\n faFilePdf,\r\n faNewspaper,\r\n faFileImage,\r\n faFlag,\r\n faBarcodeScan,\r\n faMap,\r\n faBars,\r\n faMagnifyingGlass,\r\n faGrid2,\r\n faScrewdriver,\r\n faBullhorn,\r\n faMoneyBill,\r\n faFileArrowUp,\r\n faEarthEurope,\r\n faScannerKeyboard,\r\n faChevronsLeft,\r\n faChevronsRight,\r\n faCircleNotch,\r\n faMapLocation,\r\n faScrewdriverWrench,\r\n faBandage,\r\n faHourglassHalf,\r\n fasInfinity,\r\n //fal\r\n falCircleCheck,\r\n falTriangleExclamation,\r\n falCircleQuarters,\r\n falCircleExclamation,\r\n falMinimize,\r\n falMaximize,\r\n falTable,\r\n falCalendars,\r\n //fad\r\n fadTelescope,\r\n fadInfinity,\r\n fadCalendarCheck,\r\n fadCalendarExclamation,\r\n fadCalendarTimes,\r\n fadCalendarPlus,\r\n //far\r\n farMaximize,\r\n farCommentQuestion,\r\n farcircleExclamation,\r\n farCircleCheck,\r\n //fab\r\n fabGoogle,\r\n fabWindows,\r\n faShare,\r\n);\r\nexport type IconProp = IconName | [IconPrefix, IconName] | IconLookup;\r\n\r\nexport const IconNames: string[] = [\r\n 'circle-user',\r\n 'user-circle',\r\n 'chevron-up',\r\n 'pencil',\r\n 'lock',\r\n 'users',\r\n 'bell',\r\n 'question-circle',\r\n 'sign-out-alt',\r\n 'home',\r\n 'layer-group',\r\n 'bookmark',\r\n 'calendar-alt',\r\n 'dumbbell',\r\n 'comment-alt-dots',\r\n 'bolt',\r\n 'list-ul',\r\n 'chart-bar',\r\n 'chart-column',\r\n 'chart-line',\r\n 'chart-pie',\r\n 'chart-pie-alt',\r\n 'megaphone',\r\n 'file-invoice-dollar',\r\n 'cog',\r\n 'times',\r\n 'circle',\r\n 'circle-small',\r\n 'circle-check',\r\n 'print',\r\n 'search',\r\n 'chevron-double-up',\r\n 'chevron-double-down',\r\n 'check',\r\n 'check-double',\r\n 'info',\r\n 'triangle-exclamation',\r\n 'xmark',\r\n 'chevron-down',\r\n 'circle-xmark',\r\n 'ellipsis-v',\r\n 'plus',\r\n 'filter',\r\n 'table',\r\n 'minus',\r\n 'file-import',\r\n 'globe',\r\n 'lock-open',\r\n 'edit',\r\n 'trash',\r\n 'info-circle',\r\n 'grip-vertical',\r\n 'bell-slash',\r\n 'exclamation-circle',\r\n 'times-circle',\r\n 'arrow-left',\r\n 'tools',\r\n 'play',\r\n 'history',\r\n 'add',\r\n 'stream',\r\n 'ruler-triangle',\r\n 'th-list',\r\n 'clipboard-list-check',\r\n 'pencil-alt',\r\n 'calendar-plus',\r\n 'pause',\r\n 'save',\r\n 'calendars',\r\n 'list-timeline',\r\n 'code',\r\n 'ban',\r\n 'floppy-disk-circle-arrow-right',\r\n 'calculator',\r\n 'refresh',\r\n 'square',\r\n 'clone',\r\n 'clock',\r\n 'chevron-right',\r\n 'chevrons-right',\r\n 'clipboard-list',\r\n 'envelope',\r\n 'calendar',\r\n 'check-circle',\r\n 'link',\r\n 'chevron-double-right',\r\n 'chevron-double-left',\r\n 'chevron-left',\r\n 'chevrons-left',\r\n 'list',\r\n 'user',\r\n 'grip-horizontal',\r\n 'arrow-from-left',\r\n 'vial',\r\n 'stopwatch',\r\n 'wrench',\r\n 'arrow-up-right-from-square',\r\n 'external-link',\r\n 'external-link-alt',\r\n 'close',\r\n 'download',\r\n 'bold',\r\n 'italic',\r\n 'underline',\r\n 'h1',\r\n 'h2',\r\n 'quote-right',\r\n 'list-ol',\r\n 'file-alt',\r\n 'at',\r\n 'barcode',\r\n 'chain',\r\n 'power-off',\r\n 'plug',\r\n 'microscope',\r\n 'calendar-check',\r\n 'calendar-exclamation',\r\n 'calendar-times',\r\n 'file-upload',\r\n 'spinner',\r\n 'money-check-edit',\r\n 'level-up-alt',\r\n 'paperclip',\r\n 'abacus',\r\n 'album',\r\n 'file',\r\n 'sync',\r\n 'rectangle-vertical-history',\r\n 'university',\r\n 'shop-slash',\r\n 'dollar-sign',\r\n 'exchange',\r\n 'sms',\r\n 'circle-check',\r\n 'triangle-exclamation',\r\n 'circle-quarters',\r\n 'circle-exclamation',\r\n 'minimize',\r\n 'maximize',\r\n 'table',\r\n 'calendars',\r\n 'telescope',\r\n 'infinity',\r\n 'calendar-check',\r\n 'calendar-exclamation',\r\n 'calendar-times',\r\n 'calendar-plus',\r\n 'maximize',\r\n 'comment-question',\r\n 'circle-exclamation',\r\n 'circle-check',\r\n 'google',\r\n 'user-plus',\r\n 'user-shield',\r\n 'warning',\r\n 'windows',\r\n 'location-crosshairs',\r\n 'circle-dollar-to-slot',\r\n 'code-branch',\r\n 'copy',\r\n 'chevrons-up',\r\n 'chevrons-down',\r\n 'equals',\r\n 'file-spreadsheet',\r\n 'file-pdf',\r\n 'newspaper',\r\n 'flag',\r\n 'barcode-scan',\r\n 'map',\r\n 'bars',\r\n 'magnifying-glass',\r\n 'grid-2',\r\n 'screwdriver',\r\n 'bullhorn',\r\n 'money-bill',\r\n 'file-arrow-up',\r\n 'earth-europe',\r\n 'share',\r\n 'scanner-keyboard',\r\n 'circle-notch',\r\n 'map-location',\r\n 'screwdriver-wrench',\r\n 'bandage',\r\n 'hourglass-half',\r\n];\r\nexport const getIconNames = (): Entity[] => {\r\n const iconst = IconNames.map(icon => {\r\n return {\r\n Id: icon\r\n .split('-')\r\n .map((item, i) => {\r\n if (i === 0) {\r\n return item.toLowerCase();\r\n }\r\n return item.charAt(0).toUpperCase() + item.slice(1).toLowerCase();\r\n })\r\n .join(''),\r\n Name: icon,\r\n };\r\n });\r\n return iconst;\r\n};\r\nexport const getIconNamesObject = () => {\r\n const iconst = IconNames.map(icon => {\r\n return {\r\n [icon\r\n .split('-')\r\n .map((item, i) => {\r\n if (i === 0) {\r\n return item.toLowerCase();\r\n }\r\n return item.charAt(0).toUpperCase() + item.slice(1).toLowerCase();\r\n })\r\n .join('')]: icon,\r\n };\r\n });\r\n return iconst;\r\n};\r\n","/**\r\n *\r\n * PublicAssetsLayout\r\n *\r\n */\r\n// import { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport * as React from 'react';\r\n\r\nexport interface PublicAssetsLayoutProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport function PublicAssetsLayout(props: PublicAssetsLayoutProps) {\r\n const { children } = props;\r\n // const { checkIsMobile } = useIsMobile();\r\n // const isMobile = checkIsMobile();\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PublicAssetsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.PublicAssetsPage,\r\n);\r\n","/*\r\n * Asynchronously loads the component for NotAllowedPage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotAllowedPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.NotAllowed,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PlayGroundPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PlayGroundPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.PlayGroundPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetsInventoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetsInventoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AssetsInventoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetsInventoryLogPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetsInventoryLogPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.AssetsInventoryLogPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestAuditTrailHistoryPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.ServiceRequestAuditTrailHistoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Floors Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Floors = lazyLoad(\r\n () => import('./index'),\r\n module => module.Floors,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SubscriptionTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubscriptionTypesPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.SubscriptionTypesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BudgetExperimentsPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.BudgetExperiments,\r\n);\r\n","/**\r\n *\r\n * AddPricePeriod\r\n *\r\n */\r\n\r\nimport React from 'react';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\ninterface AddRegionProps {}\r\n\r\nexport function AddRegion(props: AddRegionProps): JSX.Element {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions } = useLayoutSlice();\r\n\r\n //RENDER\r\n return (\r\n \r\n {\r\n let params = {\r\n useSidePanel: true,\r\n } as RegionDetailsProps;\r\n dispatch(\r\n actions.openSidePanel({\r\n type: RenderPageType.RegionDetails,\r\n props: params,\r\n }),\r\n );\r\n }}\r\n />\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * Regions - Page\r\n *\r\n */\r\n\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport * as React from 'react';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { intersection } from 'lodash';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from './Columns';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { AxiosError } from 'axios';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IRegionDto } from '../IRegionDto';\r\nimport { IBasePageProps, IListPageProps } from 'app/pages/IBasePageProps';\r\nimport { GePageActions } from './Actions/GetPageActions';\r\n\r\n// IBasePageProps is for Routing\r\n// IListPageProps is for filtering has appliedFiler?: IFilterSettings;\r\nexport interface RegionsProps\r\n extends IBasePageProps,\r\n IListPageProps {}\r\n\r\nexport function Regions(props: RegionsProps): JSX.Element {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n //USER AUTHENTICATION\r\n const User: AuthenticatedUser | undefined = useSelector(\r\n selectAuthenticatedUser,\r\n );\r\n const roles: number[] | undefined = User?.Roles;\r\n const allowedroles: Roles[] = [Roles.Administrators];\r\n const IsAdmin: boolean = intersection(roles, allowedroles).length > 0;\r\n const settings = useSelector(selectglobalSettings);\r\n //COLUMNS\r\n const columns = useMemo(() => {\r\n return getColumns(t, settings);\r\n }, [settings, t]);\r\n\r\n //PAGE ACTIONS\r\n const PageActions: PageActionRenderer[] = GePageActions({\r\n isAdmin: IsAdmin,\r\n });\r\n\r\n //TABLE-INITIAL-STATE\r\n const initialState: IBasicTableState = useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Id', desc: false }],\r\n }),\r\n [],\r\n );\r\n //SELECTED ROWS ACTIONS\r\n const rowActions = React.useMemo[]>(() => {\r\n const result = IsAdmin\r\n ? [\r\n ({ row, onRefresh, ...rest }) => {\r\n const items: RowActionsProps[] = [];\r\n const handleDeleteClick = async () => {\r\n const url = `/api/odata/v4/Regions(${row.original.Id})`;\r\n try {\r\n await httpClient.delete(url).then(response => {\r\n if ((response as any).ErrorMessages.length > 0) {\r\n (response as any).ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n notifyActions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n } else {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n });\r\n onRefresh();\r\n } catch (error: unknown) {\r\n const responsemessage = (error as AxiosError)?.response?.data\r\n ?.error?.innererror?.message as string;\r\n const message =\r\n responsemessage === undefined\r\n ? t(translations.err_ErrorOccured)\r\n : responsemessage;\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n };\r\n items.push({\r\n onClick: handleDeleteClick,\r\n text: t(translations.Delete) as string,\r\n icon: 'trash',\r\n });\r\n\r\n return (\r\n \r\n );\r\n },\r\n ]\r\n : [];\r\n return result;\r\n }, [IsAdmin, dispatch, notifyActions, t]);\r\n\r\n const url = '/api/odata/v4/Regions';\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n\r\nconst TTable = withSavedHistoryT(\r\n BasicTable,\r\n '/Regions',\r\n (t, appSettings, user, settings) => search => [],\r\n);\r\n","import RegionRenderer from 'app/components/BasicTable/CellRenderers/RegionRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { IRegionDto } from '../IRegionDto';\r\n\r\nexport const getColumns = (t: TFunction, settings: GlobalSettings) => {\r\n const cols: Column[] = [\r\n {\r\n Header: t(translations.Id) as string,\r\n accessor: 'Id',\r\n Cell: RegionRenderer,\r\n },\r\n {\r\n Header: t(translations.RegionName) as string,\r\n accessor: 'Name',\r\n },\r\n ];\r\n return cols;\r\n};\r\n","import { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { AddRegion } from './AddRegion';\r\n\r\ninterface GetPageActionsProps {\r\n isAdmin: boolean;\r\n}\r\n\r\nexport function GePageActions(\r\n props: GetPageActionsProps,\r\n): PageActionRenderer[] {\r\n const PageActions = props.isAdmin\r\n ? [(dataCount, refresh) => ]\r\n : [];\r\n return PageActions;\r\n}\r\n","/**\r\n *\r\n * RegionDetailsPage\r\n *\r\n */\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { RegionDetails } from './Details';\r\n\r\nexport interface RegionDetailsPageProps\r\n extends RouteComponentProps<{ id: string }> {}\r\nexport function RegionDetailsPage(props: RegionDetailsPageProps) {\r\n const location = useLocation();\r\n const params = new URLSearchParams(location.search);\r\n\r\n const regionId =\r\n props.match.params['id'] || (GetRawValue(params, 'id') ?? undefined);\r\n return ;\r\n}\r\n","/**\r\n *\r\n * AddSuperGroup\r\n *\r\n */\r\n\r\nimport React from 'react';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\ninterface AddSuperGroupProps {}\r\n\r\nexport function AddSuperGroup(props: AddSuperGroupProps): JSX.Element {\r\n const { t } = useTranslation();\r\n\r\n //RENDER\r\n return (\r\n \r\n \r\n ,\r\n \r\n );\r\n}\r\n","/**\r\n *\r\n * Regions - Page\r\n *\r\n */\r\n\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport * as React from 'react';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n selectAuthenticatedUser,\r\n selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { intersection } from 'lodash';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from './Columns';\r\nimport {\r\n RowActionsMenu,\r\n RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { AxiosError } from 'axios';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IBasePageProps, IListPageProps } from 'app/pages/IBasePageProps';\r\nimport { GePageActions } from './Actions/GetPageActions';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\nimport { GetFilters } from './Filters';\r\n\r\n// IBasePageProps is for Routing\r\n// IListPageProps is for filtering has appliedFiler?: IFilterSettings;\r\nexport interface SuperGroupsPageProps\r\n extends IBasePageProps,\r\n IListPageProps {}\r\n\r\nexport function SuperGroupsPage(props: SuperGroupsPageProps): JSX.Element {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { actions: notifyActions } = useAppSettingsSlice();\r\n //USER AUTHENTICATION\r\n const User: AuthenticatedUser | undefined = useSelector(\r\n selectAuthenticatedUser,\r\n );\r\n const roles: number[] | undefined = User?.Roles;\r\n const allowedroles: Roles[] = [Roles.Administrators];\r\n const IsAdmin: boolean = intersection(roles, allowedroles).length > 0;\r\n const settings = useSelector(selectglobalSettings);\r\n //COLUMNS\r\n const columns = useMemo(() => {\r\n return getColumns(t, settings, IsAdmin);\r\n }, [IsAdmin, settings, t]);\r\n\r\n //PAGE ACTIONS\r\n const PageActions: PageActionRenderer[] = GePageActions({\r\n isAdmin: IsAdmin,\r\n });\r\n\r\n //TABLE-INITIAL-STATE\r\n const initialState: IBasicTableState = useMemo(\r\n () => ({\r\n sortBy: [{ id: 'Id', desc: false }],\r\n }),\r\n [],\r\n );\r\n //SELECTED ROWS ACTIONS\r\n const rowActions = React.useMemo[]>(() => {\r\n const result = IsAdmin\r\n ? [\r\n ({ row, onRefresh, ...rest }) => {\r\n const items: RowActionsProps[] = [];\r\n const handleDeleteClick = async () => {\r\n const url = `/api/odata/v4/SuperGroup(${row.original.Id})`;\r\n try {\r\n await httpClient.delete(url).then(response => {\r\n if ((response as any).ErrorMessages.length > 0) {\r\n (response as any).ErrorMessages.forEach(errmsg =>\r\n dispatch(\r\n notifyActions.addNotification({\r\n variant: 'error',\r\n message: errmsg,\r\n }),\r\n ),\r\n );\r\n } else {\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: t(translations.Success),\r\n variant: 'success',\r\n }),\r\n );\r\n }\r\n });\r\n onRefresh();\r\n } catch (error: unknown) {\r\n const responsemessage = (error as AxiosError)?.response?.data\r\n ?.error?.innererror?.message as string;\r\n const message =\r\n responsemessage === undefined\r\n ? t(translations.err_ErrorOccured)\r\n : responsemessage;\r\n dispatch(\r\n notifyActions.addNotification({\r\n message: message,\r\n variant: 'error',\r\n }),\r\n );\r\n }\r\n };\r\n items.push({\r\n onClick: handleDeleteClick,\r\n text: t(translations.Delete) as string,\r\n icon: 'trash',\r\n });\r\n\r\n return (\r\n \r\n );\r\n },\r\n ]\r\n : [];\r\n return result;\r\n }, [IsAdmin, dispatch, notifyActions, t]);\r\n\r\n const url = '/api/odata/v4/SuperGroup';\r\n //RENDER\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n\r\nconst TTable = withSavedHistoryT(\r\n BasicTable,\r\n '/SuperGroups',\r\n GetFilters,\r\n);\r\n","import { Link } from 'app/components/ExternalLink';\r\nimport { RegionLink } from 'app/pages/Regions/RegionLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\n\r\nexport const getColumns = (\r\n t: TFunction,\r\n settings: GlobalSettings,\r\n isAdmin: boolean,\r\n) => {\r\n const cols: Column[] = [\r\n {\r\n Header: t(translations.Id) as string,\r\n accessor: 'Id',\r\n Cell: ({ value, row }) => {\r\n if (isAdmin) {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n );\r\n } else {\r\n return <>{value};\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.Name) as string,\r\n accessor: 'Name',\r\n },\r\n {\r\n Header: t(translations.RegionName) as string,\r\n accessor: 'RegionName',\r\n Cell: ({ value, row }) => {\r\n if (\r\n row.original.RegionId !== null &&\r\n row.original.RegionId !== undefined\r\n ) {\r\n return (\r\n <>\r\n {isAdmin ? (\r\n \r\n {value}\r\n \r\n ) : (\r\n <>{value}\r\n )}\r\n \r\n );\r\n } else {\r\n return <>{'N/A'};\r\n }\r\n },\r\n },\r\n {\r\n Header: t(translations.Description) as string,\r\n accessor: 'Description',\r\n },\r\n ];\r\n return cols;\r\n};\r\n","import { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { AddSuperGroup } from './AddSuperGroup';\r\n\r\ninterface GetPageActionsProps {\r\n isAdmin: boolean;\r\n}\r\n\r\nexport function GePageActions(\r\n props: GetPageActionsProps,\r\n): PageActionRenderer[] {\r\n const PageActions = props.isAdmin\r\n ? [(dataCount, refresh) => ]\r\n : [];\r\n return PageActions;\r\n}\r\n","/**\r\n *\r\n * supergroups - Filters\r\n *\r\n */\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\n\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\nimport {\r\n URLSearchParamsCI,\r\n GetPartialEntity,\r\n GetRawValue,\r\n GetNumberOrUndefined,\r\n initExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\n\r\nexport const GetFilters: GetPageFilters = (\r\n t,\r\n appSettings,\r\n user,\r\n settings,\r\n) => search => {\r\n const params = new URLSearchParamsCI(search);\r\n var result: IFilterSettings[] = [\r\n {\r\n fieldName: 'RegionId',\r\n displayName: t(translations.Region),\r\n operator: ODataOperators.Equals,\r\n queryStringSerializer: 'regionid',\r\n initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n value: GetPartialEntity(\r\n GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n ),\r\n component: RegionFilter,\r\n urlType: 'base',\r\n },\r\n ];\r\n return result;\r\n};\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const JoinAdGroupPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.JoinAdGroupPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const JoinConfirmPage = lazyLoad(\r\n () => import('./index'),\r\n module => module.JoinConfirmPage,\r\n);\r\n","/**\r\n *\r\n * App\r\n *\r\n * This component is the skeleton around the actual pages, and should only\r\n * contain code that should be seen on all pages. (e.g. navigation bar)\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Switch, Route } from 'react-router-dom';\r\n\r\nimport { GlobalStyle, CustomStyle } from 'styles/global-styles';\r\n\r\nimport { NotFoundPage } from './pages/NotFoundPage/Loadable';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { FrontendLayout } from 'app/Layout/FrontendLayout/Loadable';\r\n\r\nimport {\r\n ThemeProvider as MuiThemeProvider,\r\n StylesProvider,\r\n jssPreset,\r\n} from '@material-ui/core/styles';\r\nimport { create } from 'jss';\r\nimport rtl from 'jss-rtl';\r\n\r\nimport { CreateTheme } from 'styles/theme';\r\nimport { SnackbarProvider } from 'notistack';\r\n\r\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\r\n\r\n// pick a date util library\r\nimport DateFnsUtils from '@date-io/date-fns';\r\nimport * as dateFnsLocales from 'date-fns/locale';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n selectAppSettings,\r\n selectDateFnsLocale,\r\n selectIsAuthenticated,\r\n selectLoading,\r\n selectLoadingUser,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from './slice';\r\nimport { useEffect } from 'react';\r\n\r\n// import i18n (needs to be bundled ;))\r\nimport '../locales/i18n';\r\nimport { AnimalTypesPage } from './pages/AnimalTypesPage/Loadable';\r\n\r\nimport { DialogAlert } from './components/DialogAlert';\r\nimport { ErrorBoundary } from './components/ErrorBoundary';\r\nimport { SnackbarManager } from './Layout/FrontendLayout/components/Snackbar/Loadable';\r\nimport { InternalIdLoginPage } from './pages/Animals/InternalIdLoginPage/Loadable';\r\nimport { AnimalsListPage } from './pages/AnimalsListPage/Loadable';\r\nimport { PosLayout } from './Layout/PosLayout';\r\nimport { AnimalCaseConsumablesPage } from './pages/Animals/AnimalCaseConsumablesPage/Loadable';\r\nimport { LoginLayout } from './Layout/LoginLayout';\r\nimport { AnimalsHomePage } from './pages/Animals/AnimalsHomePage/Loadable';\r\nimport { ConnectedRouter } from 'connected-react-router';\r\n\r\nimport { PrivateAnimalRoute } from './pages/Animals/PrivateAnimalRoute';\r\nimport Grow from '@material-ui/core/Grow';\r\nimport { TransitionProps } from '@material-ui/core/transitions/transition';\r\nimport { CssBaseline } from '@material-ui/core';\r\nimport { CreateNewCasePage } from './pages/Animals/CreateNewCasePage/Loadable';\r\nimport { SamplesListPage } from './pages/Samples/SamplesListPage/Loadable';\r\nimport { RunDetailsPage } from './pages/Samples/RunDetailsPage/Loadable';\r\nimport {\r\n RequestDetailsPage,\r\n RequestSamplesPage,\r\n} from './pages/Samples/RequestSamplesPage/Loadable';\r\nimport { TrainingSessionsPage } from './pages/TrainingSessionsPage/Loadable';\r\nimport { BuildingsPage } from './pages/Buildings/Loadable';\r\nimport { History } from './pages/ReservationHistoryPage/Loadable';\r\nimport { AddNewReportPage } from './pages/AddNewReportPage/Loadable';\r\nimport { Progress } from './components/LoadingIndicator';\r\nimport { TrainingWaitingListPage } from './pages/TrainingWaitingListPage/Loadable';\r\nimport { history } from 'store/history';\r\nimport { EmailNotificationsPage } from './pages/EmailNotificationsPage/Loadable';\r\nimport { ExperimentTemplatesPage } from './pages/ExperimentTemplates/Loadable';\r\nimport { UsersHistoryPage } from './pages/UsersHistoryPage/Loadable';\r\nimport { UserTrainingPage } from './pages/UserTrainingsPage/Loadable';\r\nimport { NotAvailable } from './pages/NotAvailablePage/Loadable';\r\nimport { RestrictedRoute } from './components/Routers/RestrictedRoute';\r\nimport { Users } from './pages/UsersPage/loadable';\r\nimport { AnimalExtendedBillingReportPage } from './pages/Animals/AnimalExtendedBillingReportPage/Loadable';\r\nimport { UserTrainingHistoryPage } from './pages/UserTrainingHistoryPage/Loadable';\r\nimport { OtherServicesPage } from './pages/OtherServicesPage/Loadable';\r\nimport { BudgetsPage } from './pages/BudgetsPage/Loadable';\r\nimport { ServiceRequestPage } from './pages/ServiceRequestListPage/Loadable';\r\nimport { WorkOrdersPage } from './pages/WorkOrdersPage/Loadable';\r\nimport { DocumentsPage } from './pages/Documents/Loadable';\r\nimport { QuizPage } from './pages/QuizPage/Loadable';\r\nimport { QuizDetailsPage } from './pages/QuizDetailsPage/Loadable';\r\nimport { UserTrainingDetailsPage } from './pages/UserTrainings/TrainingDetailsPage/Loadable';\r\nimport { SampleModificationsPage } from './pages/Samples/SampleModificationsPage/Loadable';\r\nimport { UsageHistory } from './pages/UsageHistoryPage/Loadable';\r\nimport { RunsListPage } from './pages/Samples/RunsListPage/Loadable';\r\nimport { AnimalCasesHistoryPage } from './pages/Animals/AnimalCaseEditPage/AnimalCasesHistory/Loadable';\r\nimport { SendEmailToUsersPage } from './pages/SendEmailToUsers/Loadable';\r\nimport { Charges } from './pages/ChargesPage/Loadable';\r\nimport { MyAssetsPage } from './pages/MyAssetsPage/Loadable';\r\nimport { Locations } from './pages/LocationsPage/loadable';\r\nimport { BuildingPage } from './pages/LocationsPage/BuildingPage/loadable';\r\nimport { CampusesPage } from './pages/LocationsPage/CampusesPage/loadable';\r\nimport { AreasPage } from './pages/LocationsPage/AreasPage/loadable';\r\nimport { LocationListPage } from './pages/LocationsPage/LocationListPage/loadable';\r\nimport { SubLocationListPage } from './pages/LocationsPage/SubLocationListPage/loadable';\r\nimport { InvoiceBatches } from './pages/InvoiceBatches/Loadable';\r\nimport { CategoriesPage } from './pages/CategoriesPage/Loadable';\r\nimport { CategoryGroupsPage } from './pages/CategoryGroupsPage/Loadable';\r\nimport { BillingPreviewPage } from './pages/BillingPreviewPage/Loadable';\r\nimport { OnlineBudgetsStatusPage } from './pages/OnlineBudgetsStatusPage';\r\nimport { InvoiceDetailsPage } from './pages/InvoiceDetails/Loadable';\r\nimport { WorkOrderDetailsPage } from './pages/WorkOrders/WorkOrderDetailsPage/Loadable';\r\nimport { Billing } from './pages/InvoiceBillingPage/Loadable';\r\nimport { BillingActions } from './pages/BillingActions/BillingActionsPage/Loadable';\r\nimport { BillingActionsDetailsPage } from './pages/BillingActions/BillingActionsDetailsPage/Loadable';\r\nimport { LocationTypesPage } from './pages/LocationsPage/LocationTypesPage/loadable';\r\nimport { SubLocationTypesPage } from './pages/LocationsPage/SubLocationTypesPage/loadable';\r\nimport { GetBrowserInfo } from 'utils/mobileDetect';\r\nimport { SavedViewDetailsPage } from './pages/SavedViewsPage/SavedViewPage/Loadable';\r\nimport { SavedViews } from './pages/SavedViewsPage/SavedViewsPage/Loadable';\r\nimport { LabelTypesPage } from './pages/LabelTypesPage/Loadable';\r\nimport { AssetDetailsPage } from './pages/AssetDetailsPage/Loadable';\r\nimport { LabelPrintDialog } from './components/LabelPrint/LabelPrintDialog/Loadable';\r\nimport { KioskProjectsPage } from './pages/KioskProjects/Loadable';\r\nimport { KioskProjectConsumablesPage } from './pages/KioskProjects/KioskProjectConsumablesPage/Loadable';\r\nimport { PrivateKioskProjectsRoute } from './pages/KioskProjects/PrivateKioskProjectsRoute/Loadable';\r\nimport { SessionTimeout } from './components/SessionTimeout';\r\nimport { SubmissionsPage } from './pages/QuizSubmissionsPage/Loadable';\r\nimport { QuizzesPage } from './pages/QuizzesPage/Loadable';\r\nimport { AdHocReportListPage } from './pages/AdHocReportListPage/Loadable';\r\nimport { Rooms } from './pages/RoomsPage/Loadable';\r\nimport { CalendarMessages } from './pages/CalendarMessages/CalendarMessagesPage/Loadable';\r\nimport { CoresDirectoryPage } from './pages/CoresDirectoryPage/Loadable';\r\nimport { SamplePlatesPage } from './pages/Samples/SamplePlatesPage/Loadable';\r\nimport { HeadTitle } from './Layout/FrontendLayout/components/HeadTitle';\r\nimport { InstrumentRestrictionsPage } from './pages/InstrumentRestrictionsPage/Loadable';\r\nimport { LabelTypeDetailsPage } from './pages/LabelTypeDetailsPage/Loadable';\r\nimport { ConfigurableColumnExportImportPage } from './pages/ConfigurableColumnExportImport/Loadable';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ServerBarcodeRoute } from './components/Routers/ServerBarcodesRoute';\r\nimport { useLayoutSlice } from './Layout/FrontendLayout/slice';\r\nimport { NewMessagePage } from './pages/NewMessagePage/Loadable';\r\nimport { OtherServiceDetailsPage } from './pages/OtherServiceDetails/OtherServiceDetailsPage/Loadable';\r\nimport { InvoiceTemplates } from './pages/InvoiceTemplates/InvoiceTemplatesPage/Loadable';\r\nimport { Expenses } from './pages/ExpensesPage/Loadable';\r\nimport { PricePeriodsPagePage } from './pages/PriceSheetPeriodsPage/Loadable';\r\nimport { PriceSheetPeriodDetailsPage } from './pages/PriceSheetPeriodDetails/PriceSheetPeriodDetailsPage/Loadable';\r\nimport { ArticlesPagePath, ArticlesPage } from './pages/ArticlesPage/Loadable';\r\nimport {\r\n ArticlesExternalSearchPagePath,\r\n ArticlesExternalSearchPage,\r\n} from './pages/ArticlesExternalSearchPage/Loadable';\r\nimport { AccountLayout } from './Layout/AccountLayout/Loadable';\r\nimport { RegisterPage } from './pages/Account/Register/Loadable';\r\nimport { anonimusUrls } from './slice/types';\r\nimport {\r\n CalendarPage,\r\n CalendarPageDefaultRedir,\r\n} from './pages/CalendarPage/Loadable';\r\nimport {\r\n calendarPageDefaultPath,\r\n calendarPageFullPath,\r\n CalendarPagePaths,\r\n} from './pages/CalendarPage';\r\nimport { ReservationDetailsPage } from './pages/ReservationDetails/ReservationDetailsPage/Loadable';\r\nimport { HomePage } from './pages/HomePage/Loadable';\r\nimport { SystemPage } from './pages/SystemPage/Loadable';\r\nimport { DashboardPage } from './pages/DashboardPage/Loadable';\r\nimport { CoreSelectionPage } from './pages/CoreSelectionPage/Loadable';\r\nimport { CoreHomePage } from './pages/CoreHomePage/Loadable';\r\nimport { CoreStatsPage } from './pages/CoreStatsPage/Loadable';\r\nimport { ReportingPage } from './pages/ReportingPage/Loadable';\r\nimport { BookitLabDashboadPage } from './pages/BookitLabDashboardPage/Loadable';\r\nimport { RedirectWithSearch } from './components/RedirectWithSearch';\r\nimport { AssetSelectionPage } from './pages/MyAssetsPage/AssetsSelection/Loadable';\r\nimport { TermsOfUseAgreementPage } from './pages/TermsOfUseAgreementPage/Loadable';\r\nimport { SnackWrapper } from './Layout/FrontendLayout/components/Snackbar/SnackWrapper';\r\nimport { ActiveUserGroupPage } from './pages/ActiveUserGroupPage/Loadable';\r\nimport { CannedReportsPage } from './pages/CannedReports/Loadable';\r\nimport { ServiceRequestDetailsPath } from './pages/Samples/RequestSamplesPage/slice/path';\r\nimport { UserAttributes } from './pages/UserAttributes/UserAttributesPage/Loadable';\r\nimport { ReportConsumablesPage } from './pages/OtherServiceDetails/ReportConsumables/ReportConsumablesPage/Loadable';\r\nimport { LoginPage } from './pages/LoginPage/Loadable';\r\nimport { CalendarMessagesDetailsPage } from './pages/CalendarMessages/CalendarMessagesDetails/Loadable';\r\nimport { ServiceRequestsKanbanPage } from './pages/ServiceRequestsKanbanPage/Loadable';\r\nimport { OfflineServiceTypesPage } from './pages/OfflineServiceTypesPage/Loadable';\r\nimport { RUN_DETAILS_PAGE_PATH } from './pages/Samples/RunDetailsPage';\r\nimport { NOTIFICATIONS_LOG_PAGE_PATH } from './pages/EmailNotificationsPage';\r\nimport { AnimalCaseEditPage } from './pages/Animals/AnimalCaseEditPage/Loadable';\r\nimport { ServiceRequestsKanbanPagePath } from './pages/ServiceRequestsKanbanPage';\r\nimport './AllIcons';\r\nimport { PublicAssetsLayout } from './Layout/PublicAssetsLayout';\r\nimport { PublicAssetsPage } from './pages/PublicAssets/Loadable';\r\nimport { NotAllowedPage } from './pages/NotAllowedPage/Loadable';\r\nimport { PlayGroundPage } from './pages/PlayGround/Loadable';\r\nimport { AssetsInventoryPage } from './pages/AssetsInventory/Loadable';\r\nimport { AssetsInventoryLogPage } from './pages/AssetsInventoryLog/Loadable';\r\nimport { ServiceRequestAuditTrailHistoryPage } from './pages/ServiceRequestAuditTrailHistoryPage/Loadable';\r\nimport { Floors } from './pages/FloorsPage/Loadable';\r\nimport { SubscriptionTypesPage } from './pages/SubscriptionTypesPage/Loadable';\r\nimport { BudgetExperimentsPage } from './pages/BudgetExperimentsPage/Loadable';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Regions } from './pages/Regions/RegionsPage';\r\nimport { RegionDetailsPage } from './pages/Regions/RegionsDetailsPage';\r\nimport { SuperGroupsPage } from './pages/SuperGroups/SuperGroupsPage';\r\nimport { JoinAdGroupPage } from './pages/JoinAdGroup/Loadable';\r\nimport { JoinConfirmPage } from './pages/JoinAdGroup/JoinConfirmPage/Loadable';\r\n\r\nconst jss = create({ plugins: [...jssPreset().plugins, rtl()] });\r\n\r\nexport function App() {\r\n const { i18n } = useTranslation();\r\n const dispatch = useDispatch();\r\n const isAuthenticated = useSelector(selectIsAuthenticated);\r\n const userLoading = useSelector(selectLoadingUser);\r\n const isLoading = useSelector(selectLoading);\r\n const isLoginPage = React.useMemo(() => {\r\n return window.location.pathname.toLowerCase().indexOf('login') > -1;\r\n }, []);\r\n const isPublicPage = React.useMemo(() => {\r\n return anonimusUrls.some(\r\n f => window.location.pathname.toLowerCase().indexOf(f) > -1,\r\n );\r\n }, []);\r\n //const [noValidLocation, setNoValidLocation] = React.useState(false);\r\n const useEffectOnMount = (effect: React.EffectCallback) => {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n useEffect(effect, []);\r\n };\r\n const { actions } = useAppSettingsSlice();\r\n // run the layout slice ahead of time so that it will process global actions like openSidePanel, etc.\r\n useLayoutSlice();\r\n useEffectOnMount(() => {\r\n if (!isLoginPage) {\r\n dispatch(actions.getAuthenticatedUser(isPublicPage));\r\n window.scrollTo(0, 1);\r\n } else {\r\n dispatch(actions.loadLoginSystemSettings());\r\n }\r\n });\r\n React.useEffect(() => {\r\n if (!isLoginPage) {\r\n if (!userLoading && isAuthenticated !== undefined) {\r\n if (isAuthenticated) {\r\n // if (noValidLocation) {\r\n // window.location.href = toRootedURL('/Divisions.aspx');\r\n // }\r\n dispatch(actions.loadAppSettings(true));\r\n dispatch(actions.loadSiteMapSettings());\r\n dispatch(actions.loadUserProfileSettings());\r\n dispatch(actions.loadGlobalServiceGroupFilter());\r\n dispatch(actions.loadSystemSettings());\r\n setTimeout(() => dispatch(actions.loadEventsCount()), 0);\r\n\r\n GetBrowserInfo();\r\n } else {\r\n if (isPublicPage) {\r\n dispatch(actions.loadAppSettings(false));\r\n } else {\r\n window.location.replace(toRootedURL('/login'));\r\n //dispatch(actions.navigate('/login'));\r\n }\r\n }\r\n }\r\n }\r\n }, [\r\n actions,\r\n dispatch,\r\n isAuthenticated,\r\n isLoginPage,\r\n isPublicPage,\r\n userLoading,\r\n ]);\r\n // React.useEffect(() => {\r\n // setNoValidLocation(window.location.pathname.endsWith('index.html'));\r\n // }, []);\r\n\r\n const dir = i18n.dir();\r\n const bookitTheme = CreateTheme('ltr', 'bookit');\r\n const defaultTheme = CreateTheme(dir, 'default');\r\n const animalTheme = CreateTheme(dir, 'animals');\r\n const kioskTheme = CreateTheme('ltr', 'bookit');\r\n\r\n document.body.dir = dir;\r\n const dateFnsLocale = useSelector(selectDateFnsLocale);\r\n const locale = React.useMemo(\r\n () =>\r\n dateFnsLocale === undefined ? undefined : dateFnsLocales[dateFnsLocale],\r\n [dateFnsLocale],\r\n );\r\n const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {/* basename is required to properly route addresses when app is served from a non-root location like https://host/application/ */}\r\n \r\n {isLoading === false &&\r\n //!noValidLocation &&\r\n isAuthenticated === true && (\r\n \r\n )}\r\n {isLoading === false && }\r\n {isLoading === false &&\r\n //!noValidLocation &&\r\n (isAuthenticated !== undefined || isLoginPage) ? (\r\n \r\n {isAuthenticated === true ? (\r\n \r\n \r\n \r\n {/* todo: fix the LatoStyle - after initial load, first dialog open results in a glitch: text elements are switched from lato to default and immediately back. this results in elements on the page jumping back and forth */}\r\n {/* */}\r\n \r\n {/* todo : prepend public url like so to support virtual applications hosted at {process.env.PUBLIC_URL + '/Calendar'} */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* \r\n direct navigation/aspx links are redirected on the server side,\r\n so reservation details should get the /reservation/details here\r\n reservation.aspx link might be added by mistake somewhere in react, so these cases are handled here\r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n \r\n \r\n \r\n \r\n */}\r\n\r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n ) : (\r\n
    \r\n \r\n
    \r\n )}\r\n {/* */}\r\n\r\n \r\n {isLoading === false &&\r\n //!noValidLocation &&\r\n isAuthenticated === true && }\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n \r\n \r\n \r\n \r\n {isLoading === false &&\r\n //!noValidLocation &&\r\n isAuthenticated === true && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { BARCODE_SCANNED, BARCODE_SCANNING } from 'react-usb-barcode-scanner';\r\n\r\nexport const barcodeScannerMiddleware = store => next => action => {\r\n // processing barcode need to be here\r\n if (action.type === BARCODE_SCANNED) {\r\n console.debug(action);\r\n }\r\n if (action.type === BARCODE_SCANNING) {\r\n }\r\n return next(action);\r\n};\r\n","import { ReportHandler } from 'web-vitals';\r\n\r\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","/**\r\n *\r\n * MobileBarcodeScanner\r\n *\r\n */\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nexport interface MobileBarcodeScannerProps {}\r\n\r\nexport const MobileBarcodeScanner = React.memo(function MobileBarcodeScanner(\r\n props: MobileBarcodeScannerProps,\r\n) {\r\n const dispatch = useDispatch();\r\n const handleBarcodeScanned = (barcode: string) => {\r\n dispatch({\r\n type: BARCODE_SCANNED,\r\n payload: {\r\n data: barcode,\r\n },\r\n });\r\n };\r\n // sets the mobile barcode callback that will be called directly from the mobile app\r\n useEffectOnMount(() => {\r\n (window as any).mobileBarcodeScanCallback = handleBarcodeScanned;\r\n return () => ((window as any).mobileBarcodeScanCallback = undefined);\r\n });\r\n return
    ;\r\n});\r\n","/**\r\n * index.tsx\r\n *\r\n * This is the entry file for the application, only setup and boilerplate\r\n * code.\r\n */\r\n\r\nimport 'react-app-polyfill/ie11';\r\nimport 'react-app-polyfill/stable';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\n\r\n// Use consistent styling\r\nimport 'sanitize.css/sanitize.css';\r\n\r\n// Import root app\r\nimport { App } from 'app';\r\n\r\nimport { HelmetProvider } from 'react-helmet-async';\r\n\r\nimport { configureAppStore } from 'store/configureStore';\r\nimport { BarcodeScanner } from 'react-usb-barcode-scanner';\r\n\r\nimport reportWebVitals from 'reportWebVitals';\r\n\r\nimport WebfontLoader from '@dr-kobros/react-webfont-loader';\r\n// Initialize languages\r\nimport './locales/i18n';\r\nimport { MobileBarcodeScanner } from 'app/components/MobileBarcodeScanner';\r\n\r\nconst fontsConfig = {\r\n // custom: {\r\n // families: ['Lato:wght@300;400;700;900&display=swap'],\r\n // urls: [`${process.env.PUBLIC_URL}/fonts/Lato/lato.css`],\r\n // },\r\n google: {\r\n families: ['Lato:wght@300;400;700;900&display=swap'],\r\n },\r\n};\r\nconst store = configureAppStore();\r\nconst MOUNT_NODE = document.getElementById('root') as HTMLElement;\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n MOUNT_NODE,\r\n);\r\n\r\n// Hot reloadable translation json files\r\nif (module.hot) {\r\n module.hot.accept(['./locales/i18n'], () => {\r\n // No need to render the App again because i18next works with the hooks\r\n });\r\n}\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","/**\r\n * Create the store with dynamic reducers\r\n */\r\n\r\nimport { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';\r\nimport { createInjectorsEnhancer } from 'redux-injectors';\r\nimport createSagaMiddleware from 'redux-saga';\r\nimport { routerMiddleware as createRouterMiddleware } from 'connected-react-router';\r\n\r\nimport { createReducer as createReducerWithRouter } from './reducers';\r\nimport { history } from './history';\r\nimport { barcodeScannerMiddleware } from './BarcodeScanner';\r\n\r\nexport function configureAppStore() {\r\n const reduxSagaMonitorOptions = {};\r\n const sagaMiddleware = createSagaMiddleware(reduxSagaMonitorOptions);\r\n\r\n const { run: runSaga } = sagaMiddleware;\r\n\r\n // List middlewares here\r\n const middlewares = [\r\n // Create the store with saga middleware\r\n sagaMiddleware,\r\n // routerMiddleware is needed to to dispatch history actions (e.g. to change URL with push('/path/to/somewhere')).\r\n createRouterMiddleware(history),\r\n barcodeScannerMiddleware,\r\n ];\r\n\r\n // dev logging\r\n // Log only in development\r\n if (process.env.NODE_ENV === `development`) {\r\n const { createLogger } = require(`redux-logger`);\r\n middlewares.push(\r\n createLogger({\r\n collapsed: true,\r\n }),\r\n );\r\n }\r\n\r\n // Provide the created history to the root reducer creator.\r\n const createReducer = createReducerWithRouter(history);\r\n\r\n const enhancers = [\r\n createInjectorsEnhancer({\r\n createReducer,\r\n runSaga,\r\n }),\r\n ];\r\n\r\n const store = configureStore({\r\n reducer: createReducer(),\r\n middleware: [\r\n ...middlewares,\r\n ...getDefaultMiddleware({\r\n serializableCheck: {\r\n ignoredPaths: [\r\n 'workOrder.createState.data.StaffFormFiles',\r\n 'workOrder.createState.data.SubmissionFormFiles',\r\n ],\r\n ignoredActionPaths: [\r\n 'payload.workOrderDetails.SubmissionFormFiles',\r\n 'payload.workOrderDetails.StaffFormFiles',\r\n 'payload.current.SubmissionFormFiles',\r\n 'payload.current.StaffFormFiles',\r\n 'payload.customFormFiles',\r\n 'payload.currentCustomFormFiles',\r\n 'payload.originalCustomFormFiles',\r\n 'payload.state.customFormFiles',\r\n ],\r\n },\r\n }),\r\n ],\r\n devTools: process.env.NODE_ENV !== 'production',\r\n enhancers,\r\n });\r\n\r\n return store;\r\n}\r\n","/**\r\n * Combine all reducers in this file and export the combined reducers.\r\n */\r\n\r\nimport { combineReducers } from '@reduxjs/toolkit';\r\nimport { connectRouter } from 'connected-react-router';\r\nimport { barcodeScannerReducer } from 'react-usb-barcode-scanner';\r\nimport { InjectedReducersType } from 'utils/types/injector-typings';\r\n\r\n/**\r\n * Merges the main reducer with the router state and dynamically injected reducers\r\n */\r\nexport const createReducer = history => (\r\n injectedReducers: InjectedReducersType = {},\r\n) => {\r\n // Create a function that takes history as an argument and returns the root reducer.\r\n // Add router reducer into root reducer by passing history to connectRouter.\r\n // Note: The key MUST be router.\r\n\r\n return combineReducers({\r\n router: connectRouter(history),\r\n barcodeScanner: barcodeScannerReducer,\r\n ...injectedReducers,\r\n });\r\n};\r\n"],"sourceRoot":""}