{"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","app/Layout/FrontendLayout/slice/selectors.ts","types/AppSettings.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","enums/ServiceTypes.ts","app/components/Typography/BasicTypography.tsx","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/hooks/useSystemDate.ts","app/components/ExternalLink/index.tsx","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/pages/Samples/RequestSamplesPage/slice/types.ts","app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn.ts","app/pages/Samples/RequestSamplesPage/slice/selectors.ts","app/components/BasicIcons/InfoIcon/index.tsx","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","types/CustomDate.ts","app/components/pickers/AutocompletePickers/UserPicker/index.tsx","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/Article.ts","app/components/Forms/FormConnectedFilters/slice/selectors.ts","app/components/pickers/MultiSelectPickers/OnlineServicesPicker/index.tsx","enums/commentReferenceTypes.ts","app/components/Forms/FormLabelText.tsx","enums/TrainingState.ts","api/OtherServicesApi.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/selectors.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/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","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","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","api/CommentsApi.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","api/WorkOrderApi.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/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/WorkOrders/WorkOrderDetailsPage/Details/slice/saga.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/index.ts","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/components/pickers/AutocompletePickers/UserGroupPicker/index.tsx","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/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/Actions/GlobalSelectedActions/OpenWorkOrder.tsx","app/components/CommentsContainer/styles.ts","app/components/CommentsContainer/FileButton.tsx","app/components/LargeFilesUpload/slice/selectoes.ts","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/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/pickers/AutocompletePickers/InstituteTypePicker/index.tsx","app/components/Description/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/pages/ReservationDetails/Details/slice/getBudgetVisible.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","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","app/components/CommentsContainer/IComment.ts","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/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/InfoIcon/index.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","layout","selectSidePanelState","selectPageType","selectPageTypeProps","selectConfirmOpen","selectConfirmApproved","selectConfirmRejected","selectDoRefreshTable","selectContinueState","selectContinueToLink","selectHideNavigation","selectSnackBarIndex","selectIsMobileView","selectActionTableProcessing","selectProcessingIndicator","methodName","selectIsCoverOpen","selectIsCoverExpanded","selectAdminPanelUrl","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","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","ServiceType","BasicTypography","italic","typographyComponentMapping","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","useSystemDate","appTimeZone","currentTimezoneOffser","getOffset","useCallback","newDate","parsedDate","getOffsetDateOrNull","localDate","withoutOffset","withOffset","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","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","selectSavedOfflineServices","savedOfflineServices","selectRefreshOfflineServices","refeshOfflineService","selectTerminateState","terminationState","selectTerminateProcessing","terminatProcessing","selectTerminateCompleted","terminateCompleted","selectCloneReservations","cloneReservation","selectReservationDtoState","reservationDtoState","selectSavedForLater","SaveForLater","selectIsCreditSubmited","submitCredit","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","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","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","styles","createStyles","zIndex","left","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","orderBy","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","ArticleStatus","selectConnectedFilters","connectedFilters","selectConnectedFieldHandler","connectedValueHandler","selectConnectedSettings","connectedSettings","adminUrl","reservableUrl","initOnlineServicesData","sourceurl","OnlineServiceMultiPicker","OnlineServiceSinglePicker","RestrictedByAdminFilter","ServiceGroupIds","IsAdminPanel","ServiceGroupFilter","CommentReferenceTypes","FormLabelText","html","StyledInfo","TrainingState","OtherServicesApi","otherService","otherServices","rowId","deleteService","deleteCustom","isBudgetsTurnedOn","offlineServiceTypeId","calculateCreditModel","getReservationOfflineServices","reservationId","repeat","deleteInventoryBatch","loadOfflineServiceData","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","selectSaveNewComments","doSaveNewComments","selectCreatedOrders","createdOrders","selectSavedLinkedOrders","savedLinkedOrders","selectLinksProcessing","calibrationsChanged","linksProcessing","selectDowntimeOverlaps","downtimeOverlaps","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","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","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","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","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","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","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","isCloned","calcCredit","customFormFiles","getFilesModel","FileTypes","ReservationFile","CustomFormTypeEnum","Reservation","FileStoreApi","saveFormFiles","fileRes","fileResponse","self","setCloneReservation","warnOnTrainingSession","FirstEquipmentId","ClickHere","afterLinkText","res_futureTrainingSession_LinkTitle","repetitiveActions","resetState","createReservation_Success","reservationIds","insertModel","insertedModel","createReservation_Error","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","resetOperateState","resetAssisteTrainingData","resetEquipmentChangeState","getAnyValue","getAnyValueSuccess","resetRequestedFor","resetTransferState","setSavedOfflineServices","setRefreshOfflineServices","resetTerminateState","setAsyncChangeLoading","setSubmitCredit","setByApprovalErrors","setUserCanRequestApproval","setRefreshWorkOrderLink","reservationActions","useReservationSlice","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","referenceId","setSeletedFiles","setCommentProperties","setCanUpload","addFile","removeFile","resetNumberOfUploadedFiles","useLargeFilesUploadSlice","CommentsApi","GetComments","reference","SendComment","typeId","Files","Text","IsInternal","form","delteUrl","mapSettings","isEditMode","budgetEnabled","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","initUpdateData","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","WorkOrderApi","initCreateData","insertWorkOrder","updateWorkOrder","offData","getNewWorkOrderStatus","deleteOrders","DowntimeOrders","assetIds","foo","nowDate","removefromLinks","linkedId","addToLinked","removeLinkedCalibration","addLinkedToCalibration","getLinkedToCalibration","getOverlappingDowntimes","updateWorkOrdersStatus","workOrderStatus","workOrdersIds","statusId","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","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","doInitCreate","doInitUpdate","doSendReservationsOfflineEmail","doRemoveFromLinked","doAddToLinked","doRemoveLinkedCalibration","doaddLinkedCalibration","doSetCreatedOrders","doCheckDowntimeOverlaps","workOrderSaga","initWorkOrder_Success","initWorkOrder_Error","initUpdateWorkOrder_Success","initUpdateWorkOrder_Error","ConvertNewWorkOrdersToModel","submissionFormFiles","workOrderDetails","SubmissionFormFiles","savedLinkeCalibrations","idx","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","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","initUserGroupData","UserGroupPicker","RestrictedUserGroupPicker","RestrictedFilter","departmentId","instituteId","instituteTypeId","restricted","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","take","openSidePanelProps","showEdit_Success","ServiceRequestTicketDetails","showEdit","showEdit_Error","getMoreItems","setSelectedStatuses","reorder","showEditParent","selectedStatusIds","fetchCount","sourceSection","destinationSection","removed","updateSamplesCount","serviceRequestsKanbanActions","useServiceRequestsKanbanSlice","originalSamplesCount","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","GetBooleanByKey","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","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","catch","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","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","selectLargeFilesUpload","largeFilesUpload","selectLargeFilesCanUpload","selectLargeFilesUploading","selectLargeFilesStartedToUpload","selectLargeFilesUploadTargetId","selectLargeFilesUploadFilesNumber","selectLargeFilesUploadSelectedFiles","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","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","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","ArticleComments","commentsFormRef","setchanged","newSavedComments","setNewSavedComments","newComments","setNewComments","Article","portalRef","Portal","ConvertNewToComment","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","InstituteTypePicker","DEFAULT_WIDTH","tryCleanValue","titleValue","parsedTitle","htmlParse","maxChars","toCharsWidth","data-html","TruncatedDescriptionText","Styled","toCssWidth","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","timeEnabled","waitingTransferApproval","transferToUser","terminationEnabled","transferForId","handleTerminate","allowEditMultipleEquipments","offlineServicesErrors","assistedTrainingData","allowOngoingModifications","requestedFor","equipmentChangeState","equipmentChangeCompleted","insertUpdateCompleted","savedForLater","isCreditSubmited","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","handleFullDayReservationChange","fullDayReservation","currentPeriod","adjusted","adjustSchedulerEventTimes","partialReservationDetailsState","messageList","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","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","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","setProcessing","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","newcomment","newFiles","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","chosenFundingType","setFundingType","chosenPurchaseOrder","setPurchaseOrder","chosenBudget","setChosenBudget","setService","initActiveSampleTypesData","getServiceRequest","getService","showProject","ProjectIsRequired","purchaseOrderLength","purchaseOrderRequired","purchaseLengthInvalid","projectIsRequired","Requests_Created_Failure","Requests_Created_Success","propsSide","mt","RequiredLabServiceLabel","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","doSaveComments","saveComments","referenceIds","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","reservationSwithProps","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","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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7jX,aACjC,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAOsjX,uBCFNC,GAAoB9jX,aAC/B,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAOwjX,iB,UCINC,GAAiBhkX,aAC5B,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO0jX,sBCFNC,GAAwBlkX,aACnC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO2jX,yBCRNC,GAAYnkX,aACvB,kBAAM,0DACN,SAAAO,GAAM,OAAIA,EAAO4jX,aCINC,GAA8BpkX,aACzC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO6jX,+BCFNhV,GAA4BpvW,aACvC,kBAAM,6CACN,SAAAO,GAAM,OAAIA,EAAO6uW,6BCHNiV,GAA0BrkX,aACrC,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAO8jX,2B,oBCDNC,GAAqBtkX,aAChC,kBAAM,yDACN,SAAAO,GAAM,OAAIA,EAAO+jX,sB,ugEC6XnBC,KAAQz7Y,IAEN07Y,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,eACAC,gBACAC,cACAC,SACAC,cACAC,gBACAC,aACAC,wBACAC,wBACAC,UACAC,gBACAC,gBACAC,kBACAC,YACAC,qBACAC,aACAC,eACAC,eACAC,UACAC,iBACAC,SACAC,UACAC,qBACAC,WACAC,iBACAC,cACAC,eACAC,iBACAC,iBACAC,qBACAC,kBACAC,mBACAC,iBACAC,iBACAC,uBACAC,aACAC,mBACAC,cAEAC,iBACAC,yBACAC,oBACAC,uBACAC,cACAC,cACAC,WACAC,eAEAC,eACAC,cACAC,mBACAC,yBACAC,mBACAC,kBAEAC,cACAC,qBACAC,uBACAC,iBAEAC,YACAC,aACAC,YCzjBK,SAASC,GAAmBrmY,GAAiC,IAC1DO,EAAaP,EAAbO,SAGR,OACE,sBACE+e,MAAO,CACL2P,QAAS,OACTgG,UAAW,mCACX1E,MAAO,OACPd,OAAQ,UALZ,SAQGlvB,ICvBA,IAAM+lY,GAAmBlwX,aAC9B,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAO2vX,oBCENC,GAAiBnwX,aAC5B,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO6+B,cCANgxV,GAAiBpwX,aAC5B,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO6vX,kBCFNC,GAAsBrwX,aACjC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO8vX,uBCFNC,GAAyBtwX,aACpC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO+vX,0BCFNC,GAAsCvwX,aACjD,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAOgwX,uCCFNC,GAASxwX,aACpB,kBAAM,mCACN,SA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ACA,kBACA,oBACA,uBACAsC,+BACA,gBACA,yBACA,4BACA,oBACA,6BACA,gCACA,kBACA,cACA,aACA,gBACA,YACA,kBACA,oBACA,WACA,SACA,mCACA,gBACA,WACA,sBACA,uBACA,eACA,6CACA,gBACA,cACA,uBACA,iBACA,0BACA,6BACA,qBACA,0BACA,cACA,uBACA,0BACA,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,iBACA6vC,KACAu9G,GACA,kBACA,uBAEA,iBACA,oBACA,wBACA,cACA,mCACA,eACA,qBACA,qBACA,eACA,WACA,sBACA,mBACA,gBACA,yBA/HJ,SAkIE,eAAC,IAAD,CAAkBv4X,MAAO8nY,EAAzB,SAGE,eAACp5B,EAAD,UAEE,gBAAC,IAAD,WACE,eAAC,IAAD,CACE3+V,KAAM,mBACNN,UAAWqpX,KAEb,eAAC,IAAD,CACE/oX,KAAM,CAAC,sCACPN,UAAW0pX,KAEb,eAAC,IAAD,CACEppX,KAAM,wBACNN,UAAW4pX,KAEb,eAAC,IAAD,CACEtpX,KAAM,wBACNN,UAAW6pX,KAEb,eAAC,IAAD,CACEvpX,KAAM,cACNN,UAAWupX,KAEb,eAAC,IAAD,CACEjpX,KAAM,iBACNN,UAAWypX,KAEb,eAAC,IAAD,CACEnpX,KAAM,cACNN,UAAWspX,KAEb,eAAC,IAAD,CACEhpX,KAAM,6BACNN,UAAW8pX,KAEb,eAAC,IAAD,CACEjwB,OAAK,EACLv5V,KAAMulI,wBACN7lI,UAAW6nN,KAEb,eAAC,IAAD,CACEgyI,OAAK,EACLv5V,KAAMqnN,2BACN3nN,UAAWsnN,KAEb,e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AMzC,OAAOC,aAAgB,cACrB33K,OAAQ43K,aAAc77W,GACtB87W,eAAgBC,0BACbJ,MDoBCK,EAAY,CAChBC,aAAwB,CACtBP,gBACAH,aA+BJ,OA3BcW,aAAe,CAC3B96X,QAASs6X,IACTS,WAAW,GAAD,OACLX,EADK,YAELY,aAAqB,CACtBC,kBAAmB,CACjBC,aAAc,CACZ,4CACA,kDAEFC,mBAAoB,CAClB,+CACA,0CACA,sCACA,iCACA,0BACA,iCACA,kCACA,sCAKRC,UAAUptY,EACV4sY,cDhCUS,GACRC,GAAa7gY,SAASmtX,eAAe,QAE3C7sG,SACE,eAAC,aAAD,UACE,eAAC,WAAD,CAAgB5zQ,SAAU,KAA1B,SACE,gBAAC,WAAD,CAAUiyX,MAAOA,GAAjB,UACE,eAAC,KAAD,UACE,eAAC,KAAD,CAAe3qY,OAjBL,CAKlB8sY,OAAQ,CACNC,SAAU,CAAC,4CAWL,SACE,eAACjD,GAAD,QAGJ,eAAC,kBAAD,CACE9pY,OAAQ,CACNgtY,wBAAyB,GACzBC,mBAAoB,IACpBlkY,OAAOxJ,EACP2tY,eAAe,EACfC,cAAe,KAGnB,eAAC,GAAD,WAINN,IAaFhC,O","file":"static/js/main.de773384.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 { 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 { 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 { 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","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","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 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 creditState: 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 submitCredit?: 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","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","/**\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 { 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 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 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 selectIsCreditSubmited = createSelector(\r\n [selectSlice],\r\n state => state.submitCredit,\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 // const handleClickOpen = () => {\r\n // setOpen(true);\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 { 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 } 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(columns, column => column.getFieldName());\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 { 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 { 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 '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}\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 { FormValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { FieldHookConfig, useFormikContext } from 'formik';\r\nimport * as React from 'react';\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\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 = 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 * 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","/**\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: `${AdminServicesFilter(serviceItems)[0]} and (${predicates\r\n .map(f => f.toString())\r\n .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","/* 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","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","/**\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","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 { 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","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","/**\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 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 [\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 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 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 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 { ListItemIcon, ListItemText, Menu, MenuItem } 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} 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}\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 { t } = useTranslation();\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 const toAbsolutePath = (href: string | IPathAndQuery) => {\r\n return 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 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 return item.renderAsTitle ? (\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 ) : item.href ? (\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 ) : item.to ? (\r\n \r\n \r\n \r\n \r\n {item.text}\r\n \r\n ) : (\r\n {\r\n popupState.close();\r\n if (item.onClick) {\r\n await item.onClick();\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n {item.text}\r\n \r\n );\r\n })}\r\n \r\n
\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","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 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 ReservationGlobalState,\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} 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 { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\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\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\n\r\nfunction* doCreate(\r\n action: PayloadAction<{\r\n state: ReservationGlobalState;\r\n calcCredit?: boolean;\r\n }>,\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(actions.getCredit_Success({ credit: 0, balance: null }));\r\n }\r\n } else {\r\n if (action.payload.calcCredit) {\r\n yield put(\r\n actions.getCredit_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\nfunction* doUpdate(\r\n action: PayloadAction<{\r\n current: ReservationDetailsState;\r\n original: ReservationDetailsState;\r\n currentCustomFormFiles: IFormFileValue[];\r\n originalCustomFormFiles: IFormFileValue[];\r\n offlineServices: IOtherServices[];\r\n settings: ReservationSettingsState | undefined;\r\n terminate?: boolean;\r\n }>,\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* doUpdate({\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, doCreate);\r\n yield takeLatest(actions.updateReservation.type, doUpdate);\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\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 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 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 submitCredit: undefined,\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.submitCredit = undefined;\r\n state.ByApprovalErrors = undefined;\r\n state.userCanRequestApproval = undefined;\r\n state.refreshWorkOrderLink = undefined;\r\n state.notFound = undefined;\r\n },\r\n resetOperateState(state, action: PayloadAction) {\r\n state.detailsState.hasErrors = false;\r\n state.detailsState.completed = false;\r\n },\r\n createReservation(\r\n state,\r\n action: PayloadAction<{\r\n state: ReservationGlobalState;\r\n calcCredit?: boolean;\r\n ByApproval?: boolean;\r\n }>,\r\n ) {\r\n if (action.payload.calcCredit === true) {\r\n state.creditState.processing = true;\r\n state.creditState.completed = undefined;\r\n state.creditState.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 current: ReservationDetailsState;\r\n original: ReservationDetailsState;\r\n currentCustomFormFiles: IFormFileValue[];\r\n originalCustomFormFiles: IFormFileValue[];\r\n offlineServices: IOtherServices[];\r\n settings: ReservationSettingsState | undefined;\r\n terminate?: 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 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 getCredit(state, action: PayloadAction) {\r\n state.creditState.processing = true;\r\n state.creditState.completed = undefined;\r\n state.creditState.hasErrors = undefined;\r\n state.submitCredit = 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 state.submitCredit = undefined;\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 setSubmitCredit(state, action: PayloadAction) {\r\n state.submitCredit = action.payload;\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 { 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 {\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","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 { getBudgetVisible } from 'app/pages/ReservationDetails/Details/slice/getBudgetVisible';\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 = getBudgetVisible(\r\n globalSettings,\r\n services.map(service => ({\r\n Billable: service.Billable,\r\n BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n HideProjects: service.HideProject,\r\n ServiceTypeId: service.ServiceTypeId,\r\n })),\r\n );\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 // && !!data\r\n // ? data.Budget !== null\r\n // ? !((data.Budget as IBudgetFilterDto).HideExperiments === true)\r\n // : false\r\n // : false;\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 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\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","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\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 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","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","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 // 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 { 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 //console.log(httpPayloads);\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 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: 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\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}\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(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 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 = state.readonlyState.LinkedAlerts.filter(\r\n f => f.Id !== action.payload,\r\n );\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","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","/**\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","/**\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 { 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}\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: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n .ShowOnCalibrationHistory,\r\n NotEditable: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n .NotEditable,\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 } 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 '&.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 Id: original.ServiceGroup.AssetId ?? undefined,\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 console.debug('foo', result);\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 { 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 { 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 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) => 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) => 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 handleSubmit = ({ Files, ...values }: NewComment) => {\r\n const comment: NewComment = {\r\n ...values,\r\n };\r\n onSubmit(comment);\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 {}} 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.Save)}\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) => 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) => {\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);\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 { 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 // 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 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 * 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","/**\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","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","import { ServiceType } from 'enums/ServiceTypes';\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: GlobalSettingsType,\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 return (\r\n globalSettings.budgetModuleEnabled &&\r\n !equipments.every(f => f.HideProjects) &&\r\n equipments.every(f => f.BudgetsTurnedOn === true) &&\r\n // Billable is only shown on the instrument details when the PriceSheetPricing is on. Otherwise the instruments will with Billable = false, which should be ignored since they are in fact billable\r\n (globalSettings.priceSheetPricing === true ||\r\n equipments.every(f => f.ServiceTypeId !== ServiceType.Online) ||\r\n equipments.some(f => f.Billable === true))\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 selectIsCreditSubmited,\r\n selectIsEdit,\r\n selectRequestedValueFor,\r\n selectReservationCompleted,\r\n selectReservationHasError,\r\n selectReservationSettings,\r\n selectSavedForLater,\r\n selectSavedOfflineServices,\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 processing?: boolean;\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 timeEnabled?: 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 processing,\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 timeEnabled,\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 isCreditSubmited = useSelector(selectIsCreditSubmited);\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 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 (isCreditSubmited) {\r\n dispatch(actions.setSubmitCredit(false));\r\n }\r\n } else {\r\n if (isCreditSubmited) {\r\n handleSubmit(values);\r\n } else {\r\n console.debug('submitting', values);\r\n formikHelpers.setSubmitting(true);\r\n dispatch(actions.resetOperateState());\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 console.log('Reservation submitting', formik.isSubmitting);\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 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 formik.isSubmitting ||\r\n (isEdit &&\r\n !(editable && allowEditMultipleEquipments)) ||\r\n readonly\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={\r\n formik.isSubmitting ||\r\n (isEdit && !editable) ||\r\n readonly\r\n }\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={\r\n formik.isSubmitting ||\r\n readonly ||\r\n (isEdit && !editable)\r\n }\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={\r\n formik.isSubmitting ||\r\n readonly ||\r\n (isEdit && !editable)\r\n }\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={\r\n formik.isSubmitting ||\r\n readonly ||\r\n (isEdit && !editable)\r\n }\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={\r\n formik.isSubmitting ||\r\n (isEdit && !editable) ||\r\n readonly\r\n }\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 { DialogConfirm } 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 open: boolean;\r\n onClose: () => void;\r\n title: React.ReactNode;\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(props: CalculatePricingProps) {\r\n const {\r\n open,\r\n onClose,\r\n credit,\r\n creditProcessing,\r\n title,\r\n creditCompleted,\r\n edit,\r\n } = props;\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n return (\r\n onClose()}\r\n body={\r\n creditProcessing && !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.PricingConfirmationLabelEditText1\r\n : translations.PricingConfirmationLabelText1,\r\n ) as string).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 selectCredit,\r\n selectCreditCompleted,\r\n selectCreditProcessing,\r\n selectEquipmentChangeCompleted,\r\n selectEquipmentsSettings,\r\n selectIsCreditSubmited,\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} 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\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 creditProcessing = useSelector(selectCreditProcessing);\r\n const credit = useSelector(selectCredit);\r\n const creditCompleted = useSelector(selectCreditCompleted);\r\n const isCloned = useSelector(selectCloneReservations);\r\n const edit = useSelector(selectIsEdit);\r\n const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n const isCreditSubmited = useSelector(selectIsCreditSubmited);\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 [edit, setEdit] = 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 [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 return (\r\n reservationSettings?.FutureReservation ||\r\n (reservationSettings?.Ongoing &&\r\n (allowSortenReservation ||\r\n equipmentSettings?.AllowModification ||\r\n equipmentSettings?.AllowExtendReservation))\r\n );\r\n }, [\r\n equipmentSettings?.AllowExtendReservation,\r\n equipmentSettings?.AllowModification,\r\n reservationSettings?.FutureReservation,\r\n reservationSettings?.Ongoing,\r\n allowSortenReservation,\r\n ]);\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 const calculateButtonVisible = React.useMemo(() => {\r\n return globalSettings.showCalculatePrice &&\r\n globalSettings.budgetModuleEnabled\r\n ? equipmentSettings?.BudgetsTurnedOn\r\n : true;\r\n }, [\r\n equipmentSettings?.BudgetsTurnedOn,\r\n globalSettings.budgetModuleEnabled,\r\n globalSettings.showCalculatePrice,\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 /// 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 (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 (isCreditSubmited) {\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 //console.log('data', value);\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 isCreditSubmited,\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 // dispatch(actions.setUserCanRequestApproval(undefined));\r\n // handleSubmitForm(e);\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.setSubmitCredit(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 (reservationId !== undefined && !isCloned) {\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 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 (active) {\r\n if (creditCompleted === true && !showCalculateCredit) {\r\n dispatch(actions.resetCreditState());\r\n setBusy(false);\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 ]);\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\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.resetOperateState());\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 (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 (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 (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.resetOperateState());\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={credit}\r\n creditCompleted={creditCompleted}\r\n creditProcessing={creditProcessing}\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","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 { 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 { 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 // if (budgetVisible === true) {\r\n // otherServiceSchema.fields.Budget.withMutation(schema =>\r\n // schema.required(t(translations.BudgetIsRequired) as string),\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","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","/**\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 { 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 { UserPicker } 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\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 [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 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 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,\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 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 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 chosenUser?.UserGroupId ?? 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 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 {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+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzA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RmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Z9pN0AAAAhUlEQVR42uyUSwrAMAhE1cP0/ufpZWy6KI2hxOIYGkrcJQPDw88w3bWRrb15G11Vjc7MIb38d/25B+FB1noxDEFWgI/+LWAY8gSMdNLzF6RrGaP3/AUd7WhIydg/5Eg8f/66e95OCgqEdvLNkdDMkDLraC//lYMrB3+Xg+jODs/BbP0QYAB+HaheBAg0CAAAAABJRU5ErkJggg==);\r\n}\r\n\r\n.dhx_cal_event .dhx_body,\r\n.dhx_cal_event .dhx_footer,\r\n.dhx_cal_event .dhx_header,\r\n.dhx_cal_event .dhx_title {\r\n background-color: initial;\r\n padding: 3px 5px 0px 5px;\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 {\r\n ConvertNewToComment,\r\n IComment,\r\n NewComment,\r\n} 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 { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { selectCreatedOrders, selectSaveNewComments } from '../slice/selectors';\r\nimport { useWorkOrderSlice } from '../slice';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\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}\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 user,\r\n sectionTitle,\r\n } = props;\r\n const publicUrl = useSelector(selectPublicUrl);\r\n const { t } = useTranslation();\r\n const { newDate } = useSystemDate();\r\n const dispatch = useDispatch();\r\n const { actions: workOrderActions } = useWorkOrderSlice();\r\n const doSaveComments = useSelector(selectSaveNewComments);\r\n const createdOrders = useSelector(selectCreatedOrders);\r\n const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n const [changed, setchanged] = React.useState(false);\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 () => CommentsApi.GetComments(CommentReferenceTypes.Alerts, order.Id),\r\n [],\r\n [changed],\r\n );\r\n const saveComments = async (\r\n comments: NewComment[],\r\n referenceIds: number[],\r\n ): Promise => {\r\n var result = await Promise.all(\r\n comments.map(async item => {\r\n referenceIds.map(refId => {\r\n try {\r\n return CommentsApi.SendComment(\r\n CommentReferenceTypes.Alerts,\r\n refId,\r\n item,\r\n );\r\n } catch {\r\n return item;\r\n }\r\n });\r\n }),\r\n );\r\n return result;\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 React.useEffect(() => {\r\n if (doSaveComments === true && createdOrders.length > 0) {\r\n saveComments(newSavedComments, createdOrders);\r\n dispatch(workOrderActions.setSaveNewComments(undefined));\r\n dispatch(workOrderActions.setOrderNumbers([]));\r\n }\r\n }, [\r\n createdOrders,\r\n dispatch,\r\n doSaveComments,\r\n newSavedComments,\r\n workOrderActions,\r\n ]);\r\n const { onCommentAdded } = useUploadToNewComment();\r\n React.useEffect(() => {\r\n dispatch(\r\n largeFileActions.setCommentProperties({\r\n commentType: CommentReferenceTypes.Alerts,\r\n referenceId: order.Id,\r\n }),\r\n );\r\n }, [dispatch, largeFileActions, order.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 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.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}\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}: 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] = React.useState(\r\n false,\r\n );\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 [\r\n (item as Entity<\r\n number\r\n >) as IWorkOrderDetailsDto,\r\n ],\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 {\r\n cover,\r\n openPanel,\r\n closePanel,\r\n coverClosed,\r\n 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 [\r\n workOrderOfflineEndChangedValue,\r\n setWorkOrderOfflineEndChangedValue,\r\n ] = React.useState();\r\n\r\n const [isCloseWorkOrderClicked, setIsCloseWorkOrderClicked] = React.useState<\r\n boolean\r\n >(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 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 = (e: any) => {\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 (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 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 } as WorkOrderGlobalState;\r\n //console.log('data', value);\r\n dispatch(actions.createWorkOrder(value));\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());\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 />\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\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 * 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: 0,\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":""}