{"version":3,"sources":["shared/store/applicationState.ts","hooks/useSelector.ts","assets/icons/check-box-outlined.svg","helpers/HelperFunctions.ts","shared/enums/document-type-enum.ts","components/portal/GridComponents.tsx","shared/enums/document-status-enum.ts","shared/settings/appSettings.ts","overrides/mapping/user-mapping.ts","overrides/user-manager.ts","shared/services/httpService.ts","shared/services/userApi.ts","shared/services/userService.ts","overrides/api.ts","shared/services/railDocumentsApi.ts","assets/icons/folder.svg","assets/icons/status-expired.svg","assets/icons/status-expired-folder.svg","assets/icons/action-fields-outlined.svg","assets/icons/status-deleted.svg","assets/icons/status-current.svg","assets/icons/rail-docs-filled.svg","assets/icons/doc-recently-acknowledged-filled.svg","assets/icons/rd-memo.svg","assets/icons/rd-operating-manuals.svg","assets/icons/rd-wins.svg","assets/icons/rb-operating-notices.svg","assets/icons/rb-network-rules.svg","assets/icons/rb-network-procs.svg","assets/icons/rb-network-rules-forms.svg","assets/icons/rb-operations-manual.svg","assets/icons/rb-signalling.svg","assets/icons/rb-glossary.svg","assets/icons/rb-rulebook-filled.svg","assets/icons/rb-nr-general-rules.svg","assets/icons/rb-nr-rail-traffic-operations.svg","assets/icons/rb-nr-signalling-operations.svg","assets/icons/rb-nr-work-on-track.svg","assets/icons/admin-add-new-document.svg","assets/icons/admin-edit-document.svg","assets/icons/admin-delete-document.svg","assets/icons/consultation-documents.svg","components/ui/DocumentRules.tsx","assets/icons/link-filled.svg","assets/icons/mark-chat-read.svg","assets/icons/admin-expired-documents.svg","assets/icons/pdf-icon.svg","assets/icons/check-box-outlined-blank.svg","shared/helpers/colorManager.ts","hooks/useDocumentType.ts","components/ui/ToggleContent.tsx","components/menu/Labels.tsx","hooks/useRoles.ts","components/portal/documents/SideBar.tsx","components/ui/ConfirmationBox.tsx","shared/models/mapping/mapping.ts","components/ui/InfoModal.tsx","shared/enums/document-review-period-enum.ts","components/portal/documents/admin/AddEditDocumentState.tsx","shared/models/site/document.ts","components/ui/SearchBox.tsx","components/ui/ToggleButton.tsx","assets/icons/filter.svg","components/ui/LabelledCheckbox.tsx","components/ui/Lists.tsx","components/ui/UseClickOutsideRef.tsx","components/portal/documents/admin/RelatedDocuments.tsx","components/portal/documents/admin/AddEditDocumentSecondPage.tsx","shared/services/documentTypeService.ts","shared/enums/document-module-enum.ts","helpers/filters.ts","components/portal/documents/admin/AddEditDocumentFirstPage.tsx","components/portal/documents/admin/AddEditDocument.tsx","components/portal/documents/DocumentInfo/DocumentDetails.tsx","components/portal/documents/DocumentInfo/DocumentHistoryView.tsx","components/portal/documents/DocumentInfo/DocumentInfo.tsx","components/ui/Spinner.tsx","components/ui/PageList.tsx","components/portal/DocumentGrid.tsx","components/portal/Search.tsx","components/ui/CleverString.ts","components/UnderConstruction.tsx","components/menu/SubHeader.tsx","assets/icons/reports-filled.svg","components/portal/documents/DocumentsList.tsx","shared/services/reportingApi.ts","components/ui/TabPanel.tsx","assets/icons/build-circle.svg","assets/icons/dashboard-customize.svg","assets/icons/add-chart.svg","assets/icons/users-filled.svg","components/ui/ModalBox.tsx","components/portal/PortalPage.tsx","components/ui/DetailForm.tsx","components/ui/DataGrid.tsx","shared/models/api/models.ts","components/ui/Toolbar.tsx","components/portal/administration/user-management.tsx","assets/icons/make-inactive.svg","assets/icons/make-active.svg","assets/icons/related-documents.svg","components/portal/administration/user-management-data.ts","components/portal/reporting/ExportGrid.tsx","components/portal/reporting/blobDownload.ts","components/portal/reporting/DateRangePicker.tsx","components/portal/reporting/UserDocumentsReportingView.tsx","components/portal/fatigueAssessment/FatigueAssessmentQuestions.tsx","shared/services/locationApi.ts","components/portal/reporting/FatigueAssessmentReportingView.tsx","components/portal/reporting/LoginHistoryReportingView.tsx","assets/icons/fatigue-assessment-filled.svg","components/portal/pdf/RelatedDocuments.tsx","components/ui/FormModal.tsx","components/portal/pdf/DocumentClarify.tsx","components/portal/pdf/DocumentFeedback.tsx","components/portal/pdf/AcknowledgeDocument.tsx","components/portal/pdf/SideBar.tsx","assets/icons/favourite-empty.svg","assets/icons/favourite-filled.svg","assets/icons/ios-share.svg","assets/icons/info.svg","assets/icons/search.svg","assets/icons/zoom-in.svg","assets/icons/zoom-out.svg","assets/icons/download.svg","assets/icons/grid.svg","assets/icons/fullscreen.svg","assets/icons/print.svg","components/portal/pdf/Viewer.tsx","components/portal/ActionableDocuments.tsx","shared/services/fatigueAssessmentApi.ts","components/portal/fatigueAssessment/FatigueAssessmentPageSelector.tsx","components/portal/fatigueAssessment/FatigueAssessmentSidebar.tsx","components/portal/fatigueAssessment/FatigueAssessmentPage.tsx","components/portal/fatigueAssessment/FatigueAssessmentView.tsx","components/portal/fatigueAssessment/FatigueAssessments.tsx","components/portal/fatigueAssessment/FatigueAssessmentActionState.tsx","components/portal/fatigueAssessment/FormControls.tsx","components/portal/fatigueAssessment/FatigueAssessmentAction.tsx","components/portal/fatigueAssessment/FatigueAssessmentFormState.tsx","components/portal/fatigueAssessment/FormContents.tsx","components/portal/fatigueAssessment/FatigueAssessmentBaseForm.tsx","components/portal/fatigueAssessment/FatigueAssessmentOnBehalfForm.tsx","components/portal/fatigueAssessment/FatigueAssessmentAssignForm.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboard.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboardPending.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboardToAction.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboardToRevisit.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboardCompleted.tsx","components/portal/fatigueAssessment/FatigueAssessmentDashboardOverview.tsx","components/portal/fatigueAssessment/FatigueAssessmentDetails.tsx","components/portal/fatigueAssessment/FatigueAssessmentRoutes.tsx","components/ui/FatigueAssessmentRules.tsx","components/portal/fatigueAssessment/FatigueAssessmentCard.tsx","components/portal/fatigueAssessment/FatigueAssessmentCardList.tsx","assets/icons/ql-take-time-talks.svg","components/portal/ActionableFatigueAssessment.tsx","assets/icons/ql-ideas-hub.svg","assets/icons/ql-success-factors.svg","assets/icons/ql-fiori.svg","assets/icons/ql-webmail.svg","assets/icons/insert-comments.svg","components/ui/QuickLinks.tsx","assets/icons/date-range.svg","components/ui/NeedDirection.tsx","assets/icons/rail-app.svg","assets/icons/train-app.svg","assets/icons/icon-pdf.svg","components/ui/Applications.tsx","pages/Home.tsx","pages/SignInOIDC.tsx","pages/SignOutOIDC.tsx","pages/SilentAuth.tsx","pages/UserProfile.tsx","components/portal/documents/search/DocumentSearchState.tsx","components/portal/documents/search/RefineSearch.tsx","assets/icons/icon-work-on-track.svg","assets/icons/settings.svg","components/portal/documents/search/DocumentSearch.tsx","pages/DebugInfo.tsx","shared/services/adminApi.ts","components/portal/administration/allowed-domain-list.tsx","components/ui/TabButtons.tsx","components/ui/AccessDenied.tsx","components/portal/administration/general-administration.tsx","shared/services/abmApi.ts","components/portal/administration/apple-app-codes.tsx","components/portal/administration/acronyms.tsx","components/portal/administration/site-mobile-numbers.tsx","assets/icons/bhp-logo.svg","components/portal/administration/general-administration-data.ts","helpers/route-config.tsx","pages/Login.tsx","components/portal/UserGuide.tsx","pages/Loading.tsx","pages/NoAccess.tsx","pages/AccessRequired.tsx","utils/ProtectedRoute.tsx","assets/icons/fatigue-assessment.svg","components/menu/UserMenu.tsx","assets/icons/apps-filled.svg","assets/icons/arrow_forward.svg","components/menu/NavMenu.tsx","components/menu/NotificationsState.tsx","shared/enums/document-notify-type-enum.ts","shared/notifications/helpers.ts","components/menu/NotificationsMenu.tsx","components/ui/Hamburger.tsx","components/menu/NavBar.tsx","components/Footer.tsx","components/ui/LoadingSplash.tsx","hooks/useBreakpoint.ts","components/Layout.tsx","authProvider.ts","App.tsx","registerServiceWorker.ts","index.tsx"],"names":["SignedInState","initialState","backOfHouseRoles","isBackOfHouseUser","documentStateSubject","BehaviorSubject","setState","updateFn","state","Object","assign","getValue","next","applicationState","subscribe","getUser","user","setUser","undefined","roles","length","getProfile","profile","setProfile","_profile$roles$some","some","role","isBackOfHouseRole","getSignedInState","signedInState","setSignedInState","setRailDocumentTypes","documentTypes","railDocumentTypes","setSearchableRailDocumentTypes","searchableTypes","unsearchable","filter","t","includes","key","searchableRailDocumentTypes","setWritableRailDocumentTypes","writableRailDocumentTypes","useSelector","selector","_useState","useState","_useState2","_slicedToArray","val","setVal","useEffect","sub","unsubscribe","_path","_path2","_excluded","_extends","bind","target","i","arguments","source","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","SvgCheckBoxOutlined","_ref","svgRef","title","titleId","props","xmlns","width","height","viewBox","ref","id","fill","d","ForwardRef","openInANewBrowser","location","window","open","evalPath","path","obj","idx","propertyName","substring","console","warn","stringSort","a","b","ignoreCase","aVal","toLowerCase","bVal","dateSort","DocumentTypeEnum","documentTypeDisplay","type","NetworkRules","parseInt","replace","trim","GridLabel","_jsxs","className","children","_jsx","text","SortArrow","config","fieldName","direction","SortOrder","DESC","ArrowUpward","ASC","ArrowDownward","ImportExport","FilterArrow","selectedItems","setSelectedItems","onToggle","isOpen","onFilter","filterItemCheck","item","doNothing","UncontrolledDropdown","setActiveFromChild","e","o","DropdownToggle","tag","caret","filterItems","ExpandMore","DropdownMenu","onClick","arr","push","map","x","filterItemChangeAll","Input","checked","onChange","Label","n","itemtoToggle","findIndex","splice","toggleFilterItem","style","textAlign","paddingTop","useSortableData","items","sortConfig","filterConfig","pageConfig","_React$useState","React","_React$useState2","sortConfigState","setSortConfig","_React$useState3","_React$useState4","filterConfigState","setFilterConfig","_React$useState5","pageSize","currentPage","itemCount","_React$useState6","pageConfigState","setPageConfig","useMemo","sortableItems","_toConsumableArray","forEach","filterFn","table","DataTable","asc","sortStyle","desc","getAll","getFrom","requestSort","dir","requestFilter","arrFilterItems","_filterConfig$filterI","filterName","requestPage","page","SortStyle","SortArgument","order","String","_classCallCheck","_createClass","value","valueA","valueB","eval","isObject","Numeric","numericCompare","Number","stringCompare","toLocaleString","toLocaleLowerCase","CaseSensitiveString","sortBy","sortField","compare","sort","sorter","row","index","slice","offset","limit","pattern","search","matching","matches","firstMatch","lastMatch","RegExp","test","toString","DocumentStatusEnum","appSettings","api","portalApi","webSite","identityServer","userAdminLink","environmentIndicator","installAppLink","userMapper","oidcUser","name","expires_in","access_token","authority","client_id","redirect_uri","concat","response_type","scope","post_logout_redirect_uri","filterProtocolClaims","loadUserInfo","automaticSilentRenew","silent_redirect_uri","monitorSession","userStore","WebStorageStateStore","store","localStorage","UserManagerProxy","settings","_this$userManager","_this$userManager$set","_this","userManager","accessTokenExpiringNotificationTime","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","sent","abrupt","stop","signinRedirectCallback","_callee2","_context2","signinSilent","_callee3","_context3","clearStaleState","removeUser","signoutRedirect","signinRedirect","signoutRedirectCallback","signinSilentCallback","getProxiedObject","UserManager","getAuthHeader","_getAuthHeader","_callee8","token","_context8","getToken","Authorization","getHeaderValue","headers","header","get","split","httpDownloadAs","url","method","data","authHeaders","fetchParams","response","_getHeaderValue","blob","_args","_objectSpread","body","JSON","stringify","fetch","log","fileName","_x","_x2","httpPost","_ref2","request","http","_x3","_x4","httpGet","_ref3","_x5","_x6","httpPut","_ref4","_callee4","_context4","_x7","_x8","httpDelete","_ref5","_callee5","_context5","_x9","_x10","_ref6","_callee6","_context6","http_fetch","json","_x11","_x12","_x13","_ref7","_callee7","_context7","status","_x14","_x15","_x16","fullyQualifiedAndEncodedURL","relativeUri","URL","encodeURI","userManagementRoot","getAllEmployees","getAllUsers","getAllSupervisors","getUserProfile","catch","userAdminApi","listAsync","_listAsync","_callee9","req","_context9","getAsync","_getAsync","_callee10","userId","_context10","addAsync","_addAsync","_callee11","_context11","updateAsync","_updateAsync","_callee12","_context12","setStatus","_setStatus","_callee13","_context13","_loadUserFromStorage","_user","_e$t","_window","_window$location","Loading","t0","error","pathname","sessionStorage","setItem","NotSignedIn","SignedIn","t1","loadUserProfile","_loadUserProfile","waitForUserLoad","setTimeout","finish","useLocation","_unused","sr","_getToken","retryWaitPeriod","maxRetries","_getUser","retry","blockWait","Error","_waitForUserLoad","ms","Promise","resolve","documentUriPath","documentViewedUriSuffixPath","documentAcknowledgedUriSuffixPath","documentClarifyUriSuffixPath","documentFeedbackUriSuffixPath","documentFilePath","staticFilePath","documentTypesPath","writableDocumentTypesPath","rescindDocumentPath","deleteDocumentPath","permanentlyDeleteDocumentPath","restoreDocumentPath","notificationsUriPath","validateDocumentPath","myDocumentsUri","actionableDocumentsUri","convertModelToFormData","model","namespace","formData","FormData","_loop","formKey","Date","append","toISOString","Array","element","File","getActionableDocuments","result","getMyDocuments","pageNumber","_args2","handleError","msg","getRulebookDocuments","then","getRailDocuments","getAllWritableDocuments","getPdfBytes","docId","pdfResponse","http_response","arrayBuffer","getStaticFileBytes","_ref8","filename","fileResponse","getAllDocumentTypes","_getAllDocumentTypes","_callee24","_context24","getWritableDocumentTypes","_getWritableDocumentTypes","_callee25","_context25","getDocument","_ref10","getDocumentHistory","_ref11","_setDocumentViewed","_callee26","pendingActions","_context26","_setDocumentAcknowledged","_callee27","success","_context27","_setDocumentClarification","_callee28","comment","_context28","_setDocumentFeedback","_callee29","_context29","mapDocumentValidationRequestForPost","document","file","validateDocument","_ref12","addDocument","_ref13","t2","t3","t4","editDocument","_ref14","_callee14","_context14","rescindDocument","_ref15","_callee15","uri","_context15","deleteDocument","_ref16","_callee16","_context16","_x17","permanentDeleteDocument","_ref17","_callee17","_context17","_x18","restoreDocument","_ref18","_callee18","_context18","_x19","getNotifications","_ref19","_callee19","_context19","updateFavouriteFlagAsync","_ref21","_callee21","documentId","selected","_context21","_x20","_x21","_documentSearch","_callee30","query","results","_context30","documentSearchReplaceSuggestions","_documentSearchReplaceSuggestions","_callee31","_context31","addSearchReplaceSuggestion","_x24","_addSearchReplaceSuggestion","_callee32","suggestion","_context32","editSearchReplaceSuggestion","_x25","_editSearchReplaceSuggestion","_callee33","_context33","deleteSearchReplaceSuggestion","_x26","_deleteSearchReplaceSuggestion","_callee34","suggestionIds","_context34","_defs","_callee35","_context35","_x28","_http","_callee36","_context36","_x29","_http_response","_callee37","_context37","SvgFolder","transform","SvgStatusExpired","_g","SvgStatusExpiredFolder","_rect","SvgActionFieldsOutlined","SvgStatusDeleted","SvgStatusCurrent","SvgRailDocsFilled","SvgDocRecentlyAcknowledgedFilled","SvgRdMemo","_g2","SvgRdOperatingManuals","SvgRdWins","SvgRbOperatingNotices","SvgRbNetworkRules","SvgRbNetworkProcs","SvgRbNetworkRulesForms","SvgRbOperationsManual","SvgRbSignalling","SvgRbGlossary","SvgRbRulebookFilled","SvgRbNrGeneralRules","opacity","SvgRbNrRailTrafficOperations","SvgRbNrSignallingOperations","SvgRbNrWorkOnTrack","SvgAdminAddNewDocument","SvgAdminEditDocument","SvgAdminDeleteDocument","SvgConsultationDocuments","color","defaultDocumentIcon","Assessment","rulebookRoot","documentRoot","railDocumentsRoot","myDocumentsRoot","documentManagementRoot","operatingNoticesAndInstructionsRoot","networkRulesRoot","expiredDocumentsRoot","getClassName","s","join","filtersPass","doc","moduleFilter","moduleId","moduleFilterPasses","filterByFavourite","isFavourite","favouriteFilterPasses","_config$filterByStatu","filterByStatuses","Current","statusDescription","statusFilterPasses","_config$filterBySubTy","filterBySubTypes","subTypeId","subTypeFilterPasses","_config$filterByTypes","filterByTypes","typeId","typeFilterPasses","_doc$pendingActions","firstDate","secondDate","filterByLastAcknowledgedDate","acknowledgedDate","getTime","recentlyActionedFilterPasses","filterByPendingActions","acknowledge","clarify","feedback","pendingActionFilterPasses","defaultDocumentFilter","view","subFilter","userFilter","_subFilter$rules$grid","_subFilter$rules","_filter$rules","_view$rules","_userFilter$rules","gridConfig","rules","GeneralRulesDocumentSubType","GeneralRules","icon","RbNrGeneralRules","defaultSortOrder","defaultSortField","hasSubTypes","NetworkRulesDocumentTypes","RailTrafficOperations","RbNrRailTrafficOperations","SignallingOperations","RbNrSignallingOperations","WorkOnTrack","RbNrWorkOnTrack","NetworkRulesDocumentType","redirectType","subTypes","subFilters","RbNetworkRulesIcon","NetworkProceduresDocumentType","NetworkProcedures","RbNetworkProcsIcon","OperatingNoticesDocumentSubType","OperatingNotices","RbOperatingNoticesIcon","canFilterByModule","OperatingNoticesAndInstructionsDocumentTypes","OperatingInstructions","OperatingInstructionsNoticesIcon","OperatingNoticesAndInstructionsDocumentType","OperatingNoticesAndInstructions","NetworkFormsDocumentType","NetworkForms","RbNetworkFormsIcon","RailTrafficOperationsManualDocumentType","RailTrafficOperationsManual","RbRailTrafficOperationsManualIcon","NetworkSignalsAndSignsManualDocumentType","NetworkSignalsAndSignsManual","RbSignallingIcon","RailRulebookDocumentTypes","ConsultationRulebook","ConsulationDocumentsIcon","Glossary","RbGlossary","preventRelatedDocumentTarget","RulebookDocumentMenu","prefix","dataSource","filters","OperatingNoticesDocumentType","OperatingInstructionsDocumentType","MemosDocumentType","Memos","MemosIcon","RailControlOperatingInstructionsDocumentType","RailControlOperatingInstructions","RailDocsIcon","TrackGeneralInstructionsDocumentType","TrackGeneralInstructions","TrackEngineeringInstructionsDocumentType","TrackEngineeringInstructions","SignallingGeneralInstructionsDocumentType","SignalingGeneralInstructions","RailDocumentDocumentTypes","WorkInstructions","WorkInstructionsIcon","OperatingManuals","OperatingManualsIcon","ConsultationDocuments","getRelatableDocuments","rulebookDocs","railDocs","RelatedRulebookDocumentView","sortPredicate","initRelatedDocs","reject","cache","lastRefresh","find","dt","refresh","maxAge","millisecondsPerMinute","AwaitingActionFilter","AwaitingActionIcon","hasStatus","RecentlyActionedFilter","RecentActionsIcon","RecentlyActionedPath","FavouritesFilter","FavouriteIcon","FavouritesPath","CurrentFilter","Folder","RecindedDocumentsFilter","StatusRescinded","ExpiredDocumentsFilter","StatusExpired","ExpiredFilter","StatusExpiredFolder","DeletedFilter","StatusDeleted","doesModuleMatch","m","doesDocumentTypeMatch","findDocumentView","views","DocumentViews","_step7","_iterator7","_createForOfIteratorHelper","done","v","_step8","_iterator8","f","_step9","_iterator9","f2","err","BackOfHouseRoles","AddDocumentAction","AddNewActionIcon","EditDocumentAction","EditActionIcon","RescindDocumentAction","RecindActionIcon","DeleteDocumentAction","DeleteActionIcon","confirm","message","options","defaultOption","DeletePermanentlyDocumentAction","FavouriteDocumentAction","SelectDocumentAction","CurrentDocumentStatus","StatusCurrent","availableInMyDocuments","actions","ExpiredDocumentStatus","Expired","RescindedDocumentStatus","Rescinded","DocumentStatuses","Archived","StatusArchived","Deleted","DeletedFull","userHasRole","requiredRoles","_applicationState$get","_applicationState$get2","userRole","statusHasAction","action","statusFilterHasAction","filterByStatus","userHasPermission","autoAssignActionRules","_f$rules$gridConfig$f","_f$rules$gridConfig","defaultFilterStatus","canFavourite","canAdd","canEdit","canRescind","canDelete","canDeleteForever","canSelect","MyDocumentsDocumentView","defaultFilter","pagedDataSource","recentWindow","RailRulebookDocumentModule","RbRulebookFilled","filterTitle","defaultPageSize","RailDocumentDocumentModule","hidden","maxDisplayed","DocumentManagementDocumentView","requiredPermission","publishDate","_documentViewsCache","cacheViews","deepCopy","fn","forEachFilter","getDocumentViews","DefaultView","DocumentModules","DocumentStatusIcon","Icon","_DocumentStatuses$fin","_DocumentStatuses$fin2","getIconForStatus","DocumentTypeIcon","_props$subType","_icon","_docType$subType","docType","moduleName","_step","_iterator","_step2","_iterator2","module","_step3","_iterator3","st","subType","findDocumentType","SvgLinkFilled","SvgMarkChatRead","SvgPdfIcon","colors","colorCssMapping","butterscotch","useAllDocumentTypes","Floating","_props$className","_Fragment","clickOutside","currentTarget","Toggle","isExpanded","setIsExpanded","collapse","collapseOnChangeOf","label","DropUpIcon","DropDownIcon","IconHeading","maxWidth","altColor","float","headingText","IconHeading3","display","MyActionsH1","MyActionsIcon","fontSize","HistoryH1","History","AppsH1","Apps","QuickLinksH1","QuickLinksIcon","AddDocumentH2","AdminAddNewDocumentIcon","EditDocumentH2","EditIcon","RescindDocumentH2","AdminRescindIcon","RelatedDocumentsH2","AddRelatedDocumentsIcon","DocumentInfoH2","Info","MarkChatRead","MarkChatReadIcon","focusable","ModalClose","dark","CancelIcon","ToolTipButton","ToolTipIcon","ToolTipLabel","whiteSpace","DocumentModuleFilterList","_props$modules","modules","FormGroup","event","setSelectedModule","canSelectAll","check","defaultChecked","DocumentViewList","_props$activeView","activeView","_props$activeView2","setActiveView","DocumentFilter","_props$activeFilter","_props$filter$subFilt3","_props$filter$subFilt4","_props$hideSubFilters","_props$filter$subFilt5","_props$filter$subFilt6","_props$filter3","_props$filter3$subFil","filterClassName","isActive","activeFilter","showingDocuments","docs","setActiveFilter","inFlightSubFilterChange","setActiveSubFilter","_props$filter$subFilt","_props$filter","_props$filter$subFilt2","_props$filter2","autoExpandFirstSubFilter","activeSubFilter","documents","_props$filter$rules","_props$filter$default","_props$filter$default2","field","sortDocs","setDocs","showSubFilters","hideSubFilters","isParent","selectedCount","_props$selectedDocume","selectedDocuments","sd","docTypes","childDocTypes","flatMap","documentTypeAllowed","expanded","ArrowForwardIos","sf","onDocumentClick","selectedDocumentId","PdfIcon","CheckBoxOutlined","CheckBoxOutlineBlankOutlined","DocumentFilterList","_props$view","_props$activeSubFilte","_props$activeSubFilte2","_props$activeFilter2","_props$view2","_props$view3","_props$view3$filters","_useState17","_useState18","setExpanded","viewName","allDocumentsHeading","documentCount","replaceAll","_props$expandedFilter","_props$expandedFilter2","_props$view4","_props$view4$cache","_props$hideSubFilters2","expandedFilters","permission","userRoles","useUserRoles","permissions","useProfile","_usr$roles","usr","useRoles","_usr$roles$map","_usr$roles$some","isBOH","Sidebar","_props$activeView$fil","_props$documentCount","_props$activeView3","userIsBOH","isBackOfHouse","selectedModule","selectedModuleFilter","setSelectedModuleFilter","ConfirmationBox","stopPropagation","setResult","opt","toISOLocalDate","date","z","getFullYear","getMonth","getDate","formatTime","toLocaleTimeString","hour","minute","hourCycle","formatDateTime","toLocaleDateString","isoDateStringToBrowserSafeString","dateString","dateToBrowserSafeString","toLocalDateTimeFields","fields","documentMapper","mapFromRailDocument","railDocument","effectiveFromDate","documentModule","typeLabel","subTypeLabel","documentNumber","versionNumber","version","effectiveFromTime","expiryDate","expiryTime","publishTime","requiresAcknowledgementAndNotify","releaseNotes","rescindDocumentReason","reviewPeriod","reviewRecurring","relatedDocuments","relatesTo","acknowledgeRequired","mapToNewDocument","_document$relatedDocu","documentType","effectiveFrom","RootModal","closeText","closeButtonText","closeButtonClass","actionButtonText","Fragment","Modal","modalClass","ModalBody","html","justifyContent","Button","closeAction","ExitCancelModel","InfoModal","DocumentReviewPeriodEnum","getPeriod","period","None","getMonths","Months6","Months12","Months18","Months24","Months36","documentReviewPeriodDisplay","emptyDocument","createInitialState","originalDocument","documentAddEditStateSubject","documentAddEditState","newState","toDisplayDocument","dateTimeFormat","Intl","DateTimeFormat","expiryDateDate","publishDateDate","reviewPeriodDisplay","effectiveFromDateDisplay","format","expiryDateDisplay","publishDateDisplay","SearchBox","_props$value","searchText","setSearchText","_useState3","autoSearch","_useState4","searchTextEvent","setSearchTextEvent","_useState5","_useState6","searchTimer","setSearchTimer","_useState7","searchDelayMs","clearTimeout","timer","placeholder","onKeyPress","searchDisabled","Search","ToggleButton","onMouseDown","preventDefault","isInvalid","KeyboardArrowUpOutlined","KeyboardArrowDownOutlined","SvgCheckBoxOutlinedBlank","Checkbox","toggle","checkedValue","CheckBoxOutlinedBlank","LabelledCheckbox","List","_props$dataSource","filteredItems","setFilteredItems","showAll","setShowAll","ListItemType","listItemType","filterText","refreshFilterOnDataSourceChange","expand","autoCloseRef","callback","useRef","handler","node","current","contains","addEventListener","removeEventListener","useClickOutsideRef","setFilterText","filterAsync","isSelected","buildKey","itemKey","maxItems","displayLoadingData","invalid","filterTextPlaceholder","summary","selectItems","partialSelected","deselectItems","itemFilter","_props$maxItems","_props$maxItems2","toggleSelected","previousItem","ListItem","StringListItem","RelatedDocumentChips","deleteAction","Chip","onDelete","RelatedDocumentList","DocumentListItem","RelatedDocuments","_RelatedRulebookDocum2","setSelectedDocuments","menuDocuments","setMenuDocuments","_useState8","_useState9","_useState10","documentsByNameFilter","setDocumentsByNameFilter","_useState11","_useState12","documentsByNameExpanded","setDocumentsByNameExpanded","_useState13","_useState14","documentSearchSummary","setDocumentSearchSummary","_props$document$relat","_props$document","rulebookCache","relatedDocsIds","rd","_useState15","_useState16","isConfirmClose","setIsConfirmClose","closeModal","removeDocument","leafItem","relatedDocument","selectAction","selectDocument","documentSearchByName","_RelatedRulebookDocum","lcName","_doc$type","_doc$subType","ModalHeader","Row","Col","xs","noResultsMessage","SecondPage","setDocument","completing","setCompleting","displayDocument","ModalSubHeader","isComplete","disabled","backAction","completeAction","mapper","documentModuleId","parentId","parentTypeId","documentTitleDefault","documentTitleValidation","documentNumberDefault","documentNumberValidation","loadDocumentTypes","mapped","writableDocTypes","writableMapped","DocumentModuleEnum","documentModuleDisplay","Rulebook","Document","isAdditionalRulebookType","requiredValidation","validateForm","_docType$children","subtypeIndex","pv","titleValidation","validateTitle","validateDocumentNumber","fileValidation","validateFile","documentTypeValidation","effectiveDateValidation","versionNumberValidation","validateVersionNumber","subTypeValidation","rescindDocumentReasonValidation","PageView","Rescind","isValid","expireDateValidation","fmt","minLength","Edit","endsWith","getDefaultTitle","documentTitleDefaultFormat","getDefaultDocumentNumberTitle","str","today","yy","mm","toolTip","effectiveDate","KeyboardArrowUp","KeyboardArrowDown","RelatedDocumentsSection","showRelatedDocuments","setShowRelatedDocuments","_t$subTypes","DocumentFileUploadSection","existingFile","viewType","NewVersion","FileInput","_props$pageValidation","for","pageValidation","accept","onFileChange","_props$pageValidation2","_props$pageValidation3","AddNew","renderSwitch","FirstPage","_pageValidation$docum","_pageValidation$docum3","_pageValidation$docum4","_pageValidation$subTy2","_pageValidation$subTy3","_pageValidation$title","_pageValidation$title2","_pageValidation$docum5","_pageValidation$docum6","_pageValidation$versi","_pageValidation$versi2","_pageValidation$effec","_pageValidation$effec2","_pageValidation$expir","_pageValidation$expir2","_pageValidation$resci","_pageValidation$resci2","notifyToggleControl","reviewRecurringToggleControl","setDocumentType","subCategories","setSubCategories","setPageValidation","originalTitle","setOriginalTitle","isNotifyToggleDisabled","setNotifyToggleDisabled","userMessage","setUserMessage","reviewPeriodDisabledControl","setReviewPeriodDisabledControl","_useState19","_useState20","documentLoaded","setDocumentLoaded","typeAheadRef","createRef","isAddNew","isEdit","isNewVersion","isRescind","updateState","setConditionalFieldsAndNotify","updatedDoc","reviewMonths","setMonth","handleChange","_defineProperty","handleToggle","handleDocumentTypeChange","relatedDocs","trace","_x$originalDocument","_getDocumentTypeFromI","_x$originalDocument2","documentTypeId","y","vf","validateAction","newDisabled","k","isNaN","useLayoutEffect","disable","enable","documentModuleChange","clear","handleSubTypeChange","nextButtonText","onNextButtonClick","errors","nextAction","ReviewPeriodSelection","htmlFor","sm","md","Typeahead","filterBy","option","dm","inputProps","required","_pageValidation$docum2","isMenuShown","toggleMenu","c","_pageValidation$subTy","maxLength","FormFeedback","defaultValue","min","step","newDocState","setHours","onlabel","onstyle","offlabel","offstyle","size","input","files","DocumentForm","setView","successText","errorText","confirmCloseText","onClose","mount","handleErrors","isArray","ValidationErrors","AddNewForm","setPage","isError","setIsError","setIsComplete","addNewUpload","newDoc","ok","onUpdate","closeModalPrompt","EditForm","tab","setTab","isEditValid","setIsEditValid","_useState21","_useState22","showEditInvalid","setShowEditInvalid","_useState23","_useState24","setEditView","editUpload","editDoc","alignContent","cursor","RescindForm","_useState25","_useState26","_useState27","_useState28","_useState29","_useState30","_useState31","_useState32","rescind","recindDoc","recindDocument","ModalHost","DocumentDetails","BarChart","Link","to","DocumentHistoryView","documentHistory","stateDocumentHistory","setStateDocumentHistory","displayedReleaseNote","setdisplayedReleaseNote","documentIdRestorePrompt","setDocumentIdRestorePrompt","displayRestoredResult","setDisplayRestoredResult","restoredDocId","setRestoredDocId","releaseNoteClick","canRestore","restoreDocumentVersionById","restoreDocumentVersionResult","alert","isRescinded","history","rescindedByDocumentId","isRescinding","rescindsDocumentId","isDeleted","statusId","HistoryIcon","Table","href","rescindedByDocumentNumber","rescindsDocumentNumber","DescriptionIcon","userName","changeDate","onChangeValue","Tabs","stateDocument","setStateDocument","tabType","infoTab","setInfoTab","setIsOpen","TabDetails","documentHistoryUpdated","TabHistory","getDocumentAndHistory","railDoc","docHistory","ViewInfo","setTabView","showEditDocument","setShowEditDocument","actionDocumentId","setActionDocumentId","setRefresh","Spinner","PageList","scrollPageToBottom","setScrollPageToBottom","lastPage","Math","ceil","totalResults","pageArray","p","buildPageArray","moveToPage","scrollCurrentPageNumberIntoView","docPageListElement","getElementsByClassName","docPageNumberElements","currentDocPageElement","midPoint","offsetWidth","offsetLeft","scroll","scrollToBottomIfRequired","pageScrollPercent","pageYOffset","documentElement","scrollHeight","innerHeight","scrollTo","FirstPageOutlined","NavigateBeforeOutlined","NavigateNextOutlined","LastPageOutlined","working","setWorking","toggleFavouriteFlag","setIsFavourite","Star","StarBorder","DocumentRowActionColumn","AnnouncementOutlined","DocumentRow","_props$showStatusColu","_props$showSelectColu","setFavourite","DocumentRowTemplate","openDocument","actionClassName","favourite","favouriteVisible","showFavouriteColumn","statusVisible","showStatusColumn","published","info","InfoOutlined","infoClicked","setShowDocumentInfo","selectVisible","showSelectColumn","select","selectClicked","documentSelectAction","favouriteClicked","statusClicked","isHeader","Grid","container","lg","Hidden","mdDown","xsUp","SortableCol","_props$sortConfig","sortFn","ActionButton","confirmProps","setConfirmProps","enabled","cp","preConfirmationMessageUpdate","visible","DocumentHeaderRow","_props$showStatusColu2","_props$showSelectColu2","statuses","categories","DocumentGrid","_props$documents","_props$documents2","_props$documents3","_props$filter2$rules","_props$filter3$rules","_props$filter4","_props$filter4$rules","_ref9","_props$filter5","_props$filter5$rules","_props$filter6","_props$filter6$rules","showDocumentInfo","sd_items","sd_pageConfig","_useSortableData","openDoc","documentButtonAction","showColumn","colName","_props$hiddenColumns","hiddenColumns","showSubTypeColumn","getDocumentsForSelectedIndexes","ids","getStatusIdsForAction","getStatusesForAction","selectedDocumentsCanExecute","statusIds","setCanFavourite","setCanAdd","setCanEdit","setCanRescind","setCanDelete","setCanDeleteForever","_favourite","_edit","_add","_rescind","_delete","_deleteForever","_props$documents4","selectedDocument","navHistory","useHistory","msgBox","setMsgBox","closeMessageBox","showMessageBox","defaultAction","actionsBusy","setActionsBusy","performActionOnCurrentDocument","_props$documents5","deleteSelectedAsync","_docs2","_doc","deleteDocumentAsync","onDataChanged","deleteForeverSelectedAsync","_docs3","_doc2","permanentDeleteDocumentAsync","addSelectedDocumentsToConfirmationMessage","PDFIcon","onAddDocument","onEditDocument","onRescindDocument","bookmarkAction","createPredicate","colSpan","noDocumentsMessage","onModalsClosed","hidePageList","encodeTerm","term","Searchbar","forwardRef","searchState","from","autoComplete","onKeyDown","CleverString","_String","_inherits","_super","_createSuper","toKebabCase","currentCharacter","toTitleCase","currentWord","toUpperCase","toSentenceCase","_assertThisInitialized","_wrapNativeSuper","SubHeader","Card","BreadCrumbs","route","endTrail","customBreadCrumbs","_route$breadCrumb","startsWith","matchedPath","RouteList","mp","matchPath","isExact","r","breadCrumb","spacer","component","UnderConstruction","backgroundColor","hideSearchBar","SvgFilter","PageSizeDropdown","sizes","setPageSize","PageSizeWithPicker","setSelected","FilterDocumentsDialog","ver","setVer","setModules","setStatuses","toggleModule","toggleStatus","DocumentList","_activeSubFilter$icon","_unfilteredDocuments$","_activeSubFilter$url","showSingleSelectMessage","setShowSingleSelectMessage","setUserFilter","loadingState","setLoadingState","unfilteredDocuments","setUnfilteredDocuments","filteredDocuments","setFilteredDocuments","filteredCount","setFilteredCount","setHiddenColumns","_useState33","_useState34","modalFilterVisible","setModalFilterVisible","CurrentIcon","_useState35","_useState36","showAddDocument","setShowAddDocument","_useState37","_useState38","_useState39","_useState40","showRescindDocument","setShowRescindDocument","_useState41","_useState42","clearModals","clearSelectedItems","getPage","getAllResults","switchFilter","switchSubFilter","applyFilters","filteredResults","viewDataForCurrentPath","_viewDataForCurrentPa2","_viewDataForCurrentPa3","_viewDataForCurrentPa4","_viewDataForCurrentPa","setPathView","_DefaultView$rules$gr","_DefaultView$rules","_DefaultView$rules$gr2","_DefaultView$defaultF","setDefaultView","getDocuments","currentPath","docView","_activeView$rules","_activeView$rules2","_ref5$rules","_ref6$rules","getHiddenColumns","_filteredDocuments$le","SideBar","FilterIcon","clearSelected","getUsersByNamePath","getSupervisorsByNamePath","getUsers","getSupervisors","getPublishers","getUsersSupervisedByCurrentUser","getDocumentTypes","getDepartments","getUserStatuses","getDocumentStatuses","getUsersByName","getSupervisorsByName","getAllDocuments","getUsersDocuments","downloadResults","downloadFatigueAssessmentResults","getLoginHistoryResults","_ref20","_callee20","_context20","downloadLoginHistoryResults","downloadFullComplianceReport","_ref22","_callee22","_context22","TabPanel","SvgReportsFilled","SvgBuildCircle","SvgDashboardCustomize","SvgAddChart","ModalBox","_props$options","heading","canClose","HighlightOffOutlined","subHeading","PortalPage","confirmationProps","modalProps","DefaultLayout","editStates","viewStates","getLayout","currentMode","editLayout","fieldProps","col","formatRow","getLookupKeyValuePair","kvp","_col$validation$value","_col$validation","validation","values","getValues","getLookupValue","_getLookupKeyValuePai","isReadonly","_col$readonly","readonlyIf","readonlyForEdit","readonly","getFieldMode","mode","Field","_props$immediateValid","_props$validationMess","tip","viewModeValue","editModeValue","immediateValidationMessages","validationMessages","UserListItem","fullname","city","NearMeOutlined","supervisor","SupervisorAccountOutlined","email","MailOutline","UserPicker","_props$value2","_selectedUsers$","usersByNameSummary","setUsersByNameSummary","users","setUsers","defaultUser","selectedUsers","setSelectedUsers","filterUsersAsync","searchTerm","usersText","u","mounted","placeholderText","LabelField","_props$col$validation","currentValue","setCurrentValue","validationTooltip","KeyValueListItem","KeyValueList","_props$selected","ComboField","_props$col$validation2","_props$col$validation3","_props$col$validation4","TextField","_props$col$readonly2","_props$col$readonlyFo2","_props$col$validation6","_props$col$validation7","_props$col$validation8","_props$col$placeholde","newValue","onBlur","UserField","_props$col$validation9","_props$col$placeholde2","setValue","EmailField","_props$col$validation10","_props$col$validation11","_props$col$validation12","_props$col$placeholde3","DetailFormWrapper","_props$module$columns","_props$viewName","setConfirmationProps","DetailsForm","load","create","cols","columns","save","setValid","close","isDirty","opts","def","defFn","otherFn","closeDialog","_findView","_props$viewName2","_appView$mode","_appView$editLayout","currentUser","setData","setInitialState","setDirtyState","savingState","setSavingState","validationErrors","setValidationErrors","immediateValidationErrors","setImmediateValidationErrors","findView","_props$module","_props$module$views","appView","setAppView","_useState43","_useState44","setMode","newRow","validate","invalidCols","formComponent","invalidColResult","_appView$mode2","_rules$minLength","_rules$maxLength","valueIsBlank","ew","startsWithString","reduce","endsWithString","segments","splitter","column","validateColumn","validateImmediateResult","valid","clearColImmediateResultError","_col$validation4","immediateValidationMsgFn","filteredErrors","take","switchToView","_findView2","nextView","switchView","HeadingIcon","subSubIcon","progress","subSubHeading","_appView$editLayout2","FieldType","columnErrors","immediateColumnErrors","_col$validation2","_col$validation3","immediateValidationFn","validateImmediate","_currentUser$roles","DataGrid","_props$sortCol","filterValues","setFilterValues","rows","filteredRows","setFilteredRows","setPageNumber","sortCol","setSortCol","sortDirection","setSortDirection","toggleFilterFn","areAllSelected","_props$selectedItems","sel","colHeaderVal","rawValue","blankValue","_col$validation$value2","distinctColumnsFiltered","fv","colVal","selectMode","_props$selectedItems2","_props$selectedItems3","_props$rows","_col$gridHeading3","_col$gridHeading4","filterable","_col$gridHeading","_col$gridHeading2","vals","rowVal","acumulator","distinct","gridHeading","CheckBoxOutlineBlank","updateSort","SwapVertOutlined","ArrowDownwardOutlined","ArrowUpwardOutlined","rowIndex","_props$selectedItems7","onDoubleClick","_props$selectedItems4","_props$selectedItems5","_props$selectedItems6","nullValue","clickAction","perform","actionName","EmployeeTypeEnum","UserStatusEnum","FatigueAssessmentRiskEnum","FatigueAssessmentTaskEnum","FatigueAssessmentStatusEnum","ToolbarButton","minSelectedCount","maxSelectedCount","isEnabled","Toolbar","userActions","firstname","lastname","MailOutlined","UserFilter","summaryText","setSummaryText","allUsers","allowSelectAll","StringFilter","allValues","singularOrPlural","singularDesc","pluralDesc","UsersByDepartmentFilter","allDepartments","selectedDepartments","setSelectedDepartments","RadioButton","RadioButtonCheckedOutlined","RadioButtonUncheckedOutlined","UsersByEmployeeTypeFilter","selectedEmployeeType","setSelectedEmployeeType","Employee","EmployeeTypeEmployeeLabel","Contractor","EmployeeTypeContractorLabel","ResultHeading","UserFilters","userFilterTab","setUserFilterTab","supervisorIds","setSupervisorIds","_props$allUsers","_usr$supervisor$id","_usr$supervisor","whenUserOrSupervisorIsSelected","selectedSupervisors","sv","_usr$supervisor2","setSelectAllUsers","selectAllUsers","PersonOutlined","Tab","_usr$supervisor3","_props$currentUser","setSelectedSupervisors","userToRemove","selectedUser","supervisorToRemove","selectedSupervisor","dpt","departmentToRemove","selectedDepartment","UserManagementPage","_UserManagementModule","_UserManagementModule2","_UserManagementModule3","_UserManagementModule4","setModalProps","setAllUsers","setAllDepartments","filterDepartments","setFilterDepartments","filteredUsers","setFilteredUsers","filterUsers","setFilterUsers","filterSupervisors","setFilterSupervisors","updatedUser","department","dept","ask","replaceItem","byUserFilters","_usr$supervisor4","employeeType","saveUser","userToSave","viewUser","UserManagementModule","changeUserStatus","usersToChange","newStatus","Active","userIds","_action$minSelectedCo","checkMinMax","ViewOrEditButtonText","MakeInactiveButtonText","usersToInactivate","Inacitve","MakeActiveButtonText","usersToActivate","RefreshButtonText","showInGrid","numberSort","SvgUsersFilled","cx","cy","rx","ry","SvgMakeInactive","SvgMakeActive","isEmployee","UserIcon","doubleClickAction","EditOutlined","openView","MakeInactiveIcon","MakeActiveIcon","BarChartOutlined","Create","username","_props$col$readonly","_props$col$readonlyFo","_props$col$validation5","ReactDatePicker","dateFormat","lastLoginDate","mobile","System","Unknown","standardGridSizes","xl","ExportColumnList","definition","ExportColumnHeader","unsortable","DragIndicatorOutlined","removeColumn","RemoveOutlined","titleAccess","ExportGrid","getSortDirection","sortOrder","getRemoveColumn","xc","getFieldTitle","setSortOrder","list","ExportGridColumn","infoDialog","formatter","blobDownload","iOS","navigator","userAgent","MSStream","isSafari","match","reader","FileReader","onload","Blob","readAsDataURL","RangeError","lnk","createElement","createObjectURL","setAttribute","click","DateRangePicker","fromDate","maxDate","toDate","setter","TodayOutlined","minDate","EventOutlined","dateToStringFormatter","booleanToYesNoFormatter","trueValue","falseValue","stringArrayToString","separator","emailFormatter","CheckboxList","gridSizes","_createElement","content","sortByComplianceReport","defaultForComplianceReport","fullName","DocumentTypeListItem","_props$item$subTypes","_props$indent","_props$indent2","paddingLeft","indent","metadata","CleverStringChips","cs","removeItem","UserChips","DocumentChips","DocumentTypeChips","Chips","UserDocumentReport","MaxResultsPerReport","exportState","setExportState","stateVersion","setStateVersion","exportUsers","setExportUsers","exportDocuments","setExportDocuments","newExportColumns","exportColumns","selectedCol","userColumns","documentColumns","actionColumns","selectedUserColumns","selectedDocumentColumns","selectedActionColumns","setExportColums","seq","exportResults","setExportResults","usersByNameFilter","setUsersByNameFilter","usersByNameExpanded","setUsersByNameExpanded","usersInMyTeam","setUsersInMyTeam","usersInMyTeamFilter","setUsersInMyTeamFilter","usersInMyTeamListExpanded","setUsersInMyTeamListExpanded","allSupervisors","setAllSupervisors","usersBySupervisorFilter","setUsersBySupervisorFilter","usersBySupervisorExpanded","setUsersBySupervisorExpanded","usersByDepartmentFilter","setUsersByDepartmentFilter","usersByDepartmentExpanded","setUsersByDepartmentExpanded","_useState45","_useState46","selectedUserStatuses","setSelectedUserStatuses","_useState47","_useState48","userStatuses","setUserStatuses","_useState49","_useState50","allDocuments","setAllDocuments","_useState51","_useState52","selectAllDocuments","setSelectAllDocuments","_useState53","_useState54","_useState55","_useState56","_useState57","_useState58","documentStatuses","setDocumentStatuses","_useState59","_useState60","selectedDocumentStatuses","setSelectedDocumentStatuses","_useState61","_useState62","setDocumentTypes","_useState63","_useState64","selectedDocumentTypes","setSelectedDocumentTypes","_useState65","_useState66","documentsByTypeFilter","setDocumentsTypeFilter","_useState67","_useState68","documentsByTypeExpanded","setDocumentsByTypeExpanded","_useState69","_useState70","allPublishers","setAllPublishers","_useState71","_useState72","selectedPublishers","setSelectedPublishers","_useState73","_useState74","documentsByPublisherFilter","setDocumentsPublisherFilter","_useState75","_useState76","documentsByPublisherExpanded","setDocumentsByPublisherExpanded","_useState77","_useState78","publishedDateFrom","setPublishedDateFrom","_useState79","_useState80","publishedDateTo","setPublishedDateTo","refreshDepartmentsFromResult","refreshUserStatusesFromResult","refreshDocumentStatusesFromResult","refreshUsersFromResult","refreshSupervisorsFromResult","refreshPublishersFromResult","refreshUsersInMyTeamFromResult","forceStateChange","selectUsers","selectUserItems","stateItems","newUsers","Set","userFilterAdded","deselectUsers","deselectUserItems","selectDocumentItems","newDocs","documentFilterAdded","deselectDocumentItems","refreshDocumentTypesFromResult","refreshDocumentsFromServer","currentDocumentIds","remoteUpdates","getData","processData","processRemoteResults","errorMessage","allSettled","getExportFilter","departments","employeeTypes","typeIds","publishedFromDate","publishedToDate","publisherIds","fileType","uc","downloadExportResults","refreshExportResults","userUpdated","setUserInfoProps","_useState81","userDoc","_userDoc$user","_useState83","_useState85","_useState87","_useState88","_useState89","_useState90","_useState91","_useState92","_useState93","_useState94","_useState95","_useState96","_useState97","_useState98","userInfoProps","_useState99","_useState100","_useState101","_useState102","documentFilterTab","setDocumentFilterTab","toggleItem","comparerPredicate","toggleUser","toggleDepartment","toggleSupervisor","toggleUserStatus","us","toggleDocument","toggleDocumentStatus","toggleDocumentType","togglePublisher","toggleExportColumn","userNameItemFilter","_item$email","userNameFilter","documentNameItemFilter","documentTypeNameContains","lcFilterText","stringItemFilter","cancelOption","setSelectAllUsersAndClearSelections","setSelectAllDocumentsAndClearSelections","downloadComplianceReport","allExportTypeCheckedValue","selectedColumnCount","selCol","exportCol","toggleAllExportTypeChecked","selectedColumns","selectColumns","unselectColumns","ReportingIcon","BuildCircle","AddChart","Paper","variant","FolderOutlined","dateTo","DashboardCustomise","PersonAddOutlined","CreateNewFolderOutlined","ActionFields","FatigueAssessmentQuestions","hoursSleep24Hrs","hoursSleep48Hrs","currentHoursAwake","feelAlert","alcoholicDrinks","gender","altValue","unfitSubstanceCheck","concentrationCheck","signOnLocation","signOnLocationId","tooltip","shiftStartTime","assessmentDate","assessmentScore","risk","onBehalfUser","shiftSupervisor","shiftSupervisorId","partialShiftStartDate","partialShiftStartTime","onBehalfSubmitter","onBehalfReason","controlsImplementedBy","actionTakenGroup","actionComment","actionConfidential","actionSupervisors","actionSupervisorSignature","actionAlternativeSupervisorReason","privacyPolicy","getLocations","getLocationsWithDetail","getLocationWithDetail","locationId","updateLocationMobile","LocationDetail","siteMobileNumber","LocationListItem","LocationChips","FatigueAssessmentReport","usersByName","setUsersByName","supervisorsFilter","setSupervisorsFilter","supervisorsExpanded","setSupervisorsExpanded","supervisorsSummary","setSupervisorsSummary","supervisors","setSupervisors","selectedLocations","setSelectedLocations","locationsFilter","setLocationsFilter","locationsExpanded","setLocationsExpanded","locationsSummary","setLocationsSummary","locations","setLocations","includeAudit","setincludeAudit","statusCompleted","setStatusCompleted","statusPending","setStatusPending","statusViolation","setStatusViolation","riskLow","setRiskLow","riskMedium","setRiskMedium","riskHigh","setRiskHigh","riskNa","setRiskNa","yesterday","setDate","shiftDateFrom","setShiftDateFrom","shiftDateTo","setShiftDateTo","srcItems","destinationItems","comparer","locationIds","isNumber","Complete","Pending","Violation","riskIds","Low","Medium","High","NA","toggleLocation","searchUsersByName","searchSupervisorsByName","locationApi","View","LocationOnOutlined","AssignmentTurnedInOutlined","CancelOutlined","DateRangeOutlined","CheckOutlined","LoginHistoryReport","downloadState","setDownloadState","historyResult","setHistoryResult","historyResultPaged","setHistoryResultPaged","historyColumns","viewResults","setPagedResults","start","deleteCount","paged","SvgRelatedDocuments","showRelatedDocs","setShowRelateDocs","setExpandedFilters","RelatedDocumentsLinkIcon","ModalButton","primaryButton","ModalButtonRow","FormModalSubHeader","FormModalPaddedBody","FormModal","ClarifyModal","clarifyNoMessageModalDisplayed","setClarifyNoMessageModalDisplayed","commentsText","setCommentsText","InsertCommentOutlined","commentMaxLength","_event$target","comments","setDocumentClarification","submitAction","FeedbackModal","setDocumentFeedback","AcknowledgePanel","shrinkAcknowledgePanel","setShrinkAcknowledgePanel","understoodChecked","setUnderstoodChecked","understoodUncheckedWarning","setUnderstoodUncheckedWarning","clarificationModalDisplayed","setClarificationModalDisplayed","acknowledgeSentModalDisplayed","setAcknowledgeSentModalDisplayed","feedbackModalDisplayed","setFeedbackModalDisplayed","AcknowledgementErrorModalDisplayed","setAcknowledgementErrorModalDisplayed","feedbackRecordedModalDisplayed","setFeedbackRecordedModalDisplayed","clarifyRecordedModalDisplayed","setClarifyRecordedModalDisplayed","clarifyEnabled","setClarifyEnabled","setAcknowledgeRequired","expandAcknowledgePanel","toggleShrinkAcknowledgePanel","acknowledgeAction","sendAcknowledgement","setDocumentAcknowledged","acknowledgeActionResult","displaySendAcknowledgementError","clarificationAction","naviateToDocuments","Modals","AcknowledgeRow","ClarifyRow","AcknowledgeTooltip","displayAcknowledgePanel","ShrinkToggle","ChevronRight","ChevronLeft","PopulatedRailRulebookMenu","_f$subFilters","Nav","NavItem","shown","setShown","toggleShown","publicUrl","protocol","host","process","staticJsFilesBaseUrl","PSPDFKitComponent","setRelatedDocuments","setDocumentId","documentLoadError","setDocumentLoadError","pdfInstance","_setPdfInstance","pdfInstanceRef","toggleFavourite","configureToolbar","shareDocument","subject","link","encodeURIComponent","docInfo","downloadPdf","buffer","exportPDF","saveAs","copyToolbarItem","src","dst","stockButton","button","GridIcon","ZoomIn","ZoomOut","Fullscreen","SearchIcon","onPress","InfoIcon","IosShare","FavouriteFilled","FavouriteEmpty","PrintIcon","Download","customIcon","instance","toolbarItems","bhpToolbarItems","setToolbarItems","documentPendingActions","_setDocumentPendingActions","documentPendingActionsRef","_setDisplayAcknowledgePanel","displayAcknowledgePanelRef","setDisplayAcknowledgePanel","related","pdf","all","loadPdfViewer","_pdfInstanceRef$curre","contentWindow","PSPDFKit","unload","staticFile","_pdfInstanceRef$curre2","_pdfInstanceRef$curre3","licenseKey","baseUrl","styleSheets","setDocumentViewed","setDocumentAcknowledgeAction","viewStateChangeEvent","setPdfInstance","viewState","set","setViewState","startUISearch","isLastPage","currentPageIndex","totalPageCount","setDocumentPendingActions","onDocInfoUpdate","_viewData$module$url","_viewData$type$url","_viewData$subType$url","_viewData$subType","moduleLinkPart","typeLinkPart","subTypeLinkPart","viewData","_step4","_iterator4","_step5","_iterator5","_step6","_iterator6","findDocumentViewForId","moduleLink","typeLink","subTypeLink","StaticFileViewer","MyActions","setDocuments","goToMyAwaitingActionList","downloadedDocuments","updateDocuments","documentListModalsClosed","Documents","maxResults","KeyboardArrowRightOutlined","fatigueAssessmentUriPath","fatigueAssessmentDetails","fatigueAssessmentSubmitFa","fatigueAssessmentSubmitOnBehalf","fatigueAssessmentsUri","dashboardFatigueAssessmentsUri","fatigueAssessmentsAddNoteUri","fatigueAssessmentSaveActionUri","fatigueAssessmentAssignUri","getFatigueAssessment","getFatigueAssessmentDetails","getFatigueAssessments","myForm","getDashboardFatigueAssessments","form","assessments","submitFatigueAssessment","submitOnBehalfAssessment","fatigueAssessmentAddNote","note","saveAction","faAssign","getRoute","fatigueAssessmentRoute","shiftSummaryDashboard","fatigueAssessmentDashboardPathRoute","shiftSummaryDashboardPending","fatigueAssessmentPendingPathRoute","subitem","shiftSummaryDashboardToAction","fatigueAssessmentActionPathRoute","shiftSummaryDashboardToRevisit","fatigueAssessmentRevisitPathRoute","shiftSummaryDashboardCompleted","fatigueAssessmentCompletedPathRoute","shiftSummaryDashboardOverview","fatigueAssessmentOverviewPathRoute","fatigueAssessmentForm","fatigueAssessmentBlankFormRoute","fatigueAssessmentOnBehalf","fatigueAssessmentOnBehalfRoute","fatigueAssessmentAssign","fatigueAssessmentAssignRoute","FatigueAssessmentPageSelector","selectedPage","currentSelection","setCurrentSelection","selectOptions","setSelectOptions","getSelectOptions","selectOption","selectOnChange","SvgFatigueAssessmentFilled","FatigueAssessmentSidebar","FatigueAssessmentIcon","RightIcon","DownIcon","FatigueAssessmentPage","FatigueAssessmentView","FatigueAssessments","FatigueAssessmentCardList","MyForm","titleIcon","ReplayIcon","emptyAction","affectedSupervisors","confidential","originalAction","actionValidation","checkValidation","fatigueAssessmentActionStateSubject","isValueInvalid","fatigueAssessmentActionState","handleActionChange","_event$target2","enableActionValidation","resetActionValidation","actionFieldInvalid","requiredFields","actionStateInvalid","conditionalFields","invalidGroups","group","reset","alertOptions","yesNoOptions","sexOptions","riskOptions","actionOptions","noFurtherAction","noActionTakenPlannedLeave","noActionTakenUnplannedLeave","actionTaken","actionTakenRevisit","actionTakenBuddyUp","actionTakenRemoveFromSafetyCritical","actionTakenRemainLocal","actionTakenAltDuties","sentHome","onbehalfOptions","DropdownSelect","selectedAnswer","setSelectedAnswer","isOptional","optional","ExpandLess","choice","DropdownItem","onAnswerUpdate","answerSelected","HoursChoices","displayTime","time","hours","floor","minutes","padStart","timeOptions","AlertChoices","Form","Check","AlcoholicDrinksChoices","displayDrinksChoices","drinks","drinksOptions","SexChoices","OnbehalfChoices","YesNoChoice","YesNoCheck","_props$item$superviso","UserChoice","setAction","subscribeActionField","filterSelectedUsers","supervisorFilter","multichoice","OtherLocation","LocationChoice","setOptions","defaultLocationOption","_location$siteMobileN","defaultLocationId","l","DateChoice","currentDate","addDays","days","dayRange","max","TimeChoice","addMinutes","setTime","defaultTime","getMinutes","getHours","selectedHour","setSelectedHour","selectedMinute","setSelectedMinute","timeFormat","roundSelectedTimeUpToNearestHalfHour","ft","dateInput","roundDateUpToNearestHalfHour","hourOptions","SingleLineTextInput","setText","MultilineTextInput","RadioInput","CheckBoxInput","setChecked","FatigueAssessmentAction","affectedSupervisorsChips","setAffectedSupervisorsChips","actionTakenSelected","setActionTakenSelected","noActionTakenSelected","setNoActionTakenSelected","setRender","q","removeAffectedSupervisor","newSupervisors","newSupervisorIds","actionTakenUpdated","furtherAction","alternativeSupervisor","emptyForm","originalForm","formValidation","fatigueAssessmentFormStateSubject","updateFormState","fatigueAssessmentFormState","_value$target","fieldInvalid","OnBehalfHeader","setForm","showText","setShowText","fs","_s$form$onBehalfReaso","hideText","MainForm","_form$supervisor","_form$supervisor2","_form$signOnLocation$","_form$signOnLocation","defaultSupervisor","setDefaultSupervisor","defaultSignOnLocation","setDefaultSignOnLocation","defaultShiftStartTime","setDefaultShiftStartTime","showSupervisor","setShowSupervisor","_s$form$supervisor","_s$form$supervisor2","_s$form$signOnLocatio","_s$form$signOnLocatio2","sol","dangerouslySetInnerHTML","__html","_value$target2","OnBehalfFooter","LoadingMessage","ResultModal","formTitle","onBehalf","resultScore","WarningIcon","FormContents","loading","isLoading","setIsLoading","clearForm","setClearForm","isSubmitting","setIsSubmitting","displayAllRequired","setAllRequired","displayErrorSubmitting","setErrorSubmitting","setResultScore","displayResultModal","setResultModal","onSubmit","submitAssessment","unansweredCount","getAssessmentFromCurrentForm","submitIfAble","supervisorId","shiftStartLocalTimeString","shiftStartLocalTime","_form$user","submitOnBehalf","questionsUnanswered","submitResults","errorResults","answers","errorCount","entries","debug","score","showResults","_props$assessment","faSub","actionSub","faAssessment","assessment","tabIndex","FatigueAssessmentBaseForm","setAssessment","setLoading","_getData","idString","FatigueAssessmentOnBehalfForm","_props$results","_props$results2","_props$results3","_props$results4","_props$results5","added","existing","failed","FatigueAssessmentAssignForm","shiftStartDate","setShiftStartDate","setShiftStartTime","validationEnabled","setValidationEnabled","assignResults","setAssignResults","newUserIds","now","paddingBottom","minHeight","_e$target","_e$target2","_e$target3","_e$target4","FatigueAssessmentDashboard","_props$page","_props$pageView","pageView","pageTitle","showPageSize","showFilters","showFooter","FatigueAssessmentDashboardPending","FatigueAssessmentDashboardToAction","ToAction","FatigueAssessmentDashboardToRevisit","ToRevisit","FatigueAssessmentDashboardCompleted","Completed","FatigueAssessmentDashboardOverview","Overview","TabHeader","tabExpanded","activeTab","tabValue","RemoveIcon","AddIcon","QaRow","_props$faQuestion$alt","keyVal","getKeyValue","formDetails","faQuestion","translateAnswer","DetailsTab","translateYesNo","_yesNoOptions$find","InfoTab","_props$formDetails$on","RecommendationsTab","ActionsFormTab","saveResults","reload","isAlternativeSupervisor","_props$formDetails$su","fatigueAssessmentId","ActionsInfoTab","actionDescription","_yesNoOptions$find2","ActionsTab","NotesTab","notes","setNotes","noteText","setNoteText","saving","setSaving","maxNoteLength","addNoteResult","newNotes","noteDate","AuditTab","audit","auditItem","description","FatigueAssessmentDetails","pages","dashboardPending","dashboardAction","dashboardRevisit","dashboardCompleted","params","useParams","dashboardType","formId","setActiveTab","setFormDetails","setReload","tabClicked","getActionPath","isOverdue30Min","fatigueAssessmentPath","dashboardOverview","fatigueAssessmentDashboardPath","fatigueAssessmentPendingPath","fatigueAssessmentActionPath","fatigueAssessmentRevisitPath","fatigueAssessmentCompletedPath","fatigueAssessmentOverviewPath","fatigueAssessmentDetailsPath","fatigueAssessmentBlankFormPath","fatigueAssessmentFormPath","fatigueAssessmentOnBehalfPath","fatigueAssessmentAssignPath","exact","fatigueAssessmentDetailsPathRoute","fatigueAssessmentFormRoute","fatigueAssessmentFormUrl","CardRow","_assessment$user","_assessment$signOnLoc","_assessment$superviso","_assessment$signOnLoc2","_assessment$superviso2","shiftStartTimeFormatted","isActionableOverdue","task","displayFatigueAssessmentDetails","adminView","currentView","StatusComplete","StatusPending","dueState","dueMessage","FiberManualRecord","displayDue","NoAction","ActionIcon","FatigueAssessmentCard","cardUrl","OrderByOption","FilterType","TitleContainer","ResultCountContainer","viewCount","resultCount","LinkIcon","TabsContainer","getTabLabel","substr","tabs","setCurrentView","ChartContainer","COLORS","acc","riskLevel","PieChart","Legend","layout","verticalAlign","align","Pie","dataKey","nameKey","outerRadius","entry","Cell","updateDate","parse","FilterContainer","userResult","FaListContainer","displayAssessments","setDisplayAssessments","setRiskOptions","riskFilter","setRiskFilter","newDisplayAssessments","orderByName","orderByOption","NameAsc","SortDescIcon","NameDesc","SortAscIcon","SortNoneIcon","orderByShiftStartTime","ShiftStartTimeAsc","ShiftStartTimeDesc","risks","newRisks","riskValue","FooterContainer","assessmentCacheTime","setAssessmentCacheTime","setAssessments","viewAssessments","setViewAssessments","headerLink","setHeaderLink","setAdminView","setOrderByOption","loadBackground","setLoadBackground","defaultFilters","todayDate","nowDate","getDefaultFilters","setFilters","getViewData","dashboardQuery","supervisorFilters","locationFilters","dateFilter","pending","_dashboardQuery$super","_dashboardQuery$locat","overview","configHeaderLink","showHeaderLink","interval","setInterval","cacheAgeThreshold","pollingSeconds","clearInterval","newFilters","oldDateFilterIndex","_a$user","_b$user","aName","bName","localeCompare","reverse","aTime","bTime","ActionableFatigueAssessments","hasAdminPermission","viewTabs","SvgQlTakeTimeTalks","SvgQlIdeasHub","SvgQlSuccessFactors","SvgQlFiori","SvgQlWebmail","QuickLink","Box","QuickLinksData","TakeTimeTalksIcon","IdeasHubIcon","SuccessFactorsIcon","FioriIcon","WebMailIcon","QuickLinksCard","SvgInsertComments","SubmitTechFeedback","EmailSafeWorking","NeedDirectionCard","Help","Feedback","Explore","SvgDateRange","SvgRailApp","SvgTrainApp","overflow","ApplicationData","CrewRosteringIcon","RailAppIcon","TrainAppIcon","AppCard","image","alt","ApplicationsCard","app","HistoryButton","DocHistory","home","ActionableDocuments","spacing","SigninOidc","_signinAsync","locationPath","getItem","signinAsync","SignoutOidc","SilentAuth","_silentAuthAsync","silentAuthAsync","RolesProfile","_roleInfo$roles","showRoles","setShowRoles","roleInfo","clearStorage","ctrlKey","altKey","RoleIcon","ProfileCol","ProfileDetails","ProfileIcon","AccountIcon","WorkIcon","jobTitle","supervisorFirstname","supervisorLastname","supervisorEmail","officeLocation","division","UserProfile","emptyQuery","moduleIds","dateRange","fullMatchContentRequired","documentSearchStateSubject","documentSearchState","FilterDropdown","ExpandIcon","toggleFunction","checkedItems","keyPrefix","DateRangeDropdown","setFromDate","setToDate","dateFrom","setDateRange","newQuery","searchQuery","setSearchQuery","startDate","endDate","setDates","RefineSearch","_searchQuery$moduleId","_searchQuery$typeIds","_searchQuery$statusId","_searchQuery$moduleId2","_searchQuery$typeIds2","_searchQuery$statusId2","setSearchTerm","searchHistory","setSearchHistory","searchHistoryLoaded","setSearchHistoryLoaded","runPostMount","setRunPostMount","allSuggestions","setAllSuggestions","currentSuggestions","setCurrentSuggestions","mainSearchBarRef","updateSuggestions","formattedSearchTerm","newSuggestions","rs","formattedExpression","expression","minSearchTermLength","addSearchHistory","runQuery","pushHistory","documentFilterModules","documentFilterTypes","documentFilterStatus","getDocumentFilterStatus","toggleType","unshift","pop","historyJson","loadHistory","autoFocus","ClearIcon","_mainSearchBarRef$cur","replaceIndex","lastIndexOf","focus","selectSuggestion","TuneIcon","searchForTerm","SyncIcon","SvgIconPdf","SvgIconWorkOnTrack","StatusIcon","StatusCurrentIcon","StatusArchivedIcon","StatusExpiredIcon","StatusRescindedIcon","StatusDeletedIcon","DocumentCard","documentLink","escapeHtml","WorkOnTrackIcon","documentTitle","hideType","publishedDate","output","escapeSearch","matchWidth","matchIsAtStart","matchIsAtEnd","trimStartPosition","trimLastPosition","whitespaceMatches","matchAll","lastWhitespacePosition","firstWhitespacePosition","matchStart","fromCharCode","matchEnd","escapeRegExp","formatMatchText","matchText","requiresAcknowledgement","AcknowledgeIcon","NotFavouriteIcon","GroupResultTitle","RulebookIcon","DocumentsIcon","GroupResults","setMaxResults","displayDefaultResults","groupName","DocumentSearch","setResults","rulebookResults","setRulebookResults","documentResults","setDocumentResults","typeResults","setTypeResults","isSearching","setIsSearching","isPreSearch","setIsPreSearch","setMounted","stateParams","_x23","documentSearch","searchResults","splitTypeResults","types","CloseIcon","count","queryModuleCount","queryTypeCount","allowedDomainRoot","emailDomainAvailable","emailDomain","allowedDomainApi","allowedDomainId","allowedDomain","setIsEnabled","_setIsEnabled","allowedDomainIds","AllowedDomainList","_props$module$actions","_props$module$pageSiz","_filter$sort","domains","setDomains","selectedDomains","setSelectedDomains","getAllowedDomains","createBlankDomain","contractPartner","sector","companyWebsite","domain","viewOrEdit","AddNewButtonText","EnableOrDisableButtonText","allowedDomains","theseDomains","DISABLED","enableSlashDisable","proceedButtonText","enabledSlashDisabled","activeSlashInactivePhrase","confirmEnableOrDisable","_a$showInGrid","_b$showInGrid","compareInts","TabButtons","onSelected","AccessDenied","GeneralAdministrationPage","_GeneralAdministratio","_currentTab$url","userTabs","GeneralAdministrationModule","subModule","getDefaultTab","_userTabs$find","_t$url","currentTab","setCurrentTab","defTab","TabComponent","tabComponentProps","abmUriPath","getAbmCodeUsage","usage","addNewCodes","codes","UsageView","codeUsage","available","used","AddCodesForm","newCodes","setNewCodes","addCodes","AddCodesResults","codesAddedResult","duplicate","setCodesAddedResult","AppleAppCodesPage","setCodeUsage","codesAdded","codesArray","addNewActionButton","AddCircleOutlineOutlined","editActionButton","deleteActionButton","DeleteOutlined","toolbarActions","gridColumns","AcronymForm","setExpression","setSuggestion","expressionInvalid","setExpressionInvalid","suggestionInvalid","setSuggestionInvalid","_props$acronym","_props$acronym2","acronym","formValid","saveAcronym","okAction","AcronymsPage","acronyms","setAcronyms","selectedAcronyms","setSelectedAcronyms","setMessage","prompt","setPrompt","openMessage","closePrompt","closeForm","addAcronym","editAcronym","deleteSelectedAcronyms","deleteIds","SiteMobileNumbers","getLocationList","saveLocationDetail","locationDetail","SvgSettings","GeneralAdminIcon","hideInMenuTile","SwapHorizontalCircleOutlined","_props$col$readonly3","_props$col$readonlyFo3","_props$col$validation13","_props$col$validation14","_props$col$placeholde4","_immediateValidationFn","contractManager","mobileString","MobileNumbersPage","unProtected","Home","UserDocumentsReportingView","Debug","routes","_step10","_iterator10","AllDocumentRoutes","accessLink","Routes","accessRequired","hasPermissionRouteProtected","hasPermissionRouteUnprotected","Route","AccessRequired","NoAccess","SvgBhpLogo","ShowIcon","logoutMessage","setLogoutMessage","Person","right","AccountCircle","divider","ExitToApp","SvgFatigueAssessment","SvgAppsFilled","SvgArrowForward","LinkAndClose","_objectDestructuringEmpty","AdministrationTileData","modulePrefix","Settings","CreateMenuForAppModule","appMod","_appMod$children","_c$hideInMenuTile","CreateTileForDocumentModule","_dt$subFilters","maxDisplayedChildren","RailRulebookTileData","RailDocumentsTileData","FatigueAssessmentTileData","ReportingTileData","ApplicationTileData","AppsIcon","external","QuickLinksTileData","ql","MenuItem","_props$item$className","_props$item$url","rel","ArrowForward","_c$hideInMenuTile2","subItem","MenuPanel","viewAllItem","_props$item","_c$hideInMenuTile3","docTypeId","menuItems","MenuTile","currentMenu","largeTile","setCurrentMenu","NavMenu","admin","onFollowLink","notificationsStateSubject","stateNotifications","requireRefresh","notificationsState","notifications","DocumentNotifyTypeEnum","getCardBodyText","faId","documentNotifyType","InitialDocument","VersionUpdate","Restored","Review","getTimeDiffText","timeDiff","valueOf","timeDesc","round","setStateNotifications","setRequireRefresh","lastCheckedTime","setLastCheckedTime","getNotificationsForMenu","notificationsStateSubscribe","EmptyNotifications","AccessTime","NotificationsList","_stateNotifications$f2","_stateNotifications$f3","_stateNotifications$d2","faCount","fatigueAssessments","faNotification","NotificationCard","dateOfIssue","documentNotifications","docNotification","notifyDate","notifyType","AllNotificationsRedirect","NotificationsActive","_stateNotifications$f","_stateNotifications$d","notificationCount","Hamburger","preserveAspectRatio","stroke","strokeWidth","percentComplete","x1","y1","x2","y2","fontWeight","textAnchor","AnimatedHamburger","percentageComplete","setPercentageComplete","currentTicks","onComplete","animate","pct","duration","startTicks","getPercentComplete","_props$steps","steps","show","NavMenuComp","FloatingMenu","setStartTicks","NavBar","scrolledPastHeader","setScrolledPastHeader","isTouch","setIsTouch","onScroll","scrollTop","scrollY","Navbar","NavbarBrand","Logo","onTouchEnd","onMouseUp","Close","Menu","NotificationsMenu","UserMenu","scrollToTop","LoadingSplash","Breakpoints","isMobile","isTablet","isDesktop","minWidth","bp","nextBreakpoint","previousBreakpoint","breakpoint","getBreakpoint","innerWidth","currentBreakpoint","setCurrentBreakpoint","onResize","useBreakpoint","Container","Footer","AuthProvider","_userManager$current5","_userManager$current6","_userManager$current7","_userManager$current8","_userManager$current9","_userManager$current10","onUserLoaded","onUserUnloaded","onAccessTokenExpiring","_userManager$current","onAccessTokenExpired","_userManager$current2","onUserSignedOut","_userManager$current3","onSilentRenewError","_userManager$current4","events","addUserLoaded","addUserUnloaded","addAccessTokenExpiring","addAccessTokenExpired","addUserSignedOut","addSilentRenewError","_userManager$current11","_userManager$current12","_userManager$current13","_userManager$current14","_userManager$current15","_userManager$current16","removeUserLoaded","removeUserUnloaded","removeAccessTokenExpiring","removeAccessTokenExpired","removeUserSignedOut","removeSilentRenewError","Children","only","_i","_Object$entries","_Object$entries$_i","setProperty","_i2","_Object$entries2","_Object$entries2$_i","configure","initialised","initiailiseState","loadUserFromStorage","Layout","isLocalhost","Boolean","hostname","registerValidSW","swUrl","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","createBrowserHistory","ReactDOM","Router","App","getElementById","origin","contentType","ready","unregister","checkValidServiceWorker","registerServiceWorker"],"mappings":"24BAMYA,EAAa,SAAbA,GAAa,OAAbA,IAAa,qBAAbA,IAAa,6BAAbA,IAAa,uBAAbA,CAAa,MAiBZC,EAAiC,CAC1CC,iBAAkB,CAAC,aAAc,aAAc,eAC/CC,mBAAmB,GAGjBC,EAAuB,IAAIC,IAAkCJ,GAE7DK,EAAW,SAACC,GACd,IAAIC,EAAQC,OAAOC,OAAO,CAAC,EAAGN,EAAqBO,YAEnDJ,EAASC,GACTJ,EAAqBQ,KAAKJ,EAC9B,EAEaK,EAAmB,CAC5BC,UAAW,SAACR,GAAa,OAAKF,EAAqBU,UAAUR,EAAS,EACtES,QAAS,kBAAMX,EAAqBO,WAAWK,IAAI,EACnDC,QAAS,SAACD,GACFA,SACmBE,IAAfF,EAAKG,OAA6C,IAAtBH,EAAKG,MAAMC,OACvCJ,EAAKG,MAAQ,GAKgB,kBAAhBH,EAAKG,QAClBH,EAAKG,MAAQ,CAACH,EAAKG,QAGvBb,GAAS,SAAAE,GACLA,EAAMQ,KAAOA,CACjB,IAER,EACAK,WAAY,WACR,OAAOjB,EAAqBO,WAAWW,OAC3C,EACAC,WAAY,SAACD,GACThB,GAAS,SAAAE,GAAU,IAADgB,EACdhB,EAAMc,QAAUA,EAChBd,EAAML,kBAA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7G,OAAM,WACL9R,QAAQ4O,IACN,gEAEJ,GACJ,CAhEQmgH,CAAwBlB,GAGxBD,GAAgBC,EAEpB,GACF,CACF,CCbAmB,E","file":"static/js/main.26f2ceaf.chunk.js","sourcesContent":["import { BehaviorSubject } from 'rxjs';\r\nimport { User } from 'shared/models/site/user';\r\nimport { UserProfile } from 'shared/models/site/user-profile';\r\nimport { DocumentType } from \"shared/models/site/document-type\"\r\nimport { IRole } from '../models/api/models';\r\n\r\nexport enum SignedInState {\r\n Loading,\r\n NotSignedIn,\r\n SignedIn\r\n}\r\n\r\nexport type ApplicationState = {\r\n user?: User,\r\n profile?: UserProfile,\r\n signedInState?: SignedInState,\r\n railDocumentTypes?: DocumentType[],\r\n searchableRailDocumentTypes?: DocumentType[],\r\n writableRailDocumentTypes?: DocumentType[],\r\n backOfHouseRoles: string[],\r\n isBackOfHouseUser: boolean\r\n};\r\n\r\nexport const initialState: ApplicationState = {\r\n backOfHouseRoles: [\"BackOffice\", \"Supervisor\", \"SafeWorking\"],\r\n isBackOfHouseUser: false\r\n};\r\n\r\nconst documentStateSubject = new BehaviorSubject(initialState);\r\n\r\nconst setState = (updateFn: (appState: ApplicationState) => void) => {\r\n var state = Object.assign({}, documentStateSubject.getValue());;\r\n\r\n updateFn(state);\r\n documentStateSubject.next(state);\r\n};\r\n\r\nexport const applicationState = {\r\n subscribe: (setState: any) => documentStateSubject.subscribe(setState),\r\n getUser: () => documentStateSubject.getValue().user,\r\n setUser: (user?: User) => {\r\n if (user) {\r\n if (user.roles === undefined || user.roles.length === 0) {\r\n user.roles = [];\r\n }\r\n\r\n // user.roles is expected to be an array and will cause exceptions if a string is used instead of an array of strings\r\n // this happens if a single group is given to the user such as only having 'GeneralAccess'\r\n else if (typeof (user.roles) === 'string') {\r\n user.roles = [user.roles];\r\n }\r\n\r\n setState(state => {\r\n state.user = user;\r\n });\r\n }\r\n },\r\n getProfile: () => {\r\n return documentStateSubject.getValue().profile;\r\n },\r\n setProfile: (profile?: UserProfile) => {\r\n setState(state => {\r\n state.profile = profile;\r\n state.isBackOfHouseUser = profile?.roles.some(role => role.isBackOfHouseRole) ?? false;\r\n });\r\n },\r\n getSignedInState: () => documentStateSubject.getValue().signedInState,\r\n setSignedInState: (signedInState?: SignedInState) => {\r\n setState(state => { state.signedInState = signedInState; });\r\n }, \r\n setRailDocumentTypes: (documentTypes?: DocumentType[]) => {\r\n if (documentTypes) setState(state => { state.railDocumentTypes = documentTypes });\r\n },\r\n setSearchableRailDocumentTypes: (documentTypes?: DocumentType[]) => {\r\n let searchableTypes = documentTypes ?? [];\r\n const unsearchable = [\"operatingnoticesandinstructions\"];\r\n searchableTypes = searchableTypes.filter(t => !unsearchable.includes(t.key));\r\n if (searchableTypes) setState(state => { state.searchableRailDocumentTypes = searchableTypes });\r\n },\r\n setWritableRailDocumentTypes: (documentTypes?: DocumentType[]) => {\r\n if (documentTypes) setState(state => { state.writableRailDocumentTypes = documentTypes });\r\n }\r\n};","import { useEffect, useState } from \"react\";\r\nimport { ApplicationState, applicationState, initialState } from \"shared/store/applicationState\";\r\n\r\nexport default function useSelector(selector:(state: ApplicationState) => T ): T {\r\n const [val, setVal] = useState(initialState);\r\n\r\n useEffect(() => {\r\n var sub = applicationState.subscribe(setVal); \r\n return () => sub.unsubscribe();\r\n }, []);\r\n\r\n return selector(val);\r\n}\r\n","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgCheckBoxOutlined(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#01ab8b\",\n d: \"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgCheckBoxOutlined);\nexport default __webpack_public_path__ + \"static/media/check-box-outlined.894f407a.svg\";\nexport { ForwardRef as ReactComponent };","export const openInANewBrowser = (location: string) => {\r\n window.open(location, \"_blank\");\r\n};\r\n\r\nexport const numberSort = (a?: number | null, b?: number | null) => {\r\n if (!a && !b) return 0;\r\n\r\n // nulls first\r\n if (!a) return -1;\r\n if (!b) return 1;\r\n\r\n if (a < b) return -1;\r\n if (a > b) return 1;\r\n\r\n return 0;\r\n};\r\n\r\nexport const evalPath = (path: string, obj: any): any => {\r\n if (!obj) {\r\n return null;\r\n }\r\n\r\n const idx = path.indexOf('.');\r\n\r\n if (idx > -1) {\r\n const propertyName = path.substring(0, idx);\r\n\r\n if (!obj.hasOwnProperty(propertyName)) {\r\n console.warn(\"property not found - \" + propertyName);\r\n return propertyName + \" not found\";\r\n }\r\n\r\n return (evalPath(path.substring(idx + 1), obj[propertyName]));\r\n }\r\n\r\n if (!obj.hasOwnProperty(path)) {\r\n console.warn(\"property not found - \" + path);\r\n }\r\n\r\n return obj[path];\r\n};\r\n\r\nexport const stringSort = (a: string, b: string, ignoreCase: boolean = false) => {\r\n if (!a && !b) return 0;\r\n\r\n // nulls first\r\n if (!a) return -1;\r\n if (!b) return 1;\r\n\r\n const aVal = ignoreCase ? a.toLowerCase() : a;\r\n const bVal = ignoreCase ? b.toLowerCase() : b;\r\n\r\n if (aVal < bVal) return -1;\r\n if (aVal > bVal) return 1;\r\n\r\n return 0;\r\n};\r\n\r\nexport const dateSort = (a?: Date | null, b?: Date | null) => {\r\n if (!a && !b) return 0;\r\n\r\n // nulls first\r\n if (!a) return -1;\r\n if (!b) return 1;\r\n\r\n if (a < b) return -1;\r\n if (a > b) return 1;\r\n\r\n return 0;\r\n};\r\n\r\n","export enum DocumentTypeEnum {\r\n NetworkRules = 1,\r\n NetworkProcedures = 2,\r\n OperatingNoticesAndInstructions = 3,\r\n NetworkForms = 4,\r\n RailTrafficOperationsManual = 5,\r\n NetworkSignalsAndSignsManual = 6,\r\n Glossary = 7,\r\n GeneralRules = 10,\r\n RailTrafficOperations = 11,\r\n SignallingOperations = 12,\r\n WorkOnTrack = 13,\r\n OperatingNotices = 200,\r\n OperatingInstructions = 300,\r\n Memos = 400,\r\n RailControlOperatingInstructions = 500,\r\n TrackGeneralInstructions = 600,\r\n TrackEngineeringInstructions = 700,\r\n SignalingGeneralInstructions = 800,\r\n WorkInstructions = 900,\r\n OperatingManuals = 1000,\r\n ConsultationRulebook = 1001,\r\n ConsultationDocuments = 1002\r\n}\r\n\r\nexport const documentTypeDisplay = (val: DocumentTypeEnum | string | undefined) => {\r\n\r\n let type: DocumentTypeEnum = DocumentTypeEnum.NetworkRules;\r\n if (typeof (val) === 'number') {\r\n type = val;\r\n }\r\n if (typeof (val) === 'string') {\r\n type = parseInt(val);\r\n }\r\n\r\n let displayString = DocumentTypeEnum[type].replace(/([A-Z])/g, ' $1').trim()\r\n\r\n return displayString;\r\n}\r\n","import React, { ReactNode, useState } from 'react';\r\nimport { ArrowDownward, ArrowUpward, ExpandMore, ImportExport } from '@material-ui/icons';\r\nimport {\r\n DropdownMenu, DropdownToggle, Input, Label, UncontrolledDropdown\r\n} from 'reactstrap';\r\nimport { Grid, GridSize, Hidden } from '@material-ui/core';\r\nimport { Breakpoint } from '@material-ui/core/styles/createBreakpoints';\r\n\r\nexport const MobileBreakpoints = [\"xs\", \"sm\", \"md\"] as Breakpoint[];\r\nexport const DesktopBreakpoints = [\"lg\", \"xl\"] as Breakpoint[];\r\n\r\ninterface IPropsWithGridSizes { xs?: GridSize, sm?: GridSize, md?: GridSize, lg?: GridSize, xl?: GridSize };\r\ninterface IGridColProps extends IPropsWithGridSizes {\r\n hiddenBreakpoints?: Breakpoint | Breakpoint[],\r\n className?: string,\r\n children?: ReactNode,\r\n onClick?: () => void\r\n};\r\n\r\nexport const GridCol = (props: IGridColProps) => {\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n};\r\n\r\nexport interface ISortableGridColProps extends IGridColProps {\r\n fieldName: string,\r\n sortStyle: SortStyle,\r\n sortFn: (field: string, style: SortStyle) => void,\r\n sortConfig: ISortConfig | null\r\n}\r\n\r\nexport const SortableGridCol = (props: ISortableGridColProps) => {\r\n const colProps = props as IGridColProps;\r\n return (\r\n { props.sortFn(props.fieldName, props.sortStyle); }}>\r\n {props.children} \r\n \r\n );\r\n};\r\n\r\nexport const GridLabel = (props: { title: string, text: string }) => (\r\n
\r\n \r\n {props.title}\r\n \r\n \r\n {props.text}\r\n \r\n
\r\n);\r\n\r\nexport const SortArrow = (props: { fieldName: string, config: ISortConfig | null }) => {\r\n if (props.config && props.fieldName === props.config.fieldName && props.config.direction === SortOrder.DESC) {\r\n return (\r\n \r\n );\r\n }\r\n else if (props.config && props.fieldName === props.config.fieldName && props.config.direction === SortOrder.ASC) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const FilterArrow = (props: { text: string, filterItems: Array, onFilter: (items: Array) => void }) => {\r\n const [selectedItems, setSelectedItems] = useState([] as Array);\r\n\r\n const onToggle = (isOpen: boolean) => {\r\n if (isOpen) {\r\n // if w're closeing, then apply the filter\r\n props.onFilter(selectedItems);\r\n }\r\n };\r\n\r\n const filterItemCheck = (i: string): boolean => {\r\n return selectedItems.filter((item) => item === i).length > 0;\r\n };\r\n\r\n const filterItemChangeAll = () => {\r\n let arr: string[] = [];\r\n\r\n if (!filterItemCheck('All')) { //check all\r\n arr.push('All');\r\n props.filterItems.map(x => {\r\n arr.push(x);\r\n });\r\n }\r\n\r\n setSelectedItems(arr);\r\n };\r\n\r\n const toggleFilterItem = (itemtoToggle: string) => {\r\n const arr = selectedItems.map(x => x);\r\n\r\n const idx = arr.findIndex(x => x === itemtoToggle);\r\n\r\n if (idx > -1)\r\n arr.splice(idx, 1);\r\n else\r\n arr.push(itemtoToggle);\r\n\r\n setSelectedItems(arr);\r\n };\r\n\r\n const doNothing = () => { };\r\n\r\n return (\r\n { onToggle(o) }}>\r\n 0 ? \" filtered\" : \" unfiltered\")} caret>\r\n {props.text} {props.filterItems.length > 1 && }\r\n \r\n \r\n\r\n {props.filterItems.length > 0 &&\r\n
{ filterItemChangeAll(); }}>\r\n
\r\n \r\n \r\n
\r\n
\r\n }\r\n\r\n {props.filterItems.map((i, n) => (\r\n \r\n
\r\n
toggleFilterItem(i)}>\r\n
\r\n \r\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 interface ISortConfig {\r\n fieldName: string,\r\n direction: SortOrder,\r\n sortStyle: SortStyle,\r\n}\r\n\r\nexport type IFilterConfig = {\r\n filterItems: IFilterItem[]\r\n}\r\n\r\nexport type IPageConfig = {\r\n pageSize: number,\r\n currentPage: number,\r\n itemCount: number\r\n hidePageList?: boolean\r\n}\r\n\r\nexport type IFilterItem = {\r\n filterName: string,\r\n filterFn: (element: any, index: number, array: Array) => boolean,\r\n}\r\n\r\ntype ISortableDataItem = {\r\n items: Array,\r\n requestSort: (field: string, style: SortStyle, dir?: SortOrder | null) => void,\r\n sortConfig: ISortConfig | null,\r\n requestFilter: (key: string, x?: (element: T, index: number, array: Array) => boolean) => void,\r\n filterConfig: IFilterConfig | null,\r\n requestPage: (page: number, pageSize?: number) => void,\r\n pageConfig: IPageConfig | null;\r\n}\r\n\r\n// React hook to sort, filter and page tables\r\nconst useSortableData = (items: Array, sortConfig: ISortConfig | null, filterConfig: IFilterConfig | null, pageConfig: IPageConfig | null): ISortableDataItem => {\r\n const defaultPageSize = 15;\r\n\r\n // these getters and setters here have different names, not sure if that was intentional but should perhaps be changed for readability?\r\n const [sortConfigState, setSortConfig] = React.useState(sortConfig);\r\n const [filterConfigState, setFilterConfig] = React.useState(filterConfig);\r\n const [pageConfigState, setPageConfig] = React.useState((pageConfig || { pageSize: defaultPageSize, currentPage: 0, itemCount: items.length }) as IPageConfig);\r\n\r\n const sortedAndFilteredItems = React.useMemo(() => {\r\n let sortableItems = [...items];\r\n\r\n if (filterConfigState && filterConfigState.filterItems) {\r\n //console.log('filtering items');\r\n filterConfigState.filterItems.forEach(i => {\r\n sortableItems = sortableItems.filter(i.filterFn);\r\n });\r\n }\r\n\r\n var table = new DataTable(sortableItems);\r\n\r\n pageConfigState.itemCount = sortableItems.length;\r\n\r\n if (sortConfigState) {\r\n //console.log('sort requested ' + sortConfigState.fieldName + ' ' + sortConfigState.direction);\r\n if (sortConfigState.direction === SortOrder.ASC)\r\n table.asc(sortConfigState.fieldName, sortConfigState.sortStyle);\r\n else\r\n table.desc(sortConfigState.fieldName, sortConfigState.sortStyle);\r\n };\r\n\r\n //pageSize of -1 is special case to specify no paging is to be used\r\n //pageSize of 0 isn't really valid and will always return nothing\r\n if (pageConfigState.pageSize < 1) {\r\n return table.getAll();\r\n }\r\n\r\n return table.getFrom(pageConfigState.currentPage * pageConfigState.pageSize, pageConfigState.pageSize)\r\n },\r\n [items, sortConfigState, filterConfigState, pageConfigState]);\r\n\r\n const requestSort = (fieldName: string, sortStyle: SortStyle, dir?: SortOrder | null) => {\r\n let direction = dir ?? SortOrder.ASC;\r\n\r\n if (dir === undefined && sortConfigState && sortConfigState.fieldName === fieldName && sortConfigState.direction === SortOrder.ASC) {\r\n direction = SortOrder.DESC;\r\n }\r\n\r\n setSortConfig({ fieldName, direction, sortStyle } as ISortConfig);\r\n }\r\n\r\n const requestFilter = (key: string, filterFn?: (element: T, index: number, array: Array) => boolean) => {\r\n let arrFilterItems: Array = [];\r\n\r\n if (filterConfigState) {\r\n let filterConfig = (filterConfigState as IFilterConfig);\r\n if (filterConfig.filterItems) {\r\n arrFilterItems = filterConfig.filterItems?.filter(x => x.filterName !== key);\r\n }\r\n }\r\n\r\n arrFilterItems.push({ filterName: key, filterFn } as IFilterItem);\r\n setFilterConfig({ filterItems: arrFilterItems });\r\n }\r\n\r\n const requestPage = (page: number, pageSize?: number) => {\r\n setPageConfig(() => ({ currentPage: page, pageSize: pageSize || pageConfig?.pageSize || defaultPageSize, itemCount: items.length }));\r\n }\r\n\r\n return {\r\n items: sortedAndFilteredItems,\r\n requestSort,\r\n sortConfig: sortConfigState,\r\n requestFilter,\r\n filterConfig: filterConfigState,\r\n requestPage,\r\n pageConfig: pageConfigState\r\n };\r\n}\r\n\r\n// using default export here as exporting inline was causing react errors\r\nexport default useSortableData;\r\n\r\n\r\nexport enum SortStyle {\r\n String,\r\n Numeric,\r\n CaseSensitiveString\r\n}\r\n\r\nexport enum SortOrder {\r\n ASC,\r\n DESC\r\n}\r\n\r\nexport class SortArgument {\r\n\r\n public key: string | null = null;\r\n public order: SortOrder = SortOrder.ASC;\r\n public style: SortStyle = SortStyle.String;\r\n\r\n constructor(key: string | null = null, order: SortOrder = SortOrder.ASC, style: SortStyle = SortStyle.String) {\r\n this.key = key;\r\n this.order = order;\r\n this.style = style;\r\n }\r\n\r\n private numericCompare(valueA: number, valueB: number): number {\r\n if (valueA === valueB) {\r\n return 0;\r\n }\r\n return (this.order == SortOrder.ASC) ? valueA - valueB : valueB - valueA;\r\n }\r\n\r\n private stringCompare(valueA: string, valueB: string): number {\r\n if (valueA === valueB) {\r\n return 0;\r\n }\r\n return (this.order == SortOrder.ASC) ? ((valueA < valueB) ? -1 : 1) : ((valueA < valueB) ? 1 : -1);\r\n }\r\n\r\n private eval(path: string, obj: any): any {\r\n if (!obj) {\r\n return null;\r\n }\r\n\r\n const idx = path.indexOf('.');\r\n\r\n if (idx > -1) {\r\n const propertyName = path.substring(0, idx);\r\n\r\n if (!obj.hasOwnProperty(propertyName)) {\r\n console.warn(\"property not found - \" + propertyName);\r\n return propertyName + \" not found\";\r\n }\r\n\r\n return (this.eval(path.substring(idx + 1), obj[propertyName]));\r\n }\r\n\r\n if (!obj.hasOwnProperty(path)) {\r\n console.warn(\"property not found - \" + path);\r\n }\r\n\r\n return obj[path];\r\n };\r\n\r\n public compare(a: any, b: any): number {\r\n if (a === null && b === null) return 0;\r\n if (a === null) return -1;\r\n if (b === null) return 1;\r\n\r\n // Get values to compare\r\n if (this.key && (this.key.indexOf(\".\") > -1)) {\r\n a = this.eval(this.key, a);\r\n b = this.eval(this.key, b);\r\n } else {\r\n a = (DataTable.isObject(a) && this.key ? a[this.key] : a);\r\n b = (DataTable.isObject(b) && this.key ? b[this.key] : b);\r\n }\r\n\r\n if (a === null && b === null) return 0;\r\n if (a === null) return -1;\r\n if (b === null) return 1;\r\n\r\n // Numeric sort\r\n if (this.style == SortStyle.Numeric) {\r\n return this.numericCompare(\r\n Number(a),\r\n Number(b)\r\n );\r\n }\r\n // Case-insensitive string sort\r\n else if (this.style == SortStyle.String) {\r\n return this.stringCompare(\r\n a.toLocaleString().toLocaleLowerCase(),\r\n b.toLocaleString().toLocaleLowerCase()\r\n );\r\n }\r\n // Case-sensitive string sort\r\n else if (this.style === SortStyle.CaseSensitiveString) {\r\n return this.stringCompare(\r\n a.toLocaleString(),\r\n b.toLocaleString()\r\n );\r\n }\r\n return 0;\r\n }\r\n\r\n}\r\n\r\nexport class DataTable {\r\n\r\n private items: Array = [];\r\n\r\n private sortBy: Array = [];\r\n\r\n constructor(items: Array) {\r\n this.items = items || [];\r\n }\r\n\r\n public static isObject(item: any): boolean {\r\n return (item instanceof Object);\r\n }\r\n\r\n private sorter(table: DataTable) {\r\n return (a: any, b: any) => {\r\n let val: number = 0;\r\n if (table.sortBy.length > 0) {\r\n table.sortBy.some(\r\n (sortField: SortArgument) => {\r\n val = sortField.compare(a, b);\r\n // If we got a value then break out\r\n return (val != 0);\r\n }\r\n );\r\n }\r\n return val || 0;\r\n }\r\n };\r\n\r\n private static matches(row: any, key: string, pattern: any) {\r\n let value = DataTable.isObject(row) ? row[key] : row;\r\n // Regular expression compare\r\n if (pattern instanceof RegExp) {\r\n if (pattern.test(value.toString())) {\r\n return true;\r\n }\r\n }\r\n // Equality\r\n else if (value == pattern) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private sort(): DataTable {\r\n if (this.sortBy.length > 0) {\r\n this.items.sort(this.sorter(this));\r\n }\r\n return this;\r\n }\r\n\r\n add(row: any): DataTable {\r\n this.items.push(row);\r\n return this;\r\n }\r\n\r\n public remove(index: number): DataTable {\r\n this.items = this.items.splice(index, 1);\r\n return this;\r\n }\r\n\r\n public getSort(): Array {\r\n return this.sortBy;\r\n }\r\n\r\n public clear(): DataTable {\r\n this.items = [];\r\n return this;\r\n }\r\n\r\n public clearSort(): DataTable {\r\n this.sortBy = [];\r\n return this;\r\n }\r\n\r\n public asc(fieldName: string, style: SortStyle = SortStyle.String): DataTable {\r\n this.sortBy.push(\r\n new SortArgument(fieldName, SortOrder.ASC, style)\r\n );\r\n return this;\r\n }\r\n\r\n public desc(fieldName: string, style: SortStyle = SortStyle.String): DataTable {\r\n this.sortBy.push(\r\n new SortArgument(fieldName, SortOrder.DESC, style)\r\n );\r\n return this;\r\n }\r\n\r\n public getFirst(n: number): Array {\r\n return this.getAll().slice(0, n);\r\n }\r\n\r\n public getLast(n: number): Array {\r\n return this.getAll().slice(n * -1);\r\n }\r\n\r\n public getFrom(offset: number, limit: number): Array {\r\n return this.getAll().slice(offset, (offset + limit));\r\n }\r\n\r\n public getAll(): Array {\r\n return this.sort().items;\r\n }\r\n\r\n public filter(key: string, pattern: any): DataTable {\r\n this.items = this.search(key, pattern);\r\n return this;\r\n }\r\n\r\n public search(key: string, pattern: any): Array {\r\n let matching: Array = [];\r\n this.sort().items.forEach(row => {\r\n if (DataTable.matches(row, key, pattern)) {\r\n matching.push(row);\r\n }\r\n });\r\n return matching;\r\n }\r\n\r\n public indexOf(key: string, pattern: any): number {\r\n let index = 0,\r\n firstMatch: number = -1;\r\n this.sort().items.some(row => {\r\n if (DataTable.matches(row, key, pattern)) {\r\n firstMatch = index;\r\n return true;\r\n }\r\n index++;\r\n return false;\r\n });\r\n return firstMatch;\r\n }\r\n\r\n public lastIndexOf(key: string, pattern: any): number {\r\n let index: number = 0,\r\n lastMatch: number = -1;\r\n this.sort().items.forEach(row => {\r\n if (DataTable.matches(row, key, pattern)) {\r\n lastMatch = index;\r\n }\r\n index++;\r\n });\r\n return lastMatch;\r\n }\r\n}","export enum DocumentStatusEnum {\r\n Current = 1,\r\n Archived = 2,\r\n Expired = 3,\r\n Rescinded = 4,\r\n Deleted = 5,\r\n DeletedFull = 6\r\n}\r\n","\r\ntype AppSettings = {\r\n api: {\r\n portalApi: string,\r\n webSite: string,\r\n },\r\n identityServer: string,\r\n userAdminLink: string,\r\n environmentIndicator: string,\r\n installAppLink?: string\r\n}\r\n\r\n\r\n\r\n\r\nconst mobileDev: AppSettings = {\r\n api: {\r\n portalApi: \"https://it-bhp-rail-portal-api-pov.azurewebsites.net\",\r\n webSite: \"https://it-bhp-rail-portal-web-pov.azurewebsites.net\",\r\n },\r\n identityServer: \"https://it-bhp-rail-identityserver-web-pov.azurewebsites.net\",\r\n userAdminLink: \"https://it-bhp-rail-identityserver-web-pov.azurewebsites.net/Identity/admin/\",\r\n environmentIndicator: \" (DEV)\"\r\n};\r\n\r\n\r\nconst dev: AppSettings = {\r\n api: {\r\n portalApi: \"https://localhost:44326\",\r\n webSite: \"https://localhost:44355\",\r\n },\r\n identityServer: \"https://localhost:5001\",\r\n userAdminLink: \"https://localhost:5001/Identity/admin/\",\r\n environmentIndicator: \" (DEV)\",\r\n installAppLink: \"/app/\"\r\n};\r\n\r\nconst povenv: AppSettings = {\r\n api: {\r\n portalApi: \"https://it-bhp-rail-portal-api-pov.azurewebsites.net\",\r\n webSite: \"https://it-bhp-rail-portal-web-pov.azurewebsites.net\",\r\n },\r\n identityServer: \"https://it-bhp-rail-identityserver-web-pov.azurewebsites.net\",\r\n userAdminLink: \"https://it-bhp-rail-identityserver-web-pov.azurewebsites.net/Identity/admin/\",\r\n environmentIndicator: \" (DEV)\",\r\n installAppLink: \"/app/\"\r\n};\r\n\r\nconst sitenv: AppSettings = {\r\n api: {\r\n portalApi: \"https://rail-portal-api-sit.bhp.com\",\r\n webSite: \"https://rail-test.bhp.com\",\r\n },\r\n identityServer: \"https://rail-identityserver-web-sit.bhp.com\",\r\n userAdminLink: \"https://rail-identityserver-web-sit.bhp.com/Identity/admin/\",\r\n environmentIndicator: \" (TEST)\",\r\n installAppLink: \"/app/\"\r\n};\r\n\r\nconst npenv: AppSettings = {\r\n api: {\r\n portalApi: \"https://rail-portal-api-np.bhp.com\",\r\n webSite: \"https://rail-qa.bhp.com\",\r\n },\r\n identityServer: \"https://rail-identityserver-web-np.bhp.com\",\r\n userAdminLink: \"https://rail-identityserver-web-np.bhp.com/Identity/admin/\",\r\n environmentIndicator: \" (QA)\",\r\n installAppLink: \"/app/\"\r\n};\r\n\r\nconst prodenv: AppSettings = {\r\n api: {\r\n portalApi: \"https://rail-portal-api.bhp.com\",\r\n webSite: \"https://rail.bhp.com\",\r\n },\r\n identityServer: \"https://rail-identityserver-web.bhp.com\",\r\n userAdminLink: \"https://rail-identityserver-web.bhp.com/Identity/admin/\",\r\n environmentIndicator: \"\",\r\n installAppLink: \"/app/\"\r\n};\r\n\r\n// Reference the API location based upon an environment variable. This variable should be set up deployment of the app service\r\n\r\nlet appSettings = dev;\r\nlet env = process.env.REACT_APP_Env || process.env.NODE_ENV;\r\n\r\n\r\n\r\nif (env === \"development\") appSettings = mobileDev;\r\nif (env === \"webdevelopment\") appSettings = dev;\r\nif (env === \"povenv\") appSettings = povenv;\r\nif (env === \"sitenv\") appSettings = sitenv;\r\nif (env === \"npenv\") appSettings = npenv;\r\nif (env === \"prodenv\") appSettings = prodenv;\r\n\r\n\r\n// TODO change back when released to production. This is for mobile app as haven't been able to get set the environment manually\r\nif (env === \"production\") appSettings = npenv;\r\n\r\nexport const getPortalApi = (apiPath: string) => `${appSettings.api.portalApi}${apiPath}`;\r\n\r\nexport default appSettings;","import { User } from \"shared/models/site/user\";\r\n\r\nimport { User as OIDCUser } from 'oidc-client';\r\n\r\n\r\n\r\nexport const userMapper = {\r\n mapFromOIDCUser: (oidcUser: OIDCUser): User => ({\r\n name: oidcUser.profile.name,\r\n roles: oidcUser.profile.role,\r\n expires_in: oidcUser.expires_in,\r\n access_token: oidcUser.access_token\r\n })\r\n}","import { UserManager, WebStorageStateStore, UserManagerSettings } from 'oidc-client';\r\nimport { User } from 'shared/models/site/user';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport { userMapper } from 'overrides/mapping/user-mapping'\r\n\r\nconst config = {\r\n authority: appSettings.identityServer,\r\n client_id: \"portalWeb\",\r\n redirect_uri: `${ appSettings.api.webSite }/signin-oidc`,\r\n response_type: \"code\",\r\n scope: \"openid profile roles\",\r\n post_logout_redirect_uri: `${ appSettings.api.webSite }/signout-oidc`,\r\n filterProtocolClaims: true,\r\n loadUserInfo: true,\r\n automaticSilentRenew: true,\r\n silent_redirect_uri: `${ appSettings.api.webSite }/silent-auth`,\r\n monitorSession: false,\r\n userStore: new WebStorageStateStore({ store: window.localStorage })\r\n};\r\n\r\n// this will proxy the methods on the underlying platform's OIDC implementation, giving access to a standard user model\r\n// proxy additional methods as needed by implement them in the mobile app too\r\n\r\n\r\n\r\nclass UserManagerProxy {\r\n private userManager: UserManager;\r\n readonly accessTokenExpiringNotificationTime: number;\r\n\r\n constructor(settings: UserManagerSettings) {\r\n this.userManager = new UserManager(settings)\r\n this.accessTokenExpiringNotificationTime = this.userManager?.settings?.accessTokenExpiringNotificationTime as number;\r\n }\r\n\r\n getUser = async (): Promise => {\r\n const oidcUser = await this.userManager.getUser();\r\n if (oidcUser) {\r\n return userMapper.mapFromOIDCUser(oidcUser);\r\n }\r\n return null;\r\n\r\n }\r\n\r\n signinRedirectCallback = async (): Promise => {\r\n const oidcUser = await this.userManager.signinRedirectCallback();\r\n if (oidcUser) {\r\n return userMapper.mapFromOIDCUser(oidcUser);\r\n }\r\n return null;\r\n }\r\n\r\n signinSilent = async (): Promise => {\r\n const oidcUser = await this.userManager.signinSilent();\r\n if (oidcUser) {\r\n return userMapper.mapFromOIDCUser(oidcUser);\r\n }\r\n return null;\r\n }\r\n\r\n clearStaleState = () => this.userManager.clearStaleState();\r\n removeUser = () => this.userManager.removeUser();\r\n signoutRedirect = () => this.userManager.signoutRedirect();\r\n signinRedirect = () => this.userManager.signinRedirect();\r\n signoutRedirectCallback = () => this.userManager.signoutRedirectCallback();\r\n signinSilentCallback = () => this.userManager.signinSilentCallback();\r\n\r\n getProxiedObject = () => this.userManager;\r\n}\r\n\r\nexport default new UserManagerProxy(config);\r\n\r\n\r\n\r\n\r\n","import { signinRedirect, getToken } from 'overrides/api';\r\nimport { applicationState } from 'shared/store/applicationState';\r\n\r\nexport type BlobType = {\r\n blob: Blob,\r\n fileName: string\r\n}\r\n\r\nexport async function getAuthHeader() {\r\n const token = await getToken();\r\n\r\n return {\r\n Authorization: `Bearer ${ token }`\r\n }\r\n}\r\n\r\nconst getHeaderValue = (headers: Headers, key: string) => {\r\n if (!headers) {\r\n return null;\r\n }\r\n\r\n var header = headers.get(key);\r\n\r\n if (!header) {\r\n return null;\r\n }\r\n\r\n if (header.indexOf(\"=\") > -1) {\r\n return (header.split(\";\")[1].trim().split(\"=\")[1]).replace(/\"/g, '');\r\n } else {\r\n return (header.split(\"=\")[1]).replace(/\"/g, '');\r\n }\r\n}\r\n\r\nexport const httpDownloadAs = async (\r\n url: string,\r\n method: string,\r\n data: any = null\r\n): Promise => {\r\n const authHeaders = await getAuthHeader();\r\n\r\n var fetchParams = {\r\n method: method ?? \"POST\",\r\n headers: {\r\n \"content-type\": \"application/json\",\r\n \"response-type\": \"application/*\",\r\n \"authorization\": authHeaders.Authorization\r\n }\r\n } as any;\r\n\r\n if (data != null) {\r\n fetchParams = { ...fetchParams, body: JSON.stringify(data) };\r\n }\r\n\r\n const response = await fetch(url, fetchParams);\r\n\r\n if (response) {\r\n console.log(response);\r\n const blob = await response.blob();\r\n\r\n return {\r\n blob: blob,\r\n fileName: getHeaderValue(response.headers, \"content-disposition\") ?? \"untitled.csv\"\r\n };\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const httpPost = async(request: string, data?: any): Promise => http(request, 'POST', data);\r\nexport const httpGet = async(request: string, data?: any): Promise => http(request, 'GET');\r\nexport const httpPut = async(request: string, data?: any): Promise => http(request, 'PUT', data);\r\nexport const httpDelete = async(request: string, data?: any): Promise => http(request, 'DELETE', data);\r\n\r\nexport const http = async (\r\n request: string,\r\n method: string,\r\n data?: any\r\n): Promise => {\r\n const response = await http_fetch(request, method, (data ? JSON.stringify(data) : null));\r\n\r\n const body = await response.json();\r\n\r\n return body;\r\n};\r\n\r\nconst http_fetch = async (\r\n request: string,\r\n method: string,\r\n data?: any\r\n): Promise => {\r\n const authHeaders = await getAuthHeader();\r\n\r\n const response = await fetch(request, {\r\n method: method,\r\n headers: {\r\n \"content-type\": \"application/json\",\r\n \"authorization\": authHeaders.Authorization\r\n },\r\n body: data\r\n });\r\n\r\n if (response.status == 401) {\r\n applicationState.setUser(undefined);\r\n signinRedirect();\r\n }\r\n\r\n return response;\r\n};","import { http, httpGet, httpPut, httpPost } from 'shared/services/httpService';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport { UserProfile } from 'shared/models/site/user-profile';\r\nimport {\r\n AdminUserModel,\r\n AdminUserListRequest,\r\n AdminUserSetStatusRequest,\r\n IRole,\r\n IUserSearchResult,\r\n PagedResult\r\n} from 'shared/models/api/models';\r\n\r\nconst basePath = '/api/user/';\r\n\r\nconst fullyQualifiedAndEncodedURL = (relativeUri: string) => {\r\n return new URL(basePath + encodeURI(relativeUri), appSettings.api.portalApi).toString();\r\n};\r\n\r\nconst userManagementRoot = fullyQualifiedAndEncodedURL(\"user-management\");\r\n\r\nexport const searchUserByName = async (searchText: string, pageSize: number): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`search/${searchText}/${pageSize}`).toString()}`);\r\n}\r\n\r\nexport const searchEmployeeByName = async (searchText: string, pageSize: number): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`employee/search/${searchText}/${pageSize}`).toString()}`);\r\n}\r\n\r\nexport const searchSupervisorByName = async (searchText: string, pageSize: number): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`supervisor/search/${searchText}/${pageSize}`).toString()}`);\r\n}\r\n\r\n\r\nexport const getAllEmployees = async (): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`employees`).toString()}`);\r\n}\r\n\r\nexport const getAllUsers = async (): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`allUsers`).toString()}`);\r\n}\r\n\r\nexport const getAllSupervisors = async (): Promise> => {\r\n return await httpGet>(`${fullyQualifiedAndEncodedURL(`supervisors`).toString()}`);\r\n}\r\n\r\n\r\nconst getCurrentUserProfilePath = () => { return fullyQualifiedAndEncodedURL('portalweb/profile') };\r\n\r\nexport const getUserProfile = async () => {\r\n return await http(getCurrentUserProfilePath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting user profile')\r\n console.log(e);\r\n return undefined;\r\n });\r\n};\r\n\r\nexport const getAllRoles = async () => {\r\n return await httpGet(`${fullyQualifiedAndEncodedURL(\"allRoles\").toString()}`);\r\n}\r\n\r\nexport const userAdminApi = {\r\n listAsync: async (req: AdminUserListRequest) =>\r\n await httpPost(`${userManagementRoot}/list`, req),\r\n getAsync: async (userId: number) =>\r\n await httpGet(`${userManagementRoot}/get/${userId}`),\r\n addAsync: async (user: AdminUserModel) =>\r\n await httpPut(`${userManagementRoot}/add`, user),\r\n updateAsync: async (user: AdminUserModel) =>\r\n await httpPost(`${userManagementRoot}/update`, user),\r\n setStatus: async (req: AdminUserSetStatusRequest) =>\r\n await httpPost(`${userManagementRoot}/setStatus/`, req)\r\n};","import { applicationState, SignedInState } from 'shared/store/applicationState'\r\nimport { useLocation } from 'react-router-dom'\r\nimport userManager from 'overrides/user-manager';\r\nimport { waitForUserLoad } from 'overrides/api';\r\nimport { getUserProfile } from \"shared/services/userApi\";\r\nimport { UserProfile } from 'shared/models/site/user-profile';\r\n\r\n\r\nexport async function loadUserFromStorage() {\r\n try {\r\n applicationState.setSignedInState(SignedInState.Loading);\r\n let user = await userManager.getUser();\r\n\r\n if (user?.expires_in as number < userManager.accessTokenExpiringNotificationTime || !user) {\r\n try {\r\n console.log('trying to sign in silently');\r\n user = await userManager.signinSilent();\r\n }\r\n catch (e: any) {\r\n if (e?.t0?.error === 'login_required' || e?.error === 'login_required') {\r\n if (window?.location?.pathname) {\r\n sessionStorage.setItem(\"pre-login-route\", window.location.pathname);\r\n }\r\n signinRedirect()\r\n return;\r\n }\r\n throw (e);\r\n }\r\n }\r\n\r\n if (!user) {\r\n applicationState.setSignedInState(SignedInState.NotSignedIn);\r\n throw ('User not found')\r\n }\r\n\r\n applicationState.setUser(user);\r\n applicationState.setSignedInState(SignedInState.SignedIn);\r\n }\r\n catch (e) {\r\n console.error(`User not found: ${ e }`);\r\n }\r\n}\r\n\r\nexport async function loadUserProfile() {\r\n try {\r\n await waitForUserLoad();\r\n\r\n var profile = undefined as undefined | UserProfile;\r\n\r\n let user = applicationState.getUser();\r\n\r\n if (user !== undefined && (user.roles === undefined || user.roles.length < 1)) {\r\n profile = {\r\n roles: [] as any[]\r\n } as UserProfile;\r\n applicationState.setProfile(profile);\r\n return;\r\n }\r\n\r\n profile = await getUserProfile();\r\n\r\n if (profile) {\r\n applicationState.setProfile(profile);\r\n }\r\n }\r\n catch (e) {\r\n console.error(`User profile not loaded: ${ e }`);\r\n }\r\n finally {\r\n if (!profile) {\r\n // Profile is required, keep trying\r\n setTimeout(() => { loadUserProfile(); }, 1000);\r\n console.error('User Profile not found, retrying..');\r\n }\r\n }\r\n\r\n}\r\n\r\nexport function signinRedirectCallback() {\r\n return userManager.signinRedirectCallback()\r\n .then(user => {\r\n applicationState.setUser(user || undefined);\r\n return user;\r\n })\r\n .catch(e => {\r\n console.log(e)\r\n });\r\n}\r\n\r\nexport function signoutRedirect() {\r\n userManager.clearStaleState();\r\n userManager.removeUser();\r\n return userManager.signoutRedirect();\r\n}\r\n\r\nexport function signoutRedirectCallback() {\r\n userManager.clearStaleState();\r\n userManager.removeUser();\r\n return userManager.signoutRedirectCallback();\r\n}\r\n\r\nexport function signinSilentCallback() {\r\n return userManager.signinSilentCallback();\r\n}\r\n\r\nexport const signinRedirect = () => {\r\n try {\r\n const location = useLocation();\r\n if (typeof (location?.pathname) === 'string') {\r\n sessionStorage.setItem(\"pre-login-route\", location.pathname);\r\n }\r\n }\r\n catch { }\r\n\r\n userManager.signinRedirect();\r\n}\r\nexport default userManager;\r\n","import { signinRedirect as sr } from 'shared/services/userService';\r\nimport { applicationState, SignedInState } from 'shared/store/applicationState'\r\n\r\nexport const signinRedirect = sr;\r\n\r\nexport async function getToken() {\r\n let user = await getUser();\r\n return user.access_token;\r\n}\r\n\r\n// Wait period and retries only relates to loading the user from local storage\r\n// Unrelated to getting user from the network or other network API requrests\r\nconst retryWaitPeriod = 100;\r\nconst maxRetries = 9;\r\n\r\n// Do not return until we have a valid user or have retried the maximum amount\r\n// Returning right away without a valid user and token will cause any request sent to the server to fail\r\n// Letting exceptions go uncaught should prevent unnecessary network requests being sent by consumers of getToken()\r\nasync function getUser() {\r\n await waitForUserLoad();\r\n let user = applicationState.getUser();\r\n\r\n var retry = 1;\r\n while (typeof (user?.access_token) !== \"string\") {\r\n retry++;\r\n await blockWait(retryWaitPeriod);\r\n user = applicationState.getUser();\r\n if (retry > maxRetries) {\r\n throw new Error(\"Timeout waiting for user access token\");\r\n }\r\n }\r\n\r\n return user;\r\n}\r\n\r\n// Waiting is typically only needed when the application has first loaded\r\n// Without waiting there are intermittent race conditions where requests may be sent before the user has loaded resulting in 401 responses\r\nexport async function waitForUserLoad() {\r\n let state = applicationState.getSignedInState();\r\n let retry = 0;\r\n\r\n while (state == undefined || state == SignedInState.Loading) {\r\n retry++;\r\n await blockWait(retryWaitPeriod);\r\n state = applicationState.getSignedInState();\r\n if (retry > maxRetries) {\r\n throw new Error(\"Timeout waiting for expected user loading state\");\r\n }\r\n }\r\n}\r\n\r\nfunction blockWait(ms: number) {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n","import appSettings from 'shared/settings/appSettings';\r\nimport {\r\n RailDocument,\r\n DocumentType,\r\n NewDocument,\r\n DocumentHistory,\r\n Notifications,\r\n RailDocumentPendingActions,\r\n DocumentComment,\r\n DocumentSearchQuery,\r\n DocumentSearchResult,\r\n DocumentSearchReplaceSuggestion\r\n} from '../models/api/models';\r\nimport { signinRedirect, getToken } from 'overrides/api';\r\nimport { applicationState } from 'shared/store/applicationState';\r\nimport { httpDelete, httpPost, httpPut } from 'shared/services/httpService';\r\nimport { PagedResult } from '../models/api/models';\r\n\r\nconst documentUriPath = new URL('/api/documents', appSettings.api.portalApi);\r\nconst writableDocumentUriSuffixPath = '/writable';\r\nconst rulebookDocumentUriSuffixPath = '/rulebook';\r\nconst railDocumentUriSuffixPath = '/rail';\r\nconst documentViewedUriSuffixPath = '/view';\r\nconst documentAcknowledgedUriSuffixPath = '/acknowledge';\r\nconst documentClarifyUriSuffixPath = '/clarify';\r\nconst documentFeedbackUriSuffixPath = '/feedback';\r\nconst documentHistoryUriSuffixPath = '/history';\r\n\r\nexport const documentFilePath = new URL('/api/document-files', appSettings.api.portalApi);\r\nexport const staticFilePath = new URL('/api/document-files/static', appSettings.api.portalApi);\r\nconst documentTypesPath = new URL('/api/document-types', appSettings.api.portalApi);\r\nconst writableDocumentTypesPath = new URL('/api/document-types/writable', appSettings.api.portalApi);\r\nconst rescindDocumentPath = new URL('/api/documents/rescind', appSettings.api.portalApi);\r\nconst deleteDocumentPath = new URL('/api/documents/delete', appSettings.api.portalApi);\r\nconst permanentlyDeleteDocumentPath = new URL('/api/documents/full-delete', appSettings.api.portalApi);\r\nconst restoreDocumentPath = new URL('/api/documents/restore', appSettings.api.portalApi);\r\nconst notificationsUriPath = new URL('/api/notifications', appSettings.api.portalApi);\r\nconst testUriPath = new URL('/api/test', appSettings.api.portalApi);\r\nconst validateDocumentPath = new URL('/api/documents/validate', appSettings.api.portalApi);\r\n\r\nconst myDocumentsUri = `${documentUriPath}/current-user/myDocuments`;\r\nconst actionableDocumentsUri = `${documentUriPath}/current-user/actionable`;\r\nconst allNotifiedDocumentsUri = `${documentUriPath}/current-user/allnotified`;\r\n\r\n// TODO if this is used in mobile app it will need to be overridden\r\nconst convertModelToFormData = (model: any, form: FormData | null = null, namespace = ''): FormData => {\r\n let formData = form || new FormData();\r\n\r\n for (let propertyName in model) {\r\n if (!model.hasOwnProperty(propertyName) || !model[propertyName]) continue;\r\n let formKey = namespace ? `${namespace}[${propertyName}]` : propertyName;\r\n if (model[propertyName] instanceof Date)\r\n formData.append(formKey, model[propertyName].toISOString());\r\n else if (model[propertyName] instanceof Array) {\r\n model[propertyName].forEach((element: any, index: number) => {\r\n formData.append(formKey, model[propertyName][index]);\r\n });\r\n }\r\n else if (typeof model[propertyName] === 'object' && !(model[propertyName] instanceof File))\r\n convertModelToFormData(model[propertyName], formData, formKey);\r\n else if (model[propertyName] instanceof File)\r\n formData.append(formKey, model[propertyName]);\r\n else\r\n formData.append(formKey, model[propertyName].toString());\r\n }\r\n\r\n return formData;\r\n}\r\n\r\nexport interface DocumentLists {\r\n toAcknowledge: RailDocument[];\r\n}\r\n\r\nexport interface MyDocuments {\r\n toAcknowledge: RailDocument[];\r\n}\r\n\r\n\r\n\r\nexport const getActionableDocuments = async () => {\r\n const result = await http(`${actionableDocumentsUri.toString()}`).catch((e) => {\r\n console.log(e);\r\n }) as RailDocument[];\r\n\r\n return result;\r\n};\r\n\r\n/* Documents Apis */\r\nexport const getMyDocuments = async (pageSize: number = -1, pageNumber: number = 1) => {\r\n return await http>(`${myDocumentsUri.toString()}/${pageSize}/${pageNumber}`).catch((e) => {\r\n console.log(e);\r\n }) as PagedResult;\r\n};\r\n\r\nexport const getAllNotifiedDocuments = async () => {\r\n return await http(`${allNotifiedDocumentsUri.toString()}`).catch((e) => {\r\n console.log(e);\r\n }) as RailDocument[];\r\n}\r\n\r\nconst handleError = (e: any, msg: string) => {\r\n console.log(msg);\r\n console.log(e);\r\n};\r\n\r\nexport const getRulebookDocuments =\r\n async () => await http(`${documentUriPath.toString()}${rulebookDocumentUriSuffixPath}`)\r\n .then(e => {\r\n return e;\r\n })\r\n .catch((e) => {\r\n console.log('error getting all documents')\r\n console.log(e);\r\n }) as RailDocument[];\r\n\r\nexport const getRailDocuments =\r\n async () => await http(`${documentUriPath.toString()}${railDocumentUriSuffixPath}`)\r\n .then(e => {\r\n return e;\r\n })\r\n .catch((e) => {\r\n console.log('error getting all documents')\r\n console.log(e);\r\n }) as RailDocument[];\r\n\r\nexport const getAllWritableDocuments =\r\n async () => await http(`${documentUriPath.toString()}${writableDocumentUriSuffixPath}`)\r\n .then(e => {\r\n return e;\r\n })\r\n .catch((e) => {\r\n console.log('error getting all documents')\r\n console.log(e);\r\n }) as RailDocument[];\r\n\r\nexport const getPdfBytes = async (docId: string) => {\r\n const pdfResponse = await http_response(`${documentFilePath}/${docId}`)\r\n .catch(e => { console.log(e); return {} as Response });\r\n return pdfResponse.arrayBuffer();\r\n}\r\n\r\nexport const getStaticFileBytes = async (filename: string) => {\r\n const fileResponse = await http_response(`${staticFilePath}/${filename}`)\r\n .catch(e => { console.log(e); return {} as Response });\r\n return fileResponse.arrayBuffer();\r\n}\r\n\r\nexport async function getAllDocumentTypes(): Promise {\r\n return await http(documentTypesPath.toString()).catch(() => []);\r\n}\r\n\r\nexport async function getWritableDocumentTypes(): Promise {\r\n return await http(writableDocumentTypesPath.toString()).catch(() => []);\r\n}\r\n\r\nexport const getRailDocumentTypes = async () => {\r\n const docTypes = await getAllDocumentTypes().catch((e) => { console.log(e); return [] });\r\n const filteredDocTypes = docTypes.filter((x: DocumentType) => x.documentModuleId !== 1);\r\n return filteredDocTypes;\r\n};\r\n\r\nexport const getDocument = async (id: number) => {\r\n return await http(`${documentUriPath.toString()}/${id}`)\r\n .catch(e => { console.log(e); return {} as RailDocument });\r\n}\r\n\r\nexport const getDocumentHistory = async (id: number) => {\r\n return await http(`${documentUriPath.toString()}/${id}${documentHistoryUriSuffixPath}`)\r\n .catch(e => { console.log(e); return {} as DocumentHistory[] });\r\n}\r\n\r\nexport async function setDocumentViewed(id: number): Promise {\r\n const header = await getAuthHeader();\r\n const response = await fetch(`${documentUriPath.toString()}/${id}${documentViewedUriSuffixPath}`, {\r\n method: 'PUT',\r\n headers: header,\r\n });\r\n const pendingActions = await response.json();\r\n return pendingActions;\r\n}\r\n\r\nexport async function setDocumentAcknowledged(id: number): Promise {\r\n const header = await getAuthHeader();\r\n const response = await fetch(`${documentUriPath.toString()}/${id}${documentAcknowledgedUriSuffixPath}`, {\r\n method: 'PUT',\r\n headers: header\r\n });\r\n const success = await response.text() === 'true';\r\n return success;\r\n}\r\n\r\nexport async function setDocumentClarification(id: number, comment: DocumentComment): Promise {\r\n const header = await getAuthHeader();\r\n const formData = convertModelToFormData(comment);\r\n const response = await fetch(`${documentUriPath.toString()}/${id}${documentClarifyUriSuffixPath}`, {\r\n method: 'PUT',\r\n body: formData,\r\n headers: header\r\n });\r\n const success = await response.text() === 'true';\r\n return success;\r\n}\r\n\r\nexport async function setDocumentFeedback(id: number, comment: DocumentComment): Promise {\r\n const header = await getAuthHeader();\r\n const formData = convertModelToFormData(comment);\r\n const response = await fetch(`${documentUriPath.toString()}/${id}${documentFeedbackUriSuffixPath}`, {\r\n method: 'PUT',\r\n body: formData,\r\n headers: header\r\n });\r\n const success = await response.text() === 'true';\r\n return success;\r\n}\r\n\r\nexport interface IDocumentValidationRequest {\r\n id?: number,\r\n //TODO: refactor ViewType enum so we can use it as a paramter type\r\n viewType: number,\r\n pageNumber: number,\r\n document: NewDocument\r\n}\r\n\r\nexport interface IDictonary {\r\n [name: string]: T\r\n}\r\n\r\nexport interface IDocumentValidationResponse {\r\n errors: IDictonary\r\n}\r\n\r\nconst mapDocumentValidationRequestForPost = (req: IDocumentValidationRequest) => {\r\n if (!req.document.file) {\r\n return req;\r\n }\r\n\r\n // make a copy of the the document\r\n req.document = { ...req.document };\r\n\r\n // remove the file property\r\n delete req.document.file;\r\n\r\n // return the request\r\n return req;\r\n};\r\n\r\nexport const validateDocument = async (req: IDocumentValidationRequest) => {\r\n return httpPost(validateDocumentPath.toString(), mapDocumentValidationRequestForPost(req));\r\n}\r\n\r\nexport const addDocument = async (document: NewDocument) => {\r\n //https://stackoverflow.com/questions/35192841/how-do-i-post-with-multipart-form-data-using-fetch\r\n const formData = convertModelToFormData(document);\r\n\r\n const response = await fetch(documentUriPath.toString(), {\r\n method: 'POST',\r\n body: formData,\r\n headers: await getAuthHeader(),\r\n });\r\n return response;\r\n}\r\n\r\nexport const editDocument = async (id: number, document: NewDocument) => {\r\n const formData = convertModelToFormData(document);\r\n\r\n const header = await getAuthHeader();\r\n const response = await fetch(`${documentUriPath.toString()}/${id}`, {\r\n method: 'PUT',\r\n body: formData,\r\n headers: header,\r\n\r\n });\r\n return response;\r\n}\r\n\r\nexport const rescindDocument = async (id: number, document: NewDocument) => {\r\n const formData = convertModelToFormData(document);\r\n const uri = `${rescindDocumentPath.toString()}/${id}`;\r\n console.log('attempting to put document to ' + uri);\r\n const headers = await getAuthHeader();\r\n const response = await fetch(uri, {\r\n method: 'PUT',\r\n body: formData,\r\n headers: headers,\r\n });\r\n return response;\r\n}\r\n\r\nexport const deleteDocument = async (id: number) => {\r\n const headers = await getAuthHeader();\r\n const response = await fetch(`${deleteDocumentPath.toString()}/${id}`, {\r\n method: 'PATCH',\r\n headers: headers,\r\n });\r\n}\r\n\r\nexport const permanentDeleteDocument = async (id: number) => {\r\n const headers = await getAuthHeader();\r\n const response = await fetch(`${permanentlyDeleteDocumentPath.toString()}/${id}`, {\r\n method: 'DELETE',\r\n headers: headers,\r\n });\r\n}\r\n\r\nexport const restoreDocument = async (id: number) => {\r\n const headers = await getAuthHeader();\r\n const response = await fetch(`${restoreDocumentPath.toString()}/${id}`, {\r\n method: 'PATCH',\r\n headers: headers,\r\n });\r\n return response;\r\n}\r\n\r\n\r\n/* Notifications Api */\r\nexport const getNotifications = async () => {\r\n return await http(`${notificationsUriPath.toString()}`)\r\n .catch(e => { console.log(e); return {} as Notifications });\r\n}\r\n\r\nexport const getMobileNotifications = async () => {\r\n return await http(`${notificationsUriPath.toString()}/mobile`)\r\n .catch(e => { console.log(e); return {} as Notifications });\r\n}\r\n\r\n\r\n/* Favourite Api */\r\nexport const updateFavouriteFlagAsync =\r\n async (documentId: number, selected: boolean) =>\r\n await http(`${documentUriPath.toString()}/updateFavouriteFlag/${documentId}/${selected}`)\r\n .catch(e => handleError(e, \"error setting favourite\")) as number;\r\n\r\nexport const setFavouriteFlagsAsync = async (ids: number[]) => {\r\n return await httpPost(`${documentUriPath.toString()}/setFavouriteFlags`, ids);\r\n};\r\n\r\n/* Search Api */\r\nexport async function documentSearch(query: DocumentSearchQuery): Promise {\r\n const headers = await getAuthHeader();\r\n const formData = convertModelToFormData(query);\r\n\r\n const uri = `${documentUriPath.toString()}/search`;\r\n\r\n const response = await fetch(uri, {\r\n method: 'POST',\r\n body: formData,\r\n headers: headers,\r\n });\r\n\r\n const results = await response.json();\r\n return results;\r\n}\r\n\r\nexport async function documentSearchReplaceSuggestions(): Promise {\r\n const headers = await getAuthHeader();\r\n const uri = `${documentUriPath.toString()}/searchReplaceSuggestions`;\r\n\r\n const response = await fetch(uri, {\r\n method: 'GET',\r\n headers: headers,\r\n });\r\n\r\n const results = await response.json();\r\n return results;\r\n}\r\n\r\nexport async function addSearchReplaceSuggestion(suggestion: DocumentSearchReplaceSuggestion): Promise {\r\n const uri = `${documentUriPath.toString()}/addSearchReplaceSuggestion`;\r\n const response = await httpPost(uri, suggestion);\r\n return response;\r\n}\r\n\r\nexport async function editSearchReplaceSuggestion(suggestion: DocumentSearchReplaceSuggestion): Promise {\r\n const uri = `${documentUriPath.toString()}/editSearchReplaceSuggestion`;\r\n const response = await httpPut(uri, suggestion);\r\n return response;\r\n}\r\n\r\nexport async function deleteSearchReplaceSuggestion(suggestionIds: number[]): Promise {\r\n const uri = `${documentUriPath.toString()}/deleteSearchReplaceSuggestions`;\r\n const response = await httpDelete(uri, suggestionIds);\r\n return response;\r\n}\r\n\r\n/* Test Api */\r\nexport const sendTestNotification = async (model: any) => {\r\n const formData = convertModelToFormData(model);\r\n const headers = await getAuthHeader();\r\n const response = await fetch(`${testUriPath.toString()}/send`, {\r\n method: 'POST',\r\n body: formData,\r\n headers: headers,\r\n });\r\n return response;\r\n}\r\n\r\nexport async function getAuthHeader() {\r\n const token = await getToken();\r\n\r\n return {\r\n Authorization: `Bearer ${token}`\r\n }\r\n}\r\n\r\nasync function http(\r\n request: string\r\n): Promise {\r\n console.log('http ' + request)\r\n const response = await http_response(request);\r\n const body = await response.json();\r\n return body;\r\n}\r\n\r\nasync function http_response(\r\n request: string\r\n): Promise {\r\n const headers = await getAuthHeader();\r\n console.log\r\n const response = await fetch(request, {\r\n headers: headers\r\n });\r\n\r\n if (response.status == 401) {\r\n applicationState.setUser(undefined);\r\n signinRedirect();\r\n }\r\n return response;\r\n}\r\n","var _defs, _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgFolder(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"folder-24px_1_\",\n \"data-name\": \"folder-24px (1)\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4125\",\n \"data-name\": \"Path 4125\",\n className: \"cls-1\",\n d: \"M0,0H18V18H0Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4126\",\n \"data-name\": \"Path 4126\",\n d: \"M8,4H3.5A1.5,1.5,0,0,0,2.007,5.5L2,14.5A1.5,1.5,0,0,0,3.5,16h12A1.5,1.5,0,0,0,17,14.5V7a1.5,1.5,0,0,0-1.5-1.5h-6Z\",\n transform: \"translate(-0.5 -1)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgFolder);\nexport default __webpack_public_path__ + \"static/media/folder.7bda117a.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgStatusExpired(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"alarm-24px\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4285\",\n \"data-name\": \"Path 4285\",\n className: \"cls-1\",\n d: \"M0,0H24V24H0Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4286\",\n \"data-name\": \"Path 4286\",\n d: \"M22,5.72,17.4,1.86,16.11,3.39l4.6,3.86ZM7.88,3.39,6.6,1.86,2,5.71,3.29,7.24,7.88,3.39ZM12.5,8H11v6l4.75,2.85.75-1.23-4-2.37ZM12,4a9,9,0,1,0,9,9A9,9,0,0,0,12,4Zm0,16a7,7,0,1,1,7-7A6.995,6.995,0,0,1,12,20Z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgStatusExpired);\nexport default __webpack_public_path__ + \"static/media/status-expired.45a94c0f.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgStatusExpiredFolder(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 34.5,\n height: 34.5,\n viewBox: \"0 0 34.5 34.5\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1{fill:none}\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"icon_Expired\",\n transform: \"translate(-806 -1237)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Rectangle_1838\",\n d: \"M0 0H34.5V34.5H0z\",\n className: \"cls-1\",\n transform: \"translate(806 1237)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"icon_pending_review\",\n transform: \"translate(807.569 1240.726)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Subtraction_1\",\n d: \"M0 27.052V2.7A2.706 2.706 0 0 1 2.7 0h21.649a2.706 2.706 0 0 1 2.7 2.7v7.232a8.117 8.117 0 0 0-9.734 11.71H5.41L0 27.051z\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"alarm-24px\",\n transform: \"translate(17.837 10.649)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4285\",\n d: \"M0 0h14.375v14.375H0z\",\n className: \"cls-1\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4286\",\n d: \"M13.979 4.172L11.224 1.86l-.773.916 2.755 2.312zm-8.457-1.4l-.767-.912L2 4.166l.773.916zm2.767 2.766h-.9v3.593l2.845 1.707.449-.737-2.4-1.42zm-.3-2.4a5.391 5.391 0 1 0 5.391 5.394 5.391 5.391 0 0 0-5.39-5.39zm0 9.583a4.193 4.193 0 1 1 4.193-4.193 4.19 4.19 0 0 1-4.192 4.197z\",\n transform: \"translate(-0.802 -0.746)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgStatusExpiredFolder);\nexport default __webpack_public_path__ + \"static/media/status-expired-folder.3d44205c.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _path;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgActionFieldsOutlined(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n height: \"24px\",\n viewBox: \"0 0 24 24\",\n width: \"24px\",\n fill: \"#000000\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n fill: \"none\",\n height: 24,\n width: 24\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22,5.18L10.59,16.6l-4.24-4.24l1.41-1.41l2.83,2.83l10-10L22,5.18z M12,20c-4.41,0-8-3.59-8-8s3.59-8,8-8 c1.57,0,3.04,0.46,4.28,1.25l1.45-1.45C16.1,2.67,14.13,2,12,2C6.48,2,2,6.48,2,12s4.48,10,10,10c1.73,0,3.36-0.44,4.78-1.22 l-1.5-1.5C14.28,19.74,13.17,20,12,20z M19,15h-3v2h3v3h2v-3h3v-2h-3v-3h-2V15z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgActionFieldsOutlined);\nexport default __webpack_public_path__ + \"static/media/action-fields-outlined.602d2322.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgStatusDeleted(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h30v30H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.429 24.333A2.775 2.775 0 0 0 9.286 27h11.428a2.775 2.775 0 0 0 2.857-2.667v-16H6.429zM25 4.333h-5L18.571 3h-7.142L10 4.333H5V7h20z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgStatusDeleted);\nexport default __webpack_public_path__ + \"static/media/status-deleted.f23aa179.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgStatusCurrent(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"folder-24px_1_\",\n \"data-name\": \"folder-24px (1)\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4125\",\n \"data-name\": \"Path 4125\",\n className: \"cls-1\",\n d: \"M0,0H18V18H0Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4126\",\n \"data-name\": \"Path 4126\",\n d: \"M8,4H3.5A1.5,1.5,0,0,0,2.007,5.5L2,14.5A1.5,1.5,0,0,0,3.5,16h12A1.5,1.5,0,0,0,17,14.5V7a1.5,1.5,0,0,0-1.5-1.5h-6Z\",\n transform: \"translate(-0.5 -1)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgStatusCurrent);\nexport default __webpack_public_path__ + \"static/media/status-current.7bda117a.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRailDocsFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-103.999 -1362.001) translate(103.999 1362.001)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.523 6.677h4.992a.314.314 0 0 0 .235-.523L26.523.927a.314.314 0 0 0-.523.22v5.007a.523.523 0 0 0 .523.523z\",\n transform: \"translate(-103.999 -1362.001) translate(106.068 1362.5) translate(-12.409 -.404)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.5 7.841V.523A.523.523 0 0 0 10.977 0H.523A.523.523 0 0 0 0 .523v21.954A.523.523 0 0 0 .523 23h18.818a.523.523 0 0 0 .523-.523V8.886a.523.523 0 0 0-.523-.523h-7.318a.523.523 0 0 1-.523-.522z\",\n transform: \"translate(-103.999 -1362.001) translate(106.068 1362.5)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRailDocsFilled);\nexport default __webpack_public_path__ + \"static/media/rail-docs-filled.0b328115.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgDocRecentlyAcknowledgedFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.34 20l-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 14.34zM12 17a6.992 6.992 0 0 1 10-6.32V4a2.006 2.006 0 0 0-2-2H4a2.006 2.006 0 0 0-2 2v18l4-4h6a4.193 4.193 0 0 1 .03-.5A4.07 4.07 0 0 1 12 17z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgDocRecentlyAcknowledgedFilled);\nexport default __webpack_public_path__ + \"static/media/doc-recently-acknowledged-filled.3cd95aed.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRdMemo(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 33.438,\n height: 26.838,\n viewBox: \"0 0 33.438 26.838\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M56.523 25.332a.907.907 0 0 0-.9-.011c-5.957 3.31-13.275 5.036-23.03 5.432a.907.907 0 0 0-.871.907v9.4a.907.907 0 0 0 .871.907c9.755.4 17.072 2.122 23.03 5.432a.908.908 0 0 0 1.348-.793V26.114a.906.906 0 0 0-.448-.782z\",\n transform: \"translate(-14.197 -25.207) translate(14.197 25.207) translate(-23.532 -25.207)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.76 37.171a5.563 5.563 0 1 0 0 11.126.907.907 0 0 0 .908-.907v-9.311a.907.907 0 0 0-.908-.908z\",\n transform: \"translate(-14.197 -25.207) translate(14.197 25.207) translate(-14.197 -31.58)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.077 65.281a1.149 1.149 0 0 0-1.031-.778l-2.122-.1a1.148 1.148 0 0 0-1.149 1.5l1.905 6.228a1.148 1.148 0 0 0 1.092.794h2.2a1.149 1.149 0 0 0 1.058-1.6z\",\n transform: \"translate(-14.197 -25.207) translate(14.197 25.207) translate(-23.531 -46.083)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRdMemo);\nexport default __webpack_public_path__ + \"static/media/rd-memo.7ae4f542.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g, _g2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRdOperatingManuals(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"menu_book_black_24dp\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2658\",\n \"data-name\": \"Group 2658\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_1983\",\n \"data-name\": \"Rectangle 1983\",\n className: \"cls-1\",\n width: 24,\n height: 24\n }))), _g2 || (_g2 = /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2661\",\n \"data-name\": \"Group 2661\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2660\",\n \"data-name\": \"Group 2660\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4478\",\n \"data-name\": \"Path 4478\",\n d: \"M21,5a11.8,11.8,0,0,0-3.5-.5A9.3,9.3,0,0,0,12,6,9.3,9.3,0,0,0,6.5,4.5,9.3,9.3,0,0,0,1,6V20.65a.538.538,0,0,0,.5.5c.1,0,.15-.05.25-.05A12.205,12.205,0,0,1,6.5,20,9.3,9.3,0,0,1,12,21.5,12.045,12.045,0,0,1,17.5,20a10.178,10.178,0,0,1,4.75,1.05.451.451,0,0,0,.25.05.538.538,0,0,0,.5-.5V6A6.821,6.821,0,0,0,21,5Zm0,13.5a11.62,11.62,0,0,0-3.5-.5A12.045,12.045,0,0,0,12,19.5V8a12.045,12.045,0,0,1,5.5-1.5A11.62,11.62,0,0,1,21,7Z\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2659\",\n \"data-name\": \"Group 2659\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4479\",\n \"data-name\": \"Path 4479\",\n d: \"M17.5,10.5a11.694,11.694,0,0,1,2.5.26V9.24A13.5,13.5,0,0,0,17.5,9a11.507,11.507,0,0,0-4.5.83v1.66A9.283,9.283,0,0,1,17.5,10.5Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4480\",\n \"data-name\": \"Path 4480\",\n d: \"M13,12.49v1.66a9.283,9.283,0,0,1,4.5-.99,11.694,11.694,0,0,1,2.5.26V11.9a13.5,13.5,0,0,0-2.5-.24A11.691,11.691,0,0,0,13,12.49Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4481\",\n \"data-name\": \"Path 4481\",\n d: \"M17.5,14.33a11.507,11.507,0,0,0-4.5.83v1.66a9.283,9.283,0,0,1,4.5-.99,11.694,11.694,0,0,1,2.5.26V14.57A12.7,12.7,0,0,0,17.5,14.33Z\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRdOperatingManuals);\nexport default __webpack_public_path__ + \"static/media/rd-operating-manuals.575d30e4.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRdWins(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 21.061,\n height: 29.029,\n viewBox: \"0 0 21.061 29.029\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.734 16.891a2.073 2.073 0 0 0-1.173-1.4L34.07 11.74l1.187-3.293a.646.646 0 0 0-.208-.717.678.678 0 0 0-.771-.057l-4.129 2.414a11.246 11.246 0 0 0-4.585 5.13 15.866 15.866 0 0 0-1.435 6.26 19.429 19.429 0 0 0 1.385 7.695H38.07s.326-2.547-.251-3.555l-2.834-4.94.38.126a1.582 1.582 0 0 0 .5.079 1.621 1.621 0 0 0 1.22-.549 1.317 1.317 0 0 1 1.435-.38l2.009.692a2.063 2.063 0 0 0 .674.111 2.091 2.091 0 0 0 1.528-.678l.66-.717a2.041 2.041 0 0 0 .488-1.847z\",\n transform: \"translate(-20.637 -7.578) translate(20.637 7.578) translate(-22.873 -7.578)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.561 69.82a.631.631 0 0 0-.588.664v2.023h-.746a.628.628 0 0 0-.588.664v2.687a.628.628 0 0 0 .588.664h16.5a.628.628 0 0 0 .588-.664V73.17a.628.628 0 0 0-.588-.664h-.775v-2.022a.631.631 0 0 0-.588-.664z\",\n transform: \"translate(-20.637 -7.578) translate(20.637 7.578) translate(-20.637 -47.492)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRdWins);\nexport default __webpack_public_path__ + \"static/media/rd-wins.ba748676.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbOperatingNotices(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-139.001 -1387) translate(139.001 1387)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M61.067 10.824l-1.155-1.155a.577.577 0 0 0-.816 0L52.169 16.6A.577.577 0 0 0 52 17v1.155a.577.577 0 0 0 .577.577h1.154a.577.577 0 0 0 .408-.169l6.927-6.927a.577.577 0 0 0 .001-.812z\",\n transform: \"translate(-139.001 -1387) translate(-1402.392 831.032) translate(1502.545 547.5)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.5 25.074a1.732 1.732 0 0 1-1.225.507h-1.73a1.155 1.155 0 0 1-1.155-1.155V22.7a1.731 1.731 0 0 1 .507-1.224l3.97-3.976h-14.29a.577.577 0 0 0-.577.577v18.468a.577.577 0 0 0 .577.577h17.318a.577.577 0 0 0 .577-.577V21.101zm-10.46-4.111h2.31a.577.577 0 0 1 0 1.155h-2.309a.577.577 0 0 1 0-1.155zm0 3.464h2.31a.577.577 0 0 1 0 1.155h-2.309a.577.577 0 0 1 0-1.155zm10.391 8.082h-10.39a.577.577 0 0 1 0-1.155h10.39a.577.577 0 0 1 0 1.155zm0-3.464h-10.39a.577.577 0 0 1 0-1.155h10.39a.577.577 0 0 1 0 1.155z\",\n transform: \"translate(-139.001 -1387) translate(-1402.392 831.032) translate(1531 541.809)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbOperatingNotices);\nexport default __webpack_public_path__ + \"static/media/rb-operating-notices.c8ec8c46.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNetworkRules(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-31 -1387) translate(31 1387)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.106 13.686h13.74v-3.053H9.106zM9.106 3v3.053h13.74V3zm0 18.319h13.74v-3.053H9.106zM3 13.686h3.053v-3.053H3zM3 3v3.053h3.053V3zm0 18.319h3.053v-3.053H3z\",\n transform: \"translate(-31 -1387) translate(30 1387)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNetworkRules);\nexport default __webpack_public_path__ + \"static/media/rb-network-rules.467fb8fa.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNetworkProcs(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-114 -1391.001) translate(114 1391.001)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.191 5h8.794v1.956h-8.794zm0 5.379h8.794v1.956h-8.794zm0 5.379h8.794v1.956h-8.794zM2 11.357c0 3.5 3.21 6.357 7.145 6.357h.55v1.956l3.3-2.934-3.3-2.936v1.956h-.55a4.7 4.7 0 0 1-4.947-4.4 4.7 4.7 0 0 1 4.947-4.4h3.847V5H9.145C5.21 5 2 7.856 2 11.357z\",\n transform: \"translate(-114 -1391.001) translate(113 1391.001)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNetworkProcs);\nexport default __webpack_public_path__ + \"static/media/rb-network-procs.c066e929.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNetworkRulesForms(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.068 7.673l-4.11-4.11L8 14.523v4.11h4.11zm3.238-3.238a1.1 1.1 0 0 0 0-1.551L23.748.326a1.1 1.1 0 0 0-1.551 0l-2.142 2.142 4.11 4.11z\",\n transform: \"translate(-1543 -690) translate(1537.082 689.998)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\",\n transform: \"translate(-1543 -690) translate(1543 690)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#838a8e\",\n d: \"M0 40h24v4.384H0z\",\n transform: \"translate(-1543 -690) translate(1543 669.617)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNetworkRulesForms);\nexport default __webpack_public_path__ + \"static/media/rb-network-rules-forms.db2421e4.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbOperationsManual(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-220 -1385.999) translate(220 1385.999)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H21.871V6.999H0z\",\n transform: \"translate(-220 -1385.999) translate(-1318 568.001) translate(1538.875 825.937)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.6 14H2v1.2h1.2v1.2a1.2 1.2 0 0 0 2.4 0H8a1.2 1.2 0 1 0 2.4 0v-1.2h7.2v1.2a1.2 1.2 0 0 0 2.4 0h2.4a1.2 1.2 0 1 0 2.4 0v-1.2H26V14h-8.4z\",\n transform: \"translate(-220 -1385.999) translate(-1318 568.001) translate(1536 820)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.2 5.2L10.8 4 6 6.4h14.4L15.6 4z\",\n transform: \"translate(-220 -1385.999) translate(-1318 568.001) translate(1536.8 818)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbOperationsManual);\nexport default __webpack_public_path__ + \"static/media/rb-operations-manual.c8b98d09.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbSignalling(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-252 -1392.001) translate(252 1392.001)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.829 14.59a2.148 2.148 0 1 0 2.166 2.147 2.156 2.156 0 0 0-2.166-2.147zm6.5 2.147a6.5 6.5 0 1 0-9.752 5.573l1.094-1.868a4.337 4.337 0 1 1 4.321-.005l1.091 1.863a6.409 6.409 0 0 0 3.244-5.563zM14.829 6a10.712 10.712 0 0 0-5.42 20.019l1.083-1.858a8.609 8.609 0 1 1 13-7.425 8.576 8.576 0 0 1-4.326 7.43l1.083 1.858A10.716 10.716 0 0 0 14.829 6z\",\n transform: \"translate(-252 -1392.001) translate(249 1387.999)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbSignalling);\nexport default __webpack_public_path__ + \"static/media/rb-signalling.de358ea3.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbGlossary(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-168 -1386.999) translate(168 1386.999)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.824 34.141H2.638A1.64 1.64 0 0 0 1 35.779v7.185A1.64 1.64 0 0 0 2.638 44.6h7.186a1.64 1.64 0 0 0 1.638-1.638v-7.183a1.64 1.64 0 0 0-1.638-1.638zm1.068 8.824a1.069 1.069 0 0 1-1.068 1.068H2.638a1.069 1.069 0 0 1-1.068-1.068v-7.186a1.069 1.069 0 0 1 1.068-1.068h7.186a1.069 1.069 0 0 1 1.068 1.068v7.185z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(0 -20.584)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.47 42.959a1.1 1.1 0 0 0 .775-1.137c0-.781-.527-1.393-1.86-1.393h-2.048v5.263h2.3c1.37 0 1.9-.673 1.9-1.461a1.257 1.257 0 0 0-1.067-1.272zm-2.244-1.709h1.137c.566 0 .956.147.956.708q0 .655-.964.655h-1.129V41.25zm1.393 3.622h-1.393v-1.439h1.28q1.122 0 1.122.7c0 .602-.403.738-1.009.738z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(-6.034 -24.647)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.99 12.75a1.64 1.64 0 0 0 1.638-1.638V3.926a1.64 1.64 0 0 0-1.638-1.638H19.8a1.64 1.64 0 0 0-1.638 1.638v7.186A1.64 1.64 0 0 0 19.8 12.75h7.19zm-8.254-1.638V3.926A1.069 1.069 0 0 1 19.8 2.858h7.19a1.069 1.069 0 0 1 1.068 1.068v7.186a1.069 1.069 0 0 1-1.068 1.068H19.8a1.069 1.069 0 0 1-1.064-1.068z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(-11.093)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.532 12.642h2.635l.527 1.2h.949l-2.319-5.266h-.949l-2.319 5.263h.949zm1.318-2.989l.957 2.169h-1.913z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(-15.545 -4.063)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M44.252 34.141h-7.185a1.64 1.64 0 0 0-1.638 1.638v7.185a1.64 1.64 0 0 0 1.638 1.636h7.186a1.64 1.64 0 0 0 1.638-1.638v-7.183a1.64 1.64 0 0 0-1.639-1.638zm1.068 8.824a1.069 1.069 0 0 1-1.068 1.068h-7.185A1.069 1.069 0 0 1 36 42.965v-7.186a1.069 1.069 0 0 1 1.068-1.068h7.186a1.069 1.069 0 0 1 1.068 1.068v7.185z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(-22.248 -20.584)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.3 40.94a1.941 1.941 0 0 1 1.5.648l.565-.617a2.648 2.648 0 0 0-2.044-.9 2.7 2.7 0 0 0-2.827 2.741 2.742 2.742 0 0 0 4.8 1.785l-.572-.587a1.954 1.954 0 0 1-1.484.647 1.832 1.832 0 0 1-1.815-1.879A1.8 1.8 0 0 1 46.3 40.94z\",\n transform: \"translate(-168 -1386.999) translate(167.679 1385.712) translate(-27.456 -24.413)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbGlossary);\nexport default __webpack_public_path__ + \"static/media/rb-glossary.993f9814.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbRulebookFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-53.001 -1369) translate(53.001 1369)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.643 3.464a.822.822 0 0 1 .821-.821h15.607v18.071h1.643V1H4.464A2.465 2.465 0 0 0 2 3.464v18.072A2.465 2.465 0 0 0 4.464 24h13.965V4.286H4.464a.822.822 0 0 1-.821-.822z\",\n transform: \"translate(-53.001 -1369) translate(53.143 1367.5) translate(0 1)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbRulebookFilled);\nexport default __webpack_public_path__ + \"static/media/rb-rulebook-filled.776683d9.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNrGeneralRules(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n opacity: 0.2,\n transform: \"translate(-937 -1003) translate(937 1003)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.127 3.564V2H0v18.762h9.7a5.838 5.838 0 0 1-1.865-3.909H3.127v-.782h4.715a5.832 5.832 0 0 1 .658-2.345H3.127v-.782H9a5.848 5.848 0 0 1 7.419-1.666V2H13.29v1.564h-.782V2h-2.345v1.564h-.782V2H7.036v1.564h-.782V2H3.909v1.564zM13.29 10.6H3.127v-.782H13.29zm0-3.909v.782H3.127v-.782z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(0 -.436)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H0.782V1.564H0z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(3.127)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H0.782V1.564H0z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(6.254)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H0.782V1.564H0z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(9.381)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H0.782V1.564H0z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(12.508)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.081 14a5.081 5.081 0 1 0 5.081 5.081A5.081 5.081 0 0 0 16.081 14zm-1.105 7.569l-2.212-2.211.553-.553 1.658 1.658 3.87-3.869.553.553z\",\n transform: \"translate(-937 -1003) translate(940.01 1004.488) translate(-2.401 -3.055)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNrGeneralRules);\nexport default __webpack_public_path__ + \"static/media/rb-nr-general-rules.b99db299.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNrRailTrafficOperations(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-85 -1494) translate(85 1494)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.492 25.668l-.742-1.585h.65l-.455-.987h-.67l-.622-1.332h.765l-.455-.987h-.789l-.529-1.077 2.536-1.562v-7.51l-.909-1.4.048-2.274S33.415 5 27.961 5 22.6 6.952 22.6 6.952l.048 2.274-.909 1.4v7.487l2.416 1.493-.55 1.171h-1.05l-.455.987h1.029l-.622 1.336h-1.052l-.455.984h1.029l-.742 1.585h1.148l.742-1.562h9.449l.742 1.585h1.124zm-1.866-8.451a.694.694 0 1 1-.694-.666.653.653 0 0 1 .694.666zM28.775 6.148s2.344.253 3.158 1.033V9.2l-3.158-.712zm-.813 3.9a.919.919 0 1 1-.957.919.941.941 0 0 1 .956-.915zM23.823 7.2c.813-.781 3.158-1.033 3.158-1.033v2.37l-3.158.712zm0 10.013a.694.694 0 1 1 .694.666.681.681 0 0 1-.694-.662zM25.115 20h5.55l.383.781h-6.316zm1.053 3.1h-2.537l.622-1.332h7.224L32.1 23.1z\",\n transform: \"translate(-85 -1494) translate(69 1491)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNrRailTrafficOperations);\nexport default __webpack_public_path__ + \"static/media/rb-nr-rail-traffic-operations.85823e45.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNrSignallingOperations(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-117 -1496) translate(117 1496)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.566 9.318c-2.505 0-4.536 1.753-4.536 3.914v10.781c0 2.161 2.031 3.914 4.536 3.914s4.534-1.753 4.534-3.914V13.232c0-2.161-2.029-3.914-4.534-3.914zm0 16.474a2 2 0 1 1 2.07-2 2.034 2.034 0 0 1-2.07 2zm0-5.174a2 2 0 1 1 2.07-2 2.034 2.034 0 0 1-2.07 2zm0-5.174a2 2 0 1 1 2.071-2 2.035 2.035 0 0 1-2.071 2z\",\n transform: \"translate(-117 -1496) translate(116.082 1494) translate(7.917 4) translate(-12.083 -8.333)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.4 4c-3.028 0-5.483 1.938-5.483 4.328v11.923c0 2.392 2.455 4.329 5.483 4.329s5.483-1.937 5.483-4.329V8.328C18.883 5.938 16.428 4 13.4 4zm4.715 15.741c0 2.187-2.115 3.959-4.715 3.959s-4.715-1.772-4.715-3.958V8.838c0-2.186 2.115-3.958 4.715-3.958s4.715 1.772 4.715 3.958z\",\n transform: \"translate(-117 -1496) translate(116.082 1494) translate(7.917 4) translate(-7.917 -4)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNrSignallingOperations);\nexport default __webpack_public_path__ + \"static/media/rb-nr-signalling-operations.c6e1fac4.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRbNrWorkOnTrack(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-141.001 -1496) translate(141.001 1496)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M53.093 24.562h-1.772L50.26 22h1.783a.366.366 0 0 1 .318.183l1.05 1.83a.366.366 0 0 1-.318.549z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-30.723 -13.234)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.2 22l-1.065 2.562H1.363a.366.366 0 0 1-.318-.549l1.05-1.83A.366.366 0 0 1 2.414 22z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-.996 -13.234)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.8 24.562h-8.73L18.78 22h7.309l.055.194z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-11.068 -13.234)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M47.944 13.83h-1.076L46.11 12h1.2a.366.366 0 0 1 .318.183l.63 1.1a.366.366 0 0 1-.318.549z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-28.092 -7.245)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.077 12l-.761 1.83H8.243a.366.366 0 0 1-.318-.549l.63-1.1A.366.366 0 0 1 8.873 12z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-5.358 -7.245)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.7 13.83h-6.3l.505-1.83h5.285z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-13.179 -7.245)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.493 13.719h-1.215a.742.742 0 0 1-.706-.575l-.459-1.777-.713-2.744L36.306.5a.414.414 0 0 1 .06-.342.358.358 0 0 1 .292-.158h.366a.367.367 0 0 1 .34.243l3.247 8.38 1.065 2.744.491 1.267a.832.832 0 0 1-.067.735.721.721 0 0 1-.608.35z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-21.868)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.422.5l-2.1 8.125-.71 2.744-.459 1.777a.742.742 0 0 1-.706.575h-1.21a.72.72 0 0 1-.609-.349.832.832 0 0 1-.067-.736l.491-1.267 1.065-2.746 3.247-8.38A.367.367 0 0 1 12.7 0h.366a.358.358 0 0 1 .291.156.414.414 0 0 1 .06.342z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-5.123)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.948 5.464h-.556L42.78 4h.747a.366.366 0 0 1 .318.183l.421.732a.366.366 0 0 1-.318.549z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-26.318 -2.536)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.557 4l-.607 1.464h-.556a.366.366 0 0 1-.318-.549l.421-.732A.366.366 0 0 1 13.814 4z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-8.286 -2.536)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.363 5.464H23.89L24.293 4h3.667z\",\n transform: \"translate(-141.001 -1496) translate(141.632 1501.14) translate(-14.758 -2.536)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRbNrWorkOnTrack);\nexport default __webpack_public_path__ + \"static/media/rb-nr-work-on-track.93efd3da.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAdminAddNewDocument(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-995 -1283.001) translate(995 1283.001)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.918 18.655h12.863a.187.187 0 0 0 .13-.053.184.184 0 0 0 .054-.13v-1.285a.185.185 0 0 0-.184-.187h-8.358v-.827a.183.183 0 0 0-.183-.183H5.918a.188.188 0 0 0-.131.054.182.182 0 0 0-.053.131v2.3a.183.183 0 0 0 .053.13.185.185 0 0 0 .131.05z\",\n transform: \"translate(-995 -1283.001) translate(995.001 1272.01) translate(-4.356)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.935 34.943a6.007 6.007 0 0 1 2.094-4.56H.183a.187.187 0 0 0-.138.063.183.183 0 0 0-.045.144l1.1 8.76a.181.181 0 0 0 .181.161h12.757a6.006 6.006 0 0 1-2.103-4.568z\",\n transform: \"translate(-995 -1283.001) translate(995.001 1272.01) translate(0 -10.931)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M59.429 26.479A5.519 5.519 0 1 0 64.948 32a5.518 5.518 0 0 0-5.519-5.521zm2.4 6.351h-1.567v1.57a.833.833 0 0 1-1.666 0v-1.57h-1.565a.832.832 0 0 1 0-1.665H58.6V29.6a.833.833 0 0 1 1.666 0v1.566h1.566a.832.832 0 1 1 0 1.665z\",\n transform: \"translate(-995 -1283.001) translate(995.001 1272.01) translate(-40.949 -7.966)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAdminAddNewDocument);\nexport default __webpack_public_path__ + \"static/media/admin-add-new-document.c9eec677.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAdminEditDocument(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h30v30H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 22v5h5l14.746-14.747-5-5zm3.893 2.333H5.667v-1.226l12.08-12.08 1.227 1.227zm19.72-17.826l-3.12-3.12a1.336 1.336 0 0 0-1.88 0l-2.44 2.44 5 5 2.44-2.44a1.328 1.328 0 0 0 0-1.88z\",\n transform: \"translate(0 0)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAdminEditDocument);\nexport default __webpack_public_path__ + \"static/media/admin-edit-document.a503b7c2.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAdminDeleteDocument(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 19a2.006 2.006 0 0 0 2 2h8a2.006 2.006 0 0 0 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAdminDeleteDocument);\nexport default __webpack_public_path__ + \"static/media/admin-delete-document.92bda2a3.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgConsultationDocuments(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 50,\n height: 50,\n viewBox: \"0 0 24 24\",\n style: {\n color: \"currentColor\"\n },\n xmlns: \"http://www.w3.org/2000/svg\",\n className: \"h-full w-full\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"currentColor\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M6.75 10a3.25 3.25 0 1 0 0-6.5a3.25 3.25 0 0 0 0 6.5Zm5.687 5.145c.53.217 1.204.355 2.062.355c4 0 4-3 4-3A1.5 1.5 0 0 0 17 11h-4.628c.393.476.629 1.085.629 1.75v.356a2.936 2.936 0 0 1-.017.252a4.974 4.974 0 0 1-.546 1.787ZM17 7.5a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0ZM1.5 13a2 2 0 0 1 2-2H10a2 2 0 0 1 2 2s0 4-5.25 4s-5.25-4-5.25-4Zm11.5.106l-.003.064Z\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgConsultationDocuments);\nexport default __webpack_public_path__ + \"static/media/consultation-documents.74f05eab.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { deepCopy } from 'deep-copy-ts';\r\n\r\nimport { DocumentTypeEnum } from \"shared/enums/document-type-enum\";\r\nimport { ISortConfig, SortOrder } from 'components/portal/GridComponents';\r\nimport { IConfirmProps } from 'components/ui/ConfirmationBox';\r\nimport { PagedResult } from 'shared/models/api/models';\r\nimport { RailDocument } from 'shared/models/api/models';\r\nimport { DocumentStatusEnum } from 'shared/enums/document-status-enum';\r\nimport { IRouteConfig } from 'helpers/route-config';\r\nimport { dateSort, stringSort } from 'helpers/HelperFunctions';\r\nimport { applicationState } from \"shared/store/applicationState\";\r\nimport { getRulebookDocuments, getRailDocuments, getAllWritableDocuments, getMyDocuments } from 'shared/services/railDocumentsApi';\r\n\r\nimport { ReactComponent as StatusCurrent } from \"assets/icons/folder.svg\";\r\nimport { ReactComponent as StatusExpired } from \"assets/icons/status-expired.svg\";\r\nimport { ReactComponent as StatusExpiredFolder } from \"assets/icons/status-expired-folder.svg\";\r\nimport { ReactComponent as StatusRescinded } from \"assets/icons/action-fields-outlined.svg\";\r\nimport { ReactComponent as StatusDeleted } from \"assets/icons/status-deleted.svg\";\r\nimport { ReactComponent as StatusArchived } from \"assets/icons/status-current.svg\";\r\nimport { ReactComponent as RailDocsIcon } from \"assets/icons/rail-docs-filled.svg\";\r\nimport { ReactComponent as RecentActionsIcon } from \"assets/icons/doc-recently-acknowledged-filled.svg\";\r\nimport { ReactComponent as MemosIcon } from \"assets/icons/rd-memo.svg\";\r\nimport { ReactComponent as OperatingManualsIcon } from \"assets/icons/rd-operating-manuals.svg\";\r\nimport { ReactComponent as WorkInstructionsIcon } from \"assets/icons/rd-wins.svg\";\r\nimport { ReactComponent as OperatingInstructionsNoticesIcon } from \"assets/icons/rb-operating-notices.svg\";;\r\nimport { ReactComponent as RbNetworkRulesIcon } from \"assets/icons/rb-network-rules.svg\";\r\nimport { ReactComponent as RbNetworkProcsIcon } from \"assets/icons/rb-network-procs.svg\";\r\nimport { ReactComponent as RbOperatingNoticesIcon } from \"assets/icons/rb-operating-notices.svg\";\r\nimport { ReactComponent as RbNetworkFormsIcon } from \"assets/icons/rb-network-rules-forms.svg\";\r\nimport { ReactComponent as RbRailTrafficOperationsManualIcon } from \"assets/icons/rb-operations-manual.svg\";\r\nimport { ReactComponent as RbSignallingIcon } from \"assets/icons/rb-signalling.svg\";\r\nimport { ReactComponent as RbGlossary } from \"assets/icons/rb-glossary.svg\";\r\nimport { ReactComponent as RbRulebookFilled } from \"assets/icons/rb-rulebook-filled.svg\";\r\nimport { ReactComponent as RbNrGeneralRules } from \"assets/icons/rb-nr-general-rules.svg\";\r\nimport { ReactComponent as RbNrRailTrafficOperations } from \"assets/icons/rb-nr-rail-traffic-operations.svg\";\r\nimport { ReactComponent as RbNrSignallingOperations } from \"assets/icons/rb-nr-signalling-operations.svg\";\r\nimport { ReactComponent as RbNrWorkOnTrack } from \"assets/icons/rb-nr-work-on-track.svg\";\r\nimport { ReactComponent as AddNewActionIcon } from \"assets/icons/admin-add-new-document.svg\";\r\nimport { ReactComponent as EditActionIcon } from \"assets/icons/admin-edit-document.svg\";\r\nimport { ReactComponent as DeleteActionIcon } from \"assets/icons/admin-delete-document.svg\";\r\nimport { ReactComponent as RecindActionIcon } from \"assets/icons/action-fields-outlined.svg\";\r\nimport { ReactComponent as ConsulationDocumentsIcon } from \"assets/icons/consultation-documents.svg\";\r\nimport { Assessment, Folder, Announcement as AwaitingActionIcon, Star as FavouriteIcon, Star } from '@material-ui/icons';\r\n\r\n\r\nexport const defaultDocumentIcon = Assessment;\r\n\r\nconst alternateRoot = \"\" + \"\";\r\nconst documentRoot = alternateRoot ?? \"\";\r\n\r\n// pages\r\nconst rulebookRoot = documentRoot + (documentRoot === \"/document\" ? \"/rulebook\" : \"/rail-rulebook\");\r\nconst railDocumentsRoot = documentRoot + (documentRoot === \"/document\" ? \"/rail\" : \"/rail-documents\");\r\nconst myDocumentsRoot = documentRoot + (documentRoot === \"/document\" ? \"/user\" : \"/my-documents\");\r\nconst documentManagementRoot = \"/administration/document-management\";\r\n\r\n// root types\r\nconst operatingNoticesAndInstructionsRoot = rulebookRoot + \"/operating-notices-and-instructions\";\r\nconst networkRulesRoot = rulebookRoot + \"/network-rules\"\r\nconst expiredDocumentsRoot = documentManagementRoot + \"/expired\";\r\n\r\n\r\nexport interface IPendingActionFilter {\r\n acknowledge?: boolean,\r\n clarify?: boolean,\r\n feedback?: boolean\r\n}\r\n\r\nexport interface IGridConfig {\r\n filterByStatuses?: string[],\r\n filterByTypes?: number[],\r\n filterBySubTypes?: number[],\r\n filterByPendingActions?: IPendingActionFilter,\r\n filterByFavourite?: boolean,\r\n filterByLastAcknowledgedDate?: number,\r\n sortBy?: ISortConfig,\r\n defaultPageSize?: number,\r\n pageSizes?: number[]\r\n}\r\n\r\nexport type RoleBoolean = true | false | \"trueBOH\" | \"trueNotBOH\" | null | undefined;\r\n\r\nexport const isTrue = (value: RoleBoolean, userIsBOH: boolean) => {\r\n if (!value) return false;\r\n\r\n if (value === true) {\r\n return true;\r\n }\r\n\r\n if (value === \"trueBOH\") {\r\n return userIsBOH;\r\n }\r\n\r\n if (value === \"trueNotBOH\") {\r\n return !userIsBOH;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport interface IDocumentRules {\r\n canAdd?: RoleBoolean,\r\n canEdit?: RoleBoolean,\r\n canDelete?: RoleBoolean,\r\n canDeleteForever?: RoleBoolean,\r\n canFavourite?: RoleBoolean,\r\n canSelect?: RoleBoolean,\r\n canRescind?: RoleBoolean,\r\n canFilterByModule?: RoleBoolean,\r\n gridConfig?: IGridConfig,\r\n hasSubTypes?: boolean,\r\n hasStatus?: boolean\r\n}\r\n\r\nexport const kebabCaseOf = (s: string) => {\r\n if (!s) return \"\";\r\n\r\n return s.toLowerCase().split(' ').join('-');\r\n};\r\n\r\nexport interface IClassName {\r\n name: string,\r\n className?: string\r\n}\r\n\r\nexport const getClassName = (x?: IClassName | null) => {\r\n if (!x) return;\r\n\r\n if (x.className) {\r\n return x.className\r\n } else {\r\n return kebabCaseOf(x.name);\r\n }\r\n};\r\n\r\nexport interface IDocumentFilter extends IClassName {\r\n id: number,\r\n icon: any,\r\n url: string,\r\n redirectType?: IDocumentType,\r\n subFilters?: IDocumentFilter[],\r\n rules?: IDocumentRules,\r\n requiredPermission?: IDocumentAction,\r\n hidden?: RoleBoolean,\r\n documentListTitle?: string,\r\n defaultSortOrder?: SortOrder,\r\n defaultSortField?: string\r\n}\r\n\r\nconst favouriteFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n if (config.filterByFavourite && !doc.isFavourite) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst dateDifference = (firstDate: Date, secondDate: Date) => {\r\n // have to convert the dates to ticks to compare them\r\n return firstDate.getTime() - secondDate.getTime();\r\n};\r\n\r\nconst recentlyActionedFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n if (config.filterByLastAcknowledgedDate && config.filterByLastAcknowledgedDate > 0) {\r\n if (doc.pendingActions?.acknowledgedDate) {\r\n // dates are not dates, they need to be converted to dates\r\n if (dateDifference(new Date(), new Date(doc.pendingActions.acknowledgedDate)) < config.filterByLastAcknowledgedDate) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst statusFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n //Default to only allowing current unless specifically specified another status\r\n if (config.filterByStatuses === undefined && doc.status !== DocumentStatusEnum.Current) {\r\n return false;\r\n }\r\n\r\n if (config.filterByStatuses?.indexOf(doc.statusDescription) === -1) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst subTypeFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n if (config.filterBySubTypes === undefined) {\r\n return true;\r\n }\r\n\r\n if (config.filterBySubTypes?.some(t => t === doc.subTypeId)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nconst typeFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n if (config.filterByTypes === undefined) {\r\n return true;\r\n }\r\n\r\n if (config.filterByTypes?.some(t => t === doc.typeId)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nconst pendingActionFilterPasses = (config: IGridConfig, doc: RailDocument) => {\r\n if (config.filterByPendingActions) {\r\n if (!doc.pendingActions) {\r\n return false;\r\n }\r\n\r\n if (config.filterByPendingActions.acknowledge) {\r\n if (config.filterByPendingActions.acknowledge === doc.pendingActions.acknowledge) {\r\n return true;\r\n }\r\n }\r\n\r\n if (config.filterByPendingActions.clarify) {\r\n if (config.filterByPendingActions.clarify === doc.pendingActions.clarify) {\r\n return true;\r\n }\r\n }\r\n if (config.filterByPendingActions.feedback) {\r\n if (config.filterByPendingActions.feedback === doc.pendingActions.feedback) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst moduleFilterPasses = (doc: RailDocument, moduleFilter?: IDocumentModule | null) => {\r\n if (!moduleFilter) return true;\r\n\r\n return doc.moduleId === moduleFilter.id;\r\n}\r\n\r\nconst filtersPass = (\r\n config: IGridConfig,\r\n doc: RailDocument,\r\n moduleFilter?: IDocumentModule | null\r\n) => {\r\n\r\n if (!config) return true;\r\n\r\n return (moduleFilter === null || moduleFilterPasses(doc, moduleFilter))\r\n && favouriteFilterPasses(config, doc)\r\n && statusFilterPasses(config, doc)\r\n && subTypeFilterPasses(config, doc)\r\n && typeFilterPasses(config, doc)\r\n && recentlyActionedFilterPasses(config, doc)\r\n && pendingActionFilterPasses(config, doc);\r\n}\r\n\r\nexport const defaultDocumentFilter = (\r\n doc: RailDocument,\r\n view: IDocumentFilter | null,\r\n filter?: IDocumentFilter | null,\r\n subFilter?: IDocumentFilter | null,\r\n moduleFilter?: IDocumentModule | null,\r\n userFilter?: IDocumentFilter | null\r\n) => {\r\n if (!doc) return false;\r\n\r\n var gridConfig = subFilter?.rules?.gridConfig ?? filter?.rules?.gridConfig ?? view?.rules?.gridConfig;\r\n\r\n if (!gridConfig) {\r\n return true;\r\n }\r\n\r\n if (userFilter?.rules?.gridConfig) {\r\n if (!filtersPass(userFilter.rules.gridConfig, doc, null))\r\n return false;\r\n }\r\n\r\n return filtersPass(gridConfig, doc, moduleFilter);\r\n};\r\n\r\nexport interface IDocumentSubType extends IDocumentFilter {\r\n id: number\r\n}\r\n\r\nexport interface IDocumentType extends IDocumentSubType {\r\n id: number,\r\n subTypes: IDocumentSubType[],\r\n preventRelatedDocumentTarget?: boolean\r\n}\r\n\r\nexport interface IDocumentView extends IDocumentFilter {\r\n filters: IDocumentFilter[],\r\n defaultFilter?: IDocumentFilter,\r\n dataSource?: () => Promise\r\n pagedDataSource?: (pageSize?: number, pageNumber?: number) => Promise>,\r\n recentWindow?: number,\r\n filterTitle?: string,\r\n cache?: IRailDocumentCache,\r\n sortPredicate?: (a: RailDocument, b: RailDocument) => number\r\n}\r\n\r\nexport interface ICache {\r\n data: T,\r\n lastRefresh: Date,\r\n refresh: () => Promise>,\r\n maxAge: number\r\n}\r\n\r\nexport interface IRailDocumentCache extends ICache {\r\n}\r\n\r\nexport interface IDocumentModule extends IDocumentView {\r\n id: number,\r\n documentTypes: IDocumentType[],\r\n prefix: string,\r\n maxDisplayed?: number\r\n}\r\n\r\nexport const GeneralRulesDocumentSubType = {\r\n name: \"General Rules\",\r\n id: DocumentTypeEnum.GeneralRules,\r\n url: networkRulesRoot + \"/general-rules\",\r\n icon: RbNrGeneralRules,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.GeneralRules]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const RailTrafficOperationsDocumentSubType = {\r\n name: \"Rail Traffic Operations\",\r\n id: DocumentTypeEnum.RailTrafficOperations,\r\n url: networkRulesRoot + \"/rail-traffic-operations\",\r\n icon: RbNrRailTrafficOperations,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.RailTrafficOperations]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const SignallingOperationsDocumentSubType = {\r\n name: \"Signalling Operations\",\r\n id: DocumentTypeEnum.SignallingOperations,\r\n hasSubTypes: true,\r\n url: networkRulesRoot + \"/signalling-operations\",\r\n icon: RbNrSignallingOperations,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.SignallingOperations]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const WorkOnTrackDocumentSubType = {\r\n name: \"Work on Track\",\r\n id: DocumentTypeEnum.WorkOnTrack,\r\n url: networkRulesRoot + \"/work-on-track\",\r\n icon: RbNrWorkOnTrack,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.WorkOnTrack]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const NetworkRulesDocumentTypes = [GeneralRulesDocumentSubType, RailTrafficOperationsDocumentSubType, SignallingOperationsDocumentSubType,\r\n WorkOnTrackDocumentSubType];\r\n\r\nexport const NetworkRulesDocumentType = {\r\n name: \"Network Rules\",\r\n id: DocumentTypeEnum.NetworkRules,\r\n url: rulebookRoot + \"/network-rules\",\r\n redirectType: GeneralRulesDocumentSubType,\r\n subTypes: NetworkRulesDocumentTypes,\r\n subFilters: NetworkRulesDocumentTypes,\r\n icon: RbNetworkRulesIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.NetworkRules]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const NetworkProceduresDocumentType = {\r\n name: \"Network Procedures\",\r\n id: DocumentTypeEnum.NetworkProcedures,\r\n url: rulebookRoot + \"/network-procedures\",\r\n icon: RbNetworkProcsIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.NetworkProcedures]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const OperatingNoticesDocumentSubType = {\r\n name: \"Operating Notices\",\r\n id: DocumentTypeEnum.OperatingNotices,\r\n url: operatingNoticesAndInstructionsRoot + \"/operating-notices\",\r\n icon: RbOperatingNoticesIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n canFilterByModule: true,\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.OperatingNotices]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const OperatingInstructionsDocumentSubType = {\r\n name: \"Operating Instructions\",\r\n id: DocumentTypeEnum.OperatingInstructions,\r\n url: operatingNoticesAndInstructionsRoot + \"/operating-instructions\",\r\n icon: OperatingInstructionsNoticesIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n canFilterByModule: true,\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterBySubTypes: [DocumentTypeEnum.OperatingInstructions]\r\n }\r\n }\r\n} as IDocumentSubType;\r\n\r\nexport const OperatingNoticesAndInstructionsDocumentTypes = [OperatingNoticesDocumentSubType, OperatingInstructionsDocumentSubType];\r\n\r\nexport const OperatingNoticesAndInstructionsDocumentType = {\r\n name: \"Operating Notices and Instructions\",\r\n id: DocumentTypeEnum.OperatingNoticesAndInstructions,\r\n url: operatingNoticesAndInstructionsRoot,\r\n redirectType: OperatingNoticesDocumentSubType,\r\n icon: OperatingInstructionsNoticesIcon,\r\n subTypes: OperatingNoticesAndInstructionsDocumentTypes,\r\n subFilters: OperatingNoticesAndInstructionsDocumentTypes,\r\n rules: {\r\n canFilterByModule: true,\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.OperatingNoticesAndInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const NetworkFormsDocumentType = {\r\n name: \"Network Forms\",\r\n id: DocumentTypeEnum.NetworkForms,\r\n url: rulebookRoot + \"/network-forms\",\r\n icon: RbNetworkFormsIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.NetworkForms]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const RailTrafficOperationsManualDocumentType = {\r\n name: \"Rail Traffic Operations Manual\",\r\n id: DocumentTypeEnum.RailTrafficOperationsManual,\r\n url: rulebookRoot + \"/rail-traffic-operations-manual\",\r\n icon: RbRailTrafficOperationsManualIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.RailTrafficOperationsManual]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const NetworkSignalsAndSignsManualDocumentType = {\r\n name: \"Network Signals and Signs Manual\",\r\n id: DocumentTypeEnum.NetworkSignalsAndSignsManual,\r\n url: rulebookRoot + \"/network-signals-and-signs-manual\",\r\n icon: RbSignallingIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.NetworkSignalsAndSignsManual]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const ConsultationRulebookDocumentType = {\r\n name: \"Consultation\",\r\n id: DocumentTypeEnum.ConsultationRulebook,\r\n url: rulebookRoot + \"/consultation\",\r\n icon: ConsulationDocumentsIcon,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.ConsultationRulebook]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const GlossaryDocumentType = {\r\n name: \"Glossary\",\r\n id: DocumentTypeEnum.Glossary,\r\n url: rulebookRoot + \"/glossary\",\r\n icon: RbGlossary,\r\n preventRelatedDocumentTarget: true,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n rules: {\r\n hasSubTypes: false,\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.Glossary]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nconst RailRulebookDocumentTypes = [\r\n NetworkRulesDocumentType, NetworkProceduresDocumentType, OperatingNoticesAndInstructionsDocumentType,\r\n NetworkFormsDocumentType, RailTrafficOperationsManualDocumentType, NetworkSignalsAndSignsManualDocumentType,\r\n ConsultationRulebookDocumentType, GlossaryDocumentType];\r\n\r\nconst byTitleAlphabetical = (a: RailDocument, b: RailDocument) => stringSort(a.title, b.title);\r\nconst byPublishedDateNewestToOldest = (a: RailDocument, b: RailDocument) => (dateSort(a.publishDate, b.publishDate) * -1);\r\n\r\nexport const RulebookDocumentMenu = {\r\n name: \"Rail Rulebook Related Documents\",\r\n documentTypes: RailRulebookDocumentTypes,\r\n prefix: \"rb\",\r\n dataSource: getRulebookDocuments,\r\n defaultSortField: \"title\",\r\n defaultSortOrder: SortOrder.ASC\r\n} as IDocumentModule;\r\n\r\nRulebookDocumentMenu.filters = RulebookDocumentMenu.documentTypes.map(t => t as IDocumentFilter);\r\n\r\nexport const OperatingNoticesDocumentType = {\r\n name: \"Operating Notices\",\r\n id: DocumentTypeEnum.OperatingNotices,\r\n url: railDocumentsRoot + \"/operating-notices\",\r\n icon: RbOperatingNoticesIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.OperatingNotices]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const OperatingInstructionsDocumentType = {\r\n name: \"Operating Instructions\",\r\n id: DocumentTypeEnum.OperatingInstructions,\r\n url: railDocumentsRoot + \"/operating-instructions\",\r\n icon: OperatingInstructionsNoticesIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.OperatingInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const MemosDocumentType = {\r\n name: \"Memos\",\r\n id: DocumentTypeEnum.Memos,\r\n url: railDocumentsRoot + \"/memos\",\r\n icon: MemosIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.Memos]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const RailControlOperatingInstructionsDocumentType = {\r\n name: \"Rail Control Operating Instructions\",\r\n id: DocumentTypeEnum.RailControlOperatingInstructions,\r\n url: railDocumentsRoot + \"/rail-control-operating-instructions\",\r\n icon: RailDocsIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.RailControlOperatingInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const TrackGeneralInstructionsDocumentType = {\r\n name: \"Track General Instructions\",\r\n id: DocumentTypeEnum.TrackGeneralInstructions,\r\n url: railDocumentsRoot + \"/track-general-instructions\",\r\n icon: RailDocsIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.TrackGeneralInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const TrackEngineeringInstructionsDocumentType = {\r\n name: \"Track Engineering Instructions\",\r\n id: DocumentTypeEnum.TrackEngineeringInstructions,\r\n url: railDocumentsRoot + \"/track-engineering-instructions\",\r\n icon: RailDocsIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.TrackEngineeringInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const SignallingGeneralInstructionsDocumentType = {\r\n name: \"Signalling General Instructions\",\r\n id: DocumentTypeEnum.SignalingGeneralInstructions,\r\n url: railDocumentsRoot + \"/signaling-general-instructions\",\r\n icon: RailDocsIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.SignalingGeneralInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const WorkInstructionsDocumentType = {\r\n name: \"Work Instructions\",\r\n id: DocumentTypeEnum.WorkInstructions,\r\n url: railDocumentsRoot + \"/work-instructions\",\r\n icon: WorkInstructionsIcon,\r\n preventRelatedDocumentTarget: true,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.WorkInstructions]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const OperatingManualsDocumentType = {\r\n name: \"Operating Manuals\",\r\n id: DocumentTypeEnum.OperatingManuals,\r\n url: railDocumentsRoot + \"/operating-manuals\",\r\n icon: OperatingManualsIcon,\r\n preventRelatedDocumentTarget: true,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.OperatingManuals]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nexport const ConsultationDocumentsDocumentType = {\r\n name: \"Consultation\",\r\n id: DocumentTypeEnum.ConsultationDocuments,\r\n url: railDocumentsRoot + \"/consultation\",\r\n icon: ConsulationDocumentsIcon,\r\n preventRelatedDocumentTarget: true,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n gridConfig: {\r\n filterByTypes: [DocumentTypeEnum.ConsultationDocuments]\r\n }\r\n }\r\n} as IDocumentType;\r\n\r\nconst RailDocumentDocumentTypes = [\r\n OperatingNoticesDocumentType, OperatingInstructionsDocumentType, MemosDocumentType,\r\n RailControlOperatingInstructionsDocumentType, TrackGeneralInstructionsDocumentType,\r\n TrackEngineeringInstructionsDocumentType, SignallingGeneralInstructionsDocumentType,\r\n WorkInstructionsDocumentType, OperatingManualsDocumentType, ConsultationDocumentsDocumentType] as IDocumentType[];\r\n\r\nconst getRelatableDocuments = async () => {\r\n var rulebookDocs = await getRulebookDocuments();\r\n var railDocs = await getRailDocuments();\r\n return [...rulebookDocs, ...railDocs];\r\n}\r\n\r\nexport const RelatedRulebookDocumentView = {\r\n name: \"Rail Rulebook Related Documents\",\r\n documentTypes: [\r\n NetworkRulesDocumentType,\r\n NetworkProceduresDocumentType,\r\n OperatingNoticesAndInstructionsDocumentType,\r\n NetworkFormsDocumentType,\r\n RailTrafficOperationsManualDocumentType,\r\n NetworkSignalsAndSignsManualDocumentType,\r\n MemosDocumentType,\r\n RailControlOperatingInstructionsDocumentType,\r\n TrackGeneralInstructionsDocumentType,\r\n TrackEngineeringInstructionsDocumentType,\r\n SignallingGeneralInstructionsDocumentType\r\n ],\r\n prefix: \"rb\",\r\n dataSource: getRelatableDocuments,\r\n sortPredicate: (a: RailDocument, b: RailDocument) => (a.title < b.title ? -1 : a.title > b.title ? 1 : 0),\r\n defaultSortField: \"title\",\r\n defaultSortOrder: SortOrder.ASC\r\n} as IDocumentModule;\r\n\r\nRelatedRulebookDocumentView.filters = RelatedRulebookDocumentView.documentTypes.map(t => t as IDocumentFilter);\r\n\r\nexport const initRelatedDocs = () => {\r\n return new Promise((resolve, reject) => {\r\n if (RelatedRulebookDocumentView.dataSource) {\r\n RelatedRulebookDocumentView.dataSource()\r\n .then(result => {\r\n if (result) {\r\n RelatedRulebookDocumentView.cache = {\r\n lastRefresh: new Date(),\r\n data: result.filter(doc => RelatedRulebookDocumentView.documentTypes.find(dt => dt.id === doc.typeId)),\r\n refresh: initRelatedDocs,\r\n maxAge: millisecondsPerMinute * 10 // refresh every 10 mins, if needed\r\n }\r\n\r\n RulebookDocumentMenu.cache = {\r\n lastRefresh: new Date(),\r\n data: result.filter(doc => RulebookDocumentMenu.documentTypes.find(dt => dt.id === doc.typeId)),\r\n refresh: initRelatedDocs,\r\n maxAge: millisecondsPerMinute * 10 // refresh every 10 mins, if needed\r\n }\r\n }\r\n\r\n return resolve(RelatedRulebookDocumentView.cache as IRailDocumentCache);\r\n })\r\n .catch(reject);\r\n } else {\r\n return reject(\"No dataSource configured for cached view\");\r\n }\r\n });\r\n};\r\n\r\nexport const AwaitingActionFilter = {\r\n name: \"Awaiting action\",\r\n url: myDocumentsRoot + \"/awaiting-action\",\r\n icon: AwaitingActionIcon,\r\n className: \"awaiting-action\",\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"pendingActions.notifyDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n gridConfig: {\r\n filterByPendingActions: {\r\n acknowledge: true\r\n }\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nconst millisecondsPerMinute = 60000;\r\nconst millisecondsPerDay = 86400000;\r\n\r\nexport const RecentlyActionedFilter = {\r\n name: \"Recently actioned\",\r\n url: myDocumentsRoot + \"/recently-actioned\",\r\n icon: RecentActionsIcon,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"pendingActions.acknowledgedDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n gridConfig: {\r\n filterByLastAcknowledgedDate: 30 * millisecondsPerDay\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const RecentlyActionedPath = RecentlyActionedFilter.url;\r\n\r\nexport const FavouritesFilter = {\r\n name: \"Favourites\",\r\n url: myDocumentsRoot + \"/favourites\",\r\n icon: FavouriteIcon,\r\n defaultSortField: \"title\",\r\n defaultSortOrder: SortOrder.ASC,\r\n rules: {\r\n hasStatus: true,\r\n hasSubTypes: true,\r\n gridConfig: {\r\n filterByFavourite: true\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const FavouritesPath = FavouritesFilter.url;\r\n\r\nexport const CurrentFilter = {\r\n name: \"Current\",\r\n url: documentManagementRoot + \"/current\",\r\n icon: Folder,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n canFilterByModule: true,\r\n gridConfig: {\r\n filterByStatuses: [\"Current\"]\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const RecindedDocumentsFilter = {\r\n name: \"Rescinded documents\",\r\n url: expiredDocumentsRoot + \"/rescinded-documents\",\r\n icon: StatusRescinded,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"rescindedDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n canFilterByModule: true,\r\n gridConfig: {\r\n filterByStatuses: [\"Rescinded\"]\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const ExpiredDocumentsFilter = {\r\n name: \"Expired documents\",\r\n url: expiredDocumentsRoot + \"/expired-documents\",\r\n icon: StatusExpired,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"expiryDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n canFilterByModule: true,\r\n gridConfig: {\r\n filterByStatuses: [\"Expired\"]\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const ExpiredFilter = {\r\n name: \"Expired\",\r\n url: expiredDocumentsRoot,\r\n icon: StatusExpiredFolder,\r\n subFilters: [RecindedDocumentsFilter, ExpiredDocumentsFilter],\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"expiryDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n canFilterByModule: true,\r\n gridConfig: {\r\n filterByStatuses: [\"Expired\", \"Rescinded\"]\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nexport const DeletedFilter = {\r\n name: \"Deleted\",\r\n url: documentManagementRoot + \"/deleted\",\r\n icon: StatusDeleted,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"deletedDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n\r\n canFilterByModule: true,\r\n gridConfig: {\r\n filterByStatuses: [\"Deleted\"]\r\n }\r\n }\r\n} as IDocumentFilter;\r\n\r\nconst doesModuleMatch = (m: IDocumentModule, id?: number, name?: string) => (!id || m.id === id) && (!name || m.name === name);\r\nconst doesDocumentTypeMatch = (dt: IDocumentSubType, id?: number, name?: string) => (!id || dt.id === id) && (!name || dt.name === name);\r\n\r\nexport const findDocumentType = (name?: string, id?: number, moduleName?: string, moduleId?: number) => {\r\n for (var m of DocumentModules) {\r\n if (m.documentTypes && doesModuleMatch(m, moduleId, moduleName)) {\r\n for (var dt of m.documentTypes) {\r\n if (doesDocumentTypeMatch(dt, id, name)) {\r\n return { module: m, type: dt };\r\n }\r\n\r\n if (dt.subTypes) {\r\n for (var st of dt.subTypes) {\r\n if (doesDocumentTypeMatch(st, id, name)) {\r\n return { module: m, type: dt, subType: st };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const findDocumentViewForId = (typeId: number, subTypeId: number | null) => {\r\n if (DocumentModules) {\r\n for (var m of DocumentModules) {\r\n for (var type of m.documentTypes) {\r\n if (subTypeId) {\r\n for (var subType of type.subTypes) {\r\n if (subType.id === subTypeId) {\r\n return { module: m, type: type, subType: subType };\r\n }\r\n }\r\n } else {\r\n if (type.id === typeId) {\r\n return { module: m, type: type, subType: null };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\r\nexport const findDocumentView = (url: string) => {\r\n let views = DocumentViews();\r\n if (views) {\r\n for (var v of views) {\r\n if (v.url === url) {\r\n return { view: v };\r\n }\r\n\r\n if (v.filters) {\r\n for (var f of v.filters) {\r\n if (f.url === url) {\r\n return { view: v, filter: f };\r\n }\r\n\r\n if (f.subFilters) {\r\n for (var f2 of f.subFilters) {\r\n if (f2.url === url) {\r\n return { view: v, filter: f, subFilter: f2 };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst BackOfHouseRoles = [\"BackOffice\", \"Supervisor\", \"SafeWorking\"];\r\n\r\nexport interface IDocumentAction {\r\n name: string,\r\n roles?: string[],\r\n icon?: any,\r\n className?: string,\r\n confirm: IConfirmProps\r\n}\r\n\r\nexport const AddDocumentAction = {\r\n name: \"Add\",\r\n roles: BackOfHouseRoles,\r\n icon: AddNewActionIcon,\r\n className: \"action-add-new-document\"\r\n} as IDocumentAction;\r\n\r\nexport const EditDocumentAction = {\r\n name: \"Edit\",\r\n roles: BackOfHouseRoles,\r\n icon: EditActionIcon,\r\n className: \"action-edit-document\"\r\n} as IDocumentAction;\r\n\r\nexport const RescindDocumentAction = {\r\n name: \"Rescind\",\r\n roles: BackOfHouseRoles,\r\n icon: RecindActionIcon,\r\n className: \"action-rescind-document\"\r\n} as IDocumentAction;\r\n\r\nexport const DeleteDocumentAction = {\r\n name: \"Delete\",\r\n roles: BackOfHouseRoles,\r\n icon: DeleteActionIcon,\r\n className: \"action-delete-document\",\r\n confirm: {\r\n message: \"Are you sure you want to delete this document?\",\r\n options: [\"Cancel\", \"Delete\"],\r\n defaultOption: \"Delete\"\r\n }\r\n} as IDocumentAction;\r\n\r\nexport const DeletePermanentlyDocumentAction = {\r\n name: \"Delete permanently\",\r\n roles: BackOfHouseRoles,\r\n icon: DeleteActionIcon,\r\n className: \"action-delete-document-permanently\",\r\n confirm: {\r\n message: \"Are you sure you want to delete these documents permanently? This action is not reversible.\",\r\n options: [\"Yes, delete\", \"Keep files\"],\r\n defaultOption: \"Yes, delete\"\r\n }\r\n} as IDocumentAction;\r\n\r\nexport const FavouriteDocumentAction = {\r\n name: \"Favourite\",\r\n className: \"action-favourite\"\r\n} as IDocumentAction;\r\n\r\nexport const SelectDocumentAction = {\r\n name: \"Select\"\r\n} as IDocumentAction;\r\n\r\nexport interface IDocumentStatus {\r\n id: number,\r\n name: string,\r\n icon: any,\r\n availableInMyDocuments?: boolean\r\n actions: IDocumentAction[]\r\n}\r\n\r\nexport const CurrentDocumentStatus = {\r\n id: DocumentStatusEnum.Current,\r\n name: \"Current\",\r\n icon: StatusCurrent,\r\n availableInMyDocuments: true,\r\n actions: [SelectDocumentAction, FavouriteDocumentAction, AddDocumentAction, EditDocumentAction, RescindDocumentAction]\r\n} as IDocumentStatus;\r\n\r\nexport const ExpiredDocumentStatus = {\r\n id: DocumentStatusEnum.Expired,\r\n name: \"Expired\",\r\n icon: StatusExpired,\r\n availableInMyDocuments: true,\r\n actions: [SelectDocumentAction, FavouriteDocumentAction, DeleteDocumentAction]\r\n} as IDocumentStatus;\r\n\r\nexport const RescindedDocumentStatus = {\r\n id: DocumentStatusEnum.Rescinded,\r\n name: \"Rescinded\",\r\n icon: StatusExpired,\r\n availableInMyDocuments: true,\r\n actions: [SelectDocumentAction, FavouriteDocumentAction, DeleteDocumentAction]\r\n} as IDocumentStatus;\r\n\r\nexport const ArchivedDocumentStatus = {\r\n id: DocumentStatusEnum.Archived,\r\n name: \"Archived\",\r\n icon: StatusArchived,\r\n actions: [SelectDocumentAction]\r\n} as IDocumentStatus;\r\n\r\nexport const DeletedDocumentStatus = {\r\n id: DocumentStatusEnum.Deleted,\r\n name: \"Deleted\",\r\n icon: StatusDeleted,\r\n actions: [SelectDocumentAction, FavouriteDocumentAction, DeletePermanentlyDocumentAction]\r\n} as IDocumentStatus;\r\n\r\nexport const DeletedFullDocumentStatus = {\r\n id: DocumentStatusEnum.DeletedFull,\r\n name: \"DeletedFull\",\r\n icon: StatusDeleted,\r\n actions: []\r\n} as IDocumentStatus;\r\n\r\nexport const DocumentStatuses = [\r\n CurrentDocumentStatus, ExpiredDocumentStatus, ArchivedDocumentStatus,\r\n DeletedDocumentStatus, DeletedFullDocumentStatus, RescindedDocumentStatus\r\n] as IDocumentStatus[];\r\n\r\nconst userHasRole = (requiredRoles?: string[]) => {\r\n if (!requiredRoles) return true;\r\n\r\n const userRoles = applicationState.getUser()?.roles ?? [];\r\n\r\n let hasRole = userRoles.some(userRole => requiredRoles.indexOf(userRole) > -1);\r\n\r\n return hasRole;\r\n};\r\n\r\nconst statusHasAction = (status: IDocumentStatus, action: IDocumentAction): RoleBoolean => {\r\n return status.actions.includes(action);\r\n};\r\n\r\nconst anyStatusHasAction = (action: IDocumentAction): RoleBoolean => {\r\n let hasAction = DocumentStatuses.some(s => statusHasAction(s, action) && userHasRole(action.roles));\r\n\r\n return hasAction;\r\n};\r\n\r\nconst statusFilterHasAction = (filterByStatus: string[], action: IDocumentAction): RoleBoolean => {\r\n let hasAction = DocumentStatuses.some(s => filterByStatus.includes(s.name) && statusHasAction(s, action) && userHasRole(action.roles));\r\n\r\n return hasAction;\r\n};\r\n\r\nconst userHasPermission = (action: IDocumentAction): boolean => {\r\n let hasRole = userHasRole(action.roles);\r\n\r\n return hasRole;\r\n};\r\n\r\nconst autoAssignActionRules = (f: IDocumentFilter) => {\r\n if (f.rules) {\r\n const filterByStatus = f.rules.gridConfig?.filterByStatuses ?? [];\r\n const defaultFilterStatus = [\"Current\"];\r\n\r\n // can favourite unless otherwise set above\r\n f.rules.canFavourite = f.rules.canFavourite === false ? false : true;\r\n\r\n if (filterByStatus.length === 0) {\r\n f.rules.canAdd = f.rules.canAdd === true && userHasPermission(AddDocumentAction);\r\n f.rules.canEdit = f.rules.canEdit === false ? false : statusFilterHasAction(defaultFilterStatus, EditDocumentAction);\r\n f.rules.canRescind = f.rules.canRescind === false ? false : statusFilterHasAction(defaultFilterStatus, RescindDocumentAction);\r\n f.rules.canDelete = f.rules.canDelete === true && userHasPermission(DeleteDocumentAction);\r\n f.rules.canDeleteForever = f.rules.canDeleteForever === true && userHasPermission(DeletePermanentlyDocumentAction);\r\n f.rules.canSelect = f.rules.canSelect === false ? false : anyStatusHasAction(SelectDocumentAction);\r\n } else {\r\n f.rules.canAdd = f.rules.canAdd === false ? false : statusFilterHasAction(filterByStatus, AddDocumentAction);\r\n f.rules.canEdit = f.rules.canEdit === false ? false : statusFilterHasAction(filterByStatus, EditDocumentAction);\r\n f.rules.canRescind = f.rules.canRescind === false ? false : statusFilterHasAction(filterByStatus, RescindDocumentAction);\r\n f.rules.canDelete = f.rules.canDelete === false ? false : statusFilterHasAction(filterByStatus, DeleteDocumentAction);\r\n f.rules.canDeleteForever = f.rules.canDeleteForever === false ? false : statusFilterHasAction(filterByStatus, DeletePermanentlyDocumentAction);\r\n f.rules.canSelect = f.rules.canSelect === false ? false : statusFilterHasAction(filterByStatus, SelectDocumentAction);\r\n }\r\n }\r\n};\r\n\r\nconst forEachFilter = (views: IDocumentView[], fn: (v: IDocumentFilter) => void) => {\r\n views.forEach(v => {\r\n fn(v);\r\n\r\n if (v.filters) {\r\n v.filters.forEach(f => {\r\n fn(f);\r\n\r\n if (f.subFilters) {\r\n f.subFilters.forEach(fn);\r\n }\r\n })\r\n }\r\n });\r\n}\r\n\r\nexport const MyDocumentsDocumentView = {\r\n name: \"My Documents\",\r\n url: myDocumentsRoot,\r\n icon: Folder,\r\n filters: [AwaitingActionFilter, RecentlyActionedFilter, FavouritesFilter],\r\n defaultFilter: AwaitingActionFilter,\r\n pagedDataSource: getMyDocuments,\r\n recentWindow: 30,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"pendingActions.notifyDate\",\r\n rules: {\r\n hasStatus: true,\r\n hasSubTypes: true,\r\n canFilterByModule: true\r\n }\r\n} as IDocumentView;\r\n\r\nexport const RailRulebookDocumentModule = {\r\n id: 1,\r\n name: \"Rail Rulebook\",\r\n url: rulebookRoot,\r\n icon: RbRulebookFilled,\r\n defaultFilter: NetworkRulesDocumentType,\r\n documentTypes: RailRulebookDocumentTypes,\r\n filters: RailRulebookDocumentTypes.map(t => t as IDocumentFilter),\r\n filterTitle: \"Contents\",\r\n prefix: \"rb\",\r\n dataSource: getRulebookDocuments,\r\n defaultSortOrder: SortOrder.ASC,\r\n defaultSortField: \"title\",\r\n sortPredicate: byTitleAlphabetical,\r\n rules: {\r\n hasSubTypes: true,\r\n gridConfig: {\r\n defaultPageSize: -1\r\n }\r\n }\r\n} as IDocumentModule;\r\n\r\nexport const RailDocumentDocumentModule = {\r\n id: 2,\r\n name: \"Rail Documents\",\r\n url: railDocumentsRoot,\r\n icon: RailDocsIcon,\r\n documentTypes: RailDocumentDocumentTypes,\r\n filters: RailDocumentDocumentTypes.map(t => t as IDocumentFilter),\r\n prefix: \"rd\",\r\n dataSource: getRailDocuments,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n hidden: \"trueNotBOH\",\r\n maxDisplayed: 7,\r\n rules: {}\r\n} as IDocumentModule;\r\n\r\nexport const DocumentManagementDocumentView = {\r\n name: \"Document Management\",\r\n url: documentManagementRoot,\r\n icon: Folder,\r\n filters: [CurrentFilter, ExpiredFilter, DeletedFilter],\r\n requiredPermission: EditDocumentAction,\r\n defaultFilter: CurrentFilter,\r\n dataSource: getAllWritableDocuments,\r\n sortPredicate: byPublishedDateNewestToOldest,\r\n defaultSortOrder: SortOrder.DESC,\r\n defaultSortField: \"publishDate\",\r\n rules: {\r\n hasSubTypes: true,\r\n hasStatus: true,\r\n canFilterByModule: true\r\n }\r\n} as IDocumentView;\r\n\r\nlet _documentViewsCache = undefined as undefined | IDocumentView[];\r\n\r\nconst getDocumentViews = () => {\r\n let cacheViews = false;\r\n if (applicationState.getUser() != null) {\r\n cacheViews = true;\r\n }\r\n\r\n if (cacheViews && _documentViewsCache !== undefined) {\r\n return _documentViewsCache;\r\n }\r\n\r\n const viewsArray = [MyDocumentsDocumentView, RailRulebookDocumentModule, RailDocumentDocumentModule, DocumentManagementDocumentView] as IDocumentView[];\r\n let views = [] as IDocumentView[];\r\n viewsArray.forEach(view => {\r\n if (cacheViews == false || view.requiredPermission == undefined || userHasPermission(view.requiredPermission)) {\r\n views.push(deepCopy(view));\r\n }\r\n });\r\n\r\n forEachFilter(views, autoAssignActionRules);\r\n\r\n if (cacheViews) {\r\n _documentViewsCache = views;\r\n }\r\n\r\n return views;\r\n}\r\nexport const DocumentViews = () => getDocumentViews();\r\n\r\nexport const DefaultView = MyDocumentsDocumentView;\r\n\r\nconst getDocumentModules = () => {\r\n return [RailRulebookDocumentModule, RailDocumentDocumentModule] as IDocumentModule[];\r\n}\r\n\r\nexport const DocumentModules = getDocumentModules();\r\n\r\nexport const DocumentStatusIcon = (props: { status: string }) => {\r\n const getIconForStatus = (status: string) => {\r\n return DocumentStatuses.find(s => s.name == status)?.icon ?? StatusCurrent;\r\n }\r\n\r\n const Icon = getIconForStatus(status);\r\n\r\n return ();\r\n};\r\n\r\nexport const DocumentTypeIcon = (props: { type: string, subType?: string }) => {\r\n const docType = findDocumentType(props.subType ?? props.type);\r\n\r\n const Icon = !docType ? defaultDocumentIcon : (docType.subType ?? docType.type).icon ?? defaultDocumentIcon;\r\n\r\n return ();\r\n}\r\n\r\nexport const FilterIcon = (props: { filter: IDocumentFilter }) => {\r\n const Icon = props.filter?.icon ?? Folder;\r\n\r\n return ();\r\n}\r\n\r\nexport const AllDocumentRoutes = (component: any) => {\r\n const routes = [] as any[];\r\n\r\n let views = DocumentViews();\r\n if (views) {\r\n for (var v of views) {\r\n if (v.url) {\r\n routes.push({ exact: true, path: v.url, component: component, breadCrumb: v.name } as IRouteConfig);\r\n routes.push({ exact: false, path: v.url + \"/:typeFilter\", component: component, breadCrumb: undefined } as IRouteConfig);\r\n }\r\n }\r\n }\r\n\r\n return routes;\r\n};\r\n","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgLinkFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 35,\n height: 35,\n viewBox: \"0 0 70 70\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h70.8v70.8H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.605 21.751a9.153 9.153 0 0 1 9.145-9.145h11.8V7h-11.8a14.751 14.751 0 0 0 0 29.5h11.8v-5.6h-11.8a9.153 9.153 0 0 1-9.145-9.149zM19.7 24.7h23.6v-5.9H19.7zM46.252 7h-11.8v5.605h11.8a9.145 9.145 0 1 1 0 18.291h-11.8V36.5h11.8a14.751 14.751 0 0 0 0-29.5z\",\n transform: \"translate(3.9 13.651)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgLinkFilled);\nexport default __webpack_public_path__ + \"static/media/link-filled.184e94f9.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgMarkChatRead(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 18H6l-4 4V4a2.006 2.006 0 0 1 2-2h16a2.006 2.006 0 0 1 2 2v7h-2V4H4v12h8zm11-3.66l-1.41-1.41-4.24 4.24-2.12-2.12-1.41 1.41L17.34 20z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgMarkChatRead);\nexport default __webpack_public_path__ + \"static/media/mark-chat-read.3c67bff6.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAdminExpiredDocuments(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-180 -1494) translate(180 1494)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.629 17.119H2.139A2.14 2.14 0 0 1 0 14.98L.012 2.139A2.136 2.136 0 0 1 2.139 0h6.424L10.7 2.139h8.56a2.142 2.142 0 0 1 2.14 2.14v4.069a6.422 6.422 0 0 0-8.771 8.77z\",\n transform: \"translate(-180 -1494) translate(-755.191 293.062) translate(936 1203.999)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.013 3A4.587 4.587 0 0 0 2.5 7.66H1l1.949 2.014.035.072L5.009 7.66h-1.5a3.565 3.565 0 0 1 3.504-3.624 3.565 3.565 0 0 1 3.508 3.624 3.565 3.565 0 0 1-3.508 3.624 3.425 3.425 0 0 1-2.475-1.067l-.712.735a4.416 4.416 0 0 0 3.187 1.368 4.587 4.587 0 0 0 4.51-4.66A4.587 4.587 0 0 0 7.013 3zm-.5 2.589v2.589l2.144 1.315.361-.626-1.754-1.078v-2.2z\",\n transform: \"translate(-180 -1494) translate(-755.191 293.062) translate(947.858 1212.56) translate(-1 -3)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAdminExpiredDocuments);\nexport default __webpack_public_path__ + \"static/media/admin-expired-documents.60f7d743.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgPdfIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-963 -1256) translate(963 1256)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.63 13.809V6.373L19.257 2h-9.173a1.042 1.042 0 0 0-1.042 1.042v10.767A1.042 1.042 0 0 0 8 14.851v5.557a1.042 1.042 0 0 0 1.042 1.042v.35a1.042 1.042 0 0 0 1.042 1.042h12.5A1.042 1.042 0 0 0 23.63 21.8v-.347a1.042 1.042 0 0 0 1.042-1.042v-5.56a1.042 1.042 0 0 0-1.042-1.042zM19.462 3.184l2.984 2.984h-2.984zm-9.725-.142a.347.347 0 0 1 .347-.347h8.683v4.168h4.168v6.947H9.737zM22.935 21.8a.347.347 0 0 1-.347.347h-12.5a.347.347 0 0 1-.347-.347v-.347h13.2zm1.042-1.389a.347.347 0 0 1-.347.347H9.042a.347.347 0 0 1-.347-.347v-5.56a.347.347 0 0 1 .347-.347H23.63a.347.347 0 0 1 .347.347z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-8 -2)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.347 24.695h9.725a.347.347 0 0 0 0-.695h-9.725a.347.347 0 0 0 0 .695z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-13.874 -16.359)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.073 30h-9.726a.347.347 0 0 0 0 .695h9.725a.347.347 0 0 0 0-.695z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-13.874 -20.275)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.817 41.9a1.08 1.08 0 0 0-.42-.219 1.775 1.775 0 0 0-.518-.069h-1.156a.347.347 0 0 0-.233.076.233.233 0 0 0-.09.184v3.557a.215.215 0 0 0 .135.2.716.716 0 0 0 .6 0 .215.215 0 0 0 .135-.2v-1.211h.552a1.931 1.931 0 0 0 .542-.069 1.094 1.094 0 0 0 .438-.226 1.129 1.129 0 0 0 .292-.4 1.521 1.521 0 0 0 .1-.6v-.028a1.521 1.521 0 0 0-.1-.6 1.018 1.018 0 0 0-.277-.395zm-.472 1.091a.587.587 0 0 1-.135.424.49.49 0 0 1-.368.135h-.57v-1.18h.552a.49.49 0 0 1 .368.135.58.58 0 0 1 .153.424z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-15.44 -27.852)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.9 41.907a1.066 1.066 0 0 0-.434-.229 1.931 1.931 0 0 0-.542-.069h-.99a.455.455 0 0 0-.278.076.233.233 0 0 0-.1.184v3.564a.233.233 0 0 0 .1.184.455.455 0 0 0 .278.076h.99a2.084 2.084 0 0 0 .542-.069 1.08 1.08 0 0 0 .726-.636 1.535 1.535 0 0 0 .108-.615v-1.444a1.528 1.528 0 0 0-.108-.611 1.042 1.042 0 0 0-.292-.411zm-.455 2.466a.58.58 0 0 1-.135.424.5.5 0 0 1-.368.135h-.514v-2.563h.5a.5.5 0 0 1 .368.135.58.58 0 0 1 .153.424z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-21.419 -27.851)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.37 41.609h-1.938a.514.514 0 0 0-.264.066.215.215 0 0 0-.118.2v3.55a.215.215 0 0 0 .135.2.716.716 0 0 0 .6 0 .215.215 0 0 0 .135-.2v-1.44h.847a.215.215 0 0 0 .2-.111.438.438 0 0 0 .063-.219.431.431 0 0 0-.069-.24.215.215 0 0 0-.195-.1h-.847v-.945h1.451a.212.212 0 0 0 .195-.115.524.524 0 0 0 .069-.271.552.552 0 0 0-.063-.257.208.208 0 0 0-.201-.118z\",\n transform: \"translate(-963 -1256) translate(959 1256.001) translate(8 2) translate(-27.612 -27.851)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgPdfIcon);\nexport default __webpack_public_path__ + \"static/media/pdf-icon.95451d8e.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgCheckBoxOutlinedBlank(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 5v14H5V5h14m0-2H5a2.006 2.006 0 0 0-2 2v14a2.006 2.006 0 0 0 2 2h14a2.006 2.006 0 0 0 2-2V5a2.006 2.006 0 0 0-2-2z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgCheckBoxOutlinedBlank);\nexport default __webpack_public_path__ + \"static/media/check-box-outlined-blank.be668b01.svg\";\nexport { ForwardRef as ReactComponent };","\r\n// Set all of the colors here and update the css vars\r\n// These colors map to the zeplin defined colors\r\n// https://app.zeplin.io/project/5ffea29702627814f1355337\r\nexport const colors = {\r\n \"golden-yellow\": \"#f9c32d\",\r\n \"red\": \"#e10505\",\r\n \"red-two\": \"#ff0000\",\r\n \"deep-orange\": \"#e65400\",\r\n \"dusty-orange\": \"#f67b2f\",\r\n \"wheat\": \"#f8d696\",\r\n \"light-grey\": \"#e7e8d5\",\r\n \"green-blue\": \"#01ab8b\",\r\n \"butterscotch\": \"#fab636\",\r\n \"bluegreen\": \"#008074\",\r\n \"dusk-blue\": \"#234483\",\r\n \"deep-aqua\": \"#0c637c\",\r\n \"slate\": \"#476475\",\r\n \"silver\": \"#d8e0e3\",\r\n \"dark-sky-blue\": \"#2da3d7\",\r\n \"aqua-marine\": \"#4fdbe7\",\r\n \"pale-olive-green\": \"#b3de68\",\r\n \"bluegrey\": \"#90b1c0\",\r\n \"black\": \"#000000\",\r\n \"white\": \"#ffffff\",\r\n \"white-two\": \"#f5f5f5\",\r\n \"white-three\": \"#f2f2f2\",\r\n \"darkish-purple\": \"#742068\",\r\n \"charcoal\": \"#50544d\",\r\n \"warm-grey\": \"#707070\",\r\n \"purplish-pink\": \"#d04d97\",\r\n \"silver-two\": \"#bdbebc\",\r\n \"greyish-blue\": \"#5c889c\"\r\n};\r\n\r\n\r\nexport const colorCssMapping = {\r\n \"nav-menu-button-bg-color\": colors[\"deep-orange\"],\r\n \"nav-bg-color\": colors[\"black\"],\r\n \"nav-menu-text-color\": colors[\"white\"],\r\n \"nav-menu-text-hover-color\": colors[\"black\"],\r\n \"nav-menu-hover-bg-color\": colors[\"white\"],\r\n \"nav-menu-rulebook-bg\": colors[\"darkish-purple\"],\r\n \"nav-menu-raildocs-bg\": colors[\"bluegreen\"],\r\n \"nav-menu-reporting-bg\": colors[\"dusk-blue\"],\r\n \"nav-menu-fatigue-assessment-bg\": colors[\"deep-orange\"],\r\n \"nav-menu-user-management-bg\": colors[\"deep-aqua\"],\r\n \"nav-menu-apps-bg\": colors[\"slate\"],\r\n \"nav-menu-quicklinks-bg\": colors[\"charcoal\"],\r\n \"nav-menu-my-documents-bg\": colors[\"light-grey\"],\r\n \"nav-menu-all-documents-bg\": colors[\"deep-aqua\"],\r\n \"card-primary-bg\": colors[\"white-two\"],\r\n \"text-color\": colors[\"black\"],\r\n \"text-color-alternate\": colors[\"white\"],\r\n \"text-primary-heading-underline\": colors[\"dusty-orange\"],\r\n \"card-alternate-bg\": colors[\"wheat\"],\r\n \"card-grid-border\": colors[\"warm-grey\"],\r\n \"status-requires-action-color\": colors[\"red\"],\r\n \"status-ok\": colors[\"green-blue\"],\r\n \"favourites-color\": colors.butterscotch,\r\n \"rb-network-rules-color\": colors.butterscotch,\r\n \"rb-network-procs-color\": colors[\"purplish-pink\"],\r\n \"rb-operating-notices-color\": colors[\"silver-two\"],\r\n \"rb-network-rules-forms-color\": colors[\"dark-sky-blue\"],\r\n \"rb-network-rail-traffic-operations-manual\": colors[\"aqua-marine\"],\r\n \"rb-remote-control-signalling\": colors[\"pale-olive-green\"],\r\n \"rb-glossary\": colors[\"bluegrey\"],\r\n \"button-primary-color\": colors[\"greyish-blue\"],\r\n \"rail-docs-menu\": colors[\"slate\"],\r\n \"button-grid-icon\": colors[\"slate\"],\r\n \"modal-header-color\": colors[\"deep-orange\"],\r\n \"modal-sub-header-color\": colors[\"greyish-blue\"],\r\n};\r\n\r\nexport const docViewMapping: { [id: string]: string; } = {\r\n \"AllDocuments\": colorCssMapping[\"nav-menu-all-documents-bg\"],\r\n \"MyDocuments\": colorCssMapping[\"nav-menu-my-documents-bg\"],\r\n \"RailRulebook\": colorCssMapping[\"nav-menu-rulebook-bg\"],\r\n \"RailDocuments\": colorCssMapping[\"nav-menu-raildocs-bg\"],\r\n};\r\n\r\nexport const configure = () => {\r\n for (const [key, value] of Object.entries(colors)) {\r\n document.documentElement.style.setProperty(`--${key}`, value);\r\n }\r\n\r\n // We loop through all the css vars and set them here\r\n for (const [key, value] of Object.entries(colorCssMapping)) {\r\n document.documentElement.style.setProperty(`--${key}`, value);\r\n }\r\n\r\n}\r\n\r\n","import useSelector from \"./useSelector\";\r\nimport { DocumentType as RailDocumentType } from \"shared/models/site/document-type\";\r\n\r\n\r\nexport const useAllDocumentTypes = () => (useSelector(s => s.railDocumentTypes) || []);\r\n\r\nexport default (key: string): RailDocumentType | undefined => {\r\n key = key.replace(/\\s/g, '').toLowerCase();\r\n var selector = useSelector(s => s.railDocumentTypes);\r\n\r\n if (!selector) {\r\n return;\r\n }\r\n\r\n //Select a type where the type or subtype matches the key\r\n var type = (selector || []).filter(x => x.key === key || x.children?.filter(x => x.key === key)[0]?.key == key)[0];\r\n\r\n //If the child of the selected type matches the key, return the child instead\r\n if (type?.children?.filter(x => x.key === key)[0]?.key == key) {\r\n return type?.children?.filter(x => x.key === key)[0];\r\n }\r\n\r\n //Return the main selected type\r\n return type;\r\n}\r\n\r\n","import React, { MouseEvent, ReactNode, useEffect, useState } from \"react\";\r\nimport { ExpandMore as DropDownIcon, ExpandLess as DropUpIcon } from \"@material-ui/icons\";\r\n\r\nexport interface IFloatingProps {\r\n children: ReactNode,\r\n clickOutside?: () => void,\r\n className?: string\r\n}\r\n\r\nexport const Floating = (props: IFloatingProps) => {\r\n const onClickOutside = (e: MouseEvent) => {\r\n if (e.target === e.currentTarget && props.clickOutside) {\r\n props.clickOutside();\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n {props.clickOutside && (\r\n
\r\n )}\r\n
{props.children}
\r\n \r\n );\r\n};\r\n\r\nexport interface IToggleProps {\r\n expandedState?: ReactNode,\r\n collapsedState?: ReactNode\r\n clickOutside?: () => boolean,\r\n children: ReactNode,\r\n label?: ReactNode,\r\n collapseOnChangeOf?: any\r\n}\r\n\r\nexport const Toggle = (props: IToggleProps) => {\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n\r\n const collapse = () => {\r\n setIsExpanded(false);\r\n };\r\n\r\n const clickOutside = () => {\r\n if (props.clickOutside) {\r\n if (!props.clickOutside()) {\r\n collapse();\r\n }\r\n } else {\r\n collapse();\r\n }\r\n }\r\n \r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n\r\n // auto collapse when the value changes\r\n useEffect(collapse, [props.collapseOnChangeOf]);\r\n\r\n return (\r\n
\r\n \r\n {props.label &&\r\n \r\n {props.label}\r\n \r\n }\r\n\r\n \r\n {isExpanded ? : }\r\n \r\n \r\n\r\n {isExpanded &&\r\n
\r\n {props.children}\r\n
\r\n }\r\n
\r\n );\r\n};","import * as React from 'react';\r\nimport { useState, useEffect } from 'react';\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { ReactComponent as CheckBoxOutlined } from \"assets/icons/check-box-outlined.svg\";\r\nimport { evalPath } from 'helpers/HelperFunctions';\r\nimport hexRgb from \"hex-rgb\"\r\n\r\nimport {\r\n AssignmentLate as MyActionsIcon\r\n , History\r\n , Apps\r\n , Announcement as AwaitingActionIcon\r\n , Star as FavouriteIcon\r\n , KeyboardArrowDown\r\n , ArrowForwardIos\r\n , Folder as CurrentDocuments\r\n , Folder\r\n , Delete\r\n , Create as AdminEditIcon\r\n , History as AdminRescindIcon\r\n , CancelOutlined as CancelIcon\r\n , Info as ToolTipIcon\r\n , Info\r\n , Help as ToolTipQuestionIcon\r\n , Create as EditIcon\r\n , DeleteOutlined as DeleteIcon\r\n , ReportProblem as ValidationIcon\r\n , AddCircle as AddRelatedDocumentsIcon\r\n , ExpandMore,\r\n CheckBoxOutlineBlankOutlined\r\n} from '@material-ui/icons';\r\n\r\n\r\n//import {Button} from 'reactstrap'\r\n\r\nimport { IDocumentModule, IDocumentFilter, DocumentViews, IDocumentView, getClassName, DocumentModules, defaultDocumentIcon, FilterIcon, RailRulebookDocumentModule, IRailDocumentCache, defaultDocumentFilter } from \"../ui/DocumentRules\";\r\n\r\nimport { ReactComponent as RailDocsIcon } from \"assets/icons/rail-docs-filled.svg\";\r\nimport { ReactComponent as RecentActionsIcon } from \"assets/icons/doc-recently-acknowledged-filled.svg\";\r\nimport { ReactComponent as MemosIcon } from \"assets/icons/rd-memo.svg\";\r\nimport { ReactComponent as WorkInstructionsIcon } from \"assets/icons/rd-wins.svg\";\r\nimport { ReactComponent as QuickLinksIcon } from \"assets/icons/link-filled.svg\";\r\nimport { ReactComponent as MarkChatReadIcon } from \"assets/icons/mark-chat-read.svg\";\r\nimport { ReactComponent as OperatingInstructionsNoticesIcon } from \"assets/icons/rb-operating-notices.svg\";;\r\n\r\nimport { ReactComponent as RbNetworkRulesIcon } from \"assets/icons/rb-network-rules.svg\";\r\nimport { ReactComponent as RbNetworkProcsIcon } from \"assets/icons/rb-network-procs.svg\";\r\nimport { ReactComponent as RbNetworkFormsIcon } from \"assets/icons/rb-network-rules-forms.svg\";\r\nimport { ReactComponent as RbRailTrafficOperationsManualIcon } from \"assets/icons/rb-operations-manual.svg\";\r\nimport { ReactComponent as RbSignallingIcon } from \"assets/icons/rb-signalling.svg\";\r\nimport { ReactComponent as RbGlossary } from \"assets/icons/rb-glossary.svg\";\r\nimport { ReactComponent as RbRulebookFilled } from \"assets/icons/rb-rulebook-filled.svg\";\r\n\r\nimport { ReactComponent as AdminAddNewDocumentIcon } from \"assets/icons/admin-add-new-document.svg\";\r\nimport { ReactComponent as AdminExpiredDocumentsIcon } from \"assets/icons/admin-expired-documents.svg\";\r\n\r\nimport { ReactComponent as RbNrGeneralRules } from \"assets/icons/rb-nr-general-rules.svg\";\r\nimport { ReactComponent as RbNrRailTrafficOperations } from \"assets/icons/rb-nr-rail-traffic-operations.svg\";\r\nimport { ReactComponent as RbNrSignallingOperations } from \"assets/icons/rb-nr-signalling-operations.svg\";\r\nimport { ReactComponent as RbNrWorkOnTrack } from \"assets/icons/rb-nr-work-on-track.svg\";\r\n\r\nimport { ReactComponent as PdfIcon } from \"assets/icons/pdf-icon.svg\";\r\n\r\nimport { DocumentType as RailDocumentType } from \"shared/models/site/document-type\"\r\n\r\nimport \"./Labels.css\";\r\nimport { colorCssMapping, colors } from \"shared/helpers/colorManager\"\r\nimport { FormGroup, Input, Label } from 'reactstrap';\r\nimport { useAllDocumentTypes } from 'hooks/useDocumentType';\r\nimport { Floating, Toggle } from '../ui/ToggleContent';\r\nimport { RailDocument } from '../../shared/models/api/models';\r\nimport { SortOrder } from '../portal/GridComponents';\r\n\r\n// TODO make heading responsive\r\n/* All labels and icon menus should go here so all the icons are imported in a central place */\r\n\r\n\r\nexport const IconHeading = (props: { icon: React.ReactNode, headingText: string, width?: string, altColor?: boolean }) => {\r\n const style = props.width ? { maxWidth: props.width } : {};\r\n\r\n let className = \"primary-card-heading pb-1\";\r\n className += props.width ? \" primary-card-heading-underline\" : \"\";\r\n className += props.altColor ? \" alternate-text\" : \"\";\r\n\r\n return (\r\n
\r\n \r\n
{props.icon}
 {props.headingText}\r\n
\r\n
\r\n );\r\n}\r\n\r\nconst IconHeading2 = (props: { icon: React.ReactNode, headingText: string, width?: string, altColor?: boolean }) => {\r\n let className = \"secondary-card-heading pb-1\";\r\n className += props.altColor ? \" alternate-text\" : \"\";\r\n return (\r\n
\r\n
{props.icon}
\r\n
{props.headingText}
\r\n \r\n
\r\n );\r\n}\r\n\r\nexport const IconHeading3 = (props: { icon: React.ReactNode, headingText: string, width?: string, altColor?: boolean }) => {\r\n let className = \"secondary-card-heading pb-1\";\r\n className += props.altColor ? \" alternate-text\" : \"\";\r\n return (\r\n
\r\n
{props.icon}
\r\n
{props.headingText}
\r\n
\r\n );\r\n}\r\n\r\nconst GridButton = (props: { icon: React.ReactNode, headingText: string, onClick: () => void, altColor?: boolean }) => {\r\n\r\n const buttonColor = colors[\"silver\"];\r\n const iconBgColor = SetAlphaColor(buttonColor, \"0.5\");\r\n const buttonTextBgColor = SetAlphaColor(buttonColor, \"0.25\");\r\n\r\n return (\r\n
props.onClick()} >\r\n {props.icon}{props.headingText}\r\n
\r\n );\r\n}\r\n\r\ninterface IIconSubMenu {\r\n text: string,\r\n selectFn: () => void,\r\n icon?: React.ReactNode;\r\n}\r\n\r\nconst SetAlphaColor = (hexColor: string, alpha: string): string => {\r\n\r\n const rgbColor = hexRgb(hexColor || \"#000000\", { format: \"array\" });\r\n return `rgb(${rgbColor[\"0\"]}, ${rgbColor[\"1\"]},${rgbColor[\"2\"]}, ${alpha})`;\r\n}\r\n\r\n// Properties common to level 1 and level 2 menus\r\ntype IIconMenuProps = {\r\n icon?: React.ReactNode,\r\n text: string,\r\n color: string,\r\n isActive?: boolean,\r\n toggleActive?: () => void,\r\n leafItems?: ILeafItem[],\r\n maxItems?: number\r\n}\r\n\r\nexport type ILeafItem = {\r\n parent: string,\r\n text: string,\r\n id: number,\r\n selected: boolean,\r\n selectAction?: (item: ILeafItem) => void,\r\n clickAction?: (item: ILeafItem) => void\r\n}\r\n\r\ntype IRootIconMenuProps = {\r\n subMenus?: IIconSubMenu[],\r\n}\r\n\r\nconst IconLeafMenus = (props: { isActive?: boolean, leafItems?: ILeafItem[], maxItems?: number }) => {\r\n if (props.leafItems && props.leafItems.length > 0) {\r\n }\r\n\r\n const navHistory = useHistory();\r\n\r\n const [leafItems, setLeafItems] = useState(props.leafItems);\r\n\r\n const onLeafSelected = (l: ILeafItem) => {\r\n l.selected = !l.selected;\r\n if (l.selectAction) l.selectAction(l);\r\n setLeafItems((leafItems || []).filter(x => true));\r\n }\r\n\r\n const navigateToRulebook = (type: string) => {\r\n // this will likely not work, but I dont think this leaf component is used, will find out when i clean up a bit\r\n navHistory.push(`${RailRulebookDocumentModule.url}/${type.replaceAll(' ', '',)}`);\r\n }\r\n\r\n return (\r\n \r\n {\r\n (props.isActive && leafItems) && leafItems.map((x, i) =>\r\n (\r\n <>\r\n {(typeof (props.maxItems) !== \"number\" || (typeof (props.maxItems) === \"number\" && i < props.maxItems)) &&\r\n
\r\n { if (x.clickAction) x.clickAction(x) }} >\r\n {x.selectAction && onLeafSelected(x)} />}\r\n {x.clickAction && }\r\n
 
{x.text}\r\n
\r\n
\r\n }\r\n {i === props.maxItems &&\r\n
navigateToRulebook(x.parent)}>\r\n See all {x.parent}\r\n
\r\n }\r\n \r\n ))\r\n }\r\n
\r\n );\r\n}\r\n\r\n// Level 1 Menu with icons on colored bar\r\n// Note this menu structure only supports 2 levels as per requirements\r\nexport const IconMenuItem1 = (props: IIconMenuProps & IRootIconMenuProps) => {\r\n\r\n const [isHover, setIsHover] = useState(false);\r\n const [isFocus, setIsFocus] = useState(false);\r\n const [activeSubMenu, setActiveSubMenu] = useState(-1);\r\n\r\n const toggleHover = () => { setIsHover(!isHover); };\r\n const toggleActive = () => { if (props.toggleActive) props.toggleActive(); };\r\n const toggleFocus = () => { setIsFocus(!isFocus) };\r\n const subMenus = props.subMenus || [];\r\n // If leaf items are passed in but they aren't visible then \r\n var isVisible = true;\r\n var leafItems = [] as Array;\r\n if (props.leafItems) {\r\n leafItems = (props.leafItems).filter(x => x.parent === props.text);\r\n const subMenuItems = subMenus.filter(x => { return (props.leafItems?.filter(l => l.parent == x.text) || []).length > 0 });\r\n // this can be set via an option if there is a requirement to hide empty menus later\r\n //isVisible = leafItems.length > 0 || subMenuItems.length > 0;\r\n }\r\n var style = {};\r\n\r\n const Caret = () => (\r\n <>\r\n {\r\n (props.isActive && props.subMenus)\r\n ? \r\n : props.isActive && \r\n }\r\n \r\n );\r\n\r\n const SubMenus = () => {\r\n const toggleSubActive = (menuIndex: number) => {\r\n setActiveSubMenu(menuIndex === activeSubMenu ? -1 : menuIndex);\r\n }\r\n return (\r\n <>\r\n {\r\n props.isActive && subMenus.map((x, i) => (\r\n toggleSubActive(i)} />))\r\n }\r\n \r\n );\r\n };\r\n\r\n if (isHover || isFocus || props.isActive) {\r\n style = {\r\n backgroundColor: SetAlphaColor(props.color, '0.25')\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n {\r\n isVisible &&\r\n <>\r\n
\r\n
\r\n
\r\n
{props.icon}
 {props.text}
\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 IconMenuItem2 = (props: IIconMenuProps & IIconSubMenu) => {\r\n\r\n const [isActive, setIsActive] = useState(false);\r\n const [isHover, setIsHover] = useState(false);\r\n const [isFocus, setIsFocus] = useState(false);\r\n\r\n const toggleHover = () => { setIsHover(!isHover); };\r\n const toggleActive = () => {\r\n const newState = (!isActive);\r\n setIsActive(newState);\r\n if (props.selectFn && newState) props.selectFn();\r\n };\r\n const toggleFocus = () => { setIsFocus(!isFocus) };\r\n\r\n // If leaf items are passed in but they aren't visible then \r\n var isVisible = true;\r\n var leafItems = [] as Array;\r\n if (props.leafItems) {\r\n leafItems = (props.leafItems).filter(x => x.parent === props.text);\r\n isVisible = leafItems.length > 0;\r\n }\r\n\r\n var style = { backgroundColor: SetAlphaColor(props.color, (isHover || isFocus || isActive) ? '0.25' : '0.1') };\r\n var menuBarStyle = { backgroundColor: SetAlphaColor(props.color, '0.5') };\r\n\r\n return (\r\n <>\r\n {\r\n isVisible &&\r\n <>\r\n
\r\n
\r\n
\r\n
{props.icon}
 {props.text}\r\n
\r\n
\r\n \r\n \r\n }\r\n );\r\n}\r\n\r\n/* Icon headings */\r\n\r\nexport const MyActionsH1 = () => (} headingText=\"My Actions\" />);\r\nexport const HistoryH1 = () => (} headingText=\"Document History\" width=\"400px\" />);\r\nexport const AppsH1 = () => (} headingText=\"Apps\" width=\"230px\" altColor={true} />);\r\nexport const QuickLinksH1 = () => (} headingText=\"Quick Links\" width=\"300px\" altColor={true} />);\r\n\r\nexport const RailRulebookH2 = () => (} headingText=\"Rail Rulebook\" altColor={true} />);\r\nexport const RailDocumentsH2 = () => (} headingText=\"Rail Documents\" altColor={true} />);\r\nexport const AllDocumentsH2 = () => (} headingText=\"All Documents\" altColor={true} />);\r\nexport const MyDocumentsH2 = () => (} headingText=\"My Documents\" />);\r\n\r\nexport const AddDocumentH2 = () => (} headingText=\"Add a new document\" altColor={true} />);\r\nexport const EditDocumentH2 = () => (} headingText=\"Edit a document\" altColor={true} />);\r\nexport const RescindDocumentH2 = () => (} headingText=\"Rescind document\" altColor={true} />);\r\nexport const RelatedDocumentsH2 = () => (} headingText=\"Related documents\" altColor={true} />);\r\n\r\nexport const DocumentInfoH2 = () => (} headingText=\"Document information\" altColor={true} />);\r\n\r\n\r\n/* Icons */\r\n\r\nexport const MarkChatRead = () => ();\r\n\r\n\r\n/* Buttons */\r\n\r\ntype IButtonProps =\r\n {\r\n onClick: () => void\r\n }\r\n\r\nexport const ModalClose = (props: { onClick: () => void, dark?: boolean }) => {\r\n return (
);\r\n}\r\n\r\nexport const RelatedDocumentsAddButton = (props: IButtonProps) => {\r\n return (
);\r\n}\r\n\r\ntype ITooltipProps =\r\n {\r\n\r\n text: string | React.ReactNode;\r\n }\r\n\r\ntype ITooltipLabelProps = ITooltipProps & {\r\n label: string \r\n}\r\n\r\nexport const ToolTipButton = (props: ITooltipProps) => (
{props.text}
);\r\nexport const ToolTipLabel = (props: ITooltipLabelProps) => (
);\r\nexport const ToolTipQuestionButton = (props: ITooltipProps) => (
{props.text}
);\r\nexport const ValidationError = () => (
);\r\n\r\nexport type AllDocMenu =\r\n | \"Current\"\r\n | \"Expired\"\r\n | \"Rescinded\"\r\n | \"Deleted\"\r\n | \"ALL\";\r\n\r\n// All Docs menu\r\nexport const AllDocumentsMenu = (props: { onMenuChanged?: (x: AllDocMenu) => void }) => {\r\n\r\n const [activeMenu, setActiveMenu] = useState(-1);\r\n const toggleActive = (menuIndex: number) => {\r\n setActiveMenu(menuIndex === activeMenu ? 0 : menuIndex);\r\n }\r\n\r\n const filter = (x: AllDocMenu) => {\r\n if (props.onMenuChanged) props.onMenuChanged(x)\r\n }\r\n\r\n const toggleActiveFilter = (x: AllDocMenu, menuIndex: number) => {\r\n const newMenu = menuIndex === activeMenu ? -1 : menuIndex;\r\n setActiveMenu(newMenu);\r\n filter(newMenu !== -1 ? x : \"ALL\");\r\n }\r\n\r\n const clr = colorCssMapping[\"nav-menu-all-documents-bg\"];\r\n\r\n return (\r\n \r\n
\r\n } text=\"Current\" color={clr} isActive={activeMenu === 1} toggleActive={() => toggleActiveFilter(\"Current\", 1)} />\r\n
\r\n
\r\n } text=\"Expired\" color={clr} isActive={activeMenu === 2} toggleActive={() => toggleActive(2)} subMenus={[\r\n { text: \"Rescinded documents\", selectFn: () => filter(\"Rescinded\") },\r\n { text: \"Expired documents\", selectFn: () => filter(\"Expired\") }\r\n ]} />\r\n
\r\n
\r\n } text=\"Deleted\" color={clr} isActive={activeMenu === 3} toggleActive={() => toggleActiveFilter(\"Deleted\", 3)} />\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport type MyDocMenu =\r\n | \"AwaitingAction\"\r\n | \"RecentlyActioned\"\r\n | \"Favorites\";\r\n\r\ninterface IFilterProps {\r\n filter: IDocumentFilter,\r\n isActive: boolean,\r\n activate: () => void\r\n}\r\n\r\nexport const Filter = (props: IFilterProps) => {\r\n return (\r\n
\r\n \r\n
\r\n )\r\n}\r\n\r\ninterface IModuleFilterListProps {\r\n title: string,\r\n selectedModule: IDocumentModule | null,\r\n setSelectedModule: (module: IDocumentModule | null) => void,\r\n modules?: IDocumentModule[],\r\n canSelectAll?: React.ReactNode\r\n}\r\n\r\nexport const DocumentModuleFilterList = (props: IModuleFilterListProps) => {\r\n var items = (props.modules ?? DocumentModules);\r\n\r\n const onChange = (event: any) => {\r\n let moduleId = parseInt(event.target.value);\r\n\r\n if (moduleId > -1) {\r\n props.setSelectedModule(items[moduleId]);\r\n }\r\n else {\r\n props.setSelectedModule(null);\r\n }\r\n }\r\n\r\n return (
\r\n

\r\n Filter by module\r\n

\r\n \r\n {props.canSelectAll &&\r\n \r\n \r\n \r\n }\r\n\r\n {items.map((item, index) =>\r\n \r\n \r\n \r\n )}\r\n \r\n
);\r\n}\r\n\r\ninterface DocumentViewListProps {\r\n activeView: IDocumentView | null,\r\n setActiveView: (view: IDocumentView) => void\r\n}\r\n\r\nexport const DocumentViewList = (props: DocumentViewListProps) => {\r\n return (\r\n
\r\n \r\n
\r\n {DocumentViews().map(view =>\r\n
props.setActiveView(view)}\r\n className={\"item \" + (view.name === props.activeView?.name ? \"active\" : \"clickable\")}>\r\n {view.name}\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\ninterface IFilterSelector {\r\n activeFilter?: IDocumentFilter | null,\r\n setActiveFilter?: (filter: IDocumentFilter | null) => void\r\n activeSubFilter?: IDocumentFilter | null,\r\n setActiveSubFilter?: (filter: IDocumentFilter | null) => void\r\n}\r\n\r\ninterface IDocumentFilterProps extends IFilterSelector {\r\n filter: IDocumentFilter,\r\n hideSubFilters?: boolean,\r\n documents?: RailDocument[] | null,\r\n selectedDocuments?: RailDocument[] | null,\r\n selectedDocumentId?: number,\r\n expanded: boolean,\r\n onDocumentClick?: (doc: RailDocument) => void\r\n}\r\n\r\nexport const DocumentFilter = (props: IDocumentFilterProps) => {\r\n const Icon = props.filter.icon;\r\n const filterClassName = getClassName(props.filter);\r\n const isActive = props.activeFilter?.name === props.filter.name;\r\n\r\n const collapseSubFilter = () => {\r\n if (props.setActiveSubFilter) {\r\n props.setActiveSubFilter(null);\r\n }\r\n };\r\n\r\n const collapseThisFilter = () => {\r\n if (props.setActiveFilter) {\r\n props.setActiveFilter(null);\r\n }\r\n };\r\n\r\n const autoExpandFirstSubFilter = () => {\r\n if ((props.filter?.subFilters?.length ?? 0) > 0) {\r\n if (props.setActiveSubFilter && props.filter?.subFilters) {\r\n props.setActiveSubFilter(props.filter.subFilters[0]);\r\n }\r\n }\r\n };\r\n\r\n const thisIsTheCurrentFilter = () => (props.filter === props.activeFilter);\r\n const showingDocuments = () => (docs.length > 0);\r\n\r\n const setActiveFilter = (inFlightSubFilterChange: IDocumentFilter | null = null) => {\r\n if (thisIsTheCurrentFilter()) {\r\n // if we're showing documents, then allow it to collapse\r\n if (showingDocuments()) {\r\n collapseThisFilter();\r\n }\r\n } else {\r\n if (props.setActiveFilter) {\r\n // set this filter as the current filter\r\n props.setActiveFilter(props.filter);\r\n }\r\n\r\n if (!showingDocuments()) {\r\n // and thers no subfilter change in-flight (being called from setActiveSubFilter rather than directly)\r\n if (!inFlightSubFilterChange) {\r\n autoExpandFirstSubFilter();\r\n }\r\n } else {\r\n collapseSubFilter();\r\n }\r\n }\r\n };\r\n\r\n const setActiveSubFilter = (subFilter: IDocumentFilter | null) => {\r\n if (props.setActiveSubFilter) {\r\n\r\n // if the user is click on the active sub filter, just remove it\r\n if (props.activeSubFilter === subFilter) {\r\n if (docs.length > 0) {\r\n props.setActiveSubFilter(null);\r\n }\r\n }\r\n else {\r\n if (props.filter !== props.activeFilter) {\r\n setActiveFilter(subFilter);\r\n }\r\n props.setActiveSubFilter(subFilter);\r\n }\r\n\r\n }\r\n };\r\n\r\n const sortDocs = (field: string, order: SortOrder, a: RailDocument, b: RailDocument) => {\r\n const aVal = evalPath(field, a);\r\n const bVal = evalPath(field, b);\r\n\r\n if (aVal === null && bVal === null) return 0;\r\n if (aVal === null) return (order === SortOrder.ASC ? -1 : 1);\r\n if (bVal === null) return (order === SortOrder.ASC ? 1 : -1);\r\n\r\n if (aVal < bVal) return (order === SortOrder.ASC ? -1 : 1);\r\n if (aVal > bVal) return (order === SortOrder.ASC ? 1 : -1);\r\n\r\n return 0;\r\n };\r\n\r\n const setDocs = () => {\r\n if (props.documents) {\r\n if (props.documents.length > 0) {\r\n var config = props.filter.rules?.gridConfig;\r\n\r\n if (config) {\r\n const docs = props.documents.filter(doc => defaultDocumentFilter(doc, props.filter));\r\n\r\n if (props.filter.defaultSortField) {\r\n docs.sort((a, b) => sortDocs(props.filter.defaultSortField ?? \"title\", props.filter.defaultSortOrder ?? SortOrder.ASC, a, b));\r\n }\r\n\r\n return docs;\r\n }\r\n }\r\n\r\n return props.documents;\r\n }\r\n\r\n return [] as RailDocument[];\r\n };\r\n\r\n const docs = setDocs();\r\n const showSubFilters = ((props.filter.subFilters?.length ?? 0) > 0) && (!(props.hideSubFilters ?? false));\r\n const isParent = (docs.length > 0) || showSubFilters;\r\n\r\n const onClick = (doc: RailDocument) => {\r\n if (props.onDocumentClick) {\r\n props.onDocumentClick(doc);\r\n }\r\n };\r\n\r\n const isDocSelected = (id: number) => {\r\n if (props.selectedDocumentId) {\r\n return id === props.selectedDocumentId;\r\n }\r\n\r\n if (props.selectedDocuments) {\r\n return (props.selectedDocuments.findIndex(sd => sd.id === id) > -1);\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const selectedCount = docs.filter(doc => (props.selectedDocuments?.some(sd => sd.id === doc.id))).length;\r\n\r\n const documentTypeAllowed = (filter: IDocumentFilter) => {\r\n if (filter.id === undefined) {\r\n return true;\r\n }\r\n\r\n let docTypes = useAllDocumentTypes();\r\n let childDocTypes = docTypes.flatMap(dt => dt.children);\r\n let isAllowed = docTypes.some(type => type.typeId === filter.id) || childDocTypes.some(type => type && type.typeId === filter.id);\r\n\r\n return isAllowed;\r\n }\r\n\r\n return (\r\n <>\r\n {documentTypeAllowed(props.filter) &&\r\n
\r\n
setActiveFilter(null)}>\r\n
\r\n
\r\n
{props.filter.name}
\r\n\r\n {docs && props.selectedDocuments &&\r\n
\r\n {selectedCount}\r\n /\r\n {docs.length}\r\n
\r\n\r\n }\r\n
\r\n
\r\n\r\n {showSubFilters &&\r\n props.filter.subFilters?.map(sf =>\r\n
\r\n \r\n
\r\n )\r\n }\r\n\r\n {docs && (!showSubFilters || (props.filter?.subFilters?.length ?? 0) === 0) &&\r\n
\r\n \r\n \r\n {docs.map(doc =>\r\n onClick(doc)}\r\n className={\"document doc-\" + doc.id + (isDocSelected(doc.id) ? \" selected-document\" : \"\")}>\r\n \r\n\r\n {props.selectedDocuments &&\r\n \r\n }\r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n {props.selectedDocuments && props.selectedDocuments.findIndex(sd => sd.id === doc.id) > -1\r\n ? \r\n : \r\n }\r\n {doc.title}
\r\n
\r\n }\r\n
\r\n }\r\n \r\n );\r\n};\r\n\r\ninterface IDocumentFiltersProps extends IFilterSelector {\r\n view: IDocumentView | null,\r\n documentCount?: number,\r\n hideSubFilters?: boolean,\r\n selectedDocuments?: RailDocument[] | null,\r\n selectedDocumentId?: number,\r\n expandedFilters?: IDocumentFilter[],\r\n onDocumentClick?: (doc: RailDocument) => void\r\n}\r\n\r\nexport const DocumentFilterList = (props: IDocumentFiltersProps) => {\r\n const [expanded, setExpanded] = useState(false);\r\n\r\n useEffect(() => {\r\n setExpanded(false);\r\n }, [props.activeFilter, props.activeSubFilter]);\r\n\r\n const allDocumentsHeading = \"All documents\" + (props.documentCount ? \"(\" + props.documentCount + \")\" : \"\");\r\n\r\n const Icon = props.view?.icon || defaultDocumentIcon;\r\n\r\n const onClick = () => {\r\n if (props.setActiveFilter) {\r\n props.setActiveFilter(null);\r\n }\r\n };\r\n\r\n const viewNameFormat = (viewName: string | undefined) => {\r\n if (viewName === undefined) {\r\n return 'none';\r\n }\r\n return viewName.replaceAll(' ', '-');\r\n }\r\n\r\n return (\r\n <>\r\n
setExpanded(!expanded)} >\r\n
{\r\n props.activeSubFilter?.name\r\n ?? props.activeFilter?.name\r\n ?? allDocumentsHeading\r\n }
\r\n
\r\n\r\n setExpanded(!expanded)}>\r\n {props.view?.filters?.map(filter =>\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport const MyDocumentsMenu = (props: { onMenuChanged?: (x: MyDocMenu) => void }) => {\r\n const [activeMenu, setActiveMenu] = useState(1);\r\n\r\n const toggleActive = (menuIndex: number) => {\r\n setActiveMenu(menuIndex === activeMenu ? 0 : menuIndex);\r\n }\r\n\r\n const filter = (x: MyDocMenu) => { if (props.onMenuChanged) props.onMenuChanged(x) }\r\n\r\n const toggleActiveFilter = (x: MyDocMenu, menuIndex: number) => {\r\n toggleActive(menuIndex);\r\n filter(x);\r\n }\r\n\r\n return (\r\n
\r\n
\r\n } text=\"Awaiting action\"\r\n isActive={activeMenu === 1} toggleActive={() => toggleActiveFilter(\"AwaitingAction\", 1)} color={colorCssMapping[\"status-requires-action-color\"]} />\r\n
\r\n
\r\n } text=\"Recently actioned\"\r\n isActive={activeMenu === 2} toggleActive={() => toggleActiveFilter(\"RecentlyActioned\", 2)} color={colorCssMapping[\"status-ok\"]} />\r\n
\r\n
\r\n }\r\n isActive={activeMenu === 3} toggleActive={() => toggleActiveFilter(\"Favorites\", 3)} text=\"Favorites\" color={colorCssMapping[\"favourites-color\"]} />\r\n
\r\n
);\r\n}\r\n\r\n// Create the rail rulebook menu structure with optional leaf items (ie PDFs)\r\nexport const RailRulebookMenu = (props: {\r\n onMenuChanged?: (x: string, isSubMenu?: boolean) => void,\r\n leafItems?: ILeafItem[],\r\n activeMenuIndex?: number,\r\n maxItems?: number,\r\n includeRailDocs?: boolean, // Include any menus that are not rulebook items\r\n exludeMenuKeys?: Array // Menu titles that you don't want displayed \r\n}) => {\r\n\r\n const exludeMenuKeys = props.exludeMenuKeys || [];\r\n // TODO more generic way of setting up menus\r\n const [activeMenu, setActiveMenu] = useState(-1);\r\n\r\n const filter = (x: string, isSubMenu?: boolean) => {\r\n if (props.onMenuChanged) {\r\n props.onMenuChanged(x, isSubMenu);\r\n }\r\n }\r\n\r\n const toggleActive = (menuIndex: number, x: string) => {\r\n const newMenu = menuIndex === activeMenu ? -1 : menuIndex;\r\n setActiveMenu(newMenu);\r\n filter(newMenu !== -1 ? x : \"ALL\");\r\n }\r\n\r\n useEffect(() => {\r\n if (props.activeMenuIndex !== undefined && props.activeMenuIndex > 0 && props.activeMenuIndex !== activeMenu) {\r\n setActiveMenu(props.activeMenuIndex);\r\n }\r\n });\r\n\r\n const NetworkRulesMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-network-rules-color\"]} isActive={activeMenu === 1} toggleActive={() => toggleActive(1, p.menuText)} subMenus={[\r\n { icon: , text: \"General Rules\", selectFn: () => filter(\"General Rules\", true) },\r\n { icon: , text: \"Rail Traffic Operations\", selectFn: () => filter(\"Rail Traffic Operations\", true) },\r\n { icon: , text: \"Signalling Operations\", selectFn: () => filter(\"Signalling Operations\", true) },\r\n { icon: , text: \"Work on Track\", selectFn: () => filter(\"Work on Track\", true) }\r\n ]} />);\r\n\r\n const NetworkProceduresMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-network-procs-color\"]} isActive={activeMenu === 2} toggleActive={() => toggleActive(2, p.menuText)} />);\r\n\r\n const NetworkRulesFormsMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-network-rules-forms-color\"]} isActive={activeMenu === 4} toggleActive={() => toggleActive(4, p.menuText)} />);\r\n\r\n const RailTrafficOperationsManualMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-network-rail-traffic-operations-manual\"]} isActive={activeMenu === 5} toggleActive={() => toggleActive(5, p.menuText)} />);\r\n\r\n const SignallingMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-remote-control-signalling\"]} isActive={activeMenu === 6} toggleActive={() => toggleActive(6, p.menuText)} />);\r\n\r\n const GlossaryMenuButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rb-glossary\"]} isActive={activeMenu === 7} toggleActive={() => toggleActive(7, p.menuText)} />);\r\n\r\n const OperatingNoticeButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rail-docs-menu\"]} isActive={activeMenu === 8} toggleActive={() => toggleActive(8, p.menuText)} />);\r\n\r\n const OperatingInstructionsButton =\r\n (p: { menuText: string }) => (} {...props} text={p.menuText} color={colorCssMapping[\"rail-docs-menu\"]} isActive={activeMenu === 9} toggleActive={() => toggleActive(9, p.menuText)} />);\r\n\r\n\r\n return (\r\n \r\n {!exludeMenuKeys.includes(\"Network Rules\") &&
}\r\n {!exludeMenuKeys.includes(\"Network Procedures\") &&
}\r\n {!exludeMenuKeys.includes(\"Operating Notices and Instructions\") &&
}\r\n {!exludeMenuKeys.includes(\"Network Forms\") &&
}\r\n {!exludeMenuKeys.includes(\"Rail Traffic Operations Manual\") &&
}\r\n {!exludeMenuKeys.includes(\"Network Signals and Signs Manual\") &&
}\r\n {!exludeMenuKeys.includes(\"Glossary\") &&
}\r\n
\r\n )\r\n};","import { IRole } from 'shared/models/api/models';\r\nimport useSelector from \"./useSelector\";\r\n\r\nexport interface IRoles {\r\n roles: string[],\r\n isBOH: boolean\r\n}\r\n\r\nexport const userHasPermission = (permission?: string | null, userRoles?: IRole[]) => {\r\n if (!permission || permission.length === 0) return true;\r\n\r\n if (!userRoles) {\r\n userRoles = useUserRoles();\r\n }\r\n\r\n return userRoles.some(role => role.permissions.includes(permission));\r\n};\r\n\r\nexport const userHasAnyRequiredRole = (requiredRoles: string[], userRoles?: IRole[]) => {\r\n if (!requiredRoles || requiredRoles.length === 0) return true;\r\n\r\n if (!userRoles) {\r\n userRoles = useUserRoles();\r\n }\r\n\r\n return userRoles.some(userRole => requiredRoles.includes(userRole.name));\r\n};\r\n\r\nexport const useIsBackOfHouse = (): boolean => useSelector(s => s.isBackOfHouseUser);\r\n\r\nexport const useProfile = () => {\r\n return useSelector(s => s.profile);\r\n};\r\n\r\nexport const useUserRoles = (): IRole[] => {\r\n var usr = useSelector(s => s.profile); \r\n\r\n return usr?.roles ?? [];\r\n};\r\n\r\n// maintaining this method for exisiting code, but propbably should be using something else to get the BOH\r\nconst useRoles = (): IRoles => {\r\n var usr = useSelector(s => s.profile);\r\n\r\n return {\r\n roles: usr?.roles.map(role => role.name) ?? [],\r\n isBOH: usr?.roles.some(role => role.isBackOfHouseRole === true) ?? false\r\n };\r\n};\r\n\r\nexport default useRoles;\r\n","import React from \"react\";\r\nimport { Nav, NavItem } from \"reactstrap\";\r\nimport \"./SideBar.css\";\r\nimport { DocumentViewList, DocumentFilterList, DocumentModuleFilterList } from \"components/menu/Labels\";\r\nimport { IDocumentFilter, IDocumentModule, IDocumentView, isTrue } from \"../../ui/DocumentRules\";\r\nimport { useIsBackOfHouse } from 'hooks/useRoles';\r\n\r\ninterface ISidebarProps {\r\n activeView: IDocumentView | null,\r\n setActiveView: (view: IDocumentView | null) => void,\r\n activeFilter: IDocumentFilter | null,\r\n setActiveFilter: (filter: IDocumentFilter | null) => void,\r\n activeSubFilter: IDocumentFilter | null,\r\n setActiveSubFilter: (filter: IDocumentFilter | null) => void,\r\n selectedModuleFilter: IDocumentModule | null,\r\n setSelectedModuleFilter: (module: IDocumentModule | null) => void,\r\n documentCount: number\r\n}\r\n\r\nconst Sidebar = (props: ISidebarProps) => {\r\n var isBackOfHouse = useIsBackOfHouse();\r\n\r\n return (
\r\n
\r\n
Current view:
\r\n \r\n
\r\n
\r\n {props.activeView && props.activeView.filters &&\r\n <>\r\n
\r\n {props.activeView?.filterTitle ?? \"Contents\"}\r\n
\r\n\r\n \r\n \r\n }\r\n
\r\n
\r\n {props.activeView?.rules && isTrue(props.activeView.rules.canFilterByModule, isBackOfHouse) &&\r\n \r\n }\r\n
\r\n
);\r\n};\r\n\r\nexport default Sidebar","import * as React from 'react';\r\n\r\nexport interface ISupportsConfirmationBox {\r\n confirmProps?: IConfirmProps | null,\r\n setConfirmProps?: (confirmProps: IConfirmProps | null) => void\r\n}\r\n\r\nexport interface IConfirmProps {\r\n message: React.ReactNode;\r\n options: string[];\r\n defaultOption?: string;\r\n setResult: (value: string) => void\r\n}\r\n\r\nexport const ConfirmationBox = (props: IConfirmProps) => {\r\n const onClick = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n\r\n if (e.target === e.currentTarget && props.options.length === 1) {\r\n props.setResult(props.options[0]);\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n {props.message &&\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {props?.message}\r\n
\r\n
\r\n {\r\n props.options.map(opt => {\r\n return (\r\n { if (props.setResult) props.setResult(opt); }}\r\n >{opt}\r\n );\r\n })\r\n }\r\n
\r\n
\r\n
\r\n }\r\n \r\n );\r\n};","import { RailDocument, NewDocument } from \"shared/models/api/models\"\r\nimport { Document } from \"shared/models/site/document\"\r\n\r\nexport const toISOLocalDate = (date?: any): string | undefined => {\r\n if (!date) return undefined;\r\n const z = (n: any) => (`0${ n }`).slice(-2);\r\n const d = new Date(date);\r\n return `${ d.getFullYear() }-${ z(d.getMonth() + 1) }-${ z(d.getDate()) }`;\r\n}\r\n\r\nexport const formatTime = (date?: any) =>\r\n date ?\r\n new Date(date).toLocaleTimeString(\"en-AU\", { hour: \"2-digit\", minute: \"2-digit\", hourCycle: \"h23\" })\r\n : undefined;\r\n\r\nexport const formatDateTime = (date?: any) => {\r\n if (!date) {\r\n return '';\r\n }\r\n if (typeof (date) === 'string') {\r\n date = new Date(date);\r\n }\r\n return `${ date.toLocaleDateString(\"en-AU\") } ${ formatTime(date) }`;\r\n}\r\n\r\nexport const formatDate = (date?: any) => {\r\n if (!date) {\r\n return '';\r\n }\r\n if (typeof (date) === 'string') {\r\n date = new Date(date);\r\n }\r\n return date.toLocaleDateString(\"en-AU\");\r\n}\r\n\r\nexport const isoDateStringToBrowserSafeString = (dateString: string) => {\r\n //Safari isn't happy with ISO string, this format looks to work on Chromium and Safari\r\n var date = dateString.replace(/-/g, '/').replace('T', ' ');\r\n return date\r\n}\r\n\r\nexport const dateToBrowserSafeString = (date: Date) => {\r\n return isoDateStringToBrowserSafeString(date.toISOString());\r\n}\r\n\r\nexport const toLocalDateTimeFields = (obj: any, fields: Array): any => {\r\n fields.forEach(x => {\r\n if (typeof obj[x] === 'string') {\r\n obj[x] = isoDateStringToBrowserSafeString(`${ toISOLocalDate(obj[x]) } ${ formatTime(obj[x]) }`);\r\n }\r\n });\r\n return obj;\r\n}\r\n\r\nexport const documentMapper = {\r\n mapFromRailDocument: (railDocument: RailDocument): Document => {\r\n const effectiveFromDate = railDocument.effectiveFromDate < railDocument.publishDate\r\n ? railDocument.publishDate\r\n : railDocument.effectiveFromDate;\r\n const val = {\r\n documentId: railDocument.id,\r\n documentModule: railDocument.moduleId,\r\n typeLabel: railDocument.type,\r\n typeId: railDocument.typeId,\r\n subTypeId: railDocument.subTypeId,\r\n subTypeLabel: railDocument.subType,\r\n title: railDocument.title,\r\n documentNumber: railDocument.documentNumber,\r\n versionNumber: railDocument.version,\r\n effectiveFromDate: toISOLocalDate(effectiveFromDate),\r\n effectiveFromTime: formatTime(effectiveFromDate),\r\n expiryDate: toISOLocalDate(railDocument.expiryDate),\r\n expiryTime: formatTime(railDocument.expiryDate),\r\n publishDate: toISOLocalDate(railDocument.publishDate),\r\n publishTime: formatTime(railDocument.publishDate),\r\n requiresAcknowledgementAndNotify: railDocument.requiresAcknowledgementAndNotify,\r\n releaseNotes: railDocument.releaseNotes,\r\n rescindDocumentReason: railDocument.rescindDocumentReason,\r\n fileName: railDocument.fileName,\r\n reviewPeriod: railDocument.reviewPeriod,\r\n reviewRecurring: railDocument.reviewRecurring,\r\n relatedDocuments: (railDocument.relatesTo || []).map(x => ({ id: x.key, title: x.value })),\r\n canEdit: railDocument.canEdit,\r\n acknowledgeRequired: railDocument.acknowledgeRequired\r\n } as Document;\r\n return val;\r\n },\r\n mapToNewDocument: (document: Document): NewDocument => {\r\n console.log('Mapping to new document');\r\n const val = {\r\n documentModule: document.documentModule,\r\n documentType: document.subTypeId ? document.subTypeId : document.typeId,\r\n title: document.title,\r\n documentNumber: document.documentNumber,\r\n versionNumber: document.versionNumber,\r\n effectiveFrom: dateToBrowserSafeString(new Date(isoDateStringToBrowserSafeString(`${ document.effectiveFromDate } ${ document.effectiveFromTime || '00:00' }`))),\r\n expiryDate: document.expiryDate\r\n ? dateToBrowserSafeString(new Date(isoDateStringToBrowserSafeString(`${ document.expiryDate } ${ document.expiryTime || '00:00' }`)))\r\n : undefined,\r\n reviewPeriod: document.reviewPeriod,\r\n reviewRecurring: document.reviewRecurring,\r\n requiresAcknowledgementAndNotify: document.requiresAcknowledgementAndNotify || false,\r\n releaseNotes: document.releaseNotes,\r\n rescindDocumentReason: document.rescindDocumentReason,\r\n file: document.file,\r\n relatesTo: document.relatedDocuments?.map(x => x.id)\r\n } as NewDocument;\r\n\r\n return val;\r\n }\r\n}\r\n","import React from 'react';\r\n\r\nimport {\r\n Button\r\n , Modal\r\n , ModalBody\r\n} from 'reactstrap';\r\nimport './InfoModal.css'\r\n\r\ntype IModalProps = {\r\n text?: string,\r\n html?: React.ReactNode\r\n modalClass?: string,\r\n isOpen: boolean,\r\n actionButtonText?: string;\r\n action?: () => void;\r\n closeButtonText?: string;\r\n closeAction?: () => void;\r\n}\r\n\r\nconst RootModal = (props: IModalProps) => {\r\n\r\n const closeModal = () => {\r\n if (props.closeAction) props.closeAction();\r\n }\r\n\r\n const closeText = props.closeButtonText || \"OK\";\r\n\r\n const closeButtonClass = `${ props.actionButtonText ? 'btn-secondary' : 'btn-primary' } pr-4 pl-4 mb-5`;\r\n\r\n return (\r\n \r\n \r\n \r\n {props.text ?
{props.text}
: <>}\r\n {props.html ? props.html : <>}\r\n
\r\n
\r\n \r\n {props.actionButtonText ? : }\r\n
\r\n \r\n
\r\n )\r\n};\r\n\r\n\r\nconst InfoModal = (props: {\r\n text?: string,\r\n html?: React.ReactNode,\r\n modalClass?: string,\r\n closeAction?: () => void,\r\n isOpen: boolean\r\n}) => ();\r\n\r\n\r\nexport const ExitCancelModel = (props: {\r\n text: string,\r\n isOpen: boolean,\r\n actionButtonText: string,\r\n action: () => void,\r\n closeButtonText: string,\r\n closeAction?: () => void\r\n}) => ();\r\n\r\nexport default InfoModal\r\n","export enum DocumentReviewPeriodEnum {\r\n None = 0,\r\n Months6 = 1,\r\n Months12 = 2,\r\n Months18 = 3,\r\n Months24 = 4,\r\n Months36 = 5\r\n}\r\n\r\nconst getPeriod = (val: DocumentReviewPeriodEnum | string | undefined) => {\r\n let period: DocumentReviewPeriodEnum = DocumentReviewPeriodEnum.None;\r\n\r\n if (typeof (val) === 'number') {\r\n period = val;\r\n }\r\n if (typeof (val) === 'string') {\r\n period = parseInt(val);\r\n }\r\n return period;\r\n}\r\n\r\nexport const getMonths = (val: DocumentReviewPeriodEnum | string | undefined) => {\r\n const period = getPeriod(val);\r\n\r\n switch (period) {\r\n case DocumentReviewPeriodEnum.Months6:\r\n return 6;\r\n case DocumentReviewPeriodEnum.Months12:\r\n return 12;\r\n case DocumentReviewPeriodEnum.Months18:\r\n return 18;\r\n case DocumentReviewPeriodEnum.Months24:\r\n return 24\r\n case DocumentReviewPeriodEnum.Months36:\r\n return 36\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nexport const documentReviewPeriodDisplay = (val: DocumentReviewPeriodEnum | string | undefined) => {\r\n const period = getPeriod(val);\r\n\r\n if (period === DocumentReviewPeriodEnum.None) {\r\n return \"None\";\r\n }\r\n\r\n return `${getMonths(period)} months`;\r\n}\r\n","import { BehaviorSubject } from 'rxjs';\r\nimport { Document } from \"shared/models/site/document\";\r\nimport { toISOLocalDate, formatTime } from \"shared/models/mapping/mapping\";\r\nimport { DocumentReviewPeriodEnum } from \"shared/enums/document-review-period-enum\"\r\n\r\nexport type DocumentAddEditState = {\r\n document: Document,\r\n originalDocument: Document\r\n}\r\n\r\nconst emptyDocument: Document = {\r\n effectiveFromDate: toISOLocalDate(new Date()),\r\n effectiveFromTime: formatTime(new Date()),\r\n publishDate: toISOLocalDate(new Date()),\r\n publishTime: formatTime(new Date()),\r\n documentModule: 2,\r\n relatedDocuments: [],\r\n subTypeLabel: null,\r\n reviewPeriod: DocumentReviewPeriodEnum.None,\r\n requiresAcknowledgementAndNotify: true\r\n}\r\nconst createInitialState = (): DocumentAddEditState => ({ document: Object.assign({}, emptyDocument), originalDocument: {} })\r\n\r\nconst documentAddEditStateSubject = new BehaviorSubject(createInitialState());\r\n\r\nexport const documentAddEditState = {\r\n subscribe: (setState: any) => documentAddEditStateSubject.subscribe(setState),\r\n setState: (fn: (state: DocumentAddEditState) => void) => {\r\n var newState = Object.assign({}, documentAddEditStateSubject.getValue());\r\n fn(newState);\r\n documentAddEditStateSubject.next(newState);\r\n },\r\n reset: () => {\r\n documentAddEditStateSubject.next(createInitialState());\r\n }\r\n}","import { DocumentModuleEnum } from \"shared/enums/document-module-enum\";\r\nimport { documentReviewPeriodDisplay, DocumentReviewPeriodEnum } from \"shared/enums/document-review-period-enum\";\r\nimport { isoDateStringToBrowserSafeString } from \"../mapping/mapping\";\r\nimport { RelatedDocument } from \"./related-document\";\r\n\r\n\r\nexport interface Document {\r\n documentId?: number,\r\n typeLabel?: string,\r\n subTypeLabel?: string | null,\r\n documentModule?: DocumentModuleEnum,\r\n typeId?: number,\r\n subTypeId?: number,\r\n title?: string,\r\n documentNumber?: string,\r\n versionNumber?: string,\r\n effectiveFromDate?: string,\r\n effectiveFromTime?: string,\r\n expiryDate?: string,\r\n expiryTime?: string,\r\n reviewPeriod?: DocumentReviewPeriodEnum,\r\n reviewRecurring?: boolean,\r\n notifyUsers?: boolean,\r\n releaseNotes?: string,\r\n rescindDocumentReason?: string,\r\n file?: File,\r\n fileName?: string,\r\n publishDate?: string,\r\n publishTime?: string,\r\n requiresAcknowledgementAndNotify?: boolean,\r\n relatedDocuments?: Array,\r\n canEdit?: boolean,\r\n acknowledgeRequired?: boolean\r\n}\r\n\r\ntype IDocumentDisplayProps = {\r\n effectiveFromDateDisplay: string,\r\n expiryDateDisplay: string,\r\n publishDateDisplay: string,\r\n reviewPeriodDisplay: string\r\n}\r\n\r\nexport type IDocumentDisplay = IDocumentDisplayProps & Document;\r\n\r\nexport const toDisplayDocument = (d: Document): IDocumentDisplay => {\r\n \r\n var dateTimeFormat = new Intl.DateTimeFormat(\"en-AU\", {});\r\n var effectiveFromDate = d.effectiveFromDate ? new Date(isoDateStringToBrowserSafeString(`${d.effectiveFromDate} ${d.effectiveFromTime || '00:00'}`)) : undefined;\r\n var expiryDateDate = d.expiryDate ? new Date(isoDateStringToBrowserSafeString(`${d.expiryDate} ${d.expiryTime || '00:00'}`)) : undefined;\r\n var publishDateDate = d.publishDate ? new Date(isoDateStringToBrowserSafeString(`${d.publishDate} ${d.publishTime || '00:00'}`)) : undefined;\r\n var reviewPeriodDisplay = `${documentReviewPeriodDisplay(d.reviewPeriod)}` + `${(d.reviewRecurring ? \" recurring\" : \"\")}`;\r\n return {\r\n ...d,\r\n effectiveFromDateDisplay: effectiveFromDate ? dateTimeFormat.format(effectiveFromDate) : '',\r\n expiryDateDisplay: expiryDateDate ? dateTimeFormat.format(expiryDateDate) : '',\r\n publishDateDisplay: publishDateDate ? dateTimeFormat.format(publishDateDate) : '',\r\n reviewPeriodDisplay: `${reviewPeriodDisplay}`\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { useState } from 'react';\r\nimport { Search } from '@material-ui/icons';\r\nimport { useEffect } from 'react';\r\n\r\ninterface ISearchBoxProps {\r\n search: (value: string) => void;\r\n value?: string;\r\n placeholder?: string;\r\n onChange?: (value: string) => void;\r\n onKeyPress?: (e: React.KeyboardEvent) => boolean;\r\n searchDisabled?: boolean;\r\n searchDelayMs?: number;\r\n}\r\n\r\nexport const SearchBox = (props: ISearchBoxProps) => {\r\n const [searchText, setSearchText] = useState(props.value ?? \"\");\r\n const [searchTextEvent, setSearchTextEvent] = useState({ autoSearch: false });\r\n const [searchTimer, setSearchTimer] = useState(undefined as NodeJS.Timeout | undefined);\r\n const [searchDelayMs] = useState(props.searchDelayMs || 300);\r\n\r\n const search = () => {\r\n console.log(\"Searching for: \" + searchText);\r\n props.search(searchText);\r\n };\r\n\r\n const searchTextSet = (text: string) => {\r\n setSearchText(text);\r\n setSearchTextEvent({ autoSearch: true });\r\n }\r\n\r\n useEffect(() => {\r\n if (searchTextEvent && !searchTextEvent.autoSearch) {\r\n return;\r\n }\r\n\r\n if (searchTimer) {\r\n clearTimeout(searchTimer);\r\n }\r\n\r\n if (!searchText || searchText.length < 2) {\r\n return;\r\n }\r\n\r\n let timer = setTimeout(() => search(), searchDelayMs);\r\n setSearchTimer(timer);\r\n\r\n return () => {\r\n if (!searchTimer) {\r\n clearTimeout(searchTimer);\r\n }\r\n };\r\n }, [searchTextEvent]);\r\n\r\n return (\r\n
\r\n { searchTextSet(e.target.value); }}\r\n placeholder={props.placeholder}\r\n onKeyPress={e => {\r\n if (e.key === 'Enter') {\r\n search();\r\n return false;\r\n }\r\n return true;\r\n }}\r\n />\r\n\r\n {!props.searchDisabled &&\r\n \r\n }\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { KeyboardArrowDownOutlined, KeyboardArrowUpOutlined } from '@material-ui/icons';\r\n\r\ninterface ToggleButtonProps {\r\n isOpen?: any;\r\n onClick?: any;\r\n isInvalid?: any;\r\n className?: string;\r\n};\r\n\r\nexport const ToggleButton = (props: ToggleButtonProps) => (\r\n {\r\n // Prevent input from losing focus.\r\n e.preventDefault();\r\n }}>\r\n {props.isInvalid ? undefined : props.isOpen ? : }\r\n \r\n);","var _path;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgFilter(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 20,\n height: 20,\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"g\", {\n \"data-name\": \"icon Filter\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n \"data-name\": \"Rectangle 1838\",\n style: {\n fill: \"none\"\n },\n d: \"M0 0h20v20H0z\"\n }), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n \"data-name\": \"Path 4217\",\n d: \"M17.472 3.417a.871.871 0 0 0-.672-1.419H2.87a.87.87 0 0 0-.805.544.818.818 0 0 0-.065.326.87.87 0 0 0 .2.553l.55.672 3.1 3.79 1.969 2.393a.87.87 0 0 1 .27.642v5.88a.869.869 0 0 0 1.373.709l.052-.039 1.669-1.253.048-.035a.87.87 0 0 0 .339-.688v-4.573a.87.87 0 0 1 .268-.629l1.971-2.406 3.655-4.463z\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgFilter);\nexport default __webpack_public_path__ + \"static/media/filter.585517b2.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as CheckBoxOutlined } from \"assets/icons/check-box-outlined.svg\";\r\nimport { ReactComponent as CheckBoxOutlinedBlank } from \"assets/icons/check-box-outlined-blank.svg\";\r\nimport * as React from 'react';\r\nimport { ReactNode } from \"react\";\r\n\r\ninterface ICheckboxProps {\r\n checkedValue: true | false | 'partial',\r\n toggle?: () => void,\r\n}\r\n\r\nexport const Checkbox = (props: ICheckboxProps) => {\r\n const onClick = (e: React.MouseEvent) => {\r\n if (props.toggle) {\r\n e.stopPropagation();\r\n props.toggle();\r\n }\r\n };\r\n\r\n return (\r\n
\r\n {\r\n props.checkedValue !== false\r\n ? \r\n : \r\n }\r\n
\r\n );\r\n};\r\n\r\ninterface ILablledCheckboxProps extends ICheckboxProps {\r\n children: ReactNode\r\n}\r\n\r\nexport const LabelledCheckbox = (props: ILablledCheckboxProps) => {\r\n const onClick = (e: React.MouseEvent) => {\r\n if (props.toggle) {\r\n e.stopPropagation();\r\n props.toggle();\r\n }\r\n };\r\n\r\n return (\r\n \r\n \r\n {props.children}\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useState, ReactNode, useEffect } from \"react\";\r\nimport { useClickOutsideRef } from './UseClickOutsideRef';\r\nimport { SearchBox } from './SearchBox';\r\nimport { ToggleButton } from './ToggleButton';\r\nimport { LabelledCheckbox } from './LabelledCheckbox';\r\n\r\nexport interface IListProps {\r\n toggleSelected?: (item: T) => void,\r\n onClick?: (item: T) => void,\r\n listSize?: number,\r\n maxItems?: number,\r\n isSelected?: (item: T) => true | false | 'partial',\r\n filterAsync?: (name: string, items?: T[]) => Promise,\r\n filter?: (name: string, items?: T[]) => T[],\r\n itemFilter?: (item: T, filterText: string) => boolean,\r\n expanded?: boolean,\r\n setExpanded?: (value: boolean) => void,\r\n filterText?: string,\r\n setFilterText?: (value: string) => void,\r\n refreshFilterOnDataSourceChange?: boolean\r\n dataSource?: T[],\r\n displayLoadingData?: boolean,\r\n selected: T[],\r\n filterTextPlaceholder?: string,\r\n listItemType: any,\r\n selectItems?: (items: T[]) => void,\r\n deselectItems?: (items: T[]) => void,\r\n noResultsMessage: string,\r\n buildKey: (item: T) => any,\r\n summary?: string,\r\n searchDisabled?: boolean,\r\n searchDelayMs?: number,\r\n invalid?: boolean\r\n}\r\n\r\nexport const List = (props: IListProps) => {\r\n const [filteredItems, setFilteredItems] = useState(props.dataSource);\r\n const [showAll, setShowAll] = useState(false);\r\n const ListItemType = props.listItemType;\r\n\r\n useEffect(() => {\r\n if (\r\n filteredItems &&\r\n filteredItems.length > 0 &&\r\n props.filterText &&\r\n props.refreshFilterOnDataSourceChange\r\n ) {\r\n filter(props.filterText);\r\n return;\r\n }\r\n\r\n setFilteredItems(props.dataSource);\r\n }, [props.dataSource]);\r\n\r\n const collapse = () => {\r\n if (props.expanded && props.setExpanded) {\r\n props.setExpanded(false);\r\n }\r\n };\r\n\r\n const expand = () => {\r\n if (!props.expanded && props.setExpanded) {\r\n props.setExpanded(true);\r\n }\r\n };\r\n\r\n const toggleList = () => {\r\n if (props.setExpanded) {\r\n props.setExpanded(!props.expanded);\r\n }\r\n };\r\n\r\n const autoCloseRef = useClickOutsideRef(collapse);\r\n\r\n const filter = (name: string) => {\r\n setShowAll(false);\r\n\r\n if (props.setFilterText) {\r\n props.setFilterText(name);\r\n }\r\n\r\n if (props.filter) {\r\n setFilteredItems(props.filter(name, props.dataSource));\r\n expand();\r\n }\r\n\r\n if (props.filterAsync) {\r\n props.filterAsync(name, props.dataSource).then(result => {\r\n if (result) {\r\n setFilteredItems(result);\r\n\r\n expand();\r\n }\r\n });\r\n }\r\n };\r\n\r\n const isSelected = (item: T) => {\r\n if (props.isSelected) {\r\n return props.isSelected(item);\r\n }\r\n\r\n if (item) {\r\n if (props.buildKey) {\r\n const itemKey = props.buildKey(item);\r\n\r\n return props.selected.findIndex(i => props.buildKey(i) === itemKey) > -1;\r\n } else {\r\n return props.selected.indexOf(item);\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const selectAll = () => {\r\n var partialSelected = (filteredItems ?? []).some(f => isSelected(f) === false);\r\n\r\n if (props.selectItems && partialSelected) {\r\n props.selectItems(filteredItems ?? []);\r\n } else {\r\n if (props.deselectItems) {\r\n props.deselectItems(filteredItems ?? []);\r\n }\r\n }\r\n };\r\n\r\n const itemFilter = (item: T) => {\r\n if (!props.itemFilter) return true;\r\n\r\n if (!props.filterText) return true;\r\n\r\n return props.itemFilter(item, props.filterText);\r\n };\r\n\r\n return (\r\n
\r\n\r\n {props.displayLoadingData && (props.dataSource == undefined || props.dataSource?.length < 1) ?\r\n
Loading...
\r\n :\r\n
\r\n \r\n \r\n
\r\n }\r\n\r\n {props.expanded &&\r\n
\r\n {\r\n props.summary &&\r\n
{props.summary}
\r\n }\r\n\r\n {(filteredItems && filteredItems.length > 1 && props.selectItems) &&\r\n
\r\n isSelected(f) === false)}>Select all\r\n
\r\n }\r\n\r\n {filteredItems && filteredItems.length > 0 &&\r\n filteredItems.filter(itemFilter).filter(\r\n (item, index) => (((props.maxItems ?? 0) > 0) && !showAll) ? (index < (props.maxItems ?? 0)) : true\r\n ).map(\r\n (item, index) =>\r\n 0 ? filteredItems[index - 1] : null}\r\n selected={isSelected(item)} />\r\n )\r\n }\r\n\r\n {!showAll && filteredItems && props.maxItems && (filteredItems.length > props.maxItems) &&\r\n
setShowAll(true)}>{filteredItems.length - props.maxItems} more items, show more...
\r\n }\r\n
\r\n }\r\n
\r\n );\r\n};\r\n\r\nexport interface IListItemProps {\r\n item: T,\r\n toggle: (item: T) => void,\r\n children: ReactNode,\r\n selected: true | false | 'partial',\r\n selectedItems?: T[],\r\n indent?: number,\r\n previousItem?: T\r\n}\r\n\r\nexport const ListItem = (props: IListItemProps) => {\r\n return (\r\n
props.toggle(props.item)}>{props.children}
\r\n );\r\n};\r\n\r\nexport const StringListItem = (props: IListItemProps) => {\r\n return (\r\n \r\n
\r\n \r\n {props.item}\r\n \r\n
\r\n
\r\n );\r\n};","import * as React from 'react';\r\nimport { useEffect, useRef } from \"react\";\r\n\r\nexport const useClickOutsideRef = (\r\n callback: (e: MouseEvent | TouchEvent) => void\r\n) => {\r\n const ref = useRef(null);\r\n\r\n useEffect(() => {\r\n const handler = (e: MouseEvent | TouchEvent) => {\r\n const node = ref?.current;\r\n\r\n // if the mouse click occurred outside of this component, then let the component know it lost focus\r\n if (node && !node.contains(e.target as Node)) {\r\n callback(e);\r\n }\r\n\r\n return false;\r\n };\r\n\r\n // listen for mouse clicks on the page\r\n document.addEventListener(\"mousedown\", handler);\r\n\r\n return () => {\r\n // clean up the listener\r\n document.removeEventListener(\"mousedown\", handler);\r\n };\r\n });\r\n\r\n return ref;\r\n};","import React, { useState, useEffect } from \"react\";\r\nimport { Button, Col, Modal, ModalBody, ModalHeader, Row } from \"reactstrap\";\r\nimport { RailDocument } from \"shared/models/api/models\";\r\nimport { Document } from \"shared/models/site/document\";\r\nimport { RelatedDocument } from \"shared/models/site/related-document\";\r\nimport { ExitCancelModel } from 'components/ui/InfoModal';\r\nimport { IDocumentFilter, RelatedRulebookDocumentView } from \"components/ui/DocumentRules\";\r\nimport { IListItemProps, List } from \"components/ui/Lists\";\r\nimport { Checkbox } from \"components/ui/LabelledCheckbox\";\r\nimport { DocumentFilterList, ILeafItem, ModalClose, RelatedDocumentsH2 } from \"components/menu/Labels\";\r\nimport { documentAddEditState } from './AddEditDocumentState'\r\nimport { Chip } from '@material-ui/core'\r\nimport './RelatedDocuments.css'\r\n\r\n\r\ninterface IRelatedDocumentChipsProps {\r\n documents: Array,\r\n deleteAction?: (id: number) => void\r\n}\r\n\r\nexport const RelatedDocumentChips = (props: IRelatedDocumentChipsProps) => {\r\n return (\r\n
\r\n {\r\n props.documents.map((d, i) => {\r\n const deleteAction = props.deleteAction ? () => {\r\n if (props.deleteAction) props.deleteAction(d.id)\r\n } : undefined;\r\n\r\n return (\r\n \r\n )\r\n })\r\n }\r\n
\r\n );\r\n}\r\n\r\nexport const RelatedDocumentList = (props: IRelatedDocumentChipsProps) => {\r\n return (\r\n
\r\n {\r\n props.documents.map((d, i) => {\r\n return (\r\n
{d.title}
\r\n );\r\n })\r\n }\r\n
\r\n );\r\n}\r\n\r\n// component to show the search results for the text based document search\r\nexport const DocumentListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n \r\n {props.item.type}\r\n {props.item.subType && {props.item.subType}}\r\n {props.item.title}\r\n
;\r\n\r\ninterface IRelatedDocumentsProps {\r\n isOpen: boolean,\r\n closeAction: () => void,\r\n document: Document\r\n}\r\n\r\nexport const RelatedDocuments = (props: IRelatedDocumentsProps) => {\r\n const [selectedDocuments, setSelectedDocuments] = useState([] as RailDocument[]);\r\n const [menuDocuments, setMenuDocuments] = useState([] as ILeafItem[]);\r\n const [activeFilter, setActiveFilter] = useState(null as IDocumentFilter | null);\r\n const [activeSubFilter, setActiveSubFilter] = useState(null as IDocumentFilter | null);\r\n const [documentsByNameFilter, setDocumentsByNameFilter] = useState(\"\");\r\n const [documentsByNameExpanded, setDocumentsByNameExpanded] = useState(false);\r\n const [documentSearchSummary, setDocumentSearchSummary] = useState(\"\");\r\n\r\n useEffect(() => {\r\n if (!props.isOpen) return;\r\n\r\n var rulebookCache = RelatedRulebookDocumentView.cache;\r\n var relatedDocsIds = (props?.document?.relatedDocuments ?? []).map(rd => rd.id);\r\n\r\n if (rulebookCache && relatedDocsIds.length > 0) {\r\n // is the cache stale?\r\n if (rulebookCache.lastRefresh.getTime() + rulebookCache.maxAge < new Date().getTime()) {\r\n // update the cache and use that list\r\n rulebookCache.refresh().then(result => {\r\n rulebookCache = result;\r\n\r\n if (relatedDocsIds.length > 0) {\r\n setSelectedDocuments(rulebookCache.data.filter(doc => relatedDocsIds.includes(doc.id)));\r\n }\r\n });\r\n } else {\r\n // use the cache\r\n setSelectedDocuments(rulebookCache.data.filter(doc => relatedDocsIds.includes(doc.id)));\r\n }\r\n }\r\n }, [props.isOpen]);\r\n\r\n const [isConfirmClose, setIsConfirmClose] = useState(false);\r\n\r\n const confirmCloseText: string = 'Are you sure you want to exit?\\nUnsaved data will be lost.';\r\n\r\n const showClosePrompt = () => {\r\n setIsConfirmClose(true);\r\n }\r\n\r\n const hideClosePrompt = () => {\r\n setIsConfirmClose(false);\r\n }\r\n\r\n const closeModal = () => {\r\n setIsConfirmClose(false);\r\n setMenuDocuments(f => f.filter(x => false));\r\n props.closeAction()\r\n }\r\n\r\n // Adds releated documents to the document object\r\n const addDocuments = () => {\r\n const doc = props.document;\r\n doc.relatedDocuments = selectedDocuments;\r\n documentAddEditState.setState(s => s.document = doc);\r\n closeModal();\r\n }\r\n\r\n // removes documents that have been selected o\r\n const removeDocument = (id: number) => {\r\n setSelectedDocuments(f => f.filter(i => i.id != id));\r\n const leafItem = menuDocuments.filter(x => x.id === id)[0];\r\n if (leafItem && leafItem.selected) leafItem.selected = false;\r\n }\r\n\r\n const selectDocument = (relatedDocument: RailDocument) => {\r\n setSelectedDocuments(f => f.filter(i => i.id !== relatedDocument.id).concat(relatedDocument));\r\n const leafItem = menuDocuments.filter(x => x.id === relatedDocument.id)[0];\r\n if (leafItem && !leafItem.selectAction) leafItem.selected = true;\r\n }\r\n\r\n const onDocumentClick = (doc: RailDocument) => {\r\n if (selectedDocuments.findIndex(sd => sd.id === doc.id) > -1) {\r\n removeDocument(doc.id);\r\n } else {\r\n selectDocument(doc);\r\n }\r\n };\r\n\r\n const documentSearchByName = async (name: string, documents?: RailDocument[]) => {\r\n if (!documents || !RelatedRulebookDocumentView.cache?.data) {\r\n return [] as RailDocument[];\r\n }\r\n\r\n const lcName = name.toLowerCase();\r\n\r\n const result = await documents.filter(doc => {\r\n return (doc.title.toLowerCase().indexOf(lcName) > -1\r\n || doc.documentNumber.toLowerCase().indexOf(lcName) > -1\r\n || doc.type?.toLowerCase().indexOf(lcName) > -1\r\n || doc.subType?.toLowerCase().indexOf(lcName) > -1\r\n || doc.fileName.toLowerCase().indexOf(lcName) > -1);\r\n });\r\n\r\n setDocumentSearchSummary(result.length + ' search result' + (result.length === 1 ? \"\" : \"s\") + ' for the search \"' + name + '\"');\r\n\r\n return result;\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

Selected documents:

\r\n \r\n\r\n

Search for related documents

\r\n \r\n \r\n \r\n listItemType={DocumentListItem}\r\n filterText={documentsByNameFilter}\r\n setFilterText={setDocumentsByNameFilter}\r\n expanded={documentsByNameExpanded}\r\n setExpanded={setDocumentsByNameExpanded}\r\n buildKey={item => { return item.id; }}\r\n dataSource={RelatedRulebookDocumentView.cache?.data}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n filterAsync={documentSearchByName}\r\n summary={documentSearchSummary}\r\n toggleSelected={onDocumentClick}\r\n noResultsMessage=\"No documents found\"\r\n filterTextPlaceholder=\"Enter document title, document number or keyword\"\r\n selected={selectedDocuments} />\r\n \r\n \r\n\r\n

Or select documents from the list

\r\n \r\n \r\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 RelatedDocuments;","import React, { } from 'react';\r\nimport { useState, useEffect } from 'react';\r\nimport { Document, toDisplayDocument } from \"shared/models/site/document\"\r\n\r\nimport {\r\n Button\r\n , ModalBody\r\n , Row\r\n , Col\r\n} from 'reactstrap';\r\n\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport './DocumentAdmin.css'\r\nimport { DocumentAddEditState, documentAddEditState } from './AddEditDocumentState'\r\nimport { ModalSubHeader } from './AddEditDocument';\r\nimport { RelatedDocumentList } from './RelatedDocuments';\r\n\r\nexport const SecondPage = (props: {\r\n completeAction: (document: Document) => void,\r\n backAction: () => void,\r\n isComplete: boolean,\r\n}) => {\r\n\r\n const [document, setDocument] = useState({} as Document)\r\n const [completing, setCompleting] = useState(false)\r\n\r\n useEffect(() => {\r\n const sub = documentAddEditState.subscribe((s: DocumentAddEditState) => {\r\n setDocument(s.document)\r\n });\r\n\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n\r\n const displayDocument = toDisplayDocument(document);\r\n\r\n const completeAction = () => {\r\n setCompleting(true);\r\n props.completeAction(document);\r\n }\r\n\r\n const items = [\r\n { label: \"Document type\", value: displayDocument.typeLabel },\r\n { label: \"Document sub-type\", value: displayDocument.subTypeLabel || 'N/A' },\r\n { label: \"Document title\", value: displayDocument.title },\r\n { label: \"Document number\", value: displayDocument.documentNumber },\r\n { label: \"Version number\", value: displayDocument.versionNumber },\r\n { label: \"Related documents\", value: (displayDocument.relatedDocuments || []).length > 0 ? : <>N/A },\r\n { label: \"Effective from date\", value: `${displayDocument.effectiveFromDateDisplay} ${displayDocument.effectiveFromTime}` },\r\n { label: \"Expiry date\", value: `${displayDocument.expiryDateDisplay || 'N/A'} ${displayDocument.expiryTime || ''}` },\r\n { label: \"Notfication and acknowledgement\", value: `${displayDocument.requiresAcknowledgementAndNotify ? \"YES\" : \"NO\"}` },\r\n { label: \"Review\", value: `${displayDocument.reviewPeriodDisplay}` },\r\n { label: \"Selected file\", value: displayDocument.file ? displayDocument.file.name : displayDocument.fileName || \"Error!\" },\r\n { label: \"Release Notes\", value: displayDocument.releaseNotes },\r\n { label: \"Rescind Document Reason\", value: displayDocument.rescindDocumentReason },\r\n ]\r\n return (\r\n \r\n \r\n
Check document details and confirm your upload
\r\n
\r\n\r\n \r\n <>\r\n {items.map((x, i) => {\r\n const className = (i % 2 === 0) ? 'p-2' : 'alternate-row p-2'\r\n return (\r\n \r\n {x.label}:\r\n {x.value}\r\n \r\n )\r\n })}\r\n
\r\n {props.isComplete\r\n ? \r\n : \r\n {completing\r\n ?\r\n \r\n \r\n \r\n :\r\n \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 { applicationState } from \"shared/store/applicationState\"\r\nimport { getAllDocumentTypes, getWritableDocumentTypes } from \"./railDocumentsApi\"\r\nimport { DocumentType as RailDocumentType } from \"shared/models/site/document-type\"\r\nimport { DocumentType } from \"shared/models/api/models\";\r\n\r\nconst mapper = (x: DocumentType): RailDocumentType => {\r\n return {\r\n key: x.name.replaceAll(' ', '').toLowerCase(),\r\n label: x.name,\r\n documentModule: x.documentModuleId,\r\n typeId: x.id,\r\n parentId: x.parentTypeId,\r\n documentTitleDefault: x.documentTitleDefault,\r\n documentTitleValidation: x.documentTitleValidation,\r\n documentNumberDefault: x.documentNumberDefault,\r\n documentNumberValidation: x.documentNumberValidation\r\n\r\n } as RailDocumentType;\r\n}\r\n// Load the document types into the app state\r\nexport const loadDocumentTypes = async () => {\r\n const docTypes = await getAllDocumentTypes();\r\n const mapped = docTypes\r\n .filter(x => (x.parentTypeId || 0) === 0)\r\n .map(x => (\r\n {\r\n ...mapper(x),\r\n children: docTypes.filter(dt => dt.parentTypeId === x.id).map(x => mapper(x))\r\n } as RailDocumentType));\r\n applicationState.setRailDocumentTypes(mapped);\r\n applicationState.setSearchableRailDocumentTypes(mapped);\r\n\r\n const writableDocTypes = await getWritableDocumentTypes();\r\n const writableMapped = writableDocTypes\r\n .filter(x => (x.parentTypeId || 0) === 0)\r\n .map(x => (\r\n {\r\n ...mapper(x),\r\n children: docTypes.filter(dt => dt.parentTypeId === x.id).map(x => mapper(x))\r\n } as RailDocumentType));\r\n applicationState.setWritableRailDocumentTypes(writableMapped);\r\n}\r\n\r\n// Given a document Id returns the root parent and the child item or parent and undefined if they are the same\r\nexport const getDocumentTypeFromId =\r\n (documentTypeId: number, items: Array): RailDocumentType | undefined =>\r\n items.flatMap(x => x.children || []).find(x => x.typeId === documentTypeId)\r\n || items.find(x => x.typeId === documentTypeId)\r\n","export enum DocumentModuleEnum {\r\n Rulebook = 1,\r\n Document = 2,\r\n}\r\n\r\nexport const documentModuleDisplay = (val: DocumentModuleEnum | string | undefined) => {\r\n let module: DocumentModuleEnum = DocumentModuleEnum.Rulebook;\r\n\r\n if (typeof (val) === 'number') {\r\n module = val;\r\n }\r\n\r\n if (typeof (val) === 'string') {\r\n module = parseInt(val);\r\n }\r\n\r\n switch (module) {\r\n case DocumentModuleEnum.Rulebook:\r\n return \"Rail Rulebook\";\r\n break;\r\n case DocumentModuleEnum.Document:\r\n return \"Rail Document\";\r\n break;\r\n }\r\n\r\n return \"\";\r\n}","import { DocumentModuleEnum } from \"shared/enums/document-module-enum\";\r\nimport { RailDocument } from \"shared/models/api/models\";\r\nimport { DocumentType as IDocumentTypeItem } from 'shared/models/site/document-type';\r\nimport { Document } from 'shared/models/site/document';\r\n\r\nconst isAdditionalRulebookType = (type: string): boolean => [\r\n \"Operating Instructions\",\r\n \"Operating Notices\"\r\n].filter(x => x == type).length > 0;\r\n\r\n// Rail documents also include operating notices and instructions. Define some global filters here so that they can easily be redefined. \r\nexport const isRulebookRailDocument = (x: RailDocument): boolean => (x.moduleId === DocumentModuleEnum.Rulebook || isAdditionalRulebookType(x.type));\r\nexport const isRulebookDocument = (x: Document): boolean => (x.documentModule === DocumentModuleEnum.Rulebook || isAdditionalRulebookType(x.typeLabel || ''));\r\nexport const isRuleBookDocumentType = (x: IDocumentTypeItem): boolean => x.documentModule === DocumentModuleEnum.Rulebook || isAdditionalRulebookType(x.label);","import React from 'react';\r\nimport { useState, useEffect, useLayoutEffect } from 'react';\r\nimport { Document } from \"shared/models/site/document\"\r\nimport { DocumentType as IDocumentTypeItem } from 'shared/models/site/document-type';\r\nimport RelatedDocuments from './RelatedDocuments';\r\n\r\nimport {\r\n Button\r\n , ModalBody\r\n , FormGroup\r\n , Label\r\n , Input\r\n , Row\r\n , Col,\r\n FormFeedback\r\n} from 'reactstrap';\r\n\r\nimport { Typeahead } from 'react-bootstrap-typeahead';\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport Toggle from 'bootstrap-switch-button-react';\r\nimport { ToolTipButton, ToolTipLabel } from \"components/menu/Labels\";\r\nimport './DocumentAdmin.css'\r\nimport { toISOLocalDate } from \"shared/models/mapping/mapping\";\r\nimport useSelector from 'hooks/useSelector';\r\nimport { getDocumentTypeFromId } from 'shared/services/documentTypeService';\r\nimport { DocumentAddEditState, documentAddEditState } from './AddEditDocumentState'\r\nimport { PageView } from './AddEditDocument';\r\nimport { RelatedDocumentChips } from './RelatedDocuments';\r\nimport './DocumentAdmin.css'\r\nimport InfoModal from 'components/ui/InfoModal';\r\nimport { DocumentReviewPeriodEnum, documentReviewPeriodDisplay, getMonths } from \"shared/enums/document-review-period-enum\"\r\nimport { DocumentTypeEnum } from 'shared/enums/document-type-enum';\r\nimport { isRuleBookDocumentType, isRulebookDocument } from 'helpers/filters';\r\nimport { RelatedDocument } from 'shared/models/site/related-document';\r\nimport { IDocumentValidationRequest, validateDocument } from 'shared/services/railDocumentsApi';\r\nimport { RelatedRulebookDocumentView } from 'components/ui/DocumentRules';\r\nimport { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons';\r\n\r\n// A first attempt at page validation\r\ntype PageValidation = {\r\n isValid?: boolean,\r\n titleValidation?: FieldValidation,\r\n documentNumberValidation?: FieldValidation,\r\n fileValidation?: FieldValidation,\r\n documentTypeValidation?: FieldValidation,\r\n effectiveDateValidation?: FieldValidation,\r\n expireDateValidation?: FieldValidation,\r\n versionNumberValidation?: FieldValidation,\r\n subTypeValidation?: FieldValidation,\r\n rescindDocumentReasonValidation?: FieldValidation\r\n}\r\n\r\ntype FieldValidation = {\r\n display: boolean,\r\n message: string\r\n}\r\n\r\nconst requiredValidation = (field?: string) => ((field || '').trim() === '')\r\nconst minLengthValidation = (minLength: number, field?: string) => (field && field.length < minLength)\r\nconst validateForm = (doc: Document, view: PageView, display: boolean, docTypes: IDocumentTypeItem[]): PageValidation => {\r\n //Display will set if the validation will appear during editing the form or on submit\r\n\r\n let docType = {} as IDocumentTypeItem;\r\n if (docTypes.length > 0) {\r\n docType = docTypes[0];\r\n if (typeof (doc.subTypeId) === 'number') {\r\n var subtypeIndex = docType.children?.findIndex(t => t.typeId == doc.subTypeId);\r\n if (docType.children !== undefined && typeof (subtypeIndex) === 'number') {\r\n docType = docType.children[subtypeIndex];\r\n }\r\n }\r\n }\r\n\r\n var pv: PageValidation = {\r\n titleValidation: validateTitle(doc, view, display, docType),\r\n documentNumberValidation: validateDocumentNumber(doc, view, display, docType),\r\n fileValidation: validateFile(doc, view, display),\r\n documentTypeValidation: requiredValidation(doc.typeLabel) ? { display: display, message: \"Document type is required\" } : undefined,\r\n effectiveDateValidation: requiredValidation(doc.effectiveFromDate) ? { display: display, message: \"Effective date is required\" } : undefined,\r\n versionNumberValidation: validateVersionNumber(doc, view, display, docType),\r\n subTypeValidation: doc.subTypeLabel == null ? { display: display, message: \"Document sub-type is required\" } : undefined,\r\n rescindDocumentReasonValidation: view === PageView.Rescind && !doc.rescindDocumentReason ? { display: display, message: \"Reason for rescinding document is required\" } : undefined\r\n }\r\n\r\n pv.isValid = !(pv.titleValidation) &&\r\n !(pv.documentNumberValidation) &&\r\n !(pv.fileValidation) &&\r\n !(pv.documentTypeValidation) &&\r\n !(pv.effectiveDateValidation) &&\r\n !(pv.expireDateValidation) &&\r\n !(pv.versionNumberValidation) &&\r\n !(pv.rescindDocumentReasonValidation)\r\n return pv;\r\n}\r\n\r\nconst validateTitle = (doc: Document, view: PageView, display: boolean, docType: IDocumentTypeItem): FieldValidation | undefined => {\r\n if (requiredValidation(doc.title)) {\r\n return { display: display, message: \"Document title is required\" } as FieldValidation;\r\n }\r\n\r\n if (typeof (docType?.documentTitleValidation) === 'string' && typeof (doc.title) === 'string') {\r\n let re = new RegExp(docType.documentTitleValidation);\r\n if (!re.test(doc.title)) {\r\n let fmt = docType?.documentTitleDefault.replaceAll('{', '').replaceAll('}', '');\r\n return { display: display, message: `Document title required prefix: ${fmt}` } as FieldValidation;\r\n }\r\n\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst validateDocumentNumber = (doc: Document, view: PageView, display: boolean, docType: IDocumentTypeItem): FieldValidation | undefined => {\r\n if (requiredValidation(doc.documentNumber)) {\r\n return { display: display, message: \"Document number is required\" } as FieldValidation;\r\n }\r\n\r\n if (minLengthValidation(7, doc.documentNumber)) {\r\n return { display: display, message: \"Document number should be at least 7 characters\" } as FieldValidation;\r\n }\r\n\r\n if (typeof (docType?.documentNumberValidation) === 'string' && typeof (doc.documentNumber) === 'string') {\r\n let re = new RegExp(docType.documentNumberValidation);\r\n if (!re.test(doc.documentNumber)) {\r\n let fmt = docType?.documentNumberDefault.replaceAll('{', '').replaceAll('}', '');\r\n return { display: display, message: `Document number required format: ${fmt}` } as FieldValidation;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst validateVersionNumber = (doc: Document, view: PageView, display: boolean, docType: IDocumentTypeItem): FieldValidation | undefined => {\r\n if (requiredValidation(doc.versionNumber)) {\r\n return { display: display, message: \"Version number is required\" } as FieldValidation;\r\n }\r\n\r\n let re = /^[0-9]+\\.[0-9]+$/;\r\n if (!re.test(doc.versionNumber || \"\")) {\r\n return { display: display, message: \"Version number must be decimal format, e.g. 1.0\" } as FieldValidation;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst validateFile = (doc: Document, view: PageView, display: boolean): FieldValidation | undefined => {\r\n if (view == PageView.Edit) {\r\n return undefined;\r\n }\r\n\r\n if (!doc.file) {\r\n return { display: display, message: \"File is required\" };\r\n }\r\n\r\n if (!doc.file.name.toLocaleLowerCase().endsWith(\".pdf\")) {\r\n return { display: display, message: \"File must be a PDF\" };\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst getDefaultTitle = (docType?: IDocumentTypeItem) => {\r\n let title = '';\r\n if (docType?.documentTitleDefault != undefined) {\r\n title = documentTitleDefaultFormat(docType.documentTitleDefault);\r\n }\r\n return title;\r\n}\r\n\r\nconst getDefaultDocumentNumberTitle = (docType?: IDocumentTypeItem) => {\r\n let documentNumber = '';\r\n if (docType?.documentNumberDefault != undefined) {\r\n documentNumber = documentTitleDefaultFormat(docType.documentNumberDefault);\r\n }\r\n return documentNumber;\r\n}\r\n\r\nconst documentTitleDefaultFormat = (str: string) => {\r\n let today = new Date();\r\n let yy = today.toISOString().substring(2, 4);\r\n let mm = today.toISOString().substring(5, 7);\r\n\r\n str = str.replaceAll('{YY}', yy);\r\n str = str.replaceAll('{MM}', mm);\r\n return str;\r\n}\r\n\r\nconst toolTip = {\r\n expiryDate: <>The date/time that this document
should cease to be current and applicable ,\r\n documentNumber: <>This is the unique identifier of the document.
\r\n It will be either the 1Doc number, or;
\r\n ON YY-XXX for Operating Notices;
\r\n OI YY-XXX for Operating Instructions;
\r\n ROME YY-XXX for Memos;
\r\n RCOI YY-XXX for Rail Control Operating Instructions;
\r\n TGI YY-XXX for Track General Instructions;
\r\n TEI YY-XXX for Track Engineering Instructions;
\r\n SGI YY-XXX for Signalling General Instructions.,\r\n versionNumber: <>This is the unique version of the document;
will be the 1Doc version number if applicable,\r\n effectiveDate: 'The date/time that this document will be valid',\r\n reviewPeriod: <>After this period of time the
user should re-read and acknowledge the document,\r\n releaseNotes: <>Describes document summary
of change from the last version,\r\n rescindDocumentReason: <>Please specify why the document
is being rescinded\r\n}\r\n\r\n\r\nconst ToggleButton = ({ isOpen, onClick, isInvalid }: any) => (\r\n {\r\n // Prevent input from losing focus.\r\n e.preventDefault();\r\n }}>\r\n {isInvalid ? undefined : isOpen ? : }\r\n \r\n);\r\n\r\n\r\nconst RuleBookModuleId: number = 1;\r\nconst NonRuleBookModuleId: number = 2;\r\n\r\n\r\n// WIP would like to split out these sections again now that the form works better\r\nconst DocumentTypeSelect = (props: { document: Document, onChange: (e: any) => void }) => {\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\nconst RelatedDocumentsSection = (props: { document: Document, deleteAction: (id: number) => void }) => {\r\n const [showRelatedDocuments, setShowRelatedDocuments] = useState(false);\r\n\r\n return (\r\n <>\r\n

Related documents (optional)

\r\n \r\n
\r\n \r\n
\r\n setShowRelatedDocuments(true)}\r\n disabled={!RelatedRulebookDocumentView.documentTypes.some((t => t.id === props.document.typeId || t.subTypes?.some(st => st.id === props.document.typeId)))}\r\n >Manage Documents\r\n setShowRelatedDocuments(false)}\r\n document={props.document}\r\n />\r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nconst DocumentFileUploadSection = (props: { document: Document, viewType: PageView, pageValidation: PageValidation, onFileChange: (e: any) => void }) => {\r\n const existingFile = (props.viewType === PageView.NewVersion || props.viewType === PageView.Rescind) ?\r\n props.document.file ? props.document.file.name : undefined :\r\n props.document.file ? props.document.file.name : props.document.fileName;\r\n\r\n\r\n const FileInput = () => (\r\n \r\n \r\n \r\n );\r\n\r\n const renderSwitch = () => {\r\n switch (props.viewType) {\r\n case PageView.NewVersion:\r\n case PageView.AddNew:\r\n case PageView.Rescind:\r\n return (<>\r\n {\r\n existingFile ?\r\n <> :\r\n \r\n }\r\n {props.pageValidation.fileValidation?.display ?\r\n
{props.pageValidation.fileValidation?.message}
\r\n : <>}\r\n \r\n )\r\n case PageView.Edit:\r\n return ();\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n return (\r\n <>\r\n
\r\n

File upload

\r\n {renderSwitch()}\r\n \r\n );\r\n};\r\n\r\nexport const FirstPage = (props: {\r\n viewType: PageView,\r\n documentId?: number,\r\n closeAction: () => void,\r\n nextAction: () => void,\r\n validateAction?: (x: boolean) => void\r\n}) => {\r\n const [documentType, setDocumentType] = useState([] as Array);\r\n const [subCategories, setSubCategories] = useState([] as Array);\r\n const [document, setDocument] = useState({} as Document);\r\n const [pageValidation, setPageValidation] = useState({} as PageValidation);\r\n const [originalTitle, setOriginalTitle] = useState(undefined as string | undefined);\r\n const [isNotifyToggleDisabled, setNotifyToggleDisabled] = useState(false);\r\n const [userMessage, setUserMessage] = useState(\"\");\r\n const [reviewPeriodDisabledControl, setReviewPeriodDisabledControl] = useState([] as boolean[]);\r\n const [documentLoaded, setDocumentLoaded] = useState(false);\r\n\r\n const typeAheadRef = React.createRef>();\r\n\r\n const isAddNew = props.viewType === PageView.AddNew;\r\n const isEdit = props.viewType === PageView.Edit;\r\n const isNewVersion = props.viewType === PageView.NewVersion;\r\n const isRescind = props.viewType === PageView.Rescind;\r\n\r\n var notifyToggleControl: any;\r\n var reviewRecurringToggleControl: any;\r\n\r\n const updateState = (doc: Document) => {\r\n\r\n doc = setConditionalFieldsAndNotify(doc);\r\n\r\n documentAddEditState.setState(s => {\r\n s.document = doc;\r\n });\r\n }\r\n\r\n const setConditionalFieldsAndNotify = (doc: Document) => {\r\n var updatedDoc = { ...doc };\r\n const hasExpiry = (updatedDoc.expiryDate || \"\") !== \"\";\r\n if (hasExpiry && updatedDoc.reviewPeriod !== DocumentReviewPeriodEnum.None) {\r\n let publishDate = new Date(`${doc.publishDate} ${doc.publishTime || '00:00'}`)\r\n let expiryDate = new Date(`${doc.expiryDate} ${doc.expiryTime || '00:00'}`)\r\n let reviewMonths = getMonths(updatedDoc.reviewPeriod);\r\n let reviewDate = new Date(publishDate.setMonth(publishDate.getMonth() + reviewMonths));\r\n if (reviewDate > expiryDate) {\r\n setUserMessage(\"Review Date can not exceed expiry date\");\r\n updatedDoc.reviewPeriod = DocumentReviewPeriodEnum.None;\r\n updatedDoc.reviewRecurring = false;\r\n }\r\n }\r\n\r\n if (!updatedDoc.requiresAcknowledgementAndNotify) {\r\n updatedDoc.reviewPeriod = DocumentReviewPeriodEnum.None;\r\n }\r\n\r\n if (updatedDoc.reviewPeriod == DocumentReviewPeriodEnum.None) {\r\n updatedDoc.reviewRecurring = false;\r\n }\r\n\r\n return updatedDoc;\r\n }\r\n\r\n const updateConditionalFieldsUi = (doc: Document) => {\r\n if (notifyToggleControl != null) {\r\n if (isNotifyToggleDisabled) {\r\n notifyToggleControl.disable();\r\n }\r\n else {\r\n notifyToggleControl.enable();\r\n }\r\n }\r\n\r\n if (reviewRecurringToggleControl != null) {\r\n if (doc.reviewPeriod == DocumentReviewPeriodEnum.None) {\r\n reviewRecurringToggleControl.disable();\r\n reviewRecurringToggleControl.disabled = true;\r\n }\r\n else {\r\n reviewRecurringToggleControl.enable();\r\n reviewRecurringToggleControl.disabled = false;\r\n }\r\n }\r\n }\r\n\r\n const nextAction = () => {\r\n updateState(document);\r\n props.nextAction();\r\n }\r\n\r\n const handleChange = (field: string) => (event: any) => {\r\n updateState({ ...document, [field]: event.target.value });\r\n };\r\n\r\n const handleFileChange = (event: any) => {\r\n if (event) {\r\n document.file = event.target.files[0];\r\n document.fileName = document.file!.name;\r\n } else {\r\n document.file = undefined;\r\n document.fileName = undefined;\r\n }\r\n updateState(document)\r\n }\r\n\r\n const handleVersionNumberChange = () => (event: any) => {\r\n let versionNumber = event.target.value as string;\r\n\r\n //Remove any characters that are not a digit or full stop\r\n let re = /[^0-9\\.]/g;\r\n versionNumber = versionNumber.replaceAll(re, '');\r\n\r\n updateState({\r\n ...document,\r\n versionNumber: versionNumber\r\n });\r\n };\r\n\r\n const handleToggle = (field: string) => (val: boolean) => {\r\n updateState({ ...document, [field]: val });\r\n }\r\n\r\n const handleDocumentTypeChange = (docType?: IDocumentTypeItem) => {\r\n const subCategories = docType?.children || []\r\n setSubCategories(subCategories);\r\n\r\n var relatedDocs: Array = [];\r\n if (docType && isRuleBookDocumentType(docType)) {\r\n relatedDocs = document.relatedDocuments || [];\r\n }\r\n\r\n let title = getDefaultTitle(docType);\r\n let documentNumber = getDefaultDocumentNumberTitle(docType);\r\n\r\n updateState({\r\n ...document,\r\n typeId: docType?.typeId,\r\n relatedDocuments: relatedDocs,\r\n subTypeId: undefined,\r\n subTypeLabel: subCategories.length > 0 ? null : undefined,\r\n title: title,\r\n documentNumber: documentNumber\r\n });\r\n console.trace('document type change to ');\r\n console.trace(docType);\r\n }\r\n\r\n const documentTypes = (useSelector(x => x.writableRailDocumentTypes) || []).sort((a, b) => a.label > b.label ? 1 : -1);\r\n\r\n useEffect(() => {\r\n\r\n if (!documentTypes) return;\r\n\r\n const sub = documentAddEditState.subscribe((x: DocumentAddEditState) => {\r\n const doc = x.document;\r\n const docType = documentTypes.filter(y => y.typeId === doc.typeId);\r\n if (docType.length > 0) doc.typeLabel = docType[0].label;\r\n setOriginalTitle(x.originalDocument?.title);\r\n setDocument(doc);\r\n setDocumentType(docType);\r\n setSubCategories((getDocumentTypeFromId(x.document.typeId || -1, documentTypes)?.children || []) as Array);\r\n setNotifyToggleDisabled(isEdit && x.originalDocument?.requiresAcknowledgementAndNotify === true);\r\n const vf = validateForm(doc, props.viewType, false, docType);\r\n if (!documentLoaded && (props.viewType == PageView.AddNew || doc.canEdit)) { setDocumentLoaded(true); } //Trigger loading form defaults\r\n setPageValidation(vf);\r\n if (props.validateAction) {\r\n props.validateAction(vf.isValid || false);\r\n }\r\n });\r\n\r\n return () => {\r\n sub.unsubscribe();\r\n };\r\n }, [props.documentId, props.viewType, documentTypes]);\r\n\r\n useEffect(() => {\r\n if (!documentLoaded) {\r\n return;\r\n }\r\n\r\n const doc = document;\r\n\r\n //Set form defaults for new document\r\n if (props.viewType == PageView.AddNew) {\r\n doc.versionNumber = '1.0';\r\n }\r\n\r\n //Set form defaults for Rescind document\r\n if (props.viewType == PageView.Rescind) {\r\n setDocumentType([]);\r\n doc.typeId = undefined;\r\n doc.title = '';\r\n doc.documentNumber = '';\r\n doc.versionNumber = \"1.0\";\r\n }\r\n\r\n setDocument(doc);\r\n }, [documentLoaded]);\r\n\r\n useEffect(() => {\r\n var newDisabled = [...reviewPeriodDisabledControl];\r\n var reviewPeriodKeys = Object.keys(DocumentReviewPeriodEnum).map(key => parseInt(key)).filter(k => !isNaN(k));\r\n reviewPeriodKeys.map(reviewPeriod => {\r\n newDisabled[reviewPeriod] = false;\r\n\r\n const hasExpiry = (document.expiryDate || \"\") !== \"\";\r\n\r\n if (hasExpiry) {\r\n let publishDate = new Date(`${document.publishDate} ${document.publishTime || '00:00'}`)\r\n let expiryDate = new Date(`${document.expiryDate} ${document.expiryTime || '00:00'}`)\r\n let reviewMonths = getMonths(reviewPeriod);\r\n let reviewDate = new Date(publishDate.setMonth(publishDate.getMonth() + reviewMonths));\r\n if (reviewDate > expiryDate) {\r\n newDisabled[reviewPeriod] = true;\r\n }\r\n }\r\n });\r\n setReviewPeriodDisabledControl(newDisabled);\r\n\r\n }, [document]);\r\n\r\n useLayoutEffect(() => {\r\n updateConditionalFieldsUi(document);\r\n });\r\n\r\n\r\n // Look for either document rail book (\r\n function filterBy(option: IDocumentTypeItem, state: any) {\r\n const dm = ((document.documentModule == NonRuleBookModuleId) && (option.documentModule != RuleBookModuleId)) ? option.documentModule : document.documentModule;\r\n\r\n if (option.typeId == DocumentTypeEnum.OperatingNoticesAndInstructions) {\r\n return false;\r\n }\r\n\r\n if (state.selected.length || !option.label) {\r\n return option.documentModule == dm;\r\n }\r\n\r\n const val = (option.label.toLowerCase().indexOf(state.text.toLowerCase()) > -1) && (option.documentModule == dm) ? true : (option.documentModule == dm);\r\n return val;\r\n }\r\n\r\n const documentModuleChange = (event: any) => {\r\n document.documentModule = Number.parseInt(event.target.value);\r\n document.relatedDocuments = [];\r\n\r\n if (typeAheadRef.current) {\r\n typeAheadRef.current.clear();\r\n setDocumentType([]);\r\n setSubCategories([]);\r\n document.typeId = undefined;\r\n document.subTypeId = undefined;\r\n document.subTypeLabel = undefined;\r\n document.title = '';\r\n document.documentNumber = '';\r\n }\r\n updateState(document)\r\n }\r\n\r\n const handleTypeChange = (selected: any) => {\r\n const docType = (selected && selected.length > 0) ? selected[0] as IDocumentTypeItem : undefined;\r\n handleDocumentTypeChange(docType);\r\n }\r\n\r\n const handleSubTypeChange = (event: any) => {\r\n const docType = subCategories.find(x => x.typeId == (event.target.value as number));\r\n let title = getDefaultTitle(docType);\r\n let documentNumber = getDefaultDocumentNumberTitle(docType);\r\n\r\n updateState({\r\n ...document,\r\n subTypeId: docType?.typeId,\r\n subTypeLabel: docType?.label,\r\n title: title,\r\n documentNumber: documentNumber\r\n });\r\n }\r\n\r\n const removeRelatedDocument = (id: number) => {\r\n updateState({\r\n ...document,\r\n relatedDocuments: (document.relatedDocuments || []).filter(d => d.id !== id)\r\n })\r\n };\r\n\r\n var nextButtonText = \"Continue\";\r\n\r\n switch (props.viewType) {\r\n case PageView.Rescind:\r\n nextButtonText = \"Rescind\";\r\n break;\r\n case PageView.Edit:\r\n nextButtonText = \"Update details\";\r\n break;\r\n case PageView.NewVersion:\r\n nextButtonText = \"Add new version\";\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n const onNextButtonClick = async () => {\r\n const req = {\r\n id: document.documentId,\r\n document: document,\r\n pageNumber: 1,\r\n viewType: props.viewType\r\n } as IDocumentValidationRequest;\r\n\r\n // validate the form locally\r\n const docType = documentTypes.filter(y => y.typeId === document.typeId);\r\n const pv = validateForm(document, props.viewType, true, docType);\r\n\r\n // get any server side validation errors\r\n await validateDocument(req).then(response => {\r\n if (response) {\r\n if (response.errors[\"documentNumber\"]) {\r\n pv.documentNumberValidation = { display: true, message: response.errors[\"documentNumber\"] }\r\n pv.isValid = false;\r\n }\r\n\r\n if (pv.isValid) {\r\n nextAction();\r\n } else {\r\n setPageValidation(pv);\r\n }\r\n }\r\n });\r\n };\r\n\r\n type ReviewPeriodSelectionProps = {\r\n period: DocumentReviewPeriodEnum\r\n }\r\n\r\n const ReviewPeriodSelection = (props: ReviewPeriodSelectionProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n const handleExpiryDateChange = (event: any) => {\r\n let newDocState = { ...document, ['expiryDate']: event.target.value };\r\n let expiryDate = new Date(`${event.target.value}T00:00:00`).setHours(0, 0, 0, 0);\r\n let currentDate = new Date().setHours(0, 0, 0, 0);\r\n if (expiryDate > currentDate) {\r\n newDocState['expiryTime'] = '23:59';\r\n }\r\n updateState(newDocState);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n

{`Document details${originalTitle ? `: ${originalTitle}` : ''}`}

\r\n\r\n {(isAddNew || isRescind) &&\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {({ isMenuShown, toggleMenu }: any) => (\r\n toggleMenu()} />\r\n )}\r\n\r\n \r\n {/* Hack to display validation message for typeahead */}\r\n {\r\n pageValidation.documentTypeValidation?.display &&\r\n
{pageValidation.documentTypeValidation?.message}
\r\n }\r\n \r\n
\r\n
\r\n {(subCategories.length > 0) &&\r\n <>\r\n \r\n
\r\n \r\n {\r\n subCategories.map((c, i) => (\r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n {\r\n pageValidation.subTypeValidation?.display &&\r\n
{pageValidation.subTypeValidation?.message}
\r\n }\r\n
\r\n \r\n }\r\n
\r\n }\r\n \r\n {(isNewVersion) ?\r\n <>\r\n :\r\n <>\r\n \r\n \r\n {pageValidation.titleValidation?.message}\r\n }\r\n \r\n \r\n {(isNewVersion) ?\r\n <>\r\n :\r\n \r\n \r\n \r\n \r\n\r\n {pageValidation.documentNumberValidation?.message}\r\n \r\n }\r\n \r\n\r\n \r\n \r\n {pageValidation.versionNumberValidation?.message}\r\n \r\n \r\n
\r\n \r\n

Date and time

\r\n {\r\n ((isEdit || isRescind) && document.publishDate) &&\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n \r\n {pageValidation.effectiveDateValidation?.message}\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n {pageValidation.expireDateValidation?.message}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Notification and acknowledgement

\r\n \r\n \r\n { notifyToggleControl = input }}\r\n />\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n

Release notes (optional):

\r\n\r\n \r\n {isRescind &&\r\n <>\r\n
\r\n

Reason for rescinding:

\r\n \r\n \r\n {pageValidation.rescindDocumentReasonValidation?.message}\r\n \r\n }\r\n
\r\n \r\n \r\n
\r\n setUserMessage(\"\")} text={userMessage} />\r\n
\r\n\r\n
\r\n );\r\n}\r\n","import React, { useMemo } from 'react';\r\nimport { useState, useEffect, useRef } from 'react';\r\nimport { Document } from \"shared/models/site/document\"\r\nimport { addDocument, editDocument, getDocument, rescindDocument as recindDocument } from \"shared/services/railDocumentsApi\";\r\nimport { Modal, ModalHeader } from 'reactstrap';\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport { AddDocumentH2, EditDocumentH2, RescindDocumentH2, ModalClose } from \"components/menu/Labels\";\r\nimport InfoModal, { ExitCancelModel } from \"components/ui/InfoModal\"\r\nimport './DocumentAdmin.css'\r\nimport { documentMapper, toISOLocalDate } from \"shared/models/mapping/mapping\";\r\nimport { documentAddEditState } from './AddEditDocumentState'\r\nimport { SecondPage } from './AddEditDocumentSecondPage';\r\nimport { FirstPage } from './AddEditDocumentFirstPage';\r\n\r\nexport enum PageView {\r\n AddNew = 0,\r\n Edit = 1,\r\n NewVersion = 2,\r\n Rescind = 3\r\n}\r\n\r\nexport const ModalSubHeader = (props: { children?: React.ReactNode }) => {\r\n return (\r\n

{props.children}

\r\n );\r\n}\r\n\r\ntype IDocumentFormProps = {\r\n isOpen: boolean,\r\n onUpdate: () => void,\r\n onClose?: () => void,\r\n documentId?: number,\r\n viewType: PageView,\r\n setOpen?: (b: boolean) => void\r\n}\r\n\r\ntype IAddNewFormProps = {\r\n isOpen: boolean,\r\n onUpdate: () => void,\r\n onClose?: () => void,\r\n}\r\n\r\ntype IEditFormProps = IAddNewFormProps & {\r\n documentId: number\r\n};\r\n\r\nconst DocumentForm = (props: IDocumentFormProps) => {\r\n const [view, setView] = useState(props.viewType);\r\n const documentId = useRef(-1);\r\n\r\n var successText: string = 'Document information has been updated';\r\n var errorText: string = 'An error occured performing the requested action';\r\n var confirmCloseText: string = 'Are you sure you want to exit?\\nUnsaved data will be lost.';\r\n\r\n const closeModal = () => {\r\n if (view === PageView.NewVersion) setView(PageView.Edit);\r\n documentId.current = -1;\r\n documentAddEditState.reset();\r\n if (props.onClose) { props.onClose(); }\r\n };\r\n\r\n useEffect(() => {\r\n const mount = async () => {\r\n if (props.documentId) {\r\n const doc = documentMapper.mapFromRailDocument(await getDocument(props.documentId));\r\n\r\n documentAddEditState.setState(x => {\r\n x.document = doc;\r\n // Move to a configuration function if more defaults required for different views\r\n x.document.requiresAcknowledgementAndNotify = props.viewType === PageView.Rescind ? true : x.document.requiresAcknowledgementAndNotify;\r\n x.originalDocument = doc\r\n });\r\n } else {\r\n documentAddEditState.reset();\r\n }\r\n };\r\n mount();\r\n\r\n return () => {\r\n };\r\n },\r\n [props.documentId, props.viewType]);\r\n\r\n const handleErrors = (e: any): string | undefined => {\r\n if (e.title) {\r\n var errorText = e.title;\r\n\r\n if (Array.isArray(e.errors.ValidationErrors)) {\r\n e.errors.ValidationErrors.map((x: string) => {\r\n errorText += `\\n${x}`;\r\n });\r\n }\r\n return errorText;\r\n }\r\n }\r\n\r\n const AddNewForm = () => {\r\n const [page, setPage] = useState(1);\r\n const [isError, setIsError] = useState(false);\r\n const [isComplete, setIsComplete] = useState(false);\r\n const [isConfirmClose, setIsConfirmClose] = useState(false);\r\n\r\n const addNewUpload = async (document: Document) => {\r\n const newDoc = documentMapper.mapToNewDocument(document);\r\n await addDocument(newDoc)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n props.onUpdate();\r\n setIsComplete(true);\r\n }\r\n else {\r\n throw (await response.json());\r\n }\r\n })\r\n .catch((e) => {\r\n errorText = handleErrors(e) || errorText;\r\n setIsError(true);\r\n });\r\n }\r\n\r\n const closeModalPrompt = () => {\r\n setIsConfirmClose(true);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {page === 1 ?\r\n \r\n \r\n
Enter document details
\r\n
\r\n setPage(2)} closeAction={closeModalPrompt} />\r\n
\r\n :\r\n setPage(1)} completeAction={(document: Document) => addNewUpload(document)} isComplete={isComplete} />\r\n\r\n }\r\n { setIsComplete(false); closeModal(); }} />\r\n setIsError(false)} />\r\n { setIsConfirmClose(false); closeModal(); }}\r\n closeAction={() => setIsConfirmClose(false)} />\r\n \r\n );\r\n }\r\n\r\n const EditForm = () => {\r\n const [tab, setTab] = useState(view)\r\n const [page, setPage] = useState(1);\r\n const [isError, setIsError] = useState(false);\r\n const [isComplete, setIsComplete] = useState(false);\r\n const [isEditValid, setIsEditValid] = useState(false);\r\n const [showEditInvalid, setShowEditInvalid] = useState(false);\r\n const [isConfirmClose, setIsConfirmClose] = useState(false);\r\n\r\n const setEditView = (view: PageView) => {\r\n setTab(view);\r\n }\r\n\r\n const editUpload = async (document: Document) => {\r\n const editDoc = documentMapper.mapToNewDocument(document);\r\n if (!document.documentId) return;\r\n\r\n await editDocument(document.documentId, editDoc)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n props.onUpdate();\r\n setIsComplete(true);\r\n }\r\n else {\r\n throw (await response.json());\r\n }\r\n })\r\n .catch((e) => {\r\n errorText = handleErrors(e) || errorText;\r\n setIsError(true);\r\n });\r\n }\r\n\r\n const selectNewVersionTab = () => {\r\n if (isEditValid) {\r\n setEditView(PageView.NewVersion)\r\n } else {\r\n setShowEditInvalid(true);\r\n }\r\n }\r\n\r\n const closeModalPrompt = () => {\r\n setIsConfirmClose(true);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {page === 1\r\n ? \r\n \r\n
\r\n
|
\r\n
setEditView(PageView.Edit)}>Update document details
\r\n
|
\r\n
Add new version
\r\n
|
\r\n
\r\n \r\n\r\n setPage(2)} closeAction={closeModalPrompt} validateAction={x => setIsEditValid(x)} />\r\n \r\n :\r\n setPage(1)} completeAction={(document: Document) => editUpload(document)} isComplete={isComplete} />\r\n }\r\n { setIsComplete(false); closeModal(); }} />\r\n setIsError(false)} />\r\n setShowEditInvalid(false)} />\r\n { setIsConfirmClose(false); closeModal(); }}\r\n closeAction={() => setIsConfirmClose(false)} />\r\n \r\n );\r\n }\r\n\r\n\r\n const RescindForm = () => {\r\n const [page, setPage] = useState(1);\r\n const [isError, setIsError] = useState(false);\r\n const [isComplete, setIsComplete] = useState(false);\r\n const [isConfirmClose, setIsConfirmClose] = useState(false);\r\n\r\n const rescind = async (document: Document) => {\r\n const recindDoc = documentMapper.mapToNewDocument(document);\r\n if (!props.documentId) return;\r\n\r\n await recindDocument(props.documentId, recindDoc)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n props.onUpdate();\r\n setIsComplete(true);\r\n }\r\n else {\r\n throw (await response.json());\r\n }\r\n })\r\n .catch((e) => {\r\n errorText = handleErrors(e) || errorText;\r\n setIsError(true);\r\n });\r\n }\r\n\r\n const closeModalPrompt = () => {\r\n setIsConfirmClose(true);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {page === 1\r\n ? \r\n \r\n
Enter new document details
\r\n
\r\n setPage(2)} closeAction={closeModalPrompt} />\r\n
\r\n : \r\n setPage(1)} completeAction={(document: Document) => rescind(document)} isComplete={isComplete} />\r\n \r\n }\r\n { setIsComplete(false); closeModal(); }} />\r\n setIsError(false)} />\r\n { setIsConfirmClose(false); closeModal(); }}\r\n closeAction={() => setIsConfirmClose(false)} />\r\n \r\n );\r\n }\r\n\r\n const renderSwitch = () => {\r\n\r\n switch (view) {\r\n case PageView.AddNew:\r\n successText = \"Congratulations! Your document has been uploaded\";\r\n return (useMemo(() => (), []));\r\n case PageView.NewVersion:\r\n case PageView.Edit:\r\n return (useMemo(() => (), []));\r\n case PageView.Rescind:\r\n successText = \"Document rescinded successfully\";\r\n return (useMemo(() => (), []));\r\n default:\r\n return (
);\r\n }\r\n }\r\n return (\r\n <>\r\n {renderSwitch()}\r\n \r\n );\r\n};\r\n\r\nexport const ModalHost = (props: IDocumentFormProps) => {\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport const AddNewForm = (props: IAddNewFormProps) => ();\r\nexport const EditForm = (props: IEditFormProps) => ();\r\nexport const NewVersionForm = (props: IEditFormProps) => ();\r\nexport const RescindForm = (props: IEditFormProps) => ();\r\n","import React, { useState } from 'react';\r\nimport { useLocation } from 'react-router';\r\nimport { Link, useHistory } from 'react-router-dom';\r\n\r\nimport useRoles from 'hooks/useRoles';\r\nimport { Document, toDisplayDocument } from 'shared/models/site/document'\r\nimport { RelatedDocumentChips } from 'components/portal/documents/admin/RelatedDocuments';\r\n\r\nimport {\r\n Button\r\n , ModalBody\r\n , Row\r\n , Col\r\n} from 'reactstrap';\r\n\r\nimport { BarChart } from '@material-ui/icons';\r\n\r\n\r\ntype DocumentDetailsProps = {\r\n document: Document,\r\n editDocument: (docId: number) => void,\r\n closeModal: () => void\r\n}\r\n\r\nexport const DocumentDetails = (props: DocumentDetailsProps) => {\r\n const roles = useRoles();\r\n const getPdfViewUrl = (docId: number | undefined) => `/pdf/view/${docId}`;\r\n const displayDocument = toDisplayDocument(props.document);\r\n\r\n const editDocument = (docId: number | undefined) => {\r\n if (typeof docId === 'number') {\r\n props.editDocument(docId);\r\n }\r\n }\r\n\r\n return (\r\n \r\n\r\n \r\n\r\n \r\n

Document details: {props.document.documentNumber} {props.document.title}

\r\n
\r\n \r\n Document type:\r\n {displayDocument.typeLabel}{displayDocument.subTypeLabel == null ? \"\" : (`: ${displayDocument.subTypeLabel}`)}\r\n \r\n \r\n Document title:\r\n {displayDocument.title}\r\n \r\n \r\n Document number:\r\n {displayDocument.documentNumber}\r\n \r\n \r\n Version number:\r\n {displayDocument.versionNumber}\r\n \r\n \r\n Related documents:\r\n {(displayDocument.relatedDocuments || []).length > 0 ? : <>N/A}\r\n \r\n \r\n Published date:\r\n {displayDocument.publishDateDisplay} {displayDocument.publishTime}\r\n \r\n \r\n Effective from date:\r\n {displayDocument.effectiveFromDateDisplay} {displayDocument.effectiveFromTime}\r\n \r\n \r\n Expiry date:\r\n {displayDocument.expiryDateDisplay} {displayDocument.expiryTime}\r\n \r\n \r\n Acknowledgement and notfication:\r\n {displayDocument.requiresAcknowledgementAndNotify ? \"YES\" : \"NO\"}\r\n \r\n \r\n Review:\r\n {displayDocument.reviewPeriodDisplay}\r\n \r\n \r\n Selected file:\r\n \r\n {displayDocument.file ? displayDocument.file.name : displayDocument.fileName || \"Error!\"}\r\n View\r\n \r\n \r\n \r\n Release notes:\r\n {displayDocument.releaseNotes}\r\n \r\n \r\n Rescinding reason:\r\n {displayDocument.rescindDocumentReason}\r\n \r\n\r\n {roles.isBOH &&\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 { useState, useEffect } from 'react';\r\nimport { Document } from \"shared/models/site/document\"\r\nimport { DocumentHistory } from 'shared/models/api/models';\r\nimport { History as HistoryIcon, DescriptionOutlined as DescriptionIcon, VisibilityOutlined as VisibilityIcon } from '@material-ui/icons';\r\nimport { restoreDocument } from \"shared/services/railDocumentsApi\";\r\nimport { Table, ModalBody, Row, Col } from 'reactstrap';\r\n\r\nexport const DocumentHistoryView = (props: {\r\n document: Document,\r\n documentHistory: DocumentHistory[],\r\n onChangeValue: any\r\n}) => {\r\n const [stateDocumentHistory, setStateDocumentHistory] = useState(props.documentHistory);\r\n const [displayedReleaseNote, setdisplayedReleaseNote] = useState(0);\r\n const [documentIdRestorePrompt, setDocumentIdRestorePrompt] = useState(0);\r\n const [displayRestoredResult, setDisplayRestoredResult] = useState(false);\r\n const [completing, setCompleting] = useState(false);\r\n const [restoredDocId, setRestoredDocId] = useState(0);\r\n const dateTimeFormat = new Intl.DateTimeFormat(\"en-AU\", {});\r\n\r\n useEffect(() => {\r\n setStateDocumentHistory(props.documentHistory);\r\n });\r\n\r\n var n: number = 0;\r\n const rowClass = (): string => {\r\n return (n++ % 2 === 1) ? 'alternate-row' : '';\r\n };\r\n\r\n const toggleReleaseNote = (id: number) => {\r\n if (displayedReleaseNote === id) {\r\n setdisplayedReleaseNote(0);\r\n }\r\n else {\r\n setdisplayedReleaseNote(id);\r\n }\r\n };\r\n\r\n const releaseNoteClick = (event: any) => {\r\n event.stopPropagation();\r\n };\r\n\r\n const canRestore = (): boolean => {\r\n if (props.document.canEdit === false) {\r\n return false;\r\n }\r\n\r\n if (props.documentHistory[0].status !== 'Current') {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n const restoreConfirmPrompt = (id: number) => {\r\n setCompleting(false);\r\n setDocumentIdRestorePrompt(id);\r\n }\r\n\r\n const closeRestoreConfirmPrompt = () => {\r\n setDocumentIdRestorePrompt(0);\r\n }\r\n\r\n const restoreDocumentVersionById = async (id: number) => {\r\n setCompleting(true);\r\n const response = await restoreDocument(id);\r\n\r\n if (response.ok) {\r\n setRestoredDocId(await response.json());\r\n restoreDocumentVersionResult();\r\n }\r\n\r\n else {\r\n setDocumentIdRestorePrompt(0);\r\n console.log('Error restoring document - http status code ' + response.status);\r\n window.alert('Error restoring document');\r\n }\r\n\r\n }\r\n\r\n const restoreDocumentVersionResult = () => {\r\n setDocumentIdRestorePrompt(0);\r\n setDisplayRestoredResult(true);\r\n }\r\n\r\n const closeRestoreConfirmed = () => {\r\n setDisplayRestoredResult(false);\r\n if (typeof (restoredDocId) === 'number' && restoredDocId > 0) {\r\n props.onChangeValue(restoredDocId);\r\n }\r\n }\r\n\r\n const isRescinded = (history: DocumentHistory) => {\r\n return typeof (history.rescindedByDocumentId) === 'number';\r\n }\r\n\r\n const isRescinding = (history: DocumentHistory) => {\r\n return typeof (history.rescindsDocumentId) === 'number';\r\n }\r\n\r\n const isDeleted = (history: DocumentHistory) => {\r\n return history.statusId > 4;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n

Document history: {props.document.documentNumber} {props.document.title}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {canRestore() === true &&\r\n \r\n }\r\n \r\n \r\n \r\n {stateDocumentHistory.map((history) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {canRestore() === true &&\r\n \r\n }\r\n \r\n ))}\r\n \r\n
VersionStatusChangeNotesUserDate of changeRestore
\r\n {history.version}\r\n \r\n {history.status.replace(/([A-Z])/g, ' $1').trim()}\r\n \r\n {(isDeleted(history) === false && isRescinded(history) === false && isRescinding(history) === false) &&\r\n \r\n {history.action.replace(/([A-Z])/g, ' $1').trim()}\r\n \r\n }\r\n {isRescinded(history) === true &&\r\n <>\r\n Recinded by {history.rescindedByDocumentNumber}\r\n \r\n }\r\n {isRescinding(history) === true &&\r\n <>\r\n Rescinded {history.rescindsDocumentNumber}\r\n \r\n }\r\n {(isDeleted(history) === true) &&\r\n <>\r\n {history.action.replace(/([A-Z])/g, ' $1').trim()}\r\n \r\n }\r\n \r\n
toggleReleaseNote(history.id)}>\r\n
\r\n
\r\n
{displayedReleaseNote === history.id ? 'Hide' : 'Read'}
\r\n
\r\n
\r\n
{history.releaseNotes}
\r\n
\r\n
\r\n {history.userName}\r\n \r\n {dateTimeFormat.format(new Date(history.changeDate))} {new Date(history.changeDate).toLocaleTimeString('en-GB')}\r\n \r\n {history.statusId === 1 &&\r\n
\r\n }\r\n {history.statusId === 2 &&\r\n
restoreConfirmPrompt(history.id)}>\r\n
\r\n \r\n
Restore
\r\n
\r\n
\r\n }\r\n {history.statusId >= 3 &&\r\n
{history.status}
\r\n }\r\n
\r\n
\r\n\r\n {documentIdRestorePrompt !== 0 &&\r\n \r\n
\r\n
\r\n
\r\n
\r\n
Are you sure you want to restore this previous version of this file?
\r\n {completing\r\n ?\r\n \r\n
\r\n
\r\n
Restoring
\r\n
\r\n
\r\n
\r\n :\r\n \r\n
\r\n
\r\n
Cancel
\r\n
\r\n
\r\n
restoreDocumentVersionById(documentIdRestorePrompt)}>\r\n
\r\n
Restore file
\r\n
\r\n
\r\n
\r\n }\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n }\r\n\r\n {displayRestoredResult === true &&\r\n \r\n
\r\n
\r\n
\r\n
\r\n
The previous version of this file has been restored.
\r\n
\r\n
\r\n
OK
\r\n
\r\n
\r\n\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 { useState, useEffect, useRef } from 'react';\r\nimport { Modal, ModalHeader } from 'reactstrap';\r\nimport { Document } from \"shared/models/site/document\"\r\nimport { getDocument, getDocumentHistory } from \"shared/services/railDocumentsApi\";\r\nimport { DocumentHistory } from 'shared/models/api/models';\r\nimport { DocumentInfoH2, ModalClose } from \"components/menu/Labels\";\r\nimport { documentMapper } from \"shared/models/mapping/mapping\";\r\nimport { EditForm } from 'components/portal/documents/admin/AddEditDocument';\r\nimport { DocumentDetails } from \"./DocumentDetails\"\r\nimport { DocumentHistoryView } from \"./DocumentHistoryView\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport './DocumentInfo.css'\r\n\r\nenum Tabs {\r\n TabDetails,\r\n TabHistory\r\n}\r\n\r\nconst ModalSubHeader = (props: { children?: React.ReactNode }) => {\r\n return (\r\n

{props.children}

\r\n );\r\n}\r\n\r\ntype IDocumentFormProps = {\r\n isOpen: boolean,\r\n onClose: () => void,\r\n editDocument: (docId: number) => void,\r\n documentId: number,\r\n refresh: object,\r\n tabType: Tabs\r\n}\r\n\r\nconst DocumentForm = (props: IDocumentFormProps) => {\r\n const [stateDocument, setStateDocument] = useState({} as Document);\r\n const [stateDocumentHistory, setStateDocumentHistory] = useState({} as DocumentHistory[]);\r\n const [infoTab, setInfoTab] = useState(props.tabType);\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const documentId = useRef(-1);\r\n\r\n const closeModal = () => {\r\n documentId.current = -1;\r\n setStateDocument({});\r\n setInfoTab(Tabs.TabDetails);\r\n setIsOpen(false);\r\n if (props.onClose) props.onClose();\r\n };\r\n\r\n const documentHistoryUpdated = async (docId: number) => {\r\n setInfoTab(Tabs.TabHistory);\r\n await getDocumentAndHistory(docId);\r\n }\r\n\r\n const getDocumentAndHistory = async (docId: number) => {\r\n if (docId) {\r\n getDocument(docId)\r\n .then(railDoc => {\r\n documentId.current = docId;\r\n var doc = documentMapper.mapFromRailDocument(railDoc);\r\n setStateDocument(doc);\r\n setIsOpen(true);\r\n });\r\n\r\n getDocumentHistory(docId)\r\n .then(docHistory => {\r\n setStateDocumentHistory(docHistory);\r\n });\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (!props.isOpen) return;\r\n\r\n const mount = async () => {\r\n if (props.documentId) {\r\n await getDocumentAndHistory(props.documentId);\r\n }\r\n };\r\n\r\n mount();\r\n },\r\n [props.documentId, props.tabType, props.isOpen, props.refresh]);\r\n\r\n const ViewInfo = () => {\r\n const [tab, setTab] = useState(infoTab);\r\n\r\n const setTabView = (tab: Tabs) => {\r\n setTab(tab);\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
setTabView(Tabs.TabDetails)}>Document details
\r\n
|
\r\n
setTabView(Tabs.TabHistory)}>Document history
\r\n
|
\r\n
\r\n
\r\n {tab === Tabs.TabDetails\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\r\ntype IViewInfoProps = {\r\n isOpen: boolean,\r\n onClose: () => void,\r\n onUpdate: () => void,\r\n documentId: number\r\n};\r\n\r\nexport const ViewInfo = (props: IViewInfoProps) => {\r\n const [showEditDocument, setShowEditDocument] = useState(false);\r\n const [actionDocumentId, setActionDocumentId] = useState(0);\r\n const [refresh, setRefresh] = useState({});\r\n\r\n const editDocument = (docId: number | undefined) => {\r\n if (typeof docId === 'number') {\r\n setActionDocumentId(docId);\r\n setShowEditDocument(true);\r\n }\r\n }\r\n\r\n const closeEditDocument = () => {\r\n setShowEditDocument(false);\r\n }\r\n\r\n const editDocumentUpdated = () => {\r\n props.onUpdate();\r\n setRefresh({});\r\n }\r\n\r\n return (\r\n <>\r\n {showEditDocument ?\r\n \r\n :\r\n \r\n }\r\n \r\n );\r\n}\r\n","import React from 'react';\r\n\r\nexport const Spinner = () =>\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
;\r\n\r\nexport default Spinner;","import * as React from 'react';\r\nimport { useState, useEffect } from \"react\";\r\nimport { NavigateNextOutlined, NavigateBeforeOutlined, LastPageOutlined, FirstPageOutlined, FirstPage } from '@material-ui/icons';\r\n\r\nexport interface IPageListProps {\r\n totalResults: number,\r\n pageSize: number,\r\n pageNumber: number,\r\n moveToPage: (page: number) => void\r\n}\r\n\r\nexport const PageList = (props: IPageListProps) => {\r\n const [scrollPageToBottom, setScrollPageToBottom] = useState(false);\r\n\r\n const buildPageArray = () => {\r\n const arr = [] as number[];\r\n\r\n if (props.totalResults > 0) {\r\n var startPage = 1;\r\n var lastPage = Math.ceil(props.totalResults / props.pageSize);\r\n\r\n for (var p = startPage; p < lastPage + 1; p++) {\r\n arr.push(p);\r\n }\r\n }\r\n\r\n return arr;\r\n };\r\n\r\n const lastPage = Math.ceil(props.totalResults / props.pageSize);\r\n const pageArray = buildPageArray();\r\n\r\n const scrollToBottomOfPage = () => {\r\n window.scrollTo(0, document.documentElement.scrollHeight - window.innerHeight);\r\n }\r\n\r\n const moveToPage = (page: number) => {\r\n props.moveToPage(page);\r\n setScrollPageToBottom(true);\r\n }\r\n\r\n const scrollCurrentPageNumberIntoView = () => {\r\n let docPageListElement = document.getElementsByClassName(\"pl-page-list\")[0] as HTMLElement;\r\n\r\n let docPageNumberElements = document.getElementsByClassName(\"pl-current-page\");\r\n if (docPageNumberElements.length > 0) {\r\n let currentDocPageElement = docPageNumberElements[0] as HTMLElement;\r\n let midPoint = docPageListElement.offsetWidth / 2;\r\n let offset = currentDocPageElement.offsetLeft - docPageListElement.offsetLeft - midPoint;\r\n docPageListElement.scroll(offset, 0); //Scroll the document page selector list so the currently selected page is on visible\r\n }\r\n }\r\n\r\n const scrollToBottomIfRequired = () => {\r\n let pageScrollPercent = window.pageYOffset / (document.documentElement.scrollHeight - window.innerHeight);\r\n if (scrollPageToBottom || pageScrollPercent > 0.85) {\r\n setScrollPageToBottom(false);\r\n scrollToBottomOfPage();\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n window.addEventListener(\"resize\", scrollCurrentPageNumberIntoView);\r\n return () => window.removeEventListener(\"resize\", scrollCurrentPageNumberIntoView);\r\n }, []);\r\n\r\n useEffect(() => {\r\n scrollCurrentPageNumberIntoView();\r\n scrollToBottomIfRequired();\r\n });\r\n\r\n return (\r\n <>\r\n {lastPage > 1 &&\r\n
\r\n { if (props.pageNumber > 1) moveToPage(1); }}>\r\n { if (props.pageNumber > 1) moveToPage(props.pageNumber - 1); }}>\r\n \r\n {pageArray.map(\r\n p => {\r\n return { moveToPage(p); }}>{p}\r\n }\r\n )}\r\n \r\n { if (props.pageNumber < lastPage) moveToPage(props.pageNumber + 1); }}>\r\n { if (props.pageNumber < lastPage) moveToPage(lastPage); }}>\r\n
\r\n }\r\n \r\n )\r\n};","import React, { ReactNode, useEffect, useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { RailDocument } from \"shared/models/api/models\";\r\nimport { AnnouncementOutlined, StarBorder, InfoOutlined, Star } from '@material-ui/icons';\r\nimport { GridLabel, SortStyle, FilterArrow, ISortConfig, SortArrow } from './GridComponents';\r\nimport useSortableData from './GridComponents';\r\nimport { ConfirmationBox, IConfirmProps } from 'components/ui/ConfirmationBox';\r\nimport { IFilterConfig, IPageConfig } from './GridComponents';\r\nimport './grid-cards.css';\r\nimport { MarkChatRead } from \"components/menu/Labels\";\r\nimport { ViewInfo } from \"./documents/DocumentInfo/DocumentInfo\";\r\nimport { Grid, Hidden } from \"@material-ui/core\";\r\nimport { Checkbox } from \"../ui/LabelledCheckbox\";\r\nimport {\r\n AddDocumentAction, DeleteDocumentAction, DeletePermanentlyDocumentAction, DocumentStatuses, DocumentStatusIcon,\r\n DocumentTypeIcon, EditDocumentAction, FavouriteDocumentAction, IDocumentAction, IDocumentFilter, RescindDocumentAction, DocumentViews\r\n} from '../ui/DocumentRules';\r\nimport { Spinner } from '../ui/Spinner';\r\nimport { PageList } from \"../ui/PageList\";\r\nimport { setFavouriteFlagsAsync, updateFavouriteFlagAsync } from \"../../shared/services/railDocumentsApi\";\r\nimport { permanentDeleteDocument as permanentDeleteDocumentAsync, deleteDocument as deleteDocumentAsync } from 'shared/services/railDocumentsApi';\r\nimport { DocumentModuleEnum } from \"shared/enums/document-module-enum\"\r\nimport { formatDate } from \"shared/models/mapping/mapping\";\r\n\r\nimport { ReactComponent as PDFIcon } from \"assets/icons/pdf-icon.svg\";\r\n\r\nexport type GridColumnName = \"Select\" | \"Favourite\" | \"SubType\" | \"Status\";\r\n\r\ninterface IDocumentRowSharedProps {\r\n showSelectColumn: boolean,\r\n showFavouriteColumn: boolean,\r\n showSubTypeColumn: boolean,\r\n showStatusColumn: boolean,\r\n bookmarkAction?: (id: number) => void\r\n}\r\n\r\ninterface IDocumentRowHeaderProps extends IDocumentRowSharedProps {\r\n requestSort: (x: string, y: SortStyle) => void,\r\n sortConfig: ISortConfig | null,\r\n categories: string[],\r\n statuses: string[],\r\n filter: (key: string, filterItems: Array, createPredicate: (d: RailDocument) => (x: string) => boolean) => void\r\n}\r\n\r\ninterface IFavouriteIconProps {\r\n documentId: number,\r\n isFavourite: boolean,\r\n setIsFavourite: (isFavourite: boolean) => void,\r\n}\r\n\r\nexport const FavouriteIcon = (props: IFavouriteIconProps) => {\r\n const [working, setWorking] = useState(false);\r\n\r\n const toggleFavouriteFlag = async () => {\r\n if (!working) {\r\n setWorking(true);\r\n\r\n var result = await updateFavouriteFlagAsync(props.documentId, !props.isFavourite);\r\n\r\n if (result) {\r\n props.setIsFavourite(!props.isFavourite);\r\n }\r\n\r\n setWorking(false);\r\n }\r\n };\r\n\r\n const toggle = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n\r\n toggleFavouriteFlag();\r\n };\r\n\r\n return (\r\n
toggle(e)}>\r\n
\r\n {!props.isFavourite ? : }\r\n
\r\n
\r\n );\r\n}\r\n\r\nconst DocumentRowActionColumn = (props: { acknowledgeRequired?: boolean }) =>\r\n <>{props.acknowledgeRequired ? : };\r\n\r\ninterface IDocumentRowDetailProps extends IDocumentRowSharedProps {\r\n document: RailDocument,\r\n selected: boolean,\r\n documentSelectAction?: (id: number) => void,\r\n openDocument: (document: RailDocument) => void,\r\n setShowDocumentInfo: (id: number) => void\r\n}\r\n\r\nexport const DocumentRow = (props: IDocumentRowDetailProps) => {\r\n const [isFavourite, setFavourite] = useState(props.document.isFavourite === true);\r\n\r\n const updateFavourite = (val: boolean) => {\r\n props.document.isFavourite = val;\r\n setFavourite(val);\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n\r\n { props.openDocument(props.document); }}\r\n actionClassName={props.document.acknowledgeRequired ? \"acknowledge-required\" : \"\"}\r\n action={}\r\n favourite={}\r\n favouriteVisible={props.showFavouriteColumn}\r\n status={}\r\n statusVisible={props.showStatusColumn ?? false}\r\n icon={}\r\n title={<>{props.document.title}}\r\n documentNumber={}\r\n published={}\r\n type={}\r\n info={}\r\n infoClicked={() => { props.setShowDocumentInfo(props.document.id) }}\r\n selectVisible={props.showSelectColumn ?? false}\r\n select={}\r\n selectClicked={() => { if (props.documentSelectAction) props.documentSelectAction(props.document.id) }}\r\n />\r\n );\r\n};\r\n\r\ninterface IDocumentRowTemplateProps {\r\n className: string,\r\n onClick?: () => void,\r\n action: ReactNode,\r\n actionClassName?: string,\r\n favourite: ReactNode,\r\n favouriteVisible: boolean,\r\n favouriteClicked?: () => void,\r\n icon: ReactNode,\r\n title: ReactNode,\r\n documentNumber: ReactNode,\r\n published: ReactNode,\r\n type: ReactNode,\r\n info: ReactNode,\r\n infoClicked?: () => void,\r\n select: ReactNode,\r\n selectClicked?: () => void,\r\n selectVisible: boolean,\r\n status: ReactNode,\r\n statusClicked?: () => void,\r\n statusVisible: boolean,\r\n isHeader?: boolean\r\n}\r\n\r\nconst DocumentRowTemplate = (props: IDocumentRowTemplateProps) => {\r\n const infoClicked = (e: React.MouseEvent) => {\r\n if (props.infoClicked) {\r\n e.stopPropagation();\r\n props.infoClicked();\r\n }\r\n };\r\n\r\n const favouriteClicked = (e: React.MouseEvent) => {\r\n if (props.favouriteClicked) {\r\n e.stopPropagation();\r\n props.favouriteClicked();\r\n }\r\n };\r\n\r\n const selectClicked = (e: React.MouseEvent) => {\r\n if (props.selectClicked) {\r\n e.stopPropagation();\r\n props.selectClicked();\r\n }\r\n };\r\n\r\n const statusClicked = (e: React.MouseEvent) => {\r\n if (props.statusClicked) {\r\n e.stopPropagation();\r\n props.statusClicked();\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n \r\n {props.action}\r\n {props.favouriteVisible &&\r\n {props.favourite}\r\n }\r\n {props.statusVisible &&\r\n {props.status}\r\n }\r\n {props.icon}\r\n\r\n {props.isHeader &&\r\n <>\r\n \r\n \r\n {props.title}\r\n\r\n \r\n {props.published}\r\n {props.type}\r\n \r\n \r\n \r\n \r\n }\r\n\r\n {!props.isHeader &&\r\n \r\n \r\n {props.title}\r\n\r\n {props.documentNumber}\r\n {props.published}\r\n \r\n {props.type}\r\n \r\n \r\n \r\n }\r\n\r\n {props.info}\r\n\r\n \r\n {props.select}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport interface ISortableColProps {\r\n className?: string,\r\n children?: ReactNode,\r\n onClick?: () => void,\r\n fieldName: string,\r\n sortStyle: SortStyle,\r\n sortFn: (field: string, style: SortStyle) => void,\r\n sortConfig: ISortConfig | null\r\n}\r\n\r\nexport const SortableCol = (props: ISortableColProps) => {\r\n return (\r\n { props.sortFn(props.fieldName, props.sortStyle); }}>{props.children} \r\n );\r\n};\r\n\r\ninterface IFilterableColProps {\r\n sortFn: (field: string, style: SortStyle) => void,\r\n fieldName: string,\r\n sortStyle: SortStyle,\r\n sortConfig: ISortConfig,\r\n children: ReactNode\r\n}\r\n\r\nexport const FilterableCol = (props: IFilterableColProps) => {\r\n return (\r\n { props.sortFn(props.fieldName, props.sortStyle); }}>{props.children} \r\n );\r\n};\r\n\r\ninterface IActionButtonProps {\r\n onClick: () => void,\r\n enabled: boolean,\r\n visible: boolean,\r\n action: IDocumentAction,\r\n preConfirmationMessageUpdate?: (confirmProps: IConfirmProps) => IConfirmProps\r\n}\r\n\r\nconst ActionButton = (props: IActionButtonProps) => {\r\n const Icon = props.action.icon;\r\n\r\n const [confirmProps, setConfirmProps] = useState(null as IConfirmProps | null);\r\n\r\n const onClick = () => {\r\n if (props.enabled && props.onClick) {\r\n\r\n if (props.action.confirm) {\r\n var cp = { ...props.action.confirm };\r\n\r\n if (props.preConfirmationMessageUpdate) {\r\n cp = props.preConfirmationMessageUpdate(cp);\r\n }\r\n\r\n cp.setResult = (result: string) => {\r\n if (result === cp.defaultOption) {\r\n props.onClick();\r\n }\r\n\r\n setConfirmProps(null);\r\n };\r\n\r\n setConfirmProps(cp);\r\n } else {\r\n props.onClick();\r\n }\r\n }\r\n }\r\n\r\n return (\r\n \r\n
\r\n {Icon &&\r\n
\r\n }\r\n
{props.action.name}
\r\n
\r\n\r\n {confirmProps &&\r\n \r\n }\r\n \r\n );\r\n};\r\n\r\nconst DocumentHeaderRow = (props: IDocumentRowHeaderProps) =>\r\n Action}\r\n favourite={<>}\r\n favouriteVisible={props.showFavouriteColumn}\r\n status={ props.filter(\"statusDescription\", x, d => (s) => d.statusDescription === s)} />}\r\n statusVisible={props.showStatusColumn ?? false}\r\n icon={<>}\r\n title={Title}\r\n documentNumber={<>Document Number}\r\n published={Published}\r\n type={ props.filter(\"type\", x, d => (s) => d.type === s)} />}\r\n info={<>Info}\r\n selectVisible={props.showSelectColumn ?? false}\r\n select={<>Select}\r\n />;\r\n\r\nexport interface IDocumentGridProps {\r\n documents?: RailDocument[] | null,\r\n onDataChanged?: () => void,\r\n bookmarkAction?: (id: number) => void,\r\n documentButtonAction?: (id: number) => void,\r\n documentSelectAction?: (id: number) => void,\r\n filterConfig?: IFilterConfig,\r\n selectedItems: number[] | null,\r\n hiddenColumns?: Array,\r\n pageSize?: number,\r\n hidePageList?: boolean,\r\n noDocumentsMessage?: string,\r\n filter?: IDocumentFilter | null,\r\n clearSelected: () => void,\r\n onModalsClosed?: () => void,\r\n onAddDocument?: () => void,\r\n onEditDocument?: (doc: RailDocument) => void,\r\n onRescindDocument?: (doc: RailDocument) => void,\r\n onDeleteDocument?: (docs: RailDocument[]) => void,\r\n onDeleteDocumentForever?: (docs: RailDocument[]) => void\r\n}\r\n\r\nexport const DocumentGrid = (props: IDocumentGridProps) => {\r\n const [showDocumentInfo, setShowDocumentInfo] = useState(0);\r\n const [refresh, setRefresh] = useState(false);\r\n\r\n const sd_items = props.documents || [] as RailDocument[];\r\n const sd_sortConfig = {} as ISortConfig;\r\n const sd_filterConfig = {} as IFilterConfig;\r\n const sd_pageConfig = props.pageSize ? {\r\n pageSize: props.pageSize,\r\n currentPage: 0,\r\n itemCount: props.documents?.length || 0\r\n } : null as IPageConfig | null;\r\n\r\n const { items, requestSort, sortConfig, requestFilter, requestPage, pageConfig } = useSortableData(\r\n sd_items,\r\n sd_sortConfig,\r\n sd_filterConfig,\r\n sd_pageConfig\r\n );\r\n\r\n const refreshGrid = (fullRefresh?: boolean) => {\r\n if (!fullRefresh) {\r\n requestPage(pageConfig?.currentPage ?? 1);\r\n } else {\r\n if (props.onDataChanged) props.onDataChanged()\r\n }\r\n };\r\n\r\n const categories = props.documents?.filter((item, i, arr) => arr.findIndex(t => t.type === item.type && t.type !== null) === i).map(x => x.type).sort() || [];\r\n const statuses = props.documents?.filter((item, i, arr) => arr.findIndex(t => t.statusDescription === item.statusDescription) === i).map(x => x.statusDescription).sort() || [];\r\n\r\n const filterFn = (\r\n key: string,\r\n filterItems: Array,\r\n createPredicate: (d: RailDocument) => (x: string) => boolean\r\n ) => {\r\n const fn: any = (d: RailDocument) => {\r\n return filterItems.length > 0 ? (filterItems.find(createPredicate(d)) || \"\") !== \"\" : true;\r\n }\r\n\r\n requestFilter(key, fn);\r\n }\r\n\r\n const openDoc = (doc: RailDocument) => {\r\n if (props.documentButtonAction) {\r\n props.documentButtonAction(doc.id)\r\n }\r\n };\r\n\r\n const onDocInfoUpdate = () => {\r\n if (props.onDataChanged) props.onDataChanged();\r\n }\r\n\r\n const clearModals = () => {\r\n setShowDocumentInfo(0);\r\n setRefresh(!refresh);\r\n\r\n if (props.onModalsClosed) props.onModalsClosed();\r\n }\r\n\r\n useEffect(() => {\r\n requestPage(pageConfig?.currentPage || 0, props.pageSize);\r\n }, [props.pageSize]);\r\n\r\n const showColumn = (colName: GridColumnName): boolean => (!props?.hiddenColumns?.some(x => x === colName));\r\n\r\n const showSelectColumn = showColumn(\"Select\");\r\n const showStatusColumn = showColumn(\"Status\");\r\n const showFavouriteColumn = showColumn(\"Favourite\");\r\n const showSubTypeColumn = showColumn(\"SubType\");\r\n\r\n const getDocumentsForSelectedIndexes = (ids?: number[]) => {\r\n if (!props.documents) return [] as RailDocument[];\r\n\r\n return props.documents.filter(d => (ids ?? props.selectedItems ?? []).includes(d.id));\r\n };\r\n\r\n const getStatusesForAction = (action: IDocumentAction) => DocumentStatuses.filter(s => s.actions.includes(action));\r\n const getStatusIdsForAction = (action: IDocumentAction) => getStatusesForAction(action).map(status => status.id);\r\n\r\n const selectedDocumentsCanExecute = (action: IDocumentAction) => {\r\n const statusIds = getStatusIdsForAction(action);\r\n\r\n if (!props.selectedItems) return false;\r\n\r\n // are there any documents selected that have a status that is invalid for the action?\r\n return !getDocumentsForSelectedIndexes(props.selectedItems).some(d => !statusIds.includes(d.status));\r\n };\r\n\r\n const [canFavourite, setCanFavourite] = useState(false);\r\n const [canAdd, setCanAdd] = useState(false);\r\n const [canEdit, setCanEdit] = useState(false);\r\n const [canRescind, setCanRescind] = useState(false);\r\n const [canDelete, setCanDelete] = useState(false);\r\n const [canDeleteForever, setCanDeleteForever] = useState(false);\r\n\r\n useEffect(() => {\r\n var _favourite = false;\r\n var _edit = false;\r\n var _add = false;\r\n var _rescind = false;\r\n var _delete = false;\r\n var _deleteForever = false;\r\n\r\n if (props.filter?.rules) {\r\n const rules = props.filter.rules;\r\n\r\n // as long as the rule says we can add, we can. the selected does nothing\r\n _add = rules.canAdd === true;\r\n\r\n if (props.selectedItems && props.selectedItems.length > 0) {\r\n // some documents selected\r\n _favourite = rules.canFavourite === true && selectedDocumentsCanExecute(FavouriteDocumentAction);\r\n _deleteForever = rules.canDeleteForever === true && selectedDocumentsCanExecute(DeletePermanentlyDocumentAction);\r\n\r\n // single document actions\r\n if (props.selectedItems.length === 1) {\r\n // one document selected \r\n const selectedDocumentId = props.selectedItems[0];\r\n const selectedDocument = props.documents?.find(d => d.id === selectedDocumentId);\r\n\r\n if (selectedDocument) {\r\n const status = DocumentStatuses.find(status => status.id === selectedDocument.status);\r\n\r\n if (status) {\r\n _edit = (rules.canEdit === true) && status.actions.includes(EditDocumentAction);\r\n _rescind = (rules.canRescind === true) && status.actions.includes(RescindDocumentAction) && selectedDocument.moduleId !== DocumentModuleEnum.Rulebook;\r\n _delete = (rules.canDelete === true) && status.actions.includes(DeleteDocumentAction);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n setCanFavourite(_favourite);\r\n setCanAdd(_add);\r\n setCanEdit(_edit);\r\n setCanRescind(_rescind);\r\n setCanDelete(_delete);\r\n setCanDeleteForever(_deleteForever);\r\n\r\n }, [props.selectedItems, props.documents]);\r\n\r\n const navHistory = useHistory();\r\n\r\n useEffect(() => {\r\n if (!props.filter) {\r\n return;\r\n }\r\n\r\n if (sortConfig) {\r\n requestSort(props.filter.defaultSortField ?? \"title\", SortStyle.String, props.filter.defaultSortOrder);\r\n }\r\n\r\n if (props.filter.redirectType) {\r\n navHistory.push(props.filter.redirectType.url);\r\n }\r\n\r\n }, [props.filter]);\r\n\r\n const [msgBox, setMsgBox] = useState({} as IConfirmProps);\r\n const closeMessageBox = () => {\r\n setMsgBox({} as IConfirmProps);\r\n };\r\n const showMessageBox = (msg: string) => {\r\n const cp = {\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultAction: \"OK\",\r\n setResult: closeMessageBox\r\n } as IConfirmProps;\r\n\r\n setMsgBox(cp);\r\n };\r\n\r\n const [actionsBusy, setActionsBusy] = useState(false);\r\n\r\n const favouriteSelectedAsync = async () => {\r\n if (!actionsBusy && canFavourite && props.selectedItems && props.selectedItems.length > 0) {\r\n const docs = getDocumentsForSelectedIndexes()\r\n .filter(d => d.isFavourite !== true);\r\n\r\n if (docs.length > 0) {\r\n setActionsBusy(true);\r\n\r\n await setFavouriteFlagsAsync(docs.map(d => d.id))\r\n .then(result => {\r\n docs.forEach(doc => {\r\n doc.isFavourite = true;\r\n });\r\n\r\n setActionsBusy(false);\r\n\r\n setMsgBox({\r\n message: \"Favourites updated. Would you like to clear the selected documents?\",\r\n options: [\"Yes\", \"No\"],\r\n defaultOption: \"Yes\",\r\n setResult: (response: string) => {\r\n if (response === \"Yes\") {\r\n props.clearSelected();\r\n }\r\n\r\n closeMessageBox();\r\n }\r\n });\r\n\r\n refreshGrid();\r\n })\r\n .catch(e => {\r\n showMessageBox(\"There was an error updating your favourites.\");\r\n console.log(e);\r\n\r\n setActionsBusy(false);\r\n });\r\n } else {\r\n showMessageBox(\"All selected documents are already marked as favourite\");\r\n }\r\n }\r\n };\r\n\r\n const addDocument = () => {\r\n if (canAdd && props.onAddDocument) {\r\n props.onAddDocument();\r\n }\r\n };\r\n\r\n const performActionOnCurrentDocument = (fn?: (doc: RailDocument) => void) => {\r\n if (!fn) return;\r\n\r\n if (props.selectedItems && props.selectedItems.length === 1) {\r\n const selectedDocumentId = props.selectedItems[0];\r\n const selectedDocument = props.documents?.find(d => d.id === selectedDocumentId);\r\n\r\n if (selectedDocument) {\r\n fn(selectedDocument);\r\n }\r\n }\r\n }\r\n\r\n const editSelected = () => {\r\n if (canEdit) {\r\n performActionOnCurrentDocument(props.onEditDocument);\r\n }\r\n };\r\n\r\n const rescindSelected = () => {\r\n if (canRescind) {\r\n performActionOnCurrentDocument(props.onRescindDocument);\r\n }\r\n };\r\n\r\n const deleteSelectedAsync = async () => {\r\n if (!actionsBusy && canDelete) {\r\n\r\n const docs = getDocumentsForSelectedIndexes();\r\n\r\n if (docs.length === 1) {\r\n setActionsBusy(true);\r\n\r\n const doc = docs[0];\r\n\r\n await deleteDocumentAsync(doc.id)\r\n .then(response => {\r\n setActionsBusy(false);\r\n showMessageBox(\"Document has been moved to the Deleted folder\");\r\n if (props.onDataChanged) props.onDataChanged();\r\n })\r\n .catch(e => {\r\n setActionsBusy(false);\r\n showMessageBox(\"There was an error deleting the document.\");\r\n console.log(e);\r\n });\r\n }\r\n }\r\n };\r\n\r\n const deleteForeverSelectedAsync = async () => {\r\n if (!actionsBusy && canDeleteForever) {\r\n const docs = getDocumentsForSelectedIndexes();\r\n\r\n if (docs.length === 1) {\r\n setActionsBusy(true);\r\n\r\n const doc = docs[0];\r\n\r\n await permanentDeleteDocumentAsync(doc.id)\r\n .then(response => {\r\n setActionsBusy(false);\r\n showMessageBox(\"Your request has been successfully completed.\");\r\n if (props.onDataChanged) props.onDataChanged();\r\n })\r\n .catch(e => {\r\n setActionsBusy(false);\r\n showMessageBox(\"There was an error deleting the document.\");\r\n console.log(e);\r\n return;\r\n });\r\n }\r\n }\r\n };\r\n\r\n const addSelectedDocumentsToConfirmationMessage = (confirmProps: IConfirmProps): IConfirmProps => {\r\n const docs = getDocumentsForSelectedIndexes();\r\n\r\n confirmProps.message =
\r\n
{confirmProps.message}
\r\n \r\n \r\n {docs.map(doc =>\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n
{doc.fileName}
\r\n
;\r\n\r\n return confirmProps;\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
\r\n\r\n { props.filter &&\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \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.documents &&\r\n \r\n \r\n }\r\n\r\n \r\n\r\n {items?.length === 0 &&\r\n \r\n {props.documents &&\r\n \r\n }\r\n {!props.documents &&\r\n \r\n }\r\n \r\n }\r\n\r\n {(items as RailDocument[]).map(doc => (\r\n x === doc.id).length > 0\r\n : false\r\n }\r\n documentSelectAction={props.documentSelectAction}\r\n openDocument={openDoc}\r\n setShowDocumentInfo={setShowDocumentInfo}\r\n />\r\n ))}\r\n \r\n
\r\n
{props.noDocumentsMessage}
\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n 0} onClose={clearModals} onUpdate={onDocInfoUpdate} documentId={showDocumentInfo} />\r\n {\r\n
\r\n {pageConfig && !props.hidePageList && props.documents &&\r\n { requestPage(page - 1) }}\r\n />\r\n }\r\n
\r\n }\r\n \r\n );\r\n}\r\n\r\nexport default DocumentGrid;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Search } from '@material-ui/icons';\r\nimport \"./Search.css\";\r\nimport { Chip } from '@material-ui/core';\r\nimport { useHistory } from \"react-router-dom\";\r\n\r\nimport { SearchStateParams } from \"components/portal/documents/search/DocumentSearchState\";\r\n\r\n// There are issues with the % symbol and how React routing handles these\r\n// For now filter them out in cases when they were causing issues\r\nexport const encodeTerm = (term: string) => {\r\n return term.replaceAll('%', '');\r\n}\r\n\r\n// If encoding % characters is handled later, will likely need some sort of matching decoding\r\nexport const decodeTerm = (term: string) => {\r\n if (!term) {\r\n return '';\r\n }\r\n return term;\r\n}\r\n\r\nexport const Searchbar = React.forwardRef((props: { filters?: Array, onChange?: (text: string) => void }, ref) => {\r\n const [searchText, setSearchText] = useState('');\r\n\r\n const history = useHistory();\r\n\r\n const searchOnChange = (e: React.ChangeEvent) => {\r\n if (typeof e.target.value === 'string') {\r\n setSearchText(e.target.value);\r\n }\r\n\r\n if (props.onChange) {\r\n props.onChange(e.target.value);\r\n }\r\n }\r\n\r\n const handleKeyDown = (event: any) => {\r\n if (event.key === 'Enter') {\r\n search();\r\n }\r\n }\r\n\r\n const search = () => {\r\n const searchState: SearchStateParams = { from: history.location.pathname };\r\n history.push(`/search/${encodeTerm(searchText)}`,searchState);\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\nexport default Searchbar;\r\n","import * as React from 'react';\r\n\r\nexport class CleverString extends String {\r\n constructor(value = '') {\r\n super(value);\r\n }\r\n\r\n toKebabCase = () => {\r\n return this.split('')\r\n .map((currentCharacter, idx) => {\r\n if (/[A-Z]/.test(currentCharacter)) {\r\n return ((idx > 0) ? \" \" : \"\") + currentCharacter.toLowerCase();\r\n }\r\n return currentCharacter;\r\n })\r\n .join('')\r\n .replace(/_/g, '-')\r\n .replace(/\\s+/g, '-');\r\n };\r\n\r\n toTitleCase = () => {\r\n return this.toKebabCase()\r\n .split('-')\r\n .map(currentWord => {\r\n return currentWord.slice(0, 1).toUpperCase() + currentWord.slice(1);\r\n })\r\n .join(' ');\r\n }\r\n\r\n toSentenceCase = () => {\r\n if (this.length == 0) {\r\n return this;\r\n }\r\n\r\n if (this.length > 1) {\r\n return this.slice(0, 1).toUpperCase() + this.toKebabCase().replace(/-/g, ' ').slice(1);\r\n }\r\n\r\n return this.substring(0, 1).toUpperCase;\r\n }\r\n\r\n toCamelCase() {\r\n return this.toKebabCase()\r\n .split('-')\r\n .map((currentWord, idx) => {\r\n if (idx === 0) return currentWord;\r\n return currentWord.slice(0, 1).toUpperCase() + currentWord.slice(1).toLowerCase()\r\n })\r\n .join('');\r\n }\r\n};","import * as React from 'react';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { Card } from \"reactstrap\";\r\n\r\nexport default () =>\r\n
\r\n \r\n\r\n \r\n

Under Construction

\r\n\r\n

This page is coming in a future release

\r\n
\r\n
;","import React from 'react';\r\nimport { Link, matchPath } from 'react-router-dom';\r\nimport { useLocation } from 'react-router';\r\nimport { Grid } from '@material-ui/core';\r\nimport { RouteList } from \"helpers/route-config\"\r\nimport Search from \"components/portal/Search\";\r\nimport { CleverString } from 'components/ui/CleverString';\r\nimport UnderConstruction from 'components/UnderConstruction';\r\n\r\n\r\ninterface BreadCrumbsProps {\r\n route: string;\r\n customBreadCrumbs?: any;\r\n}\r\n\r\nconst BreadCrumbs = (props: BreadCrumbsProps) => {\r\n\r\n const items = props.route === \"/\" ? [\"/\"] : props.route.split(\"/\");\r\n let endTrail = false;\r\n\r\n if (props.customBreadCrumbs != undefined) {\r\n return props.customBreadCrumbs();\r\n }\r\n\r\n return (\r\n \r\n {\r\n items.map((item, key, items) => {\r\n\r\n if (endTrail === true) {\r\n return;\r\n }\r\n\r\n let path = '';\r\n for (let i = 0; i <= key; i++) {\r\n if (!path.endsWith('/') && !items[i].startsWith('/')) {\r\n path += '/';\r\n }\r\n path += items[i];\r\n }\r\n\r\n let matchedPath = undefined as undefined | string;\r\n\r\n RouteList.forEach(route => {\r\n let mp = matchPath(path, { path: route.path });\r\n if (mp !== null && mp.isExact) {\r\n matchedPath = mp.path;\r\n }\r\n });\r\n\r\n const route = RouteList.find((r) => matchedPath === r.path);\r\n\r\n if (route?.endTrail === true) {\r\n endTrail = true;\r\n }\r\n\r\n let text = route?.breadCrumb ?? '';\r\n if (typeof (text) !== 'string' || text.length < 1) {\r\n text = item;\r\n }\r\n text = new CleverString(text).toTitleCase() as string;\r\n\r\n var spacer = ` > `;\r\n\r\n if (key == 0) {\r\n spacer = '';\r\n }\r\n\r\n if ((endTrail || key + 1 === items.length) || !route || !route.breadCrumb || route.component === UnderConstruction)\r\n return (\r\n \r\n {spacer}{text}\r\n \r\n );\r\n else {\r\n return (\r\n \r\n {spacer}{text}\r\n \r\n );\r\n }\r\n })\r\n }\r\n \r\n );\r\n}\r\n\r\ninterface SubHeaderProps {\r\n color?: string;\r\n hideSearchBar?: boolean;\r\n customBreadCrumbs?: any;\r\n}\r\n\r\nexport const SubHeader = (props: SubHeaderProps) => {\r\n const location = useLocation();\r\n\r\n var style = {};\r\n\r\n if (props.color) {\r\n style = { backgroundColor: props.color, color: \"white\" };\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {props.hideSearchBar !== true &&\r\n \r\n }\r\n \r\n \r\n );\r\n};\r\n\r\nexport default SubHeader;\r\n","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgReportsFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 70.191,\n height: 52.3,\n viewBox: \"0 0 70.191 52.3\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M64.192 13.765H6a6.007 6.007 0 0 1-6-6V6a6.007 6.007 0 0 1 6-6h58.192a6.007 6.007 0 0 1 6 6v1.764a6.007 6.007 0 0 1-6 6.001zM53.676 4.819v4.816h11.01V4.819z\",\n transform: \"translate(-964 -531.999) translate(964 531.998)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M64.192 13.765H6a6.007 6.007 0 0 1-6-6V6a6.007 6.007 0 0 1 6-6h58.192a6.007 6.007 0 0 1 6 6v1.764a6.007 6.007 0 0 1-6 6.001zm-27.72-8.946v4.816h28.214V4.819z\",\n transform: \"translate(-964 -531.999) translate(964 551.266)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M64.192 13.765H6a6.007 6.007 0 0 1-6-6V6a6.007 6.007 0 0 1 6-6h58.192a6.007 6.007 0 0 1 6 6v1.764a6.007 6.007 0 0 1-6 6.001zM50.235 4.819v4.816h14.45V4.819z\",\n transform: \"translate(-964 -531.999) translate(964 570.534)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgReportsFilled);\nexport default __webpack_public_path__ + \"static/media/reports-filled.deeafbe6.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { useState, useEffect } from 'react'\r\nimport SideBar from \"./SideBar\";\r\nimport DocumentGrid, { GridColumnName } from \"components/portal/DocumentGrid\";\r\nimport { RailDocument } from \"shared/models/api/models\";\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { AddNewForm, EditForm, RescindForm } from \"./admin/AddEditDocument\";\r\nimport InfoModal from \"components/ui/InfoModal\";\r\nimport { ReactComponent as FilterIcon } from \"assets/icons/filter.svg\";\r\nimport './DocumentsList.css'\r\nimport { Grid } from '@material-ui/core';\r\nimport {\r\n defaultDocumentFilter, defaultDocumentIcon, DocumentModules, DocumentStatuses, findDocumentView,\r\n getClassName, IDocumentFilter, IDocumentModule, IDocumentView, IDocumentStatus, DefaultView\r\n} from 'components/ui/DocumentRules';\r\nimport { Toggle } from \"components/ui/ToggleContent\";\r\n\r\ninterface IPageSizeDropdownProps {\r\n pageSize: number,\r\n setPageSize: (pageSize: number) => void,\r\n defaultExpanded?: boolean,\r\n sizes: number[]\r\n}\r\n\r\nconst PageSizeDropdown = (props: IPageSizeDropdownProps) =>\r\n \r\n
\r\n {props.sizes.map(s =>\r\n
props.setPageSize(s)}>{s} items
\r\n )}\r\n
\r\n
\r\n ;\r\n\r\nconst PageSizeWithPicker = (props: IPageSizeDropdownProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ninterface IToggleButtonProps {\r\n text: string,\r\n selected: boolean,\r\n setSelected: (selected: boolean) => void\r\n}\r\n\r\nconst ToggleButton = (props: IToggleButtonProps) =>\r\n
props.setSelected(!props.selected)}>{props.text}
;\r\n\r\ninterface IFilterDocumentsDialog {\r\n visible: boolean,\r\n setResult: (filter: IDocumentFilter | null) => void\r\n}\r\n\r\nconst FilterDocumentsDialog = (props: IFilterDocumentsDialog) => {\r\n const ok = () => {\r\n const userFilter = {} as IDocumentFilter;\r\n\r\n props.setResult(userFilter);\r\n };\r\n\r\n const cancel = () => {\r\n props.setResult(null);\r\n };\r\n\r\n const [ver, setVer] = useState(1);\r\n const [modules, setModules] = useState([] as number[]);\r\n const [statuses, setStatuses] = useState([] as string[]);\r\n\r\n const toggleStatus = (s: IDocumentStatus) => {\r\n const idx = statuses.indexOf(s.name);\r\n\r\n if (idx === -1) {\r\n statuses.push(s.name);\r\n } else {\r\n statuses.splice(idx, 1);\r\n }\r\n\r\n setStatuses(statuses);\r\n setVer(ver + 1);\r\n };\r\n\r\n const toggleModule = (m: IDocumentModule) => {\r\n const idx = modules.indexOf(m.id);\r\n\r\n if (idx === -1) {\r\n modules.push(m.id);\r\n } else {\r\n modules.splice(idx, 1);\r\n }\r\n\r\n setModules(modules);\r\n setVer(ver + 1);\r\n };\r\n\r\n return (\r\n
\r\n\r\n
\r\n
By module:
\r\n\r\n \r\n \r\n setModules([])} />\r\n \r\n\r\n {DocumentModules.map(m =>\r\n toggleModule(m)} />\r\n )}\r\n \r\n
\r\n\r\n
\r\n
By module:
\r\n\r\n \r\n setStatuses([])}\r\n >\r\n All\r\n \r\n\r\n {DocumentStatuses.filter(s => s.availableInMyDocuments).map(s =>\r\n -1 ? \" selected\" : \"\")}\r\n onClick={() => toggleStatus(s)}\r\n >\r\n {s.name + statuses.indexOf(s.name)}\r\n \r\n )}\r\n \r\n
\r\n\r\n
Cancel
\r\n
OK
\r\n\r\n
\r\n );\r\n};\r\n\r\ninterface IDocumentListProps {\r\n}\r\n\r\nconst DocumentList = (props: IDocumentListProps) => {\r\n const [showSingleSelectMessage, setShowSingleSelectMessage] = useState(false);\r\n const [pageSize, setPageSize] = useState(-1);\r\n\r\n const [activeView, setActiveView] = useState(null as IDocumentView | null);\r\n const [activeFilter, setActiveFilter] = useState(null as IDocumentFilter | null);\r\n const [activeSubFilter, setActiveSubFilter] = useState(null as IDocumentFilter | null);\r\n const [userFilter, setUserFilter] = useState(null as IDocumentFilter | null);\r\n\r\n const [selectedModuleFilter, setSelectedModuleFilter] = useState(null as IDocumentModule | null);\r\n const [loadingState, setLoadingState] = useState(\"loading\");\r\n const [selectedItems, setSelectedItems] = useState([] as number[]);\r\n const [unfilteredDocuments, setUnfilteredDocuments] = useState(null as RailDocument[] | null);\r\n const [filteredDocuments, setFilteredDocuments] = useState(null as RailDocument[] | null);\r\n const [filteredCount, setFilteredCount] = useState(0);\r\n const [hiddenColumns, setHiddenColumns] = useState([\"Select\"] as GridColumnName[]);\r\n const [modalFilterVisible, setModalFilterVisible] = useState(false);\r\n const CurrentIcon = activeSubFilter?.icon ?? activeFilter?.icon ?? activeView?.icon ?? defaultDocumentIcon;\r\n const WatermarkIcon = activeView?.icon;\r\n const showWatermark = false;\r\n\r\n const [showAddDocument, setShowAddDocument] = useState(false);\r\n const [showEditDocument, setShowEditDocument] = useState(false);\r\n const [showRescindDocument, setShowRescindDocument] = useState(false);\r\n const [actionDocumentId, setActionDocumentId] = useState(0);\r\n\r\n const defaultPageSize = 10;\r\n\r\n const clearModals = () => {\r\n setShowAddDocument(false);\r\n setShowEditDocument(false);\r\n setShowRescindDocument(false);\r\n clearSelectedItems();\r\n }\r\n\r\n const addDocument = () => {\r\n setShowAddDocument(true);\r\n };\r\n\r\n const editDocument = (doc: RailDocument) => {\r\n setActionDocumentId(doc.id);\r\n setShowEditDocument(true);\r\n };\r\n\r\n const recindDocument = (doc: RailDocument) => {\r\n setActionDocumentId(doc.id);\r\n setShowRescindDocument(true);\r\n };\r\n\r\n const clearSelectedItems = () => {\r\n setActionDocumentId(0);\r\n setSelectedItems([]);\r\n };\r\n\r\n const history = useHistory();\r\n\r\n const switchView = (view: IDocumentView | null) => {\r\n if (view?.url) {\r\n if (view.defaultFilter) {\r\n history.replace(view.defaultFilter.url);\r\n } else {\r\n history.replace(view.url);\r\n }\r\n }\r\n\r\n setActiveView(view);\r\n };\r\n\r\n const getPage = async (pageSize: number, pageNumber: number) => {\r\n if (activeView?.pagedDataSource) {\r\n var result = await activeView.pagedDataSource(pageSize, pageNumber);\r\n\r\n return result.results;\r\n }\r\n };\r\n\r\n const getAllResults = async () => {\r\n if (activeView?.dataSource) {\r\n var result = await activeView.dataSource();\r\n\r\n if (activeView.sortPredicate) {\r\n return result.sort(activeView.sortPredicate);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n return getPage(-1, 1);\r\n };\r\n\r\n const switchFilter = (filter: IDocumentFilter | null) => {\r\n if (filter?.url) {\r\n history.replace(filter.url);\r\n }\r\n\r\n clearSelectedItems();\r\n\r\n if (unfilteredDocuments) {\r\n setActiveSubFilter(null);\r\n } else {\r\n setActiveSubFilter(filter?.subFilters ? filter.subFilters[0] : null);\r\n }\r\n \r\n setActiveFilter(filter);\r\n };\r\n\r\n const switchSubFilter = (filter: IDocumentFilter | null) => {\r\n if (filter?.url) {\r\n history.replace(filter.url);\r\n }\r\n clearSelectedItems();\r\n setActiveSubFilter(filter);\r\n };\r\n\r\n const setPathView = (viewDataForCurrentPath: any) => {\r\n if (viewDataForCurrentPath.filter) {\r\n switchFilter(viewDataForCurrentPath.filter);\r\n\r\n if (viewDataForCurrentPath.subFilter) {\r\n switchSubFilter(viewDataForCurrentPath.subFilter);\r\n }\r\n }\r\n else {\r\n if (viewDataForCurrentPath.view.defaultFilter) {\r\n // use the default filter\r\n switchFilter(viewDataForCurrentPath.view.defaultFilter);\r\n history.replace(viewDataForCurrentPath.view.defaultFilter.url);\r\n }\r\n else {\r\n if (viewDataForCurrentPath.view.filters?.length > 0) {\r\n // take the first one\r\n switchFilter(viewDataForCurrentPath.view.filters[0]);\r\n history.replace(viewDataForCurrentPath.view.filters[0].url);\r\n }\r\n }\r\n }\r\n\r\n const pageSize = viewDataForCurrentPath.view.rules?.gridConfig?.defaultPageSize ?? defaultPageSize;\r\n setPageSize(pageSize);\r\n setActiveView(viewDataForCurrentPath.view);\r\n applyFilters();\r\n }\r\n\r\n const setDefaultView = () => {\r\n if (DefaultView.url) {\r\n history.replace((DefaultView.defaultFilter ?? DefaultView).url);\r\n return;\r\n }\r\n\r\n if (DefaultView.defaultFilter) {\r\n setActiveFilter(DefaultView.defaultFilter);\r\n }\r\n\r\n const pageSize = DefaultView.rules?.gridConfig?.defaultPageSize ?? defaultPageSize;\r\n setPageSize(pageSize);\r\n setActiveView(DefaultView);\r\n applyFilters();\r\n }\r\n\r\n const applyFilters = () => {\r\n if (unfilteredDocuments) {\r\n const filteredResults = unfilteredDocuments.filter(doc =>\r\n defaultDocumentFilter(doc, activeView, activeFilter, activeSubFilter, selectedModuleFilter, userFilter)\r\n );\r\n\r\n setFilteredDocuments(filteredResults);\r\n }\r\n else {\r\n setFilteredDocuments(null);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (!activeView) {\r\n // resolve the view from the url\r\n var viewDataForCurrentPath = findDocumentView(history.location.pathname);\r\n\r\n // if we found a matching view, use that view\r\n if (viewDataForCurrentPath?.view) {\r\n setPathView(viewDataForCurrentPath);\r\n }\r\n else {\r\n setDefaultView();\r\n }\r\n }\r\n }, []);\r\n\r\n const getHiddenColumns = () => {\r\n const result = [] as GridColumnName[];\r\n\r\n if (activeView) {\r\n if (!activeView.rules?.canSelect) result.push(\"Select\");\r\n if (!activeView.rules?.canFavourite) result.push(\"Favourite\");\r\n if (!(activeFilter ?? activeView)?.rules?.hasSubTypes) result.push(\"SubType\");\r\n if (!(activeFilter ?? activeView)?.rules?.hasStatus) result.push(\"Status\");\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const getDocuments = async () => {\r\n setLoadingState(\"loading\");\r\n\r\n await getAllResults()\r\n .then(result => {\r\n if (result) {\r\n setUnfilteredDocuments(result);\r\n }\r\n setLoadingState(\"idle\");\r\n })\r\n .catch(e => {\r\n setLoadingState(\"error\");\r\n console.log(\"Error fetching documents\");\r\n console.log(e);\r\n });\r\n };\r\n\r\n const onViewChange = () => {\r\n if (activeView && (activeView.dataSource || activeView.pagedDataSource)) {\r\n setUnfilteredDocuments(null);\r\n setFilteredDocuments(null);\r\n getDocuments();\r\n setHiddenColumns(getHiddenColumns());\r\n clearSelectedItems();\r\n }\r\n\r\n return () => {\r\n }\r\n };\r\n\r\n const updateFilteredCount = () => {\r\n setFilteredCount(filteredDocuments?.length ?? 0)\r\n };\r\n\r\n const handleFilterResult = (filter: IDocumentFilter | null) => {\r\n if (filter) {\r\n setUserFilter(filter);\r\n }\r\n\r\n setModalFilterVisible(false);\r\n };\r\n\r\n const openDoc = (id: number) => {\r\n history.push(`/pdf/view/${id}`);\r\n };\r\n\r\n const selectManyDoc = (id: number) => {\r\n var arr = selectedItems.map(i => i);\r\n\r\n if (arr.indexOf(id)) {\r\n arr.push(id);\r\n\r\n setSelectedItems(arr);\r\n } else {\r\n setSelectedItems(arr.filter(x => x !== id));\r\n }\r\n }\r\n\r\n const selectSingleDoc = (id: number) => {\r\n setSelectedItems([id]);\r\n }\r\n\r\n const setFiltersIfRequired = () => {\r\n let currentPath = history.location.pathname;\r\n if (activeFilter?.url != currentPath) {\r\n let docView = findDocumentView(currentPath);\r\n if (docView?.filter) {\r\n setActiveFilter(docView.filter);\r\n }\r\n if (docView?.subFilter) {\r\n setActiveSubFilter(docView.subFilter);\r\n }\r\n else {\r\n setActiveSubFilter(null);\r\n }\r\n }\r\n }\r\n\r\n useEffect(setFiltersIfRequired, [props]);\r\n useEffect(onViewChange, [activeView]);\r\n useEffect(applyFilters, [activeFilter, activeSubFilter, selectedModuleFilter, userFilter, unfilteredDocuments]);\r\n useEffect(updateFilteredCount, [filteredDocuments]);\r\n\r\n return (\r\n
\r\n\r\n
\r\n\r\n
\r\n {showWatermark && }\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {(activeSubFilter ?? activeFilter ?? activeView)?.name}\r\n \r\n \r\n \r\n \r\n \r\n {pageSize > -1 &&\r\n \r\n }\r\n \r\n \r\n \r\n
\r\n \r\n {pageSize > -1 ? \"per page of\" : \"\"} {filteredCount} results
\r\n
\r\n \r\n setModalFilterVisible(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 setShowSingleSelectMessage(false)} />\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default DocumentList;","import { http, httpDownloadAs } from 'shared/services/httpService';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport { CleverString } from 'components/ui/CleverString';\r\nimport { FatigueAssessmentReportQuery, LoginHistoryReportQuery, LoginHistory } from 'shared/models/api/models';\r\nconst basePath = '/api/reporting/';\r\n\r\nconst fullyQualifiedAndEncodedURL = (relativeUri: string) => {\r\n return new URL(basePath + encodeURI(relativeUri), appSettings.api.portalApi).toString();\r\n};\r\n\r\nconst getUsersByNamePath = (name: string) => { return fullyQualifiedAndEncodedURL('usersByName/' + name); };\r\nconst getSupervisorsByNamePath = (name: string) => { return fullyQualifiedAndEncodedURL('supervisorsByName/' + name); };\r\nconst getUsersByPublisherNamePath = (name: string) => { return fullyQualifiedAndEncodedURL('usersByPublisherName/' + name); };\r\nconst getDocumentsByNamePath = (name: string) => { return fullyQualifiedAndEncodedURL('documentsByName/' + name); };\r\nconst getAllDocumentsPath = () => { return fullyQualifiedAndEncodedURL('allDocuments') };\r\nconst getUsersSupervisedByCurrentUserPath = () => { return fullyQualifiedAndEncodedURL('usersSupervisedByCurrentUser') };\r\nconst getUsersPath = () => { return fullyQualifiedAndEncodedURL('users') };\r\nconst getSupervisorsPath = () => { return fullyQualifiedAndEncodedURL('supervisors') };\r\nconst getPublishersPath = () => { return fullyQualifiedAndEncodedURL('publishers') };\r\nconst getUsersBySupervisorPath = (id: number) => { return fullyQualifiedAndEncodedURL('usersBySupervisor/' + id); };\r\nconst getUsersByDepartmentPath = (name: string) => { return fullyQualifiedAndEncodedURL('usersByDepartment/' + name); };\r\nconst getUsersByStatusPath = (name: string) => { return fullyQualifiedAndEncodedURL('usersByStaus/' + name); };\r\nconst getDepartmentsPath = () => { return fullyQualifiedAndEncodedURL('departments'); };\r\nconst getDocumentTypesPath = () => { return fullyQualifiedAndEncodedURL('documentTypes'); };\r\nconst getUserStatusesPath = () => { return fullyQualifiedAndEncodedURL('userStatuses'); };\r\nconst getDocumentStatusesPath = () => { return fullyQualifiedAndEncodedURL('documentStatuses'); };\r\nconst getUsersDocumentsPath = () => { return fullyQualifiedAndEncodedURL('usersDocuments'); };\r\nconst downloadResultsPath = () => { return fullyQualifiedAndEncodedURL('usersDocumentsExport'); };\r\nconst downloadFatigueAssessmentResultsPath = () => { return fullyQualifiedAndEncodedURL('fatigueassessmentsexport'); };\r\nconst getLoginHistoryResultsPath = () => { return fullyQualifiedAndEncodedURL('loginhistory'); };\r\nconst downloadLoginHistoryResultsPath = () => { return fullyQualifiedAndEncodedURL('loginhistoryexport'); };\r\nconst downloadFullComplianceReportPath = () => { return fullyQualifiedAndEncodedURL('fullComplianceReport'); };\r\n\r\nexport interface DocumentMetadata {\r\n title: string,\r\n documentNumber: string\r\n}\r\n\r\nexport interface DocumentMetadataExtended extends DocumentMetadata {\r\n effectiveFromDate?: Date,\r\n expiryDate?: Date,\r\n modifiedDate?: Date,\r\n reviewDate?: Date,\r\n releaseNotes?: string\r\n}\r\n\r\nexport interface Document {\r\n id: number, \r\n type: string,\r\n subType: string,\r\n fileName: string,\r\n metadata: T,\r\n}\r\n\r\nexport interface DocumentExtended extends Document {\r\n status: string,\r\n uploadedBy: string,\r\n uploadedDate: Date,\r\n relatedDocuments: string[]\r\n}\r\n\r\nexport interface IEntity {\r\n id: number\r\n}\r\n\r\nexport interface DocumentType extends IEntity {\r\n id: number,\r\n name: string,\r\n parentId: number,\r\n subTypes?: DocumentType[],\r\n module: string\r\n}\r\n\r\nexport interface ISortConfig {\r\n field: string,\r\n dir: string\r\n}\r\n\r\nexport interface User extends IEntity {\r\n fullName: string, \r\n city: string,\r\n officeLocation: string,\r\n email: string,\r\n supervisor: string\r\n}\r\n\r\nexport interface UserExtended {\r\n firstName: string,\r\n lastName: string, \r\n role: string, \r\n department: string,\r\n status: string,\r\n lastLoginDate: Date,\r\n mobile: string,\r\n employeeType: string,\r\n company: string,\r\n jobTitle: string, \r\n division: string\r\n}\r\n\r\nexport interface UserDocumentAction {\r\n lastAction: string,\r\n notifyDate: Date,\r\n acknowledgedDate: Date,\r\n clarificationDate: Date,\r\n clarificationText: string,\r\n feedbackText: string,\r\n viewDate: Date\r\n}\r\n\r\nexport interface IResultList {\r\n list: any[],\r\n totalResults: number\r\n}\r\n\r\nexport interface UsersDocumentsResult extends IResultList {\r\n list: UserDocument[]\r\n}\r\n\r\nexport interface LoginHistoryReportResult extends IResultList {\r\n list: LoginHistory[]\r\n}\r\n\r\nexport interface UserDocument extends IEntity {\r\n docuement?: Document,\r\n user?: User,\r\n action?: UserDocumentAction\r\n}\r\n\r\nexport interface DocumentsFilter {\r\n ids: number[],\r\n typeIds: number[],\r\n statuses: CleverString[],\r\n publishedFromDate?: Date,\r\n publishedToDate?: Date,\r\n publisherIds: number[]\r\n}\r\n\r\nexport interface UsersFilter {\r\n ids: number[],\r\n supervisorIds: number[],\r\n statuses: string[],\r\n departments: string[],\r\n employeeTypes: string[]\r\n}\r\n\r\nexport interface ExportColumn {\r\n title: string,\r\n name: string, \r\n selected: boolean,\r\n formatter?: (value: any) => JSX.Element,\r\n defaultForComplianceReport?: number,\r\n infoDialog?: (item: UserDocument) => void,\r\n unsortable: boolean\r\n}\r\n\r\ninterface IPagedFilter {\r\n pageNumber: number,\r\n pageSize: number,\r\n sort: ISortConfig[]\r\n}\r\n\r\nexport interface UsersDocumentsFilter extends IPagedFilter {\r\n users?: UsersFilter,\r\n documents?: DocumentsFilter,\r\n fileType: string,\r\n exportColumns: ExportColumn[]\r\n}\r\n\r\nexport interface Location {\r\n id: number,\r\n name: string\r\n}\r\n\r\nexport const getUsers = async () => {\r\n return await http(getUsersPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting users')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getSupervisors = async () => {\r\n return await http(getSupervisorsPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting supervisors')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getPublishers = async () => {\r\n return await http(getPublishersPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting publishers')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUsersSupervisedByCurrentUser = async () => {\r\n return await http(getUsersSupervisedByCurrentUserPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting users in my team')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUsersBySupervisor = async (supervisorId: number) => {\r\n return await http(getUsersBySupervisorPath(supervisorId), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting users for supervisor')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getDocumentTypes = async () => {\r\n return await http(getDocumentTypesPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting document types')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getDepartments = async () => {\r\n return await http(getDepartmentsPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting departments')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUserStatuses = async () => {\r\n return await http(getUserStatusesPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting user statuses')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getDocumentStatuses = async () => {\r\n var result = await http(getDocumentStatusesPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting document statuses')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n if (result) {\r\n return result.map(status => { return new CleverString(status); });\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const getUsersByDepartment = async (name: string) => {\r\n const result = await http(getUsersByDepartmentPath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting users for depoartment')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return result;\r\n};\r\n\r\nexport const getUsersByStatus = async (name: string) => {\r\n return await http(getUsersByStatusPath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error getting users for status')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUsersByName = async (name: string) => {\r\n return await http(getUsersByNamePath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error search users')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getSupervisorsByName = async (name: string) => {\r\n return await http(getSupervisorsByNamePath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error search supervisors')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUsersByPublisherName = async (name: string) => {\r\n return await http(getUsersByPublisherNamePath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error search users')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getDocumentsByName = async (name: string) => {\r\n return await http[]>(getDocumentsByNamePath(name), \"GET\")\r\n .catch((e) => {\r\n console.log('error searching documents')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getAllDocuments = async () => {\r\n return await http[]>(getAllDocumentsPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error searching documents')\r\n console.log(e);\r\n return null;\r\n });\r\n};\r\n\r\nexport const getUsersDocuments = async (filter: UsersDocumentsFilter) => {\r\n return await http(getUsersDocumentsPath(), 'POST', filter);\r\n};\r\n\r\nexport const downloadResults = async (filter: UsersDocumentsFilter) => {\r\n const response = await httpDownloadAs(downloadResultsPath(), \"POST\", filter)\r\n .catch((e) => {\r\n console.log('error exporting users documents')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return response;\r\n};\r\n\r\nexport const downloadFatigueAssessmentResults = async (filter: FatigueAssessmentReportQuery) => {\r\n const response = await httpDownloadAs(downloadFatigueAssessmentResultsPath(), \"POST\", filter)\r\n .catch((e) => {\r\n console.log('error exporting fatigue assessments')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return response;\r\n};\r\n\r\nexport const getLoginHistoryResults = async (filter: LoginHistoryReportQuery) => {\r\n const response = await http(getLoginHistoryResultsPath(), \"POST\", filter)\r\n .catch((e) => {\r\n console.log('error exporting login history')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return response;\r\n};\r\n\r\nexport const downloadLoginHistoryResults = async (filter: LoginHistoryReportQuery) => {\r\n const response = await httpDownloadAs(downloadLoginHistoryResultsPath(), \"POST\", filter)\r\n .catch((e) => {\r\n console.log('error exporting login history')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return response;\r\n};\r\n\r\nexport const downloadFullComplianceReport = async () => {\r\n const response = await httpDownloadAs(downloadFullComplianceReportPath(), \"GET\")\r\n .catch((e) => {\r\n console.log('error exporting login history')\r\n console.log(e);\r\n return null;\r\n });\r\n\r\n return response;\r\n};\r\n","import * as React from 'react';\r\nimport { ReactNode } from \"react\";\r\n\r\nexport interface ITabPanelProps {\r\n value: number,\r\n index: number,\r\n children: ReactNode,\r\n className?: string\r\n}\r\n\r\nexport const TabPanel = (props: ITabPanelProps) => {\r\n return (\r\n \r\n );\r\n};","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgBuildCircle(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"build-circle\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8.011,8.011,0,0,1,12,20Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.49,11.38A3.459,3.459,0,0,0,8.58,7.17l2.35,2.35L9.52,10.93,7.17,8.58a3.459,3.459,0,0,0,4.21,4.91l3.41,3.41a.5.5,0,0,0,.71,0l1.4-1.4a.5.5,0,0,0,0-.71Z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgBuildCircle);\nexport default __webpack_public_path__ + \"static/media/build-circle.33adc57a.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgDashboardCustomize(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"dashboard_customize_black_24dp\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4437\",\n \"data-name\": \"Path 4437\",\n className: \"cls-1\",\n d: \"M0,0H24V24H0Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4438\",\n \"data-name\": \"Path 4438\",\n d: \"M3,3h8v8H3ZM13,3h8v8H13ZM3,13h8v8H3Zm15,0H16v3H13v2h3v3h2V18h3V16H18Z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgDashboardCustomize);\nexport default __webpack_public_path__ + \"static/media/dashboard-customize.b9d98087.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAddChart(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22 5v2h-3v3h-2V7h-3V5h3V2h2v3zm-3 14H5V5h6V3H5a2.006 2.006 0 0 0-2 2v14a2.006 2.006 0 0 0 2 2h14a2.006 2.006 0 0 0 2-2v-6h-2zm-4-6v4h2v-4zm-4 4h2V9h-2zm-2 0v-6H7v6z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAddChart);\nexport default __webpack_public_path__ + \"static/media/add-chart.409f13fb.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgUsersFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 67,\n height: 67,\n viewBox: \"0 0 67 67\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-2{fill-rule:evenodd}\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"people_alt-24px\",\n transform: \"translate(.111 .297)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2275\",\n transform: \"translate(-.111 -.297)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Rectangle_1704\",\n fill: \"none\",\n d: \"M0 0H67V67H0z\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2281\",\n transform: \"translate(2.813 11.202)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2280\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2276\",\n transform: \"translate(43.491 25.34)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_2539\",\n d: \"M16.67 13.13c3.8 2.581 6.467 6.078 6.467 10.741V32.2h11.1v-8.329c.002-6.05-9.907-9.631-17.567-10.741z\",\n className: \"cls-2\",\n transform: \"translate(-16.67 -13.13)\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2277\",\n transform: \"translate(10.459 .546)\"\n }, /*#__PURE__*/React.createElement(\"ellipse\", {\n id: \"Ellipse_271\",\n cx: 11.5,\n cy: 10.5,\n rx: 11.5,\n ry: 10.5,\n transform: \"translate(-.383 -.045)\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2278\",\n transform: \"translate(35.165)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_2540\",\n d: \"M17.361 26.2a11.1 11.1 0 0 0 0-22.2 11.6 11.6 0 0 0-3.691.666 16.6 16.6 0 0 1 0 20.871 11.6 11.6 0 0 0 3.691.663z\",\n className: \"cls-2\",\n transform: \"translate(-13.67 -4)\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2279\",\n transform: \"translate(0 24.979)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_2541\",\n d: \"M23.2 13C15.793 13 1 16.719 1 24.1v8.326h44.407V24.1c0-7.381-14.793-11.1-22.207-11.1z\",\n className: \"cls-2\",\n transform: \"translate(-1 -13)\"\n })))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUsersFilled);\nexport default __webpack_public_path__ + \"static/media/users-filled.df323895.svg\";\nexport { ForwardRef as ReactComponent };","import { HighlightOffOutlined } from '@material-ui/icons';\r\nimport React, { ReactNode } from 'react';\r\nimport './ModalBox.css';\r\nimport { Modal } from 'reactstrap';\r\n\r\nexport interface IModalBoxProps {\r\n heading?: ReactNode,\r\n subHeading?: ReactNode,\r\n options?: string[];\r\n defaultOption?: string;\r\n body: ReactNode;\r\n icon?: any,\r\n canClose?: () => boolean,\r\n setResult?: (value: string) => void,\r\n className?: string\r\n}\r\n\r\nexport const ModalBox = (props: IModalBoxProps) => {\r\n const onClickOutside = (e: React.MouseEvent) => {\r\n if (props.setResult) {\r\n e.stopPropagation();\r\n\r\n if (!props.canClose || props.canClose()) {\r\n if (e.target === e.currentTarget) {\r\n props.setResult(\"ClickOutsideModal\");\r\n }\r\n }\r\n }\r\n };\r\n\r\n const close = () => {\r\n if (props.setResult) {\r\n if (props.canClose && props.canClose()) {\r\n props.setResult(\"CloseModal\");\r\n }\r\n }\r\n };\r\n\r\n const Icon = props.icon;\r\n\r\n return (\r\n <>\r\n {props.body &&\r\n \r\n
\r\n
\r\n {Icon &&\r\n \r\n }\r\n
\r\n\r\n {props.heading && <>\r\n
{props.heading}
\r\n\r\n
\r\n \r\n
\r\n\r\n {props.subHeading &&\r\n
{props.subHeading}
\r\n }\r\n\r\n
\r\n {props.body}\r\n
\r\n }\r\n\r\n {!props.heading && props.body}\r\n\r\n
\r\n {\r\n props.options?.map(opt => {\r\n return ();\r\n })\r\n }\r\n
\r\n
\r\n
\r\n }\r\n \r\n );\r\n};","import React, { useEffect } from 'react';\r\nimport SubHeader from 'components/menu/SubHeader';\r\nimport './PortalPage.css';\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { ConfirmationBox, IConfirmProps } from '../ui/ConfirmationBox';\r\nimport { ModalBox, IModalBoxProps } from '../ui/ModalBox';\r\n\r\nexport interface IPortalPageProps {\r\n module: string,\r\n page: string,\r\n loadingState: string,\r\n children: React.ReactNode,\r\n title?: string,\r\n route: string,\r\n icon?: any,\r\n confirmationProps?: IConfirmProps | null,\r\n modalProps?: IModalBoxProps | null\r\n}\r\n\r\nexport const PortalPage = (props: IPortalPageProps) => {\r\n const Icon = props.icon;\r\n const history = useHistory();\r\n\r\n useEffect(() => {\r\n if (props.route.length > 0 && props.route !== history.location.pathname) {\r\n history.replace(props.route);\r\n }\r\n }, [props.route]);\r\n\r\n return (\r\n
\r\n {props.confirmationProps &&\r\n \r\n }\r\n\r\n {props.modalProps &&\r\n \r\n }\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.title &&\r\n
\r\n {props.icon &&
}\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 );\r\n};\r\n\r\nexport default PortalPage;","import React, { ReactNode, useEffect, useState } from 'react';\r\nimport { Grid, GridSize } from '@material-ui/core';\r\nimport { HighlightOffOutlined, Info, MailOutline, NearMeOutlined, SupervisorAccountOutlined } from '@material-ui/icons';\r\nimport { IUserSearchResult } from 'shared/models/api/models';\r\nimport { searchUserByName, getAllEmployees } from 'shared/services/userApi';\r\nimport { IDataCol, IKeyValuePair } from './DataGrid';\r\nimport { IListItemProps, List } from './Lists';\r\nimport ReactDatePicker from 'react-datepicker';\r\nimport { LabelledCheckbox } from './LabelledCheckbox';\r\nimport { FormMode, IApplicationModule, IApplicationModuleViewAction } from './IApplicationModule';\r\nimport { IConfirmProps } from './ConfirmationBox';\r\nimport { useProfile, userHasPermission } from 'hooks/useRoles';\r\n\r\ntype EditLayout = \"grid\" | \"form\";\r\nconst DefaultLayout = \"form\";\r\n\r\nconst editStates = [\"edit\", \"new\", \"quickEdit\"] as FormMode[];\r\nconst viewStates = [\"view\", \"review\"] as FormMode[];\r\n\r\nconst allColumns = 12 as GridSize;\r\nconst propertyColumnSpan = 6 as GridSize;\r\n\r\n// use the balance of the space for the value\r\nconst valueColumnSpan = (allColumns as number) - (propertyColumnSpan as number) as GridSize;\r\n\r\nconst titleAndControlOnSeperateRows = allColumns;\r\nconst titleAndControlOnSameRow = valueColumnSpan;\r\n\r\ninterface IFieldProps {\r\n heading: string,\r\n mode: FormMode,\r\n editModeValue: ReactNode,\r\n viewModeValue: ReactNode,\r\n isValid: boolean,\r\n validationMessages?: string[],\r\n immediateValidationMessages?: string[],\r\n validationTooltip?: string,\r\n editLayout?: EditLayout,\r\n tip?: string\r\n}\r\n\r\nconst getLayout = (currentMode: FormMode, editLayout: EditLayout | undefined): EditLayout => {\r\n // always grid for view mode\r\n if (viewStates.includes(currentMode)) return \"grid\";\r\n\r\n return editLayout ?? DefaultLayout;\r\n};\r\n\r\nconst getGridColSpanForLayout = (currentMode: FormMode, editLayout: EditLayout | undefined): GridSize => {\r\n if (getLayout(currentMode, editLayout) === \"grid\") {\r\n return titleAndControlOnSameRow; //50%\r\n }\r\n\r\n return titleAndControlOnSeperateRows;\r\n};\r\n\r\nconst getValue = (fieldProps: IFormField) => {\r\n return (fieldProps.col.formatRow ? fieldProps.col.formatRow(fieldProps.row) : fieldProps.row[fieldProps.col.name]);\r\n};\r\n\r\nconst getValues = (col: IDataCol) => {\r\n return (col.validation?.values ?? []) as IKeyValuePair[];\r\n}\r\n\r\nconst getLookupKeyValuePair = (fieldProps: IFormField): IKeyValuePair => {\r\n const value = getValue(fieldProps);\r\n\r\n if (value !== null) {\r\n var kvp = getValues(fieldProps.col).find(v => v.key === value);\r\n\r\n if (kvp) {\r\n return kvp;\r\n }\r\n }\r\n\r\n return {} as IKeyValuePair;\r\n};\r\n\r\nconst getLookupValue = (fieldProps: IFormField) => {\r\n return getLookupKeyValuePair(fieldProps)?.value;\r\n};\r\n\r\nconst isReadonly = (currentMode: FormMode, col: IDataCol, row: any) => {\r\n // always readonly in view mode\r\n if (viewStates.includes(currentMode)) {\r\n return true;\r\n }\r\n\r\n // do we have a callback?\r\n if (col.readonlyIf) {\r\n if (col.readonlyIf(row) === true) {\r\n return true;\r\n }\r\n }\r\n\r\n // some controls can be set on new, but not updated, so we're not using editStates.includes(), just checking if edit\r\n if (col.readonlyForEdit === true && currentMode === \"edit\") {\r\n return true;\r\n }\r\n\r\n // use the static readonly flag, or default to false\r\n return col.readonly ?? false;\r\n};\r\n\r\nconst getFieldMode = (fieldProps: IFormField): FormMode => {\r\n if (viewStates.includes(fieldProps.mode)) {\r\n return (fieldProps.mode);\r\n }\r\n\r\n // if we're in grid layout and its disabled, then just show as a label\r\n if (fieldProps.editLayout === \"grid\" && isReadonly(fieldProps.mode, fieldProps.col, fieldProps.row)) {\r\n return \"view\";\r\n }\r\n\r\n return fieldProps.mode;\r\n};\r\n\r\nexport const Field = (props: IFieldProps) => {\r\n return (\r\n \r\n \r\n \r\n {props.heading}{(viewStates.includes(props.mode) ? \":\" : \"\")}\r\n {props.tip && editStates.includes(props.mode) &&\r\n \r\n \r\n \r\n }\r\n \r\n \r\n\r\n \r\n {viewStates.includes(props.mode) ? props.viewModeValue : props.editModeValue}\r\n\r\n {props.immediateValidationMessages != undefined && props.immediateValidationMessages?.map(message =>\r\n
{message}
\r\n )}\r\n\r\n {!props.isValid && props.validationMessages?.map(message =>\r\n
{message}
\r\n )}\r\n
\r\n\r\n
\r\n );\r\n}\r\n\r\nconst UserListItem = (props: IListItemProps) =>\r\n props.toggle(props.item)}>\r\n {props.item.fullname}\r\n\r\n {props.item.city &&\r\n {props.item.city}\r\n }\r\n\r\n {props.item.supervisor.length > 0 &&\r\n \r\n {props.item.supervisor}\r\n \r\n }\r\n\r\n {props.item.email.length > 0 &&\r\n \r\n {props.item.email}\r\n \r\n }\r\n ;\r\n\r\n\r\ninterface IUserSearchProps {\r\n value: IUserSearchResult,\r\n onChange: (value: IUserSearchResult) => void,\r\n isExpanded: boolean,\r\n setIsExpanded: (expanded: boolean) => void,\r\n placeholderText: string\r\n}\r\n\r\nexport const UserPicker = (props: IUserSearchProps) => {\r\n const [usersByNameSummary, setUsersByNameSummary] = useState(\"\");\r\n const [users, setUsers] = useState([] as IUserSearchResult[]);\r\n const [searchText, setSearchText] = useState(\"\");\r\n\r\n const blankUser = { id: null, fullname: \"\" } as IUserSearchResult;\r\n const defaultUser = { ...blankUser, id: props.value?.id || null, fullname: props.value?.fullname || \"\" };\r\n const [selectedUsers, setSelectedUsers] = useState(defaultUser ? [defaultUser] : [] as IUserSearchResult[]);\r\n\r\n const selectUser = (user: IUserSearchResult) => {\r\n setSelectedUsers([user]);\r\n props.onChange(user);\r\n }\r\n\r\n const filterUsersAsync = async (searchTerm: string, users?: IUserSearchResult[]): Promise => {\r\n const lcName = searchTerm.toLowerCase();\r\n\r\n const result = await (users ?? []).filter(u => {\r\n return (u.fullname.toLowerCase().indexOf(lcName) > -1\r\n || (u.email && u.email.toLowerCase().indexOf(lcName) > -1));\r\n });\r\n\r\n const usersText = result.length === 1 ? \"user\" : \"users\";\r\n\r\n setUsersByNameSummary(`${ result.length } ${ usersText } found for search \"${ searchTerm }\".`);\r\n\r\n return result;\r\n };\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n var users = await getAllEmployees();\r\n\r\n if (mounted) {\r\n setUsers(users.results);\r\n }\r\n };\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n
\r\n \r\n summary={usersByNameSummary}\r\n dataSource={users}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n listItemType={UserListItem}\r\n filterText={searchText}\r\n setFilterText={setSearchText}\r\n expanded={props.isExpanded}\r\n setExpanded={props.setIsExpanded}\r\n buildKey={(item: IUserSearchResult) => { return item.id; }}\r\n filterAsync={filterUsersAsync}\r\n selected={selectedUsers}\r\n toggleSelected={selectUser}\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder={props.placeholderText}\r\n />\r\n {!props.isExpanded && selectedUsers.length === 1 && selectedUsers[0]?.id && users.length > 0 &&\r\n
{selectedUsers[0].fullname}
\r\n }\r\n
\r\n );\r\n};\r\n\r\ninterface IFormField {\r\n col: IDataCol,\r\n row: any,\r\n mode: FormMode,\r\n isValid: boolean,\r\n validationMessages?: string[],\r\n immediateValidationMessages?: string[],\r\n editLayout?: \"grid\" | \"form\",\r\n onChange: (newVal: any) => void,\r\n onBlur?: (newVal: any) => void,\r\n onPropertyChanged?: () => void\r\n}\r\n\r\nexport const LabelField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props));\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n {currentValue}
}\r\n editModeValue={
{currentValue}
}\r\n />\r\n );\r\n};\r\n\r\nexport const KeyValueListItem = (props: IListItemProps) => {\r\n return (\r\n
props.toggle(props.item)}>\r\n \r\n {props.item.value}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport interface IKeyValueListProps {\r\n placeholder?: string,\r\n values: IKeyValuePair[],\r\n selected: IKeyValuePair[],\r\n setSelected: (val: IKeyValuePair[]) => void\r\n}\r\n\r\nexport const KeyValueList = (props: IKeyValueListProps) => {\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n const [filterText, setFilterText] = useState(props.selected?.length > 0 ? props.selected[0].value : \"\");\r\n\r\n const filterAsync = async (key: string): Promise => {\r\n return await props.values.filter(kvp => kvp.value.indexOf(key) > -1);\r\n };\r\n\r\n const toggle = (val: IKeyValuePair) => {\r\n setFilterText(val.value);\r\n props.setSelected(((val !== null) ? [val] : []))\r\n };\r\n\r\n return (\r\n \r\n dataSource={props.values}\r\n listItemType={KeyValueListItem}\r\n expanded={isExpanded}\r\n filterText={filterText}\r\n setFilterText={setFilterText}\r\n setExpanded={setIsExpanded}\r\n buildKey={item => item.key}\r\n filterTextPlaceholder={props.placeholder}\r\n noResultsMessage=\"No matching items\"\r\n filterAsync={filterAsync}\r\n selected={props.selected !== null ? props.selected : []}\r\n toggleSelected={toggle}\r\n searchDisabled={true}\r\n />\r\n );\r\n};\r\n\r\nexport const ComboField = (props: IFormField) => {\r\n const onChange = (selected: IKeyValuePair[]) => {\r\n props.onChange(selected?.length > 0 ? selected[0].key : null);\r\n };\r\n\r\n return (\r\n {getLookupValue(props)}
}\r\n editModeValue={\r\n \r\n }\r\n />\r\n );\r\n};\r\n\r\nexport const DateField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props) as Date | null);\r\n\r\n const disabled = ((props.col.readonly ?? false) === true) || (props.mode === \"edit\" && ((props.col.readonlyForEdit ?? false) === true));\r\n\r\n const onChange = (newValue: Date) => {\r\n setCurrentValue(newValue);\r\n props.onChange(newValue);\r\n };\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n {currentValue ? new Date(currentValue).toLocaleDateString() : \"\"} {currentValue ? new Date(currentValue).toLocaleTimeString() : \"\"}
\r\n }\r\n editModeValue={\r\n \r\n }\r\n />\r\n );\r\n};\r\n\r\nconst defaultMaxInputLength = 50;\r\n\r\nexport const TextField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props));\r\n\r\n const disabled = ((props.col.readonly ?? false) === true) || (props.mode === \"edit\" && ((props.col.readonlyForEdit ?? false) === true));\r\n\r\n const onChange = (newValue: string) => {\r\n setCurrentValue(newValue);\r\n props.onChange(newValue);\r\n };\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n \r\n {currentValue}\r\n
\r\n }\r\n editModeValue={\r\n onChange(e.target.value)}\r\n onBlur={e => props.onBlur && props.onBlur(e.target.value)}\r\n value={currentValue ?? \"\"} />\r\n }\r\n />\r\n );\r\n};\r\n\r\nexport const UserField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props));\r\n\r\n const [expanded, setExpanded] = useState(false);\r\n\r\n const onChange = (newValue: IUserSearchResult) => {\r\n if (props.col.setValue) {\r\n setCurrentValue(newValue);\r\n props.onChange(newValue);\r\n }\r\n\r\n setExpanded(false);\r\n };\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n <>\r\n {currentValue ? currentValue.fullname : \"\"}
}\r\n editModeValue={\r\n }\r\n />\r\n \r\n );\r\n};\r\n\r\nexport const EmailField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props));\r\n\r\n const disabled = isReadonly(props.mode, props.col, props.row);\r\n\r\n const onChange = (newValue: string) => {\r\n setCurrentValue(newValue);\r\n props.onChange(newValue);\r\n };\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n {currentValue}
\r\n }\r\n editModeValue={\r\n onChange(e.target.value)}\r\n onBlur={e => props.onBlur && props.onBlur(e.target.value)}\r\n value={currentValue ?? \"\"}\r\n />\r\n }\r\n />\r\n );\r\n};\r\n\r\nexport const HyperlinkField = (props: IFormField) => {\r\n const [currentValue, setCurrentValue] = useState(getValue(props));\r\n\r\n const disabled = ((props.col.readonly ?? false) === true) || (props.mode === \"edit\" && ((props.col.readonlyForEdit ?? false) === true));\r\n\r\n const onChange = (newValue: string) => {\r\n setCurrentValue(newValue);\r\n props.onChange(newValue);\r\n };\r\n\r\n useEffect(() => {\r\n setCurrentValue(getValue(props));\r\n }, [props.row[props.col.name]]);\r\n\r\n return (\r\n \r\n \r\n {props.row[props.col.name]}\r\n \r\n
\r\n }\r\n editModeValue={\r\n onChange(e.target.value)}\r\n onBlur={e => props.onBlur && props.onBlur(e.target.value)}\r\n value={currentValue ?? \"\"} />\r\n }\r\n />\r\n );\r\n};\r\n\r\ninterface IDetailFormWrapperProps {\r\n module: IApplicationModule,\r\n viewName: string,\r\n load?: () => Promise,\r\n create?: () => T,\r\n save: (entity: T) => Promise,\r\n setConfirmationProps: (props: IConfirmProps | null) => void,\r\n closeDialog: () => void,\r\n onDataChanged?: (row: T, msg: string | undefined) => void\r\n}\r\n\r\nexport const DetailFormWrapper = (props: IDetailFormWrapperProps) => {\r\n const msgBox = (msg: ReactNode) => {\r\n props.setConfirmationProps({\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultOption: \"OK\",\r\n setResult: result => {\r\n props.setConfirmationProps(null);\r\n }\r\n });\r\n };\r\n\r\n const ask = (\r\n msg: string,\r\n opts: string[],\r\n def: string,\r\n defFn: () => void,\r\n otherFn?: (result: string) => void\r\n ) => {\r\n props.setConfirmationProps({\r\n message: msg,\r\n options: opts,\r\n defaultOption: def,\r\n setResult: result => {\r\n props.setConfirmationProps(null);\r\n\r\n if (result === def) {\r\n if (defFn) defFn();\r\n } else {\r\n if (otherFn) otherFn(result);\r\n }\r\n }\r\n });\r\n };\r\n\r\n\r\n return (\r\n \r\n module={props.module}\r\n load={props.load}\r\n create={props.create}\r\n cols={props.module.columns ?? []}\r\n save={props.save}\r\n setValid={() => { msgBox(\"Please enter all mandatory details in the form.\"); }}\r\n msgBox={msgBox}\r\n onDataChanged={props.onDataChanged}\r\n viewName={props.viewName ?? \"view\"}\r\n close={isDirty => {\r\n if (!isDirty) {\r\n props.closeDialog();\r\n return;\r\n }\r\n\r\n ask(\r\n \"Are you sure you want to exit? All your data will be lost.\",\r\n [\"Exit\", \"Cancel\"],\r\n \"Exit\",\r\n () => {\r\n props.closeDialog();\r\n });\r\n }}\r\n />\r\n );\r\n};\r\n\r\ninterface IDetailsFormProps {\r\n cols: IDataCol[],\r\n setValid: (isValid: boolean) => void,\r\n msgBox: (msg: ReactNode) => void,\r\n\r\n load?: () => Promise,\r\n create?: () => T,\r\n save?: (data: T) => Promise,\r\n close: (dirty?: boolean) => void,\r\n onDataChanged?: (row: T, msg: string | undefined) => void,\r\n viewName?: string,\r\n heading?: ReactNode,\r\n initialView?: FormMode,\r\n module?: IApplicationModule\r\n}\r\n\r\nexport const DetailsForm = (props: IDetailsFormProps) => {\r\n const currentUser = useProfile();\r\n const [data, setData] = useState(null as T | null);\r\n\r\n const [initialState, setInitialState] = useState(\"\");\r\n const [dirtyState, setDirtyState] = useState(false);\r\n const [savingState, setSavingState] = useState(\"ready\");\r\n const [ver, setVer] = useState(1);\r\n\r\n const [validationErrors, setValidationErrors] = useState([] as iInvalidColumn[]);\r\n const [immediateValidationErrors, setImmediateValidationErrors] = useState([] as iInvalidColumn[]);\r\n\r\n const findView = (name: string) => {\r\n return props.module?.views?.find(v => v.name === name ?? \"view\");\r\n };\r\n\r\n const [appView, setAppView] = useState(findView(props.viewName ?? \"view\") ?? null);\r\n const [mode, setMode] = useState(appView?.mode ?? \"view\" as FormMode);\r\n\r\n useEffect(() => {\r\n const load = async () => {\r\n if (props.load) {\r\n var result = await props.load();\r\n\r\n if (result) {\r\n setInitialState(JSON.stringify(result));\r\n setData(result);\r\n }\r\n }\r\n }\r\n switch (mode) {\r\n case \"quickEdit\":\r\n case \"view\":\r\n load();\r\n break;\r\n case \"new\":\r\n if (props.create) {\r\n const newRow = props.create();\r\n setInitialState(JSON.stringify(newRow));\r\n setData(newRow);\r\n }\r\n break;\r\n }\r\n }, []);\r\n\r\n const isDirty = () => {\r\n return (JSON.stringify(data) !== initialState);\r\n };\r\n\r\n const switchView = (viewName: string) => {\r\n var nextView = findView(viewName) ?? null;\r\n\r\n if (nextView) {\r\n setAppView(nextView);\r\n setMode(nextView.mode);\r\n } else {\r\n console.warn(\"cannot find view \" + viewName);\r\n }\r\n\r\n setDirtyState(isDirty);\r\n setSavingState(\"ready\");\r\n };\r\n\r\n interface iInvalidColumn {\r\n column: IDataCol,\r\n validationMessages?: string[]\r\n }\r\n\r\n\r\n const validateColumn = (col: IDataCol) => {\r\n const value = (data as any)[col.name] || '';\r\n const valueIsBlank = value === null || value === undefined || value == '';\r\n const rules = col.validation;\r\n\r\n var readonly = isReadonly(appView?.mode ?? \"edit\", col, data);\r\n\r\n if (readonly || !rules) {\r\n return null;\r\n }\r\n\r\n let validationMessages = [] as string[];\r\n\r\n let minLength = rules.minLength ?? 1;\r\n if (rules.required && valueIsBlank) {\r\n validationMessages.push('Required');\r\n }\r\n else if (value?.length < minLength) {\r\n validationMessages.push(`Required minimum length of ${ minLength }`);\r\n }\r\n\r\n let maxLength = rules.maxLength ?? defaultMaxInputLength;\r\n if (value?.length > maxLength) {\r\n validationMessages.push(`Must not exceed ${ maxLength } characters`);\r\n }\r\n\r\n if (rules.startsWith && rules.startsWith.length > 0 && (valueIsBlank || rules.startsWith.filter(ew => value.startsWith(ew)).length === 0)) {\r\n const startsWithString = rules.startsWith.reduce((prev, message) => `${ prev }${ prev ? ' or' : '' } ${ message }`);\r\n validationMessages.push(`Must start with ${ startsWithString }`);\r\n }\r\n\r\n if (rules.endsWith && rules.endsWith.length > 0 && (valueIsBlank || rules.endsWith.filter(ew => value.endsWith(ew)).length === 0)) {\r\n const endsWithString = rules.endsWith.reduce((prev, message) => `${ prev ? ' or' : '' } ${ message }`);\r\n validationMessages.push(`Must end with ${ endsWithString }`);\r\n }\r\n\r\n if (rules.segments && (valueIsBlank || value.split(rules.segments.splitter).length < rules.segments.min)) {\r\n validationMessages.push(rules.tip);\r\n }\r\n\r\n if (validationMessages.length > 0) {\r\n return {\r\n column: col,\r\n validationMessages: validationMessages\r\n } as iInvalidColumn;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n const validate = () => {\r\n const invalidCols = [] as iInvalidColumn[];\r\n\r\n if (!data) return false;\r\n\r\n props.cols.filter(col => !!col.formComponent && col.validation).forEach(\r\n col => {\r\n const invalidColResult = validateColumn(col);\r\n if (invalidColResult) {\r\n invalidCols.push(invalidColResult);\r\n }\r\n }\r\n );\r\n\r\n setValidationErrors(invalidCols);\r\n\r\n let isValid = invalidCols.length == 0 && immediateValidationErrors.length == 0;\r\n return isValid;\r\n };\r\n\r\n const validateImmediate = (col: IDataCol, value: string) => {\r\n if (col.validation?.immediateValidationFn) {\r\n col.validation?.immediateValidationFn(value).then((result) => validateImmediateResult(col, value, result));\r\n }\r\n }\r\n\r\n const validateImmediateResult = (col: IDataCol, value: string, valid: boolean) => {\r\n if (valid) {\r\n clearColImmediateResultError(col);\r\n }\r\n else {\r\n let msg = 'Validation issue';\r\n if (col.validation?.immediateValidationMsgFn) {\r\n msg = col.validation.immediateValidationMsgFn(value);\r\n }\r\n const filteredErrors = immediateValidationErrors.filter(e => e.column != col) || null;\r\n filteredErrors.push({ column: col, validationMessages: [msg] });\r\n setImmediateValidationErrors(filteredErrors);\r\n }\r\n }\r\n\r\n const clearColImmediateResultError = (col: IDataCol) => {\r\n const filteredErrors = immediateValidationErrors.filter(e => e.column != col) || null;\r\n setImmediateValidationErrors(filteredErrors);\r\n }\r\n\r\n const save = async (msg: string | undefined) => {\r\n if (props.save && savingState !== \"working\") {\r\n if (validate()) {\r\n setSavingState(\"working\");\r\n\r\n var result = undefined as T | undefined;\r\n\r\n try {\r\n result = await props.save(data as T);\r\n }\r\n catch {\r\n props.msgBox(\"There was a problem saving.\");\r\n }\r\n\r\n if (result) {\r\n setSavingState(\"saved\");\r\n setInitialState(JSON.stringify(data));\r\n\r\n if (props.onDataChanged) {\r\n props.onDataChanged(data as T, msg);\r\n }\r\n return;\r\n }\r\n\r\n setSavingState(\"failed\");\r\n } else {\r\n props.setValid(false);\r\n }\r\n }\r\n };\r\n\r\n const take = (action: IApplicationModuleViewAction) => {\r\n if (action.switchToView) {\r\n if (action.validate === true) {\r\n if (!validate()) {\r\n return props.setValid(false);\r\n }\r\n }\r\n\r\n return switchView(action.switchToView as FormMode);\r\n }\r\n\r\n if (action.setResult) {\r\n switch (action.setResult) {\r\n case \"save\":\r\n return save(action.msg);\r\n case \"close\":\r\n return props.close(isDirty());\r\n }\r\n }\r\n };\r\n\r\n const HeadingIcon = appView?.subSubIcon;\r\n const Icon = appView?.icon;\r\n\r\n return (\r\n <>\r\n {appView?.heading &&\r\n <>\r\n
{appView.heading}
\r\n\r\n
props.close(isDirty())}>\r\n \r\n
\r\n \r\n }\r\n\r\n {appView?.subHeading &&
\r\n

\r\n
{appView.subHeading}
\r\n
{appView.progress}
\r\n

\r\n
}\r\n\r\n {Icon &&\r\n
\r\n {Icon &&\r\n \r\n }\r\n
\r\n }\r\n\r\n
\r\n
\r\n {props.heading}\r\n\r\n {appView?.subSubHeading && data &&\r\n
\r\n {HeadingIcon && }\r\n {appView.subSubHeading(data)}\r\n
\r\n }\r\n\r\n {data &&\r\n
\r\n
\r\n {props.cols.filter(col => !!col.formComponent).map(col => {\r\n const FieldType = col.formComponent as (props: IFormField) => JSX.Element;\r\n\r\n const columnErrors = validationErrors.find(e => e.column == col) || null;\r\n const validationMessages = columnErrors?.validationMessages || [];\r\n\r\n const immediateColumnErrors = immediateValidationErrors.find(e => e.column == col) || null;\r\n const immediateValidationMessages = immediateColumnErrors?.validationMessages || [];\r\n\r\n return ( {\r\n if (col.setValue) {\r\n col.setValue(data, value);\r\n }\r\n\r\n if (columnErrors != null) {\r\n validate();\r\n }\r\n\r\n if (immediateColumnErrors != null) {\r\n clearColImmediateResultError(col);\r\n }\r\n\r\n setVer(ver + 1);\r\n }}\r\n onBlur={(value) => { validateImmediate(col, value || '') }}\r\n />)\r\n })}\r\n
\r\n
\r\n }\r\n\r\n \r\n \r\n \r\n {appView?.actions &&\r\n appView.actions.filter(\r\n action => action.permission === null || userHasPermission(action.permission, currentUser?.roles ?? [])\r\n ).map(action =>\r\n \r\n )}\r\n \r\n \r\n
\r\n take(action)}>{action.label}\r\n
\r\n
\r\n
\r\n \r\n );\r\n};","import React, { useEffect, useState } from 'react';\r\nimport { PageList } from './PageList';\r\nimport { Toggle } from './ToggleContent';\r\nimport { ArrowDownwardOutlined, ArrowUpwardOutlined, CheckBoxOutlineBlank, SwapVertOutlined } from '@material-ui/icons';\r\nimport { ReactComponent as CheckBoxOutlined } from \"assets/icons/check-box-outlined.svg\";\r\nimport { ReactNode } from 'react';\r\nimport { Checkbox } from './LabelledCheckbox';\r\n\r\ninterface IDataColValidationSegments {\r\n splitter: string,\r\n min: number\r\n}\r\n\r\nexport interface IKeyValuePair {\r\n key: any,\r\n value: any\r\n}\r\n\r\nexport interface IDataColValidation {\r\n required: boolean,\r\n minLength: number,\r\n maxLength?: number,\r\n segments: IDataColValidationSegments,\r\n contains: string[],\r\n startsWith: string[],\r\n endsWith: string[],\r\n tip: string,\r\n values?: IKeyValuePair[],\r\n immediateValidationFn?: (value: string) => Promise,\r\n immediateValidationMsgFn?: (value: string) => string\r\n}\r\n\r\nexport interface IDataCol {\r\n // required\r\n name: string,\r\n heading: string,\r\n className: string,\r\n\r\n // optional\r\n clickAction?: string,\r\n gridHeading?: string,\r\n formatRow?: (row: any) => any,\r\n format?: (val: any) => any,\r\n sort?: (a: any, b: any, order: number) => number,\r\n filterable?: boolean,\r\n showInGrid?: number,\r\n formComponent?: any,\r\n placeholderText?: string,\r\n tip?: string,\r\n validation?: IDataColValidation\r\n readonly?: boolean,\r\n readonlyIf?: (row: any) => boolean,\r\n readonlyForEdit?: boolean,\r\n setValue?: (row: any, value: any) => void\r\n}\r\n\r\nexport interface IDataGridProps {\r\n rows: any[],\r\n selectedItems?: any[],\r\n setSelectedItems?: (items: any[]) => void,\r\n columns: IDataCol[],\r\n onClick?: (row: any) => void,\r\n onDoubleClick?: (row: any) => void,\r\n selectMode?: \"one\" | \"none\" | \"many\",\r\n pageSize: number,\r\n sortCol?: IDataCol,\r\n nullValue?: ReactNode,\r\n perform?: (actionName: string, row: any) => void\r\n}\r\n\r\ninterface IFilterValue {\r\n column: IDataCol,\r\n value: any\r\n}\r\n\r\nexport const DataGrid = (props: IDataGridProps) => {\r\n const [filterValues, setFilterValues] = useState([] as IFilterValue[]);\r\n const [filteredRows, setFilteredRows] = useState(props.rows || []);\r\n const [pageNumber, setPageNumber] = useState(1);\r\n const [sortCol, setSortCol] = useState(props.sortCol ?? (props.columns && props.columns.length > 0 ? props.columns[0] : null));\r\n const [sortDirection, setSortDirection] = useState(1);\r\n\r\n useEffect(() => {\r\n toggleFilterFn();\r\n }, [props.rows]);\r\n\r\n const areAllSelected = () => {\r\n const selectedCount = (props.selectedItems ?? []).filter(sel => filteredRows.includes(sel)).length;\r\n\r\n switch (selectedCount) {\r\n case filteredRows.length:\r\n return true;\r\n case 0:\r\n return false;\r\n }\r\n\r\n return 'partial';\r\n };\r\n\r\n const selectAll = () => {\r\n if (props.setSelectedItems && props.selectMode === \"many\") {\r\n if (areAllSelected() === true) {\r\n props.setSelectedItems(\r\n // selected, less the showing\r\n (props.selectedItems ?? []).filter(sel => !filteredRows.includes(sel))\r\n );\r\n } else {\r\n props.setSelectedItems(\r\n // selected, but not showing... plus the showing\r\n (props.selectedItems ?? []).filter(sel => !filteredRows.includes(sel)).concat(filteredRows)\r\n );\r\n }\r\n }\r\n };\r\n\r\n const onClick = (row: any) => {\r\n if (!props) {\r\n return;\r\n }\r\n\r\n if (props.onClick) {\r\n props.onClick(row);\r\n return;\r\n }\r\n\r\n if (!props.setSelectedItems) {\r\n return;\r\n }\r\n\r\n switch (props.selectMode) {\r\n case \"one\":\r\n if (props.selectedItems?.includes(row)) {\r\n return props.setSelectedItems([]);\r\n }\r\n else {\r\n return props.setSelectedItems([row]);\r\n }\r\n \r\n case \"many\":\r\n if (props.selectedItems?.includes(row)) {\r\n return props.setSelectedItems(props.selectedItems.filter(r => r !== row));\r\n }\r\n else {\r\n return props.setSelectedItems((props.selectedItems ?? []).concat([row]));\r\n }\r\n }\r\n };\r\n\r\n const updateSort = (col: IDataCol) => {\r\n if (sortCol === col) {\r\n setSortDirection(sortDirection * -1);\r\n } else {\r\n setSortCol(col);\r\n setSortDirection(1);\r\n }\r\n };\r\n\r\n const colHeaderVal = (rawValue: any, col: IDataCol, blankValue?: any) => {\r\n if (rawValue === null) return blankValue;\r\n\r\n if (col.format) {\r\n return col.format(rawValue);\r\n }\r\n\r\n if (col.validation?.values) {\r\n return col.validation.values.find(v => v.key === rawValue)?.value ?? rawValue;\r\n }\r\n\r\n return rawValue;\r\n };\r\n\r\n const toggleFilterFn = async (col?: IDataCol, val?: string) => {\r\n var arr = col ? filterValues.filter(f => !(f.column.name === col.name && f.value === val)) : filterValues;\r\n\r\n if (col && val && arr.length == filterValues.length) {\r\n arr.push({ column: col, value: val });\r\n }\r\n\r\n setFilterValues(arr);\r\n\r\n var distinctColumnsFiltered = arr.map(f => f.column.name).filter((v, i, s) => { return s.indexOf(v) === i; }).length;\r\n\r\n setFilteredRows(props.rows.filter(\r\n row => arr.filter(\r\n fv => fv.value === colHeaderVal(row[fv.column.name], fv.column, \"(Blanks)\")\r\n ).length === distinctColumnsFiltered)\r\n );\r\n };\r\n\r\n const distinct = (rows: any[], col: IDataCol) => {\r\n return rows\r\n // first convert it to a string\r\n .map(row => colHeaderVal(row[col.name], col, \"(Blanks)\"))\r\n // then find the distinct list of strings\r\n .filter((rowVal, idx, acumulator) => { return acumulator.indexOf(rowVal) === idx; })\r\n .sort();\r\n };\r\n\r\n const colVal = (row: any, col: IDataCol) => {\r\n var rawValue = row[col.name];\r\n\r\n return colHeaderVal(rawValue, col);\r\n };\r\n\r\n const perform = (e: React.MouseEvent, actionName: string, row: any) => {\r\n if (props.perform) {\r\n e.stopPropagation();\r\n props.perform(actionName, row);\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n \r\n \r\n \r\n\r\n {props.selectMode === \"many\" &&\r\n \r\n }\r\n\r\n {props.columns.map((col, idx) => {\r\n if (col.filterable && props.rows?.length > 0) {\r\n const vals = distinct(props.rows, col);\r\n\r\n if (vals.length > 1) {\r\n return (\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n } else {\r\n if (col.sort) {\r\n return (\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 \r\n\r\n {filteredRows.sort((a, b) => (sortCol && sortCol.sort) ? sortCol.sort(a, b, sortDirection) : sortDirection)\r\n .filter((r, i) => { return props.pageSize < 1 || (i >= props.pageSize * (pageNumber - 1) && i < props.pageSize * pageNumber) })\r\n .map((row, rowIndex) =>\r\n { if (props.onDoubleClick) props.onDoubleClick(row) }}\r\n onClick={() => onClick(row)}>\r\n\r\n {props.selectMode !== \"none\" &&\r\n }\r\n\r\n {props.columns.map(col => {\r\n if (!props.nullValue || row[col.name] !== null) {\r\n return (\r\n ((props.perform && col.clickAction) ? perform(e, col.clickAction, row) : null)}\r\n key={col.name} >\r\n {colVal(row, col)}\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
\r\n \r\n fv.column.name === col.name) ? \" filtered\" : \"\")} key={col.name}>\r\n \r\n {vals.map(\r\n val => {\r\n return (\r\n
toggleFilterFn(col, val)}>\r\n {filterValues.findIndex(fv => fv.column.name === col.name && fv.value === val) === -1 ? : }\r\n {val}\r\n
\r\n );\r\n }\r\n )}\r\n
\r\n
\r\n {col.gridHeading ?? col.heading}\r\n updateSort(col)} className={\"dg-col \" + col.className} key={col.name}>\r\n {col.gridHeading ?? col.heading} {(sortCol !== col ? : (sortDirection === 1 ? : ))}\r\n \r\n {col.gridHeading ?? col.heading}\r\n
\r\n {props.selectedItems?.indexOf(row) === -1\r\n ? \r\n : \r\n }\r\n {props.nullValue}
\r\n
\r\n\r\n {\r\n props.pageSize > 0 && filteredRows.length > props.pageSize &&\r\n
\r\n \r\n
\r\n }\r\n \r\n );\r\n};","// These are currently manually generated but need to look into automatic generation with autorest/ swagger\r\nimport { DocumentReviewPeriodEnum } from \"shared/enums/document-review-period-enum\"\r\nimport { DocumentNotifyTypeEnum } from \"shared/enums/document-notify-type-enum\"\r\nimport { DocumentStatusEnum } from \"shared/enums/document-status-enum\"\r\nimport { DocumentModuleEnum } from \"shared/enums/document-module-enum\"\r\n\r\nexport interface PagedResult {\r\n totalResults: number,\r\n results: T[]\r\n}\r\n\r\nexport interface IUserSearchResult {\r\n id: number | null,\r\n fullname: string,\r\n email: string,\r\n city: string,\r\n officeLocation: string,\r\n supervisor: string\r\n}\r\n\r\nexport interface ISortDescriptor {\r\n field: string,\r\n dir: string\r\n}\r\n\r\nexport interface IFilterDescriptor {\r\n field: string,\r\n operator: string,\r\n value: any,\r\n logic: string\r\n filters: IFilterDescriptor[]\r\n}\r\n\r\nexport interface IPageRequest {\r\n pageSize: number,\r\n pageNumber: number,\r\n sort: ISortDescriptor[],\r\n filter: IFilterDescriptor\r\n}\r\n\r\nexport interface AdminUserListRequest {\r\n\r\n}\r\n\r\nexport enum EmployeeTypeEnum {\r\n Unknown = 0,\r\n System = 1,\r\n Employee = 2,\r\n Contractor = 3\r\n}\r\n\r\nexport enum UserStatusEnum {\r\n Active = 0,\r\n Inacitve = 1\r\n}\r\n\r\nexport interface AdminUserSetStatusRequest {\r\n status: UserStatusEnum,\r\n userIds: number[]\r\n}\r\n\r\nexport interface IRole {\r\n id: number,\r\n name: string,\r\n permissions: string[],\r\n isBackOfHouseRole: boolean\r\n}\r\n\r\nexport interface AdminUserModel {\r\n id: number,\r\n firstname: string,\r\n lastname: string,\r\n fullname: string,\r\n username: string,\r\n email: string,\r\n mobile: string,\r\n lastLoginDate?: Date,\r\n password: string,\r\n employeeType: number,\r\n companyName: string,\r\n jobTitle: string,\r\n roleName: string,\r\n supervisor?: IUserSearchResult,\r\n panel: string,\r\n city: string,\r\n officeLocation: string,\r\n department: string,\r\n division: string,\r\n status: UserStatusEnum,\r\n domainDisabled: boolean\r\n}\r\n\r\nexport enum FatigueAssessmentRiskEnum {\r\n NA,\r\n Low,\r\n Medium,\r\n High\r\n}\r\n\r\nexport enum FatigueAssessmentTaskEnum {\r\n NoAction,\r\n ToAction,\r\n ToRevisit\r\n}\r\n\r\nexport enum FatigueAssessmentStatusEnum {\r\n Pending,\r\n Violation,\r\n Complete\r\n}\r\n\r\nexport interface FatigueAssessmentForm {\r\n id: number,\r\n user?: FatigueAssessmentUser,\r\n status?: string,\r\n shiftStartTime?: Date,\r\n partialShiftStartDate?: string | undefined,\r\n partialShiftStartTime?: string | undefined,\r\n dateOfIssue?: Date,\r\n supervisorId?: number,\r\n supervisor?: FatigueAssessmentUser,\r\n issuedBy?: FatigueAssessmentUser,\r\n onBehalfSubmitter?: FatigueAssessmentUser,\r\n onBehalfReason?: string,\r\n assessmentDate?: Date,\r\n hoursSleep24Hrs?: number,\r\n hoursSleep48Hrs?: number,\r\n currentHoursAwake?: number,\r\n feelAlert?: number,\r\n alcoholicDrinks?: number,\r\n gender?: number,\r\n unfitSubstanceCheck?: number,\r\n concentrationCheck?: number,\r\n signOnLocationId?: number,\r\n signOnLocation?: Location,\r\n assessmentScore?: number,\r\n risk?: FatigueAssessmentRiskEnum,\r\n task?: FatigueAssessmentTaskEnum,\r\n privacyPolicy?: boolean,\r\n}\r\n\r\nexport interface FatigueAssessmentNote {\r\n id: number,\r\n fatigueAssessmentId: number,\r\n userId: number,\r\n userName: string,\r\n comment: string,\r\n noteDate: Date\r\n}\r\n\r\nexport interface FatigueAssessmentAudit {\r\n id: number,\r\n fatigueAssessmentId: number,\r\n date: Date,\r\n description: string,\r\n}\r\n\r\nexport interface FatigueAssessmentUser {\r\n id: number,\r\n firstname: string,\r\n lastname: string,\r\n fullname: string\r\n}\r\n\r\nexport interface FatigueAssessment {\r\n id: number\r\n dateOfIssue: Date\r\n}\r\n\r\nexport interface FatigueAssessmentActionModel {\r\n fatigueAssessmentId: number;\r\n controlsImplementedBy: FatigueAssessmentUser;\r\n noFurtherAction: boolean;\r\n actionTaken: boolean;\r\n actionTakenRevisit: boolean;\r\n actionTakenBuddyUp: boolean;\r\n actionTakenRemoveFromSafetyCritical: boolean;\r\n actionTakenRemainLocal: boolean;\r\n actionTakenAltDuties: boolean;\r\n sentHome: boolean;\r\n comment: string;\r\n confidential: boolean;\r\n supervisorSignature: string;\r\n alternativeSupervisorReason: string;\r\n affectedSupervisors: FatigueAssessmentUser[];\r\n noActionTakenPlannedLeave: boolean;\r\n noActionTakenUnplannedLeave: boolean;\r\n}\r\n\r\nexport interface FatigueAssessmentDetailsModel extends FatigueAssessmentForm {\r\n notes: FatigueAssessmentNote[];\r\n action?: FatigueAssessmentActionModel;\r\n audit: FatigueAssessmentAudit[];\r\n}\r\n\r\nexport interface FatigueAssessmentReportQuery {\r\n userIds: number[];\r\n supervisorIds: number[];\r\n locationIds: number[];\r\n statusIds: FatigueAssessmentStatusEnum[];\r\n riskIds: FatigueAssessmentRiskEnum[];\r\n shiftDateFrom: Date;\r\n shiftDateTo: Date;\r\n includeAudit: boolean;\r\n}\r\n\r\nexport interface LoginHistoryReportQuery {\r\n userIds: number[];\r\n}\r\n\r\nexport interface LoginHistory {\r\n loginHistoryResultId: number;\r\n fullname: string;\r\n email: string;\r\n source: string;\r\n date: string;\r\n}\r\n\r\nexport interface DashboardQueryModel {\r\n overview: boolean,\r\n pending: boolean,\r\n supervisorIds?: number[],\r\n date?: Date,\r\n locationIds?: number[],\r\n task?: FatigueAssessmentTaskEnum\r\n}\r\n\r\nexport interface SubmitActionModel {\r\n fatigueAssessmentId?: number;\r\n controlsImplementedById?: number;\r\n noFurtherAction?: boolean;\r\n noActionTakenPlannedLeave?: boolean,\r\n noActionTakenUnplannedLeave?: boolean,\r\n actionTaken?: boolean;\r\n actionTakenRevisit?: boolean;\r\n actionTakenBuddyUp?: boolean;\r\n actionTakenRemoveFromSafetyCritical?: boolean;\r\n actionTakenRemainLocal?: boolean;\r\n actionTakenAltDuties?: boolean;\r\n sentHome?: boolean;\r\n comment?: string;\r\n confidential?: boolean;\r\n supervisorSignature?: string;\r\n alternativeSupervisorReason?: string;\r\n affectedSupervisors: number[];\r\n}\r\n\r\nexport interface SubmitAssessmentModel {\r\n id?: number,\r\n hoursSleep24Hrs: number,\r\n hoursSleep48Hrs: number,\r\n currentHoursAwake: number,\r\n feelAlert: number,\r\n alcoholicDrinks: number,\r\n gender: number,\r\n unfitSubstanceCheck: number,\r\n concentrationCheck: number,\r\n supervisorId: number,\r\n signOnLocationId: number,\r\n shiftStartTime: Date,\r\n privacyPolicy: boolean\r\n}\r\n\r\nexport interface SubmitOnBehalfModel extends SubmitAssessmentModel {\r\n userId: number;\r\n onBehalfReason: string;\r\n action: SubmitActionModel;\r\n}\r\n\r\nexport interface FatigueAssessmentAddNoteModel {\r\n fatigueAssessmentId: number,\r\n comment: string\r\n}\r\n\r\nexport interface FatigueAssessmentAssign {\r\n userIds: number[],\r\n shiftStartTime: Date\r\n}\r\n\r\nexport interface FatigueAssessmentAssignResult {\r\n time: Date;\r\n added: number;\r\n existing: number;\r\n failed: number;\r\n}\r\n\r\nexport interface Metadata {\r\n id: number;\r\n documentId: number;\r\n createdDate: Date;\r\n documentNumber: string;\r\n version: string;\r\n title: string;\r\n publishDate: Date;\r\n effectiveFromDate: Date;\r\n expiryDate?: any;\r\n reviewPeriod: DocumentReviewPeriodEnum,\r\n reviewRecurring: boolean,\r\n notifyUsers: boolean;\r\n releaseNotes: string;\r\n rescindDocumentReason: string;\r\n requiresAcknowledgement: boolean;\r\n active: boolean;\r\n rescindedById?: any;\r\n rescindedBy?: any;\r\n rescindedDate?: any;\r\n deletedById?: any;\r\n deletedBy?: any;\r\n deletedDate?: any;\r\n modifiedById: number;\r\n modifiedBy?: any;\r\n modifiedDate: Date;\r\n}\r\n\r\ninterface RelatedDocument {\r\n id: number,\r\n title: string\r\n}\r\n\r\n\r\nexport interface RailDocument {\r\n id: number;\r\n fileName: string;\r\n uploadedById: number;\r\n uploadedByName: string;\r\n uploadedDate: Date;\r\n moduleId: DocumentModuleEnum;\r\n module: string;\r\n typeId: number;\r\n type: string;\r\n subTypeId: number;\r\n subType: string;\r\n status: DocumentStatusEnum;\r\n statusDescription: string;\r\n createdDate: Date;\r\n documentNumber: string;\r\n version: string;\r\n title: string;\r\n publishDate: Date;\r\n effectiveFromDate: Date;\r\n expiryDate?: any;\r\n reviewPeriod: DocumentReviewPeriodEnum,\r\n reviewRecurring: boolean,\r\n releaseNotes: string;\r\n rescindDocumentReason: string;\r\n active: boolean;\r\n rescindedById?: any;\r\n rescindedByName?: any;\r\n rescindedDate?: any;\r\n deletedById?: any;\r\n deletedByName?: any;\r\n deletedDate?: any;\r\n modifiedById: number;\r\n modifiedByName: string;\r\n modifiedDate: Date;\r\n requiresAcknowledgementAndNotify: boolean;\r\n relatesTo?: Array<{ key: number, value: string }>;\r\n canEdit?: boolean;\r\n acknowledgeRequired?: boolean;\r\n pendingActions?: RailDocumentPendingActions,\r\n isFavourite?: boolean\r\n}\r\n\r\nexport interface DocumentType {\r\n id: number;\r\n parentTypeId?: number | null;\r\n name: string;\r\n documentModuleId: number;\r\n documentTitleDefault: string;\r\n documentTitleValidation: string;\r\n documentNumberDefault: string;\r\n documentNumberValidation: string;\r\n}\r\n\r\n\r\nexport interface NewDocument {\r\n documentModule?: number,\r\n documentType?: number,\r\n title?: string,\r\n documentNumber?: string,\r\n versionNumber?: string,\r\n effectiveFrom: string,\r\n expiryDate?: string,\r\n reviewPeriod: DocumentReviewPeriodEnum,\r\n reviewRecurring: boolean,\r\n requiresAcknowledgementAndNotify?: boolean,\r\n releaseNotes?: string,\r\n rescindDocumentReason?: string,\r\n file?: File,\r\n relatesTo: Array\r\n}\r\n\r\nexport interface UserInfo {\r\n role?: string[]\r\n}\r\n\r\nexport interface DocumentHistory {\r\n id: number,\r\n version?: string,\r\n actionId: number,\r\n action: string,\r\n rescindedByDocumentNumber?: string,\r\n rescindedByDocumentId?: number,\r\n rescindsDocumentNumber?: string,\r\n rescindsDocumentId?: number,\r\n releaseNotes?: string,\r\n userId?: string,\r\n userName?: string,\r\n changeDate: Date,\r\n statusId: number,\r\n status: string\r\n}\r\n\r\nexport interface Notifications {\r\n fatigueAssessments: [FatigueAssessment],\r\n documentNotifications: [DocumentNotification],\r\n}\r\n\r\nexport interface DocumentNotification {\r\n id: number,\r\n userId: number,\r\n userName: string,\r\n documentId: number,\r\n documentTitle: string,\r\n documentNumber: string,\r\n documentType: number,\r\n documentPublishDate: Date,\r\n notifyDate: Date,\r\n notifyType: DocumentNotifyTypeEnum,\r\n acknowledgedDate?: Date,\r\n}\r\n\r\nexport interface RailDocumentPendingActions {\r\n documentId: number,\r\n acknowledge: boolean\r\n clarify: boolean\r\n feedback: boolean,\r\n view: boolean,\r\n latestAction?: string,\r\n latestActionDate?: Date,\r\n acknowledgedDate?: Date\r\n}\r\n\r\nexport interface DocumentComment {\r\n text: string\r\n}\r\n\r\nexport interface DocumentSearchQuery {\r\n searchTerm: string,\r\n statusIds?: number[],\r\n moduleIds?: number[],\r\n typeIds?: number[],\r\n dateRange?: DateRange,\r\n fullMatchContentRequired?: boolean\r\n}\r\n\r\nexport interface DateRange {\r\n startDate: Date,\r\n endDate: Date\r\n}\r\n\r\nexport interface DocumentSearchResult {\r\n documentId: number,\r\n moduleId: number,\r\n typeId: number,\r\n documentTitle: string,\r\n documentNumber: string,\r\n publishedDate: Date,\r\n version: string,\r\n status: DocumentStatusEnum,\r\n pageNumber: number,\r\n matchText: string,\r\n matchContent?: DocumentContent[],\r\n totalResults: number,\r\n requiresAcknowledgement: boolean,\r\n favourite: boolean\r\n}\r\n\r\nexport interface DocumentSearchReplaceSuggestion {\r\n id: number;\r\n expression: string;\r\n suggestion: string;\r\n}\r\n\r\nexport interface DocumentContent {\r\n id: number,\r\n documentId: number,\r\n content?: string,\r\n pageNumber: number\r\n}\r\n\r\nexport interface Location {\r\n id: number,\r\n name: string\r\n}\r\n\r\nexport interface LocationDetail extends Location {\r\n siteMobileNumber: string\r\n}\r\n\r\nexport interface AbmCodeUsage {\r\n available: number;\r\n used: number;\r\n}\r\n\r\nexport interface AddCodeResult {\r\n added: number;\r\n duplicate: number;\r\n invalid: number;\r\n error?: string;\r\n}\r\n","import React from 'react';\r\nimport { userHasPermission } from 'hooks/useRoles';\r\nimport { IRole } from 'shared/models/api/models';\r\n\r\nexport interface IActionProps {\r\n name: string,\r\n icon: any,\r\n permission: string,\r\n minSelectedCount?: number,\r\n maxSelectedCount?: number,\r\n openView?: string\r\n}\r\n\r\ninterface IToolbarButtonProps {\r\n action: IActionProps,\r\n onClick: (action: IActionProps) => void,\r\n selectedCount?: number\r\n}\r\n\r\nexport const ToolbarButton = (props: IToolbarButtonProps) => {\r\n const Icon = props.action.icon;\r\n\r\n const isEnabled = () => {\r\n if (props.selectedCount != undefined) {\r\n\r\n if (props.action.minSelectedCount) {\r\n if (props.selectedCount < props.action.minSelectedCount) {\r\n return false;\r\n }\r\n }\r\n\r\n if (props.action.maxSelectedCount) {\r\n if (props.selectedCount > props.action.maxSelectedCount) {\r\n return false;\r\n }\r\n }\r\n\r\n }\r\n\r\n return true;\r\n };\r\n\r\n return (\r\n
props.onClick(props.action)}>\r\n
\r\n
{props.action.name}
\r\n
\r\n );\r\n}\r\n\r\ninterface IToolbarProps {\r\n actions: IActionProps[],\r\n userRoles?: IRole[],\r\n onClick: (action: IActionProps) => void,\r\n selectedCount?: number\r\n}\r\n\r\nexport const Toolbar = (props: IToolbarProps) => {\r\n const userActions = props.actions.filter(action => userHasPermission(action.permission, props.userRoles));\r\n\r\n return (\r\n
\r\n {userActions.map(action =>\r\n \r\n )}\r\n
);\r\n};","import React, { useEffect, useState } from 'react';\r\nimport { Tabs, Tab, Chip } from '@material-ui/core';\r\nimport PortalPage from '../../../components/portal/PortalPage'\r\nimport './administration.css';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { useProfile } from 'hooks/useRoles';\r\nimport { MakeActiveButtonText, MakeInactiveButtonText, RefreshButtonText, UserManagementModule, ViewOrEditButtonText, EmployeeTypeEmployeeLabel, EmployeeTypeContractorLabel } from './user-management-data';\r\nimport { IConfirmProps } from '../../ui/ConfirmationBox';\r\nimport { IModalBoxProps } from '../../ui/ModalBox';\r\nimport { DataGrid } from '../../ui/DataGrid';\r\nimport { userAdminApi } from '../../../shared/services/userApi';\r\nimport {\r\n AdminUserModel, AdminUserListRequest, UserStatusEnum, AdminUserSetStatusRequest,\r\n EmployeeTypeEnum, IUserSearchResult\r\n} from '../../../shared/models/api/models';\r\nimport { IActionProps, Toolbar } from '../../ui/Toolbar';\r\nimport { ReactNode } from 'react';\r\nimport { LabelledCheckbox } from '../../ui/LabelledCheckbox';\r\nimport {\r\n MailOutlined, NearMeOutlined, PersonOutlined, RadioButtonCheckedOutlined,\r\n RadioButtonUncheckedOutlined, SupervisorAccountOutlined\r\n} from '@material-ui/icons';\r\nimport { TabPanel } from '../../ui/TabPanel';\r\nimport { IListItemProps, List } from '../../ui/Lists';\r\nimport { UserProfile } from '../../../shared/models/site/user-profile';\r\nimport Spinner from '../../ui/Spinner';\r\nimport { DetailFormWrapper } from '../../ui/DetailForm';\r\n\r\ninterface IUserFilterUser {\r\n id: number,\r\n firstname: string,\r\n lastname: string,\r\n email: string,\r\n city: string,\r\n officeLocation: string,\r\n supervisor?: IUserSearchResult\r\n}\r\n\r\nconst UserListItem = (props: IListItemProps) => {\r\n return (\r\n
props.toggle(props.item)}>\r\n {props.item.firstname} {props.item.lastname}\r\n
\r\n {props.item.city &&\r\n {props.item.city}\r\n }\r\n {props.item.supervisor &&\r\n \r\n {props.item.supervisor.fullname}\r\n \r\n }\r\n {props.item.city === null && props.item.email &&\r\n \r\n {props.item.email}\r\n \r\n }\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst StringListItem = (props: IListItemProps) => {\r\n return (\r\n
props.toggle(props.item)}>\r\n {props.item}\r\n
\r\n );\r\n};\r\n\r\ninterface IUserFilterProps {\r\n allUsers: T[],\r\n selected: T[],\r\n setSelected: (users: T[]) => void,\r\n allowSelectAll?: boolean,\r\n isSelected?: (usr: T) => true | false | 'partial'\r\n}\r\n\r\nconst UserFilter = (props: IUserFilterProps) => {\r\n const [summaryText, setSummaryText] = useState(\"\");\r\n const [filterText, setFilterText] = useState(\"\");\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n\r\n const filterUsersAsync = async (name: string, users?: T[]): Promise => {\r\n const lcName = name.toLowerCase();\r\n\r\n const result = await (users ?? []).filter(u => {\r\n return ((u.firstname + ' ' + u.lastname).toLowerCase().indexOf(lcName) > -1\r\n || (u.email && u.email.toLowerCase().indexOf(lcName) > -1));\r\n });\r\n\r\n const usersText = result.length === 1 ? \"user\" : \"users\";\r\n\r\n setSummaryText(`${result.length} ${usersText} found for search \"${name}\".`);\r\n\r\n return result;\r\n };\r\n\r\n const selectItems = (items: T[]) => {\r\n props.setSelected(props.allUsers.filter(usr => props.selected.includes(usr) || items.includes(usr)));\r\n };\r\n\r\n const deselectItems = (items: T[]) => {\r\n props.setSelected(props.selected.filter(usr => !items.includes(usr)));\r\n };\r\n\r\n const toggleUser = (usr: T) => {\r\n if (props.selected.includes(usr)) {\r\n props.setSelected(props.selected.filter(u => u !== usr));\r\n } else {\r\n props.setSelected(props.selected.concat(usr));\r\n }\r\n };\r\n\r\n return (\r\n \r\n summary={summaryText}\r\n dataSource={props.allUsers}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n listItemType={UserListItem}\r\n filterText={filterText}\r\n setFilterText={setFilterText}\r\n expanded={isExpanded}\r\n selectItems={props.allowSelectAll ? selectItems : undefined}\r\n deselectItems={props.allowSelectAll ? deselectItems : undefined}\r\n maxItems={4}\r\n isSelected={props.isSelected}\r\n setExpanded={setIsExpanded}\r\n buildKey={(item: T) => { return item.id; }}\r\n filterAsync={filterUsersAsync}\r\n toggleSelected={toggleUser}\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={props.selected} />\r\n );\r\n};\r\n\r\ninterface IStringFilterProps {\r\n allValues: string[],\r\n selected: string[],\r\n setSelected: (values: string[]) => void,\r\n singularDesc: string,\r\n pluralDesc: string,\r\n placeholder: string\r\n}\r\n\r\nconst StringFilter = (props: IStringFilterProps) => {\r\n const [summaryText, setSummaryText] = useState(\"\");\r\n const [filterText, setFilterText] = useState(\"\");\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n\r\n const filter = (searchText: string, values?: string[]) => {\r\n const lcName = searchText.toLowerCase();\r\n\r\n const result = (values ?? []).filter(v => v?.toLowerCase().indexOf(lcName) > -1);\r\n\r\n const singularOrPlural = result.length === 1 ? props.singularDesc : props.pluralDesc;\r\n\r\n setSummaryText(`${result.length} ${singularOrPlural} found for search \"${searchText}\".`);\r\n\r\n return result;\r\n };\r\n\r\n const toggleValue = (value: string) => {\r\n if (props.selected.includes(value)) {\r\n props.setSelected(props.selected.filter(s => s !== value));\r\n } else {\r\n props.setSelected(props.selected.concat(value));\r\n }\r\n };\r\n\r\n return (\r\n \r\n summary={summaryText}\r\n dataSource={props.allValues}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n listItemType={StringListItem}\r\n filterText={filterText}\r\n setFilterText={setFilterText}\r\n expanded={isExpanded}\r\n setExpanded={setIsExpanded}\r\n buildKey={item => item}\r\n filter={filter}\r\n toggleSelected={toggleValue}\r\n noResultsMessage={\"No \" + props.pluralDesc + \" found.\"}\r\n filterTextPlaceholder={props.placeholder}\r\n selected={props.selected} />\r\n );\r\n};\r\n\r\ninterface IUsersByDepartmentFilterProps {\r\n allDepartments: string[],\r\n selectedDepartments: string[],\r\n setSelectedDepartments: (depts: string[]) => void\r\n}\r\n\r\nconst UsersByDepartmentFilter = (props: IUsersByDepartmentFilterProps) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n//TODO: refactor to ui folder, if we need radio buttons elsewhere with black accents\r\ninterface IRadioButtonProps {\r\n value: boolean,\r\n onClick: () => void,\r\n label: ReactNode\r\n}\r\n\r\nconst RadioButton = (props: IRadioButtonProps) => {\r\n return (\r\n
\r\n {props.value ? : }\r\n {props.label}\r\n
\r\n );\r\n};\r\n\r\ninterface IUsersByemployeeTypeFilterProps {\r\n selectedEmployeeType: EmployeeTypeEnum | null,\r\n setSelectedEmployeeType: (empType: EmployeeTypeEnum | null) => void\r\n}\r\n\r\nconst UsersByEmployeeTypeFilter = (props: IUsersByemployeeTypeFilterProps) => {\r\n return (\r\n
\r\n props.setSelectedEmployeeType(null)}\r\n label=\"All\"\r\n />\r\n\r\n props.setSelectedEmployeeType(EmployeeTypeEnum.Employee)}\r\n label={EmployeeTypeEmployeeLabel}\r\n />\r\n\r\n props.setSelectedEmployeeType(EmployeeTypeEnum.Contractor)}\r\n label={EmployeeTypeContractorLabel}\r\n />\r\n
\r\n );\r\n};\r\n\r\nconst distinct = (arr: T[]) => {\r\n return arr.filter((v, i, s) => { return s.indexOf(v) === i; });\r\n};\r\n\r\ninterface IUserFiltersProps {\r\n allUsers: AdminUserModel[],\r\n selectedUsers: AdminUserModel[],\r\n setSelectedUsers: (users: AdminUserModel[]) => void,\r\n selectedSupervisors: AdminUserModel[],\r\n setSelectedSupervisors: (users: AdminUserModel[]) => void,\r\n allDepartments: string[],\r\n selectedDepartments: string[],\r\n setSelectedDepartments: (depts: string[]) => void,\r\n selectedEmployeeType: EmployeeTypeEnum | null,\r\n setSelectedEmployeeType: (empType: EmployeeTypeEnum | null) => void\r\n currentUser?: UserProfile,\r\n selectAllUsers: boolean,\r\n setSelectAllUsers: (val: boolean) => void\r\n}\r\n\r\nconst ResultHeading = (props: { text: string, icon?: any }) => {\r\n const Icon = props.icon;\r\n\r\n return (\r\n
\r\n
\r\n {Icon && }\r\n Viewing: {props.text}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst UserFilters = (props: IUserFiltersProps) => {\r\n const [userFilterTab, setUserFilterTab] = useState(0);\r\n const [supervisorIds, setSupervisorIds] = useState([] as number[]);\r\n\r\n useEffect(() => {\r\n setSupervisorIds(distinct((props.allUsers ?? []).filter(usr => usr.supervisor !== null).map(usr => usr.supervisor?.id ?? -1)));\r\n }, [props.allUsers]);\r\n\r\n const deselectUser = (userToRemove: AdminUserModel) => {\r\n props.setSelectedUsers(props.selectedUsers.filter(selectedUser => selectedUser !== userToRemove));\r\n };\r\n\r\n const deselectSupervisor = (supervisorToRemove: AdminUserModel) => {\r\n props.setSelectedSupervisors(props.selectedSupervisors.filter(selectedSupervisor => selectedSupervisor !== supervisorToRemove));\r\n };\r\n\r\n const deselectDepartment = (departmentToRemove: string) => {\r\n props.setSelectedDepartments(props.selectedDepartments.filter(selectedDepartment => selectedDepartment !== departmentToRemove));\r\n };\r\n\r\n const whenUserOrSupervisorIsSelected = (usr: AdminUserModel) => {\r\n if (props.selectedUsers.includes(usr)) {\r\n return true;\r\n }\r\n\r\n if (usr.supervisor === null) {\r\n return false;\r\n } else {\r\n if (props.selectedSupervisors.findIndex(sv => sv.id === usr.supervisor?.id) > -1) {\r\n return 'partial';\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n Select User\r\n
\r\n\r\n
props.setSelectAllUsers(!props.selectAllUsers)}>\r\n \r\n User\r\n
\r\n\r\n
\r\n
\r\n { setUserFilterTab(v); }}>\r\n \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.currentUser &&\r\n usr.supervisor?.id === props.currentUser?.id)}\r\n selected={props.selectedUsers}\r\n setSelected={props.setSelectedUsers}\r\n isSelected={whenUserOrSupervisorIsSelected}\r\n allowSelectAll={true}\r\n />\r\n }\r\n \r\n\r\n \r\n supervisorIds.includes(usr.id))}\r\n selected={props.selectedSupervisors}\r\n setSelected={props.setSelectedSupervisors}\r\n allowSelectAll={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 {props.selectedUsers.map(usr =>\r\n deselectUser(usr)}\r\n label={<>User: {usr.firstname} {usr.lastname}} />\r\n )}\r\n\r\n {props.selectedSupervisors.map(sv =>\r\n deselectSupervisor(sv)}\r\n label={<>Supervisor: {sv.firstname} {sv.lastname}} />\r\n )}\r\n\r\n {props.selectedDepartments.map(dpt =>\r\n deselectDepartment(dpt)}\r\n label={<>Department: {dpt}} />\r\n )}\r\n\r\n {props.selectedEmployeeType === EmployeeTypeEnum.Employee &&\r\n props.setSelectedEmployeeType(null)}\r\n label={<>Employee type: BHP Employees users} />\r\n }\r\n\r\n {props.selectedEmployeeType === EmployeeTypeEnum.Contractor &&\r\n props.setSelectedEmployeeType(null)}\r\n label={<>Employee type: Contractors users} />\r\n }\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\ninterface IUserManagementPageProps {\r\n module: string\r\n}\r\n\r\nconst UserManagementPage = (props: RouteComponentProps) => {\r\n const currentUser = useProfile();\r\n\r\n const [loadingState, setLoadingState] = useState(\"init\");\r\n const [confirmationProps, setConfirmationProps] = useState(null as IConfirmProps | null);\r\n const [modalProps, setModalProps] = useState(null as IModalBoxProps | null);\r\n const [allUsers, setAllUsers] = useState([] as AdminUserModel[]);\r\n const [selectedUsers, setSelectedUsers] = useState([] as AdminUserModel[]);\r\n const [selectAllUsers, setSelectAllUsers] = useState(true);\r\n\r\n const [selectedEmployeeType, setSelectedEmployeeType] = useState(null as EmployeeTypeEnum | null);\r\n\r\n const [allDepartments, setAllDepartments] = useState([] as string[]);\r\n const [filterDepartments, setFilterDepartments] = useState([] as string[]);\r\n\r\n // this is a subset of all users, with the filters applied\r\n const [filteredUsers, setFilteredUsers] = useState([] as AdminUserModel[]);\r\n\r\n // this is the list of users the users has elected to include in the grid\r\n const [filterUsers, setFilterUsers] = useState([] as AdminUserModel[]);\r\n\r\n // this is the list of users the supervisors has elected to include the subordinates of in the grid\r\n const [filterSupervisors, setFilterSupervisors] = useState([] as AdminUserModel[]);\r\n\r\n const refresh = async () => {\r\n setLoadingState(\"loading\");\r\n\r\n const req = {} as AdminUserListRequest;\r\n\r\n userAdminApi.listAsync(req)\r\n .then(result => {\r\n setSelectedUsers(result.filter(updatedUser => selectedUsers.findIndex(selected => selected.id === updatedUser.id) > -1));\r\n setFilterUsers(result.filter(updatedUser => filterUsers.findIndex(selected => selected.id === updatedUser.id) > -1));\r\n setFilterSupervisors(result.filter(updatedUser => filterSupervisors.findIndex(selected => selected.id === updatedUser.id) > -1));\r\n setAllUsers(result);\r\n setAllDepartments(\r\n distinct(result.map(usr => usr.department)).filter(dept => dept?.length > 0).sort()\r\n );\r\n setLoadingState(\"ready\");\r\n })\r\n .catch(e => {\r\n setLoadingState(\"error\");\r\n ask(\"There was an error loading the user data.\", [\"Retry\", \"Cancel\"], \"Retry\", refresh);\r\n });\r\n };\r\n\r\n const replaceItem = (users: AdminUserModel[], updatedUser: AdminUserModel) => {\r\n // take a copy of the array\r\n const arr = users.map(u => u);\r\n\r\n const idx = arr.findIndex(u => u.id === updatedUser.id);\r\n\r\n if (idx > -1) {\r\n // replace the row with the updated user\r\n arr[idx] = updatedUser;\r\n }\r\n\r\n return arr;\r\n };\r\n\r\n const onDataChanged = (updatedUser: AdminUserModel) => {\r\n const idx = allUsers.findIndex(usr => usr.id === updatedUser.id);\r\n\r\n if (idx > -1) {\r\n setAllUsers(replaceItem(allUsers, updatedUser));\r\n setFilterUsers(replaceItem(filterUsers, updatedUser));\r\n } else {\r\n // just get all users again\r\n refresh();\r\n }\r\n\r\n setModalProps(null);\r\n msgBox(\"Your request has been successfully completed.\");\r\n };\r\n\r\n useEffect(() => {\r\n if (loadingState === \"init\") {\r\n refresh();\r\n }\r\n }, []);\r\n\r\n const byUserFilters = (usr: AdminUserModel) => {\r\n return (\r\n (filterUsers.length === 0 || filterUsers.includes(usr))\r\n && (filterSupervisors.length === 0 || (filterSupervisors.findIndex(sv => sv.id === usr.supervisor?.id) > -1))\r\n && ((filterDepartments.length === 0 || filterDepartments.includes(usr.department)))\r\n && ((selectedEmployeeType === null || usr.employeeType === selectedEmployeeType))\r\n );\r\n };\r\n\r\n useEffect(() => {\r\n if (filterUsers.length > 0 || filterSupervisors.length > 0 || filterDepartments.length || 0 || selectedEmployeeType !== null) {\r\n setFilteredUsers(allUsers.filter(byUserFilters));\r\n } else {\r\n setFilteredUsers(allUsers);\r\n }\r\n setSelectedUsers([]);\r\n\r\n }, [allUsers, filterUsers, filterSupervisors, filterDepartments, selectedEmployeeType]);\r\n\r\n const numberSort = (a?: number | null, b?: number | null) => {\r\n if (!a && !b) return 0;\r\n\r\n // nulls first\r\n if (!a) return -1;\r\n if (!b) return 1;\r\n\r\n if (a < b) return -1;\r\n if (a > b) return 1;\r\n\r\n return 0;\r\n };\r\n\r\n const msgBox = (msg: ReactNode) => {\r\n setConfirmationProps({\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultOption: \"OK\",\r\n setResult: result => {\r\n setConfirmationProps(null);\r\n }\r\n });\r\n };\r\n\r\n const ask = (\r\n msg: React.ReactNode,\r\n opts: string[],\r\n def: string,\r\n defFn: () => void,\r\n otherFn?: (result: string) => void\r\n ) => {\r\n setConfirmationProps({\r\n message: msg,\r\n options: opts,\r\n defaultOption: def,\r\n setResult: result => {\r\n setConfirmationProps(null);\r\n\r\n if (result === def) {\r\n if (defFn) defFn();\r\n } else {\r\n if (otherFn) otherFn(result);\r\n }\r\n }\r\n });\r\n };\r\n\r\n const loadUser = (id: number) => {\r\n return userAdminApi.getAsync(id);\r\n };\r\n\r\n const saveUser = async (userToSave: AdminUserModel) => {\r\n let user = await userAdminApi.updateAsync(userToSave);\r\n await refresh();\r\n return user;\r\n };\r\n\r\n const viewUser = (usr: AdminUserModel) => {\r\n if (usr) {\r\n setModalProps({\r\n className: \"user-information-dialog\",\r\n body:\r\n loadUser(usr.id)}\r\n save={saveUser}\r\n setConfirmationProps={setConfirmationProps}\r\n closeDialog={() => setModalProps(null)}\r\n onDataChanged={onDataChanged}\r\n />\r\n });\r\n }\r\n };\r\n\r\n const makeUsersInactive = (usersToInactivate: AdminUserModel[]) => {\r\n changeUserStatus(usersToInactivate, UserStatusEnum.Inacitve);\r\n };\r\n\r\n const makeUsersActive = (usersToActivate: AdminUserModel[]) => {\r\n changeUserStatus(usersToActivate, UserStatusEnum.Active);\r\n };\r\n\r\n const changeUserStatus = (usersToChange: AdminUserModel[], status: UserStatusEnum) => {\r\n if (usersToChange.length < 1) {\r\n msgBox(
Please select at least one user
to continue.
);\r\n return;\r\n }\r\n\r\n var nonEmployeesSelected = usersToChange.filter(usr => usr.employeeType !== EmployeeTypeEnum.Contractor).length;\r\n\r\n if (nonEmployeesSelected > 0) {\r\n msgBox(
The selected action can only be
performed on Contractor users.
);\r\n return;\r\n }\r\n\r\n const users = usersToChange.length === 1 ? \"user\" : \"users\";\r\n const newStatus = status === UserStatusEnum.Active ? \"active\" : \"inactive\";\r\n\r\n ask(\r\n
Are you sure you would like to
make the {users} { newStatus} ?
,\r\n [\"No\", \"Yes\"],\r\n \"Yes\",\r\n () => {\r\n const req = {\r\n userIds: usersToChange.map(usr => usr.id),\r\n status: status\r\n } as AdminUserSetStatusRequest;\r\n\r\n userAdminApi.setStatus(req).then((result) => {\r\n if (result) {\r\n refresh();\r\n msgBox(\"You have successfully changed the status of the \" + users + \".\");\r\n }\r\n });\r\n\r\n\r\n }\r\n );\r\n }\r\n\r\n const onUserDoubleClick = (usr: AdminUserModel) => {\r\n viewUser(usr);\r\n };\r\n\r\n const perform = (actionName: string, user: AdminUserModel) => {\r\n switch (actionName) {\r\n case ViewOrEditButtonText:\r\n return viewUser(user);\r\n } \r\n };\r\n\r\n const checkMinMax = (action: IActionProps) => {\r\n if (selectedUsers.length === 0 && (action.minSelectedCount ?? 0) > 0) {\r\n msgBox(\"Please select one item to continue.\");\r\n return false;\r\n }\r\n\r\n if (!!action.maxSelectedCount) {\r\n if (selectedUsers.length > action.maxSelectedCount) {\r\n if (action.maxSelectedCount === 1) {\r\n msgBox(
The selected action can only
be performed on a single user.
);\r\n } else {\r\n msgBox(\"Please select \" + action.maxSelectedCount + \" or fewer items to continue.\");\r\n }\r\n\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n\r\n const actionClicked = (action: IActionProps) => {\r\n if (checkMinMax(action)) {\r\n switch (action.name) {\r\n case ViewOrEditButtonText:\r\n viewUser(selectedUsers[0]);\r\n break;\r\n case MakeInactiveButtonText:\r\n makeUsersInactive(selectedUsers.map(u => u));\r\n break;\r\n case MakeActiveButtonText:\r\n makeUsersActive(selectedUsers.map(u => u));\r\n break;\r\n case RefreshButtonText:\r\n refresh();\r\n break;\r\n }\r\n }\r\n };\r\n\r\n return (\r\n \r\n\r\n {loadingState === \"loading\" &&\r\n \r\n }\r\n\r\n {loadingState === \"ready\" && <>\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n c.showInGrid).sort((a, b) => numberSort(a.showInGrid, b.showInGrid))}\r\n perform={perform}\r\n onDoubleClick={onUserDoubleClick} />\r\n \r\n }\r\n \r\n );\r\n};\r\n\r\nexport default UserManagementPage;","var _defs, _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgMakeInactive(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"power_settings_new_black_24dp\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4330\",\n \"data-name\": \"Path 4330\",\n className: \"cls-1\",\n d: \"M0,0H24V24H0Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4331\",\n \"data-name\": \"Path 4331\",\n d: \"M13,3H11V13h2Zm4.83,2.17L16.41,6.59A6.92,6.92,0,0,1,19,12,7,7,0,1,1,7.58,6.58L6.17,5.17A8.992,8.992,0,1,0,21,12,8.932,8.932,0,0,0,17.83,5.17Z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgMakeInactive);\nexport default __webpack_public_path__ + \"static/media/make-inactive.9c329f07.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgMakeActive(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"toggle_on_black_24dp\",\n xmlns: \"http://www.w3.org/2000/svg\",\n height: 24,\n viewBox: \"0 0 24 24\",\n width: 24,\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5zm0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgMakeActive);\nexport default __webpack_public_path__ + \"static/media/make-active.1fcf57c8.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRelatedDocuments(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2.006 2.006 0 0 0 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRelatedDocuments);\nexport default __webpack_public_path__ + \"static/media/related-documents.ee39a8eb.svg\";\nexport { ForwardRef as ReactComponent };","import UserManagementPage from './user-management';\r\nimport { TextField, UserField, EmailField, LabelField, ComboField, DateField } from 'components/ui/DetailForm';\r\nimport { IApplicationModule } from 'components/ui/IApplicationModule';\r\nimport { IUserSearchResult, AdminUserModel, UserStatusEnum, EmployeeTypeEnum } from '../../../shared/models/api/models';\r\nimport { ReactComponent as UserIcon } from \"assets/icons/users-filled.svg\";\r\nimport { ReactComponent as MakeInactiveIcon } from \"assets/icons/make-inactive.svg\";\r\nimport { ReactComponent as MakeActiveIcon } from \"assets/icons/make-active.svg\";\r\nimport { stringSort, dateSort } from 'helpers/HelperFunctions';\r\nimport { BarChartOutlined, Create, EditOutlined, Info, RefreshOutlined } from '@material-ui/icons';\r\n\r\n// we could probably move these to the toolbar as standard text buttons\r\nexport const ViewOrEditButtonText = \"View/Edit\";\r\nexport const MakeInactiveButtonText = \"Make inactive\";\r\nexport const MakeActiveButtonText = \"Make active\";\r\nexport const RefreshButtonText = \"Refresh\";\r\n\r\nconst isContractor = (user: AdminUserModel) => {\r\n return user.employeeType === EmployeeTypeEnum.Contractor;\r\n};\r\nconst isEmployee = (user: AdminUserModel) => {\r\n return user.employeeType === EmployeeTypeEnum.Employee;\r\n}\r\n\r\nconst byEmail = (a: AdminUserModel, b: AdminUserModel, order: number) => {\r\n return stringSort(a.email, b.email) * order;\r\n};\r\n\r\nconst byUsername = (a: AdminUserModel, b: AdminUserModel, order: number) => {\r\n return stringSort(a.username, b.username) * order;\r\n};\r\n\r\nconst byLastLogin = (a: AdminUserModel, b: AdminUserModel, order: number) => {\r\n return dateSort(a.lastLoginDate, b.lastLoginDate) * order;\r\n};\r\n\r\nconst byName = (a: AdminUserModel, b: AdminUserModel, order: number) => {\r\n return stringSort(`${a.firstname} ${a.lastname}`, `${b.firstname} ${b.lastname}`) * order;\r\n};\r\n\r\nconst byMobile = (a: AdminUserModel, b: AdminUserModel, order: number) => {\r\n return stringSort(a.mobile, b.mobile) * order;\r\n};\r\n\r\nexport const EmployeeTypeEmployeeLabel = \"BHP User\";\r\nexport const EmployeeTypeContractorLabel = \"Contractor User\";\r\n\r\nexport const UserManagementModule = {\r\n title: \"User Management\",\r\n className: \"user-management\",\r\n url: \"/administration/user-management\",\r\n icon: UserIcon,\r\n permission: \"web.admin.user.read\",\r\n component: UserManagementPage,\r\n selectMode: \"many\", \r\n doubleClickAction: ViewOrEditButtonText,\r\n actions: [\r\n {\r\n name: ViewOrEditButtonText,\r\n icon: EditOutlined,\r\n permission: \"web.admin.user.read\",\r\n minSelectedCount: 1,\r\n maxSelectedCount: 1,\r\n openView: \"view\"\r\n },\r\n {\r\n name: MakeInactiveButtonText,\r\n icon: MakeInactiveIcon,\r\n permission: \"web.admin.user.make-inactive\"\r\n },\r\n {\r\n name: MakeActiveButtonText,\r\n icon: MakeActiveIcon,\r\n permission: \"web.admin.user.make-inactive\"\r\n }\r\n ],\r\n views: [\r\n {\r\n name: \"view\",\r\n mode: \"view\",\r\n icon: Info,\r\n heading: \"User Information\",\r\n subSubHeading: (usr: AdminUserModel) => (\"User Information: \" + usr.firstname + \" \" + usr.lastname),\r\n subSubIcon: BarChartOutlined,\r\n defaultAction: \"edit\",\r\n actions: [\r\n { name: \"cancel\", label: \"Close\", setResult: \"close\" },\r\n { name: \"edit\", label: \"Edit\", switchToView: \"edit\", permission: \"web.admin.user.edit\" }\r\n ]\r\n },\r\n {\r\n name: \"edit\",\r\n mode: \"edit\",\r\n heading: \"User details\",\r\n icon: Create,\r\n subHeading: \"Edit user details\",\r\n subSubIcon: BarChartOutlined,\r\n subSubHeading: (usr: AdminUserModel) => (\"User Information: \" + usr.firstname + \" \" + usr.lastname),\r\n editLayout: \"grid\",\r\n defaultAction: \"save\",\r\n actions: [\r\n { name: \"cancel\", label: \"Cancel\", setResult: \"close\" },\r\n { name: \"save\", label: \"Update details\", setResult: \"save\", validate: true }\r\n ]\r\n }\r\n ],\r\n columns: [\r\n {\r\n name: \"id\",\r\n heading: \"id\",\r\n className: \"number-col\"\r\n },\r\n {\r\n name: \"username\",\r\n heading: \"Username\",\r\n sort: byUsername,\r\n readonly: true,\r\n className: \"string-col\"\r\n },\r\n {\r\n name: \"lastLoginDate\",\r\n heading: \"Last login date and time\",\r\n gridHeading: \"Last login\",\r\n showInGrid: 4,\r\n className: \"date-col\",\r\n formComponent: DateField,\r\n readonly: true,\r\n sort: byLastLogin,\r\n format: (val?: string) => {\r\n return (!val ? null : new Date(val).toLocaleDateString())\r\n }\r\n },\r\n {\r\n name: \"firstname\",\r\n heading: \"First name\",\r\n className: \"string-col\",\r\n formComponent: TextField,\r\n readonlyIf: isEmployee,\r\n validation: {\r\n required: true,\r\n minLength: 2,\r\n tip: \"Enter first name\"\r\n },\r\n placeholderText: \"Enter first name\",\r\n setValue: (user: AdminUserModel, val: string) => {\r\n user.firstname = val;\r\n user.fullname = user.firstname + ' ' + user.lastname;\r\n }\r\n },\r\n {\r\n name: \"lastname\",\r\n heading: \"Last name\",\r\n className: \"string-col\",\r\n formComponent: TextField,\r\n readonlyIf: isEmployee,\r\n validation: {\r\n required: true,\r\n minLength: 2,\r\n tip: \"Enter last name\"\r\n },\r\n placeholderText: \"Enter last name\",\r\n setValue: (user: AdminUserModel, val: string) => {\r\n user.lastname = val;\r\n user.fullname = user.firstname + ' ' + user.lastname;\r\n }\r\n },\r\n {\r\n name: \"fullname\",\r\n heading: \"Name\",\r\n className: \"string-col\",\r\n showInGrid: 1,\r\n sort: byName,\r\n clickAction: ViewOrEditButtonText,\r\n readonly: true,\r\n readonlyForEdit: true\r\n },\r\n {\r\n name: \"email\",\r\n heading: \"Email address\",\r\n sort: byEmail,\r\n readonly: true,\r\n className: \"email-col\",\r\n showInGrid: 2, \r\n formComponent: EmailField\r\n },\r\n {\r\n name: \"mobile\",\r\n heading: \"Phone number\",\r\n showInGrid: 13,\r\n className: \"phone-col\",\r\n readonlyIf: isEmployee,\r\n sort: byMobile,\r\n formComponent: TextField,\r\n validation: {\r\n required: true,\r\n segments: { splitter: ' ', min: 3 },\r\n minLength: 8,\r\n tip: \"Phone number is mandatory\"\r\n },\r\n placeholderText: \"(+61) 412 123 123\",\r\n setValue: (user: AdminUserModel, val: string) => { user.mobile = val; }\r\n },\r\n {\r\n name: \"password\",\r\n heading: \"Password\",\r\n className: \"password-col\",\r\n readonly: true,\r\n formComponent: LabelField,\r\n formatRow: (row) => {\r\n // IKR!\r\n return \"*********\";\r\n }\r\n },\r\n {\r\n name: \"employeeType\",\r\n heading: \"Employee type\",\r\n className: \"string-col\",\r\n formComponent: ComboField,\r\n showInGrid: 5,\r\n filterable: true,\r\n readonly: true,\r\n validation: {\r\n values: [\r\n { key: EmployeeTypeEnum.Contractor, value: EmployeeTypeContractorLabel },\r\n { key: EmployeeTypeEnum.Employee, value: EmployeeTypeEmployeeLabel },\r\n { key: EmployeeTypeEnum.System, value: \"System\" },\r\n { key: EmployeeTypeEnum.Unknown, value: \"Unknown\" }\r\n ],\r\n required: true,\r\n },\r\n placeholderText: \"Select employee type\",\r\n setValue: (user: AdminUserModel, val: number) => { user.employeeType = val; }\r\n },\r\n {\r\n name: \"companyName\",\r\n heading: \"Company\",\r\n className: \"Company\",\r\n formComponent: LabelField,\r\n showInGrid: 6,\r\n filterable: true\r\n },\r\n {\r\n name: \"jobTitle\",\r\n heading: \"Title\",\r\n showInGrid: 8,\r\n filterable: true,\r\n className: \"string-col\",\r\n formComponent: LabelField\r\n },\r\n {\r\n name: \"roleName\",\r\n heading: \"Role\",\r\n showInGrid: 9,\r\n className: \"string-col\",\r\n formComponent: LabelField,\r\n filterable: true,\r\n readonly: true\r\n },\r\n {\r\n // this on shows in the grid\r\n name: \"supervisor\", \r\n heading: \"Supervisor\",\r\n filterable: true,\r\n showInGrid: 7,\r\n className: \"user-name\", \r\n format: (val: IUserSearchResult) => {\r\n return val ? val.fullname : \"\";\r\n }\r\n },\r\n {\r\n // this on shows in the form\r\n name: \"supervisor\",\r\n heading: \"Supervisor\",\r\n className: \"user-id\",\r\n formComponent: UserField,\r\n readonlyIf: isContractor,\r\n placeholderText: \"Select supervisor\",\r\n setValue: (user: AdminUserModel, val: IUserSearchResult) => {\r\n user.supervisor = val;\r\n }\r\n }, \r\n {\r\n name: \"city\",\r\n heading: \"City\",\r\n filterable: true,\r\n showInGrid: 10,\r\n className: \"string-col\",\r\n formComponent: LabelField\r\n },\r\n {\r\n name: \"officeLocation\",\r\n heading: \"Location\",\r\n filterable: true,\r\n showInGrid: 11,\r\n className: \"string-col\",\r\n formComponent: LabelField\r\n },\r\n {\r\n name: \"department\",\r\n heading: \"Department\",\r\n filterable: true,\r\n showInGrid: 12,\r\n className: \"string-col\",\r\n formComponent: LabelField\r\n },\r\n {\r\n name: \"division\",\r\n heading: \"Division\",\r\n filterable: true,\r\n className: \"string-col\",\r\n formComponent: LabelField\r\n },\r\n {\r\n name: \"status\",\r\n heading: \"Status\",\r\n filterable: true,\r\n showInGrid: 3,\r\n className: \"string-col\",\r\n formComponent: ComboField,\r\n readonlyIf: (user: AdminUserModel) => { return isEmployee(user) || user.status === UserStatusEnum.Inacitve },\r\n validation: {\r\n values: [\r\n { key: UserStatusEnum.Active, value: \"Active\" },\r\n { key: UserStatusEnum.Inacitve, value: \"Inactive\" }\r\n ],\r\n required: true,\r\n tip: \"status is mandatory\"\r\n },\r\n placeholderText: \"Select a status\",\r\n setValue: (user: AdminUserModel, val: UserStatusEnum) => { user.status = val; }\r\n },\r\n {\r\n name: \"domainDisabled\",\r\n heading: \"Domain status\",\r\n validation: {\r\n values: [\r\n { key: true, value: \"Disabled\" },\r\n { key: false, value: \"Enabled\" }\r\n\r\n ],\r\n },\r\n filterable: true,\r\n className: \"boolean-col\"\r\n }\r\n ]\r\n} as IApplicationModule;","import * as React from 'react';\r\nimport { ReactNode } from \"react\";\r\nimport * as api from 'shared/services/reportingApi';\r\nimport { evalPath } from 'helpers/HelperFunctions';\r\nimport { PageList } from 'components/ui/PageList';\r\nimport { LabelledCheckbox } from 'components/ui/LabelledCheckbox';\r\nimport { Grid, GridSize } from '@material-ui/core';\r\nimport { RemoveOutlined, DragIndicatorOutlined, ImportExportOutlined, ArrowDownwardOutlined, ArrowUpwardOutlined } from '@material-ui/icons';\r\n\r\n\r\nexport interface IGridSizes {\r\n xs?: boolean | GridSize | undefined,\r\n sm?: boolean | GridSize | undefined,\r\n md?: boolean | GridSize | undefined,\r\n lg?: boolean | GridSize | undefined,\r\n xl?: boolean | GridSize | undefined\r\n}\r\n\r\nexport const standardGridSizes: IGridSizes = { xs: 6, sm: 5, md: 4, lg: 3, xl: 2 };\r\n\r\nexport interface ICheckboxListProps extends IGridSizes {\r\n items: T[],\r\n toggle: (item: T) => void,\r\n buildKey: (item: T) => string,\r\n isSelected: (item: T) => boolean,\r\n content: (item: T) => ReactNode\r\n}\r\n\r\nexport interface IExportColumnListProps extends IGridSizes {\r\n columns: api.ExportColumn[],\r\n toggle: (col: api.ExportColumn) => void,\r\n selected: ISelectedExportColumn[]\r\n}\r\n\r\nexport const ExportColumnList = (props: IExportColumnListProps) => {\r\n return (\r\n \r\n {\r\n props.columns.map(\r\n c => \r\n s.definition.name === c.name) > -1}\r\n toggle={() => { props.toggle(c); }}>{c.title}\r\n \r\n )\r\n }\r\n \r\n );\r\n};\r\n\r\nexport interface IExportGridProps {\r\n columns: ISelectedExportColumn[],\r\n results: api.IResultList,\r\n sortOrder: api.ISortConfig[],\r\n pageNumber: number,\r\n state: 'ready' | 'busy',\r\n moveToPage: (page: number) => void,\r\n pageSize: number,\r\n setPageSize: (value: number) => void,\r\n setSortOrder?: (value: api.ISortConfig[]) => void,\r\n removeColumn?: (col: api.ExportColumn) => void\r\n}\r\n\r\nexport interface IExportColumnHeaderProps {\r\n col: ISelectedExportColumn;\r\n direction: string | null;\r\n setSortDirection: (dir: null | 'asc' | 'desc') => void;\r\n removeColumn?: () => void;\r\n}\r\n\r\nexport const ExportColumnHeader = (props: IExportColumnHeaderProps) => {\r\n const toggleSortOrder = () => {\r\n if (!props.col.definition.unsortable) {\r\n switch (props.direction) {\r\n case \"asc\":\r\n props.setSortDirection(\"desc\");\r\n break;\r\n case \"desc\":\r\n props.setSortDirection(null);\r\n break;\r\n default:\r\n props.setSortDirection(\"asc\");\r\n break;\r\n }\r\n }\r\n };\r\n\r\n return (\r\n \r\n
\r\n\r\n \r\n \r\n {props.col.definition.title}\r\n \r\n
\r\n {props.removeColumn != undefined &&\r\n \r\n }\r\n
\r\n
\r\n \r\n )\r\n};\r\n\r\nexport const ExportGrid = (props: IExportGridProps) => {\r\n const getSortDirection = (name: string): string | null => {\r\n var sortField = props.sortOrder.find(s => s.field === name);\r\n\r\n if (sortField)\r\n return sortField.dir;\r\n\r\n return null;\r\n };\r\n\r\n const setSortDirection = (name: string, dir: null | 'asc' | 'desc') => {\r\n const arr = props.sortOrder;\r\n\r\n var idx = arr.findIndex(s => s.field === name);\r\n\r\n if (idx > -1) {\r\n if (dir === null) {\r\n arr.splice(idx, 1);\r\n } else if (dir !== undefined) {\r\n arr[idx].dir = dir;\r\n }\r\n } else {\r\n if (dir) {\r\n arr.push({ field: name, dir: dir });\r\n }\r\n }\r\n\r\n props.setSortOrder !== undefined && props.setSortOrder(arr);\r\n };\r\n\r\n const getFieldTitle = (name: string): string => {\r\n const field = props.columns.find(c => c.definition.name === name);\r\n\r\n if (!field) {\r\n return name;\r\n }\r\n\r\n return field.definition.title;\r\n }\r\n\r\n const sortDescription = () => {\r\n if (props.sortOrder.length === 0) {\r\n return \"click a column header to stort\";\r\n }\r\n\r\n return \"sorted by: \" + props.sortOrder.map(s => { return getFieldTitle(s.field) + (s.dir === 'asc' ? \"\" : \" (\" + s.dir + \")\") }).join(', then by: ');\r\n };\r\n\r\n const getRemoveColumn = (xc: ISelectedExportColumn) => {\r\n if (props.removeColumn == undefined) {\r\n return undefined;\r\n }\r\n\r\n return () => { props.removeColumn != undefined && props.removeColumn(xc.definition); }\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n \r\n \r\n \r\n {\r\n props.columns.length == 0 &&\r\n \r\n }\r\n\r\n {\r\n props.columns.map(xc =>\r\n { setSortDirection(xc.definition.name, dir); }}\r\n direction={getSortDirection(xc.definition.name)}\r\n />)\r\n }\r\n \r\n {\r\n props.results.list.map(\r\n (row, index) => \r\n {\r\n props.columns.map(xc =>\r\n \r\n )\r\n }\r\n \r\n )\r\n }\r\n \r\n
No columns selected
\r\n
\r\n
\r\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 interface IExportGridColumnProps {\r\n row: any,\r\n col: ISelectedExportColumn\r\n}\r\n\r\nexport const ExportGridColumn = (props: IExportGridColumnProps) => {\r\n return (\r\n { if (props.col.definition.infoDialog) props.col.definition.infoDialog(props.row); }}>\r\n {props.col.definition.formatter ? props.col.definition.formatter(evalPath(props.col.definition.name, props.row)) : evalPath(props.col.definition.name, props.row)}\r\n \r\n )\r\n};\r\n\r\nexport interface ISelectedExportColumn {\r\n seq: number;\r\n definition: api.ExportColumn;\r\n}\r\n","import { hasUncaughtExceptionCaptureCallback } from \"process\";\r\nimport { BlobType } from \"shared/services/httpService\";\r\n\r\n// Different processing depending on if on ios device / non safari. \r\n// The file reader approach will work on all platforms how ever the file isn't named, downloads as (unkown.csv)\r\n\r\nexport const blobDownload = (file: BlobType | null): void =>\r\n{\r\n\r\n if (file) {\r\n\r\n var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\r\n\r\n var isSafari = !!navigator.userAgent.match(/Version\\/[\\d\\.]+.*Safari/);\r\n\r\n if (iOS) {\r\n var reader = new FileReader();\r\n reader.onload = function (e)\r\n {\r\n window.location.href = reader.result as string;\r\n }\r\n if (isSafari) {\r\n var blob = new Blob([file.blob], { type: 'text/csv' })\r\n reader.readAsDataURL(blob);\r\n }\r\n else\r\n if (file.blob.size > 1048576)\r\n throw new RangeError(\"File exceeds maximum size for non-safari browser on ios. Please use Safari if you wish to download this file.\");\r\n else\r\n reader.readAsDataURL(file.blob)\r\n return;\r\n }\r\n\r\n var lnk = document.createElement(\"a\");\r\n\r\n if (lnk) {\r\n var blob = new Blob([file.blob], { type: 'text/csv' })\r\n lnk.href = window.URL.createObjectURL(blob);\r\n lnk.setAttribute(\"download\", file.fileName);\r\n lnk.click();\r\n }\r\n }\r\n\r\n}","import React, { useState, useEffect } from 'react';\r\nimport ReactDatePicker from 'react-datepicker';\r\n\r\nimport 'react-datepicker/dist/react-datepicker.css';\r\nimport 'components/portal/administration/administration.css';\r\nimport './Reporting.css';\r\n\r\nimport { TodayOutlined, EventOutlined } from '@material-ui/icons';\r\n\r\n\r\ninterface IDateRangePickerProps {\r\n className?: string;\r\n fromDate?: Date;\r\n toDate?: Date;\r\n setter: (fromDate?: Date, toDate?: Date) => void;\r\n}\r\n\r\nconst DateRangePicker = (props: IDateRangePickerProps) => {\r\n return (\r\n
\r\n\r\n \r\n\r\n \r\n\r\n
\r\n );\r\n};\r\n\r\nexport default DateRangePicker;\r\n","import { Paper, Tabs, Tab, Grid } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { useState, useEffect, ReactNode } from \"react\";\r\nimport {\r\n SupervisorAccountOutlined, PersonOutlined, FolderOutlined, NearMeOutlined,\r\n CreateNewFolderOutlined, PersonAddOutlined, BarChartOutlined, MailOutline\r\n} from '@material-ui/icons';\r\nimport Chip from '@material-ui/core/Chip';\r\nimport * as api from 'shared/services/reportingApi';\r\nimport { List, StringListItem, ListItem, IListItemProps } from '../../ui/Lists';\r\nimport { Checkbox, LabelledCheckbox } from '../../ui/LabelledCheckbox';\r\nimport { IConfirmProps } from '../../ui/ConfirmationBox';\r\nimport '../../ui/ConfirmationBox.css';\r\nimport { TabPanel } from '../../ui/TabPanel';\r\nimport { ReactComponent as ReportingIcon } from \"assets/icons/reports-filled.svg\";\r\nimport { ReactComponent as ActionFields } from \"assets/icons/action-fields-outlined.svg\";\r\nimport { ReactComponent as BuildCircle } from \"assets/icons/build-circle.svg\";\r\nimport { ReactComponent as DashboardCustomise } from \"assets/icons/dashboard-customize.svg\";\r\nimport { ReactComponent as AddChart } from \"assets/icons/add-chart.svg\";\r\nimport \"react-datepicker/dist/react-datepicker.css\";\r\nimport './Reporting.css';\r\nimport { CleverString } from '../../ui/CleverString';\r\nimport PortalPage from '../PortalPage';\r\nimport { IModalBoxProps } from '../../ui/ModalBox';\r\nimport { DetailFormWrapper } from '../../ui/DetailForm';\r\nimport { AdminUserModel } from '../../../shared/models/api/models';\r\nimport { UserManagementModule } from '../administration/user-management-data';\r\nimport { userAdminApi } from '../../../shared/services/userApi';\r\nimport '../administration/administration.css';\r\n\r\nimport { ICheckboxListProps, IGridSizes, ISelectedExportColumn, standardGridSizes, ExportColumnList, ExportGrid } from './ExportGrid'\r\nimport { blobDownload } from './blobDownload';\r\nimport DateRangePicker from './DateRangePicker';\r\n\r\nconst dateToStringFormatter = (value: string) =>\r\n
{!value ? \"\" : (new Date(value)).toLocaleString()}
;\r\n\r\nconst booleanToYesNoFormatter = (value: boolean, trueValue = \"Yes\", falseValue = \"No\") =>\r\n
{!value ? falseValue : trueValue}
;\r\n\r\nconst stringArrayToString = (value: string[], separator = \", \") => value.join(separator);\r\n\r\nconst emailFormatter = (value: Date) => {\r\n return (\r\n {value}\r\n );\r\n};\r\n\r\nconst CheckboxList = (props: ICheckboxListProps) => {\r\n const gridSizes = props as IGridSizes;\r\n\r\n return (\r\n \r\n {props.items.map(item => \r\n props.toggle(item)}>{props.content(item)}\r\n )}\r\n \r\n );\r\n};\r\n\r\n\r\nconst sortByComplianceReport = (a: api.ExportColumn, b: api.ExportColumn) => {\r\n if (a.defaultForComplianceReport && b.defaultForComplianceReport) {\r\n if (a.defaultForComplianceReport < b.defaultForComplianceReport) return -1;\r\n if (a.defaultForComplianceReport > b.defaultForComplianceReport) return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nexport const UserListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n {props.item.fullName}\r\n
\r\n {props.item.city &&\r\n {props.item.city}\r\n }\r\n\r\n {props.item.supervisor.length > 0 &&\r\n {props.item.supervisor}\r\n }\r\n\r\n {!props.item.city && props.item.email.length > 0 &&\r\n {props.item.email} \r\n }\r\n\r\n
\r\n
;\r\n\r\nexport const DocumentTypeListItem = (props: IListItemProps) => {\r\n const isSelected = (doc: api.DocumentType): boolean => {\r\n if (!props) {\r\n return false;\r\n }\r\n\r\n if (!props.selectedItems) {\r\n return false;\r\n }\r\n\r\n return props.selectedItems.findIndex(d => doc.id === d.id) > -1;\r\n };\r\n\r\n return (\r\n <>\r\n {(props.previousItem == null || props.previousItem.module !== props.item.module) &&\r\n
{props.item.module}
\r\n }\r\n\r\n \r\n \r\n {props.item.name}\r\n \r\n \r\n\r\n {props.item.subTypes?.map(st =>\r\n
\r\n \r\n \r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport const DocumentListItem = (props: IListItemProps>) =>\r\n
props.toggle(props.item)}>\r\n \r\n {props.item.type}\r\n {props.item.subType && {props.item.subType}}\r\n {props.item.metadata.title}\r\n
;\r\n\r\ninterface IChipsProps {\r\n values: T[],\r\n removeItem: (item: T) => void,\r\n prefix?: any\r\n}\r\nconst CleverStringChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(cs =>\r\n { props.removeItem(cs); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{cs.toSentenceCase()}\r\n }\r\n />\r\n )\r\n }\r\n ;\r\n\r\nconst UserChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(usr =>\r\n { props.removeItem(usr); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{usr.fullName}\r\n } />\r\n )\r\n }\r\n ;\r\n\r\nconst DocumentChips = (props: IChipsProps>) =>\r\n <>\r\n {props.values &&\r\n props.values.map(doc =>\r\n { props.removeItem(doc); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{doc.metadata.title}\r\n }\r\n />\r\n )\r\n }\r\n ;\r\n\r\nconst DocumentTypeChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(dt =>\r\n { props.removeItem(dt); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{dt.name}\r\n }\r\n />\r\n )\r\n }\r\n ;\r\n\r\nconst Chips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(val =>\r\n { props.removeItem(val); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{val}\r\n }\r\n />\r\n )\r\n }\r\n ;\r\n\r\nconst UserDocumentReport = () => {\r\n const MaxResultsPerReport = 60000;\r\n\r\n const [exportState, setExportState] = useState(\"ready\" as \"ready\" | \"busy\");\r\n\r\n const [stateVersion, setStateVersion] = useState(0);\r\n const [selectedDocuments, setSelectedDocuments] = useState([] as api.Document[]);\r\n\r\n const [selectedUsers, setSelectedUsers] = useState([] as api.User[]);\r\n\r\n const [exportUsers, setExportUsers] = useState(false);\r\n const [exportDocuments, setExportDocuments] = useState(false);\r\n\r\n useEffect(() => {\r\n let newExportColumns = exportColumns.map(c => c.definition);\r\n\r\n //Deselect any columns from a groups not enabled\r\n if (!exportUsers) {\r\n newExportColumns = newExportColumns.filter(selectedCol => !userColumns.some(col => col.name == selectedCol.name));\r\n }\r\n\r\n if (!exportDocuments) {\r\n newExportColumns = newExportColumns.filter(selectedCol => !documentColumns.some(col => col.name == selectedCol.name));\r\n }\r\n\r\n if (!exportUsers || !exportDocuments) {\r\n newExportColumns = newExportColumns.filter(selectedCol => !actionColumns.some(col => col.name == selectedCol.name));\r\n }\r\n\r\n //Select defaults from groups that are enabled with no current columns selected\r\n let selectedUserColumns = exportColumns.filter(selectedCol => userColumns.some(col => col.name == selectedCol.definition.name));\r\n if (exportUsers && selectedUserColumns.length === 0) {\r\n newExportColumns = newExportColumns.concat(userColumns.filter(c => c.defaultForComplianceReport));\r\n }\r\n\r\n let selectedDocumentColumns = exportColumns.filter(selectedCol => documentColumns.some(col => col.name == selectedCol.definition.name));\r\n if (exportDocuments && selectedDocumentColumns.length === 0) {\r\n newExportColumns = newExportColumns.concat(documentColumns.filter(c => c.defaultForComplianceReport));\r\n }\r\n\r\n let selectedActionColumns = exportColumns.filter(selectedCol => actionColumns.some(col => col.name == selectedCol.definition.name));\r\n if (exportUsers && exportDocuments && selectedActionColumns.length === 0) {\r\n newExportColumns = newExportColumns.concat(actionColumns.filter(c => c.defaultForComplianceReport));\r\n }\r\n\r\n newExportColumns.sort(sortByComplianceReport);\r\n setExportColums(newExportColumns.map((c, index) => { return { seq: index, definition: c }; }));\r\n\r\n }, [exportUsers, exportDocuments]);\r\n\r\n const [exportResults, setExportResults] = useState(null as api.UsersDocumentsResult | null);\r\n\r\n const [allUsers, setAllUsers] = useState([] as api.User[]);\r\n const [selectAllUsers, setSelectAllUsers] = useState(false);\r\n const [usersByNameFilter, setUsersByNameFilter] = useState(\"\");\r\n const [usersByNameExpanded, setUsersByNameExpanded] = useState(false);\r\n\r\n const [usersInMyTeam, setUsersInMyTeam] = useState([] as api.User[]);\r\n const [usersInMyTeamFilter, setUsersInMyTeamFilter] = useState(\"\");\r\n const [usersInMyTeamListExpanded, setUsersInMyTeamListExpanded] = useState(false);\r\n\r\n const [allSupervisors, setAllSupervisors] = useState([] as api.User[]);\r\n const [selectedSupervisors, setSelectedSupervisors] = useState([] as api.User[]);\r\n const [usersBySupervisorFilter, setUsersBySupervisorFilter] = useState(\"\");\r\n const [usersBySupervisorExpanded, setUsersBySupervisorExpanded] = useState(false);\r\n\r\n const [allDepartments, setAllDepartments] = useState([] as string[]);\r\n const [selectedDepartments, setSelectedDepartments] = useState([] as string[]);\r\n const [usersByDepartmentFilter, setUsersByDepartmentFilter] = useState(\"\");\r\n const [usersByDepartmentExpanded, setUsersByDepartmentExpanded] = useState(false);\r\n\r\n const [selectedUserStatuses, setSelectedUserStatuses] = useState([] as string[]);\r\n const [userStatuses, setUserStatuses] = useState([] as string[]);\r\n\r\n const [allDocuments, setAllDocuments] = useState([] as api.Document[]);\r\n const [selectAllDocuments, setSelectAllDocuments] = useState(false);\r\n\r\n const [documentsByNameFilter, setDocumentsByNameFilter] = useState(\"\");\r\n const [documentsByNameExpanded, setDocumentsByNameExpanded] = useState(false);\r\n\r\n const [documentStatuses, setDocumentStatuses] = useState([] as CleverString[]);\r\n const [selectedDocumentStatuses, setSelectedDocumentStatuses] = useState([] as CleverString[]);\r\n\r\n const [documentTypes, setDocumentTypes] = useState([] as api.DocumentType[]);\r\n const [selectedDocumentTypes, setSelectedDocumentTypes] = useState([] as api.DocumentType[]);\r\n const [documentsByTypeFilter, setDocumentsTypeFilter] = useState(\"\");\r\n const [documentsByTypeExpanded, setDocumentsByTypeExpanded] = useState(false);\r\n\r\n const [allPublishers, setAllPublishers] = useState([] as api.User[]);\r\n const [selectedPublishers, setSelectedPublishers] = useState([] as api.User[]);\r\n const [documentsByPublisherFilter, setDocumentsPublisherFilter] = useState(\"\");\r\n const [documentsByPublisherExpanded, setDocumentsByPublisherExpanded] = useState(false);\r\n\r\n const [publishedDateFrom, setPublishedDateFrom] = useState(null as Date | null);\r\n const [publishedDateTo, setPublishedDateTo] = useState(null as Date | null);\r\n\r\n const setPublishedDateRange = (dateFrom: Date | null, dateTo: Date | null): void => {\r\n setPublishedDateFrom(dateFrom);\r\n setPublishedDateTo(dateTo);\r\n };\r\n\r\n const refreshDepartmentsFromResult = async (result: string[]) => {\r\n if (result) setAllDepartments(result);\r\n };\r\n\r\n const refreshUserStatusesFromResult = async (result: string[]) => {\r\n if (result) setUserStatuses(result);\r\n };\r\n\r\n const refreshDocumentStatusesFromResult = async (result: CleverString[]) => {\r\n if (result) setDocumentStatuses(result);\r\n };\r\n\r\n const refreshUsersFromResult = async (result: api.User[]) => {\r\n if (result) setAllUsers(result);\r\n };\r\n\r\n const refreshSupervisorsFromResult = async (result: api.User[]) => {\r\n if (result) setAllSupervisors(result);\r\n };\r\n\r\n\r\n const refreshPublishersFromResult = async (result: api.User[]) => {\r\n if (result) setAllPublishers(result);\r\n };\r\n\r\n const refreshUsersInMyTeamFromResult = async (result: api.User[]) => {\r\n if (result) setUsersInMyTeam(result);\r\n };\r\n\r\n const forceStateChange = () => {\r\n setStateVersion(stateVersion + 1);\r\n };\r\n\r\n const selectUsers = (items: api.User[]) => {\r\n selectUserItems(items, selectedUsers, setSelectedUsers);\r\n }\r\n\r\n const selectSupervisors = (items: api.User[]) => {\r\n selectUserItems(items, selectedSupervisors, setSelectedSupervisors);\r\n }\r\n\r\n const selectPublishers = (items: api.User[]) => {\r\n selectUserItems(items, selectedPublishers, setSelectedPublishers);\r\n }\r\n\r\n const selectUserItems = (items: api.User[], stateItems: api.User[], setter: (items: api.User[]) => void) => {\r\n const newUsers = [...new Set([...stateItems, ...items])];\r\n userFilterAdded();\r\n setter(newUsers);\r\n forceStateChange();\r\n };\r\n\r\n const deselectUsers = (items: api.User[]) => {\r\n deselectUserItems(items, selectedUsers, setSelectedUsers);\r\n }\r\n\r\n const deselectSupervisors = (items: api.User[]) => {\r\n deselectUserItems(items, selectedSupervisors, setSelectedSupervisors);\r\n }\r\n\r\n const deselectPublishers = (items: api.User[]) => {\r\n deselectUserItems(items, selectedPublishers, setSelectedPublishers);\r\n }\r\n\r\n const deselectUserItems = (items: api.User[], stateItems: api.User[], setter: (items: api.User[]) => void) => {\r\n const newUsers = [...stateItems].filter(user => !items.includes(user));\r\n userFilterAdded();\r\n setter(newUsers);\r\n forceStateChange();\r\n };\r\n\r\n const selectDocuments = (items: api.DocumentType[]) => {\r\n selectDocumentItems(items, selectedDocumentTypes, setSelectedDocumentTypes);\r\n }\r\n\r\n const selectDocumentItems = (items: api.DocumentType[], stateItems: api.DocumentType[], setter: (items: api.DocumentType[]) => void) => {\r\n const newDocs = [...new Set([...stateItems, ...items])];\r\n documentFilterAdded();\r\n setter(newDocs);\r\n forceStateChange();\r\n };\r\n\r\n const deselectDocuments = (items: api.DocumentType[]) => {\r\n deselectDocumentItems(items, selectedDocumentTypes, setSelectedDocumentTypes);\r\n }\r\n\r\n const deselectDocumentItems = (items: api.DocumentType[], stateItems: api.DocumentType[], setter: (items: api.DocumentType[]) => void) => {\r\n const newDocs = [...stateItems].filter(user => !items.includes(user));\r\n documentFilterAdded();\r\n setter(newDocs);\r\n forceStateChange();\r\n };\r\n\r\n const refreshDocumentTypesFromResult = async (result: api.DocumentType[]) => {\r\n if (result) {\r\n // populate the sub types\r\n for (var t = 0; t < result.length; t++) {\r\n result[t].subTypes = result.filter(r => { return r.parentId === result[t].id; });\r\n }\r\n\r\n // set the list to the root notes\r\n setDocumentTypes(result.filter(r => { return r.parentId === null }));\r\n }\r\n };\r\n\r\n const refreshDocumentsFromServer = async (result: api.Document[]) => {\r\n if (result) {\r\n setAllDocuments(result);\r\n\r\n if (selectedDocuments.length > 0) {\r\n const currentDocumentIds = selectedDocuments.map(d => d.id);\r\n\r\n // re-select the documents using the IDs\r\n setSelectedDocuments(result.filter(d => currentDocumentIds.indexOf(d.id) > -1));\r\n }\r\n }\r\n };\r\n\r\n interface IRemoteUpdate {\r\n getData: () => Promise;\r\n processData: (result: any[] | null) => void;\r\n };\r\n\r\n const remoteUpdates = [\r\n { getData: api.getDocumentTypes, processData: refreshDocumentTypesFromResult },\r\n { getData: api.getDocumentStatuses, processData: refreshDocumentStatusesFromResult },\r\n { getData: api.getDepartments, processData: refreshDepartmentsFromResult },\r\n { getData: api.getUserStatuses, processData: refreshUserStatusesFromResult },\r\n { getData: api.getUsers, processData: refreshUsersFromResult },\r\n { getData: api.getSupervisors, processData: refreshSupervisorsFromResult },\r\n { getData: api.getPublishers, processData: refreshPublishersFromResult },\r\n { getData: api.getUsersSupervisedByCurrentUser, processData: refreshUsersInMyTeamFromResult },\r\n { getData: api.getAllDocuments, processData: refreshDocumentsFromServer }\r\n ] as IRemoteUpdate[];\r\n\r\n const processRemoteResults = (results: PromiseSettledResult[]) => {\r\n results.forEach((result, i) => {\r\n if (result.status === \"fulfilled\" && result.value != null) {\r\n remoteUpdates[i].processData(result.value);\r\n }\r\n else {\r\n const errorMessage = `error retrieving ${remoteUpdates[i].getData.name}`;\r\n console.error(errorMessage);\r\n msgBox(errorMessage);\r\n }\r\n });\r\n\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n\r\n const mount = async () => {\r\n let results = await Promise.allSettled(remoteUpdates.map(r => r.getData()));\r\n if (mounted && results) {\r\n processRemoteResults(results);\r\n }\r\n };\r\n\r\n mount();\r\n\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n const getVisibleColumns = () => {\r\n return exportColumns\r\n .filter(xc => {\r\n if (exportUsers && userColumns.findIndex(uc => uc.name === xc.definition.name) > -1) {\r\n return true\r\n }\r\n\r\n if (exportDocuments && documentColumns.findIndex(uc => uc.name === xc.definition.name) > -1) {\r\n return true\r\n }\r\n\r\n if (exportUsers && exportDocuments && actionColumns.findIndex(uc => uc.name === xc.definition.name) > -1) {\r\n return true\r\n }\r\n\r\n return false;\r\n });\r\n };\r\n\r\n const getExportFilter = (page: number) => {\r\n if (\r\n // user filters\r\n !selectAllUsers\r\n && selectedUsers.length === 0\r\n && selectedSupervisors.length === 0\r\n && selectedUserStatuses.length === 0\r\n && selectedDepartments.length === 0\r\n\r\n // document filters\r\n && !selectAllDocuments\r\n && selectedDocuments.length === 0\r\n && selectedDocumentTypes.length === 0\r\n && selectedDocumentStatuses.length === 0\r\n && selectedPublishers.length === 0\r\n && publishedDateFrom == null\r\n && publishedDateTo == null\r\n ) {\r\n confirm(\"You haven't selected any data. Please make a selection to run a report.\", [\"OK\"], \"OK\");\r\n return null;\r\n }\r\n\r\n if (exportColumns.length === 0) {\r\n confirm(\"You haven't selected any fields. Please make a selection to run a report.\", [\"OK\"], \"OK\");\r\n return null;\r\n }\r\n\r\n return {\r\n users: exportUsers ? {\r\n ids: selectedUsers.map(u => u.id),\r\n supervisorIds: selectedSupervisors.map(s => s.id),\r\n statuses: selectedUserStatuses,\r\n departments: selectedDepartments,\r\n employeeTypes: []\r\n } : null,\r\n documents: exportDocuments ? {\r\n ids: selectedDocuments.map(u => u.id),\r\n typeIds: selectedDocumentTypes.map(dt => dt.id),\r\n statuses: selectedDocumentStatuses,\r\n publishedFromDate: publishedDateFrom,\r\n publishedToDate: publishedDateTo,\r\n publisherIds: selectedPublishers.map(p => p.id)\r\n } : null,\r\n pageSize: pageSize,\r\n pageNumber: page,\r\n sort: sortOrder,\r\n fileType: \"CSV\",\r\n exportColumns: getVisibleColumns().map(c => { return { name: c.definition.name, title: c.definition.title } as api.ExportColumn })\r\n } as api.UsersDocumentsFilter;\r\n };\r\n\r\n const downloadExportResults = async () => {\r\n if (exportState === \"ready\") {\r\n const filter = getExportFilter(1);\r\n\r\n if (filter) {\r\n setExportState(\"busy\");\r\n\r\n // set the pageSize to zero, so that we get all of the results\r\n filter.pageSize = 0;\r\n\r\n api.downloadResults(filter)\r\n .then(file => {\r\n setExportState(\"ready\");\r\n blobDownload(file);\r\n })\r\n .catch(e => {\r\n const message = (e instanceof RangeError) ? e.message : \"Error fetching data. \";\r\n confirm(message, [\"Close\"], \"Close\");\r\n setExportState(\"ready\");\r\n });\r\n }\r\n }\r\n };\r\n\r\n const refreshExportResults = async (page: number) => {\r\n if (exportState === \"ready\") {\r\n setPageNumber(page);\r\n\r\n const filter = getExportFilter(page);\r\n\r\n if (filter) {\r\n setExportState(\"busy\");\r\n\r\n api.getUsersDocuments(filter)\r\n .then(result => {\r\n setExportState(\"ready\");\r\n setExportResults(result);\r\n if (result.totalResults > MaxResultsPerReport) {\r\n msgBox(<>\r\n
Resulting data set too large.
\r\n
Select less data or download full extract.
\r\n );\r\n }\r\n })\r\n .catch(e => {\r\n const message = (e instanceof RangeError) ? e.message : \"Error fetching data. \";\r\n confirm(message, [\"Close\"], \"Close\");\r\n setExportState(\"ready\");\r\n });\r\n }\r\n }\r\n };\r\n\r\n const loadUser = (id: number) => {\r\n return userAdminApi.getAsync(id);\r\n };\r\n\r\n const saveUser = (userToSave: AdminUserModel) => {\r\n return userAdminApi.updateAsync(userToSave);\r\n };\r\n\r\n const msgBox = (msg: ReactNode) => {\r\n setConfirmProps({\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultOption: \"OK\",\r\n setResult: result => {\r\n setConfirmProps(null);\r\n }\r\n });\r\n };\r\n\r\n const userUpdated = (usr: AdminUserModel) => {\r\n // close the dialog\r\n setUserInfoProps(null);\r\n\r\n //tell the user it saved\r\n msgBox(\"Your request has been successfully completed.\");\r\n\r\n // throwing an error at this stage, new functionality. can deal with it later if someone needs it fixed\r\n //refreshExportResults(pageNumber);\r\n };\r\n\r\n const showUserInfo = (userDoc: api.UserDocument) => {\r\n const userId = userDoc?.user?.id;\r\n\r\n if (userId) {\r\n setUserInfoProps({\r\n className: \"user-information-dialog\",\r\n body:\r\n loadUser(userId)}\r\n save={saveUser}\r\n setConfirmationProps={setConfirmProps}\r\n closeDialog={() => setUserInfoProps(null)}\r\n onDataChanged={userUpdated}\r\n />\r\n });\r\n }\r\n };\r\n\r\n const [userColumns] = useState([\r\n { title: \"Name\", name: \"user.fullName\", selected: false, defaultForComplianceReport: 1, infoDialog: showUserInfo },\r\n { title: \"Employee type\", name: \"user.employeeType\", selected: false },\r\n { title: \"Company name\", name: \"user.companyName\", selected: false },\r\n { title: \"Supervisor\", name: \"user.supervisor\", selected: false, defaultForComplianceReport: 3 },\r\n { title: \"Title\", name: \"user.jobTitle\", selected: false },\r\n { title: \"Role\", name: \"user.role\", selected: false },\r\n { title: \"Department\", name: \"user.department\", selected: false },\r\n { title: \"Division\", name: \"user.division\", selected: false },\r\n { title: \"City\", name: \"user.city\", selected: false },\r\n { title: \"Location\", name: \"user.officeLocation\", selected: false },\r\n { title: \"User status\", name: \"user.status\", selected: false, defaultForComplianceReport: 5 },\r\n { title: \"Last login\", name: \"user.lastLoginDate\", selected: false, formatter: dateToStringFormatter },\r\n { title: \"Email\", name: \"user.email\", selected: false, defaultForComplianceReport: 6, formatter: emailFormatter },\r\n { title: \"Mobile\", name: \"user.mobile\", selected: false, formatter: emailFormatter }\r\n ] as api.ExportColumn[]);\r\n\r\n const [documentColumns] = useState([\r\n { title: \"Document title\", name: \"document.metadata.title\", selected: false, defaultForComplianceReport: 7 },\r\n { title: \"Document number\", name: \"document.metadata.documentNumber\", selected: false, defaultForComplianceReport: 8 },\r\n { title: \"Document type\", name: \"document.type\", selected: false, defaultForComplianceReport: 9 },\r\n { title: \"Document sub-type\", name: \"document.subType\", selected: false },\r\n { title: \"Document status\", name: \"document.status\", selected: false, defaultForComplianceReport: 10 },\r\n { title: \"Version number\", name: \"document.metadata.version\", selected: false },\r\n { title: \"Publisher\", name: \"document.uploadedBy\", selected: false },\r\n { title: \"Published date\", name: \"document.metadata.publishDate\", selected: false, formatter: dateToStringFormatter, defaultForComplianceReport: 11 },\r\n { title: \"Effective date\", name: \"document.metadata.effectiveFromDate\", selected: false, formatter: dateToStringFormatter },\r\n { title: \"Expiry date\", name: \"document.metadata.expiryDate\", selected: false, formatter: dateToStringFormatter },\r\n { title: \"Last updated by\", name: \"document.metadata.modifiedBy\", selected: false },\r\n { title: \"Date of last update\", name: \"document.metadata.modifiedDate\", selected: false, formatter: dateToStringFormatter },\r\n { title: \"Related documents\", name: \"document.metadata.relatedDocuments\", selected: false, formatter: stringArrayToString },\r\n { title: \"Release notes\", name: \"document.metadata.releaseNotes\", selected: false },\r\n { title: \"Rescind Reason\", name: \"document.metadata.rescindDocumentReason\", selected: false },\r\n { title: \"File name\", name: \"document.fileName\", selected: false },\r\n { title: \"Acknowledgement\", name: \"document.metadata.requiresAcknowledgement\", selected: false, formatter: booleanToYesNoFormatter }\r\n ] as api.ExportColumn[]);\r\n\r\n const [actionColumns] = useState([\r\n { title: \"Last action\", name: \"action.lastAction\", selected: false, defaultForComplianceReport: 12 },\r\n { title: \"Notified date\", name: \"action.notifyDate\", selected: false, formatter: dateToStringFormatter, defaultForComplianceReport: 13 },\r\n { title: \"Viewed date\", name: \"action.viewDate\", selected: false, formatter: dateToStringFormatter, defaultForComplianceReport: 14 },\r\n { title: \"Acknowledged date\", name: \"action.acknowledgedDate\", selected: false, formatter: dateToStringFormatter, defaultForComplianceReport: 15 },\r\n { title: \"Clarification requested date\", name: \"action.clarificationDate\", selected: false, formatter: dateToStringFormatter, defaultForComplianceReport: 16 },\r\n { title: \"Feedback message\", name: \"action.feedbackText\", selected: false, defaultForComplianceReport: 16 },\r\n { title: \"Clarification request message\", name: \"action.clarificationText\", selected: false, defaultForComplianceReport: 18 }\r\n ] as api.ExportColumn[]);\r\n\r\n const [exportColumns, setExportColums] = useState([] as ISelectedExportColumn[]);\r\n\r\n const [sortOrder, setSortOrder] = useState([] as api.ISortConfig[]);\r\n useEffect(() => {\r\n if (exportResults && exportResults.totalResults > 0) {\r\n refreshExportResults(pageNumber);\r\n }\r\n }, [sortOrder]);\r\n\r\n const [pageSize, setPageSize] = useState(20);\r\n const [pageNumber, setPageNumber] = useState(1);\r\n\r\n const [confirmProps, setConfirmProps] = useState(null as IConfirmProps | null);\r\n const [userInfoProps, setUserInfoProps] = useState(null as IModalBoxProps | null);\r\n\r\n const [userFilterTab, setUserFilterTab] = useState(0);\r\n const [documentFilterTab, setDocumentFilterTab] = useState(0);\r\n\r\n const toggleItem = (\r\n item: T,\r\n arr: T[],\r\n comparerPredicate: (value: T) => boolean,\r\n setter: (value: T[]) => void\r\n ): boolean => {\r\n const idx = arr.findIndex(comparerPredicate);\r\n\r\n var result = false;\r\n\r\n if (idx === -1) {\r\n result = true;\r\n arr.push(item);\r\n } else {\r\n arr.splice(idx, 1);\r\n }\r\n\r\n setter(arr);\r\n forceStateChange();\r\n\r\n return result;\r\n };\r\n\r\n // when the user changes a user filter, turn on exporting users, and turn off \"Select All Users\"\r\n const userFilterAdded = () => {\r\n setExportUsers(true);\r\n setExportResults(null);\r\n\r\n if (selectAllUsers) {\r\n setSelectAllUsers(false);\r\n }\r\n }\r\n\r\n const toggleUser = (usr: api.User) => {\r\n if (toggleItem(usr, selectedUsers, u => { return u.id === usr.id }, setSelectedUsers) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n const toggleDepartment = (dpt: string): void => {\r\n if (toggleItem(dpt, selectedDepartments, d => { return d === dpt }, setSelectedDepartments) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n const toggleSupervisor = (usr: api.User): void => {\r\n if (toggleItem(usr, selectedSupervisors, u => { return u.id === usr.id }, setSelectedSupervisors) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n const toggleUserStatus = (status: string) => {\r\n if (toggleItem(status, selectedUserStatuses, us => { return us === status }, setSelectedUserStatuses) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n // when the user changes a document filter, turn on exporting documents, and turn off \"Select All Documents\"\r\n const documentFilterAdded = () => {\r\n setExportDocuments(true);\r\n setExportResults(null);\r\n\r\n if (selectAllDocuments) {\r\n setSelectAllDocuments(false);\r\n }\r\n }\r\n\r\n const toggleDocument = (doc: api.Document): void => {\r\n if (toggleItem(doc, selectedDocuments, d => { return d.id === doc.id }, setSelectedDocuments) === true) {\r\n documentFilterAdded();\r\n }\r\n };\r\n\r\n const toggleDocumentStatus = (status: CleverString) => {\r\n if (toggleItem(status, selectedDocumentStatuses, s => { return s === status }, setSelectedDocumentStatuses) === true) {\r\n documentFilterAdded();\r\n }\r\n };\r\n\r\n const toggleDocumentType = (type: api.DocumentType) => {\r\n if (toggleItem(type, selectedDocumentTypes, dt => { return dt.id === type.id }, setSelectedDocumentTypes) === true) {\r\n documentFilterAdded();\r\n }\r\n };\r\n\r\n const togglePublisher = (usr: api.User) => {\r\n if (toggleItem(usr, selectedPublishers, p => { return p.id === usr.id }, setSelectedPublishers) === true) {\r\n documentFilterAdded();\r\n }\r\n };\r\n\r\n const toggleExportColumn = (definition: api.ExportColumn) => {\r\n const idx: number = exportColumns.findIndex(c => { return c.definition.name == definition.name; });\r\n\r\n if (idx === -1) {\r\n // add the column\r\n exportColumns.push({\r\n seq: exportColumns.length,\r\n definition: definition\r\n })\r\n\r\n // update the state\r\n setExportColums(exportColumns);\r\n } else {\r\n // remove the column\r\n const cols = exportColumns;\r\n cols.splice(idx, 1);\r\n\r\n // update the sequence numbers for any subsequent columns, so that if we add another it we dont get duplicate sequence numbers\r\n for (var x = idx; x < cols.length; x++) {\r\n cols[x].seq = x;\r\n }\r\n\r\n // update the state with the refined list\r\n setExportColums(cols);\r\n }\r\n\r\n forceStateChange();\r\n };\r\n\r\n const userNameItemFilter = (item: api.User, filterText: string) => {\r\n const lcName = filterText.toLowerCase();\r\n\r\n return (\r\n (item.fullName).toLowerCase().indexOf(lcName) > -1\r\n || (item.email?.toLowerCase().indexOf(lcName) > -1)\r\n );\r\n };\r\n\r\n const userNameFilter = (name: string, users?: api.User[]) => {\r\n if (!users) {\r\n return [] as api.User[];\r\n }\r\n\r\n return users.filter(u => userNameItemFilter(u, name));\r\n };\r\n\r\n const documentNameItemFilter = (doc: api.Document, filterText: string) => {\r\n const lcName = filterText?.toLowerCase();\r\n\r\n return (\r\n doc.metadata.title.toLowerCase().indexOf(lcName) > -1\r\n || doc.metadata.documentNumber.toLowerCase().indexOf(lcName) > -1\r\n || doc.fileName.toLowerCase().indexOf(lcName) > -1\r\n || doc.type.toLowerCase().indexOf(lcName) > -1\r\n || doc.subType?.toLowerCase().indexOf(lcName) > -1\r\n );\r\n }\r\n\r\n const documentNameFilter = (name: string, documents?: api.Document[]) => {\r\n if (!documents) {\r\n return [] as api.Document[];\r\n }\r\n\r\n const result = documents.filter(doc => documentNameItemFilter(doc, name));\r\n\r\n return result;\r\n };\r\n\r\n const documentTypeNameContains = (item: api.DocumentType, name: string): boolean => {\r\n const lcFilterText = name.toLowerCase();\r\n\r\n if (item.name.toLowerCase().indexOf(lcFilterText) > -1) {\r\n return true;\r\n }\r\n\r\n if (item.subTypes) {\r\n for (var s = 0; s < item.subTypes.length; s++) {\r\n if (documentTypeNameContains(item.subTypes[s], lcFilterText)) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const documentTypeNameFilter = (name: string, items?: api.DocumentType[]) => {\r\n if (!items) {\r\n return [] as api.DocumentType[];\r\n }\r\n\r\n const result = items.filter(item => documentTypeNameContains(item, name));\r\n\r\n return result;\r\n };\r\n\r\n const stringItemFilter = (item: string, filterText: string) => {\r\n return item?.toLowerCase().indexOf(filterText.toLowerCase()) > -1;\r\n };\r\n\r\n const filterStringArray = (name: string, items?: string[]) => {\r\n if (!items) return [] as string[];\r\n\r\n const result = items.filter(v => stringItemFilter(v, name));\r\n\r\n return result;\r\n };\r\n\r\n const confirm = async (message: string, opts?: string[], defaultOption?: string, cancelOption?: string): Promise => {\r\n return new Promise((resolve) => {\r\n setConfirmProps({\r\n message: message,\r\n options: opts ?? [\"OK\", \"Cancel\"],\r\n defaultOption: defaultOption,\r\n setResult: (value) => {\r\n setConfirmProps({} as IConfirmProps);\r\n resolve(value);\r\n }\r\n });\r\n });\r\n };\r\n\r\n const clearUserFilters = () => {\r\n setSelectedUsers([]);\r\n setSelectAllUsers(false);\r\n setSelectedUserStatuses([]);\r\n setSelectedDepartments([]);\r\n setSelectedSupervisors([]);\r\n };\r\n\r\n const setSelectAllUsersAndClearSelections = (value: boolean) => {\r\n if (value) {\r\n confirm(\"Are you sure you want to include all users? Including all users will reset all user filters.\", [\"All Users\", \"Cancel\"], \"All Users\").then(result => {\r\n if (result === \"All Users\") {\r\n setSelectedUsers([]);\r\n setSelectedUserStatuses([]);\r\n setSelectedDepartments([]);\r\n setSelectedSupervisors([]);\r\n\r\n setSelectAllUsers(true);\r\n setExportUsers(true);\r\n } else {\r\n setSelectAllUsers(false);\r\n }\r\n });\r\n } else {\r\n setSelectAllUsers(value);\r\n }\r\n setExportResults(null);\r\n };\r\n\r\n const clearDocumentFilters = () => {\r\n setSelectedDocuments([]);\r\n setSelectAllDocuments(false);\r\n setSelectedDocumentStatuses([]);\r\n setSelectedDocumentTypes([]);\r\n setSelectedPublishers([]);\r\n setPublishedDateFrom(null);\r\n setPublishedDateTo(null);\r\n };\r\n\r\n const setSelectAllDocumentsAndClearSelections = (value: boolean) => {\r\n if (value) {\r\n confirm(\"Are you sure you want to include all documents? Including all users will reset all document filters.\", [\"All Documents\", \"Cancel\"], \"All Documents\").then(result => {\r\n if (result === \"All Documents\") {\r\n setSelectedDocuments([]);\r\n setSelectedDocumentStatuses([]);\r\n setSelectedDocumentTypes([]);\r\n setSelectedPublishers([]);\r\n setPublishedDateFrom(null);\r\n setPublishedDateTo(null);\r\n\r\n setSelectAllDocuments(true);\r\n setExportDocuments(true);\r\n } else {\r\n setSelectAllDocuments(false);\r\n }\r\n });\r\n } else {\r\n setSelectAllDocuments(value);\r\n }\r\n setExportResults(null);\r\n };\r\n\r\n const userFiltersExist = () => {\r\n return (selectAllUsers\r\n || selectedUsers.length > 0\r\n || selectedSupervisors.length > 0\r\n || selectedDepartments.length > 0\r\n || selectedUserStatuses.length > 0);\r\n };\r\n\r\n const toggleExportUsers = () => {\r\n if (exportUsers && userFiltersExist()) {\r\n\r\n confirm(\r\n \"Disabling user export will clear all user filters, are you sure?\",\r\n [\"Disable user export\", \"Cancel\"],\r\n \"Disable user export\"\r\n ).then(\r\n result => {\r\n if (result !== \"Cancel\") {\r\n clearUserFilters();\r\n setExportUsers(false);\r\n }\r\n }\r\n );\r\n } else {\r\n setExportUsers(!exportUsers);\r\n }\r\n };\r\n\r\n const documentFiltersExist = () => {\r\n return (selectAllDocuments\r\n || selectedDocuments.length > 0\r\n || selectedDocumentTypes.length > 0\r\n || selectedDocumentStatuses.length > 0\r\n || selectedPublishers.length > 0\r\n || publishedDateFrom !== null\r\n || publishedDateTo !== null);\r\n };\r\n\r\n const toggleExportDocuments = () => {\r\n if (exportDocuments && documentFiltersExist()) {\r\n confirm(\r\n \"Disabling document export will clear all document filters, are you sure?\",\r\n [\"Disable document export\", \"Cancel\"],\r\n \"Disable document export\"\r\n ).then(\r\n result => {\r\n if (result !== \"Cancel\") {\r\n clearDocumentFilters();\r\n setExportDocuments(false);\r\n }\r\n }\r\n );\r\n } else {\r\n setExportDocuments(!exportDocuments);\r\n }\r\n };\r\n\r\n const downloadComplianceReport = async () => {\r\n api.downloadFullComplianceReport()\r\n .then(file => {\r\n blobDownload(file);\r\n })\r\n .catch((e) => {\r\n const message = (e instanceof RangeError) ? e.message : \"Error fetching data. \";\r\n confirm(message, [\"Close\"], \"Close\");\r\n });\r\n };\r\n\r\n const allExportTypeCheckedValue = (columns: api.ExportColumn[]) => {\r\n const selectedColumnCount = exportColumns\r\n .map(selCol => selCol.definition)\r\n .filter(exportCol => columns.includes(exportCol))\r\n .length;\r\n\r\n if (selectedColumnCount === 0) {\r\n return false;\r\n }\r\n\r\n if (selectedColumnCount === columns.length) {\r\n return true;\r\n }\r\n\r\n return 'partial';\r\n }\r\n\r\n const selectColumns = (columns: api.ExportColumn[]) => {\r\n let newExportColumns = [...exportColumns];\r\n columns.forEach(exportCol => {\r\n if (!newExportColumns.map(selCol => selCol.definition).includes(exportCol)) {\r\n newExportColumns.push({\r\n seq: newExportColumns.length,\r\n definition: exportCol\r\n });\r\n }\r\n });\r\n setExportColums(newExportColumns);\r\n }\r\n\r\n const unselectColumns = (selectedColumns: api.ExportColumn[]) => {\r\n setExportColums(exportColumns.filter(selCol => !selectedColumns.includes(selCol.definition)));\r\n }\r\n\r\n const toggleAllExportTypeChecked = (columns: api.ExportColumn[]) => {\r\n const selectedColumns = exportColumns\r\n .map(selCol => selCol.definition)\r\n .filter(exportCol => columns.includes(exportCol));\r\n\r\n // All columns currently selected, unselect all from this group\r\n if (selectedColumns.length === columns.length) {\r\n unselectColumns(selectedColumns);\r\n return;\r\n }\r\n\r\n // Empty or partial selection, select all from this group not already selected\r\n selectColumns(columns);\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 Download full report\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n Build a report\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Add data\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n User\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n { setSelectAllUsersAndClearSelections(!selectAllUsers); }}>Select all users\r\n
\r\n
or
\r\n
\r\n \r\n { setUserFilterTab(v); }}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n dataSource={allUsers}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n listItemType={UserListItem}\r\n filterText={usersByNameFilter}\r\n setFilterText={setUsersByNameFilter}\r\n expanded={usersByNameExpanded}\r\n setExpanded={setUsersByNameExpanded}\r\n buildKey={item => item.id}\r\n filter={userNameFilter}\r\n toggleSelected={toggleUser}\r\n selectItems={selectUsers}\r\n deselectItems={deselectUsers}\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedUsers} />\r\n \r\n\r\n \r\n \r\n listItemType={UserListItem}\r\n filterText={usersInMyTeamFilter}\r\n setFilterText={setUsersInMyTeamFilter}\r\n expanded={usersInMyTeamListExpanded}\r\n setExpanded={setUsersInMyTeamListExpanded}\r\n buildKey={item => item.id}\r\n filter={userNameFilter}\r\n itemFilter={userNameItemFilter}\r\n dataSource={usersInMyTeam}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n toggleSelected={toggleUser}\r\n selectItems={selectUsers}\r\n deselectItems={deselectUsers}\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedUsers} />\r\n \r\n\r\n \r\n \r\n listItemType={UserListItem}\r\n filterText={usersBySupervisorFilter}\r\n setFilterText={setUsersBySupervisorFilter}\r\n expanded={usersBySupervisorExpanded}\r\n setExpanded={setUsersBySupervisorExpanded}\r\n buildKey={item => item.id}\r\n filter={userNameFilter}\r\n itemFilter={userNameItemFilter}\r\n dataSource={allSupervisors}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n toggleSelected={toggleSupervisor}\r\n selectItems={selectSupervisors}\r\n deselectItems={deselectSupervisors}\r\n noResultsMessage=\"No supervisors found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedSupervisors} />\r\n \r\n\r\n \r\n \r\n listItemType={StringListItem}\r\n filterText={usersByDepartmentFilter}\r\n setFilterText={setUsersByDepartmentFilter}\r\n expanded={usersByDepartmentExpanded}\r\n setExpanded={setUsersByDepartmentExpanded}\r\n dataSource={allDepartments}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n buildKey={item => item}\r\n filter={filterStringArray}\r\n itemFilter={stringItemFilter}\r\n toggleSelected={toggleDepartment}\r\n noResultsMessage=\"No departments found\"\r\n selected={selectedDepartments} />\r\n \r\n\r\n \r\n \r\n items={userStatuses}\r\n toggle={toggleUserStatus}\r\n buildKey={item => item}\r\n {...standardGridSizes}\r\n isSelected={item => selectedUserStatuses.indexOf(item) > -1}\r\n content={item => item}\r\n />\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n  \r\n {selectAllUsers &&\r\n { setSelectAllUsersAndClearSelections(false); }} label={<>User: All}>\r\n }\r\n  \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n Document\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n { setSelectAllDocumentsAndClearSelections(!selectAllDocuments); }}>Select all documents\r\n
\r\n\r\n
or
\r\n
\r\n \r\n { setDocumentFilterTab(v); }}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n >\r\n listItemType={DocumentListItem}\r\n filterText={documentsByNameFilter}\r\n setFilterText={setDocumentsByNameFilter}\r\n expanded={documentsByNameExpanded}\r\n setExpanded={setDocumentsByNameExpanded}\r\n buildKey={item => item.id}\r\n dataSource={allDocuments}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n filter={documentNameFilter}\r\n itemFilter={documentNameItemFilter}\r\n toggleSelected={toggleDocument}\r\n noResultsMessage=\"No documents found\"\r\n filterTextPlaceholder=\"Enter document title, document number or keyword\"\r\n selected={selectedDocuments} />\r\n \r\n\r\n \r\n \r\n listItemType={DocumentTypeListItem}\r\n filterText={documentsByTypeFilter}\r\n setFilterText={setDocumentsTypeFilter}\r\n expanded={documentsByTypeExpanded}\r\n setExpanded={setDocumentsByTypeExpanded}\r\n buildKey={item => item.id}\r\n dataSource={documentTypes}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n filter={documentTypeNameFilter}\r\n itemFilter={documentTypeNameContains}\r\n toggleSelected={toggleDocumentType}\r\n selectItems={selectDocuments}\r\n deselectItems={deselectDocuments}\r\n noResultsMessage=\"No documents types found\"\r\n selected={selectedDocumentTypes} />\r\n \r\n\r\n \r\n \r\n items={documentStatuses}\r\n toggle={toggleDocumentStatus}\r\n buildKey={item => item.toString()}\r\n {...standardGridSizes}\r\n isSelected={item => selectedDocumentStatuses.indexOf(item) > -1}\r\n content={item => { return item.toSentenceCase(); }}\r\n />\r\n \r\n\r\n \r\n {\r\n setPublishedDateRange(f ? f : null, t ? t : null);\r\n }}\r\n />\r\n \r\n\r\n \r\n \r\n listItemType={UserListItem}\r\n filterText={documentsByPublisherFilter}\r\n setFilterText={setDocumentsPublisherFilter}\r\n expanded={documentsByPublisherExpanded}\r\n setExpanded={setDocumentsByPublisherExpanded}\r\n buildKey={item => item.id}\r\n dataSource={allPublishers}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n filter={userNameFilter}\r\n toggleSelected={togglePublisher}\r\n selectItems={selectPublishers}\r\n deselectItems={deselectPublishers}\r\n noResultsMessage=\"No publishers found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedPublishers} />\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n {selectAllDocuments &&\r\n { setSelectAllDocumentsAndClearSelections(false); }} label={<>Document: All}>\r\n }\r\n  \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Customise report fields\r\n
\r\n
\r\n\r\n {exportUsers && <>\r\n
\r\n
\r\n toggleAllExportTypeChecked(userColumns)} />\r\n \r\n User Fields\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n {exportDocuments && <>\r\n
\r\n
\r\n toggleAllExportTypeChecked(documentColumns)} />\r\n \r\n Document Fields\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n {exportUsers && exportDocuments && <>\r\n
\r\n
\r\n toggleAllExportTypeChecked(actionColumns)} />\r\n \r\n Action Fields\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n {(exportUsers || exportDocuments) &&\r\n
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n {((exportState === 'busy')) &&\r\n
\r\n
We're fetching your data...
\r\n
\r\n }\r\n\r\n {(exportUsers || exportDocuments) && exportResults &&\r\n <>\r\n
\r\n
\r\n \r\n Results\r\n
\r\n
\r\n {exportResults.totalResults == 0 ?\r\n
No results are available for the current report
\r\n :\r\n <>\r\n
\r\n
\r\n { toggleExportColumn(col); }}\r\n setSortOrder={\r\n (arr) => {\r\n setSortOrder(arr);\r\n forceStateChange();\r\n }\r\n } />\r\n
\r\n
\r\n
\r\n
\r\n MaxResultsPerReport}\r\n onClick={downloadExportResults}\r\n >\r\n {exportResults.totalResults > MaxResultsPerReport ?\r\n <>Export too large\r\n :\r\n <>Export report in .csv format\r\n }\r\n \r\n
\r\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 UserDocumentReport;\r\n","\r\nexport interface FatigueAssessmentQuestion {\r\n key: string,\r\n value: string,\r\n altValue?: string,\r\n tooltip?: string\r\n}\r\n\r\nexport const FatigueAssessmentQuestions = {\r\n hoursSleep24Hrs: {\r\n key: 'hoursSleep24Hrs',\r\n value: '1. How many hours of sleep have you had in the last 24 hours?'\r\n },\r\n hoursSleep48Hrs: {\r\n key: 'hoursSleep48Hrs',\r\n value: '2. How many hours of sleep have you had in the last 48 hours?'\r\n },\r\n currentHoursAwake: {\r\n key: 'currentHoursAwake',\r\n value: '3. How many hours have you been awake (or how long will you be awake by the end of your shift)?'\r\n },\r\n feelAlert: {\r\n key: 'feelAlert',\r\n value: '4. Do you feel alert?'\r\n },\r\n alcoholicDrinks: {\r\n key: 'alcoholicDrinks',\r\n value: '5. How many alcoholic drinks did you have before your sleep?'\r\n },\r\n gender: {\r\n key: 'gender',\r\n value: '6. What is your sex?',\r\n altValue: 'Sex'\r\n },\r\n unfitSubstanceCheck: {\r\n key: 'unfitSubstanceCheck',\r\n value: '7. Are you on any medication or other substances that could cause drowsiness or cause you to be unfit for work?'\r\n },\r\n concentrationCheck: {\r\n key: 'concentrationCheck',\r\n value: '8. Do you have any stress, health problems or other personal problems that are significantly affecting your concentration and/or sleep?'\r\n },\r\n user: {\r\n key: 'user.fullname',\r\n value: 'User'\r\n },\r\n supervisor: {\r\n key: 'supervisor.fullname',\r\n value: 'Shift supervisor'\r\n },\r\n signOnLocation: {\r\n key: 'signOnLocation.name',\r\n value: 'Sign-on location'\r\n },\r\n signOnLocationId: {\r\n key: 'signOnLocationId',\r\n value: 'Sign-on location',\r\n tooltip: 'Select your shift start Depot location'\r\n },\r\n shiftStartTime: {\r\n key: 'shiftStartTime',\r\n value: 'Shift start time'\r\n },\r\n assessmentDate: {\r\n key: 'assessmentDate',\r\n value: 'Assessment completed time'\r\n },\r\n assessmentScore: {\r\n key: 'assessmentScore',\r\n value: 'Risk score'\r\n },\r\n risk: {\r\n key: 'risk',\r\n value: 'Risk rating'\r\n },\r\n onBehalfUser: {\r\n key: 'user',\r\n value: 'User',\r\n tooltip: 'Who are you submitting the on-behalf form for?'\r\n },\r\n shiftSupervisor: {\r\n key: 'supervisor',\r\n value: 'Shift supervisor',\r\n tooltip: 'Select your Shift Supervisor currently on shift TODAY'\r\n },\r\n shiftSupervisorId: {\r\n key: 'supervisorId',\r\n value: 'Shift supervisor',\r\n tooltip: 'Select your Shift Supervisor currently on shift TODAY'\r\n },\r\n partialShiftStartDate: {\r\n key: 'partialShiftStartDate',\r\n value: 'Shift start date'\r\n },\r\n partialShiftStartTime: {\r\n key: 'partialShiftStartTime',\r\n value: 'Shift start time'\r\n },\r\n onBehalfSubmitter: {\r\n key: 'onBehalfSubmitter.fullname',\r\n value: 'Fatigue Assessment On-behalf form completed by'\r\n },\r\n onBehalfReason: {\r\n key: 'onBehalfReason',\r\n value: 'Reason for submitting on-behalf'\r\n },\r\n controlsImplementedBy: {\r\n key: 'action.controlsImplementedBy.fullname',\r\n value: 'Controls implemented by',\r\n tooltip: 'Select the supervisor that applied the controls'\r\n },\r\n actionTakenGroup: {\r\n key: 'action',\r\n value: 'Action taken'\r\n },\r\n actionComment: {\r\n key: 'action.comment',\r\n value: 'Comments'\r\n },\r\n actionConfidential: {\r\n key: 'action.confidential',\r\n value: 'Mark as confidential',\r\n tooltip: 'Will this FA contain confidential comments?'\r\n },\r\n actionSupervisors: {\r\n key: 'action.affectedSupervisors',\r\n value: 'Affected supervisors',\r\n tooltip: 'Which supervisors will be able to view this FA, even if it\\'s confidential'\r\n },\r\n actionSupervisorSignature: {\r\n key: 'action.supervisorSignature',\r\n value: 'Supervisor signature'\r\n },\r\n actionAlternativeSupervisorReason: {\r\n key: 'action.alternativeSupervisorReason',\r\n value: 'Alternative supervisor reason'\r\n },\r\n privacyPolicy: {\r\n key: 'privacyPolicy',\r\n value: 'Please read and indicate your acceptance of the following declaration.
I consent to BHP collecting, using and processing my personal information to manage BHP’s safe working environment. Please see BHP’s Privacy Policy and Global Privacy Notice for BHP’s Workers for more detail about how we manage personal information.',\r\n }\r\n}\r\n\r\nexport default FatigueAssessmentQuestions;\r\n","import { http, httpGet, httpPut, httpPost } from 'shared/services/httpService';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport { Location, LocationDetail } from 'shared/models/api/models';\r\n\r\nconst basePath = '/api/location/';\r\n\r\nconst fullyQualifiedAndEncodedURL = (relativeUri: string) => {\r\n return new URL(basePath + encodeURI(relativeUri), appSettings.api.portalApi).toString();\r\n};\r\n\r\n\r\nexport const getLocations = async (): Promise => {\r\n return await httpGet(`${ fullyQualifiedAndEncodedURL(``).toString() }`);\r\n}\r\n\r\nexport const getLocationsWithDetail = async (): Promise => {\r\n return await httpGet(`${ fullyQualifiedAndEncodedURL(`details`).toString() }`);\r\n}\r\n\r\nexport const getLocationWithDetail = async (locationId: number): Promise => {\r\n return await httpGet(`${ fullyQualifiedAndEncodedURL(`details/${ locationId }`).toString() }`);\r\n}\r\n\r\nexport const updateLocationMobile = async (LocationDetail: LocationDetail): Promise => {\r\n return await httpPut(`${ fullyQualifiedAndEncodedURL(`updatemobile/${ LocationDetail.id }/${ LocationDetail.siteMobileNumber }`).toString() }`);\r\n}","import React, { useState, useEffect } from 'react';\r\nimport { isNumber } from 'util';\r\nimport { Paper, Tabs, Tab } from '@material-ui/core';\r\nimport Chip from '@material-ui/core/Chip';\r\n\r\nimport { List, IListItemProps } from 'components/ui/Lists';\r\nimport { LabelledCheckbox } from 'components/ui/LabelledCheckbox';\r\nimport { IConfirmProps } from 'components/ui/ConfirmationBox';\r\nimport { TabPanel } from 'components/ui/TabPanel';\r\nimport PortalPage from 'components/portal/PortalPage';\r\nimport { ToolTipButton } from 'components/menu/Labels';\r\nimport { FatigueAssessmentQuestions } from 'components/portal/fatigueAssessment/FatigueAssessmentQuestions'\r\n\r\nimport { FatigueAssessmentReportQuery, FatigueAssessmentStatusEnum, FatigueAssessmentRiskEnum } from 'shared/models/api/models';\r\nimport * as api from 'shared/services/reportingApi';\r\nimport * as locationApi from 'shared/services/locationApi';\r\n\r\nimport { ReactComponent as ReportingIcon } from 'assets/icons/reports-filled.svg';\r\nimport { ReactComponent as BuildCircle } from 'assets/icons/build-circle.svg';\r\nimport { ReactComponent as AddChart } from 'assets/icons/add-chart.svg';\r\n\r\nimport 'react-datepicker/dist/react-datepicker.css';\r\nimport 'components/ui/ConfirmationBox.css';\r\nimport 'components/portal/administration/administration.css';\r\nimport './Reporting.css';\r\n\r\nimport {\r\n SupervisorAccountOutlined, PersonOutlined, NearMeOutlined, MailOutline,\r\n LocationOnOutlined, AssignmentTurnedInOutlined, CancelOutlined, DateRangeOutlined, CheckOutlined\r\n} from '@material-ui/icons';\r\nimport { blobDownload } from './blobDownload';\r\nimport DateRangePicker from './DateRangePicker';\r\n\r\n\r\nexport const UserListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n {props.item.fullName}\r\n
\r\n {props.item.city &&\r\n {props.item.city}\r\n }\r\n\r\n {props.item.supervisor.length > 0 &&\r\n {props.item.supervisor}\r\n }\r\n\r\n {!props.item.city && props.item.email.length > 0 &&\r\n {props.item.email}\r\n }\r\n\r\n
\r\n
;\r\n\r\nexport const LocationListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n {props.item.name}\r\n
;\r\n\r\n\r\ninterface IChipsProps {\r\n values: T[],\r\n removeItem: (item: T) => void,\r\n prefix?: any\r\n}\r\n\r\nconst UserChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(usr =>\r\n { props.removeItem(usr); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{usr.fullName}\r\n } />\r\n )\r\n }\r\n ;\r\n\r\nconst LocationChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(usr =>\r\n { props.removeItem(usr); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{usr.name}\r\n } />\r\n )\r\n }\r\n ;\r\n\r\nconst FatigueAssessmentReport = () => {\r\n const [exportState, setExportState] = useState(\"ready\" as \"ready\" | \"busy\");\r\n const [stateVersion, setStateVersion] = useState(0);\r\n const [confirmProps, setConfirmProps] = useState(null as IConfirmProps | null);\r\n const [userFilterTab, setUserFilterTab] = useState(0);\r\n\r\n const [selectedUsers, setSelectedUsers] = useState([] as api.User[]);\r\n const [selectAllUsers, setSelectAllUsers] = useState(true);\r\n const [usersByNameFilter, setUsersByNameFilter] = useState(\"\");\r\n const [usersByNameExpanded, setUsersByNameExpanded] = useState(false);\r\n const [usersByNameSummary, setUsersByNameSummary] = useState(\"\");\r\n const [usersByName, setUsersByName] = useState([] as api.User[]);\r\n\r\n const [selectedSupervisors, setSelectedSupervisors] = useState([] as api.User[]);\r\n const [supervisorsFilter, setSupervisorsFilter] = useState(\"\");\r\n const [supervisorsExpanded, setSupervisorsExpanded] = useState(false);\r\n const [supervisorsSummary, setSupervisorsSummary] = useState(\"\");\r\n const [supervisors, setSupervisors] = useState([] as api.User[]);\r\n\r\n const [selectedLocations, setSelectedLocations] = useState([{ name: \"All\" }] as api.Location[]);\r\n const [locationsFilter, setLocationsFilter] = useState(\"\");\r\n const [locationsExpanded, setLocationsExpanded] = useState(false);\r\n const [locationsSummary, setLocationsSummary] = useState(\"\");\r\n const [locations, setLocations] = useState([] as api.Location[]);\r\n const [includeAudit, setincludeAudit] = useState(false);\r\n\r\n const [statusCompleted, setStatusCompleted] = useState(true);\r\n const [statusPending, setStatusPending] = useState(true);\r\n const [statusViolation, setStatusViolation] = useState(true);\r\n\r\n const [riskLow, setRiskLow] = useState(true);\r\n const [riskMedium, setRiskMedium] = useState(true);\r\n const [riskHigh, setRiskHigh] = useState(true);\r\n const [riskNa, setRiskNa] = useState(true);\r\n\r\n const today = new Date()\r\n today.setHours(0, 0, 0, 0);\r\n const yesterday = new Date(today);\r\n yesterday.setDate(yesterday.getDate() - 1);\r\n\r\n const [shiftDateFrom, setShiftDateFrom] = useState(yesterday as Date | null);\r\n const [shiftDateTo, setShiftDateTo] = useState(today as Date | null);\r\n\r\n const setShiftDateRange = (dateFrom: Date | null, dateTo: Date | null): void => {\r\n setShiftDateFrom(dateFrom);\r\n setShiftDateTo(dateTo);\r\n };\r\n\r\n const forceStateChange = () => {\r\n setStateVersion(stateVersion + 1);\r\n };\r\n\r\n const selectItems = (\r\n srcItems: T[],\r\n destinationItems: T[],\r\n comparer: (a: T, b: T) => boolean,\r\n setter: (items: T[]) => void\r\n ) => {\r\n for (var i = 0; i < srcItems.length; i++) {\r\n // if its not already selected, add it to the list\r\n if (destinationItems.findIndex(d => comparer(d, srcItems[i])) === -1) {\r\n destinationItems.push(srcItems[i]);\r\n }\r\n }\r\n\r\n setter(destinationItems);\r\n forceStateChange();\r\n };\r\n\r\n const getExportFilter = () => {\r\n let userIds = selectedUsers.map(user => user.id);\r\n let supervisorIds = selectedSupervisors.map(user => user.id);\r\n\r\n let locationIds = [] as number[];\r\n selectedLocations.forEach(location => {\r\n if (isNumber(location.id)) {\r\n locationIds.push(location.id);\r\n }\r\n });\r\n\r\n let statusIds = [] as FatigueAssessmentStatusEnum[];\r\n if (statusCompleted) statusIds.push(FatigueAssessmentStatusEnum.Complete);\r\n if (statusPending) statusIds.push(FatigueAssessmentStatusEnum.Pending);\r\n if (statusViolation) statusIds.push(FatigueAssessmentStatusEnum.Violation);\r\n\r\n let riskIds = [] as FatigueAssessmentRiskEnum[];\r\n if (riskLow) riskIds.push(FatigueAssessmentRiskEnum.Low);\r\n if (riskMedium) riskIds.push(FatigueAssessmentRiskEnum.Medium);\r\n if (riskHigh) riskIds.push(FatigueAssessmentRiskEnum.High);\r\n if (riskNa) riskIds.push(FatigueAssessmentRiskEnum.NA);\r\n\r\n return {\r\n userIds: userIds,\r\n supervisorIds: supervisorIds,\r\n locationIds: locationIds,\r\n statusIds: statusIds,\r\n riskIds: riskIds,\r\n shiftDateFrom: shiftDateFrom,\r\n shiftDateTo: shiftDateTo,\r\n includeAudit: includeAudit\r\n } as FatigueAssessmentReportQuery;\r\n };\r\n\r\n const downloadExportResults = async () => {\r\n if (exportState === \"ready\") {\r\n const filter = getExportFilter();\r\n\r\n if (filter) {\r\n setExportState(\"busy\");\r\n\r\n api.downloadFatigueAssessmentResults(filter)\r\n .then(file => {\r\n setExportState(\"ready\");\r\n blobDownload(file);\r\n })\r\n .catch(e => {\r\n const message = (e instanceof RangeError) ? e.message : \"Error fetching data. \";\r\n confirm(message, [\"Close\"], \"Close\");\r\n setExportState(\"ready\");\r\n });\r\n }\r\n }\r\n };\r\n\r\n const toggleItem = (\r\n item: T,\r\n arr: T[],\r\n comparerPredicate: (value: T) => boolean,\r\n setter: (value: T[]) => void\r\n ): boolean => {\r\n const idx = arr.findIndex(comparerPredicate);\r\n\r\n var result = false;\r\n\r\n if (idx === -1) {\r\n result = true;\r\n arr.push(item);\r\n } else {\r\n arr.splice(idx, 1);\r\n }\r\n\r\n setter(arr);\r\n forceStateChange();\r\n\r\n return result;\r\n };\r\n\r\n // when the user changes a user filter, turn on exporting users, and turn off \"Select All Users\"\r\n const userFilterAdded = () => {\r\n if (selectAllUsers) {\r\n setSelectAllUsers(false);\r\n }\r\n }\r\n\r\n const toggleUser = (usr: api.User) => {\r\n if (toggleItem(usr, selectedUsers, u => { return u.id === usr.id }, setSelectedUsers) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n const toggleSupervisor = (usr: api.User) => {\r\n if (toggleItem(usr, selectedSupervisors, u => { return u.id === usr.id }, setSelectedSupervisors) === true) {\r\n userFilterAdded();\r\n }\r\n };\r\n\r\n const toggleLocation = (usr: api.Location) => {\r\n let locations = selectedLocations;\r\n\r\n if (locations.length > 0 && locations[0].id == undefined) {\r\n locations = [];\r\n if (usr.id == undefined) {\r\n setSelectedLocations(locations);\r\n return;\r\n }\r\n }\r\n\r\n toggleItem(usr, locations, u => { return u.id === usr.id }, setSelectedLocations);\r\n };\r\n\r\n const searchUsersByName = async (name: string) => {\r\n const result = await api.getUsersByName(name);\r\n\r\n if (result) {\r\n setUsersByName(result);\r\n setUsersByNameSummary(result.length + \" search results for the search \\\"\" + name + \"\\\"\");\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const searchSupervisorsByName = async (name: string) => {\r\n const result = await api.getSupervisorsByName(name);\r\n\r\n if (result) {\r\n setSupervisors(result);\r\n setSupervisorsSummary(result.length + \" search results for the search \\\"\" + name + \"\\\"\");\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const getLocations = async () => {\r\n const result = await locationApi.getLocations();\r\n\r\n if (result) {\r\n setLocations(result);\r\n setLocationsSummary(result.length + \" locations results\");\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const userNameItemFilter = (item: api.User, filterText: string) => {\r\n const lcName = filterText.toLowerCase();\r\n\r\n return (\r\n (item.fullName).toLowerCase().indexOf(lcName) > -1\r\n || (item.email?.toLowerCase().indexOf(lcName) > -1)\r\n );\r\n };\r\n\r\n const confirm = async (message: string, opts?: string[], defaultOption?: string, cancelOption?: string): Promise => {\r\n return new Promise((resolve) => {\r\n setConfirmProps({\r\n message: message,\r\n options: opts ?? [\"OK\", \"Cancel\"],\r\n defaultOption: defaultOption,\r\n setResult: (value) => {\r\n setConfirmProps({} as IConfirmProps);\r\n resolve(value);\r\n }\r\n });\r\n });\r\n };\r\n\r\n const setSelectAllUsersAndClearSelections = (value: boolean) => {\r\n if (value) {\r\n confirm(\"Are you sure you want to include all users? Including all users will reset all user filters.\", [\"All Users\", \"Cancel\"], \"All Users\").then(result => {\r\n if (result === \"All Users\") {\r\n setSelectedUsers([]);\r\n setSelectedSupervisors([]);\r\n\r\n setSelectAllUsers(true);\r\n } else {\r\n setSelectAllUsers(false);\r\n }\r\n });\r\n } else {\r\n setSelectAllUsers(value);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n getLocations();\r\n }, []);\r\n\r\n const View = () => {\r\n return (\r\n
\r\n\r\n
\r\n
\r\n \r\n Build a report\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Add data\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n User\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n { setSelectAllUsersAndClearSelections(!selectAllUsers); }}>Select all users\r\n
\r\n
or
\r\n
\r\n \r\n { setUserFilterTab(v); }}>\r\n \r\n \r\n \r\n\r\n \r\n \r\n summary={usersByNameSummary}\r\n dataSource={usersByName}\r\n listItemType={UserListItem}\r\n filterText={usersByNameFilter}\r\n setFilterText={setUsersByNameFilter}\r\n expanded={usersByNameExpanded}\r\n setExpanded={setUsersByNameExpanded}\r\n buildKey={item => item.id}\r\n filterAsync={searchUsersByName}\r\n toggleSelected={toggleUser}\r\n selectItems={\r\n (filteredItems) => selectItems(\r\n filteredItems,\r\n selectedUsers,\r\n (a, b) => a.id === b.id,\r\n setSelectedUsers\r\n )\r\n }\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedUsers} />\r\n \r\n\r\n \r\n \r\n summary={supervisorsSummary}\r\n dataSource={supervisors}\r\n listItemType={UserListItem}\r\n filterText={supervisorsFilter}\r\n setFilterText={setSupervisorsFilter}\r\n expanded={supervisorsExpanded}\r\n setExpanded={setSupervisorsExpanded}\r\n buildKey={item => item.id}\r\n filterAsync={searchSupervisorsByName}\r\n toggleSelected={toggleSupervisor}\r\n selectItems={\r\n (filteredItems) => selectItems(\r\n filteredItems,\r\n selectedSupervisors,\r\n (a, b) => a.id === b.id,\r\n setSelectedSupervisors\r\n )\r\n }\r\n noResultsMessage=\"No supervisors found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedSupervisors} />\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n  \r\n {selectAllUsers &&\r\n { setSelectAllUsersAndClearSelections(false); }} label={<>User: All}>\r\n }\r\n  \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {FatigueAssessmentQuestions.signOnLocation.value}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
setLocationsExpanded(true)}>\r\n \r\n summary={locationsSummary}\r\n dataSource={locations}\r\n listItemType={LocationListItem}\r\n filterText={locationsFilter}\r\n setFilterText={setLocationsFilter}\r\n expanded={locationsExpanded}\r\n setExpanded={setLocationsExpanded}\r\n buildKey={item => item.id}\r\n toggleSelected={toggleLocation}\r\n selectItems={\r\n (filteredItems) => selectItems(\r\n filteredItems,\r\n selectedLocations,\r\n (a, b) => a.id === b.id,\r\n setSelectedLocations\r\n )\r\n }\r\n noResultsMessage=\"No locations found\"\r\n filterTextPlaceholder=\"Select location\"\r\n selected={selectedLocations} />\r\n
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Status\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n setStatusCompleted(!statusCompleted)}>Completed fatigue assessments\r\n setStatusPending(!statusPending)}>Pending fatigue assessments\r\n setStatusViolation(!statusViolation)}>Fatigue assessments not complete\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Risk\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n setRiskLow(!riskLow)}>Low risk\r\n setRiskMedium(!riskMedium)}>Medium risk\r\n setRiskHigh(!riskHigh)}>High risk\r\n setRiskNa(!riskNa)}>\r\n Not applicable\r\n Only applies to:
pending / not completed fatigue assessments } />\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {FatigueAssessmentQuestions.partialShiftStartDate.value}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n {\r\n setShiftDateRange(f ? f : null, t ? t : null);\r\n }}\r\n />\r\n
\r\n
\r\n
\r\n
\r\n \r\n Audit\r\n
\r\n
\r\n
\r\n
\r\n
\r\n setincludeAudit(!includeAudit)}>Include fatigue assessment audit trail\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n {((exportState === 'busy')) &&\r\n
\r\n
We're fetching your data...
\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};\r\n\r\nexport default FatigueAssessmentReport;\r\n","import React, { useState } from 'react';\r\n\r\nimport * as api from 'shared/services/reportingApi';\r\nimport { List, IListItemProps } from 'components/ui/Lists';\r\nimport { LabelledCheckbox } from 'components/ui/LabelledCheckbox';\r\nimport { IConfirmProps } from 'components/ui/ConfirmationBox';\r\nimport { TabPanel } from 'components/ui/TabPanel';\r\nimport PortalPage from 'components/portal/PortalPage';\r\nimport { LoginHistoryReportQuery } from 'shared/models/api/models';\r\nimport { ISelectedExportColumn, ExportGrid } from './ExportGrid'\r\n\r\nimport Chip from '@material-ui/core/Chip';\r\nimport { Paper, Tabs, Tab } from '@material-ui/core';\r\nimport { SupervisorAccountOutlined, PersonOutlined, NearMeOutlined, BarChartOutlined, MailOutline } from '@material-ui/icons';\r\nimport { ReactComponent as ReportingIcon } from 'assets/icons/reports-filled.svg';\r\nimport { ReactComponent as BuildCircle } from 'assets/icons/build-circle.svg';\r\nimport { ReactComponent as AddChart } from 'assets/icons/add-chart.svg';\r\nimport 'react-datepicker/dist/react-datepicker.css';\r\nimport 'components/ui/ConfirmationBox.css';\r\nimport 'components/portal/administration/administration.css';\r\nimport './Reporting.css';\r\nimport { blobDownload } from './blobDownload'\r\n\r\n\r\nexport const UserListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n {props.item.fullName}\r\n
\r\n {props.item.city &&\r\n {props.item.city}\r\n }\r\n\r\n {props.item.supervisor.length > 0 &&\r\n {props.item.supervisor}\r\n }\r\n\r\n {!props.item.city && props.item.email.length > 0 &&\r\n {props.item.email}\r\n }\r\n\r\n
\r\n
;\r\n\r\ninterface IChipsProps {\r\n values: T[],\r\n removeItem: (item: T) => void,\r\n prefix?: any\r\n}\r\n\r\nconst UserChips = (props: IChipsProps) =>\r\n <>\r\n {props.values &&\r\n props.values.map(usr =>\r\n { props.removeItem(usr); }}\r\n label={<>\r\n {props.prefix ? props.prefix + \": \" : \"\"}{usr.fullName}\r\n } />\r\n )\r\n }\r\n ;\r\n\r\n\r\nconst LoginHistoryReport = () => {\r\n const [downloadState, setDownloadState] = useState(\"ready\" as \"ready\" | \"busy\");\r\n const [historyResult, setHistoryResult] = useState(undefined as api.LoginHistoryReportResult | undefined);\r\n const [historyResultPaged, setHistoryResultPaged] = useState(undefined as api.LoginHistoryReportResult | undefined);\r\n\r\n const [exportState, setExportState] = useState(\"ready\" as \"ready\" | \"busy\");\r\n const [stateVersion, setStateVersion] = useState(0);\r\n const [confirmProps, setConfirmProps] = useState(null as IConfirmProps | null);\r\n const [userFilterTab, setUserFilterTab] = useState(0);\r\n\r\n const [selectedUsers, setSelectedUsers] = useState([] as api.User[]);\r\n const [usersByNameFilter, setUsersByNameFilter] = useState(\"\");\r\n const [usersByNameExpanded, setUsersByNameExpanded] = useState(false);\r\n const [usersByNameSummary, setUsersByNameSummary] = useState(\"\");\r\n const [usersByName, setUsersByName] = useState([] as api.User[]);\r\n\r\n const [pageSize, setPageSize] = useState(100);\r\n const [pageNumber, setPageNumber] = useState(1);\r\n\r\n const forceStateChange = () => {\r\n setStateVersion(stateVersion + 1);\r\n };\r\n\r\n const historyColumns = [\r\n { seq: 1, definition: { title: \"Id\", name: \"loginHistoryResultId\", selected: false, unsortable: true } },\r\n { seq: 2, definition: { title: \"Name\", name: \"fullname\", selected: false, unsortable: true } },\r\n { seq: 3, definition: { title: \"Email\", name: \"email\", selected: false, unsortable: true } },\r\n { seq: 4, definition: { title: \"Source\", name: \"source\", selected: false, unsortable: true } },\r\n { seq: 5, definition: { title: \"Date\", name: \"date\", selected: false, unsortable: true } }\r\n ] as ISelectedExportColumn[];\r\n\r\n const selectItems = (\r\n srcItems: T[],\r\n destinationItems: T[],\r\n comparer: (a: T, b: T) => boolean,\r\n setter: (items: T[]) => void\r\n ) => {\r\n for (var i = 0; i < srcItems.length; i++) {\r\n if (destinationItems.findIndex(d => comparer(d, srcItems[i])) === -1) {\r\n destinationItems.push(srcItems[i]);\r\n }\r\n }\r\n\r\n setter(destinationItems);\r\n forceStateChange();\r\n };\r\n\r\n const getExportFilter = () => {\r\n let userIds = selectedUsers.map(user => user.id);\r\n\r\n return {\r\n userIds: userIds\r\n } as LoginHistoryReportQuery;\r\n };\r\n\r\n const viewResults = async () => {\r\n if (downloadState === \"ready\") {\r\n const filter = getExportFilter();\r\n\r\n if (filter) {\r\n setDownloadState(\"busy\");\r\n\r\n api.getLoginHistoryResults(filter)\r\n .then(result => {\r\n setDownloadState(\"ready\");\r\n\r\n if (result) {\r\n setHistoryResult(result);\r\n setPagedResults(result, 1);\r\n }\r\n })\r\n .catch(e => {\r\n confirm(\"Error fetching data.\", [\"Close\"], \"Close\");\r\n setDownloadState(\"ready\");\r\n });\r\n }\r\n }\r\n };\r\n\r\n const setPagedResults = (result: api.LoginHistoryReportResult, page: number) => {\r\n setPageNumber(page);\r\n var items = [...result.list];\r\n var start = pageSize * (page - 1);\r\n var deleteCount = pageSize;\r\n items = items.splice(start, deleteCount);\r\n\r\n var paged = {\r\n totalResults: result.totalResults,\r\n list: items\r\n } as api.LoginHistoryReportResult;\r\n setHistoryResultPaged(paged);\r\n }\r\n\r\n const downloadExportResults = async () => {\r\n if (exportState === \"ready\") {\r\n const filter = getExportFilter();\r\n\r\n if (filter) {\r\n setExportState(\"busy\");\r\n\r\n api.downloadLoginHistoryResults(filter)\r\n .then(file => {\r\n setExportState(\"ready\");\r\n blobDownload(file);\r\n })\r\n .catch(e => {\r\n const message = (e instanceof RangeError) ? e.message : \"Error fetching data. \";\r\n confirm(message, [\"Close\"], \"Close\");\r\n setExportState(\"ready\");\r\n });\r\n }\r\n }\r\n };\r\n\r\n const toggleItem = (\r\n item: T,\r\n arr: T[],\r\n comparerPredicate: (value: T) => boolean,\r\n setter: (value: T[]) => void\r\n ): boolean => {\r\n const idx = arr.findIndex(comparerPredicate);\r\n\r\n var result = false;\r\n\r\n if (idx === -1) {\r\n result = true;\r\n arr.push(item);\r\n } else {\r\n arr.splice(idx, 1);\r\n }\r\n\r\n setter(arr);\r\n forceStateChange();\r\n\r\n return result;\r\n };\r\n\r\n const toggleUser = (usr: api.User) => {\r\n toggleItem(usr, selectedUsers, u => { return u.id === usr.id }, setSelectedUsers);\r\n };\r\n\r\n const searchUsersByName = async (name: string) => {\r\n const result = await api.getUsersByName(name);\r\n\r\n if (result) {\r\n setUsersByName(result);\r\n setUsersByNameSummary(result.length + \" search results for the search \\\"\" + name + \"\\\"\");\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const confirm = async (message: string, opts?: string[], defaultOption?: string, cancelOption?: string): Promise => {\r\n return new Promise((resolve) => {\r\n setConfirmProps({\r\n message: message,\r\n options: opts ?? [\"OK\", \"Cancel\"],\r\n defaultOption: defaultOption,\r\n setResult: (value) => {\r\n setConfirmProps({} as IConfirmProps);\r\n resolve(value);\r\n }\r\n });\r\n });\r\n };\r\n\r\n const View = () => {\r\n return (\r\n
\r\n\r\n
\r\n
\r\n \r\n Build a report\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n Add data\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n User\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n { setUserFilterTab(v); }}>\r\n \r\n \r\n\r\n \r\n \r\n summary={usersByNameSummary}\r\n dataSource={usersByName}\r\n listItemType={UserListItem}\r\n filterText={usersByNameFilter}\r\n setFilterText={setUsersByNameFilter}\r\n expanded={usersByNameExpanded}\r\n setExpanded={setUsersByNameExpanded}\r\n buildKey={item => item.id}\r\n filterAsync={searchUsersByName}\r\n toggleSelected={toggleUser}\r\n selectItems={\r\n (filteredItems) => selectItems(\r\n filteredItems,\r\n selectedUsers,\r\n (a, b) => a.id === b.id,\r\n setSelectedUsers\r\n )\r\n }\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n selected={selectedUsers} />\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n {(downloadState === 'busy' || exportState === 'busy') &&\r\n
\r\n
We're fetching your data...
\r\n
\r\n }\r\n\r\n {historyResult && historyResultPaged &&\r\n <>\r\n
\r\n
\r\n \r\n Results\r\n
\r\n
\r\n
\r\n
\r\n setPagedResults(historyResult, n)}\r\n sortOrder={[]}\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};\r\n\r\nexport default LoginHistoryReport;\r\n\r\n","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgFatigueAssessmentFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 47.645,\n height: 57.335,\n viewBox: \"0 0 47.645 57.335\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H5.833V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 10.076)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H21.743V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 10.076) translate(11.136)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H5.833V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 20.151)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H21.743V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 20.151) translate(11.136)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H5.833V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H21.743V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(11.136)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H5.833V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 30.228)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H21.743V5.833H0z\",\n transform: \"translate(-388 -22) translate(394.894 34.727) translate(0 30.228) translate(11.136)\"\n }))), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.644 57.335H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h45.644a1 1 0 0 1 1 1v55.335a1 1 0 0 1-1 1zM2.826 6.46v47.645h41.589V6.46z\",\n transform: \"translate(-388 -22) translate(388 22)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgFatigueAssessmentFilled);\nexport default __webpack_public_path__ + \"static/media/fatigue-assessment-filled.4d18df8d.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useState, useEffect } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { RailDocument } from 'shared/models/api/models';\r\nimport { DocumentFilterList } from 'components/menu/Labels';\r\nimport { IDocumentFilter, RelatedRulebookDocumentView } from 'components/ui/DocumentRules';\r\n\r\nimport { HighlightOffOutlined, KeyboardArrowDownOutlined, KeyboardArrowUpOutlined } from '@material-ui/icons';\r\nimport { ReactComponent as RelatedDocumentsLinkIcon } from \"assets/icons/related-documents.svg\";\r\nimport './Viewer.css'\r\n\r\n\r\ninterface RelatedDocumentsProps {\r\n relatedDocuments: Array,\r\n document: RailDocument\r\n}\r\n\r\nexport const RelatedDocuments = (props: RelatedDocumentsProps) => {\r\n const [showRelatedDocs, setShowRelateDocs] = useState(false);\r\n const [expandedFilters, setExpandedFilters] = useState([] as IDocumentFilter[]);\r\n const [activeFilter, setActiveFilter] = useState({} as IDocumentFilter | null);\r\n\r\n const history = useHistory();\r\n\r\n const updateActiveFilter = (filter: IDocumentFilter | null) => {\r\n setActiveFilter(filter);\r\n\r\n if (filter === null && activeFilter) {\r\n setExpandedFilters(expandedFilters.filter(f => f !== activeFilter));\r\n } else {\r\n if (activeFilter !== null) {\r\n setExpandedFilters(expandedFilters.concat([activeFilter]));\r\n } else {\r\n setExpandedFilters(expandedFilters.filter(f => f !== filter));\r\n }\r\n }\r\n };\r\n\r\n const navigateToDocument = (doc: RailDocument) => {\r\n setShowRelateDocs(false);\r\n history.push(`/pdf/view/${doc.id}`);\r\n }\r\n\r\n useEffect(() => {\r\n setExpandedFilters(RelatedRulebookDocumentView.filters);\r\n }, []);\r\n\r\n return (\r\n
\r\n {(props.relatedDocuments.length > 0) && <>\r\n
setShowRelateDocs(!showRelatedDocs)}>\r\n
\r\n \r\n
\r\n
Related documents
\r\n
{showRelatedDocs ? : }
\r\n
\r\n }\r\n\r\n {showRelatedDocs &&\r\n
\r\n
\r\n
\r\n setShowRelateDocs(false)} />\r\n
\r\n
Related documents: {props.document.title}
\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 { Button, Modal, ModalHeader, ModalBody } from 'reactstrap';\r\n\r\nimport { ModalClose } from \"components/menu/Labels\";\r\nimport './FormModal.css'\r\n\r\ntype IModalButtonProps = {\r\n onClick: () => void,\r\n text: string,\r\n primaryButton?: boolean\r\n}\r\n\r\nexport const ModalButton = (props: IModalButtonProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\n\r\ntype IModalButtonRowProps = {\r\n children: any\r\n}\r\n\r\nexport const ModalButtonRow = (props: IModalButtonRowProps) => {\r\n return (\r\n \r\n
\r\n {props.children}\r\n
\r\n
\r\n );\r\n}\r\n\r\n\r\ntype ISubHeaderProps = {\r\n children: any\r\n}\r\n\r\nexport const FormModalSubHeader = (props: ISubHeaderProps) => {\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\n\r\n\r\ntype IPaddedBodyProps = {\r\n children: any\r\n}\r\n\r\nexport const FormModalPaddedBody = (props: IPaddedBodyProps) => {\r\n return (\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\ntype IFormModalProps = {\r\n children: any,\r\n isOpen: boolean,\r\n closeAction: () => void,\r\n headingText: string,\r\n submitAction?: () => void,\r\n icon?: any\r\n}\r\n\r\nexport const FormModal = (props: IFormModalProps) => {\r\n return (\r\n \r\n \r\n \r\n
\r\n
\r\n
{props.icon}
\r\n
{props.headingText}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n {props.children}\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import React, { useState } from 'react';\r\nimport { Info, InsertCommentOutlined } from '@material-ui/icons';\r\n\r\nimport { FormModal, FormModalSubHeader, FormModalPaddedBody, ModalButtonRow, ModalButton } from 'components/ui/FormModal';\r\nimport InfoModal from 'components/ui/InfoModal';\r\nimport { setDocumentClarification } from \"shared/services/railDocumentsApi\";\r\nimport { DocumentComment } from 'shared/models/api/models';\r\nimport './Viewer.css'\r\n\r\ntype ClarifyModalProps = {\r\n documentId: number,\r\n commentMaxLength: number,\r\n isOpen: boolean,\r\n closeAction: () => void,\r\n submitAction: () => void\r\n}\r\n\r\nexport const ClarifyModal = (props: ClarifyModalProps) => {\r\n const [clarifyNoMessageModalDisplayed, setClarifyNoMessageModalDisplayed] = useState(false);\r\n const [commentsText, setCommentsText] = useState('');\r\n\r\n const answerUpdate = (event: any) => {\r\n let value = (event?.target?.value || '').substring(0, props.commentMaxLength) as string;\r\n setCommentsText(value);\r\n }\r\n\r\n const submit = () => {\r\n if (commentsText.length < 1) {\r\n setClarifyNoMessageModalDisplayed(true);\r\n return;\r\n }\r\n\r\n const comments: DocumentComment = { text: commentsText };\r\n\r\n setDocumentClarification(props.documentId, comments).then(() => props.submitAction());\r\n }\r\n\r\n return (\r\n } headingText=\"Clarification request\">\r\n { setClarifyNoMessageModalDisplayed(false); }}\r\n />\r\n \r\n
Add a comment to this document
\r\n
\r\n\r\n \r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
Your comment will be recorded and be visible to supervisors.
\r\n
If you don't want to send a clarification request, please close this window.
\r\n\r\n \r\n\r\n \r\n \r\n \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, { useState } from 'react';\r\nimport { Info, InsertCommentOutlined } from '@material-ui/icons';\r\n\r\nimport { FormModal, FormModalSubHeader, FormModalPaddedBody, ModalButtonRow, ModalButton } from 'components/ui/FormModal';\r\nimport { setDocumentFeedback } from \"shared/services/railDocumentsApi\";\r\nimport { DocumentComment } from 'shared/models/api/models';\r\nimport './Viewer.css'\r\n\r\ntype FeedbackModalProps = {\r\n documentId: number,\r\n commentMaxLength: number,\r\n isOpen: boolean,\r\n closeAction: () => void,\r\n submitAction: () => void\r\n}\r\n\r\nexport const FeedbackModal = (props: FeedbackModalProps) => {\r\n const [commentsText, setCommentsText] = useState('');\r\n\r\n const answerUpdate = (event: any) => {\r\n let value = (event?.target?.value || '').substring(0, props.commentMaxLength) as string;\r\n setCommentsText(value);\r\n }\r\n\r\n const submit = () => {\r\n\r\n const comments: DocumentComment = { text: commentsText };\r\n\r\n setDocumentFeedback(props.documentId, comments).then(() => props.submitAction());\r\n }\r\n\r\n return (\r\n } headingText=\"Document feedback\">\r\n \r\n
Add a comment to this document
\r\n
\r\n\r\n \r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
Feedback is optional. Your comment will be recorded and be visible to supervisors.
\r\n
If you don't want to provide feedback, please close this window
\r\n\r\n \r\n\r\n \r\n \r\n \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, { useState, useEffect } from 'react';\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { AnnouncementOutlined, ChevronLeft, ChevronRight } from '@material-ui/icons';\r\n\r\nimport { setDocumentAcknowledged } from \"shared/services/railDocumentsApi\";\r\nimport { RailDocumentPendingActions } from 'shared/models/api/models';\r\nimport InfoModal, { ExitCancelModel } from 'components/ui/InfoModal';\r\nimport { ClarifyModal } from './DocumentClarify';\r\nimport { FeedbackModal } from './DocumentFeedback';\r\nimport './Viewer.css'\r\n\r\nimport {\r\n Input,\r\n Button\r\n} from 'reactstrap';\r\nimport { MyDocumentsDocumentView } from '../../ui/DocumentRules';\r\n\r\n\r\ninterface AcknowledgePanelProps {\r\n documentId: number;\r\n pendingActions: RailDocumentPendingActions;\r\n displayAcknowledgePanel: boolean;\r\n}\r\n\r\nexport const AcknowledgePanel = (props: AcknowledgePanelProps) => {\r\n const [shrinkAcknowledgePanel, setShrinkAcknowledgePanel] = useState(false);\r\n const [understoodChecked, setUnderstoodChecked] = useState(false);\r\n const [understoodUncheckedWarning, setUnderstoodUncheckedWarning] = useState(false);\r\n const [clarificationModalDisplayed, setClarificationModalDisplayed] = useState(false);\r\n const [acknowledgeSentModalDisplayed, setAcknowledgeSentModalDisplayed] = useState(false);\r\n const [feedbackModalDisplayed, setFeedbackModalDisplayed] = useState(false);\r\n const [AcknowledgementErrorModalDisplayed, setAcknowledgementErrorModalDisplayed] = useState(false);\r\n const [feedbackRecordedModalDisplayed, setFeedbackRecordedModalDisplayed] = useState(false);\r\n const [clarifyRecordedModalDisplayed, setClarifyRecordedModalDisplayed] = useState(false);\r\n const [clarifyEnabled, setClarifyEnabled] = useState(false);\r\n const [acknowledgeRequired, setAcknowledgeRequired] = useState(false);\r\n\r\n const history = useHistory();\r\n\r\n const commentMaxLength = 500;\r\n\r\n const expandAcknowledgePanel = () => {\r\n setShrinkAcknowledgePanel(false);\r\n }\r\n\r\n const toggleShrinkAcknowledgePanel = () => {\r\n setShrinkAcknowledgePanel(!shrinkAcknowledgePanel);\r\n }\r\n\r\n const acknowledgeAction = () => {\r\n if (!understoodChecked) {\r\n setUnderstoodUncheckedWarning(true);\r\n return;\r\n }\r\n\r\n sendAcknowledgement();\r\n }\r\n\r\n const sendAcknowledgement = () => {\r\n setDocumentAcknowledged(props.documentId)\r\n .then(async (response) => {\r\n if (response === true) {\r\n acknowledgeActionResult();\r\n }\r\n else {\r\n throw (response);\r\n }\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n displaySendAcknowledgementError();\r\n });\r\n }\r\n\r\n const acknowledgeActionResult = () => {\r\n setAcknowledgeSentModalDisplayed(true);\r\n }\r\n\r\n const displaySendAcknowledgementError = () => {\r\n setAcknowledgementErrorModalDisplayed(true);\r\n }\r\n\r\n const clarificationAction = () => {\r\n setClarificationModalDisplayed(true);\r\n }\r\n\r\n const naviateToDocuments = () => {\r\n setAcknowledgeSentModalDisplayed(false);\r\n history.push(MyDocumentsDocumentView.url);\r\n }\r\n\r\n useEffect(() => {\r\n setUnderstoodChecked(false);\r\n setClarifyEnabled(props.pendingActions.clarify);\r\n setAcknowledgeRequired(props.pendingActions.acknowledge);\r\n }, [props]);\r\n\r\n\r\n\r\n const Modals = () => {\r\n return (\r\n <>\r\n { setUnderstoodUncheckedWarning(false); }} />\r\n\r\n { setAcknowledgementErrorModalDisplayed(false); }} />\r\n\r\n { setClarificationModalDisplayed(false); }}\r\n submitAction={() => { setClarificationModalDisplayed(false); setClarifyRecordedModalDisplayed(true); setClarifyEnabled(false); }} />\r\n\r\n { setClarifyRecordedModalDisplayed(false); }} />\r\n\r\n { setFeedbackModalDisplayed(false); setAcknowledgeRequired(false); }}\r\n submitAction={() => { setFeedbackModalDisplayed(false); setFeedbackRecordedModalDisplayed(true); }} />\r\n\r\n { setFeedbackRecordedModalDisplayed(false); setAcknowledgeRequired(false); }} />\r\n\r\n { setAcknowledgeSentModalDisplayed(false); setFeedbackModalDisplayed(true); }} />\r\n \r\n );\r\n }\r\n\r\n const AcknowledgeRow = () => {\r\n return (\r\n
\r\n \r\n setUnderstoodChecked(e.target.checked)} />\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n const ClarifyRow = () => {\r\n return (\r\n
\r\n
\r\n );\r\n }\r\n\r\n const AcknowledgeTooltip = () => {\r\n return (\r\n !props.displayAcknowledgePanel ?\r\n
\r\n
\r\n
This document requires acknowledgment.
\r\n
Read to the end to acknowledge.
\r\n
\r\n
\r\n :\r\n
\r\n );\r\n }\r\n\r\n const ShrinkToggle = () => {\r\n return (\r\n
\r\n {shrinkAcknowledgePanel ?\r\n \r\n :\r\n \r\n }\r\n
\r\n );\r\n }\r\n\r\n return (\r\n acknowledgeRequired == 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
\r\n :\r\n <>\r\n );\r\n}\r\n","import React, { useState, useEffect } from 'react';\r\nimport { Nav, NavItem } from \"reactstrap\";\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { ChevronLeft, ChevronRight } from '@material-ui/icons';\r\nimport \"./SideBar.css\";\r\nimport { DocumentFilterList } from \"components/menu/Labels\";\r\nimport { IDocumentFilter, IDocumentSubType, RailRulebookDocumentModule, RulebookDocumentMenu } from 'components/ui/DocumentRules';\r\n\r\ninterface IRailRulebookMenuProps {\r\n documentId: number,\r\n typeId: number,\r\n subTypeId: number | null,\r\n isExpanded: boolean,\r\n setIsExpanded: (value: boolean) => void\r\n\r\n}\r\n\r\nconst PopulatedRailRulebookMenu = (props: IRailRulebookMenuProps) => {\r\n const [activeFilter, setActiveFilter] = useState(null as IDocumentFilter | null);\r\n const [activeSubFilter, setActiveSubFilter] = useState(null as IDocumentFilter | null);\r\n\r\n const history = useHistory();\r\n\r\n const navigateToDocument = (id: number) => {\r\n history.push('/pdf/view/' + id);\r\n props.setIsExpanded(false);\r\n }\r\n\r\n const Icon = RailRulebookDocumentModule.icon;\r\n\r\n useEffect(() => {\r\n RulebookDocumentMenu.filters.forEach(f => {\r\n f.subFilters?.forEach(sf => {\r\n if ((sf as IDocumentSubType).id === props.subTypeId) {\r\n setActiveSubFilter(sf);\r\n return;\r\n }\r\n\r\n if ((sf as IDocumentSubType).id === props.typeId) {\r\n setActiveSubFilter(sf);\r\n setActiveFilter(f);\r\n return;\r\n }\r\n });\r\n\r\n if ((f as IDocumentSubType).id === props.typeId) {\r\n setActiveFilter(f);\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\nconst SideBar = (props: { docId: string, typeId: number, subTypeId: number | null }) => {\r\n const [shown, setShown] = useState(false);\r\n\r\n const toggleShown = () => {\r\n setShown(!shown);\r\n }\r\n\r\n const isTocEnabled = () => {\r\n //Only show Rulebook module or OperatingNotices/OperatingInstructions from Documents module, these are typeId 1 to 300\r\n if (props.typeId < 301) {\r\n return true;\r\n }\r\n\r\n //All document type ids above 300 is in the Document module and is no an ON/OI and should not be shown\r\n return false;\r\n }\r\n\r\n return (\r\n <>\r\n {isTocEnabled() &&\r\n <>\r\n
\r\n \r\n Rail Rulebook\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\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 SideBar;\r\n","export default __webpack_public_path__ + \"static/media/favourite-empty.621ca3a7.svg\";","export default __webpack_public_path__ + \"static/media/favourite-filled.db1a0753.svg\";","export default __webpack_public_path__ + \"static/media/ios-share.edb6866f.svg\";","export default __webpack_public_path__ + \"static/media/info.b16d1020.svg\";","export default __webpack_public_path__ + \"static/media/search.7d047d11.svg\";","export default __webpack_public_path__ + \"static/media/zoom-in.a8453203.svg\";","export default __webpack_public_path__ + \"static/media/zoom-out.5f9c0156.svg\";","export default __webpack_public_path__ + \"static/media/download.d05a68ee.svg\";","export default __webpack_public_path__ + \"static/media/grid.856651d5.svg\";","export default __webpack_public_path__ + \"static/media/fullscreen.fc13bffa.svg\";","export default __webpack_public_path__ + \"static/media/print.8459865c.svg\";","import React, { useEffect, useRef, useState } from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { Link } from 'react-router-dom';\r\nimport { Module } from \"shared/types/types\";\r\nimport PSPDFKit from 'pspdfkit';\r\nimport { saveAs } from 'file-saver';\r\nimport { getStaticFileBytes } from \"shared/services/railDocumentsApi\";\r\nimport { getDocument, getPdfBytes, setDocumentViewed, updateFavouriteFlagAsync } from \"shared/services/railDocumentsApi\";\r\nimport { RailDocument, RailDocumentPendingActions } from 'shared/models/api/models';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { RelatedDocuments } from './RelatedDocuments'\r\nimport { AcknowledgePanel } from './AcknowledgeDocument'\r\nimport { DocumentTypeEnum } from 'shared/enums/document-type-enum';\r\nimport SideBar from './SideBar'\r\nimport './Viewer.css'\r\nimport FavouriteEmpty from 'assets/icons/favourite-empty.svg';\r\nimport FavouriteFilled from 'assets/icons/favourite-filled.svg';\r\nimport IosShare from 'assets/icons/ios-share.svg';\r\nimport InfoIcon from 'assets/icons/info.svg';\r\nimport SearchIcon from 'assets/icons/search.svg';\r\nimport ZoomIn from 'assets/icons/zoom-in.svg';\r\nimport ZoomOut from 'assets/icons/zoom-out.svg';\r\nimport Download from 'assets/icons/download.svg';\r\nimport GridIcon from 'assets/icons/grid.svg';\r\nimport Fullscreen from 'assets/icons/fullscreen.svg';\r\nimport PrintIcon from 'assets/icons/print.svg';\r\nimport { useProfile } from '../../../hooks/useRoles';\r\nimport { ViewInfo } from \"components/portal/documents/DocumentInfo/DocumentInfo\";\r\nimport { findDocumentViewForId } from '../../ui/DocumentRules';\r\n\r\n\r\n\r\nconst publicUrl = `${window.location.protocol}//${window.location.host}/${process.env.PUBLIC_URL}`\r\nconst staticJsFilesBaseUrl = `${publicUrl}static/js/`;\r\n\r\n\r\ninterface IPSPDFKitToolbarItem {\r\n className: string,\r\n disabled: boolean,\r\n dorpDownGroup: string,\r\n icon: string,\r\n id: string,\r\n mediaQueries: string[],\r\n node: Node,\r\n onPress: () => void,\r\n responsiveGroup: string,\r\n selected: boolean,\r\n title: string,\r\n type: string\r\n}\r\n\r\ninterface PdfViewProps {\r\n docId?: string;\r\n page: number;\r\n searchTerm?: string;\r\n staticFile?: string;\r\n}\r\n\r\nconst PSPDFKitComponent = (props: PdfViewProps) => {\r\n const user = useProfile();\r\n\r\n const [relatedDocuments, setRelatedDocuments] = useState([] as Array);\r\n const [document, setDocument] = useState({} as RailDocument);\r\n const [documentId, setDocumentId] = useState(Number.parseInt(props.docId || \"\") as number);\r\n const [showDocumentInfo, setShowDocumentInfo] = useState(0);\r\n const [documentLoadError, setDocumentLoadError] = useState(null as string | null);\r\n\r\n const [pdfInstance, _setPdfInstance] = useState({} as any);\r\n\r\n const pdfInstanceRef = React.useRef(pdfInstance);\r\n\r\n const toggleFavourite = async () => {\r\n await updateFavouriteFlagAsync(documentId, !document.isFavourite).then(result => {\r\n document.isFavourite = !document.isFavourite;\r\n // update the toolbar\r\n configureToolbar(pdfInstanceRef.current);\r\n });\r\n };\r\n\r\n const shareDocument = () => {\r\n const subject = \"BHP Rail Portal: \" + user?.firstname + \" wants to share a document.\";\r\n const body = \"Please click this link: \" + window.location + \" to view the \" + document.title + \".\";\r\n\r\n const link = \"mailto://?subject=\" + encodeURIComponent(subject) + \"&body=\" + encodeURIComponent(body);\r\n\r\n window.open(link, \"_blank\");\r\n };\r\n\r\n const docInfo = () => {\r\n setShowDocumentInfo(document.id);\r\n };\r\n\r\n const downloadPdf = async () => {\r\n const buffer = await pdfInstanceRef.current.exportPDF();\r\n const blob = new Blob([buffer], { type: \"application/pdf\" });\r\n saveAs(blob, document.fileName);\r\n }\r\n\r\n const customIcon = (type: string, stockButton: IPSPDFKitToolbarItem | undefined) => {\r\n let button = stockButton;\r\n switch (type) {\r\n case \"sidebar-thumbnails\":\r\n if (stockButton) {\r\n stockButton.icon = GridIcon;\r\n }\r\n break;\r\n case \"zoom-in\":\r\n if (stockButton) {\r\n stockButton.icon = ZoomIn;\r\n }\r\n break;\r\n case \"zoom-out\":\r\n if (stockButton) {\r\n stockButton.icon = ZoomOut;\r\n }\r\n break;\r\n case \"zoom-mode\":\r\n if (stockButton) {\r\n stockButton.icon = Fullscreen;\r\n }\r\n break;\r\n case \"search\":\r\n if (stockButton) {\r\n stockButton.icon = SearchIcon;\r\n }\r\n break;\r\n case \"info\":\r\n button = (stockButton ?? {\r\n type: \"custom\",\r\n id: type,\r\n title: \"Document Information\",\r\n onPress: docInfo,\r\n icon: InfoIcon\r\n }) as IPSPDFKitToolbarItem;\r\n break;\r\n case \"share\":\r\n button = (stockButton ?? {\r\n type: \"custom\",\r\n id: type,\r\n title: \"Share\",\r\n onPress: shareDocument,\r\n icon: IosShare\r\n }) as IPSPDFKitToolbarItem;\r\n break;\r\n case \"favourite\":\r\n button = (stockButton ?? {\r\n type: \"custom\",\r\n id: type,\r\n title: \"Favourite\",\r\n onPress: toggleFavourite,\r\n icon: (document.isFavourite ? FavouriteFilled : FavouriteEmpty)\r\n }) as IPSPDFKitToolbarItem;\r\n break;\r\n case \"print\":\r\n if (stockButton) {\r\n stockButton.icon = PrintIcon;\r\n }\r\n break;\r\n case \"download-pdf\":\r\n button = (stockButton ?? {\r\n type: \"custom\",\r\n id: type,\r\n title: \"Export\",\r\n onPress: downloadPdf,\r\n icon: Download\r\n }) as IPSPDFKitToolbarItem;\r\n break;\r\n }\r\n\r\n return button;\r\n };\r\n\r\n const copyToolbarItem = (src: IPSPDFKitToolbarItem[], dst: IPSPDFKitToolbarItem[], type: string) => {\r\n const item = customIcon(type, src.find(item => item.type === type));\r\n\r\n if (item) {\r\n dst.push(item);\r\n }\r\n };\r\n\r\n const copyToolbarItems = (src: IPSPDFKitToolbarItem[], dst: IPSPDFKitToolbarItem[], types: string[]) => {\r\n types.forEach(type => copyToolbarItem(src, dst, type));\r\n };\r\n\r\n const configureToolbar = (instance: any) => {\r\n if (instance?.toolbarItems) {\r\n const bhpToolbarItems = [] as IPSPDFKitToolbarItem[];\r\n\r\n /* stock toolbar button types\r\n * 'sidebar-thumbnails', 'sidebar-document-outline', 'sidebar-annotations', 'sidebar-bookmarks', 'pager', \r\n * 'pan', 'zoom-out', 'zoom-in', 'zoom-mode', 'spacer', 'annotate', 'ink', 'highlighter', 'text-highlighter', \r\n * 'ink-eraser', 'signature', 'image', 'stamp', 'note', 'text', 'line', 'arrow', 'rectangle', 'ellipse', 'polygon', \r\n * 'polyline', 'print', 'document-editor', 'search', 'export-pdf', 'debug'\r\n */\r\n copyToolbarItems(instance.toolbarItems, bhpToolbarItems, [\r\n \"sidebar-thumbnails\",\r\n \"zoom-mode\",\r\n \"zoom-in\",\r\n \"zoom-out\",\r\n \"spacer\",\r\n \"pager\",\r\n \"search\",\r\n \"spacer\",\r\n \"info\",\r\n \"favourite\",\r\n \"print\",\r\n \"download-pdf\",\r\n \"share\"\r\n ]);\r\n\r\n instance.setToolbarItems(bhpToolbarItems);\r\n }\r\n };\r\n\r\n const setPdfInstance = (instance: any) => {\r\n pdfInstanceRef.current = instance;\r\n\r\n if (instance?.toolbarItems && document?.id) {\r\n configureToolbar(instance);\r\n }\r\n\r\n _setPdfInstance(instance);\r\n };\r\n\r\n const [documentPendingActions, _setDocumentPendingActions] = useState({} as RailDocumentPendingActions);\r\n const documentPendingActionsRef = React.useRef(documentPendingActions);\r\n const setDocumentPendingActions = (pendingActions: RailDocumentPendingActions) => {\r\n documentPendingActionsRef.current = pendingActions;\r\n _setDocumentPendingActions(pendingActions);\r\n };\r\n\r\n const [displayAcknowledgePanel, _setDisplayAcknowledgePanel] = useState(false);\r\n const displayAcknowledgePanelRef = React.useRef(displayAcknowledgePanel);\r\n const setDisplayAcknowledgePanel = (display: boolean) => {\r\n displayAcknowledgePanelRef.current = display;\r\n _setDisplayAcknowledgePanel(display);\r\n };\r\n\r\n const container = useRef(null);\r\n\r\n useEffect(() => {\r\n if (props.docId === undefined) {\r\n return;\r\n }\r\n\r\n var mounted = true;\r\n\r\n const docId = Number.parseInt(props.docId) as number;\r\n\r\n const mount = async () => {\r\n setDocumentId(docId);\r\n var doc = await getDocument(docId);\r\n const related = await Promise.all((doc.relatesTo || []).map(async (x) => await getDocument(x.key)));\r\n\r\n if (mounted) {\r\n setDocument(doc);\r\n setRelatedDocuments(related);\r\n }\r\n\r\n var pdf = undefined as undefined | ArrayBuffer;\r\n if (!!doc.id) {\r\n pdf = await getPdfBytes(doc.id.toString());\r\n }\r\n\r\n if (mounted) {\r\n if (pdf) {\r\n loadPdfViewer(doc, pdf);\r\n }\r\n else {\r\n setDocumentLoadError(\"You do not have access/permission to view this document. Please contact your supervisor.\");\r\n }\r\n }\r\n\r\n }\r\n\r\n mount();\r\n\r\n return () => {\r\n mounted = false;\r\n setDisplayAcknowledgePanel(false);\r\n if (typeof (pdfInstanceRef.current?.contentWindow) === 'object') {\r\n PSPDFKit.unload(pdfInstanceRef.current);\r\n }\r\n\r\n };\r\n\r\n }, [props.docId]);\r\n\r\n useEffect(() => {\r\n const mount = async () => {\r\n if (props.staticFile === undefined) {\r\n return;\r\n }\r\n\r\n var pdf = await getStaticFileBytes(props.staticFile);\r\n loadPdfViewer(null, pdf);\r\n }\r\n\r\n mount();\r\n\r\n return () => {\r\n setDisplayAcknowledgePanel(false);\r\n if (typeof (pdfInstanceRef.current?.contentWindow) === 'object') {\r\n PSPDFKit.unload(pdfInstanceRef.current);\r\n }\r\n\r\n };\r\n\r\n }, [props.staticFile]);\r\n\r\n useEffect(() => {\r\n if (document?.id && pdfInstanceRef?.current?.toolbarItems) {\r\n configureToolbar(pdfInstanceRef.current);\r\n }\r\n }, [document, pdfInstance]);\r\n\r\n const loadPdfViewer = (doc: RailDocument | null, pdf: ArrayBuffer) => {\r\n PSPDFKit.load({\r\n document: pdf,\r\n container: container.current as HTMLDivElement,\r\n licenseKey: process.env.REACT_APP_PSPDFKIT_LICENSE_KEY as string,\r\n baseUrl: staticJsFilesBaseUrl,\r\n styleSheets: [`${publicUrl}pspdfkit-override.css`]\r\n\r\n })\r\n .then(instance => {\r\n console.log(\"Successfully mounted PSPDFKit\", instance);\r\n if (doc !== null) {\r\n setDocumentViewed(doc.id).then(setDocumentAcknowledgeAction);\r\n }\r\n instance.addEventListener(\"viewState.change\", viewStateChangeEvent);\r\n setPdfInstance(instance);\r\n\r\n const state = instance.viewState;\r\n const newState = state.set(\"currentPageIndex\", props.page - 1);\r\n instance.setViewState(newState);\r\n\r\n if (props.searchTerm) {\r\n instance.startUISearch(props.searchTerm);\r\n }\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n\r\n }\r\n\r\n const viewStateChangeEvent = (viewState: any) => {\r\n const isLastPage = viewState.currentPageIndex + 1 === viewState.instance.totalPageCount;\r\n setDisplayAcknowledgePanel(isLastPage && documentPendingActionsRef.current.acknowledge);\r\n }\r\n\r\n const setDocumentAcknowledgeAction = (pendingActions: RailDocumentPendingActions) => {\r\n if (pendingActions.documentId == 0) {\r\n return;\r\n }\r\n\r\n const isLastPage = pdfInstanceRef.current.viewState.get(\"currentPageIndex\") + 1 === pdfInstanceRef.current.totalPageCount;\r\n if (isLastPage) {\r\n setDisplayAcknowledgePanel(true);\r\n }\r\n\r\n setDocumentPendingActions(pendingActions);\r\n }\r\n\r\n const clearModals = () => {\r\n setShowDocumentInfo(0);\r\n };\r\n\r\n const onDocInfoUpdate = async () => {\r\n var doc = await getDocument(documentId);\r\n const related = await Promise.all((doc.relatesTo || []).map(async (x) => await getDocument(x.key)));\r\n setDocument(doc);\r\n setRelatedDocuments(related);\r\n }\r\n\r\n const customBreadCrumbs = () => {\r\n const moduleLinkPart = (document.moduleId === 1) ? 'rulebook' : 'raildocs';\r\n const typeLinkPart = DocumentTypeEnum[document.typeId];\r\n const subTypeLinkPart = DocumentTypeEnum[document.subTypeId];\r\n\r\n var viewData = findDocumentViewForId(document.typeId, document.subTypeId);\r\n\r\n const homeLink = `/`;\r\n const moduleLink = viewData?.module.url ?? `/${moduleLinkPart}`;\r\n const typeLink = viewData?.type.url ?? `/${moduleLinkPart}/${typeLinkPart}`;\r\n const subTypeLink = viewData?.subType?.url ?? `/${moduleLinkPart}/${subTypeLinkPart}`;\r\n\r\n return (\r\n <>\r\n \r\n Home\r\n {!documentLoadError &&\r\n <>\r\n  > {document.module}\r\n  > {document.type}\r\n {subTypeLinkPart !== undefined &&\r\n <> > {document.subType}\r\n }\r\n  > {document.title}\r\n \r\n }\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n <>\r\n {documentId > 0 ?\r\n \r\n :\r\n \r\n }\r\n\r\n
\r\n {documentLoadError ?\r\n
{documentLoadError}
\r\n :\r\n <>\r\n
\r\n \r\n \r\n \r\n }\r\n
\r\n\r\n 0} onClose={clearModals} onUpdate={onDocInfoUpdate} documentId={showDocumentInfo} />\r\n\r\n {props.docId !== undefined &&\r\n \r\n }\r\n \r\n );\r\n}\r\n\r\ninterface MatchParams {\r\n documentId: string;\r\n page: string;\r\n search: string;\r\n}\r\n\r\nexport const PDFViewer = (props: RouteComponentProps) => {\r\n const docId = props.match.params.documentId;\r\n const page = props.match.params.page ? parseInt(props.match.params.page) : 1;\r\n const searchTerm = props.match.params.search;\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\ninterface StaticFileParams {\r\n staticFile: string;\r\n page?: string;\r\n}\r\n\r\nexport const StaticFileViewer = (props: StaticFileParams) => {\r\n const staticFile = props.staticFile;\r\n const page = props.page ? parseInt(props.page) : 1;\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import * as React from \"react\";\r\nimport { useEffect, useState, } from \"react\";\r\nimport { getActionableDocuments } from \"shared/services/railDocumentsApi\";\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { Button, Card } from 'reactstrap';\r\nimport { AnnouncementOutlined, KeyboardArrowRightOutlined } from '@material-ui/icons';\r\nimport Documents from \"./DocumentGrid\"\r\nimport './grid-cards.css'\r\nimport { RailDocument } from \"../../shared/models/api/models\";\r\nimport { AwaitingActionFilter } from \"../ui/DocumentRules\";\r\n\r\nconst MyActions = (props: { maxResults: number }) => {\r\n const [documents, setDocuments] = useState(null as RailDocument[] | null);\r\n const history = useHistory();\r\n\r\n const goToMyAwaitingActionList = () => history.push(AwaitingActionFilter.url);\r\n\r\n let downloadedDocuments = null as RailDocument[] | null;\r\n const updateDocuments = async () => {\r\n downloadedDocuments = await getActionableDocuments();\r\n }\r\n\r\n const documentListModalsClosed = () => {\r\n if (downloadedDocuments !== null && downloadedDocuments.length > 0) {\r\n const docs = downloadedDocuments;\r\n setDocuments(docs);\r\n downloadedDocuments = null;\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n }, [downloadedDocuments]);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const items = await getActionableDocuments();\r\n\r\n if (mounted) {\r\n setDocuments(items);\r\n }\r\n };\r\n\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n const View = () => {\r\n const history = useHistory();\r\n\r\n const [selectedItems, setSelectedItems] = useState([] as number[]);\r\n\r\n const clearSelectedItems = () => {\r\n setSelectedItems([] as number[]);\r\n };\r\n\r\n const documentButtonAction = (docId: number) => {\r\n history.push(`/pdf/view/${docId}`);\r\n };\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n My actionable documents\r\n {documents &&\r\n \r\n {\r\n documents?.length > props.maxResults\r\n ? props.maxResults\r\n : documents.length\r\n } of {\r\n documents.length\r\n } result{documents.length > 1 ? \"s\" : \"\"}\r\n \r\n \r\n }\r\n {!documents &&\r\n Loading...\r\n }\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default MyActions;\r\n","import { httpGet, httpPost } from 'shared/services/httpService';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport {\r\n FatigueAssessmentForm,\r\n FatigueAssessmentDetailsModel,\r\n SubmitAssessmentModel,\r\n SubmitOnBehalfModel,\r\n DashboardQueryModel,\r\n FatigueAssessmentNote,\r\n FatigueAssessmentAddNoteModel,\r\n SubmitActionModel,\r\n FatigueAssessmentAssign,\r\n FatigueAssessmentAssignResult,\r\n} from 'shared/models/api/models';\r\n\r\nconst fatigueAssessmentUriPath = new URL('/api/fatigue', appSettings.api.portalApi);\r\nconst fatigueAssessmentDetails = `${fatigueAssessmentUriPath}/details`;\r\nconst fatigueAssessmentSubmitFa = `${fatigueAssessmentUriPath}/fatigueassessment`;\r\nconst fatigueAssessmentSubmitOnBehalf = `${fatigueAssessmentUriPath}/onbehalf`;\r\nconst fatigueAssessmentsUri = `${fatigueAssessmentUriPath}/current-user/actionable`;\r\nconst dashboardFatigueAssessmentsUri = `${fatigueAssessmentUriPath}/dashboard`;\r\nconst fatigueAssessmentsAddNoteUri = `${fatigueAssessmentUriPath}/addnote`;\r\nconst fatigueAssessmentSaveActionUri = `${fatigueAssessmentUriPath}/action`;\r\nconst fatigueAssessmentAssignUri = `${fatigueAssessmentUriPath}/assignassessments`;\r\n\r\nexport const getFatigueAssessment = async (id: number) => {\r\n return await httpGet(`${fatigueAssessmentUriPath}/${id}`)\r\n .catch(e => { console.log(e); return {} as FatigueAssessmentForm });\r\n};\r\n\r\nexport const getFatigueAssessmentDetails = async (id: number) => {\r\n return await httpGet(`${fatigueAssessmentDetails}/${id}`)\r\n .catch(e => { console.log(e); return {} as FatigueAssessmentDetailsModel });\r\n};\r\n\r\nexport const getFatigueAssessments = async () => {\r\n const myForm = await httpGet(fatigueAssessmentsUri.toString())\r\n .catch((e) => {\r\n console.log(e);\r\n }) as FatigueAssessmentForm[];\r\n return myForm;\r\n};\r\n\r\nexport const getDashboardFatigueAssessments = async (form: DashboardQueryModel) => {\r\n const assessments = await httpPost(dashboardFatigueAssessmentsUri.toString(), form)\r\n .catch((e) => {\r\n console.log(e);\r\n }) as FatigueAssessmentForm[];\r\n return assessments;\r\n};\r\n\r\nexport const submitFatigueAssessment = async (form: SubmitAssessmentModel) => {\r\n return await httpPost(`${fatigueAssessmentSubmitFa}`, form)\r\n .catch(e => { console.log(e); return -1 });\r\n};\r\n\r\nexport const submitOnBehalfAssessment = async (form: SubmitOnBehalfModel) => {\r\n return await httpPost(`${fatigueAssessmentSubmitOnBehalf}`, form)\r\n .catch(e => { console.log(e); return -1 });\r\n};\r\n\r\nexport const fatigueAssessmentAddNote = async (note: FatigueAssessmentAddNoteModel) => {\r\n const result = await httpPost(`${fatigueAssessmentsAddNoteUri}`, note)\r\n .catch(e => { console.log(e); return null });\r\n return result;\r\n};\r\n\r\nexport const saveAction = async (action: SubmitActionModel) => {\r\n const result = await httpPost(`${fatigueAssessmentSaveActionUri}`, action)\r\n .catch(e => { console.log(e); return null });\r\n return result;\r\n};\r\n\r\nexport const assign = async (faAssign: FatigueAssessmentAssign) => {\r\n const result = await httpPost(`${fatigueAssessmentAssignUri}`, faAssign)\r\n .catch(e => { console.log(e); return null });\r\n return result;\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport { useHistory } from \"react-router-dom\"\r\nimport useSelector from 'hooks/useSelector';\r\nimport { IRouteConfig } from 'helpers/route-config';\r\nimport { userHasPermission } from 'hooks/useRoles';\r\nimport { UserProfile } from 'shared/models/site/user-profile';\r\nimport { ExpandMore } from '@material-ui/icons';\r\nimport './FatigueAssessments.css'\r\n\r\nimport {\r\n fatigueAssessmentRoute,\r\n fatigueAssessmentBlankFormRoute,\r\n fatigueAssessmentOnBehalfRoute,\r\n fatigueAssessmentAssignRoute,\r\n fatigueAssessmentDashboardPathRoute,\r\n fatigueAssessmentPendingPathRoute,\r\n fatigueAssessmentActionPathRoute,\r\n fatigueAssessmentRevisitPathRoute,\r\n fatigueAssessmentCompletedPathRoute,\r\n fatigueAssessmentOverviewPathRoute\r\n} from \"components/portal/fatigueAssessment/FatigueAssessmentRoutes\";\r\n\r\nimport {\r\n Label,\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu\r\n} from 'reactstrap';\r\n\r\n\r\nexport interface ISelectOption {\r\n label: string;\r\n value: string;\r\n getRoute(): IRouteConfig;\r\n subitem?: boolean;\r\n}\r\n\r\nconst getFatigueAssessmentRoute = () => { return fatigueAssessmentRoute; }\r\nconst getFatigueAssessmentDashboardPathRoute = () => { return fatigueAssessmentDashboardPathRoute; }\r\nconst getFatigueAssessmentPendingPathRoute = () => { return fatigueAssessmentPendingPathRoute; }\r\nconst getFatigueAssessmentActionPathRoute = () => { return fatigueAssessmentActionPathRoute; }\r\nconst getFatigueAssessmentRevisitPathRoute = () => { return fatigueAssessmentRevisitPathRoute; }\r\nconst getFatigueAssessmentCompletedPathRoute = () => { return fatigueAssessmentCompletedPathRoute; }\r\nconst getFatigueAssessmentOverviewPathRoute = () => { return fatigueAssessmentOverviewPathRoute; }\r\nconst getFatigueAssessmentFormRoute = () => { return fatigueAssessmentBlankFormRoute; }\r\nconst getFatigueAssessmentOnBehalfRoute = () => { return fatigueAssessmentOnBehalfRoute; }\r\nconst getFatigueAssessmentAssignRoute = () => { return fatigueAssessmentAssignRoute; }\r\n\r\nexport const myForm = {\r\n label: \"Pending\",\r\n value: \"myForm\",\r\n getRoute: getFatigueAssessmentRoute\r\n} as ISelectOption;\r\n\r\nexport const shiftSummaryDashboard = {\r\n label: \"Shift Summary Dashboard\",\r\n value: \"shiftSummaryDashboard\",\r\n getRoute: getFatigueAssessmentDashboardPathRoute\r\n} as ISelectOption;\r\n\r\nexport const shiftSummaryDashboardPending = {\r\n label: \"Pending Fatigue Assessments\",\r\n value: \"shiftSummaryDashboardPending\",\r\n getRoute: getFatigueAssessmentPendingPathRoute,\r\n subitem: true\r\n} as ISelectOption;\r\n\r\nexport const shiftSummaryDashboardToAction = {\r\n label: \"Fatigue Assessments to action\",\r\n value: \"shiftSummaryDashboardToAction\",\r\n getRoute: getFatigueAssessmentActionPathRoute,\r\n subitem: true\r\n} as ISelectOption;\r\n\r\nexport const shiftSummaryDashboardToRevisit = {\r\n label: \"Fatigue Assessments to revisit\",\r\n value: \"shiftSummaryDashboardToRevisit\",\r\n getRoute: getFatigueAssessmentRevisitPathRoute,\r\n subitem: true\r\n} as ISelectOption;\r\n\r\nexport const shiftSummaryDashboardCompleted = {\r\n label: \"Completed - no action required\",\r\n value: \"shiftSummaryDashboardCompleted\",\r\n getRoute: getFatigueAssessmentCompletedPathRoute,\r\n subitem: true\r\n} as ISelectOption;\r\n\r\n\r\nexport const shiftSummaryDashboardOverview = {\r\n label: \"Overview\",\r\n value: \"shiftSummaryDashboardOverview\",\r\n getRoute: getFatigueAssessmentOverviewPathRoute,\r\n subitem: true\r\n} as ISelectOption;\r\n\r\n\r\nexport const fatigueAssessmentForm = {\r\n label: \"Form\",\r\n value: \"fatigueAssessmentForm\",\r\n getRoute: getFatigueAssessmentFormRoute\r\n} as ISelectOption;\r\n\r\nexport const fatigueAssessmentOnBehalf = {\r\n label: \"On-behalf form\",\r\n value: \"fatigueAssessmentOnBehalf\",\r\n getRoute: getFatigueAssessmentOnBehalfRoute\r\n} as ISelectOption;\r\n\r\nexport const fatigueAssessmentAssign = {\r\n label: \"Assign\",\r\n value: \"fatigueAssessmentAssign\",\r\n getRoute: getFatigueAssessmentAssignRoute\r\n} as ISelectOption;\r\n\r\ninterface FatigueAssessmentPageSelectorProps {\r\n selectedPage: ISelectOption\r\n}\r\n\r\nexport const FatigueAssessmentPageSelector = (props: FatigueAssessmentPageSelectorProps) => {\r\n const [currentSelection, setCurrentSelection] = useState(props.selectedPage);\r\n const [selectOptions, setSelectOptions] = useState([props.selectedPage] as ISelectOption[]);\r\n const profile = useSelector(state => state.profile);\r\n const history = useHistory();\r\n\r\n const getSelectOptions = (user: UserProfile) => {\r\n var options: ISelectOption[] = [];\r\n options.push(myForm);\r\n\r\n options.push(fatigueAssessmentForm);\r\n\r\n if (userHasPermission(\"web.admin.fatigue-assessment.on-behalf\", user?.roles)) {\r\n options.push(fatigueAssessmentOnBehalf);\r\n }\r\n\r\n if (userHasPermission(\"web.admin.fatigue-assessment.shift-summary-dashboard\", user?.roles)) {\r\n options.push(fatigueAssessmentAssign);\r\n options.push(shiftSummaryDashboard);\r\n options.push(shiftSummaryDashboardPending);\r\n options.push(shiftSummaryDashboardToAction);\r\n options.push(shiftSummaryDashboardToRevisit);\r\n options.push(shiftSummaryDashboardCompleted);\r\n options.push(shiftSummaryDashboardOverview);\r\n }\r\n\r\n return options;\r\n }\r\n\r\n const selectOnChange = (selectOption: ISelectOption) => {\r\n var path = selectOption.getRoute().path;\r\n if (selectOption !== currentSelection && typeof (path) === 'string') {\r\n history.push(path);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (currentSelection === undefined) {\r\n setCurrentSelection(myForm);\r\n }\r\n\r\n if (profile && selectOptions.length <= 1) {\r\n setSelectOptions(getSelectOptions(profile));\r\n }\r\n }, [profile, selectOptions]);\r\n\r\n return (\r\n
\r\n \r\n \r\n
{currentSelection.label}
\r\n
\r\n \r\n \r\n {selectOptions.map((option) => (\r\n selectOnChange(option)}>\r\n \r\n
\r\n\r\n ))}\r\n \r\n \r\n
\r\n );\r\n\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport useSelector from 'hooks/useSelector';\r\nimport { userHasPermission } from 'hooks/useRoles';\r\n\r\nimport {\r\n ISelectOption,\r\n myForm,\r\n shiftSummaryDashboard,\r\n shiftSummaryDashboardPending,\r\n shiftSummaryDashboardToAction,\r\n shiftSummaryDashboardToRevisit,\r\n shiftSummaryDashboardCompleted,\r\n shiftSummaryDashboardOverview,\r\n fatigueAssessmentForm,\r\n fatigueAssessmentOnBehalf,\r\n fatigueAssessmentAssign\r\n} from \"./FatigueAssessmentPageSelector\";\r\n\r\nimport {\r\n ChevronRight as RightIcon,\r\n ExpandMore as DownIcon\r\n} from '@material-ui/icons';\r\n\r\nimport { ReactComponent as FatigueAssessmentIcon } from \"assets/icons/fatigue-assessment-filled.svg\";\r\nimport './FatigueAssessments.css'\r\n\r\n\r\ninterface FatigueAssessmentSidebarProps {\r\n selectedPage: ISelectOption\r\n}\r\n\r\nexport const FatigueAssessmentSidebar = (props: FatigueAssessmentSidebarProps) => {\r\n const [currentSelection, setCurrentSelection] = useState(props.selectedPage);\r\n const profile = useSelector(state => state.profile);\r\n\r\n useEffect(() => {\r\n if (currentSelection === undefined) {\r\n setCurrentSelection(myForm);\r\n }\r\n }, [profile]);\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n \r\n
Fatigue Assessment
\r\n
\r\n\r\n
\r\n \r\n
\r\n
{myForm.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
{fatigueAssessmentForm.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n {profile && userHasPermission(\"web.admin.fatigue-assessment.on-behalf\", profile?.roles) &&\r\n
\r\n \r\n
\r\n
{fatigueAssessmentOnBehalf.label}
\r\n
\r\n
\r\n \r\n
\r\n }\r\n\r\n {profile && userHasPermission(\"web.admin.fatigue-assessment.shift-summary-dashboard\", profile?.roles) &&\r\n <>\r\n\r\n
\r\n \r\n
\r\n
{fatigueAssessmentAssign.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboard.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n {currentSelection.subitem &&\r\n <>\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboardOverview.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboardPending.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboardToAction.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboardToRevisit.label}
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
{shiftSummaryDashboardCompleted.label}
\r\n
\r\n
\r\n \r\n
\r\n \r\n }\r\n \r\n }\r\n
\r\n\r\n {profile && userHasPermission(\"web.admin.fatigue-assessment.shift-summary-dashboard\", profile?.roles) &&\r\n
\r\n
Links
\r\n
    \r\n
  • Fatigue Assessment reporting
  • \r\n
\r\n
\r\n }\r\n\r\n \r\n );\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { FatigueAssessmentPageSelector, ISelectOption } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentSidebar } from \"./FatigueAssessmentSidebar\";\r\nimport { ReactComponent as FatigueAssessmentIcon } from \"assets/icons/fatigue-assessment-filled.svg\";\r\nimport './FatigueAssessments.css'\r\n\r\n\r\ninterface FatigueAssessmentPageProps {\r\n selectedPage: ISelectOption,\r\n children?: React.ReactNode\r\n}\r\n\r\nconst FatigueAssessmentPage = (props: FatigueAssessmentPageProps) => {\r\n const [currentSelection] = useState(props.selectedPage);\r\n\r\n useEffect(() => {\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 Fatigue Assessment\r\n
\r\n \r\n\r\n
\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 );\r\n}\r\n\r\nexport default FatigueAssessmentPage;\r\n","export enum FatigueAssessmentView {\r\n MyForm,\r\n Pending,\r\n ToAction,\r\n ToRevisit,\r\n Overview,\r\n Completed\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Replay as ReplayIcon } from '@material-ui/icons';\r\nimport FatigueAssessmentPage from \"./FatigueAssessmentPage\";\r\nimport FatigueAssessmentCardList from \"./FatigueAssessmentCardList\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport { myForm } from \"./FatigueAssessmentPageSelector\";\r\n\r\n\r\nconst FatigueAssessments = () => {\r\n return (\r\n \r\n
\r\n }\r\n />\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default FatigueAssessments;\r\n","import { BehaviorSubject } from 'rxjs';\r\nimport { SubmitActionModel } from 'shared/models/api/models';\r\n\r\n\r\nexport type FatigueAssessmentActionState = {\r\n action: SubmitActionModel,\r\n originalAction: SubmitActionModel,\r\n actionValidation: {},\r\n checkValidation: boolean\r\n}\r\n\r\nconst emptyAction: SubmitActionModel = {\r\n affectedSupervisors: [] as number[],\r\n confidential: false\r\n};\r\n\r\nconst createInitialState = (): FatigueAssessmentActionState => ({\r\n action: Object.assign({}, emptyAction),\r\n originalAction: emptyAction,\r\n actionValidation: {},\r\n checkValidation: false\r\n});\r\n\r\nconst fatigueAssessmentActionStateSubject = new BehaviorSubject(createInitialState());\r\n\r\nexport const updateActionState = (action: SubmitActionModel) => {\r\n fatigueAssessmentActionState.setState(s => {\r\n s.action = action;\r\n });\r\n}\r\n\r\nconst updateValidationState = (validation: {}) => {\r\n fatigueAssessmentActionState.setState(s => {\r\n s.actionValidation = validation;\r\n });\r\n}\r\n\r\nconst isValueInvalid = (value: any) => {\r\n if (value === undefined) return true;\r\n if (typeof (value) === 'string' && !value.trim()) return true;\r\n return false;\r\n}\r\n\r\nconst validate = (field: string, value: any) => {\r\n updateValidationState({ ...fatigueAssessmentActionStateSubject.value.actionValidation, [field]: isValueInvalid(value) });\r\n}\r\n\r\nexport const handleActionChange = (field: string) => (event: any) => {\r\n let value = (event.target?.value !== undefined) ? event.target?.value : event;\r\n updateActionState({ ...fatigueAssessmentActionStateSubject.value.action, [field]: value });\r\n validate(field, value);\r\n};\r\n\r\nexport const enableActionValidation = () => {\r\n fatigueAssessmentActionState.setState(s => { s.checkValidation = true });\r\n};\r\n\r\nexport const resetActionValidation = () => {\r\n fatigueAssessmentActionState.setState(s => { s.actionValidation = {}, s.checkValidation = false });\r\n};\r\n\r\nexport const actionFieldInvalid = (field: string) => {\r\n if (!fatigueAssessmentActionStateSubject.value.checkValidation) {\r\n return false;\r\n }\r\n let value = Object(fatigueAssessmentActionStateSubject.value.actionValidation)[field] as boolean;\r\n if (value === undefined) return true;\r\n return value;\r\n}\r\n\r\nconst requiredFields = [\r\n [\"controlsImplementedById\"],\r\n [\"noFurtherAction\", \"actionTaken\", \"sentHome\"],\r\n [\"comment\"],\r\n [\"supervisorSignature\"]\r\n];\r\n\r\nexport const actionStateInvalid = (conditionalFields: string[][] = []) => {\r\n let invalidGroups = 0;\r\n\r\n const groups = [...requiredFields, ...conditionalFields];\r\n\r\n //ensure at least 1 field per group has a value\r\n groups.forEach(group => {\r\n let valid = false;\r\n group.forEach(field => {\r\n if (!actionFieldInvalid(field)) valid = true;\r\n });\r\n if (!valid) invalidGroups++;\r\n });\r\n\r\n return invalidGroups;\r\n}\r\n\r\nexport const fatigueAssessmentActionState = {\r\n subscribe: (setState: any) => fatigueAssessmentActionStateSubject.subscribe(setState),\r\n setState: (fn: (state: FatigueAssessmentActionState) => void) => {\r\n var newState = Object.assign({}, fatigueAssessmentActionStateSubject.getValue());\r\n fn(newState);\r\n fatigueAssessmentActionStateSubject.next(newState);\r\n },\r\n reset: () => {\r\n fatigueAssessmentActionStateSubject.next(createInitialState());\r\n }\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport { getAllEmployees, getAllSupervisors, getAllUsers } from 'shared/services/userApi';\r\nimport { getLocationsWithDetail } from 'shared/services/locationApi';\r\nimport { IUserSearchResult, LocationDetail } from 'shared/models/api/models';\r\nimport { toISOLocalDate, isoDateStringToBrowserSafeString } from 'shared/models/mapping/mapping';\r\nimport { NearMeOutlined, SupervisorAccountOutlined, ExpandMore, ExpandLess } from '@material-ui/icons';\r\nimport Form from 'react-bootstrap/Form'\r\n\r\nimport { SubmitActionModel } from 'shared/models/api/models';\r\nimport { List, IListItemProps } from 'components/ui/Lists';\r\nimport { LabelledCheckbox } from 'components/ui/LabelledCheckbox';\r\nimport { FatigueAssessmentActionState, fatigueAssessmentActionState } from './FatigueAssessmentActionState'\r\nimport {\r\n FatigueAssessmentFormState,\r\n fatigueAssessmentFormState as fs,\r\n} from './FatigueAssessmentFormState'\r\n\r\nimport {\r\n FormFeedback,\r\n Input,\r\n Label,\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu,\r\n DropdownItem\r\n} from 'reactstrap';\r\n\r\ninterface OptionValueLabel {\r\n value: number;\r\n label: string;\r\n}\r\n\r\ninterface AnswerProps {\r\n onAnswerUpdate: (value: any) => any;\r\n invalid?: boolean;\r\n optional?: boolean;\r\n}\r\n\r\nconst getAlertOptions = () => {\r\n let o = [\r\n { value: 0, label: \"Feeling active, alert or wide awake\" },\r\n { value: 1, label: \"Functioning at a good level, but not at peak, able to concentrate\" },\r\n { value: 2, label: \"OK, but not fully alert\" },\r\n { value: 3, label: \"A bit groggy, hard to concentrate \" },\r\n { value: 4, label: \"Sleepy, groggy, would like to lie down\" },\r\n ] as OptionValueLabel[];\r\n return o;\r\n}\r\n\r\n\r\nexport const alertOptions = getAlertOptions();\r\n\r\nconst getYesNoOptions = () => {\r\n let o = [\r\n { value: 1, label: \"Yes\" },\r\n { value: 0, label: \"No\" }\r\n ] as OptionValueLabel[];\r\n return o;\r\n}\r\nexport const yesNoOptions = getYesNoOptions();\r\n\r\nconst getSexOptions = () => {\r\n let o = [\r\n { value: 0, label: \"Male\" },\r\n { value: 1, label: \"Female\" },\r\n { value: 2, label: \"Prefer not to disclose\" }\r\n ] as OptionValueLabel[];\r\n return o;\r\n}\r\nexport const sexOptions = getSexOptions();\r\n\r\nconst getRiskOptions = () => {\r\n let o = [\r\n { value: 0, label: \"N/A\" },\r\n { value: 1, label: \"Low\" },\r\n { value: 2, label: \"Medium\" },\r\n { value: 3, label: \"High\" }\r\n ] as OptionValueLabel[];\r\n return o;\r\n}\r\nexport const riskOptions = getRiskOptions();\r\n\r\nconst getActionOptions = () => {\r\n let o = {\r\n noFurtherAction: \"No further action required\",\r\n noActionTakenPlannedLeave: \"Planned Leave\",\r\n noActionTakenUnplannedLeave: \"Unplanned Leave\",\r\n actionTaken: \"Action has been taken\",\r\n actionTakenRevisit: \"Revisit Fatigue Assessment\",\r\n actionTakenBuddyUp: \"Buddy Up\",\r\n actionTakenRemoveFromSafetyCritical: \"Remove from Safety Critical\",\r\n actionTakenRemainLocal: \"Remain Local\",\r\n actionTakenAltDuties: \"Alternate Duties - Office Bound\",\r\n sentHome: \"Sent Home\"\r\n }\r\n return o;\r\n}\r\nexport const actionOptions = getActionOptions();\r\n\r\n\r\nconst getOnbehalfOptions = () => {\r\n let o = [\r\n { value: 0, label: \"DSS Microsleep\" },\r\n { value: 1, label: \"Person unable to log on\" },\r\n { value: 2, label: \"Previous medium high risk recorded\" },\r\n { value: 3, label: \"Remote Sign On\" },\r\n { value: -1, label: \"Other\" }\r\n ] as OptionValueLabel[];\r\n return o;\r\n}\r\nexport const onbehalfOptions = getOnbehalfOptions();\r\n\r\ninterface SelectAnswerProps extends AnswerProps {\r\n options: OptionValueLabel[];\r\n selectedAnswer?: OptionValueLabel;\r\n}\r\n\r\nexport const DropdownSelect = (props: SelectAnswerProps) => {\r\n const [selectedAnswer, setSelectedAnswer] = useState(props.selectedAnswer);\r\n\r\n const answerSelected = (choice: OptionValueLabel) => {\r\n setSelectedAnswer(choice);\r\n props.onAnswerUpdate(choice);\r\n }\r\n\r\n const isOptional = () => props.optional === true; //default to false if not provided\r\n\r\n useEffect(() => {\r\n // Fixes a bug on safari where dropdown unpopulates\r\n if (props.selectedAnswer) {\r\n setSelectedAnswer(props.selectedAnswer);\r\n }\r\n }, [props.selectedAnswer]);\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n {selectedAnswer ? selectedAnswer.label : Select}\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n {props.options.map((choice) => (\r\n answerSelected(choice)}>\r\n \r\n \r\n ))}\r\n \r\n
\r\n Required\r\n
\r\n );\r\n}\r\n\r\n\r\nexport const HoursChoices = (props: AnswerProps) => {\r\n const minTime = 4.5;\r\n const minTimeMessage = \"Less than 5 hours\";\r\n const maxTime = 18;\r\n const maxTimeMessage = \"18 hours or more\";\r\n const incrementTime = 0.5;\r\n\r\n const options = () => {\r\n let timeOptions = [] as number[];\r\n for (let time = minTime; time <= maxTime; time += incrementTime) {\r\n timeOptions.push(time);\r\n }\r\n\r\n let mappedOptions = timeOptions.map(option => ({ value: option, label: displayTime(option) })); \r\n return mappedOptions;\r\n }\r\n\r\n const displayTime = (time: number) => {\r\n if (time == minTime) {\r\n return minTimeMessage;\r\n }\r\n if (time == maxTime) {\r\n return maxTimeMessage;\r\n }\r\n const hours = Math.floor(time);\r\n const minutes = (time * 60) % 60;\r\n return `${ hours }:${ minutes.toString().padStart(2, '0') }`;\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n\r\nexport const AlertChoices = (props: AnswerProps) => {\r\n return (\r\n <>\r\n {alertOptions.map((option) => (\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n ))}\r\n Required\r\n \r\n );\r\n}\r\n\r\n\r\nexport const AlcoholicDrinksChoices = (props: AnswerProps) => {\r\n const minDrinks = 0;\r\n const maxDrinks = 10;\r\n const maxDrinksMessage = \"10 or more\";\r\n\r\n const options = () => {\r\n let drinksOptions = [] as number[];\r\n for (let drinks = minDrinks; drinks <= maxDrinks; drinks += 1) {\r\n drinksOptions.push(drinks);\r\n }\r\n\r\n let mappedOptions = drinksOptions.map(option => ({ value: option, label: displayDrinksChoices(option) }));\r\n return mappedOptions;\r\n }\r\n\r\n const displayDrinksChoices = (drinks: number) => {\r\n if (drinks == maxDrinks) {\r\n return maxDrinksMessage;\r\n }\r\n return `${ drinks }`;\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n\r\n\r\nexport const SexChoices = (props: AnswerProps) => {\r\n return (\r\n \r\n );\r\n}\r\n\r\n\r\nexport const OnbehalfChoices = (props: AnswerProps) => {\r\n return (\r\n \r\n );\r\n}\r\n\r\ninterface IYesNoProps extends AnswerProps {\r\n name: string;\r\n}\r\n\r\nexport const YesNoChoice = (props: IYesNoProps) => {\r\n return (\r\n <>\r\n {yesNoOptions.map((option) => (\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n ))}\r\n Required\r\n \r\n );\r\n}\r\n\r\n\r\nexport const YesNoCheck = (props: IYesNoProps) => {\r\n return (\r\n <>\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n Required\r\n \r\n );\r\n}\r\n\r\n\r\nexport const UserListItem = (props: IListItemProps) =>\r\n
props.toggle(props.item)}>\r\n {props.item.fullname}\r\n
\r\n {props.item.city}\r\n \r\n {props.item.supervisor?.length > 0 &&\r\n {props.item.supervisor}\r\n }\r\n \r\n
\r\n
;\r\n\r\n\r\ninterface UserChoiceProps extends AnswerProps {\r\n defaultUser?: IUserSearchResult,\r\n multichoice?: boolean,\r\n supervisorFilter?: boolean,\r\n clearOnSelect?: boolean,\r\n subscribeActionField?: string,\r\n assign?: boolean\r\n}\r\n\r\n\r\nexport const UserChoice = (props: UserChoiceProps) => {\r\n const [users, setUsers] = useState((props.defaultUser ? [props.defaultUser] : []) as IUserSearchResult[]);\r\n const [selectedUsers, setSelectedUsers] = useState(props.defaultUser ? [props.defaultUser] : [] as IUserSearchResult[]);\r\n const [summaryText, setSummaryText] = useState(\"\");\r\n const [filterText, setFilterText] = useState(\"\");\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n const [action, setAction] = useState({} as SubmitActionModel);\r\n\r\n const selectUser = (user: IUserSearchResult) => {\r\n if (props.multichoice) {\r\n if (selectedUsers.includes(user)) {\r\n setSelectedUsers(selectedUsers.filter(u => u !== user));\r\n }\r\n else {\r\n setSelectedUsers(selectedUsers.concat([user]));\r\n }\r\n }\r\n else {\r\n setSelectedUsers([user]);\r\n setIsExpanded(false);\r\n }\r\n\r\n props.onAnswerUpdate(user);\r\n };\r\n\r\n const filterUsersAsync = async (searchTerm: string, users?: IUserSearchResult[]): Promise => {\r\n const lcName = searchTerm.toLowerCase();\r\n\r\n const result = await (users ?? []).filter(u => {\r\n return (u.fullname.toLowerCase().indexOf(lcName) > -1\r\n || (u.email && u.email.toLowerCase().indexOf(lcName) > -1));\r\n });\r\n\r\n const usersText = result.length === 1 ? \"user\" : \"users\";\r\n\r\n setSummaryText(`${result.length} ${usersText} found for search \"${searchTerm}\".`);\r\n\r\n return result;\r\n };\r\n\r\n const filterSelectedUsers = (userIds: number[]) => {\r\n let users = selectedUsers.filter(u => u.id !== null && userIds.includes(u.id));\r\n setSelectedUsers(users);\r\n }\r\n\r\n useEffect(() => {\r\n if (typeof (props.subscribeActionField) === 'string') {\r\n let key = props.subscribeActionField as keyof SubmitActionModel;\r\n let userIds = action[key] as number[];\r\n filterSelectedUsers(userIds);\r\n }\r\n }, [action]);\r\n\r\n useEffect(() => {\r\n if (!props.subscribeActionField) {\r\n return;\r\n }\r\n const sub = fatigueAssessmentActionState.subscribe((s: FatigueAssessmentActionState) => {\r\n setAction(s.action);\r\n });\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n if (props.supervisorFilter !== true) {\r\n if (props.assign) {\r\n var users = await getAllUsers();\r\n } else {\r\n var users = await getAllEmployees();\r\n } \r\n }\r\n else {\r\n var users = await getAllSupervisors();\r\n }\r\n\r\n if (mounted) {\r\n setUsers(users.results);\r\n }\r\n };\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n
\r\n \r\n summary={summaryText}\r\n dataSource={users}\r\n searchDelayMs={1}\r\n displayLoadingData={true}\r\n refreshFilterOnDataSourceChange={true}\r\n listItemType={UserListItem}\r\n filterText={filterText}\r\n setFilterText={setFilterText}\r\n expanded={isExpanded}\r\n setExpanded={setIsExpanded}\r\n buildKey={(item: IUserSearchResult) => { return item.id; }}\r\n filterAsync={filterUsersAsync}\r\n selected={selectedUsers}\r\n toggleSelected={selectUser}\r\n invalid={props.invalid}\r\n noResultsMessage=\"No users found\"\r\n filterTextPlaceholder=\"Enter first name, last name or email address\"\r\n />\r\n {!isExpanded && selectedUsers.length === 1 && selectedUsers[0]?.id && !props.multichoice &&\r\n
{selectedUsers[0].fullname}
\r\n }\r\n Required\r\n\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface LocationChoiceProps extends AnswerProps {\r\n defaultLocationId?: number;\r\n}\r\n\r\nexport const OtherLocation = { value: -2, label: \"Other\" };\r\n\r\nexport const LocationChoice = (props: LocationChoiceProps) => {\r\n const [options, setOptions] = useState([] as OptionValueLabel[]);\r\n const [selectedAnswer, setSelectedAnswer] = useState(undefined as undefined | OptionValueLabel);\r\n\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const results = await getLocationsWithDetail();\r\n if (mounted) {\r\n let locations = results.filter(location => (location.siteMobileNumber ?? \"\") !== \"\").map(location => ({ value: location.id, label: `${ location.name } (${ location.siteMobileNumber })` }));\r\n locations.push(OtherLocation);\r\n setOptions(locations);\r\n if (props.defaultLocationId !== undefined) {\r\n props.onAnswerUpdate(props.defaultLocationId);\r\n let defaultLocationOption = locations.find(l => l.value === props.defaultLocationId);\r\n if (defaultLocationOption) {\r\n setSelectedAnswer(defaultLocationOption);\r\n }\r\n }\r\n }\r\n };\r\n\r\n\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n\r\ninterface DateChoiceProps extends AnswerProps {\r\n date?: Date\r\n}\r\n\r\nexport const DateChoice = (props: DateChoiceProps) => {\r\n const dayRange = 1;\r\n const currentDate = new Date();\r\n\r\n function addDays(date: Date, days: number) {\r\n let result = new Date(date);\r\n result.setDate(result.getDate() + days);\r\n return result;\r\n }\r\n\r\n const minDate = addDays(currentDate, dayRange * -1);\r\n const maxDate = addDays(currentDate, dayRange);\r\n\r\n const onChange = (e: React.ChangeEvent) => {\r\n props.onAnswerUpdate(e);\r\n }\r\n\r\n useEffect(() => {\r\n props.onAnswerUpdate(toISOLocalDate(props.date || currentDate));\r\n }, [])\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\n\r\ninterface TimeChoiceProps extends AnswerProps {\r\n time?: Date\r\n}\r\n\r\nexport const TimeChoice = (props: TimeChoiceProps) => {\r\n const currentDate = toISOLocalDate(new Date());\r\n\r\n function addMinutes(date: Date, minutes: number) {\r\n let result = new Date(date);\r\n result.setTime(result.getTime() + (minutes * 60000));\r\n return result;\r\n }\r\n const defaultTime = () => {\r\n let time = new Date('2001-01-01 00:00');\r\n if (typeof (props.time) === 'string') {\r\n time = new Date(isoDateStringToBrowserSafeString(props.time));\r\n }\r\n else {\r\n time = new Date();\r\n time = addMinutes(time, 60 - time.getMinutes());\r\n\r\n }\r\n return time;\r\n }\r\n\r\n const [selectedHour, setSelectedHour] = useState(defaultTime().getHours());\r\n const [selectedMinute, setSelectedMinute] = useState(defaultTime().getMinutes());\r\n\r\n\r\n const roundDateUpToNearestHalfHour = (dateInput: Date | string | undefined) => {\r\n let date = new Date(dateInput ?? `${ currentDate } ${ defaultTime() || '00:00' }`);\r\n if (date.getMinutes() % 30 !== 0) {\r\n date = addMinutes(date, 30 - date.getMinutes() % 30);\r\n }\r\n return date;\r\n }\r\n\r\n const timeFormat = (hour: number, minute: number) => {\r\n\r\n return `${ hour.toString().padStart(2, '0') }:${ minute.toString().padStart(2, '0') }`;\r\n }\r\n\r\n const roundSelectedTimeUpToNearestHalfHour = () => {\r\n let date = new Date(isoDateStringToBrowserSafeString(`${ currentDate } ${ timeFormat(selectedHour, selectedMinute) }`));\r\n let ft = roundDateUpToNearestHalfHour(date);\r\n if (date.getMinutes() % 30 !== 0) {\r\n setSelectedHour(ft.getHours())\r\n setSelectedMinute(ft.getMinutes())\r\n }\r\n props.onAnswerUpdate(`${ timeFormat(ft.getHours(), ft.getMinutes()) }`);\r\n }\r\n\r\n const onHourChange = (option: OptionValueLabel) => {\r\n var hour = Number(option.value);\r\n var minute = selectedMinute;\r\n setSelectedHour(hour);\r\n\r\n props.onAnswerUpdate(`${ timeFormat(hour, minute) }`);\r\n }\r\n\r\n const onMinuteChange = (option: OptionValueLabel) => {\r\n var hour = selectedHour;\r\n var minute = Number(option.value);\r\n setSelectedMinute(minute);\r\n props.onAnswerUpdate(`${ timeFormat(hour, minute) }`);\r\n }\r\n\r\n useEffect(() => {\r\n roundSelectedTimeUpToNearestHalfHour();\r\n }, [props.time])\r\n\r\n const hourOptions = () => {\r\n var options = [] as OptionValueLabel[];\r\n for (let i = 0; i < 24; i++) {\r\n options.push({ value: i, label: i.toString().padStart(2, '0') });\r\n } \r\n return options;\r\n }\r\n\r\n const minuteOptions = () => {\r\n var options = [\r\n { value: 0, label: '00' },\r\n { value: 30, label: '30' }\r\n ] as OptionValueLabel[]; \r\n return options;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n o.value == selectedHour)}\r\n />\r\n
\r\n
\r\n o.value == selectedMinute)}\r\n />\r\n
\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface TextInputProps extends AnswerProps {\r\n placeholder?: string;\r\n}\r\n\r\nexport const SingleLineTextInput = (props: TextInputProps) => {\r\n const [text, setText] = useState('');\r\n const maxLength = 100;\r\n\r\n const answerUpdate = (event: any) => {\r\n let value = (event?.target?.value || '').substring(0, maxLength) as string;\r\n props.onAnswerUpdate(value);\r\n setText(value);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n Required\r\n \r\n )\r\n}\r\n\r\nexport const MultilineTextInput = (props: TextInputProps) => {\r\n const [text, setText] = useState('');\r\n const maxLength = 500;\r\n\r\n const answerUpdate = (event: any) => {\r\n let value = (event?.target?.value || '').substring(0, maxLength) as string;\r\n props.onAnswerUpdate(value);\r\n setText(value);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n Required\r\n \r\n )\r\n}\r\n\r\n\r\ninterface RadioInputProps extends AnswerProps {\r\n name: string;\r\n id: string;\r\n label?: string;\r\n}\r\n\r\nexport const RadioInput = (props: RadioInputProps) => {\r\n return (\r\n
\r\n
\r\n { props.onAnswerUpdate(props.id)(e.target.checked) }} />\r\n
\r\n
\r\n \r\n
\r\n
\r\n )\r\n}\r\n\r\ninterface CheckBoxInputProps extends AnswerProps {\r\n id: string;\r\n label?: string;\r\n checked?: boolean;\r\n}\r\n\r\nexport const CheckBoxInput = (props: CheckBoxInputProps) => {\r\n const [checked, setChecked] = useState(false);\r\n\r\n return (\r\n
\r\n
\r\n {\r\n setChecked(e.target.checked);\r\n props.onAnswerUpdate(props.id)(e.target.checked);\r\n }} />\r\n
\r\n
\r\n \r\n
\r\n
\r\n )\r\n}\r\n","import React, { useState, useEffect } from 'react';\r\nimport { FormFeedback } from 'reactstrap';\r\nimport { Chip } from '@material-ui/core'\r\nimport Form from 'react-bootstrap/Form'\r\nimport { SubmitActionModel, IUserSearchResult } from 'shared/models/api/models';\r\nimport FatigueAssessmentQuestions from './FatigueAssessmentQuestions'\r\nimport { ToolTipButton } from \"components/menu/Labels\";\r\n\r\nimport {\r\n FatigueAssessmentActionState,\r\n fatigueAssessmentActionState,\r\n handleActionChange,\r\n actionFieldInvalid,\r\n resetActionValidation\r\n} from './FatigueAssessmentActionState'\r\n\r\nimport {\r\n UserChoice,\r\n SingleLineTextInput,\r\n MultilineTextInput,\r\n RadioInput,\r\n CheckBoxInput,\r\n actionOptions,\r\n} from './FormControls';\r\n\r\n\r\ninterface SupervisorChip {\r\n id: number;\r\n name: string;\r\n}\r\n\r\ninterface FatigueAssessmentActionProps {\r\n alternativeSupervisor?: boolean;\r\n}\r\n\r\nconst FatigueAssessmentAction = (props: FatigueAssessmentActionProps) => {\r\n const [action, setAction] = useState({} as SubmitActionModel)\r\n const [affectedSupervisorsChips, setAffectedSupervisorsChips] = useState([] as SupervisorChip[]);\r\n const [actionTakenSelected, setActionTakenSelected] = useState(false);\r\n const [noActionTakenSelected, setNoActionTakenSelected] = useState(false);\r\n const [render, setRender] = useState({});\r\n const q = FatigueAssessmentQuestions;\r\n\r\n const handleAffectedSupervisorSelected = () => (user: IUserSearchResult) => {\r\n if (!user || typeof (user.id) !== 'number') {\r\n return;\r\n }\r\n\r\n if (affectedSupervisorsChips.findIndex(supervisor => supervisor.id === user.id) > -1) {\r\n removeAffectedSupervisor(user.id);\r\n return;\r\n }\r\n\r\n const newSupervisors = [...affectedSupervisorsChips, { id: user.id, name: user.fullname } as SupervisorChip];\r\n setAffectedSupervisorsChips(newSupervisors);\r\n const newSupervisorIds = newSupervisors.map(user => user.id);\r\n handleActionChange(\"affectedSupervisors\")(newSupervisorIds);\r\n }\r\n\r\n const removeAffectedSupervisor = (userId: number) => {\r\n var index = affectedSupervisorsChips.findIndex(supervisor => supervisor.id === userId);\r\n if (index > -1) {\r\n var newSupervisors = [...affectedSupervisorsChips];\r\n newSupervisors.splice(index, 1);\r\n setAffectedSupervisorsChips(newSupervisors);\r\n const newSupervisorIds = newSupervisors.map(user => user.id);\r\n handleActionChange(\"affectedSupervisors\")(newSupervisorIds);\r\n }\r\n }\r\n\r\n const actionTakenUpdated = (field: string) => (event: any) => {\r\n if (typeof (event) !== 'boolean') {\r\n return;\r\n }\r\n\r\n let furtherAction = false;\r\n let actionTaken = false;\r\n\r\n if (field === \"noFurtherAction\") {\r\n furtherAction = true;\r\n }\r\n else if (field === \"actionTaken\") {\r\n actionTaken = true;\r\n }\r\n\r\n\r\n //Set top level radio buttons\r\n handleActionChange(\"noFurtherAction\")(furtherAction);\r\n handleActionChange(\"actionTaken\")(actionTaken);\r\n\r\n\r\n //Always uncheck all action taken second level check boxes when top level changes\r\n handleActionChange(\"actionTakenRevisit\")(false);\r\n handleActionChange(\"actionTakenBuddyUp\")(false);\r\n handleActionChange(\"actionTakenRemoveFromSafetyCritical\")(false);\r\n handleActionChange(\"actionTakenRemainLocal\")(false);\r\n handleActionChange(\"actionTakenAltDuties\")(false);\r\n handleActionChange(\"noActionTakenPlannedLeave\")(false);\r\n handleActionChange(\"noActionTakenUnplannedLeave\")(false);\r\n handleActionChange(\"sentHome\")(false);\r\n\r\n //Determine if actionTaken second level check boxes should be displayed\r\n setActionTakenSelected(field === \"actionTaken\");\r\n\r\n //Determine if noActionTaken second level check boxes should be displayed\r\n setNoActionTakenSelected(field === \"noFurtherAction\");\r\n\r\n }\r\n\r\n const actionTakenInvalid = () => {\r\n return actionFieldInvalid(\"noFurtherAction\") && actionFieldInvalid(\"actionTaken\") && actionFieldInvalid(\"sentHome\");\r\n }\r\n\r\n useEffect(() => {\r\n const sub = fatigueAssessmentActionState.subscribe((s: FatigueAssessmentActionState) => {\r\n setAction(s.action);\r\n setRender({}); //Cause new render on action change - needed for invalid fields to display as expected\r\n });\r\n resetActionValidation();\r\n\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n return (\r\n
\r\n\r\n
\r\n
{q.controlsImplementedBy.value}
\r\n
\r\n handleActionChange(\"controlsImplementedById\")(user.id)}\r\n invalid={actionFieldInvalid(\"controlsImplementedById\")} />\r\n
\r\n
\r\n\r\n
\r\n
{q.actionTakenGroup.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\r\n\r\n\r\n Required\r\n\r\n
\r\n
\r\n\r\n
\r\n
{q.actionComment.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.actionConfidential.value}
\r\n
\r\n
\r\n { handleActionChange(\"confidential\")(e.target.checked) }} />\r\n
\r\n
\r\n
\r\n\r\n
\r\n
{q.actionSupervisors.value}
\r\n
\r\n \r\n {affectedSupervisorsChips.map((supervisor) => (\r\n removeAffectedSupervisor(supervisor.id)} />\r\n ))}\r\n
\r\n
\r\n\r\n
\r\n
{q.actionSupervisorSignature.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n {props.alternativeSupervisor === true &&\r\n
\r\n
{q.actionAlternativeSupervisorReason.value}
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n
\r\n );\r\n}\r\n\r\nexport default FatigueAssessmentAction;\r\n","import { BehaviorSubject } from 'rxjs';\r\nimport { FatigueAssessmentForm } from 'shared/models/api/models';\r\n\r\n\r\nexport type FatigueAssessmentFormState = {\r\n form: FatigueAssessmentForm,\r\n originalForm: FatigueAssessmentForm,\r\n formValidation: boolean[],\r\n checkValidation: boolean\r\n}\r\n\r\nconst emptyForm: FatigueAssessmentForm = {\r\n id: -1\r\n};\r\n\r\nconst createInitialState = (): FatigueAssessmentFormState => ({\r\n form: Object.assign({}, emptyForm),\r\n originalForm: emptyForm,\r\n formValidation: [],\r\n checkValidation: false\r\n});\r\n\r\nconst fatigueAssessmentFormStateSubject = new BehaviorSubject(createInitialState());\r\n\r\nexport const updateFormState = (form: FatigueAssessmentForm) => {\r\n fatigueAssessmentFormState.setState(s => {\r\n s.form = form;\r\n });\r\n}\r\n\r\nconst updateValidationState = (validation: boolean[]) => {\r\n fatigueAssessmentFormState.setState(s => {\r\n s.formValidation = validation;\r\n });\r\n}\r\n\r\nconst isValueInvalid = (value: any) => {\r\n if (value === undefined) return true;\r\n if (typeof (value) === 'string' && !value.trim()) return true;\r\n return false;\r\n}\r\n\r\nconst validate = (field: string, value: any) => {\r\n updateValidationState({ ...fatigueAssessmentFormStateSubject.value.formValidation, [field]: isValueInvalid(value) });\r\n}\r\n\r\nexport const handleChange = (field: string) => (event: any) => {\r\n let value = event;\r\n\r\n if (value.target?.value !== undefined) {\r\n value = value.target.value;\r\n }\r\n if (value.value !== undefined) {\r\n value = value.value;\r\n }\r\n updateFormState({ ...fatigueAssessmentFormStateSubject.value.form, [field]: value });\r\n validate(field, value);\r\n\r\n};\r\n\r\nexport const handleCheckboxChange = (field: string) => (event: any) => {\r\n let value = event;\r\n if (value.target?.checked !== undefined) {\r\n value = value.target.checked;\r\n } else {\r\n value = false;\r\n }\r\n\r\n updateFormState({ ...fatigueAssessmentFormStateSubject.value.form, [field]: value });\r\n validate(field, value ? value : undefined);\r\n}\r\n\r\n// Handle a dropdown change using the label instead of the value\r\nexport const handleOptionTextChange = (field: string) => (event: any) => {\r\n updateFormState({ ...fatigueAssessmentFormStateSubject.value.form, [field]: event.label });\r\n validate(field, event.label);\r\n}\r\n\r\nexport const enableValidation = () => {\r\n fatigueAssessmentFormState.setState(s => { s.checkValidation = true });\r\n};\r\n\r\nexport const resetValidation = () => {\r\n fatigueAssessmentFormState.setState(s => { s.formValidation = [], s.checkValidation = false });\r\n};\r\n\r\nexport const fieldInvalid = (field: string) => {\r\n if (!fatigueAssessmentFormStateSubject.value.checkValidation) {\r\n return false;\r\n }\r\n let value = Object(fatigueAssessmentFormStateSubject.value.formValidation)[field] as boolean;\r\n if (value === undefined) return true;\r\n return value;\r\n}\r\n\r\nexport const fatigueAssessmentFormState = {\r\n subscribe: (setState: any) => fatigueAssessmentFormStateSubject.subscribe(setState),\r\n setState: (fn: (state: FatigueAssessmentFormState) => void) => {\r\n var newState = Object.assign({}, fatigueAssessmentFormStateSubject.getValue());\r\n fn(newState);\r\n fatigueAssessmentFormStateSubject.next(newState);\r\n },\r\n reset: () => {\r\n fatigueAssessmentFormStateSubject.next(createInitialState());\r\n }\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css';\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { FatigueAssessmentForm, SubmitActionModel } from 'shared/models/api/models';\r\nimport { submitFatigueAssessment, submitOnBehalfAssessment } from 'shared/services/fatigueAssessmentApi';\r\nimport { IUserSearchResult, SubmitAssessmentModel, SubmitOnBehalfModel } from 'shared/models/api/models';\r\nimport { isoDateStringToBrowserSafeString } from 'shared/models/mapping/mapping';\r\nimport { InfoOutlined as InfoIcon, Warning as WarningIcon } from '@material-ui/icons';\r\nimport InfoModal from \"components/ui/InfoModal\"\r\nimport { FormModal, FormModalSubHeader, FormModalPaddedBody, ModalButtonRow, ModalButton } from 'components/ui/FormModal';\r\nimport { fatigueAssessmentRoute } from 'components/portal/fatigueAssessment/FatigueAssessmentRoutes';\r\nimport { ToolTipButton, ToolTipQuestionButton } from \"components/menu/Labels\";\r\nimport { Button } from 'reactstrap';\r\nimport FatigueAssessmentQuestions from './FatigueAssessmentQuestions'\r\nimport FatigueAssessmentAction from './FatigueAssessmentAction'\r\n\r\nimport {\r\n HoursChoices,\r\n AlertChoices,\r\n AlcoholicDrinksChoices,\r\n SexChoices,\r\n YesNoChoice,\r\n UserChoice,\r\n LocationChoice,\r\n DateChoice,\r\n TimeChoice,\r\n MultilineTextInput,\r\n OnbehalfChoices,\r\n onbehalfOptions,\r\n YesNoCheck,\r\n OtherLocation\r\n} from './FormControls';\r\n\r\nimport {\r\n FatigueAssessmentFormState,\r\n fatigueAssessmentFormState as fs,\r\n handleChange,\r\n fieldInvalid,\r\n enableValidation,\r\n resetValidation,\r\n updateFormState,\r\n handleOptionTextChange,\r\n handleCheckboxChange,\r\n} from './FatigueAssessmentFormState'\r\n\r\nimport {\r\n FatigueAssessmentActionState,\r\n fatigueAssessmentActionState,\r\n enableActionValidation,\r\n actionStateInvalid\r\n} from './FatigueAssessmentActionState'\r\n\r\n\r\nconst OnBehalfHeader = () => {\r\n const [form, setForm] = useState({} as FatigueAssessmentForm)\r\n const [showText, setShowText] = useState(false);\r\n const q = FatigueAssessmentQuestions;\r\n\r\n useEffect(() => {\r\n const sub = fs.subscribe((s: FatigueAssessmentFormState) => {\r\n setForm(s.form);\r\n if (s.form.onBehalfReason) {\r\n const hideText = (onbehalfOptions.map(o => o.label).includes(s.form.onBehalfReason ?? '') && s.form.onBehalfReason !== 'Other');\r\n setShowText(!hideText);\r\n }\r\n });\r\n\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n return (\r\n <>\r\n
Questions are phrased as the user would read them. Please answer on behalf of the user relative to the time of submitting the fatigue assessment.
\r\n
\r\n
{q.onBehalfReason.value}
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n {\r\n showText &&\r\n <>\r\n
\r\n
\r\n \r\n }\r\n
\r\n\r\n
\r\n
{q.onBehalfUser.value}
\r\n
\r\n \r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\nconst MainForm = () => {\r\n const [form, setForm] = useState({} as FatigueAssessmentForm)\r\n const defaultUser = { id: null, fullname: \"\" } as IUserSearchResult;\r\n const [defaultSupervisor, setDefaultSupervisor] = useState({ ...defaultUser, id: form.supervisor?.id || null, fullname: form.supervisor?.fullname || \"\" });\r\n const [defaultSignOnLocation, setDefaultSignOnLocation] = useState(form.signOnLocation?.id ?? undefined);\r\n const [defaultShiftStartTime, setDefaultShiftStartTime] = useState(form.shiftStartTime);\r\n const [dataCollectionShown, setDataCollectionShown] = useState(false);\r\n const [showSupervisor, setShowSupervisor] = useState(false);\r\n const q = FatigueAssessmentQuestions;\r\n\r\n useEffect(() => {\r\n const sub = fs.subscribe((s: FatigueAssessmentFormState) => {\r\n setForm(s.form);\r\n\r\n let defaultSupervisor = { ...defaultUser, id: s.form.supervisor?.id || null, fullname: s.form.supervisor?.fullname || \"\" };\r\n setDefaultSupervisor(defaultSupervisor);\r\n\r\n let sol = s.form.signOnLocation?.id ?? undefined;\r\n setDefaultSignOnLocation(sol);\r\n\r\n setDefaultShiftStartTime(s.form.shiftStartTime);\r\n setShowSupervisor(s.form.signOnLocationId === OtherLocation.value);\r\n });\r\n\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n return (\r\n
\r\n {/* \r\n

\r\n BHP wishes to collect and process health information about you in order to conduct this Fatigue Assessment.\r\n The information we will collect about you will include information related to recent sleep, consumption of alcoholic drinks, your sex and other health related information.\r\n By completing this form, you consent to BHP collecting and processing your personal information, including information previously collected, for the purposes described above.\r\n Your data is accessed by your line leader (supervisor) only for the purposes of managing safety, and is not shared to third parties or outside of the portal.\r\n

\r\n\r\n

\r\n This consent is voluntary and you are free to withdraw, alter or restrict your consent at any time by notifying BHP in writing.\r\n However, without access to this information you may not be able to report for work.\r\n

\r\n\r\n

\r\n We will manage all of your information in accordance with applicable privacy laws.\r\n For more information about how BHP conduct our privacy management practices, and about your rights in relation to information held by BHP, please see\r\n

\r\n

BHP Global Privacy Notice for BHP workers.

\r\n\r\n
}\r\n isOpen={!dataCollectionShown}\r\n closeAction={() => { setDataCollectionShown(true); }}\r\n /> */}\r\n
\r\n
{q.hoursSleep24Hrs.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.hoursSleep48Hrs.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.currentHoursAwake.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.feelAlert.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.alcoholicDrinks.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.gender.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.unfitSubstanceCheck.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.concentrationCheck.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n
\r\n
{q.signOnLocationId.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n {\r\n showSupervisor &&\r\n
\r\n
{q.shiftSupervisorId.value}
\r\n
\r\n handleChange(q.shiftSupervisorId.key)(user.id)}\r\n invalid={fieldInvalid(q.shiftSupervisorId.key)} />\r\n
\r\n
\r\n }\r\n\r\n
\r\n
{q.partialShiftStartDate.value}
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
{q.partialShiftStartTime.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\nconst OnBehalfFooter = () => {\r\n\r\n\r\n return (\r\n <>\r\n\r\n
Supervisors - Action taken
\r\n \r\n \r\n );\r\n}\r\n\r\n\r\nconst LoadingMessage = () => {\r\n return (\r\n <>\r\n
Loading...
\r\n \r\n );\r\n}\r\n\r\n\r\ntype ResultModalProps = {\r\n resultScore?: number,\r\n isOpen: boolean,\r\n onBehalf: boolean,\r\n closeAction: () => void\r\n}\r\n\r\nconst ResultModal = (props: ResultModalProps) => {\r\n const lowScoreThreshold = 2;\r\n const formTitle = () => {\r\n if (props.onBehalf == true) {\r\n return \"On-behalf form\";\r\n }\r\n return \"form\";\r\n }\r\n\r\n return (\r\n \r\n\r\n \r\n
{`Thank you for submitting the ${ formTitle().toLowerCase() }.`}
\r\n
\r\n\r\n \r\n
\r\n\r\n
\r\n {(props.resultScore !== undefined && props.resultScore <= lowScoreThreshold) ?\r\n
Risk score was low.
\r\n :\r\n
\r\n \r\n
\r\n Please report to the Shift Supervisor immediately.
\r\n Do not commence any work activities until you are authorised to do so.\r\n
\r\n
\r\n }\r\n
\r\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 FormContentsProps {\r\n onBehalf?: boolean,\r\n assessment?: FatigueAssessmentForm,\r\n loading?: boolean\r\n}\r\n\r\nconst FormContents = (props: FormContentsProps) => {\r\n const [onBehalf] = useState(props.onBehalf === true);\r\n const [isLoading, setIsLoading] = useState(props.loading === true);\r\n const [clearForm, setClearForm] = useState(true);\r\n const [isSubmitting, setIsSubmitting] = useState(false);\r\n const [displayAllRequired, setAllRequired] = useState(false);\r\n const [displayErrorSubmitting, setErrorSubmitting] = useState(false);\r\n const [resultScore, setResultScore] = useState(-1);\r\n const [displayResultModal, setResultModal] = useState(false);\r\n const [form, setForm] = useState({} as FatigueAssessmentForm);\r\n const [action, setAction] = useState({} as SubmitActionModel);\r\n const q = FatigueAssessmentQuestions;\r\n\r\n const history = useHistory();\r\n\r\n const onSubmit = async () => {\r\n setIsSubmitting(true);\r\n enableValidation();\r\n\r\n if (props.onBehalf) {\r\n enableActionValidation();\r\n }\r\n\r\n let submitAssessment = getAssessmentFromCurrentForm();\r\n let unansweredCount = 0;\r\n\r\n\r\n try {\r\n unansweredCount = await submitIfAble(submitAssessment);\r\n }\r\n finally {\r\n\r\n if (unansweredCount > 0) {\r\n setAllRequired(true);\r\n setIsSubmitting(false);\r\n }\r\n }\r\n }\r\n\r\n const getAssessmentFromCurrentForm = () => {\r\n let submitAssessment = {} as SubmitAssessmentModel;\r\n submitAssessment.id = form.id;\r\n submitAssessment.hoursSleep24Hrs = Number(form.hoursSleep24Hrs || -1);\r\n submitAssessment.hoursSleep48Hrs = Number(form.hoursSleep48Hrs || -1);\r\n submitAssessment.currentHoursAwake = Number(form.currentHoursAwake || -1);\r\n submitAssessment.feelAlert = Number(form.feelAlert || -1);\r\n submitAssessment.alcoholicDrinks = typeof (form.alcoholicDrinks) === 'number' ? form.alcoholicDrinks : -1;\r\n submitAssessment.gender = typeof (form.gender) === 'number' ? form.gender : -1;\r\n submitAssessment.unfitSubstanceCheck = Number(form.unfitSubstanceCheck || -1);\r\n submitAssessment.concentrationCheck = Number(form.concentrationCheck || -1);\r\n submitAssessment.signOnLocationId = form.signOnLocationId || -1;\r\n submitAssessment.supervisorId = submitAssessment.signOnLocationId > 0 ? -2 : (form.supervisorId || -1); // -2 doesn't trigger validation as supervisor only needed if other location is chosen\r\n let shiftStartLocalTimeString = isoDateStringToBrowserSafeString(`${ form.partialShiftStartDate }T${ form.partialShiftStartTime }:00`);\r\n let shiftStartLocalTime = new Date(shiftStartLocalTimeString);\r\n submitAssessment.shiftStartTime = shiftStartLocalTime;\r\n submitAssessment.privacyPolicy = form.privacyPolicy || false;\r\n return submitAssessment;\r\n }\r\n\r\n const submitIfAble = async (submitAssessment: SubmitAssessmentModel) => {\r\n let unansweredCount = 0;\r\n\r\n if (props.onBehalf) {\r\n let submitOnBehalf = { ...submitAssessment } as SubmitOnBehalfModel;\r\n submitOnBehalf.userId = Number(form.user?.id || -1);\r\n submitOnBehalf.onBehalfReason = form.onBehalfReason || \"\";\r\n submitOnBehalf.action = action;\r\n\r\n unansweredCount = questionsUnanswered(submitOnBehalf);\r\n unansweredCount += actionStateInvalid();\r\n\r\n if (unansweredCount === 0) {\r\n submitOnBehalfAssessment(submitOnBehalf)\r\n .then(submitResults)\r\n .catch(errorResults);\r\n }\r\n }\r\n else {\r\n unansweredCount = questionsUnanswered(submitAssessment);\r\n if (unansweredCount === 0) {\r\n submitFatigueAssessment(submitAssessment)\r\n .then(submitResults)\r\n .catch(errorResults);\r\n }\r\n }\r\n\r\n return unansweredCount;\r\n }\r\n\r\n const questionsUnanswered = (answers: {}) => {\r\n let errorCount = 0;\r\n Object.entries(answers).forEach(\r\n ([key, value]) => {\r\n if (\r\n key !== \"id\" &&\r\n value === undefined ||\r\n (typeof (value) === 'boolean' && !value) ||\r\n (typeof (value) === 'number' && value === -1) ||\r\n (typeof (value) === 'string' && !value.trim())\r\n ) {\r\n console.debug(`Key ${ key } not set (${ value })`);\r\n errorCount++;\r\n }\r\n }\r\n );\r\n return errorCount;\r\n }\r\n\r\n const submitResults = (score: number) => {\r\n setIsSubmitting(false);\r\n\r\n if (score < 0) {\r\n errorResults(undefined);\r\n return;\r\n }\r\n\r\n showResults(score);\r\n }\r\n\r\n const showResults = (score: number) => {\r\n setResultScore(score);\r\n setResultModal(true);\r\n }\r\n\r\n const closeResults = () => {\r\n setResultModal(false);\r\n history.push(`${ fatigueAssessmentRoute.path }`);\r\n }\r\n\r\n const errorResults = (e: any) => {\r\n if (e !== undefined) {\r\n console.error(e);\r\n }\r\n setIsSubmitting(false);\r\n setErrorSubmitting(true);\r\n\r\n }\r\n\r\n useEffect(() => {\r\n const faSub = fs.subscribe((s: FatigueAssessmentFormState) => {\r\n setForm(s.form);\r\n setAllRequired(false);\r\n });\r\n const actionSub = fatigueAssessmentActionState.subscribe((s: FatigueAssessmentActionState) => {\r\n setAction(s.action);\r\n });\r\n let faAssessment = props.assessment ?? {} as FatigueAssessmentForm;\r\n updateFormState(faAssessment);\r\n resetValidation();\r\n setIsLoading(props.loading === true);\r\n setClearForm(false);\r\n\r\n return () => {\r\n faSub.unsubscribe();\r\n actionSub.unsubscribe();\r\n };\r\n }, [props.loading, props.assessment]);\r\n\r\n return (\r\n
\r\n
Enter all details and click submit
\r\n\r\n { setErrorSubmitting(false); }} />\r\n\r\n \r\n\r\n {isLoading || clearForm ?\r\n <>\r\n \r\n \r\n :\r\n <>\r\n {onBehalf === true &&\r\n \r\n }\r\n\r\n \r\n\r\n {onBehalf === true &&\r\n \r\n }\r\n\r\n
\r\n
Please enter all mandatory details in the form.
\r\n
\r\n {isSubmitting ?\r\n <>\r\n
\r\n \r\n \r\n :\r\n <>\r\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 FormContents;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { useLocation } from 'react-router';\r\nimport { getFatigueAssessment } from 'shared/services/fatigueAssessmentApi';\r\nimport { FatigueAssessmentForm } from 'shared/models/api/models';\r\nimport FatigueAssessmentPage from \"./FatigueAssessmentPage\";\r\nimport { fatigueAssessmentForm } from \"./FatigueAssessmentPageSelector\";\r\nimport FormContents from \"./FormContents\";\r\nimport { toLocalDateTimeFields } from 'shared/models/mapping/mapping';\r\n\r\nconst FatigueAssessmentBaseForm = () => {\r\n const [assessment, setAssessment] = useState({} as FatigueAssessmentForm);\r\n const [loading, setLoading] = useState(true);\r\n const location = useLocation();\r\n\r\n useEffect(() => {\r\n async function getData() {\r\n const idString = location.pathname.split('/')[3];\r\n if (idString !== undefined) {\r\n setLoading(true);\r\n const id = Number.parseInt(idString)\r\n let form = await getFatigueAssessment(id);\r\n // Converting the date strings from the api is problematic on safari\r\n form = toLocalDateTimeFields(form, ['assessmentDate', 'shiftStartTime', 'dateOfIssue']);\r\n setAssessment(form);\r\n }\r\n setLoading(false);\r\n }\r\n getData();\r\n }, [location]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentBaseForm;\r\n","import React from 'react';\r\n\r\nimport FatigueAssessmentPage from \"./FatigueAssessmentPage\";\r\nimport { fatigueAssessmentOnBehalf } from \"./FatigueAssessmentPageSelector\";\r\nimport FormContents from \"./FormContents\";\r\n\r\nconst FatigueAssessmentOnBehalfForm = () => {\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentOnBehalfForm;\r\n","import React, { useState } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Button } from 'reactstrap';\r\nimport { Chip } from '@material-ui/core'\r\nimport { FatigueAssessmentAssign, FatigueAssessmentAssignResult, IUserSearchResult } from 'shared/models/api/models';\r\nimport { FormModal, FormModalSubHeader, FormModalPaddedBody, ModalButtonRow, ModalButton } from 'components/ui/FormModal';\r\nimport { fatigueAssessmentDashboardPathRoute } from 'components/portal/fatigueAssessment/FatigueAssessmentRoutes';\r\nimport { assign } from 'shared/services/fatigueAssessmentApi';\r\nimport InfoModal from 'components/ui/InfoModal';\r\nimport FatigueAssessmentPage from './FatigueAssessmentPage';\r\nimport { fatigueAssessmentAssign } from './FatigueAssessmentPageSelector';\r\nimport { handleActionChange } from './FatigueAssessmentActionState';\r\nimport { DateChoice, TimeChoice, UserChoice } from './FormControls';\r\nimport { isoDateStringToBrowserSafeString } from 'shared/models/mapping/mapping';\r\n\r\ntype ResultModalProps = {\r\n results?: FatigueAssessmentAssignResult,\r\n isOpen: boolean,\r\n closeAction: () => void\r\n}\r\n\r\nconst ResultModal = (props: ResultModalProps) => {\r\n\r\n return (\r\n \r\n\r\n \r\n
{`Thank you for submitting the form`}
\r\n
\r\n\r\n \r\n
\r\n\r\n
\r\n
New fatigue assessments assigned: {props.results?.added || '0'}
\r\n {!!props.results?.existing &&\r\n
Requested users with existing pending assessments: {props.results?.existing}
\r\n }\r\n {!!props.results?.failed &&\r\n
Assessments failed to assign: {props.results?.failed}
\r\n }\r\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 UserChip {\r\n id: number;\r\n name: string;\r\n}\r\n\r\nconst FatigueAssessmentAssignForm = () => {\r\n const [selectedUsers, setSelectedUsers] = useState([] as UserChip[]);\r\n const [shiftStartDate, setShiftStartDate] = useState(\"\");\r\n const [shiftStartTime, setShiftStartTime] = useState(\"\");\r\n\r\n const [validationEnabled, setValidationEnabled] = useState(false);\r\n const [displayAllRequired, setAllRequired] = useState(false);\r\n const [displayErrorSubmitting, setErrorSubmitting] = useState(false);\r\n const [isSubmitting, setIsSubmitting] = useState(false);\r\n const [displayResultModal, setResultModal] = useState(false);\r\n const [assignResults, setAssignResults] = useState({} as FatigueAssessmentAssignResult);\r\n\r\n const history = useHistory();\r\n\r\n const handleUserSelected = (user: IUserSearchResult) => {\r\n if (!user || typeof (user.id) !== 'number') {\r\n return;\r\n }\r\n\r\n if (selectedUsers.findIndex(supervisor => supervisor.id === user.id) > -1) {\r\n removeUser(user.id);\r\n return;\r\n }\r\n\r\n setAllRequired(false);\r\n const newSupervisors = [...selectedUsers, { id: user.id, name: user.fullname } as UserChip];\r\n setSelectedUsers(newSupervisors);\r\n const newUserIds = newSupervisors.map(user => user.id);\r\n handleActionChange(\"assignAssessmentToUsers\")(newUserIds);\r\n }\r\n const handleDueDateChange = (e: any) => {\r\n \r\n if (e.target?.value)\r\n setShiftStartDate(e.target?.value);\r\n else if (e)\r\n setShiftStartDate(e);\r\n }\r\n\r\n const handleTimeChange = (e: any) => {\r\n console.log(e);\r\n if (e.target?.value)\r\n setShiftStartTime(e.target?.value);\r\n else if (e)\r\n setShiftStartTime(e);\r\n }\r\n\r\n const removeUser = (userId: number) => {\r\n var index = selectedUsers.findIndex(supervisor => supervisor.id === userId);\r\n if (index > -1) {\r\n var newSupervisors = [...selectedUsers];\r\n newSupervisors.splice(index, 1);\r\n setSelectedUsers(newSupervisors);\r\n const newUserIds = newSupervisors.map(user => user.id);\r\n handleActionChange(\"assignAssessmentToUsers\")(newUserIds);\r\n }\r\n }\r\n\r\n const clearUsers = () => {\r\n setValidationEnabled(false);\r\n setSelectedUsers([]);\r\n handleActionChange(\"assignAssessmentToUsers\")([]);\r\n }\r\n\r\n const enableValidation = () => {\r\n setValidationEnabled(true);\r\n }\r\n\r\n const closeResults = () => {\r\n setResultModal(false);\r\n history.push(`${ fatigueAssessmentDashboardPathRoute.path }`);\r\n }\r\n\r\n const showResults = (results: FatigueAssessmentAssignResult) => {\r\n setAssignResults(results);\r\n setResultModal(true);\r\n }\r\n\r\n const errorResults = (e: any) => {\r\n if (e !== undefined) {\r\n console.error(e);\r\n }\r\n setIsSubmitting(false);\r\n setErrorSubmitting(true);\r\n }\r\n\r\n const submitResults = (results: any) => {\r\n setIsSubmitting(false);\r\n\r\n if (!results || results.failed > 0) {\r\n errorResults(undefined);\r\n return;\r\n }\r\n\r\n clearUsers();\r\n\r\n showResults(results);\r\n }\r\n\r\n\r\n const submitIfAble = async () => {\r\n let unansweredCount = 0;\r\n\r\n if (selectedUsers.length < 1) {\r\n unansweredCount++;\r\n }\r\n\r\n if (unansweredCount === 0) {\r\n const userIds = selectedUsers.map(u => u.id);\r\n\r\n let shiftStartLocalTimeString = isoDateStringToBrowserSafeString(`${ shiftStartDate }T${ shiftStartTime }:00`);\r\n let shiftStartLocalTime = new Date(shiftStartLocalTimeString);\r\n let faAssign = { userIds: userIds, shiftStartTime: shiftStartLocalTime } as FatigueAssessmentAssign;\r\n assign(faAssign)\r\n .then(submitResults)\r\n .catch(errorResults);\r\n }\r\n\r\n return unansweredCount;\r\n }\r\n\r\n const onSubmit = async () => {\r\n setIsSubmitting(true);\r\n enableValidation();\r\n\r\n let unansweredCount = 0;\r\n\r\n try {\r\n unansweredCount = await submitIfAble();\r\n }\r\n finally {\r\n if (unansweredCount > 0) {\r\n setAllRequired(true);\r\n setIsSubmitting(false);\r\n }\r\n }\r\n\r\n }\r\n let defaultShiftStartTime: Date = new Date(Date.now());\r\n return (\r\n \r\n
\r\n\r\n
Assign Fatigue Assessment to Users
\r\n\r\n { setErrorSubmitting(false); }} />\r\n\r\n \r\n\r\n
\r\n\r\n
\r\n
Users to assign a fatigue assessment
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n {selectedUsers.map((user) => (\r\n removeUser(user.id)} />\r\n ))}\r\n
\r\n
\r\n\r\n
\r\n
Due Date
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
Due Time
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n
\r\n
Please enter all mandatory details in the form.
\r\n
\r\n {isSubmitting ?\r\n <>\r\n
\r\n \r\n \r\n :\r\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 FatigueAssessmentAssignForm;\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nimport FatigueAssessmentPage from \"./FatigueAssessmentPage\";\r\nimport { shiftSummaryDashboardPending, ISelectOption } from \"./FatigueAssessmentPageSelector\";\r\nimport FatigueAssessmentCardList from \"./FatigueAssessmentCardList\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\n\r\ninterface FatigueAssessmentDashboardProps {\r\n page: ISelectOption,\r\n pageView: FatigueAssessmentView\r\n}\r\n\r\nconst FatigueAssessmentDashboard = (props: FatigueAssessmentDashboardProps) => {\r\n const [selectedPage] = useState(props.page ?? shiftSummaryDashboardPending);\r\n const [pageView] = useState(props.pageView ?? FatigueAssessmentView.Pending);\r\n\r\n const getPageTitle = () => {\r\n var title = selectedPage.label;\r\n return title;\r\n }\r\n\r\n const pageTitle = getPageTitle();\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboard;\r\n","import React from 'react';\r\nimport { shiftSummaryDashboardPending } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport FatigueAssessmentDashboard from \"./FatigueAssessmentDashboard\";\r\n\r\nconst FatigueAssessmentDashboardPending = () => {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboardPending;\r\n","import React from 'react';\r\nimport { shiftSummaryDashboardToAction } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport FatigueAssessmentDashboard from \"./FatigueAssessmentDashboard\";\r\n\r\nconst FatigueAssessmentDashboardToAction = () => {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboardToAction;\r\n","import React from 'react';\r\nimport { shiftSummaryDashboardToRevisit } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport FatigueAssessmentDashboard from \"./FatigueAssessmentDashboard\";\r\n\r\nconst FatigueAssessmentDashboardToRevisit = () => {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboardToRevisit;\r\n","import React from 'react';\r\nimport { shiftSummaryDashboardCompleted } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport FatigueAssessmentDashboard from \"./FatigueAssessmentDashboard\";\r\n\r\nconst FatigueAssessmentDashboardCompleted = () => {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboardCompleted;\r\n","import React from 'react';\r\nimport { shiftSummaryDashboardOverview } from \"./FatigueAssessmentPageSelector\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport FatigueAssessmentDashboard from \"./FatigueAssessmentDashboard\";\r\n\r\nconst FatigueAssessmentDashboardOverview = () => {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentDashboardOverview;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { useParams, useHistory } from \"react-router-dom\";\r\nimport useSelector from 'hooks/useSelector';\r\nimport { Button } from 'reactstrap';\r\n\r\nimport { getFatigueAssessmentDetails, fatigueAssessmentAddNote, saveAction } from 'shared/services/fatigueAssessmentApi';\r\nimport { formatDateTime } from \"shared/models/mapping/mapping\";\r\nimport FatigueAssessmentPage from './FatigueAssessmentPage';\r\nimport FatigueAssessmentQuestions, { FatigueAssessmentQuestion } from './FatigueAssessmentQuestions'\r\nimport { alertOptions, yesNoOptions, sexOptions, riskOptions, actionOptions, OtherLocation } from './FormControls'\r\nimport FatigueAssessmentAction from './FatigueAssessmentAction'\r\nimport './FatigueAssessments.css'\r\n\r\n\r\nimport {\r\n shiftSummaryDashboardPending,\r\n shiftSummaryDashboardToAction,\r\n shiftSummaryDashboardToRevisit,\r\n shiftSummaryDashboardCompleted,\r\n ISelectOption\r\n} from \"./FatigueAssessmentPageSelector\";\r\n\r\nimport {\r\n FatigueAssessmentDetailsModel,\r\n FatigueAssessmentNote,\r\n FatigueAssessmentUser,\r\n FatigueAssessmentActionModel,\r\n SubmitActionModel\r\n} from 'shared/models/api/models';\r\n\r\nimport {\r\n fatigueAssessmentDashboardPathRoute,\r\n dashboardPending,\r\n dashboardAction,\r\n dashboardRevisit,\r\n dashboardCompleted\r\n} from \"components/portal/fatigueAssessment/FatigueAssessmentRoutes\";\r\n\r\nimport {\r\n FatigueAssessmentActionState,\r\n fatigueAssessmentActionState,\r\n handleActionChange,\r\n enableActionValidation,\r\n resetActionValidation,\r\n actionStateInvalid\r\n} from './FatigueAssessmentActionState'\r\n\r\nimport {\r\n Add as AddIcon,\r\n Remove as RemoveIcon\r\n} from '@material-ui/icons';\r\n\r\n\r\ninterface TabHeaderProps {\r\n label: string,\r\n tabValue: string,\r\n activeTab: string,\r\n onClick: any,\r\n children?: React.ReactNode\r\n}\r\n\r\nconst TabHeader = (props: TabHeaderProps) => {\r\n const isTabExpanded = () => {\r\n return props.activeTab === props.tabValue;\r\n }\r\n const tabExpanded = isTabExpanded();\r\n\r\n return (\r\n <>\r\n
props.onClick(props.tabValue)}>\r\n {props.label}\r\n
\r\n {tabExpanded ?\r\n \r\n :\r\n \r\n }\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\nexport const Tabs = {\r\n details: 'details',\r\n info: 'info',\r\n recommendations: 'recommendations',\r\n actions: 'actions',\r\n notes: 'notes',\r\n audit: 'audit'\r\n}\r\n\r\ninterface QaRowProps {\r\n faQuestion: FatigueAssessmentQuestion,\r\n formDetails: FatigueAssessmentDetailsModel,\r\n translateAnswer?: any\r\n}\r\n\r\nconst QaRow = (props: QaRowProps) => {\r\n function getKeyValue(obj: T, key: string) {\r\n let keys = key.split('.');\r\n let value: any = obj;\r\n\r\n keys.forEach(k => {\r\n if (value == null || !value.hasOwnProperty(k)) {\r\n return null;\r\n }\r\n value = value[k as keyof T];\r\n });\r\n return value;\r\n }\r\n\r\n let keyVal = getKeyValue(props.formDetails, props.faQuestion.key);\r\n\r\n return (\r\n
\r\n
{props.faQuestion.altValue ?? props.faQuestion.value}
\r\n
{\r\n props.translateAnswer ?\r\n props.translateAnswer(keyVal)\r\n :\r\n keyVal\r\n }
\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface TabProps {\r\n formDetails: FatigueAssessmentDetailsModel\r\n}\r\n\r\nconst DetailsTab = (props: TabProps) => {\r\n const q = FatigueAssessmentQuestions;\r\n\r\n const translateAlert = (val: number) => {\r\n return val != null ? alertOptions[val].label : '';\r\n }\r\n\r\n const translateYesNo = (val: number) => {\r\n return val != null ? yesNoOptions.find(x => x.value === val)?.label : '';\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\nconst InfoTab = (props: TabProps) => {\r\n const q = FatigueAssessmentQuestions;\r\n\r\n const translateSex = (val: number) => {\r\n return val != null ? sexOptions[val].label : '';\r\n }\r\n\r\n const translateRisk = (val: number) => {\r\n return val != null ? riskOptions[val].label : '';\r\n }\r\n\r\n const translateLocation = (val: any) => {\r\n return val ? val : OtherLocation.label;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {!(props.formDetails.signOnLocation) &&\r\n <>\r\n \r\n \r\n }\r\n \r\n \r\n {props.formDetails.onBehalfSubmitter?.id &&\r\n <>\r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nconst RecommendationsTab = (props: TabProps) => {\r\n return (\r\n <>\r\n
Low risk (Total score = 0-2)
\r\n
\r\n
\r\n
Individuals are:
\r\n
    \r\n
  • Alert
  • \r\n
  • Normal eye blinks (less than 1 second)
  • \r\n
  • Coordinated body movements
  • \r\n
  • Tolerant of others
  • \r\n
\r\n
\r\n
\r\n
Recommendation
\r\n
    \r\n
  • Continue to monitor
  • \r\n
  • Remind individuals about fatigue and alertness management strategies (interaction with others, coffee, exercise, cold air on face, etc.)
  • \r\n
\r\n
\r\n
\r\n\r\n
Medium risk (Total score = 3-7)
\r\n
\r\n
\r\n
The individual reports they are fatigued and/or are showing some of the following signs:
\r\n
    \r\n
  • Irritable/impatient
  • \r\n
  • Longer eyelid closure (1-2 seconds)
  • \r\n
  • Wandering thoughts
  • \r\n
  • Rubs eyes or face
  • \r\n
  • Facial contortions
  • \r\n
  • Restless movements
  • \r\n
  • Yawning
  • \r\n
\r\n
\r\n
\r\n
Recommendation
\r\n
As above, plus:
\r\n
    \r\n
  • Discuss possible reasons for fatigue
  • \r\n
  • Rotate tasks
  • \r\n
  • Encourage the use of alertness strategies
  • \r\n
  • Provide opportunity for a short break/brief nap of no more than 15 minutes
  • \r\n
  • Have personnel work together (if possible)
  • \r\n
  • Remove from safety sensitive work
  • \r\n
  • Assess fitness for work before you allow person to return to work
  • \r\n
  • Schedule regular supervision for remainder of shift
  • \r\n
\r\n
\r\n
\r\n\r\n
High risk (Total score = 8-14)
\r\n
\r\n
\r\n
The individual reports they are significantly fatigued and/or are showing some of the following serious signs:
\r\n
    \r\n
  • Quiet and withdrawn
  • \r\n
  • Long eyelid closure (2 or more seconds)
  • \r\n
  • Fixed staring
  • \r\n
  • Frequent yawning
  • \r\n
  • Micro sleeps
  • \r\n
\r\n
\r\n
\r\n
Recommendation
\r\n
    \r\n
  • Immediately prevent person from working and discuss the possible causes and action required
  • \r\n
  • Determine if the individual can be placed on alternate duties for the remainder of shift and managed at work
  • \r\n
  • If unable to be managed on aternate duties, send the individual home (provide transportation) and report event in 1SAP
  • \r\n
\r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\ninterface ActionsTabProps extends TabProps {\r\n reload: (value: boolean) => any;\r\n}\r\n\r\nconst ActionsFormTab = (props: ActionsTabProps) => {\r\n const [action, setAction] = useState({} as SubmitActionModel);\r\n const profile = useSelector(state => state.profile);\r\n\r\n const save = () => {\r\n enableActionValidation();\r\n\r\n let conditionalFields = [] as string[][];\r\n if (isAlternativeSupervisor()) {\r\n conditionalFields.push([\"alternativeSupervisorReason\"]);\r\n }\r\n\r\n if (actionStateInvalid(conditionalFields) > 0) {\r\n return;\r\n }\r\n\r\n if (!action.fatigueAssessmentId) {\r\n return;\r\n }\r\n saveAction(action)\r\n .then(saveResults);\r\n }\r\n\r\n const saveResults = (result: any) => {\r\n resetActionValidation();\r\n\r\n if (result > 0) {\r\n props.reload(true);\r\n }\r\n }\r\n\r\n const isAlternativeSupervisor = () => {\r\n if (props.formDetails.supervisor?.id !== profile?.id) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n useEffect(() => {\r\n const sub = fatigueAssessmentActionState.subscribe((s: FatigueAssessmentActionState) => {\r\n setAction(s.action);\r\n });\r\n handleActionChange(\"fatigueAssessmentId\")(props.formDetails.id);\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n return (\r\n <>\r\n
Supervisors - Action taken
\r\n \r\n
\r\n \r\n
\r\n \r\n );\r\n}\r\n\r\nconst ActionsInfoTab = (props: TabProps) => {\r\n const q = FatigueAssessmentQuestions;\r\n\r\n const translateActions = (action: FatigueAssessmentActionModel) => {\r\n let actions = [] as string[];\r\n\r\n if (!action) {\r\n return actions;\r\n }\r\n\r\n if (action.noFurtherAction) actions.push(actionOptions.noFurtherAction);\r\n if (action.noActionTakenPlannedLeave) actions.push(actionOptions.noActionTakenPlannedLeave);\r\n if (action.noActionTakenUnplannedLeave) actions.push(actionOptions.noActionTakenUnplannedLeave);\r\n if (action.actionTaken) actions.push(actionOptions.actionTaken);\r\n if (action.actionTakenRevisit) actions.push(actionOptions.actionTakenRevisit);\r\n if (action.actionTakenBuddyUp) actions.push(actionOptions.actionTakenBuddyUp);\r\n if (action.actionTakenRemoveFromSafetyCritical) actions.push(actionOptions.actionTakenRemoveFromSafetyCritical);\r\n if (action.actionTakenRemainLocal) actions.push(actionOptions.actionTakenRemainLocal);\r\n if (action.actionTakenAltDuties) actions.push(actionOptions.actionTakenAltDuties);\r\n if (action.sentHome) actions.push(actionOptions.sentHome);\r\n\r\n\r\n return (\r\n <>\r\n {actions.map((actionDescription) =>\r\n
{actionDescription}
\r\n )}\r\n \r\n );\r\n }\r\n\r\n const translateBoolToYesNo = (val: boolean) => {\r\n return val != null ? yesNoOptions.find(x => x.value === +val)?.label : '';\r\n }\r\n\r\n const translateUserList = (val: FatigueAssessmentUser[]) => {\r\n return (\r\n <>\r\n {val != null && val.map((user) =>\r\n
\r\n {user.fullname}\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 \r\n );\r\n}\r\n\r\n\r\nconst ActionsTab = (props: ActionsTabProps) => {\r\n return (\r\n <>\r\n {props.formDetails.action ?\r\n \r\n :\r\n \r\n }\r\n \r\n );\r\n}\r\n\r\nconst NotesTab = (props: TabProps) => {\r\n const [notes, setNotes] = useState(props.formDetails.notes);\r\n const [noteText, setNoteText] = useState('');\r\n const [saving, setSaving] = useState(false);\r\n\r\n const maxNoteLength = 500;\r\n\r\n const addNote = () => {\r\n if (!noteText || noteText.length < 1) {\r\n return;\r\n }\r\n\r\n setSaving(true);\r\n\r\n fatigueAssessmentAddNote(\r\n {\r\n fatigueAssessmentId: props.formDetails.id,\r\n comment: noteText\r\n }\r\n )\r\n .then(newNotes => addNoteResult(newNotes));\r\n }\r\n\r\n const addNoteResult = (newNotes: FatigueAssessmentNote[] | null) => {\r\n if (!newNotes) {\r\n return;\r\n }\r\n setNotes(newNotes);\r\n setNoteText('');\r\n setSaving(false);\r\n }\r\n\r\n useEffect(() => {\r\n if (noteText.length > maxNoteLength) {\r\n setNoteText(noteText.substring(0, maxNoteLength));\r\n }\r\n }, [noteText]);\r\n\r\n return (\r\n <>\r\n {notes.length > 0 &&\r\n
\r\n
Previous notes
\r\n
\r\n {\r\n notes.map((note) => (\r\n
\r\n
{note.userName}
\r\n
{formatDateTime(note.noteDate)}
\r\n
{note.comment}
\r\n
\r\n ))\r\n }\r\n
\r\n
\r\n }\r\n
Add notes
\r\n
\r\n
\r\n
\r\n setNoteText(event.target.value))} />\r\n
\r\n
\r\n {saving ?\r\n \r\n :\r\n \r\n }\r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\nconst AuditTab = (props: TabProps) => {\r\n\r\n return (\r\n <>\r\n {props.formDetails.audit.length > 0 &&\r\n
\r\n
Audit Trail
\r\n
\r\n {\r\n props.formDetails.audit.map((auditItem) => (\r\n
\r\n
{formatDateTime(auditItem.date)}
\r\n
{auditItem.description}
\r\n
\r\n ))\r\n }\r\n
\r\n
\r\n }\r\n \r\n );\r\n}\r\n\r\nconst FatigueAssessmentDetails = () => {\r\n const pages: { [id: string]: ISelectOption; } = {};\r\n pages[dashboardPending] = shiftSummaryDashboardPending;\r\n pages[dashboardAction] = shiftSummaryDashboardToAction;\r\n pages[dashboardRevisit] = shiftSummaryDashboardToRevisit;\r\n pages[dashboardCompleted] = shiftSummaryDashboardCompleted;\r\n\r\n const params = useParams() as any;\r\n const [selectedPage] = useState(pages[params.dashboardType]);\r\n const [formId] = useState(parseInt(params.id));\r\n const [activeTab, setActiveTab] = useState(params.tab as string);\r\n const [formDetails, setFormDetails] = useState({} as FatigueAssessmentDetailsModel);\r\n const [reload, setReload] = useState(false);\r\n\r\n const history = useHistory();\r\n\r\n const getActionPath = (id: number, tab: string) => {\r\n let url = `${ fatigueAssessmentDashboardPathRoute.path }/${ params.dashboardType }/${ id }/${ tab }`;\r\n return url;\r\n }\r\n\r\n const tabClicked = (tab: string) => {\r\n if (tab === activeTab) {\r\n tab = '';\r\n }\r\n setActiveTab(tab);\r\n history.replace(getActionPath(formId, tab));\r\n }\r\n\r\n const goToDashboard = () => {\r\n let url = `${ fatigueAssessmentDashboardPathRoute.path }/${ params.dashboardType }`;\r\n history.push(url);\r\n }\r\n\r\n const isOverdue30Min = (shiftStartDate?: Date): boolean => {\r\n\r\n if (shiftStartDate) {\r\n if (typeof (shiftStartDate) === 'string') {\r\n shiftStartDate = new Date(shiftStartDate);\r\n }\r\n let wellOverdueThreshold = 30 * 60000; //30 minutes\r\n return (shiftStartDate.getTime() < Date.now() - wellOverdueThreshold);\r\n }\r\n return false;\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n let results = {} as FatigueAssessmentDetailsModel;\r\n if (params.id > 0) {\r\n results = await getFatigueAssessmentDetails(params.id);\r\n }\r\n if (mounted && results.id) {\r\n setFormDetails(results);\r\n }\r\n };\r\n mount();\r\n return () => { mounted = false };\r\n }, [params.id]);\r\n\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n let results = {} as FatigueAssessmentDetailsModel;\r\n if (params.id > 0) {\r\n results = await getFatigueAssessmentDetails(params.id);\r\n }\r\n if (mounted && results.id) {\r\n setFormDetails(results);\r\n }\r\n setReload(false);\r\n };\r\n if (reload) {\r\n mount();\r\n }\r\n return () => { mounted = false };\r\n }, [reload]);\r\n\r\n return (\r\n \r\n {formDetails && formDetails.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 {(formDetails.assessmentDate || isOverdue30Min(formDetails.shiftStartTime)) &&\r\n \r\n setReload(val)} />\r\n \r\n }\r\n\r\n \r\n \r\n \r\n\r\n \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}\r\n\r\nexport default FatigueAssessmentDetails;\r\n","import { IRouteConfig } from 'helpers/route-config';\r\n\r\nimport FatigueAssessments from \"components/portal/fatigueAssessment/FatigueAssessments\";\r\nimport FatigueAssessmentBaseForm from \"components/portal/fatigueAssessment/FatigueAssessmentBaseForm\";\r\nimport FatigueAssessmentOnBehalfForm from \"components/portal/fatigueAssessment/FatigueAssessmentOnBehalfForm\";\r\nimport FatigueAssessmentAssignForm from \"components/portal/fatigueAssessment/FatigueAssessmentAssignForm\";\r\nimport FatigueAssessmentDashboard from \"components/portal/fatigueAssessment/FatigueAssessmentDashboard\";\r\nimport FatigueAssessmentDashboardPending from \"components/portal/fatigueAssessment/FatigueAssessmentDashboardPending\";\r\nimport FatigueAssessmentDashboardToAction from \"components/portal/fatigueAssessment/FatigueAssessmentDashboardToAction\";\r\nimport FatigueAssessmentDashboardToRevisit from \"components/portal/fatigueAssessment/FatigueAssessmentDashboardToRevisit\";\r\nimport FatigueAssessmentDashboardCompleted from \"components/portal/fatigueAssessment/FatigueAssessmentDashboardCompleted\";\r\nimport FatigueAssessmentDashboardOverview from \"components/portal/fatigueAssessment/FatigueAssessmentDashboardOverview\";\r\nimport FatigueAssessmentDetails from \"components/portal/fatigueAssessment/FatigueAssessmentDetails\";\r\n\r\n\r\n// Pages\r\nconst fatigueAssessmentPath = \"/fatigueassessment\";\r\n\r\nexport const dashboardPending = 'pending';\r\nexport const dashboardAction = 'action';\r\nexport const dashboardRevisit = 'revisit';\r\nexport const dashboardCompleted = 'completed';\r\nexport const dashboardOverview = 'overview';\r\n\r\nconst fatigueAssessmentDashboardPath = `${ fatigueAssessmentPath }/dashboard`;\r\nconst fatigueAssessmentPendingPath = `${ fatigueAssessmentDashboardPath }/${ dashboardPending }`;\r\nconst fatigueAssessmentActionPath = `${ fatigueAssessmentDashboardPath }/${ dashboardAction }`;\r\nconst fatigueAssessmentRevisitPath = `${ fatigueAssessmentDashboardPath }/${ dashboardRevisit }`;\r\nconst fatigueAssessmentCompletedPath = `${ fatigueAssessmentDashboardPath }/${ dashboardCompleted }`;\r\nconst fatigueAssessmentOverviewPath = `${ fatigueAssessmentDashboardPath }/${ dashboardOverview }`;\r\n\r\nconst fatigueAssessmentDetailsPath = `${ fatigueAssessmentDashboardPath }/:dashboardType/:id/:tab?`;\r\n\r\nconst fatigueAssessmentBlankFormPath = `${ fatigueAssessmentPath }/form`;\r\nconst fatigueAssessmentFormPath = `${ fatigueAssessmentBlankFormPath }/:id`;\r\nconst fatigueAssessmentOnBehalfPath = `${ fatigueAssessmentPath }/onbehalf`;\r\nconst fatigueAssessmentAssignPath = `${ fatigueAssessmentPath }/assign`;\r\n\r\n\r\n// Routes\r\nexport const fatigueAssessmentRoute = {\r\n breadCrumb: \"Fatigue Assessment\",\r\n path: fatigueAssessmentPath,\r\n component: FatigueAssessments,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentDashboardPathRoute = {\r\n breadCrumb: \"Shift Summary Dashboard\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentDashboardPath,\r\n component: FatigueAssessmentDashboard,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentPendingPathRoute = {\r\n breadCrumb: \"Pending Fatigue Assessments\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentPendingPath,\r\n component: FatigueAssessmentDashboardPending,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentActionPathRoute = {\r\n breadCrumb: \"Fatigue Assessments to action\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentActionPath,\r\n component: FatigueAssessmentDashboardToAction,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentRevisitPathRoute = {\r\n breadCrumb: \"Fatigue Assessments to revisit\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentRevisitPath,\r\n component: FatigueAssessmentDashboardToRevisit,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentCompletedPathRoute = {\r\n breadCrumb: \"Completed - no action required\",\r\n permission: \"web.admin.fatigue-assessment.completed\",\r\n path: fatigueAssessmentCompletedPath,\r\n component: FatigueAssessmentDashboardCompleted,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentOverviewPathRoute = {\r\n breadCrumb: \"Overview\",\r\n permission: \"web.admin.fatigue-assessment.completed\",\r\n path: fatigueAssessmentOverviewPath,\r\n component: FatigueAssessmentDashboardOverview,\r\n exact: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentDetailsPathRoute = {\r\n breadCrumb: \"Details\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentDetailsPath,\r\n component: FatigueAssessmentDetails,\r\n endTrail: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentBlankFormRoute = {\r\n breadCrumb: \"Form\",\r\n path: fatigueAssessmentBlankFormPath,\r\n component: FatigueAssessmentBaseForm,\r\n exact: true,\r\n endTrail: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentFormRoute = {\r\n breadCrumb: undefined,\r\n path: fatigueAssessmentFormPath,\r\n component: FatigueAssessmentBaseForm\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentOnBehalfRoute = {\r\n breadCrumb: \"On-behalf form\",\r\n permission: \"web.admin.fatigue-assessment.on-behalf\",\r\n path: fatigueAssessmentOnBehalfPath,\r\n component: FatigueAssessmentOnBehalfForm,\r\n endTrail: true\r\n} as IRouteConfig;\r\n\r\nexport const fatigueAssessmentAssignRoute = {\r\n breadCrumb: \"Assign\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n path: fatigueAssessmentAssignPath,\r\n component: FatigueAssessmentAssignForm,\r\n endTrail: true\r\n} as IRouteConfig;\r\n","import { IRouteConfig } from 'helpers/route-config';\r\nimport {\r\n fatigueAssessmentRoute,\r\n fatigueAssessmentBlankFormRoute,\r\n fatigueAssessmentFormRoute,\r\n fatigueAssessmentOnBehalfRoute,\r\n fatigueAssessmentAssignRoute,\r\n fatigueAssessmentDashboardPathRoute,\r\n fatigueAssessmentPendingPathRoute,\r\n fatigueAssessmentActionPathRoute,\r\n fatigueAssessmentRevisitPathRoute,\r\n fatigueAssessmentCompletedPathRoute,\r\n fatigueAssessmentDetailsPathRoute,\r\n fatigueAssessmentOverviewPathRoute\r\n} from \"components/portal/fatigueAssessment/FatigueAssessmentRoutes\";\r\n\r\nexport const fatigueAssessmentFormUrl = (id: number) => {\r\n if (typeof (fatigueAssessmentFormRoute?.path) === 'string') {\r\n return fatigueAssessmentFormRoute.path.replace(':id', id.toString());\r\n }\r\n return '';\r\n};\r\n\r\nexport const allFatigueAssessmentRoutes = (): any[] => {\r\n const routes = [\r\n fatigueAssessmentRoute,\r\n fatigueAssessmentBlankFormRoute,\r\n fatigueAssessmentFormRoute,\r\n fatigueAssessmentOnBehalfRoute,\r\n fatigueAssessmentAssignRoute,\r\n fatigueAssessmentDashboardPathRoute,\r\n fatigueAssessmentPendingPathRoute,\r\n fatigueAssessmentActionPathRoute,\r\n fatigueAssessmentRevisitPathRoute,\r\n fatigueAssessmentCompletedPathRoute,\r\n fatigueAssessmentDetailsPathRoute,\r\n fatigueAssessmentOverviewPathRoute\r\n ];\r\n return routes;\r\n};\r\n","import React, { useState } from 'react';\r\nimport { Link, useHistory } from 'react-router-dom';\r\nimport { FatigueAssessmentForm, FatigueAssessmentRiskEnum, FatigueAssessmentTaskEnum } from 'shared/models/api/models';\r\nimport { fatigueAssessmentFormUrl } from 'components/ui/FatigueAssessmentRules';\r\nimport { formatDateTime } from \"shared/models/mapping/mapping\";\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport { Tabs } from './FatigueAssessmentDetails';\r\nimport { fatigueAssessmentDashboardPathRoute, dashboardPending, dashboardAction, dashboardRevisit, dashboardCompleted, dashboardOverview } from './FatigueAssessmentRoutes';\r\n\r\nimport {\r\n FiberManualRecord,\r\n InfoOutlined as InfoIcon,\r\n Reply as ActionIcon,\r\n AssignmentTurnedInOutlined as StatusComplete,\r\n QueryBuilder as StatusPending\r\n} from '@material-ui/icons';\r\n\r\n\r\ninterface CardProps {\r\n assessment: FatigueAssessmentForm\r\n adminView?: boolean,\r\n currentView: FatigueAssessmentView\r\n}\r\n\r\nconst CardRow = (props: CardProps) => {\r\n const [assessment] = useState(props.assessment);\r\n const history = useHistory();\r\n\r\n const shiftStartTimeFormatted = () => {\r\n var date = assessment.shiftStartTime || new Date();\r\n return formatDateTime(date);\r\n }\r\n\r\n const isActionableOverdue = (shiftStartTime?: Date): boolean => {\r\n if (typeof (shiftStartTime) === 'string') {\r\n shiftStartTime = new Date(shiftStartTime);\r\n }\r\n let wellOverdueThreshold = 30 * 60000; //30 minutes\r\n if (shiftStartTime)\r\n return shiftStartTime.getTime() < Date.now() - wellOverdueThreshold\r\n\r\n return false;\r\n }\r\n\r\n const displayDue = (shiftStartTime?: Date) => {\r\n\r\n if (typeof (shiftStartTime) === 'string') {\r\n shiftStartTime = new Date(shiftStartTime);\r\n }\r\n\r\n if (shiftStartTime === undefined) {\r\n return (<>);\r\n }\r\n\r\n let dueState = \"due\";\r\n let dueMessage = \"Due\";\r\n\r\n let slightOverdueThreshold = 15 * 60000; //15 minutes\r\n\r\n\r\n if (isActionableOverdue(shiftStartTime)) {\r\n dueState = \"overdue\";\r\n dueMessage = \"Overdue >30 min\";\r\n }\r\n else if (shiftStartTime.getTime() < Date.now() - slightOverdueThreshold) {\r\n dueState = \"overdue\";\r\n dueMessage = \"Overdue >15 min\";\r\n }\r\n else if (shiftStartTime.getTime() < Date.now()) {\r\n dueState = \"over-slight\";\r\n dueMessage = \"Overdue <15 min\";\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
{dueMessage}
\r\n \r\n );\r\n\r\n }\r\n\r\n const displayRisk = (risk?: FatigueAssessmentRiskEnum) => {\r\n\r\n if (risk === undefined || risk === FatigueAssessmentRiskEnum.NA) {\r\n return (<>);\r\n }\r\n\r\n return (\r\n
\r\n \r\n
{FatigueAssessmentRiskEnum[risk]}
\r\n
\r\n );\r\n }\r\n\r\n const displayTask = (task?: FatigueAssessmentTaskEnum) => {\r\n if (task === FatigueAssessmentTaskEnum.NoAction) {\r\n return (\r\n
No action
\r\n );\r\n }\r\n\r\n else if (task === FatigueAssessmentTaskEnum.ToAction) {\r\n return (\r\n
To action
\r\n );\r\n }\r\n\r\n else if (task === FatigueAssessmentTaskEnum.ToRevisit) {\r\n return (\r\n
To revisit
\r\n );\r\n }\r\n\r\n return (<>);\r\n }\r\n\r\n const pages: { [id: number]: string; } = {};\r\n pages[FatigueAssessmentView.Pending] = dashboardPending;\r\n pages[FatigueAssessmentView.ToAction] = dashboardAction;\r\n pages[FatigueAssessmentView.ToRevisit] = dashboardRevisit;\r\n pages[FatigueAssessmentView.Completed] = dashboardCompleted;\r\n pages[FatigueAssessmentView.Overview] = dashboardOverview;\r\n\r\n const getActionPath = (id: number, tab: string) => {\r\n let url = `${ fatigueAssessmentDashboardPathRoute.path }/${ pages[props.currentView] }/${ id }/${ tab }`;\r\n return url;\r\n }\r\n\r\n const displayFatigueAssessmentDetails = (event: any, tab?: string) => {\r\n event.stopPropagation();\r\n\r\n if (props.adminView !== true || props.currentView == FatigueAssessmentView.Overview) {\r\n return;\r\n }\r\n\r\n if (!tab) {\r\n tab = (props.currentView == FatigueAssessmentView.Pending) ? Tabs.notes : Tabs.actions;\r\n }\r\n\r\n const path = getActionPath(assessment.id, tab);\r\n history.push(path);\r\n }\r\n\r\n return (\r\n displayFatigueAssessmentDetails(event)} >\r\n\r\n {props.adminView === true &&\r\n <>\r\n
\r\n {assessment.assessmentDate ?\r\n
\r\n :\r\n
\r\n }\r\n
\r\n \r\n }\r\n\r\n
\r\n {!assessment.assessmentDate &&\r\n <>\r\n {displayDue(assessment.shiftStartTime)}\r\n \r\n }\r\n
\r\n\r\n
\r\n {assessment.user?.fullname}\r\n
\r\n
Location: {assessment.signOnLocation?.name}
\r\n
Shift start time: {`${ shiftStartTimeFormatted() }`}
\r\n {\r\n (props.currentView === FatigueAssessmentView.Overview) &&\r\n
Supervisor: {assessment.supervisor?.fullname}
\r\n }\r\n
\r\n
\r\n\r\n
{assessment.signOnLocation?.name}
\r\n\r\n
{`${ shiftStartTimeFormatted() }`}
\r\n\r\n {\r\n (props.currentView === FatigueAssessmentView.Overview || props.currentView === FatigueAssessmentView.ToAction) &&\r\n
{assessment.supervisor?.fullname}
\r\n }\r\n\r\n {props.adminView === true &&\r\n <>\r\n
{displayRisk(assessment.risk)}
\r\n\r\n
{displayTask(isActionableOverdue(assessment.shiftStartTime) && !(assessment.assessmentDate) ? FatigueAssessmentTaskEnum.ToAction : assessment.task)}
\r\n\r\n {\r\n (props.currentView !== FatigueAssessmentView.Overview) &&\r\n displayFatigueAssessmentDetails(event)}>\r\n
\r\n
\r\n
\r\n
\r\n }\r\n\r\n displayFatigueAssessmentDetails(event, Tabs.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\nconst FatigueAssessmentCard = (props: CardProps) => {\r\n const cardUrl = fatigueAssessmentFormUrl(props.assessment.id);\r\n\r\n return (\r\n <>\r\n {props.adminView !== true ?\r\n \r\n \r\n \r\n :\r\n \r\n }\r\n \r\n );\r\n}\r\n\r\nexport default FatigueAssessmentCard;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { applicationState } from 'shared/store/applicationState'\r\nimport { FatigueAssessmentForm, DashboardQueryModel, FatigueAssessmentTaskEnum, FatigueAssessment, LocationDetail } from 'shared/models/api/models';\r\nimport { getFatigueAssessments, getDashboardFatigueAssessments } from 'shared/services/fatigueAssessmentApi';\r\nimport { getLocations, getLocationsWithDetail } from 'shared/services/locationApi';\r\nimport { IUserSearchResult, Location, FatigueAssessmentRiskEnum } from 'shared/models/api/models';\r\nimport { toISOLocalDate } from \"shared/models/mapping/mapping\";\r\nimport { Toggle } from \"components/ui/ToggleContent\";\r\nimport { PageList } from \"components/ui/PageList\";\r\nimport { Chip } from '@material-ui/core';\r\nimport { FilterArrow } from 'components/portal/GridComponents';\r\nimport { ToggleButton } from 'components/ui/ToggleButton';\r\nimport Card from './FatigueAssessmentCard';\r\nimport { FatigueAssessmentView } from './FatigueAssessmentView';\r\nimport { UserChoice } from './FormControls';\r\n\r\nimport {\r\n Input,\r\n Label,\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu\r\n} from 'reactstrap';\r\n\r\nimport {\r\n myForm,\r\n shiftSummaryDashboardPending,\r\n shiftSummaryDashboardToAction,\r\n shiftSummaryDashboardToRevisit\r\n} from \"./FatigueAssessmentPageSelector\";\r\n\r\nimport {\r\n fatigueAssessmentRoute,\r\n fatigueAssessmentPendingPathRoute,\r\n fatigueAssessmentActionPathRoute,\r\n fatigueAssessmentRevisitPathRoute,\r\n fatigueAssessmentCompletedPathRoute\r\n} from 'components/portal/fatigueAssessment/FatigueAssessmentRoutes';\r\n\r\nimport {\r\n ChevronRight as LinkIcon,\r\n ArrowDownward as SortDescIcon,\r\n ArrowUpward as SortAscIcon,\r\n ImportExport as SortNoneIcon,\r\n NearMeOutlined,\r\n SupervisorAccountOutlined\r\n} from '@material-ui/icons';\r\nimport { Cell, Legend, Pie, PieChart, ResponsiveContainer } from 'recharts';\r\n\r\n\r\nenum OrderByOption {\r\n NameAsc,\r\n NameDesc,\r\n ShiftStartTimeAsc,\r\n ShiftStartTimeDesc\r\n}\r\n\r\nclass FilterType {\r\n static supervisor: string = 'Supervisor';\r\n static location: string = 'Location';\r\n static date: string = 'Date';\r\n}\r\n\r\n\r\ninterface TitleProps {\r\n title: string,\r\n titleIcon?: any\r\n}\r\n\r\nconst TitleContainer = (props: TitleProps) => {\r\n return (\r\n
\r\n {props.titleIcon}\r\n
{props.title}
\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface IPageSizeDropdownProps {\r\n pageSize: number,\r\n setPageSize: (pageSize: number) => void,\r\n defaultExpanded?: boolean,\r\n sizes: number[]\r\n}\r\n\r\nconst PageSizeDropdown = (props: IPageSizeDropdownProps) => {\r\n return (\r\n \r\n
\r\n {props.sizes.map(s =>\r\n
props.setPageSize(s)}>{s} items
\r\n )}\r\n
\r\n
\r\n );\r\n}\r\n\r\nconst PageSizeWithPicker = (props: IPageSizeDropdownProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\n\r\ninterface ResultCountProps {\r\n viewCount: number,\r\n resultCount: number,\r\n pageSize: number,\r\n setPageSize: any,\r\n link?: string,\r\n visible?: boolean\r\n}\r\n\r\nconst ResultCountContainer = (props: ResultCountProps) => {\r\n\r\n if (!props.visible) {\r\n return (<>);\r\n }\r\n\r\n return (\r\n
\r\n {props.link &&\r\n \r\n {props.viewCount} of {props.resultCount} results\r\n \r\n \r\n }\r\n {!props.link &&\r\n
\r\n \r\n \r\n \r\n per page of {props.resultCount} results\r\n
\r\n }\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface TabsProps {\r\n tabs: FatigueAssessmentView[],\r\n currentView: FatigueAssessmentView,\r\n setCurrentView: any,\r\n visible?: boolean\r\n}\r\n\r\nconst TabsContainer = (props: TabsProps) => {\r\n\r\n const getTabLabel = (view: FatigueAssessmentView) => {\r\n let selectedPage = myForm;\r\n\r\n if (view == FatigueAssessmentView.Pending) {\r\n selectedPage = shiftSummaryDashboardPending;\r\n }\r\n else if (view == FatigueAssessmentView.ToAction) {\r\n selectedPage = shiftSummaryDashboardToAction;\r\n }\r\n else if (view == FatigueAssessmentView.ToRevisit) {\r\n selectedPage = shiftSummaryDashboardToRevisit;\r\n }\r\n\r\n let title = selectedPage.label;\r\n if (title.startsWith(\"\\u2003\")) {\r\n title = title.substr(title.indexOf(\" \") + 1);\r\n }\r\n\r\n return title;\r\n }\r\n\r\n useEffect(() => {\r\n }, [props.currentView]);\r\n\r\n if (!props.visible) {\r\n return (<>);\r\n }\r\n\r\n return (\r\n
\r\n {props.tabs.map((view) =>\r\n
props.setCurrentView(view)}>\r\n {getTabLabel(view)}\r\n
\r\n )}\r\n
\r\n );\r\n}\r\ninterface IChartContainerProps {\r\n assessments: FatigueAssessmentForm[],\r\n currentView: FatigueAssessmentView\r\n}\r\n\r\nconst ChartContainer = (props: IChartContainerProps) => {\r\n const COLORS = {\r\n \"Completed\": \"#01ab8b\",\r\n \"High Risk\": \"#ff0000\",\r\n \"Medium Risk\": \"#fab636\",\r\n \"Incomplete\": \"#234483\"\r\n } as { [key: string]: string };\r\n\r\n\r\n const data = props.assessments.reduce((acc, form) => {\r\n\r\n let riskLevel = \"Completed\";\r\n if (form.risk == FatigueAssessmentRiskEnum.High) {\r\n riskLevel = \"High Risk\";\r\n }\r\n if (form.risk == FatigueAssessmentRiskEnum.Medium) {\r\n riskLevel = \"Medium Risk\";\r\n }\r\n if (!form.risk && !form.assessmentDate) {\r\n riskLevel = \"Incomplete\";\r\n }\r\n const existing = acc.find(item => item.name === riskLevel);\r\n if (existing) {\r\n existing.value++;\r\n } else {\r\n acc.push({ name: riskLevel, value: 1 });\r\n }\r\n return acc;\r\n }, [] as { name: string, value: number }[]);\r\n\r\n if (props.currentView === FatigueAssessmentView.Overview && data.length > 0)\r\n return (\r\n <>\r\n {/* */}\r\n \r\n \r\n \r\n {data.map((entry, index) => (\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\ninterface FilterItem {\r\n type: string,\r\n label: string,\r\n value: any,\r\n}\r\n\r\ninterface AnswerProps {\r\n onAnswerUpdate: (filter: FilterItem) => any;\r\n}\r\n\r\nconst LocationChoice = (props: AnswerProps) => {\r\n const [locations, setLocations] = useState([] as LocationDetail[]);\r\n\r\n const onAnswerUpdate = (label: string, value: any) => {\r\n if (value !== undefined) {\r\n let filter = {\r\n type: FilterType.location,\r\n label: label,\r\n value: value\r\n } as FilterItem;\r\n props.onAnswerUpdate(filter);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const results = await getLocationsWithDetail();\r\n if (mounted) {\r\n setLocations(results);\r\n }\r\n };\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n
\r\n \r\n \r\n
Select
\r\n
\r\n \r\n {locations.map((location) => (\r\n
onAnswerUpdate(location.name, location.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\nconst DateChoice = (props: AnswerProps) => {\r\n const dateTimeFormat = new Intl.DateTimeFormat(\"en-AU\", {});\r\n\r\n const updateDate = (event: any) => {\r\n if (event !== undefined) {\r\n if (Date.parse(event.target.value)) {\r\n let filter = {\r\n type: FilterType.date,\r\n label: dateTimeFormat.format(new Date(event.target.value)),\r\n value: event.target.value\r\n } as FilterItem;\r\n props.onAnswerUpdate(filter);\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\ninterface FilterProps extends AnswerProps {\r\n onDelete: (index: number) => any,\r\n filters: FilterItem[],\r\n showSupervisor: boolean,\r\n visible?: boolean\r\n}\r\n\r\nconst FilterContainer = (props: FilterProps) => {\r\n\r\n if (!props.visible) {\r\n return (<>);\r\n }\r\n\r\n const onSupervisorUpdate = (userResult: IUserSearchResult) => {\r\n let supervisorFilter = {\r\n type: FilterType.supervisor,\r\n label: userResult.fullname,\r\n value: userResult.id\r\n } as FilterItem;\r\n\r\n props.onAnswerUpdate(supervisorFilter)\r\n }\r\n const title = props.showSupervisor ? \"Filter by shift location, date or supervisor\" : \"Select shift location and date\";\r\n return (\r\n
\r\n
{title}
\r\n
\r\n\r\n {props.showSupervisor &&\r\n
\r\n
Supervisor
\r\n
\r\n \r\n
\r\n
\r\n }\r\n\r\n
\r\n
Shift Location
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
Date
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n {\r\n props.filters.map((filter, i) => (\r\n props.onDelete(i)}\r\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 FaListProps {\r\n loading: boolean,\r\n adminView?: boolean,\r\n currentView: FatigueAssessmentView,\r\n assessments: FatigueAssessmentForm[],\r\n pageNumber: number,\r\n pageSize: number,\r\n orderByOption: OrderByOption,\r\n orderByName: any,\r\n orderByShiftStartTime: any\r\n}\r\n\r\nconst FaListContainer = (props: FaListProps) => {\r\n const [displayAssessments, setDisplayAssessments] = useState(props.assessments.slice(0, props.pageSize));\r\n const [riskOptions, setRiskOptions] = useState([] as string[]);\r\n const [riskFilter, setRiskFilter] = useState([] as FatigueAssessmentRiskEnum[]);\r\n\r\n const nameOrderIcon = () => {\r\n if (props.orderByOption === OrderByOption.NameAsc) {\r\n return ();\r\n }\r\n else if (props.orderByOption === OrderByOption.NameDesc) {\r\n return ();\r\n }\r\n return ();\r\n }\r\n\r\n const shiftStartTimeOrderIcon = () => {\r\n if (props.orderByOption === OrderByOption.ShiftStartTimeAsc) {\r\n return ();\r\n }\r\n else if (props.orderByOption === OrderByOption.ShiftStartTimeDesc) {\r\n return ();\r\n }\r\n return ();\r\n }\r\n\r\n const filterRisk = ((risks: string[]) => {\r\n if (risks.length === 0 || risks[0] === 'All') {\r\n setRiskFilter([]);\r\n return;\r\n }\r\n\r\n let newRisks = [] as FatigueAssessmentRiskEnum[];\r\n\r\n risks.map(r => {\r\n let riskValue = Object.keys(FatigueAssessmentRiskEnum)[Object.values(FatigueAssessmentRiskEnum).indexOf(r)];\r\n newRisks.push(parseInt(riskValue));\r\n });\r\n\r\n setRiskFilter(newRisks);\r\n\r\n });\r\n\r\n useEffect(() => {\r\n let start = (props.pageNumber - 1) * props.pageSize;\r\n\r\n let newDisplayAssessments = props.assessments.slice(start, start + props.pageSize);\r\n\r\n if (riskFilter.length > 0) {\r\n newDisplayAssessments = newDisplayAssessments.filter((item) => riskFilter.includes(item.risk || 0))\r\n }\r\n\r\n setDisplayAssessments(newDisplayAssessments);\r\n\r\n setRiskOptions(\r\n props.assessments\r\n .filter((item, i, arr) => arr.findIndex(a => a.risk === item.risk) === i)\r\n .map(a => (a.risk || 0) as number)\r\n .sort()\r\n .map(r => FatigueAssessmentRiskEnum[r])\r\n );\r\n\r\n }, [props.assessments, props.pageNumber, props.pageSize, riskFilter]);\r\n\r\n return (\r\n
\r\n {props.loading === true ?\r\n
Loading...
\r\n :\r\n <>\r\n
\r\n\r\n {props.adminView === true &&\r\n <>\r\n
Status
\r\n \r\n }\r\n
Due
\r\n\r\n
Name {nameOrderIcon()}
\r\n\r\n
Location
\r\n\r\n
Shift start time {shiftStartTimeOrderIcon()}
\r\n\r\n {(props.currentView === FatigueAssessmentView.Overview || props.currentView === FatigueAssessmentView.ToAction) &&\r\n <>\r\n
Supervisor
\r\n \r\n }\r\n\r\n {props.adminView === true &&\r\n <>\r\n
\r\n \r\n
\r\n\r\n
Task
\r\n\r\n {props.currentView !== FatigueAssessmentView.Overview &&\r\n
Action
\r\n }\r\n\r\n
Info
\r\n \r\n }\r\n\r\n
\r\n\r\n
\r\n\r\n {(displayAssessments !== undefined && displayAssessments.length > 0) ? displayAssessments.map((assessment) => (\r\n \r\n ))\r\n :\r\n
There are no actionable fatigue assessments to display.
\r\n }\r\n \r\n }\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface FooterProps {\r\n pageNumber: number,\r\n pageSize: number,\r\n totalResults: number,\r\n moveToPage: any,\r\n visible?: boolean\r\n}\r\n\r\nconst FooterContainer = (props: FooterProps) => {\r\n\r\n if (!props.visible) {\r\n return (<>);\r\n }\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\ninterface FatigueAssessmentCardListProps {\r\n view: FatigueAssessmentView[],\r\n title: string,\r\n titleIcon?: any,\r\n showPageSize?: boolean,\r\n showHeaderLink?: boolean,\r\n showFilters?: boolean,\r\n showFooter?: boolean\r\n}\r\n\r\nconst FatigueAssessmentCardList = (props: FatigueAssessmentCardListProps) => {\r\n const [currentView, setCurrentView] = useState(props.view[0]);\r\n const [assessmentCacheTime, setAssessmentCacheTime] = useState(new Date().getTime());\r\n const [assessments, setAssessments] = useState(undefined as FatigueAssessmentForm[] | undefined);\r\n const [viewAssessments, setViewAssessments] = useState([] as FatigueAssessmentForm[]);\r\n const [loading, setLoading] = useState(true);\r\n const [pageSize, setPageSize] = useState(25);\r\n const [pageNumber, setPageNumber] = useState(1);\r\n const [headerLink, setHeaderLink] = useState(undefined as string | undefined);\r\n const [adminView, setAdminView] = useState(false);\r\n const [orderByOption, setOrderByOption] = useState(OrderByOption.ShiftStartTimeAsc);\r\n const [loadBackground, setLoadBackground] = useState(false);\r\n\r\n const dateTimeFormat = new Intl.DateTimeFormat(\"en-AU\", {});\r\n\r\n const getDefaultFilters = () => {\r\n let defaultFilters = [] as FilterItem[];\r\n let profile = applicationState.getProfile();\r\n // if (profile && currentView === FatigueAssessmentView.Overview) {\r\n // defaultFilters.push(\r\n // {\r\n // type: FilterType.supervisor,\r\n // label: `${ profile.firstname } ${ profile.lastname }`,\r\n // value: profile.id\r\n // } as FilterItem\r\n // );\r\n // }\r\n const todayDate = new Date();\r\n let nowDate = toISOLocalDate(todayDate);\r\n defaultFilters.push(\r\n {\r\n type: FilterType.date,\r\n label: dateTimeFormat.format(todayDate),\r\n value: nowDate\r\n } as FilterItem\r\n );\r\n return defaultFilters;\r\n }\r\n const [filters, setFilters] = useState(getDefaultFilters());\r\n\r\n\r\n const getViewData = async () => {\r\n setAssessmentCacheTime(new Date().getTime());\r\n let items: FatigueAssessmentForm[] = [];\r\n\r\n if (currentView === FatigueAssessmentView.MyForm) {\r\n items = await getFatigueAssessments();\r\n setAdminView(false);\r\n setAssessmentCacheTime(new Date().getTime());\r\n return items;\r\n }\r\n\r\n setAdminView(true);\r\n let dashboardQuery = { pending: false } as DashboardQueryModel;\r\n\r\n let supervisorFilters = filters.filter(f => f.type === FilterType.supervisor);\r\n if (supervisorFilters !== undefined && supervisorFilters.length > 0) {\r\n dashboardQuery.supervisorIds = [];\r\n supervisorFilters.map((filter) => {\r\n let value = filter.value;\r\n if (typeof (value) === 'string') {\r\n value = parseInt(value);\r\n }\r\n dashboardQuery.supervisorIds?.push(value);\r\n });\r\n }\r\n\r\n let locationFilters = filters.filter(f => f.type === FilterType.location);\r\n if (locationFilters !== undefined && locationFilters.length > 0) {\r\n dashboardQuery.locationIds = [];\r\n locationFilters.map((filter) => {\r\n let value = filter.value;\r\n if (typeof (value) === 'string') {\r\n value = parseInt(value);\r\n }\r\n dashboardQuery.locationIds?.push(value);\r\n });\r\n }\r\n\r\n let dateFilter = filters.find(f => f.type === FilterType.date);\r\n if (dateFilter !== undefined) {\r\n dashboardQuery.date = dateFilter.value;\r\n }\r\n\r\n if (currentView === FatigueAssessmentView.Pending) {\r\n dashboardQuery.pending = true;\r\n items = await getDashboardFatigueAssessments(dashboardQuery);\r\n }\r\n else if (currentView === FatigueAssessmentView.ToAction) {\r\n dashboardQuery.task = FatigueAssessmentTaskEnum.ToAction;\r\n items = await getDashboardFatigueAssessments(dashboardQuery);\r\n }\r\n else if (currentView === FatigueAssessmentView.ToRevisit) {\r\n dashboardQuery.task = FatigueAssessmentTaskEnum.ToRevisit;\r\n items = await getDashboardFatigueAssessments(dashboardQuery);\r\n }\r\n else if (currentView === FatigueAssessmentView.Completed) {\r\n dashboardQuery.task = FatigueAssessmentTaskEnum.NoAction;\r\n items = await getDashboardFatigueAssessments(dashboardQuery);\r\n }\r\n else if (currentView === FatigueAssessmentView.Overview) {\r\n dashboardQuery.overview = true;\r\n items = await getDashboardFatigueAssessments(dashboardQuery);\r\n }\r\n\r\n\r\n setAssessmentCacheTime(new Date().getTime());\r\n return items;\r\n }\r\n\r\n const orderByName = () => {\r\n let data: FatigueAssessmentForm[] = assessments ? [...assessments] : [];\r\n\r\n data.sort((a, b) => {\r\n let aName = a.user?.fullname || \"\";\r\n let bName = b.user?.fullname || \"\";\r\n return aName.localeCompare(bName);\r\n }\r\n );\r\n\r\n let sortBy = OrderByOption.NameAsc;\r\n if (orderByOption == OrderByOption.NameAsc) {\r\n sortBy = OrderByOption.NameDesc;\r\n data.reverse();\r\n }\r\n setOrderByOption(sortBy);\r\n setViewAssessments(data);\r\n }\r\n\r\n const orderByShiftStartTime = () => {\r\n let data: FatigueAssessmentForm[] = assessments ? [...assessments] : [];\r\n\r\n data.sort((a, b) => {\r\n let aTime = a.shiftStartTime || Date.now;\r\n let bTime = b.shiftStartTime || Date.now;\r\n if (aTime < bTime) return -1;\r\n if (aTime > bTime) return 1;\r\n return 0;\r\n }\r\n );\r\n\r\n let sortBy = OrderByOption.ShiftStartTimeAsc;\r\n if (orderByOption == OrderByOption.ShiftStartTimeAsc) {\r\n sortBy = OrderByOption.ShiftStartTimeDesc;\r\n data.reverse();\r\n }\r\n\r\n setOrderByOption(sortBy);\r\n setViewAssessments(data);\r\n }\r\n\r\n const configHeaderLink = () => {\r\n if (!props.showHeaderLink) {\r\n return;\r\n }\r\n\r\n let link = undefined as string | string[] | undefined\r\n\r\n if (currentView === FatigueAssessmentView.MyForm) {\r\n link = fatigueAssessmentRoute.path;\r\n }\r\n else if (currentView === FatigueAssessmentView.Pending) {\r\n link = fatigueAssessmentPendingPathRoute.path;\r\n }\r\n else if (currentView === FatigueAssessmentView.ToAction) {\r\n link = fatigueAssessmentActionPathRoute.path;\r\n }\r\n else if (currentView === FatigueAssessmentView.ToRevisit) {\r\n link = fatigueAssessmentRevisitPathRoute.path;\r\n }\r\n else if (currentView === FatigueAssessmentView.Completed) {\r\n link = fatigueAssessmentCompletedPathRoute.path;\r\n }\r\n\r\n if (typeof (link) === 'string') {\r\n setHeaderLink(link);\r\n }\r\n\r\n }\r\n\r\n const moveToPage = (page: number) => {\r\n setPageNumber(page);\r\n }\r\n\r\n const updateCurrentView = (view: FatigueAssessmentView) => {\r\n setAssessments(undefined);\r\n setCurrentView(view);\r\n }\r\n\r\n const handleFilterChange = (filter: FilterItem) => {\r\n if (filters.some(f => f.type === filter.type && f.value === filter.value)) {\r\n return; //prevent duplicates\r\n }\r\n\r\n let newFilters = [...filters];\r\n\r\n // Maximum of 1 date filter, replace old value if found\r\n if (filter.type === FilterType.date) {\r\n let oldDateFilterIndex = filters.findIndex(f => { return f.type === FilterType.date });\r\n if (oldDateFilterIndex > -1) {\r\n newFilters.splice(oldDateFilterIndex, 1);\r\n }\r\n }\r\n\r\n setFilters([...newFilters, filter]);\r\n setLoadBackground(true);\r\n }\r\n\r\n const onDeleteFilter = (index: number) => {\r\n let newFilters = [...filters];\r\n newFilters.splice(index, 1);\r\n setFilters(newFilters);\r\n setLoadBackground(true);\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n setLoading(true);\r\n const items = await getViewData();\r\n configHeaderLink();\r\n\r\n if (mounted && Array.isArray(items)) {\r\n setAssessments(items);\r\n setViewAssessments(items);\r\n setLoading(false);\r\n }\r\n };\r\n\r\n if (!assessments) {\r\n mount();\r\n }\r\n\r\n return () => { mounted = false; };\r\n }, [currentView, viewAssessments]);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const items = await getViewData();\r\n if (mounted && Array.isArray(items)) {\r\n setAssessments(items);\r\n setViewAssessments(items);\r\n }\r\n setLoadBackground(false);\r\n }\r\n\r\n if (loadBackground) {\r\n mount();\r\n }\r\n\r\n return () => { mounted = false; };\r\n }, [loadBackground]);\r\n\r\n useEffect(() => {\r\n const pollingSeconds = 60;\r\n const cacheAgeThreshold = 50;\r\n const interval = setInterval(() => {\r\n if (currentView !== FatigueAssessmentView.MyForm && assessmentCacheTime < new Date().getTime() - (cacheAgeThreshold * 1000)) {\r\n setLoadBackground(true);\r\n }\r\n }, pollingSeconds * 1000);\r\n return () => {\r\n clearInterval(interval);\r\n }\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n\r\n \r\n\r\n 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 );\r\n}\r\n\r\nexport default FatigueAssessmentCardList;\r\n","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgQlTakeTimeTalks(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 52.772,\n height: 38,\n viewBox: \"0 0 52.772 38\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.009 20.557a10.51 10.51 0 0 0 4.17-8.338C24.179 5.474 17.551 0 9.325 0A22.447 22.447 0 0 0 0 2.42c1.536.995 4.713 3.553 4.713 3.553a15.436 15.436 0 0 1 2.478 2.893 11.6 11.6 0 0 1 2 5.934c.018.345-.07 1.139-.07 1.557a13.75 13.75 0 0 1-1.25 3.368c-.117.11-1.024 1.619-1.255 1.83-.125.115-.24.446-.47.643-.443.382-.971 1.044-1.6 1.521a8.257 8.257 0 0 0-2.018 1.625c.207.019 6.483 5.982 7.754 5.815.455-.06-.118-.981-.2-1.795-.175-1.812.983-5.194 1.222-5.194 1.226 0 8.7-3.615 8.7-3.615z\",\n transform: \"translate(-911 -282.539) rotate(-15 1562.991 -3396.556)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.151 12C16.231 12 9 17.549 9 24.395c0 3.6 2.005 6.844 5.2 9.108-1.613 2.8-1.86 5.28-5.111 6.933h2.6a14.67 14.67 0 0 0 6.154-1.847c1.329-.6 1.368-.647 3.047-2.234a20.794 20.794 0 0 0 4.261.434c8.92 0 16.151-5.549 16.151-12.395S34.071 12 25.151 12z\",\n transform: \"translate(-911 -282.539) translate(902 280.102)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgQlTakeTimeTalks);\nexport default __webpack_public_path__ + \"static/media/ql-take-time-talks.ace805ea.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { Card } from 'reactstrap';\r\nimport useSelector from 'hooks/useSelector';\r\nimport { userHasPermission } from 'hooks/useRoles';\r\nimport { Replay as ReplayIcon } from '@material-ui/icons';\r\nimport FatigueAssessmentCardList from \"components/portal/fatigueAssessment/FatigueAssessmentCardList\";\r\nimport { FatigueAssessmentView } from 'components/portal/fatigueAssessment//FatigueAssessmentView';\r\n\r\nimport './grid-cards.css'\r\n\r\n\r\nconst ActionableFatigueAssessments = () => {\r\n const profile = useSelector(state => state.profile);\r\n\r\n const hasAdminPermission = () => {\r\n if (profile === undefined) {\r\n return false;\r\n }\r\n\r\n var perm = userHasPermission(\"web.admin.fatigue-assessment.shift-summary-dashboard\", profile?.roles);\r\n return perm;\r\n }\r\n\r\n const viewTabs = () => {\r\n let tabs = [FatigueAssessmentView.MyForm];\r\n\r\n if (hasAdminPermission()) {\r\n tabs = [...tabs, FatigueAssessmentView.Pending, FatigueAssessmentView.ToAction, FatigueAssessmentView.ToRevisit];\r\n }\r\n\r\n return tabs;\r\n }\r\n\r\n const getTitle = () => {\r\n if (hasAdminPermission()) {\r\n return \"My actionable Fatigue Assessment forms\";\r\n }\r\n return \"My actionable Fatigue Assessment form\";\r\n }\r\n\r\n\r\n useEffect(() => {\r\n }, [profile]);\r\n\r\n return (\r\n \r\n }\r\n showPageSize={true}\r\n showHeaderLink={true}\r\n />\r\n \r\n );\r\n}\r\n\r\nexport default ActionableFatigueAssessments;\r\n","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgQlIdeasHub(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 29.652,\n height: 40.232,\n viewBox: \"0 0 29.652 40.232\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.826 3a14.222 14.222 0 0 0-2.964.3 14.8 14.8 0 0 0-6.9 25.579 4.118 4.118 0 0 1 1.4 3.113v4.888a4.247 4.247 0 0 0 4.235 4.235h.593a4.191 4.191 0 0 0 7.284 0h.593A4.247 4.247 0 0 0 28.3 36.88v-4.891a4.107 4.107 0 0 1 1.351-3.089A14.806 14.806 0 0 0 19.826 3zm4.235 33.88h-8.47v-2.118h8.47zm0-4.235h-8.47v-2.118h8.47zm-3.176-11.837v5.484h-2.118v-5.484l-3.875-3.854 1.5-1.5 3.43 3.43 3.43-3.43 1.5 1.5z\",\n transform: \"translate(-.997 -5.676) translate(-4 2.676)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgQlIdeasHub);\nexport default __webpack_public_path__ + \"static/media/ql-ideas-hub.0bc3d5a1.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgQlSuccessFactors(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 45.189,\n height: 33.14,\n viewBox: \"0 0 45.189 33.14\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.929 33.14H2.258A2.21 2.21 0 0 1 0 30.88V8.285a2.21 2.21 0 0 1 2.258-2.26h40.671a2.211 2.211 0 0 1 2.26 2.26V30.88a2.211 2.211 0 0 1-2.26 2.26zm-12.947-9.685L28.7 24.63l3.092 3.39 5.145-4.156L39 22.2l-1.1-1.36-1.907 1.543-.581.47-3.437 2.779-2-2.177zM13.778 21.9c-2.848 0-8.161 1.4-8.161 4.081v2.04h16.322V25.98c0-2.68-5.313-4.08-8.161-4.08zm0-10.2a4.081 4.081 0 1 0 4.081 4.081 4.086 4.086 0 0 0-4.081-4.081zm16.2 2.464L28.7 15.337l3.092 3.39 5.145-4.156L39 12.906l-1.1-1.359-2.489 2.012c-1.481 1.2-3.437 2.78-3.437 2.78l-2-2.179zM0 5.273V2.26A2.21 2.21 0 0 1 2.258 0h12.353a2.176 2.176 0 0 1 1.581.678l3.841 3.841H2.258A3.889 3.889 0 0 0 0 5.27z\",\n transform: \"translate(-620.623 -411) translate(620.623 411)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgQlSuccessFactors);\nexport default __webpack_public_path__ + \"static/media/ql-success-factors.4db9cc3e.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgQlFiori(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 36.84,\n height: 37.565,\n viewBox: \"0 0 36.84 37.565\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.6 19.109c-1.669 1.451-7.629 7.094-7.629 13.676s5.963 12.224 7.629 13.676c1.669-1.452 7.628-7.094 7.628-13.676S42.274 20.558 40.6 19.109z\",\n transform: \"translate(-1089.277 -308.507) translate(1077.886 289.89)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.629 0C5.959 1.451 0 7.094 0 13.676S5.959 25.9 7.629 27.352c1.671-1.452 7.627-7.094 7.627-13.676S9.3 1.449 7.629 0z\",\n transform: \"translate(-1089.277 -308.507) rotate(89 390.595 733.68)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.574 21.162a23.812 23.812 0 0 0 1.091 3.166c.141.27.289 1.25.471 1.3.174.073.306-1.126.306-1.126l.612-2.891.571-1.089.824-1.385L11.46 17.7l1.817-1.949a17.98 17.98 0 0 1 2.091-1.562 17.977 17.977 0 0 0-6.2-12.729L7.657 0 6.15 1.361A18.942 18.942 0 0 0 0 14.555c1.169.56 3.261 2.178 4.151 2.7.267.126-2.8-2.175-2.5-1.941a26.432 26.432 0 0 1 2.906 2.71 21.541 21.541 0 0 1 2.019 3.144z\",\n transform: \"translate(-1089.277 -308.507) rotate(-43 949.539 -1223.15)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgQlFiori);\nexport default __webpack_public_path__ + \"static/media/ql-fiori.02bf8c60.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgQlWebmail(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 48.727,\n height: 48.727,\n viewBox: \"0 0 48.727 48.727\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h48.727v48.727H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38.545 4H6.061A4.055 4.055 0 0 0 2.02 8.061L2 32.424a4.072 4.072 0 0 0 4.061 4.061h32.484a4.072 4.072 0 0 0 4.061-4.061V8.061A4.072 4.072 0 0 0 38.545 4zm0 8.121L22.3 22.272 6.061 12.121v-4.06L22.3 18.212 38.545 8.061z\",\n transform: \"translate(2.061 4.121)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgQlWebmail);\nexport default __webpack_public_path__ + \"static/media/ql-webmail.187b21a9.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgInsertComments(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20 2H4a2.006 2.006 0 0 0-2 2v12a2.006 2.006 0 0 0 2 2h14l4 4V4a2.006 2.006 0 0 0-2-2zm-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgInsertComments);\nexport default __webpack_public_path__ + \"static/media/insert-comments.5ac1abd9.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { ReactComponent as TakeTimeTalksIcon } from \"assets/icons/ql-take-time-talks.svg\";\r\nimport { ReactComponent as IdeasHubIcon } from \"assets/icons/ql-ideas-hub.svg\";\r\nimport { ReactComponent as SuccessFactorsIcon } from \"assets/icons/ql-success-factors.svg\";\r\nimport { ReactComponent as FioriIcon } from \"assets/icons/ql-fiori.svg\";\r\nimport { ReactComponent as WebMailIcon } from \"assets/icons/ql-webmail.svg\";\r\nimport { QuickLinksH1 } from \"components/menu/Labels\";\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { openInANewBrowser } from 'helpers/HelperFunctions';\r\n\r\nexport interface IQuickLinkItem {\r\n icon: any,\r\n title: React.ReactNode,\r\n className: string,\r\n url: string\r\n}\r\n\r\nexport const QuickLink = (props: { item: IQuickLinkItem }) => {\r\n const Icon = props.item.icon;\r\n\r\n const onClick = () => {\r\n openInANewBrowser(props.item.url);\r\n };\r\n\r\n return (\r\n
\r\n \r\n
\r\n {props.item.title}\r\n
\r\n );\r\n};\r\n\r\nexport const QuickLinksData = [\r\n { title: \"Field Leadership\", className: \"take-time\", icon: TakeTimeTalksIcon, url: \"https://flex.bhp.com/\"},\r\n { title: \"Ideas Hub\", className: \"ideas-hub\", icon: IdeasHubIcon, url: \"https://ideas.bhp.com/\"},\r\n { title: \"People System\", className: \"success-factors\", icon: SuccessFactorsIcon, url: \"https://performancemanager8.successfactors.com\" },\r\n { title: \"Fiori\", className: \"fiori\", icon: FioriIcon, url: \"https://mobile.bhp.com/fiori\"},\r\n { title: \"BHP Webmail\", className: \"web-mail\", icon: WebMailIcon, url: \"https://mail.bhp.com\"}\r\n] as IQuickLinkItem[];\r\n\r\nexport const QuickLinksCard = () => {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n\r\n {QuickLinksData.map((link, idx) =>\r\n \r\n )}\r\n
\r\n )\r\n};\r\n\r\nexport default QuickLinksCard;","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgDateRange(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 11H7v2h2zm4 0h-2v2h2zm4 0h-2v2h2zm2-7h-1V2h-2v2H8V2H6v2H5a1.991 1.991 0 0 0-1.99 2L3 20a2 2 0 0 0 2 2h14a2.006 2.006 0 0 0 2-2V6a2.006 2.006 0 0 0-2-2zm0 16H5V9h14z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgDateRange);\nexport default __webpack_public_path__ + \"static/media/date-range.1d022ed1.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { openInANewBrowser } from 'helpers/HelperFunctions';\r\nimport { ReactComponent as Feedback } from \"assets/icons/insert-comments.svg\";\r\nimport { Explore, Help } from '@material-ui/icons';\r\nimport { Grid } from '@material-ui/core';\r\n\r\nexport const SubmitTechFeedback = () => {\r\n openInANewBrowser(\"mailto:dl-tech-minaus-assetwest-railport-apps@bhp.com\");\r\n};\r\n\r\nexport const EmailSafeWorking = () => {\r\n openInANewBrowser(\"mailto:Safeworking.Specialist@bhpbilliton.com\");\r\n};\r\n\r\nexport const NeedDirectionCard = () => (\r\n
\r\n
\r\n \r\n \r\n
\r\n
Need direction?
\r\n
\r\n\r\n \r\n Check the User guide\r\n \r\n\r\n
\r\n Email Safe Working\r\n
\r\n\r\n
\r\n Submit tech feedback\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 NeedDirectionCard;","var _defs, _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgRailApp(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"icon_Rail_App\",\n \"data-name\": \"icon Rail App\",\n transform: \"translate(-1287 -331)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_1992\",\n \"data-name\": \"Rectangle 1992\",\n className: \"cls-1\",\n width: 24,\n height: 24,\n transform: \"translate(1287 331)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Shape\",\n d: \"M.8,12.4H3l-.307.74A1.2,1.2,0,0,0,3.8,14.8H5.128a1.2,1.2,0,0,0,1.157-.88l.42-1.52H17.3l.42,1.52a1.2,1.2,0,0,0,1.157.88H20.2a1.2,1.2,0,0,0,1.109-1.66L21,12.4h2.2a.8.8,0,0,0,.694-1.2l-1.146-2a.8.8,0,0,0-.7-.4H19.506l-.5-1.2h1.44a.8.8,0,0,0,.694-1.2l-.686-1.2a.8.8,0,0,0-.694-.4H17.846L17.514,4h.875a.8.8,0,0,0,.694-1.2L18.625,2a.8.8,0,0,0-.694-.4H16.517L16.058.493A.8.8,0,0,0,15.317,0h-.4a.8.8,0,0,0-.77,1.014l.162.586H9.693l.162-.585A.8.8,0,0,0,9.085,0h-.4a.8.8,0,0,0-.742.495L7.485,1.6H6.071a.8.8,0,0,0-.695.4l-.458.8A.8.8,0,0,0,5.613,4h.875l-.332.8H4.241a.8.8,0,0,0-.7.4L2.859,6.4a.8.8,0,0,0,.694,1.2h1.44l-.5,1.2H1.947a.8.8,0,0,0-.694.4l-1.146,2A.8.8,0,0,0,.8,12.4Zm6.125-.8.555-2h9.04l.553,2ZM9.029,4h5.944l.221.8H8.807ZM8.586,5.6h6.83l.332,1.2H8.254Zm-.553,2h7.936L16.3,8.8H7.7Zm14.022,2,1.146,2H20.668l-.83-2Zm-2.294-4,.687,1.2H18.676l-.5-1.2ZM17.93,2.4l.458.8H17.181l-.332-.8ZM15.321.8l5.247,12.647A.4.4,0,0,1,20.2,14H18.874a.4.4,0,0,1-.386-.293L14.917.8Zm-.789,1.6.221.8H9.25l.221-.8ZM8.685.8l.4,0v0L5.514,13.707A.4.4,0,0,1,5.128,14H3.8a.4.4,0,0,1-.37-.554ZM5.613,3.2l.458-.8h1.08l-.332.8ZM3.553,6.8l.688-1.2H5.826l-.5,1.2ZM1.947,9.6H4.164l-.83,2H.8Z\",\n transform: \"translate(1286.998 336)\"\n }))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgRailApp);\nexport default __webpack_public_path__ + \"static/media/rail-app.9b4f6141.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgTrainApp(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n className: \"svg-icon\",\n style: {\n width: \"1em\",\n height: \"1em\",\n verticalAlign: \"middle\",\n fill: \"currentColor\",\n overflow: \"hidden\"\n },\n viewBox: \"0 0 1024 1024\",\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, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M512 85.333333C341.333333 85.333333 170.666667 106.666667 170.666667 256v405.333333c0 82.346667 66.986667 149.333333 149.333333 149.333334l-64 64v21.333333h95.146667l85.333333-85.333333H597.333333l85.333334 85.333333h85.333333v-21.333333l-64-64c82.346667 0 149.333333-66.986667 149.333333-149.333334V256c0-149.333333-152.746667-170.666667-341.333333-170.666667z m-192 640c-35.413333 0-64-28.586667-64-64s28.586667-64 64-64 64 28.586667 64 64-28.586667 64-64 64z m149.333333-298.666666H256v-170.666667h213.333333v170.666667z m85.333334 0v-170.666667h213.333333v170.666667H554.666667z m149.333333 298.666666c-35.413333 0-64-28.586667-64-64s28.586667-64 64-64 64 28.586667 64 64-28.586667 64-64 64z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgTrainApp);\nexport default __webpack_public_path__ + \"static/media/train-app.131bb0ee.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgIconPdf(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"icon_PDF\",\n \"data-name\": \"icon PDF\",\n transform: \"translate(-963 -1256)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_1838\",\n \"data-name\": \"Rectangle 1838\",\n className: \"cls-1\",\n width: 24,\n height: 24,\n transform: \"translate(963 1256)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"noun_PDF_3606966\",\n transform: \"translate(959 1256.001)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_2348\",\n \"data-name\": \"Group 2348\",\n transform: \"translate(8 2)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4170\",\n \"data-name\": \"Path 4170\",\n d: \"M23.63,13.809V6.373L19.257,2H10.084A1.042,1.042,0,0,0,9.042,3.042V13.809A1.042,1.042,0,0,0,8,14.851v5.557a1.042,1.042,0,0,0,1.042,1.042V21.8a1.042,1.042,0,0,0,1.042,1.042h12.5A1.042,1.042,0,0,0,23.63,21.8v-.347a1.042,1.042,0,0,0,1.042-1.042V14.851A1.042,1.042,0,0,0,23.63,13.809ZM19.462,3.184l2.984,2.984H19.462ZM9.737,3.042a.347.347,0,0,1,.347-.347h8.683V6.863h4.168v6.947H9.737ZM22.935,21.8a.347.347,0,0,1-.347.347h-12.5a.347.347,0,0,1-.347-.347v-.347h13.2Zm1.042-1.389a.347.347,0,0,1-.347.347H9.042a.347.347,0,0,1-.347-.347V14.851a.347.347,0,0,1,.347-.347H23.63a.347.347,0,0,1,.347.347Z\",\n transform: \"translate(-8 -2)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4171\",\n \"data-name\": \"Path 4171\",\n d: \"M17.347,24.695h9.725a.347.347,0,0,0,0-.695H17.347a.347.347,0,0,0,0,.695Z\",\n transform: \"translate(-13.874 -16.359)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4172\",\n \"data-name\": \"Path 4172\",\n d: \"M27.073,30H17.347a.347.347,0,0,0,0,.695h9.725a.347.347,0,0,0,0-.695Z\",\n transform: \"translate(-13.874 -20.275)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4173\",\n \"data-name\": \"Path 4173\",\n d: \"M21.817,41.9a1.08,1.08,0,0,0-.42-.219,1.775,1.775,0,0,0-.518-.069H19.723a.347.347,0,0,0-.233.076.233.233,0,0,0-.09.184v3.557a.215.215,0,0,0,.135.2.716.716,0,0,0,.6,0,.215.215,0,0,0,.135-.2V44.218h.552a1.931,1.931,0,0,0,.542-.069,1.094,1.094,0,0,0,.438-.226,1.129,1.129,0,0,0,.292-.4,1.521,1.521,0,0,0,.1-.6v-.028a1.521,1.521,0,0,0-.1-.6A1.018,1.018,0,0,0,21.817,41.9Zm-.472,1.091a.587.587,0,0,1-.135.424.49.49,0,0,1-.368.135h-.57V42.37h.552a.49.49,0,0,1,.368.135.58.58,0,0,1,.153.424Z\",\n transform: \"translate(-15.44 -27.852)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4174\",\n \"data-name\": \"Path 4174\",\n d: \"M30.9,41.907a1.066,1.066,0,0,0-.434-.229,1.931,1.931,0,0,0-.542-.069h-.99a.455.455,0,0,0-.278.076.233.233,0,0,0-.1.184v3.564a.233.233,0,0,0,.1.184.455.455,0,0,0,.278.076h.99a2.084,2.084,0,0,0,.542-.069,1.08,1.08,0,0,0,.726-.636,1.535,1.535,0,0,0,.108-.615V42.929a1.528,1.528,0,0,0-.108-.611A1.042,1.042,0,0,0,30.9,41.907Zm-.455,2.466a.58.58,0,0,1-.135.424.5.5,0,0,1-.368.135h-.514V42.369h.5a.5.5,0,0,1,.368.135.58.58,0,0,1,.153.424Z\",\n transform: \"translate(-21.419 -27.851)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_4175\",\n \"data-name\": \"Path 4175\",\n d: \"M40.37,41.609H38.432a.514.514,0,0,0-.264.066.215.215,0,0,0-.118.2v3.55a.215.215,0,0,0,.135.2.716.716,0,0,0,.6,0,.215.215,0,0,0,.135-.2V43.985h.847a.215.215,0,0,0,.2-.111.438.438,0,0,0,.063-.219.431.431,0,0,0-.069-.24.215.215,0,0,0-.195-.1h-.847V42.37H40.37a.212.212,0,0,0,.195-.115.524.524,0,0,0,.069-.271.552.552,0,0,0-.063-.257A.208.208,0,0,0,40.37,41.609Z\",\n transform: \"translate(-27.612 -27.851)\"\n }))))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconPdf);\nexport default __webpack_public_path__ + \"static/media/icon-pdf.8e3b90c4.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { ReactComponent as CrewRosteringIcon } from \"assets/icons/date-range.svg\";\r\nimport { ReactComponent as RailAppIcon } from \"assets/icons/rail-app.svg\";\r\nimport { ReactComponent as TrainAppIcon } from \"assets/icons/train-app.svg\";\r\nimport { AppsH1 } from \"components/menu/Labels\";\r\nimport { openInANewBrowser } from 'helpers/HelperFunctions';\r\nimport appSettings from 'shared/settings/appSettings';\r\n\r\nexport interface IApplicationItem {\r\n name: string,\r\n icon?: any,\r\n image?: any,\r\n className: string,\r\n url: string\r\n}\r\n\r\nconst CrewRostering = {\r\n name: \"Crew Rostering\",\r\n icon: CrewRosteringIcon,\r\n className: \"app-crew-rostering\",\r\n url: \"https://crewrostering.bhp.com/login\"\r\n} as IApplicationItem;\r\n\r\nconst RailApp = {\r\n name: \"Rail App\",\r\n icon: RailAppIcon,\r\n className: \"app-bhp\",\r\n url: appSettings.installAppLink\r\n} as IApplicationItem;\r\n\r\nconst EHBCApp = {\r\n name: \"Electronic Handbrake Calculator\",\r\n icon: TrainAppIcon,\r\n className: \"app-bhp\",\r\n url: \"https://ehbc.bhp.com\"\r\n} as IApplicationItem;\r\n\r\nexport const ApplicationData = [CrewRostering, RailApp, EHBCApp] as IApplicationItem[];\r\n\r\nconst AppCard = (props: { item: IApplicationItem }) => {\r\n const Icon = props.item.icon;\r\n\r\n return (\r\n { openInANewBrowser(props.item.url) }}>\r\n \r\n {props.item.icon && !props.item.image &&\r\n \r\n }\r\n {props.item.image &&\r\n \"App\r\n }\r\n \r\n\r\n {props.item.name}\r\n \r\n );\r\n};\r\n\r\nexport const ApplicationsCard = () => {\r\n return (
\r\n \r\n\r\n
\r\n\r\n \r\n {ApplicationData.map((app, idx) =>\r\n <>\r\n {app.url &&\r\n
\r\n \r\n
\r\n }\r\n \r\n )}\r\n
\r\n
);\r\n};\r\n\r\nexport default ApplicationsCard;","import * as React from 'react';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { Card } from \"reactstrap\";\r\nimport { Link } from 'react-router-dom';\r\nimport { MyActionsH1, HistoryH1 } from \"components/menu/Labels\";\r\nimport ActionableDocuments from \"components/portal/ActionableDocuments\";\r\nimport ActionableFatigueAssessments from \"components/portal/ActionableFatigueAssessment\";\r\nimport './Home.css';\r\nimport { Grid } from '@material-ui/core';\r\nimport QuickLinksCard from 'components/ui/QuickLinks';\r\nimport NeedDirectionCard from 'components/ui/NeedDirection';\r\nimport ApplicationsCard from 'components/ui/Applications';\r\nimport { ReactNode } from 'react';\r\nimport { FavouritesFilter, RecentlyActionedFilter } from '../components/ui/DocumentRules';\r\n\r\ninterface IHistoryButtonProps {\r\n children: ReactNode,\r\n url: string,\r\n icon?: any\r\n}\r\n\r\nconst HistoryButton = (props: IHistoryButtonProps) => {\r\n const Icon = props.icon;\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n {Icon && }\r\n {props.children}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nconst DocHistory = () => (\r\n \r\n
\r\n
\r\n \r\n
\r\n Recently actioned documents\r\n Favourite documents\r\n
\r\n
\r\n);\r\n\r\nconst home = () => {\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\nexport default home;","import React, { useEffect } from 'react';\r\nimport { signinRedirectCallback } from 'shared/services/userService';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Spinner } from '../components/ui/Spinner';\r\n\r\nconst SigninOidc = () => {\r\n const history = useHistory();\r\n\r\n useEffect(() => {\r\n async function signinAsync() {\r\n console.log('SigninOidc');\r\n await signinRedirectCallback();\r\n\r\n const locationPath = sessionStorage.getItem(\"pre-login-route\");\r\n if (typeof (locationPath) === 'string') {\r\n history.push(locationPath);\r\n sessionStorage.removeItem(\"pre-login-route\");\r\n }\r\n else {\r\n history.push('/');\r\n }\r\n }\r\n\r\n signinAsync()\r\n }, [history]);\r\n\r\n return (\r\n
\r\n Signing in\r\n \r\n
\r\n );\r\n}\r\n\r\nexport default SigninOidc","import React from 'react'\r\nconst SignoutOidc = () => {\r\n\r\n return (\r\n
\r\n You have been signed out. Please close your browser\r\n
\r\n );\r\n}\r\n\r\nexport default SignoutOidc","import React, { useEffect } from 'react';\r\nimport { signinSilentCallback } from 'shared/services/userService';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Spinner } from '../components/ui/Spinner';\r\n\r\nconst SilentAuth = () => {\r\n const history = useHistory();\r\n\r\n useEffect(() => {\r\n async function silentAuthAsync() {\r\n await signinSilentCallback();\r\n }\r\n\r\n silentAuthAsync();\r\n }, [history]);\r\n\r\n return (\r\n
\r\n Signing in\r\n \r\n
\r\n );\r\n}\r\n\r\nexport default SilentAuth;","import React, { ReactNode } from 'react'\r\nimport { useState, useEffect } from 'react';\r\nimport useRoles from \"hooks/useRoles\"\r\nimport useSelector from 'hooks/useSelector';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\n\r\nimport './UserProfile.css';\r\n\r\nimport {\r\n Domain as RoleIcon,\r\n Person as ProfileIcon,\r\n AccountCircle as AccountIcon,\r\n Work as WorkIcon,\r\n} from '@material-ui/icons';\r\nimport { Grid } from '@material-ui/core';\r\nimport { profile } from 'console';\r\n\r\nconst RolesProfile = () => {\r\n const [showRoles, setShowRoles] = useState(false);\r\n\r\n const roleInfo = useRoles();\r\n\r\n useEffect(() => {\r\n\r\n const clearStorage = (e: KeyboardEvent) => {\r\n if (e.ctrlKey && e.altKey && e.key === 'u') {\r\n sessionStorage.clear();\r\n localStorage.clear();\r\n window.location.reload(false);\r\n }\r\n\r\n if (e.ctrlKey && e.altKey && e.key === 'g') {\r\n setShowRoles(!showRoles);\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', clearStorage);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', clearStorage);\r\n };\r\n\r\n }, [showRoles]);\r\n\r\n return (\r\n <>\r\n {showRoles &&\r\n <>\r\n
User Roles
\r\n
\r\n {roleInfo?.roles?.map((role, i) => {\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\ninterface IProfileColProps {\r\n title: string,\r\n value: ReactNode\r\n}\r\n\r\nconst ProfileCol = (props: IProfileColProps) => {\r\n return (\r\n \r\n
{props.title}:
\r\n
{props.value}
\r\n
\r\n );\r\n};\r\n\r\nconst ProfileDetails = () => {\r\n const profile = useSelector(state => state.profile);\r\n\r\n useEffect(() => {\r\n\r\n }, [profile]);\r\n\r\n return (\r\n <>\r\n {profile !== undefined &&\r\n <>\r\n
My profile details
\r\n\r\n \r\n\r\n
Profile information
\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
Workplace information
\r\n
\r\n\r\n \r\n \r\n \r\n {profile.supervisorFirstname} {profile.supervisorLastname}} />\r\n \r\n \r\n \r\n \r\n \r\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 UserProfile = () => {\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\nexport default UserProfile;\r\n","import { BehaviorSubject } from 'rxjs';\r\n\r\nimport { DocumentSearchQuery } from 'shared/models/api/models';\r\n\r\nexport interface SearchStateParams {\r\n from: string;\r\n}\r\n\r\nexport type DocumentSearchState = {\r\n query: DocumentSearchQuery,\r\n runQuery?: boolean,\r\n pushHistory?: boolean\r\n}\r\n\r\nconst emptyQuery: DocumentSearchQuery = {\r\n searchTerm: '',\r\n statusIds: [],\r\n typeIds: [],\r\n moduleIds: [],\r\n dateRange: undefined,\r\n fullMatchContentRequired: false\r\n}\r\nconst createInitialState = (): DocumentSearchState => ({ query: Object.assign({}, emptyQuery) })\r\n\r\nconst documentSearchStateSubject = new BehaviorSubject(createInitialState());\r\n\r\nexport const documentSearchState = {\r\n subscribe: (setState: any) => documentSearchStateSubject.subscribe(setState),\r\n setState: (fn: (state: DocumentSearchState) => void) => {\r\n var newState = Object.assign({}, documentSearchStateSubject.getValue());\r\n fn(newState);\r\n documentSearchStateSubject.next(newState);\r\n },\r\n reset: () => {\r\n documentSearchStateSubject.next(createInitialState());\r\n }\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport ReactDatePicker from 'react-datepicker';\r\nimport { Chip } from '@material-ui/core'\r\nimport useSelector from 'hooks/useSelector';\r\nimport { DocumentSearchQuery, DateRange, DocumentSearchReplaceSuggestion } from 'shared/models/api/models';\r\nimport { documentSearchReplaceSuggestions } from 'shared/services/railDocumentsApi';\r\nimport { documentModuleDisplay } from 'shared/enums/document-module-enum';\r\nimport { documentTypeDisplay } from 'shared/enums/document-type-enum';\r\nimport { DocumentStatusEnum } from 'shared/enums/document-status-enum';\r\nimport { documentSearchState } from './DocumentSearchState';\r\n\r\nimport { TodayOutlined, EventOutlined } from '@material-ui/icons';\r\n\r\nimport './DocumentSearch.css';\r\n\r\nimport {\r\n Input,\r\n Label,\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu\r\n} from 'reactstrap';\r\n\r\nimport {\r\n Search as SearchIcon,\r\n Tune as TuneIcon,\r\n Sync as SyncIcon,\r\n ExpandMore as ExpandIcon,\r\n} from '@material-ui/icons';\r\nimport { HighlightOff as ClearIcon } from '@material-ui/icons';\r\n\r\ninterface FilterItem {\r\n id: number;\r\n label: string;\r\n}\r\n\r\ninterface FilterDropdownParams {\r\n items: FilterItem[];\r\n checkedItems: number[];\r\n label: string;\r\n keyPrefix: string;\r\n toggleFunction(id: number): any;\r\n}\r\n\r\nexport const FilterDropdown = (props: FilterDropdownParams) => {\r\n\r\n //Prevent React warning when onChange function is abscent\r\n const doNothing = () => { };\r\n\r\n return (\r\n \r\n {props.label}\r\n \r\n {props.items.map((item) => (\r\n
props.toggleFunction(item.id)}>\r\n \r\n \r\n
\r\n ))}\r\n
\r\n
\r\n );\r\n}\r\n\r\n\r\ninterface IDateRangePickerProps {\r\n className?: string;\r\n fromDate?: Date;\r\n toDate?: Date;\r\n setter: (fromDate?: Date, toDate?: Date) => void;\r\n}\r\n\r\nconst DateRangePicker = (props: IDateRangePickerProps) => {\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\ninterface DateRangeDropdownParams {\r\n searchQuery: DocumentSearchQuery;\r\n setSearchQuery(query: DocumentSearchQuery): any;\r\n}\r\n\r\nexport const DateRangeDropdown = (props: DateRangeDropdownParams) => {\r\n const [fromDate, setFromDate] = useState(new Date());\r\n const [toDate, setToDate] = useState(new Date());\r\n\r\n const setDates = (startDate: Date, endDate: Date) => {\r\n if (startDate === undefined || endDate === undefined) {\r\n return;\r\n }\r\n const newQuery = { ...props.searchQuery, dateRange: { startDate: startDate, endDate: endDate } };\r\n props.setSearchQuery(newQuery);\r\n }\r\n\r\n const clearDates = () => {\r\n const newQuery = { ...props.searchQuery, dateRange: undefined };\r\n props.setSearchQuery(newQuery);\r\n }\r\n\r\n const setDateRange = (dateFrom: Date | undefined, dateTo: Date | undefined): void => {\r\n setFromDate(dateFrom ? dateFrom : new Date());\r\n setToDate(dateTo ? dateTo : new Date());\r\n };\r\n\r\n return (\r\n \r\n Published date\r\n \r\n
\r\n { setDateRange(dateFrom, dateTo) }}\r\n />\r\n
\r\n
setDates(fromDate, toDate)}>
\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\ninterface RefineSearchParams {\r\n query: DocumentSearchQuery;\r\n minSearchTermLength: number;\r\n}\r\n\r\nexport const RefineSearch = (props: RefineSearchParams) => {\r\n const [searchTerm, setSearchTerm] = useState(props.query.searchTerm);\r\n const [searchQuery, setSearchQuery] = useState({ searchTerm: props.query.searchTerm } as DocumentSearchQuery);\r\n const [searchHistory, setSearchHistory] = useState([] as string[]);\r\n const [searchHistoryLoaded, setSearchHistoryLoaded] = useState(false);\r\n const [runPostMount, setRunPostMount] = useState(false);\r\n\r\n const [allSuggestions, setAllSuggestions] = useState([] as DocumentSearchReplaceSuggestion[]);\r\n const [currentSuggestions, setCurrentSuggestions] = useState([] as DocumentSearchReplaceSuggestion[]);\r\n const mainSearchBarRef = React.createRef() as React.RefObject;\r\n \r\n const searchOnChange = (e: React.ChangeEvent) => {\r\n if (typeof e.target.value === 'string') {\r\n setSearchTerm(e.target.value);\r\n let query = searchQuery;\r\n query.searchTerm = e.target.value.trim();\r\n setSearchQuery(query);\r\n updateSuggestions(e.target.value);\r\n }\r\n }\r\n\r\n const updateSuggestions = (searchTerm: string) => {\r\n let formattedSearchTerm = ` ${searchTerm.toLowerCase()}`;\r\n let newSuggestions = allSuggestions.filter(rs => {\r\n let formattedExpression = ` ${rs.expression.toLowerCase()}`;\r\n return formattedSearchTerm.endsWith(formattedExpression);\r\n });\r\n setCurrentSuggestions(newSuggestions);\r\n }\r\n\r\n const selectSuggestion = (rs: DocumentSearchReplaceSuggestion) => {\r\n setCurrentSuggestions([]);\r\n let query = searchQuery;\r\n let replaceIndex = query.searchTerm.toLowerCase().lastIndexOf(rs.expression.toLowerCase());\r\n if (replaceIndex > -1) {\r\n query.searchTerm = `${query.searchTerm.substring(0, replaceIndex)}${rs.suggestion}`;\r\n }\r\n setSearchQuery(query);\r\n setSearchTerm(`${query.searchTerm} `);\r\n mainSearchBarRef.current?.focus();\r\n }\r\n\r\n const handleKeyDown = (event: any) => {\r\n if (event.key === 'Enter') {\r\n search();\r\n }\r\n }\r\n\r\n const search = () => {\r\n if (searchQuery.searchTerm.length < props.minSearchTermLength) {\r\n return;\r\n }\r\n addSearchHistory(searchQuery.searchTerm);\r\n documentSearchState.setState(q => {\r\n q.query = searchQuery;\r\n q.runQuery = true;\r\n q.pushHistory = true;\r\n });\r\n }\r\n\r\n const searchForTerm = (term: string) => {\r\n if (term.length < props.minSearchTermLength) {\r\n return;\r\n }\r\n const query = { ...searchQuery, searchTerm: term };\r\n setSearchQuery(query);\r\n setSearchTerm(query.searchTerm);\r\n addSearchHistory(query.searchTerm);\r\n documentSearchState.setState(q => {\r\n q.query = query;\r\n q.runQuery = true;\r\n q.pushHistory = true;\r\n });\r\n }\r\n\r\n const documentTypes = (useSelector(x => x.searchableRailDocumentTypes) || []);\r\n const documentModules = [...new Set(documentTypes.map(type => type.documentModule))]\r\n\r\n const documentFilterModules = documentModules.map((module) => {\r\n let item: FilterItem = { id: module, label: documentModuleDisplay(module) };\r\n return item;\r\n });\r\n\r\n const documentFilterTypes = documentTypes.map((type) => {\r\n let item: FilterItem = { id: type.typeId, label: documentTypeDisplay(type.typeId) };\r\n return item;\r\n });\r\n\r\n const getDocumentFilterStatus = (): FilterItem[] => {\r\n let items: FilterItem[] = [];\r\n Object.values(DocumentStatusEnum).map((status) => {\r\n const statusId = Number(status);\r\n if (!isNaN(statusId)) {\r\n if (statusId < DocumentStatusEnum.DeletedFull) {\r\n let item: FilterItem = { id: statusId, label: DocumentStatusEnum[statusId] };\r\n items.push(item);\r\n }\r\n }\r\n });\r\n return items;\r\n };\r\n\r\n const documentFilterStatus = getDocumentFilterStatus();\r\n\r\n function removeItem(arr: Array, value: T): Array {\r\n const index = arr.indexOf(value);\r\n if (index > -1) {\r\n arr.splice(index, 1);\r\n }\r\n return arr;\r\n }\r\n\r\n const toggleModule = (id: number) => {\r\n let moduleIds = searchQuery.moduleIds;\r\n if (moduleIds === undefined) {\r\n moduleIds = [];\r\n }\r\n if (moduleIds.includes(id)) {\r\n removeItem(moduleIds, id);\r\n }\r\n else {\r\n moduleIds.push(id);\r\n }\r\n setSearchQuery({ ...searchQuery, moduleIds: moduleIds });\r\n }\r\n\r\n const toggleType = (id: number) => {\r\n let typeIds = searchQuery.typeIds;\r\n if (typeIds === undefined) {\r\n typeIds = [];\r\n }\r\n if (typeIds.includes(id)) {\r\n removeItem(typeIds, id);\r\n }\r\n else {\r\n typeIds.push(id);\r\n }\r\n setSearchQuery({ ...searchQuery, typeIds: typeIds });\r\n }\r\n\r\n const toggleStatus = (id: number) => {\r\n let statusIds = searchQuery.statusIds;\r\n if (statusIds === undefined) {\r\n statusIds = [];\r\n }\r\n if (statusIds.includes(id)) {\r\n removeItem(statusIds, id);\r\n }\r\n else {\r\n statusIds.push(id);\r\n }\r\n setSearchQuery({ ...searchQuery, statusIds: statusIds });\r\n }\r\n\r\n const clearSearchQuery = () => {\r\n setSearchTerm(\"\");\r\n setSearchQuery({} as DocumentSearchQuery);\r\n }\r\n\r\n const clearDates = () => {\r\n setSearchQuery({ ...searchQuery, dateRange: undefined });\r\n }\r\n\r\n const displayDateRange = (dateRange: DateRange) => {\r\n return `${dateRange.startDate.toLocaleDateString()} - ${dateRange.endDate.toLocaleDateString()}`;\r\n }\r\n\r\n const addSearchHistory = (searchTerm: string) => {\r\n if (searchTerm.length < 1 || (searchHistory.length > 0 && searchTerm === searchHistory[0])) {\r\n return;\r\n }\r\n\r\n const history = searchHistory;\r\n\r\n const index = history.indexOf(searchTerm);\r\n if (index > -1) {\r\n history.splice(index, 1);\r\n }\r\n\r\n history.unshift(searchTerm);\r\n if (history.length > 8) {\r\n history.pop();\r\n }\r\n const historyJson = JSON.stringify(history);\r\n localStorage.setItem('searchHistory', historyJson);\r\n }\r\n\r\n const loadHistory = () => {\r\n const historyJson = localStorage.getItem('searchHistory');\r\n if (typeof (historyJson) === 'string') {\r\n const history: string[] = JSON.parse(historyJson);\r\n setSearchHistory(history);\r\n }\r\n else {\r\n const history: string[] = [];\r\n setSearchHistory(history);\r\n const historyJson = JSON.stringify(history);\r\n localStorage.setItem('searchHistory', historyJson);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (runPostMount) {\r\n addSearchHistory(props.query.searchTerm);\r\n setRunPostMount(false);\r\n }\r\n\r\n if (!searchHistoryLoaded) {\r\n loadHistory();\r\n setSearchHistoryLoaded(true);\r\n setRunPostMount(true);\r\n }\r\n\r\n }, [runPostMount]);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const results = await documentSearchReplaceSuggestions();\r\n\r\n if (mounted) {\r\n setAllSuggestions(results);\r\n }\r\n };\r\n\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n
\r\n
Review or refine your search:
\r\n\r\n
\r\n
\r\n \r\n
\r\n
Search
\r\n
\r\n \r\n
\r\n {currentSuggestions.length > 0 &&\r\n
\r\n {currentSuggestions.map((rs, i) => (\r\n
selectSuggestion(rs)}>\r\n \r\n
\r\n ))}\r\n
\r\n }\r\n
\r\n
\r\n\r\n
\r\n
\r\n {searchQuery.moduleIds?.map((moduleId) => (\r\n toggleModule(moduleId)} />\r\n ))}\r\n {searchQuery.typeIds?.map((typeId) => (\r\n toggleType(typeId)} />\r\n ))}\r\n {searchQuery.statusIds?.map((statusId) => (\r\n toggleStatus(statusId)} />\r\n ))}\r\n {searchQuery.dateRange !== undefined &&\r\n \r\n }\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
Filter 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
\r\n\r\n {searchHistory.length > 1 &&\r\n
\r\n
Recent searches:
\r\n {searchHistory.map((searchTerm, i) => (\r\n \r\n {i > 0 &&\r\n
searchForTerm(searchTerm)} className=\"recent-search\">\r\n
Keyword:
\r\n
\"{searchTerm}\"
\r\n
\r\n }\r\n
\r\n ))}\r\n
\r\n }\r\n\r\n
\r\n );\r\n}\r\n","var _defs, _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgIconWorkOnTrack(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .cls-1 {\\r\\n fill: none;\\r\\n }\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"icon_Work_on_Track\",\n \"data-name\": \"icon Work on Track\",\n transform: \"translate(-85 -1494)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_1835\",\n \"data-name\": \"Rectangle 1835\",\n className: \"cls-1\",\n width: 24,\n height: 24,\n transform: \"translate(85 1494)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"noun_Train_99121_1_\",\n \"data-name\": \"noun_Train_99121 (1)\",\n transform: \"translate(69 1491)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_2336\",\n \"data-name\": \"Path 2336\",\n d: \"M34.492,25.668l-.742-1.585H34.4l-.455-.987h-.67l-.622-1.332h.765l-.455-.987h-.789L31.645,19.7l2.536-1.562v-7.51l-.909-1.4.048-2.274S33.415,5,27.961,5,22.6,6.952,22.6,6.952l.048,2.274-.909,1.4v7.487l2.416,1.493-.55,1.171H22.555l-.455.987h1.029L22.507,23.1H21.455L21,24.084h1.029l-.742,1.585h1.148l.742-1.562h9.449l.742,1.585h1.124Zm-1.866-8.451a.694.694,0,1,1-.694-.666A.653.653,0,0,1,32.626,17.217ZM28.775,6.148s2.344.253,3.158,1.033V9.2l-3.158-.712Zm-.813,3.9a.919.919,0,1,1-.957.919A.941.941,0,0,1,27.961,10.052ZM23.823,7.2c.813-.781,3.158-1.033,3.158-1.033V8.537l-3.158.712Zm0,10.013a.694.694,0,1,1,.694.666A.681.681,0,0,1,23.823,17.217ZM25.115,20h5.55l.383.781H24.732Zm1.053,3.1H23.631l.622-1.332h7.224L32.1,23.1Z\",\n transform: \"translate(0)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconWorkOnTrack);\nexport default __webpack_public_path__ + \"static/media/icon-work-on-track.2cd20f64.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgSettings(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.14 12.94a7.074 7.074 0 0 0 .06-.94 5.777 5.777 0 0 0-.07-.94l2.03-1.58a.491.491 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96a7.064 7.064 0 0 0-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84a.474.474 0 0 0-.47.41l-.36 2.54a7.22 7.22 0 0 0-1.62.94l-2.39-.96a.477.477 0 0 0-.59.22L2.74 8.87a.455.455 0 0 0 .12.61l2.03 1.58a5.563 5.563 0 0 0-.02 1.88l-2.03 1.58a.491.491 0 0 0-.12.61l1.92 3.32a.488.488 0 0 0 .59.22l2.39-.96a7.064 7.064 0 0 0 1.62.94l.36 2.54a.492.492 0 0 0 .48.41h3.84a.466.466 0 0 0 .47-.41l.36-2.54a6.859 6.859 0 0 0 1.62-.94l2.39.96a.477.477 0 0 0 .59-.22l1.92-3.32a.463.463 0 0 0-.12-.61zM12 15.6a3.6 3.6 0 1 1 3.6-3.6 3.611 3.611 0 0 1-3.6 3.6z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgSettings);\nexport default __webpack_public_path__ + \"static/media/settings.6f6cf22b.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useEffect, useState } from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { Link } from 'react-router-dom';\r\nimport { documentSearch } from 'shared/services/railDocumentsApi';\r\nimport { DocumentSearchQuery, DocumentSearchResult } from 'shared/models/api/models';\r\nimport { documentSearchState, DocumentSearchState, SearchStateParams } from './DocumentSearchState';\r\n\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { documentTypeDisplay } from 'shared/enums/document-type-enum';\r\nimport { documentModuleDisplay, DocumentModuleEnum } from 'shared/enums/document-module-enum';\r\nimport { encodeTerm, decodeTerm } from 'components/portal/Search';\r\nimport { RefineSearch } from './RefineSearch';\r\n\r\nimport './DocumentSearch.css';\r\n\r\nimport {\r\n AnnouncementOutlined as AcknowledgeIcon,\r\n Star as FavouriteIcon,\r\n StarOutline as NotFavouriteIcon,\r\n InsertDriveFile as DocumentsIcon,\r\n HighlightOff as CloseIcon,\r\n ChevronRight as RightIcon,\r\n List as ListIcon,\r\n} from '@material-ui/icons';\r\nimport { ReactComponent as RbNetworkRulesIcon } from \"assets/icons/rb-network-rules.svg\";\r\n\r\nimport { ReactComponent as StatusCurrentIcon } from \"assets/icons/status-current.svg\";\r\nimport { ReactComponent as StatusExpiredIcon } from \"assets/icons/status-expired.svg\";\r\nimport { ReactComponent as StatusRescindedIcon } from \"assets/icons/action-fields-outlined.svg\";\r\nimport { ReactComponent as StatusDeletedIcon } from \"assets/icons/status-deleted.svg\";\r\nimport { ReactComponent as StatusArchivedIcon } from \"assets/icons/status-expired-folder.svg\";\r\n\r\nimport { ReactComponent as RulebookIcon } from \"assets/icons/rb-rulebook-filled.svg\";\r\nimport { ReactComponent as MarkChatReadIcon } from \"assets/icons/mark-chat-read.svg\";\r\nimport { ReactComponent as PdfIcon } from \"assets/icons/icon-pdf.svg\";\r\nimport { ReactComponent as WorkOnTrackIcon } from \"assets/icons/icon-work-on-track.svg\";\r\nimport { DocumentStatusEnum } from 'shared/enums/document-status-enum';\r\n\r\n\r\ninterface StatusIconProps {\r\n status: DocumentStatusEnum\r\n}\r\n\r\nconst StatusIcon = (props: StatusIconProps) => {\r\n\r\n if (props.status == DocumentStatusEnum.Current) {\r\n return ();\r\n }\r\n\r\n if (props.status == DocumentStatusEnum.Archived) {\r\n return ();\r\n }\r\n\r\n if (props.status == DocumentStatusEnum.Expired) {\r\n return ();\r\n }\r\n\r\n if (props.status == DocumentStatusEnum.Rescinded) {\r\n return ();\r\n }\r\n\r\n if (props.status == DocumentStatusEnum.Deleted) {\r\n return ();\r\n }\r\n\r\n return (<>{DocumentStatusEnum[props.status]});\r\n}\r\n\r\n\r\ninterface ResultProps {\r\n result: DocumentSearchResult;\r\n hideType?: boolean;\r\n}\r\n\r\nconst DocumentCard = (props: ResultProps) => {\r\n const [result] = useState(props.result);\r\n const [searchTerm, setSearchTerm] = useState('');\r\n\r\n const dateTimeFormat = new Intl.DateTimeFormat(\"en-AU\", {});\r\n\r\n const documentLink = `/pdf/view/${result.documentId}/page/${result.pageNumber}/search/${searchTerm}`;\r\n\r\n const escapeHtml = (text: string): string => {\r\n return text\r\n .replace(/&/g, \"&\")\r\n .replace(//g, \">\")\r\n .replace(/\"/g, \""\")\r\n .replace(/'/g, \"'\");\r\n }\r\n\r\n const escapeRegExp = (term: string) => {\r\n return term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\r\n }\r\n\r\n const formatMatchText = (input: string, searchTerm: string): string => {\r\n if (input.length < 1) {\r\n return '';\r\n }\r\n\r\n let output = escapeHtml(input);\r\n const escapeSearch = escapeHtml(searchTerm);\r\n\r\n //Truncate multiple whitespaces down to a single space\r\n output = output.replace(/\\s+/g, ' ');\r\n searchTerm = searchTerm.replace(/\\s+/g, ' ');\r\n\r\n const matchWidth = 200; //How many characters to include both leading and following the first match\r\n\r\n if (searchTerm.length < 1) {\r\n return output.substring(0, matchWidth * 2);\r\n }\r\n\r\n let matchIsAtStart = false;\r\n let matchIsAtEnd = false;\r\n\r\n //Find where to start trimming\r\n let firstMatchPos = output.toLowerCase().indexOf(searchTerm.toLowerCase());\r\n let trimStartPosition = firstMatchPos - matchWidth;\r\n if (trimStartPosition < 0) {\r\n matchIsAtStart = true;\r\n trimStartPosition = 0;\r\n }\r\n\r\n //Find where to trimming until\r\n let trimLastPosition = trimStartPosition + matchWidth * 2;\r\n if (trimLastPosition > output.length) {\r\n matchIsAtEnd = true;\r\n trimLastPosition = output.length - 1;\r\n }\r\n\r\n //Trim output to matchWidth around the first matching term\r\n output = output.substring(trimStartPosition, trimLastPosition);\r\n\r\n //Remove partial trailing word\r\n let whitespaceMatches = [...output.matchAll(/\\s/g)];\r\n var lastWhitespacePosition = whitespaceMatches[whitespaceMatches.length - 1].index;\r\n if (!matchIsAtEnd && typeof lastWhitespacePosition === 'number') {\r\n output = `${output.substring(0, lastWhitespacePosition)}…`;\r\n }\r\n\r\n //Remove partial leading word\r\n var firstWhitespacePosition = whitespaceMatches[0].index;\r\n if (!matchIsAtStart && typeof firstWhitespacePosition === 'number') {\r\n output = `…${output.substring(firstWhitespacePosition, output.length - 1)}`;\r\n }\r\n\r\n //Strip out match start and end characters\r\n const matchStart = String.fromCharCode(17);\r\n const matchEnd = String.fromCharCode(19);\r\n output = output.replaceAll(matchStart, '').replace(matchEnd, '');\r\n\r\n //Mark any instances of the search term matched\r\n let terms = escapeSearch.split(' ');\r\n terms.forEach(function (term) {\r\n term = escapeRegExp(term);\r\n let r = new RegExp('(\\s?[a-zA-Z]*' + term + '[a-zA-Z]*\\s?)', \"ig\");\r\n output = output.replaceAll(r, `${matchStart}$1${matchEnd}`);\r\n });\r\n\r\n //Inject the html after all search terms have been matched to prevent the html itself being matched\r\n output = output.replaceAll(matchStart, '');\r\n\r\n return output;\r\n }\r\n\r\n useEffect(() => {\r\n const sub = documentSearchState.subscribe((s: DocumentSearchState) => {\r\n setSearchTerm(s.query.searchTerm);\r\n });\r\n return () => { sub.unsubscribe(); };\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n
\r\n
{result.documentTitle}
\r\n
{result.documentNumber}
\r\n {props.hideType !== true &&\r\n
{documentTypeDisplay(result.typeId)}
\r\n }\r\n
{dateTimeFormat.format(new Date(result.publishedDate))}
\r\n
\r\n
{result.totalResults}
\r\n
\r\n\r\n
\r\n {result.requiresAcknowledgement === true ?\r\n
\r\n :\r\n
\r\n }\r\n {result.favourite === 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\ninterface GroupResultTitleParams {\r\n moduleId: number;\r\n typeId?: number;\r\n}\r\n\r\nexport const GroupResultTitle = (props: GroupResultTitleParams) => {\r\n\r\n return (\r\n <>\r\n
\r\n {props.moduleId == DocumentModuleEnum.Rulebook ?\r\n \r\n :\r\n \r\n }\r\n
\r\n
{documentModuleDisplay(props.moduleId)}
\r\n\r\n {props.typeId &&\r\n <>\r\n
\r\n
\r\n
{documentTypeDisplay(props.typeId)}
\r\n \r\n }\r\n \r\n );\r\n}\r\n\r\ninterface GroupResultsParams {\r\n results: DocumentSearchResult[];\r\n groupName: string;\r\n children: React.ReactNode;\r\n hideType?: boolean;\r\n}\r\n\r\nexport const GroupResults = (props: GroupResultsParams) => {\r\n const defaultResults = 3;\r\n const [maxResults, setMaxResults] = useState(defaultResults);\r\n\r\n const displayAllResults = () => {\r\n setMaxResults(props.results.length);\r\n }\r\n\r\n const displayDefaultResults = () => {\r\n setMaxResults(Math.min(defaultResults, props.results.length));\r\n }\r\n\r\n useEffect(() => {\r\n displayDefaultResults();\r\n }, [props]);\r\n\r\n return (\r\n <>\r\n {props.results.length > 0 &&\r\n
\r\n\r\n
\r\n
{props.children}
\r\n {maxResults < props.results.length &&\r\n
See all +
\r\n }\r\n {maxResults > defaultResults &&\r\n
See all -
\r\n }\r\n
{maxResults} of {props.results.length} documents
\r\n
\r\n\r\n
\r\n
\r\n {props.results.map((result, i) => (\r\n \r\n {i < maxResults &&\r\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 MatchParams {\r\n searchTerm: string;\r\n}\r\n\r\nexport const DocumentSearch = (props: RouteComponentProps) => {\r\n const [results, setResults] = useState([] as DocumentSearchResult[]);\r\n const [rulebookResults, setRulebookResults] = useState([] as DocumentSearchResult[]);\r\n const [documentResults, setDocumentResults] = useState([] as DocumentSearchResult[]);\r\n const [typeResults, setTypeResults] = useState([] as DocumentSearchResult[][]);\r\n\r\n const [searchQuery, setSearchQuery] = useState({ searchTerm: decodeTerm(props.match.params.searchTerm) } as DocumentSearchQuery);\r\n const [isSearching, setIsSearching] = useState(true);\r\n const [isPreSearch, setIsPreSearch] = useState(true);\r\n const [mounted, setMounted] = useState(false);\r\n const [stateParams] = useState(props.location.state as SearchStateParams);\r\n\r\n const minSearchTermLength = 2;\r\n\r\n const history = useHistory();\r\n\r\n const navigatePrevious = () => {\r\n if (stateParams != undefined && typeof (stateParams.from) === 'string') {\r\n history.push(stateParams.from);\r\n }\r\n else {\r\n history.push(\"/\");\r\n }\r\n }\r\n\r\n const triggerSearch = () => {\r\n setIsPreSearch(false);\r\n documentSearchState.setState(q => {\r\n q.query = searchQuery;\r\n q.runQuery = true;\r\n });\r\n }\r\n\r\n const search = (query: DocumentSearchQuery) => {\r\n if (query.searchTerm === undefined || query.searchTerm.length < minSearchTermLength) {\r\n setIsSearching(false);\r\n return;\r\n }\r\n\r\n setResults([]);\r\n setIsSearching(true);\r\n\r\n documentSearch(query)\r\n .then(results => {\r\n searchResults(results);\r\n });\r\n }\r\n\r\n const searchResults = (results: DocumentSearchResult[]) => {\r\n setIsSearching(false);\r\n setRulebookResults(results.filter((doc: DocumentSearchResult) => doc.moduleId === 1));\r\n setDocumentResults(results.filter((doc: DocumentSearchResult) => doc.moduleId !== 1));\r\n splitTypeResults(results);\r\n setResults(results);\r\n }\r\n\r\n const splitTypeResults = (results: DocumentSearchResult[]) => {\r\n let types = [] as DocumentSearchResult[][];\r\n results.forEach((result) => {\r\n if (types[result.typeId] === undefined) {\r\n types[result.typeId] = [] as DocumentSearchResult[];\r\n }\r\n types[result.typeId].push(result);\r\n });\r\n setTypeResults(types);\r\n }\r\n\r\n const queryModuleCount = (): number => {\r\n let count = 0;\r\n if (searchQuery.moduleIds !== undefined) {\r\n count = searchQuery.moduleIds.length;\r\n }\r\n return count;\r\n }\r\n\r\n const queryTypeCount = (): number => {\r\n let count = 0;\r\n if (searchQuery.typeIds !== undefined) {\r\n count = searchQuery.typeIds.length;\r\n }\r\n return count;\r\n }\r\n\r\n useEffect(() => {\r\n const mount = async () => {\r\n if (mounted === true) {\r\n return;\r\n }\r\n setMounted(true);\r\n\r\n if (searchQuery.searchTerm.length > minSearchTermLength - 1) {\r\n triggerSearch();\r\n }\r\n else {\r\n setSearchQuery({ ...searchQuery, searchTerm: '' });\r\n }\r\n }\r\n\r\n mount();\r\n\r\n const sub = documentSearchState.subscribe((s: DocumentSearchState) => {\r\n setSearchQuery(s.query);\r\n\r\n if (s.pushHistory === true) {\r\n const searchState: SearchStateParams = { from: stateParams?.from };\r\n history.push(`/search/${encodeTerm(s.query.searchTerm)}`, searchState);\r\n }\r\n\r\n if (s.runQuery === true) {\r\n setIsPreSearch(false);\r\n search(s.query);\r\n }\r\n\r\n if (s.pushHistory === true || s.runQuery === true) {\r\n documentSearchState.setState(q => {\r\n q.pushHistory = false;\r\n q.runQuery = false;\r\n });\r\n }\r\n\r\n });\r\n\r\n return () => {\r\n sub.unsubscribe();\r\n };\r\n }, [results]);\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
Search results
\r\n
\r\n\r\n \r\n\r\n {!isPreSearch &&\r\n <>\r\n {isSearching ?\r\n
Searching...
\r\n :\r\n <>\r\n
{results.length} total documents found
\r\n {(queryModuleCount() > 0 || queryTypeCount() > 0) ?\r\n <>\r\n {typeResults.map((type, i) => (\r\n \r\n \r\n \r\n ))}\r\n \r\n :\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n\r\n \r\n\r\n }\r\n \r\n }\r\n\r\n
\r\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 DocumentSearch;\r\n","import React from 'react';\r\n\r\nconst debug = () => {\r\n return (\r\n
\r\n );\r\n}\r\n\r\nexport default debug;\r\n","import { httpGet, httpPost, httpPut } from './httpService';\r\nimport appSettings from '../settings/appSettings';\r\nimport { IRole, IUserSearchResult } from 'shared/models/api/models';\r\n\r\nconst basePath = '/api/admin/';\r\n\r\nconst fullyQualifiedAndEncodedURL = (relativeUri: string) => {\r\n return new URL(basePath + encodeURI(relativeUri), appSettings.api.portalApi).toString();\r\n};\r\n\r\nconst allowedDomainRoot = fullyQualifiedAndEncodedURL(\"allowed-domain-list\");\r\n\r\nexport interface AllowedDomainListItem {\r\n id: number,\r\n contractPartner: string,\r\n isEnabled?: boolean | null\r\n}\r\n\r\nexport interface AllowedDomain extends AllowedDomainListItem {\r\n sector: string,\r\n companyWebsite: string,\r\n emailDomain: string,\r\n contractManager: IUserSearchResult | null\r\n}\r\n\r\nexport const emailDomainAvailable = async (emailDomain: string): Promise => {\r\n return await httpGet(`${allowedDomainRoot}/emailDomainAvailable/${emailDomain}`);\r\n}\r\n\r\nexport const allowedDomainApi = {\r\n listAsync: async () =>\r\n await httpGet(`${allowedDomainRoot}/list`),\r\n getAsync: async (allowedDomainId: number) =>\r\n await httpGet(`${allowedDomainRoot}/get/${allowedDomainId}`),\r\n addAsync: async (allowedDomain: AllowedDomain) =>\r\n await httpPut(`${allowedDomainRoot}/add`, allowedDomain),\r\n updateAsync: async (allowedDomain: AllowedDomain) =>\r\n await httpPost(`${allowedDomainRoot}/update`, allowedDomain),\r\n setIsEnabled: async (allowedDomainIds: number[], isEnabled: boolean) =>\r\n await httpPost(`${allowedDomainRoot}/setIsEnabled/${isEnabled}`, allowedDomainIds)\r\n};","import React, { ReactNode, useEffect, useState } from 'react';\r\nimport './allowed-domain-list.css';\r\nimport { IActionProps, Toolbar } from '../../ui/Toolbar';\r\nimport { DataGrid } from '../../ui/DataGrid';\r\nimport { AllowedDomain, allowedDomainApi, AllowedDomainListItem } from '../../../shared/services/adminApi';\r\nimport { BarChartOutlined, Info } from '@material-ui/icons';\r\nimport { IConfirmProps } from '../../ui/ConfirmationBox';\r\nimport { DetailFormWrapper, DetailsForm } from '../../ui/DetailForm';\r\nimport { IApplicationModule } from '../../ui/IApplicationModule';\r\nimport { AddNewButtonText, EnableOrDisableButtonText, ViewOrEditButtonText } from './general-administration-data';\r\nimport { IModalBoxProps } from '../../ui/ModalBox';\r\nimport { IUserSearchResult } from '../../../shared/models/api/models';\r\n\r\ninterface IAllowedDomainListProps {\r\n module: IApplicationModule,\r\n loadingState: string,\r\n setLoadingState: (newState: string) => void,\r\n setConfirmProps: (confirmProps: IConfirmProps | null) => void,\r\n setModalProps: (modalProps: IModalBoxProps | null) => void\r\n}\r\n\r\nexport const AllowedDomainList = (props: IAllowedDomainListProps) => {\r\n const [domains, setDomains] = useState([] as AllowedDomainListItem[]);\r\n const [selectedDomains, setSelectedDomains] = useState([] as AllowedDomainListItem[]);\r\n\r\n const getAllowedDomains = async () => {\r\n await allowedDomainApi.listAsync()\r\n .then(result => {\r\n if (result) {\r\n setDomains(result);\r\n }\r\n });\r\n };\r\n\r\n const onGridRowClick = (row: AllowedDomain) => {\r\n var arr = selectedDomains.filter(r => r.id !== row.id);\r\n\r\n if (arr.length === selectedDomains.length) {\r\n arr.push(row);\r\n }\r\n\r\n setSelectedDomains(arr);\r\n };\r\n\r\n const canClose = () => {\r\n return true;\r\n }\r\n\r\n const ask = (\r\n msg: string,\r\n opts: string[],\r\n def: string,\r\n defFn: () => void,\r\n otherFn?: (result: string) => void\r\n ) => {\r\n props.setConfirmProps({\r\n message: msg,\r\n options: opts,\r\n defaultOption: def,\r\n setResult: result => {\r\n // close the confirm box\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps(null);\r\n }\r\n\r\n if (result === def) {\r\n if (defFn) defFn();\r\n } else {\r\n if (otherFn) otherFn(result);\r\n }\r\n }\r\n });\r\n };\r\n\r\n const createBlankDomain = () => {\r\n return {\r\n contractPartner: \"\",\r\n sector: \"\",\r\n companyWebsite: \"\",\r\n emailDomain: \"\"\r\n } as AllowedDomain;\r\n };\r\n\r\n const onDataChanged = (domain: AllowedDomain, msg: string | undefined) => {\r\n const idx = domains.findIndex(d => d.id === domain.id);\r\n\r\n if (idx > -1) {\r\n // take a copy of the array\r\n var arr = domains.map(u => u);\r\n\r\n // replace the row with the updated domain\r\n arr[idx] = domain;\r\n\r\n // set the new array back to the all domains\r\n setDomains(arr);\r\n } else {\r\n // just get all users again\r\n getAllowedDomains();\r\n }\r\n\r\n props.setModalProps(null);\r\n msgBox(msg ?? \"Your request has been successfully completed.\");\r\n };\r\n\r\n const addNew = (icon: any) => {\r\n props.setModalProps({\r\n className: \"allowed-domain-modal\",\r\n body:\r\n \r\n create={createBlankDomain}\r\n save={allowedDomainApi.addAsync}\r\n viewName=\"new\"\r\n onDataChanged={onDataChanged}\r\n module={props.module}\r\n setConfirmationProps={props.setConfirmProps}\r\n closeDialog={() => props.setModalProps(null)}\r\n />,\r\n setResult: result => {\r\n switch (result) {\r\n case \"Close\":\r\n case \"CloseModal\":\r\n case \"ClickOutsideModal\":\r\n props.setModalProps(null);\r\n break;\r\n }\r\n }\r\n });\r\n };\r\n\r\n const viewOrEdit = (row: AllowedDomainListItem) => {\r\n if (row) {\r\n props.setModalProps({\r\n className: \"allowed-domain-modal\",\r\n body:\r\n \r\n load={() => allowedDomainApi.getAsync(row.id)}\r\n save={allowedDomainApi.updateAsync}\r\n viewName=\"view\"\r\n onDataChanged={onDataChanged}\r\n module={props.module}\r\n setConfirmationProps={props.setConfirmProps}\r\n closeDialog={() => props.setModalProps(null)}\r\n />\r\n });\r\n }\r\n };\r\n\r\n const msgBox = (msg: ReactNode) => {\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps({\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultOption: \"OK\",\r\n setResult: result => {\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps(null);\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n const confirmEnableOrDisable = (allowedDomains: AllowedDomainListItem[]) => {\r\n const theseDomains = allowedDomains.length === 1 ? \"this domain\" : \"these domains\";\r\n const are = allowedDomains.length === 1 ? \"is\" : \"are\";\r\n const allUsers = allowedDomains.length === 1 ? \"All users\" : \"Users\"\r\n\r\n const DISABLED = false;\r\n\r\n // assume the state from the first selected item\r\n const currentState = allowedDomains[0].isEnabled;\r\n const newState = !currentState;\r\n\r\n const enableSlashDisable = newState === DISABLED ? \"disable\" : \"enable\";\r\n const proceedButtonText = newState === DISABLED ? \"Disable\" : \"Enable\";\r\n const enabledSlashDisabled = enableSlashDisable + \"d\";\r\n const activeSlashInactivePhrase = newState === DISABLED ? \"made inactive and lose their access to\" : \"able to access\";\r\n\r\n // check if there is a mixture of IsEnabled values in the selected values\r\n if (allowedDomains.filter(d => d.isEnabled === newState).length > 0) {\r\n msgBox(\"Some of \" + { theseDomains } + \" are already \" + enabledSlashDisabled + \".\");\r\n return;\r\n }\r\n\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps({\r\n message:
Are you sure you want to {enableSlashDisable} {theseDomains}? {allUsers} associated with {theseDomains} will be {activeSlashInactivePhrase} the BHP Rail App.
,\r\n options: [\"Cancel\", proceedButtonText],\r\n defaultOption: proceedButtonText,\r\n setResult: result => {\r\n if (result === \"Cancel\") {\r\n props.setConfirmProps(null);\r\n return;\r\n }\r\n\r\n if (result === proceedButtonText) {\r\n allowedDomainApi.setIsEnabled(allowedDomains.map(allowedDomain => allowedDomain.id), newState)\r\n .then(result => {\r\n if (!!result) {\r\n //https://app.zeplin.io/project/5ffea29702627814f1355337/screen/6114f6c4c47ff193f8eb3000\r\n //msgBox(
Success, {theseDomains} {are} now {enabledSlashDisabled}.
);\r\n msgBox(\"Your request has been successfully completed.\");\r\n // update the rows locally so we dont have to fetch them from the server\r\n allowedDomains.forEach(allowedDomain => { allowedDomain.isEnabled = newState; });\r\n }\r\n })\r\n .catch(e => {\r\n console.log(e);\r\n msgBox(
There was an error processing your request.
);\r\n });\r\n\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n const onGridRowDoubleClick = (row: AllowedDomainListItem) => {\r\n viewOrEdit(row);\r\n };\r\n\r\n const checkMinMax = (action: IActionProps) => {\r\n if (selectedDomains.length === 0 && (action.minSelectedCount ?? 0) > 0) {\r\n msgBox(\"Please select one item to continue.\");\r\n return false;\r\n }\r\n\r\n if (!!action.maxSelectedCount) {\r\n if (selectedDomains.length > action.maxSelectedCount) {\r\n if (action.maxSelectedCount === 1) {\r\n msgBox(\"Please select only one item to continue.\");\r\n } else {\r\n msgBox(\"Please select \" + action.maxSelectedCount + \" or fewer items to continue.\");\r\n }\r\n\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n\r\n const actionClicked = (action: IActionProps) => {\r\n if (checkMinMax(action)) {\r\n switch (action.name) {\r\n case AddNewButtonText:\r\n return addNew(action.icon);\r\n case ViewOrEditButtonText:\r\n return viewOrEdit(selectedDomains[0]);\r\n case EnableOrDisableButtonText:\r\n return confirmEnableOrDisable(selectedDomains);\r\n default:\r\n console.warn(\"Unhandled action: \" + action.name);\r\n }\r\n }\r\n };\r\n\r\n var loading = false;\r\n\r\n useEffect(() => {\r\n if (!loading) {\r\n loading = true;\r\n\r\n getAllowedDomains();\r\n }\r\n }, []);\r\n\r\n const compareInts = (a: number, b: number) => {\r\n if (a < b) return -1;\r\n if (a > b) return 1;\r\n return 0;\r\n };\r\n\r\n return (\r\n
\r\n \r\n\r\n c.showInGrid)\r\n .sort((a, b,) => compareInts(a.showInGrid ?? 0, b.showInGrid ?? 0))\r\n ?? []\r\n }\r\n onDoubleClick={onGridRowDoubleClick} />\r\n
\r\n );\r\n};\r\n\r\nexport default AllowedDomainList;","import React from 'react';\r\nimport { IRole } from 'shared/models/api/models';\r\n\r\nexport interface ITabProps {\r\n title: string,\r\n url: string,\r\n component?: any\r\n}\r\n\r\ninterface ITabButtonsProps {\r\n tabs: ITabProps[],\r\n selected: ITabProps | null,\r\n onSelected?: (tab: ITabProps) => void,\r\n userRoles: IRole[]\r\n}\r\n\r\nexport const TabButtons = (props: ITabButtonsProps) => {\r\n const tabClicked = (tab: ITabProps) => {\r\n if (props.onSelected) {\r\n props.onSelected(tab)\r\n }\r\n };\r\n\r\n return (<>\r\n {props.tabs.map(tab =>\r\n
tabClicked(tab)}>\r\n {tab.title}\r\n
\r\n )}\r\n );\r\n};","import React from 'react';\r\n\r\nexport const AccessDenied = () => {\r\n return (\r\n
\r\n Access denied. You don't access to any functions in this module.\r\n
\r\n );\r\n};","import React, { useState } from 'react';\r\nimport PortalPage from '../../../components/portal/PortalPage'\r\nimport './administration.css';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { userHasPermission, useUserRoles } from 'hooks/useRoles';\r\nimport { ITabProps, TabButtons } from 'components/ui/TabButtons';\r\nimport { GeneralAdministrationModule } from './general-administration-data';\r\nimport { AccessDenied } from 'components/ui/AccessDenied';\r\nimport { IConfirmProps } from '../../ui/ConfirmationBox';\r\nimport { IModalBoxProps } from '../../ui/ModalBox';\r\n\r\ninterface IGeneralAdministrationPageProps {\r\n module: string\r\n}\r\n\r\nconst GeneralAdministrationPage = (props: RouteComponentProps) => {\r\n const [loadingState, setLoadingState] = useState(\"ready\");\r\n const [confirmationProps, setConfirmationProps] = useState(null as IConfirmProps | null);\r\n const [modalProps, setModalProps] = useState(null as IModalBoxProps | null);\r\n\r\n const userRoles = useUserRoles();\r\n\r\n const userTabs = (\r\n !GeneralAdministrationModule.children ? [] as ITabProps[] :\r\n GeneralAdministrationModule.children.filter(\r\n subModule => userHasPermission(subModule.permission, userRoles)\r\n ).map(\r\n subModule => { return { ...subModule } as ITabProps }\r\n )\r\n );\r\n\r\n const getDefaultTab = (): ITabProps | null => {\r\n if (userTabs.length > 0) {\r\n if (props.match.params.module) {\r\n return userTabs.find(t => t.url?.endsWith(\"/\" + props.match.params.module)) ?? null;\r\n } else {\r\n if (userTabs.length > 0) {\r\n return userTabs[0];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const [currentTab, setCurrentTab] = useState(getDefaultTab());\r\n\r\n if (!currentTab) {\r\n const defTab = getDefaultTab();\r\n if (defTab) {\r\n setCurrentTab(defTab);\r\n }\r\n }\r\n\r\n const TabComponent = currentTab?.component;\r\n\r\n const tabComponentProps = {\r\n confirmProps: confirmationProps,\r\n setConfirmProps: setConfirmationProps,\r\n\r\n modalProps: modalProps,\r\n setModalProps: setModalProps,\r\n\r\n module: GeneralAdministrationModule.children?.find(m => m.title === currentTab?.title)\r\n };\r\n\r\n return (\r\n \r\n\r\n \r\n\r\n {TabComponent && }\r\n\r\n {userTabs.length === 0 &&\r\n \r\n }\r\n \r\n );\r\n};\r\n\r\nexport default GeneralAdministrationPage;","import { httpGet, httpPost } from 'shared/services/httpService';\r\nimport { AbmCodeUsage, AddCodeResult } from 'shared/models/api/models';\r\nimport appSettings from 'shared/settings/appSettings';\r\n\r\nconst abmUriPath = new URL('/api/abm', appSettings.api.portalApi);\r\n\r\nexport const getAbmCodeUsage = async () => {\r\n const usage = await httpGet(`${abmUriPath}/usage`)\r\n .catch(e => { console.log(e); return {} as AbmCodeUsage });\r\n return usage;\r\n};\r\n\r\nexport const addNewCodes = async (codes: string[]) => {\r\n const results = await httpPost(`${abmUriPath}`, codes)\r\n .catch(e => {\r\n console.log(e);\r\n return { error: \"Error saving codes\" } as AddCodeResult;\r\n });\r\n return results;\r\n};\r\n","import React, { useState, useEffect } from 'react';\r\nimport { getAbmCodeUsage, addNewCodes } from 'shared/services/abmApi';\r\nimport { AbmCodeUsage, AddCodeResult } from 'shared/models/api/models';\r\nimport { Button, Input } from 'reactstrap';\r\n\r\n\r\ninterface IUsageDataProps {\r\n codeUsage: undefined | AbmCodeUsage;\r\n}\r\n\r\nconst UsageView = (props: IUsageDataProps) => {\r\n return (\r\n <>\r\n {props.codeUsage != undefined ?\r\n <>\r\n
\r\n Codes available: {props.codeUsage.available}\r\n
\r\n\r\n
\r\n Codes used: {props.codeUsage.used}\r\n
\r\n \r\n :\r\n <>\r\n
Loading...
\r\n \r\n }\r\n \r\n );\r\n}\r\n\r\ninterface IAddCodesFormProps {\r\n addCodes: () => void;\r\n newCodes: string;\r\n setNewCodes: React.Dispatch>;\r\n}\r\n\r\nconst AddCodesForm = (props: IAddCodesFormProps) => {\r\n return (\r\n <>\r\n
\r\n Add new codes - Must be full redemption URLs\r\n
\r\n
\r\n props.setNewCodes(e.currentTarget.value)}\r\n rows={10}\r\n />\r\n
\r\n
\r\n \r\n
\r\n \r\n );\r\n}\r\n\r\ninterface IAddCodesResultsProps {\r\n codesAddedResult: AddCodeResult;\r\n setCodesAddedResult: React.Dispatch>;\r\n}\r\n\r\nconst AddCodesResults = (props: IAddCodesResultsProps) => {\r\n return (\r\n <>\r\n
\r\n Results\r\n
\r\n
\r\n Added: {props.codesAddedResult.added}\r\n
\r\n {props.codesAddedResult.duplicate > 0 &&\r\n
\r\n Duplicates: {props.codesAddedResult.duplicate}\r\n
\r\n }\r\n {props.codesAddedResult.invalid > 0 &&\r\n
\r\n Invalid: {props.codesAddedResult.invalid}\r\n
\r\n }\r\n {props.codesAddedResult.error && props.codesAddedResult.error.length > 0 &&\r\n
\r\n Error: {props.codesAddedResult.error}\r\n
\r\n }\r\n
\r\n \r\n
\r\n \r\n );\r\n}\r\n\r\nconst AppleAppCodesPage = () => {\r\n const [codeUsage, setCodeUsage] = useState(undefined as undefined | AbmCodeUsage);\r\n const [codesAddedResult, setCodesAddedResult] = useState(undefined as undefined | AddCodeResult);\r\n const [newCodes, setNewCodes] = useState(\"\");\r\n\r\n const addCodes = () => {\r\n let codesArray = newCodes.split(/\\r?\\n/);\r\n addNewCodes(codesArray).then(codesAdded);\r\n }\r\n\r\n const codesAdded = async (result: AddCodeResult) => {\r\n setCodesAddedResult(result);\r\n setNewCodes(\"\");\r\n getAbmCodeUsage().then(setCodeUsage);\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const usage = await getAbmCodeUsage();\r\n\r\n if (mounted) {\r\n setCodeUsage(usage);\r\n }\r\n };\r\n\r\n mount();\r\n return () => { mounted = false };\r\n }, []);\r\n\r\n return (\r\n
\r\n \r\n\r\n
\r\n\r\n {codesAddedResult ?\r\n \r\n :\r\n \r\n }\r\n
\r\n );\r\n};\r\n\r\nexport default AppleAppCodesPage;\r\n","import React, { ReactNode, useState, useEffect } from 'react';\r\nimport { AddCircleOutlineOutlined, EditOutlined, DeleteOutlined } from '@material-ui/icons';\r\nimport { DocumentSearchReplaceSuggestion } from 'shared/models/api/models';\r\nimport * as api from 'shared/services/railDocumentsApi';\r\nimport { Toolbar, IActionProps } from 'components/ui/Toolbar';\r\nimport { DataGrid, IDataCol } from 'components/ui/DataGrid';\r\nimport { FormModal, FormModalPaddedBody, FormModalSubHeader, ModalButton, ModalButtonRow } from 'components/ui/FormModal';\r\nimport InfoModal, { ExitCancelModel } from 'components/ui/InfoModal';\r\nimport { FormFeedback, Input } from 'reactstrap';\r\nimport { stringSort } from 'helpers/HelperFunctions';\r\n\r\nconst addNewActionButton = {\r\n name: \"Add new\",\r\n icon: AddCircleOutlineOutlined,\r\n permission: \"web.admin.general.acronyms.read\"\r\n} as IActionProps;\r\n\r\nconst editActionButton = {\r\n name: \"View/Edit\",\r\n icon: EditOutlined,\r\n permission: \"web.admin.general.acronyms.read\",\r\n minSelectedCount: 1,\r\n maxSelectedCount: 1\r\n} as IActionProps;\r\n\r\nconst deleteActionButton = {\r\n name: \"Delete\",\r\n icon: DeleteOutlined,\r\n permission: \"web.admin.general.acronyms.read\",\r\n minSelectedCount: 1\r\n} as IActionProps;\r\n\r\nconst toolbarActions = [addNewActionButton, editActionButton, deleteActionButton];\r\n\r\nconst expressionColumn = {\r\n name: \"expression\",\r\n heading: \"Expression\",\r\n className: \"Expression\",\r\n sort: (a: DocumentSearchReplaceSuggestion, b: DocumentSearchReplaceSuggestion, order: number) =>\r\n (stringSort(a.expression, b.expression, true) * order)\r\n} as IDataCol;\r\n\r\nconst suggestionColumn = {\r\n name: \"suggestion\",\r\n heading: \"Suggestion\",\r\n className: \"Suggestion\",\r\n sort: (a: DocumentSearchReplaceSuggestion, b: DocumentSearchReplaceSuggestion, order: number) =>\r\n (stringSort(a.suggestion, b.suggestion, true) * order)\r\n} as IDataCol;\r\n\r\nconst gridColumns = [expressionColumn, suggestionColumn];\r\n\r\ninterface IMessage {\r\n text: string;\r\n}\r\n\r\ninterface IPrompt {\r\n text: string;\r\n okAction: () => void;\r\n}\r\n\r\ninterface IForm {\r\n acronym: DocumentSearchReplaceSuggestion\r\n title: string;\r\n icon: any;\r\n closeAction: () => void;\r\n okAction: (acronym: DocumentSearchReplaceSuggestion) => void;\r\n}\r\n\r\nconst AcronymForm = (props: IForm) => {\r\n const [expression, setExpression] = useState('');\r\n const [suggestion, setSuggestion] = useState('');\r\n\r\n const [expressionInvalid, setExpressionInvalid] = useState(false);\r\n const [suggestionInvalid, setSuggestionInvalid] = useState(false);\r\n\r\n const minLength = 2;\r\n const maxLength = 50;\r\n\r\n const formValid = () => {\r\n let valid = true;\r\n\r\n if (expression.length < 2 || expression.length > 100) {\r\n setExpressionInvalid(true);\r\n valid = false;\r\n }\r\n else {\r\n setExpressionInvalid(false);\r\n }\r\n\r\n if (suggestion.length < minLength || suggestion.length > maxLength) {\r\n setSuggestionInvalid(true);\r\n valid = false;\r\n }\r\n else {\r\n setSuggestionInvalid(false);\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n const save = () => {\r\n\r\n if (!formValid()) {\r\n return;\r\n }\r\n\r\n let saveAcronym = { ...props.acronym };\r\n\r\n saveAcronym.expression = expression;\r\n saveAcronym.suggestion = suggestion;\r\n\r\n props.okAction(saveAcronym);\r\n }\r\n\r\n useEffect(() => {\r\n setExpression(props.acronym?.expression || '');\r\n setSuggestion(props.acronym?.suggestion || '');\r\n setExpressionInvalid(false);\r\n setSuggestionInvalid(false);\r\n }, [props.acronym]);\r\n\r\n return (\r\n \r\n <>\r\n \r\n
Acronym Details
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
Expression:
\r\n
\r\n setExpression(e.target.value)}\r\n invalid={expressionInvalid}\r\n required={true}\r\n />\r\n Minimum length: {minLength}\r\n
\r\n
\r\n
\r\n
Suggestion:
\r\n
\r\n setSuggestion(e.target.value)}\r\n invalid={suggestionInvalid}\r\n required={true}\r\n />\r\n Minimum length: {minLength}\r\n
\r\n
\r\n
\r\n\r\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 AcronymsPage = () => {\r\n const [acronyms, setAcronyms] = useState([] as DocumentSearchReplaceSuggestion[]);\r\n const [selectedAcronyms, setSelectedAcronyms] = useState([] as DocumentSearchReplaceSuggestion[]);\r\n const [refresh, setRefresh] = useState({});\r\n const [message, setMessage] = useState(undefined as IMessage | undefined);\r\n const [prompt, setPrompt] = useState(undefined as IPrompt | undefined);\r\n const [form, setForm] = useState(undefined as IForm | undefined);\r\n\r\n const openMessage = (msg: string) => {\r\n setMessage({ text: msg });\r\n }\r\n\r\n const closeMessage = () => {\r\n setMessage(undefined);\r\n }\r\n\r\n const openPrompt = (msg: string, okAction: () => void) => {\r\n setPrompt({ text: msg, okAction: okAction });\r\n }\r\n\r\n const closePrompt = () => {\r\n setPrompt(undefined);\r\n }\r\n\r\n const newForm = () => {\r\n setSelectedAcronyms([]);\r\n setForm({\r\n acronym: { id: 0, expression: '', suggestion: '' },\r\n title: \"Add New Acronym\",\r\n icon: ,\r\n closeAction: closeForm,\r\n okAction: (acronym) => addAcronym(acronym)\r\n });\r\n }\r\n\r\n const editForm = (acronym: DocumentSearchReplaceSuggestion) => {\r\n setForm({\r\n acronym: acronym,\r\n title: \"Edit Acronym\",\r\n icon: ,\r\n closeAction: closeForm,\r\n okAction: (acronym) => editAcronym(acronym)\r\n });\r\n }\r\n\r\n const closeForm = () => {\r\n setForm(undefined);\r\n }\r\n\r\n const checkMinMax = (action: IActionProps) => {\r\n if (selectedAcronyms.length === 0 && (action.minSelectedCount ?? 0) > 0) {\r\n openMessage(\"Please select one item to continue.\");\r\n return false;\r\n }\r\n\r\n if (!action.maxSelectedCount) {\r\n return true;\r\n }\r\n\r\n if (selectedAcronyms.length > action.maxSelectedCount) {\r\n if (action.maxSelectedCount === 1) {\r\n openMessage(\"Please select only one item to continue.\");\r\n }\r\n else {\r\n openMessage(\"Please select \" + action.maxSelectedCount + \" or fewer items to continue.\");\r\n }\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n const addAcronym = async (acronym: DocumentSearchReplaceSuggestion) => {\r\n var result = await api.addSearchReplaceSuggestion(acronym);\r\n if (result) {\r\n openMessage(`Acronym added`);\r\n setRefresh({});\r\n closeForm();\r\n }\r\n else {\r\n openMessage(`Error saving acronym`);\r\n }\r\n }\r\n\r\n const editAcronym = async (acronym: DocumentSearchReplaceSuggestion) => {\r\n var result = await api.editSearchReplaceSuggestion(acronym);\r\n if (result) {\r\n openMessage(`Acronym updated`);\r\n setRefresh({});\r\n closeForm();\r\n }\r\n else {\r\n openMessage(`Error saving acronym`);\r\n }\r\n }\r\n\r\n const deleteSelectedAcronyms = async () => {\r\n closePrompt();\r\n const deleteIds = selectedAcronyms.map(a => a.id);\r\n var success = await api.deleteSearchReplaceSuggestion(deleteIds);\r\n setRefresh({});\r\n if (success) {\r\n openMessage(\"Selected items deleted\");\r\n }\r\n else {\r\n openMessage(\"Error deleting items\");\r\n }\r\n }\r\n\r\n const actionClicked = (action: IActionProps) => {\r\n if (!checkMinMax(action)) {\r\n return;\r\n }\r\n\r\n switch (action) {\r\n case addNewActionButton:\r\n newForm();\r\n return;\r\n case editActionButton:\r\n editForm(selectedAcronyms[0]);\r\n return;\r\n case deleteActionButton:\r\n openPrompt('Are you sure you want to delete the selected acronyms?', deleteSelectedAcronyms);\r\n return;\r\n default:\r\n console.warn(\"Unhandled action: \" + action.name);\r\n }\r\n }\r\n\r\n const onGridRowDoubleClick = (acronym: DocumentSearchReplaceSuggestion) => {\r\n editAcronym(acronym);\r\n }\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n const mount = async () => {\r\n const results = await api.documentSearchReplaceSuggestions();\r\n\r\n if (mounted) {\r\n setAcronyms(results);\r\n setSelectedAcronyms([]);\r\n }\r\n };\r\n\r\n mount();\r\n return () => { mounted = false };\r\n }, [refresh]);\r\n\r\n return (\r\n <>\r\n\r\n \r\n\r\n { })}\r\n closeAction={closePrompt}\r\n closeButtonText={'Cancel'} />\r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n );\r\n};\r\n\r\nexport default AcronymsPage;\r\n","import React, { ReactNode, useEffect, useState } from 'react';\r\nimport { IActionProps, Toolbar } from '../../ui/Toolbar';\r\nimport { IApplicationModule } from '../../ui/IApplicationModule';\r\nimport { LocationDetail } from 'shared/models/api/models';\r\nimport { DetailFormWrapper } from '../../ui/DetailForm';\r\nimport { ViewOrEditButtonText } from './general-administration-data';\r\nimport { IModalBoxProps } from 'components/ui/ModalBox';\r\nimport { IConfirmProps } from 'components/ui/ConfirmationBox';\r\nimport { getLocationsWithDetail, getLocationWithDetail, updateLocationMobile } from 'shared/services/locationApi';\r\nimport { DataGrid } from 'components/ui/DataGrid';\r\n\r\ninterface ISiteMobileListProps {\r\n module: IApplicationModule,\r\n // loadingState: string,\r\n // setLoadingState: (newState: string) => void,\r\n setConfirmProps: (confirmProps: IConfirmProps | null) => void,\r\n setModalProps: (modalProps: IModalBoxProps | null) => void\r\n}\r\n\r\n\r\nexport const SiteMobileNumbers = (props: ISiteMobileListProps) => {\r\n\r\n const [locations, setLocations] = useState([] as LocationDetail[]);\r\n const [selectedLocations, setSelectedLocations] = useState([] as LocationDetail[]);\r\n\r\n\r\n const getLocationList = async () => {\r\n await getLocationsWithDetail()\r\n .then(result => {\r\n if (result) {\r\n setLocations(result);\r\n }\r\n });\r\n };\r\n\r\n const actionClicked = (action: IActionProps) => {\r\n if (checkMinMax(action)) {\r\n switch (action.name) {\r\n\r\n case ViewOrEditButtonText:\r\n return viewOrEdit(selectedLocations[0]);\r\n\r\n default:\r\n console.warn(\"Unhandled action: \" + action.name);\r\n }\r\n }\r\n };\r\n\r\n const checkMinMax = (action: IActionProps) => {\r\n if (selectedLocations.length === 0 && (action.minSelectedCount ?? 0) > 0) {\r\n msgBox(\"Please select one item to continue.\");\r\n return false;\r\n }\r\n\r\n if (!!action.maxSelectedCount) {\r\n if (selectedLocations.length > action.maxSelectedCount) {\r\n if (action.maxSelectedCount === 1) {\r\n msgBox(\"Please select only one item to continue.\");\r\n } else {\r\n msgBox(\"Please select \" + action.maxSelectedCount + \" or fewer items to continue.\");\r\n }\r\n\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n const saveLocationDetail = async (locationDetail: LocationDetail): Promise => {\r\n var result = await updateLocationMobile(locationDetail);\r\n console.log()\r\n if (!result) {\r\n throw new Error(\"Call to save mobile number failed\");\r\n }\r\n return locationDetail;\r\n }\r\n\r\n\r\n const onDataChanged = (location: LocationDetail, msg: string | undefined) => {\r\n console.log('on changed');\r\n const idx = locations.findIndex(l => l.id === location.id);\r\n\r\n if (idx > -1) {\r\n // take a copy of the array\r\n var arr = locations.map(u => u);\r\n\r\n // replace the row with the updated location\r\n arr[idx] = location;\r\n\r\n // set the new array back to the all locations\r\n setLocations(arr);\r\n } else {\r\n // just get all users again\r\n getLocationList();\r\n }\r\n\r\n props.setModalProps(null);\r\n msgBox(msg ?? \"Your request has been successfully completed.\");\r\n };\r\n\r\n const onGridRowDoubleClick = (row: LocationDetail) => {\r\n viewOrEdit(row);\r\n };\r\n\r\n const viewOrEdit = (row: LocationDetail) => {\r\n if (row) {\r\n props.setModalProps({\r\n className: \"allowed-domain-modal\",\r\n body:\r\n \r\n load={() => getLocationWithDetail(row.id)}\r\n save={saveLocationDetail}\r\n viewName=\"edit\"\r\n onDataChanged={onDataChanged}\r\n module={props.module}\r\n setConfirmationProps={props.setConfirmProps}\r\n closeDialog={() => props.setModalProps(null)}\r\n />\r\n });\r\n }\r\n };\r\n\r\n const msgBox = (msg: ReactNode) => {\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps({\r\n message: msg,\r\n options: [\"OK\"],\r\n defaultOption: \"OK\",\r\n setResult: result => {\r\n if (props.setConfirmProps) {\r\n props.setConfirmProps(null);\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n\r\n var loading = false;\r\n\r\n useEffect(() => {\r\n if (!loading) {\r\n loading = true;\r\n\r\n getLocationList();\r\n }\r\n }, []);\r\n\r\n const compareInts = (a: number, b: number) => {\r\n if (a < b) return -1;\r\n if (a > b) return 1;\r\n return 0;\r\n };\r\n\r\n\r\n return (\r\n
\r\n \r\n\r\n c.showInGrid)\r\n .sort((a, b,) => compareInts(a.showInGrid ?? 0, b.showInGrid ?? 0))\r\n ?? []\r\n }\r\n onDoubleClick={onGridRowDoubleClick} />\r\n
\r\n );\r\n\r\n}\r\n\r\n\r\nexport default SiteMobileNumbers;","var _path;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgBhpLogo(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n x: \"0px\",\n y: \"0px\",\n className: \"nav-logo\",\n viewBox: \"0 0 90 40\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"white\",\n d: \"M90,10.8c0,6-4.8,10.8-10.8,10.8h-7.4v12.6h-8.5V0h15.8C85.2,0,90,4.9,90,10.8z M77.8,7.1h-5.9 v7.1h5.9c1.9,0,3.4-1.7,3.4-3.5C81.2,8.8,79.7,7.1,77.8,7.1z M49.9,0v13.9H38.1V0h-8.5v34.3h8.5V21.7h11.8v12.6h8.5V0H49.9z M26.3,25c0,5.7-5.1,9.3-10.5,9.3H0V0h15.3c5.6,0,10.2,4.1,10.2,9.2c0,4-1.9,6.2-4.5,7.8C24,18.3,26.3,20.2,26.3,25z M14.1,20.5H8.5 v6.6h5.6c2.2,0,3.4-1.5,3.4-3.3C17.5,22,15.9,20.5,14.1,20.5z M13.3,7.1H8.5v7.1h4.8c2.2,0,3.4-1.7,3.4-3.5 C16.7,8.8,15.5,7.1,13.3,7.1z\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgBhpLogo);\nexport default __webpack_public_path__ + \"static/media/bhp-logo.694e8117.svg\";\nexport { ForwardRef as ReactComponent };","import { AddCircleOutlineOutlined, BarChartOutlined, Create, EditOutlined, Info, SwapHorizontalCircleOutlined } from '@material-ui/icons';\r\nimport { ToDo } from '../../ui/ToDo';\r\nimport AllowedDomainList from './allowed-domain-list';\r\nimport GeneralAdministrationPage from './general-administration';\r\nimport AppleAppCodesPage from './apple-app-codes';\r\nimport AcronymsPage from './acronyms';\r\nimport MobileNumbersPage from './site-mobile-numbers';\r\nimport { AllowedDomain, AllowedDomainListItem, emailDomainAvailable } from 'shared/services/adminApi';\r\nimport { TextField, UserField, EmailField, HyperlinkField } from '../../ui/DetailForm';\r\nimport { IApplicationModule } from '../../ui/IApplicationModule';\r\nimport { IUserSearchResult, LocationDetail } from '../../../shared/models/api/models';\r\nimport { ReactComponent as GeneralAdminIcon } from \"assets/icons/settings.svg\";\r\nimport { stringSort } from '../../../helpers/HelperFunctions';\r\n\r\n// we could probably move these to the toolbar as standard text buttons\r\nexport const AddNewButtonText = \"Add new\";\r\nexport const ViewOrEditButtonText = \"View/Edit\";\r\nexport const EnableOrDisableButtonText = \"Enable/Disable\";\r\n\r\nexport const GeneralAdministrationModule = {\r\n title: \"General Administration\",\r\n className: \"general-administration\",\r\n url: \"/administration/general\",\r\n permission: \"web.admin.general.view\",\r\n icon: GeneralAdminIcon,\r\n component: GeneralAdministrationPage,\r\n children: [\r\n {\r\n title: \"Allowed domain list\",\r\n className: \"allowed-domain-list\",\r\n url: \"/administration/general/allowed-domains\",\r\n hideInMenuTile: true,\r\n permission: \"web.admin.general.allowed-domain.read\",\r\n selectMode: \"one\",\r\n actions: [\r\n {\r\n name: AddNewButtonText,\r\n icon: AddCircleOutlineOutlined,\r\n permission: \"web.admin.general.allowed-domain.create\",\r\n },\r\n {\r\n name: ViewOrEditButtonText,\r\n icon: EditOutlined,\r\n permission: \"web.admin.general.allowed-domain.read\",\r\n minSelectedCount: 1,\r\n maxSelectedCount: 1\r\n },\r\n {\r\n name: EnableOrDisableButtonText,\r\n icon: SwapHorizontalCircleOutlined,\r\n permission: \"web.admin.general.allowed-domain.enable-or-disable\",\r\n minSelectedCount: 1,\r\n maxSelectedCount: 1\r\n }\r\n ],\r\n component: AllowedDomainList,\r\n pageSize: 20,\r\n views: [\r\n {\r\n name: \"view\",\r\n heading: \"Domain details\",\r\n icon: Info,\r\n mode: \"view\",\r\n actions: [\r\n { name: \"edit\", label: \"Edit\", switchToView: \"edit\" }\r\n ],\r\n defaultAction: \"edit\",\r\n permission: \"web.admin.general.allowed-domain.edit\",\r\n subSubHeading: (domain: AllowedDomain) => (\"Domain details: \" + domain.contractPartner),\r\n subSubIcon: BarChartOutlined\r\n },\r\n {\r\n name: \"edit\",\r\n heading: \"Domain details\",\r\n icon: Create,\r\n subHeading: \"Edit domain details\",\r\n mode: \"edit\",\r\n actions: [\r\n { name: \"cancel\", label: \"Cancel\", setResult: \"close\" },\r\n { name: \"continue\", label: \"Continue\", switchToView: \"review_edit\", validate: true }\r\n ],\r\n defaultAction: \"continue\",\r\n permission: \"web.admin.general.allowed-domain.edit\",\r\n subSubHeading: (domain: AllowedDomain) => (\"Domain details: \" + domain.contractPartner),\r\n subSubIcon: BarChartOutlined\r\n },\r\n {\r\n name: \"review_edit\",\r\n heading: \"Domain details\",\r\n icon: Create,\r\n subHeading: \"Check and confirm domain details\",\r\n mode: \"review\",\r\n actions: [\r\n { name: \"edit\", label: \"Edit\", switchToView: \"edit\" },\r\n { name: \"save\", label: \"Update details\", setResult: \"save\" }\r\n ],\r\n defaultAction: \"save\",\r\n permission: \"web.admin.general.allowed-domain.edit\",\r\n subSubHeading: (domain: AllowedDomain) => (\"Domain details: \" + domain.contractPartner),\r\n subSubIcon: BarChartOutlined\r\n },\r\n {\r\n name: \"new\",\r\n heading: \"Add new domain\",\r\n icon: AddCircleOutlineOutlined,\r\n subHeading: \"Enter domain details\",\r\n mode: \"new\",\r\n progress: \"1 / 2\",\r\n actions: [\r\n { name: \"cancel\", label: \"Cancel\", setResult: \"close\" },\r\n { name: \"continue\", label: \"Continue\", switchToView: \"review_new\", validate: true }\r\n ],\r\n defaultAction: \"continue\",\r\n permission: \"web.admin.general.allowed-domain.edit\",\r\n subSubHeading: (domain: AllowedDomain) => (\"Domain details\")\r\n },\r\n {\r\n name: \"review_new\",\r\n heading: \"Add new domain\",\r\n icon: AddCircleOutlineOutlined,\r\n subHeading: \"Check and confirm domain details\",\r\n mode: \"review\",\r\n progress: \"2 / 2\",\r\n actions: [\r\n { name: \"edit\", label: \"Edit\", switchToView: \"new\" },\r\n { name: \"save\", label: \"Upload\", setResult: \"save\", msg: \"The domain has been added to the list.\" }\r\n ],\r\n defaultAction: \"save\",\r\n permission: \"web.admin.general.allowed-domain.edit\"\r\n }\r\n ],\r\n columns: [\r\n {\r\n name: \"contractPartner\",\r\n heading: \"Domain name\",\r\n className: \"string-col\",\r\n showInGrid: 1,\r\n sort: (a: AllowedDomainListItem, b: AllowedDomainListItem, order: number) =>\r\n (stringSort(a.contractPartner, b.contractPartner, true) * order)\r\n },\r\n {\r\n name: \"contractPartner\",\r\n heading: \"Contract partner\",\r\n className: \"string-col\",\r\n formComponent: TextField,\r\n validation: {\r\n required: true,\r\n minLength: 2,\r\n tip: \"Contract partner is mandatory\"\r\n },\r\n placeholderText: \"Enter company name\",\r\n setValue: (allowedDomain: AllowedDomain, val: string) => { allowedDomain.contractPartner = val; }\r\n },\r\n {\r\n name: \"isEnabled\",\r\n heading: \"Domain status\",\r\n format: (val: any) => (val === true ? \"Enabled\" : \"Disabled\"),\r\n filterable: true,\r\n className: \"boolean-col\",\r\n showInGrid: 2\r\n },\r\n {\r\n name: \"sector\",\r\n heading: \"Sector\",\r\n className: \"string-col\",\r\n formComponent: TextField,\r\n validation: {\r\n required: true,\r\n minLength: 1,\r\n tip: \"Sector is mandatory\"\r\n },\r\n placeholderText: \"Enter specialised area\",\r\n setValue: (allowedDomain: AllowedDomain, val: string) => { allowedDomain.sector = val; }\r\n },\r\n {\r\n name: \"companyWebsite\",\r\n heading: \"Company website\",\r\n className: \"string-col\",\r\n formComponent: HyperlinkField,\r\n validation: {\r\n required: true,\r\n startsWith: [\"http://\", \"https://\"],\r\n segments: { splitter: '.', min: 2 },\r\n minLength: 10,\r\n maxLength: 100,\r\n tip: \"Company website is mandatory and must be a valid url e.g. https://www.bhp.com\"\r\n },\r\n placeholderText: \"Enter url e.g. https://www.bhp.com\",\r\n tip: \"Enter the company website e.g. https://www.bhp.com\",\r\n setValue: (allowedDomain: AllowedDomain, val: string) => { allowedDomain.companyWebsite = val; }\r\n },\r\n {\r\n name: \"emailDomain\",\r\n heading: \"Company email domain\",\r\n className: \"string-col\",\r\n readonlyForEdit: true,\r\n formComponent: TextField,\r\n validation: {\r\n required: true,\r\n startsWith: [\"@\"],\r\n segments: { splitter: '.', min: 2 },\r\n minLength: 5,\r\n immediateValidationFn: (async (emailDomain: string) => { return emailDomainAvailable(emailDomain) }),\r\n immediateValidationMsgFn: ((emailDomain) => `Email domain ${ emailDomain } is already in use`),\r\n\r\n tip: \"Company email domain is mandatory and must be a valid domain e.g. @bhp.com\"\r\n },\r\n placeholderText: \"Enter email domain e.g. @bhp.com\",\r\n tip: \"Enter the email domain e.g. @bhp.com\",\r\n setValue: (allowedDomain: AllowedDomain, val: string) => { allowedDomain.emailDomain = val; }\r\n },\r\n {\r\n name: \"contractManager\",\r\n heading: \"BHP contract manager/supervisor\",\r\n className: \"user-id\",\r\n formComponent: UserField,\r\n validation: {\r\n required: true\r\n },\r\n placeholderText: \"Enter first name or last name\",\r\n tip: \"List only contains users registered in the system\",\r\n setValue: (allowedDomain: AllowedDomain, val: IUserSearchResult) => {\r\n allowedDomain.contractManager = val;\r\n }\r\n },\r\n {\r\n name: \"contractManager\",\r\n heading: \"BHP contract manager/supervisor email\",\r\n className: \"user-email\",\r\n formComponent: EmailField,\r\n readonly: true,\r\n format: (val: IUserSearchResult) => val.email,\r\n formatRow: (row: AllowedDomain) => row.contractManager ? row.contractManager.email : \"\"\r\n }\r\n ]\r\n },\r\n {\r\n title: \"ABM Redeem Codes\",\r\n permission: \"web.admin.role.update\",\r\n hideInMenuTile: true,\r\n actions: [],\r\n url: \"/administration/general/abm-redeem-codes\",\r\n component: AppleAppCodesPage\r\n },\r\n {\r\n title: \"Acronyms\",\r\n className: \"acronyms\",\r\n permission: \"web.admin.general.acronyms.read\",\r\n hideInMenuTile: true,\r\n actions: [],\r\n url: \"/administration/general/acronyms\",\r\n component: AcronymsPage\r\n },\r\n {\r\n title: \"Site mobile numbers\",\r\n permission: \"web.admin.general.view\",\r\n hideInMenuTile: true,\r\n selectMode: \"one\",\r\n actions: [\r\n\r\n {\r\n name: ViewOrEditButtonText,\r\n icon: EditOutlined,\r\n permission: \"web.admin.fatigue-assessment.settings\",\r\n minSelectedCount: 1,\r\n maxSelectedCount: 1\r\n }\r\n\r\n ],\r\n columns: [{\r\n name: \"name\",\r\n heading: \"Site\",\r\n className: \"string-col\",\r\n showInGrid: 1,\r\n sort: (a: LocationDetail, b: LocationDetail, order: number) =>\r\n (stringSort(a.name, b.name, true) * order)\r\n },\r\n {\r\n name: \"siteMobileNumber\",\r\n heading: \"Mobile Number\",\r\n className: \"string-col\",\r\n showInGrid: 2,\r\n sort: (a: LocationDetail, b: LocationDetail, order: number) =>\r\n (stringSort(a.siteMobileNumber, b.siteMobileNumber, true) * order)\r\n },\r\n {\r\n name: \"siteMobileNumber\",\r\n heading: \"Mobile Number\",\r\n className: \"string-col\",\r\n formComponent: TextField,\r\n setValue: (location: LocationDetail, val: string) => { location.siteMobileNumber = val; },\r\n placeholderText: \"Enter site mobile\",\r\n validation: {\r\n required: true,\r\n minLength: 10,\r\n maxLength: 15,\r\n immediateValidationFn: (mobileString) => {\r\n var regex = /^(\\+\\d{1,3}[- ]?)?\\d{10}$/g\r\n return Promise.resolve(regex.test(mobileString));\r\n },\r\n immediateValidationMsgFn: ((mobile) => `Not a valid mobile number`),\r\n }\r\n }\r\n ],\r\n views: [\r\n {\r\n name: \"edit\",\r\n heading: \"Site Mobile Number\",\r\n icon: Create,\r\n subHeading: \"Edit site mobile number\",\r\n mode: \"quickEdit\",\r\n actions: [\r\n { name: \"cancel\", label: \"Cancel\", setResult: \"close\" },\r\n { name: \"save\", label: \"Save\", setResult: \"save\", validate: true }\r\n ],\r\n defaultAction: \"save\",\r\n permission: \"web.admin.fatigue-assessment.settings\",\r\n subSubHeading: (location: LocationDetail) => (\"Site: \" + location.name),\r\n subSubIcon: BarChartOutlined\r\n }\r\n ],\r\n url: \"/administration/general/site-mobile-numbers\",\r\n component: MobileNumbersPage\r\n }\r\n ]\r\n} as IApplicationModule;","import DocumentList from \"components/portal/documents/DocumentsList\";\r\nimport UserDocumentsReportingView from \"components/portal/reporting/UserDocumentsReportingView\";\r\nimport FatigueAssessmentReport from \"components/portal/reporting/FatigueAssessmentReportingView\";\r\nimport LoginHistoryReport from \"components/portal/reporting/LoginHistoryReportingView\";\r\nimport { PDFViewer } from \"components/portal/pdf/Viewer\";\r\nimport { UserGuide } from \"components/portal/UserGuide\";\r\nimport UnderConstruction from \"components/UnderConstruction\";\r\nimport Home from 'pages/Home';\r\nimport SigninOidc from \"pages/SignInOIDC\";\r\nimport SignoutOidc from \"pages/SignOutOIDC\";\r\nimport SilentAuth from \"pages/SilentAuth\";\r\nimport UserProfile from \"pages/UserProfile\";\r\nimport DocumentSearch from \"components/portal/documents/search/DocumentSearch\";\r\nimport Login from \"pages/Login\";\r\nimport Debug from 'pages/DebugInfo';\r\nimport { RouteProps } from 'react-router';\r\nimport { GeneralAdministrationModule } from 'components/portal/administration/general-administration-data';\r\nimport { AllDocumentRoutes } from 'components/ui/DocumentRules';\r\nimport { allFatigueAssessmentRoutes } from 'components/ui/FatigueAssessmentRules';\r\nimport { UserManagementModule } from \"components/portal/administration/user-management-data\";\r\n\r\n// TODO define colors once in css\r\nexport interface IRouteConfig extends RouteProps {\r\n breadCrumb?: string,\r\n color?: string,\r\n unProtected?: boolean,\r\n endTrail?: boolean,\r\n permission?: string\r\n}\r\n\r\nexport const homePath = \"/\";\r\n\r\nexport const RouteList: IRouteConfig[] =\r\n [{\r\n exact: true,\r\n unProtected: true,\r\n path: '/signin-oidc',\r\n component: SigninOidc,\r\n breadCrumb: \"SignIn\",\r\n },\r\n {\r\n exact: true,\r\n unProtected: true,\r\n path: '/login',\r\n component: Login,\r\n breadCrumb: \"Home\",\r\n },\r\n {\r\n exact: true,\r\n unProtected: true,\r\n path: '/signout-oidc',\r\n component: SignoutOidc,\r\n breadCrumb: \"SignOut\",\r\n },\r\n {\r\n exact: true,\r\n unProtected: true,\r\n path: '/silent-auth',\r\n component: SilentAuth,\r\n breadCrumb: \"Silent Auth\",\r\n },\r\n {\r\n exact: true,\r\n path: homePath,\r\n component: Home,\r\n breadCrumb: \"Home\",\r\n },\r\n {\r\n exact: true,\r\n path: '/signin-aad',\r\n component: Home,\r\n breadCrumb: \"Home\",\r\n },\r\n {\r\n exact: true,\r\n path: '/administration',\r\n component: UnderConstruction,\r\n breadCrumb: \"Administration\",\r\n },\r\n {\r\n exact: true,\r\n path: UserManagementModule.url,\r\n breadCrumb: UserManagementModule.title,\r\n component: UserManagementModule.component\r\n },\r\n {\r\n exact: true,\r\n path: GeneralAdministrationModule.url,\r\n breadCrumb: \"General Administration\",\r\n component: GeneralAdministrationModule.component\r\n },\r\n {\r\n exact: false,\r\n path: GeneralAdministrationModule.url + \"/:module\",\r\n breadCrumb: \"General Administration\",\r\n component: GeneralAdministrationModule.component\r\n },\r\n {\r\n exact: true,\r\n path: \"/reporting\",\r\n breadCrumb: \"Reporting\",\r\n component: UnderConstruction\r\n },\r\n {\r\n exact: true,\r\n path: \"/reporting/user-document\",\r\n breadCrumb: \"User / Document reporting\",\r\n permission: \"web.admin.user.reporting\",\r\n component: UserDocumentsReportingView\r\n },\r\n {\r\n exact: true,\r\n path: \"/reporting/fatigue-assessment\",\r\n breadCrumb: \"Fatigue Assessment reporting\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n component: FatigueAssessmentReport\r\n },\r\n {\r\n exact: true,\r\n path: \"/reporting/login-history\",\r\n breadCrumb: \"Login History reporting\",\r\n permission: \"web.admin.user.reporting\",\r\n component: LoginHistoryReport\r\n },\r\n {\r\n exact: true,\r\n path: \"/search\",\r\n component: DocumentSearch,\r\n breadCrumb: \"Search\",\r\n endTrail: true\r\n },\r\n {\r\n path: \"/search/:searchTerm\",\r\n component: DocumentSearch,\r\n breadCrumb: \"Search\",\r\n endTrail: true\r\n },\r\n {\r\n path: \"/pdf/view/:documentId/(module)?/:module?/(page)?/:page?/(search)?/:search?\",\r\n component: PDFViewer,\r\n breadCrumb: \"PDF Viewer\",\r\n endTrail: true\r\n },\r\n {\r\n exact: true,\r\n path: \"/underconstruction\",\r\n component: UnderConstruction,\r\n breadCrumb: \"Under Construction\"\r\n },\r\n {\r\n exact: true,\r\n path: \"/test\",\r\n component: Debug,\r\n breadCrumb: \"Test page\"\r\n },\r\n {\r\n exact: true,\r\n path: \"/userprofile\",\r\n component: UserProfile,\r\n breadCrumb: \"My profile details\",\r\n },\r\n {\r\n exact: true,\r\n path: \"/userguide\",\r\n component: UserGuide,\r\n breadCrumb: \"User guide\"\r\n }\r\n ]\r\n .concat(AllDocumentRoutes(DocumentList))\r\n .concat(allFatigueAssessmentRoutes());\r\n","import * as React from 'react';\r\nimport {signinRedirect } from 'shared/services/userService';\r\n\r\nexport default () => ()","import React from 'react';\r\nimport { StaticFileViewer } from \"components/portal/pdf/Viewer\";\r\n\r\nexport const UserGuide = () => {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Spinner } from '../components/ui/Spinner';\r\n\r\nexport default () => (\r\n
\r\n Signing in\r\n \r\n
\r\n)\r\n","import React, { useEffect } from 'react';\r\nimport useSelector from 'hooks/useSelector';\r\nimport SubHeader from \"components/menu/SubHeader\";\r\nimport { Card } from \"reactstrap\";\r\nimport Loading from './Loading';\r\n\r\nexport default () => {\r\n const profile = useSelector(state => state.profile);\r\n\r\n useEffect(() => {\r\n\r\n }, [profile]);\r\n\r\n return (\r\n <>\r\n {profile ?\r\n < div className=\"narrow-container\" >\r\n \r\n\r\n \r\n

No access

\r\n\r\n

You do not have access to this page

\r\n
\r\n
\r\n :\r\n \r\n }\r\n \r\n );\r\n}\r\n","import React, { useEffect } from 'react';\r\n\r\nexport default () => {\r\n const accessLink = 'https://bhp.service-now.com/sp?id=bhp_home';\r\n\r\n useEffect(() => {\r\n sessionStorage.clear();\r\n localStorage.clear();\r\n }, []);\r\n\r\n return (\r\n
\r\n

Access Required

\r\n

You do not have access to this site.

\r\n

\r\n

Please raise a service request to gain the appropriate access.

\r\n

{accessLink}

\r\n
\r\n );\r\n}\r\n","import React from 'react';\r\nimport { Route, Redirect } from 'react-router-dom';\r\nimport useSelector from 'hooks/useSelector';\r\nimport { RouteProps } from 'react-router';\r\nimport { RouteList } from \"helpers/route-config\";\r\nimport { SignedInState } from \"shared/store/applicationState\"\r\nimport { signinRedirect } from 'shared/services/userService';\r\nimport { userHasPermission } from 'hooks/useRoles';\r\nimport Loading from \"pages/Loading\";\r\nimport NoAccess from \"pages/NoAccess\";\r\nimport AccessRequired from \"pages/AccessRequired\";\r\n\r\n\r\nexport const ProtectedRoute = (props: RouteProps) => {\r\n const user = useSelector(state => state.user);\r\n console.log('Protect Route');\r\n return user\r\n ? ()\r\n : ();\r\n}\r\n\r\n\r\nexport const Routes = () => {\r\n const user = useSelector(state => state.user);\r\n const signedInState = useSelector(state => state.signedInState);\r\n\r\n return (\r\n \r\n {\r\n RouteList.map((route, i) => {\r\n\r\n const getRouteComponent = (): any => {\r\n\r\n if (signedInState === undefined || signedInState === SignedInState.Loading) {\r\n return Loading;\r\n }\r\n\r\n if (user === undefined) {\r\n return signinRedirect;\r\n }\r\n\r\n return route.component;\r\n }\r\n\r\n const component = getRouteComponent();\r\n\r\n const accessRequired = user !== undefined && (user.roles === undefined || user.roles.length < 1);\r\n const hasPermissionRouteProtected = userHasPermission(route.permission) && !route.unProtected;\r\n const hasPermissionRouteUnprotected = userHasPermission(route.permission) && route.unProtected;\r\n\r\n if (accessRequired) {\r\n return ();\r\n }\r\n\r\n if (hasPermissionRouteProtected) {\r\n return ();\r\n }\r\n\r\n else if (hasPermissionRouteUnprotected) {\r\n return ();\r\n }\r\n\r\n else {\r\n return ();\r\n }\r\n })}\r\n\r\n \r\n );\r\n};\r\n","var _g;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgFatigueAssessment(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0H24V24H0z\",\n transform: \"translate(-146 -1494) translate(146 1494)\"\n }), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H2.05V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 3.54) translate(0 0)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H7.64V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 3.54) translate(3.913 0)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H2.05V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 7.081) translate(0 0)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H7.64V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 7.081) translate(3.913 0)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H2.05V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 0)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H7.64V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 0) translate(3.913)\"\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H2.05V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 10.622) translate(0 0)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H7.64V2.05H0z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(390.423 26.472) translate(0 10.622) translate(3.913 0)\"\n }))), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.742 20.147H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h14.742a1 1 0 0 1 1 1v18.147a1 1 0 0 1-1 1zM.993 2.27v16.743h14.614V2.27z\",\n transform: \"translate(-146 -1494) translate(-238.371 1473.926) translate(388 22)\"\n })))));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgFatigueAssessment);\nexport default __webpack_public_path__ + \"static/media/fatigue-assessment.84429d52.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\r\nimport { useState, useEffect } from 'react';\r\nimport \"./UserMenu.css\";\r\nimport SaveDocument from \"assets/icons/save-documents.svg\";\r\nimport CheckVerified from \"assets/icons/check-verified.svg\";\r\nimport {\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu,\r\n DropdownItem\r\n} from 'reactstrap';\r\nimport { Help, ExitToApp, AccountCircle, Brightness2, ExpandMore, Person } from '@material-ui/icons';\r\nimport { Link } from 'react-router-dom';\r\nimport Toggle from 'bootstrap-switch-button-react';\r\nimport useSelector from 'hooks/useSelector';\r\nimport { ExitCancelModel } from 'components/ui/InfoModal';\r\nimport { loadUserProfile, signoutRedirect } from 'shared/services/userService';\r\nimport { RecentlyActionedPath, FavouritesPath, FavouritesFilter, RecentlyActionedFilter } from 'components/ui/DocumentRules';\r\n\r\n\r\nconst ShowIcon = (props: { icon: any }) => {\r\n const Icon = props.icon;\r\n\r\n return ()\r\n}\r\n\r\nexport default () => {\r\n const [logoutMessage, setLogoutMessage] = useState(\"\");\r\n\r\n const user = useSelector(state => state.user);\r\n const profile = useSelector(state => state.profile);\r\n\r\n const displayLogoutPrompt = () => {\r\n setLogoutMessage('Are you sure you want to log out?');\r\n }\r\n\r\n const closeLogoutPrompt = () => {\r\n setLogoutMessage('');\r\n }\r\n\r\n useEffect(() => {\r\n if (profile === undefined) {\r\n loadUserProfile();\r\n }\r\n }, []);\r\n\r\n return (\r\n \r\n \r\n \r\n {user &&\r\n \r\n {profile?.firstname ?\r\n <>Hi, {profile?.firstname}\r\n :\r\n <>Account\r\n }\r\n \r\n }\r\n \r\n \r\n \r\n\r\n My Account\r\n\r\n \r\n My profile details\r\n \r\n\r\n \r\n My favourite documents\r\n \r\n\r\n \r\n My actioned documents\r\n \r\n\r\n \r\n\r\n \r\n User guide\r\n \r\n\r\n \r\n Log out\r\n \r\n\r\n signoutRedirect()}\r\n closeButtonText={'Cancel'}\r\n closeAction={() => closeLogoutPrompt()}\r\n />\r\n \r\n \r\n );\r\n}\r\n\r\n\r\n\r\n\r\n\r\n","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgAppsFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 70.803,\n height: 70.803,\n viewBox: \"0 0 70.803 70.803\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h70.8v70.8H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4 15.8h11.8V4H4zm17.7 35.4h11.8V39.4H21.7zM4 51.2h11.8V39.4H4zm0-17.7h11.8V21.7H4zm17.7 0h11.8V21.7H21.7zM39.4 4v11.8h11.8V4zM21.7 15.8h11.8V4H21.7zm17.7 17.7h11.8V21.7H39.4zm0 17.7h11.8V39.4H39.4z\",\n transform: \"translate(7.8 7.8)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgAppsFilled);\nexport default __webpack_public_path__ + \"static/media/apps-filled.24afd757.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nvar _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }\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; }\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; }\nimport * as React from \"react\";\nfunction SvgArrowForward(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\",\n transform: \"translate(-2 -1)\"\n })));\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgArrowForward);\nexport default __webpack_public_path__ + \"static/media/arrow_forward.057238ad.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useState } from 'react';\r\nimport \"./NavMenu.css\";\r\nimport { Link } from 'react-router-dom';\r\nimport { ReactComponent as FatigueAssessmentIcon } from \"assets/icons/fatigue-assessment.svg\";\r\nimport { ReactComponent as ReportingIcon } from \"assets/icons/reports-filled.svg\";\r\nimport { ReactComponent as AppsIcon } from \"assets/icons/apps-filled.svg\";\r\nimport { ReactComponent as QuickLinksIcon } from \"assets/icons/link-filled.svg\";\r\nimport { QuickLinksData, IQuickLinkItem } from '../ui/QuickLinks';\r\nimport { ApplicationData, IApplicationItem } from '../ui/Applications';\r\nimport {\r\n DocumentManagementDocumentView, getClassName, IDocumentModule,\r\n RailDocumentDocumentModule, RailRulebookDocumentModule\r\n} from '../ui/DocumentRules';\r\nimport { GeneralAdministrationModule } from 'components/portal/administration/general-administration-data';\r\nimport {\r\n fatigueAssessmentRoute,\r\n fatigueAssessmentOnBehalfRoute,\r\n fatigueAssessmentAssignRoute,\r\n fatigueAssessmentBlankFormRoute,\r\n fatigueAssessmentDashboardPathRoute\r\n} from 'components/portal/fatigueAssessment/FatigueAssessmentRoutes';\r\nimport { IApplicationModule } from '../ui/IApplicationModule';\r\nimport { UserManagementModule } from '../portal/administration/user-management-data';\r\nimport { Grid, GridSize } from '@material-ui/core';\r\nimport { KeyboardArrowDownOutlined, KeyboardArrowUpOutlined, Settings } from '@material-ui/icons';\r\nimport { ReactComponent as ArrowForward } from \"assets/icons/arrow_forward.svg\";\r\nimport { userHasPermission } from 'hooks/useRoles';\r\nimport { useAllDocumentTypes } from 'hooks/useDocumentType';\r\n\r\nconst underConstructionRoute = \"/underconstruction\";\r\n\r\ntype NavMenuProps = {\r\n admin: boolean,\r\n onFollowLink: () => void;\r\n}\r\n\r\ninterface IMenuItem {\r\n title: string,\r\n className?: string,\r\n children?: IMenuItem[],\r\n maxDisplayedChildren?: number,\r\n roles?: string[],\r\n hideInMenuTile?: boolean,\r\n url?: string,\r\n permission?: string,\r\n external?: boolean,\r\n target?: string,\r\n documentTypeId?: number,\r\n icon?: any\r\n}\r\n\r\ninterface IMenuTile extends IMenuItem {\r\n modulePrefix: string,\r\n permission?: string\r\n}\r\n\r\nvar toggle: () => void;\r\n\r\nconst LinkAndClose = ({ ...props }) => (\r\n \r\n);\r\n\r\nconst CreateMenuForAppModule = (appMod: IApplicationModule): IMenuItem => {\r\n return {\r\n title: appMod.title,\r\n className: appMod.className,\r\n url: appMod.url,\r\n icon: appMod.icon,\r\n children: appMod.children?.filter(c => ((c.hideInMenuTile ?? false) === false)).map(c => CreateMenuForAppModule(c))\r\n } as IMenuItem;\r\n};\r\n\r\nconst AdministrationTileData = {\r\n title: \"Administration\",\r\n className: \"administration\",\r\n modulePrefix: \"um\",\r\n icon: Settings,\r\n children: [\r\n {\r\n title: UserManagementModule.title,\r\n className: UserManagementModule.className,\r\n url: UserManagementModule.url,\r\n icon: UserManagementModule.icon\r\n },\r\n {\r\n title: \"Document Management\",\r\n className: \"document-management\",\r\n url: DocumentManagementDocumentView.url,\r\n icon: DocumentManagementDocumentView.icon\r\n },\r\n CreateMenuForAppModule(GeneralAdministrationModule)\r\n ]\r\n} as IMenuTile;\r\n\r\nconst CreateTileForDocumentModule = (docs: IDocumentModule) => {\r\n let children = docs.filters.map(dt => {\r\n return {\r\n documentTypeId: dt.id,\r\n title: dt.name,\r\n className: dt.className,\r\n url: dt.url,\r\n icon: dt.icon,\r\n children: dt.subFilters?.map(st => {\r\n return {\r\n title: st.name,\r\n className: st.className,\r\n url: st.url,\r\n icon: st.icon\r\n } as IMenuItem\r\n })\r\n }\r\n }) as IMenuItem[];\r\n\r\n\r\n let tiles = {\r\n title: docs.name,\r\n className: getClassName(docs),\r\n modulePrefix: docs.prefix,\r\n url: docs.url,\r\n icon: docs.icon,\r\n children: children,\r\n maxDisplayedChildren: docs.maxDisplayed\r\n } as IMenuTile;\r\n\r\n return tiles;\r\n};\r\n\r\nconst RailRulebookTileData = CreateTileForDocumentModule(RailRulebookDocumentModule);\r\n\r\nconst RailDocumentsTileData = CreateTileForDocumentModule(RailDocumentDocumentModule);\r\n\r\nconst FatigueAssessmentTileData = {\r\n title: \"Fatigue Assessment\",\r\n className: \"fatigue-assessment\",\r\n modulePrefix: \"fa\",\r\n icon: FatigueAssessmentIcon,\r\n url: fatigueAssessmentRoute.path,\r\n children: [\r\n {\r\n title: fatigueAssessmentBlankFormRoute.breadCrumb,\r\n icon: FatigueAssessmentIcon,\r\n url: fatigueAssessmentBlankFormRoute.path\r\n },\r\n {\r\n title: fatigueAssessmentOnBehalfRoute.breadCrumb,\r\n icon: FatigueAssessmentIcon,\r\n url: fatigueAssessmentOnBehalfRoute.path,\r\n permission: fatigueAssessmentOnBehalfRoute.permission\r\n },\r\n {\r\n title: fatigueAssessmentAssignRoute.breadCrumb,\r\n icon: FatigueAssessmentIcon,\r\n url: fatigueAssessmentAssignRoute.path,\r\n permission: fatigueAssessmentAssignRoute.permission\r\n },\r\n {\r\n title: fatigueAssessmentDashboardPathRoute.breadCrumb,\r\n icon: FatigueAssessmentIcon,\r\n url: fatigueAssessmentDashboardPathRoute.path,\r\n permission: fatigueAssessmentDashboardPathRoute.permission\r\n }\r\n ]\r\n} as IMenuTile;\r\n\r\nconst ReportingTileData = {\r\n title: \"Reporting\",\r\n className: \"reporting\",\r\n modulePrefix: \"rm\",\r\n icon: ReportingIcon,\r\n children: [\r\n {\r\n title: \"User / Document reporting\",\r\n url: \"/reporting/user-document\",\r\n permission: \"web.admin.user.reporting\",\r\n icon: ReportingIcon\r\n },\r\n {\r\n title: \"Fatigue Assessment reporting\",\r\n url: \"/reporting/fatigue-assessment\",\r\n permission: \"web.admin.fatigue-assessment.shift-summary-dashboard\",\r\n icon: ReportingIcon\r\n },\r\n {\r\n title: \"Login History reporting\",\r\n url: \"/reporting/login-history\",\r\n permission: \"web.admin.user.reporting\",\r\n icon: ReportingIcon\r\n }\r\n\r\n ]\r\n} as IMenuTile;\r\n\r\nconst toApplicationMenuItem = (app: IApplicationItem) => {\r\n return {\r\n title: app.name,\r\n className: \"ql\" + app.className,\r\n url: app.url,\r\n external: true,\r\n target: \"_blank\",\r\n icon: app.icon\r\n } as IMenuItem;\r\n};\r\n\r\nconst ApplicationTileData = {\r\n title: \"Apps\",\r\n className: \"applications\",\r\n modulePrefix: \"am\",\r\n icon: AppsIcon,\r\n children: ApplicationData.filter(app => app.url).map(toApplicationMenuItem)\r\n} as IMenuTile;\r\n\r\nconst toQuickLinkMenuItem = (ql: IQuickLinkItem) => {\r\n return {\r\n title: ql.title,\r\n className: \"ql\" + ql.className,\r\n url: ql.url,\r\n external: ql.url.startsWith(\"http\"),\r\n target: \"_blank\",\r\n icon: ql.icon\r\n } as IMenuItem;\r\n};\r\n\r\nconst QuickLinksTileData = {\r\n title: \"Quick Links\",\r\n className: \"quick-links\",\r\n modulePrefix: \"ql\",\r\n icon: QuickLinksIcon,\r\n children: QuickLinksData.map(toQuickLinkMenuItem)\r\n} as IMenuTile;\r\n\r\nconst MenuItem = (props: { item: IMenuItem }) => {\r\n const Icon = props.item.icon;\r\n\r\n const hasPermission = () => {\r\n var perm = userHasPermission(props.item.permission);\r\n return perm;\r\n }\r\n\r\n return (\r\n <>\r\n {hasPermission() &&\r\n
  • \r\n
    \r\n {Icon &&\r\n \r\n }\r\n\r\n {props.item.external &&\r\n \r\n {props.item.title}\r\n \r\n }\r\n {!props.item.external &&\r\n\r\n \r\n {props.item.title}\r\n \r\n }\r\n
    \r\n {props.item.children &&\r\n
      \r\n {props.item.children.filter(c => (c.hideInMenuTile ?? false === false)).map((subItem, idx) =>\r\n )}\r\n
    \r\n }\r\n
  • \r\n }\r\n \r\n )\r\n};\r\n\r\nconst MenuPanel = (props: { item: IMenuTile }) => {\r\n const Icon = props.item.icon;\r\n\r\n const documentTypeAllowed = (docTypeId: number | undefined) => {\r\n if (!docTypeId) {\r\n return true;\r\n }\r\n\r\n let isAllowed = useAllDocumentTypes().some(type => type.typeId === docTypeId);\r\n return isAllowed;\r\n }\r\n\r\n const hasPermission = () => {\r\n var perm = userHasPermission(props.item.permission);\r\n return perm;\r\n }\r\n\r\n const viewAllItem = {\r\n title: 'View all...',\r\n url: props.item.url,\r\n icon: props.item.icon\r\n } as IMenuItem;\r\n\r\n const menuItems = () => {\r\n if (!props?.item?.children) {\r\n return [] as IMenuItem[];\r\n }\r\n\r\n let items = props.item.children\r\n .filter(c =>\r\n (c.hideInMenuTile ?? false === false) &&\r\n documentTypeAllowed(c.documentTypeId)\r\n );\r\n\r\n if (props.item.maxDisplayedChildren && items.length > props.item.maxDisplayedChildren) {\r\n items = items.slice(0, props.item.maxDisplayedChildren);\r\n items.push(viewAllItem);\r\n }\r\n\r\n return items;\r\n }\r\n\r\n return (\r\n <>\r\n {hasPermission() &&\r\n
    \r\n
    \r\n
    \r\n \r\n\r\n {props.item.url &&\r\n {props.item.title}\r\n }\r\n\r\n {!props.item.url &&\r\n {props.item.title}\r\n }\r\n
    \r\n\r\n
      \r\n {menuItems().map((subItem, idx) =>\r\n \r\n )}\r\n
    \r\n\r\n
    \r\n
    \r\n }\r\n \r\n );\r\n};\r\n\r\ninterface IMenuTileProps {\r\n item: IMenuTile,\r\n currentMenu: string,\r\n setCurrentMenu: (name: string) => void,\r\n largeTile?: boolean,\r\n columns: GridSize\r\n}\r\n\r\nconst MenuTile = (props: IMenuTileProps) => {\r\n const Icon = props.item.icon;\r\n\r\n const isExpanded = () => (props.currentMenu === props.item.title);\r\n\r\n const toggle = () => {\r\n if (isExpanded()) {\r\n props.setCurrentMenu(\"\");\r\n } else {\r\n props.setCurrentMenu(props.item.title);\r\n }\r\n };\r\n\r\n return (\r\n \r\n
    \r\n
    \r\n \r\n
    {props.item.title}
    \r\n
    {isExpanded() ? : }
    \r\n
    \r\n \r\n
    \r\n
    \r\n );\r\n};\r\n\r\nconst NavMenu = (props: NavMenuProps) => {\r\n const size = ((props.admin || false) ? 3 : 4) as GridSize;\r\n toggle = props.onFollowLink;\r\n const [currentMenu, setCurrentMenu] = useState(\"\");\r\n\r\n return (\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n {props.admin &&\r\n \r\n }\r\n\r\n {props.admin &&\r\n \r\n }\r\n\r\n \r\n\r\n \r\n \r\n );\r\n}\r\n\r\nexport default NavMenu;","import React from 'react';\r\nimport { BehaviorSubject } from 'rxjs';\r\nimport { Notifications } from 'shared/models/api/models';\r\n\r\nexport type NotificationsState = {\r\n stateNotifications: Notifications,\r\n requireRefresh: boolean,\r\n loading: boolean\r\n}\r\n\r\nconst initialState: NotificationsState = {\r\n stateNotifications: {} as Notifications,\r\n requireRefresh: true,\r\n loading: false\r\n};\r\n\r\nconst notificationsStateSubject = new BehaviorSubject(initialState);\r\n\r\nexport const notificationsState = {\r\n subscribe: (setState: any) => notificationsStateSubject.subscribe(setState),\r\n\r\n setNotifications: (notifications: Notifications) => {\r\n var newState = notificationsStateSubject.getValue();\r\n newState.stateNotifications = notifications;\r\n notificationsStateSubject.next(newState);\r\n },\r\n\r\n setRequireRefresh: (refresh: boolean) => {\r\n var newState = notificationsStateSubject.getValue();\r\n newState.requireRefresh = refresh;\r\n notificationsStateSubject.next(newState);\r\n },\r\n\r\n setLoading: (loading: boolean) => {\r\n var newState = notificationsStateSubject.getValue();\r\n newState.loading = loading;\r\n notificationsStateSubject.next(newState);\r\n }\r\n}\r\n","export enum DocumentNotifyTypeEnum {\r\n InitialDocument = 0,\r\n VersionUpdate = 1,\r\n Rescinded = 2,\r\n Restored = 3,\r\n Deleted = 4,\r\n Review = 50\r\n}\r\n","import { DocumentNotifyTypeEnum } from 'shared/enums/document-notify-type-enum';\r\n\r\nexport type INotificationCardProps = {\r\n index: number,\r\n id: number,\r\n time: Date,\r\n clickAction: any,\r\n faId?: number,\r\n documentId?: number,\r\n documentTitle?: string,\r\n documentNotifyType?: DocumentNotifyTypeEnum\r\n}\r\n\r\nexport const getCardBodyText = (props: INotificationCardProps): string => {\r\n if (typeof (props.faId) === 'number' && props.faId > 0) {\r\n return 'You have been assigned to complete a Fatigue Assessment form. Click here to fill and submit the form.';\r\n }\r\n\r\n if (typeof (props.documentId) === 'number' && props.documentId > 0 && props.documentNotifyType === DocumentNotifyTypeEnum.InitialDocument) {\r\n return `${props.documentTitle} has been published. Please read and acknowledge the document.`;\r\n }\r\n\r\n if (typeof (props.documentId) === 'number' && props.documentId > 0 && props.documentNotifyType === DocumentNotifyTypeEnum.VersionUpdate) {\r\n return `New version added for ${props.documentTitle}. Please read and acknowledge the new version.`;\r\n }\r\n\r\n if (typeof (props.documentId) === 'number' && props.documentId > 0 && props.documentNotifyType === DocumentNotifyTypeEnum.Rescinded) {\r\n return `${props.documentTitle} has been rescinded. Please read and acknowledge the replacement document.`;\r\n }\r\n\r\n if (typeof (props.documentId) === 'number' && props.documentId > 0 && props.documentNotifyType === DocumentNotifyTypeEnum.Restored) {\r\n return `The previous version of ${props.documentTitle} has been restored. Please review the document.`;\r\n }\r\n\r\n if (typeof (props.documentId) === 'number' && props.documentId > 0 && props.documentNotifyType === DocumentNotifyTypeEnum.Review) {\r\n return `${props.documentTitle} is up for a periodic review. Please review and re-acknowledge.`;\r\n }\r\n\r\n return '';\r\n}\r\n\r\nexport const getTimeDiffText = (props: INotificationCardProps): string => {\r\n let timeDiff = ((new Date()).valueOf() - new Date(props.time).valueOf()) / 60000;\r\n let timeDesc = 'day';\r\n\r\n if (timeDiff < 1) {\r\n return 'Just now';\r\n }\r\n\r\n if (timeDiff < 60) {\r\n timeDesc = 'minute';\r\n }\r\n\r\n else if ((timeDiff = timeDiff / 60) < 24) {\r\n timeDesc = 'hour';\r\n }\r\n\r\n else {\r\n timeDiff = timeDiff / 24;\r\n }\r\n\r\n timeDiff = Math.round(timeDiff);\r\n\r\n if (timeDiff !== 1) {\r\n timeDesc += 's';\r\n }\r\n\r\n return timeDiff + ' ' + timeDesc;\r\n}","import React from 'react';\r\nimport { useState, useEffect } from 'react';\r\nimport \"./UserMenu.css\";\r\nimport { AccessTime, AnnouncementOutlined, NotificationsActive, ExpandMore } from '@material-ui/icons';\r\nimport { getNotifications } from \"shared/services/railDocumentsApi\";\r\nimport { useHistory } from \"react-router-dom\"\r\nimport { Notifications } from 'shared/models/api/models';\r\nimport { notificationsState, NotificationsState } from \"./NotificationsState\";\r\nimport { getTimeDiffText, getCardBodyText, INotificationCardProps } from 'shared/notifications/helpers';\r\nimport { fatigueAssessmentFormUrl } from 'components/ui/FatigueAssessmentRules';\r\n\r\n\r\nimport {\r\n\r\n UncontrolledDropdown,\r\n DropdownToggle,\r\n DropdownMenu,\r\n DropdownItem\r\n\r\n} from 'reactstrap';\r\nimport { MyDocumentsDocumentView } from '../ui/DocumentRules';\r\n\r\nexport default () => {\r\n const [stateNotifications, setStateNotifications] = useState({} as Notifications);\r\n const [loading, setLoading] = useState(false);\r\n const [requireRefresh, setRequireRefresh] = useState(true);\r\n const [lastCheckedTime, setLastCheckedTime] = useState(new Date());\r\n\r\n const maxNotificationsInView: number = 8;\r\n\r\n const history = useHistory();\r\n\r\n const getNotificationsForMenu = async () => {\r\n notificationsState.setLoading(true);\r\n notificationsState.setRequireRefresh(false);\r\n\r\n getNotifications()\r\n .then(notifications => {\r\n notificationsState.setNotifications(notifications);\r\n });\r\n\r\n notificationsState.setLoading(false);\r\n };\r\n\r\n const notificationCount = () => {\r\n const faCount = stateNotifications?.fatigueAssessments?.length || 0;\r\n const docCount = stateNotifications?.documentNotifications?.length || 0;\r\n return faCount + docCount;\r\n };\r\n\r\n useEffect(() => {\r\n const notificationsStateSubscribe = notificationsState.subscribe((s: NotificationsState) => {\r\n setStateNotifications(s.stateNotifications);\r\n setLastCheckedTime(new Date());\r\n setLoading(s.loading);\r\n setRequireRefresh(s.requireRefresh);\r\n });\r\n\r\n if (requireRefresh && !loading) {\r\n getNotificationsForMenu();\r\n }\r\n\r\n return () => {\r\n notificationsStateSubscribe.unsubscribe();\r\n };\r\n }, [stateNotifications, loading, requireRefresh]);\r\n\r\n const EmptyNotifications = () => (\r\n \r\n
    \r\n
    There are currently no updates published.
    \r\n
    Check back in later.
    \r\n
    \r\n );\r\n\r\n const navigateToFatigueAssessment = (id: number) => {\r\n history.push(fatigueAssessmentFormUrl(id));\r\n }\r\n\r\n const navigateToDocument = (id: number) => {\r\n history.push('/pdf/view/' + id);\r\n }\r\n\r\n const NotificationsList = () => {\r\n const faCount: number = stateNotifications?.fatigueAssessments?.length || 0;\r\n return (\r\n <>\r\n {stateNotifications?.fatigueAssessments?.map((faNotification, index) =>\r\n navigateToFatigueAssessment(faNotification.id)}\r\n faId={faNotification.id}\r\n >\r\n )}\r\n\r\n {stateNotifications?.documentNotifications?.map((docNotification, index) =>\r\n navigateToDocument(docNotification.documentId)}\r\n documentId={docNotification.documentId}\r\n documentTitle={docNotification.documentTitle}\r\n documentNotifyType={docNotification.notifyType}\r\n >\r\n )}\r\n\r\n \r\n\r\n
    \r\n See all notifications\r\n
    \r\n
    \r\n\r\n \r\n )\r\n };\r\n\r\n const NotificationCard = (props: INotificationCardProps) => {\r\n if (props.index >= maxNotificationsInView) {\r\n return <>;\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 {getCardBodyText(props)}\r\n
    \r\n
    \r\n {getTimeDiffText(props)}\r\n
    \r\n
    \r\n
    \r\n
    \r\n )\r\n };\r\n\r\n const checkNotificationUpdateTimer = () => {\r\n //If notifications haven't been checked in this past time period, then check now\r\n const checkNotificationsMins = 1;\r\n\r\n //1000ms * 60s * checkNotificationsMins\r\n if (new Date().getTime() - lastCheckedTime.getTime() > 1000 * 60 * checkNotificationsMins) {\r\n setLastCheckedTime(new Date());\r\n setRequireRefresh(true);\r\n }\r\n }\r\n\r\n const AllNotificationsRedirect = () => {\r\n history.push(MyDocumentsDocumentView.url);\r\n }\r\n\r\n return (\r\n \r\n \r\n Notifications\r\n \r\n \r\n {notificationCount() > 0\r\n ?\r\n \r\n :\r\n \r\n }\r\n \r\n );\r\n}\r\n","import * as React from 'react';\r\n\r\ninterface IAnimatedSvgProps {\r\n percentComplete: number,\r\n className?: string\r\n}\r\n\r\nexport const Hamburger = (props: IAnimatedSvgProps) => {\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 Menu\r\n \r\n );\r\n};\r\n\r\ninterface IAnimatedProps {\r\n duration: number,\r\n startTicks: number,\r\n reverse: boolean,\r\n onComplete: () => void,\r\n className: string,\r\n steps?: number\r\n}\r\n\r\nexport const AnimatedHamburger = (props: IAnimatedProps) => {\r\n const [percentageComplete, setPercentageComplete] = React.useState(1);\r\n const currentTicks = () => new Date().getTime();\r\n var interval: NodeJS.Timeout | null;\r\n\r\n const getPercentComplete = () => {\r\n var pct = props.duration === 0 ? 1 : (currentTicks() - props.startTicks) / props.duration;\r\n\r\n return pct > 1 ? 1 : pct < 0 ? 0 : pct;\r\n };\r\n\r\n const stop = () => {\r\n if (interval) {\r\n clearInterval(interval);\r\n }\r\n\r\n props.onComplete();\r\n };\r\n\r\n const animate = () => {\r\n var pct = getPercentComplete();\r\n\r\n if (pct > 1) {\r\n stop();\r\n setPercentageComplete(1);\r\n } else {\r\n setPercentageComplete(pct < 0 ? 0 : pct);\r\n }\r\n };\r\n\r\n const start = () => {\r\n if (!interval && (props.startTicks + props.duration) > currentTicks()) {\r\n interval = setInterval(animate, props.duration / (props.steps ?? 10));\r\n }\r\n\r\n return stop;\r\n }\r\n\r\n React.useEffect(start, [props.startTicks, props.reverse]);\r\n\r\n return ()\r\n};","import React, { ReactNode, useEffect, useState } from 'react';\r\nimport { Navbar, NavbarBrand, Nav } from 'reactstrap';\r\nimport useSelector from 'hooks/useSelector';\r\nimport './NavBar.css';\r\nimport { ReactComponent as Logo } from \"../../assets/icons/bhp-logo.svg\";\r\nimport UserMenu from \"./UserMenu\";\r\nimport NavMenuComp from \"./NavMenu\";\r\nimport NotificationsMenu from \"./NotificationsMenu\";\r\nimport { Link } from 'react-router-dom';\r\nimport { Menu, Close } from '@material-ui/icons';\r\nimport useRoles from \"hooks/useRoles\"\r\nimport { AnimatedHamburger } from \"../ui/Hamburger\";\r\n\r\nconst NavMenu = (props: { show: boolean, toggle: () => void }) => {\r\n const roleInfo = useRoles();\r\n\r\n const handleClick = (e: React.MouseEvent | React.TouchEvent) => {\r\n if (e.target === e.currentTarget) {\r\n // user clicked outside the titles\r\n if (props.show) props.toggle();\r\n }\r\n };\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n}\r\n\r\nconst FloatingMenu = (props: { isOpen: boolean, toggle: () => void }) => {\r\n const [startTicks, setStartTicks] = useState(0);\r\n\r\n const toggle = () => {\r\n setStartTicks(new Date().getTime());\r\n };\r\n\r\n const onCompleteAnimation = () => {\r\n props.toggle();\r\n };\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n};\r\n\r\nconst NavBar = () => {\r\n const [scrolledPastHeader, setScrolledPastHeader] = useState(false);\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [isTouch, setIsTouch] = useState(false);\r\n\r\n const profile = useSelector(state => state.profile);\r\n\r\n const toggleMenu = () => {\r\n setIsOpen(!isOpen)\r\n };\r\n\r\n const touched = () => {\r\n setIsTouch(true);\r\n toggleMenu();\r\n };\r\n\r\n const clicked = () => {\r\n setIsTouch(false);\r\n toggleMenu();\r\n };\r\n\r\n useEffect(() => {\r\n const onScroll = (e: Event) => {\r\n const scrollTop = window.scrollY;\r\n\r\n if (scrollTop >= 30 && !scrolledPastHeader) {\r\n setScrolledPastHeader(true);\r\n }\r\n\r\n if (scrollTop < 30 && scrolledPastHeader) {\r\n setScrolledPastHeader(false);\r\n }\r\n };\r\n\r\n document.addEventListener(\"scroll\", onScroll);\r\n\r\n return () => {\r\n document.removeEventListener(\"scroll\", onScroll);\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 {isOpen && }\r\n {!isOpen && }\r\n Menu\r\n \r\n \r\n\r\n \r\n\r\n \r\n {profile?.id &&\r\n \r\n }\r\n
    \r\n );\r\n}\r\n\r\nexport default NavBar;\r\n","import * as React from 'react';\r\nimport './Footer.css';\r\nimport { ArrowUpward } from '@material-ui/icons';\r\n\r\nconst scrollToTop = () => {\r\n if (document.body.scrollTop) {\r\n document.body.scrollTop = 0;\r\n return;\r\n }\r\n\r\n if (document.documentElement.scrollTop) {\r\n document.documentElement.scrollTop = 0;\r\n return;\r\n }\r\n};\r\n\r\nexport default () => (\r\n
    \r\n
    \r\n
    \r\n
    {\"BHP \" + (new Date().getFullYear())}
    \r\n
    \r\n\r\n
    \r\n \r\n
    Go to the top
    \r\n
    \r\n
    \r\n
    \r\n);","import React from 'react';\r\nimport useSelector from 'hooks/useSelector';\r\nimport './LoadingSplash.css';\r\n\r\n\r\nexport const LoadingSplash = () => {\r\n const profile = useSelector(state => state.profile);\r\n\r\n return (\r\n
    \r\n );\r\n}\r\n\r\nexport default LoadingSplash;\r\n","import React, { useEffect, useState } from 'react';\r\n\r\ninterface IBreakpoint {\r\n name: string,\r\n isMobile: boolean,\r\n isDesktop: boolean,\r\n isTablet: boolean,\r\n minWidth: number,\r\n maxWidth: number,\r\n nextBreakpoint?: IBreakpoint,\r\n previousBreakpoint?: IBreakpoint\r\n}\r\n\r\nconst Breakpoints = [] as IBreakpoint[];\r\n\r\nBreakpoints.push({ name: \"xs\", isMobile: true, isTablet: false, isDesktop: false, minWidth: 1, maxWidth: 414 });\r\nBreakpoints.push({ name: \"sm\", isMobile: true, isTablet: false, isDesktop: false, minWidth: 415, maxWidth: 600 });\r\nBreakpoints.push({ name: \"md\", isMobile: false, isTablet: true, isDesktop: false, minWidth: 601, maxWidth: 800 });\r\nBreakpoints.push({ name: \"lg\", isMobile: false, isTablet: true, isDesktop: true, minWidth: 801, maxWidth: 1024 });\r\nBreakpoints.push({ name: \"xl\", isMobile: false, isTablet: false, isDesktop: true, minWidth: 1025, maxWidth: 1440 });\r\nBreakpoints.push({ name: \"xxl\", isMobile: false, isTablet: false, isDesktop: true, minWidth: 1441, maxWidth: 999999999 });\r\n\r\nBreakpoints.forEach(bp => {\r\n bp.nextBreakpoint = Breakpoints.find(f => f.minWidth === bp.maxWidth + 1);\r\n bp.previousBreakpoint = Breakpoints.find(f => f.maxWidth === bp.minWidth - 1);\r\n});\r\n\r\nexport const useBreakpoint = () => {\r\n const getBreakpoint = () => {\r\n var bp = Breakpoints.find(i => i.minWidth <= innerWidth && i.maxWidth > window.innerWidth);\r\n\r\n if (!bp) {\r\n console.log(\"no breakpoint for \" + window.innerWidth);\r\n }\r\n\r\n return bp;\r\n }\r\n\r\n const [currentBreakpoint, setCurrentBreakpoint] = useState(getBreakpoint());\r\n\r\n useEffect(() => {\r\n const onResize = () => {\r\n var bp = getBreakpoint();\r\n\r\n if (!(bp?.name === currentBreakpoint?.name)) {\r\n setCurrentBreakpoint(bp);\r\n }\r\n };\r\n\r\n window.addEventListener('resize', onResize);\r\n\r\n return () => {\r\n window.removeEventListener('resize', onResize);\r\n }\r\n });\r\n\r\n return currentBreakpoint;\r\n};","import * as React from 'react';\r\nimport { Container } from 'reactstrap';\r\nimport NavBar from \"./menu/NavBar\";\r\nimport Footer from './Footer';\r\nimport LoadingSplash from 'components/ui/LoadingSplash'\r\nimport { useBreakpoint } from 'hooks/useBreakpoint';\r\n\r\nconst GridlLineOverlay = (props: { gridSize: number }) => {\r\n const rows = Math.ceil(window.innerHeight / props.gridSize);\r\n const cols = Math.ceil(window.innerWidth / props.gridSize);\r\n\r\n return (\r\n \r\n {rows > 1 && [...Array(rows)].map((r, index) =>\r\n \r\n )}\r\n\r\n {cols > 1 && [...Array(cols)].map((c, index) =>\r\n \r\n )}\r\n \r\n )\r\n};\r\n\r\nexport default (props: { children?: React.ReactNode }) => {\r\n const breakpoint = useBreakpoint();\r\n\r\n return (\r\n
    \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","//https://github.com/tappyy/react-IS4-auth-demo\r\nimport React, { useEffect, useRef } from 'react';\r\nimport { applicationState } from 'shared/store/applicationState';\r\nimport { UserManager } from 'oidc-client';\r\nimport { userMapper } from 'overrides/mapping/user-mapping'\r\n\r\nexport default function AuthProvider(props: { userManager: UserManager , children: any, onUserLoaded?: () => void }) {\r\n\r\n let userManager = useRef(null);\r\n\r\n useEffect(() => {\r\n userManager.current = props.userManager;\r\n\r\n const onUserLoaded = (oidcUser: any) => {\r\n if (oidcUser) {\r\n const user = userMapper.mapFromOIDCUser(oidcUser);\r\n applicationState.setUser(user);\r\n }\r\n if (props.onUserLoaded) props?.onUserLoaded();\r\n }\r\n\r\n const onUserUnloaded = () => {\r\n console.log(`user unloaded`);\r\n applicationState.setUser(undefined);\r\n }\r\n\r\n const onAccessTokenExpiring = () => {\r\n console.log(`user token expiring`);\r\n userManager?.current?.signinSilent();\r\n }\r\n\r\n const onAccessTokenExpired = () => {\r\n console.log(`user token expired`);\r\n applicationState.setUser(undefined);\r\n userManager?.current?.signinRedirect();\r\n }\r\n\r\n const onUserSignedOut = () => {\r\n console.log(`user signed out`);\r\n applicationState.setUser(undefined);\r\n userManager?.current?.signinRedirect();\r\n }\r\n\r\n const onSilentRenewError = (error: Error) => {\r\n console.log(`Silent renew caused an error ` + error.message);\r\n console.log(error);\r\n applicationState.setUser(undefined);\r\n userManager?.current?.signinRedirect();\r\n }\r\n\r\n // events for user\r\n\r\n if (userManager) {\r\n userManager?.current?.events.addUserLoaded(onUserLoaded);\r\n userManager?.current?.events.addUserUnloaded(onUserUnloaded);\r\n userManager?.current?.events.addAccessTokenExpiring(onAccessTokenExpiring);\r\n userManager?.current?.events.addAccessTokenExpired(onAccessTokenExpired);\r\n userManager?.current?.events.addUserSignedOut(onUserSignedOut);\r\n userManager?.current?.events.addSilentRenewError(onSilentRenewError);\r\n }\r\n\r\n // Specify how to clean up after this effect:\r\n return function cleanup() {\r\n if (userManager) {\r\n userManager?.current?.events.removeUserLoaded(onUserLoaded);\r\n userManager?.current?.events.removeUserUnloaded(onUserUnloaded);\r\n userManager?.current?.events.removeAccessTokenExpiring(onAccessTokenExpiring);\r\n userManager?.current?.events.removeAccessTokenExpired(onAccessTokenExpired);\r\n userManager?.current?.events.removeUserSignedOut(onUserSignedOut);\r\n userManager?.current?.events.removeSilentRenewError(onSilentRenewError);\r\n }\r\n };\r\n }, [props.userManager]);\r\n\r\n return (\r\n React.Children.only(props.children)\r\n )\r\n}","import * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { Routes } from \"./utils/ProtectedRoute\";\r\nimport Layout from './components/Layout';\r\nimport userManager, { loadUserFromStorage } from 'shared/services/userService';\r\nimport { loadDocumentTypes } from 'shared/services/documentTypeService';\r\nimport appSettings from 'shared/settings/appSettings';\r\nimport { initRelatedDocs } from 'components/ui/DocumentRules';\r\nimport AuthProvider from 'authProvider';\r\nimport './assets/css/formatting.css'\r\nimport './assets/css/typography.css'\r\nimport './assets/css/colors.css';\r\nimport './assets/css/custom.css';\r\nimport { configure } from 'shared/helpers/colorManager';\r\nimport useSelector from 'hooks/useSelector';\r\n\r\nconfigure();\r\n\r\nexport default () => {\r\n var initialised: boolean = false;\r\n const profile = useSelector(state => state.profile);\r\n\r\n const initiailiseState = async () => {\r\n if (!initialised && profile?.id) {\r\n await loadDocumentTypes();\r\n await initRelatedDocs();\r\n initialised = true;\r\n }\r\n\r\n };\r\n\r\n useEffect(() => {\r\n // fetch current user from cookies\r\n loadUserFromStorage();\r\n const mount = async () => {\r\n const user = await userManager.getUser();\r\n if (user)\r\n initiailiseState();\r\n }\r\n mount();\r\n\r\n }, [profile]);\r\n\r\n useEffect(() => {\r\n document.title = `BHP Rail Portal${appSettings.environmentIndicator}`;\r\n }, []);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,\r\n ),\r\n);\r\n\r\nexport default function register() {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const url = process.env.PUBLIC_URL as string;\r\n const publicUrl = new URL(url, window.location.toString());\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing as ServiceWorker;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.',\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\n//import { Provider } from 'react-redux';\r\n//import { ConnectedRouter } from 'connected-react-router';\r\nimport { Router} from 'react-router-dom';\r\nimport { createBrowserHistory } from 'history';\r\nimport App from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\n\r\n\r\n// Create browser history to use in the Redux store\r\n// const baseUrl = document\r\n// .getElementsByTagName('base')[0]\r\n// .getAttribute('href') as string;\r\nconst history = createBrowserHistory();\r\n\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\n//const store = configureStore(history);\r\n\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n ,\r\n document.getElementById('root'),\r\n);\r\n\r\n\r\nregisterServiceWorker();\r\n"],"sourceRoot":""}