{"version":3,"sources":["../src sync /^/images.*$","images/BM_Dashboard_LogoBG.png","images/beaconHome.jpg","images/icons/BM_Admin.svg","images/icons/BM_Alerts.png","images/icons/BM_Alerts.svg","images/icons/BM_Billing.svg","images/icons/BM_Brand.svg","images/icons/BM_Customers.svg","images/icons/BM_Dashboard.svg","images/icons/BM_Documents.svg","images/icons/BM_Facility.svg","images/icons/BM_Home.svg","images/icons/BM_InspectionStatus.svg","images/icons/BM_Inventory.svg","images/icons/BM_JobComments.svg","images/icons/BM_Jobs.svg","images/icons/BM_Leads.svg","images/icons/BM_Locations.svg","images/icons/BM_MaintenanceCodes.svg","images/icons/BM_ManageAllTraining.png","images/icons/BM_ManageJobs.png","images/icons/BM_ManageLocations.png","images/icons/BM_ManageProducts.svg","images/icons/BM_ManageTeam.svg","images/icons/BM_ManageTraining.png","images/icons/BM_ManageUsers.svg","images/icons/BM_Measurement.svg","images/icons/BM_NewUserQueue.svg","images/icons/BM_Payments.png","images/icons/BM_PreventMaint.svg","images/icons/BM_ProductQueue.svg","images/icons/BM_Quotes.svg","images/icons/BM_Reports.svg","images/icons/BM_Sales.svg","images/icons/BM_StandardText.svg","images/icons/BM_TAE.svg","images/icons/BM_Training.svg","images/icons/BM_TrainingProgress.svg","images/icons/BM_WorkOrders.svg","images/icons/CloseMenu.svg","images/icons/alert_red.png","images/icons/gallery.svg","images/icons/select.svg","images/quotesHeader@2x.png","images/products sync /^/.*$","models-enums.tsx","components/auth/MsalInstance.tsx","components/auth/Auth-Utils.tsx","constants/constants.tsx","reducers/initialState.tsx","constants/securityFunctions.tsx","constants/tiles.tsx","components/tutorial/Video.tsx","constants/tutorials.tsx","components/common/CreatableMultiTextInput.tsx","components/common/RichTextEditor.tsx","components/common/SignatureControl.tsx","components/common/FormUtil.tsx","i18n.tsx","helpers/isLocalHost.ts","registerServiceWorker.ts","actions/actionTypes.tsx","actions/ajaxStatusActions.tsx","constants/apiEndpoints.tsx","actions/manageUserAlertActions.tsx","actions/manageUserActions.tsx","helpers/Mixpanel.ts","helpers/cleanObjEmptyStrings.ts","actions/userActions.tsx","actions/tutorialActions.tsx","reducers/measurementPointResultsReducer.tsx","reducers/manageWorkOrderReducer.tsx","reducers/facilitiesReducer.tsx","reducers/manageUserReducer.tsx","reducers/manageJobReducer.tsx","reducers/commonReducers.tsx","actions/commonActions.tsx","actions/manageCodeActions.tsx","components/common/CommonModal.tsx","components/common/WithCommonModal.tsx","components/common/UserBaseConfigControls.tsx","components/header/UserProfileForm.tsx","actions/manageAssetPhotosActions.tsx","actions/manageInventoryActions.tsx","components/header/EditProfileModal.tsx","webpack:///./src/images/icons/BM_Admin.svg?92d9","components/header/HeaderMenu.tsx","reducers/configReducer.tsx","webpack:///./src/images/icons/BM_Alerts.svg?4e3e","webpack:///./src/images/icons/BM_Brand.svg?ed72","webpack:///./src/images/icons/BM_Customers.svg?667c","webpack:///./src/images/icons/BM_Dashboard.svg?0c95","webpack:///./src/images/icons/BM_Documents.svg?0787","webpack:///./src/images/icons/BM_Facility.svg?5a17","webpack:///./src/images/icons/BM_Home.svg?8427","webpack:///./src/images/icons/BM_InspectionStatus.svg?b2e6","webpack:///./src/images/icons/BM_Inventory.svg?8cad","webpack:///./src/images/icons/BM_JobComments.svg?32ec","webpack:///./src/images/icons/BM_Jobs.svg?1962","webpack:///./src/images/icons/BM_Leads.svg?07c7","webpack:///./src/images/icons/BM_Locations.svg?61c9","webpack:///./src/images/icons/BM_StandardText.svg?a51b","webpack:///./src/images/icons/BM_ManageTeam.svg?970c","webpack:///./src/images/icons/BM_ManageUsers.svg?db17","webpack:///./src/images/icons/BM_Measurement.svg?43e5","webpack:///./src/images/icons/BM_NewUserQueue.svg?d8d8","webpack:///./src/images/icons/BM_PreventMaint.svg?fbc9","webpack:///./src/images/icons/BM_ProductQueue.svg?fb8a","webpack:///./src/images/icons/BM_Quotes.svg?2d46","webpack:///./src/images/icons/BM_Reports.svg?3dca","webpack:///./src/images/icons/BM_Sales.svg?a7a6","webpack:///./src/images/icons/BM_TAE.svg?141f","webpack:///./src/images/icons/BM_Training.svg?cd11","webpack:///./src/images/icons/BM_TrainingProgress.svg?6d77","webpack:///./src/images/icons/BM_WorkOrders.svg?65e1","webpack:///./src/images/icons/BM_ManageProducts.svg?3865","webpack:///./src/images/icons/CloseMenu.svg?9d10","constants/svgIcons.tsx","components/header/mobile/DropDownMenu.tsx","components/header/mobile/HeaderMenuMobile.tsx","components/header/Header.tsx","actions/redirectToReferrerAction.tsx","components/auth/Login.tsx","components/auth/UserForm.tsx","components/auth/SignUpDirect.tsx","reducers/userReducer.tsx","actions/measurementPointResultsActions.tsx","actions/shoppingCartActions.tsx","actions/manageWorkOrderActions.tsx","actions/managePartActions.tsx","actions/manageJobActions.tsx","actions/manageDocumentActions.tsx","components/dashboard/InstallBaseActionButtonContainer.tsx","components/dashboard/InstallBaseActionButton.tsx","components/common/Banner.tsx","components/common/SearchTableForm.tsx","actions/countriesActions.tsx","reducers/countriesReducer.tsx","components/common/SelectFacilityForm.tsx","components/common/SelectFacilityContainer.tsx","components/common/TableUtil.tsx","components/dashboard/WorkOrderExpander.tsx","components/common/AddMultiControl.tsx","components/common/mobile/CommonMobileModal.tsx","components/manageWorkOrder/EditWorkOrderForm.tsx","components/manageWorkOrder/EditWorkOrderModal.tsx","components/manageWorkOrder/WorkOrderCloseForm.tsx","components/manageWorkOrder/WorkOrderCloseModal.tsx","components/shoppingCart/ShoppingCartForm.tsx","components/shoppingCart/ShoppingCartModal.tsx","components/common/AssetImage.tsx","components/manageInventory/EditInstallForm.tsx","actions/manageLocationActions.tsx","components/manageInventory/EditInstallModal.tsx","actions/manageProductQueueActions.tsx","components/manageInventory/EditProductForm.tsx","components/manageInventory/EditProductModal.tsx","components/manageInventory/ImportInstallForm.tsx","components/manageInventory/ImportInstallModal.tsx","components/manageInventory/InstallBasesExpander.tsx","components/manageInventory/InstallBasesExpanderContainer.tsx","components/manageInventory/InstallContactForm.tsx","components/manageInventory/InstallContactModal.tsx","components/manageInventory/MPResultHistory.tsx","components/manageInventory/MPResultHistoryModal.tsx","components/manageInventory/MPResultList.tsx","actions/manageMeasurementPointListsActions.tsx","components/manageInventory/MPResultListModal.tsx","components/common/RichTextView.tsx","components/manageInventory/MPResultNotesModal.tsx","components/manageInventory/SearchFacility/SearchFacilityForm.tsx","components/manageInventory/SearchFacility/SearchFacilityContainer.tsx","components/manageInventory/SearchNewFacilityModal.tsx","components/manageInventory/SearchNewProductsForm.tsx","components/manageInventory/SearchNewProductsModal.tsx","components/common/mobile/WithCommonMobileModal.tsx","components/manageInventory/mobile/MPResultHistoryMobileModal.tsx","components/manageInventory/mobile/MPResultListMobileModal.tsx","components/manageInventory/mobile/MPResultNotesMobileModal.tsx","components/manageInventory/mobile/ManageInventoryDetails.tsx","components/manageInventory/ManageInventory.tsx","reducers/cartReducer.tsx","reducers/manageInventoryReducer.tsx","components/dashboard/InstallBaseAnalyticsTableContainer.tsx","actions/manageAlertActions.tsx","components/manageAlert/EditAlertForm.tsx","components/manageAlert/EditAlertModal.tsx","components/manageAlert/ManageAlert.tsx","actions/manageBrandActions.tsx","components/manageBrand/EditBrandForm.tsx","components/common/OtherUtils.tsx","reducers/manageBrandReducer.tsx","components/manageBrand/ManageBrand.tsx","components/manageBrand/EditBrandModal.tsx","components/manageCode/EditCodeForm.tsx","components/manageCode/EditCodeModal.tsx","reducers/manageCodeReducer.tsx","components/manageCode/ManageCode.tsx","reducers/manageCustomerAndFacilityReducer.tsx","actions/manageFacilityActions.tsx","components/common/FacilityContactControl.tsx","components/common/FacilityContractControl.tsx","components/common/EditFacilityForm.tsx","components/common/EditFacilityModal.tsx","components/common/ContactActionButton.tsx","components/common/AddContactsTable.tsx","components/common/AddContactsTableContainer.tsx","components/common/FacilityContactForm.tsx","components/common/FacilityContactModal.tsx","components/common/FacilityContractForm.tsx","components/common/FacilityContractModal.tsx","reducers/productInfoReducer.tsx","components/manageFacility/mergeFacilitiesModal.tsx","components/manageFacility/manageFacility.tsx","components/manageFacility/searchFacilityModal.tsx","components/manageFacilityQueue/manageFacilityQueue.tsx","actions/manageDocumentTypeActions.tsx","components/manageDocumentLibrary/utils/ManageDocumentUtils.ts","components/manageDocumentLibrary/forms/EditDocumentLibraryForm.tsx","components/manageDocumentLibrary/dialogs/EditDocumentLibraryModal.tsx","components/manageDocumentLibrary/ManageDocumentVersionExpander.tsx","components/manageDocumentLibrary/mobile/ManageDocumentVersions.tsx","components/manageDocumentLibrary/dialogs/PreviewDocumentModal.tsx","reducers/documentTypeReducer.tsx","components/manageDocumentLibrary/ManageDocumentLibrary.tsx","components/manageAssetPhotos/ManageAssetPhotos.tsx","components/manageInventory/ManageInventoryContainer.tsx","reducers/managePartReducer.tsx","components/manageJob/EditJobForm.tsx","components/manageJob/ManageJob.tsx","components/manageJob/EditJobModal.tsx","components/manageJob/JobWorkOrderExpanderContainer.tsx","components/manageJob/JobWorkOrderExpander.tsx","actions/manageJobCommentsActions.tsx","components/manageJobComment/EditJobCommentForm.tsx","components/manageJobComment/EditJobCommentContainer.tsx","components/manageJobComment/ManageJobComment.tsx","actions/manageLeadsActions.tsx","components/manageLeads/EditLeadForm.tsx","reducers/manageLeadsReducers.tsx","components/manageLeads/EditLeadModal.tsx","components/manageLeads/LeadInstallBasesExpander.tsx","components/manageLeads/ActionButton.tsx","components/manageLeads/LeadActivityList.tsx","components/manageLeads/LeadActivityListModal.tsx","components/manageLeads/EditLeadActivityForm.tsx","components/manageLeads/ManageLeads.tsx","components/manageLeads/EditLeadActivityModal.tsx","components/manageLeads/LeadsBulkActionsButtonContainer.tsx","components/manageLeads/LeadBulkActionsButton.tsx","actions/manageCustomerQuotesActions.tsx","components/manageQuotes/QuoteForm.tsx","components/manageQuotes/QuoteModal.tsx","components/manageQuotes/QuoteDetailsForm.tsx","components/manageQuotes/QuoteDetailsModal.tsx","reducers/manageCustomerQuotesReducer.tsx","components/manageQuotes/QuoteSalesForm.tsx","components/manageQuotes/manageQuotes.tsx","components/manageQuotes/QuoteSalesModal.tsx","components/manageQuotes/mobile/MobileQuoteModal.tsx","components/manageQuotes/mobile/MobileQuoteSalesModal.tsx","components/manageQuotes/mobile/MobileQuoteDetailsModal.tsx","components/manageLocation/EditLocationForm.tsx","components/manageLocation/EditLocationModal.tsx","reducers/manageLocationReducer.tsx","components/manageLocation/ManageLocation.tsx","components/manageMeasurementPointLists/MeasurementPointList.tsx","components/manageMeasurementPointLists/EditMeasurementPointListForm.tsx","reducers/manageMeasurementPointListsReducer.tsx","components/manageMeasurementPointLists/EditMeasurementPointListModal.tsx","components/manageMeasurementPointLists/EditMeasurementPointListTabForm.tsx","components/manageMeasurementPointLists/EditMeasurementPointListTabModal.tsx","components/manageMeasurementPointLists/EditMeasurementPointListTestProceduresForm.tsx","components/manageMeasurementPointLists/EditMeasurementPointListTestProceduresModal.tsx","components/manageMeasurementPointLists/InputList.tsx","components/manageMeasurementPointLists/EditMeasurementPointForm.tsx","components/manageMeasurementPointLists/EditMeasurementPointModal.tsx","components/manageMeasurementPointLists/ManageMeasurementPointLists.tsx","actions/manageProductActions.tsx","components/manageProduct/ManageProduct.tsx","components/manageProductQueue/ManageProductQueue.tsx","actions/manageReportActions.tsx","components/manageReport/ManageReportModal.tsx","components/manageReport/ManageReport.tsx","actions/manageTeamActions.tsx","components/manageTeam/EditTeamMemberForm.tsx","components/manageTeam/EditTeamMemberModal.tsx","components/manageTeam/ManageTeam.tsx","actions/manageTrainingActions.tsx","components/manageTraining/TrainingDetailModal.tsx","actions/trainingActions.tsx","components/manageTraining/ManageTraining.tsx","components/common/UserTrainingDataListView.tsx","components/common/UserTrainingDataModal.tsx","components/manageUser/EditUserTrainingForm.tsx","components/manageUser/ManageUserChild.tsx","components/manageUser/EditUserUtils.tsx","components/manageUser/EditUserForm.tsx","components/manageUser/EditUserModal.tsx","components/manageUser/SecurityFunctionsList.tsx","components/manageUser/ManageUser.tsx","actions/manageUserQueueActions.tsx","components/manageUserQueue/ManageUserQueue.tsx","components/manageUserQueue/EditQueueUserForm.tsx","components/manageUserQueue/EditQueueUserModal.tsx","models.tsx","components/manageWorkOrder/ConfirmSelectJobForm.tsx","helpers/sapManager.ts","components/manageWorkOrder/ConfirmSelectJobContainer.tsx","components/manageWorkOrder/WorkOrderBulkActionsButtonContainer.tsx","components/manageWorkOrder/WorkOrderBulkActionsButton.tsx","components/manageWorkOrder/WorkOrderBeaconTable.tsx","components/manageWorkOrder/WorkOrderBeaconTableContainer.tsx","components/manageWorkOrder/modals/NewJobForm.tsx","components/manageWorkOrder/modals/NewJobModal.tsx","components/manageWorkOrder/manageWorkOrder.tsx","actions/manageSuggestedPartsActions.tsx","components/manageSuggestedParts/ManageSuggestedParts.tsx","components/manageSuggestedParts/EditSuggestedPartForm.tsx","components/manageSuggestedParts/EditSuggestedPartModal.tsx","components/manageWorkOrder/PreventativeMaintenanceExpanderContainer.tsx","components/manageWorkOrder/PreventativeMaintenancePointExpander.tsx","components/manageWorkOrder/PreventativeMaintenanceTable.tsx","components/manageWorkOrder/PreventativeMaintenanceTableContainer.tsx","components/dashboard/PMPAnalyticsTableLayout.tsx","components/sideMenu/ParentItem.tsx","components/sideMenu/NavSkeleton.ts","components/sideMenu/SideMenu.tsx","components/training/CourseLessons.tsx","actions/trainingQuizActions.tsx","components/training/Lesson.tsx","components/training/Question.tsx","components/training/QuizButton.tsx","components/training/QuizComplete.tsx","components/training/Quiz.tsx","components/training/TrainingBannerContainer.tsx","components/training/TrainingBreadcrumbContainer.tsx","components/training/TrainingBreadcrumb.tsx","components/training/TrainingCheckoutForm.tsx","components/training/TrainingCourse.tsx","components/training/Training.tsx","components/dashboard/mockAnalytics.tsx","components/dashboard/InstallBaseAnalytics.tsx","components/dashboard/InstallBaseAnalyticsContainer.tsx","components/dashboard/PMPAnalytics.tsx","components/dashboard/PMPAnalyticsContainer.tsx","components/dashboard/QuoteAnalytics.tsx","components/dashboard/QuoteAnalyticsContainer.tsx","components/dashboard/Analytics/HourCard.tsx","components/dashboard/Analytics/UnitCard.tsx","components/dashboard/Utilities.ts","helpers/isFloat.ts","components/dashboard/Analytics/AnalyticsToggle.tsx","components/dashboard/Analytics/AnalyticsCard.tsx","helpers/roundTo.ts","reducers/dashboardAnalyticsReducer.tsx","components/dashboard/Analytics/AnalyticsCardContainer.tsx","components/dashboard/DashboardAnalyticsLayout.tsx","components/dashboard/DashboardAnalyticsContainer.tsx","reducers/manageReportReducer.tsx","components/dashboard/Dashboard.tsx","helpers/reactQuery.ts","actions/dashboardAnalyticsActions.tsx","components/dashboard/SmartLinkDetails.tsx","components/dashboard/AnalyticsDetailContainer.tsx","components/dashboard/TaeDetails.tsx","components/dashboard/AnalyticsDetailTaeContainer.tsx","components/dashboard/Analytics/AnalyticsExpandedCard.tsx","components/dashboard/Analytics/AnalyticsExpandedCardContainer.tsx","components/manageReportBuilder/ManageReportTemplateGrid.tsx","components/manageReportBuilder/modals/ManageReportTemplateModal.tsx","components/manageReportBuilder/ManageReportFilter.tsx","components/manageReportBuilder/modals/ManageReportAddChapterModal.tsx","components/manageReportBuilder/ManageReportBuilder.tsx","components/common/TwoPaneLayout.tsx","components/userAlertModal/userAlertModal.tsx","components/skipNav/SkipNav.tsx","components/tutorial/Tutorial.tsx","components/tutorial/TutorialContainer.tsx","components/dashboard/SmartLink.tsx","components/dashboard/SmartLinkContainer.tsx","components/common/MobileProvider.tsx","actions/configActions.tsx","components/auth/AccountPending.tsx","App.tsx","store/TrackJSLogger.tsx","store/migrations.tsx","reducers/ajaxStatusReducer.tsx","reducers/manageDocumentReducer.tsx","reducers/manageAlertReducer.tsx","reducers/manageJobCommentsReducer.tsx","reducers/productsReducer.tsx","reducers/manageProductQueueReducer.tsx","reducers/manageTaeReducer.tsx","reducers/manageTeamReducer.tsx","reducers/manageTrainingReducer.tsx","reducers/manageUserAlertReducer.tsx","reducers/manageUserQueueReducer.tsx","reducers/trainingReducer.tsx","reducers/tutorialReducer.tsx","reducers/manageProductReducer.ts","reducers/manageAssetPhotosReducer.tsx","reducers/manageSuggestedPartsReducer.tsx","reducers/sapJobMappingReducer.tsx","reducers/index.tsx","reducers/redirectToReferrerReducer.tsx","reducers/syncStatusReducer.tsx","store/configureStore.tsx","index.tsx","images/beaconManageUsersHeader.jpg","images/alert.svg","images/trainingProgressTile.jpg","images/trainingProgressHeader.jpg","images/beaconManageTeam.jpg","images/beaconManageTeamHeader.jpg","images/Azure.png","images/quotesTile.jpg","images/quotesHeader.png","images/beaconTraining.jpg","images/beaconTrainingHeader.jpg","images/beaconManageInventory.jpg","images/beaconManageInventoryHeader.jpg","images/reportTile.jpg","images/workOrderHeader.jpg","images/beaconManageProductQueue.jpg","images/beaconManageProductQueueHeader.jpg","images/icons/BM_HelpManual.svg","images/folder.svg","images/Photo_Placeholder.png","images/add.svg","images/icons/BM_Parts.svg","images/icons/Certificate.svg","images/icons/More.svg","images/icons/Preview.svg","images/beaconManageUsers.jpg","images/beaconQueue.jpg","images/beaconQueueHeader.jpg","images/documentTile.jpg","images/documentHeader.jpg","images/customerTile.jpg","images/customerHeader.jpg","images/LocationTile.jpg","images/locationHeader.jpg","images/beaconManageJobs.jpg","images/beaconManageJobsHeader.jpg","images/alertTile.jpg","images/alertHeader.jpg","images/codeTile.jpg","images/codeHeader.jpg","images/workOrderTile.jpg","images/beaconManageProducts.jpeg","images/measurementTile.jpg","images/jobCommentsTile.jpg","images/jobCommentsHeader.jpg","images/icons/alert_blue.png","images/icons/alert_animated.gif","images/BeaconLogo@2x.png","images/MMG Import Template.xlsx","images/MMG SAP Import Template.xlsx","images/icons/alert_gold.png","images/icons/alert_white.png","images/products/01-Pipeline Components.png","images/products/06-Liquid Oxygen System (Oxygen).png","images/products/08-Oxygen Concentrator Systems (Oxygen).png","images/products/AGS System_D2.png","images/products/Gas outlets.png","images/products/Instrument-Surgical (Air).png","images/products/Medical Air Systems (Air).png","images/products/Medical Air-01.png","images/products/Medical Pipeline-01.png","images/products/Medical Vacuum-01.png","images/products/Monitoring.png","images/products/Patient Environment-01.png","images/products/Valves.png","images/products/manifold.png"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","DocumentGroups","leadActivityTypesEnum","measurementPointResultStatusTypesEnum","menuParentKeysEnum","workOrderPartsTypeEnum","measurementPointTypes","jobDefaultTypeEnum","jobStatusEnumForFilter","measurementSystemEnum","facilitySiteSizeEnum","workOrderTypesEnum","workOrderStatusEnum","workOrderStatusEnumForFilter","workOrderResultStatusEnum","workOrderDateRangeUnumForFilter","workOrderPrioritiesEnum","workOrderVendorsEnum","workOrderTabEnum","dateRangeEnum","dataFormatTemperatureEnum","dataFormatEnum","dataUnitEnum","leadTypeEnum","jobStatusEnum","jobTypesIdEnum","jobTypesIdEnumForSelect","jobTypesIdEnumInverse","measurementPointListTypeEnum","measurementPointListTypeForJobEnum","productLinkTypeEnum","reportTypeEnum","reportTypeIdEnum","reportTypeId","myMedGasContractEnum","inspectionContractEnum","productCommunicationMethodEnum","leadStatusEnum","leadStatusEnumSelect","leadRankingEnum","beaconContactTypeEnum","quoteStatusEnum","widgetsEnum","userTypeEnum","userLanguageEnum","userTempUnits","userPressureUnits","UserVacuumUnits","UserPowerUnits","UserFlowUnits","UserCurrency","GraphType","GraphSize","RunStatus","OperatingMode","ReportChapterStatus","ReportChapterType","MsalInstance","msalConfig","auth","clientId","process","authority","knownAuthorities","postLogoutRedirectUri","redirectUri","navigateToLoginRequestUrl","cache","cacheLocation","storeAuthStateInCookie","system","loggerOptions","loggerCallback","level","message","containsPii","LogLevel","Info","Verbose","Warning","debug","piiLoggingEnabled","windowHashTimeout","iframeHashTimeout","loadFrameTimeout","asyncPopups","msalApp","this","PublicClientApplication","addEventCallback","event","eventType","EventType","LOGIN_SUCCESS","payload","idTokenClaims","REACT_APP_MSAL_FORGET_PASSWORD_POLICY","logoutRedirect","account","LOGIN_FAILURE","console","error","document","dispatchEvent","CustomEvent","ACQUIRE_TOKEN_FAILURE","handleRedirectPromise","catch","err","instance","msalInstance","getInstance","freeze","MSAL_SCOPES","MMG","OPENID","loginRequest","scopes","msalRequest","extraQueryParameters","delay","t","Promise","setTimeout","acquireToken","undefined","acquireTokenSilent","noAccountError","errorCode","indexOf","msalAccounts","getAllAccounts","length","setActiveAccount","ClientAuthError","trim","log","ClientConfigurationError","InteractionRequiredAuthError","acquireTokenRedirect","redirectError","DocumentTypesEnum","msalFetch","url","options","isRetry","delayTime","then","authResponse","accessToken","headers","Authorization","Axios","JSON","stringify","initialTableFilters","search","page","initialTableFiltersFrontEndPaging","initialFacilityContract","facilityID","isDeleted","initialFacility","name","name2","address","address2","city","countryID","state","postalCode","buildings","standardID","sapFacilityNumber","preventativeMaintenanceEnabled","managedByID","mgpsSite","authorizedPerson","isApproved","initialProduct","sku","description","imagePath","subcategoryID","brandID","productTypeID","powerID","origin","notes","systemSizeID","installBases","quantity","mergedProductID","isCompliant","hasSpares","isActive","communicationMethod","none","links","isFinalProduct","productStandards","initialInstallBase","productID","measurementPointListResultStatus","workOrderResultStatus","visibleStatus","latestMeasurementPointListResultID","latestWorkOrderID","lastQuarterlyMaintenanceDate","lastSixMonthMaintenanceDate","lastYearlyMaintenanceDate","lastTwoYearMaintenanceDate","lastThreeYearMaintenanceDate","lastFiveYearMaintenanceDate","initialLoc","rooms","floorID","initialContact","firstName","lastName","email","title","phone","mobile","enableNotifications","smartlinkNotifications","contactFacilities","source","initialBuilding","floors","initialFloor","buildingID","locations","initialMeasurementPointResultAnswer","measurementPointID","initialMeasurementPointList","measurementPointTabs","mainCategoryID","type","testProcedures","initialMeasurementPointTab","measurementPoints","order","initialMeasurementPoint","label","isRequired","showInReport","allowNotes","defaultText","generateLead","initialMeasurmentPointResult","status","jobID","installBaseID","measurementPointListID","measurementPointAnswers","compiledNotes","manualOverride","installBaseHistory","initialInstallBaseHistory","date","Date","jobType","workOrderId","initialReport","reportType","coverLetter","headerLogoPath","initialJob","assignedUserID","jobTypeID","startDate","endDate","userJobs","jobNumber","fseNotes","initialLead","leadInstallBases","contactID","createDate","leadActivities","ranking","High","Lost","updateDate","quoteID","partHtml","internalComments","initialLeadPopulated","leadUsers","initialLeadUser","leadID","userID","assignedDueToMissingCoverage","initialQuote","leads","comments","quoteNumber","revision","poNumber","signatureUrl","authorizedName","cloudDocumentID","initialLeadInstallBase","initialJobWorkOrder","workOrderID","initialBrand","isManufacturer","initialDocument","filename","fileSize","mimeType","container","key","facility","version","cloudDocumentTypeID","documentDate","documentID","isSystem","initialDocumentType","initialAlert","text","imageUrl","expirationDate","initialPart","number","installationTime","measurement","initialJobPart","estimated","used","lot","partID","initialJobPartPopulated","part","initialWorkOrder","activityDescription","closingNotes","partsDescription","priority","vendor","productName","parts","sapBusinessIndicator","initialPreventativeMaintenanceChecklist","preventativeMaintenancePlanID","scheduleInterval","preventativeMaintenancePoints","initialQuiz","isComplete","videoPath","instructions","lessonID","isTimed","questions","intialQuizAnswer","questionID","answer","isCorrect","initialCourse","initialLesson","courseID","primaryVideoPath","slideshowPath","courseLessons","cost","isProtected","initialUser","securityFunctions","userCountries","first","last","position","Hospital","facilities","hasTeamMembers","widgets","inspectionStatus","preventativeMaintenance","tae","quotes","salesManagerID","optInGDPR","userStandards","initialUserQueue","user","initialProductQueueObject","creator","product","initialTrainingProgress","currentTime","percentageComplete","totalTime","timeSpent","initialAnalyticsInspection","mainCategoryName","jobDate","data","total","initialAnalyticsTAE","photoUrl","coAlarm","lagAlarm","leftBankPressureBar","rightBankPressureBar","deliveryPressureBar","reservePressureBar","reservePressurePSI","leftBankPressureKPA","rightBankPressureKPA","deliveryPressureKPA","reservePressureKPA","leftBankEmpty","rightBankEmpty","timeOnCurrentBank","timeOnPreviousBank","installBaseName","installBaseLocation","installBaseSerialNumber","systemRunHours","unit1Hours","unit2Hours","dewpoint","coLevel","receiverPressure","dryer1Mode","dryer2Mode","leftBankPressurePSI","rightBankPressurePSI","deliveryPressurePSI","leftBankSelectLatch","reserveInUseAlarm","reserveLowAlarm","secondaryLowAlarm","changeoverAlarm","dewpointAlarm","gasType","device","initialTae","serialNumber","systemHours","unit1RunningHours","unit2RunningHours","dewpointValue","coValue","initialChart","unit","format","initialAnalyticsSmartlink","latestValues","unit1Graph","unit2Graph","initialSuggestedPart","adminComments","installBaseQuantity","productQuantity","initialJobComment","isDeficiency","codeID","isResolved","initialDeficiencyCode","initialLeadActivity","otherType","followUpNote","followUpScheduled","activityDate","followUpSent","initialState","countries","ajaxCallsInProgress","offline","busy","online","retryCount","retryScheduled","outbox","lastTransaction","config","isMobile","toastr","toastrs","redirect","redirectToReferrer","pathname","manageUserQueue","totalPages","userQueuesByID","tableFilters","selectedUserQueue","manageUser","usersByID","selectedUser","activeLocalCountry","manageJob","nextJobNumber","jobsByID","openJobsForWorkOrdersByID","fseUsersByID","selectedJob","jobWorkOrdersByID","manageBrand","manageBrandsByID","selectedBrand","manageDocumentType","documentTypesByID","showEditDocumentTypeModal","selectedDocumentTypeID","manageDocument","documentsByID","showEditDocumentModal","showEditVersionModal","selectedParentID","selectedDocumentID","documentFormValues","versionFormValues","manageLeads","leadsByID","leadUsersByID","leadInstallBasesByID","showEditLeadModal","showLeadActivityModal","showEditLeadActivityModal","leadActivitiesByID","selection","selectedLead","selectedLeadActivity","manageCustomerQuotes","quotesByID","selectedQuote","showEditQuoteModal","showQuoteDetailsModal","showSalesQuoteModal","manageWorkOrder","workOrdersByID","visibleWorkOrdersByID","technicians","showEditWorkOrderModal","showEditPartModalForm","showWorkOrderCloseModal","selectedWorkOrderID","selectedPartID","workOrderFormValues","preventativeMaintenanceChecklistsByID","showConfirmSelectJobModal","partFormValues","selectedFacilityIDForConfirmSelectJob","fsesWithWorkOrders","manageAlert","alertsByID","showEditAlertModal","selectedAlertID","alertFormValues","manageCode","deficiencyCodesByID","showEditCodeModal","selectedCodeID","codeFormValues","manageFacility","contacts","selectedContactID","foundUsersOrContactsByID","facilityFormValues","selectedFacilityID","facilityContractFormValues","showFacilityContractModal","selectedContact","manageReport","defaultReportsByID","selectedReport","selectedDefaultReportID","showEditReportModal","manageLocation","visibleLocations","showEditLocationModal","customersWithFacilities","manageTeam","teamMembersByID","selectedUserID","showEditTeamModal","editUserFormValues","manageInventory","showEditProductModal","showEditInstallModal","showShoppingCartModal","showInstallContactModal","showSearchNewProductsModal","showImportInstallModal","showMPResultModal","showMPResultHistoryModal","showMPResultNotesModal","productsByID","installBasesByID","cart","addedIDs","hideVirtualToggle","searchNewProductsSelectedProduct","newProducts","selectedProductID","selectedInstallBaseID","productSearchFormValues","installFormValues","searchNewProductInstallBatchMode","isBatchMode","installBaseIDs","manageProduct","productInfo","brands","allBrands","productTypes","mainCategories","powers","standards","subcategories","systemSizes","brandOptions","allBrandOptions","originOptions","productTypeOptions","mainCategoryOptions","powerOptions","standardOptions","subcategoryOptions","systemSizeOptions","manageProductQueue","showApproveProductModal","productQueueByID","mergeableProductsByID","manageTae","taeByID","selectedItemID","showEditModal","training","coursesByID","lessonsByID","lesson","quizzesByID","quiz","lessonProgress","purchasedTraining","quizAnswers","quizView","quizComplete","inProgressQuizID","startTime","quizLink","link","manageTraining","trainingProgress","manageMeasurementPointLists","measurementPointListsByID","measurementPointsByID","selectedMeasurementPointList","showEditMeasurementPointListModal","showEditMeasurementPointModal","showEditMeasurementPointTabModal","showEditMeasurementPointListTestProceduresModal","selectedTabID","selectedMeasurementPoint","measurementPointResults","measurementPointResultsByID","selectedResult","previousResult","historicalResultID","syncStatus","fseUsersUpdated","allContactsUpdated","showSideMenu","showEditFacilityModal","showEditProfileModal","showSecurityFunctionsModal","showFacilityContactModal","dashboardAnalytics","inspection","pmp","totalWorkOrders","open","closed","taeDashboard","smartlinks","quote","new","approved","inProgress","rejected","unquotedLeads","manageJobComment","jobCommentsByID","selectedJobComment","showEditJobCommentModal","filteredJobComments","rawUsersByID","securityUsersByID","showAlertModal","tutorial","viewedTours","run","manageAssetPhotos","photos","photosByProduct","managePart","jobParts","manageSuggestedParts","suggestedParts","showEditSuggestedPartModal","selectedSuggestedPart","sapJobMappings","sapJobMappingsByID","emptyTile","src","srcBanner","color","width","height","parentKey","initialPhoto","file","fileType","installBase","isInReport","lightboxUrl","originalUrl","thumbnailUrl","ManageAllUsers","ManageJobs","FSE","ViewJobs","ManageTrainingPayment","ManageSecurity","ViewInventory","ViewAssetPhotos","ManageInventory","QuoteForInvoice","SignUpTeamMembers","ManageTeamMembers","ManageIndividualTraining","ManageEmployeeTraining","Payment","ManageProducts","ManageLocations","ManageAllTraining","ManageAllMeasurementPoints","ManageCustomerMeasurementPoints","ManageFacilities","ManageBrands","ViewDocumentLibrary","ManageDocumentLibrary","ManageGeneralDocuments","ManageAlerts","ManageCodes","ManageCustomerWorkOrders","ManageWorkOrderPMP","ManageWorkOrderAdmin","RunReports","AllowAllCustomers","RecieveContact","DashboardInspection","DashboardTAE","DashboardSmartlinks","DashboardPMP","ManageJobComments","ViewCustomers","SalesParts","SalesInstallation","SalesService","SalesManager","SalesAdmin","ManageCustomerQuotes","DashboardQuote","FSECustomer","ManageSuggestedParts","ViewSuggestedParts","ManageSystemDocuments","AllowAllCountries","FSEFacilityContactEdit","ManageReports","tiles","svgKey","require","dashboard","sales","default","admin","shouldHideOnDashboard","shouldHideOnMenu","VideoPlayer","props","player","pElem","setUpPlayer","vimeoId","loop","Player","ready","constants","toastrError","off","className","ref","style","padding","margin","React","Component","documents","steps","content","target","placement","disableBeacon","inventory","components","DropdownIndicator","createOption","value","CreatableMultiTextInput","inputValue","handleChange","setState","onChange","handleInputChange","handleKeyDown","preventDefault","newValue","uniqBy","initialContent","isClearable","isMulti","menuIsOpen","onInputChange","onKeyDown","placeholder","RichTextEditor","customInlineFn","element","Style","tagName","styles","cssText","includes","fontSize","substring","setContent","maxCharacters","stateFromHTML","newEditState","EditorState","createWithContent","editorState","characterLimit","contentState","getCurrentContent","rawContentState","convertToRaw","blocks","block","join","html","draftToHtml","newEditorState","undo","charLimit","createEmpty","prevProps","onEditorStateChange","toolbar","toolbarConfig","inline","list","readOnly","SignatureControl","customerSignaturePad","onSubmit","getTrimmedCanvas","toBlob","blob","clear","createRef","onEnd","penColor","canvasProps","ControlComponent","Control","FormUtil","patchControl","formGroup","meta","patchMetaAndValue","control","get","patchValue","patchControlMeta","info","statusChanges","next","patchControlValidators","validators","setValidators","requiredWithTrim","moment","isMoment","Array","isArray","empty","isValidEmail","match","isValidPostalCode","isValidMoment","isValid","ISO_8601","requiredRichText","requiredBlob","isTwoDigitNumber","isFourDigitAlphaNumeric","isNumeric","test","isLessTenDigitAlphaNumeric","convertEnumToOptions","items","keyFmt","replace","filter","isNaN","Number","convertToOptions","shouldIncludeDeleted","filteredItems","item","firstLastName","convertToSingleOption","lastOption","getValidationState","pristine","submitted","toFormData","formValue","FormData","forEach","append","utc","toISOString","toUrlSearchParams","paramCollection","params","URLSearchParams","collection","getValues","formValues","values","val","momentSQLFormat","Datetime","handler","touched","errors","requiredLabel","required","defaultValue","momentDate","Col","xs","colWidth","md","colWidthMedium","lg","colWidthLarge","FormGroup","validationState","bsSize","alignRight","ControlLabel","timeFormat","dateFormat","isValidDate","inputProps","disabled","FormControl","Feedback","TextInput","componentClass","rows","autoFocus","FileInput","uploadButton","extension","fileName","split","pop","btnClassName","otherLabels","labelReplace","idNum","charAt","hasPreview","alt","maxWidth","marginTop","marginBottom","htmlFor","cursor","icon","accept","evt","fileInput","files","display","defaultStyles","size","hasDownload","Row","bsStyle","href","labelDownload","Toggle","innerStyle","icons","checked","Checkbox","TextInputWithoutValidation","Select","selectClassName","selectValidationClass","selectOptions","disableSort","orderBy","option","toLowerCase","data-last","Boolean","MultiValueLabel","multiValueLabel","Option","multiValueOption","classNamePrefix","isDisabled","filterOption","createFilter","ignoreAccents","CreatableSelect","dropdownIndicator","onCreateOption","handleCreate","AsyncSelect","loadOptions","defaultOptions","cacheOptions","noOptionsMessage","AsyncCreatableSelect","isValidNewOption","SelectWithoutValidation","data-type","dataType","SingleValue","singleValueLabel","SelectWithoutValidationLeftLabel","SelectWithButton","paddingTop","onClick","buttonAction","buttonName","Button","translateForm","controls","mapValues","field","newMeta","translatedOtherLabels","shouldTranslate","newOptions","TextLabel","fontWeight","TextLabelStatic","marginLeft","textAlign","CreatableSelectWithButton","subLabel","Signature","PassFail","ToggleButtonGroup","ToggleButton","NumericInput","fontAwesomeIcon","visibility","showLabel","backgroundColor","Divider","children","newProps","paddingLeft","MultiValueOption","MPLTypebyJobTypesID","annual","verification","agsRebalancing","colors","green","greenButton","greenTr","greenBanner","blue","teal","blueTr","blueBanner","blueButton","darkButton","greyButton","iconBlue","orange","orangeTr","orangeBanner","orangeButton","lightTeal","purple","purpleBanner","purpleButton","purpleTr","lightTealBanner","dark","darkBanner","red","grey","greyBanner","greyText","darkGreyText","darkRed","darkGrey","greyBlueShadow","textBlue","greyBlue","darkerBlue","yellow","smartLinkRed","smartLinkBlue","smartLinkYellow","smartLinkBlueLight","smartLinkYellowLight","smartLinkRedLight","installBaseStatusColorLookup","Pass","Fail","Repaired","menuItemsWithChildren","usStandards","caStandards","transitionIn","transitionOut","timeOut","toastrWarning","toastrSuccess","inventoryImportAllowedExtensions","alertTypes","jobCommentTypeOptions","measurementPointTypeEnum","1","2","3","4","6","7","8","measurementPointTypeOptions","MEASUREMENT_POINT_PASSFAIL","MEASUREMENT_POINT_TEXT","MEASUREMENT_POINT_NUMERIC","MEASUREMENT_POINT_SELECT","GROUP","MEASUREMENT_POINT_DATE","MEASUREMENT_POINT_LONGTEXT","MEASUREMENT_POINT_SUMMARYPAGE","measurementPointTypesInverse","5","measurementPointPassFailOptions","measurementPointPassFailTypes","pass","fail","notApplicable","isResolvedOptions","hasSecurityFunction","securityFun","sFunctions","sf","toUpperCase","intersection","intersectionBy","st","matchAll","getTileByURL","URL","firstParam","foundTile","find","constructSystems","systemsOptions","i","count","handleError","msg","response","messageDetail","hasOwnProperty","navigator","onLine","loginRedirect","tableSearchDebounceTime","formDebounceTime","timedQuizHours","searchProductPageCount","searchProductRecentProductLimit","tablePageSizeDefault","tablePageSizeOptions","httpTimeout","httpTimeoutDownload","trainingVideoProgressSaveDelay","cacheFseUsersMinutes","defaultStandardID","defaultStandardUS","defaultStandardUK","momentDisplayFormat","momentDisplayFormatWithTime","momentDisplayFormatWithTimeAndSeconds","defaultCountryID","ukCountryID","usCountryID","canadaCountryID","germanyCountryID","malaysiaCountryID","categoryManifoldID","virtualProductSubcategoryID","bulkSelectionLimit","photoUploadTimeout","urlValidatorPattern","capitalEquipmentCategories","agss","airSystem","manifold","oxygenSystem","vacuumWagd","jobTypeOptions","nonProductive","reduce","obj","jobTypeOptionsTranslated","postalAndStateRequiredCountries","productPlaceholderImages","categoryId","documentTypeMapping","reports","leaglAndQSHE","techSupport","financeAndPlanning","countryCodeOptions","languageLables","English","French","German","Spanish","Thai","Chinese","langOption","langName","i18next","on","lng","locale","use","Backend","initReactI18next","LanguageDetector","init","preload","ns","fallbackLng","defaultNS","interpolation","escapeValue","Intl","NumberFormat","parseFloat","numberTruncate","Math","trunc","secondsToHoursTruncated","pascalToPSITruncated","celcius","fahrenheit","local","react","wait","useSuspense","detection","caches","backend","backends","LocalStorageBackend","I18NextLocizeBackend","backendOptions","expirationTime","defaultVersion","projectId","apiKey","referenceLng","isLocalhost","window","location","hostname","registerValidSW","swUrl","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","USER_LOGOUT_SUCCESS","beginAjaxCall","endAjaxCall","manualAjaxStart","dispatch","root","API","POST","building","add","merge","floor","room","updateproduct","addproduct","updateinstall","addinstall","deleteInstall","installContact","approveproduct","importInstall","mergeProduct","moveFacility","updatePostalCodes","login","signup","adSignup","approve","reject","update","updateprofile","updateteam","saveteam","deleteTeamMember","saveTrainingPO","savelessonprogress","trainingCheckout","savequiz","startQuiz","measurementPoint","addglobalmpl","addResults","report","runDailyRounds","templates","chapters","templateChapters","uploadExternalDocument","brand","alert","create","markAsRead","markAllAsRead","photo","job","workOrder","PUT","updateglobalmpl","updatecustomermpl","brandLogo","updateFacility","updateInstalls","DELETE","deleteglobalmpl","deletecustomermpl","deleteglobalmeasurementpoint","deletecustomermeasurementpoint","deleteglobalmeasurementpointselectoption","deletecustomermeasurementpointselectoption","GET","sapJobMapping","getAll","getall","customer","getbyid","getByCountry","getallwithfacilities","getlogo","GetFacilityQueue","searchByCountries","getbycustomer","getinventory","getByFacility","getproductinfo","getproductqueue","products","getNextSerialNumber","getuserqueue","getfseusers","getusersbysecurityfunction","getusersearch","getteamsearch","getprogressbylesson","getalllessonprogress","getPurchasedTraining","getAdminProgress","getQuizResults","classMarker","userId","getQuizLink","courseId","savePendingTraining","trainingCurriculum","allCourses","allLessons","lessonByCourseID","quizzesByLessonID","allQuizzes","smartlinkDataPoint","getJobResults","getFacilityMeasurementPointListResults","getMeasurementPointList","getMeasurementPointListResultWithAnswers","getMeasurePointListResultForInstallBase","defaults","getsingle","single","all","alertsForInstallBase","cloudDocument","getTypeByCustomer","documentType","download","downloadVersion","delete","installSearch","preview","jobComment","smartlink","contact","findUserOrContactByEmail","updateFacilities","addFacility","deleteFacility","preventativeMaintenanceChecklist","preventativeMaintenancePoint","getCSV","getAllOpenJobsForWorkOrders","getassigned","getNextAutoNumber","addWorkOrders","lead","bulkUpdateStatus","leadActivity","leadInstallBase","updateStatus","saveQuoteFiles","getByProduct","deletephoto","deleteMultiplePhotos","getTechnicians","getWorkOrderCsv","getFSEsWithWorkOrders","unlinkWorkOrders","save","country","getUserAlerts","getState","axiosOptions","method","finally","toggleUserAlertModal","checkForLoggedInUser","updatedUserID","warning","userLogoutHelper","getSecurityUsers","securityFunctionIds","securityfunctions","users","saveUser","originalUser","initialPostalCodes","postalCodes","cleanedUser","postalCodeArray","shouldUpdatePostalCodes","isEqual","selectedUserId","toggleSecurityFunctionsModal","mixpanel","ignore_dnt","actions","identify","alias","track","people","set","replaceEmptyStringsWithNull","Event","localForage","Mixpanel","userLogout","toastrConfirmOptions","onOk","OnCancel","okText","cancelText","confirm","toggleEditProfileModal","toggleTutorial","cleanResult","result","cleanedAnswers","pickBy","property","selectInstallBaseHistory","measurementPointResultsReducer","combineReducers","action","newResults","keyBy","results","res","latestMeasurementPointListResult","types","resultID","temporary","history","mapped","Id","Notes","JobType","Status","WorkOrderID","push","sort","a","b","cleanWorkOrderObject","normalizedWorkOrder","omit","assignedUser","jobWorkOrders","cleanPreventativeMaintenanceChecklist","checklist","selectWorkOrdersByID","getVisibleWorkOrdersByID","selectJobWorkOrders","selectJobWorkOrdersWithWorkOrders","createSelector","withWorkOrders","jwo","selectVisibleWorkOrdersByID","workOrders","foundJobWorkOrders","orderedWOs","wo","woUsers","index","newOrders","newWorkOrders","newFacilityWOs","newWOrders","jobs","jobWorkOrder","currentState","pmcs","pages","createSelectedIDWithName","modalToggleWithName","createTableFiltersWithName","createFormValuesWithName","cleanFacilityWithoutBuildings","initialFacilityWithoutBuildings","cleanFacility","filteredFloors","filteredLocations","getFacilities","getSelectedFacilityID","convertFacillitiesToOptionsWithAllProperties","f","generateFacilityNameWithAddess","convertFacillitiesToOptionsWithCountryID","geographical_state","nameWithAddress","convertFacilityOptions","selectFacilityOptionsWithAddress","filteredFacilities","orderedFacilities","selectSelectedFacilityWithBuildings","query","selectSelectedFacility","selectSelectedFacilityID","contract","cleanUser","securityFunc","securityF","getUser","getActiveLocalCountry","selectSecurityUsers","userManage","newUsers","newUsersB","newUsersC","isMeasurementBasedJob","Inspection","Audit","Verification","cleanJobWorkOrder","normalizedJobWorkOrder","cleanJobObject","selectJobID","selectJobWorkOrdersForJobID","selectJobTableFilters","jobTableFilters","selectWorkOrdersForJobID","filteredJobWorkOrders","jobWO","selectJobsByID","selectNextJobNumber","selectFilteredJobs","filters","shouldInclude","visit","Repair","Maintenance","warrantyBM","servicePlan","audit","commissioning","Commissioning","measurementBasedOnly","completed","selectFilteredFacilitiesForWO","IDs","getJobOptionsFromFilters","filteredJobs","jobsWithName","unix","selectActiveFseUsersByID","fseUsers","filteredFSE","selectFseUserOptions","activeFSEUsers","selectOpenJobsForWorkOrders","jobManage","newJobs","cleanJobs","keyedJobs","udpatedJ","keyedFSEUsers","newJobWorkOrders","newJobWorkOrdersB","updatedJobWorkOrders","selectIsFacilityContactModalOpen","facilityContactModal","selectProductInfoSubCategories","selectIsFacilityContractModalOpen","facilityContractModal","selectIsLoading","isOfflineBusy","createShowModalWithNamedType","modalName","show","tableName","uuidv4","closeAllModals","toggleEditFacilityModal","getFacilitiesByCountry","filterParams","isEmpty","fromEntries","entries","hasFacilities","searchFacilitiesForAsyncSelect","countryId","quantityOfAssets","callback","saveFacilities","callbackWithPagination","setSelectedFacilityID","getSAPJobMapping","getCodes","pagingType","clearSelectedCodeID","toggleEditCodeModal","CommonModal","classNameAnimation","renderDelayActive","secondModal","wideModal","secondWideModal","backdrop","Modal","onHide","onExiting","onEntering","onEntered","getElementById","querySelector","Header","Title","Body","Footer","footer","WithCommonModal","WrappedComponent","userBaseConfigControls","defaultValues","mobilePhone","currency","mobilePhoneCountryCode","phoneCountryCode","phoneExtension","includeMobilePhone","x","fields","render","formState","Validators","pattern","divider2","divider3","UserProfileForm","patchUserValues","disable","facilitiesArray","facilityOptions","fac","selectedCountryOption","debounce","searchTerm","buildFieldConfig","languageOptions","tempOptions","pressureOptions","vacuumOptions","flowOptions","currencyOptions","languageValue","language","toString","tempUnits","pressureUnits","vacuumUnits","powerUnits","flowUnits","userStandardsValues","lang","flow","temp","pressure","vacuum","power","currencyOption","fieldConfigControls","fieldConfig","formValuesToItem","updatedValue","handleSubmit","markAsSubmitted","i18n","changeLanguage","success","updateUserProfile","handleDelete","handleDeleteSecondConfirmation","onCancel","deleteUserAccount","setForm","form","loading","getProductInfo","differenceBy","facilitySelectControl","stateChanges","formClassName","colorButton","onMount","to","toggleModal","marginRight","convertDateRangeToInterval","dateRange","lastYear","subtract","startOf","endOf","lastQuarter","quarter","thisYear","thisQuarter","getPhotos","assetSearch","jobSearch","mainCategory","resp","getPhotosByProduct","photoIDs","uploadProductPhoto","photoID","objectUrl","File","Blob","reader","FileReader","onload","onerror","readAsDataURL","base64Photo","photoPayload","now","getInventoryHelper","pagingDataCallback","initInventory","saveProduct","isEditMode","photosToUpload","photoIdsToDelete","newProductSelect","productForAPI","productLinks","productLink","cleanedProduct","setSearchNewProductsSelectedProduct","toggleEditInstallModal","moveFacilitiesAPI","newFacilityID","requestQuote","QuoteItems","sourceProductID","targetProductID","toggleEditProductModal","toggleInstallContactModal","toggleMPResultModal","toggleMPResultHistory","toggleMPResultNotes","toggleSearchNewProductsModal","setInstallBatchMode","toggleImportInstallModal","setTableFilter","setSelectedProductID","clearSelectedProductID","setSelectedInstallBaseID","clearSelectedInstallBaseID","createProductName","category","subcategory","productType","systemSize","skuString","substr","_defs","_g","withTranslation","connect","ownProps","foundFacility","updatedUser","alertImg_Icon","alertImg_Animation","handleMenuSelect","eventKey","menuOpen","modifiedPathname","slice","domain","isUserFullyLoggedIn","menuClass","showTutorial","aria-label","HelpManual","isEmailDomainInternal","alertsCount","ButtonToolbar","Dropdown","onToggle","isOpen","onSelect","Menu","MenuItem","fixedWidth","EditProfileModal","withRouter","getIsMobile","_extends","assign","bind","arguments","prototype","call","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref","svgRef","createElement","viewBox","transform","d","ForwardRef","forwardRef","_path","_path2","_path3","_circle","_rect","_rect2","_rect3","_rect4","_rect5","_rect6","cx","cy","r","rx","fill","opacity","_circle2","_path4","_circle3","fillRule","clipRule","x2","y2","_path5","_path6","_path7","_path8","svgIcons","alerts","closeMenu","customers","home","jobComments","standardText","manageUsers","newUserQueue","productQueue","toggle","data-open","isViewed","showOfflineQueueStatus","showOfflineQueueReset","localCartTotal","headerImg","useSelector","HeaderMenu","removeLoginRedirect","setRedirectPathname","setRedirect","azure","Login","initApp","addEventListener","handleRedirectToSignup","reduxPersistDelay","from","msalAccount","userLogin","userLoginFailed","handleRedirectResponse","handleRedirectError","userIsAuthenticated","handleMsalLogin","MSALlogin","removeEventListener","loggedInPath","$email","USER_ID","Grid","TrackJS","configure","defaultFacility","setLoginRedirect","getIsRequiredFromSelectedCountry","selectedCountryID","tempCompany","tempAddress","tempAddress2","tempCity","tempState","tempZip","UserForm","userForm","subscription","onCountryChanges","stateFormControl","tempZipFormControl","isStateRequired","isPostalCodeRequired","clearValidators","handleCancel","submitText","claims","given_name","family_name","valueChanges","subscribe","unsubscribe","SignUpSuccess","SignUpDirect","cancel","redirectToLogin","newUser","signUpDirect","showSignupSuccess","flipClass","tempUser","getUsersCountries","getUsersActiveCountry","getCanEditInstalls","getCanEditProducts","getCanRequestQuote","getCanCreateAsManager","getMeasurementPointResultsHistoryByInstallBase","installBaseId","getFacilityMeasurementPointResults","getFacilityMeasurementPointResultsHelper","getMeasurementPointListResult","setHistoricalResultID","clearHistoricalResultID","addToCart","cartName","toggleShoppingCartModal","workOrderToFormData","workOrderConvertedToFormData","newKey","getWorkOrders","statusFilter","workOrderType","sapWorkOrder","statusValue","parseInt","dateRangeValue","typeValue","beacon","populateFacility","sapWorkOrders","getWorkOrdersByFacility","complete","getWorkOrderByID","addWorkOrder","newWorkOrder","updateWorkOrder","deleteWorkOrder","technician","fileDownload","setSelectedWorkOrderID","clearSelectedWorkOrderID","toggleEditWorkOrderModal","toggleWorkOrderCloseModal","setWorkOrderFormValues","updateWorkOrderFormValue","toggleConfirmSelectJobModal","updateWorkOrderSelection","searchPartsForAsyncSelect","partOptions","partsToOptions","getJobs","activeCountryID","activeCountryIDValue","FSEID","getNextJobNumber","getJobsByFacility","getFSEUsers","preferServer","diff","formatDatesForAPI","input","saveJob","jobForAPI","userIDsForAPI","uj","saveJobParts","updateSelectedJob","addWorkOrdersToJob","refreshWorkOrders","cleanedJobWorkOrders","unionBy","getCloudDocument","shouldDownload","ensureDocType","RegExp","responseType","timeout","safeName","createObjectURL","updateDocumentFormValue","setDocumentFormValues","clearSelectedDocumentID","toggleEditDocumentModal","InstallBaseActionButtonContainer","selectedInstallBase","rowInfo","original","showMoveFacility","clearTableFilters","notTested","resultStatusNotTested","forMobile","DropdownButton","pullRight","openSearchFacilityModal","Banner","img","subtitle","colorIndex","background","SearchTableForm","showBtn","handleUpdatedFieldConfig","subscribeValueChanges","onValueChanges","handleToggleAdditionalFilters","showAdditionalFilters","showSearchButton","showAdditionalFiltersButton","hasActiveAdditionalFilters","loadCountries","currentCountries","setCountries","getCountries","usersCountries","usersActiveCountry","useDispatch","isRenderedInModal","usersLocalActiveCountry","setFacilitySearchTimeout","generateFacilityOption","facilityClass","classNameOverride","countryToUse","facililty","selectedFacility","userFacililty","facilityOption","activeCountryOption","c","countriesOptions","subscribeToValueChanges","clearTimeout","handleSetFacility","handleCountryChange","facForm","getFacilityForm","facilityForm","setValue","setErrors","setFacilityFormToDefault","onUnmount","s","SelectFacilityContainer","tempFacility","SelectFacilityForm","TableUtil","translateHeaders","columns","column","buildLocation","install","locationString","locationID","roomID","expanderToggleFolder","isExpanded","FolderIcon","aria-hidden","expanderToggle","WorkOrderExpander","sortedData","dueDate","expanderColumns","accessor","minWidth","statusString","sortable","minRows","showPageSizeOptions","rowsText","noDataText","resizable","showPagination","initialItem","MultiDropdown","getItemTitle","handleSelect","noCaret","alignItems","justifyContent","border","borderRadius","whiteSpace","overflow","textOverflow","disableEdit","disableDelete","actionItem","actionIndex","getTitle","SingleButton","ListGroupItem","AddMultiControlClass","handleAdd","showModal","selectedItem","subscribeToChanges","patchFormValues","itemEditFieldConfig","untypedSelectedItem","isSingleAction","stopPropagation","updatedItem","updatedItems","prevState","deleteButtonStyle","ListGroup","readonly","buttonLabel","modalTitle","AddMultiControl","styled","div","Content","MobileButtonGroup","CloseButtonWrapper","CloseButton","xmlns","CommonMobileModal","hasTitle","hasFooter","EditWorkOrderForm","updateFormValueDebounced","onFileChange","itemToFormValues","selectedWorkOrder","selectedVendor","selectedPriority","selectedStatus","cleanedWorkOrder","workOrderWithCleanedNotes","parse","Text","file1","file2","file3","buildMultiControlConfig","shouldHideTechnician","other","shouldHideTechnicianSelect","due_date","productInformation","selectedProduct","$field_1","isStatic","shouldDisableVendorSelect","manageParts","contactInfo","showTime","buildStatusOptions","shouldDisableStatusSelect","attachmentUrl1","attachmentUrl2","attachmentUrl3","reopened","tempWorkOrder","deletedItem","cleanForm","reset","shouldShowDeleteButton","shouldHideDelete","updateFormValue","setFormValues","defaultProps","EditWorkOrderModal","selectedWorkOrderId","WorkOrderCloseForm","enableRepairMode","repair","internal","button","WorkOrderCloseModal","NumberInputWithButton","hasError","paddingRight","CartProduct","Badge","deleteFromCartCB","showCost","productControls","prod","min","max","EditQuoteForm","checkout","setFormConfig","deleteFromCart","updateQuantityCart","calculateSubtotal","subtotal","EditQuoteModal","ShoppingCartForm","decreaseFromCart","AssetImage","toLocaleLowerCase","imgPath","ManageInstallForm","updateFormGroup","prepValuesFromRedux","buildingOptions","floorOptions","locationOptions","roomOptions","selectedSystemsOption","cleanedItem","getAllFilteredLocations","ib","latestAGSMeasurementPointListResultID","latestAuditMeasurementPointListResultID","latestCommissioningMeasurementPointListResultID","latestVerificationMeasurementPointListResultID","handleNewManufactureDate","generateSerialNumber","isGeneratingSerialNumber","canEditInstalls","isCapitalEquipmentType","quantityValidators","shouldRequireQuantity","$field_0","nickname","maxLength","generateSNButton","rfid","sapEquipmentNumber","sapMaterialNumber","remarks","inputType","$field_2","$field_3","importedLocation","handleCreateBuilding","handleCreateFloor","handleCreateLocation","handleCreateRoom","prodDate","$field_4","installDate","newDate","newDateFieldValues","updateFormValues","handleFieldLengthError","locationObject","saveAnyLocation","selectedBuilding","selectedFloor","selectedLocation","selectedRoom","updateInstall","saveInstall","getFacility","saveAnyLocationObjectHelper","lType","installBaseLocations","newLocationObject","updateAnyLocation","filterLocationsHelper","toggleEditLocationModal","newID","newInstalls","newIDb","cleanedInstalls","newInstall","InstallBases","installs","originalInstallBase","effect","rollback","EditInstallForm","updateQueueProduct","shouldApprove","queueID","approveProduct","EditProductForm","handleConfirmCompliant","handleConfirmSpares","filterSubcategories","filterProductTypes","filterSystemSizes","onMultiControlChanges","multiControlFormGroup","selectedLink","otherControl","enable","newOtherControl","selectedPhotos","isNew","updateAddImageButton","getAddImageLabel","selectedQueueObject","filteredSubcategoryOptions","selectedMainCategory","selectedSubcategory","selectedProductType","selectedPower","selectedSystemSize","selectedCommunicationMethod","standard_ids","Set","standard","selectedProductStandards","has","selectedLinks","shouldEnableForm","pLink","$field_spacing","sub","mainCategoryIDs","subCategory","StandardID","linksWithProductID","updatedProduct","canEditProducts","canCreateProducts","openLightbox","activePhoto","lightboxIsOpen","closeLightbox","deletePhoto","renderPhotos","hasManageSuggestedParts","lineHeight","onClose","positioner","base","zIndex","blanket","currentIndex","views","caption","canCreateAsManager","canCreateAsFSE","canCreateAsAdmin","getCanCreateProducts","addFile","selectedFile","formData","customMessage","dangerouslySetInnerHTML","__html","component","ImportInstallForm","SelectTable","selectTableHOC","treeTableHOC","ReactTable","InstallBasesExpanderContainer","showAddInstallation","showEditProduct","showRequestQuote","selectAll","checkboxTable","installBasesWithLocationString","sortedInstallBases","bulkChangeProduct","carry","eProps","top","left","ids","bulkChangeFacility","installIds","Cell","getTdProps","fState","toggleSelection","shift","row","keyIndex","selectType","toggleAll","keyField","getWrappedInstance","getResolvedState","_original","isSelected","InstallContactform","selectedInstallBaseId","facilityId","InstallContactModal","InstallContactForm","selectedInstall","beaconContactType","fse","MeasurementPointListItem","MPResultHistory","isLoading","paddingBottom","MPResultHistoryModal","MPResultList","mpAnswer","AnswerElement","numericValue","textTransform","textValue","dateValue","measurementPointSelectOptionID","selectedOption","guideText","AnswerListItem","setSelectedMeasurementPointList","measurementPointList","updateMeasurementPointListTab","tab","updateMeasurementPointList","mpl","persistToAPI","isCustomer","mp","cleanedMP","findIndex","numericMinValue","numericMaxValue","numericAllowDecimals","listForAPI","updateMeasurementPoint","saveMeasurementPointToMeasurementPointList","listID","MPlistID","toggleEditMeasurementPointListModal","toggleEditMeasurementPointModal","toggleEditMeasurementPointTabModal","toggleEditMeasurementPointListTestProceduresModal","MPResultListModal","selectedMeasurementPointResultID","RichTextView","HTMLcontent","MPResultListNotesModal","allFacilities","setSelectedFacility","facilitySelected","SearchFacilityForm","hideModal","SearchNewProductsForm","updateFormValuesDebounced","handleSubmitDebounced","buildFormValuesFromSelected","defaultFormValues","filteredSubCategoryOptions","selectedSubCategory","selectedProductStandard","ProductStandard","Obj","selectedMainCategoryOption","enableMergeProductMode","installBatchMode","productAttributes","getProductAttributes","selectedStandards","isProductQueue","getMergeableProducts","subCategoryID","getProducts","getValue","object","selectedFormValues","attributes","updateProductSearchFormValues","setProductSearchFormValues","resetNewProducts","disableCreateNew","handleProductSelect","handleMergeProduct","searchActive","ProductListItem","sItem","Well","productQueueObjects","WithCommonMobileModal","MPResultHistoryMobileModal","MPResultListMobileModal","MPResultListNotesMobileModal","ManageInventoryDetails","fullLocation","pagination","goBack","installBasesCount","setTableFilterTimeout","buildSearchControls","mainSearchControls","flexDirection","gap","useState","selectedRow","currentTile","searchFieldConfig","showSearchNewFacilityModal","installIdsToMove","filterLength","numPages","pagingInfo","setPagingInfo","isManageAssetView","path","selectedProductForEditInstall","getQuantityColumn","currState","tableElement","scrollTop","tableData","onPageChange","newPage","onSortedChanged","newSorted","shiftKey","sorted","newFacilityId","showNewFacilityModal","convertedInt","bannerTitle","EditInstallModal","scrollingHeight","overFlow","canRequestQuote","cartTotal","overflowY","stateFinal","viewIndex","defaultPageSize","pageSize","previousText","nextText","onSortedChange","multiSort","expander","Expander","userSelect","productNameString","SubComponent","expanded","EditProductModal","ShoppingCartModal","SearchNewProductsModal","targetProduct","selectedInstallIds","ImportInstallModal","addedIds","getQuantity","cartReducerWithName","getTotal","cleanAndFilterProductObject","cleanInstallBaseObjects","selectVisibleInstallBases","manageWorkOrderReducer","facilityInstallBases","installBasesPopulated","searchFormValues","filteredInstallBases","searchString","inProductName","inLocationName","inSerial","inNickname","inProductDescription","inAssetNumber","filterInstallBases","filteredWorkOrders","selectWorkOrdersByInstallBaseID","mplResult","mostRecentStatus","isAfter","resultStatusRepaired","resultStatusMaintain","resultStatusCommissioned","getInstallBaseVisibleStatus","newInstallsCount","newCount","productWithoutPhoto","productWithPhoto","newInstallBases","nInstallBases","leadInstallB","locationKey","newInstallsB","installB","installC","selectedProductReducer","productSearchModalBatchMode","InstallBaseAnalyticsTableContainer","clearSelectedAlertID","toggleEditAlertModal","EditAlertForm","selectedAlert","selectedType","imageSizeLabel","handleEdit","newAlert","ManageAlert","onSearchValueChanges","setColumns","float","getTrProps","getAlerts","tableDiv","getElementsByClassName","setSelectedAlertID","deleteAlert","manual","EditAlertModal","addBrandLogo","updateBrand","brandToUpdate","logo","base64Logo","updateSelectedBrand","clearSelectedBrandID","toggleEditBrandModal","ManageBrandForm","logoPath","countryValue","phoneNumber","reportEmail","sendReportToCustomers","replyToEmail","initSelected","queryParams","selectedBrandID","originalBrand","closeModal","updatedBrand","saveBrand","clearSelectedID","addQuery","hasQuery","removeQuery","selectBrands","selectBrand","cleanBrandObject","manageBrandQueryParamsEnum","brandManage","newBrands","isEditing","newBrand","inventoryProductInfo","EditBrandForm","ManageBrand","setTableFilterDebounced","handleSelectBrand","handleNewBrandClick","getBrands","showEditBrandModal","EditBrandModal","queryString","deleteBrand","setSelectedBrandID","EditCodeForm","selectedCode","deficiencyCode","EditCodeModal","newCode","cleanCodeObject","newCodes","ManageCode","opt","onPageSizeChange","setSelectedCodeID","deleteCode","filteredCodes","selectVisibleDeficiencyCodes","cleanFacilityContact","facilityContact","sanitized","selectManageFacilityTableFilters","selectFacilityContactsForTable","facilityContactsByID","cleanedContactsAndFacilities","updateFacilityFormValue","updateSelectedContact","toggleFacilityContractModal","updateFacilityContract","facilityContract","toggleFacilityContactModal","clearUsersThatMachedEmail","mergeFacilitiesAPI","primaryFacilityID","secondaryFacilityIDs","deleteFacilityFromContact","addContactFacility","FacilityContactControl","remove","noMargin","FacilityContractControl","myMedGasContract","inspectionContract","EditFacilityForm","selectedSiteSize","selectedInspectionProvider","selectedMaintenanceProvider","selectedAGSLEVProvider","selectedEnvironmentalTestProvider","selectedAuthorizedCompany","selectedManagedByID","selectedLeadFSE","sanitizedFacility","countryIDOption","selectedStandardOption","siteSize","inspectionProviderID","maintenanceProviderID","agslevProviderID","environmentalTestProviderID","authorizedCompanyID","leadFSEID","cleanedFormValues","canManageContacts","isSAP","countryOptions","selectedCountry","fseOptions","website","postalCodeFormControl","canUseSAP","facilityToUpdate","refreshTable","closeModals","isFacilityContactModalOpen","isFacilityContractModalOpen","searchForFacility","clearSelectedFacilityID","selectedFacilityContract","showSearchFacilityModal","approveMode","contractWithNewFacilityID","detail","convertEmptyStringsToUndefined","ContactActionButton","sapSource","handleSelectContactEdit","addContactLead","AddContactsTable","tableClassName","FormStatus","AddContactsTableContainer","FacilityContactForm","searchUsersDebounced","cleanedContact","newContactFacility","handleSelectedEmail","formStatus","Add","AddAndEdit","addContactToFacility","newContact","updateContactFromFacility","userInfo","userValues","pick","isTiedToUser","isSAPContact","resetFormToOriginalContact","originalContact","tiedToUser","sapContact","fieldFormControls","regex","newEmailOption","minLength","getContactsByFacility","facilityHasContact","facilityContacts","Edit","contactsWithEmail","combined","usersAndContacts","FacilityContractForm","maintenanceContract","agslevContract","environmentalContract","boomContract","leakTestingContract","traceGasAnalysisContract","otherContract","myMedGasContractStart","myMedGasContractEnd","myMedGasContractComments","inspectionContractStart","inspectionContractEnd","inspectionContractComments","maintenanceContractStart","maintenanceContractEnd","maintenanceContractComments","agslevContractStart","agslevContractEnd","agslevContractComments","environmentalContractStart","environmentalContractEnd","environmentalContractComments","boomContractStart","boomContractEnd","boomContractComments","leakTestingContractStart","leakTestingContractEnd","leakTestingContractComments","traceGasAnalysisContractStart","traceGasAnalysisContractEnd","traceGasAnalysisContractComments","otherContractStart","otherContractEnd","otherContractComments","primaryFacility","useEffect","facilitiesToAdd","defaultId","onValueChange","verticalAlign","defaultChecked","primary","anyErrors","secondaryFacilities","mergeFacilities","filtered","facilityName","selectFilteredFacilities","refreshData","setConfig","showMergeFacilityModal","searchText","setData","minwidth","facilityState","saveFacility","facilitiesToSave","secondary","primaryId","secondaryIds","updatedTableData","debouncedSearch","searchTerms","current","useRef","finalState","EditFacilityModal","modalClass","FacilityContractModal","FacilityContactModal","primaryFacilityForm","setPrimaryFacilityForm","setFieldConfig","facilityControl","primaryFacilityFromValue","searchFacilityQueueForAsyncSelect","hasSAPNumChecked","setHasSAPNumChecked","allFacillitesWithSearchTerm","setAllFacilitiesWithSearchTerm","setSelectedCountry","facilityNameSearch","setFacilityNameSearch","hasSAPNumber","filterSAPNumber","handleSAPNumChange","pageSizeOptions","setSelectedDocumentTypeID","getLastModifiedDate","EditDocumentLibraryForm","clearFile","canEditDocuments","countryDisabled","canAddDocuments","selectedDocument","parentName","documentTypeOptions","parentId","fieldsConfig","isEditForm","isVersionForm","isNewForm","edit","setFormContent","handleClose","Buttons","boundActions","bindActionCreators","ManageDocumentVersionExpander","setTableData","versions","addVersion","NewVersionIcon","doc","canDeleteSystemDocuments","deleteVersion","setSelectedVersionID","toggleEditVersion","ManageDocumentVersions","selectedCloudDocument","mobileColumns","newVersion","downloadDocument","getDocumentType","editDoc","getDocumentPreview","specificVersion","useMemo","closingNotesColumn","notesJsonObject","documentTypeSelector","documentTypeManage","newDocumentTypes","AGSSSchematic","AGSReblancing","getDocumentTypes","getDocuments","start","end","documentTypeID","installBaseSearch","setSelectedParentID","clearSelectedParentID","setSelectedDocumentID","routeProps","prevSelectedFacilityID","useLocation","isInstallBase","isInstallBaseSearch","modalVersionVisible","showPreviewDocumentModal","documentToPreview","previewSpecificVersion","Aggregated","pivot","groupType","PivotValue","cellInfo","_pivotVal","otherGroup","aggregate","dates","_subRows","acc","PreviewDocument","collapseTable","latest","prev","handleOriginal","parentDocumentID","EditDocumentLibraryModal","data-btn","pivotBy","onExpandedChange","ManageAssetPhotos","galleryData","defaultDateRange","selectAssetPhoto","togglePhotoSelection","selectionEnabled","deleteSelectedPhotos","toDelete","getJobsByID","canManageAssets","photoCaption","direction","renderImage","typedPhoto","imgStyle","data-selected","jobOptions","ManageInventoryContainer","visibleProducts","selectedInstallBases","foundProduct","foundInstallBases","selectVisibleProductsWithInstallBases","cleanJobPart","jobPart","selectJobPartsForJob","cleanedJobParts","EditJobForm","onChangeDebounced","selectedJobID","originalJob","getJobParts","loadJobNumber","selectedJobType","selectedAssignedUser","selectedUsers","userJob","formValuesWithoutParts","cleanedJob","formValuesToChildItems","loadPartsOptions","selectedPart","loadFacilitiesOptions","selectedParts","showCondensedFields","checkIfStartDateBeforeEndDate","handleSelectingFacility","leadFSEOption","beforeStart","isBefore","onDelete","manageJobQueryParamsEnum","activeCountry","JobWorkOrderExpanderContainer","handleSelectJob","showEditJobModal","usersActiveLocalCountry","coulumns","fseLead","userOptions","defaultStatus","Active","additionalSearchControls","useCallback","debouncedSearchValueChanges","EditJobModal","toggleEditJobCommentModal","setSelectedJobComment","EditJobCommentFormClass","selectedIsResolved","resolveJobComment","EditJobCommentForm","EditJobCommentContainer","originalComment","ManageJobComment","buttonInAction","initialize","initPromises","getJobComments","filterJobComments","commentType","foundUser","jobFilters","getJobCommentsHelper","createDateMoment","commentJob","isSame","getLeads","leadType","toggleLeadsModal","setSelectedLeadFromID","updateSelectedLead","updateSelectedLeadActivity","toggleLeadActivityModal","toggleEditLeadActivityModal","setSelectedLeadActivityFromID","EditLeadForm","updateSelectedLeadDebounced","selectedLeadID","selectedRankingOption","toLocaleString","selectedStatusOption","filteredLeadUsers","selectedLeadUserUsers","lu","cleanedLead","contactName","buildLeadUsers","copyToClipboard","leadNumber","clipboard","writeText","$field_type","$field_salesManagerNames","salesManagerNames","$field_download","$field_8","salesPersons","salesPerson","$field_partHtml","$field_internalComments","leadUserOptions","luo","foundLeadUser","updateLead","manageLeadQueryParamsEnum","PureComponent","selectLeadsByID","selectLeadInstallBasesForTable","leadInstall","selectPopulatedLeadUsers","lUser","salesManager","selectSelectedLead","leadUsersPopulated","filteredLeadUsersPopulated","selectLeadsForTable","filteredLeadInstallBases","selectLeadActivityForLead","cleanLeads","cleanLeadUser","leadUser","cleanLeadInstallBases","cleanLeadActivities","leadsManage","leadIDs","updatedLeads","leadStatus","newLeadUsers","rawLead","updatedLeadUsers","originalLeadUsers","newLeadInstallBases","cleanedActivities","managersById","managers","manager","plead","leadForAPI","LeadInstallBasesExpander","handleDeleteLeadInstallBase","ActionButton","showLeadActivity","LeadActivityItem","handleSelectLeadActivity","LeadActivityList","EditLeadActivityForm","updateSelectedLeadActivityDebounced","selectedActivityID","selectedActivityType","shouldFollowUp","cleanedFieldConfigControls","defaultFollowUp","updateLeadActivity","cleanedLeadActivity","uuid","LeadBulkActionsButtonContainer","bulkUpdate","selectedLeads","copySelection","limit","ManageLeadsWithSelect","updateLeadSelection","shouldShowSelected","shouldShowLeadActivity","shouldShowLead","handleSelectLead","handleShowLeadActivity","getLeadActivities","New","buildSearchFieldConfig","handleAddContactLead","listStyle","deleteLeadInstallBase","EditLeadModal","LeadActivityListModal","EditLeadActivityModal","getIsManageCustomerQuotesView","hasManageCustomerQuotesSF","salesSFs","hasSalesSFs","toggleQuotesModal","toggleSalesQuotesModal","toggleQuotesDetailsModal","updateSelectedQuote","updateQuoteStatus","cleanedQuote","POFile","poFile","signature","AuthorizedName","QuoteForm","selectedQuoteID","originalQuote","selectedQuoteStatus","contactNames","salesUsers","$field_po_number","$field_notes","acceptQuoteControls","poFileUrl","tos","currentStatus","accepted","manageQuoteQueryParamsEnum","salesContact","QuoteDetailsForm","cleanNotes","leadQuote","cleanQuoteResultObject","quoteResult","selectQuotes","facilitiesByID","filteredQuotes","manageQuotes","$field_comments","$field_pofile","poCloudDocument","$field_authorizedName","$field_signature","signatureCloudDocument","uri","QuoteSalesForm","ManageQuotes","isSalesMode","handleSelectQuote","shouldShow","getQuotes","isManageCustomerQuotesView","MobileQuoteModal","MobileQuoteSalesModal","MobileQuoteDetailsModal","QuoteModal","QuoteSalesModal","QuoteDetailsModal","mapDispatchToProps","ManageLocationForm","newItem","getBreadcrumbs","Breadcrumb","BreadcrumbItem","active","EditLocationForm","selectVisibleLocations","locationManage","locationManageTotalPages","ManageLocation","searchFieldConfigBanner","deleteAction","resetTableFilters","getLocationType","handleBCClick","makeSandwhich","filterLocations","deleteAnyLocation","EditLocationModal","build","newFloor","fl","DragHandle","SortableHandle","SortableItem","SortableElement","setSelectedMeasurementPoint","SortableList","SortableContainer","filterAndSortMeasurementPoints","filteredMPs","MeasurementPointList","onSortEnd","oldIndex","newIndex","newMeasurementPoints","arrayMove","updateSort","withOrderUpdated","keyedMeasurementPoints","selectedTab","useDragHandle","isCustomerView","EditMeasurementPointListForm","isCopying","tabOptions","listTabs","selectedStandard","foundSelectedTab","forJob","handleCreateTab","newTab","setSelectedTabID","handleValueChange","deleteMeasurementPoint","createNewMeasurementPoint","validInitialTab","mainCategoryToSubmit","baseMpl","creatorID","updaterID","mplID","mpt","tabID","measurementPointListTabID","addGlobalMeasurementPointList","handleAddQuestion","handleAddGroup","canEditGlobal","handleCopyClick","preCopyValues","selectMeasurementPointListTabs","selectedList","keyMeasurementPoints","measurementPointsKeyed","measurementPointLists","tabs","measurmentPointLists","allLists","measurementPointsB","newTabs","currentTab","cleanedMPs","EditMeasurementPointListTabForm","EditMeasurementPointListTabModal","EditMeasurementPointListTestProceduresForm","EditMeasurementPointListTestProceduresModal","InputList","addOption","newOption","isDefault","deleteOption","mpo","newSelectOptions","makeDefault","InputGroup","InputListAbstract","trueFalseOptions","getTrueFalseOption","buildMainMeasurementPointControls","isDailyRounds","dailyRoundOptions","reportDefaults","helpText","dedicatedReportPage","smartlinkID","measurementSystem","newDefaultText","coverLetterDefault","annualInspection","defaultCoverLetter","touchpoint","dailyRounds","getSummaryPageDefaultText","commonControls","smartLinkIdOption","measurementSystemOption","EditMeasurementPointForm","persistTimeout","smartlinkDataPoints","dp","getFormConfig","passFailDefault","jobDefaultType","selectedPassFailDefault","tOpt","mpTypes","extraControls","buildPassFailControl","selectedNumericMinValue","selectedNumericMaxValue","selectedNumericAllowDecimals","selectedjobDefaultTypeOption","constructedControls","stUpperCase","buildNumericControl","selectFieldConfig","selectRememberBetweenDevice","selectRememberBetweenInspection","buildCommonNonPassFailControls","mainControls","selectDefaultOptionID","selectOptionsDefault","noValidSelectOptions","formatSummaryText","placeholderSpan","defaultTextIndex","defaultTextValue","defaultOption","dedicatedReportPageFinal","allowNotesValue","cleanedIsRequired","cleanedShowInReport","cleanedAllowNotes","newQ","deleteMP","userCountryCode","saveMeasurementPointToMeasurementPointListHelper","ManageMeasurementPointList","getSmartlinkDataPoints","listType","isAdmin","handleNewJobMeasurementList","handleNewMeasurementList","handleGetAllMeasurementPointLists","getAllMeasurementPointLists","equipmentType","MPList","deleteGlobalMeasurementPointList","EditMeasurementPointListModal","EditMeasurementPointModal","ManageProduct","setProductTableFilterTimeout","resetProductTableFilters","selectedMainCategoryId","productManage","subCategories","ManageProductQueue","getProductQueue","getDefaultReports","runReport","reportTemplateID","sendToExternal","requestData","externalDocuments","getAllReportTemplates","createReportTemplate","newTemplate","errorMessage","updateReportTemplate","updatedTemplate","deleteReportTemplate","getAllChapters","getAllReportTemplateChapters","templateId","createReportTemplateChapter","newTemplateChapter","updateReportTemplateChapter","updatedTemplateChapters","deleteReportTemplateChapter","chapter","setSelectedDefaultReport","defaultReportID","runDailyRoundsReport","selectedTemplate","formGroupRef","inputRefs","externalDocs","setExternalDocs","allJobs","reportTemplateChapterID","jobSelectControl","forDailyRounds","reportTemplateChapters","reportChapter","chapterType","ExternalDocument","externalDoc","el","updatedDocs","clearDocument","handleRunAndSendExternal","canAccessAllCustomers","getCanAccessAllCustomers","setSelectedReport","setSelectedRow","setCurrentTile","setSelectedTemplate","showManageReportModal","setShowManageReportModal","reportTemplates","setReportTemplates","fetchTemplates","fetchedTemplates","templateName","toggleEditTeamUserModal","EditTeamMemberForm","selectedFacilities","facilityOptionsWithAddress","fw","buildUserFromFormValues","filteredSelectedFacilities","updateTeamUser","saveTeamUser","deleteTeamUser","getFacilitiesPromises","teamMember","memberID","ID","TeamManage","setSelectedTeamUserID","lastLoginDate","getUserManage","showEditUserModal","EditTeamMemberModal","team","trainingIDs","TrainingDetailModal","userData","useTranslation","userName","courseName","certificateUrl","credentialIssueDate","credentialValidUntil","score","colwidth","progress","loadCourses","courses","course","foundOnSite","foundWebinar","onSite","getLessonsByCourseID","lessons","sortBy","addLessonToCart","foundCourse","foundLesson","getPurchasedTrainingHelper","ManageTraining","handleSearchChangeViaQueryString","isCourseCompleted","courseOption","courseOptions","convertCourseIDsToOptions","localeCompare","openDetailModal","expandable","brandName","Certificate","More","getSubColumns","existingColumns","unshift","canManageTraining","getManageTraining","querySelectorAll","subRows","_","class","foundRow","UserTrainingDataListView","setIsLoading","fetchData","TrainingListItem","entity","rel","testName","passed","manageUserQueryParamsEnum","UserType","EditUserTrainingForm","filteredCourses","setFilteredCourses","formControls","purchaseOrderNumber","purchaseTraining","PONumber","editUserFormValuesToItem","userType","pCode","convertedFormValues","editUserItemToFormValues","securityOptions","salesManagerOptions","allCountries","selectedUserType","selectedPostalCodes","selectedSalesManager","foundManagerOption","userSecurityFunctionsWithNames","sec","securityfunctionsArrayTranslated","selectedCountries","sc","fullCountry","engineerValidators","EditUserForm","showTrainingModal","setShowTrainingModal","showUserTrainingForm","setShowUserTrainingForm","canEditSAPValues","manageAllUsersId","currentUserSecurityFunctions","every","countryControl","countriesControl","usersCountry","facilitiesFrom","newFacilites","engineerVanID","sapEngineerID","sapObjectID","sapPlant","sapNonProductiveWorkOrderNumber","cleanBrandID","cleanSalesManager","None","salesServiceId","salesPartsId","hasSalesManager","baseControls","getBaseControls","toSubmit","anyError","countryObject","UserTrainingDataModal","SecurityFunctionsList","func","header","UserManageChild","handleSelectUser","getAllBrands","EditUserModal","queryKey","setSelectedUserID","ManageUser","ManageUserChild","handleApproveUser","userQueueID","approveUser","manageUserQueueQueryParamsEnum","UserQueueForm","providedAddress","buildAddress","typeU","engineerValidation","providedCompany","fieldConf","managerID","originalUserQueue","selectedUserQueueID","userQueue","EditQueueUserForm","WorkOrderSource","ManageUserQueue","ApproveCell","blah","rejectUser","getUserQueue","showEditQueueUserModal","EditQueueUserModal","queue","ConfirmSelectJobForm","newJob","showNewJobModal","getJobTypeOptionsForWorkOrder","jobTypes","defaultSAPJobType","SAP","suggestedJobTypeID","forVirtualProduct","sapJobTypes","jobTypeIDs","serviceCenter","isVirtual","ConfirmSelectJobContainer","filteredJobTypes","j","filteredJobsBySAPBusinessIndicator","preFilteredJobs","facilitiesByJobs","selectedFcility","prepJobsOpenRepairAndMaintenanceForOptions","WorkOrderBulkActionsButtonContainer","setSelectedFacilityIDForConfirmSelectJob","showAddToJob","hasSameFacility","workOrderAlreadyAssigned","selectedWorkOrders","woID","firstFacilityID","checkSelection","WorkOrderBeaconTable","verifySAPWorkOrders","anyCommissioningWO","anyReparWO","workOrdersSameSAPType","handleClearSelectedWorkOrders","shouldShowActionButton","tabKey","hasWorkOrder","workOrderNumber","PartsIcon","overrideColumns","WorkOrderBeaconTableContainer","td","NewJobForm","formFacilityID","workOrdersForNewJob","ManageWorkOrder","handleUpdatedData","searchPlaceholder","fseUser","seperator","downloadCsv","shouldEnableWorkOrderForm","preventative","showCloseNoteModal","getFSEsWithWorkOrder","tech","data-tab","NewJobModal","closeAll","manageWorkOrderAdmin","manageWorkOrderPMP","manageCustomerWorkOrders","searchSuggestedParts","partSearch","productSearch","manageSuggestedPartsQueryParamsEnum","toggleEditSuggestedPartModal","ManageSuggestedPartForm","suggestedPartID","originalSuggestedPart","partOption","canManageSuggestedParts","serverTimeLabel","saveSuggestedPart","suggestedPart","cleanedSuggestedPart","EditSuggestedPartForm","checkForProductIdQueryParam","handleSearchNewProductSelect","handleClear","handleAddSuggestedPart","productFromQueryParam","EditSuggestedPartModal","PreventativeMaintenanceExpanderContainer","getPreventativeMaintenancePointCSV","data-readonly","PreventativeMaintenanceTable","PreventativeMaintenanceTableContainer","statusOptions","technicianToDo","lastServicedDate","PMPAnalyticsTableLayout","statusOption","ParentItem","handleClick","isParentOfSelectedChild","childTiles","childTile","collapsed","tile","iconStyle","parentItemStyle","parentItemClassName","cTile","isChild","NavSkeleton","availableTiles","menuSkeleton","parentContainer","parentItem","newParentContainer","buildParentContainer","Item","setCollapsed","classNames","collapse","SideMenu","Items","toggleSideMenu","ProgressColumn","QuizResultColumn","quizName","CourseLessonsClass","handleLessonClick","gfLesson","hasLessonBeenPurchased","lessonPurchased","coursePurchased","cl","getAllLessonProgress","warn","filteredLessons","allLessonsComplete","selectedCourse","lp","round","Media","l","getQuizzesByLessonID","parsedQuizzes","parsedQuestions","question","parsedOptions","quizzes","calculateScore","numCorrect","tot","Lesson","lastUpdate","handlePlayerTimeUpdateThrottled","showTimedQuizMessage","offsetWidth","handlePlayerTimeUpdate","handlePlayerEnded","setCurrentTime","gfQuiz","skipTimedCheck","saveLessonProgress","createLinkElement","failedToLoad","replacementText","primaryVideo","waitingCount","throttle","sm","lessonQuizzes","gfImage","Left","Heading","Right","playerData","timeSpentM","selectedLessonProgress","secondsSpent","duration","seconds","percent","Question","textHighlight","rightOrWrong","radioCheckBox","selectedAnswer","showCorrectAnswer","isAnswer","curQ","correctAnswer","buildOption","QuizButton","isLastQuestion","showCorrectAnswersEnabled","QuizScore","grade","getScoreString","mdOffset","smOffset","xsOffset","toFixed","QuizComplete","retakeQuiz","TimeLeftBanner","timeLeft","Alert","Quiz","quizLoading","quizLoadingTimeout","quizTimer","checkQuiz","checkLesson","shouldShowCorrectAnswers","handleNewAnswer","finishQuiz","nextQuestion","handleTimedQuiz","calculateTimeLeft","setInterval","timeoutWarningShown","reloadExistingQuiz","scrollTo","howManyAnswered","lastAnswer","questionIndex","textAnswer","resetAnswers","isQuizLoading","currentTarget","saveQuizAnswer","addAnswer","saveQuizResult","quizID","setInProgressQuizID","clearInterval","totQ","correctText","wrongText","Answers","Score","TrainingBannerContainer","TrainingBreadcrumbContainer","displayType","thousandSeparator","prefix","memo","formRef","submit","hidden","shortenTitle","ret","TrainingCourse","addCourseToCartCallback","showBuyButton","shoppingCartItem","Panel","Courses","printStudentCourses","gfCourse","addCourseToCart","getAllLessons","transactionNumber","exact","CourseLessons","TrainingCheckoutForm","setLesson","getLessonSuccess","PurchasedTraining","UTATransactionNumber","mockAnalyticsInspection","y","mockAnalyticsPMP","radius","innerRadius","mockAnalyticsSmartlinkAirSystem","guage01","medium","high","guage02","guage03","bar01","line01","countryTemperature","nextService","runningHours","loadedHours","alarms","mockAnalyticsTaeManifold","guage04","isServiceDue","mockAnalyticsQuote","InstallBaseAnalytics","getQuantityFromStatus","categoryOptions","analyticsInspection","getSelectedAnalyticsInspection","failed","repaired","cannotComplete","chartOptions","series","navigateToPass","passT","resultStatusPass","selectedCategory","navigateToFailed","failT","resultStatusFail","navigateToRepaired","repairedT","navigateToNotTested","notTestedT","navigateToCannotComplete","cannotCompleteT","resultStatusCannotComplete","isDemoMode","selectedCategoryWithoutType","updatedData","align","tooltip","formatter","point","chart","spacingTop","spacingBottom","credits","enabled","legend","itemStyle","plotOptions","pie","dataLabels","innerSize","events","click","bigNumberStyle","overflowWrap","wordWrap","right","highcharts","Highcharts","InstallBaseAnalyticsContainer","demo","highchartsMore","solidGauge","PMPAnalytics","totalRef","startCountUp","selectedData","getPMPData","totalCountUp","CountUp","useEasing","PMPData","borderWidth","shadow","valueSuffix","pointFormat","labelWidth","chartWidth","plotHeight","pane","startAngle","endAngle","outerRadius","setOpacity","yAxis","lineWidth","tickPositions","solidgauge","linecap","stickyTracking","rounded","PMPAnalyticsContainer","QuoteAnalytics","unquotedRef","getSelected","selectedAnalyticsQuote","unquotedCountUp","getQuotesLink","data-section","data-icon","showUnquotedLeads","QuoteAnalyticsContainer","HourCard","unitMeasurement","slim","data-slim","data-size","UnitCard","borderColor","barLineLabelStyle","trimmedData","floatTrim","getLastWeekDays","lastWeekDays","lastWeek","getBarChartOptions","dataFormatPreference","categories","labels","xAxis","getLineChartOptions","fmtData","getGuageChartOptions","guage","isDegree","Celsius","Fahrenheit","degree","PPM","getBarChartOptionsDefault","maxPointWidth","getLineChartOptionsDefault","dateTimeLabelFormats","day","spline","marker","getGuageChartOptionsDefault","center","shape","exporting","tickWidth","minorTickInterval","tickAmount","distance","useHTML","isStrFloat","newVal","AnalyticsToggle","isToggled","num","dig","negative","digits","multiplicator","roundTo","dataThreshold","limits","dataPoint","AnalyticsCard","guages","primaryData","graphType","Guague","units","UnitPrimary","hours","Numeric","toggleState","setToggleState","toggleCallback","alarmCount","maxHeight","chartData","pointNumber","unitItem","currentOperatingMode","operatingMode","Off","Automatic","hourItem","cleanDashboardAnalyticsData","dashboardAnalyticsData","getCurrentUser","getInstallBaseIdProp","selectDashboardAnalytics","updatedDashboardAnalyticsData","taeItem","selectAnalyticsDetailsSmartlinkForInstall","selectAnalyticsDetailsTaeForInstall","selectDataFormatPreference","temperature","dashboardData","AnalyticsCardContainer","DashboardAnalyticsLayout","shouldShowInstallBaseAnalytics","shouldShowPMPAnalytics","shouldShowQuoteAnalytics","shouldShowDashboardAnalytics","isUsFacility","hasDashboardTAESecurity","shouldShowTAEAnalytics","DashboardAnalyticsContainer","cleanDefaultReportObject","defaultReport","manageReportReducer","newData","getDefaultReportsReducer","masonryOptions","transitionDuration","getDashboardAnalytics","useQuery","refetchOnWindowFocus","isError","refetch","setDashboardAnalytics","tileElements","flexWrap","userLang","filteredData","filterDashboardAnalytics","secondaryColor","elementType","disableImagesLoaded","updateOnEachImageLoad","SmartLinkDetails","handleUpdateDataDetails","chartPressureOptions","chartLineOptions","chartPressureSecondOptions","chartTemperatureOptions","getAlarms","Placeholder","borderBottom","borderRight","numberString","AnalyticsDetailContainer","installID","SmartlinkDetails","TaeDetails","analyticTAE","chartOption1","chartOption2","chartOption3","chartOption4","chartOption5","getGasType","isDemo","AnalyticsDetailTaeContainer","UnitFooter","bgColor","UnitFooterMode","unitsSorted","labelA","labelB","useHistory","setShowEditReportModal","hourWrap","cardHeight","setCardHeight","runningStatus","dryerGraph","systemMaintenance","unitMaintenance","temperatureWeek","elementOutletTemperature","eventLogs","setEventLogs","section","clientHeight","splitEventsWithMultipleOriginators","sensorData","originator","getEventLogs","eventLogColumns","sensor","time","secondaryData","UnitSecondary","main","MaintenanceInterval","SystemMaintenanceInterval","elementOutlet","elem","Bar","temperatures","Line","dryers","Dryer","data-dark","minHeight","data-hidden","pumpRunStatus","compressorRunStatus","dryerItem","operatingStatus","Manual","maintenanceItem","maintenanceIntervals","due","dueIn","systemMaintenanceIntervals","temperatureData","data-guage","data-line","data-flip","data-mobile","elementOutletData","rawData","barChartData","barData","item1","item2","data-small","guageData","data-offset","data-wide","AnalyticsExpandedCardContainer","locationState","toggleEditReportModal","AnalyticsExpandedCard","rowClickHandler","filterValues","currentPage","setCurrentPage","filteredTemplates","template","matchesBrand","matchesJobType","matchesIsDefault","pageIndex","selectedDefault","translatedJobTypeOptions","setLoading","fetchChapters","updateTemplate","onSortEndHandler","newItems","updatedChapters","openAddChapter","chapterName","reportRevision","handleFormSubmit","isAdd","refetchTemplates","setFormGroup","selectedChapter","isAddingChapter","setChapters","currentChapter","setCurrentChapter","chapterFieldConfig","chapterData","reportChapterId","templateFileName","reportTemplateChapter","showManageTemplateModal","setShowManageTemplateModal","isAddingTemplate","setIsAddingTemplate","showAddChapterModal","setShowAddChapterModal","setIsAddingChapter","setSelectedChapter","setFilterValues","convertedDefault","openAddChapterModal","hasAccess","fluid","ManageTeam","ManangeFacilityQueue","Dashboard","ManageJob","ManageReport","ManageReportBuilder","ManageLeads","ManageFacility","Training","assetStatusProps","pmpProps","alert_icon_white","alert_icon_gold","UserAlertModal","alertsWereCleared","markAllAlertAsRead","alertCounts","userAlerts","backgroundImage","backgroundSize","collapsible","ReactHtmlParser","markAlertAsRead","handleToggle","renderAlertHead","renderBackgroundDiv","renderAlertContent","body","renderAlert","PanelGroup","showUserAlertModal","renderHeader","renderBody","SkipNavLink","SkipNavContent","Tutorial","translateTitles","step","handleJoyrideCallback","STATUS","FINISHED","SKIPPED","setIsTutorialOpen","RUNNING","view","addView","continuous","showSkipButton","arrowColor","overlayColor","primaryColor","textColor","buttonNext","selectedSteps","route","Smartlink","debouncedConnect","setConnection","connections","connectionsToSave","existingConnection","connection","baseUrl","newConnection","HubConnectionBuilder","withUrl","withAutomaticReconnect","listenForMessages","showSmartlinkFlag","addUserAlert","SmartlinkContainer","innerWidth","setWidth","disaptch","handleWindowSizeChange","queryClient","QueryClient","NoMatch","App","doubleCheckOfflineStatus","appLaunchSync","handleLogout","handleSetRedirect","redirectToSocialSignup","PrivateRoute","rest","authenticated","handleNewVersion","reload","fullScreenLoading","msalContext","userLogoutSessionOnly","client","MobileProvider","AccountPending","TwoPaneLayout","TutorialContainer","preventDuplicates","initialIsOpen","withMsal","TrackJSLogger","store","migrations","180","192","193","211","222","223","actionTypeEndsInSuccess","actionTypeEndsInFailed","cleanDocumentObject","groupDocumentObjects","documentManage","newDocuments","parentDoc","parentDocument","versionDocuments","versionIndex","isPrimary","cleanAlertObject","newAlerts","cleanJobCommentObject","manageJobCommentsReducer","foundJobComment","cleanProductQueueObject","productQueueObject","newProductQueueObjects","updatedProductQueueProduct","cleanTaeObject","manageTaeReducer","taes","newQueue","queueObject","newQueueObject","cleanQuizObject","booleanReducer","startTimeReducer","trainingReducer","quizResult","existingQuiz","prog","lessonProgressByID","tutorialReducer","cleanPhotoObject","newState","newPhoto","cleanSuggestedPart","newParts","sapJobMappingReducer","rootReducer","newFacilities","secondaryId","newFacilitiesG","newFacilitiesH","originalFacilityF","quoteFacilities","originalFacilityD","originalFacility","updatedBuildings","updatedFloors","updatedLocations","facilityIDb","originalFacilityb","locationObjectb","facilityIDc","originalFacilityc","locationObjectC","pi","filteredBrands","filteredBrandsOptions","leadU","cleanedAlert","updatedAlert","toastrReducer","replacer","reviver","persistConfig","storage","migrate","createMigrate","blacklist","stateReconciler","hardSet","transforms","createTransform","toDeshydrate","toRehydrate","offlineEnhancer","createOffline","offlineConfig","persist","discard","retries","request","persistedReducer","persistReducer","enhanceReducer","library","faAngleDoubleDown","faAngleDoubleRight","faBars","faCalendarCheck","faCaretRight","faCheck","faChevronCircleDown","faChevronCircleRight","faChevronDown","faChevronLeft","faChevronRight","faClipboard","faClipboardList","faClock","faCog","faDownload","faEdit","faFilePdf","faHistory","faHospital","faInfoCircle","faListAlt","faMinus","faPaste","faPlus","faQuestionCircle","faSearch","faShoppingCart","faSignOut","faSortAmountDown","faSortAmountUp","faTh","faTimes","faUser","faUsers","faWrench","parent","opener","createStore","compose","enhanceStore","applyMiddleware","thunk","middleware","persistor","persistStore","configureStore","axios","common","token","application","host","flush","pause","ReactDOM","fallback","fetch","contentType","unregister","checkValidServiceWorker","waiting","postMessage"],"mappings":";4r3CAAA,IAAIA,EAAM,CACT,qBAAsB,IACtB,mCAAoC,KACpC,6BAA8B,IAC9B,4BAA6B,IAC7B,oCAAqC,IACrC,wCAAyC,IACzC,iCAAkC,IAClC,mBAAoB,IACpB,qBAAsB,IACtB,2BAA4B,IAC5B,yBAA0B,IAC1B,0BAA2B,KAC3B,qCAAsC,IACtC,2CAA4C,IAC5C,gCAAiC,IACjC,sCAAuC,IACvC,wCAAyC,IACzC,8CAA+C,IAC/C,qCAAsC,IACtC,gCAAiC,IACjC,sCAAuC,IACvC,iCAAkC,IAClC,uCAAwC,IACxC,2BAA4B,IAC5B,iCAAkC,IAClC,8BAA+B,IAC/B,oCAAqC,IACrC,0BAA2B,IAC3B,wBAAyB,IACzB,8BAA+B,IAC/B,4BAA6B,IAC7B,8BAA+B,IAC/B,4BAA6B,IAC7B,sBAAuB,IACvB,8BAA+B,KAC/B,+BAAgC,KAChC,+BAAgC,KAChC,gCAAiC,KACjC,8BAA+B,KAC/B,kCAAmC,KACnC,kCAAmC,KACnC,kCAAmC,KACnC,iCAAkC,KAClC,mCAAoC,IACpC,6BAA8B,KAC9B,yCAA0C,KAC1C,kCAAmC,KACnC,oCAAqC,KACrC,6BAA8B,KAC9B,8BAA+B,KAC/B,kCAAmC,KACnC,yCAA0C,KAC1C,0CAA2C,KAC3C,mCAAoC,KACpC,wCAAyC,KACzC,uCAAwC,KACxC,mCAAoC,KACpC,uCAAwC,KACxC,oCAAqC,KACrC,oCAAqC,KACrC,qCAAsC,KACtC,8BAA+B,IAC/B,iCAAkC,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IAA0B,4C,oBCA3CD,EAAOC,QAAU,IAA0B,2C,oBCA3CD,EAAOC,QAAU,IAA0B,kD,oBCA3CD,EAAOC,QAAU,IAA0B,sD,kBCA3CD,EAAOC,QAAU,ktC,kBCAjBD,EAAOC,QAAU,88D,kBCAjBD,EAAOC,QAAU,s3P,kBCAjBD,EAAOC,QAAU,s+G,kBCAjBD,EAAOC,QAAU,07M,kBCAjBD,EAAOC,QAAU,8tF,kBCAjBD,EAAOC,QAAU,8/U,kBCAjBD,EAAOC,QAAU,svW,kBCAjBD,EAAOC,QAAU,k/L,oBCAjBD,EAAOC,QAAU,IAA0B,4C,kBCA3CD,EAAOC,QAAU,83E,kBCAjBD,EAAOC,QAAU,8xO,kBCAjBD,EAAOC,QAAU,kyO,kBCAjBD,EAAOC,QAAU,s5I,kBCAjBD,EAAOC,QAAU,kxH,kBCAjBD,EAAOC,QAAU,sgI","file":"static/js/main.9c8c5f74.chunk.js","sourcesContent":["var map = {\n\t\"./images/Azure.png\": 350,\n\t\"./images/BM_Dashboard_LogoBG.png\": 1236,\n\t\"./images/BeaconLogo@2x.png\": 653,\n\t\"./images/LocationTile.jpg\": 569,\n\t\"./images/MMG Import Template.xlsx\": 656,\n\t\"./images/MMG SAP Import Template.xlsx\": 657,\n\t\"./images/Photo_Placeholder.png\": 472,\n\t\"./images/add.svg\": 473,\n\t\"./images/alert.svg\": 283,\n\t\"./images/alertHeader.jpg\": 574,\n\t\"./images/alertTile.jpg\": 573,\n\t\"./images/beaconHome.jpg\": 1237,\n\t\"./images/beaconManageInventory.jpg\": 419,\n\t\"./images/beaconManageInventoryHeader.jpg\": 420,\n\t\"./images/beaconManageJobs.jpg\": 571,\n\t\"./images/beaconManageJobsHeader.jpg\": 572,\n\t\"./images/beaconManageProductQueue.jpg\": 423,\n\t\"./images/beaconManageProductQueueHeader.jpg\": 424,\n\t\"./images/beaconManageProducts.jpeg\": 578,\n\t\"./images/beaconManageTeam.jpg\": 325,\n\t\"./images/beaconManageTeamHeader.jpg\": 326,\n\t\"./images/beaconManageUsers.jpg\": 562,\n\t\"./images/beaconManageUsersHeader.jpg\": 263,\n\t\"./images/beaconQueue.jpg\": 563,\n\t\"./images/beaconQueueHeader.jpg\": 564,\n\t\"./images/beaconTraining.jpg\": 417,\n\t\"./images/beaconTrainingHeader.jpg\": 418,\n\t\"./images/codeHeader.jpg\": 576,\n\t\"./images/codeTile.jpg\": 575,\n\t\"./images/customerHeader.jpg\": 568,\n\t\"./images/customerTile.jpg\": 567,\n\t\"./images/documentHeader.jpg\": 566,\n\t\"./images/documentTile.jpg\": 565,\n\t\"./images/folder.svg\": 471,\n\t\"./images/icons/BM_Admin.svg\": 1238,\n\t\"./images/icons/BM_Alerts.png\": 1239,\n\t\"./images/icons/BM_Alerts.svg\": 1240,\n\t\"./images/icons/BM_Billing.svg\": 1241,\n\t\"./images/icons/BM_Brand.svg\": 1242,\n\t\"./images/icons/BM_Customers.svg\": 1243,\n\t\"./images/icons/BM_Dashboard.svg\": 1244,\n\t\"./images/icons/BM_Documents.svg\": 1245,\n\t\"./images/icons/BM_Facility.svg\": 1246,\n\t\"./images/icons/BM_HelpManual.svg\": 468,\n\t\"./images/icons/BM_Home.svg\": 1247,\n\t\"./images/icons/BM_InspectionStatus.svg\": 1248,\n\t\"./images/icons/BM_Inventory.svg\": 1249,\n\t\"./images/icons/BM_JobComments.svg\": 1250,\n\t\"./images/icons/BM_Jobs.svg\": 1251,\n\t\"./images/icons/BM_Leads.svg\": 1252,\n\t\"./images/icons/BM_Locations.svg\": 1253,\n\t\"./images/icons/BM_MaintenanceCodes.svg\": 1254,\n\t\"./images/icons/BM_ManageAllTraining.png\": 1255,\n\t\"./images/icons/BM_ManageJobs.png\": 1256,\n\t\"./images/icons/BM_ManageLocations.png\": 1257,\n\t\"./images/icons/BM_ManageProducts.svg\": 1258,\n\t\"./images/icons/BM_ManageTeam.svg\": 1259,\n\t\"./images/icons/BM_ManageTraining.png\": 1260,\n\t\"./images/icons/BM_ManageUsers.svg\": 1261,\n\t\"./images/icons/BM_Measurement.svg\": 1262,\n\t\"./images/icons/BM_NewUserQueue.svg\": 1263,\n\t\"./images/icons/BM_Parts.svg\": 474,\n\t\"./images/icons/BM_Payments.png\": 1264,\n\t\"./images/icons/BM_PreventMaint.svg\": 1265,\n\t\"./images/icons/BM_ProductQueue.svg\": 1266,\n\t\"./images/icons/BM_Quotes.svg\": 1267,\n\t\"./images/icons/BM_Reports.svg\": 1268,\n\t\"./images/icons/BM_Sales.svg\": 1269,\n\t\"./images/icons/BM_StandardText.svg\": 1270,\n\t\"./images/icons/BM_TAE.svg\": 1271,\n\t\"./images/icons/BM_Training.svg\": 1272,\n\t\"./images/icons/BM_TrainingProgress.svg\": 1273,\n\t\"./images/icons/BM_WorkOrders.svg\": 1274,\n\t\"./images/icons/Certificate.svg\": 475,\n\t\"./images/icons/CloseMenu.svg\": 1275,\n\t\"./images/icons/More.svg\": 476,\n\t\"./images/icons/Preview.svg\": 477,\n\t\"./images/icons/alert_animated.gif\": 651,\n\t\"./images/icons/alert_blue.png\": 650,\n\t\"./images/icons/alert_gold.png\": 658,\n\t\"./images/icons/alert_red.png\": 1276,\n\t\"./images/icons/alert_white.png\": 659,\n\t\"./images/icons/gallery.svg\": 1277,\n\t\"./images/icons/select.svg\": 1278,\n\t\"./images/jobCommentsHeader.jpg\": 581,\n\t\"./images/jobCommentsTile.jpg\": 580,\n\t\"./images/locationHeader.jpg\": 570,\n\t\"./images/measurementTile.jpg\": 579,\n\t\"./images/products/01-Pipeline Components.png\": 660,\n\t\"./images/products/06-Liquid Oxygen System (Oxygen).png\": 661,\n\t\"./images/products/08-Oxygen Concentrator Systems (Oxygen).png\": 662,\n\t\"./images/products/AGS System_D2.png\": 663,\n\t\"./images/products/Gas outlets.png\": 664,\n\t\"./images/products/Instrument-Surgical (Air).png\": 665,\n\t\"./images/products/Medical Air Systems (Air).png\": 666,\n\t\"./images/products/Medical Air-01.png\": 667,\n\t\"./images/products/Medical Pipeline-01.png\": 668,\n\t\"./images/products/Medical Vacuum-01.png\": 669,\n\t\"./images/products/Monitoring.png\": 670,\n\t\"./images/products/Patient Environment-01.png\": 671,\n\t\"./images/products/Valves.png\": 672,\n\t\"./images/products/manifold.png\": 673,\n\t\"./images/quotesHeader.png\": 416,\n\t\"./images/quotesHeader@2x.png\": 1279,\n\t\"./images/quotesTile.jpg\": 415,\n\t\"./images/reportTile.jpg\": 421,\n\t\"./images/trainingProgressHeader.jpg\": 324,\n\t\"./images/trainingProgressTile.jpg\": 323,\n\t\"./images/workOrderHeader.jpg\": 422,\n\t\"./images/workOrderTile.jpg\": 577\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 1235;","module.exports = __webpack_public_path__ + \"static/media/BM_Dashboard_LogoBG.382c2c09.png\";","module.exports = __webpack_public_path__ + \"static/media/beaconHome.c0f7889b.jpg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Admin.98055d25.svg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAAEACAYAAAC010pkAAAACXBIWXMAAGBAAABgQAHWJdQIAAAQD0lEQVR4nO3d/VEbSRrH8W7X/X9ksM5gcQSLI7CJwCYC4wiwIwBHIDsC2AjAEcBFABmIi6Cv2vuoPMdIoJnpl+fp/n6qtlwlbdmjkX7T790O84UQDkMIX0IIt2EsvvYxhHDQ2y0OIRyFEFYhhPWTu7KW17u8L6gohPB+x49yl/v4Q+7hO4thDCGc77gP28SH22kI4fXoLwMS/CBjWC8nhHWbj6O/uCES2m01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z3jdZ7rbnEPR+9ApRzGEL4qPV+qwyu3LDXozeAss603m+tJe6n0StAea+lyaaOuuBKpwAdUtDincZvQmOJy1RGaEKJu6e/FF4T+nUQQlDX36IxuKz0gTYEdw9UlaGNuj4XdsAAXqauFkhwAYM0BtfkjgRomrqtbjQG18xiZnSD4O7B/EZeaI66wkRjcH+OXgHqedC4oZzG4F6NXgHqUfl7VBdceboRXmjxQ+M3oXU46NvoFaC8G607P6oMrvf+Jt600RtAWV+13m/NEzBOGNNFRRdSgKikNrhyvsvn0RtAfneaS1unfcqjbJFpYoNqNONRtmdVXduzcpLByjmnduMuNCOG9a2Fo0hMLDLw3p9or7rAvDsroXUGD/2Ka3VX7ACJxC5iwWDpyE2T5+OGEL7I2bgEGEvEiT6fLR50bfpEetk68x2HW2OCzaHWV5ZPpjcd3CHZ0IsSGDtpHpcFAAAAAAAAAAAABpoZx7WixfFmxkfL+1dvH1iBj5pPOp+JAqAwjiABDCK45bV2UgPV5AoIbnnso4XFCG55rZW4nPVUAcEtTBZrt3Q+0n9GryA7gltHS+1C2rgVENw6WjnY7MHyYnTLCG4drZyNxBlPlRDcCho62EzlgVg9ILj1WD/YTO2BWD1gqlpFIYR7w/OW3zJHuR5K3LpOjF73DaGti+BWZPg4UU6VqIzg1mftOFHVx0/2guBWZuw4UfXHTwJFxRMJg27rEMIhvwod6FVWJIRw7Zw7Unp59CIrQlVZl2Olq21OCC3wjBDCQQjhUkmleS0HqwHYRwjhfBSjsu5p0wIzxNJOSr3SYonPsaXAXFJ1LlX63sup/wBSiPsxZxwyioH9yBcFZCIBPpWwLbGWBwGdTwYxjmuYnIoQq7Z/ySqj56q5D/LfTxYJGOec+x9tjtubowIs0gAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/BM_Alerts.6f6b91c7.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Billing.7cbcf18d.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Brand.d05ff31b.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Customers.d6a310b5.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Dashboard.e813a7e7.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Documents.2574f398.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Facility.b2c4c0c6.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Home.1217a504.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_InspectionStatus.a17f3b80.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Inventory.6910be55.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_JobComments.670558dd.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Jobs.dcdada83.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Leads.c29f925d.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Locations.3ab4451d.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_MaintenanceCodes.609cb903.svg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA8FJREFUeNrsnY+N2jAUh+OKARiBbsAIxwQd4cIGxwSlE6SdIGxQdYKjE8AGZQOygWufjHSCCMWJk9jP3yelOanKEd7vyx/Mu1gVAdFal2b1zSzLlv9uzPJHKXUo4FkNX8zq1SyrpGpodrzW3Xgn5sE1PJllGdOO77Ufe+J+PHt61rCKaef/ee78lcgfavjuWUMd4nVVoJ333hlzHVPEPn8Nv1D6vEEABAAEAAQABAAEAAQABAAEAAQABADxLG4/uEYE28yxnuKF6QuYrYYXs/y9NZUo94tqsyopaVaczbJRrjnjO/XIkoNyzRlLapEnKlRnCfApABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEABmYtFzuw2lixL78Mj16AIopY7UOj601g2XAEAAQABAAEAAQABAAEAAQABAAEAAQABAAECAsdBar++m0ati32E9x3x1g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r+u4KQNOnv/RBD8eqQrV14TTDt2BMC28VbFJd5FDge/iHTkylbJPo/YEYCUxvX6nyk47XWTmnKIwa+lmKOhzc2EdYgfAUhxXF52SsF5s1yaSEITO2Yp6H+q6rKuVBMgq6fwYtxIoBH8i9lLuvME+H8D7lOcuz/TAQLMVNAXF3zeF6Iu8SYAGfGUIgmmRhj8qYq6PhWyPvEngKZjX7JZHFC2/5JrRE0MAciYGYoOtlIn0CjzUWZY8lmiCICOfkXR0aE2ETWaej7ZkMkTwJ7DF4fRWUSdPItdImTiCaDZu4ayVrLbmLp31yrqsML2TOdEEoAMK9TICbCbtaFA2g0Vu6sj661MLAEMigNccdvSIM2WzFW7TnRVJ5oABiQ4rNPtSt3Th+MS/FQQIIsE8xUDcxLQRyGNPvSMisyPepAqFQTIaiK+qLHPzzDGu4dp7C/0oiPjEukgQJbBkzX2/RmT431jNPYTmuSQP9JFAM2xg2qDhr9pvOdXjvkifQQgw3GjykuKwZtD9YlavvoO5JjWSAf9EO0uYREbfxdc3gSodAAto+twhWfw4Mm7wQdrXCSAUhyTRAByAB6vhgc1Ng4pieOAIWD/dkftV7q/wEuYUGB6ezJn9VYVPAWkt6vB15HEEYBI8DGRYKfga3dS8D9Okq8SSQAiwRdwwZ03JQ6VwHfcAe8sT5yjktIKyGEfjiQu8vVlkcvrEPLNQJ5TcMu6P2gEf7oveNhVngDRO2eiQvCfTkOOnioCkIMeDejqxb89kpYiPXUEICf9ooZew0thztnPE8CxDiPAO37F6RyIUupESlWlPpOEYOZFX/4twAACr8bJMiIl2QAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/BM_ManageProducts.0e8a22d7.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_ManageTeam.96937648.svg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABZlJREFUeNrsnYFV2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d137vgrYdjPT4yGYvmcBI+ORmkVZWpaCbfL1tc7Bp6WeTM8XWexzWzgNe5QQYsGvhxGXM6P0tg6zWht4YLs0DMfaJuU+vgDOBSAOAAEACABAAAACABAAgAAApEex3hzamH83UFQJ2nYd8Ho0q3R4cSa5aOPSmyli2vg15TzG2+pACannMX3ZWCKBFBK9eGuVjGPndIBkEmGPpzrQSt+DR6eLJtFVLACc+hhuw4C0ahjbdS7HvK3dtw5RQBADAHRhRKd97zwSPEX0TpXWobd1/pQAOOh6gIQNGNOdPtI60Agw6AUVQ08DHySGWz8bSeMnXYehAXgUD12rQxZNBACE1GHz1hIEgoTxgtS1BABylRkAUGoG4CgggLWLCyPqHQzBQ9chaQBOAi6MkMYB7sxqu7rla2nHnJrl1MjOJA5Rh90pgmjktaTnCMLCP30vjoy4DjtXLGsBk47Gm/bR+IEQnPRch6wB8IZAaLhK0EO/CiCbpNT4sQHw1mqgdCVtJnXQuFF3uRoY3Ypm7BdGkIe+PkAidbTOBZdT/+mpRr5gs8s69CYNB0NC8vJQ42d9mXT2W8IC8/I0udsnewAC5ugqpGFTaMjB0woApK+zgGc/5m4cDU6gND0r9f4ZRoD0VXT15Dc2n8IHyEQVB2gKj8YvueePAEBeojn9/LWwMO8znBtFGUu0Zgghf6A2f1PaHrHHr27KiBQxiANAAAACABAAgAAABAAgAAABAAgAQAAAAgAQAIAAAAQAIAAAAQAIAEC5AVDDDGpVWz6OPYctVGr8zlpLx5fHGAl09XyzOiyz+C3AAH5T+oJTgY07AAAAAElFTkSuQmCC\"","module.exports = __webpack_public_path__ + \"static/media/BM_ManageUsers.ba2a426e.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Measurement.6ccb7d1e.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_NewUserQueue.f612a92a.svg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYW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ABAAAAEAEAAAAQAQAAABABAAAAGAxAlQQgzZoqTtYCowmEMWWaJ1wZ20W7AEec18x99k/E+AAQDz8652FWrs5AAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/BM_PreventMaint.b62b0858.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_ProductQueue.a8ede79c.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Quotes.d9981586.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Reports.df29a369.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Sales.8c36c4a9.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_StandardText.908a57f5.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_TAE.2a22c9d6.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Training.35f98002.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_TrainingProgress.e0b20dee.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_WorkOrders.7cbcf18d.svg\";","module.exports = __webpack_public_path__ + \"static/media/CloseMenu.f605c66a.svg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAjCAYAAAD17ghaAAAABHNCSVQICAgIfAhkiAAAAzdJREFUWIXtWMF121YQnGGgs8H3CF3DVCCkglAVZFWBoQpMVyCqAlMVmKoAqwpEVxClAlNXgu+ROgvK5ACAhilAICW/lxw8x/3/7wx39+9fkOjA2ix8BN4DSACER8Bp333RtDczG4P8JGnWI32Qpjdd/oMO4k85mbBmf5TCtjMCYgIgmQhIlmaLHjkZpOl12xk2GTOzMYALkBXZgyQnMIvc5y/9opVZ8g85JnDyTZnmAj4eu9+9KGBtFuZACnJUEUOaBMCs775Zmw1z8tcoTb/sOlqbhTl5Uq0tzWKSEwB/bsmk84H7rH6uV3fwCNzWyG8CaRi5T3MgzszSnPwKYL4yS3YF5KQDmGdm68zs4ghYRGlqlM4A3AOAyM+7Z3t1cpJxpTRKUwOAzCwFeQvSqqgIeFaElIrwkiHISQ58XZklA3cPpFjA35WIzGzyXQqyszOvQlWFaWkWA0hJDsu995QmvwDed99kZiMB7wlsAuCyStETMBaZAHgHAJJmx+7nZYpm25RIp5H7nNXVKY0fI/fp0ixmkY6wbq9Ul/n9a/vzpXnkflpL57Ak+2NXxCM5J3ACaRMAv/W25MBN5D5dm4UoCjFEUf2/18nLsBm+M2zrBgDQd19EaTqSdF0sM8nMJn33DaQEwAPIMAfGPUiXKAquKo6wCrukUdPV2RfH7kklAmV9HbvfURoD+CLAG/vA0iw+Aja7Ha+8ph8EJLXaKCDNCVwN3H3XX2Y2CoC7vvtmd61RQBMysxG+paYdkgfAeRNZE/YSkJmNQN7us7fQoLvyzegU0evasC3KA0AyfgIm3Tv3EPAETDrD3gCRH9Zmw659nQLKpvIq5MUT/noBZTd891oBu/3hYAEEDg59HZI6xXem4C2oHrf/TMA++Cngp4BWAWuzUPXJ9pUoe0krGh+jlVki8vNbyStIWrR90DyLwNos/JHkAEBy+NjyODWl4E3d7wURjX6fCei7L7Zj1I+ENG0ytw4k5QTU+ZjsgU1QjPKNH7R7j2QVVmbWdjsC4LqNqA2tX8dtEBCDvGhe1NWh/g5uRAEwBfCwa6d0te8g+iYBffeNpBGA6s+He0iXA/fxob7+F/gXg0OEryvwIDMAAAAASUVORK5CYII=\"","module.exports = __webpack_public_path__ + \"static/media/gallery.e1794000.svg\";","module.exports = __webpack_public_path__ + \"static/media/select.09ec8f5a.svg\";","module.exports = __webpack_public_path__ + \"static/media/quotesHeader@2x.59a0c04f.png\";","var map = {\n\t\"./01-Pipeline Components.png\": 660,\n\t\"./06-Liquid Oxygen System (Oxygen).png\": 661,\n\t\"./08-Oxygen Concentrator Systems (Oxygen).png\": 662,\n\t\"./AGS System_D2.png\": 663,\n\t\"./Gas outlets.png\": 664,\n\t\"./Instrument-Surgical (Air).png\": 665,\n\t\"./Medical Air Systems (Air).png\": 666,\n\t\"./Medical Air-01.png\": 667,\n\t\"./Medical Pipeline-01.png\": 668,\n\t\"./Medical Vacuum-01.png\": 669,\n\t\"./Monitoring.png\": 670,\n\t\"./Patient Environment-01.png\": 671,\n\t\"./Valves.png\": 672,\n\t\"./manifold.png\": 673\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 1466;","// import { constants } from './constants/constants';\r\n\r\n// export enum installBaseStatusColorEnum {\r\n// \"Not Tested\" = constants.colors.darkGrey,\r\n// \"Pass\" = constants.colors.green,\r\n// \"Fail\" = constants.colors.red,\r\n// \"Cannot Complete\" = constants.colors.darkRed,\r\n// \"Repair\" = constants.colors.darkGreyText\r\n// }\r\nexport enum DocumentGroups {\r\n financeAndPlanning,\r\n leaglAndQSHE,\r\n reports,\r\n techSupport\r\n}\r\n\r\nexport enum leadActivityTypesEnum {\r\n email,\r\n phone,\r\n other\r\n}\r\n\r\nexport enum measurementPointResultStatusTypesEnum {\r\n resultStatusNotTested = 0,\r\n // resultStatusIncomplete = 1, // We removed this 11/2019\r\n resultStatusFail = 2,\r\n resultStatusPass = 3,\r\n resultStatusCannotComplete = 4,\r\n resultStatusRepaired = 5,\r\n resultStatusMaintain = 6,\r\n resultStatusCommissioned = 7\r\n}\r\n/*\r\n * menuParentKeysEnum helps determin which parent menu item a child item should display\r\n */\r\nexport enum menuParentKeysEnum {\r\n default,\r\n admin,\r\n facility,\r\n documents,\r\n sales,\r\n dashboard\r\n}\r\n\r\nexport enum workOrderPartsTypeEnum {\r\n hours = 1,\r\n part = 0\r\n}\r\n\r\nexport enum measurementPointTypes {\r\n QUESTION_PASSFAIL = 1,\r\n QUESTION_TEXT,\r\n QUESTION_NUMERIC,\r\n QUESTION_SELECT,\r\n GROUP,\r\n DATE\r\n}\r\n\r\nexport enum jobDefaultTypeEnum {\r\n staticPressureValue,\r\n dynamicFlowRate\r\n}\r\n\r\n// This is not the actual statuses, but more of a filter, the API will resolve this to the correct statuses when filtering\r\nexport enum jobStatusEnumForFilter {\r\n All = 0,\r\n Active = 1,\r\n Completed = 2\r\n}\r\n\r\nexport enum measurementSystemEnum {\r\n None = 0,\r\n Celcius,\r\n Bar,\r\n HG,\r\n KPA,\r\n Minutes,\r\n PPM,\r\n PSI,\r\n Fahrenheit,\r\n Hours,\r\n Days\r\n}\r\n\r\nexport enum facilitySiteSizeEnum {\r\n lessThanFive = 1,\r\n sixToTwenty,\r\n twentyOneToFifty,\r\n fiftyOneToOneHundred,\r\n oneHundredOneToThreeHundred,\r\n threeHundredOneToSevenHundred,\r\n greaterThanSevenHundred\r\n}\r\n\r\nexport enum workOrderTypesEnum {\r\n repair = 1,\r\n pmp,\r\n warranty,\r\n servicePlan,\r\n commissioning\r\n}\r\n\r\nexport enum workOrderStatusEnum {\r\n new = 1,\r\n complete,\r\n reopened,\r\n open,\r\n notApplicable,\r\n planning\r\n}\r\n\r\n// This is not the actual statuses, but more of a filter, the API will resolve this to the correct statuses when filtering\r\nexport enum workOrderStatusEnumForFilter {\r\n All = 0,\r\n Completed = 1,\r\n New = 2\r\n}\r\n\r\nexport enum workOrderResultStatusEnum {\r\n none,\r\n repair,\r\n maintenance\r\n}\r\n\r\nexport enum workOrderDateRangeUnumForFilter {\r\n lessThanThreeMonths = 1,\r\n lessThanSixMonths,\r\n greaterThanSixMonths\r\n}\r\n\r\nexport enum workOrderPrioritiesEnum {\r\n highRisk = 1,\r\n lowRisk,\r\n infectionControl\r\n}\r\n\r\nexport enum workOrderVendorsEnum {\r\n internal = 1,\r\n other,\r\n beacon\r\n}\r\n\r\nexport enum workOrderTabEnum {\r\n beacon = 'beacon',\r\n repair = 'repair',\r\n preventative = 'preventative'\r\n}\r\n\r\nexport enum dateRangeEnum {\r\n lastYear = 'lastYear',\r\n lastQuarter = 'lastQuarter',\r\n thisYear = 'thisYear',\r\n thisQuarter = 'thisQuarter'\r\n}\r\n\r\nexport enum dataFormatTemperatureEnum {\r\n celcius,\r\n fahrenheit\r\n}\r\n\r\nexport enum dataFormatEnum {\r\n none = 0,\r\n date,\r\n numberTruncate,\r\n countryTemperature,\r\n celcius,\r\n fahrenheit,\r\n secondsToHoursTruncated,\r\n pascalToPSITruncated,\r\n ppm,\r\n pascalToHGTruncated\r\n}\r\n\r\nexport enum dataUnitEnum {\r\n none = 0,\r\n Celsius,\r\n Bar,\r\n Hg,\r\n KPA,\r\n Minutes,\r\n PPM,\r\n PSI,\r\n Fahrenheit,\r\n Hours,\r\n Days\r\n}\r\n\r\nexport enum leadTypeEnum {\r\n InspectionDeficiency,\r\n OldEquipment,\r\n FSERequestSupport,\r\n UnreliableEquipment,\r\n NewEquipment,\r\n IncompliantEquipment,\r\n ContactForSupport,\r\n Connectivity,\r\n Maintenance,\r\n EquipmentIsNotSupported,\r\n NewWorkOrder,\r\n OldContract,\r\n Shutdown\r\n}\r\n\r\n/*\r\n New - No results have been saved for the job\r\n Started - Results are in the job\r\n Completed - Leader has clicked complete button\r\n Reopened - Leader reopened the job after closing\r\n */\r\nexport enum jobStatusEnum {\r\n new = 'New',\r\n started = 'Started',\r\n completed = 'Completed',\r\n reopened = 'Reopened'\r\n}\r\n\r\nexport enum jobTypesIdEnum {\r\n Audit = '80eedbac-ec22-45ef-9ac7-f2eb4be2db4c', //\r\n Commissioning = '1ff033de-c0b6-4f4d-bdb7-7893053092d8',\r\n Inspection = '524235fd-4633-4b7a-9c13-c37fc39efe69',\r\n Repair = 'ae78eaa3-89c2-490a-90c6-44e5cfa10b01', // work order based\r\n Verification = '9c7fde18-0b94-4af8-b4aa-913c40e5aed0',\r\n Maintenance = '86198f73-1a58-4989-a205-13a42a157989', // work order based\r\n agsRebalancing = 'bbfd50fe-a790-4384-8a29-00995e5d7158',\r\n warrantyBM = '6a70ced7-37ce-48c1-92ae-7db47981f896',\r\n nonProductive = '2AC3BFC5-18FE-4EF1-BFCA-ADF46125AB10',\r\n servicePlan = '909770e7-54f9-4d7e-8854-0cb5bdc800ad'\r\n}\r\n\r\nexport enum jobTypesIdEnumForSelect {\r\n Audit = '80eedbac-ec22-45ef-9ac7-f2eb4be2db4c', //\r\n Commissioning = '1ff033de-c0b6-4f4d-bdb7-7893053092d8',\r\n Inspection = '524235fd-4633-4b7a-9c13-c37fc39efe69',\r\n Repair = 'ae78eaa3-89c2-490a-90c6-44e5cfa10b01', // work order based\r\n Verification = '9c7fde18-0b94-4af8-b4aa-913c40e5aed0',\r\n Maintenance = '86198f73-1a58-4989-a205-13a42a157989', // work order based\r\n agsRebalancing = 'bbfd50fe-a790-4384-8a29-00995e5d7158',\r\n warrantyBM = '6a70ced7-37ce-48c1-92ae-7db47981f896',\r\n nonProductive = '2ac3bfc5-18fe-4ef1-bfca-adf46125ab10',\r\n servicePlan = '909770e7-54f9-4d7e-8854-0cb5bdc800ad'\r\n}\r\n\r\nexport enum jobTypesIdEnumInverse {\r\n '80eedbac-ec22-45ef-9ac7-f2eb4be2db4c' = 'Audit',\r\n '1ff033de-c0b6-4f4d-bdb7-7893053092d8' = 'Commissioning',\r\n '524235fd-4633-4b7a-9c13-c37fc39efe69' = 'Inspection',\r\n 'ae78eaa3-89c2-490a-90c6-44e5cfa10b01' = 'Repair', // work order based\r\n '9c7fde18-0b94-4af8-b4aa-913c40e5aed0' = 'Verification',\r\n '86198f73-1a58-4989-a205-13a42a157989' = 'Maintenance', // work order based\r\n 'bbfd50fe-a790-4384-8a29-00995e5d7158' = 'agsRebalancing',\r\n '6a70ced7-37ce-48c1-92ae-7db47981f896' = 'warrantyBM',\r\n '2AC3BFC5-18FE-4EF1-BFCA-ADF46125AB10' = 'nonProductive',\r\n '909770e7-54f9-4d7e-8854-0cb5bdc800ad' = 'servicePlan'\r\n}\r\n\r\nexport enum measurementPointListTypeEnum {\r\n annual = 1,\r\n verification,\r\n touchpoint, // maintenance and repair\r\n agsRebalancing,\r\n purity, // a single list for a verification job\r\n verificationChecklist, // a single list for a verification job\r\n audit,\r\n Commissioning,\r\n dailyRounds,\r\n servicePlan\r\n}\r\n\r\nexport enum measurementPointListTypeForJobEnum {\r\n annual = 1,\r\n verification,\r\n touchpoint, // maintenance and repair\r\n agsRebalancing,\r\n audit = 7,\r\n Commissioning\r\n}\r\n\r\nexport enum productLinkTypeEnum {\r\n specificationSheet = 1,\r\n salesBrochure,\r\n operationManual,\r\n sparePartsBook,\r\n certificate,\r\n other\r\n}\r\n\r\nexport enum reportTypeEnum {\r\n annualInspection = 1,\r\n jobNotes,\r\n HTM,\r\n visit,\r\n agsRebalancing,\r\n verification,\r\n audit,\r\n commissioning,\r\n dailyRounds\r\n}\r\n\r\nexport enum reportTypeIdEnum {\r\n 'ppmInspection' = '864ae841-fc3d-4ff6-a44f-1d38c6c49fb5',\r\n 'annualInspection' = '19502e5b-3389-436f-8f9a-331d2e7d80d4',\r\n 'verification' = 'a3b37df8-b18d-4507-9efb-7431b505af41',\r\n 'repairWarrantyMaintenance' = '355af604-5f03-42aa-a398-79b566deab1c',\r\n 'jobCommentDeficiency' = 'da1ada41-be53-4214-a66d-7eec693e15cf',\r\n 'agsRebalancing' = '1855041c-f64b-4e46-b147-8ed5a0867ef8',\r\n 'siteSurveyAudit' = '311769cf-c16b-4219-b26e-93c61739616c',\r\n 'dailyRounds' = '0ff13067-d224-4ba7-883b-9cc07788b55a',\r\n 'medicalGasPipelineSystemCommissioning' = '1b18a87b-1d0e-4107-9645-c8745d7914f7',\r\n 'servicePlan' = 'f5e41921-77a7-4b13-a6f9-fbf1b7786afa'\r\n}\r\n\r\nexport enum reportTypeId {\r\n '864ae841-fc3d-4ff6-a44f-1d38c6c49fb5' = 'ppmInspection',\r\n '19502e5b-3389-436f-8f9a-331d2e7d80d4' = 'annualInspection',\r\n 'a3b37df8-b18d-4507-9efb-7431b505af41' = 'verification',\r\n '355af604-5f03-42aa-a398-79b566deab1c' = 'repairWarrantyMaintenance',\r\n 'da1ada41-be53-4214-a66d-7eec693e15cf' = 'jobCommentDeficiency',\r\n '1855041c-f64b-4e46-b147-8ed5a0867ef8' = 'agsRebalancing',\r\n '311769cf-c16b-4219-b26e-93c61739616c' = 'siteSurveyAudit',\r\n '1b18a87b-1d0e-4107-9645-c8745d7914f7' = 'medicalGasPipelineSystemCommissioning',\r\n 'f5e41921-77a7-4b13-a6f9-fbf1b7786afa' = 'servicePlan'\r\n}\r\n\r\nexport enum myMedGasContractEnum {\r\n None = 1,\r\n MMGService,\r\n MMGCare,\r\n MMGCarePlus\r\n}\r\nexport enum inspectionContractEnum {\r\n Won = 1,\r\n Quoted,\r\n Lost,\r\n Renewal,\r\n Unknown,\r\n RenewalOffer\r\n}\r\n\r\nexport enum productCommunicationMethodEnum {\r\n none,\r\n TAE\r\n}\r\n\r\nexport enum leadStatusEnum {\r\n New,\r\n Quoted,\r\n Won,\r\n Lost,\r\n InProgress,\r\n Archived,\r\n ReadyForQuoting\r\n}\r\n\r\nexport enum leadStatusEnumSelect {\r\n New = 0,\r\n Won = 2,\r\n Lost,\r\n InProgress,\r\n Archived,\r\n ReadyForQuoting\r\n}\r\n\r\nexport enum leadRankingEnum {\r\n Low,\r\n Medium,\r\n High\r\n}\r\n\r\nexport enum beaconContactTypeEnum {\r\n fse\r\n}\r\n\r\nexport enum quoteStatusEnum {\r\n new,\r\n requestChanges,\r\n accepted,\r\n rejected,\r\n shelved\r\n}\r\n\r\nexport enum widgetsEnum {\r\n inspectionStatus = 'inspectionStatus',\r\n preventativeMaintenance = 'preventativeMaintenance',\r\n tae = 'tae',\r\n quotes = 'quotes',\r\n smartlinks = 'smartlinks'\r\n}\r\n\r\nexport enum userTypeEnum {\r\n None,\r\n Hospital,\r\n Contractor,\r\n Plumber,\r\n Engineer,\r\n Internal,\r\n 'Surgery Center'\r\n}\r\n\r\nexport enum userLanguageEnum {\r\n English,\r\n French,\r\n German,\r\n Spanish,\r\n Thai,\r\n Chinese\r\n}\r\n\r\n// Profile settings\r\nexport enum userTempUnits {\r\n Celsius = 0,\r\n Fahrenheit\r\n}\r\n\r\nexport enum userPressureUnits {\r\n PSIG = 0,\r\n BAR\r\n}\r\n\r\nexport enum UserVacuumUnits {\r\n mbar = 0,\r\n inHg = 1\r\n}\r\n\r\nexport enum UserPowerUnits {\r\n HP = 0,\r\n kW = 1\r\n}\r\n\r\nexport enum UserFlowUnits {\r\n lm = 0,\r\n ls = 1,\r\n cfm = 2,\r\n m3h = 3\r\n}\r\n\r\nexport enum UserCurrency {\r\n USD = 0,\r\n GBP = 1,\r\n EUR = 2\r\n}\r\n\r\n// Dashboard\r\nexport enum GraphType {\r\n Guague = 0,\r\n Numeric,\r\n Bar,\r\n Line,\r\n UnitPrimary,\r\n UnitSecondary,\r\n MaintenanceInterval,\r\n SystemMaintenanceInterval,\r\n Dryer\r\n}\r\n\r\nexport enum GraphSize {\r\n Third = 0, // 33%\r\n Half, // 50%\r\n TwoThird, // 66%\r\n Full // 100%\r\n}\r\n\r\nexport enum RunStatus {\r\n NotRunning = 0,\r\n Running\r\n}\r\n\r\nexport enum OperatingMode {\r\n Off = 0,\r\n Manual,\r\n Automatic,\r\n ManualOverrideOff,\r\n ManualOverrideOn,\r\n EmergencyManual,\r\n EmergencyManual2,\r\n Purge\r\n}\r\n\r\nexport enum ReportChapterStatus {\r\n Legacy = 0,\r\n NotStarted = 1\r\n}\r\n\r\nexport enum ReportChapterType {\r\n CoverPage = 0,\r\n CoverPage_No_Job,\r\n CoverPage_ServicePlan,\r\n Exec_Summary,\r\n Job_Level_MP,\r\n Deficiencies,\r\n MeasurementPoints_Landscape,\r\n MeasurementPoints_Portrait,\r\n VisitParts_and_Hours,\r\n Signature_Authorization,\r\n Last_Page,\r\n AGSS_Summary,\r\n ExternalDocument\r\n}\r\n","// msalInstance.js\r\n\r\nimport {\r\n EventType,\r\n LogLevel,\r\n PublicClientApplication\r\n} from '@azure/msal-browser';\r\n\r\nclass MsalInstance {\r\n public debug(error: any) {\r\n let showLogs = false;\r\n if (showLogs) {\r\n console.error('[debugMSAL]: ', error);\r\n }\r\n }\r\n // Config settings for the PCA - set in index.tsx\r\n // Information about all of the config options and what they do can be found here\r\n // https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md\r\n public msalConfig = {\r\n auth: {\r\n clientId: `${process.env.REACT_APP_MSAL_CLIENT_ID}`,\r\n authority: `https://${process.env.REACT_APP_MSAL_TENANT_NAME}.b2clogin.com/${process.env.REACT_APP_MSAL_TENANT_NAME}.onmicrosoft.com/${process.env.REACT_APP_MSAL_SIGNIN_POLICY}`,\r\n knownAuthorities: [\r\n `${process.env.REACT_APP_MSAL_TENANT_NAME}.b2clogin.com`\r\n ],\r\n postLogoutRedirectUri: `${process.env.REACT_APP_HOST_DOMAIN}`,\r\n redirectUri: `${process.env.REACT_APP_HOST_DOMAIN}`,\r\n navigateToLoginRequestUrl: false\r\n },\r\n cache: {\r\n cacheLocation: 'localStorage',\r\n storeAuthStateInCookie: false\r\n },\r\n system: {\r\n loggerOptions: {\r\n loggerCallback: (\r\n level: LogLevel,\r\n message: string,\r\n containsPii: boolean\r\n ): void => {\r\n if (containsPii) {\r\n return;\r\n }\r\n switch (level) {\r\n case LogLevel.Error:\r\n this.debug(message);\r\n return;\r\n case LogLevel.Info:\r\n this.debug(message);\r\n return;\r\n case LogLevel.Verbose:\r\n this.debug(message);\r\n return;\r\n case LogLevel.Warning:\r\n this.debug(message);\r\n return;\r\n }\r\n },\r\n piiLoggingEnabled: false\r\n },\r\n windowHashTimeout: 60000,\r\n iframeHashTimeout: 6000,\r\n loadFrameTimeout: 9000,\r\n asyncPopups: false\r\n // If you ever need to test forcing a token to expire\r\n // https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/810\r\n // tokenRenewalOffsetSeconds: 301\r\n }\r\n };\r\n\r\n private static instance: MsalInstance;\r\n public msalApp: PublicClientApplication;\r\n\r\n public reinstantiateMsal() {\r\n this.msalApp = new PublicClientApplication(this.msalConfig);\r\n }\r\n\r\n private constructor() {\r\n this.msalApp = new PublicClientApplication(this.msalConfig);\r\n\r\n /*\r\n * After you complete a successful password reset, you recieve back a token, but\r\n * this token cannot be used for sign-in. So check the tfp field in the payload for the\r\n * name of the password reset policy, if you find it, logout and clear the token so the user\r\n * won't get an error when trying to sign in after changing their password.\r\n */\r\n this.msalApp.addEventCallback((event: any) => {\r\n if (event.eventType === EventType.LOGIN_SUCCESS) {\r\n if (\r\n event.payload.idTokenClaims['tfp'] ===\r\n `${process.env.REACT_APP_MSAL_FORGET_PASSWORD_POLICY}`\r\n ) {\r\n this.msalApp.logoutRedirect({\r\n postLogoutRedirectUri: '/',\r\n account: event.payload.account\r\n });\r\n }\r\n }\r\n if (event.eventType === EventType.LOGIN_FAILURE) {\r\n console.error('[setPCA]: msal redirect login', event.payload);\r\n document.dispatchEvent(\r\n new CustomEvent('startUserLogoutSessionOnly')\r\n );\r\n }\r\n if (event.eventType === EventType.ACQUIRE_TOKEN_FAILURE) {\r\n console.error(\r\n '[setPCA]: msal redirect acquire token',\r\n event.payload\r\n );\r\n document.dispatchEvent(\r\n new CustomEvent('startUserLogoutSessionOnly')\r\n );\r\n }\r\n });\r\n this.msalApp.handleRedirectPromise().catch(err => {\r\n console.error('[setPCA]: handleRedirectPromise error', err);\r\n });\r\n }\r\n\r\n public static getInstance(): MsalInstance {\r\n if (!MsalInstance.instance) {\r\n MsalInstance.instance = new MsalInstance();\r\n }\r\n return MsalInstance.instance;\r\n }\r\n}\r\n\r\nconst msalInstance = MsalInstance.getInstance();\r\nObject.freeze(msalInstance);\r\n\r\nexport default msalInstance;\r\n","import {\r\n ClientAuthError,\r\n ClientConfigurationError,\r\n InteractionRequiredAuthError\r\n} from '@azure/msal-browser';\r\nimport Axios, { AxiosRequestConfig } from 'axios';\r\nimport msalInstance from './MsalInstance';\r\n\r\nexport const MSAL_SCOPES = {\r\n MMG: `https://${process.env.REACT_APP_MSAL_TENANT_NAME}.onmicrosoft.com/${process.env.REACT_APP_MSAL_APP_ID_URI}/read`,\r\n OPENID: 'openid'\r\n};\r\n\r\nexport const loginRequest = {\r\n scopes: [MSAL_SCOPES.MMG]\r\n};\r\n\r\nexport const MSAL_LOGOUT_URL = `https://login.microsoftonline.com/common/oauth2/logout`;\r\n\r\nexport const forgotPasswordRequest = {\r\n authority: `https://${process.env.REACT_APP_MSAL_TENANT_NAME}.b2clogin.com/${process.env.REACT_APP_MSAL_TENANT_NAME}.onmicrosoft.com/${process.env.REACT_APP_MSAL_FORGET_PASSWORD_POLICY}`,\r\n scopes: [\r\n `https://${process.env.REACT_APP_MSAL_TENANT_NAME}.onmicrosoft.com/mmg-api/read`\r\n ]\r\n};\r\n\r\nexport const msalRequest = {\r\n scopes: [MSAL_SCOPES.MMG],\r\n extraQueryParameters: {}\r\n};\r\n\r\n// Simple debug method for msal debugging, easily clean up console when you don't want to see 100 msal messages\r\nexport const debugMSAL = (error: any) => {\r\n let showLogs = false;\r\n\r\n if (showLogs) {\r\n console.error('[debugMSAL]: ', error);\r\n }\r\n};\r\n\r\nconst delay = (t: number) => new Promise(resolve => setTimeout(resolve, t));\r\n\r\nexport async function acquireToken() {\r\n if (msalInstance === undefined) {\r\n console.error('[acquireToken]: msalInstance is not defined');\r\n document.dispatchEvent(new CustomEvent('startUserLogoutSessionOnly'));\r\n return;\r\n }\r\n\r\n if (msalInstance.msalApp === undefined) {\r\n console.error('[acquireToken]: msalApp is not defined');\r\n document.dispatchEvent(new CustomEvent('startUserLogoutSessionOnly'));\r\n return;\r\n }\r\n\r\n return await msalInstance.msalApp\r\n .acquireTokenSilent(loginRequest)\r\n .catch(async error => {\r\n // due to consent or interaction required ONLY\r\n console.error('[acquireToken]:', error);\r\n debugMSAL(`AcquireTokenSilent: ${error}`);\r\n const noAccountError =\r\n error?.errorCode?.indexOf('no_account_error') > -1;\r\n\r\n if (noAccountError) {\r\n const msalAccounts = msalInstance.msalApp.getAllAccounts();\r\n if (msalAccounts.length > 0) {\r\n msalInstance.msalApp.setActiveAccount(msalAccounts[0]);\r\n } else {\r\n console.error(\r\n '[acquireToken]: we have reached an unrecoverable error with msal'\r\n );\r\n // even redirecting the user to the logout url does not seem to resolve it.\r\n // Steps to replicate, login as username password. then when asked to re-login login with Azure\r\n // window.location.replace(`https://login.microsoftonline.com/common/oauth2/logout`);\r\n document.dispatchEvent(\r\n new CustomEvent('startUserLogoutSessionOnly')\r\n );\r\n return;\r\n }\r\n }\r\n\r\n if (\r\n error instanceof ClientAuthError &&\r\n error.errorCode &&\r\n error.errorCode.trim() === 'endpoints_resolution_error'\r\n ) {\r\n // User does not have a network connection, they're probably working offline, so don't stop them or log them out\r\n console.log('ClientAuthError: endpoints_resolution_error');\r\n } else if (error instanceof ClientConfigurationError) {\r\n console.error(\r\n '[acquireToken]: ClientConfigurationError',\r\n error\r\n );\r\n document.dispatchEvent(new CustomEvent('forceUserLogout'));\r\n } else if (\r\n error instanceof InteractionRequiredAuthError ||\r\n noAccountError\r\n ) {\r\n console.error(\r\n '[acquireToken]: error requires interaction',\r\n noAccountError\r\n );\r\n\r\n return await msalInstance.msalApp\r\n .acquireTokenRedirect(loginRequest)\r\n .catch(redirectError => {\r\n // if aquireTokenSilent, acquireTokenPop, and aquireTokenRedirect all fail, just log out\r\n console.error(`AcquireTokenRedirect: ${redirectError}`);\r\n document.dispatchEvent(\r\n new CustomEvent('startUserLogoutSessionOnly')\r\n );\r\n });\r\n } else {\r\n // If there is ANY error from MSAL when getting a token, just logout and prevent any weird user experince.\r\n // Right now this would be because of the app registration migration\r\n debugMSAL(error);\r\n document.dispatchEvent(\r\n new CustomEvent('startUserLogoutSessionOnly')\r\n );\r\n }\r\n });\r\n}\r\n\r\n/*\r\n * check the token before every API call.\r\n * goal is to redirect to login when needed and avoid displaying errors unless it fails to redirect for some reason.\r\n * If it is invalid it will try again. If it is still invalid, redirect to the login page\r\n * if it is currently redirecting to the login page (logininprogress()) then it will wait\r\n *\r\n */\r\n\r\nexport const msalFetch = (\r\n url: string,\r\n options: AxiosRequestConfig,\r\n isRetry?: boolean\r\n): Promise => {\r\n // If msalApp is initialized then delayTime is 0, otherwise it's currently at 250 to wait for the constructor in App to finish running.\r\n let delayTime = msalInstance.msalApp === undefined ? 250 : 0;\r\n\r\n return delay(delayTime).then(() => {\r\n return acquireToken()\r\n .then(authResponse => {\r\n if (\r\n !authResponse ||\r\n (authResponse && !authResponse.accessToken)\r\n ) {\r\n console.error('[msalFetch]:', authResponse);\r\n throw new Error(\r\n 'failed to retrieve token. Likely because 3rd party cookies are disabled'\r\n );\r\n }\r\n const headers = {\r\n ...options,\r\n headers: {\r\n Authorization: `Bearer ${authResponse.accessToken}`\r\n }\r\n };\r\n return Axios(url, headers);\r\n })\r\n .catch(error => {\r\n console.error(\r\n `[msalFetch (${url})]:`,\r\n ' ERROR: ' + error,\r\n ' OPTIONS: ' + JSON.stringify(options)\r\n );\r\n debugMSAL(`msalFetch: ${error}`);\r\n return delay(2000).then(() => {\r\n // wait for the redirect before returning the error to the calling function.\r\n throw error;\r\n });\r\n // Don't allow a weird user experience, log the error and log the user out\r\n // TODO need to add something to catch the specific case when we want to log the user out.\r\n // document.dispatchEvent(\r\n // new CustomEvent('startUserLogoutSessionOnly')\r\n // );\r\n });\r\n });\r\n};\r\n","import {\r\n Icountry,\r\n IparentTile,\r\n Itile,\r\n Iuser,\r\n transitionInType,\r\n transitionOutType,\r\n IoptionNumberValue,\r\n Ioption\r\n} from '../models';\r\nimport { MSAL_SCOPES } from '../components/auth/Auth-Utils';\r\nimport msalInstance from '../components/auth/MsalInstance';\r\nimport {\r\n DocumentGroups,\r\n jobTypesIdEnumForSelect,\r\n measurementPointListTypeEnum,\r\n menuParentKeysEnum\r\n} from '../models-enums';\r\n\r\nimport { emptyTile } from '../reducers/initialState';\r\nimport { find, intersectionBy } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { securityFunctions } from './securityFunctions';\r\nimport { tiles } from './tiles';\r\nimport { TFunction } from 'i18next';\r\nimport { tutorial } from './tutorials';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\n\r\nconst MPLTypebyJobTypesID: { [key: string]: number } = {\r\n '80eedbac-ec22-45ef-9ac7-f2eb4be2db4c': 0, // Audit job does not have MPLs\r\n '524235fd-4633-4b7a-9c13-c37fc39efe69': measurementPointListTypeEnum.annual,\r\n '9c7fde18-0b94-4af8-b4aa-913c40e5aed0':\r\n measurementPointListTypeEnum.verification,\r\n 'ae78eaa3-89c2-490a-90c6-44e5cfa10b01': measurementPointListTypeEnum.annual,\r\n 'bbfd50fe-a790-4384-8a29-00995e5d7158':\r\n measurementPointListTypeEnum.agsRebalancing\r\n};\r\nconst jobCommentTypeOptions = [\r\n { value: true, label: 'Deficiency' },\r\n { value: false, label: 'Info' }\r\n];\r\n\r\nconst measurementPointTypeEnum: { [key: number]: string } = {\r\n 1: 'Pass/Fail',\r\n 2: 'Text',\r\n 3: 'Numeric',\r\n 4: 'Select',\r\n 6: 'Date',\r\n 7: 'Long Text',\r\n 8: 'Summary Page'\r\n};\r\nconst measurementPointTypeOptions = [\r\n { label: 'Pass/Fail', value: 1 },\r\n { label: 'Text', value: 2 },\r\n { label: 'Numeric', value: 3 },\r\n { label: 'Select', value: 4 },\r\n { label: 'Date', value: 6 },\r\n { label: 'Long Text', value: 7 },\r\n { label: 'Summary Page', value: 8 }\r\n];\r\nconst measurementPointTypes: { [key: string]: number } = {\r\n MEASUREMENT_POINT_PASSFAIL: 1,\r\n MEASUREMENT_POINT_TEXT: 2,\r\n MEASUREMENT_POINT_NUMERIC: 3,\r\n MEASUREMENT_POINT_SELECT: 4,\r\n GROUP: 5,\r\n MEASUREMENT_POINT_DATE: 6,\r\n MEASUREMENT_POINT_LONGTEXT: 7,\r\n MEASUREMENT_POINT_SUMMARYPAGE: 8\r\n};\r\nconst measurementPointTypesInverse: { [key: number]: string } = {\r\n 1: 'Pass/Fail',\r\n 2: 'Text',\r\n 3: 'Numeric',\r\n 4: 'Select',\r\n 5: 'Group',\r\n 6: 'Date',\r\n 7: 'Long Text',\r\n 8: 'Summary Page'\r\n};\r\nconst measurementPointPassFailTypes: { [key: string]: number } = {\r\n pass: 1,\r\n fail: 2,\r\n notApplicable: 3\r\n};\r\n\r\nconst measurementPointPassFailOptions = [\r\n { label: 'Pass', value: 1 },\r\n { label: 'Fail', value: 2 },\r\n { label: 'Not Applicable', value: 3 }\r\n];\r\nconst isResolvedOptions = [\r\n { label: 'Yes', value: 'true' },\r\n { label: 'No', value: 'false' }\r\n];\r\n\r\nconst colors = {\r\n green: '#7FC467',\r\n greenButton: 'success', // use the bootstrap success button color\r\n greenTr: 'rgba(127, 196, 103,.2)',\r\n greenBanner: 'rgba(127, 196, 103, .85)',\r\n blue: '#027AC3',\r\n teal: '#0c5a8b',\r\n blueTr: 'rgba(2,122,195,.2)',\r\n blueBanner: 'rgba(2,122,195,.85)',\r\n blueButton: 'primary',\r\n darkButton: 'primary',\r\n greyButton: 'default',\r\n iconBlue: ' #336eb4',\r\n orange: '#ff9738',\r\n orangeTr: 'rgba(255,166,99,.2)',\r\n orangeBanner: 'rgba(255,166,99,.85)',\r\n orangeButton: 'warning',\r\n lightTeal: '#06B6B6',\r\n purple: '#06B6B6',\r\n purpleBanner: 'rgba(6, 182, 182, .85)',\r\n purpleButton: 'info', // use the bootstrap info button color\r\n purpleTr: 'rgba(6, 182, 182,.2)',\r\n lightTealBanner: 'rgba(6, 182, 182, .85)',\r\n dark: '#013564',\r\n darkBanner: 'rgba(1, 53, 100, .85)',\r\n red: '#d00000',\r\n grey: '#A2ACB4',\r\n greyBanner: 'rgba(162, 172, 180,.85)',\r\n greyText: '#AAAAAA',\r\n darkGreyText: '#888888',\r\n darkRed: '#840000',\r\n darkGrey: '#707070',\r\n greyBlueShadow: '#3b5161',\r\n textBlue: '#007AC3',\r\n greyBlue: '#7094ad',\r\n darkerBlue: '#306BA0',\r\n yellow: '#F1E43B',\r\n smartLinkRed: '#d20404',\r\n smartLinkBlue: '#0070c0',\r\n smartLinkYellow: '#ffc000',\r\n smartLinkBlueLight: '#99c6e6',\r\n smartLinkYellowLight: '#ffe699',\r\n smartLinkRedLight: '#ff9999'\r\n};\r\n\r\nconst installBaseStatusColorLookup = {\r\n 'Not Tested': colors.greyBlue,\r\n Pass: colors.green,\r\n Fail: colors.red,\r\n 'Cannot Complete': colors.purple,\r\n // Repair: colors.textBlue,\r\n Repaired: colors.textBlue\r\n};\r\n\r\nconst alertTypes = [\r\n { value: 'alert', label: 'Alert' },\r\n { value: 'informational', label: 'Informational' }\r\n];\r\n\r\nconst menuItemsWithChildren: IparentTile[] = [\r\n {\r\n title: 'dashboard',\r\n key: menuParentKeysEnum.dashboard,\r\n url: '/dashboard',\r\n svgKey: 'dashboard',\r\n order: 10\r\n },\r\n {\r\n title: 'admin',\r\n key: menuParentKeysEnum.admin,\r\n url: '/admin',\r\n svgKey: 'admin',\r\n order: 100\r\n },\r\n {\r\n title: 'facility',\r\n key: menuParentKeysEnum.facility,\r\n url: '/facility',\r\n svgKey: 'facility',\r\n order: 110\r\n },\r\n {\r\n title: 'sales',\r\n key: menuParentKeysEnum.sales,\r\n url: '/sales',\r\n svgKey: 'sales',\r\n order: 120\r\n }\r\n];\r\n\r\nconst inventoryImportAllowedExtensions = '.xlsx';\r\n\r\n// not exhaustive!\r\nexport const standards = {\r\n NFPA99_2012: 'A7E05021-18F5-4D20-B733-9E49265B598A',\r\n NFPA99_2015: '6490C3E9-B9D5-419C-8BF5-9A900956AB79',\r\n NFPA99_2018: '740E2F29-6BFA-4316-98C1-F2B32637BF6E',\r\n CSA: '6988A779-8887-473E-AB63-C11E53EFDFE2'\r\n};\r\n\r\nexport const usStandards = [\r\n standards.NFPA99_2012,\r\n standards.NFPA99_2015,\r\n standards.NFPA99_2018\r\n];\r\nexport const caStandards = [standards.CSA];\r\n\r\nexport const constants = {\r\n toastrError: {\r\n transitionIn: 'bounceInDown' as transitionInType,\r\n transitionOut: 'bounceOutUp' as transitionOutType,\r\n timeOut: 8000\r\n },\r\n toastrWarning: {\r\n transitionIn: 'bounceInDown' as transitionInType,\r\n transitionOut: 'bounceOutUp' as transitionOutType,\r\n timeOut: 8000\r\n },\r\n toastrSuccess: {\r\n transitionIn: 'bounceInDown' as transitionInType,\r\n transitionOut: 'bounceOutUp' as transitionOutType,\r\n timeOut: 3000\r\n },\r\n inventoryImportAllowedExtensions,\r\n alertTypes,\r\n colors,\r\n tutorial,\r\n securityFunctions,\r\n tiles,\r\n menuItemsWithChildren,\r\n jobCommentTypeOptions,\r\n measurementPointListTypeEnum,\r\n MPLTypebyJobTypesID,\r\n measurementPointTypeEnum,\r\n measurementPointTypeOptions,\r\n measurementPointTypes,\r\n measurementPointTypesInverse,\r\n measurementPointPassFailOptions,\r\n measurementPointPassFailTypes,\r\n isResolvedOptions,\r\n installBaseStatusColorLookup,\r\n // eslint-disable-next-line no-shadow\r\n hasSecurityFunction: (\r\n user: Iuser,\r\n securityFun: string[],\r\n options?: { matchAll: boolean }\r\n ): boolean => {\r\n const sFunctions = user.securityFunctions.map(sf => sf.toUpperCase());\r\n const upperCase = (st: string) => st.toUpperCase();\r\n const intersection = intersectionBy(sFunctions, securityFun, upperCase);\r\n return options?.matchAll\r\n ? intersection.length === securityFun.length\r\n : intersection.length > 0;\r\n },\r\n getTileByURL: (URL: string): Itile => {\r\n const firstParam = '/' + URL.split('/')[1];\r\n const foundTile = find(tiles, { url: firstParam });\r\n if (foundTile && foundTile.url.length) {\r\n return foundTile as Itile;\r\n } else {\r\n return emptyTile;\r\n }\r\n },\r\n\r\n constructSystems: (t: TFunction): IoptionNumberValue[] => {\r\n let systemsOptions: IoptionNumberValue[] = [];\r\n for (let i = 1; i < 41; i++) {\r\n systemsOptions = [\r\n ...systemsOptions,\r\n {\r\n label: t('manageInventory:systemsOptionLabel', {\r\n count: i\r\n }),\r\n value: i\r\n }\r\n ];\r\n }\r\n return systemsOptions;\r\n },\r\n\r\n countries: require('../constants/countries.json') as {\r\n [key: string]: Icountry;\r\n },\r\n handleError(error: any, message: string) {\r\n let msg = '';\r\n\r\n if (error && error.response && error.response.data) {\r\n // get error message from the JSON body\r\n const messageDetail =\r\n error.response.data instanceof Object &&\r\n error.response.data.hasOwnProperty('value')\r\n ? error.response.data.value\r\n : error.response.data;\r\n msg = `Failed to ${message}. ${messageDetail}`;\r\n } else if (error && error.message) {\r\n // get error message from the error.message\r\n msg = `Failed to ${message}. ${error.message}`;\r\n } else {\r\n // show an error without any additional details\r\n msg = `Failed to ${message}. Please try again or contact support.`;\r\n }\r\n if (!navigator.onLine) {\r\n // override and show an error if we are not connected to the internet\r\n msg = 'Please connect to the internet.';\r\n }\r\n\r\n if (error && error.errorCode === 'user_login_error') {\r\n // override login errors and do not show an error\r\n setTimeout(() => {\r\n msalInstance.msalApp?.loginRedirect({\r\n scopes: [MSAL_SCOPES.MMG]\r\n });\r\n }, 1000);\r\n return;\r\n }\r\n\r\n if (error && error.response && error.response.status === 401) {\r\n console.error(\r\n 'catching unauthorized, we should not get here now that we are using msalFetch'\r\n );\r\n return; // don't show an error\r\n }\r\n // show friendly timeout errors\r\n if (error.code === 'ECONNABORTED') {\r\n msg =\r\n 'MyMedGas is having trouble connecting to the internet. Please refresh and try again.';\r\n }\r\n\r\n toastr.error('Error', msg, constants.toastrError);\r\n },\r\n tableSearchDebounceTime: 500,\r\n formDebounceTime: 300,\r\n timedQuizHours: 4,\r\n searchProductPageCount: 80, // max items to show inside the product search modal\r\n searchProductRecentProductLimit: 30,\r\n tablePageSizeDefault: 25,\r\n tablePageSizeOptions: [10, 25, 50, 100],\r\n httpTimeout: 60000,\r\n httpTimeoutDownload: 1000 * 60 * 5, // 5 min\r\n trainingVideoProgressSaveDelay: 15000,\r\n cacheFseUsersMinutes: 10,\r\n defaultStandardID: standards.NFPA99_2018,\r\n defaultStandardUS: standards.NFPA99_2012,\r\n defaultStandardUK: '',\r\n momentSQLFormat: 'YYYY-MM-DDTHH:mm:ss',\r\n momentDisplayFormat: 'DD-MMM-YY',\r\n momentDisplayFormatWithTime: 'DD-MMM-YY LT',\r\n momentDisplayFormatWithTimeAndSeconds: 'DD-MM-YY LTS',\r\n defaultCountryID: 'abc5d95c-129f-4837-988c-0bf4ae1f3b67',\r\n ukCountryID: '419ec375-dce2-41fb-8251-ce28caa507f5',\r\n usCountryID: 'abc5d95c-129f-4837-988c-0bf4ae1f3b67',\r\n canadaCountryID: '2fcbfdc4-9c25-4b58-874c-7c2625eaa750',\r\n germanyCountryID: '049060ff-8fc7-44b3-9c0e-20a987aac7ff',\r\n malaysiaCountryID: '0b61d1dd-f32e-442c-9ff4-fb5fc1e012e4',\r\n categoryManifoldID: '55ec8036-f4cb-4fc9-8ed7-87eaaed8df13',\r\n virtualProductSubcategoryID: 'cad4e18c-45d6-4e42-8a27-090bf385e723',\r\n bulkSelectionLimit: 400,\r\n photoUploadTimeout: 1500,\r\n urlValidatorPattern: /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i\r\n};\r\n\r\nexport const capitalEquipmentCategories = {\r\n agss: 'c17ea749-20b7-4ab7-ab15-237a85a92e83',\r\n airSystem: 'aec75f68-6836-4af1-89cf-75d9232a8d7b',\r\n manifold: '55ec8036-f4cb-4fc9-8ed7-87eaaed8df13',\r\n oxygenSystem: '1a28be85-84ab-40bd-840f-e32dcffaad4c',\r\n vacuumWagd: '97bae3c8-1adc-4429-8bf0-68f47618cd03'\r\n};\r\n\r\nexport const sapBusinessIndicators = {\r\n fixedPrice: 'FP',\r\n servicePlan: 'SP',\r\n mf: 'MF',\r\n fm: 'FM',\r\n ic: 'IC'\r\n};\r\n\r\nexport const jobTypeOptions = FormUtil.convertEnumToOptions(\r\n Object.keys(jobTypesIdEnumForSelect)\r\n .filter(\r\n key =>\r\n jobTypesIdEnumForSelect[\r\n key as keyof typeof jobTypesIdEnumForSelect\r\n ] !== jobTypesIdEnumForSelect.nonProductive\r\n )\r\n .reduce((obj, key) => {\r\n obj[key as keyof typeof jobTypesIdEnumForSelect] =\r\n jobTypesIdEnumForSelect[\r\n key as keyof typeof jobTypesIdEnumForSelect\r\n ];\r\n return obj;\r\n }, {} as { [key: string]: string })\r\n);\r\n\r\nexport const jobTypeOptionsTranslated = (t: TFunction) => {\r\n return jobTypeOptions.map(option => {\r\n return {\r\n ...option,\r\n label: t(`nsJob:${option.label}`)\r\n };\r\n });\r\n};\r\n\r\nexport const postalAndStateRequiredCountries = {\r\n [constants.usCountryID]: { postalCode: true, state: true },\r\n [constants.ukCountryID]: { postalCode: true, state: false },\r\n [constants.germanyCountryID]: { postalCode: true, state: false },\r\n [constants.canadaCountryID]: { postalCode: true, state: true },\r\n [constants.malaysiaCountryID]: { postalCode: false, state: false }\r\n};\r\n\r\nexport const productPlaceholderImages = [\r\n {\r\n categoryId: 'C17EA749-20B7-4AB7-AB15-237A85A92E83',\r\n src: 'AGS System_D2.png'\r\n },\r\n {\r\n categoryId: 'AEC75F68-6836-4AF1-89CF-75D9232A8D7B',\r\n src: 'Medical Air Systems (Air).png'\r\n },\r\n {\r\n categoryId: 'AEE5775D-FD2D-4831-9D68-80090676EF5F',\r\n src: 'Monitoring.png'\r\n },\r\n {\r\n categoryId: '3C4D2DC0-0CCD-4281-861D-F07BCCA8F6F7',\r\n src: 'Monitoring.png'\r\n },\r\n {\r\n categoryId: '6E817F59-CF14-42ED-89C9-9E99C15E6CA3',\r\n src: 'Monitoring.png'\r\n },\r\n {\r\n categoryId: '699C584F-F431-432B-A251-FF8E3DC82D96',\r\n src: 'Patient Environment-01.png'\r\n },\r\n {\r\n categoryId: 'EA5E3BBE-9D11-4F8A-B9BA-8263829B1BF4',\r\n src: 'Valves.png'\r\n },\r\n {\r\n categoryId: '55EC8036-F4CB-4FC9-8ED7-87EAAED8DF13',\r\n src: 'manifold.png'\r\n },\r\n {\r\n categoryId: '59D4F580-40A8-4084-A2C3-AE5B08C9718E',\r\n src: 'Gas outlets.png'\r\n },\r\n {\r\n categoryId: '97BAE3C8-1ADC-4429-8BF0-68F47618CD03',\r\n src: 'Medical Vacuum-01.png'\r\n },\r\n {\r\n categoryId: '0C3C9A37-5B98-4B7D-8141-384747DA373C',\r\n src: 'Valves.png'\r\n },\r\n {\r\n categoryId: 'A142693B-0272-4673-98FF-B76DB5814023',\r\n src: 'Valves.png'\r\n },\r\n {\r\n categoryId: '5CD2F63A-2219-42CF-B613-52C24067B2E9',\r\n src: '06-Liquid Oxygen System (Oxygen).png'\r\n },\r\n {\r\n categoryId: 'A8C77FFB-134A-412D-B763-311E18255CE5',\r\n src: 'Medical Pipeline-01.png'\r\n },\r\n {\r\n categoryId: '1A28BE85-84AB-40BD-840F-E32DCFFAAD4C',\r\n src: '08-Oxygen Concentrator Systems (Oxygen).png'\r\n },\r\n {\r\n categoryId: 'F045DE0B-0B30-4D57-BBAD-EF5C54922B81',\r\n src: '01-Pipeline Components.png'\r\n }\r\n];\r\n\r\nexport const DOCUMENT_TYPE_VISIT_REPORT =\r\n '33B984F9-AD87-4D4C-A774-1181AA40D29E';\r\n\r\n// This is not all, only really need this Job one right now\r\nexport const mainCategories: { [key: string]: string } = {\r\n job: 'ee4e20f7-2541-414e-8810-dd53dc3064ea'\r\n};\r\n\r\nexport enum DocumentTypesEnum {\r\n AGSReblancing = '1003AB57-F3EE-463A-AC8C-DFA8A8901A31',\r\n AGSSSchematic = 'A0076422-4776-43A7-88C9-190D350312FF'\r\n}\r\n\r\nexport const documentTypeMapping: { [key: string]: DocumentGroups } = {\r\n '1003AB57-F3EE-463A-AC8C-DFA8A8901A31': DocumentGroups.reports, // AGS Re-Balancing Reports,\r\n 'A0076422-4776-43A7-88C9-190D350312FF': DocumentGroups.reports, // AGSS Schematic,\r\n // 'EE7C0746-6C28-4386-9655-2964FCF498B3': DocumentGroups.other, // Air Sample\r\n '63B549F7-5338-490A-98A8-0D783E1EF20E': DocumentGroups.reports, // Annual Inspection Reports\r\n '2CB24522-2066-43F0-9F9A-6020E15A328B': DocumentGroups.reports, // Budget Planning Reports\r\n '6BD51679-A32D-4597-9F51-BA9B50262C4A': DocumentGroups.leaglAndQSHE, // Certification\r\n '09BE932A-149F-4C32-988A-A4ECBCCDC958': DocumentGroups.reports, // Commissioning Reports\r\n 'A60A2CBB-55AB-4045-B664-CA370A244F7A': DocumentGroups.leaglAndQSHE, // CP / AP Certificate\r\n '1A375BE0-C705-4F2C-A1D3-0552D129739B': DocumentGroups.techSupport, // Drawings\r\n '96DAF302-5243-447B-8063-5E3D07354A46': DocumentGroups.leaglAndQSHE, // Employers Liability\r\n '935D067A-9E4B-4670-935E-5EA68933A275': DocumentGroups.reports, // Environment of Care Report\r\n '984BC9ED-42B0-4242-8482-88DFBF8771A6': DocumentGroups.reports, // Job Comment Reports\r\n '9F34E464-B9C5-4BA9-91F7-925F17ED420F': DocumentGroups.techSupport, // Manuals\r\n // '22D50AA2-31A3-4632-8B4E-514FB6D57602': DocumentGroups.other, // Oil Sample\r\n // '87400BA8-6729-410A-9C23-94C3436A7489': DocumentGroups.other, // Other\r\n // 'C0DAB37A-1F84-4BCB-80E8-949E1F698A48': DocumentGroups.other, // Permit to Work\r\n 'E8C6ABB1-4FC4-4D01-AC1C-647C24563BEF': DocumentGroups.techSupport, // Photos\r\n 'E1F3E245-86AD-47C0-ACAE-10DDC88D60BE': DocumentGroups.leaglAndQSHE, // Public and Product Liability\r\n 'BE17D9FE-B214-446C-9570-2D631504F8E4': DocumentGroups.financeAndPlanning, // Quotes\r\n // '4177CDB3-AF60-4377-BD79-8ADDB77A4B35': DocumentGroups.other, // Risk Assessment / Method Statement\r\n 'DC92BF93-F5DA-4F5C-A43A-847495B885C3': DocumentGroups.leaglAndQSHE, // Safety Plans\r\n '293B7A6E-A49F-4DDD-A9F0-5E72419D80C8': DocumentGroups.reports, // Site Survey (Audit) Reports\r\n // '4E83B822-900D-4A2A-94E9-77B710AE9EA2': DocumentGroups.other, // Submittal\r\n '7E024A9D-DBC9-4A44-9703-287C085FC375': DocumentGroups.reports, // Training Records\r\n 'FC0BECA6-73FC-4CD0-988A-20DA5DF6F2AB': DocumentGroups.reports, // Verification Reports\r\n '33B984F9-AD87-4D4C-A774-1181AA40D29E': DocumentGroups.reports, // Visit Reports\r\n '40803CEF-744A-4DDC-A4DB-4A93E38304CA': DocumentGroups.leaglAndQSHE, // Standards and other Legal Docs\r\n 'BFBDC78C-17E0-4FEE-BB8E-862E062F0615': DocumentGroups.reports // Daily Rounds Reports\r\n};\r\n\r\nexport const countryCodeOptions: Ioption[] = [\r\n { label: 'Afghanistan +93', value: '93' },\r\n { label: 'Aland Islands +358', value: '358' },\r\n { label: 'Albania +355', value: '355' },\r\n { label: 'Algeria +213', value: '213' },\r\n { label: 'American Samoa +1684', value: '1684' },\r\n { label: 'Andorra +376', value: '376' },\r\n { label: 'Angola +244', value: '244' },\r\n { label: 'Anguilla +1264', value: '1264' },\r\n { label: 'Antarctica +672', value: '672' },\r\n { label: 'Antigua and Barbuda +1268', value: '1268' },\r\n { label: 'Argentina +54', value: '54' },\r\n { label: 'Armenia +374', value: '374' },\r\n { label: 'Aruba +297', value: '297' },\r\n { label: 'Australia +61', value: '61' },\r\n { label: 'Austria +43', value: '43' },\r\n { label: 'Azerbaijan +994', value: '994' },\r\n { label: 'Bahamas +1242', value: '1242' },\r\n { label: 'Bahrain +973', value: '973' },\r\n { label: 'Bangladesh +880', value: '880' },\r\n { label: 'Barbados +1246', value: '1246' },\r\n { label: 'Belarus +375', value: '375' },\r\n { label: 'Belgium +32', value: '32' },\r\n { label: 'Belize +501', value: '501' },\r\n { label: 'Benin +229', value: '229' },\r\n { label: 'Bermuda +1441', value: '1441' },\r\n { label: 'Bhutan +975', value: '975' },\r\n { label: 'Bolivia +591', value: '591' },\r\n { label: 'Bonaire, Sint Eustatius and Saba +599', value: '599' },\r\n { label: 'Bosnia and Herzegovina +387', value: '387' },\r\n { label: 'Botswana +267', value: '267' },\r\n { label: 'Bouvet Island +55', value: '55' },\r\n { label: 'Brazil +55', value: '55' },\r\n { label: 'British Indian Ocean Territory +246', value: '246' },\r\n { label: 'Brunei Darussalam +673', value: '673' },\r\n { label: 'Bulgaria +359', value: '359' },\r\n { label: 'Burkina Faso +226', value: '226' },\r\n { label: 'Burundi +257', value: '257' },\r\n { label: 'Cambodia +855', value: '855' },\r\n { label: 'Cameroon +237', value: '237' },\r\n { label: 'Cape Verde +238', value: '238' },\r\n { label: 'Cayman Islands +1345', value: '1345' },\r\n { label: 'Central African Republic +236', value: '236' },\r\n { label: 'Chad +235', value: '235' },\r\n { label: 'Chile +56', value: '56' },\r\n { label: 'China +86', value: '86' },\r\n { label: 'Christmas Island +61', value: '61' },\r\n { label: 'Cocos (Keeling) Islands +672', value: '672' },\r\n { label: 'Colombia +57', value: '57' },\r\n { label: 'Comoros +269', value: '269' },\r\n { label: 'Congo +242', value: '242' },\r\n { label: 'Congo, Democratic Republic of the Congo +242', value: '242' },\r\n { label: 'Cook Islands +682', value: '682' },\r\n { label: 'Costa Rica +506', value: '506' },\r\n { label: \"Cote D'Ivoire +225\", value: '225' },\r\n { label: 'Croatia +385', value: '385' },\r\n { label: 'Cuba +53', value: '53' },\r\n { label: 'Curacao +599', value: '599' },\r\n { label: 'Cyprus +357', value: '357' },\r\n { label: 'Czech Republic +420', value: '420' },\r\n { label: 'Denmark +45', value: '45' },\r\n { label: 'Djibouti +253', value: '253' },\r\n { label: 'Dominica +1767', value: '1767' },\r\n { label: 'Dominican Republic +1809', value: '1809' },\r\n { label: 'Ecuador +593', value: '593' },\r\n { label: 'Egypt +20', value: '20' },\r\n { label: 'El Salvador +503', value: '503' },\r\n { label: 'Equatorial Guinea +240', value: '240' },\r\n { label: 'Eritrea +291', value: '291' },\r\n { label: 'Estonia +372', value: '372' },\r\n { label: 'Ethiopia +251', value: '251' },\r\n { label: 'Falkland Islands (Malvinas) +500', value: '500' },\r\n { label: 'Faroe Islands +298', value: '298' },\r\n { label: 'Fiji +679', value: '679' },\r\n { label: 'Finland +358', value: '358' },\r\n { label: 'France +33', value: '33' },\r\n { label: 'French Guiana +594', value: '594' },\r\n { label: 'French Polynesia +689', value: '689' },\r\n { label: 'French Southern Territories +262', value: '262' },\r\n { label: 'Gabon +241', value: '241' },\r\n { label: 'Gambia +220', value: '220' },\r\n { label: 'Georgia +995', value: '995' },\r\n { label: 'Germany +49', value: '49' },\r\n { label: 'Ghana +233', value: '233' },\r\n { label: 'Gibraltar +350', value: '350' },\r\n { label: 'Greece +30', value: '30' },\r\n { label: 'Greenland +299', value: '299' },\r\n { label: 'Grenada +1473', value: '1473' },\r\n { label: 'Guadeloupe +590', value: '590' },\r\n { label: 'Guam +1671', value: '1671' },\r\n { label: 'Guatemala +502', value: '502' },\r\n { label: 'Guinea +224', value: '224' },\r\n { label: 'Guinea-Bissau +245', value: '245' },\r\n { label: 'Guyana +592', value: '592' },\r\n { label: 'Haiti +509', value: '509' },\r\n { label: 'Holy See (Vatican City State) +39', value: '39' },\r\n { label: 'Honduras +504', value: '504' },\r\n { label: 'Hong Kong +852', value: '852' },\r\n { label: 'Hungary +36', value: '36' },\r\n { label: 'Iceland +354', value: '354' },\r\n { label: 'India +91', value: '91' },\r\n { label: 'Indonesia +62', value: '62' },\r\n { label: 'Iran, Islamic Republic of +98', value: '98' },\r\n { label: 'Iraq +964', value: '964' },\r\n { label: 'Ireland +353', value: '353' },\r\n { label: 'Israel +972', value: '972' },\r\n { label: 'Italy +39', value: '39' },\r\n { label: 'Jamaica +1876', value: '1876' },\r\n { label: 'Japan +81', value: '81' },\r\n { label: 'Jordan +962', value: '962' },\r\n { label: 'Kazakhstan +7', value: '7' },\r\n { label: 'Kenya +254', value: '254' },\r\n { label: 'Kiribati +686', value: '686' },\r\n { label: \"Korea, Democratic People's Republic of +850\", value: '850' },\r\n { label: 'Korea, Republic of +82', value: '82' },\r\n { label: 'Kosovo +383', value: '383' },\r\n { label: 'Kuwait +965', value: '965' },\r\n { label: 'Kyrgyzstan +996', value: '996' },\r\n { label: \"Lao People's Democratic Republic +856\", value: '856' },\r\n { label: 'Latvia +371', value: '371' },\r\n { label: 'Lebanon +961', value: '961' },\r\n { label: 'Lesotho +266', value: '266' },\r\n { label: 'Liberia +231', value: '231' },\r\n { label: 'Libyan Arab Jamahiriya +218', value: '218' },\r\n { label: 'Liechtenstein +423', value: '423' },\r\n { label: 'Lithuania +370', value: '370' },\r\n { label: 'Luxembourg +352', value: '352' },\r\n { label: 'Macao +853', value: '853' },\r\n { label: 'Macedonia, the Former Yugoslav Republic of +389', value: '389' },\r\n { label: 'Madagascar +261', value: '261' },\r\n { label: 'Malawi +265', value: '265' },\r\n { label: 'Malaysia +60', value: '60' },\r\n { label: 'Maldives +960', value: '960' },\r\n { label: 'Mali +223', value: '223' },\r\n { label: 'Malta +356', value: '356' },\r\n { label: 'Marshall Islands +692', value: '692' },\r\n { label: 'Martinique +596', value: '596' },\r\n { label: 'Mauritania +222', value: '222' },\r\n { label: 'Mauritius +230', value: '230' },\r\n { label: 'Mayotte +262', value: '262' },\r\n { label: 'Mexico +52', value: '52' },\r\n { label: 'Micronesia, Federated States of +691', value: '691' },\r\n { label: 'Moldova, Republic of +373', value: '373' },\r\n { label: 'Monaco +377', value: '377' },\r\n { label: 'Mongolia +976', value: '976' },\r\n { label: 'Montenegro +382', value: '382' },\r\n { label: 'Montserrat +1664', value: '1664' },\r\n { label: 'Morocco +212', value: '212' },\r\n { label: 'Mozambique +258', value: '258' },\r\n { label: 'Myanmar +95', value: '95' },\r\n { label: 'Namibia +264', value: '264' },\r\n { label: 'Nauru +674', value: '674' },\r\n { label: 'Nepal +977', value: '977' },\r\n { label: 'Netherlands +31', value: '31' },\r\n { label: 'Netherlands Antilles +599', value: '599' },\r\n { label: 'New Caledonia +687', value: '687' },\r\n { label: 'New Zealand +64', value: '64' },\r\n { label: 'Nicaragua +505', value: '505' },\r\n { label: 'Niger +227', value: '227' },\r\n { label: 'Nigeria +234', value: '234' },\r\n { label: 'Niue +683', value: '683' },\r\n { label: 'Norfolk Island +672', value: '672' },\r\n { label: 'Northern Mariana Islands +1670', value: '1670' },\r\n { label: 'Norway +47', value: '47' },\r\n { label: 'Oman +968', value: '968' },\r\n { label: 'Pakistan +92', value: '92' },\r\n { label: 'Palau +680', value: '680' },\r\n { label: 'Palestinian Territory, Occupied +970', value: '970' },\r\n { label: 'Panama +507', value: '507' },\r\n { label: 'Papua New Guinea +675', value: '675' },\r\n { label: 'Paraguay +595', value: '595' },\r\n { label: 'Peru +51', value: '51' },\r\n { label: 'Philippines +63', value: '63' },\r\n { label: 'Pitcairn +64', value: '64' },\r\n { label: 'Poland +48', value: '48' },\r\n { label: 'Portugal +351', value: '351' },\r\n { label: 'Puerto Rico +1787', value: '1787' },\r\n { label: 'Qatar +974', value: '974' },\r\n { label: 'Reunion +262', value: '262' },\r\n { label: 'Romania +40', value: '40' },\r\n { label: 'Russian Federation +7', value: '7' },\r\n { label: 'Rwanda +250', value: '250' },\r\n { label: 'Saint Barthelemy +590', value: '590' },\r\n { label: 'Saint Helena +290', value: '290' },\r\n { label: 'Saint Kitts and Nevis +1869', value: '1869' },\r\n { label: 'Saint Lucia +1758', value: '1758' },\r\n { label: 'Saint Martin +590', value: '590' },\r\n { label: 'Saint Pierre and Miquelon +508', value: '508' },\r\n { label: 'Saint Vincent and the Grenadines +1784', value: '1784' },\r\n { label: 'Samoa +684', value: '684' },\r\n { label: 'San Marino +378', value: '378' },\r\n { label: 'Sao Tome and Principe +239', value: '239' },\r\n { label: 'Saudi Arabia +966', value: '966' },\r\n { label: 'Senegal +221', value: '221' },\r\n { label: 'Serbia +381', value: '381' },\r\n { label: 'Serbia and Montenegro +381', value: '381' },\r\n { label: 'Seychelles +248', value: '248' },\r\n { label: 'Sierra Leone +232', value: '232' },\r\n { label: 'Singapore +65', value: '65' },\r\n { label: 'Sint Maarten +721', value: '721' },\r\n { label: 'Slovakia +421', value: '421' },\r\n { label: 'Slovenia +386', value: '386' },\r\n { label: 'Solomon Islands +677', value: '677' },\r\n { label: 'Somalia +252', value: '252' },\r\n { label: 'South Africa +27', value: '27' },\r\n {\r\n label: 'South Georgia and the South Sandwich Islands +500',\r\n value: '500'\r\n },\r\n { label: 'South Sudan +211', value: '211' },\r\n { label: 'Spain +34', value: '34' },\r\n { label: 'Sri Lanka +94', value: '94' },\r\n { label: 'Sudan +249', value: '249' },\r\n { label: 'Suriname +597', value: '597' },\r\n { label: 'Svalbard and Jan Mayen +47', value: '47' },\r\n { label: 'Swaziland +268', value: '268' },\r\n { label: 'Sweden +46', value: '46' },\r\n { label: 'Switzerland +41', value: '41' },\r\n { label: 'Syrian Arab Republic +963', value: '963' },\r\n { label: 'Taiwan +886', value: '886' },\r\n { label: 'Tajikistan +992', value: '992' },\r\n { label: 'Tanzania, United Republic of +255', value: '255' },\r\n { label: 'Thailand +66', value: '66' },\r\n { label: 'Timor-Leste +670', value: '670' },\r\n { label: 'Togo +228', value: '228' },\r\n { label: 'Tokelau +690', value: '690' },\r\n { label: 'Tonga +676', value: '676' },\r\n { label: 'Trinidad and Tobago +1868', value: '1868' },\r\n { label: 'Tunisia +216', value: '216' },\r\n { label: 'Turkey +90', value: '90' },\r\n { label: 'Turkmenistan +993', value: '993' },\r\n { label: 'Turks and Caicos Islands +1649', value: '1649' },\r\n { label: 'Tuvalu +688', value: '688' },\r\n { label: 'Uganda +256', value: '256' },\r\n { label: 'Ukraine +380', value: '380' },\r\n { label: 'United Arab Emirates +971', value: '971' },\r\n { label: 'United Kingdom +44', value: '44' },\r\n { label: 'United States +1', value: '1' },\r\n { label: 'Uruguay +598', value: '598' },\r\n { label: 'Uzbekistan +998', value: '998' },\r\n { label: 'Vanuatu +678', value: '678' },\r\n { label: 'Venezuela +58', value: '58' },\r\n { label: 'Vietnam +84', value: '84' },\r\n { label: 'Virgin Islands, British +1284', value: '1284' },\r\n { label: 'Virgin Islands, U.S. +1340', value: '1340' },\r\n { label: 'Wallis and Futuna +681', value: '681' },\r\n { label: 'Western Sahara +212', value: '212' },\r\n { label: 'Yemen +967', value: '967' },\r\n { label: 'Zambia +260', value: '260' },\r\n { label: 'Zimbabwe +263', value: '263' }\r\n];\r\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport {\r\n IWorkOrder,\r\n IanalyticsInspection,\r\n IanalyticsSmartlink,\r\n IanalyticsTAE,\r\n IcloudDocument,\r\n Iconfig,\r\n IdeficiencyCode,\r\n Ifacility,\r\n IfacilityContact,\r\n IfacilityContract,\r\n IinstallBase,\r\n IinstallBaseHistory,\r\n Ijob,\r\n IjobWorkOrder,\r\n Ilead,\r\n IleadActivity,\r\n IleadInstallBase,\r\n ImeasurementPointResult,\r\n Ipart,\r\n Iphoto,\r\n IpreventativeMaintenanceChecklist,\r\n Iproduct,\r\n IproductQueueObject,\r\n Iquote,\r\n IsuggestedPart,\r\n Itae,\r\n Itile,\r\n Iuser\r\n} from '../models';\r\nimport {\r\n dataFormatEnum,\r\n dataUnitEnum,\r\n leadActivityTypesEnum,\r\n leadRankingEnum,\r\n leadStatusEnum,\r\n productCommunicationMethodEnum,\r\n userTypeEnum,\r\n widgetsEnum\r\n} from '../models-enums';\r\n\r\nexport const initialOption = { value: '', label: '' };\r\nexport const initialTableFilters = { search: '', page: 1 };\r\nexport const initialTableFiltersFrontEndPaging = { search: '', page: 0 };\r\n\r\nexport const initialFacilityContract: IfacilityContract = {\r\n facilityID: '',\r\n id: '',\r\n isDeleted: false\r\n};\r\n\r\nexport const initialFacility: Ifacility = {\r\n id: '',\r\n name: '',\r\n name2: '',\r\n address: '',\r\n address2: '',\r\n city: '',\r\n countryID: '',\r\n state: '',\r\n postalCode: '',\r\n buildings: [],\r\n isDeleted: false,\r\n standardID: '',\r\n sapFacilityNumber: '',\r\n preventativeMaintenanceEnabled: false,\r\n managedByID: '',\r\n mgpsSite: false,\r\n authorizedPerson: '',\r\n isApproved: false\r\n};\r\n\r\n// const initialMainCategory = {\r\n// id: '',\r\n// name: '',\r\n// isDeleted: false\r\n// };\r\n// const initialSubcategory: Isubcategory = {\r\n// mainCategoryID: '',\r\n// id: '',\r\n// name: '',\r\n// mainCategory: initialMainCategory,\r\n// isDeleted: false\r\n// };\r\n\r\nexport const initialConfig: Iconfig = {\r\n isMobile: false\r\n};\r\n\r\nexport const initialProduct: Iproduct = {\r\n id: '',\r\n name: '',\r\n sku: '',\r\n description: '',\r\n imagePath: '',\r\n subcategoryID: '',\r\n brandID: '',\r\n productTypeID: '',\r\n powerID: '',\r\n origin: '',\r\n notes: '',\r\n systemSizeID: '',\r\n installBases: [],\r\n isDeleted: false,\r\n isApproved: false,\r\n quantity: 1,\r\n mergedProductID: '',\r\n isCompliant: true,\r\n hasSpares: true,\r\n isActive: true,\r\n communicationMethod: productCommunicationMethodEnum.none,\r\n links: [],\r\n isFinalProduct: true,\r\n productStandards: []\r\n};\r\nexport const initialInstallBase: IinstallBase = {\r\n id: '',\r\n productID: '',\r\n facilityID: '',\r\n isDeleted: false,\r\n measurementPointListResultStatus: 0,\r\n workOrderResultStatus: 1,\r\n visibleStatus: 0,\r\n latestMeasurementPointListResultID: '',\r\n latestWorkOrderID: '',\r\n lastQuarterlyMaintenanceDate: '',\r\n lastSixMonthMaintenanceDate: '',\r\n lastYearlyMaintenanceDate: '',\r\n lastTwoYearMaintenanceDate: '',\r\n lastThreeYearMaintenanceDate: '',\r\n lastFiveYearMaintenanceDate: ''\r\n};\r\n\r\nexport const initialLoc = {\r\n id: '',\r\n name: '',\r\n rooms: [],\r\n floorID: '',\r\n isDeleted: false\r\n};\r\nexport const initialContact: IfacilityContact = {\r\n id: '',\r\n firstName: '',\r\n lastName: '',\r\n email: '',\r\n title: '',\r\n phone: '',\r\n mobile: '',\r\n enableNotifications: false,\r\n smartlinkNotifications: false,\r\n isDeleted: false,\r\n contactFacilities: [],\r\n source: 0 // MMG\r\n};\r\nexport const initialBuilding = {\r\n id: '',\r\n name: '',\r\n floors: [],\r\n facilityID: '',\r\n isDeleted: false\r\n};\r\nexport const initialFloor = {\r\n id: '',\r\n name: '',\r\n buildingID: '',\r\n locations: [],\r\n isDeleted: false\r\n};\r\n\r\nexport const initialRoom = {\r\n id: '',\r\n name: '',\r\n locationID: '',\r\n isDeleted: false\r\n};\r\nexport const initialMeasurementPointResultAnswer = {\r\n measurementPointID: ''\r\n};\r\nexport const initialMeasurementPointList = {\r\n id: '',\r\n measurementPointTabs: [],\r\n mainCategoryID: '',\r\n standardID: '',\r\n type: 1,\r\n testProcedures: '',\r\n isDeleted: false\r\n};\r\nexport const initialMeasurementPointTab = {\r\n id: '',\r\n name: 'Default Tab',\r\n measurementPoints: {},\r\n order: 0,\r\n isDeleted: false\r\n};\r\nexport const initialMeasurementPoint = {\r\n id: '',\r\n type: 1,\r\n label: '',\r\n order: 0,\r\n isDeleted: false,\r\n isRequired: true,\r\n showInReport: true,\r\n allowNotes: true,\r\n defaultText: '',\r\n generateLead: true\r\n};\r\nexport const initialMeasurmentPointResult: ImeasurementPointResult = {\r\n id: '',\r\n status: 0,\r\n jobID: '',\r\n notes: '',\r\n installBaseID: '',\r\n isDeleted: false,\r\n measurementPointListID: '',\r\n measurementPointAnswers: [],\r\n compiledNotes: '',\r\n manualOverride: false,\r\n installBaseHistory: []\r\n};\r\n\r\nexport const initialInstallBaseHistory: IinstallBaseHistory[] = [\r\n {\r\n id: '',\r\n date: new Date(),\r\n notes: '',\r\n jobType: '',\r\n status: 0,\r\n workOrderId: ''\r\n }\r\n];\r\n\r\nexport const initialDefaultReport = {\r\n id: '',\r\n reportType: 1,\r\n defaultCoverLetter: 'testing cover letter'\r\n};\r\nexport const initialReport = {\r\n jobID: '123',\r\n reportType: 1,\r\n coverLetter: 'testing cover letter',\r\n headerLogoPath: ''\r\n};\r\n\r\nexport const initialJob: Ijob = {\r\n id: '',\r\n facilityID: '',\r\n assignedUserID: '',\r\n jobTypeID: '',\r\n startDate: '',\r\n endDate: '',\r\n status: 'New',\r\n userJobs: [],\r\n jobNumber: '',\r\n fseNotes: '',\r\n isDeleted: false\r\n};\r\n\r\nexport const initialLead: Ilead = {\r\n leadInstallBases: [],\r\n id: '',\r\n contactID: '',\r\n type: 0,\r\n notes: '',\r\n createDate: '',\r\n facilityID: '',\r\n productID: '',\r\n isDeleted: false,\r\n leadActivities: [],\r\n ranking: leadRankingEnum.High,\r\n status: leadStatusEnum.Lost,\r\n updateDate: '',\r\n quoteID: '',\r\n partHtml: '',\r\n internalComments: ''\r\n};\r\n\r\nexport const initialLeadPopulated = {\r\n ...initialLead,\r\n leadUsers: []\r\n};\r\n\r\nexport const initialLeadUser = {\r\n id: '',\r\n leadID: '',\r\n userID: '',\r\n assignedDueToMissingCoverage: false,\r\n isDeleted: false\r\n};\r\n\r\nexport const initialQuote: Iquote = {\r\n id: '',\r\n leads: [],\r\n comments: '',\r\n quoteNumber: '1',\r\n revision: '',\r\n poNumber: '',\r\n signatureUrl: '',\r\n authorizedName: '',\r\n status: 0,\r\n isDeleted: false,\r\n cloudDocumentID: ''\r\n};\r\n\r\nexport const initialCloudDocument: IcloudDocument = {\r\n id: '',\r\n isDeleted: false,\r\n facilityID: '',\r\n filename: '',\r\n fileSize: 0,\r\n mimeType: '',\r\n url: '',\r\n container: '',\r\n key: '',\r\n version: '',\r\n name: '',\r\n cloudDocumentTypeID: '',\r\n documentID: '',\r\n documentDate: '',\r\n countryID: '',\r\n isSystem: false\r\n};\r\n\r\nexport const initialLeadInstallBase: IleadInstallBase = {\r\n installBaseID: '',\r\n id: '',\r\n leadID: '',\r\n isDeleted: false\r\n};\r\n\r\nexport const initialJobWorkOrder: IjobWorkOrder = {\r\n id: '',\r\n jobID: '',\r\n workOrderID: '',\r\n isDeleted: false\r\n};\r\n\r\nexport const initialBrand = {\r\n id: '',\r\n name: '',\r\n code: '',\r\n isDeleted: false,\r\n isManufacturer: true\r\n};\r\n\r\nexport const initialDocument = {\r\n id: '',\r\n name: '',\r\n facilityID: '',\r\n filename: '',\r\n fileSize: 0,\r\n mimeType: '',\r\n url: '',\r\n container: '',\r\n key: '',\r\n facility: initialFacility,\r\n version: '',\r\n isDeleted: false,\r\n cloudDocumentTypeID: '',\r\n documentDate: '',\r\n documentID: '',\r\n countryID: '',\r\n isSystem: false\r\n};\r\n\r\nexport const initialDocumentType = {\r\n id: '',\r\n name: ''\r\n};\r\n\r\nexport const initialAlert = {\r\n id: '',\r\n title: '',\r\n text: '',\r\n type: '',\r\n imageUrl: '',\r\n expirationDate: ''\r\n};\r\n\r\nexport const initialPart: Ipart = {\r\n id: '',\r\n isDeleted: false,\r\n description: '',\r\n number: '',\r\n installationTime: 0,\r\n isActive: false,\r\n measurement: '',\r\n origin: ''\r\n};\r\n\r\nexport const initialJobPart = {\r\n jobID: '',\r\n isDeleted: false,\r\n estimated: 0,\r\n used: 0,\r\n lot: '',\r\n id: '',\r\n partID: ''\r\n};\r\nexport const initialJobPartPopulated = {\r\n ...initialJobPart,\r\n part: initialPart\r\n};\r\n\r\nexport const initialWorkOrder: IWorkOrder = {\r\n id: '',\r\n activityDescription: '',\r\n closingNotes: '',\r\n installBaseID: '',\r\n notes: '',\r\n partsDescription: '',\r\n priority: 3,\r\n status: 1,\r\n type: 1,\r\n vendor: 3,\r\n number: '',\r\n isDeleted: false,\r\n productName: '',\r\n parts: [],\r\n sapBusinessIndicator: '',\r\n userID: '',\r\n source: 0\r\n};\r\n\r\nexport const initialPreventativeMaintenanceChecklist: IpreventativeMaintenanceChecklist = {\r\n id: '',\r\n name: '',\r\n isDeleted: false,\r\n preventativeMaintenancePlanID: '',\r\n scheduleInterval: 0,\r\n preventativeMaintenancePoints: []\r\n};\r\n\r\nexport const initialUserAlert = {\r\n data: {},\r\n showUserAlertModal: false\r\n};\r\n\r\n/* ******************** DESKTOP ONLY ***************/\r\n/*\r\n\r\n/*\r\n* TRAINING initial state\r\n*/\r\nexport const initialQuiz = {\r\n id: '',\r\n name: '',\r\n imagePath: '',\r\n isComplete: false,\r\n videoPath: '',\r\n instructions: '',\r\n lessonID: '',\r\n isTimed: false,\r\n questions: []\r\n};\r\nexport const intialQuizAnswer = {\r\n questionID: '',\r\n answer: '',\r\n isCorrect: false\r\n};\r\nexport const initialQuizAnswers = { show: false, quizAnswers: {} };\r\n\r\nexport const initialCourse = {\r\n id: '',\r\n name: '',\r\n description: ''\r\n};\r\nexport const initialLesson = {\r\n id: '',\r\n name: '',\r\n description: '',\r\n courseID: '',\r\n imagePath: '',\r\n order: 0,\r\n primaryVideoPath: '',\r\n slideshowPath: '',\r\n courseLessons: [],\r\n cost: 0,\r\n isProtected: false\r\n};\r\nexport const initialUser: Iuser = {\r\n email: '',\r\n securityFunctions: [],\r\n userCountries: [],\r\n first: '',\r\n last: '',\r\n position: '',\r\n phone: '',\r\n id: '',\r\n type: userTypeEnum.Hospital,\r\n facilities: [],\r\n hasTeamMembers: false,\r\n isActive: true,\r\n countryID: '',\r\n isDeleted: false,\r\n widgets: `${widgetsEnum.inspectionStatus},${widgetsEnum.preventativeMaintenance},${widgetsEnum.tae},${widgetsEnum.quotes}`,\r\n salesManagerID: '',\r\n optInGDPR: true,\r\n userStandards: []\r\n};\r\n\r\nexport const initialUserQueue = {\r\n id: '',\r\n user: initialUser\r\n};\r\n\r\nexport const initialProductQueueObject: IproductQueueObject = {\r\n id: '',\r\n productID: '',\r\n creator: initialUser,\r\n product: initialProduct,\r\n isDeleted: false\r\n};\r\n\r\n// not used currently\r\nexport const initialTrainingProgress = {\r\n id: '',\r\n lessonID: '',\r\n userID: '',\r\n currentTime: 0, // the current time of the video as reported from vimeo\r\n percentageComplete: 0, // the current percent complete as reported by vimeo\r\n totalTime: 0, // the total time (or duration) in second of the video, from vimeo\r\n timeSpent: 0,\r\n isComplete: false\r\n};\r\n\r\n// Dashboard Analytics\r\nexport const initialAnalyticsInspection: IanalyticsInspection = {\r\n mainCategoryID: '',\r\n mainCategoryName: '',\r\n jobDate: '',\r\n data: [],\r\n total: 0\r\n};\r\nexport const initialAnalyticsQuote = {\r\n total: 0,\r\n new: 0,\r\n approved: 0,\r\n inProgress: 0,\r\n rejected: 0,\r\n unquotedLeads: 0\r\n};\r\n\r\nexport const initialAnalyticsTAE: IanalyticsTAE = {\r\n photoUrl: '',\r\n coAlarm: false,\r\n lagAlarm: false,\r\n leftBankPressureBar: 0,\r\n rightBankPressureBar: 0,\r\n deliveryPressureBar: 0,\r\n reservePressureBar: 0,\r\n reservePressurePSI: 0,\r\n leftBankPressureKPA: 0,\r\n rightBankPressureKPA: 0,\r\n deliveryPressureKPA: 0,\r\n reservePressureKPA: 0,\r\n leftBankEmpty: 0,\r\n rightBankEmpty: 0,\r\n timeOnCurrentBank: 0,\r\n timeOnPreviousBank: 0,\r\n mainCategoryID: '',\r\n mainCategoryName: '',\r\n installBaseID: '',\r\n installBaseName: '',\r\n installBaseLocation: '',\r\n installBaseSerialNumber: '',\r\n systemRunHours: 0,\r\n unit1Hours: 0,\r\n unit2Hours: 0,\r\n dewpoint: 0,\r\n coLevel: 0,\r\n receiverPressure: 0,\r\n dryer1Mode: '',\r\n dryer2Mode: '',\r\n leftBankPressurePSI: 0,\r\n rightBankPressurePSI: 0,\r\n deliveryPressurePSI: 0,\r\n leftBankSelectLatch: true,\r\n reserveInUseAlarm: false,\r\n reserveLowAlarm: false,\r\n secondaryLowAlarm: false,\r\n changeoverAlarm: false,\r\n dewpointAlarm: false,\r\n gasType: '',\r\n date: '',\r\n device: {}\r\n};\r\n\r\nexport const initialTae: Itae = {\r\n leftBankPressureBar: 0,\r\n rightBankPressureBar: 0,\r\n deliveryPressureBar: 0,\r\n reservePressureBar: 0,\r\n leftBankPressurePSI: 0,\r\n rightBankPressurePSI: 0,\r\n deliveryPressurePSI: 0,\r\n reservePressurePSI: 0,\r\n leftBankPressureKPA: 0,\r\n rightBankPressureKPA: 0,\r\n deliveryPressureKPA: 0,\r\n reservePressureKPA: 0,\r\n leftBankEmpty: 0,\r\n rightBankEmpty: 0,\r\n leftBankSelectLatch: true,\r\n reserveInUseAlarm: false,\r\n reserveLowAlarm: false,\r\n secondaryLowAlarm: false,\r\n changeoverAlarm: false,\r\n gasType: '',\r\n timeOnCurrentBank: 0,\r\n timeOnPreviousBank: 0,\r\n installBaseID: '',\r\n serialNumber: '',\r\n date: '',\r\n systemHours: 0,\r\n unit1RunningHours: 0,\r\n unit2RunningHours: 0,\r\n lagAlarm: false,\r\n dewpointAlarm: false,\r\n coAlarm: false,\r\n dryer1Mode: '',\r\n dryer2Mode: '',\r\n dewpointValue: 0,\r\n coValue: 0,\r\n receiverPressure: 0,\r\n id: '',\r\n isDeleted: false\r\n};\r\n\r\nexport const initialChart = {\r\n data: [],\r\n label: '',\r\n unit: dataUnitEnum.none,\r\n format: dataFormatEnum.none\r\n};\r\n\r\nexport const initialAnalyticsSmartlink: IanalyticsSmartlink = {\r\n mainCategoryID: '',\r\n mainCategoryName: '',\r\n installBaseID: '',\r\n installBaseName: '',\r\n installBaseLocation: '',\r\n installBaseSerialNumber: '',\r\n latestValues: [],\r\n unit1Graph: [],\r\n unit2Graph: [],\r\n updateDate: '',\r\n photoUrl: '',\r\n device: {}\r\n};\r\n\r\nexport const initialSuggestedPart: IsuggestedPart = {\r\n adminComments: '',\r\n createDate: '',\r\n id: '',\r\n installBaseID: '',\r\n installBaseQuantity: 0,\r\n isDeleted: false,\r\n part: initialPart,\r\n partID: '',\r\n product: initialProduct,\r\n productID: '',\r\n productQuantity: 0,\r\n updateDate: ''\r\n};\r\n\r\nexport const initialJobComment = {\r\n id: '',\r\n jobID: '',\r\n userID: '',\r\n isDeficiency: false,\r\n isDeleted: false,\r\n text: '',\r\n codeID: '',\r\n isResolved: true\r\n};\r\n\r\nexport const initialDeficiencyCode: IdeficiencyCode = {\r\n description: '',\r\n name: '',\r\n id: '',\r\n isDeleted: false,\r\n standardID: ''\r\n};\r\nexport const initialLeadActivity: IleadActivity = {\r\n type: leadActivityTypesEnum.email,\r\n otherType: '',\r\n notes: '',\r\n followUpNote: '',\r\n followUpScheduled: '',\r\n leadID: '',\r\n id: '',\r\n activityDate: '',\r\n isDeleted: false,\r\n userID: '',\r\n followUpSent: '',\r\n user: initialUser\r\n};\r\n\r\n/* initialState */\r\nconst initialState = {\r\n countries: [],\r\n ajaxCallsInProgress: 0,\r\n offline: {\r\n busy: false,\r\n online: true,\r\n retryCount: 0,\r\n retryScheduled: false,\r\n outbox: [],\r\n lastTransaction: 0\r\n },\r\n config: initialConfig,\r\n user: initialUser,\r\n toastr: { toastrs: [] },\r\n redirect: {\r\n redirectToReferrer: false,\r\n pathname: '/'\r\n },\r\n manageUserQueue: {\r\n totalPages: 1,\r\n userQueuesByID: {},\r\n tableFilters: initialTableFilters,\r\n selectedUserQueue: initialUserQueue\r\n },\r\n manageUser: {\r\n usersByID: {},\r\n selectedUser: initialUser,\r\n totalPages: 1,\r\n tableFilters: initialTableFilters,\r\n activeLocalCountry: ''\r\n },\r\n manageJob: {\r\n totalPages: 1,\r\n nextJobNumber: '',\r\n jobsByID: {},\r\n openJobsForWorkOrdersByID: {},\r\n fseUsersByID: {},\r\n tableFilters: initialTableFilters,\r\n selectedJob: initialJob,\r\n jobWorkOrdersByID: {}\r\n },\r\n manageBrand: {\r\n manageBrandsByID: {},\r\n selectedBrand: initialBrand,\r\n totalPages: 1,\r\n tableFilters: initialTableFilters\r\n },\r\n manageDocumentType: {\r\n documentTypesByID: {},\r\n showEditDocumentTypeModal: false,\r\n selectedDocumentTypeID: ''\r\n },\r\n manageDocument: {\r\n documentsByID: {},\r\n totalPages: 1,\r\n showEditDocumentModal: false,\r\n showEditVersionModal: false,\r\n tableFilters: initialTableFilters,\r\n selectedParentID: '',\r\n selectedDocumentID: '',\r\n documentFormValues: {},\r\n versionFormValues: {}\r\n },\r\n manageLeads: {\r\n leadsByID: {},\r\n leadUsersByID: {},\r\n leadInstallBasesByID: {},\r\n totalPages: 1,\r\n tableFilters: initialTableFilters,\r\n showEditLeadModal: false,\r\n showLeadActivityModal: false,\r\n showEditLeadActivityModal: false,\r\n leadActivitiesByID: {},\r\n selection: [],\r\n selectedLead: initialLead,\r\n selectedLeadActivity: initialLeadActivity\r\n },\r\n manageCustomerQuotes: {\r\n quotesByID: {},\r\n tableFilters: initialTableFilters,\r\n selectedQuote: initialQuote,\r\n showEditQuoteModal: false,\r\n showQuoteDetailsModal: false,\r\n showSalesQuoteModal: false,\r\n totalPages: 1\r\n },\r\n manageWorkOrder: {\r\n workOrdersByID: {},\r\n visibleWorkOrdersByID: {},\r\n technicians: [],\r\n totalPages: 1,\r\n showEditWorkOrderModal: false,\r\n showEditPartModalForm: false,\r\n showWorkOrderCloseModal: false,\r\n tableFilters: initialTableFilters,\r\n selectedWorkOrderID: '',\r\n selectedPartID: '',\r\n workOrderFormValues: {},\r\n preventativeMaintenanceChecklistsByID: {},\r\n showConfirmSelectJobModal: false,\r\n selection: [],\r\n partFormValues: {},\r\n selectedFacilityIDForConfirmSelectJob: '',\r\n fsesWithWorkOrders: []\r\n },\r\n manageAlert: {\r\n totalPages: 1,\r\n alertsByID: {},\r\n showEditAlertModal: false,\r\n tableFilters: initialTableFilters,\r\n selectedAlertID: '',\r\n alertFormValues: {}\r\n },\r\n manageCode: {\r\n totalPages: 1,\r\n deficiencyCodesByID: {},\r\n showEditCodeModal: false,\r\n tableFilters: initialTableFiltersFrontEndPaging,\r\n selectedCodeID: '',\r\n codeFormValues: {}\r\n },\r\n manageFacility: {\r\n contacts: {},\r\n selectedContactID: '',\r\n foundUsersOrContactsByID: {},\r\n facilityFormValues: {},\r\n tableFilters: initialTableFiltersFrontEndPaging,\r\n selectedFacilityID: '',\r\n facilityContractFormValues: {},\r\n showFacilityContractModal: false,\r\n selectedContact: initialContact\r\n },\r\n manageReport: {\r\n totalPages: 1,\r\n defaultReportsByID: {},\r\n selectedReport: initialReport,\r\n selectedDefaultReportID: '',\r\n showEditReportModal: false,\r\n tableFilters: initialTableFilters\r\n },\r\n manageLocation: {\r\n totalPages: 1,\r\n visibleLocations: [],\r\n showEditLocationModal: false,\r\n tableFilters: initialTableFilters\r\n },\r\n customersWithFacilities: {},\r\n manageTeam: {\r\n teamMembersByID: {},\r\n selectedUserID: '',\r\n showEditTeamModal: false,\r\n editUserFormValues: {},\r\n totalPages: 1,\r\n tableFilters: initialTableFilters\r\n },\r\n manageInventory: {\r\n showEditProductModal: false,\r\n showEditInstallModal: false,\r\n showShoppingCartModal: false,\r\n showInstallContactModal: false,\r\n showSearchNewProductsModal: false,\r\n showImportInstallModal: false,\r\n showMPResultModal: false,\r\n showMPResultHistoryModal: false,\r\n showMPResultNotesModal: false,\r\n totalPages: 1,\r\n productsByID: {},\r\n installBasesByID: {},\r\n cart: {\r\n addedIDs: [],\r\n productsByID: {}\r\n },\r\n tableFilters: {\r\n ...initialTableFiltersFrontEndPaging,\r\n hideVirtualToggle: true\r\n },\r\n searchNewProductsSelectedProduct: initialProduct,\r\n newProducts: {},\r\n selectedProductID: '',\r\n selectedInstallBaseID: '',\r\n productSearchFormValues: {},\r\n installFormValues: {},\r\n searchNewProductInstallBatchMode: {\r\n isBatchMode: false,\r\n installBaseIDs: []\r\n }\r\n },\r\n manageProduct: {\r\n showEditProductModal: false,\r\n tableFilters: initialTableFilters,\r\n productsByID: {},\r\n totalPages: 1\r\n },\r\n productInfo: {\r\n brands: {},\r\n allBrands: {}, // New property for all brands (unfiltered)\r\n productTypes: {},\r\n mainCategories: {},\r\n powers: {},\r\n standards: {},\r\n subcategories: {},\r\n systemSizes: {},\r\n brandOptions: [],\r\n allBrandOptions: [],\r\n originOptions: [],\r\n productTypeOptions: [],\r\n mainCategoryOptions: [],\r\n powerOptions: [],\r\n standardOptions: [],\r\n subcategoryOptions: [],\r\n systemSizeOptions: []\r\n },\r\n manageProductQueue: {\r\n showApproveProductModal: false,\r\n totalPages: 1,\r\n productQueueByID: {},\r\n mergeableProductsByID: {},\r\n tableFilters: initialTableFilters\r\n },\r\n manageTae: {\r\n taeByID: {},\r\n selectedItemID: '',\r\n tableFilters: initialTableFiltersFrontEndPaging,\r\n showEditModal: false\r\n },\r\n training: {\r\n cart: {\r\n addedIDs: [],\r\n productsByID: {}\r\n },\r\n showShoppingCartModal: false,\r\n coursesByID: {},\r\n lessonsByID: {},\r\n lesson: initialLesson,\r\n quizzesByID: {},\r\n quiz: initialQuiz,\r\n lessonProgress: {},\r\n purchasedTraining: [],\r\n quizAnswers: [],\r\n quizView: {\r\n quizComplete: false,\r\n inProgressQuizID: '',\r\n startTime: ''\r\n },\r\n quizLink: { link: '' }\r\n },\r\n manageTraining: {\r\n trainingProgress: {},\r\n tableFilters: initialTableFilters,\r\n totalPages: 1\r\n },\r\n manageMeasurementPointLists: {\r\n totalPages: 1,\r\n measurementPointListsByID: {},\r\n measurementPointsByID: {},\r\n selectedMeasurementPointList: initialMeasurementPointList,\r\n showEditMeasurementPointListModal: false,\r\n showEditMeasurementPointModal: false,\r\n showEditMeasurementPointTabModal: false,\r\n showEditMeasurementPointListTestProceduresModal: false,\r\n tableFilters: initialTableFilters,\r\n selectedTabID: '',\r\n selectedMeasurementPoint: initialMeasurementPoint\r\n },\r\n measurementPointResults: {\r\n measurementPointResultsByID: {},\r\n selectedResult: initialMeasurmentPointResult,\r\n previousResult: initialMeasurmentPointResult,\r\n historicalResultID: ''\r\n },\r\n facilities: {},\r\n syncStatus: {\r\n fseUsersUpdated: 0,\r\n allContactsUpdated: 0\r\n },\r\n showSideMenu: false,\r\n showEditFacilityModal: false,\r\n showEditProfileModal: false,\r\n showSecurityFunctionsModal: false,\r\n showFacilityContactModal: false,\r\n showFacilityContractModal: false,\r\n selectedFacilityID: '',\r\n dashboardAnalytics: {\r\n data: {\r\n inspection: [],\r\n pmp: { totalWorkOrders: 0, data: { open: [], closed: [] } },\r\n tae: [],\r\n taeDashboard: [],\r\n smartlinks: [],\r\n quote: initialAnalyticsQuote\r\n }\r\n },\r\n manageJobComment: {\r\n jobCommentsByID: {},\r\n selectedJobComment: initialJobComment,\r\n showEditJobCommentModal: false,\r\n filteredJobComments: [],\r\n tableFilters: initialTableFiltersFrontEndPaging\r\n },\r\n rawUsersByID: {},\r\n securityUsersByID: {},\r\n showAlertModal: false,\r\n alertsByID: {},\r\n tutorial: {\r\n viewedTours: [],\r\n run: false\r\n },\r\n manageAssetPhotos: {\r\n totalPages: 1,\r\n tableFilters: initialTableFilters,\r\n photos: {},\r\n photosByProduct: {}\r\n },\r\n managePart: {\r\n jobParts: {}\r\n },\r\n manageSuggestedParts: {\r\n totalPages: 1,\r\n suggestedParts: {},\r\n showEditSuggestedPartModal: false,\r\n tableFilters: initialTableFilters,\r\n selectedSuggestedPart: initialSuggestedPart\r\n },\r\n sapJobMappings: {\r\n sapJobMappingsByID: {}\r\n }\r\n};\r\n\r\nexport const emptyTile: Itile = {\r\n title: '',\r\n src: '',\r\n srcBanner: '',\r\n color: 'blue',\r\n width: 359,\r\n height: 136,\r\n url: '',\r\n securityFunctions: [],\r\n description: '',\r\n parentKey: 0,\r\n order: 100\r\n};\r\n\r\nexport const initialPhoto: Iphoto = {\r\n comments: '',\r\n createDate: '',\r\n file: '',\r\n fileType: 0,\r\n height: 0,\r\n id: '',\r\n installBase: initialInstallBase,\r\n installBaseID: '',\r\n isDeleted: false,\r\n isInReport: false,\r\n jobID: '',\r\n lightboxUrl: '',\r\n name: '',\r\n originalUrl: '',\r\n product: initialProduct,\r\n productID: '',\r\n src: '',\r\n thumbnailUrl: '',\r\n updateDate: '',\r\n width: 0\r\n};\r\n\r\nexport default initialState;\r\n","export const securityFunctions = {\r\n // RunDailyRoundsReports: {\r\n // id: '0FF13067-D224-4BA7-883B-9CC07788B55A',\r\n // name: 'securityF:RunDailyReports',\r\n // description: 'securityF:RunDailyReportsDescription'\r\n // },\r\n ManageAllUsers: {\r\n id: 'AA6F93B7-D278-4117-9B14-26DFA795742E',\r\n name: 'securityF:ManageAllUsers',\r\n description: 'securityF:ManageAllUsersDescription'\r\n },\r\n ManageJobs: {\r\n // Beacon Admin only\r\n id: '097AAE49-75FD-4D2B-91EF-967BE665D565',\r\n name: 'securityF:ManageJobs',\r\n description: 'securityF:ManageJobsDescription'\r\n },\r\n FSE: {\r\n id: '9685F92C-F78E-4C70-9961-5E3068030242',\r\n name: 'securityF:FSE',\r\n description: 'securityF:FSEDescription'\r\n },\r\n ViewJobs: {\r\n id: '362838EB-A081-4D87-A231-1B427A481916',\r\n name: 'securityF:ViewJobs',\r\n description: 'securityF:ViewJobsDescription'\r\n },\r\n ManageTrainingPayment: {\r\n id: '3A0D4616-4179-4BA1-98F0-6A929A3A5E0D',\r\n name: 'securityF:ManageTrainingPayment',\r\n description: 'securityF:ManageTrainingPaymentDescription'\r\n },\r\n ManageSecurity: {\r\n id: 'B397D3EB-D55E-416A-9C48-AFE858AC5091',\r\n name: 'securityF:ManageSecurity',\r\n description: 'securityF:ManageSecurityDescription'\r\n },\r\n ViewInventory: {\r\n id: 'A98B1372-81D3-43E1-A81A-3F382CE83542',\r\n name: 'securityF:ViewInventory',\r\n description: 'securityF:ViewInventoryDescription'\r\n },\r\n ViewAssetPhotos: {\r\n id: '51EE06A2-9314-493F-8706-1F9479D7B42B',\r\n name: 'securityF:ViewAssetPhotos',\r\n description: 'securityF:ViewAssetPhotosDescription'\r\n },\r\n ManageInventory: {\r\n id: 'DD65AB77-23D6-4FE0-9AD7-5729B6E5C40D',\r\n name: 'securityF:ManageInventory',\r\n description: 'securityF:ManageInventoryDescription'\r\n },\r\n QuoteForInvoice: {\r\n id: 'DF7EA0C4-98C3-40BF-9E73-03E5BF50F9D0',\r\n name: 'securityF:QuoteForInvoice',\r\n description: 'securityF:QuoteForInvoiceDescription'\r\n },\r\n SignUpTeamMembers: {\r\n id: '947CF4F4-10AC-4A38-BA7B-F069605E7A6C',\r\n name: 'securityF:SignUpTeamMembers',\r\n description: 'securityF:SignUpTeamMembersDescription'\r\n },\r\n ManageTeamMembers: {\r\n id: 'C75A644C-54A5-4EA3-95D2-AB58D2A39E8E',\r\n name: 'securityF:ManageTeamMembers',\r\n description: 'securityF:ManageTeamMembersDescription'\r\n },\r\n ManageIndividualTraining: {\r\n id: '977049C6-3EB6-40CF-938F-C3B766C5EECD',\r\n name: 'securityF:ManageIndividualTraining',\r\n description: 'securityF:ManageIndividualTrainingDescription'\r\n },\r\n ManageEmployeeTraining: {\r\n id: '26785416-C391-4B14-AE9F-B5A56F8D223E',\r\n name: 'securityF:ManageEmployeeTraining',\r\n description: 'securityF:ManageEmployeeTrainingDescription'\r\n },\r\n Payment: {\r\n id: '655401EA-4AA1-4543-91E0-9F5A3AB754C3',\r\n name: 'securityF:Payment',\r\n description: 'securityF:PaymentDescription'\r\n },\r\n ManageProducts: {\r\n id: '64818AA5-A685-4E5D-AD22-E2BB357CF58B',\r\n name: 'securityF:ManageProducts',\r\n description: 'securityF:ManageProductsDescription'\r\n },\r\n ManageLocations: {\r\n id: '0FE683B3-FEA5-4130-9243-2C272CABA674',\r\n name: 'securityF:ManageLocations',\r\n description: 'securityF:ManageLocationsDescription'\r\n },\r\n ManageAllTraining: {\r\n id: '25961E0B-AFB4-4864-BF4C-A341A22553C6',\r\n name: 'securityF:ManageAllTraining',\r\n description: 'securityF:ManageAllTrainingDescription'\r\n },\r\n ManageAllMeasurementPoints: {\r\n id: 'BE9173D7-B8AA-4065-973F-7B39A2226221',\r\n name: 'securityF:ManageAllMeasurementPoints',\r\n description: 'securityF:ManageAllMeasurementPointsDescription'\r\n },\r\n ManageCustomerMeasurementPoints: {\r\n id: '4EA1668B-220A-4FFB-865B-EB271EF6FF0E',\r\n name: 'securityF:ManageCustomerMeasurementPoints',\r\n description: 'securityF:ManageCustomerMeasurementPointsDescription'\r\n },\r\n ManageFacilities: {\r\n id: '9FC06116-3A12-4564-B49B-BC3B7C6218C5',\r\n name: 'securityF:ManageFacilities',\r\n description: 'securityF:ManageFacilitiesDescription'\r\n },\r\n ManageBrands: {\r\n id: '6701ED68-A98C-4F62-BB4D-02219E88804B',\r\n name: 'securityF:ManageBrands',\r\n description: 'securityF:ManageBrandsDescription'\r\n },\r\n ViewDocumentLibrary: {\r\n id: 'B5F04EF4-A318-4781-B7EA-16502E4FD046',\r\n name: 'securityF:ViewDocumentLibrary',\r\n description: 'securityF:ViewDocumentLibraryDescription'\r\n },\r\n ManageDocumentLibrary: {\r\n id: '47E83493-0BC0-4148-8200-13610E9EF087',\r\n name: 'securityF:ManageDocumentLibrary',\r\n description: 'securityF:ManageDocumentLibraryDescription'\r\n },\r\n ManageGeneralDocuments: {\r\n id: '2B836828-2A0D-4B74-9C63-1892097AB2A1',\r\n name: 'securityF:ManageGeneralDocuments',\r\n description: 'securityF:ManageGeneralDocumentsDescription'\r\n },\r\n ManageAlerts: {\r\n id: '28FBCC2D-7D2E-4A56-A6DA-17B08B3D3444',\r\n name: 'securityF:ManageAlerts',\r\n description: 'securityF:ManageAlertsDescription'\r\n },\r\n ManageCodes: {\r\n id: '36B49774-29AF-40C1-818F-15C306197EFC',\r\n name: 'securityF:ManageCodes',\r\n description: 'securityF:ManageCodesDescription'\r\n },\r\n ManageCustomerWorkOrders: {\r\n id: 'FEE227A5-21FD-4301-A0CB-BC101742950F',\r\n name: 'securityF:ManageCustomerWorkOrders',\r\n description: 'securityF:ManageCustomerWorkOrdersDescription'\r\n },\r\n ManageWorkOrderPMP: {\r\n id: '0EA6A35F-C45E-4699-8BDA-96ED23DC22D3',\r\n name: 'securityF:ManageWorkOrderPMP',\r\n description: 'securityF:ManageWorkOrderPMPDescription'\r\n },\r\n ManageWorkOrderAdmin: {\r\n id: '71600CA9-6AD1-4763-857F-4676785EADB6',\r\n name: 'securityF:ManageWorkOrderAdmin',\r\n description: 'securityF:ManageWorkOrderAdminDescription'\r\n },\r\n RunReports: {\r\n id: 'FF7FAA1C-DF33-4237-98DA-2A8279250619',\r\n name: 'securityF:RunReports',\r\n description: 'securityF:RunReportsDescription'\r\n },\r\n // RunAuditReport: {\r\n // id: '3F7939D0-1AC0-4F06-B54B-931F8E673F69',\r\n // name: 'securityF:RunAuditReport',\r\n // description: 'securityF:RunAuditReport'\r\n // },\r\n // RunVerificationReport: {\r\n // id: '1DD9F449-3804-4868-9258-542877847FBF',\r\n // name: 'securityF:RunVerificationReport',\r\n // description: 'securityF:RunVerificationReport'\r\n // },\r\n // RunAGSRebalanceReport: {\r\n // id: '6A5945C0-04E2-42C9-997A-2560A716EA06',\r\n // name: 'securityF:RunAGSRebalanceReport',\r\n // description: 'securityF:RunAGSRebalanceReportDescription'\r\n // },\r\n // RunCommissioningReport: {\r\n // id: 'BD90D27B-5266-4B4B-AE30-968FA9855BD5',\r\n // name: 'securityF:RunCommissioningReport',\r\n // description: 'securityF:RunCommissioningReportDescription'\r\n // },\r\n AllowAllCustomers: {\r\n id: 'FB36F652-705E-4CAC-996F-558CC1BC11AF',\r\n name: 'securityF:AllowAllCustomers',\r\n description: 'securityF:AllowAllCustomersDescription'\r\n },\r\n RecieveContact: {\r\n id: 'E6491559-9664-4BF9-98C6-B55D4648F638',\r\n name: 'securityF:RecieveContact',\r\n description: 'securityF:RecieveContactDescription'\r\n },\r\n DashboardInspection: {\r\n id: 'D75CD19E-F89B-467E-A881-AB2FE316465C',\r\n name: 'securityF:DashboardInspection',\r\n description: 'securityF:DashboardInspectionDescription'\r\n },\r\n DashboardTAE: {\r\n id: '2EB141B4-692C-47FA-BDF8-EC87FE36FBFC',\r\n name: 'securityF:DashboardTAE',\r\n description: 'securityF:DashboardTAEDescription'\r\n },\r\n DashboardSmartlinks: {\r\n id: '90BD451F-667C-4EFF-9AD7-EF5CD4F4410D',\r\n name: 'securityF:DashboardSmartlinks',\r\n description: 'securityF:DashboardSmartlinksDescription'\r\n },\r\n DashboardPMP: {\r\n id: 'F0C9B006-8A6B-4B45-8454-5574522E45DE',\r\n name: 'securityF:DashboardPMP',\r\n description: 'securityF:DashboardPMPDescription'\r\n },\r\n ManageJobComments: {\r\n id: 'C374FD13-5E93-46E9-B0EF-E6D001850D7C',\r\n name: 'securityF:ManageJobComments',\r\n description: 'securityF:ManageJobCommentsDescription'\r\n },\r\n // RunVisitReport: {\r\n // id: 'C9C6ABC6-B5F0-4D40-82F0-C1A90036AF85',\r\n // name: 'securityF:RunVisitReport',\r\n // description: 'securityF:RunVisitReportDescription'\r\n // },\r\n ViewCustomers: {\r\n id: 'DD6495E8-5EA5-4116-9951-9E3DF6C6E560',\r\n name: 'securityF:ViewCustomers',\r\n description: 'securityF:ViewCustomersDescription'\r\n },\r\n SalesParts: {\r\n id: '6A0C2EF5-FA7A-4056-BA21-806066719FD8',\r\n name: 'securityF:SalesParts',\r\n description: 'securityF:SalesPartsDescription'\r\n },\r\n SalesInstallation: {\r\n id: '9FF13CF9-658B-456D-9F16-61D26BB1B3E0',\r\n name: 'securityF:SalesInstallation',\r\n description: 'securityF:SalesInstallationDescription'\r\n },\r\n SalesService: {\r\n id: '65A98A0B-2427-45ED-B130-F508960CFC0C',\r\n name: 'securityF:SalesService',\r\n description: 'securityF:SalesServiceDescription'\r\n },\r\n SalesManager: {\r\n id: 'A14BDD5F-14FF-49E5-81F0-5AB85FFD454D',\r\n name: 'securityF:SalesManager',\r\n description: 'securityF:SalesManagerDescription'\r\n },\r\n SalesAdmin: {\r\n id: '7AC36557-025E-496E-94DB-E99181982FA1',\r\n name: 'securityF:SalesAdmin',\r\n description: 'securityF:SalesAdminDescription'\r\n },\r\n ManageCustomerQuotes: {\r\n id: 'CDD578F8-F20C-4CBD-A948-407CDB0200B5',\r\n name: 'securityF:ManageCustomerQuotes',\r\n description: 'securityF:ManageCustomerQuotesDescription'\r\n },\r\n DashboardQuote: {\r\n id: '8D326BA2-DA50-4B15-BC0A-3659E7348F7D',\r\n name: 'securityF:DashboardQuote',\r\n description: 'securityF:DashboardQuoteDescription'\r\n },\r\n FSECustomer: {\r\n id: '156E2179-D321-4F46-A883-D6646C54E362',\r\n name: 'securityF:FSECustomer',\r\n description: 'securityF:FSECustomerDescription'\r\n },\r\n ManageSuggestedParts: {\r\n id: '48AEC40C-27B1-4773-A1CC-3023EEABB891',\r\n name: 'securityF:ManageSuggestedParts',\r\n description: 'securityF:ManageSuggestedPartsDescription'\r\n },\r\n ViewSuggestedParts: {\r\n id: 'E231A44F-25E7-4C4D-8693-96E30272DBC8',\r\n name: 'securityF:ViewSuggestedParts',\r\n description: 'securityF:ViewSuggestedPartsDescription'\r\n },\r\n ManageSystemDocuments: {\r\n id: '2BE1DCCD-3C3E-4518-8B03-859D57AF0D90',\r\n name: 'securityF:ManageSystemDocuments',\r\n description: 'securityF:ManageSystemDocumentsDescription'\r\n },\r\n AllowAllCountries: {\r\n id: '64D24BBC-671C-4273-A975-0C0D9ED23F33',\r\n name: 'securityF:AllowAllCountries',\r\n description: 'securityF:AllowAllCountriesDescription'\r\n },\r\n // RunServicePlanReport: {\r\n // id: '9A4BD96E-477C-4190-847B-CB4ED22D7B9B',\r\n // name: 'securityF:RunServicePlanReport',\r\n // description: 'securityF:RunServicePlanReportDescription'\r\n // },\r\n FSEFacilityContactEdit: {\r\n id: '8E08F739-3B0F-43F5-8751-B1E9BA920DDC',\r\n name: 'securityF:FSEFacilityContactEdit',\r\n description: 'securityF:FSEFacilityContactEditDescription'\r\n },\r\n ManageReports: {\r\n id: 'BE652BF9-D046-4F13-84F9-9AC63FCCA9A7',\r\n name: 'securityF:ManageReportsName',\r\n description: 'securityF:ManageReportsDescription'\r\n }\r\n};\r\n","import { Itile } from '../models';\r\nimport { securityFunctions } from './securityFunctions';\r\nimport { menuParentKeysEnum } from '../models-enums';\r\n\r\nexport const tiles: Itile[] = [\r\n {\r\n svgKey: 'quotes',\r\n title: 'quotes',\r\n src: require('../images/quotesTile.jpg'),\r\n srcBanner: require('../images/quotesHeader.png'),\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/quotes',\r\n securityFunctions: [securityFunctions.ManageCustomerQuotes.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.dashboard,\r\n order: 105\r\n },\r\n {\r\n svgKey: 'quotes',\r\n title: 'quotes_sales',\r\n src: require('../images/quotesTile.jpg'),\r\n srcBanner: require('../images/quotesHeader.png'),\r\n color: 'purple',\r\n width: 270,\r\n height: 300,\r\n url: '/quotes_sales',\r\n securityFunctions: [\r\n securityFunctions.SalesParts.id,\r\n securityFunctions.SalesInstallation.id,\r\n securityFunctions.SalesService.id,\r\n securityFunctions.SalesManager.id,\r\n securityFunctions.SalesAdmin.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.sales,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'training',\r\n title: 'training',\r\n src: require('../images/beaconTraining.jpg'),\r\n srcBanner: require('../images/beaconTrainingHeader.jpg'),\r\n color: 'purple',\r\n width: 270,\r\n height: 300,\r\n url: '/training',\r\n securityFunctions: [securityFunctions.ManageIndividualTraining.id],\r\n parentKey: menuParentKeysEnum.default,\r\n description: '',\r\n order: 100\r\n },\r\n // TODO Figure out the Tile for this guy. Should hold parent tile as well\r\n {\r\n svgKey: 'leads',\r\n title: 'leads',\r\n src: require('../images/beaconTraining.jpg'),\r\n srcBanner: require('../images/beaconTrainingHeader.jpg'),\r\n color: 'dark',\r\n width: 270,\r\n height: 300,\r\n url: '/leads',\r\n securityFunctions: [\r\n securityFunctions.SalesAdmin.id,\r\n securityFunctions.SalesInstallation.id,\r\n securityFunctions.SalesManager.id,\r\n securityFunctions.SalesParts.id,\r\n securityFunctions.SalesService.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.sales,\r\n order: 100\r\n },\r\n\r\n {\r\n svgKey: 'inventory',\r\n title: 'inventory',\r\n src: require('../images/beaconManageInventory.jpg'),\r\n srcBanner: require('../images/beaconManageInventoryHeader.jpg'),\r\n color: 'orange',\r\n width: 270,\r\n height: 300,\r\n url: '/inventory',\r\n securityFunctions: [\r\n securityFunctions.ViewInventory.id,\r\n securityFunctions.ManageInventory.id\r\n ],\r\n parentKey: menuParentKeysEnum.default,\r\n description: '',\r\n order: 100\r\n },\r\n {\r\n svgKey: 'manageUsers',\r\n title: 'manageUser',\r\n src: require('../images/beaconManageUsers.jpg'),\r\n srcBanner: require('../images/beaconManageUsersHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/users',\r\n securityFunctions: [securityFunctions.ManageAllUsers.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 20\r\n },\r\n {\r\n svgKey: 'newUserQueue',\r\n title: 'manageUserQueue',\r\n src: require('../images/beaconQueue.jpg'),\r\n srcBanner: require('../images/beaconQueueHeader.jpg'),\r\n color: 'grey',\r\n width: 270,\r\n height: 300,\r\n url: '/queue',\r\n securityFunctions: [securityFunctions.ManageAllUsers.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 30\r\n },\r\n {\r\n svgKey: 'documents',\r\n title: 'Documents',\r\n src: require('../images/documentTile.jpg'),\r\n srcBanner: require('../images/documentHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/documents',\r\n securityFunctions: [\r\n securityFunctions.ViewDocumentLibrary.id,\r\n securityFunctions.ManageDocumentLibrary.id,\r\n securityFunctions.ManageGeneralDocuments.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.facility,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'reports',\r\n title: 'manageReports',\r\n src: require('../images/reportTile.jpg'),\r\n srcBanner: require('../images/beaconManageUsersHeader.jpg'),\r\n color: 'orange',\r\n width: 270,\r\n height: 300,\r\n url: '/reports',\r\n securityFunctions: [securityFunctions.RunReports.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 50\r\n },\r\n {\r\n svgKey: 'reports',\r\n title: 'reportBuilder',\r\n src: require('../images/reportTile.jpg'),\r\n srcBanner: require('../images/beaconManageUsersHeader.jpg'),\r\n color: 'orange',\r\n width: 270,\r\n height: 300,\r\n url: '/reportBuilder',\r\n securityFunctions: [securityFunctions.ManageReports.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 50\r\n },\r\n {\r\n svgKey: 'customers',\r\n title: 'facilities',\r\n src: require('../images/customerTile.jpg'),\r\n srcBanner: require('../images/customerHeader.jpg'),\r\n color: 'grey',\r\n width: 270,\r\n height: 300,\r\n url: '/facility',\r\n securityFunctions: [\r\n securityFunctions.ManageFacilities.id,\r\n securityFunctions.ViewCustomers.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'locations',\r\n title: 'locations',\r\n src: require('../images/LocationTile.jpg'),\r\n srcBanner: require('../images/locationHeader.jpg'),\r\n color: 'dark',\r\n width: 270,\r\n height: 300,\r\n url: '/locations',\r\n securityFunctions: [securityFunctions.ManageLocations.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.facility,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'jobs',\r\n title: 'manageJobs',\r\n src: require('../images/beaconManageJobs.jpg'),\r\n srcBanner: require('../images/beaconManageJobsHeader.jpg'),\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/managejobs',\r\n securityFunctions: [securityFunctions.ManageJobs.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 40\r\n },\r\n {\r\n svgKey: 'alerts',\r\n title: 'alerts',\r\n src: require('../images/alertTile.jpg'),\r\n srcBanner: require('../images/alertHeader.jpg'),\r\n color: 'purple',\r\n width: 270,\r\n height: 300,\r\n url: '/alerts',\r\n securityFunctions: [securityFunctions.ManageAlerts.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'standardText',\r\n title: 'standardTextLibrary',\r\n src: require('../images/codeTile.jpg'),\r\n srcBanner: require('../images/codeHeader.jpg'),\r\n color: 'grey',\r\n width: 270,\r\n height: 300,\r\n url: '/codes',\r\n securityFunctions: [securityFunctions.ManageCodes.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'workOrders',\r\n title: 'workorders',\r\n src: require('../images/workOrderTile.jpg'),\r\n srcBanner: require('../images/workOrderHeader.jpg'),\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/workorders',\r\n securityFunctions: [securityFunctions.ManageCustomerWorkOrders.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'productQueue',\r\n title: 'facilityqueue',\r\n src: require('../images/beaconManageProductQueue.jpg'),\r\n srcBanner: require('../images/beaconManageProductQueueHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/facilityqueue',\r\n securityFunctions: [securityFunctions.ManageFacilities.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'productQueue',\r\n title: 'productqueue',\r\n src: require('../images/beaconManageProductQueue.jpg'),\r\n srcBanner: require('../images/beaconManageProductQueueHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/productqueue',\r\n securityFunctions: [securityFunctions.ManageProducts.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'products',\r\n title: 'products',\r\n src: require('../images/beaconManageProducts.jpeg'),\r\n srcBanner: require('../images/workOrderHeader.jpg'),\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/products',\r\n securityFunctions: [securityFunctions.ManageProducts.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 10\r\n },\r\n\r\n {\r\n svgKey: 'measurement',\r\n title: 'manageMeasurementPointList',\r\n src: require('../images/measurementTile.jpg'),\r\n srcBanner: require('../images/beaconManageUsersHeader.jpg'),\r\n color: 'purple',\r\n width: 270,\r\n height: 300,\r\n url: '/measurements',\r\n securityFunctions: [securityFunctions.ManageAllMeasurementPoints.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 60\r\n },\r\n\r\n {\r\n svgKey: 'brands',\r\n title: 'brands',\r\n src: require('../images/beaconManageInventory.jpg'),\r\n srcBanner: require('../images/beaconManageInventoryHeader.jpg'),\r\n color: 'orange',\r\n width: 270,\r\n height: 300,\r\n url: '/brands',\r\n securityFunctions: [securityFunctions.ManageBrands.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'trainingProgress',\r\n title: 'manageAllTraining',\r\n src: require('../images/trainingProgressTile.jpg'),\r\n srcBanner: require('../images/trainingProgressHeader.jpg'),\r\n color: 'dark',\r\n width: 270,\r\n height: 300,\r\n url: '/manageTraining',\r\n securityFunctions: [\r\n securityFunctions.ManageAllTraining.id,\r\n securityFunctions.ManageIndividualTraining.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'manageTeam',\r\n title: 'manageTeam',\r\n src: require('../images/beaconManageTeam.jpg'),\r\n srcBanner: require('../images/beaconManageTeamHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/team',\r\n // securityFunctions: [securityFunctions.ManageTeamMembers.id],\r\n securityFunctions: ['temporarily disabled'],\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'jobComments',\r\n title: 'jobComments',\r\n src: require('../images/jobCommentsTile.jpg'),\r\n srcBanner: require('../images/jobCommentsHeader.jpg'),\r\n color: 'purple',\r\n width: 270,\r\n height: 300,\r\n url: '/job_comments',\r\n securityFunctions: [securityFunctions.ManageJobComments.id],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'pmp',\r\n title: 'pmp',\r\n src: require('../images/beaconManageTeam.jpg'),\r\n srcBanner: require('../images/beaconManageTeamHeader.jpg'),\r\n color: 'blue',\r\n width: 270,\r\n height: 300,\r\n url: '/pmp',\r\n securityFunctions: [securityFunctions.DashboardPMP.id],\r\n description: 'tile for the PMP dashboard analytics',\r\n shouldHideOnDashboard: true,\r\n shouldHideOnMenu: false,\r\n parentKey: menuParentKeysEnum.dashboard,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'inspectionStatus',\r\n title: 'inspection',\r\n src: require('../images/beaconManageTeam.jpg'),\r\n srcBanner: require('../images/beaconManageTeamHeader.jpg'),\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/assetStatus',\r\n securityFunctions: [\r\n securityFunctions.DashboardInspection.id,\r\n securityFunctions.ViewInventory.id\r\n ],\r\n description: 'tile for the Inspection dashboard analytics',\r\n shouldHideOnDashboard: true,\r\n shouldHideOnMenu: false,\r\n parentKey: menuParentKeysEnum.dashboard,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'home',\r\n title: 'home',\r\n color: 'green',\r\n width: 270,\r\n height: 300,\r\n url: '/dashboard',\r\n securityFunctions: [securityFunctions.ManageIndividualTraining.id],\r\n shouldHideOnDashboard: true,\r\n shouldHideOnMenu: false,\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 0\r\n },\r\n // new-route: require new image assets\r\n {\r\n svgKey: 'trainingProgress',\r\n title: 'assetPhotos',\r\n src: require('../images/trainingProgressTile.jpg'),\r\n srcBanner: require('../images/trainingProgressHeader.jpg'),\r\n color: 'dark',\r\n width: 270,\r\n height: 300,\r\n url: '/asset_Photos',\r\n securityFunctions: [\r\n securityFunctions.ManageIndividualTraining.id,\r\n securityFunctions.ManageAllTraining.id,\r\n securityFunctions.ManageEmployeeTraining.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.default,\r\n order: 100\r\n },\r\n {\r\n svgKey: 'trainingProgress',\r\n title: 'suggestedParts',\r\n src: require('../images/trainingProgressTile.jpg'),\r\n srcBanner: require('../images/trainingProgressHeader.jpg'),\r\n color: 'dark',\r\n width: 270,\r\n height: 300,\r\n url: '/suggested_parts',\r\n securityFunctions: [\r\n securityFunctions.ManageSuggestedParts.id,\r\n securityFunctions.ViewSuggestedParts.id\r\n ],\r\n description: '',\r\n parentKey: menuParentKeysEnum.admin,\r\n order: 100\r\n }\r\n];\r\n","import Player, { Options } from '@vimeo/player';\r\nimport React from 'react';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\n\r\ninterface IvimeoProps {\r\n vimeoId: number;\r\n}\r\n\r\nexport class VideoPlayer extends React.Component {\r\n private player: Player | undefined;\r\n private pElem: HTMLDivElement | null;\r\n\r\n constructor(props: IvimeoProps) {\r\n super(props);\r\n this.player = undefined;\r\n this.pElem = null;\r\n }\r\n\r\n componentDidMount() {\r\n this.setUpPlayer();\r\n }\r\n componentWillUnmount() {\r\n if (typeof this.player !== 'undefined') {\r\n this.player.off('play');\r\n this.player.off('pause');\r\n }\r\n }\r\n\r\n setUpPlayer = () => {\r\n if (this.pElem === null) {\r\n throw new Error('missing pElem');\r\n }\r\n const options: Options = {\r\n id: this.props.vimeoId,\r\n width: 723, // > 723 ? this.pElem.offsetWidth : 723,\r\n loop: false\r\n };\r\n\r\n this.player = new Player('lessonPlayer', options);\r\n this.player\r\n .ready()\r\n .then(() => {\r\n if (this.player === undefined) {\r\n throw new Error('missing vimeo player DOM element');\r\n }\r\n })\r\n .catch(error => {\r\n console.error('Vimeo player failed to initialize.', error);\r\n toastr.error(\r\n 'Error',\r\n 'Video failed to load. Please try again or contact support.',\r\n constants.toastrError\r\n );\r\n });\r\n };\r\n render() {\r\n return (\r\n (this.pElem = ref)}\r\n style={{ width: '100%', padding: 0, margin: 0 }}\r\n />\r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport { Step } from 'react-joyride';\r\nimport { VideoPlayer } from '../components/tutorial/Video';\r\n\r\n// interface Itutorial {\r\n// [key: string]: {steps: Step[]};\r\n// }\r\n\r\nexport const tutorial = {\r\n // tae: {\r\n // steps: [\r\n // {\r\n // title: 'taeTutorialTitle',\r\n // content: ,\r\n // target: 'body',\r\n // placement: 'center',\r\n // disableBeacon: true\r\n // }\r\n // ] as Step[]\r\n // },\r\n documents: {\r\n steps: [\r\n {\r\n title: 'documentsTutorialTitle',\r\n content: ,\r\n target: 'body',\r\n placement: 'center',\r\n disableBeacon: true\r\n }\r\n ] as Step[]\r\n },\r\n inventory: {\r\n steps: [\r\n {\r\n title: 'inventoryTutorialTitle',\r\n content: ,\r\n target: 'body',\r\n placement: 'center',\r\n disableBeacon: true\r\n }\r\n ] as Step[]\r\n }\r\n // training: {\r\n // steps: [\r\n // {\r\n // title: 'trainingTutorialTitle',\r\n // content: ,\r\n // target: 'body',\r\n // placement: 'center',\r\n // disableBeacon: true\r\n // }\r\n // ] as Step[]\r\n // },\r\n // workorders: {\r\n // steps: [\r\n // {\r\n // title: 'workOrdersTutorialTitle',\r\n // content: ,\r\n // target: 'body',\r\n // placement: 'center',\r\n // disableBeacon: true\r\n // }\r\n // ] as Step[]\r\n // },\r\n // pmp: {\r\n // steps: [\r\n // {\r\n // title: 'pmpTutorialTitle',\r\n // content: ,\r\n // target: 'body',\r\n // placement: 'center',\r\n // disableBeacon: true\r\n // }\r\n // ] as Step[]\r\n // }\r\n};\r\n","import React, { Component } from 'react';\r\n\r\nimport CreatableSelect from 'react-select/creatable';\r\nimport { uniqBy } from 'lodash';\r\n\r\ninterface Iprops {\r\n onChange: (value: any) => void;\r\n initialContent: string[];\r\n}\r\n\r\nconst components = {\r\n DropdownIndicator: null\r\n};\r\n\r\nconst createOption = (label: string) => ({\r\n label,\r\n value: label\r\n});\r\n\r\nexport default class CreatableMultiTextInput extends Component {\r\n state = {\r\n inputValue: '',\r\n value: []\r\n };\r\n\r\n componentDidMount() {\r\n this.setState({ value: this.props.initialContent });\r\n }\r\n handleChange = (value: any) => {\r\n this.setState({ value });\r\n this.props.onChange(value);\r\n };\r\n handleInputChange = (inputValue: string) => {\r\n this.setState({ inputValue });\r\n };\r\n handleKeyDown = (event: React.KeyboardEvent) => {\r\n const { inputValue, value } = this.state;\r\n if (!inputValue) return;\r\n switch (event.key) {\r\n case 'Enter':\r\n case 'Tab': {\r\n event.preventDefault();\r\n const newValue = value\r\n ? uniqBy([...value, createOption(inputValue)], 'value')\r\n : [createOption(inputValue)];\r\n this.setState({\r\n inputValue: '',\r\n value: newValue\r\n });\r\n this.props.onChange(newValue);\r\n }\r\n }\r\n };\r\n render() {\r\n const { inputValue, value } = this.state;\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { EditorState, convertToRaw } from 'draft-js';\r\nimport { Editor } from 'react-draft-wysiwyg';\r\nimport { stateFromHTML } from 'draft-js-import-html';\r\nimport draftToHtml from 'draftjs-to-html';\r\n\r\ninterface Iprops {\r\n initialContent: any;\r\n onChange: any;\r\n readOnly: boolean;\r\n toolbarConfig?: object;\r\n charLimit?: number;\r\n}\r\n\r\ninterface Istate {\r\n editorState: EditorState;\r\n characterLimit: number;\r\n}\r\n\r\nconst defaultCharacterLimit: number = 1000;\r\nclass RichTextEditor extends React.Component {\r\n constructor(props: Iprops) {\r\n super(props);\r\n\r\n if (\r\n this.props.initialContent !== 'undefined' &&\r\n this.props.initialContent !== null &&\r\n this.props.initialContent !== ''\r\n ) {\r\n this.setContent(this.props.initialContent, this.props.charLimit);\r\n } else {\r\n this.state = {\r\n editorState: EditorState.createEmpty(),\r\n characterLimit: defaultCharacterLimit\r\n };\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n this.props.charLimit &&\r\n prevProps.charLimit !== this.props.charLimit\r\n ) {\r\n this.state = {\r\n ...this.state,\r\n characterLimit: this.props.charLimit\r\n };\r\n }\r\n }\r\n\r\n customInlineFn = (element: any, { Style }: any) => {\r\n if (element.tagName === 'SPAN') {\r\n let styles = '';\r\n if (element.style.cssText.includes('font-size')) {\r\n const size = element.style.fontSize.substring(\r\n 0,\r\n element.style.fontSize.length - 2\r\n );\r\n styles += 'fontsize-' + size;\r\n }\r\n\r\n return Style(styles);\r\n }\r\n };\r\n\r\n setContent = (initialContent: any, maxCharacters: number | undefined) => {\r\n const content = stateFromHTML(initialContent, {\r\n customInlineFn: this.customInlineFn\r\n });\r\n const newEditState = EditorState.createWithContent(content);\r\n\r\n this.state = {\r\n ...this.state,\r\n editorState: newEditState,\r\n characterLimit: maxCharacters\r\n ? maxCharacters\r\n : defaultCharacterLimit\r\n };\r\n };\r\n\r\n onChange = (editorState: EditorState) => {\r\n this.setState({ editorState });\r\n\r\n const contentState = editorState.getCurrentContent();\r\n const rawContentState = convertToRaw(contentState);\r\n const plainText = rawContentState.blocks\r\n .map(block => (!block.text.trim() && '\\n') || block.text)\r\n .join('\\n');\r\n if (plainText.length <= this.state.characterLimit) {\r\n const html = draftToHtml(rawContentState);\r\n this.props.onChange(html);\r\n } else {\r\n const newEditorState = EditorState.undo(this.state.editorState);\r\n this.state = { ...this.state, editorState: newEditorState };\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default RichTextEditor;\r\n","import React from 'react';\r\n\r\nimport SignatureCanvas from 'react-signature-canvas';\r\n\r\ninterface Iprops {\r\n onChange: any;\r\n}\r\nclass SignatureControl extends React.Component {\r\n private customerSignaturePad: any = {};\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.customerSignaturePad = React.createRef();\r\n }\r\n\r\n onSubmit = () => {\r\n this.customerSignaturePad.getTrimmedCanvas().toBlob((blob: Blob) => {\r\n this.props.onChange(blob);\r\n });\r\n };\r\n\r\n clear = () => {\r\n this.customerSignaturePad.clear();\r\n };\r\n\r\n render() {\r\n return (\r\n
\r\n {\r\n this.customerSignaturePad = ref;\r\n }}\r\n penColor=\"#333333\"\r\n canvasProps={{\r\n width: 368,\r\n height: 200\r\n }}\r\n />\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default SignatureControl;\r\n","import * as React from 'react';\r\n\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n Observable,\r\n ValidationErrors,\r\n FormControl as rFormControl\r\n} from 'react-reactive-form';\r\nimport {\r\n Button,\r\n Col,\r\n ControlLabel,\r\n FormControl,\r\n FormGroup,\r\n Row,\r\n ToggleButton,\r\n ToggleButtonGroup\r\n} from 'react-bootstrap';\r\nimport FileIcon, { defaultStyles } from 'react-file-icon';\r\nimport Select, { components, createFilter } from 'react-select';\r\nimport { filter, forEach, map, mapValues, orderBy } from 'lodash';\r\n\r\nimport AsyncCreatableSelect from 'react-select/async-creatable';\r\nimport AsyncSelect from 'react-select/async';\r\nimport CreatableMultiTextInput from './CreatableMultiTextInput';\r\nimport CreatableSelect from 'react-select/creatable';\r\nimport Datetime from 'react-datetime';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Ioption } from '../../models';\r\nimport RichTextEditor from './RichTextEditor';\r\nimport { TFunction } from 'i18next';\r\nimport Toggle from 'react-toggle';\r\nimport { constants } from '../../constants/constants';\r\nimport moment from 'moment';\r\nimport SignatureControl from './SignatureControl';\r\n\r\ninterface IstateChanges extends Observable {\r\n next: () => void;\r\n}\r\n\r\ninterface AbstractControlEdited extends AbstractControl {\r\n stateChanges: IstateChanges;\r\n}\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\nexport const ControlComponent = (props: any) => (\r\n
\r\n \r\n
\r\n);\r\n\r\nexport const FormUtil = {\r\n // REFACTOR consider sperating out concerns and remove patchingMeta from \"patchControl\" and rename it to \"patchControlValue\"\r\n patchControl: (\r\n formGroup: AbstractControl,\r\n key: string,\r\n value: any,\r\n meta?: any,\r\n disabled = false,\r\n patchMetaAndValue = false\r\n ) => {\r\n // const control = formGroup.get(key) as AbstractControlEdited; // can't figure out why this does not define next()\r\n const control = formGroup.get(key) as any;\r\n if (!control) {\r\n console.info('missing control', key);\r\n return;\r\n }\r\n if (meta === undefined || (meta && patchMetaAndValue)) {\r\n formGroup.patchValue({ [key]: value });\r\n }\r\n if (meta) {\r\n FormUtil.patchControlMeta(formGroup, key, meta);\r\n }\r\n },\r\n patchControlMeta: (formGroup: AbstractControl, key: string, meta: any) => {\r\n // const control = formGroup.get(key) as AbstractControlEdited; // can't figure out why this does not define next()\r\n const control = formGroup.get(key) as any;\r\n if (!control) {\r\n console.info('missing control', key);\r\n return;\r\n }\r\n control.meta = { ...control.meta, ...meta };\r\n control.statusChanges.next();\r\n // TODO jfbloom22 1/19/2020 calling \"next\" does not trigger a re-render, it will re-render when the user \"focuses\" the input, which is why this works when updating select options\r\n // temporary fix: patch in order to force a re-render\r\n formGroup.patchValue({ [key]: control.value });\r\n },\r\n patchControlValidators: (\r\n formGroup: AbstractControl,\r\n key: string,\r\n validators: Function[]\r\n ): void => {\r\n const control = formGroup.get(key) as any;\r\n if (!control) {\r\n console.info('missing control', key);\r\n return;\r\n }\r\n if (validators) {\r\n control.setValidators(validators);\r\n control.statusChanges.next();\r\n }\r\n },\r\n validators: {\r\n requiredWithTrim: (meta: any) => {\r\n if (\r\n meta &&\r\n meta.value &&\r\n typeof meta.value === 'string' &&\r\n meta.value.trim().length > 0\r\n ) {\r\n return null;\r\n } else if (meta && meta.value && typeof meta.value === 'number') {\r\n // number\r\n return null;\r\n } else if (\r\n meta &&\r\n meta.value &&\r\n typeof meta.value !== 'string' &&\r\n meta.value.value &&\r\n typeof meta.value.value === 'string' &&\r\n meta.value.value.trim().length > 0\r\n ) {\r\n // option with string value\r\n return null;\r\n } else if (\r\n meta &&\r\n meta.value &&\r\n typeof meta.value !== 'string' &&\r\n typeof meta.value.value === 'number'\r\n ) {\r\n // option with number value\r\n return null;\r\n } else if (meta && meta.value && moment.isMoment(meta.value)) {\r\n // moment date\r\n return null;\r\n } else if (Array.isArray(meta.value) && meta.value.length > 0) {\r\n // multi select\r\n return null;\r\n } else {\r\n return { empty: { message: 'not long enough' } };\r\n }\r\n },\r\n isValidEmail: (meta: any) => {\r\n if (meta?.value) {\r\n if (\r\n meta.value.match(\r\n /^([\\w-.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/\r\n )\r\n ) {\r\n return null;\r\n } else {\r\n return {\r\n isValidEmail: {\r\n message: 'not a valid email'\r\n }\r\n };\r\n }\r\n } else {\r\n return null;\r\n }\r\n },\r\n isValidPostalCode: (meta: any) => {\r\n if (meta && !meta.value) {\r\n return null;\r\n } else if (\r\n // eslint-disable-next-line no-constant-condition\r\n false\r\n ) {\r\n return { empty: { message: 'invalid postalCode length' } };\r\n } else {\r\n return null;\r\n }\r\n },\r\n isValidMoment: (meta: any) => {\r\n if (meta && !meta.value) {\r\n return null;\r\n } else if (meta && meta.value && moment.isMoment(meta.value)) {\r\n return null;\r\n } else if (\r\n meta &&\r\n meta.value &&\r\n moment.isMoment(meta.value) === false &&\r\n (moment(meta.value, 'DD-MMM-YY', true).isValid() ||\r\n moment(meta.value, 'YYYY-MM-DDTHH:mm:ss', true).isValid() ||\r\n moment(meta.value, moment.ISO_8601, true).isValid())\r\n ) {\r\n // This validation checks to see if it is one of the 3 expected formats. 1. the format from dateTime plugin, 2.\r\n // format we receive from the API, 3. is what we save locally and send to the API\r\n // TODO this can be improved by using moment().format(constant.momentSQL) everywhere we have toISOString().\r\n return null;\r\n } else {\r\n return { isValidMoment: { message: 'not a valid date' } };\r\n }\r\n },\r\n requiredRichText: (meta: any) => {\r\n if (meta && meta.value !== '


') {\r\n return null;\r\n } else {\r\n return { empty: { message: 'not long enough' } };\r\n }\r\n },\r\n requiredBlob: (meta: any) => {\r\n if (meta && meta.value) {\r\n return null;\r\n } else return { empty: { message: 'required' } };\r\n },\r\n isTwoDigitNumber: (meta: any) => {\r\n if (meta && meta.value) {\r\n if (meta.value.match(/^\\d{2}$/)) {\r\n return null;\r\n } else {\r\n return {\r\n isTwoDigitNumber: {\r\n message: 'not a valid 2 digit value'\r\n }\r\n };\r\n }\r\n } else {\r\n return null;\r\n }\r\n },\r\n isFourDigitAlphaNumeric: (meta: any) => {\r\n if (meta && meta.value) {\r\n if (meta.value.match(/^[0-9A-Za-z]{4}$/)) {\r\n return null;\r\n } else {\r\n return {\r\n isFourDigitAlphaNumeric: {\r\n message: 'not a valid 4 digit value'\r\n }\r\n };\r\n }\r\n } else {\r\n return null;\r\n }\r\n },\r\n isNumeric: (meta: any) => {\r\n if (meta && meta.value) {\r\n if (/^[0-9]+$/.test(meta.value)) {\r\n return null;\r\n } else {\r\n return {\r\n isFourDigitAlphaNumeric: {\r\n message: 'not a valid numeric value'\r\n }\r\n };\r\n }\r\n } else {\r\n return null;\r\n }\r\n },\r\n isLessTenDigitAlphaNumeric: (meta: any) => {\r\n if (meta && meta.value) {\r\n if (meta.value.match(/^[0-9A-Za-z]{1,9}$/)) {\r\n return null;\r\n } else {\r\n return {\r\n isLessTenDigitAlphaNumeric: {\r\n message: 'not a valid 1-9 digit value'\r\n }\r\n };\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n },\r\n convertEnumToOptions: (items: any): Ioption[] => {\r\n const keyFmt = (key: string) =>\r\n key.replace('agsRebalancing', 'AGS Re-Balancing');\r\n const StringIsNumber = (value: string) => isNaN(Number(value)) === true;\r\n return Object.keys(items)\r\n .filter(StringIsNumber)\r\n .map((key: string) => {\r\n return { label: keyFmt(key), value: items[key] };\r\n });\r\n },\r\n convertToOptions: (items: any, shouldIncludeDeleted = false): Ioption[] => {\r\n if (!items) {\r\n console.info('missing option items, returning empty array');\r\n return [];\r\n }\r\n const filteredItems = filter(items, item => {\r\n if (\r\n item.isDeleted === true &&\r\n item.isDeleted !== shouldIncludeDeleted\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n return map(filteredItems, (item: any) => {\r\n const firstLastName =\r\n item.first && item.last ? item.first + ' ' + item.last : '';\r\n return {\r\n value: item.id || item.value,\r\n label:\r\n item.name ||\r\n item.code ||\r\n item.label ||\r\n firstLastName ||\r\n item.email ||\r\n 'unknown'\r\n };\r\n });\r\n },\r\n convertToSingleOption: (item: any, t?: TFunction): Ioption | undefined => {\r\n if (item && item.id && item.id.length) {\r\n const lastOption =\r\n item.first && item.last\r\n ? item.first + ' ' + item.last\r\n : 'unknown';\r\n let label = item.name || item.code || item.label || lastOption;\r\n if (t) {\r\n label = t(label);\r\n }\r\n return {\r\n value: item.id,\r\n label\r\n };\r\n } else {\r\n return undefined;\r\n }\r\n },\r\n getValidationState: (\r\n pristine: boolean,\r\n error: ValidationErrors,\r\n submitted: boolean\r\n ) => {\r\n if (!pristine && error) {\r\n return 'error';\r\n } else if (!pristine && !error) {\r\n return 'success';\r\n } else if (pristine && error && submitted) {\r\n return 'error';\r\n } else {\r\n return null;\r\n }\r\n },\r\n /*\r\n * utility to help transform the data into multipart/form-data\r\n */\r\n toFormData: (formValue: any) => {\r\n const data = new FormData();\r\n Object.keys(formValue).forEach(key => {\r\n const value = formValue[key];\r\n if (moment.isMoment(value)) {\r\n data.append(key, value.utc().toISOString());\r\n } else {\r\n data.append(key, value && value.value ? value.value : value);\r\n }\r\n });\r\n return data;\r\n },\r\n /*\r\n * utility to help transform JSON to query params\r\n */\r\n toUrlSearchParams: (paramCollection: {\r\n [key: string]: string[] | string;\r\n }) => {\r\n const params = new URLSearchParams();\r\n forEach(paramCollection, (collection, key) => {\r\n if (Array.isArray(collection)) {\r\n forEach(collection, item => {\r\n params.append(key, item);\r\n });\r\n } else {\r\n params.append(key, collection);\r\n }\r\n });\r\n return params;\r\n },\r\n /*\r\n * getValues\r\n * a utility function to help convert form values to an object\r\n */\r\n getValues: (formValues: { [key: string]: any }) => {\r\n let values: {\r\n [key: string]: string | boolean | number | string[];\r\n } = {};\r\n forEach(formValues, (value, key) => {\r\n if (\r\n typeof value === 'object' &&\r\n value !== null &&\r\n 'value' in value\r\n ) {\r\n values = { ...values, [key]: value.value };\r\n } else if (Array.isArray(value) && value.length) {\r\n values = { ...values, [key]: map(value, val => val.value) };\r\n } else if (moment.isMoment(value)) {\r\n values = {\r\n ...values,\r\n [key]: value.format(constants.momentSQLFormat)\r\n };\r\n } else {\r\n if (value === undefined) {\r\n return; // don't add it if undefined\r\n }\r\n values = { ...values, [key]: value };\r\n }\r\n });\r\n return values;\r\n },\r\n Datetime: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n\r\n const defaultValue = handler().value;\r\n const momentDate =\r\n !defaultValue || moment.isMoment(defaultValue)\r\n ? defaultValue\r\n : moment.utc(defaultValue);\r\n\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n TextInput: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n FileInput: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const requiredLabel =\r\n meta.required === false && !meta.uploadButton ? ' - Optional' : '';\r\n const extension =\r\n (meta.fileName && meta.fileName.split('.').pop()) ||\r\n (meta.imageUrl && meta.imageUrl.split('.').pop());\r\n const btnClassName = handler().disabled\r\n ? 'btn btn-default disabled'\r\n : 'btn btn-default';\r\n const label =\r\n meta.imageUrl && meta.otherLabels && meta.otherLabels.labelReplace\r\n ? meta.otherLabels.labelReplace\r\n : meta.label;\r\n const idNum = meta.name.charAt(meta.name.length - 1);\r\n const id = `fileUpload${idNum}`;\r\n return (\r\n \r\n {meta.hasPreview && meta.imageUrl && (\r\n \r\n )}\r\n \r\n \r\n \r\n {meta.icon && (\r\n \r\n )}\r\n {label}\r\n {requiredLabel}\r\n \r\n {\r\n const fileInput = evt.target;\r\n let fileName = '';\r\n if (fileInput.files.length > 0) {\r\n meta.onChange(\r\n meta.name,\r\n fileInput.files[0]\r\n );\r\n fileName = fileInput.files[0].name;\r\n }\r\n evt.target.filename = fileName;\r\n }}\r\n style={{ display: 'none' }}\r\n />\r\n \r\n \r\n {!meta.hasPreview && !meta.imageUrl && !meta.uploadButton && (\r\n \r\n )}\r\n\r\n {!!meta.hasDownload &&\r\n meta.imageUrl &&\r\n meta.imageUrl.length !== 0 && (\r\n \r\n \r\n \r\n {meta.otherLabels.labelDownload}\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n },\r\n Toggle: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n Checkbox: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n // const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n TextInputWithoutValidation: ({ handler, meta }: AbstractControl) => (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n ),\r\n Select: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n CreatableSelect: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n AsyncSelect: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \"Enter at least 3 characters to find the facility you're looking for.\"\r\n }\r\n {...handler()}\r\n />\r\n \r\n \r\n );\r\n },\r\n AsyncCreatableSelect: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n SelectWithoutValidation: ({ handler, meta }: AbstractControl) => {\r\n // console.info('rendering select', meta.options, value, defaultValue)\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n return (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n );\r\n },\r\n SelectWithoutValidationLeftLabel: ({ handler, meta }: AbstractControl) => {\r\n // TODO get rid of this because default values do not work for some unknwon reason. we patch the values instead\r\n // console.info('rendering select', meta.options, value, defaultValue)\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n SelectWithButton: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n // console.info('rendering select', meta.options, value, defaultValue)\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n {meta.buttonName}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n Button: ({ handler, meta }: AbstractControl) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n },\r\n translateForm: (config: FieldConfig, t: TFunction) => {\r\n const newControls = mapValues(\r\n config.controls,\r\n (field: AbstractControl) => {\r\n if (field.meta) {\r\n let newMeta: any = { ...field.meta };\r\n if (newMeta.label) {\r\n newMeta = { ...newMeta, label: t(newMeta.label) };\r\n }\r\n if (newMeta.otherLabels) {\r\n let translatedOtherLabels: {\r\n [key: string]: string;\r\n } = {};\r\n forEach(newMeta.otherLabels, (value, key) => {\r\n translatedOtherLabels = {\r\n ...translatedOtherLabels,\r\n [key]: t(value)\r\n };\r\n });\r\n newMeta = {\r\n ...newMeta,\r\n otherLabels: translatedOtherLabels\r\n };\r\n }\r\n\r\n if (newMeta.buttonName) {\r\n newMeta = {\r\n ...newMeta,\r\n buttonName: t(newMeta.buttonName)\r\n };\r\n }\r\n if (newMeta.placeholder) {\r\n newMeta = {\r\n ...newMeta,\r\n placeholder: t(newMeta.placeholder)\r\n };\r\n }\r\n // we need this to translate the options for the security functions\r\n if (\r\n newMeta.shouldTranslate &&\r\n newMeta.options &&\r\n newMeta.options.length\r\n ) {\r\n const newOptions = map(newMeta.options, option => ({\r\n value: option.value,\r\n label: t(option.label)\r\n }));\r\n newMeta = { ...newMeta, options: newOptions };\r\n }\r\n return { ...field, meta: newMeta };\r\n }\r\n return field;\r\n }\r\n );\r\n return { controls: newControls };\r\n },\r\n TextLabel: ({ handler, meta }: any) => {\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n \r\n
{handler().value}
\r\n
\r\n \r\n );\r\n },\r\n TextLabelStatic: ({ meta }: any) => {\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n {meta.value}\r\n \r\n {meta.buttonName ||\r\n (meta.icon && meta.buttonAction && (\r\n \r\n {meta.buttonName\r\n ? meta.name\r\n : meta.icon\r\n ? meta.icon\r\n : null}\r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n },\r\n /*\r\n * DESKTOP ONLY\r\n */\r\n CreatableSelectWithButton: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted,\r\n value\r\n }: AbstractControl) => {\r\n const selectClassName = meta.isMulti\r\n ? 'is-multi beacon-select'\r\n : 'beacon-select';\r\n const selectValidationClass = value && !pristine ? 'has-success' : '';\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n const selectOptions = meta.disableSort\r\n ? meta.options\r\n : orderBy(meta.options, option => option.label.toLowerCase());\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {meta.label}\r\n \r\n {requiredLabel}\r\n {meta.subLabel}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {meta.buttonName}\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n RichTextEditor: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n Signature: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n CreatableMultiTextInput: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n PassFail: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: AbstractControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n Pass\r\n Fail\r\n N/A\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n NumericInput: ({\r\n handler,\r\n touched,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n }: rFormControl) => {\r\n const requiredLabel = meta.required === false ? ' - Optional' : '';\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n {requiredLabel}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n fontAwesomeIcon: ({ handler, meta }: rFormControl) => {\r\n return (\r\n \r\n \r\n \r\n {meta.label}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n },\r\n Divider: () => (\r\n
\r\n \r\n
\r\n )\r\n};\r\n\r\nexport const MultiValueLabel = (props: {\r\n children: string;\r\n innerProps: any;\r\n data: any;\r\n selectProps: any;\r\n}) => {\r\n const label = props.children.split('
')[0];\r\n const address = props.children.split('
')[1];\r\n const children = () => {\r\n return (\r\n \r\n {label}\r\n \r\n {address}\r\n \r\n \r\n );\r\n };\r\n const newProps = { ...props, children: children() };\r\n return ;\r\n};\r\nexport const MultiValueOption = (props: any) => {\r\n const label = props.children.split('
')[0];\r\n const address = props.children.split('
')[1];\r\n const newProps = { ...props, children: label };\r\n return (\r\n \r\n \r\n

{label}

\r\n {address}\r\n
\r\n
\r\n );\r\n};\r\nexport const SingleValueLabel = (props: {\r\n children: string;\r\n innerProps: any;\r\n data: any;\r\n selectProps: any;\r\n}) => {\r\n const label = props.children.split('
')[0];\r\n const address = props.children.split('
')[1];\r\n const newProps = { ...props, children: label };\r\n return (\r\n \r\n \r\n {address}\r\n \r\n );\r\n};\r\n","import * as LanguageDetector from 'i18next-browser-languagedetector';\r\n\r\nimport moment from 'moment';\r\nimport i18next from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\nimport Backend from 'i18next-chained-backend';\r\nimport LocalStorageBackend, {\r\n I18NextLocalStorageBackend\r\n} from 'i18next-localstorage-backend';\r\nimport I18NextLocizeBackend from 'i18next-locize-backend';\r\n// import common from './translations/en-US/common.json';\r\nimport { forEach } from 'lodash';\r\nimport { dataFormatEnum, userLanguageEnum } from './models-enums';\r\nimport { constants } from './constants/constants';\r\n\r\nconst ns = [\r\n 'auth',\r\n 'common',\r\n 'dashboardAnalytics',\r\n 'securityF',\r\n 'facility',\r\n 'nsJob',\r\n 'manageAssetPhotos',\r\n 'manageAlert',\r\n 'manageBrand',\r\n 'manageCode',\r\n 'manageLeads',\r\n 'manageFacility',\r\n 'manageDocument',\r\n 'manageInventory',\r\n 'manageJobComments',\r\n 'manageLocation',\r\n 'manageMeasurementPointLists',\r\n 'manageProduct',\r\n 'manageProductQueue',\r\n 'manageTae',\r\n 'manageTraining',\r\n 'manageWorkOrder',\r\n 'manageReport',\r\n 'manageTeam',\r\n 'manageUserAlert',\r\n 'manageUser',\r\n 'manageUserQueue',\r\n 'tiles',\r\n 'toastMessage',\r\n 'training',\r\n 'units',\r\n 'user',\r\n 'nsTutorial',\r\n 'manageQuotes',\r\n 'manageSuggestedParts',\r\n 'manageReportBuilder'\r\n];\r\n\r\nexport const languageLables: { [key: string]: string } = {\r\n English: 'en-US',\r\n French: 'fr',\r\n German: 'de',\r\n Spanish: 'es',\r\n Thai: 'th-TH',\r\n Chinese: 'zh'\r\n};\r\n\r\nexport const langOption = (value: number): string => {\r\n const langName = userLanguageEnum[value];\r\n const langKey = languageLables[langName];\r\n\r\n return langKey;\r\n};\r\n\r\ni18next.on('onInitialized', lng => {\r\n console.info('setting moment lng', lng);\r\n moment.locale(lng);\r\n});\r\n\r\nconst instance = i18next\r\n .use(Backend)\r\n .use(initReactI18next)\r\n\r\n .use(LanguageDetector)\r\n\r\n .init({\r\n preload: ['en-US'],\r\n lng: 'en-US',\r\n ns,\r\n fallbackLng: 'en-US',\r\n defaultNS: 'translation',\r\n debug: false,\r\n interpolation: {\r\n escapeValue: false, // not needed for react!!\r\n format: (value, format, lng) => {\r\n if (format === 'number') {\r\n if (!value) {\r\n return value;\r\n }\r\n return new Intl.NumberFormat(lng).format(parseFloat(value));\r\n }\r\n if (format === dataFormatEnum[dataFormatEnum.numberTruncate]) {\r\n if (!value) {\r\n return value;\r\n }\r\n return new Intl.NumberFormat(lng).format(\r\n Math.trunc(parseFloat(value) * 100) / 100\r\n ); // intentionally tuncating\r\n }\r\n if (\r\n format ===\r\n dataFormatEnum[dataFormatEnum.secondsToHoursTruncated]\r\n ) {\r\n if (!value) {\r\n return value;\r\n }\r\n value = value / 3600;\r\n return new Intl.NumberFormat(lng).format(\r\n Math.trunc(parseFloat(value) * 100) / 100\r\n ); // intentionally tuncating\r\n }\r\n if (\r\n format ===\r\n dataFormatEnum[dataFormatEnum.pascalToPSITruncated]\r\n ) {\r\n if (!value) {\r\n return value;\r\n }\r\n value = value * 0.0001450377;\r\n return new Intl.NumberFormat(lng).format(\r\n Math.trunc(parseFloat(value) * 100) / 100\r\n ); // intentionally tuncating\r\n }\r\n if (format === dataFormatEnum[dataFormatEnum.celcius]) {\r\n if (!value) {\r\n return value;\r\n }\r\n value = value - 273.15;\r\n return new Intl.NumberFormat(lng).format(\r\n Math.trunc(parseFloat(value) * 100) / 100\r\n ); // intentionally tuncating\r\n }\r\n if (format === dataFormatEnum[dataFormatEnum.fahrenheit]) {\r\n if (!value) {\r\n return value;\r\n }\r\n value = value * 1.8 - 459.67;\r\n return new Intl.NumberFormat(lng).format(\r\n Math.trunc(parseFloat(value) * 100) / 100\r\n ); // intentionally tuncating\r\n }\r\n if (format === dataFormatEnum[dataFormatEnum.date]) {\r\n if (!value) {\r\n return value;\r\n }\r\n return moment\r\n .utc(value)\r\n .local(true)\r\n .format(constants.momentDisplayFormat);\r\n }\r\n return value;\r\n }\r\n },\r\n react: {\r\n wait: true,\r\n useSuspense: true\r\n },\r\n detection: {\r\n caches:\r\n process.env.NODE_ENV === 'development' ? [] : ['localStorage']\r\n },\r\n backend: {\r\n backends: [LocalStorageBackend, I18NextLocizeBackend],\r\n backendOptions: [\r\n {\r\n expirationTime: 24 * 60 * 60 * 1000,\r\n defaultVersion: `${process.env.REACT_APP_LOCIZE_VERSION}`\r\n } as I18NextLocalStorageBackend.BackendOptions,\r\n {\r\n projectId: `${process.env.REACT_APP_LOCIZE_PROJECT_ID}`,\r\n apiKey: `${process.env.REACT_APP_LOCIZE_API_KEY}`,\r\n version: `${process.env.REACT_APP_LOCIZE_VERSION}`,\r\n referenceLng: 'en-US'\r\n } as I18NextLocizeBackend.BackendOptions\r\n ]\r\n }\r\n });\r\n\r\n// while developing load translations locally from json files\r\nif (process.env.NODE_ENV === 'development') {\r\n forEach(ns, key => {\r\n i18next.addResourceBundle(\r\n 'en-US',\r\n key,\r\n require(`./translations/en-US/${key}.json`)\r\n );\r\n });\r\n}\r\nexport default instance;\r\n","const 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.0/8 are 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 isLocalhost;\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\nimport isLocalhost from './helpers/isLocalHost';\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 subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.info(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\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.info('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\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, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' }\r\n })\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 != null &&\r\n 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, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.info(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\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 baseUrl = process.env.PUBLIC_URL;\r\n if (baseUrl) {\r\n const publicUrl = new URL(baseUrl, window.location.href);\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/facebook/create-react-app/issues/2374\r\n return;\r\n }\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. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.info(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","export const BEGIN_AJAX_CALL = 'BEGIN_AJAX_CALL';\r\nexport const END_AJAX_CALL = 'END_AJAX_CALL';\r\nexport const _SUCCESS = '_SUCCESS';\r\nexport const _FAILED = '_FAILED';\r\n\r\nexport const USER_LOGIN_SUCCESS = 'USER_LOGIN_SUCCESS';\r\nexport const UPDATE_CURRENT_USER = 'UPDATE_CURRENT_USER';\r\nexport const USER_LOGOUT_SUCCESS = 'USER_LOGOUT_SUCCESS';\r\nexport const USER_LOGIN_FAILED = 'USER_LOGIN_FAILED';\r\nexport const USER_LOGOUT_FAILED = 'USER_LOGOUT_FAILED';\r\nexport const USER_LOGOUT_SESSION_ONLY_SUCCESS =\r\n 'USER_LOGOUT_SESSION_ONLY_SUCCESS';\r\n\r\nexport const USER_SIGNUP_SUCCESS = 'USER_SIGNUP_SUCCESS';\r\nexport const USER_SIGNUP_FAILED = 'USER_SIGNUP_FAILED';\r\n\r\nexport const USER_QUEUE_SUCCESS = 'USER_QUEUE_SUCCESS';\r\nexport const USER_QUEUE_FAILED = 'USER_QUEUE_FAILED';\r\n\r\nexport const UPDATE_SELECTED_USER = 'UPDATE_SELECTED_USER';\r\nexport const USER_SAVE_SUCCESS = 'USER_SAVE_SUCCESS';\r\nexport const USER_SAVE_FAILED = 'USER_SAVE_FAILED';\r\n\r\nexport const AAD_LOGIN_ = 'AAD_LOGIN';\r\nexport const AAD_LOGOUT_SUCCESS = 'AAD_LOGOUT_SUCCESS';\r\nexport const AAD_LOGIN = 'AAD_LOGIN';\r\nexport const AAD_LOGOUT_FAILED = 'AAD_LOGOUT_FAILED';\r\n\r\nexport const SET_REDIRECT_REFERRER = 'SET_REDIRECT_REFERRER';\r\nexport const REMOVE_REDIRECT_REFERRER = 'REMOVE_REDIRECT_REFERRER';\r\n\r\nexport const SET_REDIRECT_PATHNAME = 'SET_REDIRECT_PATHNAME';\r\nexport const REMOVE_REDIRECT_PATHNAME = 'REMOVE_REDIRECT_PATHNAME';\r\n\r\nexport const USER_APPROVE_SUCCESS = 'USER_APPROVE_SUCCESS';\r\nexport const USER_APPROVE_FAILED = 'USER_APPROVE_FAILED';\r\n\r\nexport const USER_REJECT_SUCCESS = 'USER_APPROVE_SUCCESS';\r\nexport const USER_REJECT_FAILED = 'USER_APPROVE_FAILED';\r\n\r\nexport const USER_QUEUE_SAVE_SUCCESS = 'USER_QUEUE_SAVE_SUCCESS';\r\nexport const USER_QUEUE_SAVE_FAILED = 'USER_QUEUE_SAVE_FAILED';\r\n\r\nexport const USER_QUEUE_UPDATE_SELECTED = 'USER_QUEUE_UPDATE_SELECTED';\r\n\r\nexport const SET_SELECTED_MANAGE_USER = 'SET_SELECTED_MANAGE_USER';\r\n\r\nexport const USER_UPDATE = 'USER_UPDATE';\r\n\r\nexport const USER_UPDATE_POSTAL_CODES_SUCCESS =\r\n 'USER_UPDATE_POSTAL_CODES_SUCCESS';\r\nexport const USER_UPDATE_POSTAL_CODES_FAILED =\r\n 'USER_UPDATE_POSTAL_CODES_FAILED';\r\n\r\nexport const USER_UPDATE_PROFILE_SUCCESS = 'USER_UPDATE_PROFILE_SUCCESS';\r\nexport const USER_UPDATE_PROFILE_FAILED = 'USER_UPDATE_PROFILE_FAILED';\r\n\r\nexport const USER_QUEUE_INCREMENT = 'USER_QUEUE_INCREMENT';\r\nexport const USER_QUEUE_DECREMENT = 'USER_QUEUE_DECREMENT';\r\nexport const SET_TABLE_FILTER_MANAGE_USER_QUEUE =\r\n 'SET_TABLE_FILTER_MANAGE_USER_QUEUE';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_USER = 'SET_FORM_VALUES_MANAGE_USER';\r\nexport const SET_FORM_VALUES_MANAGE_USER_QUEUE =\r\n 'SET_FORM_VALUES_MANAGE_USER_QUEUE';\r\nexport const UPDATE_FORM_VALUES_MANAGE_USER_QUEUE =\r\n 'UPDATE_FORM_VALUES_MANAGE_USER_QUEUE';\r\nexport const UPDATE_FORM_VALUES_MANAGE_USER = 'UPDATE_FORM_VALUES_MANAGE_USER';\r\n\r\nexport const USER_QUEUE_TOTAL_PAGES = 'USER_QUEUE_TOTAL_PAGES';\r\nexport const SET_SELECTED_MANAGE_USER_QUEUE = 'SET_SELECTED_MANAGE_USER_QUEUE';\r\n\r\nexport const GET_SECURITY_SUCCESS = 'GET_SECURITY_SUCCESS';\r\nexport const GET_SECURITY_FAILED = 'GET_SECURITY_FAILED';\r\n\r\nexport const GET_FACILITIES_SUCCESS = 'GET_FACILITIES_SUCCESS';\r\nexport const MERGE_FACILITIES_SUCCESS = 'MERGE_FACILITIES_SUCCESS';\r\nexport const GET_FACILITIES_FAILED = 'GET_FACILITIES_FAILED';\r\n\r\nexport const FACILITY_UPDATE_SUCCESS = 'FACILITY_UPDATE_SUCCESS';\r\nexport const FACILITY_UPDATE_FAILED = 'FACILITY_UPDATE_FAILED';\r\n\r\nexport const ADD_JOB_FACILITY_SUCCESS = 'ADD_JOB_FACILITY_SUCCESS';\r\nexport const ADD_JOB_FACILITY_FAILED = 'ADD_JOB_FACILITY_FAILED';\r\n\r\nexport const FACILITY_DELETE_SUCCESS = 'FACILITY_DELETE_SUCCESS';\r\nexport const FACILITY_DELETE_FAILED = 'FACILITY_DELETE_FAILED';\r\n\r\nexport const TOGGLE_MODAL_FACILITY_CONTRACT = 'TOGGLE_MODAL_FACILITY_CONTRACT';\r\nexport const UPDATE_FACILITY_CONTRACT = 'UPDATE_FACILITY_CONTRACT';\r\nexport const UPDATE_FORM_VALUES_MANAGE_FACILITY_CONTRACT =\r\n 'UPDATE_FORM_VALUES_MANAGE_FACILITY_CONTRACT';\r\nexport const SET_FORM_VALUES_MANAGE_FACILITY_CONTRACT =\r\n 'SET_FORM_VALUES_MANAGE_FACILITY_CONTRACT';\r\n\r\n// CONTACT CONSTANTS\r\nexport const TOGGLE_MODAL_FACILITY_CONTACT = 'TOGGLE_MODAL_FACILITY_CONTACT';\r\nexport const ADD_CONTACT_SUCCESS = 'ADD_CONTACT_SUCCESS';\r\nexport const ADD_CONTACT_FAILED = 'ADD_CONTACT_FAILED';\r\nexport const GET_CONTACTS_BY_FACILITY_SUCCESS =\r\n 'GET_CONTACTS_BY_FACILITY_SUCCESS';\r\nexport const GET_CONTACTS_BY_FACILITY_FAILED =\r\n 'GET_CONTACTS_BY_FACILITY_FAILED';\r\nexport const FIND_USERS_OR_CONTACT_BY_EMAIL_FAILED =\r\n 'FIND_USERS_OR_CONTACT_BY_EMAIL_FAILED';\r\nexport const FIND_USERS_OR_CONTACT_BY_EMAIL_SUCCESS =\r\n 'FIND_USERS_OR_CONTACT_BY_EMAIL_SUCCESS';\r\nexport const GET_USERS_MATCHED_EMAIL_FAILED = 'GET_USERS_MATCHED_EMAIL_FAILED';\r\nexport const DELETE_CONTACT_FACILITY_SUCCESS =\r\n 'DELETE_CONTACT_FACILITY_SUCCESS';\r\nexport const DELETE_CONTACT_FACILITY_FAILED = 'DELETE_CONTACT_FACILITY_FAILED';\r\nexport const UPDATE_CONTACT_SUCCESS = 'UPDATE_CONTACT_SUCCESS';\r\nexport const UPDATE_CONTACT_FAILED = 'UPDATE_CONTACT_FAILED';\r\nexport const UPDATE_SELECTED_CONTACT = 'UPDATE_SELECTED_CONTACT';\r\nexport const SET_SELECTED_CONTACT_ID = 'SET_SELECTED_CONTACT_ID';\r\nexport const CLEAR_SELECTED_CONTACT_ID = 'CLEAR_SELECTED_CONTACT_ID';\r\nexport const CLEAR_USERS_MATCHED_EMAIL = 'CLEAR_USERS_MATCHED_EMAIL';\r\n\r\nexport const CLOSE_ALL_MODALS = 'CLOSE_ALL_MODALS';\r\nexport const TOGGLE_MODAL_EDIT_FACILITY = 'TOGGLE_MODAL_EDIT_FACILITY';\r\nexport const TOGGLE_MODAL_EDIT_PROFILE = 'TOGGLE_MODAL_EDIT_PROFILE';\r\nexport const TOGGLE_MODAL_SECURITY_FUNCTIONS =\r\n 'TOGGLE_MODAL_SECURITY_FUNCTIONS';\r\nexport const TOGGLE_MODAL_SIDE_MENU = 'TOGGLE_MODAL_SIDE_MENU';\r\n\r\nexport const USER_MANAGE_SUCCESS = 'USER_MANAGE_SUCCESS';\r\nexport const USER_MANAGE_FAILED = 'USER_MANAGE_FAILED';\r\nexport const USER_MANAGE_INCREMENT = 'USER_MANAGE_INCREMENT';\r\nexport const USER_MANAGE_DECREMENT = 'USER_MANAGE_DECREMENT';\r\nexport const USER_MANAGE_TOTAL_PAGES = 'USER_MANAGE_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_USER = 'SET_TABLE_FILTER_MANAGE_USER';\r\nexport const UPDATE_USER_LOCAL_COUNTRY = 'UPDATE_USER_LOCAL_COUNTRY';\r\n\r\n// TEAM\r\nexport const TEAM_MANAGE_SUCCESS = 'TEAM_MANAGE_SUCCESS';\r\nexport const TEAM_MANAGE_FAILED = 'TEAM_MANAGE_FAILED';\r\nexport const TEAM_MANAGE_INCREMENT = 'TEAM_MANAGE_INCREMENT';\r\nexport const TEAM_MANAGE_DECREMENT = 'TEAM_MANAGE_DECREMENT';\r\nexport const TEAM_MANAGE_TOTAL_PAGES = 'TEAM_MANAGE_TOTAL_PAGES';\r\nexport const TEAM_UPDATE_SUCCESS = 'TEAM_UPDATE_SUCCESS';\r\nexport const TEAM_UPDATE_FAILED = 'TEAM_UPDATE_FAILED';\r\nexport const TEAM_DELETE_SUCCESS = 'TEAM_DELETE_SUCCESS';\r\nexport const TEAM_DELETE_FAILED = 'TEAM_DELETE_FAILED';\r\nexport const TEAM_SAVE_SUCCESS = 'TEAM_SAVE_SUCCESS';\r\nexport const TEAM_SAVE_FAILED = 'TEAM_SAVE_FAILED';\r\nexport const TOGGLE_MODAL_EDIT_TEAM = 'TOGGLE_MODAL_EDIT_TEAM';\r\nexport const SET_TABLE_FILTER_MANAGE_TEAM = 'SET_TABLE_FILTER_MANAGE_TEAM';\r\nexport const SET_FORM_VALUES_MANAGE_TEAM_MEMBER =\r\n 'SET_FORM_VALUES_MANAGE_TEAM_MEMBER';\r\nexport const UPDATE_FORM_VALUES_MANAGE_TEAM_MEMBER =\r\n 'UPDATE_FORM_VALUES_MANAGE_TEAM_MEMBER';\r\nexport const SET_SELECTED_MANAGE_TEAM = 'SET_SELECTED_MANAGE_TEAM';\r\n\r\n// inventory\r\nexport const GET_INVENTORY_SUCCESS = 'GET_INVENTORY_SUCCESS';\r\nexport const GET_INVENTORY_FAILED = 'GET_INVENTORY_FAILED';\r\nexport const INVENTORY_INCREMENT = 'INVENTORY_INCREMENT';\r\nexport const INVENTORY_DECREMENT = 'INVENTORY_DECREMENT';\r\nexport const INVENTORY_TOTAL_PAGES = 'INVENTORY_TOTAL_PAGES';\r\nexport const INSTALL_UPDATE_BULK = 'INSTALL_UPDATE_BULK';\r\nexport const PRODUCT_UPDATE_SUCCESS = 'PRODUCT_UPDATE_SUCCESS';\r\nexport const PRODUCT_UPDATE_FAILED = 'PRODUCT_UPDATE_FAILED';\r\nexport const PRODUCT_ADD_SUCCESS = 'PRODUCT_ADD_SUCCESS';\r\nexport const PRODUCT_ADD_FAILED = 'PRODUCT_ADD_FAILED';\r\nexport const PRODUCT_MERGE_SUCCESS = 'PRODUCT_MERGE_SUCCESS';\r\nexport const PRODUCT_MERGE_FAILED = 'PRODUCT_MERGE_FAILED';\r\nexport const TOGGLE_MODAL_EDIT_PRODUCT = 'TOGGLE_MODAL_EDIT_PRODUCT';\r\nexport const HIDE_MODAL_EDIT_PRODUCT = 'HIDE_MODAL_EDIT_PRODUCT';\r\nexport const GET_PRODUCT_INFO_SUCCESS = 'GET_PRODUCT_INFO_SUCCESS';\r\nexport const UPDATE_PRODUCT_INFO_SUCCESS = 'UPDATE_PRODUCT_INFO_SUCCESS';\r\nexport const GET_PRODUCT_INFO_FAILED = 'GET_PRODUCT_INFO_FAILED';\r\nexport const UPDATE_PRODUCT_INFO_BRANDS_SUCCESS =\r\n 'UPDATE_PRODUCT_INFO_BRANDS_SUCCESS';\r\nexport const INSTALL_UPDATE_SUCCESS = 'INSTALL_UPDATE_SUCCESS';\r\nexport const INSTALL_UPDATE_FAILED = 'INSTALL_UPDATE_FAILED';\r\nexport const INSTALL_ADD_SUCCESS = 'INSTALL_ADD_SUCCESS';\r\nexport const INSTALL_ADD_FAILED = 'INSTALL_ADD_FAILED';\r\nexport const INSTALL_DELETE_SUCCESS = 'INSTALL_DELETE_SUCCESS';\r\nexport const INSTALL_DELETE_FAILED = 'INSTALL_DELETE_FAILED';\r\nexport const TOGGLE_MODAL_EDIT_INSTALL = 'TOGGLE_MODAL_EDIT_INSTALL';\r\nexport const TOGGLE_MODAL_INSTALL_CONTACT = 'TOGGLE_MODAL_INSTALL_CONTACT';\r\nexport const TOGGLE_MODAL_IMPORT_INSTALL = 'TOGGLE_MODAL_IMPORT_INSTALL';\r\nexport const IMPORT_INSTALL_SUCCESS = 'IMPORT_INSTALL_SUCCESS';\r\nexport const IMPORT_INSTALL_FAILED = 'IMPORT_INSTALL_FAILED';\r\nexport const SET_TABLE_FILTER_MANAGE_INVENTORY =\r\n 'SET_TABLE_FILTER_MANAGE_INVENTORY';\r\nexport const SET_PRODUCT_TABLE_FILTER_MANAGE_INVENTORY =\r\n 'SET_PRODUCT_TABLE_FILTER_MANAGE_INVENTORY';\r\nexport const INSTALL_CONTACT_SUCCESS = 'INSTALL_CONTACT_SUCCESS';\r\nexport const INSTALL_CONTACT_FAILED = 'INSTALL_CONTACT_FAILED';\r\nexport const TOGGLE_MODAL_SEARCH_NEW_PRODUCTS =\r\n 'TOGGLE_MODAL_SEARCH_NEW_PRODUCTS';\r\nexport const HIDE_MODAL_SEARCH_NEW_PRODUCTS = 'HIDE_MODAL_SEARCH_NEW_PRODUCTS';\r\nexport const SET_SELECTED_PRODUCT = 'SET_SELECTED_PRODUCT';\r\nexport const GET_PRODUCTS_SUCCESS = 'GET_PRODUCTS_SUCCESS';\r\nexport const GET_PRODUCTS_FAILED = 'GET_PRODUCTS_FAILED';\r\nexport const NEW_PRODUCTS_RESET = 'NEW_PRODUCTS_RESET';\r\nexport const TOGGLE_MODAL_MP_RESULT = 'TOGGLE_MODAL_MP_RESULT';\r\nexport const TOGGLE_MODAL_MP_RESULT_WORK_ORDER =\r\n 'TOGGLE_MODAL_MP_RESULT_WORK_ORDER';\r\nexport const TOGGLE_MODAL_MP_RESULT_HISTORY = 'TOGGLE_MODAL_MP_RESULT_HISTORY';\r\nexport const TOGGLE_MODAL_MP_RESULT_NOTES = 'TOGGLE_MODAL_MP_RESULT_NOTES';\r\nexport const SET_INSTALL_BATCH_MODE = 'SET_INSTALL_BATCH_MODE';\r\nexport const SET_SELECTED_MANAGE_INVENTORY_PRODUCT_ID =\r\n 'SET_SELECTED_MANAGE_INVENTORY_PRODUCT_ID';\r\nexport const CLEAR_SELECTED_MANAGE_INVENTORY_PRODUCT_ID =\r\n 'CLEAR_SELECTED_MANAGE_INVENTORY_PRODUCT_ID';\r\nexport const SET_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID =\r\n 'SET_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID';\r\nexport const CLEAR_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID =\r\n 'CLEAR_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID';\r\nexport const SET_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH =\r\n 'SET_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH';\r\nexport const UPDATE_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH =\r\n 'UPDATE_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH';\r\nexport const UPDATE_FORM_VALUES_MANAGE_INVENTORY_INSTALL =\r\n 'UPDATE_FORM_VALUES_MANAGE_INVENTORY_INSTALL';\r\nexport const SET_FORM_VALUES_MANAGE_INVENTORY_INSTALL =\r\n 'SET_FORM_VALUES_MANAGE_INVENTORY_INSTALL';\r\n\r\n// shopping cart\r\nexport const ADD_TO_CART = 'ADD_TO_CART';\r\nexport const DELETE_FROM_CART = 'DELETE_FROM_CART';\r\nexport const DECREASE_FROM_CART = 'DECREASE_FROM_CART';\r\nexport const UPDATE_QUANTITY_CART = 'UPDATE_QUANTITY_CART';\r\n\r\nexport const CHECKOUT_REQUEST = 'CHECKOUT_REQUEST';\r\nexport const CHECKOUT_TRAINING_SUCCESS = 'CHECKOUT_TRAINING_SUCCESS';\r\nexport const CHECKOUT_TRAINING_FAILED = 'CHECKOUT_TRAINING_FAILED';\r\nexport const CHECKOUT_INVENTORY_SUCCESS = 'CHECKOUT_INVENTORY_SUCCESS';\r\nexport const CHECKOUT_INVENTORY_FAILED = 'CHECKOUT_INVENTORY_FAILED';\r\nexport const RECEIVE_PRODUCTS = 'RECEIVE_PRODUCTS';\r\nexport const TOGGLE_MODAL_SHOPPING_CART_TRAINING =\r\n 'TOGGLE_MODAL_SHOPPING_CART_TRAINING';\r\nexport const TOGGLE_MODAL_SHOPPING_CART_INVENTORY =\r\n 'TOGGLE_MODAL_SHOPPING_CART_INVENTORY';\r\nexport const GET_PURCHASED_TRAINING_SUCCESS = 'GET_PURCHASED_TRAINING_SUCCESS';\r\nexport const GET_PURCHASED_TRAINING_FAILED = 'GET_PURCHASED_TRAINING_FAILED';\r\n\r\n// product queue\r\nexport const PRODUCT_QUEUE_SUCCESS = 'PRODUCT_QUEUE_SUCCESS';\r\nexport const PRODUCT_QUEUE_FAILED = 'PRODUCT_QUEUE_FAILED';\r\n\r\nexport const PRODUCT_APPROVE_SUCCESS = 'PRODUCT_APPROVE_SUCCESS';\r\nexport const PRODUCT_APPROVE_FAILED = 'PRODUCT_APPROVE_FAILED';\r\n\r\nexport const PRODUCT_REJECT_SUCCESS = 'PRODUCT_APPROVE_SUCCESS';\r\nexport const PRODUCT_REJECT_FAILED = 'PRODUCT_APPROVE_FAILED';\r\n\r\nexport const PRODUCT_QUEUE_TOTAL_PAGES = 'PRODUCT_QUEUE_TOTAL_PAGES';\r\nexport const TOGGLE_MODAL_APPROVE_PRODUCT = 'TOGGLE_MODAL_APPROVE_PRODUCT';\r\nexport const SET_TABLE_FILTER_MANAGE_PRODUCT_QUEUE =\r\n 'SET_TABLE_FILTER_MANAGE_PRODUCT_QUEUE';\r\nexport const PRODUCT_QUEUE_PRODUCT_UPDATE_SUCCESS =\r\n 'PRODUCT_QUEUE_PRODUCT_UPDATE_SUCCESS';\r\nexport const PRODUCT_QUEUE_PRODUCT_UPDATE_FAILED =\r\n 'PRODUCT_QUEUE_PRODUCT_UPDATE_FAILED';\r\nexport const MERGEABLE_PRODUCTS_SUCCESS = 'MERGEABLE_PRODUCTS_SUCCESS';\r\nexport const MERGEABLE_PRODUCTS_FAILED = 'MERGEABLE_PRODUCTS_FAILED';\r\n\r\n// manage products\r\nexport const GET_MANAGE_PRODUCT_SUCCESS = 'GET_MANAGE_PRODUCT_SUCCESS';\r\nexport const GET_MANAGE_PRODUCT_FAILED = 'GET_MANAGE_PRODUCT_FAILED';\r\nexport const SET_TABLE_FILTER_MANAGE_PRODUCT =\r\n 'SET_TABLE_FILTER_MANAGE_PRODUCT';\r\nexport const PRODUCT_MANAGE_TOTAL_PAGES = 'PRODUCT_MANAGE_TOTAL_PAGES';\r\n\r\n// manage jobs\r\nexport const JOB_MANAGE_SUCCESS = 'JOB_MANAGE_SUCCESS';\r\nexport const JOB_MANAGE_FAILED = 'JOB_MANAGE_FAILED';\r\nexport const JOB_UPDATE_SUCCESS = 'JOB_UPDATE_SUCCESS';\r\nexport const JOB_UPDATE_FAILED = 'JOB_UPDATE_FAILED';\r\nexport const JOB_SAVE_SUCCESS = 'JOB_SAVE_SUCCESS';\r\nexport const JOB_SAVE_FAILED = 'JOB_SAVE_FAILED';\r\nexport const JOB_GET_SUCCESS = 'JOB_GET_SUCCESS';\r\nexport const JOB_GET_FAILED = 'JOB_GET_FAILED';\r\nexport const JOB_DELETE_SUCCESS = 'JOB_DELETE_SUCCESS';\r\nexport const JOB_DELETE_FAILED = 'JOB_DELETE_FAILED';\r\nexport const GET_FSE_SUCCESS = 'GET_FSE_SUCCESS';\r\nexport const GET_FSE_FAILED = 'GET_FSE_FAILED';\r\nexport const JOB_MANAGE_TOTAL_PAGES = 'JOB_MANAGE_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_JOB = 'SET_TABLE_FILTER_MANAGE_JOB';\r\nexport const SET_FORM_VALUES_MANAGE_JOB = 'SET_FORM_VALUES_MANAGE_JOB';\r\nexport const UPDATE_FORM_VALUES_MANAGE_JOB = 'UPDATE_FORM_VALUES_MANAGE_JOB';\r\nexport const JOBS_BY_FACILITY_SUCCESS = 'JOBS_BY_FACILITY_SUCCESS';\r\nexport const JOBS_BY_FACILITY_FAILED = 'JOBS_BY_FACILITY_FAILED';\r\nexport const JOBS_REPAIR_MAINTENANCE_SUCCESS =\r\n 'JOBS_REPAIR_MAINTENANCE_SUCCESS';\r\nexport const JOBS_REPAIR_MAINTENANCE_FAILED = 'JOBS_REPAIR_MAINTENANCE_FAILED';\r\nexport const JOB_UPDATE_WORKORDERS_SUCCESS = 'JOB_UPDATE_WORKORDERS_SUCCESS';\r\nexport const JOB_UPDATE_WORKORDERS_FAILED = 'JOB_UPDATE_WORKORDERS_FAILED';\r\nexport const UPDATE_SELECTED_JOB = 'UPDATE_SELECTED_JOB';\r\nexport const SET_SELECTED_JOB = 'SET_SELECTED_JOB';\r\n\r\n// manage leads\r\nexport const LEADS_MANAGE_SUCCESS = 'LEADS_MANAGE_SUCCESS';\r\nexport const LEADS_MANAGE_FAILED = 'LEADS_MANAGE_FAILED';\r\nexport const LEAD_ACTIVITIES_MANAGE_SUCCESS = 'LEAD_ACTIVITIES_MANAGE_SUCCESS';\r\nexport const LEAD_ACTIVITIES_MANAGE_FAILED = 'LEAD_ACTIVITIES_MANAGE_FAILED';\r\nexport const SET_TABLE_FILTER_MANAGE_LEADS = 'SET_TABLE_FILTER_MANAGE_LEADS';\r\nexport const LEADS_MANAGE_TOTAL_PAGES = 'LEADS_MANAGE_TOTAL_PAGES';\r\nexport const LEAD_INSTALL_DELETE_SUCCESS = 'LEAD_INSTALL_DELETE_SUCCESS';\r\nexport const LEAD_INSTALL_UPDATE_SUCCESS = 'LEAD_INSTALL_UPDATE_SUCCESS';\r\nexport const LEAD_INSTALL_DELETE_FAILED = 'LEAD_INSTALL_DELETE_FAILED';\r\nexport const SET_SELECTED_LEAD = 'SET_SELECTED_LEAD';\r\nexport const UPDATE_SELECTED_LEAD = 'UPDATE_SELECTED_LEAD';\r\nexport const LEAD_UPDATE_SUCCESS = 'LEAD_UPDATE_SUCCESS';\r\nexport const LEAD_UPDATE_FAILED = 'LEAD_UPDATE_FAILED';\r\nexport const LEADS_BULK_UPDATE_STATUS_SUCCESS =\r\n 'LEADS_BULK_UPDATE_STATUS_SUCCESS';\r\nexport const LEADS_BULK_UPDATE_STATUS_FAILED =\r\n 'LEADS_BULK_UPDATE_STATUS_FAILED';\r\nexport const SELECTED_LEAD_ACTIVITIES = 'SELECTED_LEAD_ACTIVITIES';\r\nexport const TOGGLE_MODAL_LEAD_ACTIVITIES = 'TOGGLE_MODAL_LEAD_ACTIVITIES';\r\nexport const TOGGLE_MODAL_EDIT_LEAD_ACTIVITY =\r\n 'TOGGLE_MODAL_EDIT_LEAD_ACTIVITY';\r\nexport const UPDATE_SELECTED_LEAD_ACTIVITY = 'UPDATE_SELECTED_LEAD_ACTIVITY';\r\nexport const SET_SELECTED_LEAD_ACTIVITY = 'SET_SELECTED_LEAD_ACTIVITY';\r\nexport const LEAD_ACTIVITY_DELETE_SUCCESS = 'LEAD_ACTIVITY_DELETE_SUCCESS';\r\nexport const LEAD_ACTIVITY_DELETE_FAILED = 'LEAD_ACTIVITY_DELETE_FAILED';\r\nexport const LEAD_ACTIVITY_ADD_SUCCESS = 'LEAD_ACTIVITY_ADD_SUCCESS';\r\nexport const LEAD_ACTIVITY_ADD_FAILED = 'LEAD_ACTIVITY_ADD_FAILED';\r\nexport const LEAD_ACTIVITY_UPDATE_SUCCESS = 'LEAD_ACTIVITY_UPDATE_SUCCESS';\r\nexport const LEAD_ACTIVITY_UPDATE_FAILED = 'LEAD_ACTIVITY_UPDATE_FAILED';\r\nexport const LEAD_UPDATE_SELECTION = 'LEAD_UPDATE_SELECTION';\r\n\r\n// Manage Quotes\r\n\r\nexport const QUOTE_MANAGE_SUCCESS = 'QUOTE_MANAGE_SUCCESS';\r\nexport const QUOTE_MANAGE_FAILED = 'QUOTE_MANAGE_FAILED';\r\nexport const UPDATE_SELECTED_QUOTE = 'UPDATE_SELECTED_QUOTE';\r\nexport const SET_SELECTED_QUOTE = 'SET_SELECTED_QUOTE';\r\nexport const TOGGLE_MODAL_QUOTES = 'TOGGLE_MODAL_QUOTES';\r\nexport const TOGGLE_MODAL_SALES_QUOTES = 'TOGGLE_MODAL_SALES_QUOTES';\r\nexport const TOGGLE_MODAL_QUOTES_DETAILS = 'TOGGLE_MODAL_QUOTES_DETAILS';\r\nexport const QUOTE_DELETE_SUCCESS = 'QUOTE_DELETE_SUCCESS';\r\nexport const QUOTE_ADD_SUCCESS = 'QUOTE_ADD_SUCCESS';\r\nexport const QUOTE_MANAGE_TOTAL_PAGES = 'QUOTE_MANAGE_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_QUOTES = 'SET_TABLE_FILTER_MANAGE_QUOTES';\r\nexport const QUOTE_UPDATE_STATUS_SUCCESS = 'QUOTE_UPDATE_STATUS_SUCCESS';\r\nexport const QUOTE_UPDATE_STATUS_FAILED = 'QUOTE_UPDATE_STATUS_FAILED';\r\nexport const TOGGLE_MODAL_ACCEPT_QUOTE = 'TOGGLE_MODAL_ACCEPT_QUOTE';\r\nexport const QUOTE_DOWNLOAD_SUCCESS = 'QUOTE_DOWNLOAD_SUCCESS';\r\nexport const QUOTE_DOWNLOAD_FAILED = 'QUOTE_DOWNLOAD_FAILED';\r\n\r\n// manage locations\r\nexport const LOCATION_MANAGE_SUCCESS = 'LOCATION_MANAGE_SUCCESS';\r\nexport const LOCATION_MANAGE_FAILED = 'LOCATION_MANAGE_FAILED';\r\nexport const LOCATION_UPDATE_SUCCESS = 'LOCATION_UPDATE_SUCCESS';\r\nexport const LOCATION_UPDATE_FAILED = 'LOCATION_UPDATE_FAILED';\r\nexport const LOCATION_ADD_SUCCESS = 'LOCATION_ADD_SUCCESS';\r\nexport const LOCATION_ADD_FAILED = 'LOCATION_ADD_FAILED';\r\nexport const LOCATION_DELETE_SUCCESS = 'LOCATION_DELETE_SUCCESS';\r\nexport const LOCATION_DELETE_FAILED = 'LOCATION_DELETE_FAILED';\r\nexport const LOCATION_MANAGE_TOTAL_PAGES = 'LOCATION_MANAGE_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_LOCATION =\r\n 'SET_TABLE_FILTER_MANAGE_LOCATION';\r\nexport const TOGGLE_MODAL_EDIT_LOCATION = 'TOGGLE_MODAL_EDIT_LOCATION';\r\nexport const SET_VISIBLE_LOCATIONS = 'SET_VISIBLE_LOCATIONS';\r\n\r\n/*\r\n * Training Actions\r\n */\r\nexport const LOAD_COURSES_SUCCESS = 'LOAD_COURSES_SUCCESS';\r\nexport const LOAD_COURSES_FAILED = 'LOAD_COURSES_FAILED';\r\nexport const LOAD_LESSONS_SUCCESS = 'LOAD_LESSONS_SUCCESS';\r\nexport const LOAD_LESSONS_FAILED = 'LOAD_LESSONS_FAILED';\r\nexport const LOAD_LESSON = 'LOAD_LESSON';\r\nexport const LOAD_QUIZZES_SUCCESS = 'LOAD_QUIZZES_SUCCESS';\r\nexport const LOAD_QUIZZES_FAILED = 'LOAD_QUIZZES_FAILED';\r\nexport const LOAD_QUIZ = 'LOAD_QUIZ';\r\nexport const LOAD_QUIZZES_BY_LESSON_SUCCESS = 'LOAD_QUIZZES_BY_LESSON_SUCCESS';\r\nexport const LOAD_QUIZZES_BY_LESSON_FAILED = 'LOAD_QUIZZES_BY_LESSON_FAILED';\r\n\r\nexport const GET_ALL_LESSON_PROGRESS_SUCCESS =\r\n 'GET_ALL_LESSON_PROGRESS_SUCCESS';\r\nexport const GET_ALL_LESSON_PROGRESS_FAILED = 'GET_ALL_LESSON_PROGRESS_FAILED';\r\nexport const GET_LESSON_PROGRESS_SUCCESS = 'GET_LESSON_PROGRESS_SUCCESS';\r\nexport const GET_LESSON_PROGRESS_FAILED = 'GET_LESSON_PROGRESS_FAILED';\r\nexport const SAVE_LESSON_PROGRESS_SUCCESS = 'SAVE_LESSON_PROGRESS_SUCCESS';\r\nexport const SAVE_LESSON_PROGRESS_FAILED = 'SAVE_LESSON_PROGRESS_FAILED';\r\nexport const SAVE_QUIZ_SUCCESS = 'SAVE_QUIZ_SUCCESS';\r\nexport const SAVE_QUIZ_FAILED = 'SAVE_QUIZ_FAILED';\r\nexport const START_QUIZ_SUCCESS = 'START_QUIZ_SUCCESS';\r\nexport const START_QUIZ_FAILED = 'START_QUIZ_FAILED';\r\nexport const GET_QUIZ_RESULTS_SUCCESS = 'GET_QUIZ_RESULTS_SUCCESS';\r\nexport const GET_QUIZ_RESULTS_FAILED = 'GET_QUIZ_RESULTS_FAILED';\r\nexport const GET_QUIZ_LINK_SUCCESS = 'GET_QUIZ_LINK_SUCCESS';\r\nexport const GET_QUIZ_LINK_FAILED = 'GET_QUIZ_LINK_FAILED';\r\nexport const ADD_ANSWER = 'ADD_ANSWER';\r\nexport const RESET_ANSWERS = 'RESET_ANSWERS';\r\nexport const SAVE_QUIZ_ANSWERS_SUCCESS = 'SAVE_QUIZ_ANSWERS_SUCCESS';\r\nexport const SAVE_QUIZ_ANSWERS_FAILED = 'SAVE_QUIZ_ANSWERS_FAILED';\r\nexport const SET_SELECTED_IN_PROGRESS_QUIZ = 'SET_SELECTED_IN_PROGRESS_QUIZ';\r\n\r\n/*\r\n * MANAGE TRAINING ACTIONS\r\n */\r\nexport const MANAGE_TRAINING_SUCCESS = 'MANAGE_TRAINING_SUCCESS';\r\nexport const MANAGE_TRAINING_FAILED = 'MANAGE_TRAINING_FAILED';\r\nexport const MANAGE_TRAINING_TOTAL_PAGES = 'MANAGE_TRAINING_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_TRAINING =\r\n 'SET_TABLE_FILTER_MANAGE_TRAINING';\r\n\r\n/*\r\n * MANAGE MEASUREMENTS ACTIONS\r\n */\r\nexport const MANAGE_MEASUREMENT_POINT_LISTS_SUCCESS =\r\n 'MANAGE_MEASUREMENT_POINT_LISTS_SUCCESS';\r\nexport const MANAGE_MEASUREMENT_POINT_LISTS_FAILED =\r\n 'MANAGE_MEASUREMENT_POINT_LISTS_FAILED';\r\nexport const MANAGE_MEASUREMENT_POINT_LISTS_TOTAL_PAGES =\r\n 'MANAGE_MEASUREMENT_POINT_LISTS_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_MEASUREMENT_POINT_LISTS =\r\n 'SET_TABLE_FILTER_MANAGE_MEASUREMENT_POINT_LISTS';\r\nexport const MEASUREMENT_POINT_LIST_SUCCESS = 'MEASUREMENT_POINT_LIST_SUCCESS';\r\nexport const MEASUREMENT_POINT_LIST_FAILED = 'MEASUREMENT_POINT_LIST_FAILED';\r\nexport const DELETE_MEASUREMENT_POINT = 'DELETE_MEASUREMENT_POINT';\r\nexport const REMOVE_MEASUREMENT_POINT_FROM_TAB =\r\n 'REMOVE_MEASUREMENT_POINT_FROM_TAB';\r\n\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_ADD =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_ADD';\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_ADD_FAILED =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_ADD_FAILED';\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_UPDATE =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_UPDATE';\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_UPDATE_FAILED =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_UPDATE_FAILED';\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_DELETE_SUCCESS =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_DELETE_SUCCESS';\r\nexport const MANAGE_MEASUREMENT_POINT_LIST_DELETE_FAILED =\r\n 'MANAGE_MEASUREMENT_POINT_LIST_DELETE_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LISTS =\r\n 'TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LISTS';\r\nexport const TOGGLE_MODAL_EDIT_MEASUREMENT_POINT =\r\n 'TOGGLE_MODAL_EDIT_MEASUREMENT_POINT';\r\n\r\nexport const MANAGE_MEASUREMENT_POINT_SAVE_TO_LIST =\r\n 'MANAGE_MEASUREMENT_POINT_SAVE_TO_LIST';\r\nexport const SELECT_MEASUREMENT_POINT_LIST = 'SELECT_MEASUREMENT_POINT_LIST';\r\nexport const MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB =\r\n 'MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB';\r\nexport const MANAGE_MEASUREMENT_POINT_UPDATE =\r\n 'MANAGE_MEASUREMENT_POINT_UPDATE';\r\nexport const TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_TAB =\r\n 'TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_TAB';\r\nexport const TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LIST_TEST_PROCEDURES =\r\n 'TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LIST_TEST_PROCEDURES';\r\nexport const MANAGE_MEASUREMENT_POINT_TAB_UPDATE =\r\n 'MANAGE_MEASUREMENT_POINT_TAB_UPDATE';\r\nexport const MANAGE_MEASUREMENT_POINT_LISTS_DELETE_SUCCESS =\r\n 'MANAGE_MEASUREMENT_POINT_LISTS_DELETE_SUCCESS';\r\nexport const MANAGE_MEASUREMENT_POINT_LISTS_DELETE_FAILED =\r\n 'MANAGE_MEASUREMENT_POINT_LISTS_DELETE_FAILED';\r\n\r\n// MEASUREMENT POINT RESULTS\r\nexport const ADD_MEASUREMENT_POINT_RESULT = 'ADD_MEASUREMENT_POINT_RESULT';\r\nexport const UPDATE_MEASUREMENT_POINT_RESULT =\r\n 'UPDATE_MEASUREMENT_POINT_RESULT';\r\nexport const GET_MEASUREMENT_POINT_FACILITY_RESULTS_SUCCESS =\r\n 'GET_MEASUREMENT_POINT_FACILITY_RESULTS_SUCCESS';\r\nexport const GET_MEASUREMENT_POINT_FACILITY_RESULTS_FAILED =\r\n 'GET_MEASUREMENT_POINT_FACILITY_RESULTS_FAILED';\r\nexport const RESET_MEASUREMENT_POINT_RESULT = 'RESET_MEASUREMENT_POINT_RESULT';\r\nexport const REMOVE_NOT_TESTED = 'REMOVE_NOT_TESTED';\r\nexport const SET_NOT_TESTED = 'SET_NOT_TESTED';\r\nexport const TOGGLE_MODAL_TEST_PROCEDURES = 'TOGGLE_MODAL_TEST_PROCEDURES';\r\nexport const SET_HISTORICAL_RESULT_ID = 'SET_HISTORICAL_RESULT_ID';\r\nexport const CLEAR_HISTORICAL_RESULT_ID = 'CLEAR_HISTORICAL_RESULT_ID';\r\nexport const SET_PREVIOUS_RESULT = 'SET_PREVIOUS_RESULT';\r\nexport const RESET_PREVIOUS_RESULT = 'RESET_PREVIOUS_RESULT';\r\nexport const GET_MEASUREMENT_POINT_RESULT_SUCCESS =\r\n 'GET_MEASUREMENT_POINT_RESULT_SUCCESS';\r\nexport const GET_MEASUREMENT_POINT_RESULT_FAILED =\r\n 'GET_MEASUREMENT_POINT_RESULT_FAILED';\r\nexport const GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_SUCCESS =\r\n 'GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_SUCCESS';\r\nexport const GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_FAILED =\r\n 'GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_FAILED';\r\n\r\n/*\r\n * MANAGE REPORT\r\n */\r\n/*\r\n * MANAGE REPORT\r\n */\r\nexport const REPORT_MANAGE_GET_DEFAULT_SUCCESS =\r\n 'REPORT_MANAGE_GET_DEFAULT_SUCCESS';\r\nexport const REPORT_MANAGE_GET_DEFAULT_FAILED =\r\n 'REPORT_MANAGE_GET_DEFAULT_FAILED';\r\nexport const REPORT_UPDATE = 'REPORT_UPDATE';\r\nexport const REPORT_ADD_SUCCESS = 'REPORT_ADD_SUCCESS';\r\nexport const REPORT_ADD_FAILED = 'REPORT_ADD_FAILED';\r\nexport const REPORT_MANAGE_TOTAL_PAGES = 'REPORT_MANAGE_TOTAL_PAGES';\r\nexport const SET_TABLE_FILTER_MANAGE_REPORT = 'SET_TABLE_FILTER_MANAGE_REPORT';\r\nexport const TOGGLE_MODAL_EDIT_REPORT = 'TOGGLE_MODAL_EDIT_REPORT';\r\nexport const SET_SELECTED_REPORT = 'SET_SELECTED_REPORT';\r\nexport const SET_SELECTED_DEFAULT_REPORT_ID = 'SET_SELECTED_DEFAULT_REPORT_ID';\r\nexport const CLEAR_SELECTED_DEFAULT_REPORT_ID =\r\n 'CLEAR_SELECTED_DEFAULT_REPORT_ID';\r\n\r\n/*\r\n * REPORT TEMPLATES\r\n */\r\nexport const REPORT_TEMPLATES_GET_SUCCESS = 'REPORT_TEMPLATES_GET_SUCCESS';\r\nexport const REPORT_TEMPLATES_GET_FAILED = 'REPORT_TEMPLATES_GET_FAILED';\r\nexport const REPORT_TEMPLATES_CREATE_SUCCESS =\r\n 'REPORT_TEMPLATES_CREATE_SUCCESS';\r\nexport const REPORT_TEMPLATES_CREATE_FAILED = 'REPORT_TEMPLATES_CREATE_FAILED';\r\nexport const REPORT_TEMPLATES_UPDATE_SUCCESS =\r\n 'REPORT_TEMPLATES_UPDATE_SUCCESS';\r\nexport const REPORT_TEMPLATES_UPDATE_FAILED = 'REPORT_TEMPLATES_UPDATE_FAILED';\r\nexport const REPORT_TEMPLATES_DELETE_SUCCESS =\r\n 'REPORT_TEMPLATES_DELETE_SUCCESS';\r\nexport const REPORT_TEMPLATES_DELETE_FAILED = 'REPORT_TEMPLATES_DELETE_FAILED';\r\n\r\n/*\r\n * REPORT CHAPTERS\r\n */\r\nexport const REPORT_CHAPTERS_GET_SUCCESS = 'REPORT_CHAPTERS_GET_SUCCESS';\r\nexport const REPORT_CHAPTERS_GET_FAILED = 'REPORT_CHAPTERS_GET_FAILED';\r\nexport const REPORT_CHAPTERS_UPDATE_SUCCESS = 'REPORT_CHAPTERS_UPDATE_SUCCESS';\r\nexport const REPORT_CHAPTERS_UPDATE_FAILED = 'REPORT_CHAPTERS_UPDATE_FAILED';\r\nexport const REPORT_CHAPTERS_DELETE_SUCCESS = 'REPORT_CHAPTERS_DELETE_SUCCESS';\r\nexport const REPORT_CHAPTERS_DELETE_FAILED = 'REPORT_CHAPTERS_DELETE_FAILED';\r\n\r\n/*\r\n * REPORT TEMPLATE CHAPTERS\r\n */\r\nexport const REPORT_TEMPLATE_CHAPTERS_GET_SUCCESS =\r\n 'REPORT_TEMPLATE_CHAPTERS_GET_SUCCESS';\r\nexport const REPORT_TEMPLATE_CHAPTERS_GET_FAILED =\r\n 'REPORT_TEMPLATE_CHAPTERS_GET_FAILED';\r\nexport const REPORT_TEMPLATE_CHAPTERS_CREATE_SUCCESS =\r\n 'REPORT_TEMPLATE_CHAPTERS_CREATE_SUCCESS';\r\nexport const REPORT_TEMPLATE_CHAPTERS_CREATE_FAILED =\r\n 'REPORT_TEMPLATE_CHAPTERS_CREATE_FAILED';\r\nexport const REPORT_TEMPLATE_CHAPTERS_UPDATE_SUCCESS =\r\n 'REPORT_TEMPLATE_CHAPTERS_UPDATE_SUCCESS';\r\nexport const REPORT_TEMPLATE_CHAPTERS_UPDATE_FAILED =\r\n 'REPORT_TEMPLATE_CHAPTERS_UPDATE_FAILED';\r\nexport const REPORT_TEMPLATE_CHAPTERS_DELETE_SUCCESS =\r\n 'REPORT_TEMPLATE_CHAPTERS_DELETE_SUCCESS';\r\nexport const REPORT_TEMPLATE_CHAPTERS_DELETE_FAILED =\r\n 'REPORT_TEMPLATE_CHAPTERS_DELETE_FAILED';\r\n\r\n// brands\r\nexport const LOAD_BRANDS_SUCCESS = 'LOAD_BRANDS_SUCCESS';\r\nexport const ADD_BRAND_SUCCESS = 'ADD_BRAND_SUCCESS';\r\nexport const EDIT_BRAND_SUCCESS = 'EDIT_BRAND_SUCCESS';\r\nexport const REMOVE_BRAND_SUCCESS = 'REMOVE_BRAND_SUCCESS';\r\nexport const ADD_BRAND_LOGO_SUCCESS = 'ADD_BRAND_LOGO_SUCCESS';\r\n\r\nexport const ADD_BRAND_FAILED = 'ADD_BRAND_FAILED';\r\nexport const EDIT_BRAND_FAILED = 'EDIT_BRAND_FAILED';\r\nexport const REMOVE_BRAND_FAILED = 'REMOVE_BRAND_FAILED';\r\nexport const ADD_BRAND_LOGO_FAILED = 'ADD_BRAND_LOGO_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_BRAND = 'TOGGLE_MODAL_EDIT_BRAND';\r\nexport const SET_TABLE_FILTER_MANAGE_BRAND = 'SET_TABLE_FILTER_MANAGE_BRAND';\r\nexport const BRAND_MANAGE_TOTAL_PAGES = 'BRAND_MANAGE_TOTAL_PAGES';\r\nexport const SET_SELECTED_BRAND_ID = 'SET_SELECTED_BRAND_ID';\r\nexport const CLEAR_SELECTED_BRAND_ID = 'CLEAR_SELECTED_BRAND_ID';\r\nexport const UPDATE_SELECTED_BRAND = 'UPDATE_SELECTED_BRAND';\r\n\r\n// Documents\r\nexport const LOAD_DOCUMENT_TYPES_SUCCESS = 'LOAD_DOCUMENT_TYPES_SUCCESS';\r\nexport const LOAD_DOCUMENTS_SUCCESS = 'LOAD_DOCUMENTS_SUCCESS';\r\nexport const ADD_DOCUMENT_SUCCESS = 'ADD_DOCUMENT_SUCCESS';\r\nexport const ADD_DOCUMENT_VERSION_SUCCESS = 'ADD_DOCUMENT_VERSION_SUCCESS';\r\nexport const EDIT_DOCUMENT_SUCCESS = 'EDIT_DOCUMENT_SUCCESS';\r\nexport const REMOVE_DOCUMENT_SUCCESS = 'REMOVE_DOCUMENT_SUCCESS';\r\nexport const DOWNLOAD_DOCUMENT_SUCCESS = 'DOWNLOAD_DOCUMENT_SUCCESS';\r\nexport const DOWNLOAD_DOCUMENT_FAILED = 'DOWNLOAD_DOCUMENT_FAILED';\r\n\r\nexport const LOAD_DOCUMENT_TYPES_FAILED = 'LOAD_DOCUMENT_TYPES_FAILED';\r\nexport const LOAD_DOCUMENTS_FAILED = 'LOAD_DOCUMENTS_FAILED';\r\nexport const ADD_DOCUMENT_FAILED = 'ADD_DOCUMENT_FAILED';\r\nexport const EDIT_DOCUMENT_FAILED = 'EDIT_DOCUMENT_FAILED';\r\nexport const REMOVE_DOCUMENT_FAILED = 'REMOVE_DOCUMENT_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_DOCUMENT = 'TOGGLE_MODAL_EDIT_DOCUMENT';\r\nexport const SET_TABLE_FILTER_MANAGE_DOCUMENT =\r\n 'SET_TABLE_FILTER_MANAGE_DOCUMENT';\r\nexport const CLEAR_TABLE_FILTERS_MANAGE_DOCUMENT =\r\n 'CLEAR_TABLE_FILTERS_MANAGE_DOCUMENT';\r\nexport const DOCUMENT_MANAGE_TOTAL_PAGES = 'DOCUMENT_MANAGE_TOTAL_PAGES';\r\nexport const SET_SELECTED_PARENT_ID = 'SET_SELECTED_PARENT_ID';\r\nexport const CLEAR_SELECTED_PARENT_ID = 'CLEAR_SELECTED_PARENT_ID';\r\nexport const SET_SELECTED_DOCUMENT_ID = 'SET_SELECTED_DOCUMENT_ID';\r\nexport const CLEAR_SELECTED_DOCUMENT_ID = 'CLEAR_SELECTED_DOCUMENT_ID';\r\nexport const SET_SELECTED_DOCUMENT_TYPE_ID = 'SET_SELECTED_DOCUMENT_TYPE_ID';\r\nexport const CLEAR_SELECTED_DOCUMENT_TYPE_ID =\r\n 'CLEAR_SELECTED_DOCUMENT_TYPE_ID';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_DOCUMENT =\r\n 'SET_FORM_VALUES_MANAGE_DOCUMENT';\r\nexport const UPDATE_FORM_VALUES_MANAGE_DOCUMENT =\r\n 'UPDATE_FORM_VALUES_MANAGE_DOCUMENT';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_DOCUMENT_VERSION =\r\n 'SET_FORM_VALUES_MANAGE_DOCUMENT_VERSION';\r\nexport const UPDATE_FORM_VALUES_MANAGE_DOCUMENT_VERSION =\r\n 'UPDATE_FORM_VALUES_MANAGE_DOCUMENT_VERSION';\r\n\r\n// alerts\r\nexport const LOAD_ALERTS_SUCCESS = 'LOAD_ALERTS_SUCCESS';\r\nexport const ADD_ALERT_SUCCESS = 'ADD_ALERT_SUCCESS';\r\nexport const EDIT_ALERT_SUCCESS = 'EDIT_ALERT_SUCCESS';\r\nexport const REMOVE_ALERT_SUCCESS = 'REMOVE_ALERT_SUCCESS';\r\nexport const ADD_USER_ALERT = 'ADD_USER_ALERT';\r\n\r\nexport const ADD_ALERT_FAILED = 'ADD_ALERT_FAILED';\r\nexport const EDIT_ALERT_FAILED = 'EDIT_ALERT_FAILED';\r\nexport const REMOVE_ALERT_FAILED = 'REMOVE_ALERT_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_ALERT = 'TOGGLE_MODAL_EDIT_ALERT';\r\nexport const SET_TABLE_FILTER_MANAGE_ALERT = 'SET_TABLE_FILTER_MANAGE_ALERT';\r\nexport const ALERT_MANAGE_TOTAL_PAGES = 'ALERT_MANAGE_TOTAL_PAGES';\r\nexport const SET_SELECTED_ALERT_ID = 'SET_SELECTED_ALERT_ID';\r\nexport const CLEAR_SELECTED_ALERT_ID = 'CLEAR_SELECTED_ALERT_ID';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_ALERT = 'SET_FORM_VALUES_MANAGE_ALERT';\r\nexport const UPDATE_FORM_VALUES_MANAGE_ALERT =\r\n 'UPDATE_FORM_VALUES_MANAGE_ALERT';\r\n\r\n// codes\r\n\r\nexport const LOAD_CODES_SUCCESS = 'LOAD_CODES_SUCCESS';\r\nexport const ADD_CODE_SUCCESS = 'ADD_CODE_SUCCESS';\r\nexport const EDIT_CODE_SUCCESS = 'EDIT_CODE_SUCCESS';\r\nexport const REMOVE_CODE_SUCCESS = 'REMOVE_CODE_SUCCESS';\r\n\r\nexport const ADD_CODE_FAILED = 'ADD_CODE_FAILED';\r\nexport const EDIT_CODE_FAILED = 'EDIT_CODE_FAILED';\r\nexport const REMOVE_CODE_FAILED = 'REMOVE_CODE_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_CODE = 'TOGGLE_MODAL_EDIT_CODE';\r\nexport const SET_TABLE_FILTER_MANAGE_CODE = 'SET_TABLE_FILTER_MANAGE_CODE';\r\nexport const CODE_MANAGE_TOTAL_PAGES = 'CODE_MANAGE_TOTAL_PAGES';\r\nexport const SET_SELECTED_CODE_ID = 'SET_SELECTED_CODE_ID';\r\nexport const CLEAR_SELECTED_CODE_ID = 'CLEAR_SELECTED_CODE_ID';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_CODE = 'SET_FORM_VALUES_MANAGE_CODE';\r\nexport const UPDATE_FORM_VALUES_MANAGE_CODE = 'UPDATE_FORM_VALUES_MANAGE_CODE';\r\n\r\n// work orders\r\n\r\nexport const CLEAR_WORKORDERS = 'CLEAR_WORKORDERS';\r\nexport const LOAD_WORKORDERS_SUCCESS = 'LOAD_WORKORDERS_SUCCESS';\r\nexport const LOAD_WORKORDERS_FAILED = 'LOAD_WORKORDERS_FAILED';\r\nexport const LOAD_WORKORDER_TECHNICIANS_SUCCESS =\r\n 'LOAD_WORKORDER_TECHNICIANS_SUCCESS';\r\nexport const LOAD_WORKORDER_TECHNICIANS_FAILED =\r\n 'LOAD_WORKORDER_TECHNICIANS_FAILED';\r\nexport const LOAD_WORKORDER_CSV_SUCCESS = 'LOAD_WORKORDER_CSV_SUCCESS';\r\nexport const LOAD_WORKORDER_CSV_FAILED = 'LOAD_WORKORDER_CSV_FAILED';\r\n\r\nexport const ADD_WORKORDER_SUCCESS = 'ADD_WORKORDER_SUCCESS';\r\nexport const ADD_WORKORDER_FAILED = 'ADD_WORKORDER_FAILED';\r\nexport const EDIT_WORKORDER_SUCCESS = 'EDIT_WORKORDER_SUCCESS';\r\nexport const EDIT_WORKORDER_FAILED = 'EDIT_WORKORDER_FAILED';\r\nexport const REMOVE_WORKORDER_SUCCESS = 'REMOVE_WORKORDER_SUCCESS';\r\nexport const REMOVE_WORKORDER_FAILED = 'REMOVE_WORKORDER_FAILED';\r\n\r\nexport const UNLINK_WORKORDERS_SUCCESS = 'UNLINK_WORKORDERS_SUCCESS';\r\nexport const UNLINK_WORKORDERS_FAILED = 'UNLINK_WORKORDERS_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_WORKORDER = 'TOGGLE_MODAL_EDIT_WORKORDER';\r\nexport const TOGGLE_MODAL_CLOSING_NOTES = 'TOGGLE_MODAL_CLOSING_NOTES';\r\n\r\nexport const SET_SELECTED_PART_ID = 'SET_SELECTED_PART_ID';\r\nexport const CLEAR_SELECTED_PART_ID = 'CLEAR_SELECTED_PART_ID';\r\nexport const TOGGLE_MODAL_EDIT_PART = 'TOGGLE_MODAL_EDIT_PART';\r\n\r\nexport const SET_TABLE_FILTER_MANAGE_WORKORDER =\r\n 'SET_TABLE_FILTER_MANAGE_WORKORDER';\r\nexport const WORKORDER_MANAGE_TOTAL_PAGES = 'WORKORDER_MANAGE_TOTAL_PAGES';\r\nexport const SET_SELECTED_WORKORDER_ID = 'SET_SELECTED_WORKORDER_ID';\r\nexport const CLEAR_SELECTED_WORKORDER_ID = 'CLEAR_SELECTED_WORKORDER_ID';\r\n\r\nexport const SET_FORM_VALUES_MANAGE_WORKORDER =\r\n 'SET_FORM_VALUES_MANAGE_WORKORDER';\r\nexport const UPDATE_FORM_VALUES_MANAGE_WORKORDER =\r\n 'UPDATE_FORM_VALUES_MANAGE_WORKORDER';\r\nexport const SET_FORM_VALUES_MANAGE_WORKORDER_PART =\r\n 'SET_FORM_VALUES_MANAGE_WORKORDER_PART';\r\nexport const UPDATE_FORM_VALUES_MANAGE_WORKORDER_PART =\r\n 'UPDATE_FORM_VALUES_MANAGE_WORKORDER_PART';\r\nexport const GET_WORK_ORDERS_BY_FACILITY_SUCCESS =\r\n 'GET_WORK_ORDERS_BY_FACILITY_SUCCESS';\r\nexport const GET_WORK_ORDERS_BY_FACILITY_FAILED =\r\n 'GET_WORK_ORDERS_BY_FACILITY_FAILED';\r\nexport const TOGGLE_MODAL_CONFIRM_SELECT_JOB =\r\n 'TOGGLE_MODAL_CONFIRM_SELECT_JOB';\r\nexport const WORKORDER_UPDATE_SELECTION = 'WORKORDER_UPDATE_SELECTION';\r\nexport const SET_SELECTED_MANAGE_WORKORDER_FACILITY_ID =\r\n 'SET_SELECTED_MANAGE_WORKORDER_FACILITY_ID';\r\nexport const CLEAR_SELECTED_MANAGE_WORKORDER_FACILITY_ID =\r\n 'CLEAR_SELECTED_MANAGE_WORKORDER_FACILITY_ID';\r\nexport const GET_FSES_WITH_WORK_ORDERS_SUCCESS =\r\n 'GET_FSES_WITH_WORK_ORDERS_SUCCESS';\r\nexport const GET_FSES_WITH_WORK_ORDERS_FAILED =\r\n 'GET_FSES_WITH_WORK_ORDERS_FAILED';\r\n\r\n// User Alerts\r\nexport const LOAD_USER_ALERTS_SUCCESS = 'LOAD_USER_ALERTS_SUCCESS';\r\nexport const LOAD_USER_ALERTS_FAILED = 'LOAD_USER_ALERTS_FAILED';\r\nexport const READ_USER_ALERT_SUCCESS = 'READ_USER_ALERT_SUCCESS';\r\nexport const READ_USER_ALERT_FAILED = 'READ_USER_ALERT_FAILED';\r\nexport const READ_ALL_USER_ALERTS_SUCCESS = 'READ_ALL_USER_ALERT_SUCCESS';\r\nexport const READ_ALL_USER_ALERTS_FAILED = 'READ_ALL_USER_ALERT_FAILED';\r\nexport const TOGGLE_MODAL_USER_ALERT = 'TOGGLE_MODAL_USER_ALERT';\r\n\r\n// Facility\r\nexport const GET_FACILITY_SUCCESS = 'GET_FACILITY_SUCCESS';\r\nexport const GET_FACILITY_FAILED = 'GET_FACILITY_FAILED';\r\nexport const FACILITY_TOTAL_PAGES = 'FACILITY_TOTAL_PAGES';\r\nexport const ADD_FACILITY_SUCCESS = 'ADD_FACILITY_SUCCESS';\r\nexport const EDIT_FACILITY_SUCCESS = 'EDIT_FACILITY_SUCCESS';\r\n\r\nexport const SET_SELECTED_FACILITY_ID = 'SET_SELECTED_FACILITY_ID';\r\nexport const CLEAR_SELECTED_FACILITY_ID = 'CLEAR_SELECTED_FACILITY_ID';\r\nexport const SET_TABLE_FILTER_MANAGE_FACILITY =\r\n 'SET_TABLE_FILTER_MANAGE_FACILITY';\r\n\r\nexport const UPDATE_FORM_VALUES_MANAGE_FACILITY =\r\n 'UPDATE_FORM_VALUES_MANAGE_FACILITY';\r\nexport const SET_FORM_VALUES_MANAGE_FACILITY =\r\n 'SET_FORM_VALUES_MANAGE_FACILITY';\r\n\r\nexport const GLOBAL_SET_SELECTED_CUSTOMER_ID = `GLOBAL_SET_SELECTED_CUSTOMER_ID`;\r\nexport const GLOBAL_SET_SELECTED_FACILITY_ID =\r\n 'GLOBAL_SET_SELECTED_FACILITY_ID';\r\nexport const GLOBAL_CLEAR_SELECTED_FACILITY_ID =\r\n 'GLOBAL_CLEAR_SELECTED_FACILITY_ID';\r\nexport const SET_GLOBAL_CUSTOMER_ID_VIA_FACILITY_ID =\r\n 'SET_GLOBAL_CUSTOMER_ID_VIA_FACILITY_ID';\r\n\r\n// Dashboard Analytics\r\n\r\nexport const GET_DASHBOARD_ANALYTICS_SUCCESS =\r\n 'GET_DASHBOARD_ANALYTICS_SUCCESS';\r\nexport const GET_DASHBOARD_ANALYTICS_FAILED = 'GET_DASHBOARD_ANALYTICS_FAILED';\r\n\r\n// Job Comments\r\nexport const MANAGE_JOB_COMMENTS_SUCCESS = 'MANAGE_JOB_COMMENTS_SUCCESS';\r\nexport const MANAGE_JOB_COMMENTS_FAILED = 'MANAGE_JOB_COMMENTS_FAILED';\r\nexport const MANAGE_JOB_COMMENTS_ADD = 'MANAGE_JOB_COMMENTS_ADD';\r\nexport const MANAGE_JOB_COMMENTS_UPDATE = 'MANAGE_JOB_COMMENTS_UPDATE';\r\nexport const MANAGE_JOB_COMMENTS_SELECT = 'MANAGE_JOB_COMMENTS_SELECT';\r\nexport const TOGGLE_MODAL_EDIT_JOB_COMMENT = 'TOGGLE_MODAL_EDIT_JOB_COMMENT';\r\nexport const MANAGE_JOB_COMMENTS_FILTER_VISIBLE =\r\n 'MANAGE_JOB_COMMENTS_FILTER_VISIBLE';\r\nexport const SET_TABLE_FILTER_MANAGE_JOB_COMMENTS =\r\n 'SET_TABLE_FILTER_MANAGE_JOB_COMMENTS';\r\nexport const MANAGE_JOB_COMMENT_CODES_SUCCESS =\r\n 'MANAGE_JOB_COMMENT_CODES_SUCCESS';\r\nexport const MANAGE_JOB_COMMENT_CODES_FAILED =\r\n 'MANAGE_JOB_COMMENT_CODES_FAILED';\r\n\r\n// Manage TAE\r\n\r\nexport const MANAGE_TAE_SUCCESS = 'MANAGE_TAE_SUCCESS';\r\nexport const MANAGE_TAE_FAILED = 'MANAGE_TAE_FAILED';\r\nexport const TOGGLE_MODAL_EDIT_TAE = 'TOGGLE_MODAL_EDIT_TAE';\r\nexport const SET_TABLE_FILTER_MANAGE_TAE = 'SET_TABLE_FILTER_MANAGE_TAE';\r\nexport const SET_SELECTED_MANAGE_TAE = 'SET_SELECTED_MANAGE_TAE';\r\n\r\n// Manage Leads\r\nexport const TOGGLE_MODAL_LEADS = 'TOGGLE_MODAL_LEADS';\r\n// SideMenu\r\nexport const SET_CURRENT_MENU_ITEM = 'SET_CURRENT_MENU_ITEM';\r\nexport const SET_SELECTED_MENU_ITEM = 'SET_SELECTED_MENU_ITEM';\r\n\r\n// Video Lesson\r\nexport const ADD_VIEWED_TOUR = 'ADD_VIEWED_TOUR';\r\nexport const RESET_VIEWED = 'RESET_VIEWED';\r\nexport const SET_IS_TUTORIAL_OPEN = 'SET_IS_TUTORIAL_OPEN';\r\nexport const TOGGLE_TUTORIAL = 'TOGGLE_TUTORIAL';\r\n\r\n// Manage Asset Photos\r\nexport const ASSET_PHOTOS_MANAGE_SUCCESS = 'ASSET_PHOTOS_MANAGE_SUCCESS';\r\nexport const ASSET_PHOTOS_MANAGE_FAILED = 'ASSET_PHOTOS_MANAGE_FAILED';\r\nexport const SET_TABLE_FILTER_MANAGE_ASSET_PHOTOS =\r\n 'SET_TABLE_FILTER_MANAGE_ASSET_PHOTOS';\r\nexport const ASSET_PHOTOS_MANAGE_TOTAL_PAGES =\r\n 'ASSET_PHOTOS_MANAGE_TOTAL_PAGES';\r\nexport const UPLOAD_PRODUCT_PHOTO_SUCCESS = 'UPLOAD_PRODUCT_PHOTO_SUCCESS';\r\nexport const UPLOAD_PRODUCT_PHOTO_FAILED = 'UPLOAD_PRODUCT_PHOTO_FAILED';\r\nexport const PHOTOS_BY_PRODUCT_SUCCESS = 'PHOTOS_BY_PRODUCT_SUCCESS';\r\nexport const DELETE_PHOTO_SUCCESS = 'DELETE_PHOTO_SUCCESS';\r\nexport const DELETE_PHOTO_FAILED = 'DELETE_PHOTO_FAILED';\r\n\r\nexport const SAVE_JOB_PARTS_SUCCESS = 'SAVE_JOB_PARTS_SUCCESS';\r\nexport const SAVE_JOB_PARTS_FAILED = 'SAVE_JOB_PARTS_FAILED';\r\n\r\nexport const GET_JOB_PARTS_SUCCESS = 'GET_JOB_PARTS_SUCCESS';\r\nexport const GET_JOB_PARTS_FAILED = 'GET_JOB_PARTS_FAILED';\r\n\r\nexport const GET_NEXT_JOB_NUMBER_SUCCESS = 'GET_NEXT_JOB_NUMBER_SUCCESS';\r\nexport const GET_NEXT_JOB_NUMBER_FAILED = 'GET_NEXT_JOB_NUMBER_FAILED';\r\n\r\nexport const TOGGLE_MODAL_EDIT_SUGGESTED_PART =\r\n 'TOGGLE_MODAL_EDIT_SUGGESTED_PART';\r\nexport const SET_TABLE_FILTER_MANAGE_SUGGESTED_PARTS =\r\n 'SET_TABLE_FILTER_MANAGE_SUGGESTED_PARTS';\r\nexport const SUGGESTED_PARTS_MANAGE_TOTAL_PAGES =\r\n 'SUGGESTED_PARTS_MANAGE_TOTAL_PAGES';\r\n\r\nexport const SEARCH_SUGGESTED_PARTS_SUCCESS = 'SEARCH_SUGGESTED_PARTS_SUCCESS';\r\nexport const SEARCH_SUGGESTED_PARTS_FAILED = 'SEARCH_SUGGESTED_PARTS_FAILED';\r\nexport const UPDATE_SELECTED_SUGGESTED_PART = 'UPDATE_SELECTED_SUGGESTED_PART';\r\n\r\nexport const SAVE_SUGGESTED_PARTS_SUCCESS = 'SAVE_SUGGESTED_PARTS_SUCCESS';\r\nexport const SAVE_SUGGESTED_PARTS_FAILED = 'SAVE_SUGGESTED_PARTS_FAILED';\r\n\r\n// Config\r\nexport const SET_IS_MOBILE = 'SET_IS_MOBILE';\r\n\r\n// Countries\r\nexport const SET_COUNTRIES = 'SET_COUNTRIES';\r\n\r\nexport const SET_SAP_JOB_MAPPING = 'SET_SAP_JOB_MAPPING';\r\n","import * as types from './actionTypes';\r\nimport { Dispatch } from 'redux';\r\n\r\nexport function beginAjaxCall() {\r\n return { type: types.BEGIN_AJAX_CALL };\r\n}\r\n\r\nexport function endAjaxCall() {\r\n return { type: types.END_AJAX_CALL };\r\n}\r\n\r\nexport function manualAjaxStart() {\r\n return (dispatch: Dispatch) => {\r\n dispatch(beginAjaxCall());\r\n };\r\n}\r\n\r\nexport function manualAjaxEnd() {\r\n return (dispatch: Dispatch) => {\r\n dispatch(endAjaxCall());\r\n };\r\n}\r\n","const root = process.env.REACT_APP_SERVER_DOMAIN;\r\nconst trainingRoot = process.env.REACT_APP_SERVER_DOMAIN_TRAINING;\r\nconsole.info(\r\n `ENV: ${process.env.NODE_ENV} SERVER_DOMAIN: ${root}/ Version: ${process.env.REACT_APP_VERSION}`\r\n);\r\n// TODO now that we are using the same endpoint for POST, PUT and GET, refactor this so that they are no longer nested and repeated\r\nconst API = {\r\n POST: {\r\n building: `${root}/building/add`,\r\n facility: {\r\n add: `${root}/facility/add`,\r\n merge: `${root}/facility/MergeFacilities`\r\n },\r\n floor: `${root}/floor`,\r\n location: `${root}/location`,\r\n room: `${root}/room/Add`,\r\n inventory: {\r\n updateproduct: `${root}/inventory/updateproduct`,\r\n addproduct: `${root}/inventory/addproduct`,\r\n quote: `${root}/inventory/beaconquote`,\r\n updateinstall: `${root}/inventory/update`,\r\n addinstall: `${root}/inventory/add`,\r\n deleteInstall: `${root}/inventory/delete`,\r\n installContact: `${root}/inventory/beaconcontact`,\r\n approveproduct: `${root}/inventory/approve`,\r\n importInstall: `${root}/inventory/excelimport`,\r\n mergeProduct: `${root}/inventory/mergeproduct`,\r\n moveFacility: `${root}/inventory/MoveFacilities`\r\n },\r\n user: {\r\n updatePostalCodes: `${root}/user/updatePostalCodes`,\r\n login: `${root}/user/login`,\r\n signup: `${root}/user/signup`,\r\n adSignup: `${root}/user/adsignup`,\r\n approve: `${root}/user/approve`,\r\n reject: `${root}/user/reject`,\r\n update: `${root}/user/update`,\r\n updateprofile: `${root}/user/updateprofile`,\r\n updateteam: `${root}/user/updateteammember`,\r\n saveteam: `${root}/user/saveteammember`,\r\n deleteTeamMember: `${root}/user/deleteteammember`,\r\n saveTrainingPO: `${root}/user/savetrainingpo`\r\n },\r\n training: {\r\n savelessonprogress: `${root}/training/savelessonprogress`,\r\n trainingCheckout: `${root}/training/savetrainingtransaction`,\r\n savequiz: `${root}/training/savequiz`,\r\n startQuiz: `${root}/training/startquiz`\r\n },\r\n measurementPoint: {\r\n addglobalmpl: `${root}/MeasurementPoint/AddGlobalMeasurementPointList`,\r\n addResults: `${root}/MeasurementPoint/AddJobMeasurementPointListResults`\r\n },\r\n report: {\r\n run: `${root}/report/run`,\r\n runDailyRounds: `${root}/report/RunDailyRounds`,\r\n templates: `${root}/report/CreateReportTemplate`,\r\n chapters: `${root}/report/CreateReportTemplateChapter`,\r\n templateChapters: `${root}/report/CreateReportTemplateChapter`,\r\n uploadExternalDocument: `${root}/report/UploadExtDoc`\r\n },\r\n brand: `${root}/brand`,\r\n alert: {\r\n create: `${root}/alert/add`,\r\n markAsRead: `${root}/alert/{alertId}/viewed`,\r\n markAllAsRead: `${root}/alert/all/viewed`\r\n },\r\n photo: {\r\n add: `${root}/photo/add`\r\n },\r\n job: {\r\n create: `${root}/job/CreateJob`\r\n },\r\n workOrder: {\r\n add: `${root}/workOrder/add`\r\n }\r\n },\r\n PUT: {\r\n building: `${root}/building/update`,\r\n floor: `${root}/floor`,\r\n location: `${root}/location`,\r\n room: `${root}/room`,\r\n measurementPoint: {\r\n updateglobalmpl: `${root}/MeasurementPoint/UpdateGlobalMeasurementPointList`,\r\n updatecustomermpl: `${root}/MeasurementPoint/UpdateCustomerMeasurementPointList`\r\n },\r\n brand: `${root}/brand`,\r\n brandLogo: `${root}/brand/UploadLogo`,\r\n alert: `${root}/alert/update`,\r\n facility: `${root}/facility/{id}`,\r\n updateFacility: `${root}/facility/update/{id}`,\r\n inventory: {\r\n updateInstalls: `${root}/inventory/updateInstalls`\r\n },\r\n report: {\r\n templates: `${root}/report/UpdateReportTemplate/{id}`,\r\n chapters: `${root}/report/UpdateChapter/{id}`,\r\n templateChapters: `${root}/report/UpdateReportTemplateChapters`\r\n }\r\n },\r\n DELETE: {\r\n building: `${root}/building/deletebuilding`,\r\n floor: `${root}/floor/deletefloor`,\r\n location: `${root}/location/deletelocation`,\r\n room: `${root}/room/deleteroom`,\r\n measurementPoint: {\r\n deleteglobalmpl: `${root}/MeasurementPoint/deleteglobalmeasurementpointlist`,\r\n deletecustomermpl: `${root}/MeasurementPoint/deletecustomermeasurementpointlist`,\r\n deleteglobalmeasurementpoint: `${root}/MeasurementPoint/deleteglobalmeasurementpoint`,\r\n deletecustomermeasurementpoint: `${root}/MeasurementPoint/deleteglobalmeasurementpoint`,\r\n deleteglobalmeasurementpointselectoption: `${root}/MeasurementPoint/deleteglobalmeasurementpointselectoption`,\r\n deletecustomermeasurementpointselectoption: `${root}/MeasurementPoint/deletecustomermeasurementpointselectoption`\r\n },\r\n user: `${root}/user/deleteaccount`,\r\n brand: `${root}/brand`,\r\n alert: `${root}/alert`,\r\n facility: `${root}/facility/DeleteFacility/{id}`,\r\n report: {\r\n templates: `${root}/report/DeleteReportTemplate/{id}`,\r\n chapters: `${root}/report/DeleteChapter/{id}`,\r\n templateChapters: `${root}/report/DeleteReportTemplateChapter`\r\n }\r\n },\r\n GET: {\r\n sapJobMapping: {\r\n getAll: `${root}/SAPJobMapping/GetAll`\r\n },\r\n building: {\r\n getall: `${root}/building/getall`\r\n },\r\n customer: {\r\n getbyid: `${root}/customer/{customerId}`,\r\n getall: `${root}/customer/getall`,\r\n getByCountry: `${root}/customer/GetByCountry`,\r\n getallwithfacilities: `${root}/customer/getallwithfacilities`,\r\n search: `${root}/customer/search`,\r\n getlogo: `${root}/customer/{customerId}/icon`\r\n },\r\n facility: {\r\n search: `${root}/facility/search`,\r\n GetFacilityQueue: `${root}/facility/GetFacilityQueue`,\r\n searchByCountries: `${root}/facility/SearchByCountries`,\r\n getbyid: `${root}/facility`,\r\n getbycustomer: `${root}/facility/getbycustomer`\r\n },\r\n inventory: {\r\n getinventory: `${root}/inventory/search`,\r\n getByFacility: `${root}/inventory/getbyfacility`,\r\n getproductinfo: `${root}/inventory/getproductinfo`,\r\n getproductqueue: `${root}/inventory/getproductqueue`,\r\n products: `${root}/inventory/products`,\r\n getNextSerialNumber: `${root}/inventory/getnextserialNumber`\r\n },\r\n floor: {\r\n getall: `${root}/floor/getall`\r\n },\r\n location: {\r\n getall: `${root}/location/getall`\r\n },\r\n room: {\r\n getall: `${root}/room/getall`\r\n },\r\n user: {\r\n getuserqueue: `${root}/user/getuserqueue`,\r\n getfseusers: `${root}/user/getfseusers`,\r\n getusersbysecurityfunction: `${root}/user/getusersbysecurityfunction`,\r\n getusersearch: `${root}/user/search`,\r\n getteamsearch: `${root}/user/searchteam`\r\n },\r\n training: {\r\n getprogressbylesson: `${root}/training/getprogressbylesson`,\r\n getalllessonprogress: `${root}/training/getalllessonprogress`,\r\n getPurchasedTraining: `${root}/training/getpurchasedtraining`,\r\n getAdminProgress: `${root}/training/getadminprogress`,\r\n getQuizResults: `${root}/training/getquizresults`,\r\n classMarker: (userId: string) =>\r\n `${root}/ClassMarker/GetResultsByUser/${userId}`,\r\n getQuizLink: (courseId: string) =>\r\n `${root}/training/getquizlink/${courseId}`,\r\n savePendingTraining: `${root}/training/SavePendingTransactions`\r\n },\r\n trainingCurriculum: {\r\n allCourses: `${root}/training/getcourses`,\r\n allLessons: `${root}/training/getlessons`,\r\n lessonByCourseID: `${root}/training/getlessonsbycourse`,\r\n quizzesByLessonID: `${root}/training/getquizzesbylesson`,\r\n allQuizzes: `${root}/training/getquizzes`\r\n },\r\n smartlinkDataPoint: {\r\n getAll: `${root}/smartlinkdatapoint/getall`\r\n },\r\n measurementPoint: {\r\n getall: `${root}/measurementpoint/GetAllMeasurementPointLists`,\r\n getJobResults: `${root}/MeasurementPoint/GetJobMeasurementPointListResults`,\r\n getFacilityMeasurementPointListResults: `${root}/MeasurementPoint/GetFacilityMeasurementPointListResults`,\r\n getMeasurementPointList: `${root}/measurementpoint/getmeasurementpointlist`,\r\n getMeasurementPointListResultWithAnswers: `${root}/measurementpoint/getmeasurementpointlistresultwithanswers`,\r\n getMeasurePointListResultForInstallBase: `${root}/measurementpoint/GetInstallBaseMeasurementPointListResults`\r\n },\r\n report: {\r\n defaults: `${root}/report/defaults`,\r\n templates: `${root}/report/GetAllReportTemplates`,\r\n chapters: `${root}/report/GetAllChapter`,\r\n templateChapters: `${root}/report/GetAllReportTemplateChapters`\r\n },\r\n brand: {\r\n search: `${root}/brand/search`,\r\n getAll: `${root}/brand/getallbrands`,\r\n getsingle: `${root}/brand`\r\n },\r\n alert: {\r\n single: `${root}/alert/{alertId}`,\r\n all: `${root}/alert/getall`,\r\n search: `${root}/alert/search`,\r\n user: `${root}/alert/user`\r\n }\r\n },\r\n alert: {\r\n alertsForInstallBase: `${root}/alert/AlertsForInstallBase`\r\n },\r\n cloudDocument: {\r\n getTypeByCustomer: `${root}/cloudDocumentType/getByCustomer`,\r\n documentType: `${root}/cloudDocumentType`,\r\n search: `${root}/cloudDocument/search`,\r\n single: `${root}/cloudDocument`, // {id}\r\n download: `${root}/cloudDocument/{documentID}/download`, // {id}/download\r\n downloadVersion: `${root}/cloudDocument/{documentID}/version/{versionID}/download`,\r\n getAll: `${root}/cloudDocumentType/GetAll`,\r\n add: `${root}/cloudDocument/add`,\r\n delete: `${root}/cloudDocument/deleteCloudDocument`,\r\n installSearch: `${root}/cloudDocument/installSearch`,\r\n preview: `${root}/cloudDocument/preview`\r\n },\r\n update: {\r\n dashboard: `${root}/update/dashboard`\r\n },\r\n jobComment: {\r\n search: `${root}/jobcomment/search`,\r\n single: `${root}/jobcomment`,\r\n resolve: `${root}/jobcomment/resolve`\r\n },\r\n code: {\r\n search: `${root}/code/search`,\r\n single: `${root}/code`\r\n },\r\n smartlink: {\r\n alert: `${root}/smartlink/alert`\r\n },\r\n contact: {\r\n getall: `${root}/contact/getall`,\r\n add: `${root}/contact/add`,\r\n update: `${root}/contact`,\r\n findUserOrContactByEmail: `${root}/contact/finduserorcontactbyemail`,\r\n getByFacility: `${root}/contact/getbyfacility`,\r\n updateFacilities: `${root}/contact/{id}/updateFacilities`,\r\n addFacility: `${root}/contact/{id}/addFacility`,\r\n deleteFacility: `${root}/contact/{id}/deletefacility`\r\n },\r\n preventativeMaintenanceChecklist: {\r\n getAll: `${root}/preventativeMaintenanceChecklist/getall`,\r\n single: `${root}/preventativeMaintenanceChecklist`\r\n },\r\n preventativeMaintenancePoint: {\r\n getCSV: `${root}/PreventativeMaintenancePoint/getCSV`\r\n },\r\n tae: {\r\n search: `${root}/tae/search`\r\n },\r\n job: {\r\n single: `${root}/job`,\r\n search: `${root}/job/search`,\r\n getAll: `${root}/job/getall`,\r\n getAllOpenJobsForWorkOrders: `${root}/job/GetAllOpenJobsForWorkOrders`,\r\n getassigned: `${root}/job/getassigned`,\r\n getByFacility: `${root}/job/getbyfacility`,\r\n getNextAutoNumber: `${root}/job/getnextautonumber`,\r\n addWorkOrders: `${root}/job/addworkorders`,\r\n delete: `${root}/job/deletejob`\r\n },\r\n lead: {\r\n bulkUpdateStatus: `${root}/Lead/BulkUpdateStatus`,\r\n getAll: `${root}/Lead/GetAll`,\r\n search: `${root}/Lead/Search`,\r\n single: `${root}/lead`\r\n },\r\n leadActivity: {\r\n getAll: `${root}/LeadActivity/GetLeadActivityForLead`,\r\n single: `${root}/LeadActivity`\r\n },\r\n leadInstallBase: {\r\n single: `${root}/LeadInstallBase`\r\n },\r\n quote: {\r\n search: `${root}/quote/search`,\r\n updateStatus: `${root}/quote/updatestatus`,\r\n saveQuoteFiles: `${root}/quote/saveQuoteFiles`\r\n },\r\n photo: {\r\n search: `${root}/photo/search`,\r\n getByProduct: `${root}/photo/getByProduct`,\r\n deletephoto: `${root}/photo/deletephoto?photoID={id}`,\r\n deleteMultiplePhotos: `${root}/photo/deletephotos`\r\n },\r\n workOrder: {\r\n single: `${root}/workorder`,\r\n search: `${root}/workorder/search`,\r\n getTechnicians: `${root}/workorder/GetTechnicians`,\r\n getWorkOrderCsv: `${root}/workorder/GetWorkOrderCSV`,\r\n getFSEsWithWorkOrders: `${root}/workorder/getfseswithworkorders`,\r\n unlinkWorkOrders: `${root}/workorder/UnlinkWorkOrders`\r\n },\r\n part: {\r\n search: `${root}/part/search`,\r\n get: `${root}/part/GetJobParts`,\r\n save: `${root}/part/SaveJobParts`\r\n },\r\n suggestedParts: {\r\n search: `${root}/part/SearchSuggestedParts`,\r\n save: `${root}/part/SaveSuggestedParts`\r\n },\r\n country: {\r\n getAll: `${root}/country/getAll`\r\n }\r\n};\r\n\r\nexport default API;\r\n","import { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { IAlert, ThunkResult } from '../models';\r\n\r\nexport const addUserAlert = (alert: IAlert) => ({\r\n type: types.ADD_USER_ALERT,\r\n payload: alert\r\n});\r\n\r\nexport const getUserAlerts = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.alert.user;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_USER_ALERTS_SUCCESS,\r\n payload: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOAD_USER_ALERTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get alerts');\r\n })\r\n .finally(() => endAjaxCall());\r\n };\r\n};\r\n\r\nexport const markAlertAsRead = (alert: IAlert): ThunkResult => (\r\n dispatch,\r\n getState\r\n) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post'\r\n };\r\n\r\n const url = API.POST.alert.markAsRead.replace('{alertId}', alert.id);\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.READ_USER_ALERT_SUCCESS,\r\n payload: alert.id\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.READ_USER_ALERT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'READ_USER_ALERT_FAILED');\r\n });\r\n};\r\n\r\nexport const markAllAlertAsRead = (): ThunkResult => (\r\n dispatch,\r\n getState\r\n) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post'\r\n };\r\n\r\n const url = API.POST.alert.markAllAsRead;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.READ_ALL_USER_ALERTS_SUCCESS\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.READ_ALL_USER_ALERTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'READ_ALL_USER_ALERT_FAILED');\r\n });\r\n};\r\n\r\nexport const toggleUserAlertModal = () => ({\r\n type: types.TOGGLE_MODAL_USER_ALERT\r\n});\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport {\r\n IpostalCode,\r\n ItableFiltersParams,\r\n Iuser,\r\n ThunkResult\r\n} from '../models';\r\nimport { isEqual, map } from 'lodash';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport { initialUser } from '../reducers/initialState';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { userLogoutHelper } from './userActions';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\n\r\ninterface IuserModified extends Omit {\r\n customers: Array<{ id: string; name: string }>;\r\n facilities: Array<{ id: string; name: string }>;\r\n}\r\n\r\nexport function getUserManage(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n countryID,\r\n userType\r\n } = getState().manageUser.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page,\r\n search,\r\n countryID: countryID?.value ?? '',\r\n userType: userType?.value ?? ''\r\n }\r\n };\r\n\r\n const url = API.GET.user.getusersearch;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_MANAGE_SUCCESS,\r\n users: data.data.result\r\n });\r\n dispatch({\r\n type: types.USER_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get users');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n/*\r\n * If the user updates themselves, log them out so that the changes are actually reflected\r\n */\r\nexport const checkForLoggedInUser = (\r\n userID: string,\r\n updatedUserID: string,\r\n dispatch: any\r\n) => {\r\n if (userID === updatedUserID) {\r\n toastr.warning(\r\n 'Logging out',\r\n 'Updating currently logged in user requires logging out.',\r\n constants.toastrSuccess\r\n );\r\n setTimeout(() => {\r\n dispatch(userLogoutHelper);\r\n }, 5000);\r\n }\r\n};\r\n\r\nexport function getSecurityUsers(\r\n securityFunctionIds: string[]\r\n): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: FormUtil.toUrlSearchParams({\r\n securityfunctions: securityFunctionIds\r\n })\r\n };\r\n\r\n const url = API.GET.user.getusersbysecurityfunction;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_SECURITY_SUCCESS,\r\n users: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_SECURITY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get security users');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function updatePostalCodes(\r\n postalCodes: string[],\r\n selectedUserId: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n const params = FormUtil.toUrlSearchParams({\r\n userId: selectedUserId,\r\n postalCodes\r\n });\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n params\r\n };\r\n const url = API.POST.user.updatePostalCodes;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_UPDATE_POSTAL_CODES_SUCCESS,\r\n id: selectedUserId,\r\n postalCodes: data.data.filter(\r\n (postalCode: IpostalCode) => !postalCode.isDeleted\r\n )\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_UPDATE_POSTAL_CODES_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'add postal codes');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const updateSelectedUser = (user = initialUser) => ({\r\n type: types.UPDATE_SELECTED_USER,\r\n payload: user\r\n});\r\n\r\n/*\r\n * saveUser\r\n * persist the user to the Server\r\n */\r\nexport function saveUser(user: Iuser, originalUser?: Iuser): ThunkResult {\r\n return (dispatch, getState) => {\r\n const { postalCodes, ...cleanedUser } = user;\r\n const postalCodeArray = map(postalCodes, (postalCode: IpostalCode) => {\r\n return postalCode.postalCode;\r\n });\r\n let initialPostalCodes;\r\n\r\n if (originalUser?.postalCodes) {\r\n initialPostalCodes = originalUser.postalCodes.map(\r\n postalCode => postalCode.postalCode\r\n );\r\n }\r\n\r\n const shouldUpdatePostalCodes = !isEqual(\r\n postalCodeArray,\r\n initialPostalCodes\r\n );\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: cleanedUser\r\n };\r\n\r\n const url = API.POST.user.update;\r\n\r\n dispatch(beginAjaxCall());\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data?.data) {\r\n throw new Error('missing data');\r\n } else {\r\n if (shouldUpdatePostalCodes) {\r\n dispatch(updatePostalCodes(postalCodeArray, user.id));\r\n }\r\n dispatch({\r\n type: types.USER_SAVE_SUCCESS,\r\n user: data.data\r\n });\r\n\r\n // toastr.success('Success', 'Saved user', constants.toastrSuccess);\r\n checkForLoggedInUser(user.id, getState().user.id, dispatch);\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_SAVE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update user');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const toggleSecurityFunctionsModal = () => ({\r\n type: types.TOGGLE_MODAL_SECURITY_FUNCTIONS\r\n});\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_USER,\r\n filters\r\n});\r\n\r\nexport const setEditUserFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_USER,\r\n formValues\r\n});\r\nexport const updateEditUserFormValues = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_USER,\r\n formValues\r\n});\r\n\r\nexport const setSelectedUserID = (id: string) => ({\r\n type: types.SET_SELECTED_MANAGE_USER,\r\n id\r\n});\r\n","import mixpanel from 'mixpanel-browser';\r\n\r\nimport isLocalhost from './isLocalHost';\r\n\r\nif (!isLocalhost) {\r\n mixpanel.init(`${process.env.REACT_APP_MIXPANEL_TOKEN}`, {\r\n ignore_dnt: true\r\n });\r\n}\r\n\r\nconst production = process.env.NODE_ENV === 'production';\r\n\r\ninterface IPeopleProps {\r\n $email: string;\r\n USER_ID: string;\r\n}\r\n\r\nconst actions = {\r\n identify: (id: string) => {\r\n if (production && !isLocalhost) {\r\n mixpanel.identify(id);\r\n }\r\n },\r\n alias: (id: string) => {\r\n if (production && !isLocalhost) {\r\n mixpanel.alias(id);\r\n }\r\n },\r\n track: (name: string, props?: any) => {\r\n if (production && !isLocalhost) {\r\n mixpanel.track(name, props);\r\n }\r\n },\r\n people: {\r\n set: (props: IPeopleProps) => {\r\n if (production && !isLocalhost) {\r\n mixpanel.people.set(props);\r\n }\r\n }\r\n }\r\n};\r\n\r\nexport default actions;\r\n","/**\r\n * Recursively traverses an object and replaces all empty string values with null.\r\n */\r\nexport const replaceEmptyStringsWithNull = (obj: T): T => {\r\n for (let key in obj) {\r\n if (typeof obj[key] === 'object' && obj[key] !== null) {\r\n replaceEmptyStringsWithNull(obj[key]);\r\n } else if ((obj[key] as unknown as string) === '') {\r\n (obj[key] as unknown) = null;\r\n }\r\n }\r\n return obj;\r\n};\r\n","import * as localForage from 'localforage';\r\nimport * as types from './actionTypes';\r\n\r\nimport Axios, { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { ItempUser, Iuser, ThunkResult } from '../models';\r\nimport {\r\n msalRequest,\r\n acquireToken,\r\n msalFetch\r\n} from '../components/auth/Auth-Utils';\r\nimport msalInstance from '../components/auth/MsalInstance';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { differenceBy } from 'lodash';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { Dispatch } from 'redux';\r\nimport { IregisterUserFormValues } from '../modelsForms';\r\nimport { TrackJS } from 'trackjs';\r\nimport { TFunction } from 'i18next';\r\nimport { constants } from '../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport initialState from '../reducers/initialState';\r\nimport { checkForLoggedInUser } from './manageUserActions';\r\nimport Mixpanel from '../helpers/Mixpanel';\r\nimport { getUserAlerts } from './manageUserAlertActions';\r\nimport { replaceEmptyStringsWithNull } from '../helpers/cleanObjEmptyStrings';\r\n\r\nexport const userLogoutHelper = (dispatch: Dispatch) => {\r\n console.info('logging out');\r\n // dispatch({ type: types.USER_LOGOUT_SUCCESS });\r\n // dispatch({ type: 'Offline/RESET_STATE' }); // reset the redux-offline outbox\r\n // dispatch({ type: '@ReduxToastr/toastr/CLEAN_TOASTR' }); // reset the toastr\r\n document.dispatchEvent(new Event('userLogout')); // pause the redux persist\r\n // remove persisted state then do the MSAL logout which causes a redirect to the MSAL logout then to our login screen\r\n\r\n localForage\r\n .setItem('persist:state-core-care-web', JSON.stringify(initialState))\r\n .then(message => {\r\n msalInstance.msalApp.logoutRedirect();\r\n Mixpanel.track('User Logout');\r\n // window.location.replace(MSAL_LOGOUT_URL);\r\n })\r\n .catch(error => {\r\n Mixpanel.track('User Logout Error');\r\n console.error('error logging out', error);\r\n });\r\n};\r\n\r\nexport function userLogin(t: TFunction): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n // return acquireToken().then((authResponse: AuthResponse) => {\r\n // const token = authResponse.accessToken;\r\n // dispatch({ type: types.AAD_LOGIN, token });\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post'\r\n };\r\n const url = API.POST.user.login;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const user = data.data as Iuser;\r\n dispatch({ type: types.USER_LOGIN_SUCCESS, user });\r\n TrackJS.configure({\r\n userId: user.email,\r\n version: process.env.REACT_APP_VERSION\r\n });\r\n\r\n // make sure they have at least one Facility (this happens when a user's one facility has been deleted from the system)\r\n if (user.facilities.length === 0) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:loginMissingFacility'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n // default the the selected customer and facility if they are not already set\r\n const defaultFacility = user.facilities[0];\r\n\r\n if (defaultFacility && defaultFacility.id.length) {\r\n dispatch({\r\n type: types.GLOBAL_SET_SELECTED_FACILITY_ID,\r\n id: defaultFacility.id\r\n });\r\n } else {\r\n console.error('missing facility', defaultFacility);\r\n }\r\n }\r\n\r\n // if user has access to all customers and we have not already retrieved them\r\n // wait for MSAL (otherwise when logging out, this fires before MSAL loggs out)\r\n // if (getCanAccessAllCustomers(user)) {\r\n // setTimeout(() => {\r\n // dispatch(getCustomersWithFacilities());\r\n // }, 500);\r\n // }\r\n dispatch(getUserAlerts());\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n console.error('failed to login', error);\r\n // dispatch({\r\n // type: types.USER_LOGIN_FAILED,\r\n // error,\r\n // axiosOptions\r\n // });\r\n // userLogoutHelper(dispatch);\r\n // // to avoid getting stuck, go ahead and log the user out after a longer pause\r\n // constants.handleError(error, 'login');\r\n throw error; // intentionally re-throw\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n // });\r\n };\r\n}\r\n// export function MSALlogin(t: TFunction): ThunkResult {\r\n// return (dispatch, getState) => {\r\n// // First handle any existing redirect response\r\n// return msalApp.handleRedirectPromise()\r\n// .then(async response => {\r\n// console.info('handleRedirectPromise', response);\r\n// if (response) {\r\n// msalApp.setActiveAccount(response.account);\r\n// await dispatch(userLogin(t));\r\n// return;\r\n// } else {\r\n// return msalApp.loginRedirect(msalRequest);\r\n// }\r\n// })\r\n// .catch(error => {\r\n// console.info(error);\r\n// });\r\n// };\r\n// }\r\nexport function MSALlogin(t: TFunction): ThunkResult {\r\n return async (dispatch, getState) => {\r\n return await msalInstance.msalApp.loginRedirect(msalRequest);\r\n };\r\n}\r\n\r\n/*\r\n * reauthenticate in the background if possible\r\n * April 24th - this can likely be removed now that we are doing login() right from the error hanndling function in constants.tsx\r\n */\r\nexport const adalReauth = () => {\r\n acquireToken();\r\n};\r\n\r\nexport function userLogout(t: TFunction): ThunkResult {\r\n return (dispatch, getState) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n userLogoutHelper(dispatch);\r\n },\r\n OnCancel: () => console.info('CANCEL: clicked'),\r\n okText: t('common:logout'),\r\n cancelText: t('common:cancel')\r\n };\r\n toastr.confirm(t('common:logoutConfirm'), toastrConfirmOptions);\r\n };\r\n}\r\n\r\nexport function userLogoutSessionOnly(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({ type: types.USER_LOGOUT_SESSION_ONLY_SUCCESS });\r\n const event = new CustomEvent('userLogout');\r\n document.dispatchEvent(event);\r\n setTimeout(() => {\r\n msalInstance.msalApp.logoutRedirect();\r\n }, 2000);\r\n };\r\n}\r\n\r\n/*\r\n * Logout dispatches an event to pause persisting redux state\r\n * then we replace the entire persisted state. This works better than dispatching USER_LOGOUT_SUCCESS because\r\n * dispatching that will trigger API calls which try to renew the token and results in a nasty race condition.\r\n */\r\n\r\nexport function signUpDirect(\r\n formValues: IregisterUserFormValues\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const countryID = formValues.countryID.value;\r\n const phoneCountryCode = formValues.phoneCountryCode?.value;\r\n\r\n const tempUser: ItempUser = {\r\n ...formValues,\r\n countryID,\r\n phoneCountryCode\r\n };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: tempUser\r\n };\r\n const url = API.POST.user.signup;\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_SIGNUP_SUCCESS,\r\n user: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n console.log(error);\r\n dispatch({ type: types.USER_SIGNUP_FAILED, error, tempUser });\r\n constants.handleError(error, 'sign up');\r\n throw error; // intentionally re-throw\r\n });\r\n };\r\n}\r\n\r\nexport function adSignup({\r\n first,\r\n last,\r\n email\r\n}: {\r\n [key: string]: any;\r\n}): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const body = {\r\n first: first || '',\r\n last: last || '',\r\n email: email || ''\r\n };\r\n return Axios.post(API.POST.user.adSignup, body)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_SIGNUP_SUCCESS,\r\n user: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.USER_SIGNUP_FAILED, error, body });\r\n constants.handleError(error, 'sign up');\r\n throw error; // intentionally re-throw\r\n });\r\n };\r\n}\r\n\r\nexport const toggleEditProfileModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_PROFILE\r\n});\r\n\r\nexport function updateUserProfile(updatedUser: Iuser): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_PROFILE });\r\n const { user } = getState();\r\n // change all empty strings to null\r\n const cleanData = replaceEmptyStringsWithNull(updatedUser);\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: cleanData\r\n };\r\n\r\n const url = API.POST.user.updateprofile;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_UPDATE_PROFILE_SUCCESS,\r\n user: updatedUser\r\n });\r\n\r\n // if changing country we need to log the user out\r\n if (updatedUser.countryID !== user.countryID) {\r\n checkForLoggedInUser(user.id, user.id, dispatch);\r\n }\r\n\r\n // if the user changed their facilities we need to log them out\r\n if (\r\n differenceBy(\r\n user.facilities,\r\n data.data.facilities,\r\n 'id'\r\n ).length > 0 ||\r\n differenceBy(\r\n data.data.facilities,\r\n user.facilities,\r\n 'id'\r\n ).length > 0\r\n ) {\r\n checkForLoggedInUser(user.id, user.id, dispatch);\r\n } else {\r\n toastr.success(\r\n 'Success',\r\n 'Saved profile',\r\n constants.toastrSuccess\r\n );\r\n }\r\n\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_UPDATE_PROFILE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update profile');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function deleteUserAccount(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_PROFILE });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = API.DELETE.user;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n userLogoutHelper(dispatch);\r\n })\r\n .catch((error: any) => {\r\n dispatch(endAjaxCall());\r\n constants.handleError(error, 'delete profile');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n","import * as types from './actionTypes';\r\n\r\nexport const addView = (route: string) => ({\r\n type: types.ADD_VIEWED_TOUR,\r\n payload: route\r\n});\r\n\r\nexport const resetViews = () => ({\r\n type: types.RESET_VIEWED\r\n});\r\n\r\nexport const setIsTutorialOpen = (run: boolean) => ({\r\n type: types.SET_IS_TUTORIAL_OPEN,\r\n payload: run\r\n});\r\n\r\nexport const toggleTutorial = () => ({\r\n type: types.TOGGLE_TUTORIAL\r\n});\r\n","/*\r\n * Measurement Point Results Reducer\r\n * This reducer was copied from the mobile app\r\n */\r\n\r\nimport {\r\n ImeasurementPointResultsReducer,\r\n ImeasurementPointResult,\r\n ImeasurementPointAnswer,\r\n IinstallBaseHistory\r\n} from '../models';\r\nimport {\r\n initialMeasurmentPointResult,\r\n initialMeasurementPointResultAnswer,\r\n initialInstallBaseHistory\r\n} from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { keyBy, pickBy, filter } from 'lodash';\r\nimport { combineReducers } from 'redux';\r\n\r\nconst cleanResult = (\r\n result: ImeasurementPointResult\r\n): ImeasurementPointResult => {\r\n let cleanedAnswers: ImeasurementPointAnswer[] = [];\r\n if (\r\n result.measurementPointAnswers &&\r\n result.measurementPointAnswers.length\r\n ) {\r\n cleanedAnswers = result.measurementPointAnswers.map(answer => {\r\n return {\r\n ...initialMeasurementPointResultAnswer,\r\n ...pickBy(answer, (property, key) => property !== null)\r\n };\r\n });\r\n }\r\n return {\r\n ...initialMeasurmentPointResult,\r\n ...pickBy(result, (property, key) => property !== null),\r\n measurementPointAnswers: cleanedAnswers\r\n };\r\n};\r\n\r\nconst measurementPointResultsByID = (\r\n state: { [key: string]: ImeasurementPointResult } = {},\r\n action: any\r\n): { [key: string]: ImeasurementPointResult } => {\r\n switch (action.type) {\r\n case types.ADD_MEASUREMENT_POINT_RESULT: {\r\n return { ...state, [action.result.id]: cleanResult(action.result) };\r\n }\r\n case types.UPDATE_MEASUREMENT_POINT_RESULT: {\r\n return { ...state, [action.result.id]: cleanResult(action.result) };\r\n }\r\n case types.GET_MEASUREMENT_POINT_FACILITY_RESULTS_SUCCESS: {\r\n const newResults = keyBy(\r\n action.results.map((res: ImeasurementPointResult) =>\r\n cleanResult(res)\r\n ),\r\n 'id'\r\n );\r\n return { ...state, ...newResults };\r\n }\r\n case types.GET_INVENTORY_SUCCESS: {\r\n let measurementPointResults: ImeasurementPointResult[] = [];\r\n action.inventory.forEach(({ product }: any) => {\r\n // these objects do not include the measurement point result answers\r\n product.installBases.forEach(\r\n ({ latestMeasurementPointListResult }: any) => {\r\n if (latestMeasurementPointListResult) {\r\n measurementPointResults = [\r\n ...measurementPointResults,\r\n latestMeasurementPointListResult\r\n ];\r\n }\r\n }\r\n );\r\n });\r\n return { ...state, ...keyBy(measurementPointResults, 'id') };\r\n }\r\n case types.GET_MEASUREMENT_POINT_RESULT_SUCCESS: {\r\n return {\r\n ...state,\r\n [action.payload.id]: cleanResult(action.payload)\r\n };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport const selectInstallBaseHistory = (\r\n state: ImeasurementPointResultsReducer\r\n) => {\r\n return state.installBaseHistory;\r\n};\r\n\r\nconst installBaseHistory = (\r\n state: IinstallBaseHistory[] = initialInstallBaseHistory,\r\n action: any\r\n): IinstallBaseHistory[] => {\r\n if (action !== undefined) {\r\n switch (action.type) {\r\n case types.GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_SUCCESS: {\r\n const history: IinstallBaseHistory[] = [];\r\n\r\n action.results.forEach((item: any) => {\r\n // Create model with camelCase propteries\r\n const mapped: IinstallBaseHistory = {\r\n id: item.Id,\r\n date: item.Date,\r\n notes: item.Notes,\r\n jobType: item.JobType,\r\n status: item.Status,\r\n workOrderId: item.WorkOrderID\r\n };\r\n\r\n // id acts as key for the View and when user clicks on a record (SET_HISTORICAL_RESULT_ID), i.e. we really need to have an id\r\n if (mapped.id === undefined) {\r\n mapped.id = mapped.workOrderId;\r\n }\r\n\r\n history.push(mapped);\r\n });\r\n\r\n // Sort by date\r\n history.sort(function(a, b) {\r\n if (a.date > b.date) return -1;\r\n if (a.date < b.date) return 1;\r\n return 0;\r\n });\r\n\r\n return history;\r\n }\r\n default:\r\n return state;\r\n }\r\n }\r\n return state;\r\n};\r\n\r\nconst selectedResult = (\r\n state: ImeasurementPointResult = initialMeasurmentPointResult,\r\n action: any\r\n): ImeasurementPointResult => {\r\n switch (action.type) {\r\n case types.ADD_MEASUREMENT_POINT_RESULT:\r\n return action.result;\r\n case types.UPDATE_MEASUREMENT_POINT_RESULT:\r\n // if this has been submitted to the server, it is no longer temporary and can no longer be edited. Thus it should not be in the currentRestult reducer\r\n if (action.result.temporary === false) {\r\n console.info(\r\n 'submitting a result, should we update selectedResultReducer?'\r\n );\r\n // return state;\r\n }\r\n if (state.id === action.result.id) {\r\n return { ...state, ...cleanResult(action.result) };\r\n } else {\r\n return cleanResult(action.result);\r\n }\r\n case types.RESET_MEASUREMENT_POINT_RESULT:\r\n return initialMeasurmentPointResult;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialMeasurmentPointResult;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst previousResult = (\r\n state: ImeasurementPointResult = initialMeasurmentPointResult,\r\n action: any\r\n): ImeasurementPointResult => {\r\n switch (action.type) {\r\n case types.SET_PREVIOUS_RESULT:\r\n return action.result;\r\n case types.RESET_PREVIOUS_RESULT:\r\n return initialMeasurmentPointResult;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialMeasurmentPointResult;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\n/*\r\n * enable viewing of historical results\r\n */\r\nconst historicalResultID = (state = '', action: any): string => {\r\n switch (action.type) {\r\n case types.SET_HISTORICAL_RESULT_ID:\r\n console.info(action);\r\n return action.resultID;\r\n case types.CLEAR_HISTORICAL_RESULT_ID:\r\n return '';\r\n case types.USER_LOGOUT_SUCCESS:\r\n return '';\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst measurementPointResultsReducer = combineReducers<\r\n ImeasurementPointResultsReducer\r\n>({\r\n measurementPointResultsByID,\r\n historicalResultID,\r\n selectedResult,\r\n previousResult,\r\n installBaseHistory\r\n});\r\n\r\nexport default measurementPointResultsReducer;\r\n\r\n/*\r\n * Selectors\r\n */\r\n\r\n// export const selectMeasurementPointResultsByInstallBaseID = (\r\n// state: { [key: string]: ImeasurementPointResult },\r\n// installBaseID: string\r\n// ) => {\r\n// const filteredResults = filter(\r\n// state,\r\n// result =>\r\n// result.temporary !== true && result.installBaseID === installBaseID\r\n// );\r\n// return orderBy(\r\n// filteredResults,\r\n// res => moment.utc(res.updateDate).unix(),\r\n// 'desc'\r\n// );\r\n// };\r\n\r\nexport const selectMeasurementPointListResultsByInstallBaseID = (\r\n state: ImeasurementPointResultsReducer,\r\n installBaseID: string\r\n) => {\r\n return filter(\r\n state.measurementPointResultsByID,\r\n result =>\r\n result.installBaseID === installBaseID &&\r\n result.isDeleted === false &&\r\n result.temporary !== true\r\n );\r\n};\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n IWorkOrder,\r\n Ijob,\r\n ImanageWorkOrderReducer,\r\n IpreventativeMaintenanceChecklist,\r\n Iuser\r\n} from '../models';\r\nimport {\r\n createFormValuesWithName,\r\n createSelectedIDWithName,\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { filter, keyBy, map, omit, orderBy, pickBy } from 'lodash';\r\nimport initialState, {\r\n initialPreventativeMaintenanceChecklist,\r\n initialWorkOrder\r\n} from './initialState';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { workOrderStatusEnum } from '../models-enums';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\n\r\nconst cleanWorkOrderObject = (workOrder: any): IWorkOrder => {\r\n // todo remove facility\r\n const normalizedWorkOrder = omit(workOrder, 'jobWorkOrders');\r\n const assignedUser = workOrder.jobWorkOrders?.[0]?.job?.assignedUser;\r\n return {\r\n ...initialWorkOrder,\r\n ...pickBy(normalizedWorkOrder, property => property !== null),\r\n jobNumber: workOrder.jobWorkOrders?.[0]?.job?.jobNumber,\r\n assignedUser: assignedUser\r\n ? `${assignedUser.first} ${assignedUser.last}`\r\n : undefined\r\n };\r\n};\r\nconst cleanPreventativeMaintenanceChecklist = (\r\n checklist: IpreventativeMaintenanceChecklist\r\n) => {\r\n return {\r\n ...initialPreventativeMaintenanceChecklist,\r\n ...pickBy(checklist, property => property !== null)\r\n } as IpreventativeMaintenanceChecklist;\r\n};\r\n\r\n/*\r\n * SELECTORS\r\n */\r\nexport const selectWorkOrdersByID = (state: IinitialState) =>\r\n state.manageWorkOrder.workOrdersByID;\r\n\r\nexport const getVisibleWorkOrdersByID = (state: IinitialState) =>\r\n state.manageWorkOrder.visibleWorkOrdersByID;\r\n\r\nexport const selectWorkOrdersByInstallBaseID = (\r\n state: ImanageWorkOrderReducer,\r\n installBaseID: string\r\n) => {\r\n return filter(state.workOrdersByID, { installBaseID, isDeleted: false });\r\n};\r\n\r\nexport const selectCompleteWorkOrdersByInstallBaseID = (\r\n state: ImanageWorkOrderReducer,\r\n installBaseID: string\r\n) => {\r\n return filter(state.workOrdersByID, {\r\n installBaseID,\r\n isDeleted: false,\r\n status: workOrderStatusEnum.complete\r\n });\r\n};\r\n\r\nconst selectJobWorkOrders = (state: IinitialState) =>\r\n state.manageJob.jobWorkOrdersByID;\r\n\r\n// this selector also lives in manageJobReducer. for some reason\r\n// when importing it from there we get a \"before initialization error\"\r\nconst selectJobWorkOrdersWithWorkOrders = createSelector(\r\n [selectJobWorkOrders, selectWorkOrdersByID],\r\n (jobWorkOrdersByID, workOrdersByID) => {\r\n const withWorkOrders = map(jobWorkOrdersByID, jwo => {\r\n return {\r\n ...jwo,\r\n workOrder: workOrdersByID[jwo.workOrderID] || initialWorkOrder\r\n };\r\n });\r\n return keyBy(withWorkOrders, 'id');\r\n }\r\n);\r\n\r\n// TODO\r\nexport const selectVisibleWorkOrdersPopulated = createSelector(\r\n [getVisibleWorkOrdersByID, selectJobWorkOrdersWithWorkOrders],\r\n (workOrders, jobWorkOrders) => {\r\n return map(workOrders, workOrder => {\r\n const foundJobWorkOrders = filter(jobWorkOrders, {\r\n isDeleted: false,\r\n workOrderID: workOrder.id\r\n });\r\n return { ...workOrder, jobWorkOrders: foundJobWorkOrders };\r\n });\r\n }\r\n);\r\n\r\nexport const selectVisibleWorkOrdersByID = createSelector(\r\n [getVisibleWorkOrdersByID, selectJobWorkOrders],\r\n (workOrders, jobWorkOrders) => {\r\n let orderedWOs = orderBy(workOrders, wo => wo);\r\n orderedWOs = orderedWOs.map(wo => {\r\n const foundJobWorkOrders = filter(jobWorkOrders, {\r\n isDeleted: false,\r\n workOrderID: wo.id\r\n });\r\n\r\n wo.jobWorkOrders = foundJobWorkOrders;\r\n return wo;\r\n });\r\n return orderedWOs;\r\n }\r\n);\r\n\r\nexport const selectVisibleWorkOrdersUsers = createSelector(\r\n [getVisibleWorkOrdersByID],\r\n workOrders => {\r\n // return a list of assignedUser and filter out duplicates\r\n const woList = Object.values(workOrders).filter(wo => wo.assignedUser);\r\n const woUsers = woList.map(wo => wo.assignedUser as string);\r\n const cleanUsers = woUsers.filter(\r\n (user, index) => woUsers.indexOf(user) === index\r\n );\r\n\r\n return cleanUsers;\r\n }\r\n);\r\n\r\n/*\r\n * REDUCERS\r\n */\r\n\r\nfunction workOrdersByIDReducer(\r\n state: { [key: string]: IWorkOrder } = initialState.manageWorkOrder\r\n .workOrdersByID,\r\n action: any\r\n): { [key: string]: IWorkOrder } {\r\n switch (action.type) {\r\n case types.LOAD_WORKORDERS_SUCCESS: {\r\n const newOrders = map(action.payload, (order: IWorkOrder) => {\r\n return cleanWorkOrderObject(order);\r\n });\r\n return { ...state, ...keyBy(newOrders, 'id') };\r\n }\r\n case types.GET_INVENTORY_SUCCESS: {\r\n let newWorkOrders: IWorkOrder[] = [];\r\n action.inventory.forEach(({ product }: any) => {\r\n product.installBases.forEach(({ workOrders }: any) => {\r\n if (workOrders && workOrders.length) {\r\n newWorkOrders = [...newWorkOrders, ...workOrders];\r\n }\r\n });\r\n });\r\n return { ...state, ...keyBy(newWorkOrders, 'id') };\r\n }\r\n case types.GET_WORK_ORDERS_BY_FACILITY_SUCCESS:\r\n if (action.payload && action.payload.length) {\r\n const newFacilityWOs = map(action.payload, wo => {\r\n return cleanWorkOrderObject(wo);\r\n });\r\n return { ...state, ...keyBy(newFacilityWOs, 'id') };\r\n }\r\n case types.ADD_WORKORDER_SUCCESS: {\r\n return {\r\n ...state,\r\n [action.payload.id]: cleanWorkOrderObject(action.payload)\r\n };\r\n }\r\n case types.EDIT_WORKORDER_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.REMOVE_WORKORDER_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload.id]: { ...action.payload, isDeleted: true }\r\n };\r\n case types.JOB_MANAGE_SUCCESS: {\r\n let newWOrders: IWorkOrder[] = [];\r\n action.jobs.forEach((job: Ijob) => {\r\n if (job.jobWorkOrders && job.jobWorkOrders.length) {\r\n job.jobWorkOrders.forEach(jobWorkOrder => {\r\n if (jobWorkOrder.workOrder) {\r\n newWOrders = [\r\n ...newWOrders,\r\n cleanWorkOrderObject(jobWorkOrder.workOrder)\r\n ];\r\n }\r\n });\r\n }\r\n });\r\n return { ...state, ...keyBy(newWOrders, 'id') };\r\n }\r\n case types.UNLINK_WORKORDERS_SUCCESS: {\r\n // remove the jobWorkOrders from the workOrders that were unlinked\r\n let updatedWorkOrders: IWorkOrder[] = [];\r\n let currentState = { ...state };\r\n\r\n if (action && action.selection && action.selection.length > 0) {\r\n updatedWorkOrders = action.selection.map(\r\n (workOrder: IWorkOrder) => {\r\n currentState[workOrder.id].jobWorkOrders = [];\r\n }\r\n );\r\n }\r\n return { ...currentState };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageWorkOrder.workOrdersByID;\r\n case types.CLEAR_WORKORDERS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction visibleWorkOrdersByID(\r\n state: { [key: string]: IWorkOrder } = initialState.manageWorkOrder\r\n .workOrdersByID,\r\n action: any\r\n): { [key: string]: IWorkOrder } {\r\n switch (action.type) {\r\n case types.LOAD_WORKORDERS_SUCCESS: {\r\n const newOrders = map(action.payload, (order: IWorkOrder) => {\r\n return cleanWorkOrderObject(order);\r\n });\r\n return keyBy(newOrders, 'id');\r\n }\r\n case types.EDIT_WORKORDER_SUCCESS: {\r\n return { ...state, [action.payload.id]: action.payload };\r\n }\r\n case types.REMOVE_WORKORDER_SUCCESS: {\r\n const data = { ...state };\r\n delete data[action.payload.id];\r\n return data;\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageWorkOrder.workOrdersByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction preventativeMaintenanceChecklistsByID(\r\n state: { [key: string]: IpreventativeMaintenanceChecklist } = initialState\r\n .manageWorkOrder.preventativeMaintenanceChecklistsByID,\r\n action: any\r\n): { [key: string]: IpreventativeMaintenanceChecklist } {\r\n switch (action.type) {\r\n case types.LOAD_WORKORDERS_SUCCESS: {\r\n let pmcs: IpreventativeMaintenanceChecklist[] = [];\r\n action.payload.forEach((workOrder: IWorkOrder) => {\r\n if (workOrder.preventativeMaintenanceChecklist) {\r\n pmcs = [\r\n ...pmcs,\r\n cleanPreventativeMaintenanceChecklist(\r\n workOrder.preventativeMaintenanceChecklist\r\n )\r\n ];\r\n }\r\n });\r\n return keyBy(pmcs, 'id');\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageWorkOrder\r\n .preventativeMaintenanceChecklistsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction technicians(\r\n state: string[] = initialState.manageWorkOrder.technicians,\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.LOAD_WORKORDER_TECHNICIANS_SUCCESS:\r\n return action.payload;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageWorkOrder.technicians;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.WORKORDER_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction selection(\r\n state: string[] = initialState.manageWorkOrder.selection,\r\n action: any\r\n): string[] {\r\n switch (action.type) {\r\n case types.WORKORDER_UPDATE_SELECTION:\r\n return action.payload;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageWorkOrder.selection;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst fsesWithWorkOrders = (state: Iuser[] = [], action: any): Iuser[] => {\r\n switch (action.type) {\r\n case types.GET_FSES_WITH_WORK_ORDERS_SUCCESS:\r\n return action.data;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst manageWorkOrder = combineReducers({\r\n workOrdersByID: workOrdersByIDReducer,\r\n visibleWorkOrdersByID,\r\n preventativeMaintenanceChecklistsByID,\r\n technicians,\r\n totalPages,\r\n selectedWorkOrderID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'WORKORDER_ID'),\r\n selectedPartID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'PART_ID'),\r\n showEditWorkOrderModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_WORKORDER'),\r\n showEditPartModalForm: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_PART'),\r\n showWorkOrderCloseModal: (state, action) =>\r\n modalToggleWithName(state, action, 'CLOSING_NOTES'),\r\n showConfirmSelectJobModal: (state, action) =>\r\n modalToggleWithName(state, action, 'CONFIRM_SELECT_JOB'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_WORKORDER'),\r\n workOrderFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_WORKORDER'),\r\n partFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_WORKORDER_PART'),\r\n selection,\r\n selectedFacilityIDForConfirmSelectJob: (state, action) =>\r\n createSelectedIDWithName(state, action, 'MANAGE_WORKORDER_FACILITY_ID'),\r\n fsesWithWorkOrders\r\n});\r\n\r\nexport default manageWorkOrder;\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n Ibuilding,\r\n Ifacility,\r\n IfacilityContract,\r\n IfacilityWithoutBuildings,\r\n Ifloor,\r\n Ilead,\r\n Ilocation,\r\n Ioption,\r\n Iroom,\r\n ItableFiltersParams,\r\n Iuser\r\n} from '../models';\r\nimport { filter, keyBy, map, omit, orderBy, pickBy, forEach } from 'lodash';\r\nimport initialState, { initialFacility } from './initialState';\r\n\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\n\r\nexport const cleanFacilityWithoutBuildings = (\r\n facility: IfacilityWithoutBuildings\r\n) => {\r\n const initialFacilityWithoutBuildings = omit(initialFacility, [\r\n 'buildings'\r\n ]);\r\n\r\n return {\r\n ...initialFacilityWithoutBuildings,\r\n ...pickBy(facility, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nexport const cleanFacility = (facility: Ifacility = initialFacility) => {\r\n let buildings = facility?.buildings;\r\n\r\n if (buildings && buildings.length) {\r\n buildings = buildings.filter(building => building.isDeleted === false);\r\n\r\n if (buildings.length) {\r\n buildings = buildings.map(building => {\r\n if (building?.floors?.length) {\r\n const filteredFloors = building.floors.filter(\r\n floor => floor.isDeleted === false\r\n );\r\n\r\n if (filteredFloors.length) {\r\n const floors = filteredFloors.map(floor => {\r\n const filteredLocations = floor.locations.filter(\r\n location => location.isDeleted === false\r\n );\r\n\r\n if (filteredLocations.length) {\r\n const locations = filteredLocations.map(\r\n location => {\r\n if (location.rooms.length) {\r\n return {\r\n ...location,\r\n rooms: location.rooms.filter(\r\n room =>\r\n room.isDeleted === false\r\n )\r\n };\r\n } else {\r\n return location;\r\n }\r\n }\r\n );\r\n return { ...floor, locations };\r\n } else {\r\n return {\r\n ...floor,\r\n locations: filteredLocations\r\n };\r\n }\r\n });\r\n return { ...building, floors };\r\n }\r\n\r\n return { ...building, floors: filteredFloors };\r\n }\r\n\r\n return building;\r\n });\r\n }\r\n }\r\n\r\n return {\r\n ...initialFacility,\r\n ...pickBy(facility, (property, key) => property !== null),\r\n buildings\r\n };\r\n};\r\n\r\nexport default function facilitiesReducer(\r\n state: { [key: string]: Ifacility } = initialState.facilities,\r\n action: any\r\n): { [key: string]: Ifacility } {\r\n switch (action.type) {\r\n case types.GET_FACILITIES_SUCCESS: {\r\n const newFacilities = map(action.facilities, facility => {\r\n return cleanFacility(facility);\r\n });\r\n\r\n return {\r\n ...state,\r\n ...keyBy(newFacilities, 'id')\r\n };\r\n }\r\n case types.MERGE_FACILITIES_SUCCESS: {\r\n const newState = state;\r\n action.secondaryIds.map((secondaryId: string) => {\r\n delete newState[secondaryId];\r\n });\r\n return { ...newState };\r\n }\r\n case types.ADD_JOB_FACILITY_SUCCESS: {\r\n // filter new facilities from existing facilities\r\n const newFacilities = (action.facilities as Ifacility[]).filter(\r\n ({ id }) => !state[id]\r\n );\r\n\r\n return {\r\n ...state,\r\n ...keyBy(newFacilities, 'id')\r\n };\r\n }\r\n case types.USER_LOGIN_SUCCESS: {\r\n const newFacilitiesG = map(action.user.facilities, facility => {\r\n const foundFacility = state[facility.id] || initialFacility;\r\n return {\r\n ...foundFacility,\r\n ...cleanFacilityWithoutBuildings(facility)\r\n };\r\n });\r\n return { ...state, ...keyBy(newFacilitiesG, 'id') };\r\n }\r\n case types.USER_MANAGE_SUCCESS: {\r\n let newFacilitiesH: Ifacility[] = [];\r\n\r\n forEach(action.users, (user: Iuser) => {\r\n forEach(user.facilities, facility => {\r\n const foundFacility = state[facility.id] || initialFacility;\r\n newFacilitiesH = [\r\n {\r\n ...foundFacility,\r\n ...cleanFacilityWithoutBuildings(facility)\r\n },\r\n ...newFacilitiesH\r\n ];\r\n });\r\n });\r\n return { ...state, ...keyBy(newFacilitiesH, 'id') };\r\n }\r\n\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n return {\r\n ...state,\r\n ...keyBy(\r\n action.leads\r\n .filter((lead: Ilead) => lead.facility)\r\n .map((lead: Ilead) => {\r\n if (lead.facility) {\r\n const originalFacilityF =\r\n state[lead.facility.id] || initialFacility;\r\n return {\r\n ...originalFacilityF,\r\n ...cleanFacilityWithoutBuildings(\r\n lead.facility\r\n )\r\n };\r\n } else {\r\n // this should never happen since we are filtering out leads that do not have a facility\r\n return initialFacility;\r\n }\r\n }),\r\n 'id'\r\n )\r\n };\r\n }\r\n\r\n case types.FACILITY_UPDATE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.facility.id]: {\r\n ...state[action.facility.id],\r\n ...cleanFacilityWithoutBuildings(action.facility)\r\n }\r\n };\r\n case types.QUOTE_MANAGE_SUCCESS: {\r\n let quoteFacilities: { [key: string]: Ifacility } = {};\r\n forEach(action.payload, (quoteResult: any) => {\r\n if (quoteResult.facility) {\r\n const originalFacilityD =\r\n state[quoteResult.facility.id] || initialFacility;\r\n quoteFacilities = {\r\n ...quoteFacilities,\r\n [quoteResult.facility.id]: {\r\n ...originalFacilityD,\r\n ...cleanFacilityWithoutBuildings(\r\n quoteResult.facility\r\n )\r\n }\r\n };\r\n }\r\n });\r\n return { ...state, ...quoteFacilities };\r\n }\r\n case types.FACILITY_DELETE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload]: {\r\n ...state[action.payload],\r\n isDeleted: true\r\n }\r\n };\r\n case types.LOCATION_MANAGE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.facility.id]: cleanFacility(action.facility)\r\n };\r\n\r\n case types.LOCATION_ADD_SUCCESS: {\r\n const locationObject = action.locationObject as\r\n | Ilocation\r\n | Ibuilding\r\n | Ifloor\r\n | Iroom;\r\n /*\r\n This looks scary, but its fairly straightforward.\r\n We are dealing with a tree data structure something like this:\r\n buildings: [\r\n building1: {\r\n floors: [\r\n floor1: {\r\n locations: [\r\n location1: {\r\n rooms: [\r\n room1: {},\r\n ...\r\n ]\r\n },\r\n ...\r\n ]\r\n },\r\n ...\r\n ]\r\n },\r\n ...\r\n ]\r\n\r\n This structure is the source of truth that sets the inital\r\n content of the visible array.\r\n */\r\n const facilityID = action.facilityID;\r\n const originalFacility = state[facilityID] as Ifacility;\r\n\r\n if ('facilityID' in locationObject && originalFacility.buildings) {\r\n // BUILDING\r\n return {\r\n ...state,\r\n [facilityID]: {\r\n ...originalFacility,\r\n buildings: [\r\n ...originalFacility.buildings,\r\n locationObject\r\n ]\r\n }\r\n };\r\n } else if (\r\n 'buildingID' in locationObject &&\r\n originalFacility.buildings\r\n ) {\r\n // FLOOR\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacility.buildings,\r\n building => {\r\n if (building.id === locationObject.buildingID) {\r\n return {\r\n ...building,\r\n floors: [...building.floors, locationObject]\r\n };\r\n } else {\r\n return building;\r\n }\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityID]: {\r\n ...originalFacility,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n 'floorID' in locationObject &&\r\n originalFacility.buildings\r\n ) {\r\n // LOCATION\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacility.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n if (floor.id === locationObject.floorID) {\r\n return {\r\n ...floor,\r\n locations: [\r\n ...floor.locations,\r\n locationObject\r\n ]\r\n };\r\n } else {\r\n return floor;\r\n }\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityID]: {\r\n ...originalFacility,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n 'locationID' in locationObject &&\r\n originalFacility.buildings\r\n ) {\r\n // ROOM\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacility.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n const updatedLocations = map(\r\n floor.locations,\r\n location => {\r\n if (\r\n location.id ===\r\n locationObject.locationID\r\n ) {\r\n return {\r\n ...location,\r\n rooms: [\r\n ...location.rooms,\r\n locationObject\r\n ]\r\n };\r\n } else {\r\n return location;\r\n }\r\n }\r\n );\r\n return { ...floor, locations: updatedLocations };\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityID]: {\r\n ...originalFacility,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n }\r\n return state;\r\n }\r\n\r\n case types.LOCATION_UPDATE_SUCCESS: {\r\n const facilityIDb = action.facilityID;\r\n const originalFacilityb = state[facilityIDb] as Ifacility;\r\n const locationObjectb = action.locationObject as\r\n | Ilocation\r\n | Ibuilding\r\n | Ifloor\r\n | Iroom;\r\n\r\n if (\r\n action.lType === 'Building' &&\r\n 'facilityID' in locationObjectb &&\r\n originalFacilityb.buildings\r\n ) {\r\n // BUILDING\r\n return {\r\n ...state,\r\n [facilityIDb]: {\r\n ...originalFacilityb,\r\n buildings: map(\r\n originalFacilityb.buildings,\r\n building => {\r\n if (building.id === locationObjectb.id) {\r\n return locationObjectb;\r\n } else {\r\n return building;\r\n }\r\n }\r\n )\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Floor' &&\r\n 'buildingID' in locationObjectb &&\r\n originalFacilityb.buildings\r\n ) {\r\n // FLOOR\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityb.buildings,\r\n building => {\r\n if (building.id === locationObjectb.buildingID) {\r\n return {\r\n ...building,\r\n floors: map(building.floors, floor => {\r\n if (floor.id === locationObjectb.id) {\r\n return locationObjectb;\r\n } else {\r\n return floor;\r\n }\r\n })\r\n };\r\n } else {\r\n return building;\r\n }\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDb]: {\r\n ...originalFacilityb,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Location' &&\r\n 'floorID' in locationObjectb &&\r\n originalFacilityb.buildings\r\n ) {\r\n // LOCATION\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityb.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n if (floor.id === locationObjectb.floorID) {\r\n return {\r\n ...floor,\r\n locations: map(\r\n floor.locations,\r\n location => {\r\n if (\r\n location.id ===\r\n locationObjectb.id\r\n ) {\r\n return locationObjectb;\r\n } else {\r\n return location;\r\n }\r\n }\r\n )\r\n };\r\n } else {\r\n return floor;\r\n }\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDb]: {\r\n ...originalFacilityb,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Room' &&\r\n 'locationID' in locationObjectb &&\r\n originalFacilityb.buildings\r\n ) {\r\n // ROOM\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityb.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n const updatedLocations = map(\r\n floor.locations,\r\n location => {\r\n if (\r\n location.id ===\r\n locationObjectb.locationID\r\n ) {\r\n return {\r\n ...location,\r\n rooms: map(location.rooms, room => {\r\n if (\r\n room.id ===\r\n locationObjectb.id\r\n ) {\r\n return locationObjectb;\r\n } else {\r\n return room;\r\n }\r\n })\r\n };\r\n } else {\r\n return location;\r\n }\r\n }\r\n );\r\n return { ...floor, locations: updatedLocations };\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDb]: {\r\n ...originalFacilityb,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n }\r\n return state;\r\n }\r\n case types.LOCATION_DELETE_SUCCESS: {\r\n const facilityIDc = action.facilityID;\r\n const originalFacilityc = state[facilityIDc] as Ifacility;\r\n const locationObjectC = action.locationObject as\r\n | Ilocation\r\n | Ibuilding\r\n | Ifloor\r\n | Iroom;\r\n\r\n if (\r\n action.lType === 'Building' &&\r\n 'facilityID' in locationObjectC &&\r\n originalFacilityc.buildings\r\n ) {\r\n // BUILDING\r\n return {\r\n ...state,\r\n [facilityIDc]: {\r\n ...originalFacilityc,\r\n buildings: originalFacilityc.buildings.map(building => {\r\n if (building.id === locationObjectC.id) {\r\n return { ...building, isDeleted: true };\r\n }\r\n return building;\r\n })\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Floor' &&\r\n 'buildingID' in locationObjectC &&\r\n originalFacilityc.buildings\r\n ) {\r\n // FLOOR\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityc.buildings,\r\n building => {\r\n if (building.id === locationObjectC.buildingID) {\r\n return {\r\n ...building,\r\n floors: building.floors.map(floor => {\r\n if (floor.id === locationObjectC.id) {\r\n return { ...floor, isDeleted: true };\r\n }\r\n return floor;\r\n })\r\n };\r\n }\r\n return building;\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDc]: {\r\n ...originalFacilityc,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Location' &&\r\n 'floorID' in locationObjectC &&\r\n originalFacilityc.buildings\r\n ) {\r\n // LOCATION\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityc.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n if (floor.id === locationObjectC.floorID) {\r\n return {\r\n ...floor,\r\n locations: floor.locations.map(location => {\r\n if (\r\n location.id === locationObjectC.id\r\n ) {\r\n return {\r\n ...location,\r\n isDeleted: true\r\n };\r\n }\r\n return location;\r\n })\r\n };\r\n }\r\n return floor;\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDc]: {\r\n ...originalFacilityc,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n } else if (\r\n action.lType === 'Room' &&\r\n 'locationID' in locationObjectC &&\r\n originalFacilityc.buildings\r\n ) {\r\n // ROOM\r\n const updatedBuildings: Ibuilding[] = map(\r\n originalFacilityc.buildings,\r\n building => {\r\n const updatedFloors = map(building.floors, floor => {\r\n const updatedLocations = map(\r\n floor.locations,\r\n location => {\r\n if (\r\n location.id ===\r\n locationObjectC.locationID\r\n ) {\r\n return {\r\n ...location,\r\n rooms: location.rooms.map(room => {\r\n if (\r\n room.id ===\r\n locationObjectC.id\r\n ) {\r\n return {\r\n ...room,\r\n isDeleted: true\r\n };\r\n }\r\n return room;\r\n })\r\n };\r\n }\r\n return location;\r\n }\r\n );\r\n return { ...floor, locations: updatedLocations };\r\n });\r\n return { ...building, floors: updatedFloors };\r\n }\r\n );\r\n return {\r\n ...state,\r\n [facilityIDc]: {\r\n ...originalFacilityc,\r\n buildings: updatedBuildings\r\n }\r\n };\r\n }\r\n return state;\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.facilities;\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n// filter and sort the facilities\r\nexport const getFacilitiesByCustomerID = (\r\n state: { [key: string]: Ifacility } | IfacilityWithoutBuildings[],\r\n customerID: string\r\n): IfacilityWithoutBuildings[] => {\r\n const filteredFacilities = filter(state, {\r\n customerID,\r\n isDeleted: false\r\n }) as IfacilityWithoutBuildings[];\r\n return orderBy(filteredFacilities, (facility: IfacilityWithoutBuildings) =>\r\n facility.name.toLowerCase()\r\n );\r\n};\r\n\r\nexport const getFacilities = (state: IinitialState) => state.facilities;\r\nexport const getSelectedFacilityID = (state: IinitialState) =>\r\n state.selectedFacilityID;\r\nconst getFacilitiesFiltersProps = (\r\n state: IinitialState,\r\n props: { name: string }\r\n) => props.name.toLowerCase();\r\n\r\nexport const convertFacillitiesToOptionsWithAllProperties = (\r\n facilities: IfacilityWithoutBuildings[]\r\n): Ioption[] => {\r\n return facilities.map(f => {\r\n const facility = generateFacilityNameWithAddess(f);\r\n return {\r\n ...facility,\r\n label: facility.name,\r\n value: f.id\r\n };\r\n });\r\n};\r\n\r\nexport const convertFacillitiesToOptionsWithCountryID = (\r\n facilities: IfacilityWithoutBuildings[]\r\n): Ioption[] => {\r\n return facilities?.map(f => {\r\n const facility = generateFacilityNameWithAddess(f);\r\n return {\r\n countryID: facility.countryID,\r\n label: facility.name,\r\n value: f.id\r\n };\r\n });\r\n};\r\n\r\nconst generateFacilityNameWithAddess = (\r\n facility: IfacilityWithoutBuildings\r\n) => {\r\n const {\r\n name,\r\n address,\r\n address2,\r\n city,\r\n state: geographical_state,\r\n postalCode,\r\n sapFacilityNumber\r\n } = facility;\r\n let nameWithAddress = `${name} | ${address}${\r\n address2 ? ' ' + address2 : ''\r\n } ${city} ${geographical_state} ${postalCode}`;\r\n if (sapFacilityNumber) {\r\n nameWithAddress = sapFacilityNumber + ' | ' + nameWithAddress;\r\n }\r\n return { ...facility, name: nameWithAddress };\r\n};\r\n\r\nexport const convertFacilityOptions = (\r\n facilities: IfacilityWithoutBuildings[]\r\n) => {\r\n return FormUtil.convertToOptions(\r\n map(facilities, generateFacilityNameWithAddess)\r\n );\r\n};\r\n\r\n// filter facilities and build options with the facility address added\r\nexport const selectFacilityOptionsWithAddress = createSelector(\r\n [getFacilities],\r\n (facilities): Array => {\r\n const filteredFacilities = filter(\r\n facilities,\r\n (facility: IfacilityWithoutBuildings) =>\r\n facility.isDeleted === false\r\n );\r\n const orderedFacilities = orderBy(filteredFacilities, facility =>\r\n facility.name.toLowerCase()\r\n );\r\n\r\n return convertFacilityOptions(orderedFacilities);\r\n }\r\n);\r\n\r\nexport const selectFacilityOptionsFiltered = createSelector(\r\n [getFacilities, getFacilitiesFiltersProps],\r\n (facilities, query): Array => {\r\n const filteredFacilities = filter(\r\n facilities,\r\n (facility: IfacilityWithoutBuildings) =>\r\n facility.name.toLowerCase().includes(query) &&\r\n facility.isDeleted === false\r\n );\r\n const orderedFacilities = orderBy(filteredFacilities, facility =>\r\n facility.name.toLowerCase()\r\n );\r\n\r\n return convertFacilityOptions(orderedFacilities);\r\n }\r\n);\r\n\r\nexport const selectSelectedFacilityWithBuildings = createSelector(\r\n [getFacilities, getSelectedFacilityID],\r\n (facilities, selectedFacilityID): Ifacility => {\r\n const withBuildings = Object.values(facilities).filter(\r\n facility => facility.buildings?.length > 0\r\n );\r\n const selectedFacility = withBuildings.find(\r\n facility => facility.id === selectedFacilityID\r\n );\r\n\r\n return selectedFacility || initialFacility;\r\n }\r\n);\r\n\r\nexport const selectSelectedFacility = createSelector(\r\n [getFacilities, getSelectedFacilityID],\r\n (facilities, selectedFacilityID): IfacilityWithoutBuildings =>\r\n facilities[selectedFacilityID]\r\n);\r\n\r\nexport const selectSelectedFacilityContract = createSelector(\r\n [getFacilities, getSelectedFacilityID],\r\n (facilities, selectedFacilityID): IfacilityContract | undefined => {\r\n console.info({ facilities, selectedFacilityID });\r\n return facilities[selectedFacilityID].contract;\r\n }\r\n);\r\n\r\nexport const selectSelectedFacilityID = createSelector(\r\n [getSelectedFacilityID],\r\n (selectedFacilityID): string => selectedFacilityID\r\n);\r\n\r\nexport const selectFilteredFacilities = (\r\n state: { [key: string]: Ifacility },\r\n tableFilters: ItableFiltersParams\r\n) => {\r\n const filtered = filter(state, item => {\r\n let shouldInclude = true;\r\n if (tableFilters.facilityName && tableFilters.facilityName.length) {\r\n const searchString = tableFilters.facilityName.trim().toLowerCase();\r\n if (item.name.toLowerCase().indexOf(searchString) === -1) {\r\n shouldInclude = false;\r\n }\r\n }\r\n if (item.isDeleted === true) {\r\n shouldInclude = false;\r\n }\r\n\r\n return shouldInclude;\r\n });\r\n return orderBy(filtered, res => res.name, 'asc');\r\n};\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport { ImanageUserReducer, Iuser } from '../models';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport initialState, { initialUser } from './initialState';\r\nimport { keyBy, map, pickBy, forEach, filter } from 'lodash';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\n\r\nimport {\r\n cleanFacilityWithoutBuildings,\r\n convertFacilityOptions\r\n} from './facilitiesReducer';\r\n\r\nexport const cleanUser = (user: any = initialUser): Iuser => {\r\n const cleanedUser = {\r\n ...initialState.user,\r\n ...pickBy(user, (property, key) => property !== null),\r\n brandID: user.brandID || ''\r\n };\r\n const securityFunc = map(cleanedUser.securityFunctions, securityF => {\r\n return securityF.toUpperCase();\r\n });\r\n\r\n const facilities = map(\r\n cleanedUser.facilities,\r\n cleanFacilityWithoutBuildings\r\n );\r\n return {\r\n ...cleanedUser,\r\n securityFunctions: securityFunc,\r\n facilities\r\n };\r\n};\r\n\r\n/*\r\n *********** SELECTORS\r\n */\r\n\r\nconst getSecurityUsers = (state: IinitialState) => state.securityUsersByID;\r\nexport const getUser = (state: IinitialState) => state.user;\r\nexport const getActiveLocalCountry = (state: IinitialState) =>\r\n state.manageUser.activeLocalCountry;\r\n\r\nexport const selectSecurityUsers = createSelector(\r\n [getSecurityUsers],\r\n securityUsersByID => {\r\n return keyBy(filter(securityUsersByID, { isDeleted: false }), 'id');\r\n }\r\n);\r\nexport const selectUser = createSelector([getUser], user => user);\r\nexport const selectUserFacilities = createSelector(\r\n [getUser],\r\n user => user.facilities\r\n);\r\nexport const selectUserFacilitiesOptions = createSelector([getUser], user =>\r\n convertFacilityOptions(user.facilities)\r\n);\r\n\r\n// REFACTOR we could to do something like this but we don't currently have a lookup table for the user's customers and facilities\r\n// export const selectUsers = createSelector([getUsers, getFacilities, getCustomers], (users, facilities, customers)=>{\r\n// const userFacilities = filter(facilities, {})\r\n// return map(users, user =>{\r\n// return {...user, facilities}\r\n// })\r\n// })\r\n\r\n/*\r\n ************ REDUCERS\r\n */\r\n\r\n/*\r\n * stores the user currently being edited\r\n */\r\nconst selectedUserReducer = (state = initialUser, action: any): Iuser => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_USER: {\r\n return action.payload;\r\n }\r\n case types.USER_SAVE_SUCCESS: {\r\n return action.user;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nfunction usersByID(\r\n state: { [key: string]: Iuser } = initialState.manageUser.usersByID,\r\n action: any\r\n): { [key: string]: Iuser } {\r\n switch (action.type) {\r\n case types.USER_MANAGE_SUCCESS: {\r\n const newUsers = map(action.users, user => {\r\n return cleanUser(user);\r\n });\r\n return keyBy(newUsers, 'id');\r\n }\r\n case types.USER_SAVE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.user.id]: {\r\n ...state[action.user.id],\r\n ...cleanUser(action.user)\r\n }\r\n };\r\n case types.USER_UPDATE_POSTAL_CODES_SUCCESS: {\r\n if (action.postalCodes) {\r\n return {\r\n ...state,\r\n [action.id]: {\r\n ...state[action.id],\r\n postalCodes: action.postalCodes\r\n }\r\n };\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.FIND_USERS_OR_CONTACT_BY_EMAIL_SUCCESS: {\r\n if (action.payload) {\r\n let newUsersB: Iuser[] = [];\r\n forEach(action.payload, (item: any) => {\r\n if ('user' in item && item.user) {\r\n newUsersB = [...newUsersB, cleanUser(item.user)];\r\n } else if ('first' in item) {\r\n newUsersB = [...newUsersB, cleanUser(item)];\r\n }\r\n });\r\n return {\r\n ...state,\r\n ...keyBy(newUsersB, 'id')\r\n };\r\n } else {\r\n return state;\r\n }\r\n }\r\n\r\n case types.GET_CONTACTS_BY_FACILITY_SUCCESS: {\r\n if (action.payload) {\r\n let newUsersC: Iuser[] = [];\r\n forEach(action.payload, (item: any) => {\r\n if (item.user) {\r\n newUsersC = [...newUsersC, cleanUser(item.user)];\r\n }\r\n });\r\n return {\r\n ...state,\r\n ...keyBy(newUsersC, 'id')\r\n };\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageUser.usersByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.USER_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction activeLocalCountry(state = '', action: any): string {\r\n switch (action.type) {\r\n case types.UPDATE_USER_LOCAL_COUNTRY:\r\n return action.payload;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst userManage = combineReducers({\r\n usersByID,\r\n selectedUser: selectedUserReducer,\r\n totalPages,\r\n activeLocalCountry,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_USER')\r\n});\r\n\r\nexport default userManage;\r\n","import * as moment from 'moment';\r\nimport * as types from '../actions/actionTypes';\r\n\r\nimport { filter, forEach, keyBy, map, omit, orderBy, pickBy } from 'lodash';\r\nimport {\r\n IWorkOrder,\r\n Ifacility,\r\n Ijob,\r\n IjobWorkOrder,\r\n ImanageJobReducer,\r\n ItableFiltersParams,\r\n Iuser\r\n} from '../models';\r\nimport {\r\n jobStatusEnum,\r\n jobTypesIdEnum,\r\n jobTypesIdEnumInverse,\r\n reportTypeEnum\r\n} from '../models-enums';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport initialState, {\r\n initialJob,\r\n initialJobWorkOrder,\r\n initialWorkOrder\r\n} from './initialState';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { selectWorkOrdersByID } from './manageWorkOrderReducer';\r\n\r\nexport const isMeasurementBasedJob = (job: Ijob) => {\r\n if (\r\n job.jobTypeID === jobTypesIdEnum.Inspection ||\r\n job.jobTypeID === jobTypesIdEnum.Audit ||\r\n job.jobTypeID === jobTypesIdEnum.Verification\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n};\r\n\r\nexport const cleanJobWorkOrder = (jobWorkOrder: any): IjobWorkOrder => {\r\n const normalizedJobWorkOrder = omit(jobWorkOrder, 'workOrder');\r\n return {\r\n ...initialJobWorkOrder,\r\n ...pickBy(normalizedJobWorkOrder, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nexport const cleanJobObject = (job: any): Ijob => {\r\n return {\r\n ...initialJob,\r\n ...pickBy(job, (property, key) => property !== null)\r\n };\r\n};\r\n\r\n/*\r\n * MANAGE JOB SELECTORS\r\n */\r\nconst selectJobWorkOrders = (state: IinitialState) =>\r\n state.manageJob.jobWorkOrdersByID;\r\nconst selectJobID = (state: IinitialState, props: { jobID: string }) =>\r\n props.jobID;\r\nconst getFSEUsersByID = (state: IinitialState) => state.manageJob.fseUsersByID;\r\nconst getJobTableFilters = (state: IinitialState) =>\r\n state.manageJob.tableFilters;\r\nconst getOpenJobsForWorkOrdersByID = (state: IinitialState) =>\r\n state.manageJob.openJobsForWorkOrdersByID;\r\nconst getFacilitiesByID = (state: IinitialState) => state.facilities;\r\n\r\nexport const selectJobWorkOrdersWithWorkOrders = createSelector(\r\n [selectJobWorkOrders, selectWorkOrdersByID],\r\n (jobWorkOrdersByID, workOrdersByID) => {\r\n const withWorkOrders = map(jobWorkOrdersByID, jwo => {\r\n return {\r\n ...jwo,\r\n workOrder: workOrdersByID[jwo.workOrderID] || initialWorkOrder\r\n };\r\n });\r\n return keyBy(withWorkOrders, 'id');\r\n }\r\n);\r\n\r\nexport const selectJobWorkOrdersForJobID = createSelector(\r\n [selectJobWorkOrdersWithWorkOrders, selectJobID],\r\n (jobWorkOrdersByID, jobID) => {\r\n return filter(jobWorkOrdersByID, { jobID });\r\n }\r\n);\r\n\r\nexport const selectJobTableFilters = createSelector(\r\n [getJobTableFilters],\r\n jobTableFilters => jobTableFilters\r\n);\r\n\r\nexport const selectWorkOrdersForJobID = createSelector(\r\n [selectJobWorkOrdersWithWorkOrders, selectJobID],\r\n (jobWorkOrdersByID, jobID) => {\r\n const filteredJobWorkOrders = filter(jobWorkOrdersByID, { jobID });\r\n if (filteredJobWorkOrders) {\r\n let workOrders: IWorkOrder[] = [];\r\n forEach(filteredJobWorkOrders, jobWO => {\r\n if (jobWO.isDeleted === false) {\r\n workOrders = [...workOrders, jobWO.workOrder];\r\n }\r\n });\r\n return workOrders;\r\n } else return [];\r\n }\r\n);\r\n\r\nconst getNextJobNumber = (state: IinitialState) =>\r\n state.manageJob.nextJobNumber;\r\nexport const selectJobsByID = (state: IinitialState) =>\r\n state.manageJob.jobsByID;\r\n// const selectJobTableFilters = (state: IinitialState) => state.manageJob.tableFilters\r\nconst selectJobTableFiltersProps = (\r\n state: IinitialState,\r\n props: { filters: ItableFiltersParams }\r\n) => props.filters;\r\nconst selectWOTableJobFiltersProps = (\r\n state: IinitialState,\r\n props: {\r\n filters: {\r\n IDs: string[];\r\n };\r\n }\r\n) => props.filters;\r\n\r\nexport const selectNextJobNumber = createSelector(\r\n [getNextJobNumber],\r\n jobNumber => jobNumber\r\n);\r\n\r\nexport const selectJobTypeForJobID = createSelector(\r\n [selectJobsByID, selectJobID],\r\n (jobsByID, jobID) => {\r\n const job = jobsByID[jobID];\r\n if (job) {\r\n return job.jobTypeID;\r\n } else {\r\n return jobTypesIdEnum.Inspection; // temporarily return inspection type while the jobs are loading\r\n }\r\n }\r\n);\r\n\r\nexport const selectFilteredJobs = createSelector(\r\n [selectJobsByID, selectJobTableFiltersProps],\r\n (jobsByID, filters) => {\r\n return filter(jobsByID, item => {\r\n let shouldInclude = true;\r\n if (filters.jobTypeID && item.jobTypeID !== filters.jobTypeID) {\r\n shouldInclude = false;\r\n }\r\n if (filters.reportType) {\r\n if (\r\n filters.reportType === reportTypeEnum.agsRebalancing &&\r\n item.jobTypeID !== jobTypesIdEnum.agsRebalancing\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.reportType === reportTypeEnum.visit &&\r\n item.jobTypeID !== jobTypesIdEnum.Repair &&\r\n item.jobTypeID !== jobTypesIdEnum.Maintenance &&\r\n item.jobTypeID !== jobTypesIdEnum.warrantyBM &&\r\n item.jobTypeID !== jobTypesIdEnum.servicePlan\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.reportType === reportTypeEnum.audit &&\r\n item.jobTypeID !== jobTypesIdEnum.Audit\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.reportType === reportTypeEnum.verification &&\r\n item.jobTypeID !== jobTypesIdEnum.Verification\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.reportType === reportTypeEnum.commissioning &&\r\n item.jobTypeID !== jobTypesIdEnum.Commissioning\r\n ) {\r\n shouldInclude = false;\r\n }\r\n }\r\n if (filters.facilityID && item.facilityID !== filters.facilityID) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.measurementBasedOnly !== undefined &&\r\n filters.measurementBasedOnly === true &&\r\n isMeasurementBasedJob(item) === false\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n filters.measurementBasedOnly !== undefined &&\r\n filters.measurementBasedOnly === false &&\r\n isMeasurementBasedJob(item) === true\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (filters.open && item.status === jobStatusEnum.completed) {\r\n shouldInclude = false;\r\n }\r\n if (item.isDeleted === true) {\r\n shouldInclude = false;\r\n }\r\n\r\n return shouldInclude;\r\n });\r\n }\r\n);\r\n\r\nexport const selectFilteredFacilitiesForWO = createSelector(\r\n [getFacilitiesByID, selectWOTableJobFiltersProps],\r\n (facilities, filters) => {\r\n // filter facilities by jobIDs\r\n const filteredFacilities = Object.values(facilities).filter(facility =>\r\n filters.IDs.includes(facility.id)\r\n );\r\n const keyedById = keyBy(filteredFacilities, 'id');\r\n\r\n return keyedById;\r\n }\r\n);\r\n\r\nexport const getJobOptionsFromFilters = (\r\n state: IinitialState,\r\n { filters }: { filters: ItableFiltersParams },\r\n t: TFunction\r\n) => {\r\n const filteredJobs = selectFilteredJobs(state, { filters });\r\n const jobsWithName = map(filteredJobs, job => {\r\n const startDate = moment\r\n .utc(job.startDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n const jobType = t(\r\n `nsJob:${\r\n jobTypesIdEnumInverse[\r\n job.jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n }`\r\n );\r\n const name = `${startDate} ${jobType} ${job.jobNumber} (${job.status})`;\r\n\r\n return { ...job, name };\r\n });\r\n\r\n return FormUtil.convertToOptions(\r\n orderBy(jobsWithName, res => moment.utc(res.startDate).unix(), 'desc')\r\n );\r\n};\r\n\r\nexport const prepJobsOpenRepairAndMaintenanceForOptions = (\r\n state: IinitialState,\r\n preFilteredJobs: Ijob[],\r\n t: TFunction\r\n) => {\r\n const facilitiesByJobs: {\r\n [key: string]: Ifacility;\r\n } = selectFilteredFacilitiesForWO(state, {\r\n filters: { IDs: preFilteredJobs.map(({ facilityID }) => facilityID) }\r\n });\r\n const jobsWithName = map(preFilteredJobs, job => {\r\n const startDate = moment\r\n .utc(job.startDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n const facility = () => {\r\n if (job.facilityID) {\r\n const selectedFcility = facilitiesByJobs[job.facilityID];\r\n\r\n if (selectedFcility) {\r\n return `${selectedFcility?.name} - `;\r\n }\r\n\r\n return '';\r\n }\r\n\r\n return '';\r\n };\r\n const number = job.jobNumber ? `${job.jobNumber} - ` : '';\r\n\r\n const name = `[${job.status}] ${facility()}${number}${startDate}`;\r\n\r\n return { ...job, name };\r\n });\r\n\r\n return FormUtil.convertToOptions(\r\n orderBy(jobsWithName, res => moment.utc(res.startDate).unix(), 'desc')\r\n );\r\n};\r\n\r\nexport const selectActiveFseUsersByID = createSelector(\r\n [getFSEUsersByID],\r\n fseUsers => {\r\n const filteredFSE = filter(fseUsers, {\r\n isDeleted: false,\r\n isActive: true\r\n });\r\n return keyBy(filteredFSE, 'id');\r\n }\r\n);\r\n\r\nexport const selectFseUserOptions = createSelector(\r\n [selectActiveFseUsersByID],\r\n activeFSEUsers => {\r\n return FormUtil.convertToOptions(activeFSEUsers);\r\n }\r\n);\r\n\r\nexport const selectOpenJobsForWorkOrders = createSelector(\r\n [getOpenJobsForWorkOrdersByID],\r\n jobs => Object.values(jobs)\r\n);\r\n\r\n// export const fseUserOptions =\r\n\r\n/*\r\n * MANAGE JOB REDUCERS\r\n */\r\n\r\n/*\r\n * stores the job currently being edited\r\n */\r\nconst selectedJobReducer = (state = initialJob, action: any): Ijob => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_JOB: {\r\n return action.payload;\r\n }\r\n case types.JOB_DELETE_SUCCESS: {\r\n if (state.id === action.payload) {\r\n return initialJob;\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.JOB_SAVE_SUCCESS: {\r\n return initialJob;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\nconst jobsOpenRepairAndMaintenanceByIDReducer = (\r\n state: { [key: string]: Ijob } = initialState.manageJob\r\n .openJobsForWorkOrdersByID,\r\n action: any\r\n): { [key: string]: Ijob } => {\r\n switch (action.type) {\r\n case types.JOBS_REPAIR_MAINTENANCE_SUCCESS: {\r\n const cleanJobs = map(action.jobs, (job: any) => {\r\n return { ...state[job.id], ...cleanJobObject(job) };\r\n });\r\n const keyedJobs = keyBy(cleanJobs, 'id');\r\n\r\n return { ...state, ...keyedJobs };\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\nfunction jobsByIDReducer(\r\n state: { [key: string]: Ijob } = initialState.manageJob.jobsByID,\r\n action: any\r\n): { [key: string]: Ijob } {\r\n switch (action.type) {\r\n case types.JOB_MANAGE_SUCCESS: {\r\n const newJobs = map(action.jobs, (job: Ijob) => {\r\n return cleanJobObject(job);\r\n });\r\n return keyBy(newJobs, 'id');\r\n }\r\n case types.JOBS_BY_FACILITY_SUCCESS: {\r\n const cleanJobs = map(action.jobs, (job: any) => {\r\n return { ...state[job.id], ...cleanJobObject(job) };\r\n });\r\n const keyedJobs = keyBy(cleanJobs, 'id');\r\n\r\n return { ...state, ...keyedJobs };\r\n }\r\n case types.JOB_GET_SUCCESS:\r\n case types.JOB_SAVE_SUCCESS:\r\n case types.JOB_UPDATE_SUCCESS:\r\n return { ...state, [action.job.id]: cleanJobObject(action.job) };\r\n case types.JOB_DELETE_SUCCESS:\r\n // TODO switch to FE filtering\r\n // return {...state, [action.payload]: {...state[action.payload], isDeleted: true}}\r\n return omit(state, action.payload);\r\n case types.JOB_UPDATE_WORKORDERS_SUCCESS: {\r\n const udpatedJ = {\r\n ...state[action.payload.jobID],\r\n jobWorkOrders: action.payload.jobWorkOrders\r\n };\r\n return { ...state, [action.payload.jobID]: udpatedJ };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageJob.jobsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n * jobWorkOrders relates jobs to work orders\r\n */\r\nfunction jobWorkOrdersByIDReducer(\r\n state: { [key: string]: IjobWorkOrder } = initialState.manageJob\r\n .jobWorkOrdersByID,\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.LOAD_WORKORDERS_SUCCESS: {\r\n let newJobWorkOrders: IjobWorkOrder[] = [];\r\n forEach(action.payload, (order: IWorkOrder) => {\r\n if (order.jobWorkOrders) {\r\n newJobWorkOrders = [\r\n ...newJobWorkOrders,\r\n ...map(order.jobWorkOrders, cleanJobWorkOrder)\r\n ];\r\n }\r\n });\r\n return { ...state, ...keyBy(newJobWorkOrders, 'id') };\r\n }\r\n case types.JOB_MANAGE_SUCCESS: {\r\n let newJobWorkOrdersB: IjobWorkOrder[] = [];\r\n forEach(action.jobs, (job: Ijob) => {\r\n if (job.jobWorkOrders) {\r\n newJobWorkOrdersB = [\r\n ...newJobWorkOrdersB,\r\n ...map(job.jobWorkOrders, cleanJobWorkOrder)\r\n ];\r\n }\r\n });\r\n return { ...keyBy(newJobWorkOrdersB, 'id') };\r\n }\r\n case types.JOB_UPDATE_WORKORDERS_SUCCESS: {\r\n if (action.payload.jobWorkOrders) {\r\n let updatedJobWorkOrders: IjobWorkOrder[] = [];\r\n forEach(\r\n action.payload.jobWorkOrders,\r\n (jobWO: IjobWorkOrder) => {\r\n updatedJobWorkOrders = [...updatedJobWorkOrders, jobWO];\r\n }\r\n );\r\n return { ...state, ...keyBy(updatedJobWorkOrders, 'id') };\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.UNLINK_WORKORDERS_SUCCESS: {\r\n if (action && action.selection && action.selection.length > 0) {\r\n let currentState = { ...state };\r\n forEach(action.selection, (wo: IWorkOrder) => {\r\n forEach(wo.jobWorkOrders, (jwo: IjobWorkOrder) => {\r\n currentState = omit(currentState, jwo.id);\r\n });\r\n });\r\n\r\n return currentState;\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.USER_LOGOUT_SUCCESS: {\r\n return initialState.manageJob.jobWorkOrdersByID;\r\n }\r\n case types.CLEAR_WORKORDERS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(\r\n state: number = initialState.manageJob.totalPages,\r\n action: any\r\n): number {\r\n switch (action.type) {\r\n case types.JOB_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageJob.totalPages;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction nextJobNumber(\r\n state: string = initialState.manageJob.nextJobNumber,\r\n action: any\r\n): string {\r\n switch (action.type) {\r\n case types.GET_NEXT_JOB_NUMBER_SUCCESS:\r\n return action.payload;\r\n default:\r\n return state;\r\n }\r\n}\r\n// { [key: string]: Iuser }\r\n\r\nfunction fseUsersByID(\r\n state: { [key: string]: Iuser } = initialState.manageJob.fseUsersByID,\r\n action: any\r\n): { [key: string]: Iuser } {\r\n switch (action.type) {\r\n case types.GET_FSE_SUCCESS: {\r\n const keyedFSEUsers = keyBy(action.users, 'id');\r\n return { ...state, ...keyedFSEUsers };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageJob.fseUsersByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst jobManage = combineReducers({\r\n jobsByID: jobsByIDReducer,\r\n openJobsForWorkOrdersByID: jobsOpenRepairAndMaintenanceByIDReducer,\r\n fseUsersByID,\r\n totalPages,\r\n nextJobNumber,\r\n selectedJob: selectedJobReducer,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_JOB'),\r\n jobWorkOrdersByID: jobWorkOrdersByIDReducer\r\n});\r\n\r\nexport default jobManage;\r\n","import {\r\n ItableFiltersReducer,\r\n Iuser,\r\n IproductInfo,\r\n ImeasurementPointResult,\r\n ImeasurementPointResultWithJobType\r\n} from '../models';\r\nimport initialState, { initialTableFilters } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { selectMeasurementPointListResultsByInstallBaseID } from './measurementPointResultsReducer';\r\nimport { selectCompleteWorkOrdersByInstallBaseID } from './manageWorkOrderReducer';\r\nimport { filter, orderBy, forEach, map, keyBy } from 'lodash';\r\nimport moment from 'moment';\r\nimport { measurementPointResultStatusTypesEnum } from '../models-enums';\r\nimport { cleanUser } from './manageUserReducer';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\nimport { selectJobTypeForJobID } from './manageJobReducer';\r\n\r\n/*\r\n * COMMON SELECTORS\r\n */\r\n\r\nconst selectIsOfflineBusy = (state: IinitialState) => state.offline.busy;\r\nconst selectAjaxCallsInProgress = (state: IinitialState) =>\r\n state.ajaxCallsInProgress;\r\nconst selectFacilityContactModal = (state: IinitialState) =>\r\n state.showFacilityContactModal;\r\nconst selectFacilityContractModal = (state: IinitialState) =>\r\n state.showFacilityContractModal;\r\n\r\nexport const selectIsFacilityContactModalOpen = createSelector(\r\n [selectFacilityContactModal],\r\n facilityContactModal => {\r\n return facilityContactModal;\r\n }\r\n);\r\n\r\n// Product Information\r\n\r\nconst selectProductInfo = (state: IinitialState) => state.productInfo;\r\nexport const selectProductInfoSubCategories = createSelector(\r\n selectProductInfo,\r\n (productInfo: IproductInfo) => productInfo?.subcategories\r\n);\r\n\r\nexport const selectIsFacilityContractModalOpen = createSelector(\r\n [selectFacilityContractModal],\r\n facilityContractModal => {\r\n return facilityContractModal;\r\n }\r\n);\r\n\r\nexport const selectIsLoading = createSelector(\r\n [selectIsOfflineBusy, selectAjaxCallsInProgress],\r\n (isOfflineBusy, ajaxCallsInProgress) => {\r\n return isOfflineBusy || ajaxCallsInProgress > 0;\r\n }\r\n);\r\n/*\r\n * prepare the array for the install base history\r\n * gather completed MPLRs and work orders and stuff them into a single array\r\n * do not show touchpoints which are result type repair and maintain\r\n */\r\nexport const selectInstallBaseHistoryByInstallBaseID = (\r\n state: IinitialState,\r\n installBaseID: string\r\n) => {\r\n const installBaseMeasurementPointListResults = selectMeasurementPointListResultsByInstallBaseID(\r\n state.measurementPointResults,\r\n installBaseID\r\n );\r\n const installBaseCompletedWorkOrders = selectCompleteWorkOrdersByInstallBaseID(\r\n state.manageWorkOrder,\r\n installBaseID\r\n );\r\n const resultsWithoutTouchpoints = filter(\r\n installBaseMeasurementPointListResults,\r\n result =>\r\n (result.status ===\r\n measurementPointResultStatusTypesEnum.resultStatusMaintain ||\r\n result.status ===\r\n measurementPointResultStatusTypesEnum.resultStatusRepaired) ===\r\n false\r\n );\r\n\r\n const resultsWithoutTouchpointsWithJobType = resultsWithoutTouchpoints.map(\r\n (\r\n result: ImeasurementPointResult\r\n ): ImeasurementPointResultWithJobType => {\r\n const jobTypeID = selectJobTypeForJobID(state, {\r\n jobID: result.jobID\r\n });\r\n return { ...result, jobTypeID };\r\n }\r\n );\r\n\r\n return orderBy(\r\n [\r\n ...resultsWithoutTouchpointsWithJobType,\r\n ...installBaseCompletedWorkOrders\r\n ],\r\n res => moment.utc(res.updateDate).unix(),\r\n 'desc'\r\n );\r\n};\r\n\r\n/*\r\n * COMMON REDUCER CREATORS\r\n */\r\nexport function createShowModalWithNamedType(modalName = '') {\r\n return function modalToggle(state = false, action: any): boolean {\r\n switch (action.type) {\r\n case `TOGGLE_MODAL_${modalName}`:\r\n if (typeof action.show === 'boolean') {\r\n return action.show;\r\n }\r\n return !state;\r\n case `SHOW_MODAL_${modalName}`:\r\n return true;\r\n case `HIDE_MODAL_${modalName}`:\r\n return false;\r\n case types.CLOSE_ALL_MODALS:\r\n return false;\r\n default:\r\n return state;\r\n }\r\n };\r\n}\r\n\r\nexport function modalToggleWithName(\r\n state = false,\r\n action: any,\r\n modalName: string\r\n): boolean {\r\n switch (action.type) {\r\n case `TOGGLE_MODAL_${modalName}`:\r\n if (typeof action.show === 'boolean') {\r\n return action.show;\r\n }\r\n return !state;\r\n case `SHOW_MODAL_${modalName}`:\r\n return true;\r\n case `HIDE_MODAL_${modalName}`:\r\n return false;\r\n case types.CLOSE_ALL_MODALS:\r\n return false;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport function createTableFiltersWithName(\r\n state: ItableFiltersReducer = initialTableFilters,\r\n action: any,\r\n tableName: string\r\n): ItableFiltersReducer {\r\n switch (action.type) {\r\n case `SET_TABLE_FILTER_${tableName}`:\r\n return { ...state, ...action.filters } as ItableFiltersReducer;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialTableFilters;\r\n case `CLEAR_TABLE_FILTERS_${tableName}`:\r\n return initialTableFilters;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport function createFormValuesWithName(\r\n state: { [key: string]: any } = {},\r\n action: any,\r\n tableName: string\r\n): { [key: string]: any } {\r\n switch (action.type) {\r\n case `SET_FORM_VALUES_${tableName}`:\r\n return { ...action.formValues };\r\n case `UPDATE_FORM_VALUES_${tableName}`:\r\n return { ...state, ...action.formValues };\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport function createSelectedIDWithName(\r\n state = '',\r\n action: any,\r\n name: string\r\n): string {\r\n switch (action.type) {\r\n case `SET_SELECTED_${name}`:\r\n return action.id;\r\n case `CLEAR_SELECTED_${name}`:\r\n return '';\r\n case types.USER_LOGOUT_SUCCESS:\r\n return '';\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n// this works in the reducers/index.tsx file\r\nexport function createSelectedIDWithNameRoot(name: string) {\r\n return (state = '', action: any): string => {\r\n switch (action.type) {\r\n case `GLOBAL_SET_SELECTED_${name}`:\r\n return action.id;\r\n case `GLOBAL_CLEAR_SELECTED_${name}`:\r\n return '';\r\n case types.USER_LOGOUT_SUCCESS:\r\n return '';\r\n default:\r\n return state;\r\n }\r\n };\r\n}\r\n\r\n/*\r\n * COMMON REDUCERS\r\n */\r\n\r\nexport function rawUsersByID(\r\n state: { [key: string]: Iuser } = initialState.rawUsersByID,\r\n action: any\r\n): { [key: string]: Iuser } {\r\n switch (action.type) {\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n let newUsers: { [key: string]: Iuser } = {};\r\n forEach(action.leads, lead => {\r\n if (lead.leadUsers) {\r\n forEach(lead.leadUsers, leadU => {\r\n newUsers = {\r\n ...newUsers,\r\n [leadU.user.id]: cleanUser(leadU.user)\r\n };\r\n if (leadU.user.salesManager) {\r\n newUsers = {\r\n ...newUsers,\r\n [leadU.user.salesManager.id]: cleanUser(\r\n leadU.user.salesManager\r\n )\r\n };\r\n }\r\n });\r\n }\r\n });\r\n return { ...state, ...newUsers };\r\n }\r\n case types.GET_SECURITY_SUCCESS: {\r\n let newUsers: { [key: string]: Iuser } = {};\r\n forEach(action.users, user => {\r\n newUsers = { ...newUsers, [user.id]: cleanUser(user) };\r\n if (user.salesManager) {\r\n newUsers = {\r\n ...newUsers,\r\n [user.salesManager.id]: cleanUser(user.salesManager)\r\n };\r\n }\r\n });\r\n return { ...state, ...newUsers };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n *securityUsersByID\r\n * Users who have a specific set of security functions\r\n * used for sales manager dropdowns\r\n */\r\nexport function securityUsersByID(\r\n state: { [key: string]: Iuser } = initialState.securityUsersByID,\r\n action: any\r\n): { [key: string]: Iuser } {\r\n switch (action.type) {\r\n case types.GET_SECURITY_SUCCESS: {\r\n const newUsers = map(action.users, user => {\r\n return cleanUser(user);\r\n });\r\n return keyBy(newUsers, 'id');\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse, Method } from 'axios';\r\nimport { ThunkResult, IfacilityWithoutBuildings, Ifacility } from '../models';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n convertFacilityOptions,\r\n convertFacillitiesToOptionsWithCountryID\r\n} from '../reducers/facilitiesReducer';\r\nimport { isEmpty } from 'lodash';\r\n\r\nexport interface FacilitiesSearchParams {\r\n name?: string;\r\n address?: string;\r\n postalCode?: string;\r\n}\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\nexport const closeAllModals = () => ({\r\n type: types.CLOSE_ALL_MODALS\r\n});\r\nexport const toggleEditFacilityModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_FACILITY\r\n});\r\nexport const toggleSideMenu = () => ({\r\n type: types.TOGGLE_MODAL_SIDE_MENU\r\n});\r\n\r\nexport function getFacilitiesByCountry(\r\n filterParams: FacilitiesSearchParams\r\n): ThunkResult {\r\n const cleanParams = (obj: FacilitiesSearchParams): FacilitiesSearchParams =>\r\n Object.fromEntries(\r\n Object.entries(obj).filter(\r\n ([_, val]) => val !== null && val !== undefined\r\n )\r\n );\r\n const params = isEmpty(filterParams)\r\n ? undefined\r\n : cleanParams(filterParams);\r\n\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params\r\n };\r\n\r\n const url = API.GET.facility.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse): { hasFacilities: boolean } => {\r\n dispatch(endAjaxCall());\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_FACILITIES_SUCCESS,\r\n facilities: data.data\r\n });\r\n if (data.data.length === 0) {\r\n return { hasFacilities: false };\r\n } else {\r\n return { hasFacilities: true };\r\n }\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch(endAjaxCall());\r\n dispatch({\r\n type: types.GET_FACILITIES_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get facilities search');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function searchFacilityQueueForAsyncSelect(\r\n name: string | undefined,\r\n countryId: string | undefined,\r\n callback: any,\r\n saveFacilities: any\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n let url: string;\r\n let params: any = { name };\r\n\r\n // API is expecting a Guid, don't send an empty string\r\n if (countryId) {\r\n params = { ...params, countryId };\r\n }\r\n\r\n let data: any;\r\n let method: Method = 'get';\r\n\r\n url = API.GET.facility.GetFacilityQueue;\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method,\r\n params,\r\n data\r\n };\r\n\r\n if (!name && name !== undefined) {\r\n return;\r\n }\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n }\r\n saveFacilities(data.data);\r\n callback(convertFacillitiesToOptionsWithCountryID(data.data));\r\n })\r\n .catch((error: any) => {\r\n constants.handleError(error, 'get facilities search');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function searchFacilitiesForAsyncSelect(\r\n name: string | undefined,\r\n countryId: string | null | string[],\r\n quantityOfAssets: number | null,\r\n callback: any,\r\n saveFacilities: any,\r\n page?: number,\r\n callbackWithPagination?: any\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n let url: string;\r\n const params = { name, quantityOfAssets, page: page || 1 };\r\n let data: any;\r\n let method: Method = 'get';\r\n\r\n if (countryId !== null && countryId !== '' && countryId !== undefined) {\r\n data = Array.isArray(countryId) ? countryId : [countryId];\r\n url = API.GET.facility.searchByCountries;\r\n method = 'put';\r\n } else {\r\n url = API.GET.facility.search;\r\n }\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method,\r\n params,\r\n data\r\n };\r\n\r\n if (!name && name !== undefined) {\r\n return;\r\n }\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch(endAjaxCall());\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n }\r\n saveFacilities(data.data.result);\r\n callback(\r\n convertFacillitiesToOptionsWithCountryID(data.data.result)\r\n );\r\n if (\r\n callbackWithPagination &&\r\n typeof callbackWithPagination === 'function'\r\n )\r\n callbackWithPagination(data.data);\r\n })\r\n .catch((error: any) => {\r\n dispatch(endAjaxCall());\r\n constants.handleError(error, 'get facilities search');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getFacility(facilityID: string): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.facility.getbyid}/${facilityID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n return data.data as Ifacility;\r\n }\r\n })\r\n .catch((error: any) => {\r\n constants.handleError(error, 'get facility locations');\r\n console.error(error);\r\n });\r\n}\r\n\r\nexport function addFacility(\r\n facility: IfacilityWithoutBuildings\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const newID = uuidv4();\r\n const contractWithNewFacilityID = facility.contract\r\n ? { ...facility.contract, facilityID: newID }\r\n : null;\r\n const data = {\r\n ...facility,\r\n id: newID,\r\n contract: contractWithNewFacilityID\r\n };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data\r\n };\r\n\r\n const url = API.POST.facility.add;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.FACILITY_UPDATE_SUCCESS,\r\n facility: response.data\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_FACILITY });\r\n toastr.success(\r\n 'Success',\r\n 'Saved Facility',\r\n constants.toastrSuccess\r\n );\r\n // wait for the select options to update then trigger an event that a new facility has been added.\r\n setTimeout(() => {\r\n const event = new CustomEvent('newFacility', {\r\n detail: response.data.id\r\n });\r\n document.dispatchEvent(event);\r\n document.dispatchEvent(\r\n new CustomEvent('updatedCustomers')\r\n );\r\n }, 400);\r\n\r\n return response;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.FACILITY_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'add facility');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function updateFacility(\r\n facility: IfacilityWithoutBuildings\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n // Function to convert empty strings to undefined\r\n const convertEmptyStringsToUndefined = (obj: {\r\n [key: string]: any;\r\n }) => {\r\n for (const key in obj) {\r\n if (obj[key] === '') {\r\n obj[key] = undefined;\r\n } else if (typeof obj[key] === 'object' && obj[key] !== null) {\r\n convertEmptyStringsToUndefined(obj[key]);\r\n }\r\n }\r\n };\r\n\r\n // Convert empty strings to undefined in the facility object\r\n convertEmptyStringsToUndefined(facility);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: facility\r\n };\r\n\r\n const url = API.PUT.updateFacility.replace('{id}', facility.id);\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.FACILITY_UPDATE_SUCCESS,\r\n facility\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_FACILITY });\r\n toastr.success(\r\n 'Success',\r\n 'Updated Facility',\r\n constants.toastrSuccess\r\n );\r\n document.dispatchEvent(new CustomEvent('updatedCustomers'));\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.FACILITY_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update facility');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function deleteFacility(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const { selectedFacilityID } = getState().manageFacility;\r\n const url = API.DELETE.facility.replace('{id}', selectedFacilityID);\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.FACILITY_DELETE_SUCCESS,\r\n payload: selectedFacilityID\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_FACILITY });\r\n toastr.success(\r\n 'Success',\r\n 'Deleted Facility',\r\n constants.toastrSuccess\r\n );\r\n document.dispatchEvent(new CustomEvent('updatedCustomers'));\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.FACILITY_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete facility');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n// TODO rename to global set\r\nexport const setSelectedFacilityID = (id: string) => ({\r\n type: types.GLOBAL_SET_SELECTED_FACILITY_ID,\r\n id\r\n});\r\n\r\nexport function getSAPJobMapping(): ThunkResult {\r\n return (dispatch, getState) => {\r\n // If we already have the data, don't make the call again, this data should pretty much never change\r\n if (\r\n Object.keys(getState().sapJobMappings.sapJobMappingsByID).length > 0\r\n ) {\r\n return Promise.resolve();\r\n }\r\n\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.sapJobMapping.getAll;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.SET_SAP_JOB_MAPPING,\r\n data: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n constants.handleError(error, 'get sap job mapping');\r\n console.error('[getSAPJobMapping]:', error);\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n };\r\n}\r\n","import { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { ItableFiltersParams, IdeficiencyCode, ThunkResult } from '../models';\r\n\r\nexport const getCodes = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const { user } = getState();\r\n\r\n if (\r\n !constants.hasSecurityFunction(\r\n user,\r\n [\r\n constants.securityFunctions.FSE.id,\r\n constants.securityFunctions.ManageCodes.id\r\n ],\r\n { matchAll: true }\r\n )\r\n )\r\n return dispatch({\r\n type: types.LOAD_CODES_SUCCESS,\r\n photos: []\r\n });\r\n\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { page: 1, pagingType: 'None' }\r\n };\r\n\r\n const url = API.code.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_CODES_SUCCESS,\r\n payload: data.data.result\r\n });\r\n // dispatch({\r\n // type: types.CODE_MANAGE_TOTAL_PAGES,\r\n // pages: data.data.pages\r\n // });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.LOAD_CODES_SUCCESS });\r\n constants.handleError(error, 'get codes');\r\n });\r\n };\r\n};\r\n\r\nexport const saveCode = (\r\n code: Partial\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: code\r\n };\r\n\r\n const url = API.code.single + '/add';\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const newCode = data.data;\r\n dispatch({\r\n type: types.ADD_CODE_SUCCESS,\r\n payload: newCode.value\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Created Standard Text`,\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_CODE });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.ADD_CODE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'ADD_CODE_FAILED');\r\n });\r\n};\r\n\r\nexport const updateCode = (\r\n code: Partial\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: code\r\n };\r\n\r\n const url = `${API.code.single}/${code.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.EDIT_CODE_SUCCESS,\r\n payload: data.data.value\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Updated Standard Text`,\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_CODE });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.EDIT_CODE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'EDIT_CODE_FAILED');\r\n })\r\n .finally(() => dispatch(endAjaxCall()));\r\n};\r\n\r\nexport const deleteCode = (\r\n code: IdeficiencyCode\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = `${API.code.single}/${code.id}`;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({ type: types.REMOVE_CODE_SUCCESS, payload: code });\r\n toastr.success(\r\n 'Success',\r\n `Deleted Standard Text`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.REMOVE_CODE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'REMOVE_CODE_FAILED');\r\n });\r\n};\r\n\r\nexport const setSelectedCodeID = (id: string) => ({\r\n type: types.SET_SELECTED_CODE_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedCodeID = () => ({\r\n type: types.CLEAR_SELECTED_CODE_ID\r\n});\r\n\r\nexport const toggleEditCodeModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_CODE\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_CODE,\r\n filters\r\n});\r\n\r\nexport const setCodeFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_CODE,\r\n formValues\r\n});\r\n\r\nexport const updateCodeFormValue = (formValues: { [key: string]: any }) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_CODE,\r\n formValues\r\n});\r\n","/*\r\n * Common Modal displays the modal\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Modal } from 'react-bootstrap';\r\n\r\nexport interface IPropsCommonModal extends React.Props {\r\n show: boolean;\r\n onHide: () => void;\r\n onEntered?: () => void;\r\n className: string;\r\n footer?: JSX.Element;\r\n title: string | JSX.Element;\r\n container?: any;\r\n backdrop?: string | boolean;\r\n wideModal?: boolean;\r\n secondModal?: boolean;\r\n secondWideModal?: boolean; // used when first modal is wide and this is a second modal\r\n}\r\n\r\ninterface State {\r\n classNameAnimation: string;\r\n renderDelayActive: boolean; // improves performance and resolves an issue where a modal crashes on app launch when it is being shown and then immediately hidden\r\n}\r\n\r\nclass CommonModal extends React.Component {\r\n constructor(props: IPropsCommonModal) {\r\n super(props);\r\n this.state = {\r\n classNameAnimation: '',\r\n renderDelayActive: true\r\n };\r\n }\r\n componentDidMount() {\r\n setTimeout(() => {\r\n this.setState({ renderDelayActive: false });\r\n }, 1000);\r\n }\r\n\r\n render() {\r\n if (this.state.renderDelayActive) {\r\n return null;\r\n }\r\n let className = `${this.props.className} ${this.state.classNameAnimation} slide-modal from-left`;\r\n if (this.props.secondModal === true) {\r\n className = `${className} second-modal`;\r\n }\r\n if (this.props.wideModal === true) {\r\n className = `${className} wide-modal`;\r\n }\r\n if (this.props.secondWideModal === true) {\r\n className = `${className} second-wide-modal`;\r\n }\r\n const backdrop = this.props.backdrop ? this.props.backdrop : 'static';\r\n return (\r\n {\r\n this.setState({ classNameAnimation: '' });\r\n }}\r\n onEntering={() => {\r\n this.setState({ classNameAnimation: 'after-open' });\r\n }}\r\n onEntered={() => {\r\n setTimeout(() => {\r\n this.setState({\r\n classNameAnimation: 'after-open after-entered'\r\n });\r\n }, 200);\r\n if (this.props.onEntered) {\r\n this.props.onEntered();\r\n }\r\n }}\r\n container={\r\n this.props.container ||\r\n document.getElementById('two-pane-layout') ||\r\n document.querySelector('.app')\r\n }\r\n backdrop={backdrop}\r\n >\r\n \r\n {this.props.title}\r\n \r\n {this.props.children}\r\n\r\n {this.props.footer}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default CommonModal;\r\n","/*\r\n * Common Modal displays the modal\r\n */\r\n\r\nimport * as React from 'react';\r\nimport CommonModal, { IPropsCommonModal } from './CommonModal';\r\n\r\nexport const WithCommonModal =

(\r\n WrappedComponent: React.ComponentType

\r\n) => {\r\n const commonModalWrap: React.FC

= props => (\r\n \r\n \r\n \r\n );\r\n\r\n return commonModalWrap;\r\n};\r\n// React.Component

\r\n","import { GroupProps, Validators } from 'react-reactive-form';\r\n\r\nimport { omit } from 'lodash';\r\nimport { constants, countryCodeOptions } from '../../constants/constants';\r\nimport { Ioption, Iuser } from '../../models';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\nimport { FormUtil } from './FormUtil';\r\n\r\n// reusable user form elements\r\nexport const userBaseConfigControls = (\r\n defaultValues: IgenericFormValues = {\r\n first: '',\r\n last: '',\r\n email: '',\r\n phone: '',\r\n mobilePhone: '',\r\n currency: '',\r\n mobilePhoneCountryCode: '',\r\n phoneCountryCode: '',\r\n phoneExtension: '',\r\n countryID: constants.countries[constants.defaultCountryID],\r\n position: ''\r\n },\r\n disabled = false,\r\n includeMobilePhone = true\r\n): { [key: string]: GroupProps } => {\r\n // Values are either a string or an Ioption, no idea why, so dumb\r\n if (typeof defaultValues.phoneCountryCode === 'object') {\r\n defaultValues.phoneCountryCode = (defaultValues.phoneCountryCode as Ioption).value;\r\n }\r\n let phoneCountryCode = defaultValues.phoneCountryCode\r\n ? countryCodeOptions.find(\r\n x => x.value === defaultValues.phoneCountryCode\r\n )\r\n : '';\r\n\r\n if (typeof defaultValues.mobilePhoneCountryCode === 'object') {\r\n defaultValues.mobilePhoneCountryCode = (defaultValues.mobilePhoneCountryCode as Ioption).value;\r\n }\r\n const mobilePhoneCountryCode = defaultValues.mobilePhoneCountryCode\r\n ? countryCodeOptions.find(\r\n x => x.value === defaultValues.mobilePhoneCountryCode\r\n )\r\n : '';\r\n\r\n let fields = {\r\n first: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:first',\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'first'\r\n },\r\n formState: { value: defaultValues.first, disabled }\r\n },\r\n last: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:last',\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'last'\r\n },\r\n formState: { value: defaultValues.last, disabled }\r\n },\r\n email: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(\r\n /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/ //eslint-disable-line\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:email',\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'email'\r\n },\r\n formState: { value: defaultValues.email, disabled: true }\r\n },\r\n // divider1: {\r\n // options: {},\r\n // render: FormUtil.Divider\r\n // },\r\n mobilePhoneCountryCode: {\r\n options: {},\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countryCodeOptions,\r\n label: 'user:mobileCountryCode',\r\n colWidth: 6,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'mobileCountryCode'\r\n },\r\n formState: { value: mobilePhoneCountryCode, disabled }\r\n },\r\n mobilePhone: {\r\n options: {\r\n validators: [\r\n Validators.pattern(\r\n /^((\\+\\d{1,3}(-| )?\\(?\\d\\)?(-| )?\\d{1,5})|(\\(?\\d{2,6}\\)?))(-| )?(\\d{3,4})(-| )?(\\d{4})(( x| ext)\\d{1,5}){0,1}$/\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:mobilePhone',\r\n colWidth: 6,\r\n type: 'tel',\r\n placeholder: '***-***-****',\r\n name: 'mobilePhone'\r\n },\r\n formState: { value: defaultValues.mobilePhone, disabled }\r\n },\r\n divider2: {\r\n options: {},\r\n render: FormUtil.Divider\r\n },\r\n phoneCountryCode: {\r\n options: {},\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countryCodeOptions,\r\n label: 'user:countryCode',\r\n colWidth: 6,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'countryCode'\r\n },\r\n formState: { value: phoneCountryCode, disabled }\r\n },\r\n phone: {\r\n options: {\r\n validators: [\r\n Validators.pattern(\r\n /^((\\+\\d{1,3}(-| )?\\(?\\d\\)?(-| )?\\d{1,5})|(\\(?\\d{2,6}\\)?))(-| )?(\\d{3,4})(-| )?(\\d{4})(( x| ext)\\d{1,5}){0,1}$/\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:phone',\r\n colWidth: 6,\r\n type: 'tel',\r\n placeholder: '***-***-****',\r\n name: 'phone'\r\n },\r\n formState: { value: defaultValues.phone, disabled }\r\n },\r\n phoneExtension: {\r\n options: {},\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:extension',\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'phoneExtension'\r\n },\r\n formState: { value: defaultValues.phoneExtension, disabled }\r\n },\r\n divider3: {\r\n options: {},\r\n render: FormUtil.Divider\r\n },\r\n position: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:position',\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'position'\r\n },\r\n formState: { value: defaultValues.position, disabled }\r\n },\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.countries,\r\n label: 'user:country',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: { value: defaultValues.countryID, disabled }\r\n }\r\n };\r\n\r\n if (includeMobilePhone === false) {\r\n fields = omit(fields, ['mobilePhone', 'mobilePhoneCountryCode']) as any;\r\n }\r\n\r\n return fields;\r\n};\r\n","/*\r\n * UserProfile form\r\n * Edit your profile\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Button, Col, FormGroup } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n Observable\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport { debounce, differenceBy, filter, find, forEach } from 'lodash';\r\nimport { IfacilityWithoutBuildings, Ioption, Iuser } from '../../models';\r\nimport { Link } from 'react-router-dom';\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\nimport { getCodes } from '../../actions/manageCodeActions';\r\nimport {\r\n deleteUserAccount,\r\n updateUserProfile\r\n} from '../../actions/userActions';\r\nimport { langOption } from '../../i18n';\r\nimport {\r\n UserCurrency,\r\n UserFlowUnits,\r\n UserPowerUnits,\r\n UserVacuumUnits,\r\n userLanguageEnum,\r\n userPressureUnits,\r\n userTempUnits\r\n} from '../../models-enums';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { userBaseConfigControls } from '../common/UserBaseConfigControls';\r\n\r\ninterface IstateChanges extends Observable {\r\n next: () => void;\r\n}\r\n\r\ninterface AbstractControlEdited extends AbstractControl {\r\n stateChanges: IstateChanges;\r\n}\r\n\r\ninterface Iprops {\r\n updateUserProfile: typeof updateUserProfile;\r\n toggleModal: () => void;\r\n loading: boolean;\r\n colorButton: string;\r\n user: Iuser;\r\n facilityOptions: Ioption[];\r\n standards: Ioption[];\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => void;\r\n deleteUserAccount: typeof deleteUserAccount;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n getCodes: typeof getCodes;\r\n getProductInfo: () => void;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass UserProfileForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig(\r\n this.props.facilityOptions,\r\n this.props.user\r\n )\r\n };\r\n }\r\n\r\n // eslint-disable-next-line react/no-deprecated\r\n componentWillMount() {\r\n // get the most up to date facilities from the API\r\n this.props.getFacilitiesByCountry({});\r\n this.props.getCodes();\r\n }\r\n\r\n componentDidMount() {\r\n // set values\r\n this.patchUserValues();\r\n\r\n if (!this.props.standards?.length) this.props.getProductInfo();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n differenceBy(\r\n prevProps.facilityOptions,\r\n this.props.facilityOptions,\r\n 'value'\r\n ).length ||\r\n prevProps.facilityOptions.length !==\r\n this.props.facilityOptions.length\r\n ) {\r\n const facilitySelectControl = this.formGroup.get(\r\n 'facilities'\r\n ) as AbstractControlEdited;\r\n\r\n facilitySelectControl.meta.options = this.props.facilityOptions;\r\n facilitySelectControl.stateChanges.next();\r\n\r\n const facilitiesArray = filter(\r\n this.props.facilityOptions,\r\n (fac: any) => {\r\n return find(this.props.user.facilities, {\r\n id: fac.value\r\n })\r\n ? true\r\n : false;\r\n }\r\n );\r\n\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig()\r\n });\r\n this.formGroup.patchValue({ facilities: facilitiesArray });\r\n }\r\n\r\n if (this.props.standards?.length !== prevProps.standards?.length) {\r\n const userStandards = this.props.standards.filter(option =>\r\n this.props.user.userStandards.includes(option.value)\r\n );\r\n this.setState(\r\n {\r\n fieldConfig: this.buildFieldConfig(\r\n this.props.facilityOptions,\r\n this.props.user\r\n )\r\n },\r\n () => {\r\n this.patchUserValues();\r\n this.formGroup.patchValue({ userStandards });\r\n }\r\n );\r\n }\r\n }\r\n\r\n patchUserValues = () => {\r\n forEach(this.props.user, (value, key) => {\r\n // Not sure why this form was populated with this patchValue...but these Ioptions will be set inside of buildFieldConfig\r\n if (\r\n key !== 'language' &&\r\n key !== 'tempUnits' &&\r\n key !== 'pressureUnits' &&\r\n key !== 'vacuumUnits' &&\r\n key !== 'powerUnits' &&\r\n key !== 'flowUnits' &&\r\n key !== 'currency' &&\r\n key !== 'userStandards'\r\n ) {\r\n this.formGroup.patchValue({ [key]: value });\r\n }\r\n });\r\n\r\n const { facilities, countryID } = this.props.user;\r\n const emailControl = this.formGroup.get(\r\n 'email'\r\n ) as AbstractControlEdited;\r\n emailControl.disable();\r\n\r\n const facilitiesArray = filter(\r\n this.props.facilityOptions,\r\n (fac: any) => {\r\n return find(facilities, { id: fac.value }) ? true : false;\r\n }\r\n );\r\n this.formGroup.patchValue({ facilities: facilitiesArray });\r\n\r\n if (countryID) {\r\n const selectedCountryOption = constants.countries[countryID];\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'countryID',\r\n selectedCountryOption\r\n );\r\n }\r\n };\r\n\r\n saveFacilities = (facilities: IfacilityWithoutBuildings[]) => {\r\n // console.log(facilities)\r\n };\r\n\r\n loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n this.props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n null,\r\n null,\r\n callback,\r\n this.saveFacilities\r\n );\r\n } else {\r\n callback([]);\r\n }\r\n }, 100);\r\n\r\n buildFieldConfig = (\r\n facilityOptions = this.props.facilityOptions,\r\n user = this.props.user\r\n ) => {\r\n const languageOptions = FormUtil.convertEnumToOptions(userLanguageEnum);\r\n const tempOptions = FormUtil.convertEnumToOptions(userTempUnits);\r\n const pressureOptions = FormUtil.convertEnumToOptions(\r\n userPressureUnits\r\n );\r\n const vacuumOptions = FormUtil.convertEnumToOptions(UserVacuumUnits);\r\n const powerOptions = FormUtil.convertEnumToOptions(UserPowerUnits);\r\n const flowOptions = FormUtil.convertEnumToOptions(UserFlowUnits);\r\n const currencyOptions = FormUtil.convertEnumToOptions(UserCurrency);\r\n\r\n const languageValue =\r\n user.language !== undefined ? user.language.toString() : undefined;\r\n const tempUnits =\r\n user.tempUnits !== undefined\r\n ? user.tempUnits.toString()\r\n : undefined;\r\n const pressureUnits =\r\n user.pressureUnits !== undefined\r\n ? user.pressureUnits.toString()\r\n : undefined;\r\n const vacuumUnits =\r\n user.vacuumUnits !== undefined\r\n ? user.vacuumUnits.toString()\r\n : undefined;\r\n const powerUnits =\r\n user.powerUnits !== undefined\r\n ? user.powerUnits.toString()\r\n : undefined;\r\n const flowUnits =\r\n user.flowUnits !== undefined\r\n ? user.flowUnits.toString()\r\n : undefined;\r\n const currency =\r\n user.currency !== undefined ? user.currency.toString() : undefined;\r\n\r\n const userStandardsValues = this.props.standards.filter(\r\n (value: Ioption) => {\r\n return user.userStandards.includes(value.value);\r\n }\r\n );\r\n\r\n // Values from formValues comes back as either an Ioption (object) or as a string | number (weird right?)\r\n // Even better, languageValue, flowUnits, etc are suppose to be strings, but they are actually numbers, so don't compare with ===\r\n let lang =\r\n typeof languageValue === 'object'\r\n ? languageValue\r\n : languageOptions.find(x => x.value == languageValue);\r\n let flow =\r\n typeof flowUnits === 'object'\r\n ? flowUnits\r\n : flowOptions.find(x => x.value == flowUnits);\r\n let temp =\r\n typeof tempUnits === 'object'\r\n ? tempUnits\r\n : tempOptions.find(x => x.value == tempUnits);\r\n let pressure =\r\n typeof pressureUnits === 'object'\r\n ? pressureUnits\r\n : pressureOptions.find(x => x.value == pressureUnits);\r\n let vacuum =\r\n typeof vacuumUnits === 'object'\r\n ? vacuumUnits\r\n : vacuumOptions.find(x => x.value == vacuumUnits);\r\n let power =\r\n typeof powerUnits === 'object'\r\n ? powerUnits\r\n : powerOptions.find(x => x.value == powerUnits);\r\n let currencyOption =\r\n typeof currency === 'object'\r\n ? currency\r\n : currencyOptions.find(x => x.value == currency);\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.countries,\r\n label: 'user:country',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: {\r\n value: constants.countries[constants.defaultCountryID],\r\n disabled: true\r\n }\r\n },\r\n facilities: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'common:facility',\r\n loadOptions: (searchTerm: string, callback: any) => {\r\n this.loadOptions(searchTerm, callback);\r\n },\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n isMulti: true,\r\n name: 'facilities'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: null, disabled: true }\r\n },\r\n language: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: languageOptions,\r\n label: 'common:language',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n isMulti: false,\r\n name: 'language',\r\n last: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: lang,\r\n disabled: false\r\n }\r\n },\r\n tempUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: tempOptions,\r\n label: 'common:tempatureUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'tempUnits'\r\n },\r\n formState: {\r\n value: temp,\r\n disabled: false\r\n }\r\n },\r\n pressureUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: pressureOptions,\r\n label: 'common:pressureUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'pressureUnits'\r\n },\r\n formState: {\r\n value: pressure,\r\n disabled: false\r\n }\r\n },\r\n vacuumUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: vacuumOptions,\r\n label: 'user:vacuumUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'vacuumUnits'\r\n },\r\n formState: {\r\n value: vacuum,\r\n disabled: false\r\n }\r\n },\r\n powerUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: powerOptions,\r\n label: 'user:powerUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'powerUnits'\r\n },\r\n formState: {\r\n value: power,\r\n disabled: false\r\n }\r\n },\r\n flowUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: flowOptions,\r\n label: 'user:flowUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'flowUnits'\r\n },\r\n formState: {\r\n value: flow,\r\n disabled: false\r\n }\r\n },\r\n currency: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: currencyOptions,\r\n label: 'user:currency',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'currency'\r\n },\r\n formState: {\r\n value: currencyOption,\r\n disabled: false\r\n }\r\n },\r\n userStandards: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.props.standards,\r\n label: 'common:standards',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: true,\r\n name: 'userStandards'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: userStandardsValues,\r\n disabled: false\r\n }\r\n }\r\n };\r\n\r\n const fieldConfig: FieldConfig = {\r\n controls: { ...userBaseConfigControls(), ...fieldConfigControls }\r\n };\r\n\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedJob\r\n */\r\n formValuesToItem = (updatedValue?: { [key: string]: any }): Iuser => {\r\n let formValues = this.formGroup.value;\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n formValues = FormUtil.getValues(formValues);\r\n return {\r\n ...this.props.user,\r\n ...formValues,\r\n widgets: formValues.widgets ? formValues.widgets.join(',') : '' // W/o empty string saves all available widgets to profile\r\n };\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const lang = langOption(this.formGroup.value.language);\r\n\r\n this.props.i18n\r\n .changeLanguage(lang)\r\n .then(() => {\r\n toastr.success(\r\n 'Success',\r\n `Language changed to ${this.formGroup.value.language.label}.`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch(() => {\r\n toastr.error(\r\n 'Error',\r\n `Failed to update language to ${this.formGroup.value.language.label}.`,\r\n constants.toastrError\r\n );\r\n });\r\n this.props.updateUserProfile(this.formValuesToItem());\r\n };\r\n\r\n handleDelete = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.handleDeleteSecondConfirmation();\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('delete account'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.t('userAccountDeleteConfirm'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n\r\n handleDeleteSecondConfirmation = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.deleteUserAccount();\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('common:confirm'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.t('userAccountDeleteSecondConfirm'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form ${this.props.colorButton}`;\r\n\r\n return (\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('user:delete account')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default UserProfileForm;\r\n","import * as types from './actionTypes';\r\nimport * as localForage from 'localforage';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport moment from 'moment';\r\nimport { ItableFiltersParams, ThunkResult } from '../models';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport { dateRangeEnum } from '../models-enums';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nconst toBase64 = (file: File | Blob) =>\r\n new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onload = () => resolve(reader.result);\r\n reader.onerror = error => reject(error);\r\n reader.readAsDataURL(file);\r\n });\r\n\r\n// prettier-ignore\r\nexport const convertDateRangeToInterval = (dateRange: dateRangeEnum): { startDate: string; endDate: string } => {\r\n switch (dateRange) {\r\n case dateRangeEnum.lastYear:\r\n {\r\n return (\r\n {\r\n startDate:\r\n moment.utc(\r\n moment().subtract('year', 1).startOf('year')\r\n ).format(constants.momentSQLFormat),\r\n endDate:\r\n moment.utc(\r\n moment().subtract('year', 1).endOf('year')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )\r\n }\r\n case dateRangeEnum.lastQuarter:\r\n {\r\n return (\r\n {\r\n startDate:\r\n moment.utc(\r\n moment().quarter( // format quarter: number into moment\r\n moment().subtract('quarter', 1).quarter() // subtract one quarter-length from the current quarter\r\n ).startOf('quarter') // Grab the date of the beginning of the quarter\r\n ).format(constants.momentSQLFormat), // format in sql\r\n endDate:\r\n moment.utc(\r\n moment().quarter(\r\n moment().subtract('quarter', 1).quarter()\r\n ).endOf('quarter')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )\r\n }\r\n case dateRangeEnum.thisYear:\r\n {\r\n return (\r\n {\r\n startDate:\r\n moment.utc(moment().startOf('year')).format(constants.momentSQLFormat),\r\n endDate:\r\n moment.utc(moment().endOf('year')).format(constants.momentSQLFormat)\r\n }\r\n )\r\n }\r\n case dateRangeEnum.thisQuarter:\r\n {\r\n return (\r\n {\r\n startDate:\r\n moment.utc(\r\n moment().startOf('quarter')\r\n ).format(constants.momentSQLFormat),\r\n endDate:\r\n moment.utc(\r\n moment().endOf('quarter')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )\r\n }\r\n default:\r\n return { startDate: '', endDate: '' } // It expects this return type\r\n }\r\n};\r\n/*\r\n * this is used for paging and filtering the photos on the manage Aseet Photos view\r\n */\r\nexport function getPhotos(): ThunkResult {\r\n return (dispatch, getState) => {\r\n const { user } = getState();\r\n\r\n if (\r\n !constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.ViewInventory.id\r\n ]) ||\r\n !constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.ViewAssetPhotos.id,\r\n constants.securityFunctions.ManageInventory.id\r\n ])\r\n )\r\n return dispatch({\r\n type: types.ASSET_PHOTOS_MANAGE_SUCCESS,\r\n photos: []\r\n });\r\n\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n assetSearch,\r\n jobSearch,\r\n mainCategory,\r\n dateRange\r\n } = getState().manageAssetPhotos.tableFilters;\r\n const { selectedFacilityID } = getState();\r\n const { startDate, endDate } = convertDateRangeToInterval(\r\n dateRange\r\n ? (dateRange.value as dateRangeEnum)\r\n : dateRangeEnum.thisQuarter\r\n );\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page,\r\n assetSearch,\r\n facilityID: selectedFacilityID,\r\n jobSearch,\r\n mainCategoryID: mainCategory && mainCategory.value,\r\n startDate: startDate ? moment.utc(startDate).toISOString() : '',\r\n endDate: endDate ? moment.utc(endDate).toISOString() : ''\r\n }\r\n };\r\n\r\n const url = API.photo.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.ASSET_PHOTOS_MANAGE_SUCCESS,\r\n photos: resp.data.result\r\n });\r\n dispatch({\r\n type: types.ASSET_PHOTOS_MANAGE_TOTAL_PAGES,\r\n pages: resp.data.pages\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.ASSET_PHOTOS_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get photos');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getPhotosByProduct(productID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n productID\r\n }\r\n };\r\n\r\n const url = API.photo.getByProduct;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.PHOTOS_BY_PRODUCT_SUCCESS,\r\n photos: { [productID]: resp.data.result }\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.ASSET_PHOTOS_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get photos');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function deletePhoto(\r\n photoID: string,\r\n productID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const url = API.photo.deletephoto.replace('{id}', photoID);\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n dispatch({\r\n type: types.DELETE_PHOTO_SUCCESS,\r\n photoID,\r\n productID\r\n });\r\n dispatch(getPhotosByProduct(productID));\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.DELETE_PHOTO_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete photo');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function deleteMultiplePhotos(\r\n photoIDs: string[],\r\n productID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const params = photoIDs.map(id => `photoIDs=${id}`);\r\n const url = `${API.photo.deleteMultiplePhotos}?${params.join('&')}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n dispatch({\r\n type: types.DELETE_PHOTO_SUCCESS,\r\n photos: resp.data,\r\n productID\r\n });\r\n dispatch(getPhotos());\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.DELETE_PHOTO_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete photo');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function uploadProductPhoto(\r\n photoID: string,\r\n objectUrl: string,\r\n productID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n return localForage.getItem(photoID).then(item => {\r\n if (item instanceof File || item instanceof Blob) {\r\n toBase64(item).then(base64Photo => {\r\n const photoPayload = {\r\n createDate: moment.now(),\r\n id: photoID,\r\n productID,\r\n lightboxUrl: objectUrl,\r\n originalUrl: objectUrl,\r\n thumbnailUrl: objectUrl\r\n };\r\n const file = (base64Photo as string).split(',')[1];\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n id: photoID,\r\n file,\r\n productID\r\n }\r\n };\r\n const url = API.POST.photo.add;\r\n\r\n dispatch({\r\n type: types.UPLOAD_PRODUCT_PHOTO_SUCCESS,\r\n photo: photoPayload,\r\n productID\r\n });\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.UPLOAD_PRODUCT_PHOTO_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get photos');\r\n console.error(error);\r\n });\r\n });\r\n } else {\r\n console.error('not a file or blob');\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_ASSET_PHOTOS,\r\n filters\r\n});\r\n","import * as React from 'react';\r\nimport * as types from './actionTypes';\r\n\r\nimport { AxiosError, AxiosRequestConfig, AxiosResponse, Method } from 'axios';\r\nimport {\r\n IinstallBase,\r\n Ijob,\r\n Ioption,\r\n Iphoto,\r\n Iproduct,\r\n IproductLink,\r\n IsearchNewProductInstallBatchMode,\r\n ItableFiltersParams,\r\n ThunkResult\r\n} from '../models';\r\nimport { filter, map, values } from 'lodash';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport {\r\n deleteMultiplePhotos,\r\n uploadProductPhoto\r\n} from './manageAssetPhotosActions';\r\nimport { ProductAttributes } from '../modelsForms';\r\nimport { constants } from '../constants/constants';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { beaconContactTypeEnum } from '../models-enums';\r\nimport { IinitialState } from '../reducers';\r\nimport { replaceEmptyStringsWithNull } from '../helpers/cleanObjEmptyStrings';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\n// TODO move this to the common actions file\r\nexport function getProductInfo(): ThunkResult {\r\n return (dispatch, getState) => {\r\n const { user } = getState();\r\n\r\n if (\r\n !constants.hasSecurityFunction(\r\n user,\r\n [constants.securityFunctions.ViewInventory.id],\r\n { matchAll: true }\r\n )\r\n )\r\n return dispatch({\r\n type: types.GET_PRODUCT_INFO_SUCCESS,\r\n data: {}\r\n });\r\n\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.inventory.getproductinfo;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_PRODUCT_INFO_SUCCESS,\r\n data: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_PRODUCT_INFO_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get product info');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getProducts(\r\n page: number,\r\n search: string,\r\n isFinalProduct: boolean,\r\n attributes: ProductAttributes,\r\n standards: string[],\r\n isApproved?: boolean\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n let params: {\r\n search: string;\r\n mainCategoryID?: string | null;\r\n subcategoryID?: string | null;\r\n brandID?: string | null;\r\n origin?: string;\r\n powerID?: string | null;\r\n productTypeID?: string | null;\r\n systemSizeID?: string | null;\r\n StandardID?: string;\r\n isApproved?: boolean;\r\n isFinalProduct?: boolean;\r\n standards: string[];\r\n } = {\r\n search,\r\n isFinalProduct,\r\n ...attributes,\r\n standards\r\n };\r\n if (isApproved === true) {\r\n // we only want to filter out unaproved products when merging\r\n // and we never want to filter out approved products here.\r\n params = { ...params, isApproved };\r\n }\r\n\r\n const cleanedData = replaceEmptyStringsWithNull(params);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: cleanedData\r\n };\r\n\r\n const url = API.GET.inventory.products;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_PRODUCTS_SUCCESS,\r\n products: data.data.result\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_PRODUCTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get products');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * get inventory with the result status and measurement point results\r\n */\r\n\r\nconst getInventoryHelper = (\r\n facilityID: string,\r\n pagingDataCallback: any,\r\n dispatch: any,\r\n getState: () => IinitialState,\r\n page?: number\r\n) => {\r\n const { user } = getState();\r\n const { ViewInventory } = constants.securityFunctions;\r\n\r\n if (!constants.hasSecurityFunction(user, [ViewInventory.id]))\r\n return dispatch({\r\n type: types.GET_CONTACTS_BY_FACILITY_SUCCESS,\r\n payload: []\r\n });\r\n\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n facilityID:\r\n facilityID && facilityID !== ''\r\n ? facilityID\r\n : selectedFacilityID\r\n }\r\n };\r\n\r\n const url = page\r\n ? `${API.GET.inventory.getByFacility}?page=${page}`\r\n : API.GET.inventory.getByFacility;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n // Send the paging data back to the manageInventory component, everyone else will be ignoring this\r\n pagingDataCallback(data.data.count, data.data.pages);\r\n dispatch({\r\n type: types.GET_INVENTORY_SUCCESS,\r\n inventory: data.data.result\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.GET_INVENTORY_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'get inventory');\r\n console.error(error);\r\n })\r\n .finally(() => dispatch(endAjaxCall()));\r\n};\r\nexport function initInventory(\r\n facilityID: string,\r\n pagingDataCallback: any,\r\n page?: number\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n return getInventoryHelper(\r\n facilityID,\r\n pagingDataCallback,\r\n dispatch,\r\n getState,\r\n page\r\n );\r\n };\r\n}\r\n\r\n/*\r\n * save or update a product\r\n */\r\nexport function saveProduct(\r\n product: Iproduct,\r\n isEditMode: boolean,\r\n photosToUpload?: Iphoto[],\r\n photoIdsToDelete?: string[],\r\n newProductSelect = false\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n let url = '';\r\n let method: Method = 'post';\r\n if (isEditMode) {\r\n url = API.POST.inventory.updateproduct;\r\n method = 'post';\r\n } else {\r\n url = API.POST.inventory.addproduct;\r\n method = 'post';\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n let { installBases, ...productForAPI } = product;\r\n if (product.links) {\r\n const productLinks = product.links.map(\r\n (productLink: IproductLink) => {\r\n return { ...productLink, productID: product.id };\r\n }\r\n );\r\n productForAPI = { ...product, links: productLinks };\r\n }\r\n\r\n let cleanedProduct: any = productForAPI;\r\n cleanedProduct.mergedProductID =\r\n productForAPI.mergedProductID === ''\r\n ? null\r\n : productForAPI.mergedProductID;\r\n cleanedProduct.powerID =\r\n productForAPI.powerID === '' ? null : productForAPI.powerID;\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method,\r\n data: cleanedProduct\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.PRODUCT_ADD_SUCCESS,\r\n product: data.data\r\n });\r\n\r\n if (photosToUpload && photosToUpload.length) {\r\n photosToUpload.forEach(photo => {\r\n dispatch(\r\n uploadProductPhoto(\r\n photo.id,\r\n photo.src,\r\n product.id\r\n )\r\n );\r\n });\r\n }\r\n if (photoIdsToDelete?.length) {\r\n dispatch(\r\n deleteMultiplePhotos(photoIdsToDelete, product.id)\r\n );\r\n }\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_PRODUCT });\r\n\r\n if (newProductSelect) {\r\n dispatch(setSearchNewProductsSelectedProduct(product));\r\n dispatch(toggleEditInstallModal());\r\n }\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_ADD_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'save product');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nconst cleanQuantity = (quantity: any): number => {\r\n // Make sure quantity is a number\r\n if (quantity === undefined || quantity === null || Number.isNaN(quantity)) {\r\n return 1;\r\n }\r\n\r\n if (typeof quantity === 'string') {\r\n return parseInt(quantity);\r\n }\r\n\r\n return quantity;\r\n};\r\n\r\nexport function updateInstall(\r\n install: IinstallBase,\r\n productID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n // Make sure the quantity is a valid number\r\n install.quantity = cleanQuantity(install.quantity);\r\n\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_INSTALL });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: install\r\n };\r\n\r\n const url = API.POST.inventory.updateinstall;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.INSTALL_UPDATE_SUCCESS,\r\n payload: install\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.INSTALL_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update asset');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * save (add) an install (an install might have a quantity greater than 1 so we might be adding multiple installs)\r\n * If this is a new product, then also add the product\r\n */\r\nexport function saveInstall(\r\n install: IinstallBase,\r\n product: Iproduct,\r\n job?: Ijob\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n // if quantity is greater than 1, we are creating multiple installs\r\n const newID = uuidv4();\r\n let newInstalls = {};\r\n\r\n if (install.quantity && install.quantity > 1) {\r\n for (let i = install.quantity - 1; i >= 0; i--) {\r\n const newIDb = uuidv4();\r\n newInstalls = {\r\n ...newInstalls,\r\n [newIDb]: { ...install, id: newIDb, quantity: 1 }\r\n };\r\n }\r\n } else {\r\n newInstalls = { [newID]: { ...install, id: newID } };\r\n }\r\n\r\n const cleanedInstalls = map(newInstalls, (newInstall: any) => {\r\n newInstall.lastFiveYearMaintenanceDate =\r\n newInstall.lastFiveYearMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastFiveYearMaintenanceDate;\r\n newInstall.lastThreeYearMaintenanceDate =\r\n newInstall.lastThreeYearMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastThreeYearMaintenanceDate;\r\n newInstall.lastTwoYearMaintenanceDate =\r\n newInstall.lastTwoYearMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastTwoYearMaintenanceDate;\r\n newInstall.lastYearlyMaintenanceDate =\r\n newInstall.lastYearlyMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastYearlyMaintenanceDate;\r\n newInstall.lastSixMonthMaintenanceDate =\r\n newInstall.lastSixMonthMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastSixMonthMaintenanceDate;\r\n newInstall.lastQuarterlyMaintenanceDate =\r\n newInstall.lastQuarterlyMaintenanceDate === ''\r\n ? null\r\n : newInstall.lastQuarterlyMaintenanceDate;\r\n\r\n newInstall.latestAGSMeasurementPointListResultID =\r\n newInstall.latestAGSMeasurementPointListResultID === ''\r\n ? null\r\n : newInstall.latestAGSMeasurementPointListResultID;\r\n newInstall.latestAuditMeasurementPointListResultID =\r\n newInstall.latestAuditMeasurementPointListResultID === ''\r\n ? null\r\n : newInstall.latestAuditMeasurementPointListResultID;\r\n newInstall.latestCommissioningMeasurementPointListResultID =\r\n newInstall.latestCommissioningMeasurementPointListResultID ===\r\n ''\r\n ? null\r\n : newInstall.latestCommissioningMeasurementPointListResultID;\r\n newInstall.latestMeasurementPointListResultID =\r\n newInstall.latestMeasurementPointListResultID === ''\r\n ? null\r\n : newInstall.latestMeasurementPointListResultID;\r\n newInstall.latestVerificationMeasurementPointListResultID =\r\n newInstall.latestVerificationMeasurementPointListResultID === ''\r\n ? null\r\n : newInstall.latestVerificationMeasurementPointListResultID;\r\n\r\n newInstall.latestWorkOrderID =\r\n newInstall.latestWorkOrderID === ''\r\n ? null\r\n : newInstall.latestWorkOrderID;\r\n\r\n newInstall.installDate =\r\n newInstall.installDate === '' ? null : newInstall.installDate;\r\n\r\n // Make sure quantity is a number\r\n if (\r\n newInstall.quantity === undefined ||\r\n newInstall.quantity === null ||\r\n Number.isNaN(newInstall.quantity)\r\n ) {\r\n newInstall.quantity = 1;\r\n }\r\n\r\n if (typeof newInstall.quantity === 'string') {\r\n newInstall.quantity = parseInt(newInstall.quantity);\r\n }\r\n\r\n return newInstall;\r\n });\r\n\r\n const payload = { InstallBases: values(cleanedInstalls) };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: payload\r\n };\r\n\r\n const url = API.POST.inventory.addinstall;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.INSTALL_ADD_SUCCESS,\r\n installs: values(newInstalls),\r\n product\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Saved asset',\r\n constants.toastrSuccess\r\n );\r\n // get updated inventory\r\n getInventoryHelper(\r\n '',\r\n () => {\r\n return;\r\n },\r\n dispatch,\r\n getState\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.INSTALL_ADD_FAILED, error });\r\n constants.handleError(error, 'save install');\r\n console.error(error);\r\n });\r\n };\r\n}\r\nexport function deleteInstall(installBaseID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n const originalInstallBase = getState().manageInventory.installBasesByID[\r\n installBaseID\r\n ];\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n const axiosOptions = {\r\n url: API.POST.inventory.deleteInstall,\r\n method: 'post',\r\n data: { id: installBaseID }\r\n };\r\n dispatch({\r\n type: types.INSTALL_DELETE_SUCCESS,\r\n payload: { id: installBaseID },\r\n meta: {\r\n offline: {\r\n effect: { axiosOptions, message: 'delete install' },\r\n rollback: {\r\n type: types.INSTALL_UPDATE_SUCCESS,\r\n payload: {\r\n [installBaseID]: {\r\n ...originalInstallBase,\r\n isDeleted: false\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n document.dispatchEvent(new CustomEvent('updatedInstallBases'));\r\n };\r\n}\r\n\r\nexport const moveFacilitiesAPI = async (\r\n newFacilityID: string,\r\n installBaseIDs: string[]\r\n) => {\r\n beginAjaxCall();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n newFacilityID,\r\n installBaseIDs\r\n }\r\n };\r\n const url = API.POST.inventory.moveFacility;\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n endAjaxCall();\r\n\r\n if (!data) {\r\n throw new Error('missing data');\r\n } else {\r\n return true;\r\n }\r\n })\r\n .catch((error: any) => {\r\n console.error(error);\r\n endAjaxCall();\r\n return false;\r\n });\r\n};\r\n\r\nexport function installContact(\r\n installBaseID: string,\r\n facilityID: string,\r\n message: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_INSTALL_CONTACT });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n facilityID,\r\n installBaseID,\r\n message,\r\n beaconContactType: beaconContactTypeEnum.fse\r\n }\r\n };\r\n\r\n const url = API.POST.inventory.installContact;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.INSTALL_CONTACT_SUCCESS\r\n });\r\n toastr.success(\r\n 'Contacted Beacon',\r\n 'We will respond within 24 hours.',\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: AxiosError) => {\r\n dispatch({\r\n type: types.INSTALL_CONTACT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'contact support');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function importInstall(file: any): ThunkResult {\r\n return (dispatch, getState) => {\r\n if (!file) {\r\n toastr.error(\r\n 'Error',\r\n 'Please select a file.',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n const formData = new FormData();\r\n formData.append('file', file);\r\n formData.append('name', 'file');\r\n // formData.append('filename', 'testfilename.xlsx');\r\n formData.append('facilityID', selectedFacilityID);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: formData,\r\n headers: {\r\n 'content-type': 'multipart/form-data'\r\n }\r\n };\r\n\r\n const url = API.POST.inventory.importInstall;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.IMPORT_INSTALL_SUCCESS\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_IMPORT_INSTALL });\r\n getInventoryHelper(\r\n '',\r\n () => {\r\n return;\r\n },\r\n dispatch,\r\n getState\r\n );\r\n const customMessage = (\r\n
\r\n );\r\n if (data.status === 200) {\r\n toastr.success(\r\n 'Upload Successful',\r\n 'If you do not see your assets, please refresh the page after a few moments.',\r\n {\r\n ...constants.toastrSuccess,\r\n component: customMessage,\r\n timeOut: 8000\r\n }\r\n );\r\n // try to re-download inventory ( this does not completely work if they imported a lot)\r\n setTimeout(() => {\r\n getInventoryHelper(\r\n '',\r\n () => {\r\n return;\r\n },\r\n dispatch,\r\n getState\r\n );\r\n }, 10000);\r\n } else {\r\n // status === 206\r\n toastr.warning('Import Errors', '', {\r\n ...constants.toastrSuccess,\r\n component: customMessage,\r\n timeOut: 0\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.IMPORT_INSTALL_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n // constants.handleError(error, 'importing');\r\n toastr.error(\r\n 'Error',\r\n 'Please check your email for details on the failed import.',\r\n constants.toastrError\r\n );\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const requestQuote = ({\r\n message,\r\n facilityID\r\n}: {\r\n message: string;\r\n facilityID: string;\r\n}): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const QuoteItems = map(\r\n getState().manageInventory.cart.productsByID,\r\n (product, key) => {\r\n return { productID: key, quantity: product.quantity };\r\n }\r\n );\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_SHOPPING_CART_INVENTORY });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { QuoteItems, facilityID, message }\r\n };\r\n\r\n const url = API.POST.inventory.quote;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.CHECKOUT_INVENTORY_SUCCESS\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'requested quote',\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.CHECKOUT_INVENTORY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'requesting quote');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\nexport function mergeProduct(\r\n sourceProductID: string,\r\n targetProductID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { sourceProductID, targetProductID }\r\n };\r\n\r\n const url = API.POST.inventory.mergeProduct;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.PRODUCT_MERGE_SUCCESS\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'merged product',\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_MERGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'merge product');\r\n Promise.reject(error);\r\n });\r\n };\r\n}\r\nexport const updateInstallFormValues = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_INVENTORY_INSTALL,\r\n formValues\r\n});\r\nexport const setInstallFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_INVENTORY_INSTALL,\r\n formValues\r\n});\r\nexport const toggleEditProductModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_PRODUCT\r\n});\r\n\r\nexport const toggleEditInstallModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_INSTALL\r\n});\r\nexport const toggleInstallContactModal = () => ({\r\n type: types.TOGGLE_MODAL_INSTALL_CONTACT\r\n});\r\nexport const toggleMPResultModal = () => ({\r\n type: types.TOGGLE_MODAL_MP_RESULT\r\n});\r\n\r\nexport const toggleMPResultHistory = () => ({\r\n type: types.TOGGLE_MODAL_MP_RESULT_HISTORY\r\n});\r\nexport const toggleMPResultNotes = () => ({\r\n type: types.TOGGLE_MODAL_MP_RESULT_NOTES\r\n});\r\nexport const toggleSearchNewProductsModal = () => ({\r\n type: types.TOGGLE_MODAL_SEARCH_NEW_PRODUCTS\r\n});\r\nexport const setInstallBatchMode = (\r\n payload: IsearchNewProductInstallBatchMode\r\n) => ({\r\n type: types.SET_INSTALL_BATCH_MODE,\r\n payload\r\n});\r\nexport const toggleImportInstallModal = () => ({\r\n type: types.TOGGLE_MODAL_IMPORT_INSTALL\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_INVENTORY,\r\n filters\r\n});\r\n\r\nexport const setProductTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_PRODUCT_TABLE_FILTER_MANAGE_INVENTORY,\r\n filters\r\n});\r\n\r\nexport const updateProductSearchFormValues = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH,\r\n formValues\r\n});\r\nexport const setProductSearchFormValues = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_INVENTORY_PRODUCT_SEARCH,\r\n formValues\r\n});\r\n\r\nexport const setSearchNewProductsSelectedProduct = (product?: Iproduct) => ({\r\n type: types.SET_SELECTED_PRODUCT,\r\n product\r\n});\r\nexport const resetNewProducts = () => ({\r\n type: types.NEW_PRODUCTS_RESET\r\n});\r\n\r\nexport const setSelectedProductID = (id: string) => ({\r\n type: types.SET_SELECTED_MANAGE_INVENTORY_PRODUCT_ID,\r\n id\r\n});\r\nexport const clearSelectedProductID = () => ({\r\n type: types.CLEAR_SELECTED_MANAGE_INVENTORY_PRODUCT_ID\r\n});\r\nexport const setSelectedInstallBaseID = (id: string) => ({\r\n type: types.SET_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID,\r\n id\r\n});\r\nexport const clearSelectedInstallBaseID = () => ({\r\n type: types.CLEAR_SELECTED_MANAGE_INVENTORY_INSTALL_BASE_ID\r\n});\r\n\r\n/*\r\n * product names are generated by: brand, category, subcategory, type, power, model, standard, brand, SKU\r\n */\r\nexport const createProductName = ({\r\n brandID,\r\n mainCategoryID,\r\n subcategoryID,\r\n productTypeID,\r\n powerID,\r\n systemSizeID,\r\n sku\r\n}: {\r\n brandID: Ioption | undefined;\r\n mainCategoryID: Ioption | undefined;\r\n subcategoryID: Ioption | undefined;\r\n productTypeID: Ioption | undefined;\r\n powerID: Ioption | undefined;\r\n systemSizeID: Ioption | undefined;\r\n sku: string | undefined;\r\n}) => {\r\n const category =\r\n mainCategoryID && mainCategoryID.label !== 'N/A'\r\n ? `${mainCategoryID.label}`\r\n : '';\r\n const subcategory =\r\n subcategoryID && subcategoryID.label !== 'N/A'\r\n ? `: ${subcategoryID.label}`\r\n : '';\r\n const productType =\r\n productTypeID && productTypeID.label !== 'N/A'\r\n ? `: ${productTypeID.label}`\r\n : '';\r\n const power =\r\n powerID && powerID.label !== 'N/A' ? `: ${powerID.label}` : '';\r\n const systemSize =\r\n systemSizeID && systemSizeID.label !== 'N/A'\r\n ? `: ${systemSizeID.label}`\r\n : '';\r\n const skuString = sku && sku.length ? `: ${sku}` : '';\r\n const brand =\r\n brandID && brandID.label !== 'N/A' ? `: ${brandID.label}` : '';\r\n const name = `${category}${subcategory}${productType}${power}${systemSize}${brand}${skuString}`;\r\n if (name.length > 250) {\r\n return name.substr(0, 250);\r\n } else {\r\n return name;\r\n }\r\n};\r\n\r\nexport function bulkUpdateInstallProducts(\r\n targetProduct: Iproduct,\r\n selectedInstallIds: string[]\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n const { installBasesByID } = getState().manageInventory;\r\n const selectedFacilityID = getState().manageFacility.selectedFacilityID;\r\n\r\n const installBasesToUpdate = filter(installBasesByID, install => {\r\n let shouldInclude = true;\r\n if (selectedInstallIds.indexOf(install.id) === -1) {\r\n shouldInclude = false;\r\n }\r\n if (install.isDeleted === true) {\r\n shouldInclude = false;\r\n }\r\n return shouldInclude;\r\n }).map(install => ({\r\n ...install,\r\n productID: targetProduct.id,\r\n lastQuarterlyMaintenanceDate: null,\r\n lastSixMonthMaintenanceDate: null,\r\n lastYearlyMaintenanceDate: null,\r\n lastTwoYearMaintenanceDate: null,\r\n lastThreeYearMaintenanceDate: null,\r\n lastFiveYearMaintenanceDate: null,\r\n latestWorkOrderID: install.latestWorkOrderID || null,\r\n latestMeasurementPointListResultID:\r\n install.latestMeasurementPointListResultID || null\r\n }));\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: installBasesToUpdate\r\n };\r\n\r\n return msalFetch(API.PUT.inventory.updateInstalls, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (data.status === 200) {\r\n toastr.success(\r\n 'Success',\r\n 'Assets have been updated',\r\n constants.toastrSuccess\r\n );\r\n\r\n // Now update the inventory for this facility\r\n getInventoryHelper(\r\n selectedFacilityID,\r\n () => {},\r\n dispatch,\r\n getState,\r\n 1\r\n );\r\n } else {\r\n toastr.error(\r\n 'Error',\r\n 'There was an error updating the assets',\r\n constants.toastrError\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_MERGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'merge product');\r\n Promise.reject(error);\r\n });\r\n };\r\n}\r\n","/*\r\n * EditProfileModal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\nimport { getCodes } from '../../actions/manageCodeActions';\r\nimport {\r\n deleteUserAccount,\r\n toggleEditProfileModal,\r\n updateUserProfile\r\n} from '../../actions/userActions';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport UserProfileForm from './UserProfileForm';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n // get the most up to date facilities from the facilities reducer\r\n const facilities = state.user.facilities.map(facility => {\r\n const foundFacility = state.facilities[facility.id];\r\n\r\n if (!foundFacility) {\r\n console.error('missing facility', facility);\r\n return initialFacility;\r\n } else {\r\n return foundFacility;\r\n }\r\n });\r\n\r\n return {\r\n className: 'profile-edit',\r\n title: ownProps.t('editProfileModalTitle'),\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n facilityOptions: FormUtil.convertToOptions(facilities),\r\n show: state.showEditProfileModal,\r\n standards: state.productInfo.standardOptions\r\n };\r\n};\r\n\r\nexport default withTranslation('user')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleEditProfileModal,\r\n onHide: toggleEditProfileModal,\r\n getFacilitiesByCountry,\r\n updateUserProfile,\r\n deleteUserAccount,\r\n searchFacilitiesForAsyncSelect,\r\n getCodes,\r\n getProductInfo\r\n })(WithCommonModal(UserProfileForm))\r\n);\r\n","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmAdmin = function SvgBmAdmin(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".c{fill:none;}.b{fill:#fff;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-371 -455)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"c\",\n width: 18,\n height: 18,\n transform: \"translate(371 455)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M11.813,2.25H9a2.25,2.25,0,0,0-4.5,0H1.688A1.688,1.688,0,0,0,0,3.938V16.313A1.688,1.688,0,0,0,1.688,18H11.813A1.688,1.688,0,0,0,13.5,16.313V3.938A1.688,1.688,0,0,0,11.813,2.25ZM3.375,14.906a.844.844,0,1,1,.844-.844A.842.842,0,0,1,3.375,14.906Zm0-3.375a.844.844,0,1,1,.844-.844A.842.842,0,0,1,3.375,11.531Zm0-3.375a.844.844,0,1,1,.844-.844A.842.842,0,0,1,3.375,8.156ZM6.75,1.406a.844.844,0,1,1-.844.844A.842.842,0,0,1,6.75,1.406Zm4.5,12.938a.282.282,0,0,1-.281.281H5.906a.282.282,0,0,1-.281-.281v-.562a.282.282,0,0,1,.281-.281h5.063a.282.282,0,0,1,.281.281Zm0-3.375a.282.282,0,0,1-.281.281H5.906a.282.282,0,0,1-.281-.281v-.562a.282.282,0,0,1,.281-.281h5.063a.282.282,0,0,1,.281.281Zm0-3.375a.282.282,0,0,1-.281.281H5.906a.282.282,0,0,1-.281-.281V7.031a.282.282,0,0,1,.281-.281h5.063a.282.282,0,0,1,.281.281Z\",\n transform: \"translate(373 455)\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmAdmin, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Admin.98055d25.svg\";\nexport { ForwardRef as ReactComponent };","/*\r\n * The HeaderMenu only displays if we have an authenticated user.\r\n * It is responsible for displaying the welcome message and the dropdown menu for logged in users\r\n * spinner is from : http://tobiasahlin.com/spinkit/\r\n */\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport * as React from 'react';\r\nimport { Button, ButtonToolbar, Dropdown, MenuItem } from 'react-bootstrap';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\nimport { toggleUserAlertModal } from '../../actions/manageUserAlertActions';\r\nimport { toggleEditProfileModal, userLogout } from '../../actions/userActions';\r\nimport { Iuser } from '../../models';\r\n\r\nimport { isEmpty } from 'lodash';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport { toggleTutorial } from '../../actions/tutorialActions';\r\nimport { constants } from '../../constants/constants';\r\nimport HelpManual from '../../images/icons/BM_HelpManual.svg';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport EditProfileModal from './EditProfileModal';\r\nimport msalInstance from '../auth/MsalInstance';\r\ninterface Iprops extends RouteComponentProps {\r\n user: Iuser;\r\n alertsCount: number;\r\n userLogout: any;\r\n loading: boolean;\r\n toggleTutorial: typeof toggleTutorial;\r\n\r\n toggleEditProfileModal: any;\r\n toggleUserAlertModal: typeof toggleUserAlertModal;\r\n}\r\n\r\ninterface Istate {\r\n menuOpen: boolean;\r\n}\r\n\r\nconst alertImg_Icon = require('../../images/icons/alert_blue.png');\r\nconst alertImg_Animation = require('../../images/icons/alert_animated.gif');\r\nclass Header extends React.Component {\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n menuOpen: false\r\n };\r\n }\r\n handleMenuSelect = (eventKey: any) => {\r\n switch (eventKey) {\r\n case 1:\r\n this.props.toggleEditProfileModal();\r\n break;\r\n case 2:\r\n this.props.userLogout(this.props.t);\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n showTutorial() {\r\n // return false; // jfbloom22 temporarily disabling tutorials for prod deploy\r\n const { tutorial } = constants;\r\n const { pathname } = this.props.location;\r\n const modifiedPathname = pathname.slice(1); // Removes slash\r\n\r\n if (tutorial.hasOwnProperty(modifiedPathname)) {\r\n return true;\r\n } else return false;\r\n }\r\n\r\n isEmailDomainInternal(email: string): boolean {\r\n const internalDomains = [\r\n '@beaconmedaes.com',\r\n '@atlascopco.com',\r\n '@thebigpixel.net',\r\n '@class1.com'\r\n ];\r\n\r\n for (const domain of internalDomains) {\r\n if (email.includes(domain)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n render() {\r\n const { t, user } = this.props;\r\n const isUserFullyLoggedIn =\r\n user?.id.length &&\r\n msalInstance.msalApp?.getAllAccounts().length > 0;\r\n if (!isUserFullyLoggedIn && this.props.loading) {\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 } else if (!isUserFullyLoggedIn && !this.props.loading) {\r\n return null;\r\n }\r\n const menuClass = this.state.menuOpen ? 'menu-open' : '';\r\n return (\r\n \r\n {this.props.loading && (\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n )}\r\n\r\n \r\n \r\n
\r\n {this.showTutorial() && (\r\n {\r\n this.props.toggleTutorial();\r\n }}\r\n >\r\n \r\n \r\n )}\r\n {\r\n window.open(\r\n this.isEmailDomainInternal(\r\n this.props.user.email\r\n )\r\n ? 'https://doc.clickup.com/9012013137/d/h/8cjgu2h-3292/26881703f6fb6c9'\r\n : 'https://doc.clickup.com/9012013137/p/h/8cjgu2h-3932/605e4a1c68aef87',\r\n '_blank'\r\n );\r\n }}\r\n height=\"30\"\r\n />\r\n
\r\n
\r\n {this.props.alertsCount > 0 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {this.props.alertsCount > 0 ? (\r\n \r\n {this.props.alertsCount}\r\n \r\n ) : (\r\n ''\r\n )}\r\n
\r\n {t('welcome')} \r\n {this.props.user.first}\r\n \r\n \r\n \r\n {\r\n this.setState({ menuOpen: isOpen });\r\n }}\r\n id=\"header-dropdown\"\r\n onSelect={this.handleMenuSelect}\r\n >\r\n \r\n \r\n \r\n
\r\n \r\n \r\n {' '}\r\n   {t('profile')}\r\n \r\n \r\n {' '}\r\n   {t('logout')}\r\n \r\n \r\n v: {process.env.REACT_APP_VERSION}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & RouteComponentProps<{}>\r\n) => {\r\n let alertsCount = 0;\r\n\r\n if (isEmpty(state.alertsByID) === false) {\r\n for (const key of Object.keys(state.alertsByID)) {\r\n if (state.alertsByID[key].isActive === true) {\r\n alertsCount++;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n alertsCount\r\n };\r\n};\r\n\r\nexport default withRouter(\r\n withTranslation('common')(\r\n connect(mapStateToProps, {\r\n userLogout,\r\n toggleEditProfileModal,\r\n toggleUserAlertModal,\r\n toggleTutorial\r\n })(Header)\r\n )\r\n);\r\n","import { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\nimport * as types from '../actions/actionTypes';\r\nimport initialState from './initialState';\r\nimport { Iconfig } from '../models';\r\n\r\nexport const getConfig = (state: IinitialState): Iconfig => state.config;\r\n\r\nexport const getIsMobile = createSelector(\r\n [getConfig],\r\n config => config.isMobile\r\n);\r\n\r\nexport default function configReducer(\r\n state: Iconfig = initialState.config,\r\n action: any\r\n): Iconfig {\r\n switch (action.type) {\r\n case types.SET_IS_MOBILE:\r\n return { ...state, isMobile: action.value as boolean };\r\n default:\r\n return state;\r\n }\r\n}\r\n","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmAlerts = function SvgBmAlerts(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 16.698 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(96.16 -195.049)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-81.61,210.279h-.306v-3.667a4.278,4.278,0,0,0-3.056-4.1v-.791a1.222,1.222,0,0,0-1.222-1.222,1.222,1.222,0,0,0-1.222,1.222v.791a4.278,4.278,0,0,0-3.056,4.1v3.667h-.306A1.222,1.222,0,0,0-92,211.5a1.222,1.222,0,0,0,1.222,1.222h9.168a1.222,1.222,0,0,0,1.222-1.222A1.222,1.222,0,0,0-81.61,210.279Z\",\n transform: \"translate(-1.618 -2.119)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-73.079,199.277a9.718,9.718,0,0,0-5.647-4.206.611.611,0,0,0-.752.427.612.612,0,0,0,.427.752,8.5,8.5,0,0,1,4.938,3.679.61.61,0,0,0,.518.285.609.609,0,0,0,.325-.094A.611.611,0,0,0-73.079,199.277Z\",\n transform: \"translate(-6.478 0)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-89.667,195.5a.611.611,0,0,0-.752-.427,9.718,9.718,0,0,0-5.647,4.206.611.611,0,0,0,.191.843.609.609,0,0,0,.325.094.61.61,0,0,0,.518-.285,8.5,8.5,0,0,1,4.938-3.679A.612.612,0,0,0-89.667,195.5Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-91.876,200.774a.61.61,0,0,0,.114.856.6.6,0,0,0,.37.126.609.609,0,0,0,.486-.24,5.909,5.909,0,0,1,3.049-2.087.612.612,0,0,0,.415-.758.612.612,0,0,0-.758-.415A7.122,7.122,0,0,0-91.876,200.774Z\",\n transform: \"translate(-1.617 -1.237)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-80.061,199.429a5.909,5.909,0,0,1,3.049,2.087.609.609,0,0,0,.486.24.6.6,0,0,0,.37-.126.61.61,0,0,0,.114-.856,7.122,7.122,0,0,0-3.676-2.518.613.613,0,0,0-.758.415A.612.612,0,0,0-80.061,199.429Z\",\n transform: \"translate(-6.089 -1.237)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M-83.666,223.334a1.833,1.833,0,0,0,1.834-1.834H-85.5A1.833,1.833,0,0,0-83.666,223.334Z\",\n transform: \"translate(-4.145 -10.284)\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmAlerts, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Alerts.6f6b91c7.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2, _path3;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmBrand = function SvgBmBrand(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 16 16\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M14.8,16.237a3.84,3.84,0,0,0-.891-.069h-.48V17.5h.677c.619,0,1,0,1-.715C15.11,16.541,15.1,16.3,14.8,16.237Z\",\n transform: \"translate(-6.267 -7.543)\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M8,0a8,8,0,1,0,8,8A8,8,0,0,0,8,0ZM9.9,10.693a2.427,2.427,0,0,1-1.781.507H6.2c-.379,0-.6-.123-.6-.533V5.291c0-.384.267-.491.6-.491H7.68a3.8,3.8,0,0,1,1.552.171,1.563,1.563,0,0,1,.827,1.541,1.568,1.568,0,0,1-.427,1.195A1.531,1.531,0,0,1,10.4,9.243,1.989,1.989,0,0,1,9.9,10.693Z\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M14.791,11.906a.907.907,0,0,0-.08-.432c-.112-.171-.261-.155-.437-.155H13.41v1.429h.421C14.589,12.749,14.791,12.69,14.791,11.906Z\",\n transform: \"translate(-6.258 -5.282)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmBrand, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Brand.d05ff31b.svg\";\nexport { ForwardRef as ReactComponent };","var _circle, _path;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmCustomers = function SvgBmCustomers(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 16 16\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 4,\n cy: 4,\n r: 4,\n transform: \"translate(4)\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M10.446,16.184,8.926,19.35a1.029,1.029,0,0,1-1.851,0l-1.52-3.166a.663.663,0,0,0-.84-.32A7.429,7.429,0,0,0,0,22.779H16a7.428,7.428,0,0,0-4.714-6.914.663.663,0,0,0-.841.32Z\",\n transform: \"translate(0 -6.779)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmCustomers, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Customers.d6a310b5.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _rect, _rect2, _rect3, _rect4, _rect5, _rect6;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmDashboard = function SvgBmDashboard(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 6,\n height: 5.292,\n rx: 1\n })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 10.8,\n height: 5.292,\n rx: 1,\n transform: \"translate(7.2)\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 7.8,\n height: 7.692,\n rx: 1,\n transform: \"translate(10.2 6.354)\"\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 9,\n height: 5.292,\n rx: 1,\n transform: \"translate(0 6.354)\"\n })), _rect5 || (_rect5 = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 7.8,\n height: 2.892,\n rx: 1,\n transform: \"translate(10.2 15.108)\"\n })), _rect6 || (_rect6 = /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 9,\n height: 5.292,\n rx: 1,\n transform: \"translate(0 12.708)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmDashboard, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Dashboard.e813a7e7.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmDocuments = function SvgBmDocuments(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 16 16\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-90.5 -141.5)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(90.5 145.914)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M105.948,161.086h-14.9a.551.551,0,0,1-.552-.552V150.052a.551.551,0,0,1,.552-.552h4.966a.549.549,0,0,1,.39.162l2.045,2.045h7.5a.551.551,0,0,1,.552.552v8.276A.551.551,0,0,1,105.948,161.086Z\",\n transform: \"translate(-90.5 -149.5)\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(90.5 143.707)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M105.4,148.259a.551.551,0,0,1-.552-.552v-1.1H91.052a.552.552,0,1,1,0-1.1H105.4a.551.551,0,0,1,.552.552v1.655A.551.551,0,0,1,105.4,148.259Z\",\n transform: \"translate(-90.5 -145.5)\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(90.5 141.5)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M105.4,142.6H91.052a.552.552,0,1,1,0-1.1H105.4a.552.552,0,0,1,0,1.1Z\",\n transform: \"translate(-90.5 -141.5)\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmDocuments, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Documents.2574f398.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmFacility = function SvgBmFacility(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 16.392\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(1 4)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-1 -4)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.142,24.46H.858a.858.858,0,1,0,0,1.716H17.142a.858.858,0,0,0,0-1.716Z\",\n transform: \"translate(0 -9.784)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M13.232,4.734l-5.5-2.49a.648.648,0,0,0-.906.6V4.572L2.27,2.3a.642.642,0,0,0-.93.6V14.376H13.232ZM6.32,12.126H3.752a.642.642,0,1,1,0-1.284H6.32a.642.642,0,0,1,0,1.284Zm0-3.216H3.752a.642.642,0,1,1,0-1.284H6.32a.642.642,0,1,1,0,1.284Zm4.5,3.216H8.252a.642.642,0,1,1,0-1.284H10.82a.642.642,0,0,1,0,1.284Zm0-3.216H8.252a.642.642,0,0,1,0-1.284H10.82a.642.642,0,0,1,0,1.284Z\",\n transform: \"translate(-0.536 -0.876)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M26.088.642A.642.642,0,0,0,25.446,0H22.872a.642.642,0,0,0-.642.642V13.5h3.858Z\",\n transform: \"translate(-8.892)\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmFacility, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Facility.b2c4c0c6.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmHome = function SvgBmHome(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"BM_Home\",\n transform: \"translate(-670 -316)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_528\",\n \"data-name\": \"Path 528\",\n d: \"M-66.306,7.238-74.663,2.1a.645.645,0,0,0-.674,0l-8.357,5.143a.644.644,0,0,0-.211.885.643.643,0,0,0,.885.211l.949-.584V18.071a.642.642,0,0,0,.643.643h12.857a.642.642,0,0,0,.643-.643V7.749l.949.584a.643.643,0,0,0,.336.1.643.643,0,0,0,.548-.306A.644.644,0,0,0-66.306,7.238ZM-76.929,17.429V11.643h3.857v5.786Zm7.714-10.286V17.429h-2.571V11a.642.642,0,0,0-.643-.643h-5.143a.642.642,0,0,0-.643.643v6.429h-2.571V7.143a.614.614,0,0,0-.033-.165L-75,3.4l5.819,3.581A.614.614,0,0,0-69.214,7.143Z\",\n transform: \"translate(754 314)\",\n fill: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_142\",\n \"data-name\": \"Rectangle 142\",\n width: 18,\n height: 18,\n transform: \"translate(670 316)\",\n fill: \"#fff\",\n opacity: 0\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmHome, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Home.1217a504.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmInspectionStatus = function SvgBmInspectionStatus(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"BM_InspectionStatus\",\n transform: \"translate(-670 -264)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_140\",\n \"data-name\": \"Rectangle 140\",\n width: 18,\n height: 18,\n transform: \"translate(670 264)\",\n fill: \"#fff\",\n opacity: 0\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_556\",\n \"data-name\": \"Group 556\",\n transform: \"translate(624 264)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_530\",\n \"data-name\": \"Path 530\",\n d: \"M63.148,16.94,58.6,12.392a7.4,7.4,0,1,0-.937.819l4.607,4.607a.621.621,0,0,0,.878-.878ZM47.241,7.324a6.083,6.083,0,1,1,6.083,6.083A6.089,6.089,0,0,1,47.241,7.324Z\",\n fill: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n id: \"Ellipse_32\",\n \"data-name\": \"Ellipse 32\",\n cx: 1.006,\n cy: 1.006,\n r: 1.006,\n transform: \"translate(52.319 6.319)\",\n fill: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n id: \"Ellipse_33\",\n \"data-name\": \"Ellipse 33\",\n cx: 1.006,\n cy: 1.006,\n r: 1.006,\n transform: \"translate(48.967 6.319)\",\n fill: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n id: \"Ellipse_34\",\n \"data-name\": \"Ellipse 34\",\n cx: 1.006,\n cy: 1.006,\n r: 1.006,\n transform: \"translate(55.67 6.319)\",\n fill: \"#fff\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmInspectionStatus, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_InspectionStatus.a17f3b80.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2, _circle, _path3, _circle2, _path4, _circle3;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmInventory = function SvgBmInventory(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M11.149,6.6a.372.372,0,0,0,.294-.138L16.285,1.38a.414.414,0,0,0,.114-.306.414.414,0,0,0-.114-.312l-.6-.6A.372.372,0,0,0,15.391,0a.426.426,0,0,0-.306.138L11.149,4.284,9.313,2.352a.4.4,0,0,0-.306-.138.354.354,0,0,0-.288.138l-.6.6a.438.438,0,0,0-.12.33.426.426,0,0,0,.114.318l2.742,2.868a.372.372,0,0,0,.294.132Z\",\n transform: \"translate(-3.199)\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M9,15.6a.6.6,0,0,0,.6.6H21A.6.6,0,0,0,21,15H9.6A.6.6,0,0,0,9,15.6Z\",\n transform: \"translate(-3.6 -6)\"\n })), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.2,\n cy: 1.2,\n r: 1.2,\n transform: \"translate(0 8.4)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M21,21H9.6a.6.6,0,0,0,0,1.2H21A.6.6,0,0,0,21,21Z\",\n transform: \"translate(-3.6 -8.4)\"\n })), _circle2 || (_circle2 = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.2,\n cy: 1.2,\n r: 1.2,\n transform: \"translate(0 12)\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M21,27H9.6a.6.6,0,1,0,0,1.2H21A.6.6,0,0,0,21,27Z\",\n transform: \"translate(-3.6 -10.8)\"\n })), _circle3 || (_circle3 = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.2,\n cy: 1.2,\n r: 1.2,\n transform: \"translate(0 15.6)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmInventory, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Inventory.6910be55.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmJobComments = function SvgBmJobComments(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-1)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M7,6.643a.643.643,0,0,0,.643.643h9a.643.643,0,0,0,0-1.286h-9A.643.643,0,0,0,7,6.643Z\",\n transform: \"translate(-2.143 -2.143)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M7,10.643a.643.643,0,0,0,.643.643h9a.643.643,0,0,0,0-1.286h-9A.643.643,0,0,0,7,10.643Z\",\n transform: \"translate(-2.143 -3.571)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M7,14.643a.643.643,0,0,0,.643.643h5.143a.643.643,0,0,0,0-1.286H7.643A.643.643,0,0,0,7,14.643Z\",\n transform: \"translate(-2.143 -5)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M1.643,18a.681.681,0,0,1-.27-.058A.643.643,0,0,1,1,17.357V3.214A3.214,3.214,0,0,1,4.214,0H15.786A3.214,3.214,0,0,1,19,3.214v7.714a3.214,3.214,0,0,1-3.214,3.214h-9.4l-4.32,3.7A.643.643,0,0,1,1.643,18ZM4.214,1.286A1.929,1.929,0,0,0,2.286,3.214V15.962l3.439-2.951a.643.643,0,0,1,.418-.154h9.643a1.929,1.929,0,0,0,1.929-1.929V3.214a1.929,1.929,0,0,0-1.929-1.929Z\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmJobComments, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_JobComments.670558dd.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmJobs = function SvgBmJobs(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,2.4H15.6V.6A.6.6,0,0,0,15,0h-.6a.6.6,0,0,0-.6.6V2.4H4.2V.6A.6.6,0,0,0,3.6,0H3a.6.6,0,0,0-.6.6V2.4H.6A.6.6,0,0,0,0,3v.6a.6.6,0,0,0,.6.6H17.4a.6.6,0,0,0,.6-.6V3A.6.6,0,0,0,17.4,2.4Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,10H.6a.6.6,0,0,0-.6.6V21.4a.6.6,0,0,0,.6.6H17.4a.6.6,0,0,0,.6-.6V10.6A.6.6,0,0,0,17.4,10Zm-4.314,3.48L8.244,18.562a.384.384,0,0,1-.6,0l-2.73-2.868A.426.426,0,0,1,4.8,15.4a.438.438,0,0,1,.114-.312l.6-.6A.354.354,0,0,1,5.8,14.35a.4.4,0,0,1,.306.138L7.944,16.42l3.936-4.146a.426.426,0,0,1,.306-.138.372.372,0,0,1,.288.138l.6.6a.479.479,0,0,1,.012.606Z\",\n transform: \"translate(0 -4)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmJobs, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Jobs.dcdada83.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmLeads = function SvgBmLeads(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".d{fill:none;}.a{fill:#fff;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-411 -576)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"d\",\n width: 18,\n height: 18,\n transform: \"translate(411 576)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(309 485)\"\n }, /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 3.316,\n cy: 3.316,\n r: 3.316,\n transform: \"translate(105.316 93)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M111.474,110.74v-1.83c-.04-.017-.079-.036-.119-.052a.547.547,0,0,0-.7.266l-1.261,2.62a.85.85,0,0,1-1.532,0l-1.261-2.62a.547.547,0,0,0-.7-.266A6.156,6.156,0,0,0,102,114.589h12.634l-2.676-2.675A1.626,1.626,0,0,1,111.474,110.74Z\",\n transform: \"translate(0 -8.326)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M131.371,108.346l-3.138-3.138a.684.684,0,0,0-.5-.207h-3.02a.708.708,0,0,0-.711.711v3.02a.687.687,0,0,0,.207.5l3.138,3.138a.715.715,0,0,0,1.007,0l3.02-3.02a.714.714,0,0,0,0-1.007Zm-4.737-.711a.714.714,0,1,1,.207-.5A.685.685,0,0,1,126.635,107.635Z\",\n transform: \"translate(-11.579 -6.316)\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmLeads, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Leads.c29f925d.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmLocations = function SvgBmLocations(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".c{fill:none;}.a{fill:#fff;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-371 -843)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"c\",\n width: 18,\n height: 18,\n transform: \"translate(371 843)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(246 923)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M138.561-73.5a3.6,3.6,0,0,0-1.854-.5,3.594,3.594,0,0,0-1.854.5,3.741,3.741,0,0,0-1.352,1.353,3.59,3.59,0,0,0-.5,1.854,3.589,3.589,0,0,0,.5,1.854,3.732,3.732,0,0,0,1.352,1.353,3.594,3.594,0,0,0,1.854.5,3.6,3.6,0,0,0,1.854-.5,3.741,3.741,0,0,0,1.352-1.353,3.589,3.589,0,0,0,.5-1.854,3.59,3.59,0,0,0-.5-1.854A3.751,3.751,0,0,0,138.561-73.5Zm.463,2.415-2.751,2.751a.2.2,0,0,1-.164.075.2.2,0,0,1-.164-.075l-1.555-1.555a.2.2,0,0,1-.075-.165.2.2,0,0,1,.075-.164l.329-.344a.235.235,0,0,1,.172-.075.234.234,0,0,1,.172.075l1.047,1.046,2.242-2.242a.239.239,0,0,1,.172-.075.239.239,0,0,1,.172.075l.329.344a.2.2,0,0,1,.075.164A.2.2,0,0,1,139.024-71.085Z\",\n transform: \"translate(-2.293 -2.293)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"b\",\n d: \"M134.414-80A7.415,7.415,0,0,0,127-72.586c0,4.943,5.415,8.914,6.989,10.415a.616.616,0,0,0,.425.171.616.616,0,0,0,.425-.171c1.574-1.5,6.989-5.472,6.989-10.415A7.415,7.415,0,0,0,134.414-80Zm.437,16.159-.437.385-.437-.385c-2.006-1.758-5.741-5.031-5.741-8.745a6.186,6.186,0,0,1,6.179-6.179,6.186,6.186,0,0,1,6.179,6.179C140.593-68.872,136.858-65.6,134.852-63.841Z\",\n transform: \"translate(0)\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmLocations, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Locations.3ab4451d.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmStandardText = function SvgBmStandardText(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3 0.125C1.96447 0.125 1.125 0.964466 1.125 2V15C1.125 16.5878 2.41218 17.875 4 17.875H14H16C16.4832 17.875 16.875 17.4832 16.875 17C16.875 16.5168 16.4832 16.125 16 16.125H14.875V13.875H16C16.4832 13.875 16.875 13.4832 16.875 13V2C16.875 0.964466 16.0355 0.125 15 0.125H3ZM15.125 12.125V2C15.125 1.93096 15.069 1.875 15 1.875H3C2.93096 1.875 2.875 1.93096 2.875 2V12.3534C3.22054 12.2064 3.60077 12.125 4 12.125H14H15.125ZM13.125 13.875H4C3.37868 13.875 2.875 14.3787 2.875 15C2.875 15.6213 3.37868 16.125 4 16.125H13.125V13.875ZM5.5 4.625C5.01675 4.625 4.625 5.01675 4.625 5.5C4.625 5.98325 5.01675 6.375 5.5 6.375H12.5C12.9832 6.375 13.375 5.98325 13.375 5.5C13.375 5.01675 12.9832 4.625 12.5 4.625H5.5ZM5.5 7.625C5.01675 7.625 4.625 8.01675 4.625 8.5C4.625 8.98325 5.01675 9.375 5.5 9.375H9.5C9.98325 9.375 10.375 8.98325 10.375 8.5C10.375 8.01675 9.98325 7.625 9.5 7.625H5.5Z\",\n fill: \"white\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmStandardText, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_StandardText.908a57f5.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmManageTeam = function SvgBmManageTeam(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 20.765\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-2 -0.006)\"\n }, /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.731,\n cy: 1.731,\n r: 1.731,\n transform: \"translate(2 17.31)\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.731,\n cy: 1.731,\n r: 1.731,\n transform: \"translate(9.269 17.31)\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.731,\n cy: 1.731,\n r: 1.731,\n transform: \"translate(16.538 17.31)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M4.192,19.808a.692.692,0,0,0,.692-.692V17.385h5.885v1.731a.692.692,0,1,0,1.385,0V17.385h5.885v1.731a.692.692,0,0,0,1.385,0V16.692A.692.692,0,0,0,18.731,16H4.192a.692.692,0,0,0-.692.692v2.423A.692.692,0,0,0,4.192,19.808Z\",\n transform: \"translate(-0.462 -4.921)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M11.077,7.749a4.15,4.15,0,0,0,5.67-1.516,4.029,4.029,0,0,0,.561-2.077,4.029,4.029,0,0,0-.561-2.077,4.15,4.15,0,0,0-7.186,0A4.029,4.029,0,0,0,9,4.156a4.029,4.029,0,0,0,.561,2.077,4.188,4.188,0,0,0,1.516,1.516Zm-.519-3.51.367-.388a.27.27,0,0,1,.388,0l1.149,1.177,2.513-2.513a.263.263,0,0,1,.194-.083.27.27,0,0,1,.194.083l.367.388a.215.215,0,0,1,.083.18.235.235,0,0,1-.083.187L12.669,6.35a.235.235,0,0,1-.187.083.215.215,0,0,1-.18-.083L10.558,4.606a.215.215,0,0,1-.083-.18A.228.228,0,0,1,10.558,4.239Z\",\n transform: \"translate(-2.154)\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmManageTeam, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_ManageTeam.96937648.svg\";\nexport { ForwardRef as ReactComponent };","var _circle, _circle2, _path;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmManageUsers = function SvgBmManageUsers(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.5,\n cy: 1.5,\n r: 1.5,\n transform: \"translate(3.9 4.5)\"\n })), _circle2 || (_circle2 = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.5,\n cy: 1.5,\n r: 1.5,\n transform: \"translate(11.1 10.5)\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,0H.6A.6.6,0,0,0,0,.6V17.4a.6.6,0,0,0,.6.6H17.4a.6.6,0,0,0,.6-.6V.6A.6.6,0,0,0,17.4,0ZM12.6,14.4a2.4,2.4,0,0,1-2.316-1.8H3.6a.6.6,0,1,1,0-1.2h6.684a2.4,2.4,0,1,1,2.316,3Zm1.8-7.8H7.716a2.4,2.4,0,1,1,0-1.2H14.4a.6.6,0,1,1,0,1.2Z\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmManageUsers, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_ManageUsers.ba2a426e.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmMeasurement = function SvgBmMeasurement(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 17.2 18.397\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".b{fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.2px;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-1.84 -0.9)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"b\",\n width: 6.452,\n height: 17.197,\n transform: \"translate(2.44 1.5)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"b\",\n d: \"M23.886,14.876,20.663,18.7,17.44,14.876V1.5h6.446Z\",\n transform: \"translate(-5.446)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 3.185,\n transform: \"translate(2.797 5.003)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 5.732,\n transform: \"translate(12.351 5.003)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 5.732,\n transform: \"translate(12.351 14.557)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 1.911,\n transform: \"translate(2.797 7.551)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 3.185,\n transform: \"translate(2.797 10.099)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 1.911,\n transform: \"translate(2.797 12.646)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n x2: 3.185,\n transform: \"translate(2.797 15.194)\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n className: \"b\",\n y2: 9.554,\n transform: \"translate(15.217 5.003)\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmMeasurement, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Measurement.6ccb7d1e.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _circle, _circle2, _circle3;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmNewUserQueue = function SvgBmNewUserQueue(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,0H.6A.6.6,0,0,0,0,.6V13.2a.6.6,0,0,0,.6.6H17.4a.6.6,0,0,0,.6-.6V.6A.6.6,0,0,0,17.4,0ZM6.96,4.3a2.334,2.334,0,0,1,.84-.834,2.4,2.4,0,0,1,2.364,0,2.334,2.334,0,0,1,.876.834,2.19,2.19,0,0,1,0,2.292,2.4,2.4,0,0,1-4.08,0A2.19,2.19,0,0,1,6.96,4.3ZM13.2,11.04a.516.516,0,0,1-.528.51H5.328a.516.516,0,0,1-.528-.51v-.762a1.962,1.962,0,0,1,.276-1.026,2.016,2.016,0,0,1,.768-.738A2.118,2.118,0,0,1,6.9,8.238h.9a2.922,2.922,0,0,0,2.4,0h.9a2.118,2.118,0,0,1,1.056.276,2.016,2.016,0,0,1,.768.738,1.962,1.962,0,0,1,.276,1.026Z\"\n })), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.5,\n cy: 1.5,\n r: 1.5,\n transform: \"translate(1.5 15)\"\n })), _circle2 || (_circle2 = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.5,\n cy: 1.5,\n r: 1.5,\n transform: \"translate(7.5 15)\"\n })), _circle3 || (_circle3 = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"a\",\n cx: 1.5,\n cy: 1.5,\n r: 1.5,\n transform: \"translate(13.5 15)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmNewUserQueue, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_NewUserQueue.f612a92a.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmPreventMaint = function SvgBmPreventMaint(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"BM_PreventMaint\",\n transform: \"translate(-670 -291)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_141\",\n \"data-name\": \"Rectangle 141\",\n width: 18,\n height: 18,\n transform: \"translate(670 291)\",\n fill: \"#fff\",\n opacity: 0\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_555\",\n \"data-name\": \"Group 555\",\n transform: \"translate(668.209 288.268)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_529\",\n \"data-name\": \"Path 529\",\n d: \"M13.606,13.253a.6.6,0,0,1,.309.352.576.576,0,0,1-.028.464,6.649,6.649,0,0,1-1.181,1.855.745.745,0,0,1-.408.211.633.633,0,0,1-.435-.07l-.816-.478a5.139,5.139,0,0,1-1.546.9v.955a.637.637,0,0,1-.168.422.61.61,0,0,1-.394.225,5.833,5.833,0,0,1-2.137,0,.578.578,0,0,1-.408-.225.672.672,0,0,1-.154-.422v-.955a4.722,4.722,0,0,1-1.546-.9l-.815.478a.734.734,0,0,1-.464.07.615.615,0,0,1-.38-.211,6.993,6.993,0,0,1-1.18-1.855.568.568,0,0,1-.028-.464.6.6,0,0,1,.309-.352l.928-.478a4.7,4.7,0,0,1,0-1.771l-.928-.478a.726.726,0,0,1-.309-.366.538.538,0,0,1,.028-.45,7,7,0,0,1,1.18-1.856.572.572,0,0,1,.38-.239.642.642,0,0,1,.464.1l.815.45a4.682,4.682,0,0,1,1.546-.871V6.338A.658.658,0,0,1,6.4,5.9a.6.6,0,0,1,.408-.21A6.309,6.309,0,0,1,8.94,5.663a.794.794,0,0,1,.394.239.623.623,0,0,1,.168.436v.956a5.456,5.456,0,0,1,1.546.871l.816-.45a.554.554,0,0,1,.435-.1.681.681,0,0,1,.408.239,6.48,6.48,0,0,1,1.181,1.856.67.67,0,0,1,.013.45.655.655,0,0,1-.295.366L12.651,11a4.7,4.7,0,0,1,0,1.771ZM9.9,11.764a2.035,2.035,0,0,0-.59-1.308,1.985,1.985,0,0,0-1.322-.6,2.252,2.252,0,0,0-1.6.562,2.312,2.312,0,0,0-.535,1.6A1.975,1.975,0,0,0,7.731,13.9a2.4,2.4,0,0,0,1.631-.535A2.3,2.3,0,0,0,9.9,11.764ZM15.968,10.5a.3.3,0,0,1-.183.154.419.419,0,0,1-.239.015,3.1,3.1,0,0,1-.9-.535.3.3,0,0,1-.126-.21.422.422,0,0,1,.042-.239l.226-.394a2.792,2.792,0,0,1-.45-.759h-.449a.357.357,0,0,1-.24-.084.281.281,0,0,1-.1-.225,2.771,2.771,0,0,1-.028-1.04.379.379,0,0,1,.127-.2.356.356,0,0,1,.24-.084h.449a3.276,3.276,0,0,1,.45-.787l-.226-.394a.422.422,0,0,1-.042-.239.3.3,0,0,1,.126-.21,3.508,3.508,0,0,1,.9-.506.323.323,0,0,1,.422.14l.225.422a2.425,2.425,0,0,1,.9,0l.225-.422a.323.323,0,0,1,.422-.14,2.654,2.654,0,0,1,.9.506.3.3,0,0,1,.127.21.422.422,0,0,1-.042.239l-.225.394a3.3,3.3,0,0,1,.45.787h.45a.354.354,0,0,1,.238.084.253.253,0,0,1,.1.2,2.438,2.438,0,0,1,0,1.04.282.282,0,0,1-.1.225.354.354,0,0,1-.238.084h-.45a2.809,2.809,0,0,1-.45.759l.225.394a.422.422,0,0,1,.042.239.3.3,0,0,1-.127.21,3.1,3.1,0,0,1-.9.535.422.422,0,0,1-.24-.015.3.3,0,0,1-.182-.154l-.225-.395a2.4,2.4,0,0,1-.9,0Zm0,8.4a.3.3,0,0,1-.183.155.413.413,0,0,1-.239.014,3.1,3.1,0,0,1-.9-.534.3.3,0,0,1-.126-.211.423.423,0,0,1,.042-.239l.226-.393a2.785,2.785,0,0,1-.45-.76h-.449a.357.357,0,0,1-.24-.084.28.28,0,0,1-.1-.224,2.775,2.775,0,0,1-.028-1.041.38.38,0,0,1,.127-.2.357.357,0,0,1,.24-.084h.449a3.3,3.3,0,0,1,.45-.787l-.226-.393a.425.425,0,0,1-.042-.239.3.3,0,0,1,.126-.211,2.669,2.669,0,0,1,.9-.506.323.323,0,0,1,.422.141l.225.393a2.928,2.928,0,0,1,.9.028l.225-.422a.322.322,0,0,1,.422-.141,2.666,2.666,0,0,1,.9.506.3.3,0,0,1,.127.211.425.425,0,0,1-.042.239l-.225.393a3.326,3.326,0,0,1,.45.787h.45a.354.354,0,0,1,.238.084.253.253,0,0,1,.1.2,2.441,2.441,0,0,1,0,1.041.28.28,0,0,1-.1.224.354.354,0,0,1-.238.084h-.45a2.8,2.8,0,0,1-.45.76l.225.393a.423.423,0,0,1,.042.239.3.3,0,0,1-.127.211,3.1,3.1,0,0,1-.9.534.416.416,0,0,1-.24-.014.3.3,0,0,1-.182-.155l-.225-.393a2.425,2.425,0,0,1-.9,0Zm.97-10.219a.946.946,0,0,0,.675-.674,1.164,1.164,0,0,0-.24-1.054,1.067,1.067,0,0,0-1.026-.225.978.978,0,0,0-.674.689,1.1,1.1,0,0,0,.239,1.026A1.1,1.1,0,0,0,16.938,8.685Zm0,8.392a.982.982,0,0,0,.675-.675,1.142,1.142,0,0,0-.24-1.04,1.065,1.065,0,0,0-1.026-.225.978.978,0,0,0-.674.689,1.1,1.1,0,0,0,.239,1.025A1.067,1.067,0,0,0,16.938,17.077Z\",\n fill: \"#fff\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmPreventMaint, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_PreventMaint.b62b0858.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2, _path3;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmProductQueue = function SvgBmProductQueue(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 16 16\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M20.133,0h-9.6A.533.533,0,0,0,10,.533v9.6a.533.533,0,0,0,.533.533h9.6a.533.533,0,0,0,.533-.533V.533A.533.533,0,0,0,20.133,0ZM18.043,5.867H15.867V8.043a.533.533,0,1,1-1.067,0V5.867H12.624a.533.533,0,1,1,0-1.067H14.8V2.624a.533.533,0,1,1,1.067,0V4.8h2.176a.533.533,0,0,1,0,1.067Z\",\n transform: \"translate(-4.667)\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M8.533,21H1.067V13.533a.533.533,0,1,0-1.067,0v8a.533.533,0,0,0,.533.533h8a.533.533,0,0,0,0-1.067Z\",\n transform: \"translate(0 -6.067)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M14.6,15.067H6.067V6.533A.533.533,0,1,0,5,6.533V15.6a.533.533,0,0,0,.533.533H14.6a.533.533,0,1,0,0-1.067Z\",\n transform: \"translate(-2.333 -2.8)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmProductQueue, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_ProductQueue.a8ede79c.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmQuotes = function SvgBmQuotes(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".ab,.bb{fill:#fff;}.ab{opacity:0.001;}\"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-352 -33)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"ab\",\n width: 18,\n height: 18,\n transform: \"translate(352 33)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(351 33)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"bb\",\n d: \"M17,0H2.6A.6.6,0,0,0,2,.6V17.4a.6.6,0,0,0,.6.6H17a.6.6,0,0,0,.6-.6V.6A.6.6,0,0,0,17,0Zm-.6,1.2v6H3.2v-6ZM3.2,16.8V8.4H16.4v8.4Z\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n className: \"bb\",\n width: 2.4,\n height: 6,\n rx: 1,\n transform: \"translate(12.2 9.6)\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n className: \"bb\",\n width: 2.4,\n height: 2.4,\n rx: 1,\n transform: \"translate(8.6 13.2)\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n className: \"bb\",\n width: 2.4,\n height: 2.4,\n rx: 1,\n transform: \"translate(5 13.2)\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n className: \"bb\",\n width: 2.4,\n height: 2.4,\n rx: 1,\n transform: \"translate(8.6 9.6)\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n className: \"bb\",\n width: 2.4,\n height: 2.4,\n rx: 1,\n transform: \"translate(5 9.6)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"bb\",\n d: \"M19.668,6.114l.919.277a.2.2,0,0,1,.124.088.3.3,0,0,1,.051.175.238.238,0,0,1-.073.175.223.223,0,0,1-.16.073h-.569a.487.487,0,0,1-.263-.073.149.149,0,0,0-.2.015l-.233.233A.146.146,0,0,0,19.2,7.2a.138.138,0,0,0,.073.124,1.111,1.111,0,0,0,.627.218v.248a.253.253,0,0,0,.066.175.216.216,0,0,0,.167.073h.161a.25.25,0,0,0,.248-.248V7.557a.861.861,0,0,0,.613-.277.949.949,0,0,0,.073-1.189.867.867,0,0,0-.467-.328l-.9-.277a.2.2,0,0,1-.124-.088.3.3,0,0,1-.051-.175.263.263,0,0,1,.073-.182.173.173,0,0,1,.161-.066h.569a.383.383,0,0,1,.262.066.145.145,0,0,0,.2-.007l.233-.233a.13.13,0,0,0,.051-.124.164.164,0,0,0-.065-.124,1.11,1.11,0,0,0-.627-.219V4.087a.239.239,0,0,0-.073-.175.222.222,0,0,0-.16-.073h-.175a.222.222,0,0,0-.16.073.239.239,0,0,0-.073.175V4.32a.858.858,0,0,0-.612.277.948.948,0,0,0-.073,1.189A.868.868,0,0,0,19.668,6.114Z\",\n transform: \"translate(-6.816 -1.536)\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmQuotes, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Quotes.d9981586.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmReports = function SvgBmReports(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 19.286\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M6.643,16.286h5.786a.643.643,0,0,0,0-1.286H6.643a.643.643,0,0,0,0,1.286Z\",\n transform: \"translate(-2.143 -5.357)\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M6.643,12.286H9.214a.643.643,0,1,0,0-1.286H6.643a.643.643,0,1,0,0,1.286Z\",\n transform: \"translate(-2.143 -3.929)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M6.643,20.286h5.786a.643.643,0,1,0,0-1.286H6.643a.643.643,0,1,0,0,1.286Z\",\n transform: \"translate(-2.143 -6.786)\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M6.643,24.286h5.786a.643.643,0,1,0,0-1.286H6.643a.643.643,0,1,0,0,1.286Z\",\n transform: \"translate(-2.143 -8.214)\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M11.48,29.989h.026l-.013-.019Z\",\n transform: \"translate(-4.1 -10.704)\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M14.143,5H.643A.643.643,0,0,0,0,5.643V20.429a.643.643,0,0,0,.643.643H10.929V19.786H1.286V6.286H13.5v13.5H9.643v1.286h4.5a.643.643,0,0,0,.643-.643V5.643A.643.643,0,0,0,14.143,5Z\",\n transform: \"translate(0 -1.786)\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M16.48,24.989h.026l-.013-.019Z\",\n transform: \"translate(-5.886 -8.918)\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M6.286,1.929V1.286H18.5v13.5h-.643v1.286h1.286a.643.643,0,0,0,.643-.643V.643A.643.643,0,0,0,19.143,0H5.643A.643.643,0,0,0,5,.643V1.929Z\",\n transform: \"translate(-1.786)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmReports, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Reports.df29a369.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmSales = function SvgBmSales(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-325 -58)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"d\",\n width: 18,\n height: 18,\n transform: \"translate(325 58)\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(267.446 262.078)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M65.823-188.072a1.3,1.3,0,0,1-.956.394,1.3,1.3,0,0,1-.956-.394l-5.963-5.963a1.3,1.3,0,0,1-.394-.956v-5.738a1.3,1.3,0,0,1,.394-.956,1.3,1.3,0,0,1,.956-.394h5.738a1.3,1.3,0,0,1,.956.394l5.963,5.963a1.3,1.3,0,0,1,.394.956,1.3,1.3,0,0,1-.394.956Zm3.6,0a1.3,1.3,0,0,1-.956.394,1.3,1.3,0,0,1-.956-.394l6.694-6.694-7.34-7.313h1.378a1.3,1.3,0,0,1,.956.394l5.963,5.963a1.3,1.3,0,0,1,.394.956,1.3,1.3,0,0,1-.394.956Zm-8.775-10.913a1.3,1.3,0,0,0-.394.956,1.3,1.3,0,0,0,.394.956,1.3,1.3,0,0,0,.956.394,1.3,1.3,0,0,0,.956-.394,1.3,1.3,0,0,0,.394-.956,1.3,1.3,0,0,0-.394-.956,1.3,1.3,0,0,0-.956-.394A1.3,1.3,0,0,0,60.648-198.984Z\"\n })))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmSales, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Sales.8c36c4a9.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmTae = function SvgBmTae(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n id: \"BM_TAE\",\n transform: \"translate(-374 -125)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n id: \"Rectangle_143\",\n \"data-name\": \"Rectangle 143\",\n width: 18,\n height: 18,\n transform: \"translate(374 125)\",\n fill: \"#fff\",\n opacity: 0.004\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_569\",\n \"data-name\": \"Group 569\",\n transform: \"translate(372 121.927)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_531\",\n \"data-name\": \"Path 531\",\n d: \"M12.385,6.5a5.764,5.764,0,0,1,2.955.789A5.829,5.829,0,0,1,17.481,9.43a5.93,5.93,0,0,1,0,5.91,5.829,5.829,0,0,1-2.141,2.141,5.93,5.93,0,0,1-5.91,0,5.829,5.829,0,0,1-2.141-2.141,5.93,5.93,0,0,1,0-5.91A5.829,5.829,0,0,1,9.43,7.289,5.764,5.764,0,0,1,12.385,6.5Zm.656,6.357.341-3.363a.383.383,0,0,0-.1-.328.412.412,0,0,0-.315-.145H11.807a.412.412,0,0,0-.315.145.383.383,0,0,0-.1.328l.341,3.363a.34.34,0,0,0,.118.263.406.406,0,0,0,.276.1h.526a.406.406,0,0,0,.276-.1A.34.34,0,0,0,13.041,12.857Zm-.656,2.89a.852.852,0,1,0-.591-.25A.807.807,0,0,0,12.385,15.747Z\",\n transform: \"translate(-1.385 -0.439)\",\n fill: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_568\",\n \"data-name\": \"Group 568\",\n transform: \"translate(2 5.073)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_566\",\n \"data-name\": \"Group 566\",\n transform: \"translate(13.846 0.001)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_532\",\n \"data-name\": \"Path 532\",\n d: \"M22.692,18.818a.692.692,0,0,1-.462-1.207,7.589,7.589,0,0,0,0-11.33.692.692,0,0,1,.925-1.03,8.973,8.973,0,0,1,0,13.391A.688.688,0,0,1,22.692,18.818Z\",\n transform: \"translate(-22 -5.074)\",\n fill: \"#fff\"\n })), /*#__PURE__*/React.createElement(\"g\", {\n id: \"Group_567\",\n \"data-name\": \"Group 567\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n id: \"Path_533\",\n \"data-name\": \"Path 533\",\n d: \"M5.462,18.818A.688.688,0,0,1,5,18.641,8.973,8.973,0,0,1,5,5.25a.692.692,0,0,1,.925,1.03,7.589,7.589,0,0,0,0,11.33.692.692,0,0,1-.462,1.207Z\",\n transform: \"translate(-2 -5.073)\",\n fill: \"#fff\"\n })))))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmTae, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_TAE.2a22c9d6.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmTraining = function SvgBmTraining(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,0H.6A.6.6,0,0,0,0,.6V17.4a.6.6,0,0,0,.6.6H17.4a.6.6,0,0,0,.6-.6V.6A.6.6,0,0,0,17.4,0ZM3.33,9.8a1.122,1.122,0,1,1,.795.33A1.128,1.128,0,0,1,3.33,9.8Zm3,3.444a1.128,1.128,0,1,1,.238-1.225A1.128,1.128,0,0,1,6.33,13.242Zm0-6.888a1.146,1.146,0,0,1-1.6,0,1.129,1.129,0,1,1,1.6-1.6,1.146,1.146,0,0,1,0,1.6ZM9.774,14.67a1.122,1.122,0,1,1,.33-.8,1.08,1.08,0,0,1-.306.8Zm0-9.75a.685.685,0,1,1,.024,0Zm3.444,8.322a1.129,1.129,0,1,1,0-1.6A1.128,1.128,0,0,1,13.218,13.242ZM14.646,9.8A1.128,1.128,0,1,1,15,9a1.086,1.086,0,0,1-.33.8Z\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmTraining, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_Training.35f98002.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path, _path2;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmTrainingProgress = function SvgBmTrainingProgress(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:#fff;}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M17.4,2.4H15.6V.6A.567.567,0,0,0,15,0h-.6a.567.567,0,0,0-.6.6V2.4H4.2V.6A.567.567,0,0,0,3.6,0H3a.567.567,0,0,0-.6.6V2.4H.6A.567.567,0,0,0,0,3V17.4a.567.567,0,0,0,.6.6H17.4a.567.567,0,0,0,.6-.6V3A.567.567,0,0,0,17.4,2.4ZM16.2,16.2H1.8V6H16.2Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M10.88,20.02a.38.38,0,0,0,.54.06l.06-.06,4.86-5.1a.435.435,0,0,0,0-.6l-.6-.6a.435.435,0,0,0-.6,0l-3.96,4.14L9.32,15.94a.435.435,0,0,0-.6,0l-.6.6a.435.435,0,0,0,0,.6Z\",\n transform: \"translate(-3.2 -5.44)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmTrainingProgress, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_TrainingProgress.e0b20dee.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmWorkOrders = function SvgBmWorkOrders(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M5.6,10.2H8A.6.6,0,0,0,8,9H5.6a.6.6,0,1,0,0,1.2Z\",\n transform: \"translate(-2 -3.6)\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M5.6,14.2h4.8a.6.6,0,1,0,0-1.2H5.6a.6.6,0,1,0,0,1.2Z\",\n transform: \"translate(-2 -5.2)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M11.48,29.988H11.5l-.012-.018Z\",\n transform: \"translate(-4.592 -11.988)\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M13.8,11.6v7.8a.6.6,0,0,1-.6.6H.6a.6.6,0,0,1-.6-.6V5.6A.6.6,0,0,1,.6,5H8.532A5.616,5.616,0,0,0,8.4,6.2H1.2V18.8H12.6V11.468a5.616,5.616,0,0,0,1.2.132Z\",\n transform: \"translate(0 -2)\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M20.2,0a4.2,4.2,0,1,0,4.2,4.2A4.2,4.2,0,0,0,20.2,0Zm2.136,4.62H20.62V6.336a.42.42,0,0,1-.84,0V4.62H18.064a.42.42,0,1,1,0-.84H19.78V2.064a.42.42,0,0,1,.84,0V3.78h1.716a.42.42,0,1,1,0,.84Z\",\n transform: \"translate(-6.4)\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M12.2,21.8H5.6a.6.6,0,0,1-.6-.6V17.6a.6.6,0,0,1,.6-.6h6.6a.6.6,0,0,1,.6.6v3.6A.6.6,0,0,1,12.2,21.8Zm-6-1.2h5.4V18.2H6.2Z\",\n transform: \"translate(-2 -6.8)\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmWorkOrders, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_WorkOrders.7cbcf18d.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _g;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgBmManageProducts = function SvgBmManageProducts(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 18 18\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \"\\r\\n .products-a {\\r\\n fill: none;\\r\\n }\\r\\n\\r\\n .b {\\r\\n fill: #fff;\\r\\n }\\r\\n \"))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-699 -134)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"products-a\",\n width: 18,\n height: 18,\n transform: \"translate(699 134)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"b\",\n d: \"M17.5,9H15v3l-1-.666L13,12V9H10.5a.5.5,0,0,0-.5.5v6a.5.5,0,0,0,.5.5h7a.5.5,0,0,0,.5-.5v-6A.5.5,0,0,0,17.5,9ZM5.5,7h7a.5.5,0,0,0,.5-.5V.5a.5.5,0,0,0-.5-.5H10V3L9,2.334,8,3V0H5.5A.5.5,0,0,0,5,.5v6A.5.5,0,0,0,5.5,7Zm2,2H5v3l-1-.666L3,12V9H.5a.5.5,0,0,0-.5.5v6a.5.5,0,0,0,.5.5h7a.5.5,0,0,0,.5-.5v-6A.5.5,0,0,0,7.5,9Z\",\n transform: \"translate(699 135)\"\n }))));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgBmManageProducts, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/BM_ManageProducts.0e8a22d7.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nvar _excluded = [\"svgRef\", \"title\"];\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 React from \"react\";\nvar SvgCloseMenu = function SvgCloseMenu(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.05025 2.63603C3.65972 2.24551 3.02656 2.24551 2.63603 2.63603C2.24551 3.02656 2.24551 3.65972 2.63603 4.05025L7.58578 8.99999L2.63603 13.9497C2.24551 14.3403 2.24551 14.9734 2.63603 15.364C3.02656 15.7545 3.65972 15.7545 4.05025 15.364L8.99999 10.4142L13.9497 15.364C14.3403 15.7545 14.9734 15.7545 15.364 15.364C15.7545 14.9734 15.7545 14.3403 15.364 13.9497L10.4142 8.99999L15.364 4.05025C15.7545 3.65972 15.7545 3.02656 15.364 2.63603C14.9734 2.24551 14.3403 2.24551 13.9497 2.63603L8.99999 7.58578L4.05025 2.63603Z\",\n fill: \"black\"\n })));\n};\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCloseMenu, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/CloseMenu.f605c66a.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\r\nimport { ReactComponent as Admin } from '../images/icons/BM_Admin.svg';\r\nimport { ReactComponent as Alerts } from '../images/icons/BM_Alerts.svg';\r\nimport { ReactComponent as Brands } from '../images/icons/BM_Brand.svg';\r\nimport { ReactComponent as Customers } from '../images/icons/BM_Customers.svg';\r\nimport { ReactComponent as Dashboard } from '../images/icons/BM_Dashboard.svg';\r\nimport { ReactComponent as Documents } from '../images/icons/BM_Documents.svg';\r\nimport { ReactComponent as Facility } from '../images/icons/BM_Facility.svg';\r\nimport { ReactComponent as Home } from '../images/icons/BM_Home.svg';\r\nimport { ReactComponent as InspectionStatus } from '../images/icons/BM_InspectionStatus.svg';\r\nimport { ReactComponent as Inventory } from '../images/icons/BM_Inventory.svg';\r\nimport { ReactComponent as JobComments } from '../images/icons/BM_JobComments.svg';\r\nimport { ReactComponent as Jobs } from '../images/icons/BM_Jobs.svg';\r\nimport { ReactComponent as Leads } from '../images/icons/BM_Leads.svg';\r\nimport { ReactComponent as Locations } from '../images/icons/BM_Locations.svg';\r\nimport { ReactComponent as StandardText } from '../images/icons/BM_StandardText.svg';\r\nimport { ReactComponent as ManageTeam } from '../images/icons/BM_ManageTeam.svg';\r\nimport { ReactComponent as ManageUsers } from '../images/icons/BM_ManageUsers.svg';\r\nimport { ReactComponent as Measurement } from '../images/icons/BM_Measurement.svg';\r\nimport { ReactComponent as NewUserQueue } from '../images/icons/BM_NewUserQueue.svg';\r\nimport { ReactComponent as PMP } from '../images/icons/BM_PreventMaint.svg';\r\nimport { ReactComponent as ProductQueue } from '../images/icons/BM_ProductQueue.svg';\r\nimport { ReactComponent as Quotes } from '../images/icons/BM_Quotes.svg';\r\nimport { ReactComponent as Reports } from '../images/icons/BM_Reports.svg';\r\nimport { ReactComponent as Sales } from '../images/icons/BM_Sales.svg';\r\nimport { ReactComponent as TAE } from '../images/icons/BM_TAE.svg';\r\nimport { ReactComponent as Training } from '../images/icons/BM_Training.svg';\r\nimport { ReactComponent as TrainingProgress } from '../images/icons/BM_TrainingProgress.svg';\r\nimport { ReactComponent as WorkOrders } from '../images/icons/BM_WorkOrders.svg';\r\nimport { ReactComponent as ManageProducts } from '../images/icons/BM_ManageProducts.svg';\r\nimport { ReactComponent as CloseMenu } from '../images/icons/CloseMenu.svg';\r\n\r\nexport const svgIcons = {\r\n alerts: ,\r\n admin: ,\r\n dashboard: ,\r\n brands: ,\r\n closeMenu: ,\r\n customers: ,\r\n documents: ,\r\n facility: ,\r\n home: ,\r\n leads: ,\r\n locations: ,\r\n inspectionStatus: ,\r\n inventory: ,\r\n jobs: ,\r\n jobComments: ,\r\n standardText: ,\r\n manageTeam: ,\r\n measurement: ,\r\n manageUsers: ,\r\n newUserQueue: ,\r\n pmp: ,\r\n products: ,\r\n productQueue: ,\r\n reports: ,\r\n sales: ,\r\n tae: ,\r\n training: ,\r\n trainingProgress: ,\r\n quotes: ,\r\n workOrders: \r\n};\r\n","import * as React from 'react';\r\n\r\nimport { ButtonToolbar, Dropdown, MenuItem } from 'react-bootstrap';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nimport { constants } from '../../../constants/constants';\r\nimport i18next from 'i18next';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Iuser } from '../../../models';\r\nimport { svgIcons } from '../../../constants/svgIcons';\r\n\r\ninterface Iprops {\r\n toggle: (isOpen: boolean) => void;\r\n handleMenuSelect: (eventKey: any) => void;\r\n menuClass: string;\r\n menuOpen: boolean;\r\n // hasJob: boolean;\r\n // offlineStatusOverride: boolean;\r\n // online: boolean;\r\n user: Iuser;\r\n loading: boolean;\r\n // startSync: typeof startSync;\r\n // downloadAppState: typeof downloadAppState;\r\n}\r\n\r\nconst DropDownMenu: React.FC = props => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n {/* Mobile only container */}\r\n
\r\n
\r\n

\r\n {i18next.t('welcome')}\r\n

\r\n\r\n

{props.user.first}

\r\n
\r\n
\r\n \r\n \r\n {svgIcons['dashboard']}\r\n {' '}\r\n   {i18next.t('tiles:dashboard')}\r\n \r\n \r\n \r\n {svgIcons['inventory']}\r\n {' '}\r\n   {i18next.t('tiles:inventory')}\r\n \r\n \r\n \r\n {svgIcons['training']}\r\n {' '}\r\n   {i18next.t('tiles:training')}\r\n \r\n \r\n \r\n {svgIcons['documents']}\r\n {' '}\r\n   {i18next.t('tiles:Documents')}\r\n \r\n \r\n \r\n {svgIcons['quotes']}\r\n {' '}\r\n   {i18next.t('tiles:quotes')}\r\n \r\n \r\n {' '}\r\n   {i18next.t('common:logout')}\r\n \r\n \r\n v: {process.env.REACT_APP_VERSION}\r\n \r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('common')(DropDownMenu);\r\n","import { isEmpty } from 'lodash';\r\nimport * as React from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport { userLogout } from '../../../actions/userActions';\r\nimport { Iuser } from '../../../models';\r\n\r\nimport { IinitialState } from '../../../reducers';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport DropDownMenu from './DropDownMenu';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n user: Iuser;\r\n alertsCount: number;\r\n userLogout: any;\r\n loading: boolean;\r\n // toggleTutorial: typeof toggleTutorial;\r\n\r\n // toggleEditProfileModal: any;\r\n // toggleUserAlertModal: typeof toggleUserAlertModal;\r\n}\r\n\r\ninterface Istate {\r\n menuOpen: boolean;\r\n showOfflineQueueStatus: boolean;\r\n showOfflineQueueReset: boolean;\r\n localCartTotal: number;\r\n}\r\n\r\nconst HeaderMenuMobile: React.FC = props => {\r\n const [state, setState] = React.useState({\r\n menuOpen: false,\r\n showOfflineQueueStatus: false,\r\n showOfflineQueueReset: false,\r\n localCartTotal: 0\r\n });\r\n\r\n const menuClass = state.menuOpen ? 'menu-open' : '';\r\n\r\n const handleMenuSelect = (eventKey: any) => {\r\n switch (eventKey) {\r\n case '0':\r\n window.location.replace('/dashboard');\r\n break;\r\n case '1':\r\n window.location.replace('/inventory');\r\n break;\r\n case '2':\r\n window.location.replace('/training');\r\n break;\r\n case '3':\r\n window.location.replace('/documents');\r\n break;\r\n case '4':\r\n window.location.replace('/quotes');\r\n break;\r\n\r\n case '5':\r\n props.userLogout(props.t);\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n // If the user is not logged in, don't show the menu\r\n if (props.user.id.length === 0) {\r\n return <>;\r\n }\r\n\r\n return (\r\n <>\r\n {\r\n setState({ ...state, menuOpen: isOpen });\r\n }}\r\n handleMenuSelect={handleMenuSelect}\r\n menuClass={menuClass}\r\n user={props.user}\r\n loading={props.loading}\r\n menuOpen={state.menuOpen}\r\n />\r\n \r\n );\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n let alertsCount = 0;\r\n\r\n if (isEmpty(state.alertsByID) === false) {\r\n for (const key of Object.keys(state.alertsByID)) {\r\n if (state.alertsByID[key].isViewed === false) {\r\n alertsCount++;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n alertsCount\r\n };\r\n};\r\n\r\nexport default withTranslation('common')(\r\n connect(mapStateToProps, {\r\n userLogout\r\n // toggleEditProfileModal,\r\n // toggleUserAlertModal,\r\n // toggleTutorial\r\n })(HeaderMenuMobile)\r\n);\r\n","/*\r\n * Header simply displays the header on all pages\r\n */\r\n\r\nimport * as React from 'react';\r\nimport HeaderMenu from './HeaderMenu';\r\nimport { Link } from 'react-router-dom';\r\nimport { useSelector } from 'react-redux';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport HeaderMenuMobile from './mobile/HeaderMenuMobile';\r\n\r\nconst headerImg = require('../../images/BeaconLogo@2x.png');\r\n\r\nconst Header = (props: any) => {\r\n const isMobile = useSelector(getIsMobile);\r\n\r\n return (\r\n
\r\n \r\n \"logo\"\r\n \r\n\r\n {/* Desktop */}\r\n {!isMobile && }\r\n\r\n {/* Mobile */}\r\n {isMobile && }\r\n
\r\n );\r\n};\r\n\r\nexport default Header;\r\n","import * as types from './actionTypes';\r\n\r\nexport function setLoginRedirect() {\r\n return (dispatch: any, getState: any) => {\r\n dispatch({ type: types.SET_REDIRECT_REFERRER });\r\n return Promise.resolve(true);\r\n };\r\n}\r\nexport const removeLoginRedirect = () => ({\r\n type: types.REMOVE_REDIRECT_REFERRER\r\n});\r\n\r\nexport const setRedirectPathname = (\r\n pathname: string,\r\n setRedirect?: boolean\r\n) => ({\r\n type: types.SET_REDIRECT_PATHNAME,\r\n pathname,\r\n setRedirect\r\n});\r\n","/*\r\n * This component has 2 primary responsibilities\r\n * 1) a successful login into Azure\r\n * If it is an existing user, route to the dashboard or whatever private route they were trying to access before\r\n * being redirected to the login screen.\r\n * If it is a new user, route to the signup page\r\n * 2) provide a plane for the user to begin logging in\r\n */\r\n\r\nimport { Button, Col, Grid, Row } from 'react-bootstrap';\r\nimport * as localForage from 'localforage';\r\nimport initialState from '../../reducers/initialState';\r\nimport { RouteComponentProps, Redirect } from 'react-router-dom';\r\nimport { connect } from 'react-redux';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport { Iuser, Iredirect } from '../../models';\r\nimport { MSALlogin, userLogin, userLogout } from '../../actions/userActions';\r\nimport {\r\n setLoginRedirect,\r\n removeLoginRedirect,\r\n setRedirectPathname\r\n} from '../../actions/redirectToReferrerAction';\r\nimport { getUserAlerts } from '../../actions/manageUserAlertActions';\r\nimport { manualAjaxStart } from '../../actions/ajaxStatusActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport Mixpanel from '../../helpers/Mixpanel';\r\nimport msalInstance from './MsalInstance';\r\nimport { AuthenticationResult } from '@azure/msal-browser';\r\nimport { AxiosError } from 'axios';\r\ninterface Iprops extends RouteComponentProps<{}> {\r\n userLogin: (t: TFunction) => Promise;\r\n MSALlogin: (t: TFunction) => Promise;\r\n userLogout: typeof userLogout;\r\n setLoginRedirect: () => Promise;\r\n setRedirectPathname: typeof setRedirectPathname;\r\n removeLoginRedirect: typeof removeLoginRedirect;\r\n user: Iuser;\r\n redirect: Iredirect;\r\n loading: boolean;\r\n getUserAlerts: typeof getUserAlerts;\r\n manualAjaxStart: () => void;\r\n}\r\n\r\ninterface Istate {\r\n userLoginFailed: boolean;\r\n reduxPersistDelay: boolean;\r\n userIsAuthenticated: boolean;\r\n}\r\n\r\nconst azure = require('../../images/Azure.png');\r\n\r\nclass Login extends React.Component {\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n\r\n this.state = {\r\n userLoginFailed: false,\r\n // delay redirecting to MSAL to give the redirect time to persist to indexDB.\r\n // this can likely be removed when we switch to the faster redux-persist v4\r\n reduxPersistDelay: true,\r\n userIsAuthenticated: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.initApp();\r\n localForage.setItem(\r\n 'persist:state-core-care-web',\r\n JSON.stringify(initialState)\r\n );\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\r\n 'missingUser',\r\n this.handleRedirectToSignup,\r\n false\r\n );\r\n }\r\n\r\n initApp = () => {\r\n document.addEventListener(\r\n 'missingUser',\r\n this.handleRedirectToSignup,\r\n false\r\n );\r\n\r\n setTimeout(() => {\r\n this.setState({ reduxPersistDelay: false });\r\n }, 4000);\r\n\r\n // store the referring loation in redux\r\n const locationState: any = this.props.location.state;\r\n const { from } = locationState || { from: { pathname: '/' } };\r\n\r\n // if we are not already redirecting, then set it\r\n if (\r\n !this.props.redirect.redirectToReferrer &&\r\n from &&\r\n from.pathname &&\r\n from.pathname !== '/'\r\n ) {\r\n this.props.setRedirectPathname(\r\n `${from.pathname}${from.search}`,\r\n true\r\n );\r\n }\r\n\r\n const msalAccount = msalInstance.msalApp?.getAllAccounts();\r\n\r\n if (msalAccount?.length > 0) {\r\n Mixpanel.track('Login Successful');\r\n\r\n if (!this.props.user.id.length) {\r\n this.props\r\n .userLogin(this.props.t)\r\n .then(() => {\r\n this.props.getUserAlerts();\r\n })\r\n .catch((error: AxiosError) => {\r\n if (error.response?.status === 406) {\r\n // User has not been approved yet\r\n this.props.history.push('/accountPending');\r\n } else {\r\n console.error('login failed in login.tsx', error);\r\n Mixpanel.track('Login Unsuccessful');\r\n this.setState({ userLoginFailed: true });\r\n }\r\n });\r\n }\r\n } else {\r\n console.info('no msal account');\r\n if (this.props.user.id.length) {\r\n console.error('token is expired but user is authenticated');\r\n }\r\n }\r\n\r\n msalInstance.msalApp\r\n .handleRedirectPromise()\r\n .then(this.handleRedirectResponse)\r\n .catch(this.handleRedirectError);\r\n };\r\n\r\n handleRedirectResponse = (response: AuthenticationResult | null) => {\r\n console.info('handleRedirectResponse', response);\r\n if (response && response.account && !this.state.userIsAuthenticated) {\r\n this.setState({ userIsAuthenticated: true });\r\n msalInstance.msalApp.setActiveAccount(response.account);\r\n\r\n // Let the render method handle the redirect instead of direct history push\r\n this.props\r\n .userLogin(this.props.t)\r\n .then(() => {\r\n this.props.history.push('/dashboard');\r\n })\r\n .catch((error: AxiosError) => {\r\n console.info('error', error);\r\n if (error.response?.status === 400) {\r\n this.handleRedirectToSignup();\r\n } else {\r\n console.error(\r\n 'login failed in handleRedirectResponse',\r\n error\r\n );\r\n Mixpanel.track('Login Unsuccessful');\r\n this.setState({ userLoginFailed: true });\r\n }\r\n });\r\n }\r\n };\r\n\r\n handleRedirectError = (error: any) => {\r\n this.setState({ userIsAuthenticated: false });\r\n console.error('Redirect error:', error);\r\n };\r\n\r\n handleRedirectToSignup = () => {\r\n this.props.history.push('/signup');\r\n };\r\n\r\n handleMsalLogin = () => {\r\n this.props.MSALlogin(this.props.t).then(result => {\r\n console.info('MSALlogin', result);\r\n });\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n // handle potential redirects\r\n const { from } = this.props.redirect.pathname\r\n ? { from: { pathname: this.props.redirect.pathname } }\r\n : { from: { pathname: '/' } };\r\n const { redirectToReferrer } = this.props.redirect;\r\n\r\n // if user is authenticated and exists in the backend\r\n // redirect to the redirect.pathname or the dashboard\r\n if (\r\n msalInstance.msalApp?.getAllAccounts().length > 0 &&\r\n this.props.user.id.length\r\n ) {\r\n const loggedInPath: string = redirectToReferrer\r\n ? from.pathname\r\n : '/dashboard';\r\n\r\n Mixpanel.identify(this.props.user.id);\r\n Mixpanel.people.set({\r\n $email: this.props.user.email,\r\n USER_ID: this.props.user.id\r\n });\r\n\r\n this.props.removeLoginRedirect();\r\n\r\n return ;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n {t('welcome')}\r\n \r\n \r\n \r\n {t('ssoLogin')}\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: any) => {\r\n return {\r\n user: state.user,\r\n redirect: state.redirect,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('auth')(\r\n connect(mapStateToProps, {\r\n userLogin,\r\n MSALlogin,\r\n userLogout,\r\n setLoginRedirect,\r\n removeLoginRedirect,\r\n setRedirectPathname,\r\n getUserAlerts,\r\n manualAjaxStart\r\n })(Login)\r\n);\r\n","/*\r\n * UserForm\r\n * User signs up directly to the platform\r\n */\r\n\r\nimport * as React from 'react';\r\nimport {\r\n Validators,\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport {\r\n constants,\r\n postalAndStateRequiredCountries\r\n} from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { userBaseConfigControls } from '../common/UserBaseConfigControls';\r\nimport msalInstance from './MsalInstance';\r\n\r\nconst getIsRequiredFromSelectedCountry = (selectedCountryID?: string) => {\r\n if (\r\n selectedCountryID === '' ||\r\n selectedCountryID === undefined ||\r\n selectedCountryID === null\r\n ) {\r\n return {\r\n state: false,\r\n postalCode: false\r\n };\r\n }\r\n\r\n return postalAndStateRequiredCountries[selectedCountryID];\r\n};\r\n\r\n// Field config to configure form\r\nconst fieldConfigControls = {\r\n tempCompany: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: { label: 'company', colWidth: 12, type: 'text', name: 'company' }\r\n },\r\n tempAddress: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'address',\r\n colWidth: 8,\r\n type: 'text',\r\n name: 'temp-address'\r\n }\r\n },\r\n tempAddress2: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'address2',\r\n colWidth: 4,\r\n type: 'text',\r\n name: 'temp-address2'\r\n }\r\n },\r\n tempCity: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: { label: 'city', colWidth: 5, type: 'text', name: 'temp-city' }\r\n },\r\n tempState: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: { label: 'state', colWidth: 3, type: 'text', name: 'temp-state' }\r\n },\r\n tempZip: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: { label: 'zip', colWidth: 4, type: 'tel', name: 'temp-zip' }\r\n },\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.countries,\r\n label: 'user:country',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n }\r\n }\r\n};\r\nconst fieldConfig = {\r\n controls: {\r\n ...userBaseConfigControls(undefined, undefined, false),\r\n ...fieldConfigControls\r\n }\r\n};\r\n\r\ninterface Iprops extends React.Props {\r\n handleSubmit: any;\r\n handleCancel: any;\r\n loading: boolean;\r\n}\r\n\r\ninterface IState {\r\n email: string;\r\n}\r\n\r\nclass UserForm extends React.Component {\r\n public userForm: FormGroup | any;\r\n public fieldConfig: FieldConfig;\r\n private subscription: any;\r\n\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n email: ''\r\n };\r\n this.fieldConfig = FormUtil.translateForm(fieldConfig, this.props.t);\r\n }\r\n\r\n componentDidMount() {\r\n const msalAccount = msalInstance.msalApp?.getAllAccounts();\r\n\r\n if (msalAccount?.length > 0) {\r\n const account = msalAccount[0];\r\n const claims = account.idTokenClaims;\r\n if (claims) {\r\n setTimeout(() => {\r\n const email = claims.email as string;\r\n const firstName = claims.given_name as string;\r\n const lastName = claims.family_name as string;\r\n\r\n this.setState({ email });\r\n\r\n this.userForm.patchValue({\r\n email,\r\n first: firstName,\r\n last: lastName\r\n });\r\n }, 0);\r\n }\r\n }\r\n\r\n this.subscription = this.userForm\r\n .get('countryID')\r\n .valueChanges.subscribe((value: any) => {\r\n if (value && value.value) {\r\n this.onCountryChanges(value.value);\r\n }\r\n });\r\n\r\n this.userForm.patchValue({\r\n countryID: {\r\n value: constants.usCountryID,\r\n label: 'United States of America'\r\n }\r\n });\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n onCountryChanges = (value: string) => {\r\n const stateFormControl = this.userForm.get('tempState');\r\n const tempZipFormControl = this.userForm.get('tempZip');\r\n\r\n const isStateRequired = getIsRequiredFromSelectedCountry(value)\r\n ? getIsRequiredFromSelectedCountry(value).state\r\n : false;\r\n const isPostalCodeRequired = getIsRequiredFromSelectedCountry(value)\r\n ? getIsRequiredFromSelectedCountry(value).postalCode\r\n : false;\r\n\r\n stateFormControl.clearValidators();\r\n tempZipFormControl.clearValidators();\r\n\r\n if (isStateRequired) {\r\n stateFormControl.setValidators([\r\n FormUtil.validators.requiredWithTrim\r\n ]);\r\n stateFormControl.patchValue(null);\r\n } else {\r\n stateFormControl.patchValue(null);\r\n }\r\n\r\n if (isPostalCodeRequired) {\r\n tempZipFormControl.setValidators([\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]);\r\n tempZipFormControl.patchValue(null);\r\n } else {\r\n tempZipFormControl.patchValue(null);\r\n }\r\n };\r\n\r\n handleSubmit = (evt: React.MouseEvent) => {\r\n evt.preventDefault();\r\n if (this.userForm.status === 'INVALID') {\r\n this.userForm.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('validationError'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n if (this.userForm.value.email !== this.state.email) {\r\n this.userForm.value.email = this.state.email;\r\n console.log(this.userForm.value);\r\n }\r\n\r\n console.log(this.userForm.value);\r\n\r\n this.props.handleSubmit(this.userForm.value);\r\n };\r\n setForm = (form: AbstractControl) => {\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n handleCancel: this.props.handleCancel,\r\n cancelText: 'Cancel',\r\n submitText: 'Sign Up',\r\n loading: this.props.loading\r\n };\r\n };\r\n render() {\r\n const { t } = this.props;\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {t('cancel')}\r\n \r\n \r\n {t('signUp')}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default withTranslation('user')(UserForm);\r\n","/*\r\n * Signup directly (no existing Microsoft account)\r\n */\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Redirect } from 'react-router-dom';\r\nimport { Iuser } from '../../models';\r\nimport { signUpDirect } from '../../actions/userActions';\r\nimport { removeLoginRedirect } from '../../actions/redirectToReferrerAction';\r\nimport { Col, Grid, Row, Button } from 'react-bootstrap';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport UserForm from './UserForm';\r\nimport { IregisterUserFormValues } from '../../modelsForms';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops extends RouteComponentProps<{}> {\r\n removeLoginRedirect: typeof removeLoginRedirect;\r\n user: Iuser;\r\n signUpDirect: (tempUser: IregisterUserFormValues) => Promise;\r\n loading: boolean;\r\n}\r\ninterface Istate {\r\n redirectToLogin: boolean;\r\n showSignupSuccess: boolean;\r\n}\r\n\r\nconst SignUpSuccess = (props: any) => {\r\n const { t } = props;\r\n return (\r\n
\r\n

{t('accountPending')}

\r\n

{t('successBody1')}

\r\n

\r\n {t('successBody2')}
{t('successBody3')}\r\n

\r\n \r\n {t('ok')}\r\n \r\n
\r\n );\r\n};\r\n\r\nclass SignUpDirect extends React.Component {\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n redirectToLogin: false,\r\n showSignupSuccess: false\r\n };\r\n }\r\n\r\n cancel = () => {\r\n this.setState({ redirectToLogin: true });\r\n };\r\n handleSubmit = (newUser: IregisterUserFormValues) => {\r\n return this.props\r\n .signUpDirect(newUser)\r\n .then(() => {\r\n this.setState({ showSignupSuccess: true });\r\n })\r\n .catch((error: any) => console.error(error));\r\n };\r\n render() {\r\n const { t } = this.props;\r\n if (this.props.user.id.length) {\r\n this.props.removeLoginRedirect();\r\n return ;\r\n }\r\n if (this.state.redirectToLogin) {\r\n return ;\r\n }\r\n const flipClass = this.state.showSignupSuccess\r\n ? 'flip-container flip'\r\n : 'flip-container';\r\n return (\r\n
\r\n \r\n \r\n
\r\n

\r\n Thank you for your registration with\r\n BeaconMedaes (a part of the Atlas Copco Group).\r\n By registering, your email and password can be\r\n used for different online systems within the\r\n Atlas Copco Group such as: MyMedGas,\r\n BeaconMedaes Training/Credentialing, SmartLINK,\r\n OnePortal, and others.\r\n

\r\n

\r\n As MyMedGas houses confidential details about\r\n your facility/hospital, can you please provide\r\n us with more details on the specific facility\r\n and your role? Our back office will then\r\n validate and grant the correct access levels.\r\n

\r\n

\r\n If you are only interested in Training and\r\n Credentials – then please use this direct link:{' '}\r\n \r\n learning.beaconmedaes.com\r\n {' '}\r\n as you do not need to register in MyMedGas for\r\n training\r\n

\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\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 mapStateToProps = (state: IinitialState, ownProps: any) => {\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('auth')(\r\n connect(mapStateToProps, {\r\n removeLoginRedirect,\r\n signUpDirect\r\n })(SignUpDirect)\r\n);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport { Iuser } from '../models';\r\nimport { constants } from '../constants/constants';\r\nimport initialState from './initialState';\r\nimport { cleanUser } from './manageUserReducer';\r\nimport { IinitialState } from '.';\r\n\r\nexport default function user(state: Iuser = initialState.user, action: any) {\r\n switch (action.type) {\r\n case types.USER_LOGIN_SUCCESS: {\r\n return {\r\n ...state,\r\n ...cleanUser(action.user)\r\n };\r\n }\r\n case types.UPDATE_CURRENT_USER: {\r\n return {\r\n ...state,\r\n ...cleanUser(action.user)\r\n };\r\n }\r\n\r\n case types.USER_UPDATE_PROFILE_SUCCESS: {\r\n const cleanedUser = cleanUser(action.user);\r\n return {\r\n ...state,\r\n ...cleanedUser\r\n };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.user;\r\n default:\r\n return state;\r\n }\r\n}\r\nexport const getUsersCountries = (state: IinitialState) =>\r\n state.user.userCountries;\r\nexport const getUsersActiveCountry = (state: IinitialState) =>\r\n state.user.countryID;\r\n\r\n/*\r\n * Getters and Setters\r\n */\r\n\r\nexport const getCanEditInstalls = (state: Iuser) => {\r\n return constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.ManageInventory.id,\r\n constants.securityFunctions.FSE.id\r\n ]);\r\n};\r\n\r\nexport const getCanEditProducts = (state: Iuser) => {\r\n return constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]);\r\n};\r\n\r\nexport const getCanCreateProducts = (state: Iuser) => {\r\n const canCreateAsManager = constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.ManageInventory.id\r\n ]);\r\n const canCreateAsFSE = constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.FSE.id\r\n ]);\r\n const canCreateAsAdmin = constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]);\r\n\r\n return canCreateAsFSE || canCreateAsManager || canCreateAsAdmin;\r\n};\r\n\r\nexport const getCanRequestQuote = (state: Iuser) => {\r\n return constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.QuoteForInvoice.id\r\n ]);\r\n};\r\n\r\nexport const getCanAccessAllCustomers = (state: Iuser) => {\r\n const allowAllCustomers = constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.AllowAllCustomers.id\r\n ]);\r\n return allowAllCustomers;\r\n};\r\n\r\nexport const getCanCreateAsManager = (state: Iuser) => {\r\n const canCreateAsManager = constants.hasSecurityFunction(state, [\r\n constants.securityFunctions.ManageInventory.id\r\n ]);\r\n return canCreateAsManager;\r\n};\r\n","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport {\r\n ImeasurementPointResult,\r\n ImeasurementPoint,\r\n // ImeasurementPointList,\r\n ImeasurementPointAnswer,\r\n ThunkResult\r\n} from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport * as moment from 'moment';\r\n\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport { Dispatch } from 'redux';\r\nimport {\r\n measurementPointTypes,\r\n measurementPointResultStatusTypesEnum\r\n} from '../models-enums';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\nexport const getMeasurePointListResultForInstallBase = (\r\n dispatch: any,\r\n installBaseId: string\r\n) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.measurementPoint.getMeasurePointListResultForInstallBase}/${installBaseId}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type:\r\n types.GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_SUCCESS,\r\n results: data.data\r\n });\r\n return data.data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_MEASUREMENT_POINT_HISTORY_BY_INSTALLBASE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get inspection results');\r\n throw error; // intentionally rethrow\r\n });\r\n};\r\n\r\nexport function getMeasurementPointResultsHistoryByInstallBase(\r\n installBaseId: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n return getMeasurePointListResultForInstallBase(\r\n dispatch,\r\n installBaseId\r\n ).catch((error: any) =>\r\n console.error('error getting measurement point results', error)\r\n );\r\n };\r\n}\r\n\r\nexport const getFacilityMeasurementPointResultsHelper = (\r\n dispatch: any,\r\n getState: any,\r\n facilityID: string\r\n) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.measurementPoint.getFacilityMeasurementPointListResults}/${facilityID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n // console.info(data.data);\r\n dispatch({\r\n type: types.GET_MEASUREMENT_POINT_FACILITY_RESULTS_SUCCESS,\r\n results: data.data\r\n });\r\n return data.data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_MEASUREMENT_POINT_FACILITY_RESULTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get inspection results');\r\n throw error; // intentionally rethrow\r\n });\r\n};\r\n\r\nexport function getFacilityMeasurementPointResults(\r\n facilityID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n return getFacilityMeasurementPointResultsHelper(\r\n dispatch,\r\n getState,\r\n facilityID\r\n ).catch((error: any) =>\r\n console.error('error getting measurement point results', error)\r\n );\r\n };\r\n}\r\n\r\nexport function getMeasurementPointListResult(id: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.measurementPoint.getMeasurementPointListResultWithAnswers}/${id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n // console.info(response.data);\r\n dispatch({\r\n type: types.GET_MEASUREMENT_POINT_RESULT_SUCCESS,\r\n payload: response.data\r\n });\r\n return response.data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_MEASUREMENT_POINT_RESULT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get inspection result');\r\n throw error; // intentionally rethrow\r\n });\r\n };\r\n}\r\n\r\nconst updateMPresultHelper = (\r\n result: ImeasurementPointResult,\r\n dispatch: Dispatch\r\n) => {\r\n dispatch({\r\n type: types.UPDATE_MEASUREMENT_POINT_RESULT,\r\n result\r\n });\r\n};\r\n\r\n/*\r\n * get the most recent or the selected historical result for this installBase\r\n */\r\nexport const selectResult = (historicalResultID: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const {\r\n measurementPointResultsByID\r\n } = getState().measurementPointResults;\r\n\r\n const historicalResult =\r\n measurementPointResultsByID[historicalResultID];\r\n updateMPresultHelper(historicalResult, dispatch);\r\n };\r\n};\r\n\r\nconst updateExistingResultAnswerIDs = (\r\n resultAnswers: ImeasurementPointAnswer[]\r\n) => {\r\n return resultAnswers.map(answer => ({ ...answer, id: uuidv4() }));\r\n};\r\n\r\nexport const createNewResultFromPrevious = (\r\n previousResult: ImeasurementPointResult,\r\n jobID: string,\r\n installBaseID: string\r\n): ImeasurementPointResult => {\r\n return {\r\n id: uuidv4(),\r\n installBaseID,\r\n measurementPointListID: previousResult.measurementPointListID,\r\n jobID,\r\n temporary: false,\r\n isDeleted: false,\r\n notes: previousResult.notes ? previousResult.notes : '',\r\n status: measurementPointResultStatusTypesEnum.resultStatusNotTested,\r\n previousStatus: previousResult.previousStatus,\r\n createDate: moment.utc().toISOString(),\r\n updateDate: moment.utc().toISOString(),\r\n manualOverride: true,\r\n compiledNotes: '',\r\n installBaseHistory: previousResult.installBaseHistory,\r\n measurementPointAnswers:\r\n updateExistingResultAnswerIDs(\r\n previousResult.measurementPointAnswers\r\n ) || []\r\n };\r\n};\r\n\r\nconst resetAnswerToDefault = (\r\n measurementPoint: ImeasurementPoint,\r\n answer: ImeasurementPointAnswer\r\n): ImeasurementPointAnswer => {\r\n if (measurementPoint.type === measurementPointTypes.QUESTION_PASSFAIL) {\r\n return { ...answer, notes: '', pass: measurementPoint.passFailDefault };\r\n } else if (\r\n measurementPoint.type === measurementPointTypes.QUESTION_NUMERIC\r\n ) {\r\n return { ...answer, notes: '', numericValue: undefined };\r\n } else if (measurementPoint.type === measurementPointTypes.QUESTION_TEXT) {\r\n return { ...answer, notes: '', textValue: undefined };\r\n } else if (\r\n measurementPoint.type === measurementPointTypes.QUESTION_SELECT\r\n ) {\r\n return {\r\n ...answer,\r\n notes: '',\r\n measurementPointSelectOptionID:\r\n measurementPoint.selectDefaultOptionID\r\n };\r\n } else {\r\n return { ...answer, notes: '' };\r\n }\r\n};\r\n\r\n/*\r\n * cleanExistingInstallResultAnswers - loop over answers for this device and clean any answers that are from a different job if rememberBetweenInspections === false\r\n */\r\n\r\nexport const cleanExistingInstallResultAnswers = (\r\n result: ImeasurementPointResult,\r\n measurementPointsByID: { [key: string]: ImeasurementPoint },\r\n jobID: string\r\n): ImeasurementPointResult => {\r\n // if it is temporary then it has already been cleaned\r\n if (result.temporary) {\r\n return result;\r\n }\r\n const cleanedAnswers = result.measurementPointAnswers.map(answer => {\r\n const measurementPoint =\r\n measurementPointsByID[answer.measurementPointID];\r\n if (!measurementPoint) {\r\n console.error(\r\n 'missing measurement point',\r\n measurementPoint,\r\n answer\r\n );\r\n }\r\n\r\n if (\r\n jobID !== result.jobID &&\r\n measurementPoint.selectRememberBetweenInspection === false\r\n ) {\r\n return resetAnswerToDefault(measurementPoint, answer);\r\n } else {\r\n return answer;\r\n }\r\n });\r\n return {\r\n ...result,\r\n measurementPointAnswers: cleanedAnswers,\r\n notes: '',\r\n status: 0,\r\n previousStatus: result.status\r\n };\r\n};\r\n\r\n/*\r\n * Create a measurement point result manually\r\n * set manualOverride to true and copy the answers fromt he previous result if there is one\r\n */\r\n\r\nexport function updateMeasurementPointResult(\r\n result: ImeasurementPointResult\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n updateMPresultHelper(result, dispatch);\r\n };\r\n}\r\n\r\nexport function setHistoricalResultID(resultID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({\r\n type: types.SET_HISTORICAL_RESULT_ID,\r\n resultID\r\n });\r\n };\r\n}\r\n\r\nexport const clearHistoricalResultID = () => ({\r\n type: types.CLEAR_HISTORICAL_RESULT_ID\r\n});\r\n\r\n/*\r\n * ********* Private Helper functions **********\r\n */\r\n\r\n/*\r\n * 1) try to find a previous result for this install\r\n * 2) try to find a previous result for this type of measurement point list (clean the answers)\r\n * If we find one, return it\r\n * - if it is temporary then do Not create a new ID or remove any answers\r\n */\r\n// const getPreviousResult = (\r\n// mpResults: ImeasurementPointResult[],\r\n// installID: string,\r\n// selectedMPL: ImeasurementPointList\r\n// ): ImeasurementPointResult => {\r\n// if (mpResults.length) {\r\n// let previousResult: ImeasurementPointResult = initialMeasurmentPointResult;\r\n// const installResults = getInstallResults(mpResults, false, installID);\r\n// if (installResults && installResults.length) {\r\n// previousResult = getMostRecentResult(installResults);\r\n// } else {\r\n// const MPLresults = getMeasurementPointListResults(mpResults, selectedMPL);\r\n// if (MPLresults.length) {\r\n// previousResult = getMostRecentResult(MPLresults);\r\n// }\r\n// }\r\n// return previousResult;\r\n// } else {\r\n// console.info('did not find any previous results');\r\n// return initialMeasurmentPointResult;\r\n// }\r\n// };\r\n\r\n/*\r\n * when no results for the specific install, try to find results for the same measurementPointList\r\n */\r\n// const getMeasurementPointListResults = (\r\n// results: ImeasurementPointResult[],\r\n// selectedMPL: ImeasurementPointList\r\n// ) => {\r\n// return results.filter(result => {\r\n// return (\r\n// result.measurementPointListID === selectedMPL.id && !result.temporary\r\n// );\r\n// });\r\n// };\r\n\r\n// const getInstallResults = (\r\n// results: ImeasurementPointResult[],\r\n// includeTemporary: boolean,\r\n// installID: string\r\n// ) => {\r\n// const filteredResults = results.filter(result => {\r\n// return result.installBaseID === installID;\r\n// });\r\n// if (!includeTemporary) {\r\n// return filteredResults.filter(result => result.temporary !== true);\r\n// }\r\n// return filteredResults;\r\n// };\r\n\r\n// const getMostRecentResult = (results: ImeasurementPointResult[]) => {\r\n// return results.reduce((previous, current) => {\r\n// if (\r\n// moment.utc(previous.updateDate).isAfter(moment.utc(current.updateDate))\r\n// ) {\r\n// return previous;\r\n// } else {\r\n// return current;\r\n// }\r\n// });\r\n// };\r\n\r\n/*\r\n * Copy a previous result to a new one\r\n * or create a completely new one\r\n */\r\n","import { IshoppingCartProduct, ThunkResult } from '../models';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../constants/constants';\r\nimport { TFunction } from 'i18next';\r\n\r\n// export const addToCart = (product: IshoppingCartProduct, cartName: string) => ({\r\n// type: `ADD_TO_CART_${cartName}`,\r\n// product\r\n// });\r\n\r\nexport function addToCart(\r\n product: IshoppingCartProduct,\r\n cartName: string,\r\n t: TFunction\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({\r\n type: `ADD_TO_CART_${cartName}`,\r\n product\r\n });\r\n toastr.success(\r\n t('toastMessage:success'),\r\n t('toastMessage:addedToCart'),\r\n constants.toastrSuccess\r\n );\r\n };\r\n}\r\nexport const decreaseFromCart = (productID: string, cartName: string) => ({\r\n type: `DECREASE_FROM_CART_${cartName}`,\r\n productID\r\n});\r\nexport const updateQuantityCart = (\r\n quantity: number,\r\n productID: string,\r\n cartName: string\r\n) => ({\r\n type: `UPDATE_QUANTITY_CART_${cartName}`,\r\n productID,\r\n quantity\r\n});\r\nexport const deleteFromCart = (productID: string, cartName: string) => ({\r\n type: `DELETE_FROM_CART_${cartName}`,\r\n productID\r\n});\r\n\r\nexport const toggleShoppingCartModal = (cartName: string) => ({\r\n type: `TOGGLE_MODAL_SHOPPING_CART_${cartName}`\r\n});\r\n","import { TFunction } from 'i18next';\r\nimport * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { IWorkOrder, Ipart, ItableFiltersParams, ThunkResult } from '../models';\r\nimport { workOrderStatusEnum, workOrderVendorsEnum } from '../models-enums';\r\n\r\nimport fileDownload from 'js-file-download';\r\nimport { forEach } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\n\r\n/*\r\n * Convert work order to form data\r\n */\r\nconst workOrderToFormData = (workOrder: IWorkOrder) => {\r\n const workOrderConvertedToFormData = FormUtil.toFormData(workOrder);\r\n\r\n if (workOrder.parts && workOrder.parts.length) {\r\n workOrderConvertedToFormData.delete('parts');\r\n workOrder.parts.forEach((part: Ipart, index: number) => {\r\n if (part.isDeleted) {\r\n return;\r\n }\r\n const newKey = `parts[${index}]`;\r\n forEach(part, (item, key) => {\r\n workOrderConvertedToFormData.append(\r\n `${newKey}.${key}`,\r\n `${item}`\r\n );\r\n });\r\n });\r\n }\r\n return workOrderConvertedToFormData;\r\n};\r\n\r\n/*\r\n * Get Work Orders\r\n * when getting work orders for Beacon, do not send a facility,\r\n * the facility name can be included in the string search\r\n */\r\nexport function getWorkOrders(): ThunkResult {\r\n return (dispatch, getState) => {\r\n const { user } = getState();\r\n const {\r\n ViewInventory,\r\n ManageInventory,\r\n ManageCustomerWorkOrders,\r\n ManageWorkOrderPMP,\r\n ManageWorkOrderAdmin\r\n } = constants.securityFunctions;\r\n\r\n if (\r\n !constants.hasSecurityFunction(user, [\r\n ViewInventory.id,\r\n ManageInventory.id,\r\n ManageCustomerWorkOrders.id,\r\n ManageWorkOrderPMP.id,\r\n ManageWorkOrderAdmin.id\r\n ])\r\n )\r\n return dispatch({\r\n type: types.LOAD_WORKORDERS_SUCCESS,\r\n payload: []\r\n });\r\n\r\n dispatch({\r\n type: types.CLEAR_WORKORDERS\r\n });\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n statusFilter,\r\n dateRange,\r\n workOrderType,\r\n vendor,\r\n assignedUser,\r\n isDeleted,\r\n countryID,\r\n sapWorkOrder\r\n } = getState().manageWorkOrder.tableFilters;\r\n\r\n const statusValue = statusFilter\r\n ? Number.parseInt(statusFilter.value)\r\n : 1;\r\n const dateRangeValue = dateRange ? dateRange.value : null;\r\n const typeValue = workOrderType || null;\r\n\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: {\r\n facilityID:\r\n vendor === workOrderVendorsEnum.beacon\r\n ? null\r\n : selectedFacilityID,\r\n type: typeValue,\r\n search,\r\n statusFilter: statusValue,\r\n dateRange: dateRangeValue,\r\n vendor,\r\n populateFacility: true,\r\n userID: assignedUser ? assignedUser.value : null,\r\n isDeleted: isDeleted ? isDeleted : false,\r\n countryID: countryID ? countryID.value : null,\r\n sapWorkOrders: sapWorkOrder\r\n }\r\n };\r\n\r\n const url = `${API.workOrder.search}?page=${page}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_WORKORDERS_SUCCESS,\r\n payload: data.data.result\r\n });\r\n dispatch({\r\n type: types.WORKORDER_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOAD_WORKORDERS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get workorders');\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * Get work orders for the asset status history\r\n */\r\nexport const getWorkOrdersByFacility = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: {\r\n pagingType: 'none',\r\n facilityID: selectedFacilityID,\r\n status: workOrderStatusEnum.complete,\r\n populateFacility: true\r\n }\r\n };\r\n\r\n const url = API.workOrder.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_WORK_ORDERS_BY_FACILITY_SUCCESS,\r\n payload: data.data.result\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_WORK_ORDERS_BY_FACILITY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get workorders');\r\n });\r\n };\r\n};\r\n\r\n/*\r\n * Get work orders for the asset status history\r\n */\r\nexport const getWorkOrderByID = (id: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.workOrder.single + '/' + id;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.ADD_WORKORDER_SUCCESS,\r\n payload: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.ADD_WORKORDER_SUCCESS,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get workorders');\r\n });\r\n };\r\n};\r\n\r\nexport const addWorkOrder = (workOrder: IWorkOrder): ThunkResult => (\r\n dispatch,\r\n getState\r\n) => {\r\n dispatch(beginAjaxCall());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: workOrderToFormData(workOrder),\r\n headers\r\n };\r\n\r\n const url = API.POST.workOrder.add;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const newWorkOrder = data.data;\r\n dispatch({\r\n type: types.ADD_WORKORDER_SUCCESS,\r\n payload: newWorkOrder\r\n });\r\n // toastr.success(\r\n // 'Success',\r\n // `Created Work Order`,\r\n // constants.toastrSuccess\r\n // );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.ADD_WORKORDER_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'ADD_ORDER_FAILED');\r\n });\r\n};\r\n\r\nexport const updateWorkOrder = (\r\n workOrder: IWorkOrder\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: workOrderToFormData(workOrder),\r\n headers\r\n };\r\n\r\n const url = `${API.workOrder.single}/update/${workOrder.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.EDIT_WORKORDER_SUCCESS,\r\n payload: workOrder\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Updated Work Order`,\r\n constants.toastrSuccess\r\n );\r\n // dispatch({ type: types.TOGGLE_MODAL_EDIT_WORKORDER });\r\n document.dispatchEvent(new CustomEvent('updatedWorkOrders'));\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.EDIT_WORKORDER_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'EDIT_WORKORDER_FAILED');\r\n });\r\n};\r\n\r\nexport const deleteWorkOrder = (\r\n workOrder: IWorkOrder\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = `${API.workOrder.single}/${workOrder.id}`;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.REMOVE_WORKORDER_SUCCESS,\r\n payload: workOrder\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Deleted Work Order`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.REMOVE_WORKORDER_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'REMOVE_WORKORDER_FAILED');\r\n });\r\n};\r\n\r\n/*\r\n * when vendor === 3, we are on the beacon tab and we should not send the facility\r\n */\r\nexport const getTechnicians = (vendor = 1): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n\r\n const statusOption = getState().manageWorkOrder.tableFilters.status;\r\n const status = statusOption\r\n ? statusOption.value\r\n : workOrderStatusEnum.open;\r\n const params =\r\n vendor === 3\r\n ? { vendor, status }\r\n : {\r\n facilityID: selectedFacilityID,\r\n vendor,\r\n status\r\n };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params\r\n };\r\n\r\n const url = API.workOrder.getTechnicians;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_WORKORDER_TECHNICIANS_SUCCESS,\r\n payload: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOAD_WORKORDER_TECHNICIANS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get workorders');\r\n });\r\n };\r\n};\r\n\r\nexport const getWorkOrderCsv = (technician: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n facilityID: selectedFacilityID,\r\n technician,\r\n vendor: 1\r\n }\r\n };\r\n\r\n const url = API.workOrder.getWorkOrderCsv;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({ type: types.LOAD_WORKORDER_CSV_SUCCESS });\r\n const file = data.data;\r\n fileDownload(file, `${technician}s task list.csv`);\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOAD_WORKORDER_CSV_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get workorders csv');\r\n });\r\n };\r\n};\r\n\r\nexport const getPreventativeMaintenancePointCSV = (\r\n workOrder: IWorkOrder\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n if (!workOrder.preventativeMaintenanceChecklist) {\r\n console.error('missing preventative maintenance checklist');\r\n return;\r\n }\r\n const url = `${API.preventativeMaintenancePoint.getCSV}/${workOrder.preventativeMaintenanceChecklist.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({ type: types._SUCCESS });\r\n const file = data.data;\r\n fileDownload(\r\n file,\r\n `${workOrder.activityDescription} tasks.csv`\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types._FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get task list csv');\r\n });\r\n };\r\n};\r\n\r\nexport const setSelectedWorkOrderID = (id: string) => ({\r\n type: types.SET_SELECTED_WORKORDER_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedWorkOrderID = () => ({\r\n type: types.CLEAR_SELECTED_WORKORDER_ID\r\n});\r\nexport const setSelectedFacilityIDForConfirmSelectJob = (id: string) => ({\r\n type: types.SET_SELECTED_MANAGE_WORKORDER_FACILITY_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedFacilityIDForConfirmSelectJob = () => ({\r\n type: types.CLEAR_SELECTED_MANAGE_WORKORDER_FACILITY_ID\r\n});\r\n\r\nexport const toggleEditWorkOrderModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_WORKORDER\r\n});\r\n\r\nexport const toggleWorkOrderCloseModal = () => ({\r\n type: types.TOGGLE_MODAL_CLOSING_NOTES\r\n});\r\n\r\n// export const setWorkOrderTechnician = (technician: string) => ({\r\n// type: types.SET_WORKORDER_TECHNICIAN,\r\n// technician\r\n// });\r\n\r\nexport const onWorkOrderFilterChange = (\r\n value: any,\r\n key: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n let filters: ItableFiltersParams = {};\r\n switch (key) {\r\n case 'search':\r\n filters = { search: value, page: 1 };\r\n break;\r\n case 'status':\r\n filters = {\r\n status: value ? value : null,\r\n page: 1\r\n };\r\n break;\r\n case 'dateRange':\r\n filters = {\r\n dateRange: value ? value : null,\r\n page: 1\r\n };\r\n break;\r\n default:\r\n break;\r\n }\r\n dispatch({\r\n type: types.SET_TABLE_FILTER_MANAGE_WORKORDER,\r\n filters\r\n });\r\n };\r\n};\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => {\r\n return {\r\n type: types.SET_TABLE_FILTER_MANAGE_WORKORDER,\r\n filters\r\n };\r\n};\r\n\r\nexport const setWorkOrderFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_WORKORDER,\r\n formValues\r\n});\r\n\r\nexport const updateWorkOrderFormValue = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_WORKORDER,\r\n formValues\r\n});\r\n\r\nexport const toggleConfirmSelectJobModal = () => ({\r\n type: types.TOGGLE_MODAL_CONFIRM_SELECT_JOB\r\n});\r\n\r\nexport const updateWorkOrderSelection = (selection: string[]) => ({\r\n type: types.WORKORDER_UPDATE_SELECTION,\r\n payload: selection\r\n});\r\n\r\nexport const getFSEsWithWorkOrder = (): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = { method: 'get' };\r\n const url = API.workOrder.getFSEsWithWorkOrders;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n dispatch({\r\n type: types.GET_FSES_WITH_WORK_ORDERS_SUCCESS,\r\n data: data.data\r\n });\r\n })\r\n .catch(error => {\r\n dispatch({ type: types.GET_FSES_WITH_WORK_ORDERS_FAILED });\r\n constants.handleError(error, 'GET_FSEs_WITH_WORK_ORDERS_FAILED');\r\n });\r\n};\r\n\r\nexport const unlinkWorkOrders = (\r\n selection: IWorkOrder[],\r\n t: TFunction\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: selection\r\n };\r\n\r\n const url = API.workOrder.unlinkWorkOrders;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.UNLINK_WORKORDERS_SUCCESS,\r\n selection\r\n });\r\n document.dispatchEvent(\r\n new CustomEvent('clearSelectedWorkOrders')\r\n );\r\n toastr.success(\r\n t('toastMessage:success'),\r\n t('manageWorkOrder:unlinkWorkOrderSuccess'),\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.UNLINK_WORKORDERS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'unlink work orders');\r\n });\r\n };\r\n};\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport { orderBy } from 'lodash';\r\nimport { IjobPart, Ioption, Ipart, ThunkResult } from '../models';\r\n\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\n\r\n/*\r\n * this is used for paging and filtering the jobs on the manage Jobs view\r\n * NOTE: the server automatically filters by the user's country\r\n */\r\n\r\n/**\r\n *\r\n * @param parts\r\n * @returns partOptions sorted by the part description\r\n */\r\nexport const partsToOptions = (parts: unknown): Ioption[] => {\r\n if (Array.isArray(parts)) {\r\n const partOptions = parts.map((item: Ipart) => {\r\n return {\r\n value: item.id,\r\n label: `${item.number} - ${item.description}`,\r\n order: item.description\r\n };\r\n });\r\n return orderBy(partOptions, 'order');\r\n } else {\r\n return [];\r\n }\r\n};\r\n\r\nexport const searchPartsForAsyncSelect = (\r\n search: string\r\n): Promise => {\r\n const url = API.part.search;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { number: search }\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n return partsToOptions(data.data.result);\r\n }\r\n })\r\n .catch((error: any) => {\r\n constants.handleError(error, 'searchPartsForAsyncSelect');\r\n console.error(error);\r\n throw new Error(error);\r\n });\r\n};\r\n\r\nexport const getJobParts = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = API.part.get;\r\n const jobID = getState().manageJob.selectedJob.id;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { jobID }\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_JOB_PARTS_SUCCESS,\r\n payload: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_JOB_PARTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'getJobParts');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\n/*\r\n * saveJob\r\n * persist the job to the Server\r\n */\r\nexport function saveJobParts(jobParts: IjobPart[]): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = API.part.save;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: jobParts\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n }\r\n dispatch({\r\n type: types.SAVE_JOB_PARTS_SUCCESS,\r\n payload: jobParts\r\n });\r\n return data;\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.SAVE_JOB_PARTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'save job parts');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse, Method } from 'axios';\r\nimport { map, omit, unionBy } from 'lodash';\r\nimport {\r\n Ijob,\r\n IjobPart,\r\n IjobWorkOrder,\r\n ItableFiltersParams,\r\n ThunkResult\r\n} from '../models';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport { initialJob } from '../reducers/initialState';\r\nimport { selectJobWorkOrdersForJobID } from '../reducers/manageJobReducer';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { saveJobParts } from './managePartActions';\r\nimport { getWorkOrders } from './manageWorkOrderActions';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\n/*\r\n * this is used for paging and filtering the jobs on the manage Jobs view\r\n * NOTE: the server automatically filters by the user's country\r\n */\r\nexport function getJobs(activeCountryID?: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n type,\r\n startDate,\r\n endDate,\r\n country,\r\n statusFilter,\r\n assignedUser,\r\n isDeleted\r\n } = getState().manageJob.tableFilters;\r\n\r\n const statusValue = statusFilter\r\n ? Number.parseInt(statusFilter.value)\r\n : 1;\r\n\r\n let activeCountryIDValue: string | null = null;\r\n if (activeCountryID) {\r\n activeCountryIDValue = activeCountryID;\r\n } else if (country) {\r\n activeCountryIDValue = country.value;\r\n }\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: {\r\n search,\r\n jobTypeID: type && type.value,\r\n startDate: startDate\r\n ? moment.utc(startDate).toISOString()\r\n : null,\r\n endDate: endDate ? moment.utc(endDate).toISOString() : null,\r\n activeCountryID: activeCountryIDValue\r\n ? activeCountryIDValue\r\n : null,\r\n status: statusValue,\r\n FSEID: assignedUser ? assignedUser.value : null,\r\n isDeleted: isDeleted ? isDeleted : false\r\n }\r\n };\r\n\r\n const url = `${API.job.search}?page=${page}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.JOB_MANAGE_SUCCESS,\r\n jobs: resp.data.result\r\n });\r\n dispatch({\r\n type: types.JOB_MANAGE_TOTAL_PAGES,\r\n pages: resp.data.pages\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.JOB_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get jobs');\r\n console.error(error);\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n };\r\n}\r\n\r\nexport function getJobsByID(id: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.job.single}/${id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({ type: types.JOB_GET_SUCCESS, job: resp.data });\r\n }\r\n })\r\n .catch(error => {\r\n dispatch({ type: types.JOB_GET_FAILED, axiosOptions });\r\n constants.handleError(error, 'get job');\r\n console.error(error, axiosOptions);\r\n });\r\n };\r\n}\r\n\r\nexport const getNextJobNumber = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const url = API.job.getNextAutoNumber;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_NEXT_JOB_NUMBER_SUCCESS,\r\n payload: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_NEXT_JOB_NUMBER_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'getNextJobNumber');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\n/*\r\n * getJobsByFacility is used to populate the job select on the manageReports view\r\n */\r\nexport function getJobsByFacility(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n facilityID: selectedFacilityID\r\n }\r\n };\r\n const url = API.job.getByFacility;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.JOBS_BY_FACILITY_SUCCESS,\r\n jobs: resp.data\r\n }); // TODO make a new unique action for this\r\n dispatch({\r\n type: types.JOB_MANAGE_TOTAL_PAGES,\r\n pages: resp.data.pages\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.JOBS_BY_FACILITY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get all jobs');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * getAllOpenJobsForWorkOrders is used to populate the job select for SAP WOs\r\n */\r\nexport function getAllOpenJobsForWorkOrders(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n const url = API.job.getAllOpenJobsForWorkOrders;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const jobs = resp.data;\r\n const facilities = jobs\r\n .map(job => job.facility)\r\n .filter(Boolean);\r\n dispatch({\r\n type: types.JOBS_REPAIR_MAINTENANCE_SUCCESS,\r\n jobs\r\n });\r\n dispatch({\r\n type: types.ADD_JOB_FACILITY_SUCCESS,\r\n facilities\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.JOBS_REPAIR_MAINTENANCE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get all jobs');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getFSEUsers(preferServer = false): ThunkResult {\r\n return (dispatch, getState) => {\r\n const now = moment();\r\n const diff = now.diff(\r\n moment(getState().syncStatus.fseUsersUpdated, 'X'),\r\n 'minutes'\r\n );\r\n const shouldUpdate = diff > constants.cacheFseUsersMinutes;\r\n\r\n if (shouldUpdate === false && preferServer === false) {\r\n return Promise.resolve();\r\n }\r\n\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {}\r\n };\r\n\r\n const url = API.GET.user.getfseusers;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_FSE_SUCCESS,\r\n\r\n users: resp.data,\r\n updateDate: moment().unix()\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.GET_FSE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'get fse users');\r\n console.error(error);\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n };\r\n}\r\n\r\n// API will not accept dates in dd-MM-yy format\r\nfunction formatDatesForAPI(input: string): string {\r\n const regexYYYYMMDD = /^\\d{4}-\\d{2}-\\d{2}$/;\r\n const regexDDMMMYY = /^\\d{1,2}-[A-Za-z]{3}-\\d{2}$/;\r\n\r\n let dateFormat: string | null = null;\r\n\r\n if (regexYYYYMMDD.test(input)) {\r\n dateFormat = 'yyyy-MM-dd';\r\n } else if (regexDDMMMYY.test(input)) {\r\n dateFormat = 'dd-MMM-yy';\r\n }\r\n\r\n if (dateFormat !== null) {\r\n // Parse the date string\r\n const parsedDate = new Date(input);\r\n\r\n // Format the parsed date to a format acceptable by C#\r\n return parsedDate.toISOString().substring(0, 10);\r\n } else {\r\n return input;\r\n }\r\n}\r\n\r\n/*\r\n * saveJob\r\n * persist the job to the Server\r\n */\r\nexport function saveJob(\r\n job: Ijob,\r\n jobParts: IjobPart[],\r\n isEditMode: boolean,\r\n activeCountryID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n let url = '';\r\n let method: Method = 'put';\r\n\r\n if (isEditMode) {\r\n url = `${API.job.single}/${job.id}`;\r\n method = 'put';\r\n } else {\r\n url = API.POST.job.create;\r\n method = 'post';\r\n }\r\n let jobForAPI = omit(job, ['userJobs', 'createDate', 'updateDate']);\r\n const userIDsForAPI = map(job.userJobs, uj => uj.userID);\r\n jobForAPI = {\r\n ...jobForAPI,\r\n startDate: formatDatesForAPI(jobForAPI.startDate),\r\n endDate: formatDatesForAPI(jobForAPI.endDate)\r\n };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method,\r\n data: { job: jobForAPI, users: userIDsForAPI }\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.JOB_SAVE_SUCCESS,\r\n job\r\n });\r\n // the save might effect the back end filtering so lets filter!\r\n dispatch(getJobs(activeCountryID));\r\n\r\n if (jobParts.length) {\r\n dispatch(saveJobParts(jobParts));\r\n }\r\n return resp.data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.JOB_SAVE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'create job');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * updateSelectedJob\r\n * update the selected job\r\n */\r\nexport const updateSelectedJob = (job = initialJob) => ({\r\n type: types.UPDATE_SELECTED_JOB,\r\n payload: job\r\n});\r\n\r\nexport function deleteJob(jobID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const url = `${API.job.delete}/${jobID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.JOB_DELETE_SUCCESS,\r\n payload: jobID\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.JOB_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete job');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const addWorkOrdersToJob = (\r\n selection: string[],\r\n jobID: string,\r\n t: TFunction,\r\n refreshWorkOrders: boolean = false\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const originalJobWorkOrders = selectJobWorkOrdersForJobID(getState(), {\r\n jobID\r\n });\r\n\r\n const cleanedJobWorkOrders = originalJobWorkOrders.map(item => {\r\n return omit(item, ['job', 'workOrder']);\r\n });\r\n\r\n const workOrderIDs = selection.map(item => {\r\n return item.split('select-')[1];\r\n });\r\n const newJobWorkOrders: IjobWorkOrder[] = workOrderIDs.map(item => {\r\n return { jobID, workOrderID: item, isDeleted: false, id: uuidv4() };\r\n });\r\n const jobWorkOrders = unionBy(\r\n newJobWorkOrders,\r\n cleanedJobWorkOrders,\r\n 'workOrderID'\r\n );\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { id: jobID, jobWorkOrders }\r\n };\r\n const url = API.job.addWorkOrders;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.JOB_UPDATE_WORKORDERS_SUCCESS,\r\n payload: { jobWorkOrders, jobID }\r\n });\r\n document.dispatchEvent(\r\n new CustomEvent('clearSelectedWorkOrders')\r\n );\r\n toastr.success(\r\n t('toastMessage:success'),\r\n t('toastMessage:addedWorkOrderToJob'),\r\n constants.toastrError\r\n );\r\n\r\n if (refreshWorkOrders) {\r\n dispatch(getWorkOrders());\r\n dispatch(getAllOpenJobsForWorkOrders());\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.JOB_UPDATE_WORKORDERS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'add work orders to job');\r\n });\r\n };\r\n};\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_JOB,\r\n filters\r\n});\r\n","import { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport {\r\n IcloudDocument,\r\n ItableFiltersParams,\r\n ItableFiltersReducer,\r\n ThunkResult\r\n} from '../models';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport fileDownload from 'js-file-download';\r\nimport { TFunction } from 'i18next';\r\nimport { convertDateRangeToInterval } from './manageAssetPhotosActions';\r\nimport { dateRangeEnum } from '../models-enums';\r\n\r\nexport function getDocuments(\r\n t: TFunction,\r\n tableFilters: Partial\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n\r\n const {\r\n assetSearch,\r\n mainCategoryID,\r\n type,\r\n jobType,\r\n dateRange,\r\n isSystem\r\n } = tableFilters;\r\n const { startDate, endDate } = dateRange\r\n ? convertDateRangeToInterval(dateRange?.value as dateRangeEnum)\r\n : { startDate: undefined, endDate: undefined };\r\n if (!selectedFacilityID.length) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Must select a facility.'),\r\n constants.toastrWarning\r\n );\r\n dispatch(endAjaxCall());\r\n return Promise.resolve();\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n facilityID: selectedFacilityID,\r\n search: assetSearch,\r\n mainCategoryID,\r\n start: startDate,\r\n end: endDate,\r\n isSystem: isSystem ? JSON.parse(isSystem.value) : undefined,\r\n documentTypeID: type ? type.value : undefined,\r\n jobTypeID: jobType ? jobType.value : undefined\r\n }\r\n };\r\n const regex = /^\\?installbaseId=.*$/i;\r\n const location = window.location.search;\r\n const installBaseSearch =\r\n location && location.match(regex) ? location : '';\r\n let url = installBaseSearch\r\n ? `${API.cloudDocument.installSearch}${installBaseSearch}`\r\n : API.cloudDocument.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('Missing Data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_DOCUMENTS_SUCCESS,\r\n payload: data.data\r\n });\r\n dispatch({\r\n type: types.BRAND_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch(error => {\r\n dispatch({\r\n type: types.LOAD_DOCUMENTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get Documents');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/**\r\n *\r\n * @param cloudDocument\r\n * @param shouldDownload\r\n * @returns objectURL to the downloaded image\r\n */\r\nexport function getCloudDocument(\r\n t: TFunction,\r\n cloudDocument?: Partial,\r\n shouldDownload = false\r\n): ThunkResult {\r\n const ensureDocType = (\r\n name: string | undefined,\r\n mimeType: string\r\n ): string | null => {\r\n const pattern = new RegExp(\r\n '(xlsx|xls|doc|docx|ppt|pptx|txt|pdf|zip|png|jpg|jpeg|gif|avif|webp|x-zip-compressed)$',\r\n 'gi'\r\n );\r\n let type = mimeType.match(pattern)?.[0] ?? 'pdf';\r\n\r\n if (type === 'x-zip-compressed') {\r\n type = 'zip';\r\n }\r\n return name\r\n ? name.match(pattern) !== null\r\n ? name\r\n : `${name}.${type}`\r\n : null;\r\n };\r\n\r\n return (dispatch, getState) => {\r\n if (!cloudDocument?.documentID) {\r\n toastr.warning('Missig document', '', constants.toastrWarning);\r\n console.error('missing cloud doc', cloudDocument);\r\n return;\r\n }\r\n\r\n toastr.success(\r\n 'Success',\r\n t('manageDocument:downloading'),\r\n constants.toastrSuccess\r\n );\r\n\r\n dispatch(beginAjaxCall());\r\n\r\n let url = API.cloudDocument.downloadVersion\r\n .replace('{documentID}', cloudDocument?.documentID || '')\r\n .replace('{versionID}', cloudDocument?.version || '');\r\n if (!cloudDocument?.version?.length) {\r\n url = API.cloudDocument.download.replace(\r\n '{documentID}',\r\n cloudDocument?.documentID || ''\r\n );\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {},\r\n responseType: 'blob',\r\n timeout: constants.httpTimeoutDownload\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('Missing Data');\r\n } else {\r\n dispatch({ type: types.DOWNLOAD_DOCUMENT_SUCCESS });\r\n\r\n if (shouldDownload) {\r\n const { filename, name } = cloudDocument;\r\n const mimeType =\r\n cloudDocument?.mimeType || 'application/pdf';\r\n const safeName =\r\n ensureDocType(filename, mimeType) ||\r\n ensureDocType(name, mimeType) ||\r\n 'document.pdf';\r\n\r\n fileDownload(data.data, safeName, mimeType);\r\n }\r\n return window.URL.createObjectURL(data.data);\r\n }\r\n })\r\n .catch(error => {\r\n dispatch({\r\n type: types.DOWNLOAD_DOCUMENT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'Download Documents');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function deleteVersion(\r\n parentId: string,\r\n version: IcloudDocument\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const url = `${API.cloudDocument.delete}/${version.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (data.status !== 200) {\r\n throw new Error('Missing Data');\r\n } else {\r\n dispatch({\r\n type: types.REMOVE_DOCUMENT_SUCCESS,\r\n payload: version,\r\n parentId\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Version successfully deleted`,\r\n constants.toastrSuccess\r\n );\r\n }\r\n })\r\n .catch(error => {\r\n dispatch({\r\n type: types.LOAD_DOCUMENTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'Delete version');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const updateDocumentFormValue = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_DOCUMENT,\r\n formValues\r\n});\r\n\r\nexport const setDocumentFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_DOCUMENT,\r\n formValues\r\n});\r\n\r\nexport const updateVersionFormValue = (formValues: { [key: string]: any }) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_DOCUMENT_VERSION,\r\n formValues\r\n});\r\n\r\nexport const setVersionFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_DOCUMENT_VERSION,\r\n formValues\r\n});\r\n\r\nexport const setSelectedParentID = (id: string) => ({\r\n type: types.SET_SELECTED_PARENT_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedParentID = () => ({\r\n type: types.CLEAR_SELECTED_PARENT_ID\r\n});\r\n\r\nexport const setSelectedDocumentID = (id: string) => ({\r\n type: types.SET_SELECTED_DOCUMENT_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedDocumentID = () => ({\r\n type: types.CLEAR_SELECTED_DOCUMENT_ID\r\n});\r\n\r\nexport const toggleEditDocumentModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_DOCUMENT\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_DOCUMENT,\r\n filters\r\n});\r\nexport const clearTableFilters = () => ({\r\n type: types.CLEAR_TABLE_FILTERS_MANAGE_DOCUMENT\r\n});\r\n","/*\r\n * Installs Action Button\r\n */\r\n\r\nimport { IinstallBase } from '../../models';\r\nimport {\r\n clearSelectedInstallBaseID,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleEditInstallModal,\r\n toggleEditProductModal,\r\n toggleInstallContactModal,\r\n toggleMPResultHistory,\r\n toggleMPResultModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase\r\n} from '../../actions/measurementPointResultsActions';\r\n\r\nimport { InstallBaseActionButton } from './InstallBaseActionButton';\r\nimport { RowInfo } from 'react-table';\r\nimport { TFunction } from 'i18next';\r\nimport { addToCart } from '../../actions/shoppingCartActions';\r\nimport { connect } from 'react-redux';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n getWorkOrdersByFacility,\r\n toggleWorkOrderCloseModal\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getJobsByFacility } from '../../actions/manageJobActions';\r\nimport { getCanCreateAsManager } from '../../reducers/userReducer';\r\nimport { clearTableFilters } from '../../actions/manageDocumentActions';\r\n\r\ninterface RowInfoInstallBase extends RowInfo {\r\n original: IinstallBase;\r\n}\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n rowInfo: RowInfoInstallBase;\r\n colorButton: string;\r\n forMobile: boolean;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const { selectedFacilityID } = state;\r\n const selectedInstallBase = ownProps.rowInfo.original;\r\n\r\n const facility = state.facilities[selectedFacilityID] || initialFacility;\r\n const showMoveFacility = getCanCreateAsManager(state.user);\r\n\r\n return {\r\n facility,\r\n loading: selectIsLoading(state),\r\n selectedInstallBase,\r\n showMoveFacility\r\n };\r\n};\r\n\r\nexport const InstallBaseActionButtonContainer = connect(mapStateToProps, {\r\n addToCart,\r\n toggleEditWorkOrderModal,\r\n toggleMPResultModal,\r\n toggleMPResultHistory,\r\n toggleEditProductModal,\r\n setSelectedInstallBaseID,\r\n clearSelectedInstallBaseID,\r\n toggleEditInstallModal,\r\n setSelectedProductID,\r\n toggleInstallContactModal,\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase,\r\n toggleWorkOrderCloseModal,\r\n setSelectedWorkOrderID,\r\n getWorkOrdersByFacility,\r\n getJobsByFacility,\r\n clearTableFilters\r\n})(InstallBaseActionButton);\r\n","import * as React from 'react';\r\n\r\nimport { Col, DropdownButton, MenuItem } from 'react-bootstrap';\r\nimport {\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase\r\n} from '../../actions/measurementPointResultsActions';\r\nimport {\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleInstallContactModal,\r\n toggleMPResultHistory,\r\n toggleMPResultModal\r\n} from '../../actions/manageInventoryActions';\r\n\r\nimport { IinstallBase } from '../../models';\r\nimport { TFunction } from 'i18next';\r\nimport { measurementPointResultStatusTypesEnum } from '../../models-enums';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n getWorkOrdersByFacility\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { getJobsByFacility } from '../../actions/manageJobActions';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { clearTableFilters } from '../../actions/manageDocumentActions';\r\ninterface Iprops {\r\n t: TFunction;\r\n selectedInstallBase: IinstallBase;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n setSelectedInstallBaseID: typeof setSelectedInstallBaseID;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n toggleMPResultModal: typeof toggleMPResultModal;\r\n toggleMPResultHistory: typeof toggleMPResultHistory;\r\n colorButton: string;\r\n getFacilityMeasurementPointResults: typeof getFacilityMeasurementPointResults;\r\n getMeasurementPointResultsHistoryByInstallBase: typeof getMeasurementPointResultsHistoryByInstallBase;\r\n toggleWorkOrderCloseModal: () => any;\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n getWorkOrdersByFacility: typeof getWorkOrdersByFacility;\r\n getJobsByFacility: typeof getJobsByFacility;\r\n openSearchFacilityModal: (ids: string[]) => void;\r\n showMoveFacility: boolean;\r\n forMobile: boolean;\r\n clearTableFilters: typeof clearTableFilters;\r\n}\r\n\r\nexport const InstallBaseActionButton = (props: Iprops) => {\r\n const { t, selectedInstallBase } = props;\r\n const notTested =\r\n selectedInstallBase.measurementPointListResultStatus ===\r\n measurementPointResultStatusTypesEnum.resultStatusNotTested;\r\n\r\n // Mobile!\r\n if (props.forMobile) {\r\n return (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1: // history\r\n /*\r\n * 1/11/21 - this used to get all MPR for a facility,\r\n * now only gets them for a specific InstallBase.\r\n * This was also getting all jobs for facility, removed that, should already have jobs\r\n * A good TODO is to only get 1 WorkOrder by ID instead of all for Facility\r\n */\r\n props.getWorkOrdersByFacility();\r\n props.getMeasurementPointResultsHistoryByInstallBase(\r\n selectedInstallBase.id\r\n );\r\n\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n\r\n props.toggleMPResultHistory();\r\n break;\r\n case 2: // last inspection\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n props.toggleMPResultModal();\r\n break;\r\n case 5: // contact support\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n props.toggleInstallContactModal();\r\n break;\r\n case 6:\r\n props.clearTableFilters();\r\n break;\r\n default:\r\n break;\r\n }\r\n }}\r\n >\r\n \r\n {t('dashboardAnalytics:inspectionHistory')}\r\n \r\n \r\n {t('dashboardAnalytics:lastInspection')}\r\n \r\n \r\n {t('dashboardAnalytics:contactSupport')}\r\n \r\n \r\n \r\n {t('dashboardAnalytics:viewInReports')}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n // Desktop!\r\n return (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1: // history\r\n /*\r\n * 1/11/21 - this used to get all MPR for a facility,\r\n * now only gets them for a specific InstallBase.\r\n * This was also getting all jobs for facility, removed that, should already have jobs\r\n * A good TODO is to only get 1 WorkOrder by ID instead of all for Facility\r\n */\r\n props.getWorkOrdersByFacility();\r\n props.getMeasurementPointResultsHistoryByInstallBase(\r\n selectedInstallBase.id\r\n );\r\n\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n\r\n props.toggleMPResultHistory();\r\n break;\r\n case 2: // last inspection\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n props.toggleMPResultModal();\r\n break;\r\n // case 3: // repair (work order close)\r\n // props.setSelectedProductID(selectedInstallBase.productID);\r\n // props.setSelectedInstallBaseID(selectedInstallBase.id);\r\n // props.toggleWorkOrderCloseModal();\r\n // break;\r\n case 4: // add work order\r\n props.setSelectedWorkOrderID('');\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n props.toggleEditWorkOrderModal();\r\n break;\r\n case 5: // contact support\r\n props.setSelectedProductID(\r\n selectedInstallBase.productID\r\n );\r\n props.setSelectedInstallBaseID(\r\n selectedInstallBase.id\r\n );\r\n props.toggleInstallContactModal();\r\n break;\r\n case 6: //Change Facility\r\n props.openSearchFacilityModal([\r\n selectedInstallBase.id\r\n ]);\r\n break;\r\n case 7:\r\n props.clearTableFilters();\r\n break;\r\n default:\r\n break;\r\n }\r\n }}\r\n >\r\n \r\n {t('dashboardAnalytics:inspectionHistory')}\r\n \r\n \r\n {t('dashboardAnalytics:lastInspection')}\r\n \r\n {/* {t('dashboardAnalytics:repairAsset')} */}\r\n \r\n {t('dashboardAnalytics:addWorkOrder')}\r\n \r\n \r\n {t('dashboardAnalytics:contactSupport')}\r\n \r\n \r\n \r\n {t('dashboardAnalytics:viewInReports')}\r\n \r\n \r\n {props.showMoveFacility && (\r\n \r\n {t('dashboardAnalytics:changeFacility')}\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nimport { constants } from '../../constants/constants';\r\n\r\ntype Iprops = {\r\n title: string;\r\n img: any;\r\n subtitle?: string;\r\n color: string;\r\n};\r\n\r\nexport const Banner: React.FunctionComponent = ({\r\n title,\r\n img,\r\n color,\r\n subtitle,\r\n children\r\n}) => {\r\n const colorIndex = `${color}Banner`;\r\n\r\n return (\r\n \r\n {title}\r\n {subtitle && {subtitle}}\r\n {children}\r\n
\r\n );\r\n};\r\n","/*\r\n * UserForm\r\n * User signs up directly to the platform\r\n */\r\n\r\nimport * as React from 'react';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Col, Button, Row } from 'react-bootstrap';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { TFunction } from 'i18next';\r\nimport { forEach } from 'lodash';\r\nimport { constants } from '../../constants/constants';\r\n\r\ninterface Iprops extends React.Props {\r\n fieldConfig: FieldConfig;\r\n handleSubmit: any;\r\n loading: boolean;\r\n showSearchButton?: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n onValueChanges?: (value: any, key: string) => void;\r\n subscribeValueChanges?: boolean;\r\n showAdditionalFiltersButton?: boolean;\r\n showAdditionalFilters?: boolean;\r\n hasActiveAdditionalFilters?: boolean;\r\n xs?: number;\r\n lg?: number;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nexport default class SearchTableForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private showBtn: boolean;\r\n // private onValueChangesDebounced?: (value: any, key: string) => void; // we don't do this because we want some actions to be as fast as possible\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.showBtn =\r\n typeof this.props.showSearchButton === 'undefined'\r\n ? false\r\n : this.props.showSearchButton;\r\n this.state = {\r\n fieldConfig: { controls: {} }\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.setState(\r\n {\r\n fieldConfig: FormUtil.translateForm(\r\n this.props.fieldConfig,\r\n this.props.t\r\n )\r\n },\r\n () => {\r\n this.handleUpdatedFieldConfig();\r\n }\r\n );\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n JSON.stringify(prevProps.fieldConfig) !==\r\n JSON.stringify(this.props.fieldConfig)\r\n ) {\r\n // console.info('search field config changed', this.props.fieldConfig);\r\n this.setState(\r\n {\r\n fieldConfig: FormUtil.translateForm(\r\n this.props.fieldConfig,\r\n this.props.t\r\n )\r\n },\r\n () => {\r\n this.handleUpdatedFieldConfig();\r\n }\r\n );\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n handleUpdatedFieldConfig = () => {\r\n forEach(this.state.fieldConfig.controls, (input: any, key) => {\r\n if (key.indexOf('$field_') !== -1) {\r\n // skip elements that are display only\r\n return;\r\n }\r\n\r\n if (input.meta && input.meta.defaultValue) {\r\n this.formGroup.patchValue({ [key]: input.meta.defaultValue });\r\n }\r\n\r\n if (this.props.subscribeValueChanges) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n if (this.props.onValueChanges) {\r\n this.props.onValueChanges(value, key);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n\r\n handleToggleAdditionalFilters = () => {\r\n if (this.props.onValueChanges) {\r\n this.props.onValueChanges(\r\n !this.props.showAdditionalFilters,\r\n 'showAdditionalFilters'\r\n );\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n this.props.handleSubmit(this.formGroup.value);\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n {!!this.props.showAdditionalFiltersButton && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {this.props.children}\r\n {this.showBtn && (\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 { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { IcountryBE } from '../models';\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\n\r\nexport const loadCountries = (\r\n dispatch: Function,\r\n currentCountries?: IcountryBE[]\r\n) => {\r\n if (currentCountries && currentCountries.length > 0) {\r\n return;\r\n }\r\n dispatch(beginAjaxCall());\r\n const url = API.country.getAll;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch(setCountries(data.data));\r\n })\r\n .catch(e => {\r\n constants.handleError(e, 'get Documents');\r\n console.error(e);\r\n })\r\n .finally(() => endAjaxCall());\r\n};\r\n\r\nexport const setCountries = (countries: IcountryBE[]) => ({\r\n type: types.SET_COUNTRIES,\r\n payload: countries\r\n});\r\n\r\nexport default {}; // Typescript yells and won't compile without this...\r\n","import { IinitialState } from '.';\r\nimport * as types from '../actions/actionTypes';\r\nimport { Icountry, IcountryBE } from '../models';\r\n\r\nexport const getCountries = (state: IinitialState): IcountryBE[] =>\r\n state.countries;\r\n\r\nexport default function countriesReducer(\r\n state: IcountryBE[] = [],\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.SET_COUNTRIES:\r\n return action.payload;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport * as types from '../../actions/actionTypes';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormControl,\r\n FormGenerator\r\n} from 'react-reactive-form';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { FormGroup } from 'react-bootstrap';\r\nimport { debounce, forEach } from 'lodash';\r\n\r\nimport {\r\n Ifacility,\r\n IfacilityWithoutBuildings,\r\n Ioption,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect,\r\n setSelectedFacilityID\r\n} from '../../actions/commonActions';\r\nimport { FormUtil } from './FormUtil';\r\nimport { constants } from '../../constants/constants';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n getUsersActiveCountry,\r\n getUsersCountries\r\n} from '../../reducers/userReducer';\r\nimport { loadCountries } from '../../actions/countriesActions';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { getUser } from '../../reducers/manageUserReducer';\r\nimport { initialFacility } from '../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n loading: boolean;\r\n user: Iuser;\r\n selectedFacility: IfacilityWithoutBuildings;\r\n selectedFacilityID: string;\r\n setSelectedFacilityID: typeof setSelectedFacilityID;\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => any;\r\n classNameOverride: string;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n facilities: Ifacility[];\r\n activeLocalCountry: string;\r\n isRenderedInModal?: boolean;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nconst SelectFacilityForm: React.FC = props => {\r\n const usersCountries = useSelector(getUsersCountries);\r\n const usersActiveCountry = useSelector(getUsersActiveCountry);\r\n const user = useSelector(getUser);\r\n const countries = useSelector(getCountries);\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n isRenderedInModal,\r\n activeLocalCountry: usersLocalActiveCountry\r\n } = props;\r\n\r\n const saveFacilities = (facilities: Ifacility[]) => {\r\n dispatch({\r\n type: types.GET_FACILITIES_SUCCESS,\r\n facilities\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n loadCountries(dispatch, countries);\r\n }, []);\r\n\r\n const loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n usersLocalActiveCountry || usersActiveCountry, // use local country if it exists, otherwise use the user's active country,\r\n null,\r\n callback,\r\n saveFacilities\r\n );\r\n return;\r\n }\r\n\r\n callback();\r\n }, 200);\r\n const [state, setState] = React.useState();\r\n\r\n const generateFacilityOption = (\r\n facility: IfacilityWithoutBuildings\r\n ): Ioption => {\r\n let nameWithAddress = `${facility.name} | ${facility.address}${\r\n facility.address2 ? ' ' + facility.address2 : ''\r\n } ${facility.city} ${facility.state} ${facility.postalCode}`;\r\n\r\n return {\r\n value: facility.id,\r\n label: nameWithAddress\r\n };\r\n };\r\n\r\n React.useEffect(() => {\r\n let facilityClass = 'banner-input';\r\n if (props.classNameOverride !== '') {\r\n facilityClass = props.classNameOverride;\r\n }\r\n\r\n // Default to the user's active country, but if they have a local country set, use that instead\r\n const countryToUse =\r\n usersLocalActiveCountry !== ''\r\n ? usersLocalActiveCountry\r\n : usersActiveCountry;\r\n\r\n let facililty = props.selectedFacility;\r\n\r\n if (facililty.countryID !== countryToUse || facililty.id === '') {\r\n const userFacililty = user.facilities.find(\r\n f => f.countryID === countryToUse\r\n );\r\n\r\n // If the user somehow has a country, but no facilities from that country, then they must have the AllowAllCountries SF\r\n if (userFacililty !== undefined) {\r\n facililty = userFacililty;\r\n } else {\r\n facililty = initialFacility;\r\n }\r\n }\r\n\r\n const facilityOption = generateFacilityOption(facililty);\r\n // Set the selected facility ID in the store\r\n props.setSelectedFacilityID(facilityOption.value);\r\n\r\n const activeCountryOption: Ioption = {\r\n value: countryToUse,\r\n label: countries.find(c => c.id === countryToUse)?.name || ''\r\n };\r\n const countriesOptions: Ioption[] = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => ({ label: c.name, value: c.id }));\r\n const country = {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'manageInventory:activeCountry',\r\n colWidth: !isRenderedInModal ? 2 : 12,\r\n colWidthMedium: !isRenderedInModal ? 2 : 12,\r\n colWidthLarge: !isRenderedInModal ? 2 : 12,\r\n placeholder: 'manageInventory:searchPlaceholder',\r\n name: 'country',\r\n defaultValue: activeCountryOption,\r\n className: 'banner-input'\r\n },\r\n\r\n formState: { value: activeCountryOption, disabled: false }\r\n };\r\n\r\n const facility = {\r\n render: FormUtil.AsyncSelect,\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n meta: {\r\n label: 'manageInventory:facility',\r\n loadOptions,\r\n colWidth: !isRenderedInModal ? 4 : 12,\r\n colWidthMedium: !isRenderedInModal ? 4 : 12,\r\n colWidthLarge: !isRenderedInModal ? 4 : 12,\r\n required: true,\r\n type: 'select',\r\n placeholder: 'manageInventory:facilityRequired',\r\n className: facilityClass\r\n },\r\n formState: {\r\n value: facilityOption,\r\n disabled: false\r\n }\r\n };\r\n\r\n const fieldConfig = {\r\n controls: { country, facility }\r\n };\r\n\r\n setState({ fieldConfig: FormUtil.translateForm(fieldConfig, props.t) });\r\n }, [countries, usersLocalActiveCountry]);\r\n\r\n let formGroup: FormGroup | any;\r\n let subscription: any[];\r\n let setFacilitySearchTimeout: any;\r\n\r\n const handleSetFacility = (value: any) => {\r\n // causes performance issues so we use a rudamentary debounce\r\n if (value && value.value) {\r\n clearTimeout(setFacilitySearchTimeout);\r\n\r\n setFacilitySearchTimeout = setTimeout(() => {\r\n dispatch({\r\n type: types.GLOBAL_SET_SELECTED_FACILITY_ID,\r\n id: value.value\r\n });\r\n }, constants.tableSearchDebounceTime);\r\n }\r\n };\r\n\r\n const setFacilityFormToDefault = (\r\n facilityForm: FormControl,\r\n countryID: string\r\n ) => {\r\n const facililty = user.facilities.find(f => f.countryID === countryID);\r\n\r\n if (facililty) {\r\n facilityForm.setValue(generateFacilityOption(facililty));\r\n } else {\r\n facilityForm.setValue('');\r\n facilityForm.setErrors({ required: true });\r\n facilityForm.markAsSubmitted();\r\n }\r\n };\r\n\r\n const getFacilityForm = (formGroup: any): FormControl => {\r\n return formGroup.get('facility');\r\n };\r\n\r\n const handleCountryChange = (value: Ioption) => {\r\n const countryID = value.value;\r\n\r\n dispatch({ type: types.UPDATE_USER_LOCAL_COUNTRY, payload: countryID });\r\n };\r\n\r\n const subscribeToValueChanges = () => {\r\n if (!subscription) {\r\n subscription = [];\r\n }\r\n subscription.push(\r\n formGroup.get('facility').valueChanges.subscribe((value: any) => {\r\n handleSetFacility(value);\r\n })\r\n );\r\n subscription.push(\r\n formGroup.get('country').valueChanges.subscribe((value: any) => {\r\n handleCountryChange(value);\r\n })\r\n );\r\n };\r\n\r\n const unsubscribe = () => {\r\n if (subscription && subscription.length) {\r\n subscription.forEach(s => s?.unsubscribe());\r\n }\r\n };\r\n\r\n const handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n };\r\n\r\n const setForm = (form: AbstractControl) => {\r\n formGroup = form;\r\n formGroup.meta = {\r\n loading: props.loading\r\n };\r\n const facForm = getFacilityForm(formGroup);\r\n\r\n if (facForm.value.value === '') {\r\n const countryToUse =\r\n usersLocalActiveCountry !== ''\r\n ? usersLocalActiveCountry\r\n : usersActiveCountry;\r\n\r\n setFacilityFormToDefault(facForm, countryToUse);\r\n }\r\n subscribeToValueChanges();\r\n };\r\n const formClassName = `beacon-form select-facility-form`;\r\n return (\r\n
\r\n
\r\n {state?.fieldConfig && (\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\nexport default withTranslation('manageInventory')(SelectFacilityForm);\r\n","/*\r\n * Facility Form Container\r\n */\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect,\r\n setSelectedFacilityID\r\n} from '../../actions/commonActions';\r\nimport { initialFacility } from '../../reducers/initialState';\r\n\r\nimport SelectFacilityForm from './SelectFacilityForm';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n getFacilities,\r\n selectSelectedFacility,\r\n selectSelectedFacilityID\r\n} from '../../reducers/facilitiesReducer';\r\nimport { TFunction } from 'i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n classNameOverride?: string;\r\n t: TFunction;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const selectedFacilityID = selectSelectedFacilityID(state);\r\n let selectedFacility = selectSelectedFacility(state) || initialFacility;\r\n const facilities = Object.values(getFacilities(state));\r\n\r\n if (selectedFacility.id === '') {\r\n const tempFacility = facilities.find(x => x.id === selectedFacilityID);\r\n if (tempFacility !== undefined) {\r\n selectedFacility = tempFacility;\r\n }\r\n }\r\n\r\n return {\r\n selectedFacility,\r\n selectedFacilityID,\r\n loading: selectIsLoading(state),\r\n user: state.user,\r\n facilities,\r\n activeLocalCountry: state.manageUser.activeLocalCountry\r\n };\r\n};\r\n\r\nexport const SelectFacilityContainer = connect(mapStateToProps, {\r\n setSelectedFacilityID,\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect\r\n})(SelectFacilityForm);\r\n","import * as React from 'react';\r\n\r\nimport { Column, RowRenderProps } from 'react-table';\r\nimport { Ifacility, IinstallBase } from '../../models';\r\nimport { find, map } from 'lodash';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport FolderIcon from '../../images/folder.svg';\r\n\r\nexport const TableUtil = {\r\n translateHeaders: (columns: Column[], t: TFunction) => {\r\n return map(columns, column => {\r\n if (column.Header && typeof column.Header === 'string') {\r\n return { ...column, Header: t(column.Header) };\r\n }\r\n return column;\r\n });\r\n },\r\n /*\r\n * take the install and find the names for the location id's. building, floor, locations, rooms, position\r\n */\r\n buildLocation: (install: IinstallBase, facility: Ifacility) => {\r\n let locationString = '';\r\n const building = find(facility.buildings, {\r\n id: install.buildingID\r\n });\r\n\r\n if (building) {\r\n locationString += building.name;\r\n const floor = find(building.floors, { id: install.floorID });\r\n if (floor) {\r\n locationString += `: ${floor.name}`;\r\n const location = find(floor.locations, {\r\n id: install.locationID\r\n });\r\n if (location) {\r\n locationString += `: ${location.name}`;\r\n const room = find(location.rooms, { id: install.roomID });\r\n if (room) {\r\n locationString += `: ${room.name}`;\r\n }\r\n }\r\n }\r\n }\r\n if (install.position) {\r\n locationString += `: ${install.position}`;\r\n }\r\n return locationString;\r\n },\r\n\r\n expanderToggleFolder: (props: RowRenderProps) => {\r\n let style = { transform: 'rotate(-90deg)' };\r\n\r\n if (props.isExpanded) {\r\n style = { transform: 'rotate(0)' };\r\n }\r\n\r\n const folderStyle: React.CSSProperties = {\r\n marginRight: 5,\r\n marginBottom: 5\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n\r\n expanderToggle: (props: RowRenderProps) => {\r\n let style = { transform: 'rotate(-90deg)' };\r\n\r\n if (props.isExpanded) {\r\n style = { transform: 'rotate(0)' };\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n};\r\n","/*\r\nWork Order Expander\r\n*/\r\n\r\nimport * as React from 'react';\r\n\r\nimport { IWorkOrder, IinstallBase } from '../../models';\r\nimport ReactTable, { Column, RowInfo } from 'react-table';\r\n\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\nimport { orderBy } from 'lodash';\r\nimport { workOrderStatusEnum } from '../../models-enums';\r\n\r\ninterface RowInfoInstallBase extends RowInfo {\r\n original: IinstallBase;\r\n}\r\ninterface ExpanderProps extends RowInfo {\r\n t: TFunction;\r\n original: IinstallBase;\r\n}\r\n\r\n/*\r\n * The Work Order Expander\r\n */\r\nexport const WorkOrderExpander: React.SFC = (\r\n props: ExpanderProps\r\n) => {\r\n const sortedData = orderBy(\r\n props.original.workOrders,\r\n res => moment.utc(res.dueDate).unix(),\r\n 'desc'\r\n );\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'manageWorkOrder:number',\r\n accessor: 'number',\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'manageWorkOrder:activity',\r\n accessor: 'activityDescription',\r\n minWidth: 220\r\n },\r\n {\r\n Header: 'manageWorkOrder:technician',\r\n id: 'technician',\r\n accessor: 'technician',\r\n minWidth: 150\r\n },\r\n {\r\n Header: 'manageWorkOrder:dueDate',\r\n id: 'dueDate',\r\n accessor: ({ dueDate }: IWorkOrder) => {\r\n return moment\r\n .utc(dueDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n }\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: ({ status }: IWorkOrder) => {\r\n const statusString = workOrderStatusEnum[status];\r\n\r\n return (\r\n {`${props.t(\r\n 'manageMeasurementPointLists:' + statusString\r\n )}`}\r\n );\r\n },\r\n minWidth: 100\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n return (\r\n
\r\n = 10\r\n : false\r\n }\r\n />\r\n
\r\n );\r\n // } else {\r\n // return null;\r\n // }\r\n};\r\n","import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { TFunction } from 'i18next';\r\nimport { forEach, map } from 'lodash';\r\nimport * as React from 'react';\r\nimport {\r\n Button,\r\n Col,\r\n ControlLabel,\r\n Dropdown,\r\n FormGroup,\r\n ListGroup,\r\n ListGroupItem,\r\n MenuItem\r\n} from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup as ReactiveFormGroup\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport { IbaseFormMeta } from '../../modelsForms';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport CommonModal from './CommonModal';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\nconst initialItem = {\r\n isDeleted: false,\r\n id: ''\r\n};\r\nexport interface ImultiControlMeta extends IbaseFormMeta {\r\n t: TFunction;\r\n buttonLabel: string;\r\n colorButton: string;\r\n modalTitle: string;\r\n getItemTitle: (item: { id: string } | any) => string;\r\n // actions - for passing in labels and functions to show in the dropdown\r\n actions: Array<{\r\n onClick: (item: { id: string }) => void;\r\n label: string;\r\n getTitle?: (item: typeof initialItem | any) => string;\r\n }>;\r\n disableEdit?: boolean;\r\n disableDelete?: boolean;\r\n itemEditFieldConfig: FieldConfig;\r\n onValueChanges?: (\r\n item: typeof initialItem | any,\r\n formGroup?: FormGroup\r\n ) => void; // callback with the changes to the item and the multiControlFormGroup (for use when you need to patch)\r\n readonly?: boolean;\r\n}\r\ninterface Iprops {\r\n meta: ImultiControlMeta;\r\n handler: any;\r\n pristine: boolean;\r\n errors: any;\r\n submitted: boolean;\r\n}\r\n\r\ninterface Istate {\r\n showModal: boolean;\r\n selectedItem: typeof initialItem;\r\n itemEditFieldConfig: FieldConfig;\r\n}\r\n\r\ninterface ImultiDropdownProps extends Iprops {\r\n item: typeof initialItem;\r\n index: number;\r\n handleSelect: (eventKey: any, item: any) => void;\r\n}\r\n\r\n/*\r\n * MultiDropdown\r\n * dropdown for multiple actions\r\n */\r\nconst MultiDropdown = (props: ImultiDropdownProps) => (\r\n
  • \r\n {\r\n props.handleSelect(eventKey, props.item);\r\n }}\r\n style={{\r\n textAlign: 'left'\r\n }}\r\n >\r\n \r\n \r\n {props.meta.getItemTitle(props.item)}\r\n \r\n \r\n \r\n \r\n {props.meta.disableEdit !== true && (\r\n \r\n {props.meta.t('common:edit')}\r\n \r\n )}\r\n {props.meta.disableDelete !== true && (\r\n \r\n {props.meta.t('common:delete')}\r\n \r\n )}\r\n {props.meta.actions &&\r\n props.meta.actions.map((actionItem, actionIndex) => {\r\n return (\r\n \r\n {props.meta.t(actionItem.label)}\r\n \r\n );\r\n })}\r\n \r\n \r\n
  • \r\n);\r\n\r\n/*\r\n * SingleButton Component\r\n * when there is only a single action\r\n */\r\nconst SingleButton = (props: ImultiDropdownProps) => (\r\n props.handleSelect(0, props.item)}\r\n >\r\n \r\n {props.meta.getItemTitle(props.item)}\r\n \r\n \r\n \r\n);\r\n\r\nclass AddMultiControlClass extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n showModal: false,\r\n selectedItem: initialItem,\r\n itemEditFieldConfig: FormUtil.translateForm(\r\n this.props.meta.itemEditFieldConfig,\r\n props.meta.t\r\n )\r\n };\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n // @jfbloom22 this does not work because patching the multiControl does not trigger didUpdate.\r\n // componentDidUpdate(prevProps: Iprops) {\r\n // if (\r\n // prevProps.meta.itemEditFieldConfig !==\r\n // this.props.meta.itemEditFieldConfig\r\n // ) {\r\n // console.info('we are in addMultiControl settings fieldConfig');\r\n // this.setState({\r\n // itemEditFieldConfig: this.props.meta.itemEditFieldConfig\r\n // });\r\n // }\r\n // }\r\n\r\n componentDidUpdate(prevProps: Iprops, prevState: Istate) {\r\n if (\r\n this.props.meta.onValueChanges &&\r\n prevState.showModal !== this.state.showModal\r\n ) {\r\n this.props.meta.onValueChanges(this.state.selectedItem);\r\n }\r\n }\r\n\r\n handleAdd = () => {\r\n this.setState({\r\n showModal: true,\r\n selectedItem: { ...initialItem }\r\n });\r\n };\r\n\r\n handleDelete = (item: typeof initialItem) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n const filteredItems = this.props\r\n .handler()\r\n .value.map((i: typeof initialItem) => {\r\n if (i.id === item.id) {\r\n return { ...i, isDeleted: true };\r\n } else {\r\n return i;\r\n }\r\n });\r\n this.props.handler().onChange(filteredItems);\r\n this.setState({ showModal: false });\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.meta.t('common:delete'),\r\n cancelText: this.props.meta.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.meta.t('common:deleteConfirm'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n\r\n handleSelect = (eventKey: any, item: any) => {\r\n switch (eventKey) {\r\n case 10:\r\n this.setState({ showModal: true, selectedItem: item });\r\n if (this.props.meta.onValueChanges) {\r\n this.props.meta.onValueChanges(item, this.formGroup);\r\n }\r\n break;\r\n case 11: {\r\n this.handleDelete(item);\r\n }\r\n default:\r\n // check the actions\r\n if (\r\n this.props.meta.actions &&\r\n this.props.meta.actions.length &&\r\n this.props.meta.actions[eventKey]\r\n ) {\r\n this.props.meta.actions[eventKey].onClick(item);\r\n }\r\n break;\r\n }\r\n };\r\n setForm = (form: ReactiveFormGroup | FormArray) => {\r\n this.formGroup = form;\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n this.patchFormValues();\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n const item = {\r\n ...this.formGroup.value,\r\n [key]: value\r\n } as typeof initialItem | any;\r\n if (this.props.meta.onValueChanges) {\r\n this.props.meta.onValueChanges(\r\n item,\r\n this.formGroup\r\n );\r\n }\r\n });\r\n }\r\n }\r\n };\r\n\r\n patchFormValues = () => {\r\n forEach(this.props.meta.itemEditFieldConfig.controls, (field, key) => {\r\n if (key in this.state.selectedItem) {\r\n // remove type because typescript does not think a string can be uses as an index type\r\n const untypedSelectedItem = this.state.selectedItem as any;\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n key,\r\n untypedSelectedItem[key]\r\n );\r\n }\r\n });\r\n };\r\n\r\n isSingleAction = () => {\r\n if (\r\n this.props.meta.actions.length === 1 &&\r\n this.props.meta.disableDelete &&\r\n this.props.meta.disableEdit\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n console.info(this.formGroup.value);\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.meta.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n // update the array\r\n const originalItems: Array<{\r\n id: string;\r\n }> = this.props.handler().value || [];\r\n const filteredItems = originalItems.filter(\r\n item => item.id !== this.state.selectedItem.id\r\n );\r\n const updatedItem = this.state.selectedItem.id\r\n ? this.state.selectedItem\r\n : { ...this.state.selectedItem, id: uuidv4() };\r\n const updatedItems = [\r\n ...filteredItems,\r\n { ...updatedItem, ...this.formGroup.value }\r\n ];\r\n this.props.handler().onChange(updatedItems);\r\n this.setState({ showModal: false });\r\n };\r\n\r\n render() {\r\n const { pristine, errors, submitted } = this.props;\r\n const { t, colorButton } = this.props.meta;\r\n const deleteButtonStyle =\r\n this.state.selectedItem && this.state.selectedItem.id.length === 0\r\n ? { marginRight: '15px', display: 'none' }\r\n : { marginRight: '15px' };\r\n return (\r\n \r\n \r\n \r\n {this.props.meta.label}\r\n \r\n \r\n {this.props.handler().value.length > 0 &&\r\n map(\r\n this.props.handler().value,\r\n (item: any, index: number) => {\r\n if (item.isDeleted === true) {\r\n return '';\r\n }\r\n if (this.isSingleAction() === false) {\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 {this.props.meta.readonly !== true && (\r\n \r\n {' '}\r\n {this.props.meta.buttonLabel}\r\n \r\n )}\r\n \r\n console.info('hide modal')}\r\n className=\"add-multi-modal\"\r\n secondModal={true}\r\n title={t(this.props.meta.modalTitle)}\r\n >\r\n
    \r\n \r\n \r\n \r\n this.setState({\r\n showModal: false,\r\n selectedItem: initialItem\r\n })\r\n }\r\n >\r\n {t('common:cancel')}\r\n \r\n \r\n this.handleDelete(this.state.selectedItem)\r\n }\r\n >\r\n {t('common:delete')}\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 AddMultiControl = (props: Iprops) => {\r\n return ;\r\n};\r\n","import * as React from 'react';\r\nimport { IPropsCommonModal } from '../CommonModal';\r\nimport styled from 'styled-components';\r\n\r\nconst Modal = styled.div`\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100vh;\r\n background-color: #fff;\r\n z-index: 999;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n`;\r\n\r\nconst Title = styled.div`\r\n height: 64px;\r\n padding: 16px;\r\n\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n font-family: 'Roboto Condensed';\r\n font-style: normal;\r\n font-weight: 400;\r\n font-size: 20px;\r\n line-height: 23px;\r\n color: #000000;\r\n`;\r\nconst Content = styled.div`\r\n height: calc(100vh - 64px - 84px);\r\n overflow-y: scroll;\r\n`;\r\n\r\nexport const MobileButtonGroup = styled.div`\r\n position: fixed;\r\n bottom: 0;\r\n height: 60px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 10px;\r\n background-color: #f5f5f5;\r\n width: 100vw;\r\n gap: 24px;\r\n\r\n & > button {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst Footer = styled.div``;\r\n\r\nconst CloseButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n height: 32px;\r\n width: 32px;\r\n\r\n &:hover {\r\n cursor: pointer;\r\n }\r\n`;\r\n\r\nconst CloseButton = (props: any) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst CommonMobileModal = (props: IPropsCommonModal) => {\r\n const backdrop = props.backdrop ? props.backdrop : 'static';\r\n\r\n if (!props.show) {\r\n return null;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {props.title && (\r\n \r\n {props.title} <CloseButton onClick={props.onHide} />\r\n \r\n )}\r\n \r\n {props.children}\r\n \r\n {props.footer &&
    {props.footer}
    }\r\n \r\n \r\n );\r\n};\r\n\r\nexport default CommonMobileModal;\r\n","/*\r\n * Edit alert Form\r\n * Add and Edit alerts\r\n *\r\n */\r\n\r\nimport * as moment from 'moment';\r\nimport * as React from 'react';\r\n\r\nimport { debounce, omit } from 'lodash';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport {\r\n addWorkOrder,\r\n clearSelectedWorkOrderID,\r\n deleteWorkOrder,\r\n toggleEditWorkOrderModal,\r\n updateWorkOrder,\r\n updateWorkOrderFormValue\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { IWorkOrder, Ioption } from '../../models';\r\nimport {\r\n workOrderPrioritiesEnum,\r\n workOrderStatusEnum,\r\n workOrderVendorsEnum\r\n} from '../../models-enums';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport { Iproduct } from '../../models';\r\nimport { IworkOrderFormValues } from '../../modelsForms';\r\nimport { initialWorkOrder } from '../../reducers/initialState';\r\nimport { AddMultiControl, ImultiControlMeta } from '../common/AddMultiControl';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport CommonMobileModal, {\r\n MobileButtonGroup\r\n} from '../common/mobile/CommonMobileModal';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n addWorkOrder: typeof addWorkOrder;\r\n updateWorkOrder: typeof updateWorkOrder;\r\n deleteWorkOrder: typeof deleteWorkOrder;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n selectedWorkOrder: IWorkOrder;\r\n clearSelectedWorkOrderID: typeof clearSelectedWorkOrderID;\r\n updateFormValue: (formValue: { [key: string]: any }) => any;\r\n setFormValues: (formValues: { [key: string]: any }) => any;\r\n formValues: IworkOrderFormValues;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n selectedProduct: Iproduct;\r\n standardOptions: Ioption[];\r\n selectedInstallBaseID: string;\r\n locationString?: string;\r\n disabled?: boolean;\r\n shouldDisableVendorSelect?: boolean;\r\n shouldHideTechnicianSelect?: boolean;\r\n shouldHideDelete?: boolean;\r\n isMobile: boolean;\r\n title: string;\r\n show: boolean;\r\n secondModal?: boolean;\r\n}\r\n\r\ninterface State {\r\n file1: any;\r\n file2: any;\r\n file3: any;\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditWorkOrderForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateFormValueDebounced: typeof updateWorkOrderFormValue;\r\n static defaultProps = {\r\n selectedWorkOrder: initialWorkOrder\r\n };\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n file1: '',\r\n file2: '',\r\n file3: '',\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n this.updateFormValueDebounced = debounce(\r\n this.props.updateFormValue,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n this.props.setFormValues(this.itemToFormValues());\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops, prevState: State) {\r\n if (prevProps.formValues.vendor !== this.props.formValues.vendor) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (prevProps.formValues.parts !== this.props.formValues.parts) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n\r\n if (\r\n prevProps.selectedWorkOrder.id !== this.props.selectedWorkOrder.id\r\n ) {\r\n this.props.setFormValues(this.itemToFormValues());\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.setFormValues({});\r\n this.props.clearSelectedWorkOrderID();\r\n }\r\n\r\n onFileChange = (key: 'file1' | 'file2' | 'file3', file: File) => {\r\n this.setState({ [key]: file } as any, () => {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n });\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IworkOrderFormValues => {\r\n const { t } = this.props;\r\n const { vendor, priority, status } = this.props.selectedWorkOrder;\r\n const selectedVendor = {\r\n value: vendor,\r\n label: t(workOrderVendorsEnum[vendor])\r\n };\r\n const selectedPriority = {\r\n value: priority,\r\n label: t(workOrderPrioritiesEnum[priority])\r\n };\r\n const selectedStatus = {\r\n value: status,\r\n label: t(workOrderStatusEnum[status])\r\n };\r\n const cleanedWorkOrder = omit(this.props.selectedWorkOrder, [\r\n 'preventativeMaintenanceChecklist',\r\n 'jobWorkOrders',\r\n 'facility'\r\n ]);\r\n\r\n // Closing notes are saved as a JSON object (not sure why), so convert it to a JSON object, then pull out the actual Text value\r\n const workOrderWithCleanedNotes = {\r\n ...cleanedWorkOrder,\r\n closingNotes: cleanedWorkOrder.closingNotes\r\n ? JSON.parse(cleanedWorkOrder.closingNotes)[0]?.Text\r\n : ''\r\n };\r\n\r\n return {\r\n ...workOrderWithCleanedNotes,\r\n vendor: selectedVendor,\r\n priority: selectedPriority,\r\n status: selectedStatus,\r\n product: undefined\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (): IWorkOrder => {\r\n const cleanedWorkOrder = omit(this.props.selectedWorkOrder, [\r\n 'facility',\r\n 'preventativeMaintenanceChecklist',\r\n 'jobWorkOrders'\r\n ]);\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n return {\r\n ...cleanedWorkOrder,\r\n ...formValues,\r\n parts: this.formGroup.value.parts,\r\n installBaseID:\r\n this.props.selectedWorkOrder.installBaseID ||\r\n this.props.selectedInstallBaseID,\r\n file1: this.state.file1,\r\n file2: this.state.file2,\r\n file3: this.state.file3\r\n };\r\n };\r\n\r\n buildMultiControlConfig = () => {\r\n const itemEditFieldConfig = {\r\n controls: {}\r\n };\r\n\r\n return itemEditFieldConfig;\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IworkOrderFormValues = this.props.formValues\r\n ) => {\r\n // disable if prop is disabled or if the work order is complete\r\n const disabled =\r\n this.props.disabled === true ||\r\n this.props.selectedWorkOrder.isDeleted === true ||\r\n this.props.selectedWorkOrder.status ===\r\n workOrderStatusEnum.complete;\r\n\r\n const shouldHideTechnician =\r\n defaultValues.vendor &&\r\n (defaultValues.vendor.value === workOrderVendorsEnum.beacon ||\r\n defaultValues.vendor.value === workOrderVendorsEnum.other) &&\r\n this.props.shouldHideTechnicianSelect !== false;\r\n\r\n let due_date = defaultValues.dueDate as string | moment.Moment;\r\n // if the dueDate is not a moment and there is no id, we are creating an untouched new work order and default to a month from today\r\n if (\r\n moment.isMoment(defaultValues.dueDate) === false &&\r\n this.props.selectedWorkOrder.id.length === 0 &&\r\n typeof defaultValues.dueDate === 'string'\r\n ) {\r\n due_date = moment.utc(defaultValues.dueDate).add(1, 'month');\r\n }\r\n\r\n const itemEditFieldConfig = this.buildMultiControlConfig();\r\n\r\n const fieldConfigControls = {\r\n productInformation: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n label: 'productInfo',\r\n colWidth: 12,\r\n name: 'information'\r\n },\r\n formState: {\r\n value:\r\n defaultValues.productName ||\r\n this.props.selectedProduct.name,\r\n disabled\r\n }\r\n },\r\n $field_1: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n number: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'woNumber',\r\n colWidth: 12,\r\n // autoFocus: true,\r\n required: false,\r\n name: 'number'\r\n },\r\n formState: { value: defaultValues.number, disabled }\r\n },\r\n /*\r\n * vendor is disabled when on the beacon tab. In other words the Vendor select is only enabled on the Repair tab.\r\n */\r\n vendor: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n workOrderVendorsEnum\r\n ),\r\n label: 'vendor',\r\n colWidth: 12,\r\n name: 'vendor',\r\n required: true,\r\n isClearable: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.vendor,\r\n disabled: disabled || this.props.shouldDisableVendorSelect\r\n }\r\n },\r\n /*\r\n * TODO Technician should show when on Beacon tab. And on the Repair tab when the selected vendor is Internal. Need to double check this logic\r\n */\r\n technician: {\r\n // options: {\r\n // validators: [FormUtil.validators.requiredWithTrim, Validators.maxLength(25)]\r\n // },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'tehnician',\r\n colWidth: 12,\r\n // autoFocus: true,\r\n required: false,\r\n name: 'tehnician',\r\n style: shouldHideTechnician ? { display: 'none' } : {}\r\n },\r\n formState: {\r\n value: defaultValues.technician,\r\n disabled\r\n }\r\n },\r\n closingNotes: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'closingNote',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 5,\r\n name: 'closingNote',\r\n initialContent: defaultValues.closingNotes,\r\n style:\r\n defaultValues.status &&\r\n defaultValues.status.value ===\r\n workOrderStatusEnum.complete\r\n ? {}\r\n : { display: 'none' }\r\n },\r\n formState: { value: defaultValues.closingNotes, disabled }\r\n },\r\n activityDescription: {\r\n render: FormUtil.TextInput,\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n meta: {\r\n label: 'activityDescription',\r\n colWidth: 12,\r\n name: 'notes',\r\n componentClass: 'textarea',\r\n rows: 5,\r\n initialContent: defaultValues.activityDescription,\r\n required: true\r\n },\r\n formState: {\r\n value: defaultValues.activityDescription,\r\n disabled\r\n }\r\n },\r\n notes: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'notes',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 5,\r\n name: 'notes',\r\n initialContent: defaultValues.notes,\r\n required: true\r\n },\r\n formState: { value: defaultValues.notes, disabled }\r\n },\r\n manageParts: {\r\n render: AddMultiControl,\r\n meta: {\r\n label: 'labelParts',\r\n buttonLabel: '',\r\n colWidth: 12,\r\n colorButton: this.props.colorButton,\r\n t: this.props.t,\r\n modalTitle: '',\r\n getItemTitle: item =>\r\n `(${item.estimated}) ${item.part?.number} - ${item.part?.description}`,\r\n disableDelete: true,\r\n disableEdit: true,\r\n actions: [],\r\n itemEditFieldConfig,\r\n readonly: true\r\n } as ImultiControlMeta,\r\n formState: { value: defaultValues.parts, disabled }\r\n },\r\n contactInfo: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'contactinfo',\r\n colWidth: 12,\r\n name: 'contactInfo'\r\n },\r\n formState: { value: defaultValues.contactInfo, disabled },\r\n options: {\r\n validators: Validators.pattern(\r\n /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/ //eslint-disable-line\r\n )\r\n }\r\n },\r\n dueDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'dueDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'expiration-date',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n formState: {\r\n value: due_date,\r\n disabled\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n }\r\n },\r\n priority: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n workOrderPrioritiesEnum\r\n ),\r\n label: 'priority',\r\n colWidth: 6,\r\n name: 'priority',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: defaultValues.priority,\r\n disabled\r\n }\r\n },\r\n\r\n status: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.buildStatusOptions(),\r\n label: 'status',\r\n colWidth: 12,\r\n name: 'status',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: defaultValues.status,\r\n disabled: this.shouldDisableStatusSelect()\r\n }\r\n },\r\n file1: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n accept:\r\n '.xlsx,.xls,image/*,.doc,.docx,.ppt,.pptx,.txt,.pdf,.zip',\r\n type: 'file',\r\n label: 'manageWorkOrder:addFile',\r\n otherLabels: {\r\n labelReplace: 'manageWorkOrder:replaceFile',\r\n labelDownload: 'manageWorkOrder:labelDownload'\r\n },\r\n colWidth: 12,\r\n name: 'file1',\r\n required: true,\r\n onChange: this.onFileChange,\r\n imageUrl: defaultValues.attachmentUrl1,\r\n fileName: this.state ? this.state.file1.name : '',\r\n hasDownload: true\r\n }\r\n },\r\n file2: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n accept:\r\n '.xlsx,.xls,image/*,.doc,.docx,.ppt,.pptx,.txt,.pdf,.zip',\r\n type: 'file',\r\n label: 'manageWorkOrder:addFile',\r\n otherLabels: {\r\n labelReplace: 'manageWorkOrder:replaceFile',\r\n labelDownload: 'manageWorkOrder:labelDownload'\r\n },\r\n colWidth: 12,\r\n name: 'file2',\r\n required: true,\r\n onChange: this.onFileChange,\r\n imageUrl: defaultValues.attachmentUrl2,\r\n fileName: this.state ? this.state.file2.name : '',\r\n hasDownload: true\r\n }\r\n },\r\n file3: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n accept:\r\n '.xlsx,.xls,image/*,.doc,.docx,.ppt,.pptx,.txt,.pdf,.zip',\r\n type: 'file',\r\n label: 'manageWorkOrder:addFile',\r\n otherLabels: {\r\n labelReplace: 'manageWorkOrder:replaceFile',\r\n labelDownload: 'manageWorkOrder:labelDownload'\r\n },\r\n colWidth: 12,\r\n name: 'file3',\r\n required: true,\r\n onChange: this.onFileChange,\r\n imageUrl: defaultValues.attachmentUrl3,\r\n fileName: this.state ? this.state.file3.name : '',\r\n hasDownload: true\r\n }\r\n }\r\n };\r\n\r\n // hide the status when creating new\r\n if (\r\n !(\r\n this.props.selectedWorkOrder &&\r\n this.props.selectedWorkOrder.id.length\r\n )\r\n ) {\r\n delete fieldConfigControls.status;\r\n }\r\n\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n /*\r\n * status = completed: the only selectable option should be \"reopened\"\r\n * status = reopened: empty\r\n * status = new: empty\r\n */\r\n buildStatusOptions = () => {\r\n const { status } = this.props.selectedWorkOrder;\r\n if (status === workOrderStatusEnum.complete) {\r\n return [\r\n {\r\n value: `${workOrderStatusEnum.reopened}`,\r\n label: this.props.t('reopened')\r\n }\r\n ];\r\n } else {\r\n return [];\r\n }\r\n };\r\n\r\n /*\r\n * status select should only be enabled if creating new or if the WO is completed\r\n */\r\n shouldDisableStatusSelect = () => {\r\n if (this.props.selectedWorkOrder.id.length === 0) {\r\n return false;\r\n } else if (\r\n this.props.selectedWorkOrder.status === workOrderStatusEnum.complete\r\n ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n this.updateFormValueDebounced({\r\n ...this.props.formValues,\r\n [key]: value\r\n });\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n console.info(this.formGroup.value);\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n // TODO if the vendor is Beacon or Other, clear out the technician\r\n\r\n const tempWorkOrder = this.formValuesToItem();\r\n\r\n if (!this.props.selectedWorkOrder.id.length) {\r\n // NEW\r\n const workOrderID = uuidv4();\r\n this.props.addWorkOrder({\r\n ...tempWorkOrder,\r\n id: workOrderID\r\n });\r\n this.props.toggleEditWorkOrderModal();\r\n } else {\r\n // EDIT\r\n this.props.updateWorkOrder({ ...tempWorkOrder });\r\n this.props.toggleEditWorkOrderModal();\r\n }\r\n };\r\n\r\n handleDelete = () => {\r\n let deletedItem = this.props.selectedWorkOrder;\r\n\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem\r\n };\r\n this.props.deleteWorkOrder(deletedItem);\r\n this.props.toggleEditWorkOrderModal();\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n cleanForm = () => {\r\n this.formGroup.reset();\r\n };\r\n\r\n shouldShowDeleteButton = () => {\r\n const { selectedWorkOrder } = this.props;\r\n return (\r\n selectedWorkOrder &&\r\n selectedWorkOrder.id &&\r\n selectedWorkOrder.isDeleted !== true &&\r\n selectedWorkOrder.status !== workOrderStatusEnum.complete &&\r\n this.props.disabled !== true &&\r\n this.props.shouldHideDelete !== true\r\n );\r\n };\r\n\r\n render() {\r\n const { t, secondModal, isMobile, title, show } = this.props;\r\n if (isMobile) {\r\n return (\r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {this.shouldShowDeleteButton() && (\r\n \r\n {t('common:delete')}\r\n \r\n )}\r\n {this.props.selectedWorkOrder.isDeleted ===\r\n false && (\r\n \r\n {t('save')}\r\n \r\n )}\r\n \r\n }\r\n >\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {this.shouldShowDeleteButton() && (\r\n \r\n {t('common:delete')}\r\n \r\n )}\r\n\r\n {this.props.selectedWorkOrder.isDeleted === false && (\r\n \r\n {t('save')}\r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditWorkOrderForm;\r\n","/*\r\n *\r\n */\r\n\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n addWorkOrder,\r\n clearSelectedWorkOrderID,\r\n deleteWorkOrder,\r\n setWorkOrderFormValues,\r\n toggleEditWorkOrderModal,\r\n updateWorkOrder,\r\n updateWorkOrderFormValue\r\n} from '../../actions/manageWorkOrderActions';\r\n\r\nimport { connect } from 'react-redux';\r\nimport { clearSelectedProductID } from '../../actions/manageInventoryActions';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport { initialProduct, initialWorkOrder } from '../../reducers/initialState';\r\nimport EditWorkOrderForm from './EditWorkOrderForm';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n disabled?: boolean;\r\n locationString?: string;\r\n shouldDisableVendorSelect?: boolean;\r\n shouldHideTechnicianSelect?: boolean;\r\n shouldHideDelete?: boolean;\r\n secondModal?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const {\r\n productsByID,\r\n selectedProductID,\r\n selectedInstallBaseID\r\n } = state.manageInventory;\r\n const selectedProduct =\r\n selectedProductID && productsByID[selectedProductID]\r\n ? productsByID[selectedProductID]\r\n : initialProduct;\r\n\r\n const selectedWorkOrderId = state.manageWorkOrder.selectedWorkOrderID;\r\n\r\n const selectedWorkOrder =\r\n state.manageWorkOrder.workOrdersByID[selectedWorkOrderId] ||\r\n initialWorkOrder;\r\n\r\n let title;\r\n if (selectedWorkOrder?.id?.length) {\r\n title = ownProps.t(`manageWorkOrder:editWorkOrder`);\r\n } else {\r\n title = ownProps.t(`manageWorkOrder:newWorkOrder`);\r\n }\r\n return {\r\n title,\r\n className: 'work-order-modal',\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageWorkOrder.showEditWorkOrderModal,\r\n selectedWorkOrder,\r\n formValues: state.manageWorkOrder.workOrderFormValues,\r\n standardOptions: state.productInfo.standardOptions,\r\n selectedProduct,\r\n selectedInstallBaseID,\r\n isMobile: getIsMobile(state),\r\n secondModal: ownProps.secondModal\r\n };\r\n};\r\n\r\nexport const EditWorkOrderModal = withTranslation('manageWorkOrder')(\r\n connect(mapStateToProps, {\r\n onHide: toggleEditWorkOrderModal,\r\n toggleEditWorkOrderModal,\r\n addWorkOrder,\r\n updateWorkOrder,\r\n deleteWorkOrder,\r\n clearSelectedWorkOrderID,\r\n clearSelectedProductID,\r\n updateFormValue: updateWorkOrderFormValue,\r\n setFormValues: setWorkOrderFormValues\r\n })(EditWorkOrderForm)\r\n);\r\n","/*\r\n * Work Order Close Form\r\n */\r\n\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n FormGroup\r\n} from 'react-reactive-form';\r\n\r\nimport * as React from 'react';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { constants } from '../../constants/constants';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n clearSelectedWorkOrderID,\r\n addWorkOrder\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { IWorkOrder } from '../../models';\r\nimport {\r\n workOrderStatusEnum,\r\n workOrderTypesEnum,\r\n workOrderVendorsEnum\r\n} from '../../models-enums';\r\nimport moment from 'moment';\r\nimport { TFunction } from 'i18next';\r\nimport { initialWorkOrder } from '../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n loading: boolean;\r\n selectedWorkOrder: IWorkOrder;\r\n colorButton: string;\r\n t: TFunction;\r\n updateWorkOrder: (workOrder: IWorkOrder) => Promise;\r\n clearSelectedWorkOrderID: typeof clearSelectedWorkOrderID;\r\n addWorkOrder: typeof addWorkOrder;\r\n selectedInstallBaseID?: string;\r\n enableRepairMode?: boolean;\r\n}\r\n\r\nclass WorkOrderCloseForm extends React.Component {\r\n private form: FormGroup | any;\r\n public fieldConfig: FieldConfig;\r\n\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.fieldConfig = FormUtil.translateForm(\r\n this.buildFieldConfig(),\r\n this.props.t\r\n );\r\n }\r\n\r\n buildFieldConfig = () => {\r\n const { status, closingNotes, id } = this.props.selectedWorkOrder;\r\n const shouldHideTechnician = id.length > 0;\r\n\r\n let fieldConfigControls;\r\n if (status === workOrderStatusEnum.complete) {\r\n const notes = closingNotes ? closingNotes : '';\r\n\r\n fieldConfigControls = {\r\n closingNotes: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n label: 'closingNote',\r\n colWidth: 12,\r\n name: 'closing-note'\r\n },\r\n formState: notes\r\n }\r\n };\r\n } else if (this.props.enableRepairMode === true) {\r\n fieldConfigControls = {\r\n closingNotes: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageInventory:labelRepairComment',\r\n componentClass: 'textarea',\r\n colWidth: 12,\r\n rows: 10,\r\n type: 'input',\r\n autoFocus: true,\r\n name: 'closing-note'\r\n }\r\n },\r\n technician: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageInventory:labelRepairWho',\r\n colWidth: 12,\r\n // autoFocus: true,\r\n required: false,\r\n name: 'tehnician',\r\n style: shouldHideTechnician ? { display: 'none' } : {}\r\n }\r\n }\r\n };\r\n } else {\r\n fieldConfigControls = {\r\n closingNotes: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'closingNote',\r\n componentClass: 'textarea',\r\n colWidth: 12,\r\n rows: 10,\r\n type: 'input',\r\n autoFocus: true,\r\n name: 'closing-note'\r\n }\r\n },\r\n technician: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'tehnician',\r\n colWidth: 12,\r\n // autoFocus: true,\r\n required: false,\r\n name: 'tehnician',\r\n style: shouldHideTechnician ? { display: 'none' } : {}\r\n }\r\n }\r\n };\r\n }\r\n\r\n return {\r\n controls: { ...fieldConfigControls }\r\n };\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.form.status === 'INVALID') {\r\n this.form.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n const { closingNotes, technician } = this.form.value;\r\n\r\n // TODO if there is not a work order, then we will create one\r\n if (this.props.selectedWorkOrder.id.length) {\r\n this.props.updateWorkOrder({\r\n ...this.props.selectedWorkOrder,\r\n closingNotes,\r\n status: workOrderStatusEnum.complete\r\n });\r\n } else {\r\n // NEW\r\n if (!this.props.selectedInstallBaseID) {\r\n toastr.console.error(\r\n this.props.t('error'),\r\n this.props.t('Unable to save. Missing asset.'),\r\n constants.toastrError\r\n );\r\n console.error(\r\n 'missing install base when tryig to save new work order',\r\n this.props\r\n );\r\n return;\r\n }\r\n const newWorkOrder: IWorkOrder = {\r\n ...initialWorkOrder,\r\n installBaseID: this.props.selectedInstallBaseID,\r\n status: workOrderStatusEnum.complete,\r\n type: workOrderTypesEnum.repair,\r\n number: '',\r\n technician: technician || '',\r\n contactInfo: '',\r\n vendor: workOrderVendorsEnum.internal,\r\n activityDescription: 'repairing asset',\r\n partsDescription: '',\r\n notes: '',\r\n closingNotes,\r\n dueDate: moment.utc().format(),\r\n priority: 1,\r\n isDeleted: false\r\n };\r\n this.props.addWorkOrder(newWorkOrder);\r\n }\r\n\r\n this.props.toggleModal();\r\n this.props.clearSelectedWorkOrderID();\r\n };\r\n\r\n toggleModal = () => {\r\n this.props.toggleModal();\r\n this.props.clearSelectedWorkOrderID();\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.form = form;\r\n this.form.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const { status } = this.props.selectedWorkOrder;\r\n const formClassName = `beacon-form location-form ${this.props.colorButton}`;\r\n\r\n let button;\r\n if (status !== workOrderStatusEnum.complete) {\r\n button = (\r\n \r\n {t('common:save')}\r\n \r\n );\r\n }\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {button}\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default WorkOrderCloseForm;\r\n","import { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n updateWorkOrder,\r\n toggleWorkOrderCloseModal\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { clearSelectedProductID } from '../../actions/manageInventoryActions';\r\nimport WorkOrderCloseForm from './WorkOrderCloseForm';\r\nimport { initialWorkOrder } from '../../reducers/initialState';\r\nimport { initialProduct } from '../../reducers/initialState';\r\n\r\nimport {\r\n clearSelectedWorkOrderID,\r\n setWorkOrderFormValues,\r\n updateWorkOrderFormValue,\r\n addWorkOrder\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n t: TFunction;\r\n selectedInstallBaseID?: string;\r\n locationString?: string;\r\n enableRepairMode?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { productsByID, selectedProductID } = state.manageInventory;\r\n const selectedProduct = selectedProductID\r\n ? productsByID[selectedProductID]\r\n : initialProduct;\r\n const selectedWorkOrder =\r\n state.manageWorkOrder.workOrdersByID[\r\n state.manageWorkOrder.selectedWorkOrderID\r\n ] || initialWorkOrder;\r\n let title =\r\n selectedWorkOrder.status === 1\r\n ? ownProps.t('AddCloseNote')\r\n : ownProps.t('ViewCloseNote');\r\n if (ownProps.enableRepairMode) {\r\n title = ownProps.t('repairAssetTitle');\r\n }\r\n return {\r\n title,\r\n className: 'work-order-close',\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageWorkOrder.showWorkOrderCloseModal,\r\n selectedWorkOrder,\r\n formValues: state.manageWorkOrder.workOrderFormValues,\r\n standardOptions: state.productInfo.standardOptions,\r\n selectedProduct\r\n };\r\n};\r\n\r\nexport const WorkOrderCloseModal = withTranslation('manageWorkOrder')(\r\n connect(mapStateToProps, {\r\n onHide: toggleWorkOrderCloseModal,\r\n toggleModal: toggleWorkOrderCloseModal,\r\n updateWorkOrder,\r\n clearSelectedWorkOrderID,\r\n clearSelectedProductID,\r\n updateFormValue: updateWorkOrderFormValue,\r\n setFormValues: setWorkOrderFormValues,\r\n addWorkOrder\r\n })(WithCommonModal(WorkOrderCloseForm))\r\n);\r\n","/*\r\n * Edit Quote Shopping Cart Form\r\n */\r\n\r\nimport {\r\n Col,\r\n Button,\r\n FormGroup,\r\n ControlLabel,\r\n FormControl,\r\n Badge\r\n} from 'react-bootstrap';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { mapValues, forEach } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n Ioption,\r\n IshoppingCartProduct,\r\n IproductInfo,\r\n IshoppingCart,\r\n ItableFiltersReducer\r\n} from '../../models';\r\nimport {\r\n toggleShoppingCartModal,\r\n updateQuantityCart,\r\n deleteFromCart\r\n} from '../../actions/shoppingCartActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { requestQuote } from '../../actions/manageInventoryActions';\r\nimport { TFunction } from 'i18next';\r\n\r\n/*\r\n * Input row with a button to delete the cart item\r\n */\r\nconst NumberInputWithButton = ({\r\n handler,\r\n touched,\r\n hasError,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n}: AbstractControl) => (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n meta.buttonAction(meta.id)}\r\n >\r\n \r\n \r\n \r\n \r\n);\r\n\r\n/*\r\n * Card product with a button to delete it\r\n */\r\nconst CartProduct = ({\r\n handler,\r\n touched,\r\n hasError,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n}: AbstractControl) => (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n ${`${meta.cost / 100}`}\r\n meta.buttonAction(meta.id)}\r\n >\r\n \r\n \r\n \r\n \r\n);\r\n\r\nconst buildFieldConfig = (\r\n products: { [key: string]: IshoppingCartProduct },\r\n deleteFromCartCB: typeof deleteFromCart,\r\n cartName: string,\r\n showCost = false\r\n) => {\r\n const productControls = mapValues(products, prod => {\r\n return {\r\n render: showCost ? CartProduct : NumberInputWithButton,\r\n options: {\r\n validators: [\r\n Validators.min(1),\r\n Validators.max(1000),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n meta: {\r\n label: prod.name,\r\n defaultValue: prod.quantity,\r\n buttonAction: (id: string) => deleteFromCartCB(id, cartName),\r\n id: prod.id,\r\n cost: prod.cost,\r\n name: 'product'\r\n }\r\n };\r\n });\r\n const fieldConfigControls = {\r\n message: {\r\n render: FormUtil.TextInput,\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n meta: {\r\n label: 'message',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 8,\r\n name: 'message'\r\n }\r\n }\r\n };\r\n return {\r\n controls: { ...productControls, ...fieldConfigControls }\r\n };\r\n};\r\n\r\ninterface Iprops {\r\n checkout?: typeof requestQuote;\r\n toggleShoppingCartModal: typeof toggleShoppingCartModal;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n\r\n productInfo: IproductInfo;\r\n facilityOptions: Ioption[];\r\n cart: IshoppingCart;\r\n tableFilters: ItableFiltersReducer;\r\n updateQuantityCart: typeof updateQuantityCart;\r\n deleteFromCart: typeof deleteFromCart;\r\n cartName: string;\r\n showCost?: boolean;\r\n selectedFacilityID: string;\r\n}\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditQuoteForm extends React.Component {\r\n private userForm: FormGroup | any;\r\n private subscription: any;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: { controls: {} }\r\n };\r\n }\r\n // TODO keep the message somewhere, patch the value\r\n componentDidMount() {\r\n this.setFormConfig();\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n prevProps.cart.addedIDs.length !== this.props.cart.addedIDs.length\r\n ) {\r\n console.info('products changed');\r\n this.setFormConfig();\r\n }\r\n }\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.userForm.status === 'INVALID') {\r\n this.userForm.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.userForm.value);\r\n if (!this.props.checkout) {\r\n console.error('missing checkout function');\r\n return;\r\n }\r\n\r\n this.props.checkout({\r\n message: this.userForm.value.message,\r\n facilityID: this.props.selectedFacilityID\r\n });\r\n };\r\n setFormConfig = () => {\r\n this.setState(\r\n {\r\n fieldConfig: FormUtil.translateForm(\r\n buildFieldConfig(\r\n this.props.cart.productsByID,\r\n this.props.deleteFromCart,\r\n this.props.cartName,\r\n this.props.showCost\r\n ),\r\n this.props.t\r\n )\r\n },\r\n () => {\r\n forEach(this.state.fieldConfig.controls, (input: any, key) => {\r\n if (\r\n this.userForm &&\r\n input.meta &&\r\n input.meta.defaultValue\r\n ) {\r\n this.userForm.patchValue({\r\n [key]: input.meta.defaultValue\r\n });\r\n }\r\n if (\r\n this.userForm &&\r\n this.props.cart.addedIDs.length &&\r\n key !== 'message'\r\n ) {\r\n this.subscription = this.userForm\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.props.updateQuantityCart(\r\n parseInt(value, 10),\r\n key,\r\n this.props.cartName\r\n );\r\n });\r\n }\r\n });\r\n }\r\n );\r\n };\r\n setForm = (form: AbstractControl) => {\r\n console.info('setting form');\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n calculateSubtotal = () => {\r\n let subtotal = 0;\r\n forEach(this.props.cart.productsByID, product => {\r\n subtotal += product.cost;\r\n });\r\n return subtotal;\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form manage-form ${this.props.colorButton}`;\r\n if (this.props.cart.addedIDs.length === 0) {\r\n return (\r\n
    \r\n

    \r\n {this.props.t('emptyQuoteMessage')}\r\n

    \r\n \r\n \r\n this.props.toggleShoppingCartModal(\r\n this.props.cartName\r\n )\r\n }\r\n >\r\n {t('common:cancel')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n return (\r\n
    \r\n \r\n {this.props.showCost && (\r\n \r\n Subtotal: ${this.calculateSubtotal() / 100}\r\n \r\n )}\r\n\r\n \r\n \r\n this.props.toggleShoppingCartModal(\r\n this.props.cartName\r\n )\r\n }\r\n >\r\n {t('common:cancel')}\r\n \r\n \r\n {t('checkout')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditQuoteForm;\r\n","/*\r\n * Edit Shopping Cart Modal - Container\r\n */\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n IproductInfo,\r\n IshoppingCart,\r\n ItableFiltersReducer,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n addToCart,\r\n decreaseFromCart,\r\n deleteFromCart,\r\n updateQuantityCart,\r\n toggleShoppingCartModal\r\n} from '../../actions/shoppingCartActions';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { requestQuote } from '../../actions/manageInventoryActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n t: TFunction;\r\n}\r\n\r\ninterface IdispatchProps {\r\n showModal: boolean;\r\n loading: boolean;\r\n facilityOptions: any[];\r\n productInfo: IproductInfo;\r\n addToCart: typeof addToCart;\r\n updateQuantityCart: typeof updateQuantityCart;\r\n decreaseFromCart: typeof decreaseFromCart;\r\n deleteFromCart: typeof deleteFromCart;\r\n checkout?: typeof requestQuote;\r\n toggleShoppingCartModal: typeof toggleShoppingCartModal;\r\n cart: IshoppingCart;\r\n tableFilters: ItableFiltersReducer;\r\n title: string;\r\n cartName: string;\r\n ShoppingCartForm: any;\r\n showCost?: boolean;\r\n user: Iuser;\r\n}\r\n\r\nclass EditQuoteModal extends React.Component {\r\n render() {\r\n return (\r\n \r\n this.props.toggleShoppingCartModal(this.props.cartName)\r\n }\r\n title={this.props.title}\r\n container={document.getElementById('two-pane-layout')}\r\n >\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n facilityOptions: FormUtil.convertToOptions(state.user.facilities),\r\n showModal:\r\n state.manageInventory.showShoppingCartModal ||\r\n state.training.showShoppingCartModal,\r\n productInfo: state.productInfo,\r\n tableFilters: state.manageInventory.tableFilters\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, {\r\n addToCart,\r\n decreaseFromCart,\r\n deleteFromCart,\r\n toggleShoppingCartModal,\r\n updateQuantityCart\r\n})(EditQuoteModal);\r\n","import React, { CSSProperties } from 'react';\r\nimport { productPlaceholderImages } from '../../constants/constants';\r\n\r\ninterface Iprops {\r\n style?: CSSProperties;\r\n mainCategoryID: string;\r\n imagePath: string;\r\n}\r\n\r\nfunction AssetImage(props: Iprops) {\r\n // If no valid URL was set, use a placeholder image\r\n const placeholder = productPlaceholderImages.find(\r\n img => img.categoryId.toLocaleLowerCase() === props.mainCategoryID\r\n ) || { src: 'Azure.png' };\r\n\r\n let imgPath = require(`../../images${\r\n placeholder.src === 'Azure.png' ? '' : '/products'\r\n }/${placeholder.src}`);\r\n\r\n if (\r\n props.imagePath !== '' &&\r\n props.imagePath !== null &&\r\n props.imagePath !== undefined\r\n ) {\r\n imgPath = props.imagePath;\r\n }\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default AssetImage;\r\n","/*\r\n * Manage Install Form\r\n * Edit Install items\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col, ControlLabel, FormGroup } from 'react-bootstrap';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n GroupProps,\r\n ValidatorFn,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport {\r\n deleteInstall,\r\n saveInstall,\r\n setInstallFormValues,\r\n updateInstall,\r\n updateInstallFormValues\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n Ibuilding,\r\n Ifacility,\r\n IinstallBase,\r\n Ijob,\r\n Iproduct,\r\n IproductInfo,\r\n ItableFiltersReducer,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n initialInstallBase,\r\n initialProduct\r\n} from '../../reducers/initialState';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { debounce, find, forEach, omit } from 'lodash';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n capitalEquipmentCategories,\r\n constants\r\n} from '../../constants/constants';\r\nimport { IinstallFormValues } from '../../modelsForms';\r\nimport AssetImage from '../common/AssetImage';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { msalFetch } from '../auth/Auth-Utils';\r\nimport API from '../../constants/apiEndpoints';\r\n\r\ninterface Iprops {\r\n updateInstall: typeof updateInstall;\r\n saveInstall: typeof saveInstall;\r\n toggleModal: () => void;\r\n selectedItem: IinstallBase;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n tableFilters: ItableFiltersReducer;\r\n selectedProduct: Iproduct;\r\n mainCategoryID: string;\r\n facility: Ifacility;\r\n deleteInstall: typeof deleteInstall;\r\n saveAnyLocation: (\r\n name: string,\r\n facilityID: string,\r\n installBaseLocations?: {\r\n buildingID?: string;\r\n floorID?: string;\r\n locationID?: string;\r\n }\r\n ) => { id: string } | any;\r\n user: Iuser;\r\n showCancel?: boolean;\r\n productInfo: IproductInfo;\r\n setFormValues: typeof setInstallFormValues;\r\n updateFormValues: typeof updateInstallFormValues;\r\n formValues: IinstallFormValues;\r\n canEditInstalls: boolean;\r\n selectedJob: Ijob;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n isGeneratingSerialNumber: boolean;\r\n}\r\n\r\nclass ManageInstallForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateFormValueDebounced: any;\r\n\r\n static defaultProps = {\r\n selectedItem: initialInstallBase,\r\n selectedProduct: initialProduct\r\n };\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.updateFormValueDebounced = debounce(\r\n this.props.updateFormValues,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: { controls: {} },\r\n isGeneratingSerialNumber: false\r\n };\r\n }\r\n componentDidMount() {\r\n // we should have a product if adding new, or should have an id if editing.\r\n if (\r\n (!this.props.selectedProduct ||\r\n (this.props.selectedProduct &&\r\n this.props.selectedProduct.id.length === 0)) &&\r\n (!this.props.selectedItem ||\r\n (this.props.selectedItem && !this.props.selectedItem.id.length))\r\n ) {\r\n console.error('missing product and install');\r\n }\r\n\r\n this.props.setFormValues(this.itemToFormValues());\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n JSON.stringify(prevProps.selectedItem) !==\r\n JSON.stringify(this.props.selectedItem) &&\r\n this.props.selectedItem.id.length\r\n ) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n this.props.setFormValues(this.itemToFormValues());\r\n }\r\n\r\n // since the date-time controls manage their own state, we cannot patch them\r\n if (prevProps.formValues.prodDate !== this.props.formValues.prodDate) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.formValues.floorID) !==\r\n JSON.stringify(this.props.formValues.floorID) ||\r\n JSON.stringify(prevProps.formValues.locationID) !==\r\n JSON.stringify(this.props.formValues.locationID) ||\r\n JSON.stringify(prevProps.formValues.roomID) !==\r\n JSON.stringify(this.props.formValues.roomID) ||\r\n JSON.stringify(prevProps.formValues.buildingID) !==\r\n JSON.stringify(this.props.formValues.buildingID)\r\n ) {\r\n // this.setState({ fieldConfig: this.buildFieldConfig() });\r\n this.updateFormGroup();\r\n }\r\n if (\r\n JSON.stringify(this.props.facility) !==\r\n JSON.stringify(prevProps.facility)\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n updateFormGroup = (\r\n defaultValues: IinstallFormValues = this.prepValuesFromRedux()\r\n ) => {\r\n forEach(defaultValues, (value, key) => {\r\n FormUtil.patchControl(this.formGroup, key, value);\r\n });\r\n // patch the options\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'buildingID',\r\n defaultValues.buildingID,\r\n { options: defaultValues.buildingOptions }\r\n );\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'floorID',\r\n defaultValues.floorID,\r\n {\r\n options: defaultValues.floorOptions\r\n }\r\n );\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'locationID',\r\n defaultValues.locationID,\r\n { options: defaultValues.locationOptions }\r\n );\r\n FormUtil.patchControl(this.formGroup, 'roomID', defaultValues.roomID, {\r\n options: defaultValues.roomOptions\r\n });\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IinstallFormValues => {\r\n const {\r\n buildingID,\r\n floorID,\r\n locationID,\r\n roomID,\r\n system\r\n } = this.props.selectedItem;\r\n\r\n let selectedSystemsOption;\r\n if (system) {\r\n selectedSystemsOption = {\r\n value: system,\r\n label: this.props.t('systemsOptionLabel', {\r\n count: system\r\n })\r\n };\r\n }\r\n\r\n const cleanedItem = omit(this.props.selectedItem, [\r\n 'workOrders',\r\n 'latestMeasurementPointListResult',\r\n 'latestWorkOrder'\r\n ]);\r\n return {\r\n ...cleanedItem,\r\n system: selectedSystemsOption,\r\n ...this.getAllFilteredLocations(\r\n buildingID,\r\n floorID,\r\n locationID,\r\n roomID\r\n )\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (): IinstallBase => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n const cleanedItem = omit(this.props.selectedItem, [\r\n 'workOrders',\r\n 'latestMeasurementPointListResult',\r\n 'latestWorkOrder'\r\n ]);\r\n\r\n // verify the facilities match\r\n if (\r\n this.props.selectedItem.facilityID &&\r\n this.props.selectedItem.facilityID.length &&\r\n this.props.selectedItem.facilityID !== this.props.facility.id\r\n ) {\r\n console.error(\r\n 'facilities do not match',\r\n this.props.selectedItem,\r\n this.props.facility.id\r\n );\r\n toastr.error(\r\n this.props.t('toastMessage:error'),\r\n this.props.t('toastMessage:errorMatchingFacilities'),\r\n constants.toastrError\r\n );\r\n throw new Error('facilities do not match');\r\n }\r\n\r\n let ib: any = {\r\n ...cleanedItem,\r\n ...formValues,\r\n productID:\r\n this.props.selectedItem.productID ||\r\n this.props.selectedProduct.id,\r\n facilityID: this.props.facility.id,\r\n quantity: parseInt(`${formValues.quantity}`, 10)\r\n };\r\n\r\n ib.lastFiveYearMaintenanceDate =\r\n ib.lastFiveYearMaintenanceDate === ''\r\n ? null\r\n : ib.lastFiveYearMaintenanceDate;\r\n ib.lastThreeYearMaintenanceDate =\r\n ib.lastThreeYearMaintenanceDate === ''\r\n ? null\r\n : ib.lastThreeYearMaintenanceDate;\r\n ib.lastTwoYearMaintenanceDate =\r\n ib.lastTwoYearMaintenanceDate === ''\r\n ? null\r\n : ib.lastTwoYearMaintenanceDate;\r\n ib.lastYearlyMaintenanceDate =\r\n ib.lastYearlyMaintenanceDate === ''\r\n ? null\r\n : ib.lastYearlyMaintenanceDate;\r\n ib.lastSixMonthMaintenanceDate =\r\n ib.lastSixMonthMaintenanceDate === ''\r\n ? null\r\n : ib.lastSixMonthMaintenanceDate;\r\n ib.lastQuarterlyMaintenanceDate =\r\n ib.lastQuarterlyMaintenanceDate === ''\r\n ? null\r\n : ib.lastQuarterlyMaintenanceDate;\r\n\r\n ib.latestAGSMeasurementPointListResultID =\r\n ib.latestAGSMeasurementPointListResultID === ''\r\n ? null\r\n : ib.latestAGSMeasurementPointListResultID;\r\n ib.latestAuditMeasurementPointListResultID =\r\n ib.latestAuditMeasurementPointListResultID === ''\r\n ? null\r\n : ib.latestAuditMeasurementPointListResultID;\r\n ib.latestCommissioningMeasurementPointListResultID =\r\n ib.latestCommissioningMeasurementPointListResultID === ''\r\n ? null\r\n : ib.latestCommissioningMeasurementPointListResultID;\r\n ib.latestMeasurementPointListResultID =\r\n ib.latestMeasurementPointListResultID === ''\r\n ? null\r\n : ib.latestMeasurementPointListResultID;\r\n ib.latestVerificationMeasurementPointListResultID =\r\n ib.latestVerificationMeasurementPointListResultID === ''\r\n ? null\r\n : ib.latestVerificationMeasurementPointListResultID;\r\n ib.latestWorkOrderID =\r\n ib.latestWorkOrderID === '' ? null : ib.latestWorkOrderID;\r\n\r\n return ib;\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'prodDate':\r\n this.handleNewManufactureDate(value);\r\n break;\r\n default:\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n this.updateFormValueDebounced({ [key]: value });\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * prepValuesFromRedux\r\n * help filter and build the selected locations, and options\r\n */\r\n prepValuesFromRedux = () => {\r\n const formValues = FormUtil.getValues(this.props.formValues) as {\r\n [key: string]: any;\r\n };\r\n\r\n return {\r\n ...this.props.formValues,\r\n ...this.getAllFilteredLocations(\r\n formValues.buildingID,\r\n formValues.floorID,\r\n formValues.locationID,\r\n formValues.roomID\r\n )\r\n };\r\n };\r\n\r\n generateSerialNumber = () => {\r\n if (!this.state.isGeneratingSerialNumber) {\r\n this.setState({ isGeneratingSerialNumber: true });\r\n msalFetch(API.GET.inventory.getNextSerialNumber, { method: 'GET' })\r\n .then(result => {\r\n const serialNumber = result.data;\r\n this.formGroup.patchValue({ serialNumber });\r\n })\r\n .catch(error =>\r\n constants.handleError(error, 'generate serial number')\r\n )\r\n .finally(() => {\r\n this.setState({ isGeneratingSerialNumber: false });\r\n });\r\n }\r\n };\r\n\r\n /*\r\n * buildFieldConfig\r\n accepts defaultValues and returns a formConfig object\r\n */\r\n buildFieldConfig = (\r\n defaultValues: IinstallFormValues = this.prepValuesFromRedux()\r\n ) => {\r\n const disabled = this.props.canEditInstalls === false;\r\n const isCapitalEquipmentType = Object.values(\r\n capitalEquipmentCategories\r\n ).includes(this.props.mainCategoryID);\r\n\r\n let quantityValidators: ValidatorFn[] = [];\r\n const shouldRequireQuantity = this.props.selectedItem.id.length\r\n ? false\r\n : true;\r\n if (shouldRequireQuantity) {\r\n quantityValidators = [\r\n Validators.min(1),\r\n Validators.max(1000),\r\n FormUtil.validators.requiredWithTrim\r\n ];\r\n }\r\n\r\n const fieldConfigControls = {\r\n $field_0: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n
    \r\n \r\n \r\n
    \r\n )\r\n },\r\n nickname: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'nickname',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'nickname',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(40)\r\n },\r\n formState: { value: defaultValues.nickname, disabled }\r\n },\r\n serialNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'serialNumber',\r\n colWidth: 6,\r\n type: 'input',\r\n name: 'serial-number',\r\n required: isCapitalEquipmentType\r\n },\r\n options: {\r\n validators: isCapitalEquipmentType\r\n ? [\r\n Validators.maxLength(20),\r\n Validators.required,\r\n Validators.pattern(/^[\\w-/]+$/)\r\n ]\r\n : [\r\n Validators.maxLength(20),\r\n Validators.pattern(/^[\\w-/]+$/)\r\n ]\r\n },\r\n formState: { value: defaultValues.serialNumber, disabled }\r\n },\r\n generateSNButton: {\r\n render: ({ meta }) => (\r\n \r\n \r\n {meta.buttonName}\r\n \r\n \r\n ),\r\n meta: {\r\n buttonName: 'Generate S/N',\r\n style: 'primary',\r\n colWidth: 6,\r\n buttonAction: () => this.generateSerialNumber(),\r\n disabled\r\n }\r\n },\r\n rfid: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'rfid',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'rfid',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(20)\r\n },\r\n formState: { value: defaultValues.rfid, disabled }\r\n },\r\n sapEquipmentNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'sapEquipmentNumber',\r\n colWidth: 6,\r\n type: 'input',\r\n name: 'sapEquipmentNumber',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(20)\r\n },\r\n formState: {\r\n value: defaultValues.sapEquipmentNumber,\r\n disabled: true\r\n }\r\n },\r\n sapMaterialNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'sapMaterialNumber',\r\n colWidth: 6,\r\n type: 'input',\r\n name: 'sapMaterialNumber',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(20)\r\n },\r\n formState: {\r\n value: this.props.selectedProduct.sapMaterialNumber,\r\n disabled: true\r\n }\r\n },\r\n remarks: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'remarks',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n name: 'remarks',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(1000)\r\n },\r\n formState: { value: defaultValues.remarks, disabled }\r\n },\r\n quantity: {\r\n options: {\r\n validators: quantityValidators\r\n },\r\n render: FormUtil.TextInput,\r\n inputType: 'number',\r\n meta: {\r\n label: 'quantity',\r\n colWidth: 6,\r\n type: 'number',\r\n defaultValue: 1,\r\n name: 'quantity',\r\n style: shouldRequireQuantity\r\n ? undefined\r\n : { display: 'none' }\r\n },\r\n formState: {\r\n value: defaultValues.quantity || 1,\r\n disabled: isCapitalEquipmentType\r\n }\r\n },\r\n $field_2: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_3: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n \r\n \r\n {this.props.t('imported location')}\r\n \r\n
    \r\n {defaultValues.importedLocation}\r\n
    \r\n
    \r\n \r\n )\r\n },\r\n buildingID: {\r\n render: FormUtil.CreatableSelect,\r\n meta: {\r\n options: defaultValues.buildingOptions,\r\n label: 'building',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n handleCreate: this.handleCreateBuilding,\r\n name: 'building',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.buildingID,\r\n disabled\r\n }\r\n },\r\n floorID: {\r\n render: FormUtil.CreatableSelect,\r\n meta: {\r\n options: defaultValues.floorOptions,\r\n label: 'floor',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n handleCreate: this.handleCreateFloor,\r\n name: 'floor',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.floorID,\r\n disabled\r\n }\r\n },\r\n locationID: {\r\n render: FormUtil.CreatableSelect,\r\n meta: {\r\n options: defaultValues.locationOptions,\r\n label: 'location',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n handleCreate: this.handleCreateLocation,\r\n name: 'location',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.locationID,\r\n disabled\r\n }\r\n },\r\n roomID: {\r\n render: FormUtil.CreatableSelect,\r\n meta: {\r\n options: defaultValues.roomOptions,\r\n label: 'room',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n handleCreate: this.handleCreateRoom,\r\n name: 'room',\r\n required: false,\r\n isClearable: true\r\n },\r\n options: {\r\n validators: Validators.maxLength(250)\r\n },\r\n formState: {\r\n value: defaultValues.roomID,\r\n disabled\r\n }\r\n },\r\n position: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'position',\r\n colWidth: 12,\r\n name: 'position',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(145)\r\n },\r\n formState: { value: defaultValues.position, disabled }\r\n },\r\n system: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.constructSystems(this.props.t),\r\n label: 'system',\r\n colWidth: 12,\r\n placeholder: 'nsJob:typePlaceholder',\r\n name: 'system',\r\n disableSort: true,\r\n required: false\r\n },\r\n formState: { value: defaultValues.system, disabled }\r\n },\r\n prodDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'manufacture date',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'manufacture-date',\r\n required: false,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: { value: defaultValues.prodDate, disabled }\r\n },\r\n $field_4: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n )\r\n },\r\n installDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'install date',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'install-date',\r\n required: false,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: { value: defaultValues.installDate, disabled }\r\n },\r\n lastQuarterlyMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastQuarterlyMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'quarterly-date',\r\n required: false,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastQuarterlyMaintenanceDate,\r\n disabled\r\n }\r\n },\r\n lastSixMonthMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastSixMonthMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'six-month-date',\r\n required: false,\r\n alignRight: true,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastSixMonthMaintenanceDate,\r\n disabled\r\n }\r\n },\r\n lastYearlyMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastYearlyMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'yearly-date',\r\n required: false,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastYearlyMaintenanceDate,\r\n disabled\r\n }\r\n },\r\n lastTwoYearMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastTwoYearMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'two-year-date',\r\n required: false,\r\n alignRight: true,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastTwoYearMaintenanceDate,\r\n disabled\r\n }\r\n },\r\n lastThreeYearMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastThreeYearMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'three-year-date',\r\n required: false,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastThreeYearMaintenanceDate,\r\n disabled\r\n }\r\n },\r\n lastFiveYearMaintenanceDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'lastFiveYearMaintenanceDate',\r\n colWidth: 6,\r\n showTime: false,\r\n name: 'five-year-date',\r\n required: false,\r\n alignRight: true,\r\n placeholder: 'DD-MMM-YY'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.lastFiveYearMaintenanceDate,\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n // REFACTOR: rather than changing the validation and hiding, omit the quantity control here\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n handleNewManufactureDate = (value: string | null) => {\r\n if (moment.isMoment(value) === false) {\r\n return;\r\n }\r\n const newDate = moment.isMoment(value)\r\n ? value.format(constants.momentSQLFormat)\r\n : value;\r\n let newDateFieldValues: { [key: string]: any } = { prodDate: newDate };\r\n\r\n if (newDate) {\r\n const dates = [\r\n 'installDate',\r\n 'lastQuarterlyMaintenanceDate',\r\n 'lastThreeYearMaintenanceDate',\r\n 'lastFiveYearMaintenanceDate',\r\n 'lastTwoYearMaintenanceDate',\r\n 'lastYearlyMaintenanceDate',\r\n 'lastSixMonthMaintenanceDate'\r\n ];\r\n dates.forEach(date => {\r\n const dateValue = this.props.formValues[date];\r\n if (!dateValue) {\r\n newDateFieldValues = {\r\n ...newDateFieldValues,\r\n [date]: newDate\r\n };\r\n // this.formGroup.patchValue({ [date]: moment.utc(value) });\r\n }\r\n });\r\n this.props.updateFormValues(newDateFieldValues);\r\n }\r\n };\r\n\r\n handleFieldLengthError = (name: string) => {\r\n if (name.length > 250) {\r\n toastr.error('Field too long', '', constants.toastrError);\r\n return true;\r\n }\r\n };\r\n\r\n handleCreateBuilding = (name: string) => {\r\n if (this.handleFieldLengthError(name)) {\r\n return;\r\n }\r\n\r\n const locationObject = this.props.saveAnyLocation(\r\n name,\r\n this.props.facility.id,\r\n {}\r\n );\r\n this.props.updateFormValues({\r\n buildingID: { label: name, value: locationObject.id }\r\n });\r\n };\r\n\r\n handleCreateFloor = (name: string) => {\r\n const { buildingID } = this.formGroup.value;\r\n if (!buildingID) {\r\n toastr.error(\r\n 'Please select a building first.',\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (this.handleFieldLengthError(name)) {\r\n return;\r\n }\r\n const locationObject = this.props.saveAnyLocation(\r\n name,\r\n this.props.facility.id,\r\n { buildingID: buildingID.value }\r\n );\r\n this.props.updateFormValues({\r\n floorID: { label: name, value: locationObject.id }\r\n });\r\n };\r\n handleCreateLocation = (name: string) => {\r\n const { buildingID, floorID } = this.formGroup.value;\r\n if (!buildingID || !floorID) {\r\n toastr.error(\r\n 'Please select a building and a floor first.',\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (this.handleFieldLengthError(name)) {\r\n return;\r\n }\r\n const locationObject = this.props.saveAnyLocation(\r\n name,\r\n this.props.facility.id,\r\n { buildingID: buildingID.value, floorID: floorID.value }\r\n );\r\n this.props.updateFormValues({\r\n locationID: { label: name, value: locationObject.id }\r\n });\r\n };\r\n handleCreateRoom = (name: string) => {\r\n const { buildingID, floorID, locationID } = this.formGroup.value;\r\n if (!buildingID || !floorID || !locationID) {\r\n toastr.error(\r\n 'Please select a building, floor, and location first.',\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (this.handleFieldLengthError(name)) {\r\n return;\r\n }\r\n const locationObject = this.props.saveAnyLocation(\r\n name,\r\n this.props.facility.id,\r\n {\r\n buildingID: buildingID.value,\r\n floorID: floorID.value,\r\n locationID: locationID.value\r\n }\r\n );\r\n this.props.updateFormValues({\r\n roomID: { label: name, value: locationObject.id }\r\n });\r\n };\r\n\r\n getAllFilteredLocations = (\r\n buildingID?: string,\r\n floorID?: string,\r\n locationID?: string,\r\n roomID?: string\r\n ) => {\r\n let selectedBuilding, selectedFloor, selectedLocation, selectedRoom;\r\n\r\n if (buildingID) {\r\n selectedBuilding = find(this.props.facility.buildings, {\r\n id: buildingID\r\n }) as Ibuilding;\r\n if (selectedBuilding) {\r\n selectedFloor = find(selectedBuilding.floors, {\r\n id: floorID\r\n });\r\n if (selectedFloor) {\r\n selectedLocation = find(selectedFloor.locations, {\r\n id: locationID\r\n });\r\n if (selectedLocation) {\r\n selectedRoom = find(selectedLocation.rooms, {\r\n id: roomID\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n const buildingOptions = FormUtil.convertToOptions(\r\n this.props.facility.buildings\r\n );\r\n const floorOptions = FormUtil.convertToOptions(\r\n selectedBuilding ? selectedBuilding.floors : []\r\n );\r\n const locationOptions = FormUtil.convertToOptions(\r\n selectedFloor ? selectedFloor.locations : []\r\n );\r\n const roomOptions = FormUtil.convertToOptions(\r\n selectedLocation ? selectedLocation.rooms : []\r\n );\r\n\r\n return {\r\n buildingOptions,\r\n floorOptions,\r\n locationOptions,\r\n roomOptions,\r\n buildingID: FormUtil.convertToSingleOption(selectedBuilding),\r\n floorID: FormUtil.convertToSingleOption(selectedFloor),\r\n locationID: FormUtil.convertToSingleOption(selectedLocation),\r\n roomID: FormUtil.convertToSingleOption(selectedRoom)\r\n };\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n console.info('form submit', this.formGroup);\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (this.props.facility) {\r\n if (this.props.selectedItem.id.length) {\r\n // EDIT\r\n this.props.updateInstall(\r\n this.formValuesToItem(),\r\n this.props.selectedItem.productID\r\n );\r\n } else if (\r\n this.props.selectedProduct &&\r\n this.props.selectedProduct.id.length\r\n ) {\r\n // SAVE NEW\r\n this.props.saveInstall(\r\n this.formValuesToItem(),\r\n this.props.selectedProduct,\r\n this.props.selectedJob\r\n );\r\n } else {\r\n console.error('missing product when saving a new install.');\r\n }\r\n } else {\r\n console.error('missing facility, unable to save install');\r\n toastr.error(\r\n 'Error',\r\n 'Missing facility, please try again or contact support',\r\n constants.toastrError\r\n );\r\n }\r\n };\r\n handleDelete = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.deleteInstall(this.props.selectedItem.id);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('installDeleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.t('installDeleteConfirm'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n setForm = (form: AbstractControl) => {\r\n if (!form) {\r\n console.error('missing form for setForm');\r\n return;\r\n }\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const deleteButtonStyle =\r\n this.props.selectedItem.id.length === 0\r\n ? { marginRight: '15px', display: 'none' }\r\n : { marginRight: '15px' };\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {this.props.canEditInstalls && (\r\n
    \r\n \r\n {t('common:delete')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n
    \r\n )}\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default ManageInstallForm;\r\n","import { toastr } from 'react-redux-toastr';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport {\r\n ItableFiltersParams,\r\n Ibuilding,\r\n Ifloor,\r\n Ilocation,\r\n Iroom,\r\n ThunkResult\r\n} from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { filter, find, orderBy } from 'lodash';\r\nimport { Dispatch } from 'redux';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { initialFacility } from '../reducers/initialState';\r\nimport { IinitialState } from '../reducers';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\nexport function getFacility(facilityID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.facility.getbyid}/${facilityID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOCATION_MANAGE_SUCCESS,\r\n facility: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOCATION_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get facility locations');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * save (add) a new building/floor/location/room\r\n * installBaseLocations is defined when saving locations from the editInstallForm\r\n * TODO this is a great one to change to a redux-offline request\r\n */\r\nconst saveAnyLocationObjectHelper = (\r\n dispatch: Dispatch,\r\n getState: () => IinitialState,\r\n locationObject: Ilocation | Ibuilding | Ifloor | Iroom,\r\n facilityID: string\r\n) => {\r\n dispatch(beginAjaxCall());\r\n let url: string;\r\n let lType: string;\r\n if ('facilityID' in locationObject) {\r\n url = API.POST.building;\r\n lType = 'Building';\r\n } else if ('buildingID' in locationObject) {\r\n url = API.POST.floor;\r\n lType = 'Floor';\r\n } else if ('floorID' in locationObject) {\r\n url = API.POST.location;\r\n lType = 'Location';\r\n } else {\r\n url = API.POST.room;\r\n lType = 'Room';\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: locationObject\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_LOCATION });\r\n dispatch({\r\n type: types.LOCATION_ADD_SUCCESS,\r\n lType,\r\n locationObject,\r\n facilityID\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Created new ${lType}.`,\r\n constants.toastrSuccess\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.LOCATION_ADD_FAILED, error, axiosOptions });\r\n constants.handleError(error, `save ${lType}`);\r\n console.error(error);\r\n });\r\n};\r\n\r\nexport function saveAnyLocation(\r\n name: string,\r\n facilityID: string,\r\n installBaseLocations?: {\r\n buildingID?: string;\r\n floorID?: string;\r\n locationID?: string;\r\n }\r\n // ): ThunkResult<{ id: string }> { // not sure why I can not get this to work\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n let {\r\n buildingID,\r\n floorID,\r\n locationID\r\n } = getState().manageLocation.tableFilters;\r\n if (installBaseLocations) {\r\n buildingID = installBaseLocations.buildingID;\r\n floorID = installBaseLocations.floorID;\r\n locationID = installBaseLocations.locationID;\r\n }\r\n const newLocationObject = {\r\n id: uuidv4(),\r\n name,\r\n isDeleted: false\r\n };\r\n if (locationID) {\r\n saveAnyLocationObjectHelper(\r\n dispatch,\r\n getState,\r\n { ...newLocationObject, locationID },\r\n facilityID\r\n );\r\n } else if (floorID) {\r\n saveAnyLocationObjectHelper(\r\n dispatch,\r\n getState,\r\n { ...newLocationObject, floorID, rooms: [] },\r\n facilityID\r\n );\r\n } else if (buildingID) {\r\n saveAnyLocationObjectHelper(\r\n dispatch,\r\n getState,\r\n { ...newLocationObject, buildingID, locations: [] },\r\n facilityID\r\n );\r\n } else {\r\n saveAnyLocationObjectHelper(\r\n dispatch,\r\n getState,\r\n { ...newLocationObject, facilityID, floors: [] },\r\n facilityID\r\n );\r\n }\r\n return newLocationObject;\r\n };\r\n}\r\n\r\n/*\r\n * update (edit) a building/floor/location/room\r\n */\r\nexport function updateAnyLocation(\r\n locationObject: Ilocation | Ibuilding | Ifloor | Iroom,\r\n facilityID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_LOCATION });\r\n let url: string;\r\n let lType: string;\r\n if ('facilityID' in locationObject) {\r\n url = `${API.PUT.building}/${locationObject.id}`;\r\n lType = 'Building';\r\n } else if ('buildingID' in locationObject) {\r\n url = `${API.PUT.floor}/${locationObject.id}`;\r\n lType = 'Floor';\r\n } else if ('floorID' in locationObject) {\r\n url = `${API.PUT.location}/${locationObject.id}`;\r\n lType = 'Location';\r\n } else {\r\n url = `${API.PUT.room}/${locationObject.id}`;\r\n lType = 'Room';\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: locationObject\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.LOCATION_UPDATE_SUCCESS,\r\n lType,\r\n locationObject,\r\n facilityID\r\n });\r\n\r\n toastr.success(\r\n 'Success',\r\n `Updated ${lType}.`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOCATION_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, `update ${lType}`);\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * update (edit) a building/floor/location/room\r\n */\r\nexport function deleteAnyLocation(\r\n locationObject: Ilocation | Ibuilding | Ifloor | Iroom,\r\n facilityID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n let url: string;\r\n let lType: string;\r\n if (\r\n 'locationID' in locationObject &&\r\n locationObject.locationID !== ''\r\n ) {\r\n url = `${API.DELETE.room}/${locationObject.id}`;\r\n lType = 'Room';\r\n } else if (\r\n 'floorID' in locationObject &&\r\n locationObject.floorID !== ''\r\n ) {\r\n url = `${API.DELETE.location}/${locationObject.id}`;\r\n lType = 'Location';\r\n } else if (\r\n 'buildingID' in locationObject &&\r\n locationObject.buildingID !== ''\r\n ) {\r\n url = `${API.DELETE.floor}/${locationObject.id}`;\r\n lType = 'Floor';\r\n } else {\r\n url = `${API.DELETE.building}/${locationObject.id}`;\r\n lType = 'Building';\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.LOCATION_DELETE_SUCCESS,\r\n lType,\r\n locationObject,\r\n facilityID\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Deleted ${lType}.`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOCATION_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, `delete ${lType}`);\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nconst filterLocationsHelper = (\r\n locations: Array,\r\n tableFilters: ItableFiltersParams\r\n) => {\r\n // const {} = tableFilters;\r\n return filter(locations, location => {\r\n let shouldInclude = true;\r\n if (location.isDeleted === true) {\r\n shouldInclude = false;\r\n }\r\n return shouldInclude;\r\n });\r\n};\r\n\r\nexport const filterLocations = (facilityID: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const { tableFilters } = getState().manageLocation;\r\n const { buildingID, locationID, floorID } = tableFilters;\r\n const { buildings } =\r\n getState().facilities[facilityID] || initialFacility;\r\n let locations: Array = [];\r\n if (buildingID && floorID && locationID) {\r\n // LOCATION\r\n const building: Ibuilding | undefined = find(\r\n buildings,\r\n build => build.id === buildingID\r\n );\r\n if (building && building.floors.length) {\r\n const newFloor = find(building.floors, fl => fl.id === floorID);\r\n if (newFloor && newFloor.locations.length) {\r\n const location = newFloor.locations.find(\r\n item => item.id === locationID\r\n );\r\n if (location && location.rooms.length) {\r\n locations = filterLocationsHelper(\r\n location.rooms,\r\n tableFilters\r\n );\r\n }\r\n }\r\n }\r\n } else if (buildingID && floorID) {\r\n const building = find(buildings, build => build.id === buildingID);\r\n if (building && building.floors.length) {\r\n const newFloor = find(building.floors, fl => fl.id === floorID);\r\n if (newFloor && newFloor.locations.length) {\r\n locations = filterLocationsHelper(\r\n newFloor.locations,\r\n tableFilters\r\n );\r\n }\r\n }\r\n } else if (buildingID) {\r\n const building = find(buildings, build => build.id === buildingID);\r\n if (building && building.floors.length) {\r\n locations = filterLocationsHelper(\r\n building.floors,\r\n tableFilters\r\n );\r\n }\r\n } else {\r\n locations = filterLocationsHelper(buildings, tableFilters);\r\n }\r\n\r\n dispatch({\r\n type: types.SET_VISIBLE_LOCATIONS,\r\n locations: orderBy(locations, 'name')\r\n });\r\n };\r\n};\r\n/*\r\n * receive an array of locationObjects and filter out based on the selected filters and deleted items\r\n */\r\n\r\n// export const setSelectedFacility = (facility: Ifacility) => ({\r\n// type: types.SET_SELECTED_FACILITY,\r\n// facility\r\n// });\r\n\r\nexport const toggleEditLocationModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_LOCATION\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_LOCATION,\r\n filters\r\n});\r\n","/*\r\n * Manage Install Modal - Container\r\n */\r\n\r\nimport { Iproduct } from '../../models';\r\nimport {\r\n deleteInstall,\r\n saveInstall,\r\n toggleEditInstallModal,\r\n updateInstall,\r\n setInstallFormValues,\r\n updateInstallFormValues\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n initialFacility,\r\n initialInstallBase,\r\n initialProduct\r\n} from '../../reducers/initialState';\r\n\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport EditInstallForm from './EditInstallForm';\r\nimport { connect } from 'react-redux';\r\nimport { getCanEditInstalls } from '../../reducers/userReducer';\r\nimport { saveAnyLocation } from '../../actions/manageLocationActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n selectedProduct: Iproduct;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const {\r\n selectedFacilityID,\r\n productInfo,\r\n manageJob: { selectedJob }\r\n } = state;\r\n const {\r\n showSearchNewProductsModal,\r\n tableFilters,\r\n installBasesByID,\r\n selectedInstallBaseID,\r\n showEditInstallModal\r\n } = state.manageInventory;\r\n\r\n const facility = state.facilities[selectedFacilityID] || initialFacility;\r\n const selectedProduct = ownProps.selectedProduct || initialProduct;\r\n\r\n const { subcategoryID } = selectedProduct;\r\n const mainCategoryID = (productInfo.subcategories[subcategoryID] || {})\r\n .mainCategoryID;\r\n\r\n const selectedItem =\r\n installBasesByID[selectedInstallBaseID] || initialInstallBase;\r\n\r\n const canEditInstalls = getCanEditInstalls(state.user);\r\n const modalTitle = selectedItem.id\r\n ? ownProps.t('manageInventory:editInstallModalTitle')\r\n : ownProps.t('manageInventory:saveInstallModalTitle');\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n facility,\r\n show: showEditInstallModal,\r\n productInfo: state.productInfo,\r\n tableFilters,\r\n secondWideModal: showSearchNewProductsModal,\r\n selectedProduct,\r\n mainCategoryID,\r\n selectedItem,\r\n canEditInstalls,\r\n formValues: state.manageInventory.installFormValues,\r\n className: 'install-edit',\r\n title: modalTitle,\r\n selectedJob\r\n };\r\n};\r\n\r\nexport default withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n updateInstall,\r\n saveInstall,\r\n toggleModal: toggleEditInstallModal,\r\n onHide: toggleEditInstallModal,\r\n onCancel: toggleEditInstallModal,\r\n deleteInstall,\r\n saveAnyLocation,\r\n setFormValues: setInstallFormValues,\r\n updateFormValues: updateInstallFormValues\r\n })(WithCommonModal(EditInstallForm))\r\n);\r\n","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport { Iproduct, ItableFiltersParams, ThunkResult } from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nexport function getProductQueue(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n mainCategory,\r\n subCategory,\r\n brand,\r\n origin\r\n } = getState().manageProductQueue.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n page: page || 1,\r\n search: search || '',\r\n mainCategoryID: mainCategory ? mainCategory.value : null,\r\n subCategoryID: subCategory ? subCategory.value : null,\r\n brandID: brand ? brand.value : null,\r\n origin: origin ? origin.value : null,\r\n standards: []\r\n }\r\n };\r\n\r\n const url = API.GET.inventory.getproductqueue;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.PRODUCT_QUEUE_SUCCESS,\r\n payload: { productQueueObjects: data.data.result }\r\n });\r\n dispatch({\r\n type: types.PRODUCT_QUEUE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_QUEUE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get product queue');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getMergeableProducts({\r\n page,\r\n search,\r\n mainCategoryID,\r\n subCategoryID,\r\n brandID,\r\n origin,\r\n isFinalProduct,\r\n standards\r\n}: {\r\n page: number;\r\n search: string | null;\r\n mainCategoryID: string | null;\r\n subCategoryID: string | null;\r\n brandID: string | null;\r\n origin: string | null;\r\n isFinalProduct: boolean;\r\n standards: string[];\r\n}): ThunkResult {\r\n return (dispatch, getState) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n page: page || 1,\r\n search: search || '',\r\n mainCategoryID: mainCategoryID || null,\r\n subCategoryID: subCategoryID || null,\r\n brandID: brandID || null,\r\n origin: origin || null,\r\n isFinalProduct: isFinalProduct || false,\r\n standards: standards || []\r\n }\r\n };\r\n const url = API.GET.inventory.getproductqueue;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.MERGEABLE_PRODUCTS_SUCCESS,\r\n payload: { productQueueObjects: data.data.result }\r\n });\r\n }\r\n return data;\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MERGEABLE_PRODUCTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get mergeable product queue');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function approveProduct(queueID: string, dispatch: any) {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { id: queueID }\r\n };\r\n\r\n const url = API.POST.inventory.approveproduct;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.PRODUCT_APPROVE_SUCCESS,\r\n payload: { queueID }\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_APPROVE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'approve product');\r\n console.error(error);\r\n });\r\n}\r\n\r\nexport function updateQueueProduct(\r\n product: Iproduct,\r\n shouldApprove?: boolean,\r\n queueID?: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_PRODUCT });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: product\r\n };\r\n\r\n const url = API.POST.inventory.updateproduct;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.PRODUCT_QUEUE_PRODUCT_UPDATE_SUCCESS,\r\n payload: { product: data.data, queueID }\r\n });\r\n // toastr.success('Success', 'Saved product', constants.toastrSuccess);\r\n if (shouldApprove && queueID) {\r\n dispatch(beginAjaxCall());\r\n approveProduct(queueID, dispatch); // don't return this because if we do, we will see two errors\r\n }\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.PRODUCT_QUEUE_PRODUCT_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update queue product');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const toggleApproveProductModal = () => ({\r\n type: types.TOGGLE_MODAL_APPROVE_PRODUCT\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_PRODUCT_QUEUE,\r\n filters\r\n});\r\n","/*\r\n * Edit Product Form\r\n * approve and merge products in the Product Queue\r\n * create and edit products\r\n */\r\n\r\nimport * as localForage from 'localforage';\r\nimport * as React from 'react';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Button, Col, ControlLabel, FormGroup } from 'react-bootstrap';\r\nimport Carousel, { Modal, ModalGateway } from 'react-images';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n // GroupProps,\r\n Observable,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport {\r\n deletePhoto,\r\n getPhotosByProduct,\r\n uploadProductPhoto\r\n} from '../../actions/manageAssetPhotosActions';\r\nimport {\r\n createProductName,\r\n saveProduct,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n // GroupPropsEdited,\r\n Ioption,\r\n Iphoto,\r\n Iproduct,\r\n IproductInfo,\r\n IproductLink,\r\n IproductQueueObject,\r\n Isubcategory,\r\n ItableFiltersReducer,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n initialPhoto,\r\n initialProduct,\r\n initialProductQueueObject\r\n} from '../../reducers/initialState';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { filter } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { updateQueueProduct } from '../../actions/manageProductQueueActions';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n productCommunicationMethodEnum,\r\n productLinkTypeEnum\r\n} from '../../models-enums';\r\nimport { AddMultiControl, ImultiControlMeta } from '../common/AddMultiControl';\r\nimport { FormUtil } from '../common/FormUtil';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface IstateChanges extends Observable {\r\n next: () => void;\r\n}\r\n\r\ninterface AbstractControlEdited extends AbstractControl {\r\n stateChanges: IstateChanges;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n toggleModal: () => void;\r\n selectedItem: Iproduct;\r\n selectedQueueObject: IproductQueueObject;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n productInfo: IproductInfo;\r\n tableFilters: ItableFiltersReducer;\r\n saveProduct: typeof saveProduct;\r\n updateQueueProduct: typeof updateQueueProduct;\r\n getPhotosByProduct: typeof getPhotosByProduct;\r\n uploadProductPhoto: typeof uploadProductPhoto;\r\n deletePhoto: typeof deletePhoto;\r\n user: Iuser;\r\n toggleSearchNewProductsModal: typeof toggleSearchNewProductsModal;\r\n selectedFacilityID: string;\r\n canEditProducts: boolean;\r\n canCreateProducts: boolean;\r\n photosByProduct: Iphoto[];\r\n isEditMode: boolean;\r\n}\r\n\r\ninterface Istate {\r\n selectedLink?: IselectedLinkWithOption;\r\n fieldConfig: FieldConfig;\r\n selectedPhotos: Iphoto[];\r\n photoIdsToDelete: string[];\r\n activePhoto: number;\r\n lightboxIsOpen: boolean;\r\n}\r\n\r\ninterface IselectedLinkWithOption {\r\n productID?: string;\r\n url?: string;\r\n type?: Ioption;\r\n other?: string;\r\n}\r\n\r\nclass EditProductForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n static defaultProps = {\r\n selectedItem: initialProduct,\r\n selectedQueueObject: initialProductQueueObject\r\n };\r\n\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n selectedLink: undefined,\r\n fieldConfig: { controls: {} },\r\n selectedPhotos: [],\r\n activePhoto: 0,\r\n lightboxIsOpen: false,\r\n photoIdsToDelete: []\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.setState(\r\n {\r\n fieldConfig: this.buildFieldConfig(\r\n this.props.productInfo,\r\n this.shouldEnableForm() === false,\r\n this.onFileChange\r\n ),\r\n selectedPhotos: this.props.photosByProduct\r\n },\r\n () => {\r\n this.updateAddImageButton();\r\n }\r\n );\r\n\r\n if (\r\n this.props.selectedItem.id &&\r\n this.props.photosByProduct.length === 0\r\n ) {\r\n // an existing product and the photos in the productphotos reducer are not for this product\r\n this.props.getPhotosByProduct(this.props.selectedItem.id);\r\n }\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n JSON.stringify(prevProps.photosByProduct) !==\r\n JSON.stringify(this.props.photosByProduct)\r\n ) {\r\n this.setState(\r\n { selectedPhotos: this.props.photosByProduct },\r\n () => {\r\n this.updateAddImageButton();\r\n }\r\n );\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n handleConfirmCompliant = (value: boolean) => {\r\n if (value === false) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n console.info('user says it is ok');\r\n },\r\n onCancel: () => {\r\n FormUtil.patchControl(this.formGroup, 'isCompliant', true);\r\n },\r\n okText: this.props.t('common:ok'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.t('toastMessage:confirmProductNotCompliant'),\r\n toastrConfirmOptions\r\n );\r\n }\r\n };\r\n\r\n handleConfirmSpares = (value: boolean) => {\r\n if (value === false) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n console.info('user says it is ok');\r\n },\r\n onCancel: () => {\r\n FormUtil.patchControl(this.formGroup, 'hasSpares', true);\r\n },\r\n okText: this.props.t('common:ok'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(\r\n this.props.t('toastMessage:confirmProductHasNoSpares'),\r\n toastrConfirmOptions\r\n );\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'mainCategoryID': {\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'subcategoryID',\r\n null,\r\n {\r\n options: FormUtil.convertToOptions(\r\n this.filterSubcategories(value.value)\r\n )\r\n },\r\n undefined,\r\n true\r\n );\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'productTypeID',\r\n null,\r\n {\r\n options: FormUtil.convertToOptions(\r\n this.filterProductTypes(value.value)\r\n )\r\n },\r\n undefined,\r\n true\r\n );\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'systemSizeID',\r\n null,\r\n {\r\n options: FormUtil.convertToOptions(\r\n this.filterSystemSizes(value.value)\r\n )\r\n },\r\n undefined,\r\n true\r\n );\r\n }\r\n case 'isCompliant': {\r\n this.handleConfirmCompliant(value);\r\n break;\r\n }\r\n case 'hasSpares': {\r\n this.handleConfirmSpares(value);\r\n break;\r\n }\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n onMultiControlChanges = (\r\n item: IselectedLinkWithOption,\r\n multiControlFormGroup?: any\r\n ) => {\r\n if (\r\n (!this.state.selectedLink && item) ||\r\n (this.state.selectedLink &&\r\n JSON.stringify(item) !==\r\n JSON.stringify(this.state.selectedLink))\r\n ) {\r\n this.setState({ selectedLink: item }, () => {\r\n if (multiControlFormGroup) {\r\n let meta = this.buildMultiControlConfig().controls.other\r\n .meta;\r\n // since we are rebuilding the config, we need to re-translate\r\n meta = {\r\n ...meta,\r\n label: this.props.t(meta.label),\r\n name: this.props.t(meta.name)\r\n };\r\n // patch the multi control config\r\n FormUtil.patchControl(\r\n multiControlFormGroup,\r\n 'other',\r\n '',\r\n meta\r\n );\r\n const otherControl = multiControlFormGroup.get('other');\r\n // disable the input so that it is not \"required\" when it is hidden\r\n if (otherControl) {\r\n if (meta.className === 'hidden') {\r\n otherControl.disable();\r\n } else {\r\n otherControl.enable();\r\n }\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n /*\r\n * buildMultiControlConfig\r\n * the goal here is to conditionally render the \"other\" input whenever the \"other\" type of product link is selected\r\n * We update the config here and in onMultiControlChanges we subscribe to changes and patch the \"other\" control with the \"hidden\" className\r\n */\r\n buildMultiControlConfig = () => {\r\n const itemEditFieldConfig = {\r\n controls: {\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'productForm.linkType',\r\n colWidth: 12,\r\n required: true,\r\n isMulti: false,\r\n options: FormUtil.convertEnumToOptions(\r\n productLinkTypeEnum\r\n ),\r\n shouldTranslate: true,\r\n name: 'productForm.linkType'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n }\r\n },\r\n other: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.linkLabel',\r\n colWidth: 12,\r\n required: true,\r\n name: 'productForm.linkLabel',\r\n shouldTranslate: true,\r\n className: ''\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: { value: '', disabled: false }\r\n },\r\n url: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.linkUrl',\r\n colWidth: 12,\r\n required: true,\r\n placeholder: 'productForm.linkPlaceholder',\r\n name: 'productForm.linkUrl'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(constants.urlValidatorPattern),\r\n Validators.maxLength(1000)\r\n ]\r\n }\r\n }\r\n }\r\n };\r\n\r\n if (\r\n !this.state.selectedLink ||\r\n (this.state.selectedLink &&\r\n this.state.selectedLink.type &&\r\n parseInt(this.state.selectedLink.type.value) !==\r\n productLinkTypeEnum.other) ||\r\n (this.state.selectedLink && !this.state.selectedLink.type)\r\n ) {\r\n const newMeta = {\r\n ...itemEditFieldConfig.controls.other.meta,\r\n className: 'hidden'\r\n };\r\n const newOtherControl = {\r\n ...itemEditFieldConfig.controls.other,\r\n formState: { value: '', disabled: true },\r\n meta: newMeta\r\n };\r\n itemEditFieldConfig.controls.other = newOtherControl;\r\n }\r\n return itemEditFieldConfig;\r\n };\r\n\r\n onFileChange = (key: string, file: File) => {\r\n const id = uuidv4();\r\n const objectUrl = window.URL.createObjectURL(file);\r\n\r\n localForage.setItem(id, file).then(value => {\r\n this.setState(\r\n {\r\n selectedPhotos: [\r\n {\r\n ...initialPhoto,\r\n id,\r\n thumbnailUrl: objectUrl,\r\n lightboxUrl: objectUrl,\r\n src: objectUrl,\r\n productID: this.props.selectedItem.id,\r\n isNew: true\r\n }\r\n ],\r\n photoIdsToDelete: this.state.selectedPhotos?.length\r\n ? [\r\n ...this.state.photoIdsToDelete,\r\n this.state.selectedPhotos[0]?.id\r\n ]\r\n : []\r\n },\r\n () => {\r\n this.updateAddImageButton();\r\n }\r\n );\r\n });\r\n };\r\n\r\n getAddImageLabel = (): string => {\r\n return this.state.selectedPhotos.length > 0\r\n ? this.props.t('manageProduct:productPhotoUpload')\r\n : this.props.t('manageProduct:productNoPhotoUpload');\r\n };\r\n\r\n updateAddImageButton = () => {\r\n FormUtil.patchControlMeta(this.formGroup, 'file', {\r\n label: this.getAddImageLabel()\r\n });\r\n };\r\n\r\n buildFieldConfig = (\r\n productInfo: IproductInfo,\r\n disabled: boolean,\r\n onFileChange: any\r\n ) => {\r\n const {\r\n sku,\r\n description,\r\n brandID,\r\n subcategoryID,\r\n productTypeID,\r\n powerID,\r\n systemSizeID,\r\n isActive,\r\n isCompliant,\r\n isFinalProduct,\r\n hasSpares,\r\n communicationMethod,\r\n links,\r\n origin,\r\n notes,\r\n sapMaterialNumber,\r\n productStandards\r\n } = this.props.selectedItem;\r\n const { creator } = this.props.selectedQueueObject;\r\n let filteredSubcategoryOptions: Ioption[] = [];\r\n let productTypeOptions = productInfo.productTypeOptions;\r\n let systemSizeOptions = productInfo.systemSizeOptions;\r\n // let selectedSubcategoryID = null;\r\n let selectedMainCategory: any = null;\r\n const selectedBrand = brandID ? productInfo.brands[brandID] : null;\r\n const selectedSubcategory = subcategoryID\r\n ? productInfo.subcategories[subcategoryID]\r\n : null;\r\n const selectedProductType = productTypeID\r\n ? productInfo.productTypes[productTypeID]\r\n : null;\r\n const selectedPower = powerID ? productInfo.powers[powerID] : null;\r\n const selectedSystemSize = systemSizeID\r\n ? productInfo.systemSizes[systemSizeID]\r\n : null;\r\n const selectedCommunicationMethod = {\r\n value: communicationMethod,\r\n label: this.props.t(\r\n productCommunicationMethodEnum[communicationMethod]\r\n )\r\n };\r\n\r\n const originOptions: Ioption[] = [\r\n { value: 'USN', label: 'USN' },\r\n { value: 'GBN', label: 'GBN' },\r\n { value: 'CAN', label: 'CAN' }\r\n ];\r\n\r\n const selectedOrigin = originOptions.find(x => x.value === origin);\r\n\r\n const standard_ids = new Set(\r\n productStandards.map(standard => standard['standardID'])\r\n );\r\n const selectedProductStandards: Ioption[] = productInfo.standardOptions.filter(\r\n option => standard_ids.has(option['value'])\r\n );\r\n\r\n // turn link type into iOptions\r\n const selectedLinks = links.map(link => {\r\n return {\r\n ...link,\r\n type: {\r\n value: link.type,\r\n label: productLinkTypeEnum[link.type]\r\n }\r\n };\r\n });\r\n if (subcategoryID) {\r\n // TODO for now grabbing the mainCategoryID. when we actually support having multiple mainCategories related to a single subCategory, we will need to store the mainCategoryID on the product object\r\n const subCategory = productInfo.subcategories[subcategoryID];\r\n if (subCategory) {\r\n const mainCategoryID =\r\n productInfo.subcategories[subcategoryID].mainCategoryID;\r\n if (mainCategoryID) {\r\n selectedMainCategory =\r\n productInfo.mainCategories[mainCategoryID];\r\n filteredSubcategoryOptions = FormUtil.convertToOptions(\r\n this.filterSubcategories(mainCategoryID)\r\n );\r\n productTypeOptions = FormUtil.convertToOptions(\r\n this.filterProductTypes(mainCategoryID)\r\n );\r\n systemSizeOptions = FormUtil.convertToOptions(\r\n this.filterSystemSizes(mainCategoryID)\r\n );\r\n }\r\n }\r\n }\r\n const itemEditFieldConfig = this.buildMultiControlConfig();\r\n\r\n const fieldConfigControls = {\r\n file: {\r\n render: this.shouldEnableForm() ? FormUtil.FileInput : null,\r\n meta: {\r\n type: 'file',\r\n label: this.getAddImageLabel(),\r\n name: 'product-image',\r\n icon: 'plus',\r\n colWidth: 12,\r\n accept: 'image/png, image/jpeg',\r\n required: false,\r\n onChange: onFileChange,\r\n uploadButton: true,\r\n style: { textAlign: 'right' }\r\n }\r\n },\r\n $field_0: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n \r\n \r\n {this.props.t('productForm.createdBy')}\r\n \r\n
    \r\n {creator.first} {creator.last}\r\n
    \r\n
    \r\n \r\n )\r\n },\r\n sapMaterialNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.partNumber',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'sapMaterialNumber',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(250)\r\n },\r\n formState: {\r\n value: sapMaterialNumber,\r\n disabled: true\r\n }\r\n },\r\n sku: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.sku',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'sku',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(250)\r\n },\r\n formState: {\r\n value: sku,\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n description: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.description',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n name: 'description',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(1000)\r\n },\r\n formState: {\r\n value: description,\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n notes: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'productForm.notes',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n name: 'notes',\r\n required: false\r\n },\r\n options: {\r\n validators: Validators.maxLength(1000)\r\n },\r\n formState: { value: notes, disabled: false }\r\n },\r\n // origin: {\r\n // render: FormUtil.Select,\r\n // meta: {\r\n // label: 'productForm.origin',\r\n // colWidth: 12,\r\n // componentClass: 'input',\r\n // name: 'origin',\r\n // options: originOptions,\r\n // required: false\r\n // },\r\n // formState: {\r\n // value: selectedOrigin,\r\n // disabled: sapMaterialNumber ? true : false\r\n // }\r\n // },\r\n brandID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'productForm.brand',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'brand'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedBrand),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n mainCategoryID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.mainCategoryOptions,\r\n label: 'mainCategory',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'main-category'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedMainCategory),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n subcategoryID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: selectedMainCategory\r\n ? filteredSubcategoryOptions\r\n : [],\r\n label: 'productForm.subcategory',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'subcategory'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedSubcategory),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n productTypeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productTypeOptions,\r\n label: 'productForm.productType',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'gas-type',\r\n isClearable: true,\r\n required: false\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedProductType),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n powerID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.powerOptions,\r\n label: 'productForm.power',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'power',\r\n isClearable: true,\r\n required: false\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedPower),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n // model\r\n systemSizeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: systemSizeOptions,\r\n label: 'productForm.systemSize',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'system-size',\r\n isClearable: true,\r\n required: false\r\n },\r\n formState: {\r\n value: FormUtil.convertToSingleOption(selectedSystemSize),\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n communicationMethod: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n productCommunicationMethodEnum\r\n ),\r\n label: 'productForm.communicationMethod',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'communicationMethod',\r\n isClearable: false,\r\n required: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: selectedCommunicationMethod,\r\n disabled: sapMaterialNumber ? true : false\r\n }\r\n },\r\n productStandards: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.standardOptions,\r\n label: 'productForm.standards',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: true,\r\n name: 'product-standards'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: selectedProductStandards,\r\n disabled\r\n }\r\n },\r\n links: {\r\n render: AddMultiControl,\r\n meta: {\r\n label: 'productForm.links',\r\n buttonLabel: this.props.t('productForm.addLink'),\r\n colWidth: 12,\r\n colorButton: this.props.colorButton,\r\n t: this.props.t,\r\n modalTitle: 'productForm.linkModalTitle',\r\n getItemTitle: (item: IselectedLinkWithOption) =>\r\n item.type\r\n ? `${\r\n parseInt(item.type.value) ===\r\n productLinkTypeEnum.other\r\n ? item.other\r\n : this.props.t(\r\n productLinkTypeEnum[\r\n parseInt(item.type.value)\r\n ]\r\n )\r\n }`\r\n : '',\r\n onValueChanges: this.onMultiControlChanges,\r\n disableDelete:\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]) === false,\r\n disableEdit:\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]) === false,\r\n actions: [\r\n {\r\n label: 'productForm.viewLinkButton',\r\n onClick: item => {\r\n const pLink = item as IproductLink;\r\n window.open(pLink.url, '_blank');\r\n },\r\n getTitle: (item: IproductLink) => item.url\r\n }\r\n ],\r\n itemEditFieldConfig\r\n } as ImultiControlMeta,\r\n formState: { value: selectedLinks, disabled }\r\n },\r\n $field_spacing: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n )\r\n },\r\n isActive: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'productForm.active', colWidth: 6 },\r\n formState: { value: isActive, disabled }\r\n },\r\n isCompliant: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'productForm.compliant', colWidth: 6 },\r\n formState: { value: isCompliant, disabled }\r\n },\r\n hasSpares: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'productForm.spares', colWidth: 6 },\r\n formState: { value: hasSpares, disabled }\r\n },\r\n isFinalProduct: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'productForm.isFinalProduct', colWidth: 6 },\r\n formState: { value: isFinalProduct, disabled }\r\n }\r\n };\r\n\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n filterSubcategories = (mainCategoryID: string) => {\r\n return filter(\r\n this.props.productInfo.subcategories,\r\n (sub: Isubcategory) => {\r\n return sub.mainCategoryID === mainCategoryID;\r\n }\r\n );\r\n };\r\n\r\n filterProductTypes = (mainCategoryID: string) => {\r\n return filter(this.props.productInfo.productTypes, type => {\r\n return type.mainCategoryIDs.indexOf(mainCategoryID) !== -1;\r\n });\r\n };\r\n\r\n filterSystemSizes = (mainCategoryID: string) => {\r\n return filter(this.props.productInfo.systemSizes, systemSize => {\r\n return systemSize.mainCategoryIDs.indexOf(mainCategoryID) !== -1;\r\n });\r\n };\r\n\r\n handleSubmit = (\r\n e: React.MouseEvent,\r\n shouldApprove = false\r\n ) => {\r\n e.preventDefault();\r\n\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n\r\n // when mainCategoryID is disabled it is not included in the form value\r\n let mainCategoryID = this.formGroup.value.mainCategoryID;\r\n if (!mainCategoryID) {\r\n const subCategory = this.props.productInfo.subcategories[\r\n this.props.selectedItem.subcategoryID\r\n ];\r\n mainCategoryID = FormUtil.convertToSingleOption(\r\n this.props.productInfo.mainCategories[\r\n subCategory.mainCategoryID\r\n ]\r\n );\r\n }\r\n\r\n let productStandards = this.formGroup.value.productStandards;\r\n productStandards = productStandards.map((item: any) => ({\r\n StandardID: item.value\r\n }));\r\n\r\n const productName = createProductName({\r\n ...this.formGroup.value,\r\n mainCategoryID\r\n });\r\n let linksWithProductID = [];\r\n\r\n // convert the link value to the enum\r\n if (this.formGroup.value.links) {\r\n linksWithProductID = this.formGroup.value.links.map(\r\n (link: IselectedLinkWithOption) => ({\r\n ...link,\r\n productID: this.props.selectedItem.id,\r\n type: link.type ? link.type.value : 1\r\n })\r\n );\r\n }\r\n\r\n let updatedProduct: any = {\r\n ...this.props.selectedItem,\r\n ...formValues,\r\n name: productName,\r\n links: linksWithProductID,\r\n id: this.props.selectedItem.id || uuidv4(),\r\n productStandards\r\n };\r\n\r\n updatedProduct.mergedProductID =\r\n updatedProduct.mergedProductID &&\r\n updatedProduct.mergedProductID !== ''\r\n ? updatedProduct.mergedProductID\r\n : undefined;\r\n updatedProduct.powerID =\r\n updatedProduct.powerID && updatedProduct.powerID !== ''\r\n ? updatedProduct.powerID\r\n : undefined;\r\n updatedProduct.systemSizeID =\r\n updatedProduct.systemSizeID && updatedProduct.systemSizeID !== ''\r\n ? updatedProduct.systemSizeID\r\n : undefined;\r\n updatedProduct.productTypeID =\r\n updatedProduct.productTypeID && updatedProduct.productTypeID !== ''\r\n ? updatedProduct.productTypeID\r\n : undefined;\r\n\r\n if (\r\n this.props.selectedItem.id.length &&\r\n this.props.selectedQueueObject.id.length\r\n ) {\r\n // updating a queue object, no need for a facilityID\r\n this.props.updateQueueProduct(\r\n updatedProduct,\r\n shouldApprove,\r\n this.props.selectedQueueObject.id\r\n );\r\n } else {\r\n const photosToUpload: Iphoto[] =\r\n this.state.selectedPhotos?.filter(photo => photo.isNew) || [];\r\n\r\n this.props.saveProduct(\r\n updatedProduct,\r\n this.props.isEditMode,\r\n photosToUpload,\r\n this.state.photoIdsToDelete,\r\n true\r\n );\r\n }\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n shouldEnableForm = () => {\r\n const isEditing = this.props.selectedItem.id.length > 0;\r\n if (isEditing) {\r\n return this.props.canEditProducts;\r\n } else {\r\n return this.props.canCreateProducts;\r\n }\r\n };\r\n\r\n openLightbox = (index: number) => {\r\n this.setState({ activePhoto: index, lightboxIsOpen: true });\r\n };\r\n\r\n closeLightbox = () => {\r\n this.setState({ activePhoto: 0, lightboxIsOpen: false });\r\n };\r\n\r\n deletePhoto = (photoID: string, productID: string) => (evt: any) => {\r\n evt.stopPropagation();\r\n this.setState(\r\n {\r\n selectedPhotos: [],\r\n photoIdsToDelete: [...this.state.photoIdsToDelete, photoID]\r\n },\r\n () => {\r\n this.updateAddImageButton();\r\n }\r\n );\r\n };\r\n\r\n renderPhotos = (photos?: Iphoto[]) => {\r\n if (!photos?.length) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n
    \r\n {photos.map(({ id, thumbnailUrl, productID }, index) => (\r\n this.openLightbox(index)}\r\n >\r\n {this.shouldEnableForm() && (\r\n
    \r\n \r\n
    \r\n )}\r\n \"\"\r\n
    \r\n ))}\r\n
    \r\n \r\n );\r\n };\r\n\r\n render() {\r\n const { user, t } = this.props;\r\n const hasManageSuggestedParts = constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.ManageSuggestedParts.id\r\n ]);\r\n\r\n return (\r\n
    \r\n {/* We don't want the Search For Existing Product on Products Screen */}\r\n {!!this.props.selectedItem.id.length && (\r\n \r\n {t('manageInventory:mergeProduct')}\r\n \r\n )}\r\n\r\n {!(this.props.selectedItem && this.props.selectedItem.id) && (\r\n \r\n

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

    \r\n \r\n )}\r\n {this.props.selectedItem && this.props.selectedItem.id && (\r\n \r\n
    \r\n {this.props.selectedItem.name}\r\n
    \r\n \r\n )}\r\n {hasManageSuggestedParts &&\r\n !this.props.selectedQueueObject?.id &&\r\n !!(\r\n this.props.selectedItem && this.props.selectedItem.id\r\n ) && (\r\n \r\n this.props.history.push(\r\n `/suggested_parts?productID=${this.props.selectedItem.id}`\r\n )\r\n }\r\n style={{\r\n marginBottom: '15px',\r\n marginRight: '15px'\r\n }}\r\n className=\"pull-right\"\r\n >\r\n {t('manageInventory:manageSuggestedParts')}\r\n \r\n )}\r\n\r\n {this.renderPhotos(this.state.selectedPhotos)}\r\n\r\n \r\n {this.state.lightboxIsOpen && (\r\n ({\r\n ...base,\r\n zIndex: 10000\r\n }),\r\n blanket: (base: any) => ({\r\n ...base,\r\n zIndex: 10000\r\n })\r\n }}\r\n >\r\n ({\r\n ...photo,\r\n source: photo.lightboxUrl,\r\n caption: photo.name\r\n })\r\n )}\r\n />\r\n \r\n )}\r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {this.shouldEnableForm() && (\r\n \r\n {t('common:save')}\r\n \r\n )}\r\n {!!this.props.selectedQueueObject.id.length && (\r\n \r\n this.handleSubmit(evt, true)\r\n }\r\n >\r\n {t('manageInventory:saveApprove')}\r\n \r\n )}\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default EditProductForm;\r\n","/*\r\n * Manage Product Modal\r\n */\r\nimport { connect } from 'react-redux';\r\n\r\nimport { Iproduct, IproductQueueObject } from '../../models';\r\nimport {\r\n saveProduct,\r\n toggleEditProductModal,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getPhotosByProduct,\r\n uploadProductPhoto,\r\n deletePhoto\r\n} from '../../actions/manageAssetPhotosActions';\r\nimport { updateQueueProduct } from '../../actions/manageProductQueueActions';\r\nimport EditProductForm from './EditProductForm';\r\nimport {\r\n getCanEditProducts,\r\n getCanCreateProducts\r\n} from '../../reducers/userReducer';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { RouteComponentProps, withRouter } from 'react-router';\r\n\r\ninterface Iprops {\r\n selectedItem: Iproduct;\r\n selectedQueueObject: IproductQueueObject;\r\n colorButton: any;\r\n secondModal?: boolean;\r\n secondWideModal?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation & RouteComponentProps\r\n) => {\r\n const { selectedFacilityID } = state;\r\n const canEditProducts = getCanEditProducts(state.user);\r\n const canCreateProducts = getCanCreateProducts(state.user);\r\n let modalTitle;\r\n if (ownProps.selectedQueueObject && ownProps.selectedQueueObject.id) {\r\n modalTitle = ownProps.t('manageProductQueue:editModalTitle');\r\n } else if (ownProps.selectedItem && ownProps.selectedItem.id) {\r\n modalTitle = ownProps.t('manageInventory:editModalTitle');\r\n } else {\r\n modalTitle = ownProps.t('manageInventory:saveModalTitle');\r\n }\r\n\r\n const isEditMode = ownProps.selectedItem?.id.length > 0;\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showEditProductModal,\r\n productInfo: state.productInfo,\r\n tableFilters: state.manageInventory.tableFilters,\r\n canEditProducts,\r\n canCreateProducts,\r\n className: 'edit-product',\r\n title: modalTitle,\r\n selectedItem: ownProps.selectedItem,\r\n selectedFacilityID,\r\n selectedQueueObject: ownProps.selectedQueueObject,\r\n secondWideModal: ownProps.secondWideModal,\r\n photosByProduct:\r\n state.manageAssetPhotos.photosByProduct[ownProps.selectedItem.id] ??\r\n [],\r\n isEditMode\r\n };\r\n};\r\n\r\nexport default withTranslation('manageInventory')(\r\n withRouter(\r\n connect(mapStateToProps, {\r\n saveProduct,\r\n toggleModal: toggleEditProductModal,\r\n onHide: toggleEditProductModal,\r\n onCancel: toggleEditProductModal,\r\n updateQueueProduct,\r\n toggleSearchNewProductsModal,\r\n getPhotosByProduct,\r\n uploadProductPhoto,\r\n deletePhoto\r\n })(WithCommonModal(EditProductForm))\r\n )\r\n);\r\n","/*\r\n * Import Installs\r\n */\r\n\r\nimport {\r\n Button,\r\n Col,\r\n ControlLabel,\r\n FormControl,\r\n FormGroup\r\n} from 'react-bootstrap';\r\nimport * as React from 'react';\r\nimport { importInstall } from '../../actions/manageInventoryActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { TFunction } from 'i18next';\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n importInstall: typeof importInstall;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n}\r\ninterface Istate {\r\n file?: File;\r\n}\r\n\r\nclass ManageInstallForm extends React.Component {\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n file: undefined\r\n };\r\n }\r\n\r\n handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n\r\n this.props.importInstall(this.state.file);\r\n };\r\n\r\n addFile = (fileInput: HTMLInputElement) => {\r\n if (fileInput.files) {\r\n this.setState({ file: fileInput.files[0] });\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const selectedFile = this.state.file;\r\n\r\n const formClassName = `beacon-form import-install-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n

    {t('uploadInstructions')}

    \r\n \r\n {t('exampleButton')}\r\n \r\n \r\n \r\n \r\n {t('sapTemplate')}\r\n \r\n \r\n \r\n\r\n
    \r\n \r\n \r\n \r\n \r\n {t('importInstallLabel')}\r\n \r\n {\r\n const input = e.target as HTMLInputElement;\r\n this.addFile(input);\r\n }}\r\n style={{ display: 'none' }}\r\n />\r\n \r\n \r\n {selectedFile && {selectedFile.name}}\r\n \r\n\r\n \r\n \r\n {t('common:cancel')}\r\n \r\n\r\n \r\n {t('import')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default ManageInstallForm;\r\n","/*\r\n * Import Instal Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n importInstall,\r\n toggleImportInstallModal\r\n} from '../../actions/manageInventoryActions';\r\nimport ImportInstallForm from './ImportInstallForm';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const title = ownProps.t('importInstallModalTitle');\r\n return {\r\n user: state.user,\r\n title,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showImportInstallModal,\r\n className: 'user-edit'\r\n };\r\n};\r\n\r\nexport default withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n importInstall,\r\n toggleModal: toggleImportInstallModal,\r\n onHide: toggleImportInstallModal,\r\n onCancel: toggleImportInstallModal\r\n })(WithCommonModal(ImportInstallForm))\r\n);\r\n","import * as React from 'react';\r\n\r\nimport ReactTable, {\r\n Column,\r\n FinalState,\r\n RowInfo,\r\n RowRenderProps\r\n} from 'react-table';\r\nimport {\r\n clearSelectedInstallBaseID,\r\n setInstallBatchMode,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleEditInstallModal,\r\n toggleInstallContactModal,\r\n toggleMPResultModal,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getWorkOrdersByFacility,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { Ifacility, IinstallBase } from '../../models';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { orderBy } from 'lodash';\r\nimport { Button, DropdownButton, MenuItem } from 'react-bootstrap';\r\nimport selectTableHOC, {\r\n SelectTableAdditionalProps\r\n} from 'react-table/lib/hoc/selectTable';\r\nimport treeTableHOC from 'react-table/lib/hoc/treeTable';\r\nimport {\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase\r\n} from '../../actions/measurementPointResultsActions';\r\nimport { addToCart } from '../../actions/shoppingCartActions';\r\nimport { measurementPointResultStatusTypesEnum } from '../../models-enums';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { InstallBaseActionButtonContainer } from '../dashboard/InstallBaseActionButtonContainer';\r\n\r\nconst SelectTable = selectTableHOC(treeTableHOC(ReactTable));\r\n\r\ninterface RowInfoInstallBase extends RowInfo {\r\n original: IinstallBase;\r\n}\r\ninterface ExpanderProps extends RowInfo {\r\n addToCart: typeof addToCart;\r\n t: TFunction;\r\n showAddInstallation: boolean;\r\n showRequestQuote: boolean;\r\n showEditProduct: boolean;\r\n showMoveFacility: boolean;\r\n setInstallBatchMode: typeof setInstallBatchMode;\r\n facility: Ifacility;\r\n setSelectedInstallBaseID: typeof setSelectedInstallBaseID;\r\n clearSelectedInstallBaseID: typeof clearSelectedInstallBaseID;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n toggleMPResultModal: typeof toggleMPResultModal;\r\n toggleEditProductModal: () => any;\r\n toggleEditInstallModal: typeof toggleEditInstallModal;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n toggleSearchNewProductsModal: typeof toggleSearchNewProductsModal;\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n getFacilityMeasurementPointResults: typeof getFacilityMeasurementPointResults;\r\n getMeasurementPointResultsHistoryByInstallBase: typeof getMeasurementPointResultsHistoryByInstallBase;\r\n getWorkOrdersByFacility: typeof getWorkOrdersByFacility;\r\n colorButton: string;\r\n openSearchFacilityModal: (ids: string[]) => void;\r\n}\r\ninterface Istate {\r\n selectAll: boolean;\r\n checkboxTable: any;\r\n selection: string[];\r\n}\r\n\r\n/*\r\n * The Installations Expander\r\n */\r\nexport const InstallBasesExpander: React.FC = props => {\r\n const [state, setState] = React.useState({\r\n selectAll: false,\r\n checkboxTable: {},\r\n selection: []\r\n });\r\n\r\n const installBasesWithLocationString = props.original.installBases.map(\r\n (install: IinstallBase) => {\r\n return {\r\n ...install,\r\n locationString: TableUtil.buildLocation(install, props.facility)\r\n };\r\n }\r\n );\r\n const sortedInstallBases = orderBy(\r\n installBasesWithLocationString,\r\n 'installString'\r\n );\r\n\r\n const getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoInstallBase | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column) {\r\n if (column.id && column.id === 'actions') {\r\n return {};\r\n } else {\r\n return {\r\n onClick: () => {\r\n props.setSelectedInstallBaseID(rowInfo.original.id);\r\n props.setSelectedProductID(rowInfo.original.productID);\r\n props.toggleEditInstallModal();\r\n }\r\n };\r\n }\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const toggleAll = () => {\r\n const { keyField = 'id' } = props;\r\n const selectAll = !state.selectAll;\r\n const selection: string[] = [];\r\n\r\n if (selectAll && keyField !== undefined) {\r\n // we need to get at the internals of ReactTable\r\n const wrappedInstance = state.checkboxTable.getWrappedInstance();\r\n // the 'sortedData' property contains the currently accessible records based on the filter and sort\r\n const currentRecords: any[] = wrappedInstance.getResolvedState()\r\n .sortedData;\r\n // we just push all the IDs onto the selection array\r\n currentRecords.forEach(item => {\r\n selection.push(`select-${item._original[keyField]}`);\r\n });\r\n }\r\n\r\n setState({ ...state, selectAll, selection });\r\n };\r\n\r\n /**\r\n * Whether or not a row is selected for select table\r\n */\r\n const isSelected = (key: string) => {\r\n return state.selection.includes(`select-${key}`);\r\n };\r\n\r\n const toggleSelection = (key: string, shift: boolean, row: any) => {\r\n // start off with the existing state\r\n let selection = [...state.selection];\r\n const keyIndex = selection.indexOf(key);\r\n\r\n // check to see if the key exists\r\n if (keyIndex >= 0) {\r\n // it does exist so we will remove it using destructing\r\n selection = [\r\n ...selection.slice(0, keyIndex),\r\n ...selection.slice(keyIndex + 1)\r\n ];\r\n } else {\r\n // it does not exist so add it\r\n selection.push(key);\r\n }\r\n\r\n setState({ ...state, selection });\r\n };\r\n\r\n const bulkChangeFacility = () => {\r\n let ids: string[] = [];\r\n state.selection.forEach(item => {\r\n ids.push(item.slice(7));\r\n });\r\n\r\n props.openSearchFacilityModal(ids);\r\n };\r\n\r\n const bulkChangeProduct = async () => {\r\n const installBaseIDs: string[] = state.selection.reduce(\r\n (carry, item) => {\r\n carry.push(item.slice(7) as string);\r\n return carry;\r\n },\r\n [] as string[]\r\n );\r\n\r\n await props.toggleSearchNewProductsModal();\r\n props.setInstallBatchMode({\r\n installBaseIDs,\r\n isBatchMode: true\r\n });\r\n };\r\n\r\n const ExpanderButtonBar = (eProps: RowRenderProps) => {\r\n return (\r\n \r\n {/* bulk action button */}\r\n {state.selection.length > 0 && props.showMoveFacility && (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1:\r\n bulkChangeFacility();\r\n break;\r\n case 2:\r\n bulkChangeProduct();\r\n break;\r\n }\r\n }}\r\n >\r\n \r\n {props.t('changeFacility')}\r\n \r\n \r\n {props.t('editSelectionProduct') !==\r\n 'editSelectionProduct'\r\n ? props.t('editSelectionProduct')\r\n : 'Change Product'}\r\n \r\n \r\n
    \r\n )}\r\n {props.showMoveFacility && (\r\n {\r\n const installIds: string[] = props.original.installBases.map(\r\n (install: IinstallBase) => {\r\n return install.id;\r\n }\r\n );\r\n props.openSearchFacilityModal(installIds);\r\n }}\r\n >\r\n {props.t('moveAllAssets')}\r\n \r\n )}\r\n {props.showEditProduct && (\r\n {\r\n props.toggleEditProductModal();\r\n props.setSelectedProductID(props.original.id);\r\n }}\r\n >\r\n {props.t('editProduct')}\r\n \r\n )}\r\n {props.showEditProduct === false && (\r\n {\r\n props.toggleEditProductModal();\r\n props.setSelectedProductID(props.original.id);\r\n }}\r\n >\r\n {props.t('viewProduct')}\r\n \r\n )}\r\n {props.showRequestQuote && (\r\n \r\n props.addToCart(\r\n props.original,\r\n 'INVENTORY',\r\n props.t\r\n )\r\n }\r\n >\r\n {props.t('addToQuote')}\r\n \r\n )}\r\n\r\n {props.showAddInstallation && (\r\n {\r\n props.clearSelectedInstallBaseID();\r\n props.toggleEditInstallModal();\r\n }}\r\n >\r\n {props.t('addInstallation')}\r\n \r\n )}\r\n \r\n );\r\n };\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Footer: ExpanderButtonBar,\r\n minWidth: 20,\r\n id: 'indent-column-button-bar'\r\n },\r\n {\r\n Header: 'serialNumber',\r\n accessor: 'serialNumber',\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'rfid',\r\n id: 'rfid',\r\n accessor: ({ rfid, sapEquipmentNumber }) => {\r\n return (\r\n \r\n {rfid}\r\n \r\n );\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'Location',\r\n id: 'location',\r\n accessor: 'locationString',\r\n minWidth: 220\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: ({ visibleStatus }: IinstallBase) => {\r\n const statusString =\r\n measurementPointResultStatusTypesEnum[visibleStatus];\r\n\r\n return (\r\n {`${props.t(\r\n 'manageMeasurementPointLists:' + statusString\r\n )}`}\r\n );\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: '',\r\n id: 'actions',\r\n Cell: rowInfo => (\r\n \r\n ),\r\n minWidth: 90,\r\n style: { overflow: 'visible' }\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n return (\r\n
    \r\n (state.checkboxTable = r)}\r\n keyField=\"id\"\r\n showPagination={props.original.installBases.length >= 10}\r\n />\r\n
    \r\n );\r\n};\r\n","/*\r\n * Installs Expander Container connects the InstallBasesExpander to redux\r\n */\r\n\r\nimport {\r\n clearSelectedInstallBaseID,\r\n setInstallBatchMode,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleEditInstallModal,\r\n toggleEditProductModal,\r\n toggleInstallContactModal,\r\n toggleMPResultModal,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getCanCreateAsManager,\r\n getCanEditInstalls,\r\n getCanEditProducts,\r\n getCanRequestQuote\r\n} from '../../reducers/userReducer';\r\nimport {\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase\r\n} from '../../actions/measurementPointResultsActions';\r\n\r\nimport { InstallBasesExpander } from './InstallBasesExpander';\r\nimport { RowInfo } from 'react-table';\r\nimport { addToCart } from '../../actions/shoppingCartActions';\r\nimport { connect } from 'react-redux';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n getWorkOrdersByFacility\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ntype Iprops = RowInfo;\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const { selectedFacilityID } = state;\r\n\r\n const facility = state.facilities[selectedFacilityID] || initialFacility;\r\n const showAddInstallation = getCanEditInstalls(state.user);\r\n const showEditProduct = getCanEditProducts(state.user);\r\n const showRequestQuote = getCanRequestQuote(state.user);\r\n const showMoveFacility = getCanCreateAsManager(state.user);\r\n\r\n return {\r\n facility,\r\n loading: selectIsLoading(state),\r\n showAddInstallation,\r\n showEditProduct,\r\n showRequestQuote,\r\n showMoveFacility\r\n };\r\n};\r\n\r\nexport const InstallBasesExpanderContainer = connect(mapStateToProps, {\r\n addToCart,\r\n toggleEditWorkOrderModal,\r\n toggleMPResultModal,\r\n toggleEditProductModal,\r\n toggleSearchNewProductsModal,\r\n setInstallBatchMode,\r\n setSelectedInstallBaseID,\r\n clearSelectedInstallBaseID,\r\n toggleEditInstallModal,\r\n setSelectedProductID,\r\n toggleInstallContactModal,\r\n getFacilityMeasurementPointResults,\r\n getMeasurementPointResultsHistoryByInstallBase,\r\n setSelectedWorkOrderID,\r\n getWorkOrdersByFacility\r\n})(InstallBasesExpander);\r\n","/*\r\n * InstallContactForm\r\n * Contact beacon about a specific install\r\n *\r\n */\r\n\r\nimport { Button, Col, ControlLabel, FormGroup } from 'react-bootstrap';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IinstallBase } from '../../models';\r\nimport {\r\n installContact,\r\n toggleInstallContactModal\r\n} from '../../actions/manageInventoryActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { TFunction } from 'i18next';\r\n\r\nconst TextLabel = ({ handler, meta }: any) => {\r\n return (\r\n \r\n \r\n {meta.label}\r\n
    {meta.defaultValue}
    \r\n
    \r\n \r\n );\r\n};\r\n\r\ninterface Iprops {\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n\r\n installContact: typeof installContact;\r\n selectedInstall: IinstallBase;\r\n selectedInstallBaseId: string;\r\n facilityId: string;\r\n productName: string;\r\n}\r\n\r\nclass InstallContactform extends React.Component {\r\n private userForm: FormGroup | any;\r\n public fieldConfig: FieldConfig;\r\n constructor(props: Iprops) {\r\n super(props);\r\n\r\n this.fieldConfig = FormUtil.translateForm(\r\n this.buildFieldConfig(),\r\n this.props.t\r\n );\r\n }\r\n\r\n buildFieldConfig = () => {\r\n const fieldConfigControls = {\r\n install: {\r\n render: TextLabel,\r\n meta: {\r\n label: 'productInfoLabel',\r\n colWidth: 12,\r\n defaultValue: this.props.productName,\r\n name: 'install'\r\n }\r\n },\r\n message: {\r\n render: FormUtil.TextInput,\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n meta: {\r\n label: 'contactMessageLabel',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 8,\r\n name: 'message'\r\n }\r\n }\r\n };\r\n return {\r\n controls: { ...fieldConfigControls }\r\n };\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.userForm.status === 'INVALID') {\r\n this.userForm.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n this.props.installContact(\r\n this.props.selectedInstallBaseId,\r\n this.props.facilityId,\r\n this.userForm.value.message\r\n );\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `beacon-form install-contact-form ${this.props.colorButton}`;\r\n return (\r\n
    \r\n \r\n\r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('contactButton')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default InstallContactform;\r\n","/*\r\n * Manage Install Modal - Container\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { Iproduct, IproductInfo, IinstallBase } from '../../models';\r\nimport {\r\n toggleInstallContactModal,\r\n installContact\r\n} from '../../actions/manageInventoryActions';\r\nimport CommonModal from '../common/CommonModal';\r\nimport InstallContactForm from './InstallContactForm';\r\nimport {\r\n initialInstallBase,\r\n initialProduct\r\n} from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n selectedInstall: IinstallBase;\r\n selectedProduct: Iproduct;\r\n showModal: boolean;\r\n loading: boolean;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n installContact: typeof installContact;\r\n productInfo: IproductInfo;\r\n selectedInstallBaseId: string;\r\n facilityId: string;\r\n}\r\n\r\nclass InstallContactModal extends React.PureComponent {\r\n render() {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: RouteComponentProps<{}> & WithTranslation\r\n) => {\r\n const {\r\n showInstallContactModal,\r\n productsByID,\r\n selectedProductID,\r\n selectedInstallBaseID,\r\n tableFilters,\r\n installBasesByID\r\n } = state.manageInventory;\r\n\r\n const selectedProduct = productsByID[selectedProductID] || initialProduct;\r\n const selectedInstall =\r\n installBasesByID[selectedInstallBaseID] || initialInstallBase;\r\n\r\n // If no facility is selected, use the first facility in the list\r\n // This can happen if the user logs in and hasn't changed from the facility they are assigned to\r\n const facilityID =\r\n state.manageFacility.selectedFacilityID !== ''\r\n ? state.manageFacility.selectedFacilityID\r\n : Object.values(state.user.facilities)[0]?.id;\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n facilityOptions: FormUtil.convertToOptions(state.user.facilities),\r\n showModal: showInstallContactModal,\r\n productInfo: state.productInfo,\r\n tableFilters,\r\n selectedProduct,\r\n selectedInstall,\r\n selectedInstallBaseId: selectedInstallBaseID,\r\n facilityId: facilityID\r\n };\r\n};\r\n\r\nexport default withTranslation('manageInventory')(\r\n withRouter(\r\n connect(mapStateToProps, {\r\n toggleInstallContactModal,\r\n installContact\r\n })(InstallContactModal)\r\n )\r\n);\r\n","/*\r\n * Measurement Point Result History\r\n */\r\n\r\nimport * as React from 'react';\r\nimport * as moment from 'moment';\r\n\r\nimport { Button, Col, ListGroup, ListGroupItem, Row } from 'react-bootstrap';\r\n\r\nimport { IinstallBaseHistory } from '../../models';\r\nimport { TFunction } from 'i18next';\r\nimport { measurementPointResultStatusTypesEnum } from '../../models-enums';\r\n\r\n/*\r\n * MeasurementPointListItem\r\n *\r\n */\r\nconst MeasurementPointListItem = ({\r\n result,\r\n setHistoricalResultID,\r\n toggleMPResultNotes,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal,\r\n t,\r\n getWorkOrderByID\r\n}: {\r\n result: IinstallBaseHistory;\r\n setHistoricalResultID: (id: string) => void;\r\n toggleMPResultNotes: () => void;\r\n setSelectedWorkOrderID: (id: string) => void;\r\n toggleEditWorkOrderModal: () => void;\r\n t: TFunction;\r\n getWorkOrderByID: (id: string) => any;\r\n}) => {\r\n return (\r\n {\r\n // If there is not a work order, show the notes, else show the work order\r\n if (result.workOrderId === undefined) {\r\n setHistoricalResultID(result.id);\r\n toggleMPResultNotes();\r\n } else {\r\n setSelectedWorkOrderID(result.workOrderId);\r\n getWorkOrderByID(result.workOrderId).then(() => {\r\n toggleEditWorkOrderModal();\r\n });\r\n }\r\n }}\r\n >\r\n \r\n \r\n {moment\r\n .utc(result.date)\r\n .local(true)\r\n .format('DD-MMM-YY LT')}\r\n \r\n \r\n {result.jobType}\r\n \r\n \r\n {t(\r\n 'manageMeasurementPointLists:' +\r\n measurementPointResultStatusTypesEnum[result.status]\r\n )}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ninterface Iprops {\r\n isLoading: boolean;\r\n installBaseHistory: IinstallBaseHistory[];\r\n t: TFunction;\r\n locationString: string;\r\n colorButton: any;\r\n toggleModal: () => void;\r\n toggleMPResultNotes: () => void;\r\n toggleWorkOrderCloseModal: () => void;\r\n setHistoricalResultID: (id: string) => void;\r\n setSelectedWorkOrderID: (id: string) => void;\r\n toggleEditWorkOrderModal: () => void;\r\n getWorkOrderByID: (id: string) => any;\r\n}\r\nexport const MPResultHistory = (props: Iprops) => {\r\n const { t, installBaseHistory, isLoading } = props;\r\n if (installBaseHistory.length) {\r\n return (\r\n
    \r\n
    \r\n {props.locationString}\r\n
    \r\n \r\n {installBaseHistory.map(result => {\r\n return (\r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n {t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n } else {\r\n return (\r\n
    \r\n \r\n {isLoading ? (\r\n

    {t('common:loading')}

    \r\n ) : (\r\n

    {t('No history for this asset.')}

    \r\n )}\r\n \r\n \r\n \r\n {t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n};\r\n","/*\r\n * Measurement Point Results List History Modal\r\n */\r\n\r\nimport {\r\n toggleMPResultHistory,\r\n toggleMPResultNotes\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n toggleWorkOrderCloseModal,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal,\r\n getWorkOrderByID\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { connect } from 'react-redux';\r\nimport { MPResultHistory } from './MPResultHistory';\r\nimport { setHistoricalResultID } from '../../actions/measurementPointResultsActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectInstallBaseHistory } from '../../reducers/measurementPointResultsReducer';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n locationString: string;\r\n selectedInstallBaseID: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'mp-history-modal'\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const installBaseHistory = selectInstallBaseHistory(\r\n state.measurementPointResults\r\n );\r\n\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n isLoading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultHistoryModal,\r\n installBaseHistory,\r\n title: ownProps.t('MPresultHistoryModalTitle')\r\n };\r\n};\r\n\r\nexport const MPResultHistoryModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultHistory,\r\n toggleMPResultNotes,\r\n toggleWorkOrderCloseModal,\r\n setHistoricalResultID,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal,\r\n onHide: toggleMPResultHistory,\r\n getWorkOrderByID\r\n })(WithCommonModal(MPResultHistory))\r\n);\r\n","/*\r\n * Measurement Point Result List - list the answers from the most recent result\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport { ListGroup, ListGroupItem, Col, Button, Row } from 'react-bootstrap';\r\nimport {\r\n ImeasurementPointResult,\r\n ImeasurementPointAnswer,\r\n ImeasurementPoint\r\n} from '../../models';\r\nimport { getMeasurementPointList } from '../../actions/manageMeasurementPointListsActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialMeasurementPoint } from '../../reducers/initialState';\r\nimport { clearHistoricalResultID } from '../../actions/measurementPointResultsActions';\r\nimport moment from 'moment';\r\n\r\ninterface Props {\r\n selectedItem: ImeasurementPointResult;\r\n selectedMeasurementPointResultID: string;\r\n colorButton: string;\r\n t: TFunction;\r\n toggleModal: () => void;\r\n getMeasurementPointList: typeof getMeasurementPointList;\r\n measurementPointsByID: { [key: string]: ImeasurementPoint };\r\n locationString: string;\r\n clearHistoricalResultID: typeof clearHistoricalResultID;\r\n getMeasurementPointListResult: (\r\n id: string\r\n ) => Promise;\r\n loading: boolean;\r\n}\r\n\r\nconst AnswerListItem = (\r\n mpAnswer: ImeasurementPointAnswer,\r\n measurementPoint: ImeasurementPoint,\r\n t: TFunction\r\n) => {\r\n let AnswerElement = () =>
    no answer
    ;\r\n if (mpAnswer.numericValue !== undefined) {\r\n AnswerElement = () =>
    {mpAnswer.numericValue}
    ;\r\n }\r\n if (mpAnswer.pass !== undefined) {\r\n if (mpAnswer.pass === constants.measurementPointPassFailTypes.fail) {\r\n AnswerElement = () => (\r\n \r\n {t('fail')}\r\n
    \r\n );\r\n } else if (\r\n mpAnswer.pass === constants.measurementPointPassFailTypes.pass\r\n ) {\r\n AnswerElement = () => (\r\n \r\n {t('pass')}\r\n
    \r\n );\r\n } else {\r\n AnswerElement = () => (\r\n
    {t('N/A')}
    \r\n );\r\n }\r\n }\r\n if (mpAnswer.textValue !== undefined) {\r\n AnswerElement = () =>
    {mpAnswer.textValue}
    ;\r\n }\r\n if (mpAnswer.dateValue !== undefined) {\r\n AnswerElement = () => (\r\n
    \r\n {moment\r\n .utc(mpAnswer.dateValue)\r\n .local(true)\r\n .format('DD-MM-YY')}\r\n
    \r\n );\r\n }\r\n\r\n if (\r\n mpAnswer.measurementPointSelectOptionID !== undefined &&\r\n measurementPoint.selectOptions\r\n ) {\r\n const { selectOptions } = measurementPoint;\r\n const selectedOption = selectOptions.find(\r\n option => option.id === mpAnswer.measurementPointSelectOptionID\r\n ) || { label: '' };\r\n\r\n AnswerElement = () =>
    {selectedOption.label}
    ;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n {measurementPoint.label} {measurementPoint.guideText}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {mpAnswer.notes}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport class MPResultList extends React.Component {\r\n componentDidMount() {\r\n if (this.props.selectedItem.manualOverride === true) {\r\n return; // do not get mplist or the result\r\n }\r\n if (this.props.selectedItem.measurementPointAnswers.length === 0) {\r\n this.props\r\n .getMeasurementPointListResult(this.props.selectedItem.id)\r\n .then(result => {\r\n this.props.getMeasurementPointList(\r\n result.measurementPointListID\r\n );\r\n });\r\n } else {\r\n this.props.getMeasurementPointList(\r\n this.props.selectedItem.measurementPointListID\r\n );\r\n }\r\n }\r\n\r\n render() {\r\n const { t, selectedItem } = this.props;\r\n if (selectedItem.manualOverride === true) {\r\n return (\r\n
    \r\n

    \r\n {t(\r\n 'No measurement points. Device status was manually added.'\r\n )}\r\n

    \r\n \r\n \r\n {t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n if (this.props.loading) {\r\n return (\r\n
    \r\n

    {t('Loading...')}

    \r\n \r\n \r\n {t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n return (\r\n
    \r\n
    \r\n {this.props.locationString}\r\n
    \r\n \r\n {this.props.selectedItem.measurementPointAnswers.map(\r\n mpAnswer => {\r\n const measurementPoint =\r\n this.props.measurementPointsByID[\r\n mpAnswer.measurementPointID\r\n ] || initialMeasurementPoint;\r\n if (measurementPoint.id.length === 0) {\r\n // jfbloom22 removed this 5/2020 because it will be 0 on initial render.\r\n // a better solution is to use a selector to grab all the MPs for this list\r\n // and wait to render until we have some MPs, this requires two loops because\r\n // each MP is related to a MeasurementPointTab\r\n // console.error(\r\n // 'missing measurement point',\r\n // mpAnswer.measurementPointID\r\n // );\r\n return null;\r\n }\r\n return AnswerListItem(\r\n mpAnswer,\r\n measurementPoint,\r\n t\r\n );\r\n }\r\n )}\r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n this.props.clearHistoricalResultID();\r\n }}\r\n >\r\n {t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n","import { toastr } from 'react-redux-toastr';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport {\r\n ItableFiltersParams,\r\n ImeasurementPoint,\r\n ImeasurementPointList,\r\n ImeasurementPointListTab,\r\n ThunkResult\r\n} from '../models';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\n// import * as moment from 'moment';\r\nimport { map, omit, values } from 'lodash';\r\nimport { initialMeasurementPointList } from '../reducers/initialState';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { Dispatch } from 'redux';\r\nimport { TFunction } from 'i18next';\r\nimport { IinitialState } from '../reducers';\r\nimport { selectMeasurementPointListTabs } from '../reducers/manageMeasurementPointListsReducer';\r\n\r\nexport function getAllMeasurementPointLists(\r\n isCustomerView: boolean\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n type,\r\n mainCategory,\r\n standard\r\n } = getState().manageMeasurementPointLists.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page,\r\n mainCategoryID: mainCategory && mainCategory.value,\r\n type: type && type.value,\r\n standardID: standard && standard.value\r\n }\r\n };\r\n\r\n const url = API.GET.measurementPoint.getall;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LISTS_SUCCESS,\r\n measurementPointLists: data.data.result\r\n });\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LISTS_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LISTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get measurement point lists');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const setSelectedMeasurementPointList = (\r\n measurementPointList: ImeasurementPointList\r\n) => ({\r\n type: types.SELECT_MEASUREMENT_POINT_LIST,\r\n measurementPointList\r\n});\r\n\r\n/*\r\n * save (add) a new mpl\r\n */\r\nexport function addGlobalMeasurementPointList(\r\n mpl: ImeasurementPointList\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n // convert the measementPoints back to an array\r\n const measurementPointTabs = mpl.measurementPointTabs.map(tab => {\r\n // Let clean any potential bad data\r\n const cleanedMPs = map(values(tab.measurementPoints), mp => {\r\n // Sometimes, this value get's sent as a number, instead of a boolean\r\n if (mp.numericAllowDecimals !== undefined) {\r\n let temp: any = mp.numericAllowDecimals;\r\n if (temp === 0) {\r\n temp = false;\r\n } else if (temp === 1) {\r\n temp = true;\r\n }\r\n mp.numericAllowDecimals = temp;\r\n }\r\n return mp;\r\n });\r\n\r\n return { ...tab, measurementPoints: cleanedMPs };\r\n });\r\n const listForAPI = { ...mpl, measurementPointTabs };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: listForAPI,\r\n timeout: 120000 // manually set a longer timeout since we know this is a large request\r\n };\r\n\r\n const url = API.POST.measurementPoint.addglobalmpl;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch(endAjaxCall());\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_ADD,\r\n measurementPointList: mpl\r\n });\r\n dispatch({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LISTS\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Created new measurement point list.',\r\n constants.toastrSuccess\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_ADD_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'create measurement point list');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * update a tab\r\n */\r\nexport function updateMeasurementPointListTab(\r\n tab: ImeasurementPointListTab\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_TAB_UPDATE,\r\n tab\r\n });\r\n if (tab.isDeleted === true) {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB,\r\n selectedTabID: ''\r\n });\r\n }\r\n };\r\n}\r\n/*\r\n * update a mpl\r\n */\r\nexport function updateMeasurementPointList(\r\n mpl: ImeasurementPointList,\r\n persistToAPI: boolean,\r\n isCustomer: boolean\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_UPDATE,\r\n measurementPointList: mpl,\r\n persistToAPI\r\n });\r\n if (persistToAPI) {\r\n dispatch(beginAjaxCall());\r\n // convert the measementPoints back to an array\r\n const measurementPointTabs = mpl.measurementPointTabs.map(tab => {\r\n return {\r\n ...tab,\r\n measurementPoints: map(\r\n values(tab.measurementPoints),\r\n mp => {\r\n let cleanedMP = { ...mp };\r\n\r\n if (\r\n Object.keys(cleanedMP).findIndex(\r\n key => key === 'numericMinValue'\r\n ) !== -1\r\n ) {\r\n cleanedMP = {\r\n ...cleanedMP,\r\n numericMinValue:\r\n Number(cleanedMP?.numericMinValue) ??\r\n null\r\n };\r\n }\r\n\r\n if (\r\n Object.keys(cleanedMP).findIndex(\r\n key => key === 'numericMaxValue'\r\n ) !== -1\r\n ) {\r\n cleanedMP = {\r\n ...cleanedMP,\r\n numericMaxValue:\r\n Number(cleanedMP?.numericMaxValue) ??\r\n null\r\n };\r\n }\r\n\r\n if (\r\n Object.keys(cleanedMP).findIndex(\r\n key => key === 'numericAllowDecimals'\r\n ) !== -1\r\n ) {\r\n // Just silly, sometimes, this boolean is a number, instead of \"true/false\"\r\n let answer: any =\r\n cleanedMP?.numericAllowDecimals;\r\n if (answer === 1) {\r\n answer = true;\r\n } else if (answer === 0) {\r\n answer = false;\r\n }\r\n cleanedMP = {\r\n ...cleanedMP,\r\n numericAllowDecimals: answer\r\n };\r\n }\r\n\r\n return { ...cleanedMP };\r\n }\r\n )\r\n };\r\n });\r\n const listForAPI = { ...mpl, measurementPointTabs };\r\n\r\n // Set the correct URL dependent on if this is a customer or not\r\n let url = `${API.PUT.measurementPoint.updateglobalmpl}/${mpl.id}`;\r\n if (isCustomer) {\r\n url = `${API.PUT.measurementPoint.updatecustomermpl}/${mpl.id}`;\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: listForAPI,\r\n timeout: 120000 // manually set a longer timeout since we know this is a large request\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch(endAjaxCall());\r\n dispatch({\r\n type:\r\n types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LISTS\r\n });\r\n dispatch({\r\n type: types.SELECT_MEASUREMENT_POINT_LIST,\r\n measurementPointList: initialMeasurementPointList\r\n });\r\n dispatch({\r\n type:\r\n types.MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB,\r\n selectedTabID: ''\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Updated measurement point list.',\r\n constants.toastrSuccess\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(\r\n error,\r\n 'update measurement point list'\r\n );\r\n throw error; // intentionally rethrow\r\n });\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n };\r\n}\r\n\r\nexport const saveMeasurementPointToMeasurementPointListHelper = (\r\n listID: string,\r\n selectedTabID: string,\r\n measurementPoint: ImeasurementPoint,\r\n dispatch: Dispatch,\r\n getState: () => IinitialState\r\n) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_SAVE_TO_LIST,\r\n listID,\r\n selectedTabID,\r\n measurementPoint\r\n });\r\n};\r\n\r\nexport function deleteMeasurementPoint(\r\n measurementPointID: string,\r\n measurementPointListID: string,\r\n selectedTabID: string,\r\n t: TFunction\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n const measurementPointListsByID = getState().manageMeasurementPointLists\r\n .measurementPointListsByID;\r\n const selectedMeasurementPointList =\r\n measurementPointListsByID[measurementPointListID];\r\n\r\n // If we didn't find a list, that means the list is being created right now and hasn't been saved yet\r\n // we need to remove the measurement point from redux beacuse it hasn't been sent to the api yet\r\n if (!selectedMeasurementPointList) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n const measurementPointList = getState()\r\n .manageMeasurementPointLists\r\n .selectedMeasurementPointList;\r\n\r\n dispatch({\r\n type: types.REMOVE_MEASUREMENT_POINT_FROM_TAB,\r\n measurementPointList,\r\n selectedTabID,\r\n measurementPointID\r\n });\r\n\r\n dispatch({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT\r\n });\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: t('deleteMeasurementPointOk'),\r\n cancelText: t('common:cancel')\r\n };\r\n toastr.confirm(t('deleteConfirmMP'), toastrConfirmOptions);\r\n } else {\r\n const selectedTab = selectedMeasurementPointList.measurementPointTabs.find(\r\n tab => tab.id === selectedTabID\r\n );\r\n if (!selectedTab) {\r\n throw new Error('missing selected measurement point tab');\r\n }\r\n const selectedMeasurementPoint =\r\n selectedTab.measurementPoints[measurementPointID];\r\n\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n saveMeasurementPointToMeasurementPointListHelper(\r\n measurementPointListID,\r\n selectedTabID,\r\n { ...selectedMeasurementPoint, isDeleted: true },\r\n dispatch,\r\n getState\r\n );\r\n dispatch({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT\r\n });\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: t('deleteMeasurementPointOk'),\r\n cancelText: t('common:cancel')\r\n };\r\n toastr.confirm(t('deleteConfirmMP'), toastrConfirmOptions);\r\n }\r\n };\r\n}\r\n\r\nexport function deleteGlobalMeasurementPointList(\r\n MPlistID: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = `${API.DELETE.measurementPoint.deleteglobalmpl}/${MPlistID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_DELETE_SUCCESS,\r\n MPlistID\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Deleted measurement point list.',\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MANAGE_MEASUREMENT_POINT_LIST_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete measurement point list');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * update the selected Measurement Point\r\n */\r\nexport const updateMeasurementPoint = (\r\n measurementPoint: ImeasurementPoint,\r\n selectedTabID: string\r\n) => ({\r\n type: types.MANAGE_MEASUREMENT_POINT_UPDATE,\r\n measurementPoint,\r\n selectedTabID\r\n});\r\n\r\nexport const saveMeasurementPointToMeasurementPointList = (\r\n listID: string,\r\n selectedTabID: string,\r\n measurementPoint: ImeasurementPoint\r\n) => ({\r\n type: types.MANAGE_MEASUREMENT_POINT_SAVE_TO_LIST,\r\n listID,\r\n selectedTabID,\r\n measurementPoint\r\n});\r\n\r\n/*\r\n * Get a specific measurement point list\r\n * TODO verify we are receiving deleted MPs here\r\n */\r\nexport function getMeasurementPointList(MPlistID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.measurementPoint.getMeasurementPointList}/${MPlistID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.MEASUREMENT_POINT_LIST_SUCCESS,\r\n list: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MEASUREMENT_POINT_LIST_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get a measurement point list');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const toggleEditMeasurementPointListModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LISTS\r\n});\r\nexport const toggleEditMeasurementPointModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT\r\n});\r\nexport const toggleEditMeasurementPointTabModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_TAB\r\n});\r\nexport const toggleEditMeasurementPointListTestProceduresModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_MEASUREMENT_POINT_LIST_TEST_PROCEDURES\r\n});\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_MEASUREMENT_POINT_LISTS,\r\n filters\r\n});\r\nexport const setSelectedTabID = (selectedTabID: string) => ({\r\n type: types.MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB,\r\n selectedTabID\r\n});\r\n","/*\r\n * Measurement Point Result Modal - list the answers for the most recent result\r\n */\r\n\r\nimport { toggleMPResultModal } from '../../actions/manageInventoryActions';\r\nimport { connect } from 'react-redux';\r\nimport { MPResultList } from './MPResultList';\r\nimport { getMeasurementPointList } from '../../actions/manageMeasurementPointListsActions';\r\nimport {\r\n clearHistoricalResultID,\r\n getMeasurementPointListResult\r\n} from '../../actions/measurementPointResultsActions';\r\nimport { initialMeasurmentPointResult } from '../../reducers/initialState';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n locationString: string;\r\n selectedMeasurementPointResultID: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'result-list'\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedMeasurementPointResult =\r\n state.measurementPointResults.measurementPointResultsByID[\r\n ownProps.selectedMeasurementPointResultID\r\n ];\r\n const selectedItem = selectedMeasurementPointResult || {\r\n ...initialMeasurmentPointResult,\r\n id: ownProps.selectedMeasurementPointResultID\r\n };\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultModal,\r\n measurementPointsByID:\r\n state.manageMeasurementPointLists.measurementPointsByID,\r\n selectedItem,\r\n title: ownProps.t('MeasurementPointResultModalTitle')\r\n };\r\n};\r\n\r\nexport const MPResultListModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultModal,\r\n getMeasurementPointList,\r\n clearHistoricalResultID,\r\n getMeasurementPointListResult,\r\n onHide: toggleMPResultModal\r\n })(WithCommonModal(MPResultList))\r\n);\r\n","/*\r\n * Rich Text View\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport { Col, Button } from 'react-bootstrap';\r\n\r\ninterface Iprops {\r\n HTMLcontent: string;\r\n toggleModal: () => void;\r\n t: TFunction;\r\n colorButton: string;\r\n}\r\n\r\nexport const RichTextView = ({\r\n HTMLcontent,\r\n toggleModal,\r\n t,\r\n colorButton\r\n}: Iprops) => (\r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n);\r\n","/*\r\n * Measurement Point Result Notes Modal\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport {\r\n toggleMPResultModal,\r\n toggleMPResultNotes\r\n} from '../../actions/manageInventoryActions';\r\nimport { connect } from 'react-redux';\r\nimport { IinstallBaseHistory } from '../../models';\r\nimport { RichTextView } from '../common/RichTextView';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n}\r\ninterface IdispatchProps {\r\n toggleModal: typeof toggleMPResultModal;\r\n selectedItem: IinstallBaseHistory;\r\n}\r\nconst defaultProps = {\r\n className: 'notes-modal'\r\n};\r\n\r\nconst MPResultListNotesModalClass = (\r\n props: Iprops & IdispatchProps & WithTranslation\r\n) => {\r\n if (props.selectedItem.notes && props.selectedItem.notes.length !== 0) {\r\n return (\r\n \r\n );\r\n } else if (!props.selectedItem.notes) {\r\n return (\r\n
    \r\n {props.selectedItem.notes}\r\n \r\n \r\n {props.t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n return {\r\n ...defaultProps,\r\n title: ownProps.t('MPResultNotesModalTitle'),\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultNotesModal,\r\n selectedItem: state.measurementPointResults.installBaseHistory.find(\r\n x => x.id === state.measurementPointResults.historicalResultID\r\n )!\r\n };\r\n};\r\n\r\nexport const MPResultListNotesModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultNotes,\r\n onHide: toggleMPResultNotes\r\n })(WithCommonModal(MPResultListNotesModalClass))\r\n);\r\n","import * as React from 'react';\r\nimport * as types from '../../../actions/actionTypes';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator\r\n} from 'react-reactive-form';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { FormGroup } from 'react-bootstrap';\r\nimport { debounce, forEach } from 'lodash';\r\nimport { Ifacility, Iuser } from '../../../models';\r\nimport { searchFacilitiesForAsyncSelect } from '../../../actions/commonActions';\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { constants } from '../../../constants/constants';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { initialFacility } from '../../../reducers/initialState';\r\nimport {\r\n getFacilities,\r\n getSelectedFacilityID\r\n} from '../../../reducers/facilitiesReducer';\r\n\r\ninterface Iprops {\r\n loading: boolean;\r\n user: Iuser;\r\n classNameOverride: string;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n facilitySelected: (facilityID: string) => void;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nconst SearchFacilityForm: React.FC = props => {\r\n const dispatch = useDispatch();\r\n const allFacilities = useSelector(getFacilities);\r\n const selectedFacilityID = useSelector(getSelectedFacilityID);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [selectedFacility, setSelectedFacility] = React.useState(\r\n selectedFacilityID ? allFacilities[selectedFacilityID] : initialFacility\r\n );\r\n\r\n React.useEffect(() => {\r\n if (selectedFacilityID !== '') {\r\n const facility = allFacilities[selectedFacilityID];\r\n setSelectedFacility(facility);\r\n props.facilitySelected(facility.id);\r\n }\r\n }, [selectedFacilityID]);\r\n\r\n const saveFacilities = (facilities: Ifacility[]) => {\r\n dispatch({\r\n type: types.GET_FACILITIES_SUCCESS,\r\n facilities\r\n });\r\n };\r\n\r\n const loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n null,\r\n null,\r\n callback,\r\n saveFacilities\r\n );\r\n return;\r\n }\r\n\r\n callback();\r\n }, 200);\r\n\r\n const buildFieldConfig = () => {\r\n let nameWithAddress = `${selectedFacility.name} | ${\r\n selectedFacility.address\r\n }${selectedFacility.address2 ? ' ' + selectedFacility.address2 : ''} ${\r\n selectedFacility.city\r\n } ${selectedFacility.state} ${selectedFacility.postalCode}`;\r\n const facilityOption = {\r\n value: selectedFacility.id,\r\n label: nameWithAddress\r\n };\r\n let facilityClass = 'banner-input';\r\n\r\n if (props.classNameOverride !== '') {\r\n facilityClass = props.classNameOverride;\r\n }\r\n\r\n const facility = {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'Facility',\r\n loadOptions,\r\n colWidth: 4,\r\n colWidthMedium: 4,\r\n colWidthLarge: 4,\r\n type: 'select',\r\n placeholder: 'facilityPlaceholder',\r\n className: facilityClass\r\n },\r\n formState: {\r\n value: facilityOption,\r\n disabled: false\r\n }\r\n };\r\n\r\n return {\r\n controls: { facility }\r\n };\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [state, setState] = React.useState({\r\n fieldConfig: buildFieldConfig()\r\n });\r\n\r\n let formGroup: FormGroup | any;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n let subscription: any;\r\n let setFacilitySearchTimeout: any;\r\n\r\n const handleSetFacility = (value: any) => {\r\n // causes performance issues so we use a rudamentary debounce\r\n if (value && value.value) {\r\n clearTimeout(setFacilitySearchTimeout);\r\n\r\n setFacilitySearchTimeout = setTimeout(() => {\r\n props.facilitySelected(value.value);\r\n }, constants.tableSearchDebounceTime);\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n const onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'facility':\r\n handleSetFacility(value);\r\n break;\r\n default:\r\n console.error('unknown value change detected.');\r\n }\r\n };\r\n\r\n const handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n };\r\n\r\n const subscribeToValueChanges = () => {\r\n forEach(buildFieldConfig().controls, (input: any, key) => {\r\n subscription = formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n onValueChanges(value, key);\r\n });\r\n });\r\n };\r\n\r\n const setForm = (form: AbstractControl) => {\r\n formGroup = form;\r\n formGroup.meta = {\r\n loading: props.loading\r\n };\r\n subscribeToValueChanges();\r\n };\r\n\r\n const formClassName = `beacon-form`;\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n
    \r\n );\r\n};\r\nexport default withTranslation('manageInventory')(SearchFacilityForm);\r\n","/*\r\n * Facility Form Container\r\n */\r\nimport { searchFacilitiesForAsyncSelect } from '../../../actions/commonActions';\r\nimport SearchFacilityForm from './SearchFacilityForm';\r\nimport { connect } from 'react-redux';\r\nimport { TFunction } from 'i18next';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\n\r\ninterface Iprops {\r\n classNameOverride?: string;\r\n t: TFunction;\r\n facilitySelected: (facilityID: string) => void;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n loading: selectIsLoading(state),\r\n user: state.user\r\n };\r\n};\r\n\r\nexport const SelectFacilityContainer = connect(mapStateToProps, {\r\n searchFacilitiesForAsyncSelect\r\n})(SearchFacilityForm);\r\n","import * as React from 'react';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport CommonModal from '../common/CommonModal';\r\nimport {\r\n getFacilities,\r\n getSelectedFacilityID\r\n} from '../../reducers/facilitiesReducer';\r\nimport { constants } from '../../constants/constants';\r\n\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { SelectFacilityContainer } from './SearchFacility/SearchFacilityContainer';\r\nimport { initialFacility } from '../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n showModal: boolean;\r\n hideModal: () => void;\r\n colorButton: string;\r\n moveFacility: (primary: string) => void;\r\n}\r\n\r\nconst SearchNewFacilityModal: React.FC = props => {\r\n const { t } = props;\r\n const allFacilities = useSelector(getFacilities);\r\n const selectedFacilityID = useSelector(getSelectedFacilityID);\r\n const [selectedFacility, setSelectedFacility] = React.useState(\r\n initialFacility\r\n );\r\n\r\n const merge = () => {\r\n if (selectedFacility.id === selectedFacilityID) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Select a different Facility'),\r\n constants.toastrWarning\r\n );\r\n } else if (\r\n selectedFacility === undefined ||\r\n selectedFacility.id === ''\r\n ) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Select the primary facility'),\r\n constants.toastrWarning\r\n );\r\n } else if (selectedFacilityID === selectedFacility.id) {\r\n toastr.warning(\r\n t('warning'),\r\n t('You must select a new facility'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n props.moveFacility(selectedFacility.id);\r\n },\r\n onCancel: () => console.info('CANCEL clicked'),\r\n okText: t('Ok'),\r\n cancelText: t('Cancel')\r\n };\r\n toastr.confirm(\r\n `Are you sure you want to move these install bases to ${selectedFacility.name}?`,\r\n toastrConfirmOptions\r\n );\r\n }\r\n };\r\n\r\n const facilitySelected = (facilityID: string) => {\r\n console.info('facilitySelected', facilityID, allFacilities[facilityID]);\r\n setSelectedFacility(allFacilities[facilityID]);\r\n };\r\n\r\n return (\r\n <>\r\n props.hideModal}\r\n title={t('changeFacility')}\r\n container={document.getElementById('two-pane-layout')}\r\n >\r\n
    \r\n

    \r\n Selecting a new facility here will merge all of the\r\n installs from the original facility into the selected\r\n facility.\r\n

    \r\n \r\n\r\n \r\n \r\n {t('close')}\r\n \r\n \r\n \r\n
    \r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('manageInventory')(SearchNewFacilityModal);\r\n","/*\r\n * Manage Inventory Form\r\n * Edit inventory items\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Button, Col, ListGroup, Row, Well } from 'react-bootstrap';\r\nimport {\r\n Ioption,\r\n Iproduct,\r\n IproductInfo,\r\n IproductQueueObject,\r\n IsearchNewProductInstallBatchMode,\r\n Iuser\r\n} from '../../models';\r\nimport { debounce, filter, isEmpty, map } from 'lodash';\r\nimport {\r\n getProducts,\r\n resetNewProducts,\r\n setInstallBatchMode,\r\n setProductSearchFormValues,\r\n toggleEditProductModal,\r\n updateProductSearchFormValues\r\n} from '../../actions/manageInventoryActions';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IsearchProductFormValues, ProductAttributes } from '../../modelsForms';\r\nimport { TFunction } from 'i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { getMergeableProducts } from '../../actions/manageProductQueueActions';\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n toggleEditProductModal: typeof toggleEditProductModal;\r\n selectedItem: Iproduct;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n productInfo: IproductInfo;\r\n formValues: Partial;\r\n getProducts: typeof getProducts;\r\n getMergeableProducts: typeof getMergeableProducts;\r\n newProducts: (Iproduct | IproductQueueObject)[];\r\n resetNewProducts: typeof resetNewProducts;\r\n handleProductSelect?: (\r\n product: Iproduct,\r\n installBatchMode: IsearchNewProductInstallBatchMode\r\n ) => void;\r\n handleMergeProduct: (product: Iproduct) => void;\r\n isApproved?: boolean;\r\n setProductSearchFormValues: typeof setProductSearchFormValues;\r\n updateProductSearchFormValues: typeof updateProductSearchFormValues;\r\n enableMergeProductMode: boolean;\r\n disableCreateNew: boolean;\r\n user: Iuser;\r\n isProductQueue?: boolean;\r\n installBatchMode: IsearchNewProductInstallBatchMode;\r\n setInstallBatchMode: typeof setInstallBatchMode;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass SearchNewProductsForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateFormValuesDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n private handleSubmitDebounced: () => void;\r\n\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.updateFormValuesDebounced = debounce(\r\n this.props.updateProductSearchFormValues,\r\n constants.formDebounceTime\r\n );\r\n this.handleSubmitDebounced = debounce(\r\n this.handleSubmit,\r\n constants.tableSearchDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.enableMergeProductMode) {\r\n const selectedFormValues: Partial = this.buildFormValuesFromSelected();\r\n const productAttributes = this.getProductAttributes(\r\n selectedFormValues\r\n );\r\n\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(selectedFormValues)\r\n });\r\n this.props.setProductSearchFormValues(selectedFormValues);\r\n\r\n const selectedProductStandard = this.props.productInfo.standardOptions\r\n .filter((value: Ioption) => {\r\n return this.props.user.userStandards.includes(value.value);\r\n })\r\n .map((value: Ioption) => value.value);\r\n\r\n if (this.props.isProductQueue)\r\n this.props.getMergeableProducts({\r\n page: 1,\r\n search: this.formGroup.value.search || '',\r\n mainCategoryID: productAttributes.mainCategoryID || '',\r\n subCategoryID: productAttributes.subcategoryID || '',\r\n brandID: productAttributes.brandID || '',\r\n origin: productAttributes.origin || '',\r\n isFinalProduct: this.formGroup.value.isFinalProduct,\r\n standards: selectedProductStandard || []\r\n });\r\n else\r\n this.props.getProducts(\r\n 1,\r\n '',\r\n true,\r\n productAttributes,\r\n selectedProductStandard,\r\n this.props.isApproved\r\n );\r\n } else {\r\n this.props.resetNewProducts();\r\n this.props.setProductSearchFormValues({});\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.setProductSearchFormValues({ isFinalProduct: true });\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.setInstallBatchMode({\r\n installBaseIDs: [],\r\n isBatchMode: false\r\n });\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n this.props.formValues.mainCategoryID !==\r\n prevProps.formValues.mainCategoryID\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n buildFormValuesFromSelected = (): Partial => {\r\n if (this.props.selectedItem.id.length) {\r\n const { selectedItem, productInfo } = this.props;\r\n\r\n const { subcategoryID } = selectedItem;\r\n const subcategory = productInfo.subcategories[subcategoryID];\r\n const mainCategory =\r\n productInfo.mainCategories[subcategory.mainCategoryID];\r\n const subcategoryOption =\r\n FormUtil.convertToSingleOption(subcategory) || undefined;\r\n const mainCategoryOption =\r\n FormUtil.convertToSingleOption(mainCategory) || undefined;\r\n return {\r\n subcategoryID: subcategoryOption,\r\n mainCategoryID: mainCategoryOption,\r\n search: ''\r\n };\r\n } else {\r\n return {\r\n subcategoryID: undefined,\r\n mainCategoryID: undefined,\r\n search: undefined,\r\n isFinalProduct: true\r\n };\r\n }\r\n };\r\n buildFieldConfig = (\r\n defaultFormValues: Partial = this.props\r\n .formValues\r\n ) => {\r\n const disabled = false;\r\n const { selectedItem } = this.props;\r\n const {\r\n subcategories,\r\n mainCategoryOptions,\r\n brandOptions,\r\n brands,\r\n standardOptions\r\n } = this.props.productInfo;\r\n const {\r\n search,\r\n brandID,\r\n isFinalProduct,\r\n standardID\r\n } = defaultFormValues;\r\n\r\n let filteredSubCategoryOptions: Ioption[] = [];\r\n let selectedSubCategory = null;\r\n let selectedBrand = null;\r\n let selectedProductStandard = null;\r\n let subcategoryID: string | undefined = undefined;\r\n let mainCategoryID: string | undefined = undefined;\r\n\r\n // If selectedItem is set, that means we are updating an existing InstallBase's product, main category will be locked.\r\n if (selectedItem.id.length > 0) {\r\n subcategoryID = selectedItem.subcategoryID;\r\n mainCategoryID = subcategories[subcategoryID]?.mainCategoryID;\r\n } else {\r\n subcategoryID = defaultFormValues?.subcategoryID?.value;\r\n mainCategoryID = defaultFormValues?.mainCategoryID?.value;\r\n }\r\n\r\n if (mainCategoryID) {\r\n filteredSubCategoryOptions = FormUtil.convertToOptions(\r\n filter(\r\n subcategories,\r\n sub => sub.mainCategoryID === mainCategoryID\r\n )\r\n );\r\n if (subcategoryID) {\r\n const subcategory = subcategories[subcategoryID];\r\n if (subcategory.mainCategoryID === mainCategoryID) {\r\n selectedSubCategory = subcategoryID;\r\n }\r\n }\r\n } else if (this.props.formValues.mainCategoryID) {\r\n mainCategoryID = this.props.formValues.mainCategoryID.value;\r\n }\r\n\r\n if (brandID) {\r\n const brand = brands[brandID.value];\r\n selectedBrand = FormUtil.convertToSingleOption(brand);\r\n }\r\n if (standardID) {\r\n const ProductStandard = standardOptions.filter(\r\n Obj => Obj.value === standardID.value\r\n );\r\n selectedProductStandard = FormUtil.convertToSingleOption(\r\n ProductStandard\r\n );\r\n } else {\r\n selectedProductStandard = standardOptions.filter(\r\n (value: Ioption) => {\r\n return this.props.user.userStandards.includes(value.value);\r\n }\r\n );\r\n }\r\n\r\n const selectedMainCategoryOption = mainCategoryOptions.find(\r\n category => category.value === mainCategoryID\r\n );\r\n\r\n const fieldConfigControls = {\r\n mainCategoryID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: mainCategoryOptions,\r\n label: 'common:mainCategory',\r\n colWidth: 6,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'product-group'\r\n },\r\n formState: {\r\n value: selectedMainCategoryOption || undefined,\r\n disabled:\r\n this.props.enableMergeProductMode ||\r\n this.props.installBatchMode?.isBatchMode\r\n }\r\n },\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'search',\r\n colWidth: 6,\r\n type: 'input',\r\n placeholder: 'searchByName',\r\n name: 'product-search'\r\n },\r\n formState: { value: search, disabled }\r\n },\r\n subcategoryID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: filteredSubCategoryOptions,\r\n label: 'common:subCategory',\r\n colWidth: 6,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'subcategory',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedSubCategory,\r\n disabled: false\r\n }\r\n },\r\n brandID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: brandOptions,\r\n label: 'common:manufacturer',\r\n colWidth: 6,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'manufacturer',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedBrand,\r\n disabled: false\r\n }\r\n },\r\n standardID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: standardOptions,\r\n label: 'productForm.standards',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: true,\r\n name: 'productStandard',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedProductStandard,\r\n disabled\r\n }\r\n },\r\n isFinalProduct: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'productForm.EndProduct',\r\n colWidth: 6,\r\n style: { marginTop: '8px' }\r\n },\r\n formState: { value: isFinalProduct || true, disabled }\r\n }\r\n };\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'mainCategoryID':\r\n this.updateFormValuesDebounced({\r\n [key]: value,\r\n subcategoryID: null\r\n });\r\n this.handleSubmitDebounced();\r\n break;\r\n default:\r\n this.updateFormValuesDebounced({ [key]: value });\r\n this.handleSubmitDebounced();\r\n break;\r\n }\r\n };\r\n handleSubmit = () => {\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const productAttributes = this.getProductAttributes(\r\n this.formGroup.value\r\n );\r\n\r\n const standardID = this.formGroup.value.standardID;\r\n let selectedStandards = [];\r\n if (standardID && standardID.length > 0) {\r\n selectedStandards = standardID.map(\r\n (standard: Ioption) => standard.value\r\n );\r\n }\r\n\r\n if (this.props.isProductQueue)\r\n this.props.getMergeableProducts({\r\n page: 1,\r\n search: this.formGroup.value.search || '',\r\n mainCategoryID: productAttributes.mainCategoryID || '',\r\n subCategoryID: productAttributes.subcategoryID || '',\r\n brandID: productAttributes.brandID || '',\r\n origin: productAttributes.origin || '',\r\n isFinalProduct: this.formGroup.value.isFinalProduct,\r\n standards: selectedStandards || []\r\n });\r\n else\r\n this.props.getProducts(\r\n 1,\r\n this.formGroup.value.search,\r\n this.formGroup.value.isFinalProduct,\r\n productAttributes,\r\n selectedStandards,\r\n this.props.isApproved\r\n );\r\n };\r\n\r\n getValue = (object?: Ioption | string): string => {\r\n return typeof object === 'string' ? object : object?.value ?? '';\r\n };\r\n\r\n getProductAttributes = (\r\n selectedFormValues: Partial\r\n ): ProductAttributes => {\r\n const keys: (keyof ProductAttributes)[] = [\r\n 'mainCategoryID',\r\n 'subcategoryID',\r\n 'brandID',\r\n 'origin',\r\n 'powerID',\r\n 'productTypeID',\r\n 'systemSizeID'\r\n ];\r\n\r\n return keys.reduce((attributes: ProductAttributes, key) => {\r\n attributes[key as keyof ProductAttributes] = this.getValue(\r\n selectedFormValues[key]\r\n );\r\n return attributes;\r\n }, {} as ProductAttributes);\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const {\r\n t,\r\n colorButton,\r\n loading,\r\n newProducts,\r\n selectedItem,\r\n enableMergeProductMode,\r\n disableCreateNew,\r\n handleProductSelect,\r\n handleMergeProduct,\r\n toggleModal\r\n } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form search-products-form ${colorButton}`;\r\n\r\n let searchActive = false;\r\n if (\r\n !loading &&\r\n this.formGroup &&\r\n this.formGroup.value &&\r\n (this.formGroup.value.search || this.formGroup.value.mainCategoryID)\r\n ) {\r\n searchActive = true;\r\n }\r\n\r\n const ProductListItem = ({\r\n product,\r\n sItem\r\n }: {\r\n product: Iproduct;\r\n sItem?: Iproduct;\r\n }) => {\r\n const className =\r\n sItem && sItem.id === product.id\r\n ? 'list-group-item new-product-item selected'\r\n : 'list-group-item new-product-item';\r\n return (\r\n {\r\n if (\r\n enableMergeProductMode === false &&\r\n handleProductSelect\r\n ) {\r\n handleProductSelect(\r\n product,\r\n this.props.installBatchMode\r\n );\r\n } else {\r\n handleMergeProduct(product);\r\n }\r\n }}\r\n >\r\n

    {product.name}

    \r\n \r\n );\r\n };\r\n\r\n return (\r\n
    \r\n \r\n {t('searchNewProductInstructions')}\r\n

    \r\n\r\n ) => {\r\n e.preventDefault();\r\n this.handleSubmit();\r\n }}\r\n className={formClassName}\r\n style={{ display: 'block' }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {map(newProducts, (product, index) => (\r\n \r\n ))}\r\n \r\n {isEmpty(newProducts) && searchActive && (\r\n \r\n \r\n {t('noProductsFound')}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {!disableCreateNew && enableMergeProductMode === false && (\r\n {\r\n this.props.toggleEditProductModal();\r\n }}\r\n >\r\n {t('addNewProductButton')}\r\n \r\n )}\r\n\r\n
    \r\n );\r\n }\r\n}\r\nexport default SearchNewProductsForm;\r\n","/*\r\n * Search New Products Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { values } from 'lodash';\r\nimport {\r\n Iproduct,\r\n IproductQueueObject,\r\n IsearchNewProductInstallBatchMode\r\n} from '../../models';\r\nimport {\r\n saveProduct,\r\n toggleEditProductModal,\r\n toggleSearchNewProductsModal,\r\n getProducts,\r\n resetNewProducts,\r\n updateProductSearchFormValues,\r\n setProductSearchFormValues,\r\n setInstallBatchMode\r\n} from '../../actions/manageInventoryActions';\r\nimport SearchNewProductsForm from './SearchNewProductsForm';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getMergeableProducts } from '../../actions/manageProductQueueActions';\r\n\r\ninterface Iprops {\r\n selectedItem: Iproduct;\r\n selectedQueueObject?: IproductQueueObject;\r\n colorButton: string;\r\n handleProductSelect?: (\r\n product: Iproduct,\r\n installBatchMode: IsearchNewProductInstallBatchMode\r\n ) => void;\r\n handleMergeProduct: (product: Iproduct) => void;\r\n isApproved?: boolean;\r\n secondModal?: boolean;\r\n enableMergeProductMode: boolean;\r\n wideModal: boolean;\r\n disableCreateNew: boolean;\r\n isProductQueue?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const installBatchMode: IsearchNewProductInstallBatchMode =\r\n state.manageInventory.searchNewProductInstallBatchMode;\r\n const newProducts = values(\r\n ownProps.isProductQueue\r\n ? state.manageProductQueue.mergeableProductsByID\r\n : state.manageInventory.newProducts\r\n ).filter(prod =>\r\n 'name' in prod\r\n ? prod.id !== ownProps.selectedItem.id\r\n : prod.product.id !== ownProps.selectedItem.id\r\n );\r\n\r\n let title = ownProps.t('searchNewProductModalTitle');\r\n\r\n // Search and Replace\r\n if (ownProps.enableMergeProductMode) {\r\n title = ownProps.t('replaceProductModalTitle');\r\n }\r\n\r\n // Bulk change\r\n if (installBatchMode && installBatchMode.installBaseIDs.length > 0) {\r\n title = ownProps.t('searchNewProductModalTitleBulkChange', {\r\n count: installBatchMode.installBaseIDs.length\r\n });\r\n }\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showSearchNewProductsModal,\r\n productInfo: state.productInfo,\r\n formValues: state.manageInventory.productSearchFormValues,\r\n newProducts: newProducts || [],\r\n className: 'search-products',\r\n title,\r\n secondModal: ownProps.secondModal,\r\n wideModal: ownProps.wideModal,\r\n disableCreateNew: ownProps.disableCreateNew,\r\n isProductQueue: ownProps.isProductQueue,\r\n installBatchMode\r\n };\r\n};\r\n\r\nexport default withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n saveProduct,\r\n toggleEditProductModal,\r\n getProducts,\r\n getMergeableProducts,\r\n toggleModal: toggleSearchNewProductsModal,\r\n onHide: toggleSearchNewProductsModal,\r\n resetNewProducts,\r\n updateProductSearchFormValues,\r\n setProductSearchFormValues,\r\n setInstallBatchMode\r\n })(WithCommonModal(SearchNewProductsForm))\r\n);\r\n","/*\r\n * Common Modal displays the modal\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { IPropsCommonModal } from '../CommonModal';\r\nimport CommonMobileModal from './CommonMobileModal';\r\n\r\nexport const WithCommonMobileModal =

    (\r\n WrappedComponent: React.ComponentType

    \r\n) => {\r\n const commonModalWrap: React.FC

    = props => (\r\n \r\n \r\n \r\n );\r\n\r\n return commonModalWrap;\r\n};\r\n","/*\r\n * Measurement Point Results List History Modal\r\n */\r\n\r\nimport {\r\n toggleMPResultHistory,\r\n toggleMPResultNotes\r\n} from '../../../actions/manageInventoryActions';\r\nimport {\r\n toggleWorkOrderCloseModal,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal,\r\n getWorkOrderByID\r\n} from '../../../actions/manageWorkOrderActions';\r\nimport { connect } from 'react-redux';\r\nimport { MPResultHistory } from '../MPResultHistory';\r\nimport { setHistoricalResultID } from '../../../actions/measurementPointResultsActions';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { selectInstallBaseHistory } from '../../../reducers/measurementPointResultsReducer';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n locationString: string;\r\n selectedInstallBaseID: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'mp-history-modal'\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const installBaseHistory = selectInstallBaseHistory(\r\n state.measurementPointResults\r\n );\r\n\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n isLoading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultHistoryModal,\r\n installBaseHistory,\r\n title: ownProps.t('MPresultHistoryModalTitle')\r\n };\r\n};\r\n\r\nexport const MPResultHistoryMobileModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultHistory,\r\n toggleMPResultNotes,\r\n toggleWorkOrderCloseModal,\r\n setHistoricalResultID,\r\n setSelectedWorkOrderID,\r\n toggleEditWorkOrderModal,\r\n onHide: toggleMPResultHistory,\r\n getWorkOrderByID\r\n })(WithCommonMobileModal(MPResultHistory))\r\n);\r\n","/*\r\n * Measurement Point Result Modal - list the answers for the most recent result\r\n */\r\n\r\nimport { toggleMPResultModal } from '../../../actions/manageInventoryActions';\r\nimport { connect } from 'react-redux';\r\nimport { MPResultList } from '../MPResultList';\r\nimport { getMeasurementPointList } from '../../../actions/manageMeasurementPointListsActions';\r\nimport {\r\n clearHistoricalResultID,\r\n getMeasurementPointListResult\r\n} from '../../../actions/measurementPointResultsActions';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\n\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { initialMeasurmentPointResult } from '../../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n locationString: string;\r\n selectedMeasurementPointResultID: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'result-list'\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedMeasurementPointResult =\r\n state.measurementPointResults.measurementPointResultsByID[\r\n ownProps.selectedMeasurementPointResultID\r\n ];\r\n const selectedItem = selectedMeasurementPointResult || {\r\n ...initialMeasurmentPointResult,\r\n id: ownProps.selectedMeasurementPointResultID\r\n };\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultModal,\r\n measurementPointsByID:\r\n state.manageMeasurementPointLists.measurementPointsByID,\r\n selectedItem,\r\n title: ownProps.t('MeasurementPointResultModalTitle')\r\n };\r\n};\r\n\r\nexport const MPResultListMobileModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultModal,\r\n getMeasurementPointList,\r\n clearHistoricalResultID,\r\n getMeasurementPointListResult,\r\n onHide: toggleMPResultModal\r\n })(WithCommonMobileModal(MPResultList))\r\n);\r\n","/*\r\n * Measurement Point Result Notes Modal\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport {\r\n toggleMPResultModal,\r\n toggleMPResultNotes\r\n} from '../../../actions/manageInventoryActions';\r\nimport { connect } from 'react-redux';\r\nimport { IinstallBaseHistory } from '../../../models';\r\nimport { RichTextView } from '../../common/RichTextView';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n secondModal: boolean;\r\n}\r\ninterface IdispatchProps {\r\n toggleModal: typeof toggleMPResultModal;\r\n selectedItem: IinstallBaseHistory;\r\n}\r\nconst defaultProps = {\r\n className: 'notes-modal'\r\n};\r\n\r\nconst MPResultListNotesModalClass = (\r\n props: Iprops & IdispatchProps & WithTranslation\r\n) => {\r\n if (props.selectedItem.notes && props.selectedItem.notes.length !== 0) {\r\n return (\r\n \r\n );\r\n } else if (!props.selectedItem.notes) {\r\n return (\r\n

    \r\n {props.selectedItem.notes}\r\n \r\n \r\n {props.t('common:done')}\r\n \r\n \r\n
    \r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n return {\r\n ...defaultProps,\r\n title: ownProps.t('MPResultNotesModalTitle'),\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageInventory.showMPResultNotesModal,\r\n selectedItem: state.measurementPointResults.installBaseHistory.find(\r\n x => x.id === state.measurementPointResults.historicalResultID\r\n )!\r\n };\r\n};\r\n\r\nexport const MPResultListNotesMobileModal = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleMPResultNotes,\r\n onHide: toggleMPResultNotes\r\n })(WithCommonMobileModal(MPResultListNotesModalClass))\r\n);\r\n","import * as React from 'react';\r\nimport { TFunction } from 'i18next';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport { Ifacility, IinstallBase, Iproduct } from '../../../models';\r\nimport { TableUtil } from '../../common/TableUtil';\r\nimport { orderBy } from 'lodash';\r\nimport { measurementPointResultStatusTypesEnum } from '../../../models-enums';\r\nimport { InstallBaseActionButtonContainer } from '../../dashboard/InstallBaseActionButtonContainer';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { setSelectedTaeId } from '../../../actions/manageTaeActions';\r\nimport {\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleEditInstallModal\r\n} from '../../../actions/manageInventoryActions';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n facility: Ifacility;\r\n colorButton: string;\r\n openSearchFacilityModal: (ids: string[]) => void;\r\n selectedProduct: Iproduct;\r\n goBack: () => void;\r\n setSelectedInstallBaseID: typeof setSelectedInstallBaseID;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n toggleEditInstallModal: typeof toggleEditInstallModal;\r\n}\r\n\r\nconst ManageInventoryDetails: React.FC = (props: Iprops) => {\r\n const installBasesWithLocationString = props.selectedProduct.installBases?.map(\r\n (install: IinstallBase) => {\r\n return {\r\n ...install,\r\n locationString: TableUtil.buildLocation(install, props.facility)\r\n };\r\n }\r\n );\r\n const sortedInstallBases = orderBy(\r\n installBasesWithLocationString,\r\n 'installString'\r\n );\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'serialNumber',\r\n Header: 'serialNumber',\r\n // accessor: 'serialNumber',\r\n accessor: ({ serialNumber }: IinstallBase) => {\r\n return (\r\n <>\r\n SERIAL #\r\n \r\n {serialNumber}\r\n \r\n \r\n );\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'Location',\r\n id: 'location',\r\n accessor: ({ fullLocation }: IinstallBase) => {\r\n return (\r\n <>\r\n LOCATION \r\n \r\n {fullLocation}\r\n \r\n \r\n );\r\n }\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: ({ visibleStatus }: IinstallBase) => {\r\n const statusString =\r\n measurementPointResultStatusTypesEnum[visibleStatus];\r\n\r\n return (\r\n <>\r\n STATUS \r\n {`${props.t(\r\n 'manageMeasurementPointLists:' + statusString\r\n )}`}\r\n \r\n );\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: '',\r\n id: 'actions',\r\n Cell: rowInfo => (\r\n \r\n ),\r\n className: 'mobile-action-container'\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n const getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfo | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column) {\r\n if (column.id && column.id === 'actions') {\r\n return {};\r\n } else {\r\n return {\r\n onClick: () => {\r\n props.setSelectedInstallBaseID(rowInfo.original.id);\r\n props.setSelectedProductID(rowInfo.original.productID);\r\n props.toggleEditInstallModal();\r\n }\r\n };\r\n }\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const goBack = () => {\r\n props.goBack();\r\n };\r\n\r\n let pagination = false;\r\n\r\n if (\r\n props.selectedProduct.installBases !== undefined &&\r\n props.selectedProduct.installBases?.length >= 10\r\n ) {\r\n pagination = true;\r\n }\r\n\r\n return (\r\n
    \r\n
    \r\n

    \r\n {' '}\r\n {props.selectedProduct.name}\r\n

    \r\n

    \r\n {props.selectedProduct.installBasesCount}\r\n

    \r\n
    \r\n (state.checkboxTable = r)}\r\n //keyField=\"id\"\r\n showPagination={pagination}\r\n />\r\n
    \r\n );\r\n};\r\nexport default ManageInventoryDetails;\r\n","import * as React from 'react';\r\n\r\n/*\r\n * hopsital Managers manage their team\r\n * Note: did minimal renaming from the UserManage component\r\n */\r\nimport { Badge, Button, Col } from 'react-bootstrap';\r\n\r\nimport ReactTable, {\r\n Column,\r\n FinalState,\r\n RowInfo,\r\n SortingRule\r\n} from 'react-table';\r\nimport {\r\n bulkUpdateInstallProducts,\r\n clearSelectedInstallBaseID,\r\n clearSelectedProductID,\r\n getProductInfo,\r\n initInventory,\r\n moveFacilitiesAPI,\r\n requestQuote,\r\n setSearchNewProductsSelectedProduct,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n setTableFilter,\r\n toggleEditInstallModal,\r\n toggleEditProductModal,\r\n toggleImportInstallModal,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport { getWorkOrders } from '../../actions/manageWorkOrderActions';\r\nimport {\r\n Ifacility,\r\n IinstallBase,\r\n IinstallBasePopulated,\r\n ImanageInventoryReducer,\r\n Iproduct,\r\n IproductInfo,\r\n IsearchNewProductInstallBatchMode,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n emptyTile,\r\n initialProduct,\r\n initialProductQueueObject\r\n} from '../../reducers/initialState';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { TFunction } from 'i18next';\r\nimport { useState } from 'react';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { getFacility } from '../../actions/manageLocationActions';\r\nimport { toggleShoppingCartModal } from '../../actions/shoppingCartActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { measurementPointResultStatusTypesEnum } from '../../models-enums';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport { Banner } from '../common/Banner';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { WorkOrderExpander } from '../dashboard/WorkOrderExpander';\r\nimport { EditWorkOrderModal } from '../manageWorkOrder/EditWorkOrderModal';\r\nimport { WorkOrderCloseModal } from '../manageWorkOrder/WorkOrderCloseModal';\r\nimport ShoppingCartForm from '../shoppingCart/ShoppingCartForm';\r\nimport ShoppingCartModal from '../shoppingCart/ShoppingCartModal';\r\nimport EditInstallModal from './EditInstallModal';\r\nimport EditProductModal from './EditProductModal';\r\nimport ImportInstallModal from './ImportInstallModal';\r\nimport { InstallBasesExpanderContainer } from './InstallBasesExpanderContainer';\r\nimport InstallContactModal from './InstallContactModal';\r\nimport { MPResultHistoryModal } from './MPResultHistoryModal';\r\nimport { MPResultListModal } from './MPResultListModal';\r\nimport { MPResultListNotesModal } from './MPResultNotesModal';\r\nimport SearchNewFacilityModal from './SearchNewFacilityModal';\r\nimport SearchNewProductsModal from './SearchNewProductsModal';\r\nimport { MPResultHistoryMobileModal } from './mobile/MPResultHistoryMobileModal';\r\nimport { MPResultListMobileModal } from './mobile/MPResultListMobileModal';\r\nimport { MPResultListNotesMobileModal } from './mobile/MPResultNotesMobileModal';\r\nimport ManageInventoryDetails from './mobile/ManageInventoryDetails';\r\nimport {\r\n HIDE_MODAL_EDIT_PRODUCT,\r\n HIDE_MODAL_SEARCH_NEW_PRODUCTS\r\n} from '../../actions/actionTypes';\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n t: TFunction;\r\n loading: boolean;\r\n manageInventory: ImanageInventoryReducer;\r\n toggleEditProductModal: typeof toggleEditProductModal;\r\n toggleEditInstallModal: typeof toggleEditInstallModal;\r\n toggleShoppingCartModal: typeof toggleShoppingCartModal;\r\n toggleSearchNewProductsModal: typeof toggleSearchNewProductsModal;\r\n toggleImportInstallModal: typeof toggleImportInstallModal;\r\n getProductInfo: typeof getProductInfo;\r\n getFacility: typeof getFacility;\r\n toggleSecurityFunctionsModal: () => void;\r\n initInventory: typeof initInventory;\r\n closeAllModals: typeof closeAllModals;\r\n productInfo: IproductInfo;\r\n user: Iuser;\r\n cartTotal: number;\r\n tableData: any;\r\n setTableFilter: typeof setTableFilter;\r\n selectedProduct: Iproduct;\r\n searchNewProductsSelectedProduct: Iproduct;\r\n requestQuote: typeof requestQuote;\r\n selectedFacility: Ifacility;\r\n selectedInstallBase: IinstallBase;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n clearSelectedProductID: typeof clearSelectedProductID;\r\n setSelectedInstallBaseID: typeof setSelectedInstallBaseID;\r\n clearSelectedInstallBaseID: typeof clearSelectedInstallBaseID;\r\n setSearchNewProductsSelectedProduct: typeof setSearchNewProductsSelectedProduct;\r\n canEditInstalls: boolean;\r\n canRequestQuote: boolean;\r\n bannerTitle: string;\r\n className: string;\r\n showEditWorkOrderModal: boolean;\r\n toggleEditWorkOrderModal: () => any;\r\n showWorkOrderCloseModal: boolean;\r\n mergeProduct: (sprod: string, dproduct: string) => Promise;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n showSearchNewFacilityModal: boolean;\r\n installIdsToMove: string[];\r\n filterLength: number;\r\n}\r\n\r\ninterface IpagingInfo {\r\n count: number;\r\n numPages: number;\r\n}\r\n\r\nconst ManageInventory: React.FC = (props: Iprops) => {\r\n const { selectedFacility } = props;\r\n const isMobile = useSelector(getIsMobile);\r\n const dispatch = useDispatch();\r\n const buildSearchControls = (): FieldConfig => {\r\n const { tableFilters } = props.manageInventory;\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:searchProduct',\r\n colWidth: isMobile ? 12 : 3,\r\n type: 'text',\r\n placeholder: isMobile\r\n ? 'common:searchProductAssetPlaceholder'\r\n : 'searchPlaceholder',\r\n defaultValue: tableFilters.search\r\n }\r\n },\r\n mainCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:mainCategory',\r\n options: props.productInfo.mainCategoryOptions,\r\n colWidth: isMobile ? 12 : 3,\r\n type: 'select',\r\n placeholder: isMobile\r\n ? 'common:searchCategoryPlaceholder'\r\n : 'mainCategoryPlaceholder',\r\n defaultValue: tableFilters.mainCategory,\r\n isClearable: true\r\n }\r\n },\r\n status: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:status',\r\n options: FormUtil.convertEnumToOptions(\r\n measurementPointResultStatusTypesEnum\r\n ),\r\n colWidth: isMobile ? 12 : 3,\r\n type: 'select',\r\n placeholder: isMobile\r\n ? 'common:searchStatusPlaceholder'\r\n : 'statusPlaceholder',\r\n defaultValue: tableFilters.status,\r\n isClearable: true,\r\n shouldTranslate: true\r\n }\r\n },\r\n hideVirtualToggle: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'Hide Virtual',\r\n colWidth: isMobile ? 12 : 1,\r\n defaultValue: tableFilters.hideVirtualToggle,\r\n innerStyle: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n flexDirection: 'column-reverse',\r\n gap: '4px'\r\n }\r\n }\r\n }\r\n };\r\n\r\n return {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n };\r\n\r\n const [state, setState] = useState({\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n searchFieldConfig: buildSearchControls(),\r\n showSearchNewFacilityModal: false,\r\n installIdsToMove: [],\r\n filterLength: 0\r\n });\r\n\r\n const [pagingInfo, setPagingInfo] = useState({\r\n count: 0,\r\n numPages: 0\r\n });\r\n\r\n let setTableFilterTimeout: any;\r\n\r\n const { t, manageInventory } = props;\r\n const isManageAssetView = props.match.path === '/inventory';\r\n const selectedProductForEditInstall = manageInventory.showSearchNewProductsModal\r\n ? props.searchNewProductsSelectedProduct\r\n : props.selectedProduct;\r\n const colorButton =\r\n constants.colors[\r\n `${state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n const getQuantityColumn = (): Column => {\r\n if (isManageAssetView) {\r\n return {\r\n Header: 'qty',\r\n id: 'quantity',\r\n width: 80,\r\n accessor: ({ installBasesCount }: Iproduct) => {\r\n return installBasesCount || 0; // using this rather than data.quantity because quantity is not working\r\n }\r\n };\r\n } else {\r\n return {\r\n Header: 'qty',\r\n id: 'quantity',\r\n width: 80,\r\n accessor: ({ workOrders }: IinstallBasePopulated) => {\r\n return workOrders.length || 0; // using this rather than data.quantity because quantity is not working\r\n }\r\n };\r\n }\r\n };\r\n\r\n const getNameColumn = (): Column => {\r\n if (isManageAssetView) {\r\n return {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: (inventory: Iproduct) => inventory.name,\r\n minWidth: 400\r\n };\r\n } else {\r\n return {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: (inventory: IinstallBasePopulated) => {\r\n return (\r\n \r\n {inventory.productNameString}\r\n \r\n );\r\n },\r\n minWidth: 400\r\n };\r\n }\r\n };\r\n\r\n const columns = () =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n getNameColumn(),\r\n getQuantityColumn()\r\n ],\r\n t\r\n );\r\n\r\n const mobileColumns = () =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: inventory => {\r\n const name = [];\r\n\r\n name.push(inventory.name);\r\n\r\n if (inventory.sapMaterialNumber) {\r\n name.push(inventory.sapMaterialNumber);\r\n }\r\n\r\n if (inventory.description) {\r\n name.push(inventory.description);\r\n }\r\n\r\n return name.join(': ');\r\n }\r\n },\r\n getQuantityColumn()\r\n ],\r\n t\r\n );\r\n\r\n //Close all modals on component dismount.\r\n //Prior to this you could leave the page with the modal open and go to a new page where a\r\n //disembodied modal might be open.\r\n React.useEffect(() => {\r\n return () => {\r\n dispatch({ type: HIDE_MODAL_SEARCH_NEW_PRODUCTS });\r\n dispatch({ type: HIDE_MODAL_EDIT_PRODUCT });\r\n };\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n setState(currState => ({\r\n ...currState,\r\n filterLength: Object.keys(buildSearchControls().controls).length\r\n }));\r\n }, [state.searchFieldConfig]);\r\n\r\n React.useEffect(() => {\r\n props.getProductInfo();\r\n\r\n if (selectedFacility.id.length) {\r\n props.initInventory(\r\n selectedFacility.id,\r\n (count: number, numPages: number) => {\r\n setPagingInfo({ count, numPages });\r\n return;\r\n },\r\n 1\r\n );\r\n props.getFacility(selectedFacility.id);\r\n dispatch(getWorkOrders());\r\n }\r\n\r\n setState({\r\n ...state,\r\n currentTile: constants.getTileByURL(props.location.pathname),\r\n selectedRow: {}\r\n });\r\n }, [selectedFacility.id]);\r\n\r\n // auto scroll to top when data changes\r\n React.useEffect(() => {\r\n const tableElement = document.querySelector('.ReactTable .rt-tbody');\r\n if (tableElement) tableElement.scrollTop = 0;\r\n }, [props.tableData.length]);\r\n\r\n /*\r\n * Handle user clicking on a product row column\r\n * set the selected product to state and open the modal\r\n */\r\n const getTdProps = (\r\n stateFinal: FinalState,\r\n rowInfo: RowInfo | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (column.id && column.id === 'actions') {\r\n return;\r\n }\r\n setState({\r\n ...state,\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n if (!state.selectedRow[rowInfo.viewIndex || 0]) {\r\n props.setSelectedProductID(rowInfo.original.id);\r\n } else {\r\n props.clearSelectedProductID();\r\n }\r\n },\r\n style: {\r\n background: state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const getTdPropsMobile = (\r\n stateFinal: FinalState,\r\n rowInfo: RowInfo | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column) {\r\n // launch manage inventory details component\r\n\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n setState({\r\n ...state,\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n },\r\n style: {\r\n background: state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n props.setTableFilter({ page });\r\n props.initInventory(\r\n selectedFacility.id,\r\n (count: number, numPages: number) => {\r\n setPagingInfo({ count, numPages });\r\n return;\r\n },\r\n newPage\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n const onSearchValueChanges = (value: any, key: string) => {\r\n setState({ ...state, selectedRow: {} });\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(setTableFilterTimeout);\r\n setTableFilterTimeout = setTimeout(() => {\r\n props.setTableFilter({ search: value, page: 0 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'mainCategory':\r\n props.setTableFilter({ mainCategory: value, page: 0 });\r\n break;\r\n case 'status':\r\n props.setTableFilter({ status: value, page: 0 });\r\n break;\r\n case 'hideVirtualToggle':\r\n props.setTableFilter({ hideVirtualToggle: value, page: 0 });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n const onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n props.setTableFilter({ sorted: newSorted });\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n /*\r\n * Handle Product Select from the search new products modal\r\n */\r\n const handleSearchNewProductSelect = (\r\n product: Iproduct,\r\n installBatchMode: IsearchNewProductInstallBatchMode\r\n ) => {\r\n if (installBatchMode.isBatchMode) {\r\n toastr.confirm(\r\n props.t('toastMessage:confirmBulkChangeProduct', {\r\n count: installBatchMode.installBaseIDs.length\r\n }),\r\n {\r\n onOk: () => {\r\n dispatch(\r\n bulkUpdateInstallProducts(\r\n product,\r\n installBatchMode.installBaseIDs\r\n )\r\n );\r\n }\r\n }\r\n );\r\n return;\r\n }\r\n props.toggleEditInstallModal();\r\n props.setSearchNewProductsSelectedProduct(product);\r\n };\r\n\r\n /*\r\n * Handle Merge Product\r\n */\r\n const handleMergeProduct = (product: Iproduct) => {\r\n toastr.confirm(\r\n `${props.t('manageProductQueue:mergeConfirmPart_01')} \\n \\n${\r\n props.selectedProduct.name\r\n } \\n \\n ${props.t(\r\n 'manageProductQueue:mergeConfirmPart_02'\r\n )} \\n \\n ${product.name}?`,\r\n {\r\n onOk: () => {\r\n props\r\n .mergeProduct(props.selectedProduct.id, product.id)\r\n .then(() => {\r\n props.initInventory(\r\n props.selectedFacility.id,\r\n () => {\r\n return;\r\n },\r\n 1\r\n );\r\n setState({ ...state, selectedRow: {} });\r\n })\r\n .catch((error: any) => console.error(error));\r\n }\r\n }\r\n );\r\n };\r\n\r\n const moveFacility = async (newFacilityId: string) => {\r\n if (state.installIdsToMove.length > 0) {\r\n const response = await moveFacilitiesAPI(\r\n newFacilityId,\r\n state.installIdsToMove\r\n );\r\n if (response) {\r\n setState({\r\n ...state,\r\n installIdsToMove: [],\r\n showSearchNewFacilityModal: false,\r\n selectedRow: {}\r\n });\r\n\r\n toastr.success(\r\n props.t('Success'),\r\n props.t('Install Bases successfully merged'),\r\n constants.toastrSuccess\r\n );\r\n\r\n // Refresh the table\r\n props.initInventory(\r\n props.selectedFacility.id,\r\n () => {\r\n return;\r\n },\r\n 1\r\n );\r\n } else {\r\n toastr.warning(\r\n props.t('Error'),\r\n props.t('Failed to merge Install Bases'),\r\n constants.toastrError\r\n );\r\n }\r\n } else {\r\n toastr.warning(\r\n props.t('Error'),\r\n props.t('No install bases were selected'),\r\n constants.toastrError\r\n );\r\n }\r\n };\r\n\r\n const hideNewFacilitiesModal = () => {\r\n setState({ ...state, showSearchNewFacilityModal: false });\r\n };\r\n\r\n const showNewFacilityModal = (ids: string[]) => {\r\n setState({\r\n ...state,\r\n showSearchNewFacilityModal: true,\r\n installIdsToMove: ids\r\n });\r\n };\r\n\r\n // For mobile, if a row is selected, show the ManageInventoryDetails component\r\n if (isMobile) {\r\n const key = Object.keys(state.selectedRow);\r\n\r\n if (key.length > 0) {\r\n const first = key[0];\r\n const convertedInt = parseInt(first);\r\n if (!isNaN(convertedInt)) {\r\n return (\r\n \r\n \r\n \r\n \r\n {\r\n return;\r\n }}\r\n goBack={() => {\r\n setState({ ...state, selectedRow: {} });\r\n }}\r\n setSelectedInstallBaseID={\r\n props.setSelectedInstallBaseID\r\n }\r\n setSelectedProductID={props.setSelectedProductID}\r\n toggleEditInstallModal={\r\n props.toggleEditInstallModal\r\n }\r\n />\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n
    \r\n );\r\n }\r\n }\r\n }\r\n\r\n const scrollingHeight = isMobile ? 'calc(100vh - 60px - 84px)' : '100%';\r\n const overFlow = isMobile ? 'auto' : 'initial';\r\n return (\r\n \r\n \r\n \r\n {props.canRequestQuote && props.match.path !== '/assetStatus' && (\r\n \r\n props.toggleShoppingCartModal('INVENTORY')\r\n }\r\n >\r\n \r\n {props.cartTotal} \r\n \r\n )}\r\n \r\n\r\n
    \r\n \r\n {!isMobile && (\r\n <>\r\n {props.canEditInstalls && isManageAssetView && (\r\n
    \r\n \r\n {t('import')}\r\n \r\n\r\n {\r\n props.clearSelectedProductID();\r\n props.clearSelectedInstallBaseID();\r\n props.toggleSearchNewProductsModal();\r\n }}\r\n >\r\n {t('manageInventory:newProduct')}\r\n \r\n
    \r\n )}\r\n {isManageAssetView === false && (\r\n \r\n \r\n {' '}\r\n {t('back')}\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n\r\n {/* MOBILE */}\r\n {isMobile && (\r\n \r\n )}\r\n
    \r\n\r\n {/* DESKTOP */}\r\n {!isMobile && (\r\n {\r\n if (isManageAssetView === false) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n \r\n );\r\n }}\r\n resizable={false}\r\n expanded={state.selectedRow}\r\n loading={props.loading && props.tableData.length === 0}\r\n />\r\n )}\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n
    \r\n );\r\n};\r\n\r\nexport default ManageInventory;\r\n","import initialState from './initialState';\r\nimport { IshoppingCart, IshoppingCartProduct } from '../models';\r\nimport { filter, omit } from 'lodash';\r\n\r\nconst addedIds = (\r\n state: string[] = initialState.manageInventory.cart.addedIDs,\r\n action: any,\r\n cartName: string\r\n) => {\r\n switch (action.type) {\r\n case `ADD_TO_CART_${cartName}`:\r\n if (state.indexOf(action.product.id) !== -1) {\r\n return state;\r\n }\r\n return [...state, action.product.id];\r\n case `DELETE_FROM_CART_${cartName}`:\r\n if (state.indexOf(action.productID) === -1) {\r\n return state;\r\n }\r\n return filter(state, item => item !== action.productID);\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst productsByID = (\r\n state: { [key: string]: IshoppingCartProduct } = initialState\r\n .manageInventory.cart.productsByID,\r\n action: any,\r\n cartName: string\r\n) => {\r\n switch (action.type) {\r\n case `ADD_TO_CART_${cartName}`: {\r\n const { product } = action;\r\n return {\r\n ...state,\r\n [product.id]: {\r\n ...product,\r\n quantity:\r\n (state[product.id] ? state[product.id].quantity : 0) + 1\r\n }\r\n };\r\n }\r\n case `DECREASE_FROM_CART_${cartName}`:\r\n return {\r\n ...state,\r\n [action.productID]: {\r\n ...state[action.productID],\r\n quantity:\r\n (state[action.productID]\r\n ? state[action.productID].quantity\r\n : 1) - 1\r\n }\r\n };\r\n case `UPDATE_QUANTITY_CART_${cartName}`:\r\n return {\r\n ...state,\r\n [action.productID]: {\r\n ...state[action.productID],\r\n quantity: state[action.productID] ? action.quantity : 1\r\n }\r\n };\r\n case `DELETE_FROM_CART_${cartName}`:\r\n // const {[action.productID]: v, ...theRest} = state;\r\n // return theRest;\r\n return omit(state, [action.productID]);\r\n\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport const getQuantity = (state: IshoppingCart, productID: string): number =>\r\n state.productsByID[productID].quantity || 0;\r\n\r\nexport const getAddedIDs = (state: IshoppingCart) => state.addedIDs;\r\n\r\n/*\r\n * main cart reducer\r\n */\r\nexport const cartReducerWithName = (\r\n state: IshoppingCart = initialState.manageInventory.cart,\r\n action: any,\r\n cartName: string\r\n): IshoppingCart => {\r\n switch (action.type) {\r\n case `CHECKOUT_${cartName}_SUCCESS`:\r\n return initialState.manageInventory.cart;\r\n case `CHECKOUT_${cartName}_FAILED`:\r\n return state;\r\n default:\r\n return {\r\n addedIDs: addedIds(state.addedIDs, action, cartName),\r\n productsByID: productsByID(state.productsByID, action, cartName)\r\n };\r\n }\r\n};\r\n\r\nexport const getTotal = (state: IshoppingCart) =>\r\n state.addedIDs.reduce((total, id) => total + getQuantity(state, id), 0);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n IWorkOrder,\r\n Ibuilding,\r\n Ifacility,\r\n Ifloor,\r\n IinstallBase,\r\n IinstallBasePopulated,\r\n Ilead,\r\n Ilocation,\r\n ImanageInventoryReducer,\r\n ImanageWorkOrderReducer,\r\n ImeasurementPointResult,\r\n Iproduct,\r\n IproductInfo,\r\n Iroom,\r\n IsearchNewProductInstallBatchMode,\r\n ItableFiltersParams\r\n} from '../models';\r\nimport {\r\n createFormValuesWithName,\r\n createSelectedIDWithName,\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { filter, keyBy, map, orderBy, pickBy, forEach } from 'lodash';\r\nimport initialState, {\r\n initialInstallBase,\r\n initialMeasurmentPointResult,\r\n initialProduct\r\n} from './initialState';\r\nimport {\r\n measurementPointResultStatusTypesEnum,\r\n workOrderStatusEnum,\r\n workOrderTypesEnum\r\n} from '../models-enums';\r\n\r\nimport { TableUtil } from '../components/common/TableUtil';\r\nimport { cartReducerWithName } from './cartReducer';\r\nimport { combineReducers } from 'redux';\r\nimport moment from 'moment';\r\nimport { selectWorkOrdersByInstallBaseID } from './manageWorkOrderReducer';\r\nimport { IinitialState } from '.';\r\nimport { constants } from '../constants/constants';\r\n\r\n/*\r\n * ensure the product at least has the expected attributes, ignore any null attributes\r\n */\r\nexport const cleanAndFilterProductObject = (product: Iproduct): Iproduct => {\r\n return {\r\n ...initialProduct,\r\n ...(pickBy(product, (property, key) => property !== null) as Iproduct),\r\n installBasesCount: product.installBases\r\n ? product.installBases.length\r\n : 0,\r\n installBases: undefined\r\n };\r\n};\r\n\r\n// clean and filter out deleted and remove the nested objects\r\nconst cleanInstallBaseObjects = (\r\n installBases: IinstallBase[]\r\n): IinstallBase[] => {\r\n const filteredInstallBases = filter(installBases, { isDeleted: false });\r\n return filteredInstallBases.map((install: IinstallBase) => ({\r\n ...initialInstallBase,\r\n ...(pickBy(install, property => property !== null) as IinstallBase),\r\n workOrders: undefined,\r\n latestMeasurementPointListResult: undefined\r\n }));\r\n};\r\n\r\n/*\r\n * SELECTORS\r\n */\r\n\r\nexport const getInstallBasesForProduct = (\r\n state: { [key: string]: IinstallBase },\r\n productID: string\r\n) => {\r\n return filter(state, { productID, isDeleted: false });\r\n};\r\n\r\nexport const getInstallBasesForFacility = (\r\n state: { [key: string]: IinstallBase },\r\n facilityID: string\r\n) => {\r\n return filter(state, { facilityID, isDeleted: false });\r\n};\r\n\r\nconst filterInstallBases = (\r\n installBasesPopulated: IinstallBasePopulated[],\r\n searchFormValues: ItableFiltersParams\r\n) => {\r\n const { search, mainCategory, status } = searchFormValues;\r\n const filteredInstallBases = filter(installBasesPopulated, install => {\r\n let shouldInclude = true;\r\n if (search) {\r\n const searchString = search.trim().toLowerCase();\r\n const inProductName =\r\n install.productNameString\r\n .toLowerCase()\r\n .indexOf(searchString) !== -1;\r\n const inLocationName =\r\n install.locationString.toLowerCase().indexOf(searchString) !==\r\n -1;\r\n const inSerial = install.serialNumber\r\n ? install.serialNumber.toLowerCase().indexOf(searchString) !==\r\n -1\r\n : false;\r\n const inNickname = install.nickname\r\n ? install.nickname.toLowerCase().indexOf(searchString) !== -1\r\n : false;\r\n const inProductDescription = install.product.description\r\n ? install.product.description\r\n .toLowerCase()\r\n .indexOf(searchString) !== -1\r\n : false;\r\n const inAssetNumber = install.rfid\r\n ? install.rfid.toLowerCase().indexOf(searchString) !== -1\r\n : false;\r\n\r\n if (\r\n inProductName === false &&\r\n inLocationName === false &&\r\n inSerial === false &&\r\n inNickname === false &&\r\n inProductDescription === false &&\r\n inAssetNumber === false\r\n ) {\r\n shouldInclude = false;\r\n }\r\n }\r\n if (\r\n mainCategory &&\r\n install.product.subcategory &&\r\n mainCategory.value !== install.product.subcategory.mainCategoryID\r\n ) {\r\n shouldInclude = false;\r\n }\r\n // console.info('main', mainCategory, install.product.subcategory);\r\n if (\r\n status &&\r\n parseInt(status.value, 10) !==\r\n install.measurementPointListResultStatus\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (install.isDeleted) {\r\n shouldInclude = false;\r\n }\r\n\r\n return shouldInclude;\r\n });\r\n\r\n return orderBy(filteredInstallBases, 'locationString');\r\n};\r\n\r\nexport const getInstallBaseVisibleStatus = (\r\n installBase: IinstallBase,\r\n mplResult: ImeasurementPointResult,\r\n workOrder?: IWorkOrder\r\n) => {\r\n if (installBase.mostRecentStatus) {\r\n return installBase.mostRecentStatus;\r\n }\r\n\r\n // Old code, leaving as a fall back incase mostRecentStatus is not set\r\n // some point later, we should decide if we want to remove this completely\r\n if (workOrder && mplResult.id.length) {\r\n if (\r\n moment\r\n .utc(workOrder.updateDate)\r\n .isAfter(moment.utc(mplResult.createDate)) &&\r\n workOrder.status === workOrderStatusEnum.complete &&\r\n workOrder.type === workOrderTypesEnum.repair\r\n ) {\r\n return measurementPointResultStatusTypesEnum.resultStatusRepaired;\r\n }\r\n }\r\n // Repair Job\r\n else if (\r\n workOrder &&\r\n !mplResult.id.length &&\r\n workOrder.status === workOrderStatusEnum.complete &&\r\n workOrder.type === workOrderTypesEnum.repair\r\n ) {\r\n return measurementPointResultStatusTypesEnum.resultStatusRepaired;\r\n }\r\n // Service Plan\r\n else if (\r\n workOrder &&\r\n !mplResult.id.length &&\r\n workOrder.status === workOrderStatusEnum.complete &&\r\n workOrder.type === workOrderTypesEnum.servicePlan\r\n ) {\r\n return measurementPointResultStatusTypesEnum.resultStatusMaintain;\r\n } else if (\r\n workOrder &&\r\n !mplResult.id.length &&\r\n workOrder.status === workOrderStatusEnum.complete &&\r\n workOrder.type === workOrderTypesEnum.commissioning\r\n ) {\r\n return measurementPointResultStatusTypesEnum.resultStatusCommissioned;\r\n }\r\n\r\n if (mplResult.id.length) {\r\n return mplResult.status;\r\n }\r\n\r\n return installBase.measurementPointListResultStatus;\r\n};\r\n\r\nexport const selectVisibleInstallBases = (\r\n manageInventory: ImanageInventoryReducer,\r\n measurementPointResultsByID: { [key: string]: ImeasurementPointResult },\r\n facility: Ifacility,\r\n manageWorkOrderReducer: ImanageWorkOrderReducer,\r\n productInfo: IproductInfo\r\n) => {\r\n const { installBasesByID, productsByID, tableFilters } = manageInventory;\r\n const { subcategories } = productInfo;\r\n const facilityInstallBases = getInstallBasesForFacility(\r\n installBasesByID,\r\n facility.id\r\n );\r\n const installBasesPopulated: IinstallBasePopulated[] = map(\r\n facilityInstallBases,\r\n install => {\r\n const product = productsByID[install.productID] || initialProduct;\r\n const subcategory = subcategories[product.subcategoryID];\r\n const locationString = TableUtil.buildLocation(install, facility);\r\n const latestMeasurementPointListResult =\r\n measurementPointResultsByID[\r\n install.latestMeasurementPointListResultID\r\n ] || initialMeasurmentPointResult;\r\n const workOrders = selectWorkOrdersByInstallBaseID(\r\n manageWorkOrderReducer,\r\n install.id\r\n );\r\n const filteredWorkOrders = workOrders.filter(wo => {\r\n let shouldInclude = true;\r\n if (wo.type !== workOrderTypesEnum.repair) {\r\n shouldInclude = false;\r\n }\r\n if (wo.status === workOrderStatusEnum.complete) {\r\n shouldInclude = false;\r\n }\r\n return shouldInclude;\r\n });\r\n const workOrder =\r\n manageWorkOrderReducer.workOrdersByID[\r\n install.latestWorkOrderID\r\n ];\r\n const visibleStatus = getInstallBaseVisibleStatus(\r\n install,\r\n latestMeasurementPointListResult,\r\n workOrder\r\n );\r\n\r\n return {\r\n ...install,\r\n product: { ...product, subcategory },\r\n productNameString: product.name,\r\n locationString,\r\n latestMeasurementPointListResult,\r\n workOrders: filteredWorkOrders,\r\n visibleStatus\r\n };\r\n }\r\n );\r\n\r\n return filterInstallBases(installBasesPopulated, tableFilters);\r\n};\r\n\r\nexport const selectVisibleProductsWithInstallBases = (\r\n manageInventory: ImanageInventoryReducer,\r\n measurementPointResultsByID: { [key: string]: ImeasurementPointResult },\r\n facility: Ifacility,\r\n manageWorkOrderReducer: ImanageWorkOrderReducer,\r\n productInfo: IproductInfo\r\n) => {\r\n const selectedInstallBases = selectVisibleInstallBases(\r\n manageInventory,\r\n measurementPointResultsByID,\r\n facility,\r\n manageWorkOrderReducer,\r\n productInfo\r\n );\r\n let visibleProducts: { [key: string]: Iproduct } = {};\r\n selectedInstallBases.forEach(install => {\r\n const foundProduct = manageInventory.productsByID[install.productID];\r\n const foundInstallBases =\r\n visibleProducts[install.productID] &&\r\n visibleProducts[install.productID].installBases\r\n ? visibleProducts[install.productID].installBases\r\n : [];\r\n const installBases = foundInstallBases\r\n ? [...foundInstallBases, install]\r\n : [install];\r\n visibleProducts = {\r\n ...visibleProducts,\r\n [install.productID]: {\r\n ...foundProduct,\r\n installBases,\r\n installBasesCount: installBases.length\r\n }\r\n };\r\n });\r\n\r\n const { tableFilters } = manageInventory;\r\n if (tableFilters.hideVirtualToggle) {\r\n visibleProducts = pickBy(visibleProducts, product => {\r\n return (\r\n product.subcategoryID !== constants.virtualProductSubcategoryID\r\n );\r\n });\r\n }\r\n return orderBy(visibleProducts, 'name');\r\n};\r\n\r\nexport const selectMainCategoryFromProductID = (\r\n state: IinitialState,\r\n props: { productID: string }\r\n) => {\r\n const { manageInventory: manageInventoryState, productInfo } = state;\r\n const { productsByID } = manageInventoryState;\r\n const product = productsByID[props.productID];\r\n const subCategoryID = product.subcategoryID;\r\n const subCategory = productInfo.subcategories[subCategoryID];\r\n const mainCategoryID = subCategory.mainCategoryID;\r\n return productInfo.mainCategories[mainCategoryID];\r\n};\r\n\r\n/*\r\n * filter by facility first\r\n * the rest of the filteres are handled by filterInstallBases()\r\n * add the entire product object to each install\r\n * filter the work orders for repair type and not being complete\r\n */\r\n\r\n/*\r\n * select the VisibleInstalls then group them under the product\r\n */\r\n\r\n/*\r\n * REDUCERS\r\n */\r\n\r\n/*\r\nstatus = repair When the work order status is type “repair”, it is completed, and the latestWorkOrder updateDate is before the latestMPLResult\r\nor:\r\nthere is a completed repair work order and no latestMPLresult.\r\nor:\r\nstatus = latestmMPLResult.status\r\nor:\r\nstatus = Not Tested\r\n*/\r\n\r\n/*\r\n * the product object is returned with all the installBases nested inside of it\r\n */\r\nfunction productsByIDReducer(\r\n state: { [key: string]: Iproduct } = initialState.manageInventory\r\n .productsByID,\r\n action: any\r\n): { [key: string]: Iproduct } {\r\n switch (action.type) {\r\n case types.GET_INVENTORY_SUCCESS: {\r\n const newProducts = keyBy(\r\n map(action.inventory, ({ product }: { product: Iproduct }) => {\r\n return cleanAndFilterProductObject(product);\r\n }),\r\n 'id'\r\n );\r\n return { ...state, ...newProducts };\r\n //return newProducts;\r\n }\r\n case types.PRODUCT_UPDATE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.product.id]: cleanAndFilterProductObject(action.product)\r\n };\r\n\r\n case types.PRODUCT_ADD_SUCCESS:\r\n return {\r\n ...state,\r\n [action.product.id]: cleanAndFilterProductObject(action.product)\r\n };\r\n case types.INSTALL_ADD_SUCCESS: {\r\n // if this is ther first install for this product, we are adding the product as well\r\n const newInstallsCount = action.installs.length;\r\n const product = action.product;\r\n const newCount = product.installBasesCount\r\n ? product.installBasesCount + newInstallsCount\r\n : newInstallsCount;\r\n return {\r\n ...state,\r\n [product.id]: { ...product, installBasesCount: newCount }\r\n };\r\n }\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n return {\r\n ...state,\r\n ...keyBy(\r\n action.leads\r\n .filter((lead: Ilead) => lead.product)\r\n .map((lead: Ilead) => lead.product),\r\n 'id'\r\n )\r\n };\r\n }\r\n // we could handle get_products_success here if we were keeping all the products and doing front end filtering of the manage inventory table\r\n // case types.GET_PRODUCTS_SUCCESS:\r\n // if (action.products) {\r\n // const newProducts = map(action.products, (prod: Iproduct) => {\r\n // return cleanAndFilterProductObject({\r\n // ...prod,\r\n // installBases: state[prod.id] ? state[prod.id].installBases : []\r\n // });\r\n // });\r\n // return { ...state, ...keyBy(newProducts, 'id') };\r\n // } else {\r\n // return state;\r\n // }\r\n\r\n case types.DELETE_PHOTO_SUCCESS: {\r\n if (action.productID && state[action.productID]) {\r\n const productWithoutPhoto: Iproduct = {\r\n ...state[action.productID],\r\n imagePath: ''\r\n };\r\n return {\r\n ...state,\r\n [productWithoutPhoto.id]: productWithoutPhoto\r\n };\r\n }\r\n }\r\n case types.UPLOAD_PRODUCT_PHOTO_SUCCESS: {\r\n if (action.productID && state[action.productID]) {\r\n const productWithPhoto: Iproduct = {\r\n ...state[action.productID],\r\n imagePath: action.photo.lightboxUrl\r\n };\r\n return { ...state, [productWithPhoto.id]: productWithPhoto };\r\n }\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageInventory.productsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction installBasesByIDReducer(\r\n state: { [key: string]: IinstallBase } = initialState.manageInventory\r\n .installBasesByID,\r\n action: any\r\n): { [key: string]: IinstallBase } {\r\n switch (action.type) {\r\n case types.GET_INVENTORY_SUCCESS: {\r\n let newInstallBases: IinstallBase[] = [];\r\n action.inventory.forEach(({ product }: any) => {\r\n newInstallBases = [\r\n ...newInstallBases,\r\n ...cleanInstallBaseObjects(product.installBases)\r\n ];\r\n });\r\n\r\n return { ...state, ...keyBy(newInstallBases, 'id') };\r\n //return keyBy(newInstallBases, 'id');\r\n }\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n if (action.leads) {\r\n let nInstallBases: IinstallBase[] = [];\r\n forEach(action.leads, (lead: Ilead) => {\r\n if (lead.leadInstallBases) {\r\n forEach(lead.leadInstallBases, leadInstallB => {\r\n if (leadInstallB.installBase) {\r\n nInstallBases = [\r\n ...nInstallBases,\r\n leadInstallB.installBase\r\n ];\r\n }\r\n });\r\n }\r\n });\r\n return { ...state, ...keyBy(nInstallBases, 'id') };\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.INSTALL_UPDATE_BULK:\r\n return { ...state, ...keyBy(action.installs, 'id') };\r\n\r\n case types.INSTALL_UPDATE_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n\r\n case types.INSTALL_DELETE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload.id]: {\r\n ...state[action.payload.id],\r\n isDeleted: true\r\n }\r\n };\r\n case types.LOCATION_DELETE_SUCCESS: {\r\n const locationObject = action.locationObject as\r\n | Ilocation\r\n | Ibuilding\r\n | Ifloor\r\n | Iroom;\r\n let locationKey:\r\n | 'buildingID'\r\n | 'floorID'\r\n | 'locationID'\r\n | 'roomID' = 'buildingID';\r\n if ('facilityID' in locationObject) {\r\n // BUILDING\r\n locationKey = 'buildingID';\r\n return keyBy(\r\n map(state, install => {\r\n if (install[locationKey] === locationObject.id) {\r\n return {\r\n ...install,\r\n [locationKey]: '',\r\n floorID: '',\r\n locationID: '',\r\n roomID: ''\r\n };\r\n } else {\r\n return install;\r\n }\r\n }),\r\n 'id'\r\n );\r\n } else if ('buildingID' in locationObject) {\r\n // FLOOR\r\n locationKey = 'floorID';\r\n return keyBy(\r\n map(state, install => {\r\n if (install[locationKey] === locationObject.id) {\r\n return {\r\n ...install,\r\n [locationKey]: '',\r\n locationID: '',\r\n roomID: ''\r\n };\r\n } else {\r\n return install;\r\n }\r\n }),\r\n 'id'\r\n );\r\n } else if ('floorID' in locationObject) {\r\n // LOCATION\r\n locationKey = 'locationID';\r\n return keyBy(\r\n map(state, install => {\r\n if (install[locationKey] === locationObject.id) {\r\n return {\r\n ...install,\r\n [locationKey]: '',\r\n roomID: ''\r\n };\r\n } else {\r\n return install;\r\n }\r\n }),\r\n 'id'\r\n );\r\n } else if ('locationID' in locationObject) {\r\n // ROOM\r\n locationKey = 'roomID';\r\n return keyBy(\r\n map(state, install => {\r\n if (install[locationKey] === locationObject.id) {\r\n return { ...install, [locationKey]: '' };\r\n } else {\r\n return install;\r\n }\r\n }),\r\n 'id'\r\n );\r\n }\r\n }\r\n /*\r\n * It is possible to add multiple installs at the same time.\r\n */\r\n // eslint-disable-line no-fallthrough\r\n case types.INSTALL_ADD_SUCCESS: {\r\n const newInstallsB = cleanInstallBaseObjects(action.installs);\r\n return { ...state, ...keyBy(newInstallsB, 'id') };\r\n }\r\n case types.ADD_MEASUREMENT_POINT_RESULT: {\r\n const installB = state[action.result.installBaseID];\r\n return {\r\n ...state,\r\n [installB.id]: {\r\n ...installB,\r\n measurementPointListResultStatus: action.result.status\r\n }\r\n };\r\n }\r\n case types.UPDATE_MEASUREMENT_POINT_RESULT: {\r\n const installC = state[action.result.installBaseID];\r\n return {\r\n ...state,\r\n [installC.id]: {\r\n ...installC,\r\n measurementPointListResultStatus: action.result.status\r\n }\r\n };\r\n }\r\n case types.USER_LOGOUT_SUCCESS: {\r\n return initialState.manageInventory.installBasesByID;\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.INVENTORY_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction productSearchModalBatchMode(\r\n state: IsearchNewProductInstallBatchMode | undefined,\r\n action: any\r\n): IsearchNewProductInstallBatchMode {\r\n switch (action.type) {\r\n case types.SET_INSTALL_BATCH_MODE:\r\n return action.payload;\r\n default:\r\n return state || { isBatchMode: false, installBaseIDs: [] };\r\n }\r\n}\r\n\r\nfunction selectedProductReducer(\r\n state: Iproduct = initialProduct,\r\n action: any\r\n): Iproduct {\r\n switch (action.type) {\r\n case types.SET_SELECTED_PRODUCT:\r\n return action.product ? action.product : initialProduct;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialProduct;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction newProductsReducer(\r\n state: { [key: string]: Iproduct } = {},\r\n action: any\r\n): { [key: string]: Iproduct } {\r\n switch (action.type) {\r\n case types.GET_PRODUCTS_SUCCESS:\r\n if (action.products) {\r\n const newProducts = map(\r\n action.products,\r\n (product: Iproduct) => {\r\n return cleanAndFilterProductObject(product);\r\n }\r\n );\r\n return keyBy(newProducts, 'id');\r\n } else {\r\n return {};\r\n }\r\n case types.NEW_PRODUCTS_RESET:\r\n return {};\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst ManageInventory = combineReducers({\r\n productsByID: productsByIDReducer,\r\n installBasesByID: installBasesByIDReducer,\r\n totalPages,\r\n cart: (state, action) => cartReducerWithName(state, action, 'INVENTORY'),\r\n searchNewProductsSelectedProduct: (state, action) =>\r\n selectedProductReducer(state, action),\r\n newProducts: newProductsReducer,\r\n showShoppingCartModal: (state, action) =>\r\n modalToggleWithName(state, action, 'SHOPPING_CART_INVENTORY'),\r\n showEditProductModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_PRODUCT'),\r\n showSearchNewProductsModal: (state, action) =>\r\n modalToggleWithName(state, action, 'SEARCH_NEW_PRODUCTS'),\r\n showEditInstallModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_INSTALL'),\r\n showInstallContactModal: (state, action) =>\r\n modalToggleWithName(state, action, 'INSTALL_CONTACT'),\r\n showImportInstallModal: (state, action) =>\r\n modalToggleWithName(state, action, 'IMPORT_INSTALL'),\r\n showMPResultModal: (state, action) =>\r\n modalToggleWithName(state, action, 'MP_RESULT'),\r\n showMPResultHistoryModal: (state, action) =>\r\n modalToggleWithName(state, action, 'MP_RESULT_HISTORY'),\r\n showMPResultNotesModal: (state, action) =>\r\n modalToggleWithName(state, action, 'MP_RESULT_NOTES'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_INVENTORY'),\r\n productSearchFormValues: (state, action) =>\r\n createFormValuesWithName(\r\n state,\r\n action,\r\n 'MANAGE_INVENTORY_PRODUCT_SEARCH'\r\n ),\r\n installFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_INVENTORY_INSTALL'),\r\n selectedProductID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'MANAGE_INVENTORY_PRODUCT_ID'),\r\n selectedInstallBaseID: (state, action) =>\r\n createSelectedIDWithName(\r\n state,\r\n action,\r\n 'MANAGE_INVENTORY_INSTALL_BASE_ID'\r\n ),\r\n searchNewProductInstallBatchMode: (state, action) =>\r\n productSearchModalBatchMode(state, action)\r\n // quoteRequestItems: quoteRequestReducer(state, action)\r\n});\r\n\r\nexport default ManageInventory;\r\n","/*\r\n * Install Base Analytics Table Container makes use of Manage Inventory\r\n */\r\nimport * as React from 'react';\r\n\r\nimport { IWorkOrder, IinstallBase } from '../../models';\r\nimport {\r\n clearSelectedInstallBaseID,\r\n clearSelectedProductID,\r\n getProductInfo,\r\n initInventory,\r\n requestQuote,\r\n setSearchNewProductsSelectedProduct,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n setTableFilter,\r\n toggleEditInstallModal,\r\n toggleEditProductModal,\r\n toggleImportInstallModal,\r\n toggleInstallContactModal,\r\n toggleSearchNewProductsModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getCanEditInstalls,\r\n getCanRequestQuote\r\n} from '../../reducers/userReducer';\r\nimport {\r\n initialFacility,\r\n initialInstallBase,\r\n initialProduct\r\n} from '../../reducers/initialState';\r\n\r\nimport { InstallBaseActionButtonContainer } from './InstallBaseActionButtonContainer';\r\nimport ManageInventory from '../manageInventory/ManageInventory';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { TFunction } from 'i18next';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { getFacility } from '../../actions/manageLocationActions';\r\nimport { getTotal } from '../../reducers/cartReducer';\r\nimport { measurementPointResultStatusTypesEnum } from '../../models-enums';\r\nimport { toggleShoppingCartModal } from '../../actions/shoppingCartActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport { selectVisibleInstallBases } from '../../reducers/manageInventoryReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst columns = (t: TFunction, colorButton: string) =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n Header: 'asset',\r\n accessor: 'product.name',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'location',\r\n id: 'location',\r\n minWidth: 140,\r\n accessor: 'locationString'\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: ({\r\n measurementPointListResultStatus\r\n }: IinstallBase) => {\r\n const statusString =\r\n measurementPointResultStatusTypesEnum[\r\n measurementPointListResultStatus\r\n ];\r\n return (\r\n {`${t(\r\n 'manageMeasurementPointLists:' + statusString\r\n )}`}\r\n );\r\n },\r\n width: 180\r\n },\r\n {\r\n Header: 'dashboardAnalytics:#WO',\r\n id: 'wos',\r\n width: 60,\r\n accessor: ({ workOrders }: { workOrders: IWorkOrder[] }) => {\r\n return workOrders.length; // using this rather than data.quantity because when we add new installs, we don't want to update the quantity on the product\r\n }\r\n },\r\n {\r\n Header: '',\r\n id: 'actions',\r\n Cell: rowInfo => (\r\n {\r\n return;\r\n }}\r\n forMobile={false}\r\n />\r\n ),\r\n minWidth: 90,\r\n style: { overflow: 'visible' }\r\n }\r\n ],\r\n t\r\n );\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedFacility =\r\n state.facilities[state.selectedFacilityID] || initialFacility;\r\n const {\r\n selectedInstallBaseID,\r\n productsByID,\r\n selectedProductID,\r\n searchNewProductsSelectedProduct\r\n } = state.manageInventory;\r\n const { measurementPointResultsByID } = state.measurementPointResults;\r\n const selectedProduct = productsByID[selectedProductID] || initialProduct;\r\n const selectedInstallBase =\r\n state.manageInventory.installBasesByID[selectedInstallBaseID] ||\r\n initialInstallBase;\r\n const canEditInstalls = getCanEditInstalls(state.user);\r\n const canRequestQuote = getCanRequestQuote(state.user);\r\n\r\n const installBases = selectVisibleInstallBases(\r\n state.manageInventory,\r\n measurementPointResultsByID,\r\n selectedFacility,\r\n state.manageWorkOrder,\r\n state.productInfo\r\n );\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n productInfo: state.productInfo,\r\n cartTotal: getTotal(state.manageInventory.cart),\r\n tableData: installBases,\r\n selectedProduct,\r\n searchNewProductsSelectedProduct,\r\n selectedInstallBase,\r\n selectedFacility,\r\n canEditInstalls,\r\n canRequestQuote,\r\n bannerTitle: 'dashboardAnalytics:assetStatusTitle',\r\n columns: columns(ownProps.t, ownProps.colorButton),\r\n className: 'install-base-analytics',\r\n manageInventory: state.manageInventory\r\n };\r\n};\r\n\r\nexport const InstallBaseAnalyticsTableContainer = withTranslation(\r\n 'manageInventory'\r\n)(\r\n connect(mapStateToProps, {\r\n initInventory,\r\n toggleEditProductModal,\r\n toggleEditInstallModal,\r\n toggleShoppingCartModal,\r\n toggleSearchNewProductsModal,\r\n closeAllModals,\r\n getProductInfo,\r\n getFacility,\r\n setTableFilter,\r\n toggleInstallContactModal,\r\n toggleImportInstallModal,\r\n requestQuote,\r\n setSelectedProductID,\r\n clearSelectedProductID,\r\n setSelectedInstallBaseID,\r\n clearSelectedInstallBaseID,\r\n setSearchNewProductsSelectedProduct\r\n })(ManageInventory)\r\n);\r\n","import { beginAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { ItableFiltersParams, IAlert, ThunkResult } from '../models';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\n\r\nexport const getAlerts = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { page, title, type } = getState().manageAlert.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { page, title, type }\r\n };\r\n\r\n const url = API.GET.alert.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_ALERTS_SUCCESS,\r\n payload: data.data.result\r\n });\r\n dispatch({\r\n type: types.ALERT_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.LOAD_ALERTS_SUCCESS });\r\n constants.handleError(error, 'get alerts');\r\n });\r\n };\r\n};\r\n\r\nexport const saveAlert = (alert: IAlert): ThunkResult => (\r\n dispatch,\r\n getState\r\n) => {\r\n dispatch(beginAjaxCall());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: FormUtil.toFormData(alert),\r\n headers\r\n };\r\n\r\n const url = API.POST.alert.create;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const newAlert = data.data;\r\n dispatch({\r\n type: types.ADD_ALERT_SUCCESS,\r\n payload: newAlert\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Created Alert`,\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_ALERT });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.ADD_ALERT_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'ADD_ALERT_FAILED');\r\n });\r\n};\r\n\r\nexport const updateAlert = (\r\n alert: any,\r\n selectedAlert: IAlert\r\n): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n\r\n alert['id'] = selectedAlert.id;\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: FormUtil.toFormData(alert),\r\n headers\r\n };\r\n\r\n const url = `${API.PUT.alert}/${selectedAlert.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.EDIT_ALERT_SUCCESS,\r\n payload: data.data\r\n });\r\n toastr.success(\r\n 'Success',\r\n `Updated Alert`,\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_ALERT });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.EDIT_ALERT_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'EDIT_ALERT_FAILED');\r\n });\r\n};\r\n\r\nexport const deleteAlert = (alert: IAlert): ThunkResult => dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = `${API.DELETE.alert}/Delete/${alert.id}`;\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({ type: types.REMOVE_ALERT_SUCCESS, payload: alert });\r\n toastr.success('Success', `Deleted Alert`, constants.toastrSuccess);\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.REMOVE_ALERT_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'REMOVE_ALERT_FAILED');\r\n });\r\n};\r\n\r\nexport const setSelectedAlertID = (id: string) => ({\r\n type: types.SET_SELECTED_ALERT_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedAlertID = () => ({\r\n type: types.CLEAR_SELECTED_ALERT_ID\r\n});\r\n\r\nexport const toggleEditAlertModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_ALERT\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_ALERT,\r\n filters\r\n});\r\n\r\nexport const setAlertFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_ALERT,\r\n formValues\r\n});\r\n\r\nexport const updateAlertFormValue = (formValues: { [key: string]: any }) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_ALERT,\r\n formValues\r\n});\r\n","/*\r\n * Edit alert Form\r\n * Add and Edit alerts\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { IAlert, Ioption } from '../../models';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport {\r\n clearSelectedAlertID,\r\n saveAlert,\r\n toggleEditAlertModal,\r\n updateAlert\r\n} from '../../actions/manageAlertActions';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\n\r\ninterface Iprops {\r\n handleSubmit: typeof saveAlert;\r\n handleEdit: typeof updateAlert;\r\n handleCancel: any;\r\n loading: boolean;\r\n colorButton: string;\r\n selectedAlert: IAlert;\r\n clearSelectedAlertID: typeof clearSelectedAlertID;\r\n updateFormValue: (formValue: { [key: string]: any }) => void;\r\n setFormValues: (formValues: { [key: string]: any }) => void;\r\n formValues: { [key: string]: any };\r\n toggleModal: typeof toggleEditAlertModal;\r\n standardOptions: Ioption[];\r\n}\r\n\r\ninterface State {\r\n file: any;\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditAlertForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n file: '',\r\n fieldConfig: this.buildFieldConfig(this.onFileChange)\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops, prevState: State) {\r\n if (prevProps.formValues.imageUrl !== this.props.formValues.imageUrl) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.onFileChange)\r\n });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.clearSelectedAlertID();\r\n this.props.setFormValues({});\r\n }\r\n\r\n buildFieldConfig = (onFileChange: any) => {\r\n const { selectedAlert, formValues } = this.props;\r\n let {\r\n type,\r\n title,\r\n text,\r\n imageUrl,\r\n expirationDate,\r\n standards\r\n } = selectedAlert;\r\n\r\n type = formValues.type\r\n ? formValues.type.value\r\n ? formValues.type.value\r\n : formValues.type\r\n : type;\r\n title = formValues.title ? formValues.title : title;\r\n text = formValues.text ? formValues.text : text;\r\n imageUrl = formValues.imageUrl ? formValues.imageUrl : imageUrl;\r\n expirationDate = formValues.expirationDate\r\n ? formValues.expirationDate\r\n : expirationDate;\r\n\r\n let selectedStandards: Ioption[] = [];\r\n if (\r\n (!formValues.standards || formValues.standards.length === 0) &&\r\n standards &&\r\n Object.keys(standards).length > 0\r\n ) {\r\n Object.keys(standards).forEach((key: string) => {\r\n for (let i = 0; i < this.props.standardOptions.length; i++) {\r\n if (\r\n this.props.standardOptions[i].value ===\r\n standards[key].id\r\n ) {\r\n selectedStandards.push(this.props.standardOptions[i]);\r\n return;\r\n }\r\n }\r\n });\r\n } else if (formValues.standards && formValues.standards.length > 0) {\r\n selectedStandards = formValues.standards;\r\n }\r\n\r\n const selectedType =\r\n constants.alertTypes.find(t => t.value === type) || null;\r\n\r\n const fieldConfigControls = {\r\n title: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'alertForm.title',\r\n colWidth: 12,\r\n autoFocus: true,\r\n name: 'alert-title'\r\n },\r\n formState: title\r\n },\r\n type: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.alertTypes,\r\n label: 'alertForm.type',\r\n colWidth: 12,\r\n name: 'alert-type',\r\n isClearable: false\r\n },\r\n formState: {\r\n value: selectedType,\r\n disabled: false\r\n }\r\n },\r\n standards: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.props.standardOptions,\r\n label: 'alertForm.standards',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: true,\r\n name: 'standards',\r\n required: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: selectedStandards,\r\n disabled: false\r\n }\r\n },\r\n expirationDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'alertForm.expirationDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'expiration-date',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n formState: {\r\n value: expirationDate,\r\n disabled: false\r\n },\r\n options: {\r\n validators: FormUtil.validators.isValidMoment\r\n }\r\n },\r\n text: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'alertForm.text',\r\n colWidth: 12,\r\n name: 'alert-text',\r\n required: false,\r\n initialContent: text\r\n },\r\n formState: text\r\n },\r\n file: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n type: 'file',\r\n label: 'alertForm.file',\r\n colWidth: 12,\r\n accept: 'image/png, image/jpeg',\r\n name: 'alert-file',\r\n required: false,\r\n onChange: onFileChange,\r\n imageUrl,\r\n hasPreview: true\r\n }\r\n },\r\n imageSizeLabel: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n label: 'alertForm.imageSizeLabel',\r\n colWidth: 12\r\n }\r\n }\r\n };\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n onFileChange = (key: string, file: File) => {\r\n this.setState({ file });\r\n const reader = new FileReader();\r\n reader.onload = (e: any) => {\r\n this.onValueChanges(e.target.result, 'imageUrl');\r\n };\r\n if (file) {\r\n reader.readAsDataURL(file);\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n this.props.updateFormValue({ [key]: value });\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n const formData = {\r\n ...this.formGroup.value,\r\n type: this.formGroup.value.type.value\r\n };\r\n if (this.state.file) {\r\n formData['file'] = this.state.file;\r\n }\r\n delete formData.standards;\r\n\r\n if (\r\n this.formGroup.value.standards &&\r\n this.formGroup.value.standards.length > 0\r\n ) {\r\n this.formGroup.value.standards.forEach(\r\n (standard: Ioption, index: number) => {\r\n const newKey = `standards[${index}].id`;\r\n formData[newKey] = standard.value;\r\n }\r\n );\r\n }\r\n\r\n if (!this.props.selectedAlert.id) {\r\n this.props.handleSubmit(formData);\r\n } else {\r\n this.props.handleEdit(formData, this.props.selectedAlert);\r\n }\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditAlertForm;\r\n","/*\r\n * Edit Alert Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n saveAlert,\r\n updateAlert,\r\n toggleEditAlertModal\r\n} from '../../actions/manageAlertActions';\r\nimport EditAlertForm from './EditAlertForm';\r\nimport { initialAlert } from '../../reducers/initialState';\r\nimport {\r\n clearSelectedAlertID,\r\n setAlertFormValues,\r\n updateAlertFormValue\r\n} from '../../actions/manageAlertActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedAlert =\r\n state.manageAlert.alertsByID[state.manageAlert.selectedAlertID] ||\r\n initialAlert;\r\n\r\n let modalTitle;\r\n if (selectedAlert && selectedAlert.id) {\r\n modalTitle = ownProps.t(`manageAlert:editAlert`);\r\n } else {\r\n modalTitle = ownProps.t(`manageAlert:newAlert`);\r\n }\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageAlert.showEditAlertModal,\r\n selectedAlert,\r\n formValues: state.manageAlert.alertFormValues,\r\n standardOptions: state.productInfo.standardOptions,\r\n title: modalTitle,\r\n className: 'alert-edit'\r\n };\r\n};\r\n\r\nexport default withTranslation('manageAlert')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleEditAlertModal,\r\n handleCancel: toggleEditAlertModal,\r\n handleSubmit: saveAlert,\r\n handleEdit: updateAlert,\r\n clearSelectedAlertID,\r\n updateFormValue: updateAlertFormValue,\r\n setFormValues: setAlertFormValues,\r\n onHide: toggleEditAlertModal\r\n })(WithCommonModal(EditAlertForm))\r\n);\r\n","import * as React from 'react';\r\nimport * as moment from 'moment';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { IAlert, ItableFiltersReducer, Itile } from '../../models';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport {\r\n clearSelectedAlertID,\r\n deleteAlert,\r\n getAlerts,\r\n setSelectedAlertID,\r\n setTableFilter,\r\n toggleEditAlertModal\r\n} from '../../actions/manageAlertActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { Button } from 'react-bootstrap';\r\nimport EditAlertModal from './EditAlertModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { orderBy } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RowInfoAlert extends RowInfo {\r\n original: IAlert;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n tableData: IAlert[];\r\n totalPages: number;\r\n showEditAlertModal: boolean;\r\n getAlerts: typeof getAlerts;\r\n toggleEditAlertModal: typeof toggleEditAlertModal;\r\n deleteAlert: typeof deleteAlert;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedAlertID: typeof setSelectedAlertID;\r\n clearSelectedAlertID: typeof clearSelectedAlertID;\r\n getProductInfo: typeof getProductInfo;\r\n closeAllModals: typeof closeAllModals;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageAlert extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private debounce: any;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n searchFieldConfig: this.buildSearchControls()\r\n };\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n this.props.getAlerts();\r\n this.props.getProductInfo();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditAlertModal !== this.props.showEditAlertModal &&\r\n !this.props.showEditAlertModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getAlerts();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const mainSearchControls = {\r\n name: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:Alert',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'Search by title',\r\n defaultValue: this.props.tableFilters.title,\r\n isClearable: true\r\n }\r\n },\r\n type: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: constants.alertTypes,\r\n label: 'manageAlert:alertTypeLabel',\r\n colWidth: 3,\r\n placeholder: 'Select type',\r\n defaultValue: this.props.tableFilters.type,\r\n isClearable: true\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'name':\r\n clearTimeout(this.debounce);\r\n this.debounce = setTimeout(() => {\r\n this.props.setTableFilter({ title: value, page: 1 });\r\n }, 500);\r\n break;\r\n case 'type':\r\n this.props.setTableFilter({\r\n type: value ? value.value : null,\r\n page: 1\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n handleEdit(row: any) {\r\n this.setState({ selectedRow: row.index });\r\n this.props.toggleEditAlertModal();\r\n this.props.setSelectedAlertID(row.original.id);\r\n }\r\n\r\n handleDelete(deletedItem: any) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem\r\n };\r\n this.props.deleteAlert(deletedItem);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n }\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'title',\r\n accessor: 'title',\r\n minWidth: 300\r\n },\r\n {\r\n Header: 'type',\r\n accessor: 'type'\r\n },\r\n {\r\n Header: '',\r\n id: 'delete',\r\n minWidth: 25,\r\n Cell: row => {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoAlert | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id && column.id === 'delete') {\r\n return {\r\n onClick: () => this.handleDelete(rowInfo.original)\r\n };\r\n } else if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.handleEdit(rowInfo);\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n render() {\r\n const { t, tableData = [], totalPages } = this.props;\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n {\r\n this.setState({ selectedRow: null }, () => {\r\n this.props.toggleEditAlertModal();\r\n });\r\n }}\r\n >\r\n {t(`manageAlert:newAlert`)}\r\n \r\n
    \r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n // onSortedChange={this.onSortedChanged}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n const tableData = orderBy(\r\n state.manageAlert.alertsByID,\r\n res => moment.utc(res.createDate).unix(),\r\n 'desc'\r\n );\r\n return {\r\n tableData,\r\n totalPages: state.manageAlert.totalPages,\r\n showEditAlertModal: state.manageAlert.showEditAlertModal,\r\n tableFilters: state.manageAlert.tableFilters\r\n };\r\n};\r\n\r\nexport default withTranslation('manageAlert')(\r\n connect(mapStateToProps, {\r\n getAlerts,\r\n toggleEditAlertModal,\r\n deleteAlert,\r\n setTableFilter,\r\n setSelectedAlertID,\r\n clearSelectedAlertID,\r\n getProductInfo,\r\n closeAllModals\r\n })(ManageAlert)\r\n);\r\n","import { beginAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { Ibrand, ItableFiltersParams, ThunkResult } from '../models';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { initialBrand } from '../reducers/initialState';\r\n\r\nconst addBrandLogo = async (brandID: string, file: string) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n brandID,\r\n file\r\n }\r\n };\r\n const url = API.PUT.brandLogo;\r\n\r\n return msalFetch(url, axiosOptions);\r\n};\r\n\r\nexport function getAllBrands(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {}\r\n };\r\n\r\n const url = API.GET.brand.getAll;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_BRANDS_SUCCESS,\r\n payload: { result: data.data }\r\n });\r\n\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.LOAD_BRANDS_SUCCESS });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function getBrands(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { page, name } = getState().manageBrand.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { page, name }\r\n };\r\n\r\n const url = API.GET.brand.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_BRANDS_SUCCESS,\r\n payload: data.data\r\n });\r\n dispatch({\r\n type: types.BRAND_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.LOAD_BRANDS_SUCCESS });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function updateBrand(brand: Ibrand): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n let brandToUpdate = { ...brand };\r\n if (brand.countryID === '') {\r\n brandToUpdate.countryID = undefined;\r\n }\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: { ...brandToUpdate }\r\n };\r\n\r\n const url = `${API.PUT.brand}/${brand.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.EDIT_BRAND_SUCCESS,\r\n payload: brand\r\n });\r\n const productInfo = getState().productInfo;\r\n // Check if brands are loaded in inventory\r\n if (productInfo.brandOptions?.length > 0) {\r\n const brands = {\r\n ...productInfo.allBrands,\r\n [brand.id]: brand\r\n };\r\n // Update brand in inventory brand list\r\n dispatch({\r\n type: types.UPDATE_PRODUCT_INFO_BRANDS_SUCCESS,\r\n payload: { brands }\r\n });\r\n }\r\n // dispatch({ type: types.TOGGLE_MODAL_EDIT_BRAND });\r\n toastr.success(\r\n 'Success',\r\n `Updated Brand.`,\r\n constants.toastrSuccess\r\n );\r\n\r\n if (brand.logo) {\r\n const base64Logo = brand.logo?.replace(\r\n /^[\\w/:.-]+;base64,/g,\r\n ''\r\n );\r\n addBrandLogo(brand.id, base64Logo);\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.EDIT_BRAND_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function saveBrand(brand: Ibrand, isEditing: boolean): ThunkResult {\r\n return (dispatch, getState) => {\r\n // We are creating a brand new Brand\r\n if (isEditing === false) {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { name: brand.name }\r\n };\r\n\r\n const url = API.POST.brand;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n const newBrand = {\r\n ...brand,\r\n id: data.data.id,\r\n createDate: data.data.createDate,\r\n updateDate: data.data.updateDate\r\n };\r\n dispatch({\r\n type: types.ADD_BRAND_SUCCESS,\r\n payload: newBrand\r\n });\r\n const inventoryProductInfo = getState().productInfo;\r\n // Check if brands are loaded in inventory\r\n if (\r\n inventoryProductInfo.brandOptions &&\r\n !!inventoryProductInfo.brandOptions.length\r\n ) {\r\n const brands = {\r\n [newBrand.id]: newBrand,\r\n ...inventoryProductInfo.brands\r\n };\r\n const brandOptions = [\r\n FormUtil.convertToSingleOption(newBrand),\r\n ...inventoryProductInfo.brandOptions\r\n ];\r\n // Add new brand in inventory brand list\r\n dispatch({\r\n type: types.UPDATE_PRODUCT_INFO_SUCCESS,\r\n payload: { brands, brandOptions }\r\n });\r\n }\r\n dispatch(updateBrand(newBrand));\r\n\r\n // dispatch({ type: types.TOGGLE_MODAL_EDIT_BRAND });\r\n toastr.success(\r\n 'Success',\r\n `Created Brand.`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.ADD_BRAND_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n } else {\r\n // We are updating\r\n dispatch(updateBrand(brand));\r\n }\r\n };\r\n}\r\n\r\nexport function deleteBrand(brand: any): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = `${API.DELETE.brand}/${brand.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.REMOVE_BRAND_SUCCESS,\r\n payload: brand\r\n });\r\n const inventoryProductInfo = getState().productInfo;\r\n // Check if brands are loaded in inventory\r\n if (\r\n inventoryProductInfo.brandOptions &&\r\n !!inventoryProductInfo.brandOptions.length\r\n ) {\r\n const brands = { ...inventoryProductInfo.brands };\r\n if (brands.hasOwnProperty(brand.id)) {\r\n delete brands[brand.id];\r\n }\r\n const brandOptions = inventoryProductInfo.brandOptions.filter(\r\n (b: any) => b.value !== brand.id\r\n );\r\n // Update brand in inventory brand list\r\n dispatch({\r\n type: types.UPDATE_PRODUCT_INFO_SUCCESS,\r\n payload: { brands, brandOptions }\r\n });\r\n }\r\n // dispatch({type: types.TOGGLE_MODAL_EDIT_BRAND});\r\n toastr.success(\r\n 'Success',\r\n `Deleted Brand.`,\r\n constants.toastrSuccess\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.REMOVE_BRAND_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * updateSelectedJob\r\n * update the selected brand\r\n */\r\nexport const updateSelectedBrand = (job = initialBrand) => ({\r\n type: types.UPDATE_SELECTED_BRAND,\r\n payload: job\r\n});\r\n\r\nexport const setSelectedBrandID = (id: string) => ({\r\n type: types.SET_SELECTED_BRAND_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedBrandID = () => ({\r\n type: types.CLEAR_SELECTED_BRAND_ID\r\n});\r\n\r\nexport const toggleEditBrandModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_BRAND\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_BRAND,\r\n filters\r\n});\r\n","/*\r\n * Manage Brand Form\r\n */\r\n\r\nimport { Col, Button, FormGroup } from 'react-bootstrap';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { WithTranslation } from 'react-i18next';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { Ibrand, Ioption, ItableFiltersReducer } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n clearSelectedBrandID,\r\n saveBrand,\r\n updateBrand,\r\n updateSelectedBrand\r\n} from '../../actions/manageBrandActions';\r\nimport { manageBrandQueryParamsEnum } from './ManageBrand';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n fileName: string;\r\n file: string;\r\n}\r\n\r\ninterface Iprops {\r\n closeModal: () => void;\r\n loading: boolean;\r\n colorButton: string;\r\n tableFilters: ItableFiltersReducer;\r\n saveBrand: typeof saveBrand;\r\n updateBrand: typeof updateBrand;\r\n clearSelectedID: typeof clearSelectedBrandID;\r\n queryParams: typeof manageBrandQueryParamsEnum;\r\n onChange: typeof updateSelectedBrand;\r\n selectedBrand: Ibrand;\r\n originalBrand?: Ibrand;\r\n isEditMode: boolean;\r\n}\r\n\r\nclass ManageBrandForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n public form: FormGroup | any;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fileName: '',\r\n file: '',\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.initSelected();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (this.props.selectedBrand !== prevProps.selectedBrand) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n\r\n if (this.props.originalBrand !== prevProps.originalBrand) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.props.originalBrand)\r\n });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.props.clearSelectedID();\r\n }\r\n\r\n buildFieldConfig = (value = this.itemToFormValues()) => {\r\n const { t } = this.props;\r\n const disabled = false;\r\n const imageUrl = value.logo || value.logoPath || this.state?.file || '';\r\n const countryID = value.countryID as string | undefined;\r\n const country = countryID ? constants.countries[countryID] : undefined;\r\n\r\n let countryValue = { value: '', label: '' };\r\n if (country != undefined) {\r\n countryValue = {\r\n value: countryID,\r\n label: country.label\r\n } as Ioption;\r\n }\r\n\r\n const controls = {\r\n name: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('manageBrandForm.name'),\r\n colWidth: 12,\r\n name: 'brand:name'\r\n },\r\n formState: {\r\n value: value.name,\r\n disabled\r\n }\r\n },\r\n url: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.url'),\r\n colWidth: 12,\r\n name: 'brand:url',\r\n placeholder: t('manageBrandForm.urlPlaceholder')\r\n },\r\n formState: {\r\n value: value.url,\r\n disabled\r\n }\r\n },\r\n comments: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.comments'),\r\n colWidth: 12,\r\n name: 'brand:comments',\r\n rows: 5,\r\n componentClass: 'textarea'\r\n },\r\n formState: {\r\n value: value.comments,\r\n disabled\r\n }\r\n },\r\n $field_0: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n },\r\n address: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.address'),\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'address'\r\n },\r\n formState: {\r\n value: value.address,\r\n disabled\r\n }\r\n },\r\n address2: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('manageBrandForm.address2'),\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'address2',\r\n required: false\r\n },\r\n formState: {\r\n value: value.address2,\r\n disabled\r\n }\r\n },\r\n city: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.city'),\r\n colWidth: 5,\r\n type: 'text',\r\n name: 'city'\r\n },\r\n formState: {\r\n value: value.city,\r\n disabled\r\n }\r\n },\r\n state: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.state'),\r\n colWidth: 3,\r\n type: 'text',\r\n name: 'state'\r\n },\r\n formState: {\r\n value: value.state,\r\n disabled\r\n }\r\n },\r\n postalCode: {\r\n options: {\r\n validators: [\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.postalCode'),\r\n colWidth: 4,\r\n name: 'postal-code'\r\n },\r\n formState: {\r\n value: value.postalCode,\r\n disabled\r\n }\r\n },\r\n countryID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:country',\r\n options: FormUtil.convertToOptions(\r\n Object.values(constants.countries)\r\n ),\r\n colWidth: 12,\r\n type: 'select',\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n defaultValue: countryValue,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: countryValue,\r\n disabled\r\n }\r\n },\r\n phoneNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('manageBrandForm.phoneNumber'),\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'phoneNumber'\r\n },\r\n options: {\r\n validators: [Validators.maxLength(50)]\r\n },\r\n formState: {\r\n value: value.phoneNumber,\r\n disabled\r\n }\r\n },\r\n isManufacturer: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n colWidth: 12,\r\n label: t('manageBrandForm.isManufacturer')\r\n },\r\n formState: {\r\n value: value.isManufacturer,\r\n disabled\r\n }\r\n },\r\n file: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n type: 'file',\r\n label: t('manageBrandForm.logo'),\r\n name: 'brand-logo',\r\n icon: 'plus',\r\n colWidth: 12,\r\n accept: 'image/png, image/jpeg',\r\n required: false,\r\n onChange: this.onFileChange,\r\n uploadButton: true,\r\n style: { textAlign: 'left' },\r\n imageUrl,\r\n hasPreview: true\r\n }\r\n },\r\n $field_1: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n <>\r\n \r\n \r\n )\r\n },\r\n reportEmail: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.reportEmail'),\r\n colWidth: 12,\r\n name: 'brand:reportEmail',\r\n placeholder: t('manageBrandForm.reportEmailPlaceholder')\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidEmail]\r\n },\r\n formState: {\r\n value: value.reportEmail,\r\n disabled\r\n }\r\n },\r\n $field_2: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n <>\r\n \r\n \r\n )\r\n },\r\n sendReportToCustomers: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n colWidth: 12\r\n },\r\n formState: {\r\n value: value.sendReportToCustomers,\r\n disabled\r\n }\r\n },\r\n replyToEmail: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: t('manageBrandForm.replyToEamil'),\r\n colWidth: 12,\r\n name: 'brand:replyToEamil',\r\n placeholder: t('manageBrandForm.replyToEamilPlaceholder')\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidEmail]\r\n },\r\n formState: {\r\n value: value.replyToEmail,\r\n disabled\r\n }\r\n }\r\n };\r\n\r\n return FormUtil.translateForm(\r\n {\r\n controls\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n onValueChanges = (value: any, key: string) => {\r\n this.form.patchValue({ [key]: value });\r\n };\r\n\r\n onFileChange = (key: string, file: File) => {\r\n const reader = new FileReader();\r\n\r\n reader.onload = (e: any) => {\r\n this.setState(\r\n { fileName: file.name, file: e.target.result } as any,\r\n () => {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(\r\n this.formValuesToItem()\r\n )\r\n });\r\n }\r\n );\r\n this.onValueChanges(e.target.result, 'logo');\r\n };\r\n\r\n if (file) {\r\n reader.readAsDataURL(file);\r\n }\r\n };\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, check if it matches the selectedItem in redux\r\n * if there is a brand we are editing download any dependencies\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedBrandID &&\r\n this.props.queryParams.selectedBrandID !==\r\n this.props.selectedBrand.id\r\n ) {\r\n const { originalBrand, isEditMode } = this.props;\r\n // is there an existing item from redux\r\n if (originalBrand && isEditMode) {\r\n this.props.onChange(originalBrand);\r\n return;\r\n }\r\n\r\n // the item we are trying to edit has not been loaded. TODO download this item\r\n // since we do not support downloading a single item yet, close the modal\r\n this.props.closeModal();\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedObject and convert it to formValues\r\n */\r\n itemToFormValues = (): IgenericFormValues => {\r\n return this.props.originalBrand ?? this.props.selectedBrand;\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedObject\r\n */\r\n formValuesToItem = (): Ibrand => {\r\n const formValues = FormUtil.getValues(this.form.value);\r\n const brand = this.props.originalBrand ?? this.props.selectedBrand;\r\n return {\r\n ...brand,\r\n ...formValues,\r\n logo: this.state.file\r\n };\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.form.status === 'INVALID') {\r\n this.form.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const updatedBrand = this.formValuesToItem();\r\n // create or update brand\r\n this.props.saveBrand(updatedBrand, this.props.isEditMode);\r\n this.props.closeModal();\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.form = form;\r\n this.form.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const formClassName = `beacon-form location-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default ManageBrandForm;\r\n","import { Ihistory } from '../../models';\r\n\r\nexport const addQuery = (key: string, value: string, history: Ihistory) => {\r\n const query = new URLSearchParams(history.location.search);\r\n query.set(key, value);\r\n history.replace({ ...history.location, search: query.toString() });\r\n};\r\n\r\nexport const hasQuery = (key: string, history: Ihistory) => {\r\n const UrlSearchParams = new URLSearchParams(history.location.search);\r\n return UrlSearchParams.has(key);\r\n};\r\n\r\nexport const removeQuery = (key: string, history: Ihistory) => {\r\n const query = new URLSearchParams(history.location.search);\r\n query.delete(key);\r\n history.replace({ ...history.location, search: query.toString() });\r\n};\r\n","import { initialBrand } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { Ibrand, ImanageBrandReducer } from '../models';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport { pickBy, map, keyBy, filter } from 'lodash';\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\n\r\nexport const getBrands = (state: IinitialState) =>\r\n state.manageBrand.manageBrandsByID;\r\nexport const getSelectedBrand = (state: IinitialState) =>\r\n state.manageBrand.selectedBrand;\r\n\r\nexport const selectBrands = createSelector([getBrands], brands =>\r\n keyBy(filter(brands, { isDeleted: false }), 'id')\r\n);\r\nexport const selectBrand = createSelector(\r\n [getSelectedBrand],\r\n selectedBrand => selectedBrand\r\n);\r\n\r\nconst cleanBrandObject = (brand: Ibrand) => {\r\n return {\r\n ...initialBrand,\r\n ...pickBy(brand, property => property !== null)\r\n } as Ibrand;\r\n};\r\n\r\n/*\r\n * stores the brand currently being edited\r\n */\r\nconst selectedBrandReducer = (state = initialBrand, action: any): Ibrand => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_BRAND: {\r\n return action.payload;\r\n }\r\n case types.REMOVE_BRAND_SUCCESS: {\r\n if (state.id === action.payload) {\r\n return initialBrand;\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.ADD_BRAND_SUCCESS: {\r\n return initialBrand;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\nexport function manageBrandsByID(\r\n state: { [key: string]: Ibrand } = {},\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.LOAD_BRANDS_SUCCESS: {\r\n const newBrands = map(action.payload.result, (brand: Ibrand) => {\r\n return cleanBrandObject(brand);\r\n });\r\n return keyBy(newBrands, 'id');\r\n }\r\n case types.ADD_BRAND_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.EDIT_BRAND_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.REMOVE_BRAND_SUCCESS: {\r\n const data = { ...state };\r\n delete data[action.payload.id];\r\n return data;\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.BRAND_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst brandManage = combineReducers({\r\n manageBrandsByID,\r\n selectedBrand: selectedBrandReducer,\r\n totalPages,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_BRAND')\r\n});\r\n\r\nexport default brandManage;\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { Ibrand, ItableFiltersReducer, Itile } from '../../models';\r\nimport ReactTable, { FinalState, RowInfo } from 'react-table';\r\nimport {\r\n clearSelectedBrandID,\r\n deleteBrand,\r\n getBrands,\r\n setSelectedBrandID,\r\n setTableFilter,\r\n toggleEditBrandModal,\r\n updateSelectedBrand\r\n} from '../../actions/manageBrandActions';\r\nimport queryString from 'query-string';\r\nimport { debounce, orderBy } from 'lodash';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { Button } from 'react-bootstrap';\r\nimport EditBrandModal from './EditBrandModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { addQuery } from '../common/OtherUtils';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile, initialBrand } from '../../reducers/initialState';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface RowInfoBrand extends RowInfo {\r\n original: Ibrand;\r\n}\r\n\r\nexport enum manageBrandQueryParamsEnum {\r\n selectedBrandID = 'selectedBrandID'\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n tableData: Ibrand[];\r\n totalPages: number;\r\n showEditBrandModal: boolean;\r\n getBrands: any;\r\n toggleEditBrandModal: typeof toggleEditBrandModal;\r\n deleteBrand: typeof deleteBrand;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedBrandID: typeof setSelectedBrandID;\r\n clearSelectedBrandID: typeof clearSelectedBrandID;\r\n closeAllModals: typeof closeAllModals;\r\n queryParams: typeof manageBrandQueryParamsEnum;\r\n updateSelectedBrand: typeof updateSelectedBrand;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageBrand extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n searchFieldConfig: this.buildSearchControls()\r\n };\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n this.props.getBrands();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditBrandModal !== this.props.showEditBrandModal &&\r\n !this.props.showEditBrandModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getBrands();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.setTableFilter({ name: '', page: 1 }); // reset table filters when you leave the page\r\n this.props.closeAllModals();\r\n }\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const mainSearchControls = {\r\n name: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:Brand',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'Search by text',\r\n defaultValue: this.props.tableFilters.name,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: this.props.tableFilters.name,\r\n disabled: false\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'name':\r\n this.setTableFilterDebounced({ name: value, page: 1 });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n handleSelectBrand = (id: string) => {\r\n addQuery(\r\n manageBrandQueryParamsEnum.selectedBrandID,\r\n id,\r\n this.props.history\r\n );\r\n };\r\n\r\n /**\r\n * create an empty brand with a new ID so that the ID can go in the query param which will cause the modal to open\r\n */\r\n handleNewBrandClick = () => {\r\n const id = uuidv4();\r\n this.props.updateSelectedBrand({ ...initialBrand, id });\r\n addQuery(\r\n manageBrandQueryParamsEnum.selectedBrandID,\r\n id,\r\n this.props.history\r\n );\r\n };\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n minWidth: 300\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n /*\r\n * Handle user clicking on a location row\r\n * set the selected location to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfoBrand | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n this.setState({ selectedRow: rowInfo.index });\r\n /*\r\n this.props.toggleEditBrandModal();\r\n this.props.setSelectedBrandID(rowInfo.original.id);\r\n */\r\n this.handleSelectBrand(rowInfo.original.id);\r\n return;\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n render() {\r\n const { t, tableData = [], totalPages } = this.props;\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n \r\n {t(`manageBrand:newBrand`)}\r\n \r\n
    \r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const tableData = orderBy(\r\n state.manageBrand.manageBrandsByID,\r\n res => res.name,\r\n 'asc'\r\n );\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageBrandQueryParamsEnum;\r\n return {\r\n tableData,\r\n totalPages: state.manageBrand.totalPages,\r\n showEditBrandModal: queryParams.selectedBrandID?.length > 0,\r\n tableFilters: state.manageBrand.tableFilters,\r\n queryParams\r\n };\r\n};\r\n\r\nexport default withTranslation('manageBrand')(\r\n connect(mapStateToProps, {\r\n getBrands,\r\n toggleEditBrandModal,\r\n deleteBrand,\r\n setTableFilter,\r\n setSelectedBrandID,\r\n clearSelectedBrandID,\r\n closeAllModals,\r\n updateSelectedBrand\r\n })(ManageBrand)\r\n);\r\n","/*\r\n * Manage Brand Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport { updateQueueProduct } from '../../actions/manageProductQueueActions';\r\nimport EditBrandForm from './EditBrandForm';\r\nimport { Ihistory } from '../../models';\r\nimport {\r\n saveBrand,\r\n updateBrand,\r\n toggleEditBrandModal,\r\n clearSelectedBrandID,\r\n updateSelectedBrand\r\n} from '../../actions/manageBrandActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { manageBrandQueryParamsEnum } from './ManageBrand';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport { selectBrand, selectBrands } from '../../reducers/manageBrandReducer';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n queryParams: typeof manageBrandQueryParamsEnum;\r\n history: Ihistory;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n // brand currently being edited, will be defined when adding or editing\r\n const selectedBrand = selectBrand(state);\r\n // will be defined when editing an exisiting brand\r\n const brands = selectBrands(state);\r\n const originalBrand = brands[ownProps.queryParams.selectedBrandID];\r\n const isEditMode = originalBrand?.id.length > 0;\r\n\r\n let title;\r\n if (isEditMode) {\r\n title = ownProps.t(`manageBrand:editBrand`);\r\n } else {\r\n title = ownProps.t(`manageBrand:newBrand`);\r\n }\r\n // define the closeModal function here in mapState so that we can pass it to both the main component and\r\n // to the onHide which is a WithCommonModal HOC prop\r\n // yes it is unusual to pass a function in mapState, but it is ok since it does not need dispatch\r\n const closeModal = () => {\r\n removeQuery(\r\n manageBrandQueryParamsEnum.selectedBrandID,\r\n ownProps.history\r\n );\r\n };\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: ownProps.queryParams.selectedBrandID?.length > 0,\r\n tableFilters: state.manageBrand.tableFilters,\r\n selectedBrand,\r\n originalBrand,\r\n isEditMode,\r\n closeModal,\r\n onHide: closeModal,\r\n title,\r\n className: 'brand-edit'\r\n };\r\n};\r\n\r\nexport default withTranslation('manageBrand')(\r\n connect(mapStateToProps, {\r\n saveBrand,\r\n updateBrand,\r\n toggleModal: toggleEditBrandModal,\r\n onHide: toggleEditBrandModal,\r\n onChange: updateSelectedBrand,\r\n updateQueueProduct,\r\n clearSelectedID: clearSelectedBrandID\r\n })(WithCommonModal(EditBrandForm))\r\n);\r\n","/*\r\n * Edit code Form\r\n * Add and Edit codes\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport {\r\n FormGenerator,\r\n FieldConfig,\r\n FormGroup,\r\n FormArray,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n clearSelectedCodeID,\r\n saveCode,\r\n updateCode\r\n} from '../../actions/manageCodeActions';\r\nimport { IdeficiencyCode, IproductInfo } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { debounce } from 'lodash';\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\n\r\ninterface Iprops {\r\n handleSubmit: typeof saveCode;\r\n handleEdit: typeof updateCode;\r\n handleCancel: any;\r\n loading: boolean;\r\n colorButton: string;\r\n selectedCode: IdeficiencyCode;\r\n clearSelectedCodeID: typeof clearSelectedCodeID;\r\n updateFormValue: (formValue: { [key: string]: any }) => any;\r\n setFormValues: (formValues: { [key: string]: any }) => any;\r\n formValues: { [key: string]: any };\r\n productInfo: IproductInfo;\r\n}\r\n\r\ninterface State {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditCodeForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateFormValueDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n this.updateFormValueDebounced = debounce(\r\n this.props.updateFormValue,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.clearSelectedCodeID();\r\n this.props.setFormValues({});\r\n }\r\n\r\n buildFieldConfig = () => {\r\n const disabled = false;\r\n const { selectedCode, formValues } = this.props;\r\n let { name, description, standardID } = selectedCode;\r\n name = formValues.name ? formValues.name : name;\r\n description = formValues.description\r\n ? formValues.description\r\n : description;\r\n const standardOptions = this.props.productInfo.standardOptions;\r\n const standard = FormUtil.convertToSingleOption(\r\n this.props.productInfo.standards[standardID]\r\n );\r\n\r\n const fieldConfigControls = {\r\n name: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'codeForm.name',\r\n colWidth: 12,\r\n autoFocus: true,\r\n required: true,\r\n name: 'code-name'\r\n },\r\n formState: { value: name, disabled }\r\n },\r\n standard: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: standardOptions,\r\n label: 'common:standard',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'standard',\r\n required: true\r\n },\r\n formState: { value: standard, disabled }\r\n },\r\n description: {\r\n options: {\r\n validators: FormUtil.validators.requiredRichText\r\n },\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'codeForm.description',\r\n colWidth: 12,\r\n name: 'code-description',\r\n required: true,\r\n initialContent: description\r\n },\r\n formState: { value: description, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n this.updateFormValueDebounced({ [key]: value });\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n const { selectedCode } = this.props;\r\n const { name, description, standard } = this.formGroup.value;\r\n const deficiencyCode: Partial = {\r\n name: name || selectedCode.name,\r\n description: description || selectedCode.description,\r\n standardID: standard ? standard.value : selectedCode.standardID\r\n };\r\n\r\n if (this.props.selectedCode.id.length === 0) {\r\n this.props.handleSubmit(deficiencyCode);\r\n } else {\r\n this.props.handleEdit({ ...deficiencyCode, id: selectedCode.id });\r\n }\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditCodeForm;\r\n","/*\r\n * Edit Code Modal and Container\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n saveCode,\r\n updateCode,\r\n toggleEditCodeModal\r\n} from '../../actions/manageCodeActions';\r\nimport EditCodeForm from './EditCodeForm';\r\nimport { initialDeficiencyCode } from '../../reducers/initialState';\r\nimport {\r\n clearSelectedCodeID,\r\n setCodeFormValues,\r\n updateCodeFormValue\r\n} from '../../actions/manageCodeActions';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'edit-code'\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedCode =\r\n state.manageCode.deficiencyCodesByID[state.manageCode.selectedCodeID] ||\r\n initialDeficiencyCode;\r\n\r\n let title;\r\n if (selectedCode && selectedCode.id) {\r\n title = ownProps.t(`editStandardText`);\r\n } else {\r\n title = ownProps.t(`addStandardText`);\r\n }\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageCode.showEditCodeModal,\r\n selectedCode,\r\n formValues: state.manageCode.codeFormValues,\r\n productInfo: state.productInfo,\r\n title\r\n };\r\n};\r\n\r\nexport const EditCodeModal = withTranslation('manageCode')(\r\n connect(mapStateToProps, {\r\n handleCancel: toggleEditCodeModal,\r\n handleSubmit: saveCode,\r\n handleEdit: updateCode,\r\n clearSelectedCodeID,\r\n updateFormValue: updateCodeFormValue,\r\n setFormValues: setCodeFormValues,\r\n onHide: toggleEditCodeModal\r\n })(WithCommonModal(EditCodeForm))\r\n);\r\n","import initialState, { initialDeficiencyCode } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport {\r\n IdeficiencyCode,\r\n ImanageCodeReducer,\r\n ItableFiltersParams\r\n} from '../models';\r\nimport {\r\n createSelectedIDWithName,\r\n createTableFiltersWithName,\r\n modalToggleWithName,\r\n createFormValuesWithName\r\n} from './commonReducers';\r\nimport { pickBy, map, keyBy, filter, orderBy } from 'lodash';\r\nimport { combineReducers } from 'redux';\r\n\r\nconst cleanCodeObject = (code: any) => {\r\n return {\r\n ...initialDeficiencyCode,\r\n ...pickBy(code, property => property !== null)\r\n } as IdeficiencyCode;\r\n};\r\n\r\nexport function deficiencyCodesByID(\r\n state: { [key: string]: IdeficiencyCode } = initialState.manageCode\r\n .deficiencyCodesByID,\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.LOAD_CODES_SUCCESS: {\r\n const newCodes = map(action.payload, (code: IdeficiencyCode) => {\r\n return cleanCodeObject(code);\r\n });\r\n return keyBy(newCodes, 'id');\r\n }\r\n case types.ADD_CODE_SUCCESS: {\r\n return { ...state, [action.payload.id]: action.payload };\r\n }\r\n case types.EDIT_CODE_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.REMOVE_CODE_SUCCESS: {\r\n const data = { ...state };\r\n delete data[action.payload.id];\r\n return data;\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageCode.deficiencyCodesByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.CODE_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageCode = combineReducers({\r\n deficiencyCodesByID,\r\n totalPages,\r\n selectedCodeID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'CODE_ID'),\r\n showEditCodeModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_CODE'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_CODE'),\r\n codeFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_CODE')\r\n});\r\n\r\nexport default manageCode;\r\n\r\n/*\r\n * SELECTORS\r\n */\r\n\r\nexport const selectVisibleDeficiencyCodes = (\r\n state: { [key: string]: IdeficiencyCode },\r\n tableFilters: ItableFiltersParams\r\n) => {\r\n const filteredCodes = filter(state, code => {\r\n let shouldInclude = true;\r\n if (tableFilters.search) {\r\n const searchString = tableFilters.search.trim().toLowerCase();\r\n if (code.name.toLowerCase().indexOf(searchString) === -1) {\r\n shouldInclude = false;\r\n }\r\n }\r\n if (\r\n tableFilters.standard &&\r\n tableFilters.standard.value &&\r\n code.standardID !== tableFilters.standard.value\r\n ) {\r\n shouldInclude = false;\r\n }\r\n return shouldInclude;\r\n });\r\n return orderBy(filteredCodes, res => res.name, 'asc');\r\n};\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport {\r\n ItableFiltersReducer,\r\n Itile,\r\n IdeficiencyCode,\r\n IproductInfo,\r\n Ioption\r\n} from '../../models';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport {\r\n clearSelectedCodeID,\r\n deleteCode,\r\n getCodes,\r\n setSelectedCodeID,\r\n setTableFilter,\r\n toggleEditCodeModal\r\n} from '../../actions/manageCodeActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { Button } from 'react-bootstrap';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile, initialDeficiencyCode } from '../../reducers/initialState';\r\nimport { debounce } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { EditCodeModal } from './EditCodeModal';\r\nimport { selectVisibleDeficiencyCodes } from '../../reducers/manageCodeReducer';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RowInfoCode extends RowInfo {\r\n original: IdeficiencyCode;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n loading: boolean;\r\n}\r\n\r\ninterface IdispatchProps {\r\n tableData: IdeficiencyCode[];\r\n totalPages: number;\r\n showEditCodeModal: boolean;\r\n getCodes: typeof getCodes;\r\n toggleEditCodeModal: typeof toggleEditCodeModal;\r\n deleteCode: typeof deleteCode;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedCodeID: typeof setSelectedCodeID;\r\n clearSelectedCodeID: typeof clearSelectedCodeID;\r\n selectedCode: IdeficiencyCode;\r\n productInfo: IproductInfo;\r\n closeAllModals: typeof closeAllModals;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageCode extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n searchFieldConfig: this.buildSearchControls()\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n this.props.getCodes();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n // If the edit modal was used, call api to refresh data\r\n if (\r\n prevProps.showEditCodeModal !== this.props.showEditCodeModal &&\r\n !this.props.showEditCodeModal\r\n ) {\r\n this.props.getCodes();\r\n this.setState({ selectedRow: null });\r\n }\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const { search, standard } = this.props.tableFilters;\r\n\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'standardTextLibrary',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'Search by name',\r\n isClearable: true\r\n },\r\n formState: { value: search, disabled: false }\r\n },\r\n standard: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: this.props.productInfo.standardOptions,\r\n label: 'standard',\r\n colWidth: 3,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'standard',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: standard,\r\n disabled: false\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n this.setTableFilterDebounced({ [key]: value, page: 0 });\r\n };\r\n\r\n handleEdit(row: any) {\r\n this.setState({ selectedRow: row.index });\r\n this.props.toggleEditCodeModal();\r\n this.props.setSelectedCodeID(row.original.id);\r\n }\r\n\r\n handleDelete(deletedItem: any) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem\r\n };\r\n this.props.deleteCode(deletedItem);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n }\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n minWidth: 300\r\n },\r\n {\r\n id: 'standard',\r\n Header: 'standard',\r\n accessor: ({ standardID }: IdeficiencyCode) => {\r\n const item = this.props.productInfo.standardOptions.filter(\r\n (opt: Ioption) => {\r\n return opt.value === standardID;\r\n }\r\n )[0];\r\n if (item) {\r\n return standardID ? item.label : '';\r\n } else {\r\n return null;\r\n }\r\n },\r\n minWidth: 300\r\n },\r\n {\r\n Header: '',\r\n id: 'delete',\r\n minWidth: 25,\r\n Cell: row => {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoCode | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id && column.id === 'delete') {\r\n return {\r\n onClick: () => this.handleDelete(rowInfo.original)\r\n };\r\n } else if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.handleEdit(rowInfo);\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n onPageSizeChange = (rows: number) => {\r\n this.props.setTableFilter({ rows, page: 0 });\r\n };\r\n\r\n render() {\r\n const { t, tableData = [] } = this.props;\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n {\r\n this.setState({ selectedRow: null }, () => {\r\n this.props.toggleEditCodeModal();\r\n });\r\n }}\r\n >\r\n {t(`manageCode:addStandardText`)}\r\n \r\n
    \r\n \r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n const tableData = selectVisibleDeficiencyCodes(\r\n state.manageCode.deficiencyCodesByID,\r\n state.manageCode.tableFilters\r\n );\r\n const selectedCode =\r\n state.manageCode.deficiencyCodesByID[state.manageCode.selectedCodeID] ||\r\n initialDeficiencyCode;\r\n return {\r\n tableData,\r\n selectedCode,\r\n totalPages: state.manageCode.totalPages,\r\n showEditCodeModal: state.manageCode.showEditCodeModal,\r\n tableFilters: state.manageCode.tableFilters,\r\n productInfo: state.productInfo\r\n };\r\n};\r\n\r\nexport default withTranslation('manageCode')(\r\n connect(mapStateToProps, {\r\n getCodes,\r\n toggleEditCodeModal,\r\n deleteCode,\r\n setTableFilter,\r\n setSelectedCodeID,\r\n clearSelectedCodeID,\r\n closeAllModals\r\n })(ManageCode)\r\n);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n IcontactFacility,\r\n IfacilityContact,\r\n Ioption,\r\n Iuser,\r\n ImanageFacilityReducer\r\n} from '../models';\r\nimport {\r\n createFormValuesWithName,\r\n createSelectedIDWithName,\r\n createShowModalWithNamedType,\r\n createTableFiltersWithName\r\n} from './commonReducers';\r\nimport { keyBy, map, omit, orderBy, pickBy } from 'lodash';\r\n\r\nimport { cleanUser } from './manageUserReducer';\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { initialContact } from './initialState';\r\nimport { IinitialState } from '.';\r\n\r\nconst cleanContactFacilities = (contacts: Array): IcontactFacility[] => {\r\n return map(contacts, (item: any) => {\r\n return {\r\n facilityID: '',\r\n ...pickBy(item, (property, key) => property !== null)\r\n };\r\n });\r\n};\r\n\r\nexport const cleanFacilityContact = (\r\n facilityContact: any\r\n): IfacilityContact => {\r\n const sanitized = omit(facilityContact, ['user']);\r\n return {\r\n ...initialContact,\r\n ...pickBy(sanitized, (property, key) => property !== null),\r\n contactFacilities: cleanContactFacilities(sanitized.contactFacilities)\r\n };\r\n};\r\n\r\n/*\r\n * MANAGE FACILITY SELECTORS\r\n */\r\n\r\nexport const selectUsersAndContactsToOptions = (\r\n usersAndContacts: any\r\n): Ioption[] => {\r\n if (!usersAndContacts) {\r\n return [];\r\n }\r\n return map(usersAndContacts, (item: Iuser | IfacilityContact) => {\r\n return {\r\n value: item.id,\r\n label: item.email || 'unknown'\r\n };\r\n });\r\n};\r\n\r\nexport const selectManageFacilityTableFilters = (state: IinitialState) =>\r\n state.manageFacility.tableFilters;\r\n\r\nexport const selectFacilities = (state: IinitialState) => state.facilities;\r\nexport const selectUser = (state: IinitialState) => state.user;\r\n\r\n// Pre-filtered by CountryID on user's profile\r\n\r\nconst selectFacilityContactsByID = (state: IinitialState) =>\r\n state.manageFacility.contacts;\r\nconst selectUsersByID = (state: IinitialState) => state.manageUser.usersByID;\r\n\r\nexport const selectFacilityContactsForTable = createSelector(\r\n [selectFacilityContactsByID, selectUsersByID],\r\n (facilityContactsByID, usersByID) => {\r\n return orderBy(\r\n map(facilityContactsByID, contact => {\r\n if (contact.userID && contact.userID.length) {\r\n const user = usersByID[contact.userID];\r\n // if related to a user, use the properties from the user rather than the contact\r\n if (user) {\r\n return {\r\n ...contact,\r\n firstName: user.first,\r\n lastName: user.last,\r\n title: user.position,\r\n email: user.email,\r\n phone: user.phone\r\n };\r\n }\r\n }\r\n return contact;\r\n }),\r\n 'lastName'\r\n );\r\n }\r\n);\r\n\r\n/*\r\n * ********** REDUCERS\r\n */\r\n\r\n/**\r\n * MANAGE CONTACT\r\n */\r\nconst contacts = (\r\n state: { [key: string]: IfacilityContact } = {},\r\n action: any\r\n): { [key: string]: IfacilityContact } => {\r\n switch (action.type) {\r\n case types.GET_CONTACTS_BY_FACILITY_SUCCESS:\r\n return {\r\n ...keyBy(\r\n map(action.payload, contact =>\r\n cleanFacilityContact(contact)\r\n ),\r\n 'id'\r\n )\r\n };\r\n case types.LEADS_MANAGE_SUCCESS:\r\n return {\r\n ...keyBy(\r\n map(action.payload, contact =>\r\n cleanFacilityContact(contact)\r\n ),\r\n 'id'\r\n )\r\n };\r\n case types.ADD_CONTACT_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload.id]: {\r\n ...cleanFacilityContact(action.payload)\r\n }\r\n };\r\n case types.DELETE_CONTACT_FACILITY_SUCCESS: {\r\n return omit(state, action.payload);\r\n }\r\n case types.UPDATE_CONTACT_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload.id]: { ...action.payload }\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\n/*\r\n * stores the contact currently being edited\r\n */\r\nconst selectedContactReducer = (\r\n state: IfacilityContact = initialContact,\r\n action: any\r\n): IfacilityContact => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_CONTACT: {\r\n return action.contact;\r\n }\r\n case types.DELETE_CONTACT_FACILITY_SUCCESS: {\r\n if (state.id === action.payload) {\r\n return initialContact;\r\n }\r\n }\r\n case types.ADD_CONTACT_SUCCESS: {\r\n return initialContact;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst foundUsersOrContactsByID = (\r\n state: { [key: string]: Iuser | IfacilityContact } = {},\r\n action: any\r\n): { [key: string]: Iuser | IfacilityContact } => {\r\n switch (action.type) {\r\n case types.FIND_USERS_OR_CONTACT_BY_EMAIL_SUCCESS: {\r\n const cleanedContactsAndFacilities = map(action.payload, item => {\r\n if (item.first) {\r\n return cleanUser(item);\r\n }\r\n return cleanFacilityContact(item);\r\n });\r\n return keyBy(cleanedContactsAndFacilities, 'id');\r\n }\r\n case types.CLEAR_USERS_MATCHED_EMAIL:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\n/**\r\n * MANAGE FACILITY REDUCERS\r\n */\r\nconst manageFacility = combineReducers({\r\n contacts,\r\n selectedContactID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'CONTACT_ID'),\r\n selectedContact: selectedContactReducer,\r\n foundUsersOrContactsByID,\r\n facilityFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_FACILITY'),\r\n facilityContractFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'FACILITY_CONTRACT'),\r\n showFacilityContractModal: createShowModalWithNamedType(\r\n 'FACILITY_CONTRACT'\r\n ),\r\n selectedFacilityID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'FACILITY_ID'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_FACILITY')\r\n});\r\n\r\nexport default manageFacility;\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport {\r\n IeditFacilityFormValues,\r\n IfacilityContractFormValues\r\n} from '../modelsForms';\r\nimport {\r\n IfacilityContact,\r\n IfacilityContract,\r\n ItableFiltersParams,\r\n ThunkResult\r\n} from '../models';\r\nimport { omit, orderBy, unionBy, map } from 'lodash';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport { initialContact } from '../reducers/initialState';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { selectUsersAndContactsToOptions } from '../reducers/manageCustomerAndFacilityReducer';\r\nimport { TFunction } from 'i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\n/*\r\n * the front end is sorting and filtering so we send pagingType none\r\n * the only time this is used is when a user searches by facility name\r\n */\r\n\r\nexport const updateFacilityFormValue = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_FACILITY,\r\n formValues\r\n});\r\nexport const setFacilityFormValues = (\r\n formValues: Partial\r\n) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_FACILITY,\r\n formValues\r\n});\r\n\r\nexport const updateSelectedContact = (\r\n contact: IfacilityContact = initialContact\r\n) => ({\r\n type: types.UPDATE_SELECTED_CONTACT,\r\n contact\r\n});\r\nexport const setSelectedFacilityID = (id: string) => ({\r\n type: types.SET_SELECTED_FACILITY_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedFacilityID = () => ({\r\n type: types.CLEAR_SELECTED_FACILITY_ID\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_FACILITY,\r\n filters\r\n});\r\n\r\nexport const toggleFacilityContractModal = () => ({\r\n type: types.TOGGLE_MODAL_FACILITY_CONTRACT\r\n});\r\n\r\nexport const updateFacilityContract = (\r\n facilityContract: IfacilityContract\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(updateFacilityFormValue({ contract: facilityContract }));\r\n };\r\n};\r\n\r\nexport const updateFacilityContractFormValue = (formValue: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_FACILITY_CONTRACT,\r\n formValue\r\n});\r\nexport const setFacilityContractFormValues = (\r\n formValues: IfacilityContractFormValues\r\n) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_FACILITY_CONTRACT,\r\n formValues\r\n});\r\n\r\nexport const toggleFacilityContactModal = () => ({\r\n type: types.TOGGLE_MODAL_FACILITY_CONTACT\r\n});\r\n\r\nexport const getContactsByFacility = (facilityID: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = API.contact.getByFacility;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { id: facilityID }\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_CONTACTS_BY_FACILITY_SUCCESS,\r\n payload: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_CONTACTS_BY_FACILITY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'getContactsByFacility');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\nexport const findUserOrContactByEmail = (search: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = API.contact.findUserOrContactByEmail;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { search }\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const contactsWithEmail = map(\r\n data.data.contacts,\r\n contact => {\r\n if (\r\n contact.userID &&\r\n contact.userID.length &&\r\n contact.user\r\n ) {\r\n const user = contact.user;\r\n return {\r\n ...contact,\r\n firstName: user.first,\r\n lastName: user.last,\r\n title: user.position,\r\n email: user.email,\r\n phone: user.phone\r\n };\r\n } else {\r\n return contact;\r\n }\r\n }\r\n );\r\n const combined = unionBy(\r\n contactsWithEmail,\r\n data.data.users,\r\n 'email'\r\n );\r\n dispatch({\r\n type: types.FIND_USERS_OR_CONTACT_BY_EMAIL_SUCCESS,\r\n payload: combined\r\n });\r\n const options = selectUsersAndContactsToOptions(combined);\r\n const sortedOptions = orderBy(options, 'label');\r\n return sortedOptions;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.FIND_USERS_OR_CONTACT_BY_EMAIL_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'getContactsByFacility');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\nexport const clearUsersThatMachedEmail = () => ({\r\n type: types.CLEAR_USERS_MATCHED_EMAIL\r\n});\r\n\r\nexport const setSelectedContactID = (id: string): ThunkResult => {\r\n return dispatch => {\r\n dispatch(clearUsersThatMachedEmail());\r\n dispatch({ type: types.SET_SELECTED_CONTACT_ID, id });\r\n };\r\n};\r\n\r\nexport const mergeFacilitiesAPI = async (\r\n primaryFacilityID: string,\r\n secondaryFacilityIDs: string[]\r\n) => {\r\n beginAjaxCall();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n primaryFacilityID,\r\n secondaryFacilityIDs\r\n }\r\n };\r\n const url = API.POST.facility.merge;\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n endAjaxCall();\r\n\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n return true;\r\n }\r\n })\r\n .catch((error: any) => {\r\n console.error(error);\r\n endAjaxCall();\r\n return false;\r\n });\r\n};\r\n\r\n/*\r\n * addContactToFacility\r\n */\r\n\r\nexport const addContactToFacility = (\r\n contact: IfacilityContact,\r\n facilityID: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n if (contact.id.length) {\r\n dispatch(\r\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\r\n addContactFacility(contact, facilityID)\r\n );\r\n return Promise.resolve(contact.id);\r\n } else {\r\n dispatch(beginAjaxCall());\r\n const cleanedContact = omit(contact, 'id');\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: cleanedContact\r\n };\r\n const url = API.contact.add;\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.ADD_CONTACT_SUCCESS,\r\n payload: data.data\r\n });\r\n return data.data as IfacilityContact;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.ADD_CONTACT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'addContactToFacility');\r\n console.error(error);\r\n });\r\n }\r\n };\r\n};\r\n\r\nexport const clearSelectedContactID = () => ({\r\n type: types.CLEAR_SELECTED_CONTACT_ID\r\n});\r\n\r\nexport const deleteFacilityFromContact = (\r\n contactID: string,\r\n facilityID: string,\r\n t: TFunction\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const onOk = () => {\r\n dispatch(beginAjaxCall());\r\n const url = API.contact.deleteFacility.replace('{id}', contactID);\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n params: FormUtil.toUrlSearchParams({ facilityId: facilityID })\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n dispatch({\r\n type: types.DELETE_CONTACT_FACILITY_SUCCESS,\r\n payload: contactID\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.DELETE_CONTACT_FACILITY_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'deleteContactFromFacility');\r\n console.error(error);\r\n });\r\n };\r\n const toastrConfirmOptions = {\r\n onOk,\r\n onCancel: () => console.info('CANCEL clicked'),\r\n okText: t('facilityContactForm.tableOkButton'),\r\n cancelText: t('facilityContactForm.tableCancelButton')\r\n };\r\n toastr.confirm(\r\n t('facilityContactForm.deleteContactsConfirmTitle'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n};\r\n\r\nexport const updateContactFromFacility = (\r\n contact: IfacilityContact\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const url = `${API.contact.update}/${contact.id}`;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: { ...contact, contactFacilities: [] } // TODO we can remove contactFacilities everywhere since the front end is no longer maintaining these\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.UPDATE_CONTACT_SUCCESS,\r\n payload: contact\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.UPDATE_CONTACT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'updateContactFromFacility');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\nexport const addContactFacility = (\r\n contact: IfacilityContact,\r\n facilityID: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = API.contact.addFacility.replace('{id}', contact.id);\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n params: FormUtil.toUrlSearchParams({ facilityId: facilityID })\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n dispatch({\r\n type: types.UPDATE_CONTACT_SUCCESS,\r\n payload: contact\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.UPDATE_CONTACT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'updateContactFromFacility');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n","import * as React from 'react';\r\nimport { FormGroup, ControlLabel, Button, Col } from 'react-bootstrap';\r\nimport { FormUtil } from './FormUtil';\r\n\r\n// interface Imeta extends IbaseFormMeta {\r\n// toggleModal: () => void;\r\n// t: TFunction;\r\n// buttonLabel: string;\r\n// colorButton: string;\r\n// }\r\ninterface Iprops {\r\n meta: any;\r\n handler: any;\r\n pristine: boolean;\r\n errors: any;\r\n submitted: boolean;\r\n}\r\n\r\nexport const FacilityContactControl = (props: Iprops) => {\r\n const addPart = () => {\r\n props.meta.toggleModal();\r\n };\r\n\r\n const { pristine, errors, submitted } = props;\r\n return props.meta.remove ? null : (\r\n \r\n \r\n {props.meta.label}\r\n\r\n \r\n {props.meta.buttonLabel}\r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { FormGroup, ControlLabel, Button, Col } from 'react-bootstrap';\r\nimport { IfacilityContract } from '../../models';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n myMedGasContractEnum,\r\n inspectionContractEnum\r\n} from '../../models-enums';\r\n\r\n// interface Imeta extends IbaseFormMeta {\r\n// toggleModal: () => void;\r\n// t: TFunction;\r\n// buttonLabel: string;\r\n// colorButton: string;\r\n// }\r\ninterface Iprops {\r\n meta: any;\r\n handler: any;\r\n pristine: boolean;\r\n errors: any;\r\n submitted: boolean;\r\n}\r\n\r\nexport const FacilityContractControl = (props: Iprops) => {\r\n const addPart = () => {\r\n props.meta.toggleModal();\r\n };\r\n\r\n const { pristine, errors, submitted } = props;\r\n const { t } = props.meta;\r\n const contract = props.handler().value as IfacilityContract;\r\n\r\n const myMedGasContract = contract.myMedGasContract\r\n ? props.meta.t(myMedGasContractEnum[contract.myMedGasContract])\r\n : '';\r\n const inspectionContract = contract.inspectionContract\r\n ? props.meta.t(inspectionContractEnum[contract.inspectionContract])\r\n : '';\r\n return (\r\n \r\n \r\n {props.meta.label}\r\n\r\n {contract && (\r\n
    \r\n

    \r\n MyMedGas: {myMedGasContract}\r\n

    \r\n

    \r\n Inspection: {inspectionContract}\r\n

    \r\n
    \r\n )}\r\n {!contract &&
    {t('facilityForm.noContracts')}
    }\r\n \r\n {props.meta.buttonLabel}\r\n \r\n \r\n \r\n );\r\n};\r\n","/*\r\n * Edit Facility Form\r\n * Add and Edit facilities\r\n *\r\n */\r\n\r\nimport { omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\n\r\nimport { closeAllModals, deleteFacility } from '../../actions/commonActions';\r\nimport { updateFacilityContract } from '../../actions/manageFacilityActions';\r\nimport { getFSEUsers } from '../../actions/manageJobActions';\r\nimport {\r\n Ifacility,\r\n IfacilityContract,\r\n IfacilityWithoutBuildings,\r\n Ioption,\r\n IproductInfo,\r\n Iuser\r\n} from '../../models';\r\nimport { facilitySiteSizeEnum } from '../../models-enums';\r\nimport { IeditFacilityFormValues } from '../../modelsForms';\r\nimport { FacilityContactControl } from './FacilityContactControl';\r\nimport { FacilityContractControl } from './FacilityContractControl';\r\nimport { FormUtil } from './FormUtil';\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\n\r\ninterface Iprops {\r\n handleSubmit: (facility: IfacilityWithoutBuildings) => void;\r\n handleEdit: (facility: IfacilityWithoutBuildings) => void;\r\n toggleModal: () => void;\r\n clearSelectedFacilityID: () => void;\r\n loading: boolean;\r\n colorButton: string;\r\n isFacilityContactModalOpen: boolean;\r\n isFacilityContractModalOpen: boolean;\r\n updateFormValue: (formValue: { [key: string]: any }) => void;\r\n setFormValues: (formValues: IeditFacilityFormValues) => void;\r\n updateFacilityContract: typeof updateFacilityContract;\r\n formValues: IeditFacilityFormValues;\r\n selectedFacility?: Ifacility;\r\n selectedFacilityContract?: IfacilityContract;\r\n fseOptions: Ioption[];\r\n productInfo: IproductInfo;\r\n getProductInfo: () => void;\r\n selectedLeadFSE: Iuser;\r\n deleteFacility: typeof deleteFacility;\r\n disabled?: boolean;\r\n fseUsersByID: { [key: string]: Iuser };\r\n getFSEUsers: typeof getFSEUsers;\r\n user: Iuser;\r\n toggleFacilityContractModal: () => void;\r\n toggleFacilityContactModal: () => void;\r\n closeAllModals: typeof closeAllModals;\r\n approveMode: boolean;\r\n searchForFacility: (facilityID: string) => void;\r\n showSearchFacilityModal?: boolean;\r\n refreshTable: () => void;\r\n}\r\n\r\ninterface IState {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditFacilityForm extends React.Component<\r\n Iprops & WithTranslation,\r\n IState\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private debounce: any;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n this.formGroup = undefined;\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.clearSelectedFacilityID();\r\n this.props.setFormValues({});\r\n this.cleanForm();\r\n }\r\n\r\n componentDidMount() {\r\n this.props.getFSEUsers();\r\n if (this.props.selectedFacility && this.props.selectedFacility.id) {\r\n this.props.setFormValues(this.itemToFormValues());\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n }\r\n if (this.props.selectedFacilityContract) {\r\n this.props.updateFacilityContract(\r\n this.props.selectedFacilityContract\r\n );\r\n }\r\n // manage users does not retrieve productInfo. We need the productInfo.standards so we get product info here\r\n if (this.props.productInfo.standardOptions.length === 0) {\r\n this.props.getProductInfo();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n this.props.productInfo.standardOptions.length !==\r\n prevProps.productInfo.standardOptions.length\r\n ) {\r\n if (this.props.selectedFacility && this.props.selectedFacility.id) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n } else {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n }\r\n\r\n if (this.props.formValues.contract !== prevProps.formValues.contract) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IeditFacilityFormValues => {\r\n if (!this.props.selectedFacility) {\r\n throw new Error('missing selected facility');\r\n }\r\n const { selectedLeadFSE } = this.props;\r\n const sanitizedFacility = omit(this.props.selectedFacility, [\r\n 'buildings'\r\n ]);\r\n const { productInfo, selectedFacility } = this.props;\r\n const selectedCountry = constants.countries[selectedFacility.countryID];\r\n const countryIDOption = selectedCountry || { value: '', label: '' };\r\n\r\n const selectedStandardOption = FormUtil.convertToSingleOption(\r\n productInfo.standards[selectedFacility.standardID]\r\n ) || { value: '', label: '' };\r\n\r\n let selectedSiteSize,\r\n selectedInspectionProvider,\r\n selectedMaintenanceProvider,\r\n selectedAGSLEVProvider,\r\n selectedEnvironmentalTestProvider,\r\n selectedAuthorizedCompany,\r\n selectedManagedByID;\r\n if (selectedFacility.siteSize) {\r\n selectedSiteSize = {\r\n label: this.props.t(\r\n facilitySiteSizeEnum[selectedFacility.siteSize]\r\n ),\r\n value: selectedFacility.siteSize\r\n };\r\n }\r\n\r\n if (selectedFacility.inspectionProviderID) {\r\n selectedInspectionProvider =\r\n productInfo.brands[selectedFacility.inspectionProviderID];\r\n }\r\n\r\n if (selectedFacility.maintenanceProviderID) {\r\n selectedMaintenanceProvider =\r\n productInfo.brands[selectedFacility.maintenanceProviderID];\r\n }\r\n\r\n if (selectedFacility.agslevProviderID) {\r\n selectedAGSLEVProvider =\r\n productInfo.brands[selectedFacility.agslevProviderID];\r\n }\r\n\r\n if (selectedFacility.environmentalTestProviderID) {\r\n selectedEnvironmentalTestProvider =\r\n productInfo.brands[\r\n selectedFacility.environmentalTestProviderID\r\n ];\r\n }\r\n\r\n if (selectedFacility.authorizedCompanyID) {\r\n selectedAuthorizedCompany =\r\n productInfo.brands[selectedFacility.authorizedCompanyID];\r\n }\r\n if (selectedFacility.managedByID) {\r\n selectedManagedByID =\r\n productInfo.brands[selectedFacility.managedByID];\r\n }\r\n\r\n return {\r\n ...sanitizedFacility,\r\n countryID: countryIDOption,\r\n standardID: selectedStandardOption,\r\n siteSize: selectedSiteSize,\r\n managedByID: FormUtil.convertToSingleOption(selectedManagedByID),\r\n leadFSEID: FormUtil.convertToSingleOption(selectedLeadFSE),\r\n inspectionProviderID: FormUtil.convertToSingleOption(\r\n selectedInspectionProvider\r\n ),\r\n maintenanceProviderID: FormUtil.convertToSingleOption(\r\n selectedMaintenanceProvider\r\n ),\r\n agslevProviderID: FormUtil.convertToSingleOption(\r\n selectedAGSLEVProvider\r\n ),\r\n environmentalTestProviderID: FormUtil.convertToSingleOption(\r\n selectedEnvironmentalTestProvider\r\n ),\r\n authorizedCompanyID: FormUtil.convertToSingleOption(\r\n selectedAuthorizedCompany\r\n )\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (): IfacilityWithoutBuildings => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n\r\n const sanitizedFacility = omit(this.props.selectedFacility, [\r\n 'buildings'\r\n ]);\r\n const cleanedFormValues = omit(formValues, 'contact');\r\n\r\n return {\r\n ...sanitizedFacility,\r\n ...cleanedFormValues\r\n };\r\n };\r\n\r\n canManageContacts = () => {\r\n return constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.AllowAllCustomers.id\r\n ]);\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IeditFacilityFormValues = this.props.formValues\r\n ) => {\r\n const disabled = this.props.disabled || false;\r\n const isSAP = this.props.selectedFacility?.sapFacilityNumber\r\n ? true\r\n : false;\r\n const { productInfo } = this.props;\r\n\r\n const countryOptions = constants.countries;\r\n\r\n // State dropdown's disabled state is set by the props by default\r\n let isStateRequired = false;\r\n\r\n // Postal code is only required for U.S., Canada, UK, and Germany\r\n let isPostalCodeRequired = false;\r\n\r\n // Set default country\r\n const country: any = defaultValues.countryID;\r\n let countryID = '';\r\n\r\n // If no country was passed in, let's use the one assigned to the current user\r\n if (country === undefined) {\r\n countryID = this.props.user.countryID;\r\n } else {\r\n // Make sure this country object has a property called value, which should be the country ID\r\n if (country.value) {\r\n countryID = country.value;\r\n }\r\n }\r\n\r\n const selectedCountry = constants.countries[countryID];\r\n const countryIDOption = selectedCountry || { value: '', label: '' };\r\n\r\n // State drop down is only allowed for U.S., Canada, Malaysia\r\n if (\r\n countryID === constants.usCountryID ||\r\n countryID === constants.canadaCountryID\r\n ) {\r\n isStateRequired = true;\r\n }\r\n\r\n if (\r\n countryID === constants.usCountryID ||\r\n countryID === constants.ukCountryID ||\r\n countryID === constants.canadaCountryID ||\r\n countryID === constants.germanyCountryID.toLowerCase()\r\n ) {\r\n isPostalCodeRequired = true;\r\n }\r\n\r\n const fieldConfigControls = {\r\n name: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.nameLabel',\r\n colWidth: 12,\r\n name: 'fac-name'\r\n },\r\n formState: { value: defaultValues.name, disabled: isSAP }\r\n },\r\n name2: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.name2Label',\r\n colWidth: 12,\r\n name: 'fac-name2'\r\n },\r\n formState: { value: defaultValues.name2, disabled: isSAP }\r\n },\r\n standardID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.standardOptions,\r\n label: 'standard',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'standard',\r\n required: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: defaultValues.standardID,\r\n disabled\r\n }\r\n },\r\n address: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:address',\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'address'\r\n },\r\n formState: { value: defaultValues.address, disabled: isSAP }\r\n },\r\n address2: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:address2',\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'address2',\r\n required: false\r\n },\r\n formState: { value: defaultValues.address2, disabled: isSAP }\r\n },\r\n city: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:city',\r\n colWidth: 5,\r\n type: 'text',\r\n name: 'city'\r\n },\r\n formState: { disabled: isSAP, value: defaultValues.city }\r\n },\r\n state: {\r\n options: {\r\n validators: isStateRequired\r\n ? [FormUtil.validators.requiredWithTrim]\r\n : []\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:state',\r\n colWidth: 3,\r\n type: 'text',\r\n name: 'state',\r\n required: isStateRequired\r\n },\r\n formState: {\r\n value: defaultValues.state,\r\n disabled: isSAP\r\n }\r\n },\r\n postalCode: {\r\n options: {\r\n validators: isPostalCodeRequired\r\n ? [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]\r\n : [\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'user:zip',\r\n colWidth: 4,\r\n type: 'tel',\r\n name: 'postal-code',\r\n required: isPostalCodeRequired\r\n },\r\n formState: {\r\n value: defaultValues.postalCode,\r\n disabled: isSAP\r\n }\r\n },\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countryOptions,\r\n label: 'user:country',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: {\r\n value: countryIDOption,\r\n disabled: isSAP\r\n }\r\n },\r\n sapFacilityNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.sapFacilityNumber',\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'sapFacilityNumber',\r\n required: false\r\n },\r\n formState: { disabled, value: defaultValues.sapFacilityNumber }\r\n },\r\n preventativeMaintenanceEnabled: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'facilityForm.preventativeMaintenanceEnabled',\r\n colWidth: 12\r\n },\r\n formState: {\r\n value: defaultValues.preventativeMaintenanceEnabled,\r\n disabled\r\n }\r\n },\r\n $field_0: {\r\n isStatic: false,\r\n render: () =>\r\n this.props.selectedFacility?.id ? (\r\n \r\n ) : null\r\n },\r\n contact: {\r\n render: FacilityContactControl,\r\n meta: {\r\n buttonLabel: this.props.t(\r\n 'facilityContactForm.manageContactsButton'\r\n ),\r\n colWidth: 12,\r\n colorButton: this.props.colorButton,\r\n toggleModal: this.props.toggleFacilityContactModal,\r\n remove: !this.props.selectedFacility?.id\r\n },\r\n formState: {\r\n value: defaultValues.contact,\r\n disabled: !this.canManageContacts()\r\n }\r\n },\r\n $field_1: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n siteSize: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n facilitySiteSizeEnum\r\n ),\r\n label: 'facilityForm.siteSize',\r\n colWidth: 12,\r\n name: 'site-size',\r\n required: false,\r\n isClearable: true,\r\n shouldTranslate: true,\r\n disableSort: true\r\n },\r\n formState: { disabled, value: defaultValues.siteSize }\r\n },\r\n managedByID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'facilityForm.managedBy',\r\n colWidth: 12,\r\n isClearable: true,\r\n name: 'managed-by',\r\n required: false,\r\n options: productInfo.brandOptions\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: { value: defaultValues.managedByID, disabled }\r\n },\r\n leadFSEID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.props.fseOptions,\r\n label: 'facilityForm.leadFSE',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'lead-fse',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.leadFSEID,\r\n disabled\r\n }\r\n },\r\n type: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.facilityType',\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'type',\r\n required: false\r\n },\r\n formState: { value: defaultValues.type, disabled }\r\n },\r\n mgpsSite: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'facilityForm.mgpsSite', colWidth: 6 },\r\n formState: { value: defaultValues.mgpsSite, disabled }\r\n },\r\n inspectionProviderID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'facilityForm.inspectionProvider',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'inspection-provider',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.inspectionProviderID,\r\n disabled\r\n }\r\n },\r\n maintenanceProviderID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'facilityForm.maintenanceProvider',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'maintanence-provider',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.maintenanceProviderID,\r\n disabled\r\n }\r\n },\r\n agslevProviderID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'facilityForm.agslevProvider',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'ags-lev-provider',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.agslevProviderID,\r\n disabled\r\n }\r\n },\r\n environmentalTestProviderID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'facilityForm.environmentalTestsProvider',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'environmental-tests-provider',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.environmentalTestProviderID,\r\n disabled\r\n }\r\n },\r\n authorizedCompanyID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.brandOptions,\r\n label: 'facilityForm.authorizedCompany',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'authorized-company',\r\n required: false,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: defaultValues.authorizedCompanyID,\r\n disabled\r\n }\r\n },\r\n authorizedPerson: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.authorizedPerson',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'authorized-person',\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(80)]\r\n },\r\n formState: { value: defaultValues.authorizedPerson, disabled }\r\n },\r\n website: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityForm.website',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'website',\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(1000)]\r\n },\r\n formState: { value: defaultValues.website, disabled }\r\n },\r\n comments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'common:comments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 5,\r\n name: 'comments',\r\n initialContent: defaultValues.comments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(1000)]\r\n },\r\n formState: { value: defaultValues.comments, disabled }\r\n },\r\n contract: {\r\n render: FacilityContractControl,\r\n meta: {\r\n label: 'facilityForm.contracts',\r\n buttonLabel: this.props.t(\r\n 'facilityForm.manageContractsButton'\r\n ),\r\n colWidth: 12,\r\n colorButton: this.props.colorButton,\r\n toggleModal: this.props.toggleFacilityContractModal,\r\n t: this.props.t\r\n },\r\n formState: { value: defaultValues.contract, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n let fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n\r\n fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'countryID':\r\n this.onCountryChanges(value);\r\n break;\r\n default:\r\n clearTimeout(this.debounce);\r\n this.debounce = setTimeout(() => {\r\n this.props.updateFormValue({ [key]: value });\r\n }, 200);\r\n break;\r\n }\r\n };\r\n\r\n onCountryChanges = (value: any) => {\r\n const stateFormControl = this.formGroup.get('state');\r\n const postalCodeFormControl = this.formGroup.get('postalCode');\r\n stateFormControl.clearValidators();\r\n postalCodeFormControl.clearValidators();\r\n\r\n // State\r\n if (\r\n value &&\r\n value.value &&\r\n (value.value === constants.usCountryID ||\r\n value.value === constants.canadaCountryID)\r\n ) {\r\n stateFormControl.setValidators([\r\n FormUtil.validators.requiredWithTrim\r\n ]);\r\n stateFormControl.meta.required = true;\r\n stateFormControl.patchValue(null);\r\n this.props.updateFormValue({ state: '' });\r\n } else {\r\n stateFormControl.meta.required = false;\r\n this.props.updateFormValue({ state: '' });\r\n stateFormControl.patchValue(null);\r\n }\r\n\r\n // Postal Code\r\n if (\r\n value &&\r\n value.value &&\r\n (value.value === constants.usCountryID ||\r\n value.value === constants.ukCountryID ||\r\n value.value === constants.canadaCountryID ||\r\n value.value === constants.germanyCountryID)\r\n ) {\r\n postalCodeFormControl.setValidators([\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.pattern(\r\n /^[a-zA-Z0-9][a-zA-Z0-9\\- ]{0,10}[a-zA-Z0-9]$/\r\n )\r\n ]);\r\n postalCodeFormControl.meta.required = true;\r\n postalCodeFormControl.patchValue(null);\r\n this.props.updateFormValue({ postalCode: '' });\r\n } else {\r\n postalCodeFormControl.meta.required = false;\r\n this.props.updateFormValue({ postalCode: '' });\r\n postalCodeFormControl.patchValue(null);\r\n }\r\n };\r\n\r\n canUseSAP = (countryID: string): boolean => {\r\n if (\r\n countryID === constants.usCountryID ||\r\n countryID === constants.canadaCountryID\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n handleSubmit = (\r\n e: React.MouseEvent,\r\n shouldApprove = false\r\n ) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n let facilityToUpdate = this.formValuesToItem();\r\n\r\n (Object.keys(\r\n facilityToUpdate\r\n ) as (keyof IfacilityWithoutBuildings)[]).forEach(key => {\r\n if (key.includes('ID') && facilityToUpdate[key] == '') {\r\n facilityToUpdate = {\r\n ...facilityToUpdate,\r\n [key]: null\r\n };\r\n }\r\n });\r\n\r\n if (this.props.selectedFacility && this.props.selectedFacility.id) {\r\n if (shouldApprove) {\r\n // If approving a facility, SAP facility number is required\r\n // Right now, only U.S. and Canada is using SAP\r\n\r\n facilityToUpdate.isApproved = true;\r\n }\r\n this.props.handleEdit({\r\n ...facilityToUpdate,\r\n contract: facilityToUpdate.contract\r\n ? {\r\n ...facilityToUpdate.contract,\r\n facilityID: this.props.selectedFacility?.id ?? ''\r\n }\r\n : undefined\r\n });\r\n\r\n this.props.refreshTable();\r\n } else {\r\n this.props.handleSubmit(facilityToUpdate);\r\n }\r\n };\r\n\r\n handleDelete = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.deleteFacility();\r\n this.props.refreshTable();\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n cleanForm = () => {\r\n if (this.formGroup) {\r\n this.formGroup.reset();\r\n }\r\n };\r\n\r\n closeModals = () => {\r\n this.props.toggleModal();\r\n\r\n if (this.props.isFacilityContactModalOpen) {\r\n this.props.toggleFacilityContactModal();\r\n }\r\n\r\n if (this.props.isFacilityContractModalOpen) {\r\n this.props.toggleFacilityContractModal();\r\n }\r\n };\r\n\r\n openSearchFacilityModal = () => {\r\n this.props.searchForFacility(\r\n this.props.selectedFacility ? this.props.selectedFacility.id : ''\r\n );\r\n };\r\n\r\n render() {\r\n const { t, showSearchFacilityModal } = this.props;\r\n\r\n const deleteButtonStyle =\r\n this.props.selectedFacility && this.props.selectedFacility.id\r\n ? { marginRight: '15px' }\r\n : { marginRight: '15px', display: 'none' };\r\n return (\r\n <>\r\n {this.props.approveMode && (\r\n
    \r\n \r\n Search for existing Facility\r\n \r\n
    \r\n )}\r\n \r\n \r\n \r\n {showSearchFacilityModal !== true && (\r\n {\r\n this.closeModals();\r\n this.props.setFormValues({});\r\n }}\r\n >\r\n {t('cancel')}\r\n \r\n )}\r\n {this.props.disabled !== true &&\r\n this.props.approveMode === false && (\r\n
    \r\n \r\n {t('common:delete')}\r\n \r\n \r\n {t('save')}\r\n \r\n
    \r\n )}\r\n {this.props.approveMode === true && (\r\n
    \r\n \r\n {t('save')}\r\n \r\n\r\n \r\n this.handleSubmit(evt, true)\r\n }\r\n disabled={this.props.loading}\r\n style={{ marginLeft: '10px' }}\r\n >\r\n {t('saveAndApprove')}\r\n \r\n
    \r\n )}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default EditFacilityForm;\r\n","/*\r\n * Edit Facility Modal\r\n * responsible for editing a facility\r\n * this modal is rendered inside the UserQueueForm component because we pass the selectedCustomer\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport { Ifacility } from '../../models';\r\nimport {\r\n addFacility,\r\n toggleEditFacilityModal,\r\n updateFacility,\r\n deleteFacility\r\n} from '../../actions/commonActions';\r\nimport EditFacilityForm from './EditFacilityForm';\r\nimport {\r\n clearSelectedFacilityID,\r\n setFacilityFormValues,\r\n updateFacilityFormValue,\r\n toggleFacilityContractModal,\r\n toggleFacilityContactModal,\r\n updateFacilityContract\r\n} from '../../actions/manageFacilityActions';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { getFSEUsers } from '../../actions/manageJobActions';\r\nimport {\r\n selectActiveFseUsersByID,\r\n selectFseUserOptions\r\n} from '../../reducers/manageJobReducer';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from './WithCommonModal';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport {\r\n selectIsFacilityContactModalOpen,\r\n selectIsFacilityContractModalOpen,\r\n selectIsLoading\r\n} from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { initialUser } from '../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n modalClass?: string;\r\n selectedFacility?: Ifacility;\r\n secondModal?: boolean;\r\n disabled?: boolean;\r\n approveMode: boolean;\r\n searchForFacility: (facilityID: string) => void;\r\n showSearchFacilityModal?: boolean;\r\n refreshTable: () => void;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'edit-faciity',\r\n wideModal: true\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { facilities, productInfo } = state;\r\n const fseUsersByID = selectActiveFseUsersByID(state);\r\n const { selectedFacility, t, disabled, showSearchFacilityModal } = ownProps;\r\n let title = '';\r\n let selectedLeadFSE = initialUser;\r\n let selectedFacilityContract;\r\n\r\n if (disabled) {\r\n title = t('facility:viewFacility');\r\n } else {\r\n if (selectedFacility && selectedFacility.name) {\r\n title = t('facility:editFacility');\r\n selectedFacilityContract =\r\n facilities[selectedFacility.id]?.contract;\r\n if (selectedFacility.leadFSEID) {\r\n selectedLeadFSE =\r\n state.manageJob.fseUsersByID[selectedFacility.leadFSEID];\r\n }\r\n } else {\r\n title = t('facility:newFacility');\r\n }\r\n }\r\n\r\n return {\r\n ...defaultProps,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.showEditFacilityModal,\r\n formValues: state.manageFacility.facilityFormValues,\r\n productInfo,\r\n fseUsersByID,\r\n fseOptions: selectFseUserOptions(state),\r\n selectedLeadFSE,\r\n title,\r\n isFacilityContactModalOpen: selectIsFacilityContactModalOpen(state),\r\n isFacilityContractModalOpen: selectIsFacilityContractModalOpen(state),\r\n showSearchFacilityModal,\r\n selectedFacilityContract\r\n };\r\n};\r\n\r\nexport default withTranslation('facility')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleEditFacilityModal,\r\n handleSubmit: addFacility,\r\n handleEdit: updateFacility,\r\n updateFormValue: updateFacilityFormValue,\r\n updateFacilityContract,\r\n setFormValues: setFacilityFormValues,\r\n clearSelectedFacilityID,\r\n onHide: toggleEditFacilityModal,\r\n getProductInfo,\r\n deleteFacility,\r\n getFSEUsers,\r\n toggleFacilityContractModal,\r\n toggleFacilityContactModal,\r\n closeAllModals\r\n })(WithCommonModal(EditFacilityForm))\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { Col, DropdownButton, MenuItem } from 'react-bootstrap';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { deleteFacilityFromContact } from '../../actions/manageFacilityActions';\r\nimport { IfacilityContact } from '../../models';\r\nimport { RowInfo } from 'react-table';\r\ninterface RowInfoEdited extends RowInfo {\r\n original: IfacilityContact;\r\n}\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n deleteFacilityFromContact: typeof deleteFacilityFromContact;\r\n handleSelectContactEdit: (rowInfo: RowInfoEdited) => void;\r\n addContactLead?: (contact: IfacilityContact) => void;\r\n rowInfo: RowInfoEdited;\r\n facilityID: string;\r\n}\r\n\r\nexport const ContactActionButton = (props: Iprops) => {\r\n const { t, rowInfo, facilityID, colorButton } = props;\r\n const sapSource = rowInfo.original.source === 1;\r\n const onSelect = (eventKey: any) => {\r\n switch (eventKey) {\r\n case 1:\r\n props.deleteFacilityFromContact(\r\n rowInfo.original.id,\r\n facilityID,\r\n t\r\n );\r\n break;\r\n case 2:\r\n props.handleSelectContactEdit(rowInfo);\r\n break;\r\n case 3:\r\n if (props.addContactLead !== undefined) {\r\n props.addContactLead(rowInfo.original);\r\n }\r\n default:\r\n break;\r\n }\r\n };\r\n return (\r\n \r\n \r\n {props.addContactLead !== undefined && (\r\n \r\n {t('facilityContactForm.select')}\r\n \r\n )}\r\n \r\n {t('facilityContactForm.edit')}\r\n \r\n \r\n {t('facilityContactForm.delete')}\r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nimport { IfacilityContact, Itile } from '../../models';\r\nimport ReactTable, { FinalState, RowInfo } from 'react-table';\r\nimport {\r\n deleteFacilityFromContact,\r\n updateSelectedContact\r\n} from '../../actions/manageFacilityActions';\r\n\r\nimport { ContactActionButton } from './ContactActionButton';\r\nimport { TFunction } from 'i18next';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { constants } from '../../constants/constants';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n tableData: Array;\r\n loading: boolean;\r\n currentTile: Itile;\r\n facilityID: string;\r\n selectedContactID: string;\r\n colorButton: string;\r\n deleteFacilityFromContact: typeof deleteFacilityFromContact;\r\n updateSelectedContact: typeof updateSelectedContact;\r\n addContactLead?: (contact: IfacilityContact) => void;\r\n}\r\ninterface Istate {\r\n selectedRow: any;\r\n columns: Array<{}>;\r\n}\r\ninterface RowInfoEdited extends RowInfo {\r\n original: IfacilityContact;\r\n}\r\n\r\nexport class AddContactsTable extends React.PureComponent {\r\n static defaultProps = {\r\n currentTile: constants.getTileByURL(window.location.pathname),\r\n tableData: []\r\n };\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n columns: this.columns()\r\n };\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n this.props.selectedContactID !== prevProps.selectedContactID &&\r\n this.props.selectedContactID.length === 0\r\n ) {\r\n this.setState({ selectedRow: {} });\r\n }\r\n }\r\n\r\n handleSelectContactEdit = (rowInfo: RowInfoEdited) => {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.props.updateSelectedContact(rowInfo.original);\r\n };\r\n\r\n columns = () =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'First',\r\n accessor: 'firstName',\r\n width: 110\r\n },\r\n {\r\n Header: 'Last',\r\n accessor: 'lastName',\r\n width: 110\r\n },\r\n {\r\n Header: 'SRC',\r\n accessor: 'source',\r\n width: 50,\r\n Cell: row =>\r\n row.value === 0 ? 'MMG' : row.value === 1 ? 'SAP' : ''\r\n },\r\n {\r\n Header: 'actions',\r\n id: 'actions',\r\n minWidth: 20,\r\n style: { overflow: 'visible' },\r\n Cell: row => {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n ],\r\n this.props.t\r\n );\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfoEdited | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.props.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n render() {\r\n const { tableData, t } = this.props;\r\n\r\n const tableClassName = `beacon-table contacts -highlight ${this.props.currentTile.color}`;\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n }\r\n}\r\n","import { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n deleteFacilityFromContact,\r\n updateSelectedContact\r\n} from '../../actions/manageFacilityActions';\r\n\r\nimport { AddContactsTable } from './AddContactsTable';\r\nimport { IfacilityContact } from '../../models';\r\nimport { connect } from 'react-redux';\r\nimport { selectFacilityContactsForTable } from '../../reducers/manageCustomerAndFacilityReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n facilityID: string;\r\n addContactLead?: (contact: IfacilityContact) => void;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedContact } = state.manageFacility;\r\n const tableData = selectFacilityContactsForTable(state);\r\n\r\n return {\r\n loading: selectIsLoading(state),\r\n tableData,\r\n facilityID: ownProps.facilityID,\r\n selectedContactID: selectedContact.id\r\n };\r\n};\r\n\r\nexport const AddContactsTableContainer = withTranslation('facility')(\r\n connect(mapStateToProps, {\r\n deleteFacilityFromContact,\r\n updateSelectedContact\r\n })(AddContactsTable)\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { IfacilityContact, Ioption, Iuser } from '../../models';\r\nimport {\r\n clearUsersThatMachedEmail,\r\n deleteFacilityFromContact,\r\n updateContactFromFacility,\r\n updateSelectedContact,\r\n getContactsByFacility\r\n} from '../../actions/manageFacilityActions';\r\nimport { find, omit, pick, unionBy } from 'lodash';\r\n\r\nimport { AddContactsTableContainer } from './AddContactsTableContainer';\r\nimport { FormUtil } from './FormUtil';\r\nimport { IfacilityContactFormValues } from '../../modelsForms';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport debounce from 'debounce-promise';\r\nimport { initialContact } from '../../reducers/initialState';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n show: boolean;\r\n toggleModal: () => void;\r\n colorButton: string;\r\n facilityID: string;\r\n selectedFacilityID: string;\r\n selectedContact: IfacilityContact;\r\n addContactToFacility: (\r\n contact: IfacilityContact,\r\n facilityID: string\r\n ) => Promise;\r\n getContactsByFacility: typeof getContactsByFacility;\r\n findUserOrContactByEmail: (search: string) => void;\r\n updateContactFromFacility: typeof updateContactFromFacility;\r\n clearUsersThatMachedEmail: typeof clearUsersThatMachedEmail;\r\n foundUsersOrContactsByID: { [key: string]: Iuser | IfacilityContact };\r\n usersByID: { [key: string]: Iuser };\r\n updateSelectedContact: typeof updateSelectedContact;\r\n facilityContacts: { [key: string]: IfacilityContact };\r\n deleteFacilityFromContact: typeof deleteFacilityFromContact;\r\n addContactLead?: (contact: IfacilityContact) => void;\r\n}\r\n\r\nenum FormStatus {\r\n Add,\r\n Edit,\r\n AddAndEdit // adding a contact that is not related to a user (add and edit at the same time)\r\n}\r\n\r\ninterface Istate {\r\n id?: string;\r\n fieldConfig: FieldConfig;\r\n formStatus: FormStatus;\r\n}\r\n\r\ninterface DefaultProps {\r\n selectedContact: IfacilityContact;\r\n}\r\n\r\nclass FacilityContactForm extends React.PureComponent<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private searchUsersDebounced: (search: string) => void;\r\n private subscription: any;\r\n static defaultProps: DefaultProps = {\r\n selectedContact: initialContact\r\n };\r\n\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.searchUsersDebounced = debounce(\r\n this.props.findUserOrContactByEmail,\r\n 1000\r\n );\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig(),\r\n formStatus: FormStatus.Add\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.props.getContactsByFacility(this.props.facilityID);\r\n this.props.updateSelectedContact();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n // update the form after selecting a contact\r\n if (this.props.selectedContact.id !== prevProps.selectedContact.id) {\r\n const facilityHasContact = this.props.facilityContacts[\r\n this.props.selectedContact.id\r\n ];\r\n\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues()),\r\n formStatus: facilityHasContact\r\n ? FormStatus.Edit\r\n : FormStatus.AddAndEdit\r\n });\r\n }\r\n // update the form after selecting a user\r\n if (\r\n this.props.selectedContact?.userID !==\r\n prevProps.selectedContact?.userID\r\n ) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n }\r\n\r\n // reset the form after adding a contact\r\n if (\r\n this.props.selectedContact.email.length === 0 &&\r\n prevProps.selectedContact.email.length > 0\r\n ) {\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues()),\r\n formStatus: FormStatus.Add\r\n });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.updateSelectedContact();\r\n this.props.clearUsersThatMachedEmail();\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (\r\n selectedContact = this.props.selectedContact\r\n ): IfacilityContactFormValues => {\r\n let {\r\n userID,\r\n email,\r\n firstName,\r\n lastName,\r\n title,\r\n phone,\r\n mobile\r\n } = selectedContact;\r\n if (userID !== undefined && userID?.length) {\r\n const user = find(this.props.foundUsersOrContactsByID, {\r\n id: userID\r\n });\r\n if (user && 'first' in user) {\r\n email = user.email;\r\n firstName = user.first;\r\n lastName = user.last;\r\n title = user.position;\r\n phone = user.phone;\r\n }\r\n }\r\n const cleanedContact = omit(selectedContact, [\r\n 'user',\r\n 'contactFacilities'\r\n ]);\r\n\r\n return {\r\n ...cleanedContact,\r\n email,\r\n firstName,\r\n lastName,\r\n title,\r\n phone,\r\n mobile\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (): IfacilityContact => {\r\n const newContactFacility = { facilityID: this.props.facilityID };\r\n let contactFacilities = [newContactFacility];\r\n if (this.props.selectedContact.id) {\r\n contactFacilities = unionBy(\r\n [\r\n {\r\n ...newContactFacility,\r\n contactID: this.props.selectedContact.id\r\n }\r\n ],\r\n this.props.selectedContact.contactFacilities\r\n );\r\n }\r\n return {\r\n ...this.props.selectedContact,\r\n ...FormUtil.getValues(this.formGroup.value),\r\n contactFacilities\r\n };\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'email': {\r\n this.handleSelectedEmail(value);\r\n break;\r\n }\r\n default: {\r\n this.props.updateSelectedContact(this.formValuesToItem());\r\n }\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n } else {\r\n if (\r\n this.state.formStatus === FormStatus.Add ||\r\n this.state.formStatus === FormStatus.AddAndEdit\r\n ) {\r\n const contact = this.formValuesToItem();\r\n this.props\r\n .addContactToFacility(contact, this.props.facilityID)\r\n .then((newContact: IfacilityContact | string) => {\r\n // if this is a contact not related to a user then also update the contact just in case they changed any contact info\r\n // if adding a brand new contact for the first time, newContact comes back as an IfacilityContact. If it's an existing contact, it comes back as a string (aka the Guid of the contact)\r\n if (contact.id !== undefined && contact.id !== '') {\r\n //API call to update the values of the contact\r\n this.props.updateContactFromFacility({\r\n ...contact,\r\n id: newContact as string\r\n });\r\n\r\n //Update selected contact in Redux\r\n this.props.updateSelectedContact({\r\n ...contact,\r\n id: newContact as string\r\n });\r\n\r\n this.props.clearUsersThatMachedEmail();\r\n } else {\r\n //A new contact was added, so update the selected contact in Redux\r\n this.props.updateSelectedContact(\r\n newContact as IfacilityContact\r\n );\r\n this.props.clearUsersThatMachedEmail();\r\n }\r\n });\r\n } else {\r\n this.props.updateContactFromFacility(this.formValuesToItem());\r\n }\r\n }\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n /*\r\n * handleSelectedEmail\r\n Is it an ID for a contact or a user?\r\n contact - add it\r\n user - create a new contact from this user\r\n */\r\n handleSelectedEmail = (selectedOption: Ioption) => {\r\n const userInfo = this.props.foundUsersOrContactsByID[\r\n selectedOption.value\r\n ];\r\n if (userInfo && 'contactFacilities' in userInfo) {\r\n this.props.updateSelectedContact(userInfo);\r\n } else if (userInfo && 'isActive' in userInfo) {\r\n const userValues = pick(userInfo, [\r\n 'email',\r\n 'first',\r\n 'last',\r\n 'position',\r\n 'phone'\r\n ]);\r\n const newContact: IfacilityContact = {\r\n id: '',\r\n isDeleted: false,\r\n email: userValues.email,\r\n firstName: userValues.first,\r\n lastName: userValues.last,\r\n phone: userValues.phone,\r\n mobile: '',\r\n source: 0, // MMG\r\n title: userValues.position,\r\n enableNotifications: false,\r\n smartlinkNotifications: false,\r\n contactFacilities: [],\r\n userID: userInfo.id\r\n };\r\n this.props.updateSelectedContact(newContact);\r\n this.setState({\r\n formStatus: FormStatus.Add\r\n });\r\n }\r\n };\r\n\r\n loadOptions = (value: string) => {\r\n return this.searchUsersDebounced(value);\r\n };\r\n\r\n /*\r\n * isTiedToUser\r\n * if this contact has a userID (edting an a contact that is related to a user)\r\n */\r\n isTiedToUser = (): boolean =>\r\n this.props.selectedContact?.userID !== undefined &&\r\n this.props.selectedContact?.userID?.length > 0;\r\n\r\n isSAPContact = (): boolean => this.props.selectedContact?.source === 1; // SAP\r\n\r\n /*\r\n * resetFormToOriginalContact\r\n * when adding and editing a contact, undo changes made to the contact\r\n */\r\n resetFormToOriginalContact = () => {\r\n const originalContact = this.props.foundUsersOrContactsByID[\r\n this.props.selectedContact.id\r\n ];\r\n if ('firstName' in originalContact) {\r\n this.props.updateSelectedContact(originalContact);\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(\r\n this.itemToFormValues(originalContact)\r\n )\r\n });\r\n }\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IfacilityContactFormValues = this.itemToFormValues()\r\n ) => {\r\n const tiedToUser = this.isTiedToUser();\r\n const sapContact = this.isSAPContact();\r\n const { t } = this.props;\r\n const fieldFormControls = {\r\n email: {\r\n render: FormUtil.AsyncCreatableSelect,\r\n meta: {\r\n label: t('facilityContactForm.email'),\r\n colWidth: 12,\r\n rows: 2,\r\n loadOptions: (value: string) => this.loadOptions(value),\r\n name: 'email',\r\n required: true,\r\n isMulti: false,\r\n handleCreate: (value: any) => {\r\n const regex = new RegExp(\r\n /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,8}|[0-9]{1,3})(\\]?)$/ //eslint-disable-line\r\n );\r\n if (value.match(regex)) {\r\n this.props.updateSelectedContact({\r\n ...initialContact,\r\n email: value\r\n });\r\n const newEmailOption = { value, label: value };\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'email',\r\n newEmailOption\r\n );\r\n } else {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:validEmail'),\r\n constants.toastrWarning\r\n );\r\n }\r\n }\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: {\r\n value: defaultValues.email,\r\n label: defaultValues.email\r\n },\r\n disabled: sapContact\r\n }\r\n },\r\n firstName: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('facilityContactForm.firstName'),\r\n colWidth: 6,\r\n rows: 2,\r\n name: 'firstName',\r\n initialContent: '',\r\n required: true\r\n },\r\n options: {\r\n validators: [\r\n Validators.maxLength(250),\r\n Validators.minLength(2),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.firstName,\r\n disabled: tiedToUser || sapContact\r\n }\r\n },\r\n lastName: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('facilityContactForm.lastName'),\r\n colWidth: 6,\r\n rows: 2,\r\n name: 'lastName',\r\n initialContent: '',\r\n required: true\r\n },\r\n options: {\r\n validators: [\r\n Validators.maxLength(250),\r\n Validators.minLength(2),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.lastName,\r\n disabled: tiedToUser || sapContact\r\n }\r\n },\r\n title: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('facilityContactForm.title'),\r\n colWidth: 12,\r\n rows: 2,\r\n name: 'title',\r\n initialContent: '',\r\n required: true\r\n },\r\n options: {\r\n validators: [\r\n Validators.maxLength(250),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.title,\r\n disabled: tiedToUser || sapContact\r\n }\r\n },\r\n phone: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('facilityContactForm.phone'),\r\n colWidth: 6,\r\n rows: 2,\r\n name: 'phone',\r\n initialContent: '',\r\n required: false\r\n },\r\n options: {\r\n validators: [\r\n Validators.maxLength(22),\r\n Validators.minLength(7)\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.phone,\r\n disabled: tiedToUser || sapContact\r\n }\r\n },\r\n mobile: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('facilityContactForm.mobile'),\r\n colWidth: 6,\r\n rows: 2,\r\n name: 'mobile',\r\n initialContent: '',\r\n required: false\r\n },\r\n options: {\r\n validators: [\r\n Validators.maxLength(22),\r\n Validators.minLength(7)\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.mobile,\r\n disabled: tiedToUser || sapContact\r\n }\r\n },\r\n enableNotifications: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: t('facilityContactForm.reportNotifications'),\r\n colWidth: 12,\r\n rows: 2,\r\n name: 'enableNotifications',\r\n initialContent: false,\r\n required: true\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.enableNotifications,\r\n disabled: false\r\n }\r\n },\r\n smartlinkNotifications: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: t('facilityContactForm.smartlinkNotifications'),\r\n colWidth: 12,\r\n rows: 2,\r\n name: 'smartlinkNotifications',\r\n initialContent: false,\r\n required: true\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.smartlinkNotifications,\r\n disabled: false\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n const fieldConfig = {\r\n controls: { ...fieldFormControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const formClassName = `clearfix job-form beacon-form ${this.props.colorButton}`;\r\n const { formStatus } = this.state;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {formStatus === FormStatus.Edit && (\r\n \r\n this.props.updateSelectedContact()\r\n }\r\n >\r\n Cancel\r\n \r\n )}\r\n {formStatus === FormStatus.AddAndEdit && (\r\n \r\n Cancel\r\n \r\n )}\r\n \r\n {formStatus === FormStatus.Add ? 'Add' : 'Save'}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n }}\r\n >\r\n {t('close')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default FacilityContactForm;\r\n","import { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n addContactToFacility,\r\n clearUsersThatMachedEmail,\r\n deleteFacilityFromContact,\r\n findUserOrContactByEmail,\r\n getContactsByFacility,\r\n toggleFacilityContactModal,\r\n updateContactFromFacility,\r\n updateSelectedContact\r\n} from '../../actions/manageFacilityActions';\r\n\r\nimport FacilityContactForm from './FacilityContactForm';\r\nimport { IfacilityContact } from '../../models';\r\nimport { WithCommonModal } from './WithCommonModal';\r\nimport { connect } from 'react-redux';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectSelectedFacilityID } from '../../reducers/facilitiesReducer';\r\n\r\ntype Iprops = {\r\n colorButton?: string;\r\n secondWideModal?: boolean;\r\n selectContact?: (contactID: string) => void;\r\n facilityID: string;\r\n addContactLead?: (contact: IfacilityContact) => void;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const foundUsersOrContactsByID =\r\n state.manageFacility.foundUsersOrContactsByID;\r\n const selectedFacilityID = selectSelectedFacilityID(state);\r\n\r\n return {\r\n selectedFacilityID,\r\n loading: selectIsLoading(state),\r\n show: state.showFacilityContactModal,\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('facilityContactForm.formTitle'),\r\n selectedContact: state.manageFacility.selectedContact,\r\n foundUsersOrContactsByID,\r\n usersByID: state.manageUser.usersByID,\r\n facilityContacts: state.manageFacility.contacts\r\n };\r\n};\r\n\r\nexport default withTranslation('facility')(\r\n connect(mapStateToProps, {\r\n toggleModal: toggleFacilityContactModal,\r\n onSubmit: toggleFacilityContactModal,\r\n onHide: toggleFacilityContactModal,\r\n onCancel: toggleFacilityContactModal,\r\n addContactToFacility,\r\n getContactsByFacility,\r\n findUserOrContactByEmail,\r\n updateContactFromFacility,\r\n clearUsersThatMachedEmail,\r\n updateSelectedContact,\r\n deleteFacilityFromContact\r\n })(WithCommonModal(FacilityContactForm))\r\n);\r\n","/*\r\n * EditJobForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { debounce } from 'lodash';\r\nimport {\r\n myMedGasContractEnum,\r\n inspectionContractEnum\r\n} from '../../models-enums';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IfacilityContractFormValues } from '../../modelsForms';\r\nimport { IfacilityContract, Ibrand } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialJob } from '../../reducers/initialState';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { updateFacilityContract } from '../../actions/manageFacilityActions';\r\nimport { WithTranslation } from 'react-i18next';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n selectedItem: IfacilityContract;\r\n show: boolean;\r\n handleSubmit: typeof updateFacilityContract;\r\n updateFormValue: (formValue: { [key: string]: any }) => void;\r\n setFormValues: (formValues: IfacilityContractFormValues) => void;\r\n formValues: IfacilityContractFormValues;\r\n toggleModal: () => void;\r\n colorButton: string;\r\n // other\r\n brands: { [key: string]: Ibrand };\r\n facilityID: string;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass FacilityContractForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateFormValueDebounced: any;\r\n static defaultProps = {\r\n selectedItem: initialJob\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.updateFormValueDebounced = debounce(\r\n this.props.updateFormValue,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n componentDidMount() {\r\n this.props.setFormValues(this.itemToFormValues());\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig(this.itemToFormValues())\r\n });\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IfacilityContractFormValues => {\r\n const { selectedItem, t } = this.props;\r\n let myMedGasContract,\r\n inspectionContract,\r\n maintenanceContract,\r\n agslevContract,\r\n environmentalContract,\r\n boomContract,\r\n leakTestingContract,\r\n traceGasAnalysisContract,\r\n otherContract;\r\n\r\n if (selectedItem.myMedGasContract) {\r\n myMedGasContract = {\r\n value: selectedItem.myMedGasContract,\r\n label: t(myMedGasContractEnum[selectedItem.myMedGasContract])\r\n };\r\n }\r\n if (selectedItem.inspectionContract) {\r\n inspectionContract = {\r\n value: selectedItem.inspectionContract,\r\n label: t(\r\n inspectionContractEnum[selectedItem.inspectionContract]\r\n )\r\n };\r\n }\r\n if (selectedItem.maintenanceContract) {\r\n maintenanceContract = {\r\n value: selectedItem.maintenanceContract,\r\n label: t(\r\n inspectionContractEnum[selectedItem.maintenanceContract]\r\n )\r\n };\r\n }\r\n if (selectedItem.agslevContract) {\r\n agslevContract = {\r\n value: selectedItem.agslevContract,\r\n label: t(inspectionContractEnum[selectedItem.agslevContract])\r\n };\r\n }\r\n if (selectedItem.environmentalContract) {\r\n environmentalContract = {\r\n value: selectedItem.environmentalContract,\r\n label: t(\r\n inspectionContractEnum[selectedItem.environmentalContract]\r\n )\r\n };\r\n }\r\n if (selectedItem.boomContract) {\r\n boomContract = {\r\n value: selectedItem.boomContract,\r\n label: t(inspectionContractEnum[selectedItem.boomContract])\r\n };\r\n }\r\n if (selectedItem.leakTestingContract) {\r\n leakTestingContract = {\r\n value: selectedItem.leakTestingContract,\r\n label: t(\r\n inspectionContractEnum[selectedItem.leakTestingContract]\r\n )\r\n };\r\n }\r\n if (selectedItem.traceGasAnalysisContract) {\r\n traceGasAnalysisContract = {\r\n value: selectedItem.traceGasAnalysisContract,\r\n label: t(\r\n inspectionContractEnum[\r\n selectedItem.traceGasAnalysisContract\r\n ]\r\n )\r\n };\r\n }\r\n if (selectedItem.otherContract) {\r\n otherContract = {\r\n value: selectedItem.otherContract,\r\n label: t(inspectionContractEnum[selectedItem.otherContract])\r\n };\r\n }\r\n return {\r\n ...selectedItem,\r\n myMedGasContract,\r\n inspectionContract,\r\n maintenanceContract,\r\n agslevContract,\r\n environmentalContract,\r\n boomContract,\r\n leakTestingContract,\r\n traceGasAnalysisContract,\r\n otherContract\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (): IfacilityContract => {\r\n return {\r\n ...this.props.selectedItem,\r\n ...FormUtil.getValues(this.formGroup.value),\r\n facilityID: this.props.facilityID\r\n };\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IfacilityContractFormValues = this.props.formValues\r\n ) => {\r\n const disabled = false;\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n myMedGasContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n myMedGasContractEnum\r\n ),\r\n label: 'facilityContractForm.myMedGasContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'myMedGasContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.myMedGasContract,\r\n disabled\r\n }\r\n },\r\n myMedGasContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.myMedGasContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'myMedGasContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.myMedGasContractStart,\r\n disabled\r\n }\r\n },\r\n myMedGasContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.myMedGasContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'myMedGasContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.myMedGasContractEnd,\r\n disabled\r\n }\r\n },\r\n myMedGasContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.myMedGasContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'myMedGasContractComments',\r\n initialContent: defaultValues.myMedGasContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.myMedGasContractComments,\r\n disabled\r\n }\r\n },\r\n inspectionContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.inspectionContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'inspectionContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.inspectionContract,\r\n disabled\r\n }\r\n },\r\n inspectionContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.inspectionContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'inspectionContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.inspectionContractStart,\r\n disabled\r\n }\r\n },\r\n inspectionContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.inspectionContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'inspectionContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.inspectionContractEnd,\r\n disabled\r\n }\r\n },\r\n inspectionContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.inspectionContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'inspectionContractComments',\r\n initialContent: defaultValues.inspectionContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.inspectionContractComments,\r\n disabled\r\n }\r\n },\r\n maintenanceContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.maintenanceContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'maintenanceContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.maintenanceContract,\r\n disabled\r\n }\r\n },\r\n maintenanceContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.maintenanceContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'maintenanceContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.maintenanceContractStart,\r\n disabled\r\n }\r\n },\r\n maintenanceContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.maintenanceContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'maintenanceContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.maintenanceContractEnd,\r\n disabled\r\n }\r\n },\r\n maintenanceContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.maintenanceContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'maintenanceContractComments',\r\n initialContent: defaultValues.maintenanceContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.maintenanceContractComments,\r\n disabled\r\n }\r\n },\r\n agslevContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.AGSLEVContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'AGSLEVContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.agslevContract,\r\n disabled\r\n }\r\n },\r\n agslevContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.AGSLEVContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'AGSLEVContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.agslevContractStart,\r\n disabled\r\n }\r\n },\r\n agslevContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.AGSLEVContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'AGSLEVContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.agslevContractEnd,\r\n disabled\r\n }\r\n },\r\n agslevContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.AGSLEVContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n name: 'AGSLEVContractComments',\r\n style: { marginBottom: '25px' },\r\n initialContent: defaultValues.agslevContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.agslevContractComments,\r\n disabled\r\n }\r\n },\r\n environmentalContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.environmentalContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'environmentalContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.environmentalContract,\r\n disabled\r\n }\r\n },\r\n environmentalContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.environmentalContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'environmentalContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.environmentalContractStart,\r\n disabled\r\n }\r\n },\r\n environmentalContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.environmentalContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'environmentalContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.environmentalContractEnd,\r\n disabled\r\n }\r\n },\r\n environmentalContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.environmentalContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'environmentalContractComments',\r\n initialContent: defaultValues.environmentalContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.environmentalContractComments,\r\n disabled\r\n }\r\n },\r\n boomContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.boomContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'boomContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.boomContract,\r\n disabled\r\n }\r\n },\r\n boomContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.boomContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'boomContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.boomContractStart,\r\n disabled\r\n }\r\n },\r\n boomContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.boomContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'boomContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.boomContractEnd,\r\n disabled\r\n }\r\n },\r\n boomContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.boomContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'boomContractComments',\r\n initialContent: defaultValues.boomContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.boomContractComments,\r\n disabled\r\n }\r\n },\r\n leakTestingContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.leakTestingContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'leakTestingContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.leakTestingContract,\r\n disabled\r\n }\r\n },\r\n leakTestingContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.leakTestingContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'leakTestingContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.leakTestingContractStart,\r\n disabled\r\n }\r\n },\r\n leakTestingContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.leakTestingContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'leakTestingContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.leakTestingContractEnd,\r\n disabled\r\n }\r\n },\r\n leakTestingContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.leakTestingContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'leakTestingContractComments',\r\n initialContent: defaultValues.leakTestingContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.leakTestingContractComments,\r\n disabled\r\n }\r\n },\r\n traceGasAnalysisContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.traceGasAnalysisContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'traceGasAnalysisContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.traceGasAnalysisContract,\r\n disabled\r\n }\r\n },\r\n traceGasAnalysisContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.traceGasAnalysisContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'traceGasAnalysisContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.traceGasAnalysisContractStart,\r\n disabled\r\n }\r\n },\r\n traceGasAnalysisContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.traceGasAnalysisContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'traceGasAnalysisContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.traceGasAnalysisContractEnd,\r\n disabled\r\n }\r\n },\r\n traceGasAnalysisContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label:\r\n 'facilityContractForm.traceGasAnalysisContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'traceGasAnalysisContractComments',\r\n initialContent:\r\n defaultValues.traceGasAnalysisContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.traceGasAnalysisContractComments,\r\n disabled\r\n }\r\n },\r\n otherContract: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n inspectionContractEnum\r\n ),\r\n label: 'facilityContractForm.otherContract',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'otherContract',\r\n required: false,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.otherContract,\r\n disabled\r\n }\r\n },\r\n otherContractStart: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.otherContractStart',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n name: 'otherContractStart',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.otherContractStart,\r\n disabled\r\n }\r\n },\r\n otherContractEnd: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'facilityContractForm.otherContractEnd',\r\n colWidth: 6,\r\n showTime: false,\r\n required: false,\r\n alignRight: true,\r\n name: 'otherContractEnd',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.isValidMoment]\r\n },\r\n formState: {\r\n value: defaultValues.otherContractEnd,\r\n disabled\r\n }\r\n },\r\n otherContractComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'facilityContractForm.otherContractComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 2,\r\n style: { marginBottom: '25px' },\r\n name: 'otherContractComments',\r\n initialContent: defaultValues.otherContractComments,\r\n required: false\r\n },\r\n options: {\r\n validators: [Validators.maxLength(250)]\r\n },\r\n formState: {\r\n value: defaultValues.otherContractComments,\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n default:\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n this.updateFormValueDebounced({ [key]: value });\r\n break;\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.formGroup.value);\r\n\r\n if (this.props.selectedItem.id.length) {\r\n this.props.handleSubmit(this.formValuesToItem());\r\n } else {\r\n this.props.handleSubmit({\r\n ...this.formValuesToItem(),\r\n id: uuidv4()\r\n });\r\n }\r\n this.props.toggleModal();\r\n };\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix job-form beacon-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n this.props.setFormValues({});\r\n }}\r\n >\r\n {t('cancel')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default FacilityContractForm;\r\n","/*\r\n * Facility Contract Modal and Redux Connector\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport { IfacilityContract } from '../../models';\r\n\r\nimport {\r\n initialFacilityContract,\r\n initialFacility\r\n} from '../../reducers/initialState';\r\nimport FacilityContractForm from './FacilityContractForm';\r\nimport {\r\n toggleFacilityContractModal,\r\n updateFacilityContractFormValue,\r\n setFacilityContractFormValues,\r\n updateFacilityContract\r\n} from '../../actions/manageFacilityActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from './WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n secondWideModal?: boolean;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { facilities } = state;\r\n const selectedFacility =\r\n facilities[state.manageFacility.selectedFacilityID] || initialFacility;\r\n const selectedItem =\r\n (state.manageFacility.facilityFormValues\r\n .contract as IfacilityContract) || initialFacilityContract;\r\n\r\n return {\r\n // reusable\r\n loading: selectIsLoading(state),\r\n show: state.manageFacility.showFacilityContractModal,\r\n formValues: state.manageFacility.facilityContractFormValues,\r\n selectedItem,\r\n // other\r\n brands: state.productInfo.brands,\r\n facilityID: selectedFacility.id,\r\n className: 'facility-contract-edit',\r\n title: ownProps.t('facilityContractForm.title')\r\n };\r\n};\r\n\r\nexport default withTranslation('manageFacility')(\r\n connect(mapStateToProps, {\r\n // reusable\r\n handleSubmit: updateFacilityContract,\r\n toggleModal: toggleFacilityContractModal,\r\n updateFormValue: updateFacilityContractFormValue,\r\n setFormValues: setFacilityContractFormValues,\r\n onHide: toggleFacilityContractModal\r\n // other\r\n })(WithCommonModal(FacilityContractForm))\r\n);\r\n","import * as types from '../actions/actionTypes';\r\nimport {\r\n Ibrand,\r\n ImainCategory,\r\n Ioption,\r\n Ipower,\r\n IproductInfo,\r\n IproductType,\r\n Istandard,\r\n Isubcategory,\r\n IsystemSize\r\n} from '../models';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport initialState from './initialState';\r\nimport { keyBy } from 'lodash';\r\nimport { IinitialState } from '.';\r\nimport { Dictionary } from 'highcharts';\r\n\r\n// Selector to get product info\r\nexport const getProductInfo = (state: IinitialState) => state.productInfo;\r\n\r\n/*\r\nBrand, productType, Main Category, Power, Product Group, Standard, Subcategory, System Size\r\n*/\r\nexport function productInfoReducer(\r\n state: IproductInfo = initialState.productInfo,\r\n action: any\r\n): IproductInfo {\r\n switch (action.type) {\r\n case types.GET_PRODUCT_INFO_SUCCESS: {\r\n const pi = action.data;\r\n const brands = keyBy(pi[0], (item: Ibrand) => item.id); // All brands\r\n const filteredBrands = keyBy(\r\n Object.values(brands).filter(\r\n (b: Ibrand) => b.isManufacturer === true\r\n ),\r\n (item: Ibrand) => item.id\r\n );\r\n\r\n // Options for the form elements\r\n const productTypes = keyBy(pi[1], (item: IproductType) => item.id);\r\n const mainCategories = keyBy(\r\n pi[2],\r\n (item: ImainCategory) => item.id\r\n );\r\n const powers = keyBy(pi[3], (item: Ipower) => item.id);\r\n const standards = keyBy(pi[4], (item: Istandard) => item.id);\r\n const subcategories = keyBy(pi[5], (item: Isubcategory) => item.id);\r\n const systemSizes = keyBy(pi[6], (item: IsystemSize) => item.id);\r\n\r\n const filteredBrandsOptions = FormUtil.convertToOptions(\r\n filteredBrands\r\n );\r\n\r\n const allBrandOptions = FormUtil.convertToOptions(brands);\r\n\r\n const productTypeOptions = FormUtil.convertToOptions(pi[1]);\r\n const mainCategoryOptions = FormUtil.convertToOptions(pi[2]);\r\n const powerOptions = FormUtil.convertToOptions(pi[3]);\r\n const standardOptions = FormUtil.convertToOptions(pi[4]);\r\n const subcategoryOptions = FormUtil.convertToOptions(pi[5]);\r\n const systemSizeOptions = FormUtil.convertToOptions(pi[6]);\r\n const originOptions: Ioption[] = [\r\n { value: 'USN', label: 'USN' },\r\n { value: 'GBN', label: 'GBN' },\r\n { value: 'CAN', label: 'CAN' }\r\n ];\r\n\r\n return {\r\n ...state,\r\n brands: filteredBrands, // Filtered brands (manufacturers only)\r\n allBrands: brands, // Store all brands (unfiltered)\r\n productTypes,\r\n mainCategories,\r\n powers,\r\n standards,\r\n subcategories,\r\n systemSizes,\r\n brandOptions: filteredBrandsOptions,\r\n allBrandOptions,\r\n productTypeOptions,\r\n mainCategoryOptions,\r\n powerOptions,\r\n standardOptions,\r\n subcategoryOptions,\r\n systemSizeOptions,\r\n originOptions\r\n };\r\n }\r\n case types.UPDATE_PRODUCT_INFO_BRANDS_SUCCESS: {\r\n const brands: Dictionary = action.payload.brands; // these are all brands\r\n\r\n const filteredBrands = keyBy(\r\n Object.values(brands).filter(\r\n (b: Ibrand) => b.isManufacturer === true\r\n ),\r\n (item: Ibrand) => item.id\r\n );\r\n\r\n const brandOptions = FormUtil.convertToOptions(filteredBrands);\r\n return {\r\n ...state,\r\n brands: filteredBrands,\r\n allBrands: brands,\r\n brandOptions\r\n };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.productInfo;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { Button, Col, Modal, Row } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { Ifacility } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { getFacilities } from '../../reducers/facilitiesReducer';\r\nimport { constants } from '../../constants/constants';\r\nimport { getProductInfo } from '../../reducers/productInfoReducer';\r\nimport { toastr } from 'react-redux-toastr';\r\ninterface Istate {\r\n facilities: Ifacility[];\r\n primaryFacility: string;\r\n}\r\n\r\ninterface Iprops {\r\n showModal: boolean;\r\n hideModal: () => void;\r\n selection: string[];\r\n colorButton: string;\r\n mergeFacilities: (primary: string, secondary: string[]) => void;\r\n}\r\n\r\nconst MergeFacilityModal: React.FC = props => {\r\n const { t } = props;\r\n const allFacilities = useSelector(getFacilities);\r\n const productInfo = useSelector(getProductInfo);\r\n const [state, setState] = React.useState({\r\n facilities: [],\r\n primaryFacility: ''\r\n });\r\n\r\n useEffect(() => {\r\n if (props.showModal) {\r\n //Make sure facilities is empty before adding\r\n\r\n let facilitiesToAdd: Ifacility[] = [];\r\n\r\n props.selection.forEach(value => {\r\n const facilityId = value.slice(7);\r\n facilitiesToAdd.push(allFacilities[facilityId]);\r\n });\r\n\r\n let defaultId = '';\r\n if (facilitiesToAdd.length > 0) {\r\n defaultId = facilitiesToAdd[0].id;\r\n }\r\n\r\n setState({\r\n facilities: facilitiesToAdd,\r\n primaryFacility: defaultId\r\n });\r\n }\r\n }, [props.showModal]);\r\n\r\n const onValueChange = (event: any) => {\r\n setState({ ...state, primaryFacility: event.target.value });\r\n };\r\n\r\n const merge = () => {\r\n if (state.primaryFacility === '') {\r\n toastr.warning(\r\n t('warning'),\r\n t('Select the primary facility'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n //You cannot merge facilities if they do not have the same Standard\r\n const primary = state.facilities.filter(\r\n x => x.id === state.primaryFacility\r\n )[0];\r\n let anyErrors = false;\r\n\r\n const secondaryFacilities = state.facilities.filter(\r\n x => x.id !== state.primaryFacility\r\n );\r\n\r\n secondaryFacilities.forEach(temp => {\r\n if (temp.standardID !== primary.standardID) {\r\n anyErrors = true;\r\n }\r\n });\r\n\r\n if (anyErrors) {\r\n toastr.warning(\r\n t('warning'),\r\n t('All facilities must have the same standard'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const ids = secondaryFacilities.map(value => {\r\n return value.id;\r\n });\r\n\r\n props.mergeFacilities(state.primaryFacility, ids);\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n props.hideModal}\r\n title={t('mergeFacilities')}\r\n container={document.getElementById('two-pane-layout')}\r\n >\r\n
    \r\n {state.facilities.map((facility: Ifacility, index) => {\r\n return (\r\n \r\n \r\n {props.t('makePrimary')}\r\n \r\n\r\n {/* First radio should be checked */}\r\n {index === 0 && (\r\n \r\n )}\r\n {index > 0 && (\r\n \r\n )}\r\n\r\n

    \r\n {facility.name}\r\n

    \r\n {`${t('sapFacilityNumber')} - ${\r\n facility.sapFacilityNumber\r\n }`}

    \r\n

    \r\n {\r\n productInfo.standards[\r\n facility.standardID\r\n ].name\r\n }\r\n

    \r\n

    \r\n {facility.address} {facility.address2}\r\n

    \r\n

    \r\n {facility.city} {facility.state}{' '}\r\n {facility.postalCode}\r\n

    \r\n

    \r\n {\r\n constants.countries[facility.countryID]\r\n .label\r\n }\r\n

    \r\n
    \r\n );\r\n })}\r\n\r\n \r\n \r\n {t('close')}\r\n \r\n \r\n \r\n
    \r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('manageFacility')(MergeFacilityModal);\r\n","import { debounce } from 'lodash';\r\nimport * as React from 'react';\r\nimport { MutableRefObject, useRef } from 'react';\r\nimport { Button, DropdownButton, MenuItem } from 'react-bootstrap';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { connect, useDispatch, useSelector } from 'react-redux';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport selectTableHOC, {\r\n SelectTableAdditionalProps\r\n} from 'react-table/lib/hoc/selectTable';\r\nimport treeTableHOC from 'react-table/lib/hoc/treeTable';\r\nimport * as types from '../../actions/actionTypes';\r\nimport { beginAjaxCall, endAjaxCall } from '../../actions/ajaxStatusActions';\r\nimport {\r\n FacilitiesSearchParams,\r\n closeAllModals,\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport { loadCountries } from '../../actions/countriesActions';\r\nimport {\r\n mergeFacilitiesAPI,\r\n setSelectedFacilityID,\r\n setTableFilter\r\n} from '../../actions/manageFacilityActions';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { Ifacility, Ioption, ItableFiltersReducer, Itile } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { selectFilteredFacilities } from '../../reducers/facilitiesReducer';\r\nimport { emptyTile, initialFacility } from '../../reducers/initialState';\r\nimport { selectManageFacilityTableFilters } from '../../reducers/manageCustomerAndFacilityReducer';\r\nimport { getUsersCountries } from '../../reducers/userReducer';\r\nimport { Banner } from '../common/Banner';\r\nimport EditFacilityModal from '../common/EditFacilityModal';\r\nimport FacilityContactModal from '../common/FacilityContactModal';\r\nimport FacilityContractModal from '../common/FacilityContractModal';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport MergeFacilitiesModal from './mergeFacilitiesModal';\r\n\r\ninterface RowInfoFacility extends RowInfo {\r\n original: Ifacility;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\nconst SelectTable = selectTableHOC(treeTableHOC(ReactTable));\r\n\r\ninterface IdispatchProps {\r\n totalPages: number;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedFacilityID: typeof setSelectedFacilityID;\r\n toggleEditFacilityModal: typeof toggleEditFacilityModal;\r\n facilities: { [key: string]: Ifacility };\r\n getProductInfo: typeof getProductInfo;\r\n c: number;\r\n getFacilitiesByCountry: typeof getFacilitiesByCountry;\r\n filteredFacilities: Ifacility[];\r\n closeAllModals: typeof closeAllModals;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n beginAjaxCall: typeof beginAjaxCall;\r\n endAjaxCall: typeof endAjaxCall;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n selectAll: boolean;\r\n tableData: Ifacility[];\r\n currentTile: Itile;\r\n filter: FacilitiesSearchParams;\r\n selectedFacility: Ifacility;\r\n checkboxTable: any;\r\n selection: string[];\r\n showMergeFacilityModal: boolean;\r\n searchText: string;\r\n}\r\n\r\nconst ManageFacility: React.FC = props => {\r\n const { t } = props;\r\n const dispatch = useDispatch();\r\n const countries = useSelector(getCountries);\r\n const usersCountries = useSelector(getUsersCountries);\r\n\r\n React.useEffect(() => {\r\n loadCountries(dispatch, countries);\r\n refreshData();\r\n }, []);\r\n\r\n const [config, setConfig] = React.useState();\r\n const [state, setState] = React.useState({\r\n selectedRow: {},\r\n selectAll: false,\r\n tableData: [],\r\n currentTile: emptyTile,\r\n filter: {\r\n name: '',\r\n address: '',\r\n postalCode: ''\r\n },\r\n selectedFacility: initialFacility,\r\n checkboxTable: {},\r\n selection: [],\r\n showMergeFacilityModal: false,\r\n searchText: ''\r\n });\r\n const [data, setData] = React.useState<{\r\n result: any[];\r\n count: number;\r\n pages: number;\r\n }>({ result: [], count: 0, pages: 0 });\r\n const [formValues, setFormValues] = React.useState<{\r\n country: Ioption | null;\r\n facilityName: string | undefined;\r\n quantityOfAssets: number | undefined;\r\n }>({ country: null, quantityOfAssets: undefined, facilityName: undefined });\r\n\r\n React.useEffect(() => {\r\n const countriesOptions: Ioption[] = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => ({ label: c.name, value: c.id }));\r\n const mainSearchControls = {\r\n country: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'manageFacility:Country',\r\n colWidth: 4,\r\n colWidthMedium: 4,\r\n colWidthLarge: 4,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'country',\r\n defaultValue: '',\r\n isClearable: true\r\n }\r\n },\r\n quantityOfAssets: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageFacility:quantityOfAssets',\r\n colWidth: 4,\r\n type: 'number',\r\n placeholder: 'manageFacility:quantityOfAssets',\r\n defaultValue: '',\r\n isClearable: true\r\n }\r\n },\r\n facilityName: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:facility',\r\n colWidth: 4,\r\n type: 'text',\r\n placeholder: 'common:facilitySearchPlaceholder',\r\n defaultValue: '',\r\n isClearable: true\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n setConfig(FormUtil.translateForm(searchFieldConfig, props.t));\r\n }, [countries, usersCountries]);\r\n\r\n const colorButton =\r\n constants.colors[\r\n `${state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n const columns: any[] = [\r\n {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: 'name',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'sap Facility Number',\r\n id: 'sapFacilityNumber',\r\n accessor: 'sapFacilityNumber',\r\n minWidth: 150\r\n },\r\n {\r\n Header: 'QTY OF ASSETS',\r\n id: 'quantityOfAssets',\r\n accessor: 'quantityOfAssets',\r\n minwidth: 70\r\n },\r\n {\r\n Header: 'country',\r\n id: 'country',\r\n accessor: ({ countryID }: Ifacility) => {\r\n const country = constants.countries[countryID];\r\n return country ? country.label : '';\r\n },\r\n minWidth: 120\r\n },\r\n {\r\n Header: 'address',\r\n id: 'address',\r\n accessor: ({\r\n address,\r\n address2,\r\n city,\r\n state: facilityState,\r\n postalCode\r\n }: Ifacility) => {\r\n return (\r\n `${address ? address : ''}` +\r\n ` ${address2 ? address2 : ''},` +\r\n ` ${city ? city : ''},` +\r\n ` ${facilityState ? facilityState : ''},` +\r\n ` ${postalCode ? postalCode : ''}`\r\n );\r\n },\r\n minWidth: 300\r\n }\r\n ];\r\n\r\n /**\r\n * Toggle all checkboxes for select table\r\n */\r\n const toggleAll = () => {\r\n const { keyField = 'id' } = props;\r\n const selectAll = !state.selectAll;\r\n const selection: string[] = [];\r\n\r\n if (selectAll && keyField !== undefined) {\r\n // we need to get at the internals of ReactTable\r\n const wrappedInstance = state.checkboxTable.getWrappedInstance();\r\n // the 'sortedData' property contains the currently accessible records based on the filter and sort\r\n const currentRecords: any[] = wrappedInstance.getResolvedState()\r\n .sortedData;\r\n // we just push all the IDs onto the selection array\r\n currentRecords.forEach(item => {\r\n selection.push(`select-${item._original[keyField]}`);\r\n });\r\n }\r\n\r\n setState({ ...state, selectAll, selection });\r\n };\r\n\r\n /**\r\n * Whether or not a row is selected for select table\r\n */\r\n const isSelected = (key: string) => {\r\n return state.selection.includes(`select-${key}`);\r\n };\r\n\r\n const toggleSelection = (key: string, shift: boolean, row: any) => {\r\n // start off with the existing state\r\n let selection = [...state.selection];\r\n const keyIndex = selection.indexOf(key);\r\n\r\n // check to see if the key exists\r\n if (keyIndex >= 0) {\r\n // it does exist so we will remove it using destructing\r\n selection = [\r\n ...selection.slice(0, keyIndex),\r\n ...selection.slice(keyIndex + 1)\r\n ];\r\n } else {\r\n // it does not exist so add it\r\n selection.push(key);\r\n }\r\n\r\n setState({ ...state, selection });\r\n };\r\n\r\n // Since this page does not automatically save facilities into Redux\r\n // Soon as they take an action against a facility (select or try to merge)\r\n // We need to save it so other screens work correctly. Since everything usually\r\n // looks up a facility by ID in redux\r\n const saveFacility = () => {\r\n let facilitiesToSave: Ifacility[] = [];\r\n\r\n state.selection.forEach(selection => {\r\n const id = selection.slice(7);\r\n const tempFacility = state.tableData.find(x => x.id === id);\r\n if (tempFacility !== undefined) {\r\n facilitiesToSave.push(tempFacility);\r\n }\r\n });\r\n\r\n if (facilitiesToSave.length > 0) {\r\n dispatch({\r\n type: types.GET_FACILITIES_SUCCESS,\r\n facilities: facilitiesToSave\r\n });\r\n }\r\n };\r\n\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoFacility | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n saveFacility();\r\n props.setSelectedFacilityID(rowInfo.original.id);\r\n setState({ ...state, selectedFacility: rowInfo.original });\r\n props.toggleEditFacilityModal();\r\n }\r\n };\r\n }\r\n return {};\r\n };\r\n\r\n const onPageChange = (page: number) => {\r\n props.setTableFilter({ page });\r\n setState({ ...state, selectedRow: {} });\r\n\r\n if (formValues) {\r\n const { country, quantityOfAssets, facilityName } = formValues;\r\n props.beginAjaxCall();\r\n if (facilityName === undefined || facilityName.length === 0) {\r\n props.searchFacilitiesForAsyncSelect(\r\n undefined,\r\n country?.value !== undefined\r\n ? country.value\r\n : usersCountries,\r\n quantityOfAssets !== undefined ? quantityOfAssets : null,\r\n () => {\r\n return;\r\n },\r\n saveFacilities,\r\n page + 1,\r\n (data: any) => {\r\n setData(data);\r\n }\r\n );\r\n return;\r\n } else if (\r\n formValues.facilityName &&\r\n formValues.facilityName.length >= 3\r\n ) {\r\n props.searchFacilitiesForAsyncSelect(\r\n facilityName,\r\n country?.value !== undefined\r\n ? country.value\r\n : usersCountries,\r\n quantityOfAssets !== undefined ? quantityOfAssets : null,\r\n () => {\r\n return;\r\n },\r\n saveFacilities,\r\n page + 1,\r\n (data: any) => {\r\n setData(data);\r\n }\r\n );\r\n return;\r\n }\r\n }\r\n };\r\n\r\n const onPageSizeChange = (rows: number) => {\r\n props.setTableFilter({ rows, page: 0 });\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n const addFacility = (row: any) => {\r\n props.setSelectedFacilityID(initialFacility.id);\r\n setState({ ...state, selectedFacility: initialFacility });\r\n props.toggleEditFacilityModal();\r\n };\r\n\r\n const hideMergeFacilitiesModal = () => {\r\n setState({ ...state, showMergeFacilityModal: false });\r\n };\r\n\r\n const mergeFacilities = async (primary: string, secondary: string[]) => {\r\n const response = await mergeFacilitiesAPI(primary, secondary);\r\n if (!response) {\r\n toastr.warning(\r\n t('Error'),\r\n t('Failed to merge Facilities'),\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n // Remove the now merged facilities from redux if they're there\r\n await dispatch({\r\n type: types.MERGE_FACILITIES_SUCCESS,\r\n primaryId: primary,\r\n secondaryIds: secondary\r\n });\r\n\r\n // Remove the now merged facilities from state\r\n const updatedTableData = state.tableData.filter(tempFacility => {\r\n if (secondary.includes(tempFacility.id)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n\r\n setState({\r\n ...state,\r\n selectAll: false,\r\n selection: [],\r\n showMergeFacilityModal: false,\r\n tableData: updatedTableData\r\n });\r\n\r\n toastr.success(\r\n t('Success'),\r\n t('Facilities successfully merged'),\r\n constants.toastrSuccess\r\n );\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n const searchForFacility = (facilityID: string) => {};\r\n\r\n const saveFacilities = (facilities: Ifacility[]) => {\r\n setState({ ...state, tableData: facilities });\r\n props.endAjaxCall();\r\n };\r\n\r\n const debouncedSearch = React.useRef(\r\n debounce(async (searchTerms, countries, quantityOfAssets, page) => {\r\n props.beginAjaxCall();\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerms,\r\n countries !== undefined ? countries : usersCountries,\r\n quantityOfAssets !== '' ? quantityOfAssets : null,\r\n () => {\r\n return;\r\n },\r\n saveFacilities,\r\n page + 1,\r\n (data: any) => {\r\n setData(data);\r\n }\r\n );\r\n }, 200)\r\n ).current;\r\n\r\n React.useEffect(() => {\r\n props.beginAjaxCall();\r\n props.searchFacilitiesForAsyncSelect(\r\n undefined,\r\n usersCountries,\r\n null,\r\n () => {\r\n return;\r\n },\r\n saveFacilities,\r\n props.tableFilters.page,\r\n (data: any) => {\r\n setData(data);\r\n }\r\n );\r\n }, [usersCountries]);\r\n\r\n const ref = useRef() as MutableRefObject;\r\n\r\n const refreshData = () => {\r\n if (ref.current !== undefined) {\r\n ref.current.value = '';\r\n }\r\n\r\n const countriesOptions: string[] = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => c.id);\r\n\r\n debouncedSearch(\r\n undefined,\r\n countriesOptions,\r\n null,\r\n props.tableFilters.page\r\n );\r\n };\r\n\r\n const setForm = (form: FormGroup | FormArray) => {\r\n form.valueChanges.subscribe(\r\n (formValue: {\r\n country: Ioption;\r\n facilityName: string;\r\n quantityOfAssets: number;\r\n }) => {\r\n setFormValues(formValue);\r\n if (\r\n formValue.facilityName === undefined ||\r\n formValue.facilityName.length === 0\r\n ) {\r\n debouncedSearch(\r\n undefined,\r\n formValue.country?.value,\r\n formValue.quantityOfAssets,\r\n props.tableFilters.page\r\n );\r\n return;\r\n } else if (formValue.facilityName.length >= 3) {\r\n debouncedSearch(\r\n formValue.facilityName,\r\n formValue.country?.value,\r\n formValue.quantityOfAssets,\r\n props.tableFilters.page\r\n );\r\n return;\r\n }\r\n }\r\n );\r\n };\r\n\r\n return (\r\n
    \r\n \r\n \r\n {config && (\r\n \r\n )}\r\n
    \r\n \r\n {props.t('facility:newFacility')}\r\n \r\n
    \r\n
    \r\n\r\n {state.selection.length >= 2 && (\r\n {\r\n switch (eventKey) {\r\n case 1:\r\n if (state.selection.length >= 2) {\r\n saveFacility();\r\n setState({\r\n ...state,\r\n showMergeFacilityModal: true\r\n });\r\n }\r\n break;\r\n }\r\n }}\r\n >\r\n {t('mergeFacilities')}\r\n \r\n )}\r\n\r\n (state.checkboxTable = r)}\r\n keyField=\"id\"\r\n loading={data.result.length === 0 && props.loading}\r\n page={props.tableFilters.page}\r\n pages={data.pages}\r\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 mapStateToProps = (state: IinitialState) => {\r\n const selectedFacility: Ifacility = initialFacility;\r\n\r\n const filteredFacilities = selectFilteredFacilities(\r\n state.facilities,\r\n state.manageFacility.tableFilters\r\n );\r\n\r\n return {\r\n tableFilters: selectManageFacilityTableFilters(state),\r\n facilities: state.facilities,\r\n selectedFacility,\r\n filteredFacilities,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('manageFacility')(\r\n connect(mapStateToProps, {\r\n getFacilitiesByCountry,\r\n setTableFilter,\r\n setSelectedFacilityID,\r\n toggleEditFacilityModal,\r\n searchFacilitiesForAsyncSelect,\r\n beginAjaxCall,\r\n endAjaxCall\r\n })(ManageFacility)\r\n);\r\n","import * as React from 'react';\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { connect, useDispatch, useSelector } from 'react-redux';\r\nimport { Ifacility } from '../../models';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { getFacilities } from '../../reducers/facilitiesReducer';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { searchFacilitiesForAsyncSelect } from '../../actions/commonActions';\r\nimport { debounce } from 'lodash';\r\nimport { FormArray, FormGenerator, FormGroup } from 'react-reactive-form';\r\nimport { GET_FACILITIES_SUCCESS } from '../../actions/actionTypes';\r\n\r\ninterface Iprops {\r\n showModal: boolean;\r\n hideModal: () => void;\r\n colorButton: string;\r\n secondWideModal: boolean;\r\n mergeFacilities: (primary: string, secondary: string[]) => void;\r\n selectedFacility: Ifacility;\r\n countryId: string | undefined;\r\n}\r\n\r\ninterface IdispatchProps {\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n}\r\n\r\nconst SearchFacilityModal: React.FC = props => {\r\n const { t } = props;\r\n const allFacilities = useSelector(getFacilities);\r\n const [primaryFacilityForm, setPrimaryFacilityForm] = React.useState<\r\n FormArray | FormGroup\r\n >();\r\n const [fieldConfig, setFieldConfig] = React.useState();\r\n const dispatch = useDispatch();\r\n\r\n const saveFacilities = (facilities: Ifacility[]) => {\r\n dispatch({\r\n type: GET_FACILITIES_SUCCESS,\r\n facilities\r\n });\r\n };\r\n\r\n const merge = () => {\r\n if (!primaryFacilityForm) {\r\n return;\r\n }\r\n const primaryFacilityFromValue: {\r\n countryId: string;\r\n label: string;\r\n value: string;\r\n } = primaryFacilityForm.value.facilityControl;\r\n if (!primaryFacilityFromValue || !primaryFacilityFromValue.value) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Select the primary facility'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const primaryFacility =\r\n allFacilities[primaryFacilityFromValue.value];\r\n if (!primaryFacility) {\r\n toastr.warning(\r\n t('warning'),\r\n t('cannot find facility'),\r\n constants.toastrWarning\r\n );\r\n }\r\n if (primaryFacility.id === props.selectedFacility.id) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Select a different Facility'),\r\n constants.toastrWarning\r\n );\r\n } else if (\r\n primaryFacility.standardID !== props.selectedFacility.standardID\r\n ) {\r\n toastr.warning(\r\n t('warning'),\r\n t('Both facilities must have the same standard'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n props.mergeFacilities(primaryFacility.id, [\r\n props.selectedFacility.id\r\n ]);\r\n },\r\n onCancel: () => console.info('CANCEL clicked'),\r\n okText: t('Ok'),\r\n cancelText: t('Cancel')\r\n };\r\n\r\n toastr.confirm(\r\n `Are you sure you want to merge ${props.selectedFacility.name} into ${primaryFacility?.name}?`,\r\n toastrConfirmOptions\r\n );\r\n }\r\n }\r\n };\r\n\r\n const loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n props.countryId\r\n ? props.countryId\r\n : props.selectedFacility.countryID,\r\n null,\r\n callback,\r\n saveFacilities\r\n );\r\n return;\r\n }\r\n callback();\r\n }, 200);\r\n\r\n React.useEffect(() => {\r\n const facilityControl = {\r\n render: FormUtil.AsyncSelect,\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n meta: {\r\n label: 'facility',\r\n loadOptions,\r\n colWidth: 12,\r\n colWidthMedium: 12,\r\n colWidthLarge: 12,\r\n required: true,\r\n type: 'select',\r\n placeholder: 'manageInventory:facilityRequired'\r\n },\r\n formState: {\r\n value: { value: '', label: '' },\r\n disabled: false\r\n }\r\n };\r\n setFieldConfig({ controls: { facilityControl } });\r\n }, [props.countryId]);\r\n\r\n return (\r\n <>\r\n props.hideModal}\r\n title={t('mergeFacilities')}\r\n container={document.getElementById('two-pane-layout')}\r\n secondModal={props.secondWideModal}\r\n >\r\n \r\n \r\n

    \r\n Selecting a new facility here will merge all of the\r\n contracts, installs, and contacts from the original\r\n facility into the selected facility.\r\n

    \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('close')}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('manageFacility')(\r\n connect(() => {}, {\r\n searchFacilitiesForAsyncSelect\r\n })(SearchFacilityModal)\r\n);\r\n","import * as React from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { connect, useDispatch, useSelector } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport {\r\n closeAllModals,\r\n FacilitiesSearchParams,\r\n getFacilitiesByCountry,\r\n searchFacilityQueueForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport {\r\n mergeFacilitiesAPI,\r\n setSelectedFacilityID,\r\n setTableFilter\r\n} from '../../actions/manageFacilityActions';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n Ifacility,\r\n Ioption,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { initialFacility, emptyTile } from '../../reducers/initialState';\r\nimport { selectManageFacilityTableFilters } from '../../reducers/manageCustomerAndFacilityReducer';\r\nimport { Banner } from '../common/Banner';\r\nimport EditFacilityModal from '../common/EditFacilityModal';\r\nimport FacilityContactModal from '../common/FacilityContactModal';\r\nimport FacilityContractModal from '../common/FacilityContractModal';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { debounce } from 'lodash';\r\nimport SearchFacilityModal from '../manageFacility/searchFacilityModal';\r\nimport { beginAjaxCall, endAjaxCall } from '../../actions/ajaxStatusActions';\r\nimport * as types from '../../actions/actionTypes';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { getUsersCountries } from '../../reducers/userReducer';\r\n\r\ninterface RowInfoFacility extends RowInfo {\r\n original: Ifacility;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n totalPages: number;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedFacilityID: typeof setSelectedFacilityID;\r\n toggleEditFacilityModal: typeof toggleEditFacilityModal;\r\n getProductInfo: typeof getProductInfo;\r\n c: number;\r\n user: Iuser;\r\n closeAllModals: typeof closeAllModals;\r\n searchFacilityQueueForAsyncSelect: typeof searchFacilityQueueForAsyncSelect;\r\n beginAjaxCall: typeof beginAjaxCall;\r\n endAjaxCall: typeof endAjaxCall;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n tableData: Ifacility[];\r\n currentTile: Itile;\r\n filter: FacilitiesSearchParams;\r\n selectedFacility: Ifacility;\r\n showSearchFacilityModal: boolean;\r\n}\r\n\r\nconst ManangeFacilityQueue: React.FC = props => {\r\n const { t } = props;\r\n const dispatch = useDispatch();\r\n const countries = useSelector(getCountries);\r\n const usersCountries = useSelector(getUsersCountries);\r\n\r\n const buildSearchControls = (): FieldConfig => {\r\n const countriesOptions: Ioption[] = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => ({ label: c.name, value: c.id }));\r\n\r\n const mainSearchControls = {\r\n country: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'manageFacility:Country',\r\n colWidth: 4,\r\n colWidthMedium: 4,\r\n colWidthLarge: 4,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'country',\r\n defaultValue: '',\r\n isClearable: true\r\n }\r\n },\r\n facilityName: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'manageFacility:facility',\r\n colWidth: 4,\r\n type: 'text',\r\n placeholder: 'manageFacility:facilitySearchPlaceholder',\r\n defaultValue: props.tableFilters.facilityName,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: props.tableFilters.facilityName,\r\n disabled: false\r\n }\r\n },\r\n hasSAPNumber: {\r\n render: FormUtil.Checkbox,\r\n meta: {\r\n label: 'hasSAPNumber',\r\n colWidth: 4\r\n },\r\n formState: {\r\n value: false,\r\n disabled: false\r\n }\r\n }\r\n };\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...mainSearchControls }\r\n },\r\n props.t\r\n );\r\n };\r\n\r\n const columns: any[] = [\r\n {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: 'name',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'sap Facility Number',\r\n id: 'sapFacilityNumber',\r\n accessor: 'sapFacilityNumber',\r\n minWidth: 150\r\n },\r\n {\r\n Header: 'address',\r\n id: 'address',\r\n accessor: ({\r\n address,\r\n address2,\r\n city,\r\n state: facilityState,\r\n postalCode\r\n }: Ifacility) => {\r\n return (\r\n `${address ? address : ''}` +\r\n ` ${address2 ? address2 : ''},` +\r\n ` ${city ? city : ''},` +\r\n ` ${facilityState ? facilityState : ''},` +\r\n ` ${postalCode ? postalCode : ''}`\r\n );\r\n },\r\n minWidth: 300\r\n }\r\n ];\r\n\r\n const [hasSAPNumChecked, setHasSAPNumChecked] = React.useState(\r\n false\r\n );\r\n const [\r\n allFacillitesWithSearchTerm,\r\n setAllFacilitiesWithSearchTerm\r\n ] = React.useState([]);\r\n\r\n const [selectedCountry, setSelectedCountry] = React.useState<\r\n string | undefined\r\n >(undefined);\r\n const [facilityNameSearch, setFacilityNameSearch] = React.useState<\r\n string | undefined\r\n >(undefined);\r\n\r\n const [state, setState] = React.useState({\r\n selectedRow: {},\r\n columns,\r\n tableData: [],\r\n searchFieldConfig: buildSearchControls(),\r\n currentTile: emptyTile,\r\n filter: {\r\n name: '',\r\n address: '',\r\n postalCode: ''\r\n },\r\n selectedFacility: initialFacility,\r\n showSearchFacilityModal: false\r\n });\r\n\r\n React.useEffect(() => {\r\n const tableData = filterSAPNumber(\r\n allFacillitesWithSearchTerm,\r\n hasSAPNumChecked\r\n );\r\n setState(prevState => ({\r\n ...prevState,\r\n tableData\r\n }));\r\n }, [hasSAPNumChecked, allFacillitesWithSearchTerm]);\r\n\r\n const colorButton =\r\n constants.colors[\r\n `${state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoFacility | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n props.setSelectedFacilityID(rowInfo.original.id);\r\n setState({ ...state, selectedFacility: rowInfo.original });\r\n props.toggleEditFacilityModal();\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const onPageChange = (page: number) => {\r\n props.setTableFilter({ page });\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n const onPageSizeChange = (rows: number) => {\r\n props.setTableFilter({ rows, page: 0 });\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n const hideMergeFacilitiesModal = () => {\r\n setState({ ...state, showSearchFacilityModal: false });\r\n };\r\n\r\n const mergeFacilities = async (primary: string, secondary: string[]) => {\r\n const response = await mergeFacilitiesAPI(primary, secondary);\r\n if (response) {\r\n // Remove the now merged facilities from redux if they're there\r\n dispatch({\r\n type: types.MERGE_FACILITIES_SUCCESS,\r\n primaryId: primary,\r\n secondaryIds: secondary\r\n });\r\n\r\n // Remove the now merged facilities from state\r\n const updatedTableData = allFacillitesWithSearchTerm.filter(\r\n tempFacility => {\r\n if (secondary.includes(tempFacility.id)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n );\r\n\r\n setAllFacilitiesWithSearchTerm(updatedTableData);\r\n setState(prevState => ({\r\n ...prevState,\r\n showSearchFacilityModal: false\r\n }));\r\n\r\n props.toggleEditFacilityModal();\r\n\r\n toastr.success(\r\n t('Success'),\r\n t('Facilities successfully merged'),\r\n constants.toastrSuccess\r\n );\r\n } else {\r\n toastr.warning(\r\n t('Error'),\r\n t('Failed to merge Facilities'),\r\n constants.toastrError\r\n );\r\n }\r\n };\r\n\r\n const searchForFacility = (facilityID: string) => {\r\n setState({ ...state, showSearchFacilityModal: true });\r\n };\r\n\r\n const saveFacilities = (facilities: Ifacility[]) => {\r\n const updatedTableData = facilities.filter(tempFacility => {\r\n if (tempFacility.isApproved) {\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n setAllFacilitiesWithSearchTerm(updatedTableData);\r\n props.endAjaxCall();\r\n };\r\n\r\n const filterSAPNumber = (\r\n allFacilities: Ifacility[],\r\n hasSAPNumber: boolean\r\n ) =>\r\n hasSAPNumber\r\n ? allFacilities.filter(\r\n f =>\r\n f.sapFacilityNumber !== '' &&\r\n f.sapFacilityNumber !== undefined &&\r\n f.sapFacilityNumber !== null\r\n )\r\n : allFacilities;\r\n\r\n const debouncedSearch = React.useRef(\r\n debounce(async (searchTerms, countryId) => {\r\n props.beginAjaxCall();\r\n\r\n props.searchFacilityQueueForAsyncSelect(\r\n searchTerms,\r\n countryId,\r\n () => {\r\n return;\r\n },\r\n saveFacilities\r\n );\r\n }, 200)\r\n ).current;\r\n\r\n const handleNameChange = (searchTerms: string) => {\r\n if (searchTerms.length >= 3) {\r\n setFacilityNameSearch(searchTerms);\r\n debouncedSearch(searchTerms, selectedCountry);\r\n return;\r\n }\r\n\r\n if (searchTerms.length === 0) {\r\n setFacilityNameSearch(undefined);\r\n debouncedSearch(undefined, selectedCountry);\r\n return;\r\n }\r\n };\r\n\r\n const handleSAPNumChange = (value: boolean) => {\r\n setHasSAPNumChecked(value);\r\n };\r\n\r\n const handleCountryChange = (countryId: string | undefined) => {\r\n setSelectedCountry(countryId);\r\n debouncedSearch(facilityNameSearch, countryId);\r\n };\r\n\r\n const refreshData = () => {\r\n debouncedSearch(undefined, undefined);\r\n };\r\n\r\n const onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'facilityName':\r\n handleNameChange(value);\r\n break;\r\n case 'hasSAPNumber':\r\n handleSAPNumChange(value);\r\n case 'country':\r\n if (value === null) {\r\n handleCountryChange(undefined); // if null, that means the user cleared the value\r\n } else {\r\n handleCountryChange(value.value); // value will be an Ioption\r\n }\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n props.beginAjaxCall();\r\n props.searchFacilityQueueForAsyncSelect(\r\n undefined,\r\n undefined,\r\n () => {\r\n return;\r\n },\r\n saveFacilities\r\n );\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n {}}\r\n >\r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n return {\r\n tableFilters: selectManageFacilityTableFilters(state),\r\n loading: selectIsLoading(state),\r\n user: state.user\r\n };\r\n};\r\n\r\nexport default withTranslation('manageFacility')(\r\n connect(mapStateToProps, {\r\n getFacilitiesByCountry,\r\n setTableFilter,\r\n setSelectedFacilityID,\r\n toggleEditFacilityModal,\r\n searchFacilityQueueForAsyncSelect,\r\n beginAjaxCall,\r\n endAjaxCall\r\n })(ManangeFacilityQueue)\r\n);\r\n","import { beginAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { ThunkResult } from '../models';\r\n\r\nexport function getDocumentTypes(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n const url = API.cloudDocument.getAll;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LOAD_DOCUMENT_TYPES_SUCCESS,\r\n payload: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LOAD_DOCUMENT_TYPES_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get Document Types');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const setSelectedDocumentTypeID = (id: string) => ({\r\n type: types.SET_SELECTED_DOCUMENT_TYPE_ID,\r\n id\r\n});\r\n\r\nexport const clearSelectedDocumentTypeID = () => ({\r\n type: types.CLEAR_SELECTED_DOCUMENT_TYPE_ID\r\n});\r\n","import { AxiosRequestConfig, AxiosResponse } from \"axios\";\r\nimport { FormUtil } from \"../../common/FormUtil\";\r\nimport API from \"../../../constants/apiEndpoints\";\r\nimport { msalFetch } from \"../../auth/Auth-Utils\";\r\nimport { ADD_DOCUMENT_FAILED, ADD_DOCUMENT_SUCCESS, ADD_DOCUMENT_VERSION_SUCCESS, EDIT_DOCUMENT_FAILED, EDIT_DOCUMENT_SUCCESS, TOGGLE_MODAL_EDIT_DOCUMENT } from \"../../../actions/actionTypes\";\r\nimport { constants } from \"../../../constants/constants\";\r\nimport { beginAjaxCall } from \"../../../actions/ajaxStatusActions\";\r\nimport { endAjaxCall } from \"../../../actions/ajaxStatusActions\";\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { IcloudDocument } from \"../../../models\";\r\n\r\nexport function create(formValues: {\r\n [key: string]: any;\r\n}, dispatch: Function, parentId: string): Promise {\r\n dispatch(beginAjaxCall());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: FormUtil.toFormData(formValues),\r\n headers\r\n };\r\n const url = API.cloudDocument.add;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('Missing Data');\r\n } else {\r\n if (parentId) {\r\n dispatch({\r\n type: ADD_DOCUMENT_VERSION_SUCCESS,\r\n payload: data.data,\r\n parentId\r\n });\r\n } else {\r\n dispatch({\r\n type: ADD_DOCUMENT_SUCCESS,\r\n payload: data.data\r\n });\r\n }\r\n dispatch({ type: TOGGLE_MODAL_EDIT_DOCUMENT });\r\n toastr.success(\r\n 'Success',\r\n `Created Document${parentId ? ' Version' : ''}`,\r\n constants.toastrSuccess\r\n );\r\n return true;\r\n }\r\n })\r\n .catch(error => {\r\n dispatch({\r\n type: ADD_DOCUMENT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'Create Document');\r\n console.error(error);\r\n throw error;\r\n })\r\n .finally(() => dispatch(endAjaxCall()));\r\n };\r\n\r\n export function edit(\r\n formValues: { [key: string]: any },\r\n document: IcloudDocument,\r\n parentId: string, \r\n dispatch: Function\r\n): Promise {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: { ...formValues, id: document.id }\r\n };\r\n const url = `${API.cloudDocument.single}/update/${document.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (data.status !== 200) {\r\n throw new Error('Missing Data');\r\n } else {\r\n dispatch({\r\n type: EDIT_DOCUMENT_SUCCESS,\r\n payload: { ...data.data },\r\n parentId\r\n });\r\n dispatch({ type: TOGGLE_MODAL_EDIT_DOCUMENT });\r\n toastr.success(\r\n 'Success',\r\n `Update Document.`,\r\n constants.toastrSuccess\r\n );\r\n }\r\n return true;\r\n })\r\n .catch(error => {\r\n dispatch({\r\n type: EDIT_DOCUMENT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'Update Document');\r\n console.error(error);\r\n throw error;\r\n })\r\n .finally(() => dispatch(endAjaxCall()));\r\n };\r\n\r\nexport const getLastModifiedDate = ({updateDate, createDate}: IcloudDocument) => updateDate ? updateDate : createDate;","import * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { IcloudDocument } from '../../../models';\r\nimport { clearSelectedDocumentID } from '../../../actions/manageDocumentActions';\r\nimport { setSelectedDocumentTypeID } from '../../../actions/manageDocumentTypeActions';\r\n\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { constants } from '../../../constants/constants';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { TFunction } from 'i18next';\r\nimport CommonModal from '../../common/CommonModal';\r\nimport CommonMobileModal, {\r\n MobileButtonGroup\r\n} from '../../common/mobile/CommonMobileModal';\r\nimport { create, edit } from '../utils/ManageDocumentUtils';\r\n\r\nconst uuid4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n handleCancel: any;\r\n loading: boolean;\r\n colorButton: string;\r\n selectedDocument: IcloudDocument;\r\n parentId: string;\r\n parentName: string;\r\n clearSelectedDocumentID: typeof clearSelectedDocumentID;\r\n updateFormValue: (formValue: { [key: string]: any }) => void;\r\n setFormValues: (formValues: { [key: string]: any }) => void;\r\n formValues: { [key: string]: any };\r\n documentTypeOptions: any[];\r\n isVersionForm?: boolean;\r\n setSelectedDocumentTypeID: typeof setSelectedDocumentTypeID;\r\n selectedFacilityID: string;\r\n canEditDocuments: boolean;\r\n canAddDocuments: boolean;\r\n t: TFunction;\r\n show: boolean;\r\n title: string;\r\n className: string;\r\n isMobile: boolean;\r\n dispatch: Function;\r\n isEditForm: boolean;\r\n isNewForm: boolean;\r\n documentID?: string;\r\n}\r\n\r\ninterface IState {\r\n file: any;\r\n}\r\n\r\nconst EditDocumentLibraryForm: React.FC = (props: Iprops) => {\r\n const [form, setForm] = React.useState();\r\n const [state, setState] = React.useState({\r\n file: ''\r\n });\r\n\r\n const clearFile = () => setState({ file: '' });\r\n\r\n const onFileChange = (key: string, file: File) => {\r\n if (file.size > 100000000) {\r\n toastr.error(\r\n props.t('manageDocument:fileSizeWarning'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n setState({ ...state, file });\r\n };\r\n\r\n const fieldConfig = React.useMemo(() => {\r\n const formValues = props.formValues;\r\n\r\n const disabled = props.canEditDocuments === false;\r\n const countryDisabled = props.canAddDocuments === false;\r\n let {\r\n name,\r\n cloudDocumentTypeID,\r\n documentDate,\r\n filename,\r\n countryID\r\n } = props.selectedDocument;\r\n\r\n name = formValues.name || name || props.parentName;\r\n cloudDocumentTypeID = formValues.cloudDocumentTypeID\r\n ? formValues.cloudDocumentTypeID.value\r\n : cloudDocumentTypeID;\r\n filename = formValues.filename ? formValues.filename : filename;\r\n documentDate = formValues.documentDate || documentDate;\r\n countryID = formValues.countryID || countryID;\r\n const selectedType =\r\n props.documentTypeOptions.find(\r\n option =>\r\n option.value === cloudDocumentTypeID ||\r\n option.label === cloudDocumentTypeID\r\n ) || '';\r\n\r\n const fieldConfigControls = {\r\n name: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: props.parentId\r\n ? 'manageDocument:versionName'\r\n : 'manageDocument:name',\r\n colWidth: 12,\r\n type: 'input',\r\n autoFocus: true,\r\n name: 'document-name'\r\n },\r\n formState: { value: name, disabled }\r\n },\r\n cloudDocumentTypeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: props.documentTypeOptions,\r\n label: 'manageDocument:type',\r\n colWidth: 12,\r\n placeholder: 'manageDocument:selectTypePlaceholder',\r\n isMulti: false,\r\n required: true\r\n },\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n formState: { value: selectedType, disabled }\r\n },\r\n documentDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'manageDocument:date',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'document-date',\r\n placeholder: 'dd-mmm-yy'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: documentDate,\r\n disabled\r\n }\r\n },\r\n countryID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.countries,\r\n label: 'manageDocument:countryWithHelper',\r\n colWidth: 12,\r\n placeholder: 'manageDocument:countrySearchPlaceholder',\r\n name: 'country',\r\n className: 'doc-country-select'\r\n },\r\n formState: { value: countryID, disabled: countryDisabled }\r\n },\r\n file: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n accept:\r\n '.xlsx,.xls,image/*,.doc,.docx,.ppt,.pptx,.txt,.pdf,.zip',\r\n type: 'file',\r\n label: 'manageDocument:upload',\r\n colWidth: 12,\r\n name: 'document-file',\r\n required: true,\r\n onChange: onFileChange,\r\n fileName: filename\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n let fieldsConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n\r\n // don't show the file control when editing. Users must add a new version in order to add a new file.\r\n if (props.isEditForm) {\r\n fieldsConfig = {\r\n controls: {\r\n name: fieldConfigControls.name,\r\n cloudDocumentTypeID: fieldConfigControls.cloudDocumentTypeID\r\n }\r\n };\r\n } else if (props.isVersionForm) {\r\n fieldsConfig = {\r\n controls: {\r\n name: fieldConfigControls.name,\r\n documentDate: fieldConfigControls.documentDate,\r\n file: fieldConfigControls.file\r\n }\r\n };\r\n }\r\n\r\n return FormUtil.translateForm(fieldsConfig, props.t);\r\n }, [\r\n props.selectedDocument,\r\n props.documentTypeOptions.length,\r\n props.isVersionForm,\r\n props.isEditForm,\r\n props.isNewForm,\r\n props.parentId\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (props.selectedDocument.documentID !== '') {\r\n props.setFormValues({\r\n documentID: props.selectedDocument.documentID\r\n });\r\n }\r\n }, [props.selectedDocument]);\r\n\r\n const handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n\r\n if (!form) {\r\n return;\r\n }\r\n\r\n if (form.status === 'INVALID') {\r\n form.markAsSubmitted();\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n let formData = {\r\n ...form.value,\r\n facilityID: props.selectedFacilityID,\r\n cloudDocumentTypeID: form.value.cloudDocumentTypeID\r\n ? form.value.cloudDocumentTypeID.value\r\n : '',\r\n documentDate: form.value.documentDate\r\n ? moment.utc(form.value.documentDate).toISOString()\r\n : ''\r\n };\r\n\r\n if (props.selectedDocument.documentID) {\r\n formData = {\r\n ...form.value,\r\n cloudDocumentTypeID: form.value.cloudDocumentTypeID.value\r\n };\r\n }\r\n\r\n if (state.file) {\r\n formData['file'] = state.file;\r\n } else if (!props.selectedDocument.documentID) {\r\n toastr.error(\r\n 'Error',\r\n 'Please select a file.',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n if (props.isVersionForm) {\r\n formData['documentID'] = props.documentID;\r\n } else {\r\n formData['id'] = props.selectedDocument.id;\r\n }\r\n\r\n if (formData.id) {\r\n formData.file = undefined;\r\n edit(\r\n formData,\r\n props.selectedDocument,\r\n props.parentId,\r\n props.dispatch\r\n )\r\n .then(e => {\r\n clearFile();\r\n })\r\n .catch(e => {\r\n console.error('error creating doc', e);\r\n });\r\n } else {\r\n create(formData, props.dispatch, props.parentId)\r\n .then(e => {\r\n clearFile();\r\n })\r\n .catch(e => {\r\n console.error('error creating doc', e);\r\n });\r\n }\r\n };\r\n\r\n const setFormContent = (formGroup: FormGroup | FormArray) => {\r\n formGroup.meta = {\r\n loading: props.loading\r\n };\r\n setForm(formGroup);\r\n };\r\n\r\n const handleClose = () => {\r\n clearFile();\r\n props.handleCancel();\r\n props.setFormValues({});\r\n };\r\n\r\n const Buttons = () => {\r\n return (\r\n <>\r\n {' '}\r\n {\r\n props.handleCancel();\r\n props.setFormValues({});\r\n }}\r\n >\r\n {props.t('common:cancel')}\r\n \r\n \r\n {props.t('common:save')}\r\n \r\n \r\n );\r\n };\r\n\r\n if (props.isMobile) {\r\n return (\r\n
    \r\n \r\n \r\n \r\n }\r\n show={props.show}\r\n onHide={handleClose}\r\n className={''}\r\n title={props.title}\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\n \r\n );\r\n};\r\n\r\nexport default EditDocumentLibraryForm;\r\n","/*\r\n * Edit Document Modal\r\n * responsible for editing a facility\r\n * this modal is rendered inside the UserQueueForm component because we pass the selectedCustomer\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport EditDocumentLibraryForm from '../forms/EditDocumentLibraryForm';\r\nimport { IcloudDocument } from '../../../models';\r\nimport {\r\n toggleEditDocumentModal,\r\n updateDocumentFormValue,\r\n setDocumentFormValues,\r\n clearSelectedDocumentID\r\n} from '../../../actions/manageDocumentActions';\r\nimport { setSelectedDocumentTypeID } from '../../../actions/manageDocumentTypeActions';\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { constants } from '../../../constants/constants';\r\nimport { filter } from 'lodash';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { getIsMobile } from '../../../reducers/configReducer';\r\nimport { bindActionCreators } from 'redux';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n selectedDocument: IcloudDocument;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const parentId = state.manageDocument.selectedParentID;\r\n const parentName = parentId\r\n ? state.manageDocument.documentsByID[parentId]\r\n ? state.manageDocument.documentsByID[parentId].name\r\n : ''\r\n : '';\r\n const canEditDocuments = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageDocumentLibrary.id\r\n ]);\r\n const canAddDocuments = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageGeneralDocuments.id\r\n ]);\r\n const documentTypeOptions = FormUtil.convertToOptions(\r\n filter(state.manageDocumentType.documentTypesByID, type => {\r\n return true;\r\n })\r\n );\r\n let title;\r\n let isVersionForm = false;\r\n let isNewForm = false;\r\n let isEditForm = false;\r\n let documentID;\r\n if (ownProps.selectedDocument && ownProps.selectedDocument.name) {\r\n title = ownProps.t('manageDocument:editDocument');\r\n isEditForm = true;\r\n } else if (parentId) {\r\n isVersionForm = true;\r\n title = ownProps.t(`manageDocument:newVersion`);\r\n documentID = state.manageDocument.documentsByID[parentId]?.documentID;\r\n } else {\r\n isNewForm = true;\r\n title = ownProps.t(`manageDocument:newDocument`);\r\n }\r\n return {\r\n isEditForm,\r\n isNewForm,\r\n isVersionForm,\r\n documentID,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageDocument.showEditDocumentModal,\r\n formValues: state.manageDocument.documentFormValues,\r\n parentId,\r\n parentName,\r\n documentTypeOptions,\r\n selectedFacilityID: state.selectedFacilityID,\r\n canEditDocuments,\r\n canAddDocuments,\r\n title,\r\n className: 'edit-document',\r\n isMobile: getIsMobile(state)\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (\r\n dispatch: any,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const boundActions = bindActionCreators(\r\n {\r\n toggleModal: toggleEditDocumentModal,\r\n updateFormValue: updateDocumentFormValue,\r\n setFormValues: setDocumentFormValues,\r\n clearSelectedDocumentID,\r\n onHide: toggleEditDocumentModal,\r\n handleCancel: toggleEditDocumentModal,\r\n setSelectedDocumentTypeID\r\n },\r\n dispatch\r\n );\r\n return {\r\n ...boundActions,\r\n dispatch\r\n };\r\n};\r\n\r\nexport default withTranslation('manageDocument')(\r\n connect(mapStateToProps, mapDispatchToProps)(EditDocumentLibraryForm)\r\n);\r\n","import * as React from 'react';\r\nimport ReactTable, {\r\n RowRenderProps,\r\n RowInfo,\r\n Column,\r\n FinalState\r\n} from 'react-table';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { Button } from 'react-bootstrap';\r\nimport { IcloudDocument } from '../../models';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n getCloudDocument,\r\n deleteVersion,\r\n toggleEditDocumentModal,\r\n setSelectedDocumentID,\r\n clearSelectedDocumentID\r\n} from '../../actions/manageDocumentActions';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport moment from 'moment';\r\n\r\nimport NewVersionIcon from '../../images/add.svg';\r\nimport { getLastModifiedDate } from './utils/ManageDocumentUtils';\r\nimport { orderBy } from 'lodash';\r\n\r\ninterface ExpanderProps extends RowInfo {\r\n t: TFunction;\r\n addVersion: any;\r\n setSelectedVersionID: typeof setSelectedDocumentID;\r\n getCloudDocument: typeof getCloudDocument;\r\n deleteVersion: typeof deleteVersion;\r\n toggleEditVersion: typeof toggleEditDocumentModal;\r\n clearSelectedDocumentID: typeof clearSelectedDocumentID;\r\n canEditDocuments: boolean;\r\n canDeleteSystemDocuments: boolean;\r\n}\r\n\r\ninterface RowInfoVersion extends RowInfo {\r\n original: IcloudDocument;\r\n}\r\n\r\n/*\r\n * The Manage Document Version Expander\r\n */\r\nconst ManageDocumentVersionExpander = (props: ExpanderProps) => {\r\n const ExpanderButtonBar = (eProps: RowRenderProps) => {\r\n return (\r\n \r\n {\r\n props.clearSelectedDocumentID();\r\n props.addVersion();\r\n }}\r\n title={props.t('manageDocument:newVersion')}\r\n className=\"new-version-btn\"\r\n >\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const handleDelete = (deletedItem: IcloudDocument) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem\r\n };\r\n props.deleteVersion(props.original.id, deletedItem);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: props.t('common:delete'),\r\n cancelText: props.t('common:cancel')\r\n };\r\n toastr.confirm(props.t('deleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n const [tableData, setTableData] = React.useState([]);\r\n\r\n React.useEffect(() => {\r\n if (props.original.versions) {\r\n const tableData = orderBy(\r\n props.original.versions,\r\n res => moment.utc(getLastModifiedDate(res)).unix(),\r\n 'desc'\r\n );\r\n setTableData(tableData);\r\n } else {\r\n setTableData([props.original]);\r\n }\r\n }, [props.original]);\r\n\r\n /*\r\n * Handle user clicking on a location row\r\n * set the selected location to state and open the modal\r\n */\r\n const getTdProps = (\r\n state: FinalState,\r\n rowInfo: RowInfoVersion | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id && column.id === 'download-button') {\r\n return {\r\n onClick: () => {\r\n // Find the correct version to download\r\n if (rowInfo.original && props.original.versions) {\r\n const document: IcloudDocument = {\r\n ...rowInfo.original,\r\n // ensure we have a document type; often missing from version\r\n mimeType:\r\n rowInfo.original.mimeType ||\r\n props.original.mimeType, // if the version doesn't have a mimeType, use the parant doc's mimeType\r\n version: rowInfo.original.id\r\n };\r\n props.getCloudDocument(props.t, document, true);\r\n } else {\r\n // Failed to find the version (shouldn't happen) so download the original\r\n const document: IcloudDocument = {\r\n ...rowInfo.original,\r\n // ensure we have a document type; often missing from row original\r\n mimeType:\r\n rowInfo.original.mimeType ||\r\n props.original.mimeType\r\n };\r\n\r\n props.getCloudDocument(props.t, document, true);\r\n }\r\n }\r\n };\r\n } else if (\r\n rowInfo &&\r\n column &&\r\n column.id &&\r\n column.id === 'delete-button' &&\r\n props.canEditDocuments\r\n ) {\r\n return {\r\n onClick: () => {\r\n handleDelete(rowInfo.original);\r\n }\r\n };\r\n } else if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n if (rowInfo && rowInfo.original && rowInfo.original.id) {\r\n props.setSelectedVersionID(rowInfo.original.id);\r\n }\r\n props.toggleEditVersion();\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Footer: ExpanderButtonBar,\r\n minWidth: 20,\r\n id: 'indent-column-button-bar'\r\n },\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'manageDocument:modifiedDate',\r\n accessor: (doc: IcloudDocument) => {\r\n const date = getLastModifiedDate(doc);\r\n return moment(date)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n },\r\n id: 'modifiedDate',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'manageDocument:version',\r\n id: 'quantity',\r\n minWidth: 100,\r\n accessor: (doc: IcloudDocument) => {\r\n return tableData.length - tableData.indexOf(doc);\r\n }\r\n },\r\n {\r\n Header: '',\r\n id: 'download-button',\r\n Cell: (\r\n \r\n \r\n \r\n ),\r\n minWidth: 20\r\n },\r\n {\r\n Header: '',\r\n id: 'delete-button',\r\n Cell: ({ original }: { original: IcloudDocument }) => {\r\n if (\r\n !props.canEditDocuments ||\r\n (original.isSystem && !props.canDeleteSystemDocuments)\r\n ) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n },\r\n minWidth: 20\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n return (\r\n
    \r\n = 10\r\n : false\r\n }\r\n />\r\n
    \r\n );\r\n};\r\n\r\nexport default ManageDocumentVersionExpander;\r\n","import * as React from 'react';\r\nimport { TFunction } from 'i18next';\r\nimport { Banner } from '../../common/Banner';\r\nimport { SelectFacilityContainer } from '../../common/SelectFacilityContainer';\r\nimport { IcloudDocument, ItableFiltersReducer, Itile } from '../../../models';\r\nimport { emptyTile } from '../../../reducers/initialState';\r\nimport ReactTable, { Column, FinalState } from 'react-table';\r\nimport { TableUtil } from '../../common/TableUtil';\r\nimport { setTableFilter } from '../../../actions/manageDocumentActions';\r\nimport { Button } from 'react-bootstrap';\r\nimport { RowInfoDocument } from '../ManageDocumentLibrary';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n currentTile: Itile;\r\n selectedCloudDocument: IcloudDocument;\r\n totalPages: number;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n documentTypeOptions: { [key: string]: any };\r\n goBack: () => void;\r\n newVersion: (parentDocumentID: string) => void;\r\n editDoc: (documentID: string) => void;\r\n downloadDocument: (selectedCloudDocument: IcloudDocument) => void;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n tableData: any[];\r\n columns: any[];\r\n}\r\n\r\nconst ManageDocumentVersions: React.FC = (props: Iprops) => {\r\n const { t, selectedCloudDocument } = props;\r\n\r\n const mobileColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: ({ name }: IcloudDocument) => {\r\n return (\r\n <>\r\n NAME\r\n \r\n {name}\r\n \r\n \r\n );\r\n }\r\n },\r\n {\r\n Header: 'createDate',\r\n accessor: ({ createDate }: IcloudDocument) => {\r\n return (\r\n <>\r\n DATE\r\n \r\n {createDate}\r\n \r\n \r\n );\r\n },\r\n id: 'dcreateDateate'\r\n }\r\n ],\r\n props.t\r\n );\r\n\r\n const [state, setState] = React.useState({\r\n selectedRow: {},\r\n tableData: selectedCloudDocument.versions\r\n ? selectedCloudDocument.versions\r\n : [],\r\n columns: mobileColumns\r\n });\r\n\r\n const onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n props.setTableFilter({ page: newPage });\r\n };\r\n\r\n const getDocumentType = () => {\r\n const id = props.selectedCloudDocument.cloudDocumentTypeID;\r\n\r\n if (id === undefined || id === null || id === '') {\r\n return '';\r\n }\r\n\r\n if (props.documentTypeOptions && props.documentTypeOptions[id]) {\r\n return props.documentTypeOptions[id].name;\r\n } else {\r\n return '';\r\n }\r\n };\r\n\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoDocument | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n props.editDoc(rowInfo.original.id);\r\n }\r\n };\r\n }\r\n\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 props.goBack();\r\n }}\r\n >\r\n {t(`measurementPoints:close`)}\r\n \r\n {\r\n props.newVersion(props.selectedCloudDocument.id);\r\n }}\r\n >\r\n {t(`manageDocument:newVersion`)}\r\n \r\n
    \r\n\r\n
    \r\n {\r\n props.downloadDocument(props.selectedCloudDocument);\r\n }}\r\n >\r\n Download\r\n \r\n
    \r\n\r\n
    \r\n \r\n {props.selectedCloudDocument.name}\r\n \r\n {getDocumentType()}\r\n
    \r\n\r\n = 10 ? state.tableData.length : 10\r\n }\r\n pages={props.totalPages}\r\n page={props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${props.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n
    \r\n );\r\n};\r\n\r\nexport default ManageDocumentVersions;\r\n","/*\r\n *\r\n */\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport CommonModal from '../../common/CommonModal';\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport React, { useEffect, useMemo } from 'react';\r\nimport { beginAjaxCall, endAjaxCall } from '../../../actions/ajaxStatusActions';\r\nimport { msalFetch } from '../../auth/Auth-Utils';\r\nimport API from '../../../constants/apiEndpoints';\r\nimport { IcloudDocument } from '../../../models';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport ReactTable from 'react-table';\r\nimport { TableUtil } from '../../common/TableUtil';\r\n\r\ninterface Iprops {\r\n showModal: boolean;\r\n hideModal: () => void;\r\n colorButton: string;\r\n document: IcloudDocument;\r\n specificVersion: boolean;\r\n}\r\n\r\ninterface documentPreview {\r\n productName: string;\r\n closingNotes: string;\r\n}\r\n\r\nconst PreviewDocumentModal: React.FC = props => {\r\n const { t } = props;\r\n const [tableData, setTableData] = React.useState([] as documentPreview[]);\r\n\r\n const getDocumentPreview = async () => {\r\n beginAjaxCall();\r\n\r\n try {\r\n let url;\r\n if (props.specificVersion) {\r\n url = `${API.cloudDocument.preview}/${props.document.documentID}/version/${props.document.id}`;\r\n } else {\r\n url = `${API.cloudDocument.preview}/${props.document.documentID}`;\r\n }\r\n const response = await msalFetch(url, {\r\n method: 'get',\r\n params: {}\r\n });\r\n\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n const data = response.data as documentPreview[];\r\n setTableData(data);\r\n }\r\n } catch (error) {\r\n console.error('Failed to load preview', error);\r\n toastr.error(t('toastMessage:error'), 'Failed to load preview');\r\n } finally {\r\n endAjaxCall();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (props.showModal) {\r\n setTableData([]);\r\n getDocumentPreview();\r\n }\r\n }, [props.showModal]);\r\n\r\n const columns = useMemo(() => {\r\n const closingNotesColumn = {\r\n Header: 'Closing Notes',\r\n accessor: ({ closingNotes }: documentPreview) => {\r\n if (closingNotes === '' || closingNotes === undefined) {\r\n return '';\r\n }\r\n const notesJsonObject = JSON.parse(closingNotes);\r\n\r\n if (notesJsonObject !== null && notesJsonObject.length > 0) {\r\n return notesJsonObject[0].Text;\r\n }\r\n\r\n return '';\r\n },\r\n id: 'createdDate',\r\n minWidth: 200\r\n };\r\n\r\n const productNameColumn = {\r\n Header: 'Product',\r\n accessor: 'productName',\r\n minWidth: 200\r\n };\r\n\r\n return TableUtil.translateHeaders(\r\n [\r\n ...(tableData.length > 0 ? [productNameColumn] : []),\r\n ...(tableData.length > 0 ? [closingNotesColumn] : [])\r\n ],\r\n t\r\n );\r\n }, [tableData, t]);\r\n\r\n return (\r\n <>\r\n props.hideModal}\r\n title={t('manageDocument:previewTitle')}\r\n container={document.getElementById('two-pane-layout')}\r\n secondModal={false}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n props.hideModal()}\r\n >\r\n {t('common:doneButton')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('manageDocument')(PreviewDocumentModal);\r\n","import { initialDocumentType } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { IDocumentType, ImanageDocumentTypeReducer } from '../models';\r\nimport { pickBy, map, keyBy } from 'lodash';\r\nimport {\r\n createSelectedIDWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { combineReducers } from 'redux';\r\nimport { IinitialState } from '.';\r\n\r\nexport const documentTypeSelector = (state: IinitialState) =>\r\n state.manageDocumentType.documentTypesByID;\r\n\r\nexport function documentTypesByID(\r\n state: { [key: string]: IDocumentType } = {},\r\n action: any\r\n): { [key: string]: IDocumentType } {\r\n switch (action.type) {\r\n case types.LOAD_DOCUMENT_TYPES_SUCCESS: {\r\n const newDocumentTypes = map(action.payload, type => {\r\n return {\r\n ...initialDocumentType,\r\n ...pickBy(type, (property, key) => property !== null)\r\n };\r\n }) as IDocumentType[];\r\n return { ...state, ...keyBy(newDocumentTypes, 'id') };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst documentTypeManage = combineReducers({\r\n documentTypesByID,\r\n selectedDocumentTypeID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'DOCUMENT_TYPE_ID')\r\n});\r\n\r\nexport default documentTypeManage;\r\n","import * as React from 'react';\r\nimport moment from 'moment';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nimport { withTranslation } from 'react-i18next';\r\nimport {\r\n IcloudDocument,\r\n Ioption,\r\n IproductInfo,\r\n ItableFiltersReducer,\r\n Itile\r\n} from '../../models';\r\nimport ReactTable, { CellInfo, Column, FinalState, RowInfo } from 'react-table';\r\nimport {\r\n clearSelectedDocumentID,\r\n clearSelectedParentID,\r\n deleteVersion,\r\n getCloudDocument,\r\n getDocuments,\r\n setSelectedDocumentID,\r\n setSelectedParentID,\r\n setTableFilter,\r\n toggleEditDocumentModal\r\n} from '../../actions/manageDocumentActions';\r\nimport { getDocumentTypes } from '../../actions/manageDocumentTypeActions';\r\nimport { emptyTile, initialDocument } from '../../reducers/initialState';\r\nimport { map } from 'lodash';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport EditDocumentLibraryModal from './dialogs/EditDocumentLibraryModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { Iuser } from '../../models';\r\nimport ManageDocumentVersionExpander from './ManageDocumentVersionExpander';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect, useSelector } from 'react-redux';\r\nimport {\r\n constants,\r\n DOCUMENT_TYPE_VISIT_REPORT,\r\n DocumentTypesEnum\r\n} from '../../constants/constants';\r\nimport {\r\n getFacilitiesByCountry,\r\n closeAllModals\r\n} from '../../actions/commonActions';\r\nimport { IinitialState } from '../../reducers';\r\nimport { TFunction } from 'i18next';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport ManageDocumentVersions from './mobile/ManageDocumentVersions';\r\nimport { selectSelectedFacilityID } from '../../reducers/facilitiesReducer';\r\nimport {\r\n DocumentGroups,\r\n dateRangeEnum,\r\n jobTypesIdEnum\r\n} from '../../models-enums';\r\nimport PreviewDocumentModal from './dialogs/PreviewDocumentModal';\r\nimport PreviewDocument from '../../images/icons/Preview.svg';\r\nimport { getLastModifiedDate } from './utils/ManageDocumentUtils';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { documentTypeSelector } from '../../reducers/documentTypeReducer';\r\nexport interface RowInfoDocument extends RowInfo {\r\n original: IcloudDocument;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n tableData: IcloudDocument[];\r\n totalPages: number;\r\n showEditDocumentModal: boolean;\r\n getDocumentTypes: typeof getDocumentTypes;\r\n getDocuments: typeof getDocuments;\r\n toggleEditDocumentModal: typeof toggleEditDocumentModal;\r\n loading: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n setSelectedParentID: typeof setSelectedParentID;\r\n clearSelectedParentID: typeof clearSelectedParentID;\r\n setSelectedDocumentID: typeof setSelectedDocumentID;\r\n clearSelectedDocumentID: typeof clearSelectedDocumentID;\r\n getCloudDocument: typeof getCloudDocument;\r\n deleteVersion: typeof deleteVersion;\r\n selectedDocument: IcloudDocument;\r\n getFacilitiesByCountry: typeof getFacilitiesByCountry;\r\n getProductInfo: typeof getProductInfo;\r\n user: Iuser;\r\n selectedFacilityID: string;\r\n canEditDocuments: boolean;\r\n canAddDocuments: boolean;\r\n canDeleteSystemDocuments: boolean;\r\n mainCategoryOptions: Ioption[];\r\n productInfo: IproductInfo;\r\n closeAllModals: typeof closeAllModals;\r\n t: TFunction;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n modalVersionVisible: boolean;\r\n selectedCloudDocument: IcloudDocument;\r\n filterLength: number;\r\n showPreviewDocumentModal: boolean;\r\n documentToPreview: IcloudDocument;\r\n previewSpecificVersion: boolean;\r\n}\r\n\r\nconst isInstallBaseSearch = (): boolean => {\r\n const regex = /^\\?installbaseId=.*$/i;\r\n const location = window.location.search;\r\n return location !== '' && location.match(regex) !== null;\r\n};\r\n\r\nconst ManageDocumentLibrary: React.FC = (\r\n props: IdispatchProps,\r\n routeProps: Iprops\r\n) => {\r\n const documentTypeOptions = useSelector(documentTypeSelector);\r\n const isMobile = useSelector(getIsMobile);\r\n const selectedFacilityID = useSelector(selectSelectedFacilityID);\r\n const prevSelectedFacilityID = React.useRef(selectedFacilityID);\r\n const location = useLocation();\r\n const resetFilters = () => {\r\n props.setTableFilter({\r\n assetSearch: '',\r\n name: undefined,\r\n mainCategory: undefined,\r\n type: undefined,\r\n dateRange: undefined,\r\n isSystem: undefined,\r\n jobType: undefined\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n prevSelectedFacilityID.current = selectedFacilityID;\r\n }, [selectedFacilityID]);\r\n\r\n const fieldConfig = React.useMemo(() => {\r\n if (selectedFacilityID !== prevSelectedFacilityID.current) {\r\n resetFilters();\r\n\r\n props.getDocuments(props.t, {});\r\n }\r\n\r\n const isInstallBase = isInstallBaseSearch();\r\n const mainSearchControls = {\r\n assetSearch: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'manageDocument:assetAndJob',\r\n colWidth: isMobile ? 12 : 3,\r\n colWidthLarge: 2,\r\n type: 'text',\r\n placeholder: isMobile\r\n ? 'common:searchNamePlaceholder'\r\n : 'common:searchPlaceholder',\r\n defaultValue: isInstallBase\r\n ? ''\r\n : props.tableFilters.assetSearch,\r\n isClearable: true\r\n },\r\n formState: { disabled: isInstallBase, value: '' }\r\n },\r\n mainCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:mainCategory',\r\n options: props.mainCategoryOptions,\r\n colWidth: isMobile ? 12 : 3,\r\n colWidthLarge: 2,\r\n type: 'select',\r\n placeholder: 'common:selectPlaceholder',\r\n defaultValue: '',\r\n isClearable: true\r\n }\r\n },\r\n type: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageDocument:type',\r\n options: FormUtil.convertToOptions(documentTypeOptions),\r\n colWidth: isMobile ? 12 : 3,\r\n colWidthLarge: 2,\r\n type: 'select',\r\n placeholder: isMobile\r\n ? 'common:selectTypePlaceholder'\r\n : 'DocumentType',\r\n defaultValue: isInstallBase ? '' : props.tableFilters.type,\r\n isClearable: true\r\n }\r\n },\r\n jobType: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageDocument:jobType',\r\n options: FormUtil.convertEnumToOptions(jobTypesIdEnum),\r\n colWidth: isMobile ? 12 : 2,\r\n colWidthMedium: isMobile ? 12 : 2,\r\n colWidthLarge: 2,\r\n type: 'select',\r\n placeholder: isMobile\r\n ? 'common:selectTypePlaceholder'\r\n : 'DocumentType',\r\n defaultValue: isInstallBase\r\n ? ''\r\n : props.tableFilters.jobType,\r\n isClearable: true,\r\n shouldTranslate: true\r\n }\r\n },\r\n dateRange: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageDocument:date',\r\n options: FormUtil.convertEnumToOptions(dateRangeEnum),\r\n colWidth: isMobile ? 12 : 2,\r\n colWidthLarge: 2,\r\n dataType: 'date-filter',\r\n placeholder: 'manageDocument:quarterYearAllTime',\r\n isClearable: true,\r\n shouldTranslate: true,\r\n type: 'select',\r\n defaultValue: isInstallBase\r\n ? ''\r\n : props.tableFilters.dateRange\r\n }\r\n },\r\n isSystem: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageDocument:system',\r\n options: [\r\n {\r\n value: 'true',\r\n label: 'manageDocument:yes'\r\n },\r\n {\r\n value: 'false',\r\n label: 'manageDocument:no'\r\n }\r\n ],\r\n colWidth: isMobile ? 12 : 2,\r\n colWidthLarge: 2,\r\n colWidthMedium: isMobile ? 12 : 2,\r\n type: 'select',\r\n placeholder: 'common:selectPlaceholder',\r\n defaultValue: props.tableFilters.isSystem,\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n disabled: isInstallBase,\r\n value: isInstallBase\r\n ? {\r\n value: 'true',\r\n label: props.t('manageDocument:yes')\r\n }\r\n : ''\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n }, [\r\n documentTypeOptions,\r\n prevSelectedFacilityID,\r\n selectedFacilityID,\r\n location.search\r\n ]);\r\n\r\n const [state, setState] = React.useState({\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n modalVersionVisible: false,\r\n selectedCloudDocument: initialDocument,\r\n filterLength: 0,\r\n showPreviewDocumentModal: false,\r\n documentToPreview: initialDocument,\r\n previewSpecificVersion: false\r\n });\r\n let debounce: any;\r\n\r\n const onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n const setColumns = () => {\r\n if (isMobile) {\r\n const mobileColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n // eslint-disable-next-line no-shadow\r\n Cell: props => (\r\n
    \r\n

    \r\n Name\r\n

    {' '}\r\n

    \r\n {props.value}\r\n

    \r\n
    \r\n )\r\n },\r\n {\r\n Header: 'type',\r\n accessor: ({ cloudDocumentTypeID }: IcloudDocument) => {\r\n if (\r\n documentTypeOptions &&\r\n documentTypeOptions[cloudDocumentTypeID]\r\n ) {\r\n return documentTypeOptions[cloudDocumentTypeID]\r\n .name;\r\n } else {\r\n return '';\r\n }\r\n },\r\n id: 'type',\r\n // eslint-disable-next-line no-shadow\r\n Cell: props => (\r\n
    \r\n

    \r\n Type\r\n

    {' '}\r\n

    \r\n {props.value}\r\n

    \r\n
    \r\n )\r\n }\r\n ],\r\n props.t\r\n );\r\n setState({ ...state, columns: mobileColumns });\r\n } else {\r\n // Desktop\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggleFolder,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n Header: '',\r\n accessor: 'name',\r\n minWidth: 200,\r\n Aggregated: ,\r\n Expander: TableUtil.expanderToggleFolder\r\n },\r\n {\r\n pivot: true,\r\n id: 'groupType',\r\n Expander: TableUtil.expanderToggleFolder,\r\n Aggregated: ,\r\n accessor: ({ groupType }: IcloudDocument) =>\r\n props.t(\r\n `manageDocument:${\r\n DocumentGroups[groupType || 0]\r\n }`\r\n ),\r\n Header: 'Folder',\r\n PivotValue: (cellInfo: CellInfo, column: any) => (\r\n {cellInfo.row._pivotVal}\r\n )\r\n },\r\n {\r\n pivot: true,\r\n Header: '',\r\n Expander: TableUtil.expanderToggleFolder,\r\n Aggregated: ,\r\n accessor: ({\r\n cloudDocumentTypeID,\r\n otherGroup\r\n }: IcloudDocument) => {\r\n if (otherGroup) {\r\n return props.t('manageDocument:other');\r\n }\r\n if (\r\n documentTypeOptions &&\r\n documentTypeOptions[cloudDocumentTypeID]\r\n ) {\r\n return documentTypeOptions[cloudDocumentTypeID]\r\n .name;\r\n } else {\r\n return '';\r\n }\r\n },\r\n id: 'type',\r\n PivotValue: (cellInfo: CellInfo, column: any) => (\r\n {cellInfo.row._pivotVal}\r\n )\r\n },\r\n {\r\n id: 'updateDate',\r\n Header: 'manageDocument:modifiedDate',\r\n aggregate: (values, row) => {\r\n if (values.length === 1) {\r\n return values[0];\r\n }\r\n const dates = values.map((s: string) =>\r\n moment(s, 'DD-MMM-YY')\r\n );\r\n return moment\r\n .max(dates)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n },\r\n accessor: (doc: IcloudDocument) =>\r\n moment(getLastModifiedDate(doc))\r\n .local(true)\r\n .format('DD-MMM-YY')\r\n },\r\n {\r\n Header: 'files',\r\n aggregate: (values, rows) => {\r\n if (rows[0]._subRows) {\r\n return rows.reduce(\r\n (acc: number, row: any) =>\r\n acc + row._subRows.length,\r\n 0\r\n );\r\n } else {\r\n return rows.length;\r\n }\r\n }\r\n },\r\n {\r\n Header: '',\r\n id: 'preview-button',\r\n Cell: ({ original }: { original: IcloudDocument }) => {\r\n if (\r\n original.isSystem === true &&\r\n original.cloudDocumentTypeID.toLowerCase() ===\r\n DOCUMENT_TYPE_VISIT_REPORT.toLowerCase()\r\n ) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n return null;\r\n },\r\n minWidth: 30\r\n },\r\n {\r\n Header: '',\r\n id: 'download-latest',\r\n Cell: (\r\n \r\n \r\n \r\n ),\r\n minWidth: 30\r\n }\r\n ],\r\n props.t\r\n );\r\n setState({ ...state, columns });\r\n }\r\n };\r\n\r\n /*\r\n * Collapse all table\r\n */\r\n const collapseTable = () => {\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n const showLatestDocumentPreview = (doc: IcloudDocument) => {\r\n setState({\r\n ...state,\r\n showPreviewDocumentModal: true,\r\n documentToPreview: doc,\r\n previewSpecificVersion: false\r\n });\r\n };\r\n\r\n /*\r\n * Handle user clicking on a product row column\r\n * set the selected product to state and open the modal\r\n */\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoDocument | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (isMobile) {\r\n if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n setState({\r\n ...state,\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n },\r\n selectedCloudDocument:\r\n props.tableData[rowInfo.viewIndex || 0]\r\n });\r\n }\r\n };\r\n }\r\n\r\n return {};\r\n } else {\r\n // Desktop\r\n if (rowInfo) {\r\n if (\r\n rowInfo &&\r\n column &&\r\n column.id &&\r\n column.id === 'download-latest'\r\n ) {\r\n return {\r\n onClick: () => {\r\n if (rowInfo.original && rowInfo.original.versions) {\r\n const latest = rowInfo.original.versions.reduce(\r\n (prev, current) => {\r\n return moment\r\n .utc(getLastModifiedDate(prev))\r\n .isAfter(\r\n moment.utc(\r\n getLastModifiedDate(current)\r\n )\r\n )\r\n ? prev\r\n : current;\r\n }\r\n );\r\n const document: IcloudDocument = {\r\n ...latest,\r\n // ensure we have a document type; often missing from version\r\n mimeType:\r\n latest.mimeType ||\r\n rowInfo.original.mimeType\r\n };\r\n\r\n props.getCloudDocument(props.t, document, true);\r\n }\r\n }\r\n };\r\n } else if (\r\n rowInfo &&\r\n column &&\r\n column.id &&\r\n column.id === 'preview-button'\r\n ) {\r\n return {\r\n onClick: () => {\r\n if (rowInfo.original && rowInfo.original.versions) {\r\n const index = rowInfo.original.versions.length;\r\n const version =\r\n rowInfo.original.versions[index - 1];\r\n const document: IcloudDocument = {\r\n ...version,\r\n // ensure we have a document type; often missing from version\r\n mimeType:\r\n version.mimeType ||\r\n rowInfo.original.mimeType\r\n };\r\n showLatestDocumentPreview(document);\r\n }\r\n }\r\n };\r\n } else {\r\n return {\r\n onClick: (e: any, handleOriginal: any) => {\r\n if (rowInfo.level === 0 || rowInfo.level === 1) {\r\n handleOriginal();\r\n } else {\r\n handleOriginal();\r\n if (\r\n !state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ] &&\r\n rowInfo.original\r\n ) {\r\n props.setSelectedParentID(\r\n rowInfo.original.id\r\n );\r\n } else {\r\n props.clearSelectedParentID();\r\n }\r\n }\r\n }\r\n };\r\n }\r\n } else {\r\n return {};\r\n }\r\n }\r\n };\r\n\r\n const onSearchValueChanges = (value: any, key: string) => {\r\n console.log('key', key);\r\n switch (key) {\r\n case 'assetSearch':\r\n case 'name':\r\n clearTimeout(debounce);\r\n debounce = setTimeout(() => {\r\n props.setTableFilter({ [key]: value });\r\n props.getDocuments(props.t, {\r\n ...props.tableFilters,\r\n [key]: value\r\n });\r\n }, 1000);\r\n break;\r\n case 'mainCategory':\r\n props.setTableFilter({ mainCategory: value });\r\n props.getDocuments(props.t, {\r\n ...props.tableFilters,\r\n mainCategoryID: value?.value\r\n });\r\n break;\r\n case 'type':\r\n props.setTableFilter({\r\n type: value,\r\n page: 1\r\n });\r\n props.getDocuments(props.t, {\r\n ...props.tableFilters,\r\n type: value\r\n });\r\n break;\r\n case 'dateRange':\r\n case 'isSystem':\r\n case 'jobType':\r\n props.setTableFilter({\r\n [key]: value\r\n });\r\n props.getDocuments(props.t, {\r\n ...props.tableFilters,\r\n [key]: value\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n const goBack = () => {\r\n props.clearSelectedParentID();\r\n props.clearSelectedDocumentID();\r\n setState({ ...state, selectedRow: {} });\r\n };\r\n\r\n const newVersion = (parentDocumentID: string) => {\r\n props.clearSelectedDocumentID();\r\n props.setSelectedParentID(parentDocumentID);\r\n props.toggleEditDocumentModal();\r\n };\r\n\r\n const editDoc = (documentID: string) => {\r\n props.setSelectedDocumentID(documentID);\r\n props.toggleEditDocumentModal();\r\n };\r\n\r\n React.useEffect(() => {\r\n props.getDocumentTypes();\r\n setColumns();\r\n\r\n if (!props.productInfo) {\r\n props.getProductInfo();\r\n }\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n setColumns();\r\n }, [Object.keys(documentTypeOptions).length]);\r\n\r\n React.useEffect(() => {\r\n props.getDocumentTypes();\r\n setColumns();\r\n }, [selectedFacilityID]);\r\n\r\n React.useEffect(() => {\r\n if (location.search === '' && selectedFacilityID.length) {\r\n props.getDocuments(props.t, props.tableFilters);\r\n } else if (selectedFacilityID.length) {\r\n props.getDocuments(props.t, {});\r\n }\r\n }, [location.search]);\r\n\r\n const downloadMobileDocument = (selectedCloudDocument: IcloudDocument) => {\r\n props.getCloudDocument(props.t, selectedCloudDocument, true);\r\n };\r\n\r\n React.useEffect(() => {\r\n setState(currState => ({\r\n ...currState,\r\n filterLength: Object.keys(fieldConfig.controls).length\r\n }));\r\n }, [fieldConfig.controls]);\r\n\r\n const { t, tableData, tableFilters, totalPages } = props;\r\n\r\n // Mobile and a row has been selected\r\n if (\r\n isMobile &&\r\n state.selectedRow &&\r\n Object.keys(state.selectedRow).length > 0\r\n ) {\r\n return (\r\n <>\r\n \r\n\r\n \r\n \r\n );\r\n }\r\n // Mobile and no row selected\r\n else if (isMobile) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {props.canEditDocuments && (\r\n {\r\n collapseTable();\r\n props.clearSelectedParentID();\r\n props.clearSelectedDocumentID();\r\n props.toggleEditDocumentModal();\r\n }}\r\n >\r\n {t(`manageDocument:newDocument`)}\r\n \r\n )}\r\n = 10 ? tableData.length : 10}\r\n pages={totalPages}\r\n page={tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n key={'id'}\r\n />\r\n\r\n \r\n
    \r\n );\r\n }\r\n\r\n // Desktop\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {props.canEditDocuments && (\r\n \r\n {\r\n collapseTable();\r\n props.clearSelectedParentID();\r\n props.clearSelectedDocumentID();\r\n props.toggleEditDocumentModal();\r\n }}\r\n >\r\n {t(`manageDocument:newDocument`)}\r\n \r\n \r\n )}\r\n \r\n {state.columns && state.columns.length > 0 && (\r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n pivotBy={['groupType', 'type']}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n onExpandedChange={e => {\r\n setState({\r\n ...state,\r\n selectedRow: e\r\n });\r\n }}\r\n SubComponent={(rowInfo: RowInfo) => (\r\n {\r\n props.setSelectedParentID(rowInfo.original.id);\r\n props.toggleEditDocumentModal();\r\n }}\r\n canEditDocuments={props.canEditDocuments}\r\n canDeleteSystemDocuments={\r\n props.canDeleteSystemDocuments\r\n }\r\n toggleEditVersion={props.toggleEditDocumentModal}\r\n getCloudDocument={props.getCloudDocument}\r\n deleteVersion={props.deleteVersion}\r\n setSelectedVersionID={props.setSelectedDocumentID}\r\n clearSelectedDocumentID={\r\n props.clearSelectedDocumentID\r\n }\r\n t={props.t}\r\n />\r\n )}\r\n expanded={state.selectedRow}\r\n />\r\n )}\r\n \r\n\r\n {\r\n setState({ ...state, showPreviewDocumentModal: false });\r\n }}\r\n colorButton={\r\n constants.colors[\r\n `${state.currentTile.color}Button` as keyof typeof constants.colors\r\n ]\r\n }\r\n />\r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n let tableData = Object.values(state.manageDocument.documentsByID);\r\n\r\n // We need to move all AGSSSchematic to AGSReblancing\r\n tableData = tableData.map((document: IcloudDocument) => {\r\n // Set the document type to AGSReblancing\r\n if (\r\n document.cloudDocumentTypeID.toUpperCase() ===\r\n DocumentTypesEnum.AGSSSchematic\r\n ) {\r\n document.cloudDocumentTypeID = DocumentTypesEnum.AGSReblancing.toLocaleLowerCase();\r\n\r\n // Now set all the versions as well\r\n document.versions = document.versions?.map(\r\n (version: IcloudDocument) => {\r\n version.cloudDocumentTypeID =\r\n DocumentTypesEnum.AGSReblancing;\r\n return version;\r\n }\r\n );\r\n }\r\n\r\n return document;\r\n });\r\n\r\n let selectedDocument =\r\n state.manageDocument.documentsByID[\r\n state.manageDocument.selectedDocumentID\r\n ];\r\n selectedDocument = selectedDocument ? selectedDocument : initialDocument;\r\n\r\n if (selectedDocument === initialDocument) {\r\n map(state.manageDocument.documentsByID, (document: any) => {\r\n map(document.versions, (version: IcloudDocument) => {\r\n if (version.id === state.manageDocument.selectedDocumentID) {\r\n selectedDocument = version;\r\n }\r\n });\r\n });\r\n }\r\n const canEditDocuments = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageDocumentLibrary.id\r\n ]);\r\n const canAddDocuments = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageGeneralDocuments.id\r\n ]);\r\n const canDeleteSystemDocuments = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageSystemDocuments.id\r\n ]);\r\n\r\n return {\r\n selectedDocument,\r\n tableData,\r\n totalPages: state.manageDocument.totalPages,\r\n showEditDocumentModal: state.manageDocument.showEditDocumentModal,\r\n tableFilters: state.manageDocument.tableFilters,\r\n user: state.user,\r\n canEditDocuments,\r\n canAddDocuments,\r\n canDeleteSystemDocuments,\r\n mainCategoryOptions: state?.productInfo?.mainCategoryOptions,\r\n productInfo: state?.productInfo\r\n };\r\n};\r\n\r\nexport default withTranslation('manageDocument')(\r\n connect(mapStateToProps, {\r\n getDocumentTypes,\r\n getDocuments,\r\n toggleEditDocumentModal,\r\n setTableFilter,\r\n setSelectedParentID,\r\n clearSelectedParentID,\r\n setSelectedDocumentID,\r\n clearSelectedDocumentID,\r\n getCloudDocument,\r\n deleteVersion,\r\n getFacilitiesByCountry,\r\n closeAllModals,\r\n getProductInfo\r\n })(ManageDocumentLibrary)\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport {\r\n Ioption,\r\n Iphoto,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport Gallery from 'react-photo-gallery';\r\nimport Carousel, { Modal, ModalGateway } from 'react-images';\r\nimport { debounce, filter, keyBy, orderBy, pickBy } from 'lodash';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\n\r\nimport {\r\n deleteMultiplePhotos,\r\n getPhotos,\r\n setTableFilter\r\n} from '../../actions/manageAssetPhotosActions';\r\nimport { initInventory } from '../../actions/manageInventoryActions';\r\nimport { getFacility } from '../../actions/manageLocationActions';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport { Button } from 'react-bootstrap';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IproductInfo } from '../../models';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { IinitialState } from '../../reducers';\r\nimport { dateRangeEnum } from '../../models-enums';\r\nimport { getJobOptionsFromFilters } from '../../reducers/manageJobReducer';\r\nimport { getJobsByID } from '../../actions/manageJobActions';\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n getPhotos: typeof getPhotos;\r\n deleteMultiplePhotos: typeof deleteMultiplePhotos;\r\n galleryData: Iphoto[];\r\n t: TFunction;\r\n jobOptions: Ioption[];\r\n loading: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n documentTypeOptions: { [key: string]: any };\r\n productInfo: IproductInfo;\r\n initInventory: typeof initInventory;\r\n getFacility: typeof getFacility;\r\n selectedFacilityID: string;\r\n getJobsByID: typeof getJobsByID;\r\n user: Iuser;\r\n}\r\n\r\ninterface Istate {\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n activePhoto: number;\r\n lightboxIsOpen: boolean;\r\n selectionEnabled: boolean;\r\n selectedPhotos: { [key: string]: boolean };\r\n canManageAssets: boolean;\r\n}\r\n\r\nclass ManageAssetPhotos extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n // convert gallery data to `[id]: [selectedState]` list object\r\n private selectedPhotos = this.props.galleryData.reduce(\r\n (obj: { [key: string]: boolean }, photo: Iphoto) => (\r\n (obj[photo.id] = false), obj\r\n ),\r\n {}\r\n );\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n\r\n // Everyone with ViewIntentory SF can view this page, but only those with\r\n // ManageInventory SF can do any updates like Delete\r\n const canManageAssets = constants.hasSecurityFunction(props.user, [\r\n constants.securityFunctions.ManageInventory.id\r\n ]);\r\n\r\n this.state = {\r\n currentTile: emptyTile,\r\n // TODO follow manageJobs example\r\n searchFieldConfig: { controls: this.buildSearchControls() },\r\n activePhoto: 0,\r\n lightboxIsOpen: false,\r\n selectionEnabled: false,\r\n selectedPhotos: this.selectedPhotos,\r\n canManageAssets\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n searchFieldConfig: this.buildSearchControls()\r\n });\r\n if (this.props.selectedFacilityID !== '') {\r\n this.props.getPhotos();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.selectedFacilityID !== this.props.selectedFacilityID &&\r\n this.props.selectedFacilityID.length\r\n ) {\r\n const { selectedFacilityID } = this.props;\r\n this.props.getFacility(selectedFacilityID);\r\n this.props.initInventory(selectedFacilityID, () => {\r\n return;\r\n });\r\n this.props.getPhotos();\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters) &&\r\n this.props.selectedFacilityID.length\r\n ) {\r\n this.props.getPhotos();\r\n }\r\n }\r\n\r\n defaultDateRange = () =>\r\n FormUtil.convertToSingleOption({\r\n id: dateRangeEnum.thisQuarter.toString(),\r\n label: this.props.t(\r\n `manageLeads:${dateRangeEnum[dateRangeEnum.thisQuarter]}`\r\n )\r\n });\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const {\r\n assetSearch,\r\n mainCategory,\r\n jobSearch,\r\n dateRange = this.defaultDateRange()\r\n } = this.props.tableFilters;\r\n\r\n const mainSearchControls = {\r\n assetSearch: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'product/asset',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'common:searchPlaceholder',\r\n defaultValue: assetSearch,\r\n isClearable: true\r\n }\r\n },\r\n mainCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:category',\r\n options: this.props.productInfo.mainCategoryOptions,\r\n colWidth: 3,\r\n type: 'select',\r\n placeholder: 'common:searchPlaceholder',\r\n defaultValue: mainCategory,\r\n isClearable: true\r\n }\r\n },\r\n jobSearch: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:job',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'common:searchPlaceholder',\r\n defaultValue: jobSearch,\r\n isClearable: true\r\n }\r\n },\r\n dateRange: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:dateRange',\r\n options: FormUtil.convertEnumToOptions(dateRangeEnum),\r\n colWidth: 3,\r\n colWidthLarge: 2,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: dateRange\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n this.setTableFilterDebounced({ [key]: value, page: 1 });\r\n };\r\n\r\n selectAssetPhoto = (photo: Iphoto) => {\r\n this.setState({\r\n selectedPhotos: {\r\n ...this.state.selectedPhotos,\r\n [photo.id]: !this.state.selectedPhotos[photo.id]\r\n }\r\n });\r\n };\r\n\r\n togglePhotoSelection = () => {\r\n this.setState({\r\n // when selection is off, unselect all photos\r\n selectedPhotos: this.selectedPhotos,\r\n selectionEnabled: !this.state.selectionEnabled\r\n });\r\n };\r\n\r\n deleteSelectedPhotos = (): void => {\r\n const toDelete = Object.keys(pickBy(this.state.selectedPhotos));\r\n\r\n this.props.deleteMultiplePhotos(toDelete, '');\r\n this.setState({\r\n // when selection is off, unselect all photos\r\n selectedPhotos: this.selectedPhotos,\r\n selectionEnabled: false\r\n });\r\n };\r\n\r\n openLightbox = (event: any, { photo, index }: any) => {\r\n this.props.getJobsByID(photo.jobID);\r\n this.setState({ activePhoto: index, lightboxIsOpen: true });\r\n };\r\n\r\n closeLightbox = () => {\r\n this.setState({ activePhoto: 0, lightboxIsOpen: false });\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const renderAssetPhoto = ({ index, photo, margin, top, left }: any) => {\r\n const typedPhoto = photo as Iphoto;\r\n const imgStyle: React.CSSProperties = {\r\n position: 'absolute',\r\n margin,\r\n left,\r\n top\r\n };\r\n\r\n const handleClick = (event: any) => {\r\n if (this.state.selectionEnabled) {\r\n this.selectAssetPhoto(typedPhoto);\r\n } else {\r\n this.openLightbox(event, { photo, index });\r\n }\r\n };\r\n\r\n return (\r\n \r\n \r\n \"img\"\r\n

    {typedPhoto.name}

    \r\n
    \r\n );\r\n };\r\n const photoCaption = (\r\n name: string,\r\n job: string,\r\n notes: string,\r\n date: string\r\n ) => (\r\n
    \r\n

    \r\n {t('installBase')}: \r\n {name}\r\n

    \r\n {job && (\r\n

    \r\n {t('job')}: \r\n {job}\r\n

    \r\n )}\r\n {notes && (\r\n

    \r\n {t('notes')}: \r\n {notes}\r\n

    \r\n )}\r\n

    \r\n {t('date')}: \r\n {moment(date).format('DD-MMMM-YY')}\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 {this.state.canManageAssets &&\r\n this.state.selectionEnabled ? (\r\n <>\r\n \r\n {t('common:doneButton')}\r\n \r\n \r\n {t('deleteSelectedButton')}\r\n \r\n \r\n ) : this.state.canManageAssets ? (\r\n \r\n Select Photos\r\n \r\n ) : (\r\n <>\r\n )}\r\n
    \r\n {!!this.props.galleryData.length && (\r\n \r\n )}\r\n \r\n {this.state.lightboxIsOpen && (\r\n ({\r\n ...base,\r\n zIndex: 10000\r\n }),\r\n blanket: (base: any) => ({\r\n ...base,\r\n zIndex: 10000\r\n })\r\n }}\r\n >\r\n {\r\n // get job name from photo\r\n const options = filter(\r\n this.props.jobOptions,\r\n {\r\n value: photo.jobID\r\n }\r\n );\r\n const job =\r\n options.length > 0\r\n ? options[0].label\r\n : '';\r\n return {\r\n ...photo,\r\n source: photo.lightboxUrl,\r\n caption: photoCaption(\r\n photo.name,\r\n job,\r\n photo.comments,\r\n photo.updateDate || photo.createDate\r\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 mapStateToProps = (state: IinitialState, ownProps: WithTranslation) => {\r\n const galleryData = orderBy(state.manageAssetPhotos.photos, 'updateDate')\r\n .filter(\r\n photo =>\r\n !!state.manageInventory.installBasesByID[photo.installBaseID]\r\n )\r\n .map(photo => {\r\n const installBase =\r\n state.manageInventory.installBasesByID[photo.installBaseID];\r\n const product =\r\n state.manageInventory.productsByID[installBase.productID];\r\n let productName = `${product?.name}`;\r\n\r\n // Don't show undefined as an actual product name...\r\n if (productName === 'undefined') {\r\n productName = '';\r\n }\r\n\r\n return {\r\n ...photo,\r\n width: 4,\r\n height: 3,\r\n src: photo.thumbnailUrl,\r\n name: productName\r\n };\r\n });\r\n const documentTypeOptions = keyBy(\r\n filter(state.manageDocumentType.documentTypesByID, type => {\r\n return true;\r\n }),\r\n 'id'\r\n );\r\n const { selectedFacilityID } = state;\r\n const jobOptions = getJobOptionsFromFilters(\r\n state,\r\n {\r\n filters: {\r\n facilityID: selectedFacilityID\r\n }\r\n },\r\n ownProps.t\r\n );\r\n\r\n return {\r\n galleryData,\r\n tableFilters: state.manageAssetPhotos.tableFilters,\r\n productInfo: state.productInfo,\r\n documentTypeOptions,\r\n selectedFacilityID,\r\n jobOptions,\r\n user: state.user\r\n };\r\n};\r\n\r\nexport default withTranslation('manageAssetPhotos')(\r\n connect(mapStateToProps, {\r\n getPhotos,\r\n deleteMultiplePhotos,\r\n setTableFilter,\r\n initInventory,\r\n getFacility,\r\n getJobsByID\r\n })(ManageAssetPhotos)\r\n);\r\n","/*\r\n * Manage Inventory Container\r\n */\r\n\r\nimport {\r\n clearSelectedInstallBaseID,\r\n clearSelectedProductID,\r\n getProductInfo,\r\n initInventory,\r\n requestQuote,\r\n setSearchNewProductsSelectedProduct,\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n setTableFilter,\r\n toggleEditInstallModal,\r\n toggleEditProductModal,\r\n toggleImportInstallModal,\r\n toggleInstallContactModal,\r\n toggleSearchNewProductsModal,\r\n mergeProduct\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getCanEditInstalls,\r\n getCanRequestQuote\r\n} from '../../reducers/userReducer';\r\nimport {\r\n initialFacility,\r\n initialInstallBase,\r\n initialProduct\r\n} from '../../reducers/initialState';\r\n\r\nimport ManageInventory from './ManageInventory';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { getFacility } from '../../actions/manageLocationActions';\r\nimport { getTotal } from '../../reducers/cartReducer';\r\nimport { toggleShoppingCartModal } from '../../actions/shoppingCartActions';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { values } from 'lodash';\r\nimport { selectVisibleProductsWithInstallBases } from '../../reducers/manageInventoryReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: WithTranslation) => {\r\n const selectedFacility =\r\n state.facilities[state.selectedFacilityID] || initialFacility;\r\n const { measurementPointResultsByID } = state.measurementPointResults;\r\n const {\r\n selectedInstallBaseID,\r\n productsByID,\r\n selectedProductID,\r\n searchNewProductsSelectedProduct,\r\n installBasesByID\r\n } = state.manageInventory;\r\n const selectedProduct = productsByID[selectedProductID] || initialProduct;\r\n const selectedInstallBase =\r\n installBasesByID[selectedInstallBaseID] || initialInstallBase;\r\n const canEditInstalls = getCanEditInstalls(state.user);\r\n const canRequestQuote = getCanRequestQuote(state.user);\r\n\r\n const visibleProducts = selectVisibleProductsWithInstallBases(\r\n state.manageInventory,\r\n measurementPointResultsByID,\r\n selectedFacility,\r\n state.manageWorkOrder,\r\n state.productInfo\r\n );\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n productInfo: state.productInfo,\r\n cartTotal: getTotal(state.manageInventory.cart),\r\n tableData: values(visibleProducts),\r\n selectedProduct,\r\n searchNewProductsSelectedProduct,\r\n selectedInstallBase,\r\n selectedFacility,\r\n canEditInstalls,\r\n canRequestQuote,\r\n bannerTitle: 'bannerTitle',\r\n // columns: columns(ownProps.t),\r\n manageInventory: state.manageInventory\r\n };\r\n};\r\n\r\nexport const ManageInventoryContainer = withTranslation('manageInventory')(\r\n connect(mapStateToProps, {\r\n initInventory,\r\n toggleEditProductModal,\r\n toggleEditInstallModal,\r\n toggleShoppingCartModal,\r\n toggleSearchNewProductsModal,\r\n closeAllModals,\r\n getProductInfo,\r\n getFacility,\r\n setTableFilter,\r\n toggleInstallContactModal,\r\n toggleImportInstallModal,\r\n requestQuote,\r\n setSelectedProductID,\r\n clearSelectedProductID,\r\n setSelectedInstallBaseID,\r\n clearSelectedInstallBaseID,\r\n setSearchNewProductsSelectedProduct,\r\n mergeProduct\r\n })(ManageInventory)\r\n);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport { filter, keyBy, map, pickBy } from 'lodash';\r\nimport { IjobPartPopulated, ImanagePartReducer, Ipart } from '../models';\r\nimport initialState, {\r\n initialJobPartPopulated,\r\n initialPart\r\n} from './initialState';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\n\r\n/**\r\n *************************** NORMALIZERS\r\n */\r\nexport const cleanJobPart = (jobPart: any): IjobPartPopulated => {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n // const { part, ...clanedJobPart } = jobPart; // TODO it will be better to clean this then re-populate the part in a selector\r\n return {\r\n ...initialJobPartPopulated,\r\n // ...pickBy(clanedJobPart, (property, key) => property !== null)\r\n ...pickBy(jobPart, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nexport const cleanPart = (part: any): Ipart => {\r\n return {\r\n ...initialPart,\r\n ...pickBy(part, (property, key) => property !== null)\r\n };\r\n};\r\n\r\n/**\r\n *************************** SELECTORS\r\n */\r\n\r\n// Will likely want to add a seperate reselect selector that is responsible for populating the jobPart objects with part objects\r\n// should also be sorting. take a look at selectPartOptions() in the mobile app\r\n\r\nconst getJobParts = (state: IinitialState) => state.managePart.jobParts;\r\nconst getSelectedJob = (state: IinitialState) => state.manageJob.selectedJob;\r\n\r\nexport const selectJobPartsForJob = createSelector(\r\n [getJobParts, getSelectedJob],\r\n (jobParts, selectedJob): IjobPartPopulated[] => {\r\n return filter(jobParts, { isDeleted: false, jobID: selectedJob.id });\r\n }\r\n);\r\n\r\n/**\r\n *********************** REDUCERS\r\n */\r\n\r\nconst jobPartsReducer = (\r\n state: { [key: string]: IjobPartPopulated } = initialState.managePart\r\n .jobParts,\r\n action: any\r\n): { [key: string]: IjobPartPopulated } => {\r\n switch (action.type) {\r\n case types.SAVE_JOB_PARTS_SUCCESS:\r\n case types.GET_JOB_PARTS_SUCCESS: {\r\n if (Array.isArray(action.payload)) {\r\n const cleanedJobParts = map(action.payload, cleanJobPart);\r\n return { ...state, ...keyBy(cleanedJobParts, 'id') };\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst managePart = combineReducers({\r\n jobParts: jobPartsReducer\r\n});\r\n\r\nexport default managePart;\r\n","/*\r\n * EditJobForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { debounce, filter, find, map, omit } from 'lodash';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport {\r\n jobTypesIdEnum,\r\n jobTypesIdEnumForSelect,\r\n jobTypesIdEnumInverse\r\n} from '../../models-enums';\r\n\r\nimport moment from 'moment';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\nimport {\r\n getAllOpenJobsForWorkOrders,\r\n //getAllOpenRepairAndMaintenanceJobs,\r\n getNextJobNumber,\r\n updateSelectedJob\r\n} from '../../actions/manageJobActions';\r\nimport { searchPartsForAsyncSelect } from '../../actions/managePartActions';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n IfacilityWithoutBuildings,\r\n Ihistory,\r\n Ijob,\r\n IjobPart,\r\n IjobPartPopulated,\r\n Ioption,\r\n Iuser,\r\n IuserJob\r\n} from '../../models';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\nimport { convertFacilityOptions } from '../../reducers/facilitiesReducer';\r\nimport { initialJob, initialJobPart } from '../../reducers/initialState';\r\nimport { AddMultiControl, ImultiControlMeta } from '../common/AddMultiControl';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { manageJobQueryParamsEnum } from './ManageJob';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n showCondensedFields: boolean;\r\n selectedJob: Ijob;\r\n originalJob?: Ijob;\r\n show: boolean;\r\n nextJobNumber: string;\r\n onSubmit: (\r\n job: Ijob,\r\n jobParts: IjobPart[],\r\n isEditMode: boolean,\r\n activeCountryID: string\r\n ) => Promise;\r\n delete: (jobID: string) => Promise;\r\n closeModal: () => void;\r\n onHide: () => void;\r\n // other\r\n facilityOptions: Ioption[];\r\n fseOptions: Ioption[];\r\n fseUsersByID: { [key: string]: Iuser };\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => Promise;\r\n jobParts: IjobPartPopulated[];\r\n getJobParts: () => void;\r\n facilities: { [key: string]: IfacilityWithoutBuildings };\r\n colorButton: string;\r\n queryParams: typeof manageJobQueryParamsEnum;\r\n onChange: typeof updateSelectedJob;\r\n getNextJobNumber: typeof getNextJobNumber;\r\n history: Ihistory;\r\n user: Iuser;\r\n isEditMode: boolean;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n activeLocalCountry: string;\r\n getAllOpenJobsForWorkOrders: typeof getAllOpenJobsForWorkOrders;\r\n}\r\n\r\ninterface Istate {\r\n selectedPart?: any;\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditJobForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private onChangeDebounced: (job?: Ijob) => void;\r\n static defaultProps = {\r\n selectedJob: initialJob\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.onChangeDebounced = debounce(\r\n this.props.onChange,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n selectedPart: undefined,\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.initSelected();\r\n this.props.getNextJobNumber();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (\r\n JSON.stringify(prevProps.facilityOptions) !==\r\n JSON.stringify(this.props.facilityOptions)\r\n ) {\r\n FormUtil.patchControl(this.formGroup, 'facilityID', null, {\r\n options: this.props.facilityOptions\r\n });\r\n }\r\n if (this.props.selectedJob.id !== prevProps.selectedJob.id) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n JSON.stringify(prevProps.jobParts) !==\r\n JSON.stringify(this.props.jobParts)\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (this.props.nextJobNumber !== prevProps.nextJobNumber) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.onChange();\r\n this.props.closeModal();\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, check if it matches the selectedItem in redux\r\n * if there is a job we are editing download any dependencies\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedJobID &&\r\n this.props.queryParams.selectedJobID !== this.props.selectedJob.id\r\n ) {\r\n const { originalJob, isEditMode } = this.props;\r\n // is there an existing item from redux\r\n if (originalJob && isEditMode) {\r\n this.props.onChange(originalJob);\r\n this.props.getJobParts();\r\n } else {\r\n // the item we are trying to edit has not been loaded. TODO download this item\r\n // since we do not support downloading a single item yet, close the modal\r\n console.info(\r\n 'item has not been downloaded. closing modal',\r\n this.props.queryParams.selectedJobID\r\n );\r\n this.props.closeModal();\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedObject and convert it to formValues\r\n */\r\n itemToFormValues = (): IgenericFormValues => {\r\n let {\r\n facilityID,\r\n jobTypeID,\r\n assignedUserID,\r\n userJobs,\r\n endDate,\r\n startDate,\r\n fseNotes,\r\n jobNumber\r\n } = this.props.selectedJob;\r\n const selectedFacility = FormUtil.convertToSingleOption(\r\n this.props.facilities[facilityID]\r\n );\r\n const loadJobNumber = jobNumber || this.props.nextJobNumber;\r\n\r\n const selectedJobType = jobTypeID\r\n ? {\r\n value: jobTypeID,\r\n label: this.props.t(\r\n jobTypesIdEnumInverse[\r\n jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n )\r\n }\r\n : undefined;\r\n\r\n const selectedAssignedUser = FormUtil.convertToSingleOption(\r\n this.props.fseUsersByID[assignedUserID]\r\n );\r\n\r\n const selectedUsers = filter(this.props.fseOptions, (fac: any) => {\r\n return (\r\n find(\r\n userJobs,\r\n userJob =>\r\n userJob.userID === fac.value &&\r\n userJob.isDeleted === false\r\n ) !== undefined\r\n );\r\n });\r\n\r\n if (!startDate) {\r\n startDate = moment.utc().format(constants.momentDisplayFormat);\r\n }\r\n\r\n if (!endDate) {\r\n endDate = moment.utc().format(constants.momentDisplayFormat);\r\n }\r\n\r\n return {\r\n jobNumber: loadJobNumber,\r\n facilityID: selectedFacility,\r\n jobTypeID: selectedJobType,\r\n userJobs: selectedUsers,\r\n assignedUserID: selectedAssignedUser,\r\n startDate,\r\n endDate,\r\n fseNotes\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedObject\r\n */\r\n formValuesToItem = (): Ijob => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { manageParts, ...formValuesWithoutParts } = formValues;\r\n let userJobs: IuserJob[] = [];\r\n if (Array.isArray(formValues.userJobs)) {\r\n userJobs = formValues.userJobs.map((userID: string) => {\r\n return {\r\n id: '', // let the API define the id\r\n userID,\r\n jobID: this.props.selectedJob.id,\r\n isDeleted: false\r\n };\r\n });\r\n }\r\n const cleanedJob = omit(this.props.selectedJob, ['facility']);\r\n return {\r\n ...cleanedJob,\r\n assignedUserID: cleanedJob?.assignedUserID || (null as any),\r\n ...formValuesWithoutParts,\r\n userJobs\r\n };\r\n };\r\n\r\n formValuesToChildItems = (): { jobParts: IjobPart[] } => {\r\n let jobParts: IjobPart[] = [];\r\n if (Array.isArray(this.formGroup.value.manageParts)) {\r\n jobParts = this.formGroup.value.manageParts.map(\r\n ({ id, part, estimated, isDeleted }: any) => {\r\n return {\r\n ...initialJobPart,\r\n id: id || uuidv4(),\r\n partID: part.value,\r\n estimated: Number(estimated),\r\n used: 0,\r\n isDeleted,\r\n jobID: this.props.selectedJob.id\r\n };\r\n }\r\n );\r\n }\r\n return { jobParts };\r\n };\r\n\r\n loadPartsOptions = debounce((searchTerm, callback) => {\r\n searchPartsForAsyncSelect(searchTerm).then(results =>\r\n callback(results)\r\n );\r\n }, 1000);\r\n\r\n onMultiControlChanges = (item: any, multiControlFormGroup?: any) => {\r\n if (\r\n (!this.state.selectedPart && item) ||\r\n (this.state.selectedPart &&\r\n JSON.stringify(item) !==\r\n JSON.stringify(this.state.selectedPart))\r\n ) {\r\n this.setState({ selectedPart: item });\r\n }\r\n };\r\n\r\n buildMultiControlConfig = () => {\r\n const itemEditFieldConfig = {\r\n controls: {\r\n part: {\r\n options: {\r\n validators: [Validators.required]\r\n },\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: this.props.t('jobForm.part'),\r\n colWidth: 12,\r\n rows: 2,\r\n loadOptions: this.loadPartsOptions,\r\n name: 'part',\r\n required: true,\r\n isMulti: false\r\n }\r\n },\r\n estimated: {\r\n options: {\r\n validators: [\r\n Validators.min(1),\r\n Validators.max(1000),\r\n Validators.pattern('[0-9]+'),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'jobForm.quantity',\r\n type: 'number',\r\n colWidth: 6,\r\n required: true,\r\n name: 'jobForm.quantity'\r\n }\r\n }\r\n }\r\n };\r\n\r\n return itemEditFieldConfig;\r\n };\r\n\r\n saveFacilities = (facilities: IfacilityWithoutBuildings[]) => {\r\n // console.log(facilities)\r\n };\r\n\r\n loadFacilitiesOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n this.props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n this.props.user.countryID,\r\n null,\r\n callback,\r\n this.saveFacilities\r\n );\r\n return;\r\n }\r\n callback(convertFacilityOptions(Object.values(this.props.facilities)));\r\n }, 100);\r\n\r\n buildFieldConfig = (defaultValues = this.itemToFormValues()) => {\r\n const { fseOptions, jobParts, t } = this.props;\r\n const disabled = this.props.selectedJob.isDeleted || false;\r\n const { startDate, endDate } = defaultValues;\r\n const itemEditFieldConfig = this.buildMultiControlConfig();\r\n const selectedParts = map(jobParts, part => {\r\n return {\r\n ...part,\r\n part: {\r\n value: part.part.id,\r\n label: `${part.part.number} - ${part.part.description}`\r\n },\r\n estimated: part.estimated\r\n };\r\n });\r\n // Field config to configure form\r\n let fieldConfigControls: { [key: string]: any } = {\r\n facilityID: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'jobForm.facility',\r\n loadOptions: (searchTerm: string, callback: any) => {\r\n this.loadFacilitiesOptions(searchTerm, callback);\r\n },\r\n colWidth: 12,\r\n placeholder: 'jobForm.facilitySearchPlaceholder',\r\n name: 'facility'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: defaultValues.facilityID,\r\n disabled\r\n }\r\n },\r\n jobNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'jobForm.jobNumber',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'jobnumber',\r\n required: false\r\n },\r\n formState: { value: defaultValues.jobNumber, disabled }\r\n },\r\n jobTypeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.props.isEditMode\r\n ? FormUtil.convertEnumToOptions(jobTypesIdEnum)\r\n : FormUtil.convertEnumToOptions(\r\n jobTypesIdEnumForSelect\r\n ),\r\n label: 'jobForm.type',\r\n colWidth: 12,\r\n placeholder: 'jobForm.typeSearchPlaceholder',\r\n name: 'job-type',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: defaultValues.jobTypeID,\r\n disabled: this.props.isEditMode\r\n }\r\n },\r\n startDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'jobForm.startDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'start-date',\r\n placeholder: 'jobForm.startDatePlaceholder'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: startDate,\r\n disabled\r\n }\r\n },\r\n endDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'jobForm.endDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'end-date',\r\n placeholder: 'jobForm.endDatePlaceholder'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: endDate,\r\n disabled\r\n }\r\n }\r\n };\r\n if (!this.props.showCondensedFields) {\r\n fieldConfigControls = {\r\n ...fieldConfigControls,\r\n assignedUserID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: fseOptions,\r\n label: 'jobForm.fseLead',\r\n colWidth: 12,\r\n placeholder: 'jobForm.fseLeadSearchPlaceholder',\r\n name: 'assigned-lead-user'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: defaultValues.assignedUserID,\r\n disabled\r\n }\r\n },\r\n userJobs: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: fseOptions,\r\n label: 'jobForm.fseMembers',\r\n colWidth: 12,\r\n placeholder: 'jobForm.fseMembersSearchPlaceholder',\r\n isMulti: true,\r\n name: 'assigned-user',\r\n required: false\r\n },\r\n formState: {\r\n value: defaultValues.userJobs,\r\n disabled\r\n }\r\n },\r\n manageParts: {\r\n render: AddMultiControl,\r\n meta: {\r\n label: 'jobForm.parts',\r\n buttonLabel: t('jobForm.manageParts'),\r\n colWidth: 12,\r\n colorButton: this.props.colorButton,\r\n t,\r\n modalTitle: 'jobForm.manageParts',\r\n getItemTitle: item =>\r\n `(${item.estimated}) ${item.part.label}`,\r\n onValueChanges: this.onMultiControlChanges,\r\n disableDelete:\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]) === false,\r\n disableEdit:\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageProducts.id\r\n ]) === false,\r\n actions: [],\r\n itemEditFieldConfig\r\n } as ImultiControlMeta,\r\n formState: { value: selectedParts, disabled }\r\n },\r\n fseNotes: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'fseNotes',\r\n colWidth: 12,\r\n rows: 9,\r\n componentClass: 'textarea',\r\n name: 'fse-notes'\r\n },\r\n formState: {\r\n value: defaultValues.fseNotes,\r\n disabled\r\n }\r\n }\r\n };\r\n }\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes after a short delay that allows the initial form values to load\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'startDate': {\r\n this.checkIfStartDateBeforeEndDate({ startDate: value });\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n }\r\n case 'endDate': {\r\n this.checkIfStartDateBeforeEndDate({ endDate: value });\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n }\r\n case 'facilityID':\r\n if (value && value.value) {\r\n this.handleSelectingFacility(value.value);\r\n }\r\n default:\r\n this.onChangeDebounced(this.formValuesToItem());\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * handleSelectingFacility\r\n * automatically select the lead FSE if one is set on the facility\r\n */\r\n handleSelectingFacility = (facilityID: string) => {\r\n const facility = this.props.facilities[facilityID];\r\n if (facility && facility.leadFSEID) {\r\n const leadFSEOption = find(this.props.fseOptions, {\r\n value: facility.leadFSEID\r\n });\r\n\r\n if (leadFSEOption && !this.props.selectedJob.assignedUserID) {\r\n FormUtil.patchControl(\r\n this.formGroup,\r\n 'assignedUserID',\r\n leadFSEOption\r\n );\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * Check if the date is in the past or if the start is before the end date\r\n */\r\n checkIfStartDateBeforeEndDate = ({ startDate, endDate }: any) => {\r\n if (\r\n startDate &&\r\n moment.isMoment(startDate) &&\r\n this.formGroup.value.endDate\r\n ) {\r\n if (startDate.isAfter(this.formGroup.value.endDate)) {\r\n toastr.warning(\r\n this.props.t('jobForm.startDateWarning'),\r\n '',\r\n constants.toastrWarning\r\n );\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors({ beforeStart: true });\r\n } else if (startDate.isBefore(moment(), 'day')) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.pastDateWarning'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors(null);\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors(null);\r\n }\r\n } else if (endDate && moment.isMoment(endDate)) {\r\n if (endDate.isBefore(this.formGroup.value.startDate)) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.startDateWarning'),\r\n constants.toastrWarning\r\n );\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors({ beforeStart: true });\r\n } else if (endDate.isBefore(moment(), 'day')) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.pastDateWarning'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors(null);\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors(null);\r\n }\r\n } else {\r\n console.error('missing start and end date');\r\n }\r\n };\r\n\r\n onSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.formGroup.value);\r\n\r\n this.props\r\n .onSubmit(\r\n this.formValuesToItem(),\r\n this.formValuesToChildItems().jobParts,\r\n this.props.isEditMode,\r\n this.props.activeLocalCountry\r\n )\r\n .then(() => {\r\n this.props.getAllOpenJobsForWorkOrders();\r\n this.props.closeModal();\r\n });\r\n };\r\n\r\n onDelete = () => {\r\n const { t } = this.props;\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.delete(this.props.selectedJob.id).then(() => {\r\n this.props.closeModal();\r\n });\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: t('jobDeleteOk'),\r\n cancelText: t('common:cancel')\r\n };\r\n toastr.confirm(t('jobDeleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix job-form beacon-form ${this.props.colorButton}`;\r\n const deleteButtonStyle = this.props.isEditMode\r\n ? { marginRight: '15px' }\r\n : { marginRight: '15px', display: 'none' };\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('jobForm.cancel')}\r\n \r\n {!this.props.selectedJob.isDeleted && (\r\n \r\n {t('jobForm.delete')}\r\n \r\n )}\r\n {!this.props.selectedJob.isDeleted && (\r\n \r\n {t('jobForm.save')}\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditJobForm;\r\n","import { debounce, filter, orderBy } from 'lodash';\r\nimport React, { FC, useCallback, useEffect, useMemo, useState } from 'react';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport ReactTable, {\r\n Column,\r\n FinalState,\r\n RowInfo,\r\n SortingRule\r\n} from 'react-table';\r\nimport {\r\n getFSEUsers,\r\n getJobs,\r\n setTableFilter,\r\n updateSelectedJob\r\n} from '../../actions/manageJobActions';\r\nimport {\r\n Ifacility,\r\n Ijob,\r\n IjobWorkOrder,\r\n ImanageJobReducer,\r\n Ioption,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n jobStatusEnumForFilter,\r\n jobTypesIdEnum,\r\n jobTypesIdEnumInverse\r\n} from '../../models-enums';\r\nimport { initialJob, initialUser } from '../../reducers/initialState';\r\n\r\nimport moment from 'moment';\r\nimport queryString from 'query-string';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { connect, useDispatch, useSelector } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { closeAllModals, getSAPJobMapping } from '../../actions/commonActions';\r\nimport { loadCountries } from '../../actions/countriesActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport {\r\n selectActiveFseUsersByID,\r\n selectJobTableFilters,\r\n selectJobWorkOrdersWithWorkOrders\r\n} from '../../reducers/manageJobReducer';\r\nimport { getActiveLocalCountry } from '../../reducers/manageUserReducer';\r\nimport {\r\n getUsersActiveCountry,\r\n getUsersCountries\r\n} from '../../reducers/userReducer';\r\nimport { Banner } from '../common/Banner';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { addQuery } from '../common/OtherUtils';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport EditJobModal from './EditJobModal';\r\nimport { JobWorkOrderExpanderContainer } from './JobWorkOrderExpanderContainer';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface RowInfoJob extends RowInfo {\r\n original: Ijob;\r\n}\r\n\r\nexport enum manageJobQueryParamsEnum {\r\n selectedJobID = 'selectedJobID'\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n getJobs: typeof getJobs;\r\n getFSEUsers: typeof getFSEUsers;\r\n closeAllModals: typeof closeAllModals;\r\n jobManage: ImanageJobReducer;\r\n showEditJobModal: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableData: Ijob[];\r\n jobTypes: any[];\r\n loading: boolean;\r\n facilities: { [key: string]: Ifacility };\r\n jobWorkOrdersByID: { [key: string]: IjobWorkOrder };\r\n queryParams: typeof manageJobQueryParamsEnum;\r\n updateSelectedJob: typeof updateSelectedJob;\r\n getSAPJobMapping: typeof getSAPJobMapping;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n}\r\n\r\nconst ManageJob: FC = props => {\r\n const { t } = props;\r\n const currentTile: Itile = constants.getTileByURL(props.location.pathname);\r\n const [state, setState] = useState({\r\n selectedRow: []\r\n });\r\n const fseUsersByID = useSelector(selectActiveFseUsersByID);\r\n const tableFilters = useSelector(selectJobTableFilters);\r\n const usersActiveCountry = useSelector(getUsersActiveCountry);\r\n const usersActiveLocalCountry = useSelector(getActiveLocalCountry);\r\n const usersCountries = useSelector(getUsersCountries);\r\n const getActiveCountry = () => {\r\n if (usersActiveLocalCountry !== '') {\r\n return usersActiveLocalCountry;\r\n } else {\r\n return usersActiveCountry;\r\n }\r\n };\r\n\r\n const facilities: { [key: string]: Ifacility } = useMemo(() => {\r\n const data = props.tableData.reduce(\r\n (carry: { [key: string]: Ifacility }, job: Ijob) => {\r\n if (!job.facility) {\r\n return carry;\r\n }\r\n\r\n return {\r\n ...carry,\r\n [job.facility.id]: job.facility\r\n };\r\n },\r\n {}\r\n );\r\n\r\n return data;\r\n }, [props.tableData]);\r\n\r\n const coulumns: any[] = useMemo(() => {\r\n return TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n id: 'status',\r\n Header: 'status',\r\n accessor: 'status',\r\n width: 100\r\n },\r\n {\r\n Header: 'type',\r\n id: 'type',\r\n accessor: ({ jobTypeID }: Ijob) =>\r\n props.t(\r\n jobTypesIdEnumInverse[\r\n jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n ),\r\n width: 115\r\n },\r\n {\r\n id: 'jobNumber',\r\n Header: 'jobNumber',\r\n accessor: ({ jobNumber }: Ijob) =>\r\n jobNumber ? jobNumber : '',\r\n width: 120\r\n },\r\n {\r\n id: 'facility',\r\n Header: 'facility',\r\n accessor: (job: Ijob) => {\r\n return job?.facility?.name;\r\n },\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'fseLead',\r\n Cell: (row: RowInfoJob) => {\r\n const fseLead =\r\n fseUsersByID[row.original.assignedUserID] ||\r\n initialUser;\r\n\r\n return (\r\n \r\n {fseLead.first} {fseLead.last}\r\n \r\n );\r\n }\r\n },\r\n {\r\n Header: 'start date',\r\n accessor: ({ startDate }: Ijob) => {\r\n return startDate\r\n ? moment\r\n .utc(startDate)\r\n .local(true)\r\n .format('DD-MMM-YY')\r\n : 'n/a';\r\n },\r\n id: 'startDate',\r\n width: 130\r\n },\r\n {\r\n Header: '#WO',\r\n accessor: ({ id }: Ijob) => {\r\n const jobWorkOrders = filter(props.jobWorkOrdersByID, {\r\n jobID: id,\r\n isDeleted: false\r\n });\r\n if (jobWorkOrders) {\r\n return jobWorkOrders.length;\r\n } else {\r\n return 0;\r\n }\r\n },\r\n id: 'wos',\r\n width: 60\r\n }\r\n ],\r\n props.t\r\n );\r\n }, [facilities]);\r\n\r\n const dispatch = useDispatch();\r\n const countries = useSelector(getCountries);\r\n\r\n React.useEffect(() => {\r\n loadCountries(dispatch, countries);\r\n props.getSAPJobMapping();\r\n props.getFSEUsers();\r\n }, []);\r\n\r\n const userOptions: Ioption[] = useMemo(() => {\r\n return Object.values(fseUsersByID)?.map(user => {\r\n const name = `${user.first} ${user.last}`;\r\n return { label: name, value: user.id };\r\n });\r\n }, [fseUsersByID]);\r\n\r\n const searchFieldConfig: FieldConfig = useMemo(() => {\r\n const countriesOptions: Ioption[] = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => ({ label: c.name, value: c.id }));\r\n\r\n const defaultStatus = FormUtil.convertToSingleOption({\r\n id: jobStatusEnumForFilter.Active.toString(),\r\n label: props.t('Active')\r\n });\r\n\r\n const {\r\n startDate,\r\n endDate,\r\n type,\r\n statusFilter = defaultStatus,\r\n search,\r\n showAdditionalFilters,\r\n country,\r\n assignedUser,\r\n isDeleted\r\n } = tableFilters;\r\n const disabled = false;\r\n\r\n const mainSearchControls = {\r\n country: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'manageFacility:country',\r\n colWidth: 4,\r\n colWidthMedium: 4,\r\n colWidthLarge: 4,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'country',\r\n defaultValue: country,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: country,\r\n disabled\r\n }\r\n },\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 5,\r\n colWidthLarge: 5,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder'\r\n },\r\n formState: {\r\n value: search,\r\n disabled\r\n }\r\n },\r\n type: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageMeasurementPointLists:type',\r\n options: FormUtil.convertEnumToOptions(jobTypesIdEnum),\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n type: 'select',\r\n placeholder: 'typePlaceholder',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: type,\r\n disabled\r\n }\r\n },\r\n statusFilter: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'status',\r\n options: FormUtil.convertEnumToOptions(\r\n jobStatusEnumForFilter\r\n ),\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n type: 'select',\r\n placeholder: 'statusPlaceholder'\r\n },\r\n formState: {\r\n value: statusFilter,\r\n disabled\r\n }\r\n },\r\n assignedUser: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: userOptions,\r\n label: 'FSENameTableHeader',\r\n colWidth: 3,\r\n isClearable: true,\r\n shouldTranslate: true,\r\n dataType: 'fseUser'\r\n },\r\n formState: { value: assignedUser || '', disabled }\r\n },\r\n isDeleted: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'showDeleted',\r\n colWidth: 2,\r\n innerStyle: {\r\n display: 'flex',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n height: '48px',\r\n paddingTop: '24px'\r\n }\r\n },\r\n formState: {\r\n value: isDeleted || false,\r\n disabled\r\n }\r\n }\r\n };\r\n const additionalSearchControls = {\r\n startDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'startDate',\r\n colWidth: 3,\r\n colWidthLarge: 3,\r\n showTime: false,\r\n placeholder: 'common:datePlaceholder'\r\n },\r\n formState: {\r\n value: startDate || '',\r\n disabled\r\n },\r\n options: {\r\n validators: FormUtil.validators.isValidMoment\r\n }\r\n },\r\n endDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'endDate',\r\n colWidth: 3,\r\n colWidthLarge: 3,\r\n showTime: false,\r\n placeholder: 'common:datePlaceholder'\r\n },\r\n formState: {\r\n value: endDate || '',\r\n disabled\r\n },\r\n options: {\r\n validators: FormUtil.validators.isValidMoment\r\n }\r\n }\r\n };\r\n\r\n if (showAdditionalFilters) {\r\n return {\r\n controls: {\r\n ...mainSearchControls,\r\n ...additionalSearchControls\r\n }\r\n };\r\n } else {\r\n return { controls: { ...mainSearchControls } };\r\n }\r\n }, [\r\n tableFilters.showAdditionalFilters,\r\n countries,\r\n usersCountries,\r\n usersActiveCountry,\r\n usersActiveLocalCountry,\r\n userOptions\r\n ]);\r\n\r\n useEffect(() => {\r\n if (\r\n tableFilters.country === null ||\r\n tableFilters.country === undefined\r\n ) {\r\n const activeCountryID = getActiveCountry();\r\n const activeCountryOption: Ioption = {\r\n value: activeCountryID,\r\n label: countries.find(c => c.id === activeCountryID)?.name || ''\r\n };\r\n\r\n props.setTableFilter({\r\n ['country']: activeCountryOption\r\n });\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n let activeCountryID: string | undefined = undefined;\r\n\r\n if (tableFilters.country) {\r\n activeCountryID = tableFilters.country.value;\r\n }\r\n\r\n props.getJobs(activeCountryID);\r\n\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }, [tableFilters]);\r\n\r\n const handleSelectJob = (id: string) => {\r\n addQuery(manageJobQueryParamsEnum.selectedJobID, id, props.history);\r\n };\r\n\r\n const onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n props.setTableFilter({ page: newPage });\r\n };\r\n\r\n const onSearchValueChanges = useCallback(\r\n (value: any, key: string) => {\r\n props.setTableFilter({\r\n [key]: value\r\n });\r\n },\r\n [tableFilters]\r\n );\r\n const debouncedSearchValueChanges = useCallback(\r\n debounce(onSearchValueChanges, 300),\r\n []\r\n );\r\n const onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n props.setTableFilter({ sorted: newSorted });\r\n setState({ selectedRow: {} });\r\n };\r\n\r\n const hasActiveAdditionalFilters = () => {\r\n const { endDate, startDate } = tableFilters;\r\n if (endDate || startDate) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n const handleNewJobClick = () => {\r\n const id = uuidv4();\r\n props.updateSelectedJob({ ...initialJob, id });\r\n addQuery(manageJobQueryParamsEnum.selectedJobID, id, props.history);\r\n };\r\n\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoJob | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column) {\r\n const jobWorkOrders = filter(props.jobWorkOrdersByID, {\r\n jobID: rowInfo.original.id,\r\n isDeleted: false\r\n });\r\n\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (column.id && column.id === 'actions') {\r\n return;\r\n }\r\n if (jobWorkOrders.length === 0) {\r\n setState({\r\n selectedRow: rowInfo.index\r\n });\r\n handleSelectJob(rowInfo.original.id);\r\n return;\r\n }\r\n\r\n setState({\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n },\r\n style: {\r\n background: state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : '',\r\n opacity:\r\n jobWorkOrders.length === 0 &&\r\n column.id === 'expander-toggle'\r\n ? '0'\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const tableClassName = tableFilters.showAdditionalFilters\r\n ? `beacon-table -highlight ${currentTile.color} additional-filters`\r\n : `beacon-table -highlight ${currentTile.color}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {t('newJob')}\r\n \r\n \r\n \r\n\r\n = 10 ? props.tableData.length : 10\r\n }\r\n page={tableFilters.page - 1}\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={props.jobManage.totalPages}\r\n showPageSizeOptions={false}\r\n className={tableClassName}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n expanded={state.selectedRow}\r\n SubComponent={(rowInfo: RowInfo) => {\r\n return (\r\n \r\n );\r\n }}\r\n />\r\n \r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const tableData = orderBy(\r\n state.manageJob.jobsByID,\r\n res => moment.utc(res.startDate).unix(),\r\n 'desc'\r\n );\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageJobQueryParamsEnum;\r\n const jobWorkOrdersByID = selectJobWorkOrdersWithWorkOrders(state);\r\n\r\n return {\r\n user: state.user,\r\n jobManage: state.manageJob,\r\n loading: selectIsLoading(state),\r\n showEditJobModal: queryParams.selectedJobID?.length > 0,\r\n tableData,\r\n jobWorkOrdersByID,\r\n queryParams\r\n };\r\n};\r\n\r\nexport default withTranslation('nsJob')(\r\n connect(mapStateToProps, {\r\n getJobs,\r\n getFSEUsers,\r\n closeAllModals,\r\n setTableFilter,\r\n updateSelectedJob,\r\n getSAPJobMapping\r\n })(ManageJob)\r\n);\r\n","/*\r\n * Edit Job Redux Connector\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport { keyBy } from 'lodash';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\nimport {\r\n deleteJob,\r\n getAllOpenJobsForWorkOrders,\r\n getNextJobNumber,\r\n saveJob,\r\n updateSelectedJob\r\n} from '../../actions/manageJobActions';\r\nimport { getJobParts } from '../../actions/managePartActions';\r\nimport { Ifacility, Ihistory } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport {\r\n selectActiveFseUsersByID,\r\n selectFseUserOptions,\r\n selectNextJobNumber\r\n} from '../../reducers/manageJobReducer';\r\nimport { selectJobPartsForJob } from '../../reducers/managePartReducer';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport EditJobForm from './EditJobForm';\r\nimport { manageJobQueryParamsEnum } from './ManageJob';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n queryParams: typeof manageJobQueryParamsEnum;\r\n history: Ihistory;\r\n facilities: Ifacility[];\r\n showCondensedFields?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n // job currently being edited, will be defined when adding or editing\r\n const selectedJob = state.manageJob.selectedJob;\r\n // will be defined when editing an exisiting job\r\n const originalJob =\r\n state.manageJob.jobsByID[ownProps.queryParams.selectedJobID];\r\n const fseOptions = selectFseUserOptions(state);\r\n const isEditMode = originalJob?.id.length > 0;\r\n const nextJobNumber = selectNextJobNumber(state);\r\n\r\n let activeCountry = state.user.countryID;\r\n if (state.manageUser.activeLocalCountry !== '') {\r\n activeCountry = state.manageUser.activeLocalCountry;\r\n }\r\n\r\n let modalTitle;\r\n if (isEditMode) {\r\n modalTitle = ownProps.t('nsJob:editModalTitle');\r\n } else {\r\n modalTitle = ownProps.t('nsJob:saveModalTitle');\r\n }\r\n // define the closeModal function here in mapState so that we can pass it to both the main component and\r\n // to the onHide which is a WithCommonModal HOC prop\r\n // yes it is unusual to pass a function in mapState, but it is ok since it does not need dispatch\r\n const closeModal = () => {\r\n removeQuery(manageJobQueryParamsEnum.selectedJobID, ownProps.history);\r\n };\r\n\r\n return {\r\n // reusable\r\n user: state.user,\r\n showCondensedFields: ownProps?.showCondensedFields || false,\r\n loading: selectIsLoading(state),\r\n show: ownProps.queryParams.selectedJobID?.length > 0,\r\n selectedJob,\r\n originalJob,\r\n isEditMode,\r\n className: 'job-edit',\r\n title: modalTitle,\r\n closeModal,\r\n onHide: closeModal,\r\n // other\r\n facilityOptions: FormUtil.convertToOptions(ownProps.facilities),\r\n fseUsersByID: selectActiveFseUsersByID(state),\r\n fseOptions,\r\n facilities: keyBy(ownProps.facilities, 'id'),\r\n jobParts: selectJobPartsForJob(state),\r\n activeLocalCountry: activeCountry,\r\n nextJobNumber\r\n };\r\n};\r\n\r\nexport default withTranslation('nsJob')(\r\n connect(mapStateToProps, {\r\n // reusable\r\n onSubmit: saveJob,\r\n delete: deleteJob,\r\n onChange: updateSelectedJob,\r\n // other\r\n getFacilitiesByCountry,\r\n getJobParts,\r\n searchFacilitiesForAsyncSelect,\r\n getNextJobNumber,\r\n getAllOpenJobsForWorkOrders\r\n })(WithCommonModal(EditJobForm))\r\n);\r\n","/*\r\n * Job Work Order Expander Container\r\n */\r\n\r\nimport { Ijob } from '../../models';\r\n\r\nimport { RowInfo } from 'react-table';\r\nimport { connect } from 'react-redux';\r\nimport { JobWorkOrderExpander } from './JobWorkOrderExpander';\r\nimport { TFunction } from 'i18next';\r\nimport { selectWorkOrdersForJobID } from '../../reducers/manageJobReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops extends RowInfo {\r\n original: Ijob;\r\n t: TFunction;\r\n handleSelectJob: (id: string) => void;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const workOrders = selectWorkOrdersForJobID(state, {\r\n jobID: ownProps.original.id\r\n });\r\n return {\r\n loading: selectIsLoading(state),\r\n workOrders\r\n };\r\n};\r\n\r\nexport const JobWorkOrderExpanderContainer = connect(\r\n mapStateToProps,\r\n {}\r\n)(JobWorkOrderExpander);\r\n","/*\r\nJob Work Order Expander\r\n*/\r\n\r\nimport * as React from 'react';\r\n\r\nimport { IWorkOrder, Ijob, IjobWorkOrder, Iuser } from '../../models';\r\nimport ReactTable, { Column, RowInfo, RowRenderProps } from 'react-table';\r\n\r\nimport { Button } from 'react-bootstrap';\r\nimport { TFunction } from 'i18next';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport moment from 'moment';\r\nimport { orderBy } from 'lodash';\r\nimport { workOrderStatusEnum } from '../../models-enums';\r\n\r\ninterface RowInfoEdited extends RowInfo {\r\n original: IjobWorkOrder;\r\n}\r\ninterface ExpanderProps extends RowInfo {\r\n t: TFunction;\r\n original: Ijob;\r\n handleSelectJob: (id: string) => void;\r\n workOrders: IWorkOrder[];\r\n fseUsersByID: { [key: string]: Iuser };\r\n}\r\n\r\n/*\r\n * The Job Work Order Expander\r\n */\r\nexport const JobWorkOrderExpander: React.SFC = (\r\n props: ExpanderProps\r\n) => {\r\n const ExpanderButtonBar = (eProps: RowRenderProps) => {\r\n return (\r\n \r\n {\r\n props.handleSelectJob(props.original.id);\r\n }}\r\n >\r\n {props.t('editJob')}\r\n \r\n \r\n );\r\n };\r\n const sortedData = orderBy(\r\n props.workOrders,\r\n res => moment.utc(res.dueDate).unix(),\r\n 'desc'\r\n );\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Footer: ExpanderButtonBar,\r\n minWidth: 20,\r\n id: 'indent-column-button-bar'\r\n },\r\n {\r\n Header: 'manageWorkOrder:number',\r\n id: 'woNumber',\r\n accessor: (workOrder: IWorkOrder) => {\r\n return workOrder.number;\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'manageWorkOrder:activity',\r\n id: 'activityDescription',\r\n accessor: (workOrder: IWorkOrder) => {\r\n return workOrder.activityDescription;\r\n },\r\n minWidth: 220\r\n },\r\n {\r\n Header: 'manageWorkOrder:technician',\r\n id: 'technician',\r\n accessor: (workOrder: IWorkOrder) => {\r\n const userID = workOrder.technician || workOrder.userID;\r\n const user =\r\n props.fseUsersByID[userID] ||\r\n props.original.assignedUser;\r\n return `${user?.first} ${user?.last}`;\r\n },\r\n minWidth: 150\r\n },\r\n {\r\n Header: 'manageWorkOrder:dueDate',\r\n id: 'dueDate',\r\n accessor: (workOrder: IWorkOrder) => {\r\n return moment\r\n .utc(workOrder.dueDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n }\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: (workOrder: IWorkOrder) => {\r\n const statusString = workOrderStatusEnum[workOrder.status];\r\n\r\n return (\r\n \r\n {statusString\r\n ? `${props.t(\r\n 'manageWorkOrder:' + statusString\r\n )}`\r\n : ''}\r\n \r\n );\r\n },\r\n minWidth: 100\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n return (\r\n
    \r\n = 10 : false\r\n }\r\n />\r\n
    \r\n );\r\n // } else {\r\n // return null;\r\n // }\r\n};\r\n","import * as types from './actionTypes';\r\n\r\nimport { Dispatch } from 'redux';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport {\r\n IjobComment,\r\n ItableFiltersParams,\r\n Ioption,\r\n ThunkResult\r\n} from '../models';\r\nimport { ThunkDispatch } from 'redux-thunk';\r\nimport { filter, orderBy } from 'lodash';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport moment from 'moment';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { IinitialState } from '../reducers';\r\n\r\n// const uuidv4 = require('uuid/v4');\r\n\r\nexport function getJobCommentsHelper(\r\n dispatch: ThunkDispatch,\r\n getState: () => IinitialState\r\n) {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { pagingType: 'none', facilityID: selectedFacilityID }\r\n };\r\n const url = API.jobComment.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('unable to get job comments');\r\n } else {\r\n const jobComments = data.data.result;\r\n dispatch({\r\n type: types.MANAGE_JOB_COMMENTS_SUCCESS,\r\n jobComments\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.MANAGE_JOB_COMMENTS_FAILED });\r\n constants.handleError(error, 'get job comments');\r\n console.error('get job comments', error);\r\n throw error;\r\n });\r\n}\r\n\r\nexport function getJobComments(): ThunkResult {\r\n return (dispatch, getState) => {\r\n return getJobCommentsHelper(dispatch, getState);\r\n };\r\n}\r\n\r\nexport const receiveUpdatedJobComments = (\r\n jobComments: IjobComment[],\r\n dispatch: Dispatch\r\n) => {\r\n jobComments.forEach(jobComment => {\r\n dispatch({\r\n type: types.MANAGE_JOB_COMMENTS_UPDATE,\r\n jobComment\r\n });\r\n });\r\n};\r\n\r\nexport function resolveJobComment(isResolved: Ioption): ThunkResult {\r\n return (dispatch, getState) => {\r\n if (!isResolved) {\r\n throw new Error('missing resolved selection');\r\n }\r\n const originalComment = getState().manageJobComment.selectedJobComment;\r\n const data: IjobComment = {\r\n ...originalComment,\r\n isResolved: isResolved.value === 'true' ? true : false\r\n };\r\n const axiosOptions = {\r\n url: `${API.jobComment.resolve}/${originalComment.id}`,\r\n method: 'post',\r\n params: { isResolved: isResolved.value === 'true' ? true : false }\r\n };\r\n dispatch({\r\n type: types.MANAGE_JOB_COMMENTS_UPDATE,\r\n jobComment: data,\r\n meta: {\r\n offline: {\r\n effect: { axiosOptions, message: 'resolve job comment' },\r\n rollback: {\r\n type: types.MANAGE_JOB_COMMENTS_UPDATE,\r\n jobComment: originalComment\r\n }\r\n }\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport const filterJobComments = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const { manageJobComment, selectedFacilityID, manageJob } = getState();\r\n const {\r\n commentType,\r\n createDate,\r\n userID,\r\n jobID,\r\n isResolved\r\n } = manageJobComment.tableFilters;\r\n const { jobCommentsByID } = manageJobComment;\r\n const { jobsByID } = manageJob;\r\n // const jobID = getState().manageJob.selectedJob.id;\r\n const createDateMoment = moment.isMoment(createDate)\r\n ? createDate\r\n : moment(createDate);\r\n\r\n const filteredJobComments = filter(jobCommentsByID, jobComment => {\r\n let shouldInclude = true;\r\n const commentJob = jobsByID[jobComment.jobID];\r\n if (!commentJob) {\r\n console.error('missing job', jobComment.jobID, jobsByID);\r\n return false;\r\n }\r\n\r\n if (jobID && jobID.value && jobComment.jobID !== jobID.value) {\r\n shouldInclude = false;\r\n }\r\n if (commentJob.facilityID !== selectedFacilityID) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n isResolved &&\r\n isResolved.value === 'true' &&\r\n jobComment.isResolved === false\r\n ) {\r\n shouldInclude = false;\r\n }\r\n // isResolved is undefined when it initially loads. null after it has been cleared\r\n if (\r\n (isResolved === undefined && jobComment.isResolved === true) ||\r\n (isResolved &&\r\n isResolved.value === 'false' &&\r\n jobComment.isResolved === true)\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (\r\n commentType &&\r\n commentType.value === 'false' &&\r\n jobComment.isDeficiency === true\r\n ) {\r\n // only show dificiencies\r\n shouldInclude = false;\r\n }\r\n if (\r\n commentType &&\r\n commentType.value === 'true' &&\r\n jobComment.isDeficiency === false\r\n ) {\r\n // only show non-dificiencis\r\n shouldInclude = false;\r\n }\r\n if (\r\n createDate &&\r\n !createDateMoment.isSame(\r\n moment.utc(jobComment.createDate),\r\n 'day'\r\n )\r\n ) {\r\n shouldInclude = false;\r\n }\r\n if (userID && userID.value !== jobComment.userID) {\r\n shouldInclude = false;\r\n }\r\n\r\n return shouldInclude;\r\n });\r\n dispatch({\r\n type: types.MANAGE_JOB_COMMENTS_FILTER_VISIBLE,\r\n filteredJobComments: orderBy(\r\n filteredJobComments,\r\n res => moment.utc(res.createDate).unix(),\r\n 'desc'\r\n )\r\n });\r\n };\r\n};\r\n\r\nexport const toggleEditJobCommentModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_JOB_COMMENT\r\n});\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_JOB_COMMENTS,\r\n filters\r\n});\r\n\r\nexport const setSelectedJobComment = (jobComment: IjobComment) => ({\r\n type: types.MANAGE_JOB_COMMENTS_SELECT,\r\n jobComment\r\n});\r\n","/*\r\n * Edit Job Comment Form\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\n\r\nimport { IjobComment, IdeficiencyCode, Iuser } from '../../models';\r\nimport {\r\n setSelectedJobComment,\r\n toggleEditJobCommentModal,\r\n resolveJobComment\r\n} from '../../actions/manageJobCommentsActions';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps, withRouter } from 'react-router';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialJobComment } from '../../reducers/initialState';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { TFunction } from 'i18next';\r\n\r\ninterface Iprops {\r\n selectedJobComment: IjobComment;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n\r\n toggleEditJobCommentModal: typeof toggleEditJobCommentModal;\r\n user: Iuser;\r\n resolveJobComment: typeof resolveJobComment;\r\n setSelectedJobComment: typeof setSelectedJobComment;\r\n jobCommentsByID: { [key: string]: IjobComment };\r\n deficiencyCodesByID: { [key: string]: IdeficiencyCode };\r\n}\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditJobCommentFormClass extends React.Component<\r\n Iprops & RouteComponentProps<{}>,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n\r\n constructor(props: Iprops & RouteComponentProps<{}>) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: FormUtil.translateForm(\r\n this.buildFieldConfig(this.props.selectedJobComment),\r\n this.props.t\r\n )\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (!this.props.selectedJobComment) {\r\n console.error('missing job');\r\n return;\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n subscribeToValueChanges = () => {\r\n this.subscription = this.formGroup\r\n .get('isDeficiency')\r\n .valueChanges.subscribe((value: boolean | null) => {\r\n this.setState({\r\n fieldConfig: FormUtil.translateForm(\r\n this.buildFieldConfig({\r\n ...this.props.selectedJobComment,\r\n ...this.formGroup.value,\r\n isDeficiency: value,\r\n codeID: this.formGroup.value.codeID\r\n ? this.formGroup.value.codeID.value\r\n : null\r\n }),\r\n this.props.t\r\n )\r\n });\r\n });\r\n };\r\n\r\n buildFieldConfig = ({\r\n text,\r\n isDeficiency,\r\n codeID,\r\n isResolved\r\n }: IjobComment = initialJobComment) => {\r\n const { deficiencyCodesByID } = this.props;\r\n const disabled = false;\r\n\r\n const selectedCode = codeID\r\n ? FormUtil.convertToSingleOption(deficiencyCodesByID[codeID])\r\n : null;\r\n const selectedIsResolved = isResolved\r\n ? { value: 'true', label: 'Yes' }\r\n : { value: 'false', label: 'No' };\r\n\r\n let controls = {\r\n text: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'comment',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n type: 'input',\r\n name: 'comment',\r\n required: true,\r\n rows: 10\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: text, disabled }\r\n },\r\n isDeficiency: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'labelIsDeficiency', colWidth: 12 },\r\n formState: { value: isDeficiency, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n if (isDeficiency) {\r\n controls = {\r\n ...controls,\r\n codeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'code',\r\n colWidth: 12,\r\n isMulti: false,\r\n name: 'code',\r\n required: false,\r\n options: FormUtil.convertToOptions(\r\n this.props.deficiencyCodesByID\r\n )\r\n },\r\n formState: { value: selectedCode, disabled }\r\n },\r\n $field_0: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n \r\n
    \r\n \r\n )\r\n },\r\n isResolved: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'resolved',\r\n colWidth: 12,\r\n isMulti: false,\r\n name: 'resolved',\r\n required: true,\r\n options: constants.isResolvedOptions\r\n },\r\n formState: { value: selectedIsResolved, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n }\r\n\r\n return {\r\n controls\r\n } as FieldConfig;\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.formGroup.value);\r\n\r\n this.props.resolveJobComment(this.formGroup.value.isResolved);\r\n this.props.toggleEditJobCommentModal();\r\n this.props.setSelectedJobComment(initialJobComment);\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n this.subscribeToValueChanges();\r\n };\r\n render() {\r\n const { t } = this.props;\r\n const { selectedJobComment } = this.props;\r\n if (!selectedJobComment) {\r\n return null;\r\n }\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {t('cancel')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport const EditJobCommentForm = withRouter(EditJobCommentFormClass);\r\n","/*\r\n * Edit Job Comment Connector\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n toggleEditJobCommentModal,\r\n setSelectedJobComment,\r\n resolveJobComment\r\n} from '../../actions/manageJobCommentsActions';\r\nimport { EditJobCommentForm } from './EditJobCommentForm';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const {\r\n showEditJobCommentModal,\r\n selectedJobComment,\r\n jobCommentsByID\r\n } = state.manageJobComment;\r\n return {\r\n title: ownProps.t('titleJobCommentModal'),\r\n className: 'edit-comment',\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: showEditJobCommentModal,\r\n selectedJobComment,\r\n jobCommentsByID,\r\n deficiencyCodesByID: state.manageCode.deficiencyCodesByID\r\n };\r\n};\r\n\r\nexport const EditJobCommentContainer = withTranslation('manageJobComments')(\r\n connect(mapStateToProps, {\r\n toggleEditJobCommentModal,\r\n setSelectedJobComment,\r\n resolveJobComment,\r\n onHide: toggleEditJobCommentModal\r\n })(WithCommonModal(EditJobCommentForm))\r\n);\r\n","import * as React from 'react';\r\n\r\n/*\r\n * Manage Job Comment\r\n */\r\nimport { Col, Row } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n Ijob,\r\n IjobComment,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser,\r\n Ioption,\r\n ItableFiltersParams\r\n} from '../../models';\r\nimport ReactTable, { RowInfo, SortingRule } from 'react-table';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { emptyTile, initialJob } from '../../reducers/initialState';\r\nimport {\r\n filterJobComments,\r\n getJobComments,\r\n setSelectedJobComment,\r\n setTableFilter,\r\n toggleEditJobCommentModal\r\n} from '../../actions/manageJobCommentsActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport moment from 'moment';\r\nimport { EditJobCommentContainer } from './EditJobCommentContainer';\r\nimport { getJobOptionsFromFilters } from '../../reducers/manageJobReducer';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { getCodes } from '../../actions/manageCodeActions';\r\nimport { getJobsByFacility, getFSEUsers } from '../../actions/manageJobActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { find } from 'lodash';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n loading: boolean;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleEditJobCommentModal: typeof toggleEditJobCommentModal;\r\n getJobComments: () => Promise;\r\n closeAllModals: typeof closeAllModals;\r\n showEditJobCommentModal: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: IjobComment[];\r\n setSelectedJobComment: typeof setSelectedJobComment;\r\n filterJobComments: typeof filterJobComments;\r\n jobCommentsByID: { [key: string]: IjobComment };\r\n fseUsersByID: { [key: string]: Iuser };\r\n selectedJob: Ijob;\r\n jobOptions: Ioption[];\r\n selectedFacilityID: string;\r\n getCodes: typeof getCodes;\r\n getJobsByFacility: () => Promise;\r\n getFSEUsers: () => Promise;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageJobComment extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public columns: any[];\r\n public buttonInAction = false;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile,\r\n searchFieldConfig: this.buildSearchControls()\r\n };\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'date',\r\n Header: 'date',\r\n accessor: ({ createDate }: IjobComment) => {\r\n return createDate\r\n ? moment\r\n .utc(createDate)\r\n .local(true)\r\n .format('DD-MMM-YY')\r\n : 'n/a';\r\n },\r\n width: 100\r\n },\r\n {\r\n Header: 'engineer',\r\n id: 'engineer',\r\n accessor: ({ userID }: IjobComment) => {\r\n const foundUser = find(\r\n this.props.fseUsersByID,\r\n user => user.id === userID\r\n );\r\n return foundUser\r\n ? `${foundUser.first} ${foundUser.last}`\r\n : '';\r\n }\r\n },\r\n {\r\n id: 'comment',\r\n Header: 'comment',\r\n accessor: 'text',\r\n minWidth: 150\r\n },\r\n // code will be used in P3\r\n // {\r\n // id: 'code',\r\n // Header: 'code',\r\n // accessor: 'code',\r\n // minWidth: 100\r\n // },\r\n {\r\n Header: 'type',\r\n id: 'type',\r\n accessor: ({ isDeficiency }: IjobComment) => {\r\n return isDeficiency\r\n ? this.props.t('deficiency')\r\n : this.props.t('info');\r\n },\r\n width: 120\r\n },\r\n {\r\n Header: 'resolved',\r\n id: 'resolved',\r\n accessor: ({ isResolved }: IjobComment) => {\r\n return isResolved\r\n ? this.props.t('Yes')\r\n : this.props.t('No');\r\n },\r\n width: 120\r\n }\r\n ],\r\n this.props.t\r\n );\r\n }\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.initialize();\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditJobCommentModal !==\r\n this.props.showEditJobCommentModal &&\r\n !this.props.showEditJobCommentModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.filterJobComments();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n // filter the rawData when new data received from the API\r\n if (\r\n JSON.stringify(prevProps.jobCommentsByID) !==\r\n JSON.stringify(this.props.jobCommentsByID)\r\n ) {\r\n console.info('raw data changed');\r\n this.props.filterJobComments();\r\n }\r\n if (this.props.selectedFacilityID !== prevProps.selectedFacilityID) {\r\n this.props.getJobComments();\r\n this.props.filterJobComments();\r\n this.props.getJobsByFacility().then(() => {\r\n this.props.filterJobComments();\r\n });\r\n }\r\n if (this.props.jobOptions.length !== prevProps.jobOptions.length) {\r\n this.setState({ searchFieldConfig: this.buildSearchControls() });\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n initialize = () => {\r\n let initPromises: Array> = [];\r\n this.props.getCodes();\r\n initPromises = [\r\n this.props.getJobsByFacility(),\r\n this.props.getFSEUsers(),\r\n this.props.getJobComments()\r\n ];\r\n Promise.all(initPromises).then(() => {\r\n this.props.filterJobComments();\r\n });\r\n };\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const {\r\n /* createDate, */\r\n commentType,\r\n jobID,\r\n isResolved\r\n } = this.props.tableFilters;\r\n const disabled = false;\r\n\r\n const defaultResolved = { label: 'No', value: false };\r\n return {\r\n controls: {\r\n jobID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageJobComments:labelJob',\r\n options: this.props.jobOptions,\r\n colWidth: 6,\r\n colWidthLarge: 4,\r\n type: 'select',\r\n placeholder: 'placeholderUser',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: jobID,\r\n disabled\r\n }\r\n },\r\n // jfbloom22 commented this out because it is not useful\r\n // createDate: {\r\n // render: FormUtil.DatetimeWithoutValidation,\r\n // meta: {\r\n // label: 'manageJobComments:labelCreateDate',\r\n // colWidth: 3,\r\n // colWidthLarge: 2,\r\n // showTime: false\r\n // },\r\n // formState: {\r\n // value: createDate,\r\n // disabled\r\n // }\r\n // },\r\n // removed for now becuase we need to filter the FSE users\r\n // userID: {\r\n // render: FormUtil.SelectWithoutValidation,\r\n // meta: {\r\n // label: 'manageJobComments:labelUser',\r\n // options: FormUtil.convertToOptions(this.props.fseUsers),\r\n // colWidth: 4,\r\n // colWidthLarge: 3,\r\n // type: 'select',\r\n // placeholder: 'placeholderUser',\r\n // isClearable: true\r\n // },\r\n // formState: {\r\n // value: userID,\r\n // disabled\r\n // }\r\n // },\r\n commentType: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageJobComments:labelType',\r\n options: constants.jobCommentTypeOptions,\r\n colWidth: 3,\r\n colWidthLarge: 3,\r\n type: 'select',\r\n placeholder: 'placeholderType',\r\n isClearable: true\r\n },\r\n formState: { value: commentType, disabled }\r\n },\r\n isResolved: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageJobComments:labelResolved',\r\n options: constants.isResolvedOptions,\r\n colWidth: 3,\r\n colWidthLarge: 3,\r\n type: 'select',\r\n placeholder: 'placeholderResolved',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: isResolved || defaultResolved,\r\n disabled\r\n }\r\n }\r\n }\r\n };\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (\r\n finalState: any,\r\n rowInfo?: RowInfo,\r\n column?: undefined,\r\n instance?: any\r\n ) => {\r\n // console.info(\"ROWINFO\", rowInfo);\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.props.toggleEditJobCommentModal();\r\n this.props.setSelectedJobComment(rowInfo.original);\r\n }\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n onPageChange = (page: number) => {\r\n this.props.setTableFilter({ page });\r\n };\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n default:\r\n this.props.setTableFilter({ [key]: value, page: 0 });\r\n break;\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n onPageSizeChange = (rows: number) => {\r\n this.props.setTableFilter({ rows, page: 0 });\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n console.info('search job table submit')\r\n }\r\n loading={this.props.loading}\r\n colorButton={\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ]\r\n }\r\n t={this.props.t}\r\n subscribeValueChanges={true}\r\n onValueChanges={this.onSearchValueChanges}\r\n showSearchButton={false}\r\n />\r\n \r\n {/* \r\n {\r\n this.props.toggleEditJobCommentModal();\r\n this.props.setSelectedJobComment(initialJobComment);\r\n }}\r\n >\r\n {t('manageJobComments:newJobCommentButton')}\r\n \r\n */}\r\n \r\n \r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { manageJob, selectedFacilityID, manageJobComment } = state;\r\n // const { id = '' } = manageJob.jobFormValues;\r\n // const selectedJob = manageJob.jobsByID[id] || initialJob;\r\n const selectedJob = initialJob;\r\n\r\n // only measurmentPointList based jobs have comments\r\n const jobFilters: ItableFiltersParams = {\r\n facilityID: state.selectedFacilityID,\r\n measurementBasedOnly: true\r\n };\r\n const jobOptions = getJobOptionsFromFilters(\r\n state,\r\n { filters: jobFilters },\r\n ownProps.t\r\n );\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n showEditJobCommentModal: manageJobComment.showEditJobCommentModal,\r\n tableData: manageJobComment.filteredJobComments,\r\n tableFilters: manageJobComment.tableFilters,\r\n jobCommentsByID: manageJobComment.jobCommentsByID,\r\n fseUsers: manageJob.fseUsersByID,\r\n selectedJob,\r\n jobOptions,\r\n selectedFacilityID\r\n };\r\n};\r\nexport default withTranslation('manageJobComments')(\r\n connect(mapStateToProps, {\r\n getJobComments,\r\n toggleEditJobCommentModal,\r\n closeAllModals,\r\n setTableFilter,\r\n setSelectedJobComment,\r\n filterJobComments,\r\n getCodes,\r\n getJobsByFacility,\r\n getFSEUsers\r\n })(ManageJobComment)\r\n);\r\n","import * as types from './actionTypes';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport {\r\n ItableFiltersParams,\r\n IleadActivity,\r\n Ilead,\r\n ThunkResult\r\n} from '../models';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { TFunction } from 'i18next';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { constants } from '../constants/constants';\r\nimport { omit, map } from 'lodash';\r\nimport moment from 'moment';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { initialLeadActivity, initialLead } from '../reducers/initialState';\r\nimport { dateRangeEnum } from '../models-enums';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\n// prettier-ignore\r\nconst convertDateRangeToInterval = (dateRange: dateRangeEnum): {startDate: string; endDate: string} => {\r\n switch (dateRange) {\r\n case dateRangeEnum.lastYear:\r\n { \r\n return( \r\n { \r\n startDate:\r\n moment.utc(\r\n moment().subtract('year', 1).startOf('year')\r\n ).format(constants.momentSQLFormat),\r\n endDate: \r\n moment.utc(\r\n moment().subtract('year', 1).endOf('year')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )}\r\n case dateRangeEnum.lastQuarter:\r\n { \r\n return( \r\n { \r\n startDate:\r\n moment.utc(\r\n moment().quarter( // format quarter: number into moment\r\n moment().subtract('quarter', 1).quarter() // subtract one quarter-length from the current quarter\r\n ).startOf('quarter') // Grab the date of the beginning of the quarter\r\n ).format(constants.momentSQLFormat), // format in sql\r\n endDate: \r\n moment.utc(\r\n moment().quarter(\r\n moment().subtract('quarter', 1).quarter()\r\n ).endOf('quarter')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )}\r\n case dateRangeEnum.thisYear:\r\n { \r\n return( \r\n { \r\n startDate:\r\n moment.utc(moment().startOf('year')).format(constants.momentSQLFormat),\r\n endDate: \r\n moment.utc(moment().endOf('year')).format(constants.momentSQLFormat)\r\n }\r\n )}\r\n case dateRangeEnum.thisQuarter:\r\n { \r\n return(\r\n {\r\n startDate:\r\n moment.utc(\r\n moment().startOf('quarter')\r\n ).format(constants.momentSQLFormat),\r\n endDate: \r\n moment.utc(\r\n moment().endOf('quarter')\r\n ).format(constants.momentSQLFormat)\r\n }\r\n )}\r\n default:\r\n return {startDate: '', endDate: ''} // It expects this return type\r\n }\r\n};\r\n\r\nexport function getLeads(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n ranking,\r\n status,\r\n search,\r\n dateRange,\r\n type,\r\n page\r\n } = getState().manageLeads.tableFilters;\r\n\r\n const { startDate, endDate } = convertDateRangeToInterval(\r\n dateRange\r\n ? (dateRange.value as dateRangeEnum)\r\n : dateRangeEnum.thisQuarter\r\n );\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page: page ? page : 1,\r\n ranking: ranking ? ranking.value : false,\r\n search,\r\n status: status ? status.value : false,\r\n startDate: dateRange ? startDate : false,\r\n endDate: dateRange ? endDate : false,\r\n leadType: type ? type.value : false,\r\n sort: `createdate,desc`\r\n }\r\n };\r\n\r\n const url = API.lead.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LEADS_MANAGE_SUCCESS,\r\n leads: resp.data.result\r\n });\r\n dispatch({\r\n type: types.LEADS_MANAGE_TOTAL_PAGES,\r\n pages: resp.data.pages\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEADS_MANAGE_FAILED\r\n });\r\n constants.handleError(error, 'get leads');\r\n console.error('get leads', error);\r\n });\r\n };\r\n}\r\nexport function bulkUpdate(status: number, t: TFunction): ThunkResult {\r\n return (dispatch, getState) => {\r\n const onOk = () => {\r\n dispatch(beginAjaxCall());\r\n const leadIDs = getState().manageLeads.selection.map(\r\n item => item.split('select-')[1]\r\n );\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'POST',\r\n data: leadIDs,\r\n params: FormUtil.toUrlSearchParams({\r\n leadStatus: status.toString()\r\n })\r\n };\r\n\r\n const url = API.lead.bulkUpdateStatus;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n dispatch({\r\n type: types.LEADS_BULK_UPDATE_STATUS_SUCCESS,\r\n leadIDs,\r\n leadStatus: status\r\n });\r\n dispatch(getLeads());\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEADS_BULK_UPDATE_STATUS_FAILED\r\n });\r\n constants.handleError(error, 'bulk update leads');\r\n console.error('bulk update leads', error);\r\n });\r\n };\r\n\r\n const toastrConfirmOptions = {\r\n onOk,\r\n onCancel: () => console.info('CANCEL clicked'),\r\n okText: t('bulkUpdate.tableOkButton'),\r\n cancelText: t('bulkUpdate.tableCancelButton')\r\n };\r\n toastr.confirm(\r\n t('bulkUpdate.deleteContactsConfirmTitle'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n}\r\n\r\nexport function deleteLeadInstallBase(\r\n installBaseID: string,\r\n t: TFunction\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n const url = API.leadInstallBase.single + `/${installBaseID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.LEAD_INSTALL_DELETE_SUCCESS,\r\n payload: { id: installBaseID }\r\n });\r\n toastr.success(\r\n t('toastMessage:success'),\r\n t('toastMessage:deletedLeadInstallBase'),\r\n constants.toastrError\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_INSTALL_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete install base from lead');\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_LEADS,\r\n filters\r\n});\r\n\r\nexport const toggleLeadsModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_LEADS,\r\n show\r\n});\r\n\r\nexport const setSelectedLeadFromID = (leadID: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const lead = getState().manageLeads.leadsByID[leadID];\r\n if (lead) {\r\n dispatch({\r\n type: types.SET_SELECTED_LEAD,\r\n payload: lead\r\n });\r\n } else {\r\n console.info('trying to set selected, but unable to find', leadID);\r\n dispatch({ type: types.TOGGLE_MODAL_LEADS });\r\n }\r\n };\r\n};\r\n\r\nexport const updateSelectedLead = (lead = initialLead) => ({\r\n type: types.UPDATE_SELECTED_LEAD,\r\n payload: lead\r\n});\r\n\r\nexport const updateLead = (lead: Ilead): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const prepLeadForApi = (plead: Ilead): Ilead => {\r\n return {\r\n ...omit(plead, [\r\n 'product',\r\n 'facility',\r\n 'contact',\r\n 'leadInstallBases'\r\n ]),\r\n leadUsers: map(plead.leadUsers, lu => omit(lu, ['user']))\r\n };\r\n };\r\n const leadForAPI = prepLeadForApi(lead);\r\n\r\n dispatch(beginAjaxCall());\r\n const url = `${API.lead.single}/${lead.id}`;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: leadForAPI\r\n };\r\n\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n }\r\n dispatch(toggleLeadsModal());\r\n dispatch({\r\n type: types.LEAD_UPDATE_SUCCESS,\r\n payload: lead\r\n });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'failed updating lead');\r\n throw error;\r\n });\r\n };\r\n};\r\n\r\n/*\r\n * LEAD ACTIVITY\r\n */\r\n\r\nexport function getLeadActivities(leadID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n id: leadID\r\n }\r\n };\r\n const url = API.leadActivity.getAll;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LEAD_ACTIVITIES_MANAGE_SUCCESS,\r\n leadActivities: resp.data\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_ACTIVITIES_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get lead activities');\r\n console.error('get lead activities', error);\r\n });\r\n };\r\n}\r\n\r\nexport const updateSelectedLeadActivity = (\r\n leadActivity = initialLeadActivity\r\n) => ({\r\n type: types.UPDATE_SELECTED_LEAD_ACTIVITY,\r\n leadActivity\r\n});\r\n\r\nexport const toggleLeadActivityModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_LEAD_ACTIVITIES,\r\n show\r\n});\r\n\r\nexport const toggleEditLeadActivityModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_EDIT_LEAD_ACTIVITY,\r\n show\r\n});\r\n\r\nexport function deleteLeadActivity(id: string, t: TFunction): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const url = `${API.leadActivity.single}/${id}`;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_DELETE_SUCCESS,\r\n payload: id\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_LEAD_ACTIVITY });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'deleted leadActivity');\r\n console.error(error);\r\n });\r\n };\r\n}\r\nexport function saveLeadActivity(\r\n leadActivity: IleadActivity\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const cleanedLeadActivity = omit(leadActivity, ['user']);\r\n\r\n const uuid = uuidv4();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n ...cleanedLeadActivity,\r\n userID: getState().user.id,\r\n id: uuid\r\n }\r\n };\r\n const url = API.leadActivity.single;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_ADD_SUCCESS,\r\n leadActivity: {\r\n ...leadActivity,\r\n id: uuid,\r\n user: getState().user\r\n }\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Created new lead activity.',\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_LEAD_ACTIVITY });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_ADD_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'create leadActivity');\r\n console.error(error);\r\n });\r\n };\r\n}\r\nexport function updateLeadActivity(\r\n leadActivity: IleadActivity\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const cleanedLeadActivity = omit(leadActivity, ['userID', 'user']);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: {\r\n ...cleanedLeadActivity\r\n }\r\n };\r\n const url = `${API.leadActivity.single}/${leadActivity.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_UPDATE_SUCCESS,\r\n leadActivity: { ...leadActivity }\r\n });\r\n toastr.success(\r\n 'Success',\r\n 'Updated lead activity.',\r\n constants.toastrSuccess\r\n );\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_LEAD_ACTIVITY });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.LEAD_ACTIVITY_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update leadActivity');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * setSelectedLeadActivityFromID\r\n * select the leadActivity and set it as the selectedLeadActivity\r\n */\r\nexport function setSelectedLeadActivityFromID(id: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n const leadActivity = getState().manageLeads.leadActivitiesByID[id];\r\n if (leadActivity) {\r\n dispatch({\r\n type: types.SET_SELECTED_LEAD_ACTIVITY,\r\n leadActivity\r\n });\r\n } else {\r\n // TODO this can be improved by adding an API call to get this specific leadActivity\r\n console.info(\r\n 'trying to set selected leadActivity from id, but unable to find leadActivity',\r\n id\r\n );\r\n dispatch({\r\n type: types.TOGGLE_MODAL_EDIT_LEAD_ACTIVITY,\r\n show: false\r\n });\r\n }\r\n };\r\n}\r\n\r\nexport const updateLeadSelection = (selection: string[]) => ({\r\n type: types.LEAD_UPDATE_SELECTION,\r\n payload: selection\r\n});\r\n","import React from 'react';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n Ilead,\r\n Ifacility,\r\n Iproduct,\r\n IleadUser,\r\n Iuser,\r\n Ioption,\r\n Ihistory,\r\n IleadPopulated\r\n} from '../../models';\r\nimport {\r\n leadRankingEnum,\r\n leadTypeEnum,\r\n leadStatusEnumSelect,\r\n leadStatusEnum\r\n} from '../../models-enums';\r\nimport { IleadFormValues } from '../../modelsForms';\r\nimport moment from 'moment';\r\nimport {\r\n initialFacility,\r\n initialLeadPopulated\r\n} from '../../reducers/initialState';\r\nimport { constants } from '../../constants/constants';\r\nimport { omit, map, debounce, find, filter } from 'lodash';\r\nimport { FacilityContactControl } from '../common/FacilityContactControl';\r\nimport { toggleFacilityContactModal } from '../../actions/manageFacilityActions';\r\nimport {\r\n updateLead,\r\n setSelectedLeadFromID,\r\n updateSelectedLead\r\n} from '../../actions/manageLeadsActions';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { manageLeadQueryParamsEnum } from './ManageLeads';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { getCloudDocument } from '../../actions/manageDocumentActions';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n loading: boolean;\r\n show: boolean;\r\n toggleModal: () => void;\r\n colorButton: string;\r\n selectedLead: IleadPopulated;\r\n facility: Ifacility;\r\n product: Iproduct;\r\n salesManagerNames: string;\r\n salesPersons: { [key: string]: Iuser };\r\n toggleFacilityContactModal: typeof toggleFacilityContactModal;\r\n updateLead: typeof updateLead;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n setSelectedLeadFromID: typeof setSelectedLeadFromID;\r\n updateSelectedLead: typeof updateSelectedLead;\r\n getSecurityUsers: typeof getSecurityUsers;\r\n history: Ihistory;\r\n getCloudDocument: typeof getCloudDocument;\r\n}\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditLeadForm extends React.PureComponent<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateSelectedLeadDebounced: (lead?: Ilead) => void;\r\n static defaultProps = {\r\n selectedLead: initialLeadPopulated,\r\n facility: initialFacility\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n this.updateSelectedLeadDebounced = debounce(\r\n this.props.updateSelectedLead,\r\n constants.formDebounceTime\r\n );\r\n }\r\n componentDidMount() {\r\n // get the sales persons for the sales persons select options\r\n this.props.getSecurityUsers([\r\n constants.securityFunctions.SalesService.id,\r\n constants.securityFunctions.SalesParts.id,\r\n constants.securityFunctions.SalesInstallation.id\r\n ]);\r\n this.initSelected();\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (this.props.selectedLead.id !== prevProps.selectedLead.id) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n // TODO update the form when a new contact is added\r\n if (\r\n this.props.selectedLead.contactID !==\r\n prevProps.selectedLead.contactID\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (this.props.salesManagerNames !== prevProps.salesManagerNames) {\r\n this.formGroup.meta = {\r\n salesManagerNames: this.props.salesManagerNames,\r\n loading: this.props.loading\r\n };\r\n this.formGroup.stateChanges.next();\r\n }\r\n\r\n // salesPersons will change because we finished downloading them\r\n if (\r\n JSON.stringify(this.props.salesPersons) !==\r\n JSON.stringify(prevProps.salesPersons)\r\n ) {\r\n FormUtil.patchControl(this.formGroup, 'leadUsers', null, {\r\n options: FormUtil.convertToOptions(\r\n map(this.props.salesPersons, (salesPerson: any) => ({\r\n id: salesPerson.id,\r\n first: salesPerson.first,\r\n last: salesPerson.last\r\n }))\r\n )\r\n });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n removeQuery(\r\n manageLeadQueryParamsEnum.selectedLeadID,\r\n this.props.history\r\n );\r\n this.props.updateSelectedLead();\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, make sure it matches what is active in redux\r\n * if no query param and there is a selectedLead.id, then reset what is in redux\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedLeadID &&\r\n this.props.queryParams.selectedLeadID !== this.props.selectedLead.id\r\n ) {\r\n this.props.setSelectedLeadFromID(\r\n this.props.queryParams.selectedLeadID\r\n );\r\n } else if (\r\n this.props.queryParams.selectedLeadID === undefined &&\r\n this.props.selectedLead.id.length\r\n ) {\r\n this.props.updateSelectedLead();\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IleadFormValues => {\r\n let {\r\n createDate,\r\n contact,\r\n ranking,\r\n leadUsers,\r\n status\r\n } = this.props.selectedLead;\r\n if (!createDate) {\r\n createDate = moment\r\n .utc()\r\n .format(constants.momentDisplayFormatWithTime);\r\n } else {\r\n createDate = moment(createDate).format(\r\n constants.momentDisplayFormatWithTime\r\n );\r\n }\r\n const selectedRankingOption: Ioption = {\r\n value: ranking.toLocaleString(),\r\n label: leadRankingEnum[ranking]\r\n };\r\n const selectedStatusOption: Ioption = {\r\n value: status.toLocaleString(),\r\n label: leadStatusEnum[status]\r\n };\r\n // filter out sales managers\r\n const filteredLeadUsers = filter(leadUsers, {\r\n assignedDueToMissingCoverage: false\r\n });\r\n const selectedLeadUserUsers = map(filteredLeadUsers, lu => {\r\n return {\r\n ...lu.user\r\n };\r\n });\r\n const cleanedLead = omit(this.props.selectedLead, [\r\n 'facility',\r\n 'product',\r\n 'quote',\r\n 'leadUsers',\r\n 'leadInstallBases',\r\n 'contact'\r\n ]);\r\n let contactName = '';\r\n if (contact) {\r\n contactName = `${\r\n contact.user ? contact.user.first : contact.firstName\r\n } ${contact.user ? contact.user.last : contact.lastName}`;\r\n }\r\n\r\n return {\r\n ...cleanedLead,\r\n createDate,\r\n contactName,\r\n selectedRankingOption,\r\n selectedStatusOption,\r\n selectedLeadUserUsers: FormUtil.convertToOptions(\r\n selectedLeadUserUsers\r\n )\r\n };\r\n };\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedItem\r\n */\r\n formValuesToItem = (updatedValue?: { [key: string]: any }): Ilead => {\r\n let formValues = this.formGroup.value;\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n return {\r\n ...this.props.selectedLead,\r\n ...FormUtil.getValues(formValues),\r\n leadUsers: this.buildLeadUsers(formValues.leadUsers)\r\n };\r\n };\r\n\r\n copyToClipboard = () => {\r\n if (this.props.selectedLead.leadNumber) {\r\n navigator.clipboard.writeText(\r\n this.props.selectedLead.leadNumber.toString()\r\n );\r\n toastr.success(\r\n this.props.t('toastMessage:success'),\r\n this.props.t('toastMessage:copiedLeadNumber'),\r\n constants.toastrSuccess\r\n );\r\n }\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IleadFormValues = this.itemToFormValues()\r\n ) => {\r\n const disabled = false;\r\n const { t } = this.props;\r\n const fieldFormControls = {\r\n $field_0: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n }}\r\n />\r\n )\r\n },\r\n $field_type: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_1: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_4: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_2: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_3: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n\r\n $field_salesManagerNames: {\r\n isStatic: false,\r\n render: ({ meta }) =>\r\n this.props.salesManagerNames ? (\r\n \r\n ) : null\r\n },\r\n $field_download: {\r\n isStatic: false,\r\n render: () =>\r\n this.props.selectedLead.quote?.cloudDocumentID ? (\r\n \r\n {\r\n this.props.getCloudDocument(\r\n t,\r\n {\r\n ...this.props.selectedLead.quote\r\n ?.cloudDocument,\r\n version: this.props.selectedLead\r\n .quote?.cloudDocumentID,\r\n documentID: this.props.selectedLead\r\n .quote?.id\r\n },\r\n true\r\n );\r\n }}\r\n >\r\n {' '}\r\n  \r\n {t('editLeadForm.viewQuote')}\r\n \r\n \r\n ) : null\r\n },\r\n $field_8: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n contact: {\r\n render: FacilityContactControl,\r\n meta: {\r\n buttonLabel: this.props.t(\r\n 'facility:facilityContactForm.manageContactsButton'\r\n ),\r\n colWidth: 6,\r\n noMargin: true,\r\n colorButton: this.props.colorButton,\r\n toggleModal: this.props.toggleFacilityContactModal\r\n },\r\n formState: { value: defaultValues.contact, disabled }\r\n },\r\n ranking: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'Ranking',\r\n colWidth: 6,\r\n required: false,\r\n isClearable: false,\r\n shouldTranslate: true,\r\n disableSort: false,\r\n options: FormUtil.convertEnumToOptions(leadRankingEnum)\r\n },\r\n formState: {\r\n disabled,\r\n value: defaultValues.selectedRankingOption\r\n }\r\n },\r\n status: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'Status',\r\n colWidth: 6,\r\n required: false,\r\n isClearable: true,\r\n shouldTranslate: true,\r\n options: FormUtil.convertEnumToOptions(leadStatusEnumSelect)\r\n },\r\n formState: {\r\n disabled,\r\n value: defaultValues.selectedStatusOption\r\n }\r\n },\r\n leadUsers: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'Sales Person',\r\n colWidth: 12,\r\n required: true,\r\n isClearable: true,\r\n isMulti: true,\r\n options: FormUtil.convertToOptions(\r\n map(this.props.salesPersons, (salesPerson: any) => ({\r\n id: salesPerson.id,\r\n first: salesPerson.first,\r\n last: salesPerson.last\r\n }))\r\n )\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n disabled,\r\n value: defaultValues.selectedLeadUserUsers\r\n }\r\n },\r\n notes: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'Note',\r\n colWidth: 12,\r\n required: false,\r\n isClearable: true,\r\n initialContent: defaultValues.notes\r\n },\r\n formState: {\r\n disabled,\r\n value: defaultValues.notes\r\n }\r\n },\r\n $field_partHtml: {\r\n isStatic: false,\r\n render: () => (\r\n
    \r\n )\r\n },\r\n $field_internalComments: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n const fieldConfig = {\r\n controls: { ...fieldFormControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, t);\r\n };\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n default:\r\n this.updateSelectedLeadDebounced(\r\n this.formValuesToItem({ [key]: value })\r\n );\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * buildLeadUsers\r\n * loop over the options, converting them to actual leadUsers\r\n */\r\n buildLeadUsers = (leadUserOptions: Ioption[]): IleadUser[] => {\r\n return map(leadUserOptions, luo => {\r\n // we can assume the luo.value is a user.id\r\n const foundLeadUser = find(this.props.selectedLead.leadUsers, {\r\n userID: luo.value\r\n });\r\n if (foundLeadUser) {\r\n return {\r\n ...foundLeadUser,\r\n assignedDueToMissingCoverage: false\r\n };\r\n } else {\r\n const foundUser = this.props.salesPersons[luo.value];\r\n if (foundUser) {\r\n // create a new leadUser\r\n return {\r\n id: uuidv4(),\r\n userID: luo.value,\r\n leadID: this.props.selectedLead.id,\r\n isDeleted: false,\r\n assignedDueToMissingCoverage: false\r\n };\r\n } else {\r\n throw new Error('unable to find lead user or user');\r\n }\r\n }\r\n });\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading,\r\n salesManagerNames: this.props.salesManagerNames\r\n };\r\n this.formGroup.stateChanges.next(); // render the new meta values\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n this.props.updateLead(this.formValuesToItem());\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const formClassName = `clearfix job-form beacon-form ${this.props.colorButton}`;\r\n return (\r\n
    \r\n \r\n\r\n \r\n \r\n {t('close')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withTranslation('manageLeads')(EditLeadForm);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n Ilead,\r\n IleadInstallBase,\r\n ImanageLeadsReducer,\r\n IleadActivity,\r\n IleadUser,\r\n IleadUserPopulated\r\n} from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport {\r\n filter,\r\n forEach,\r\n keyBy,\r\n map,\r\n pickBy,\r\n omit,\r\n orderBy,\r\n find\r\n} from 'lodash';\r\nimport initialState, {\r\n initialLead,\r\n initialLeadInstallBase,\r\n initialInstallBase,\r\n initialLeadActivity,\r\n initialContact,\r\n initialUser,\r\n initialLeadUser\r\n} from './initialState';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport moment from 'moment';\r\nimport { IinitialState } from '.';\r\n\r\nconst selectLeadsByID = (state: IinitialState) => state.manageLeads.leadsByID;\r\nconst selectLeadInstallBasesByID = (state: IinitialState) =>\r\n state.manageLeads.leadInstallBasesByID;\r\nconst selectInstallBasesByID = (state: IinitialState) =>\r\n state.manageInventory.installBasesByID;\r\nconst getLeadActivities = (state: IinitialState) =>\r\n state.manageLeads.leadActivitiesByID;\r\nconst getSelectedLead = (state: IinitialState) =>\r\n state.manageLeads.selectedLead;\r\nconst getRawUsers = (state: IinitialState) => state.rawUsersByID;\r\nconst getLeadUsers = (state: IinitialState) => state.manageLeads.leadUsersByID;\r\nconst getLeadIdProp = (state: IinitialState, props: { leadID: string }) =>\r\n props.leadID;\r\n\r\n// a reselect selector to grab the leads with the populated leadInstallBases\r\nexport const selectLeadInstallBasesForTable = createSelector(\r\n [selectLeadInstallBasesByID, selectInstallBasesByID],\r\n (leadInstallBasesByID, installBasesByID) => {\r\n return map(leadInstallBasesByID, leadInstall => {\r\n return {\r\n ...leadInstall,\r\n installBase:\r\n installBasesByID[leadInstall.installBaseID] ||\r\n initialInstallBase\r\n };\r\n });\r\n }\r\n);\r\n\r\nexport const selectPopulatedLeadUsers = createSelector(\r\n [getRawUsers, getLeadUsers],\r\n (rawUsersByID, leadUsersByID): IleadUserPopulated[] => {\r\n const filteredLeadUsers = filter(leadUsersByID, { isDeleted: false });\r\n return map(filteredLeadUsers, lUser => {\r\n const user = rawUsersByID[lUser.userID];\r\n const salesManager = user\r\n ? rawUsersByID[user.salesManagerID]\r\n : initialUser;\r\n return {\r\n ...lUser,\r\n user: { ...user, salesManager }\r\n };\r\n });\r\n }\r\n);\r\n\r\nexport const selectSelectedLead = createSelector(\r\n [selectLeadsByID, getLeadIdProp, selectPopulatedLeadUsers],\r\n (leadsByID, leadID, leadUsersPopulated) => {\r\n const filteredLeadUsersPopulated = filter(leadUsersPopulated, {\r\n isDeleted: false,\r\n leadID\r\n });\r\n return { ...leadsByID[leadID], leadUsers: filteredLeadUsersPopulated };\r\n }\r\n);\r\n// a reselect selector to populate the leadInstallBases on the leads\r\nexport const selectLeadsForTable = createSelector(\r\n [selectLeadsByID, selectLeadInstallBasesForTable, selectPopulatedLeadUsers],\r\n (leadsByID, leadInstallBases, leadUsersPopulated) => {\r\n return map(leadsByID, lead => {\r\n const filteredLeadInstallBases = filter(leadInstallBases, {\r\n leadID: lead.id,\r\n isDeleted: false\r\n });\r\n const filteredLeadUsers = filter(leadUsersPopulated, {\r\n isDeleted: false,\r\n leadID: lead.id\r\n });\r\n\r\n let contact = initialContact;\r\n if (lead.contact) {\r\n contact = {\r\n ...lead.contact,\r\n firstName: lead.contact.user\r\n ? lead.contact.user.first\r\n : lead.contact.firstName,\r\n lastName: lead.contact.user\r\n ? lead.contact.user.last\r\n : lead.contact.lastName\r\n };\r\n }\r\n return {\r\n ...lead,\r\n leadInstallBases: filteredLeadInstallBases,\r\n leadUsers: filteredLeadUsers,\r\n contact\r\n };\r\n });\r\n }\r\n);\r\n\r\nexport const selectLeadActivityForLead = createSelector(\r\n [getLeadActivities, getSelectedLead],\r\n (leadActivitiesByID, lead) => {\r\n const filtered = filter(leadActivitiesByID, {\r\n leadID: lead.id,\r\n isDeleted: false\r\n });\r\n return orderBy(\r\n filtered,\r\n res => moment.utc(res.activityDate).unix(),\r\n 'desc'\r\n );\r\n }\r\n);\r\n\r\n// clean and filter out deleted and remove the nested objects\r\nconst cleanLeads = (leads: any): Ilead[] => {\r\n const filtered = filter(leads, { isDeleted: false });\r\n return filtered.map((item: any) => ({\r\n ...initialLead,\r\n ...(pickBy(item, property => property !== null) as Ilead),\r\n facility: undefined,\r\n leadInstallBases: undefined,\r\n leadUsers: undefined\r\n }));\r\n};\r\n\r\nconst cleanLeadUser = (leadUser: any): IleadUser => {\r\n return {\r\n ...initialLeadUser,\r\n ...pickBy(leadUser, property => property !== null)\r\n };\r\n};\r\n\r\n// clean and filter out deleted and remove the nested objects\r\nconst cleanLeadInstallBases = (leadInstallBases: any): IleadInstallBase[] => {\r\n const filtered = filter(leadInstallBases, { isDeleted: false });\r\n return filtered.map((item: any) => ({\r\n ...initialLeadInstallBase,\r\n ...(pickBy(item, property => property !== null) as IleadInstallBase),\r\n installBase: undefined\r\n }));\r\n};\r\n\r\n// clean and filter out deleted and remove the nested objects\r\nconst cleanLeadActivities = (leadActivities: any): IleadActivity[] => {\r\n const filtered = filter(leadActivities, { isDeleted: false });\r\n return filtered.map((item: any) => ({\r\n ...initialLeadActivity,\r\n ...(pickBy(item, property => property !== null) as IleadActivity)\r\n }));\r\n};\r\n\r\n/*\r\n * REDUCERS\r\n */\r\n\r\nfunction leadUsersByIDReducer(\r\n state: { [key: string]: IleadUser } = initialState.manageLeads\r\n .leadUsersByID,\r\n action: any\r\n): { [key: string]: IleadUser } {\r\n switch (action.type) {\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n let newLeadUsers: { [key: string]: IleadUser } = {};\r\n forEach(action.leads, (rawLead: any) => {\r\n if (rawLead.leadUsers && rawLead.leadUsers.length) {\r\n forEach(rawLead.leadUsers, (lu: IleadUser) => {\r\n newLeadUsers = {\r\n ...newLeadUsers,\r\n [lu.id]: cleanLeadUser(lu)\r\n };\r\n });\r\n }\r\n });\r\n return { ...state, ...newLeadUsers };\r\n }\r\n case types.LEAD_UPDATE_SUCCESS: {\r\n let updatedLeadUsers: { [key: string]: IleadUser } = {};\r\n const originalLeadUsers = filter(state, {\r\n leadID: action.payload.id\r\n });\r\n if (action.payload.leadUsers && action.payload.leadUsers.length) {\r\n forEach(originalLeadUsers, (lu: IleadUser) => {\r\n const isDeleted =\r\n find(action.payload.leadUsers, { id: lu.id }) ===\r\n undefined;\r\n updatedLeadUsers = {\r\n ...updatedLeadUsers,\r\n [lu.id]: { ...lu, isDeleted }\r\n };\r\n });\r\n forEach(action.payload.leadUsers, (lu: IleadUser) => {\r\n updatedLeadUsers = { ...updatedLeadUsers, [lu.id]: lu };\r\n });\r\n }\r\n return { ...state, ...updatedLeadUsers };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\nfunction leadsByIDReducer(\r\n state: { [key: string]: Ilead } = initialState.manageLeads.leadsByID,\r\n action: any\r\n): { [key: string]: Ilead } {\r\n switch (action.type) {\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n return keyBy(cleanLeads(action.leads), 'id');\r\n }\r\n case types.LEAD_UPDATE_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.LEADS_BULK_UPDATE_STATUS_SUCCESS: {\r\n if (action.leadIDs && action.leadIDs.length) {\r\n const updatedLeads = map(state, lead => {\r\n if (action.leadIDs.indexOf(lead.id) !== -1) {\r\n return { ...lead, status: action.leadStatus };\r\n } else {\r\n return lead;\r\n }\r\n });\r\n return keyBy(updatedLeads, 'id');\r\n } else {\r\n return state;\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction leadActivitiesByIDReducer(\r\n state: { [key: string]: IleadActivity } = initialState.manageLeads\r\n .leadActivitiesByID,\r\n action: any\r\n): { [key: string]: IleadActivity } {\r\n switch (action.type) {\r\n case types.LEAD_ACTIVITIES_MANAGE_SUCCESS: {\r\n if (action.leadActivities) {\r\n const cleanedActivities = cleanLeadActivities(\r\n action.leadActivities\r\n );\r\n return { ...state, ...keyBy(cleanedActivities, 'id') };\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.LEAD_ACTIVITY_ADD_SUCCESS: {\r\n return { ...state, [action.leadActivity.id]: action.leadActivity };\r\n }\r\n case types.LEAD_ACTIVITY_UPDATE_SUCCESS: {\r\n return { ...state, [action.leadActivity.id]: action.leadActivity };\r\n }\r\n case types.LEAD_ACTIVITY_DELETE_SUCCESS: {\r\n return omit(state, action.payload);\r\n }\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction leadInstallBasesByIDReducer(\r\n state: { [key: string]: IleadInstallBase } = initialState.manageLeads\r\n .leadInstallBasesByID,\r\n action: any\r\n): { [key: string]: IleadInstallBase } {\r\n switch (action.type) {\r\n case types.LEADS_MANAGE_SUCCESS: {\r\n if (action.leads) {\r\n let newLeadInstallBases: IleadInstallBase[] = [];\r\n forEach(action.leads, lead => {\r\n newLeadInstallBases = [\r\n ...newLeadInstallBases,\r\n ...cleanLeadInstallBases(lead.leadInstallBases)\r\n ];\r\n });\r\n return { ...state, ...keyBy(newLeadInstallBases, 'id') };\r\n } else {\r\n return state;\r\n }\r\n }\r\n\r\n case types.LEAD_INSTALL_UPDATE_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.LEAD_INSTALL_DELETE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.payload.id]: {\r\n ...state[action.payload.id],\r\n isDeleted: true\r\n }\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(\r\n state: number = initialState.manageLeads.totalPages,\r\n action: any\r\n): number {\r\n switch (action.type) {\r\n case types.LEADS_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageLeads.totalPages;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction selection(\r\n state: string[] = initialState.manageLeads.selection,\r\n action: any\r\n): string[] {\r\n switch (action.type) {\r\n case types.LEAD_UPDATE_SELECTION:\r\n return action.payload;\r\n case types.LEADS_BULK_UPDATE_STATUS_SUCCESS:\r\n return [];\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageLeads.selection;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction selectedLeadReducer(state: Ilead = initialLead, action: any): Ilead {\r\n switch (action.type) {\r\n case types.SET_SELECTED_LEAD:\r\n return action.payload;\r\n case types.UPDATE_SELECTED_LEAD:\r\n return action.payload;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n * stores the lead activity currently being edited\r\n */\r\nconst selectedLeadActivityReducer = (\r\n state = initialLeadActivity,\r\n action: any\r\n): IleadActivity => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_LEAD_ACTIVITY: {\r\n return action.leadActivity;\r\n }\r\n case types.SET_SELECTED_LEAD_ACTIVITY: {\r\n return action.leadActivity;\r\n }\r\n case types.LEAD_ACTIVITY_DELETE_SUCCESS: {\r\n if (state.id === action.payload) {\r\n return initialLeadActivity;\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.LEAD_ACTIVITY_ADD_SUCCESS: {\r\n return initialLeadActivity;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst leadsManage = combineReducers({\r\n leadsByID: leadsByIDReducer,\r\n leadUsersByID: leadUsersByIDReducer,\r\n leadInstallBasesByID: leadInstallBasesByIDReducer,\r\n leadActivitiesByID: leadActivitiesByIDReducer,\r\n totalPages,\r\n showLeadActivityModal: (state, action) =>\r\n modalToggleWithName(state, action, 'LEAD_ACTIVITIES'),\r\n showEditLeadActivityModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_LEAD_ACTIVITY'),\r\n showEditLeadModal: (state, action) =>\r\n modalToggleWithName(state, action, 'LEADS'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_LEADS'),\r\n selection,\r\n selectedLead: selectedLeadReducer,\r\n selectedLeadActivity: selectedLeadActivityReducer\r\n});\r\n\r\nexport default leadsManage;\r\n","import { connect } from 'react-redux';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport EditLeadForm from './EditLeadForm';\r\nimport {\r\n toggleLeadsModal,\r\n updateLead,\r\n setSelectedLeadFromID,\r\n updateSelectedLead\r\n} from '../../actions/manageLeadsActions';\r\nimport { toggleFacilityContactModal } from '../../actions/manageFacilityActions';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { IleadUser, Iuser, Ihistory } from '../../models';\r\nimport { initialUser } from '../../reducers/initialState';\r\nimport { map, reduce } from 'lodash';\r\nimport { manageLeadQueryParamsEnum } from './ManageLeads';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { selectSecurityUsers } from '../../reducers/manageUserReducer';\r\nimport { selectSelectedLead } from '../../reducers/manageLeadsReducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getCloudDocument } from '../../actions/manageDocumentActions';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n history: Ihistory;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedLead = selectSelectedLead(state, {\r\n leadID: ownProps.queryParams.selectedLeadID\r\n });\r\n const { facilityID, productID, quoteID, leadUsers } = selectedLead;\r\n const facility = state.facilities[facilityID];\r\n const product = state.manageInventory.productsByID[productID];\r\n const quote = state.manageCustomerQuotes.quotesByID[quoteID];\r\n\r\n // collect the sales managers and build the sales manager names\r\n const managersById = reduce(\r\n leadUsers,\r\n (managers: { [key: string]: Iuser }, leadUser: IleadUser) => {\r\n if (leadUser.user) {\r\n const { salesManagerID } = leadUser.user;\r\n const salesManager = leadUser.user.salesManager || initialUser;\r\n if (salesManagerID && !managers[salesManagerID]) {\r\n managers[salesManagerID] = salesManager;\r\n }\r\n }\r\n return managers;\r\n },\r\n {}\r\n );\r\n const salesManagerNames = map(managersById, (manager: Iuser) => {\r\n return `${manager.first} ${manager.last}`;\r\n }).join(', ');\r\n\r\n return {\r\n show: state.manageLeads && state.manageLeads.showEditLeadModal,\r\n selectedLead,\r\n loading: selectIsLoading(state),\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editLeadForm.formTitle'),\r\n facility,\r\n product,\r\n quote,\r\n salesManagerNames,\r\n salesPersons: selectSecurityUsers(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('manageLeads')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleLeadsModal,\r\n onHide: toggleLeadsModal,\r\n toggleModal: toggleLeadsModal,\r\n toggleFacilityContactModal,\r\n updateLead,\r\n updateSelectedLead,\r\n setSelectedLeadFromID,\r\n getSecurityUsers,\r\n getCloudDocument\r\n })(WithCommonModal(EditLeadForm))\r\n);\r\n","import { Ilead, IleadInstallBase } from '../../models';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport React from 'react';\r\nimport { TFunction } from 'i18next';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\ninterface RowInfoInstallBase extends RowInfo {\r\n original: IleadInstallBase;\r\n}\r\n\r\ninterface ExpanderProps extends RowInfo {\r\n t: TFunction;\r\n original: Ilead;\r\n handleDeleteLeadInstallBase: (id: string, t: TFunction) => void;\r\n}\r\n\r\nexport const LeadInstallBasesExpander: React.SFC = (\r\n props: ExpanderProps\r\n) => {\r\n const handleDelete = (deletedItem: IleadInstallBase) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n props.handleDeleteLeadInstallBase(deletedItem.id, props.t);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: props.t('common:delete'),\r\n cancelText: props.t('common:cancel')\r\n };\r\n toastr.confirm(props.t('common:deleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n const getTdProps = (\r\n state: FinalState,\r\n rowInfo: RowInfoInstallBase | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id && column.id === 'delete-button') {\r\n return {\r\n onClick: () => {\r\n handleDelete(rowInfo.original);\r\n },\r\n style: { cursor: 'pointer' }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n minWidth: 20,\r\n id: 'indent-column-button-bar'\r\n },\r\n {\r\n Header: 'serialNumber',\r\n accessor: 'installBase.serialNumber',\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'assetNumber',\r\n accessor: 'installBase.rfid',\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'location',\r\n accessor: 'installBase.fullLocation',\r\n minWidth: 220\r\n },\r\n {\r\n Header: '',\r\n id: 'delete-button',\r\n Cell: ({ original }: { original: Ilead }) => {\r\n return (\r\n \r\n \r\n
    \r\n );\r\n },\r\n minWidth: 20\r\n }\r\n ],\r\n props.t\r\n );\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n};\r\n","import { Col, DropdownButton, MenuItem } from 'react-bootstrap';\r\n\r\nimport { Ilead } from '../../models';\r\nimport React from 'react';\r\nimport { RowInfo } from 'react-table';\r\nimport { TFunction } from 'i18next';\r\n\r\ninterface RowInfoLead extends RowInfo {\r\n original: Ilead;\r\n}\r\ninterface Iprops {\r\n t: TFunction;\r\n rowInfo: RowInfoLead;\r\n colorButton: string;\r\n setSelectedLeadFromID: (id: string) => void;\r\n showLeadActivity: (leadID: string) => void;\r\n}\r\n\r\nexport const ActionButton = (props: Iprops) => {\r\n const { t } = props;\r\n\r\n return (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1:\r\n props.setSelectedLeadFromID(\r\n props.rowInfo.original.id\r\n );\r\n break;\r\n case 2:\r\n console.info('eh');\r\n break;\r\n case 3:\r\n props.showLeadActivity(props.rowInfo.original.id);\r\n break;\r\n }\r\n }}\r\n >\r\n {t('editLead')}\r\n {/* {t('manageContact')} commented out by jfbloom22 because it is not a priority */}\r\n {t('viewActivity')}\r\n \r\n \r\n );\r\n};\r\n","import React from 'react';\r\n\r\nimport { Button, Col, ListGroup, ListGroupItem, Row } from 'react-bootstrap';\r\n\r\nimport moment from 'moment';\r\nimport { IleadActivity } from '../../models';\r\nimport { TFunction } from 'i18next';\r\nimport { leadActivityTypesEnum } from '../../models-enums';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { map } from 'lodash';\r\nimport { updateSelectedLeadActivity } from '../../actions/manageLeadsActions';\r\n\r\nconst LeadActivityItem = ({\r\n leadActivity,\r\n handleSelectLeadActivity,\r\n t\r\n}: {\r\n leadActivity: IleadActivity;\r\n handleSelectLeadActivity: (id: string) => void;\r\n toggleEditLeadActivityModal: () => void;\r\n t: TFunction;\r\n}) => (\r\n handleSelectLeadActivity(leadActivity.id)}\r\n >\r\n {' '}\r\n \r\n \r\n {moment\r\n .utc(leadActivity.activityDate)\r\n .local(true)\r\n .format('DD-MMM-YY LT')}\r\n \r\n \r\n {leadActivity.user.first} {leadActivity.user.last}\r\n \r\n \r\n {t('common:' + leadActivityTypesEnum[leadActivity.type])}\r\n \r\n \r\n \r\n);\r\n\r\ninterface Iprops {\r\n leadActivities: IleadActivity[];\r\n colorButton: string;\r\n toggleModal: () => void;\r\n handleSelectLeadActivity: (id: string) => void;\r\n toggleEditLeadActivityModal: () => void;\r\n updateSelectedLeadActivity: typeof updateSelectedLeadActivity;\r\n}\r\n\r\nclass LeadActivityList extends React.PureComponent {\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n }\r\n render() {\r\n const { t, leadActivities } = this.props;\r\n if (leadActivities.length) {\r\n return (\r\n
    \r\n \r\n \r\n {map(leadActivities, (leadActivity: IleadActivity) => {\r\n return (\r\n \r\n );\r\n })}\r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n // this.props.updateSelectedJob();\r\n // removeQuery(\r\n // manageJobQueryParamsEnum.selectedJobID,\r\n // this.props.history\r\n // );\r\n }}\r\n >\r\n {t('done')}\r\n \r\n {\r\n this.props.toggleEditLeadActivityModal();\r\n this.props.updateSelectedLeadActivity();\r\n }}\r\n >\r\n {t('manageLeads:addButton')}\r\n \r\n \r\n
    \r\n );\r\n } else {\r\n return (\r\n
    \r\n \r\n

    {t('No lead activities for this lead.')}

    \r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n // this.props.updateSelectedJob();\r\n // removeQuery(\r\n // manageJobQueryParamsEnum.selectedJobID,\r\n // this.props.history\r\n // );\r\n }}\r\n >\r\n {t('cancel')}\r\n \r\n {\r\n this.props.toggleEditLeadActivityModal();\r\n this.props.updateSelectedLeadActivity();\r\n }}\r\n >\r\n {t('manageLeads:addButton')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n }\r\n}\r\n\r\nexport default LeadActivityList;\r\n","import { connect } from 'react-redux';\r\n\r\nimport { Ihistory } from '../../models';\r\n\r\nimport LeadActivityList from './LeadActivityList';\r\n\r\nimport {\r\n toggleLeadActivityModal,\r\n toggleEditLeadActivityModal,\r\n setSelectedLeadActivityFromID,\r\n updateSelectedLeadActivity\r\n} from '../../actions/manageLeadsActions';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectLeadActivityForLead } from '../../reducers/manageLeadsReducers';\r\nimport { manageLeadQueryParamsEnum } from './ManageLeads';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n handleSelectLeadActivity: (id: string) => void;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n history: Ihistory;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const leadActivities = selectLeadActivityForLead(state);\r\n\r\n return {\r\n className: 'lead-activity',\r\n loading: selectIsLoading(state),\r\n show: state.manageLeads.showLeadActivityModal,\r\n leadActivities,\r\n title: ownProps.t('leadActivityListModalTitle')\r\n };\r\n};\r\n\r\nexport default withTranslation('manageLeads')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleLeadActivityModal,\r\n toggleModal: toggleLeadActivityModal,\r\n toggleEditLeadActivityModal,\r\n setSelectedLeadActivityFromID,\r\n onHide: toggleLeadActivityModal,\r\n updateSelectedLeadActivity\r\n })(WithCommonModal(LeadActivityList))\r\n);\r\n","/*\r\n * EditJobForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { debounce, omit } from 'lodash';\r\nimport { leadActivityTypesEnum } from '../../models-enums';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IeditLeadActivityFormValues } from '../../modelsForms';\r\nimport {\r\n IleadActivity,\r\n Ilead,\r\n Ihistory,\r\n IoptionNumberValue\r\n} from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialLeadActivity } from '../../reducers/initialState';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport {\r\n saveLeadActivity,\r\n updateSelectedLeadActivity,\r\n setSelectedLeadActivityFromID,\r\n updateLeadActivity\r\n} from '../../actions/manageLeadsActions';\r\nimport { manageLeadQueryParamsEnum } from './ManageLeads';\r\nimport { TFunction } from 'i18next';\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n selectedLead: Ilead;\r\n selectedLeadActivity: IleadActivity;\r\n show: boolean;\r\n toggleModal: () => void;\r\n onHide: () => void;\r\n colorButton: string;\r\n create: typeof saveLeadActivity;\r\n delete: (id: string, t: TFunction) => void;\r\n updateLeadActivity: typeof updateLeadActivity;\r\n history: Ihistory;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n updateSelectedLeadActivity: typeof updateSelectedLeadActivity;\r\n setSelectedLeadActivityFromID: typeof setSelectedLeadActivityFromID;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditLeadActivityForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private updateSelectedLeadActivityDebounced: (\r\n leadActivity?: IleadActivity\r\n ) =>\r\n | {\r\n type: string;\r\n leadActivity: IleadActivity;\r\n }\r\n | undefined;\r\n static defaultProps = {\r\n selectedLeadActivity: initialLeadActivity\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.updateSelectedLeadActivityDebounced = debounce(\r\n this.props.updateSelectedLeadActivity,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n componentDidMount() {\r\n // if (\r\n // (this.props.queryParams.selectedLeadID &&\r\n // this.props.queryParams.selectedActivityID &&\r\n // this.props.queryParams.selectedActivityID !==\r\n // this.props.selectedLeadActivity.id) ||\r\n // this.props.queryParams.selectedLeadID !== this.props.selectedLead.id\r\n // ) {\r\n // this.props.setSelectedLeadActivityFromID(\r\n // this.props.queryParams.selectedActivityID\r\n // );\r\n // }\r\n this.initSelected();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (\r\n prevProps.selectedLeadActivity.followUpScheduled !==\r\n this.props.selectedLeadActivity.followUpScheduled\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n this.props.selectedLeadActivity.id !==\r\n prevProps.selectedLeadActivity.id\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n this.props.selectedLeadActivity.type !==\r\n prevProps.selectedLeadActivity.type\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n removeQuery(\r\n manageLeadQueryParamsEnum.selectedActivityID,\r\n this.props.history\r\n );\r\n this.props.updateSelectedLeadActivity();\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, make sure it matches what is active in redux\r\n * if no query param and there is a selected.id, then reset what is in redux\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedActivityID &&\r\n this.props.queryParams.selectedActivityID !==\r\n this.props.selectedLeadActivity.id\r\n ) {\r\n this.props.setSelectedLeadActivityFromID(\r\n this.props.queryParams.selectedActivityID\r\n );\r\n } else if (\r\n this.props.queryParams.selectedActivityID === undefined &&\r\n this.props.selectedLeadActivity.id.length\r\n ) {\r\n this.props.updateSelectedLeadActivity();\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedLeadActivity and convert it to formValues\r\n */\r\n itemToFormValues = (): IeditLeadActivityFormValues => {\r\n let {\r\n type,\r\n activityDate,\r\n followUpScheduled\r\n } = this.props.selectedLeadActivity;\r\n\r\n const selectedActivityType: IoptionNumberValue = {\r\n value: type,\r\n label: this.props.t(leadActivityTypesEnum[type])\r\n };\r\n\r\n if (!activityDate) {\r\n activityDate = moment.utc().format('DD-MMM-YY');\r\n }\r\n\r\n return {\r\n ...this.props.selectedLeadActivity,\r\n type: selectedActivityType,\r\n activityDate,\r\n followUpScheduled\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedLeadActivity\r\n */\r\n formValuesToItem = (updatedValue?: {\r\n [key: string]: any;\r\n }): IleadActivity => {\r\n let formValues = this.formGroup.value;\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n\r\n const cleanedFormValues = omit(\r\n FormUtil.getValues(formValues),\r\n 'shouldFollowUp'\r\n );\r\n return {\r\n // ...initialLeadActivity,\r\n ...this.props.selectedLeadActivity,\r\n leadID: this.props.selectedLead.id,\r\n ...cleanedFormValues\r\n };\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IeditLeadActivityFormValues = this.itemToFormValues()\r\n ) => {\r\n console.info(\r\n 'defaultValues',\r\n defaultValues,\r\n defaultValues.followUpScheduled &&\r\n defaultValues.followUpScheduled.length === 0\r\n );\r\n const disabled = false;\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n leadActivityTypesEnum\r\n ),\r\n label: 'manageLeads:type',\r\n colWidth: 12,\r\n placeholder: 'manageUser:customerSearchPlaceholder',\r\n name: 'activityType',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: defaultValues.type,\r\n disabled\r\n }\r\n },\r\n otherType: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'leadActivityForm.other',\r\n colWidth: 12,\r\n name: 'other',\r\n placeholder: 'leadActivityForm.otherPlaceholder'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: defaultValues.otherType,\r\n disabled\r\n }\r\n },\r\n activityDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'leadActivityForm.activityDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'date',\r\n placeholder: 'common:datePlaceholder'\r\n // isValidDate: (current: any) => {\r\n // return (\r\n // moment.isMoment(current) &&\r\n // current.isAfter(moment().subtract(1, 'day'))\r\n // );\r\n // }\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.activityDate,\r\n disabled\r\n }\r\n },\r\n notes: {\r\n options: {\r\n validators: FormUtil.validators.requiredRichText\r\n },\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'leadActivityForm.notes',\r\n colWidth: 12,\r\n name: 'notes',\r\n required: false,\r\n rows: 6,\r\n initialContent: defaultValues.notes\r\n },\r\n formState: { value: defaultValues.notes, disabled }\r\n },\r\n shouldFollowUp: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'leadActivityForm.shouldFollowUp',\r\n colWidth: 6,\r\n required: true\r\n },\r\n formState: {\r\n value:\r\n defaultValues.followUpScheduled &&\r\n defaultValues.followUpScheduled.length > 0,\r\n disabled\r\n }\r\n },\r\n followUpScheduled: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'leadActivityForm.followUpScheduled',\r\n colWidth: 6,\r\n showTime: false,\r\n alignRight: true,\r\n name: 'follow-up-date',\r\n placeholder: 'common:datePlaceholder',\r\n required: true,\r\n isValidDate: (current: any) => {\r\n return (\r\n moment.isMoment(current) &&\r\n current.isAfter(moment().subtract(1, 'day'))\r\n );\r\n }\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: defaultValues.followUpScheduled,\r\n disabled\r\n }\r\n },\r\n followUpNote: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'leadActivityForm.followUpNote',\r\n colWidth: 12,\r\n name: 'note',\r\n required: false,\r\n initialContent: defaultValues.followUpNote\r\n },\r\n formState: { value: defaultValues.followUpNote, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n let cleanedFieldConfigControls = fieldConfigControls;\r\n\r\n if (!defaultValues.followUpScheduled) {\r\n cleanedFieldConfigControls = omit(fieldConfigControls, [\r\n 'followUpScheduled',\r\n 'followUpNote'\r\n ]);\r\n }\r\n if (defaultValues.type.value !== leadActivityTypesEnum.other) {\r\n cleanedFieldConfigControls = omit(\r\n cleanedFieldConfigControls,\r\n 'otherType'\r\n );\r\n }\r\n\r\n const fieldConfig = {\r\n controls: { ...cleanedFieldConfigControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'shouldFollowUp': {\r\n if (value) {\r\n const defaultFollowUp = moment\r\n .utc()\r\n .add(1, 'week')\r\n .format(constants.momentSQLFormat);\r\n this.updateSelectedLeadActivityDebounced(\r\n this.formValuesToItem({\r\n [key]: value,\r\n followUpScheduled: defaultFollowUp\r\n })\r\n );\r\n } else {\r\n this.updateSelectedLeadActivityDebounced(\r\n this.formValuesToItem({\r\n [key]: value,\r\n followUpScheduled: ''\r\n })\r\n );\r\n }\r\n break;\r\n }\r\n // case 'followUpScheduled': {\r\n // this.checkIfStartDateBeforeEndDate({ endDate: value });\r\n // if (moment.isMoment(value)) {\r\n // value = value.format(constants.momentSQLFormat);\r\n // }\r\n // }\r\n default:\r\n this.updateSelectedLeadActivityDebounced(\r\n this.formValuesToItem({ [key]: value })\r\n );\r\n break;\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (this.props.selectedLeadActivity.id.length) {\r\n console.info(\r\n 'form submit',\r\n this.formGroup.value,\r\n this.formValuesToItem()\r\n );\r\n this.props.updateLeadActivity(this.formValuesToItem());\r\n } else {\r\n this.props.create(this.formValuesToItem());\r\n }\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix lead-activity-form beacon-form ${this.props.colorButton}`;\r\n const deleteButtonStyle =\r\n this.props.selectedLeadActivity.id.length === 0\r\n ? { marginRight: '15px', display: 'none' }\r\n : { marginRight: '15px' };\r\n\r\n return (\r\n
    \r\n \r\n \r\n {\r\n this.props.toggleModal();\r\n // this.props.updateSelectedJob();\r\n // removeQuery(\r\n // manageJobQueryParamsEnum.selectedJobID,\r\n // this.props.history\r\n // );\r\n }}\r\n >\r\n {t('common:cancel')}\r\n \r\n \r\n this.props.delete(\r\n this.props.selectedLeadActivity.id,\r\n t\r\n )\r\n }\r\n >\r\n {t('common:delete')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditLeadActivityForm;\r\n","import {\r\n Ifacility,\r\n IfacilityContact,\r\n Ilead,\r\n IleadUser,\r\n Iproduct,\r\n ItableFiltersReducer,\r\n Itile,\r\n IleadActivity,\r\n ImanageLeadsReducer\r\n} from '../../models';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport selectTableHOC, {\r\n SelectTableAdditionalProps\r\n} from 'react-table/lib/hoc/selectTable';\r\nimport treeTableHOC from 'react-table/lib/hoc/treeTable';\r\nimport { Col, Row } from 'react-bootstrap';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n dateRangeEnum,\r\n leadRankingEnum,\r\n leadStatusEnum,\r\n leadTypeEnum\r\n} from '../../models-enums';\r\nimport {\r\n deleteLeadInstallBase,\r\n getLeads,\r\n setTableFilter,\r\n toggleLeadsModal,\r\n setSelectedLeadFromID,\r\n setSelectedLeadActivityFromID,\r\n updateSelectedLead,\r\n toggleLeadActivityModal,\r\n getLeadActivities,\r\n toggleEditLeadActivityModal,\r\n updateLeadSelection\r\n} from '../../actions/manageLeadsActions';\r\n\r\nimport EditLeadModal from '../manageLeads/EditLeadModal';\r\nimport { Banner } from '../common/Banner';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { LeadInstallBasesExpander } from './LeadInstallBasesExpander';\r\nimport React from 'react';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { ActionButton } from './ActionButton';\r\nimport { addQuery } from '../common/OtherUtils';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { debounce } from 'lodash';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport moment from 'moment';\r\nimport { selectLeadsForTable } from '../../reducers/manageLeadsReducers';\r\nimport LeadActivityListModal from './LeadActivityListModal';\r\nimport EditLeadActivityModal from './EditLeadActivityModal';\r\nimport FacilityContactModal from '../common/FacilityContactModal';\r\nimport queryString from 'query-string';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { LeadBulkActionsButtonContainer } from './LeadsBulkActionsButtonContainer';\r\n\r\ninterface RowInfoLead extends RowInfo {\r\n original: Ilead;\r\n}\r\n\r\nexport enum manageLeadQueryParamsEnum {\r\n selectedLeadID = 'selectedLeadID',\r\n selectedActivityID = 'selectedActivityID'\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\nconst SelectTable = selectTableHOC(treeTableHOC(ReactTable));\r\n\r\ninterface IdispatchProps {\r\n getLeads: typeof getLeads;\r\n tableData: Ilead[];\r\n loading: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n facilities: { [key: string]: Ifacility };\r\n leadsByID: { [key: string]: Ilead };\r\n products: { [key: string]: Iproduct };\r\n toggleLeadActivityModal: typeof toggleLeadActivityModal;\r\n selectedLeadID: string;\r\n deleteLeadInstallBase: typeof deleteLeadInstallBase;\r\n setSelectedLeadFromID: typeof setSelectedLeadFromID;\r\n setSelectedLeadActivityFromID: typeof setSelectedLeadActivityFromID;\r\n selectedLead: Ilead;\r\n updateSelectedLead: typeof updateSelectedLead;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n getLeadActivities: typeof getLeadActivities;\r\n toggleEditLeadActivityModal: typeof toggleEditLeadActivityModal;\r\n toggleLeadsModal: typeof toggleLeadsModal;\r\n leadActivitiesByID: { [key: string]: IleadActivity };\r\n selection: string[];\r\n updateLeadSelection: typeof updateLeadSelection;\r\n leadsManage: ImanageLeadsReducer;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n selectAll: boolean;\r\n}\r\n\r\nclass ManageLeadsWithSelect extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation & SelectTableAdditionalProps,\r\n Istate\r\n> {\r\n public columns: any[];\r\n public buttonInAction = false;\r\n private checkboxTable: any;\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n searchFieldConfig: { controls: {} },\r\n selectAll: false\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n id: 'created',\r\n Header: 'created',\r\n accessor: ({ createDate }: Ilead) => {\r\n return moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormatWithTime);\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n id: 'leadNumber',\r\n Header: 'leadNumber',\r\n accessor: ({ leadNumber }: Ilead) =>\r\n leadNumber ? leadNumber : '',\r\n minWidth: 70\r\n },\r\n {\r\n id: 'bundleQuoteNumber',\r\n Header: 'bundleQuoteNumber',\r\n accessor: ({ quote }: Ilead) =>\r\n quote ? quote.quoteNumber : '',\r\n minWidth: 100\r\n },\r\n {\r\n id: 'type',\r\n Header: 'type',\r\n accessor: ({ type }) =>\r\n this.props.t(\r\n `${leadTypeEnum[type as keyof typeof leadTypeEnum]}`\r\n ),\r\n minWidth: 90\r\n },\r\n {\r\n id: 'product',\r\n Header: 'product',\r\n accessor: ({ productID }: Ilead) =>\r\n this.props.products[productID]\r\n ? this.props.products[productID].name\r\n : '',\r\n minWidth: 200\r\n },\r\n {\r\n id: 'facility',\r\n Header: 'facility',\r\n accessor: ({ facilityID }: Ilead) =>\r\n this.props.facilities[facilityID]\r\n ? this.props.facilities[facilityID].name\r\n : '',\r\n minWidth: 100\r\n },\r\n {\r\n id: 'salesName',\r\n Header: 'salesName',\r\n Cell: (row: RowInfoLead) => (\r\n \r\n {row.original.leadUsers\r\n ? row.original.leadUsers.map(\r\n (leadUser: IleadUser) => {\r\n if (leadUser.user) {\r\n const style = leadUser.assignedDueToMissingCoverage\r\n ? { color: 'orange' }\r\n : {};\r\n return (\r\n \r\n {leadUser.user.first}{' '}\r\n {leadUser.user.last}\r\n \r\n );\r\n } else {\r\n return '';\r\n }\r\n }\r\n )\r\n : ''}\r\n \r\n ),\r\n minWidth: 110\r\n },\r\n {\r\n id: 'status',\r\n Header: 'status',\r\n accessor: ({ status }) =>\r\n this.props.t(\r\n `${\r\n leadStatusEnum[\r\n status as keyof typeof leadStatusEnum\r\n ]\r\n }`\r\n ),\r\n width: 90\r\n },\r\n {\r\n Header: '',\r\n id: 'actions',\r\n minWidth: 120,\r\n // width: 100,\r\n style: { overflow: 'visible' },\r\n Cell: (row: RowInfoLead) => {\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n return (\r\n \r\n );\r\n }\r\n }\r\n ],\r\n this.props.t\r\n );\r\n }\r\n\r\n getTdProps = (\r\n state: FinalState,\r\n rowInfo: RowInfoLead | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id !== 'actions') {\r\n return {\r\n onClick: () => {\r\n // this.handleSelectLead(rowInfo.original.id);\r\n this.setState({\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !this.state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n // if status is undefined initialize the default table filters\r\n if (this.props.tableFilters.status === undefined) {\r\n this.props.setTableFilter({\r\n status: this.defaultStatus()\r\n });\r\n } else {\r\n this.props.getLeads();\r\n }\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n searchFieldConfig: this.buildSearchFieldConfig()\r\n });\r\n this.shouldShowSelected();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getLeads();\r\n\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n /**\r\n * Toggle a single checkbox for select table\r\n */\r\n toggleSelection = (key: string, shift: boolean, row: any) => {\r\n // start off with the existing state\r\n let selection = [...this.props.selection];\r\n const keyIndex = selection.indexOf(key);\r\n\r\n // check to see if the key exists\r\n if (keyIndex >= 0) {\r\n // it does exist so we will remove it using destructing\r\n selection = [\r\n ...selection.slice(0, keyIndex),\r\n ...selection.slice(keyIndex + 1)\r\n ];\r\n } else {\r\n // it does not exist so add it\r\n selection.push(key);\r\n }\r\n // update the state\r\n this.props.updateLeadSelection(selection);\r\n };\r\n\r\n /**\r\n * Toggle all checkboxes for select table\r\n */\r\n toggleAll = () => {\r\n const { keyField = 'id' } = this.props;\r\n const selectAll = !this.state.selectAll;\r\n const selection: string[] = [];\r\n\r\n if (selectAll && keyField !== undefined) {\r\n // we need to get at the internals of ReactTable\r\n const wrappedInstance = this.checkboxTable.getWrappedInstance();\r\n // the 'sortedData' property contains the currently accessible records based on the filter and sort\r\n const currentRecords: any[] = wrappedInstance.getResolvedState()\r\n .sortedData;\r\n // we just push all the IDs onto the selection array\r\n currentRecords.forEach(item => {\r\n selection.push(`select-${item._original[keyField]}`);\r\n });\r\n }\r\n this.setState({ selectAll });\r\n this.props.updateLeadSelection(selection);\r\n };\r\n\r\n /**\r\n * Whether or not a row is selected for select table\r\n */\r\n isSelected = (key: string) => {\r\n return this.props.selection.includes(`select-${key}`);\r\n };\r\n /*\r\n * shouldShowSelected\r\n * if there is a selected item in the query param\r\n * show the edit modal for that item\r\n */\r\n shouldShowSelected = () => {\r\n const shouldShowLeadActivity = !!(\r\n this.props.queryParams.selectedActivityID &&\r\n this.props.queryParams.selectedActivityID.length > 0\r\n );\r\n this.props.toggleLeadActivityModal(shouldShowLeadActivity);\r\n this.props.toggleEditLeadActivityModal(shouldShowLeadActivity);\r\n if (shouldShowLeadActivity) {\r\n this.props.setSelectedLeadFromID(\r\n this.props.leadActivitiesByID[\r\n this.props.queryParams.selectedActivityID\r\n ].leadID\r\n );\r\n }\r\n\r\n const shouldShowLead = !!(\r\n this.props.queryParams.selectedLeadID &&\r\n this.props.queryParams.selectedLeadID.length > 0 &&\r\n shouldShowLeadActivity === false\r\n );\r\n this.props.toggleLeadsModal(shouldShowLead);\r\n };\r\n\r\n handleSelectLead = (id: string) => {\r\n addQuery(\r\n manageLeadQueryParamsEnum.selectedLeadID,\r\n id,\r\n this.props.history\r\n );\r\n this.props.setSelectedLeadFromID(id);\r\n this.props.toggleLeadsModal();\r\n };\r\n\r\n handleShowLeadActivity = (leadID: string) => {\r\n this.props.toggleLeadActivityModal();\r\n this.props.getLeadActivities(leadID);\r\n this.props.setSelectedLeadFromID(leadID);\r\n };\r\n\r\n handleSelectLeadActivity = (id: string) => {\r\n addQuery(\r\n manageLeadQueryParamsEnum.selectedActivityID,\r\n id,\r\n this.props.history\r\n );\r\n this.props.setSelectedLeadActivityFromID(id);\r\n this.props.toggleEditLeadActivityModal();\r\n };\r\n\r\n defaultStatus = () =>\r\n FormUtil.convertToSingleOption({\r\n id: leadStatusEnum.New.toString(),\r\n label: this.props.t(leadStatusEnum[leadStatusEnum.New])\r\n });\r\n\r\n defaultDateRange = () =>\r\n FormUtil.convertToSingleOption({\r\n id: dateRangeEnum.thisQuarter.toString(),\r\n label: this.props.t(dateRangeEnum[dateRangeEnum.thisQuarter])\r\n });\r\n\r\n buildSearchFieldConfig = (): FieldConfig => {\r\n const {\r\n search,\r\n status = this.defaultStatus(),\r\n ranking,\r\n dateRange = this.defaultDateRange()\r\n } = this.props.tableFilters;\r\n const disabled = false;\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n type: 'text',\r\n placeholder: 'common:searchPlaceholder',\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: search,\r\n disabled\r\n }\r\n },\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'type',\r\n options: FormUtil.convertEnumToOptions(leadTypeEnum),\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: this.props.tableFilters.type,\r\n disabled\r\n }\r\n },\r\n status: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'status',\r\n options: FormUtil.convertEnumToOptions(leadStatusEnum),\r\n colWidth: 3,\r\n colWidthLarge: 2,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: status,\r\n disabled\r\n }\r\n },\r\n ranking: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'ranking',\r\n options: FormUtil.convertEnumToOptions(leadRankingEnum),\r\n colWidth: 3,\r\n colWidthLarge: 2,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: ranking,\r\n disabled\r\n }\r\n },\r\n dateRange: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'dateRange',\r\n options: FormUtil.convertEnumToOptions(dateRangeEnum),\r\n colWidth: 3,\r\n colWidthLarge: 2,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: dateRange,\r\n disabled\r\n }\r\n }\r\n };\r\n return { controls: { ...mainSearchControls } };\r\n };\r\n\r\n handleAddContactLead = (contact: IfacilityContact) => {\r\n this.props.updateSelectedLead({\r\n ...this.props.selectedLead,\r\n contactID: contact.id,\r\n contact\r\n });\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n this.setTableFilterDebounced({ [key]: value, page: 1 });\r\n };\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n // TODO Finish table rendering\r\n // Getting errors from React Table requiring certain things.)\r\n render() {\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n const { t } = this.props;\r\n const tableClassName = `beacon-table -highlight ${this.state.currentTile.color}`;\r\n return (\r\n
    \r\n \r\n \r\n {this.props.selection.length !== 0 && (\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 toggleSelection={this.toggleSelection}\r\n selectAll={this.state.selectAll}\r\n selectType=\"checkbox\"\r\n toggleAll={this.toggleAll}\r\n isSelected={this.isSelected}\r\n ref={ref => (this.checkboxTable = ref)}\r\n keyField=\"id\"\r\n />\r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const tableData = selectLeadsForTable(state);\r\n // TODO low priority - hide the expander when there are 0 install bases\r\n\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageLeadQueryParamsEnum;\r\n return {\r\n user: state.user,\r\n leadsManage: state.manageLeads,\r\n loading: selectIsLoading(state),\r\n tableData,\r\n tableFilters: state.manageLeads.tableFilters,\r\n facilities: state.facilities,\r\n products: state.manageInventory.productsByID,\r\n contacts: state.manageFacility.contacts,\r\n selectedLead: state.manageLeads.selectedLead,\r\n selection: state.manageLeads.selection,\r\n queryParams,\r\n leadActivitiesByID: state.manageLeads.leadActivitiesByID\r\n };\r\n};\r\n\r\nexport default withTranslation('manageLeads')(\r\n connect(mapStateToProps, {\r\n getLeads,\r\n setTableFilter,\r\n deleteLeadInstallBase,\r\n toggleLeadsModal,\r\n toggleLeadActivityModal,\r\n setSelectedLeadFromID,\r\n setSelectedLeadActivityFromID,\r\n updateSelectedLead,\r\n getLeadActivities,\r\n toggleEditLeadActivityModal,\r\n updateLeadSelection\r\n })(ManageLeadsWithSelect)\r\n);\r\n","import { connect } from 'react-redux';\r\n\r\nimport { Ihistory } from '../../models';\r\n\r\nimport EditLeadActivityForm from './EditLeadActivityForm';\r\n\r\nimport {\r\n toggleEditLeadActivityModal,\r\n setSelectedLeadActivityFromID,\r\n saveLeadActivity,\r\n updateSelectedLeadActivity,\r\n updateLeadActivity,\r\n deleteLeadActivity\r\n} from '../../actions/manageLeadsActions';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { manageLeadQueryParamsEnum } from './ManageLeads';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n queryParams: typeof manageLeadQueryParamsEnum;\r\n history: Ihistory;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedLeadActivity = state.manageLeads.selectedLeadActivity;\r\n const selectedLead = state.manageLeads.selectedLead;\r\n\r\n let modalTitle;\r\n if (selectedLeadActivity && selectedLeadActivity.id) {\r\n modalTitle = ownProps.t('manageLeads:editLeadActivityModalTitle');\r\n } else {\r\n modalTitle = ownProps.t('manageLeads:saveLeadActivityModalTitle');\r\n }\r\n\r\n return {\r\n className: 'edit-lead-activity',\r\n loading: selectIsLoading(state),\r\n show: state.manageLeads.showEditLeadActivityModal,\r\n selectedLeadActivity,\r\n selectedLead,\r\n title: modalTitle,\r\n secondModal: true\r\n };\r\n};\r\n\r\nexport default withTranslation('manageLeads')(\r\n connect(mapStateToProps, {\r\n setSelectedLeadActivityFromID,\r\n updateSelectedLeadActivity,\r\n create: saveLeadActivity,\r\n delete: deleteLeadActivity,\r\n onCancel: toggleEditLeadActivityModal,\r\n toggleModal: toggleEditLeadActivityModal,\r\n onHide: toggleEditLeadActivityModal,\r\n updateLeadActivity\r\n })(WithCommonModal(EditLeadActivityForm))\r\n);\r\n","/*\r\n * An Action Button\r\n */\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { IinitialState } from '../../reducers';\r\nimport { LeadBulkActionsButton } from './LeadBulkActionsButton';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { bulkUpdate } from '../../actions/manageLeadsActions';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n selection: state.manageLeads.selection,\r\n leadsByID: state.manageLeads.leadsByID,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport const LeadBulkActionsButtonContainer = connect(mapStateToProps, {\r\n bulkUpdate\r\n})(LeadBulkActionsButton);\r\n","import * as React from 'react';\r\nimport { Col, DropdownButton, MenuItem } from 'react-bootstrap';\r\nimport { TFunction } from 'i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { Iuser, Ilead } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { bulkUpdate } from '../../actions/manageLeadsActions';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n user: Iuser;\r\n selection: string[];\r\n leadsByID: { [key: string]: Ilead };\r\n bulkUpdate: typeof bulkUpdate;\r\n}\r\n\r\nexport const LeadBulkActionsButton = (props: Iprops) => {\r\n const { t } = props;\r\n\r\n const checkSelectionLimit = () => {\r\n if (props.selection.length >= constants.bulkSelectionLimit) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:bulkSelectionLimit', {\r\n limit: constants.bulkSelectionLimit\r\n }),\r\n constants.toastrWarning\r\n );\r\n return Promise.reject(false);\r\n } else if (props.selection.length === 0) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:bulkSelectionMissing', {\r\n limit: constants.bulkSelectionLimit\r\n }),\r\n constants.toastrWarning\r\n );\r\n return Promise.reject(false);\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n };\r\n\r\n const copySelection = () => {\r\n if (props.selection) {\r\n const selectedLeads = props.selection.map(item => {\r\n const leadID = item.split('select-')[1];\r\n\r\n return props.leadsByID[leadID].leadNumber;\r\n });\r\n\r\n navigator.clipboard.writeText(selectedLeads.join(','));\r\n\r\n toastr.success(\r\n t('toastMessage:success'),\r\n t('toastMessage:copiedLeads'),\r\n constants.toastrSuccess\r\n );\r\n } else {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:noLeadsCopied'),\r\n constants.toastrWarning\r\n );\r\n }\r\n };\r\n\r\n return (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1:\r\n copySelection();\r\n break;\r\n case 2:\r\n checkSelectionLimit().then(() => {\r\n props.bulkUpdate(5, t);\r\n });\r\n break;\r\n }\r\n }}\r\n >\r\n {t('addToClipboardButton')}\r\n {t('archiveButton')}\r\n \r\n \r\n );\r\n};\r\n","import { ThunkResult, ItableFiltersParams, Iquote, Iuser } from '../models';\r\nimport {\r\n beginAjaxCall,\r\n manualAjaxEnd,\r\n manualAjaxStart\r\n} from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { omit } from 'lodash';\r\nimport { FormUtil } from '../components/common/FormUtil';\r\nimport { initialQuote } from '../reducers/initialState';\r\n\r\n/*\r\n * helper function to correctly render global search component as well as send facility Id\r\n */\r\nexport function getIsManageCustomerQuotesView(user: Iuser) {\r\n const hasManageCustomerQuotesSF = constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.ManageCustomerQuotes.id\r\n ]);\r\n const salesSFs = [\r\n constants.securityFunctions.SalesService.id,\r\n constants.securityFunctions.SalesParts.id,\r\n constants.securityFunctions.SalesManager.id,\r\n constants.securityFunctions.SalesInstallation.id,\r\n constants.securityFunctions.SalesAdmin.id\r\n ];\r\n const hasSalesSFs = constants.hasSecurityFunction(user, salesSFs);\r\n const isManageCustomerQuotesView =\r\n hasManageCustomerQuotesSF && !hasSalesSFs ? true : false;\r\n return isManageCustomerQuotesView;\r\n}\r\n\r\ninterface IquotesParams {\r\n page: number;\r\n search: string;\r\n status: string | boolean;\r\n sort: string;\r\n facilityID?: string;\r\n}\r\n\r\nexport function getQuotes(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n status\r\n } = getState().manageCustomerQuotes.tableFilters;\r\n\r\n let params: IquotesParams = {\r\n page,\r\n search,\r\n status: status ? status.value : false,\r\n sort: `createdate,desc`\r\n };\r\n const isManageCustomerQuotesView = getIsManageCustomerQuotesView(\r\n getState().user\r\n );\r\n\r\n if (isManageCustomerQuotesView) {\r\n const { selectedFacilityID: facilityID } = getState();\r\n params = { ...params, facilityID };\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params\r\n };\r\n const url = API.quote.search;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.QUOTE_MANAGE_SUCCESS,\r\n payload: resp.data.result\r\n });\r\n dispatch({\r\n type: types.QUOTE_MANAGE_TOTAL_PAGES,\r\n pages: resp.data.pages\r\n });\r\n return resp;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.QUOTE_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get quotes');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_QUOTES,\r\n filters\r\n});\r\n\r\nexport const toggleQuotesModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_QUOTES,\r\n show\r\n});\r\nexport const toggleSalesQuotesModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_SALES_QUOTES,\r\n show\r\n});\r\n\r\nexport const toggleQuotesDetailsModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_QUOTES_DETAILS,\r\n show\r\n});\r\n\r\nexport const toggleAcceptQuoteModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_ACCEPT_QUOTE,\r\n show\r\n});\r\n\r\nexport const updateSelectedQuote = (quote = initialQuote) => ({\r\n type: types.UPDATE_SELECTED_QUOTE,\r\n payload: quote\r\n});\r\n\r\nexport function updateQuoteStatus(quote: Iquote): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const cleanedQuote = omit(quote, ['signature', 'poFile']);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: cleanedQuote\r\n };\r\n\r\n const url = `${API.quote.updateStatus}/${cleanedQuote.id}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((resp: AxiosResponse) => {\r\n if (!resp.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.QUOTE_UPDATE_STATUS_SUCCESS,\r\n payload: quote\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_QUOTES });\r\n dispatch(toggleQuotesDetailsModal(false));\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.QUOTE_UPDATE_STATUS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update quote status');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function saveQuoteFiles(quote: Iquote): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(manualAjaxStart());\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n const formData = FormUtil.toFormData({\r\n quoteID: quote.id,\r\n POFile: quote.poFile,\r\n Signature: quote.signature,\r\n AuthorizedName: quote.authorizedName\r\n });\r\n // console.info('formData keys',[...formData.keys()])\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: formData,\r\n headers\r\n };\r\n\r\n const url = API.quote.saveQuoteFiles;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch(manualAjaxEnd());\r\n dispatch(updateQuoteStatus(quote));\r\n })\r\n .catch((error: any) => {\r\n dispatch(manualAjaxEnd());\r\n constants.handleError(error, 'save quote files');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n","/*\r\n * EditCustomerQuoteForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { debounce, omit, forEach } from 'lodash';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IquoteFormValues } from '../../modelsForms';\r\nimport { Iquote, Ihistory, Ifacility, IoptionNumberValue } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n initialQuote,\r\n initialFacility,\r\n initialUser\r\n} from '../../reducers/initialState';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n updateSelectedQuote,\r\n updateQuoteStatus,\r\n saveQuoteFiles,\r\n toggleQuotesDetailsModal\r\n} from '../../actions/manageCustomerQuotesActions';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { TFunction } from 'i18next';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport { quoteStatusEnum } from '../../models-enums';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { getCloudDocument } from '../../actions/manageDocumentActions';\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n selectedQuote: Iquote;\r\n originalQuote?: Iquote;\r\n show: boolean;\r\n toggleModal: () => void;\r\n onHide: () => void;\r\n getCloudDocument: typeof getCloudDocument;\r\n toggleQuotesDetailsModal: typeof toggleQuotesDetailsModal;\r\n // other\r\n facility: Ifacility;\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n onChange: typeof updateSelectedQuote;\r\n onSubmit: typeof updateQuoteStatus;\r\n history: Ihistory;\r\n getSecurityUsers: typeof getSecurityUsers;\r\n saveQuoteFiles: typeof saveQuoteFiles;\r\n t: TFunction;\r\n}\r\n\r\ninterface Istate {\r\n poFile: any;\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass QuoteForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private onChangeDebounced: (quote: Iquote) => void;\r\n static defaultProps = {\r\n selectedQuote: initialQuote,\r\n facility: initialFacility,\r\n salesContact: initialUser\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.onChangeDebounced = debounce(\r\n this.props.onChange,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n poFile: '',\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n // this.handleChecked = this.handleChecked.bind(this);\r\n }\r\n componentDidMount() {\r\n this.props.getSecurityUsers([\r\n constants.securityFunctions.SalesManager.id\r\n ]);\r\n this.initSelected();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (this.props.selectedQuote.id !== prevProps.selectedQuote.id) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n this.props.selectedQuote.status !== prevProps.selectedQuote.status\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.onChange();\r\n removeQuery(\r\n manageQuoteQueryParamsEnum.selectedQuoteID,\r\n this.props.history\r\n );\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, make sure it matches what is active in redux\r\n * if no query param and there is a selectedQuote.id, then reset what is in redux\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedQuoteID &&\r\n this.props.queryParams.selectedQuoteID !==\r\n this.props.selectedQuote.id\r\n ) {\r\n this.props.onChange(this.props.originalQuote);\r\n } else if (\r\n this.props.queryParams.selectedQuoteID === undefined &&\r\n this.props.selectedQuote.id.length\r\n ) {\r\n this.props.onChange();\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedQuote and convert it to formValues\r\n */\r\n itemToFormValues = (): IquoteFormValues => {\r\n const { status, createDate } = this.props.selectedQuote;\r\n\r\n const cleanedQuote = omit(this.props.selectedQuote, [\r\n 'leads',\r\n 'signature',\r\n 'salesUsers',\r\n 'facility'\r\n ]);\r\n const selectedQuoteStatus = {\r\n value: status,\r\n label: this.props.t(quoteStatusEnum[status])\r\n };\r\n let contactNames = '';\r\n forEach(this.props.selectedQuote.salesUsers, (user, index) => {\r\n contactNames = contactNames += ` ${index > 0 ? '|' : ''} ${\r\n user.first\r\n } ${user.last}`;\r\n });\r\n\r\n return {\r\n ...cleanedQuote,\r\n selectedQuoteStatus,\r\n createDate: moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormat),\r\n contactNames,\r\n facilityName: this.props.facility.name\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedQuote\r\n */\r\n formValuesToItem = (updatedValue?: { [key: string]: any }): Iquote => {\r\n let formValues = this.formGroup.value;\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n // const cleanedQuote = omit(this.props.selectedQuote);\r\n return {\r\n ...this.props.selectedQuote,\r\n ...FormUtil.getValues(formValues),\r\n poFile: this.state.poFile\r\n };\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IquoteFormValues = this.itemToFormValues()\r\n ) => {\r\n const disabled = false;\r\n const { t } = this.props;\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n $field_0: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_1: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_2: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_3: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_4: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_po_number: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_download: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n \r\n this.props.getCloudDocument(\r\n this.props.t,\r\n {\r\n documentID: this.props.selectedQuote.id,\r\n version: this.props.selectedQuote\r\n .cloudDocumentID\r\n },\r\n true\r\n )\r\n }\r\n bsStyle={this.props.colorButton}\r\n >\r\n {' '}\r\n  \r\n {t('editCustomerQuoteForm.viewQuote')}\r\n \r\n \r\n )\r\n },\r\n $field_notes: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n {\r\n this.props.toggleQuotesDetailsModal();\r\n }}\r\n >\r\n {t('editCustomerQuoteForm.notes')}\r\n \r\n \r\n )\r\n },\r\n comments: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'common:comments',\r\n colWidth: 12,\r\n name: 'comments',\r\n required: false,\r\n initialContent: defaultValues.comments\r\n },\r\n formState: { disabled, value: defaultValues.comments }\r\n },\r\n status: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(quoteStatusEnum),\r\n label: 'common:status',\r\n colWidth: 12,\r\n placeholder: 'typeSearchPlaceholder',\r\n name: 'status',\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.selectedQuoteStatus,\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n const acceptQuoteControls = {\r\n poNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'editCustomerQuoteForm.enterPONumber',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'poNumber',\r\n required: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: defaultValues.poNumber, disabled }\r\n },\r\n\r\n poFile: {\r\n render: FormUtil.FileInput,\r\n meta: {\r\n label: 'editCustomerQuoteForm.poFile',\r\n accept: '.pdf',\r\n type: 'file',\r\n colWidth: 12,\r\n name: 'poFile',\r\n required: true,\r\n onChange: this.onFileChange,\r\n imageUrl: defaultValues.poFileUrl,\r\n hasPreview: false,\r\n hasDownload: true,\r\n otherLabels: {\r\n labelDownload: this.props.t(\r\n 'editCustomerQuoteForm.viewPo'\r\n )\r\n }\r\n }\r\n // options: {\r\n // validators: FormUtil.validators.requiredWithTrim\r\n // },\r\n },\r\n authorizedName: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'editCustomerQuoteForm.authorizedName',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'authorizedName',\r\n required: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: defaultValues.authorizedName, disabled }\r\n },\r\n signature: {\r\n render: FormUtil.Signature,\r\n meta: {\r\n label: 'editCustomerQuoteForm.signature',\r\n colWidth: 12,\r\n name: 'signature',\r\n required: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredBlob\r\n }\r\n },\r\n tos: {\r\n render: FormUtil.Checkbox,\r\n meta: {\r\n label: 'editCustomerQuoteForm.tos',\r\n colWidth: 12,\r\n name: 'tos',\r\n required: true\r\n },\r\n formState: {\r\n value: defaultValues.tos,\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n let fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n const currentStatus = defaultValues.selectedQuoteStatus as IoptionNumberValue;\r\n if (currentStatus.value === quoteStatusEnum.accepted) {\r\n fieldConfig = {\r\n controls: { ...fieldConfigControls, ...acceptQuoteControls }\r\n };\r\n }\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n onFileChange = (key: string, poFile: File) => {\r\n this.setState({ poFile }, () => {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n // case 'status':{\r\n // this.setState({fieldConfig: this.buildFieldConfig(this.itemToFormValues({status: value})) })\r\n // }\r\n default:\r\n this.onChangeDebounced(this.formValuesToItem({ [key]: value }));\r\n break;\r\n }\r\n };\r\n\r\n onSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const quote = this.formValuesToItem();\r\n if (quote.status === quoteStatusEnum.accepted) {\r\n if (!quote.tos) {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:tosUnchecked'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n } else {\r\n this.props.saveQuoteFiles(this.props.selectedQuote);\r\n }\r\n } else {\r\n this.props.onSubmit(this.formValuesToItem());\r\n }\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix Quote-form beacon-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default QuoteForm;\r\n","import { connect } from 'react-redux';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport QuoteForm from './QuoteForm';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Ihistory } from '../../models';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport {\r\n toggleQuotesModal,\r\n toggleQuotesDetailsModal,\r\n updateSelectedQuote,\r\n saveQuoteFiles,\r\n updateQuoteStatus\r\n} from '../../actions/manageCustomerQuotesActions';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getCloudDocument } from '../../actions/manageDocumentActions';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showEditQuoteModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.modalTitle'),\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleQuotesModal,\r\n onHide: toggleQuotesModal,\r\n toggleModal: toggleQuotesModal,\r\n onChange: updateSelectedQuote,\r\n onSubmit: updateQuoteStatus,\r\n toggleQuotesDetailsModal,\r\n getSecurityUsers,\r\n getCloudDocument,\r\n saveQuoteFiles\r\n })(WithCommonModal(QuoteForm))\r\n);\r\n","/*\r\n * QuoteDetailsForm = Notes\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport moment from 'moment';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { omit } from 'lodash';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { Iquote, Ihistory, Ifacility } from '../../models';\r\nimport { IquoteFormValues } from '../../modelsForms';\r\nimport { constants } from '../../constants/constants';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport {\r\n initialQuote,\r\n initialFacility,\r\n initialUser\r\n} from '../../reducers/initialState';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport { removeQuery } from '../common/OtherUtils';\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n selectedQuote: Iquote;\r\n originalQuote?: Iquote;\r\n show: boolean;\r\n toggleModal: () => void;\r\n onHide: () => void;\r\n // other\r\n facility: Ifacility;\r\n colorButton: string;\r\n history: Ihistory;\r\n getSecurityUsers: typeof getSecurityUsers;\r\n secondModal: boolean;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass QuoteDetailsForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n static defaultProps = {\r\n selectedQuote: initialQuote,\r\n facility: initialFacility,\r\n salesContact: initialUser\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n // this.handleChecked = this.handleChecked.bind(this);\r\n }\r\n componentDidMount() {\r\n this.props.getSecurityUsers([\r\n constants.securityFunctions.SalesManager.id\r\n ]);\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (this.props.selectedQuote.id !== prevProps.selectedQuote.id) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n this.props.selectedQuote.status !== prevProps.selectedQuote.status\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n if (!this.props.secondModal) {\r\n removeQuery(\r\n // Protects cascading issue when accessing query param on first modal. https://app.clickup.com/t/2341091/MMG-516\r\n manageQuoteQueryParamsEnum.selectedQuoteID,\r\n this.props.history\r\n );\r\n }\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedQuote and convert it to formValues\r\n */\r\n itemToFormValues = (): IquoteFormValues => {\r\n const { createDate } = this.props.selectedQuote;\r\n\r\n const cleanedQuote = omit(this.props.selectedQuote, [\r\n 'authorizedName',\r\n 'facility',\r\n 'facilityID',\r\n 'leads',\r\n 'poFile',\r\n 'poNumber',\r\n 'quoteNumber',\r\n 'revision',\r\n 'salesUsers',\r\n 'signature',\r\n 'signatureUrl',\r\n 'status',\r\n 'tos'\r\n ]);\r\n const cleanNotes = this.props.selectedQuote.leads\r\n .map(leadQuote => leadQuote.lead.notes)\r\n .join('');\r\n\r\n return {\r\n ...cleanedQuote,\r\n notes: cleanNotes,\r\n createDate: moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormat),\r\n facilityName: this.props.facility.name\r\n };\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IquoteFormValues = this.itemToFormValues()\r\n ) => {\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n $field_notes: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n {defaultValues.notes ? (\r\n \r\n ) : (\r\n

    \r\n No notes available.\r\n

    \r\n )}\r\n \r\n )\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const formClassName = `clearfix beacon-form ${this.props.colorButton} quote-notes-form`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:doneButton')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default QuoteDetailsForm;\r\n","import { connect } from 'react-redux';\r\n\r\nimport QuoteDetailsForm from './QuoteDetailsForm';\r\nimport { Ihistory } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { toggleQuotesDetailsModal } from '../../actions/manageCustomerQuotesActions';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n secondModal?: boolean;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showQuoteDetailsModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.notesTitle'),\r\n secondModal: ownProps.secondModal ? true : false,\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleQuotesDetailsModal,\r\n onHide: toggleQuotesDetailsModal,\r\n toggleModal: toggleQuotesDetailsModal,\r\n getSecurityUsers\r\n })(WithCommonModal(QuoteDetailsForm))\r\n);\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport { Iquote, ImanageQuotesReducer } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport initialState, { initialQuote } from './initialState';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { keyBy, pickBy, map, filter } from 'lodash';\r\nimport { IinitialState } from '.';\r\n\r\nexport const cleanQuoteResultObject = (quoteResult: any): Iquote => {\r\n return {\r\n ...initialQuote,\r\n ...pickBy(quoteResult.quote, (property, key) => property !== null),\r\n facilityID: quoteResult.facility ? quoteResult.facility.id : undefined,\r\n salesUsers: quoteResult.users\r\n };\r\n};\r\n\r\nexport const cleanQuoteObject = (quote: any): Iquote => {\r\n return {\r\n ...initialQuote,\r\n ...pickBy(quote, (property, key) => property !== null)\r\n };\r\n};\r\n\r\n/*\r\n * SELECTORS\r\n */\r\n\r\nconst getQuotes = (state: IinitialState) =>\r\n state.manageCustomerQuotes.quotesByID;\r\nconst getFacilities = (state: IinitialState) => state.facilities;\r\n\r\nexport const selectQuotes = createSelector(\r\n [getQuotes, getFacilities],\r\n (quotesByID, facilitiesByID) => {\r\n const filteredQuotes = filter(quotesByID, { isDeleted: false });\r\n return map(filteredQuotes, quote => {\r\n if (quote.facilityID) {\r\n return { ...quote, facility: facilitiesByID[quote.facilityID] };\r\n } else {\r\n return quote;\r\n }\r\n });\r\n }\r\n);\r\n\r\n/*\r\n * REDUCERS\r\n */\r\nfunction quotesByIDReducer(\r\n state: { [key: string]: Iquote } = initialState.manageCustomerQuotes\r\n .quotesByID,\r\n action: any\r\n): { [key: string]: Iquote } {\r\n switch (action.type) {\r\n case types.QUOTE_MANAGE_SUCCESS: {\r\n const quotes = map(action.payload, (quoteResult: any) =>\r\n cleanQuoteResultObject(quoteResult)\r\n );\r\n return keyBy(quotes, 'id');\r\n }\r\n case types.QUOTE_UPDATE_STATUS_SUCCESS: {\r\n return { ...state, [action.payload.id]: action.payload };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(\r\n state: number = initialState.manageCustomerQuotes.totalPages,\r\n action: any\r\n): number {\r\n switch (action.type) {\r\n case types.QUOTE_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageCustomerQuotes.totalPages;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n * stores the lead activity currently being edited\r\n */\r\nconst selectedQuoteReducer = (state = initialQuote, action: any): Iquote => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_QUOTE: {\r\n return action.payload;\r\n }\r\n case types.QUOTE_DELETE_SUCCESS: {\r\n if (state.id === action.payload) {\r\n return initialQuote;\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.QUOTE_ADD_SUCCESS: {\r\n return initialQuote;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst manageQuotes = combineReducers({\r\n quotesByID: quotesByIDReducer,\r\n selectedQuote: selectedQuoteReducer,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_QUOTES'),\r\n showEditQuoteModal: (state, action) =>\r\n modalToggleWithName(state, action, 'QUOTES'),\r\n showSalesQuoteModal: (state, action) =>\r\n modalToggleWithName(state, action, 'SALES_QUOTES'),\r\n showQuoteDetailsModal: (state, action) =>\r\n modalToggleWithName(state, action, 'QUOTES_DETAILS'),\r\n totalPages\r\n});\r\n\r\nexport default manageQuotes;\r\n","/*\r\n * EditCustomerQuoteForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col, ControlLabel, FormGroup } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup as rFormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport { debounce, omit, forEach } from 'lodash';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { IquoteFormValues } from '../../modelsForms';\r\nimport {\r\n Iquote,\r\n Ihistory,\r\n Ifacility,\r\n IoptionNumberValue,\r\n IcloudDocument\r\n} from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n initialQuote,\r\n initialFacility,\r\n initialUser\r\n} from '../../reducers/initialState';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n updateSelectedQuote,\r\n updateQuoteStatus,\r\n saveQuoteFiles,\r\n toggleQuotesDetailsModal\r\n} from '../../actions/manageCustomerQuotesActions';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport { removeQuery } from '../common/OtherUtils';\r\nimport { quoteStatusEnum } from '../../models-enums';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { TFunction } from 'i18next';\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n selectedQuote: Iquote;\r\n originalQuote?: Iquote;\r\n show: boolean;\r\n toggleModal: () => void;\r\n onHide: () => void;\r\n toggleQuotesDetailsModal: typeof toggleQuotesDetailsModal;\r\n getCloudDocument: (\r\n t: TFunction,\r\n cloudDoc?: Partial,\r\n shouldDownload?: boolean\r\n ) => Promise;\r\n // other\r\n facility: Ifacility;\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n onChange: typeof updateSelectedQuote;\r\n onSubmit: typeof updateQuoteStatus;\r\n history: Ihistory;\r\n getSecurityUsers: typeof getSecurityUsers;\r\n saveQuoteFiles: typeof saveQuoteFiles;\r\n}\r\n\r\ninterface Istate {\r\n poFile: any;\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass QuoteForm extends React.Component {\r\n private formGroup: rFormGroup | any;\r\n private subscription: any;\r\n private onChangeDebounced: (quote: Iquote) => void;\r\n static defaultProps = {\r\n selectedQuote: initialQuote,\r\n facility: initialFacility,\r\n salesContact: initialUser\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.onChangeDebounced = debounce(\r\n this.props.onChange,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n poFile: '',\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n // this.handleChecked = this.handleChecked.bind(this);\r\n }\r\n componentDidMount() {\r\n this.props.getSecurityUsers([\r\n constants.securityFunctions.SalesManager.id\r\n ]);\r\n this.initSelected();\r\n // if there is a signature then retreive it\r\n // TODO this is spread out between didMount and didUpdate in a complex way. there must be a simpler solution\r\n if (this.props.selectedQuote.signatureCloudDocument) {\r\n this.props\r\n .getCloudDocument(\r\n this.props.t,\r\n this.props.selectedQuote.signatureCloudDocument\r\n )\r\n .then(uri => {\r\n this.props.onChange({\r\n ...this.props.selectedQuote,\r\n signatureUrl: uri\r\n });\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (this.props.selectedQuote.id !== prevProps.selectedQuote.id) {\r\n // if there is a signature then retreive it\r\n if (this.props.selectedQuote.signatureCloudDocument) {\r\n this.props\r\n .getCloudDocument(\r\n this.props.t,\r\n this.props.selectedQuote.signatureCloudDocument\r\n )\r\n .then(uri => {\r\n this.props.onChange({\r\n ...this.props.selectedQuote,\r\n signatureUrl: uri\r\n });\r\n });\r\n } else {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n if (\r\n this.props.selectedQuote.signatureUrl !==\r\n prevProps.selectedQuote.signatureUrl\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n if (\r\n this.props.selectedQuote.status !== prevProps.selectedQuote.status\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.onChange();\r\n removeQuery(\r\n manageQuoteQueryParamsEnum.selectedQuoteID,\r\n this.props.history\r\n );\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, make sure it matches what is active in redux\r\n * if no query param and there is a selectedQuote.id, then reset what is in redux\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.selectedQuoteID &&\r\n this.props.queryParams.selectedQuoteID !==\r\n this.props.selectedQuote.id\r\n ) {\r\n this.props.onChange(this.props.originalQuote);\r\n } else if (\r\n this.props.queryParams.selectedQuoteID === undefined &&\r\n this.props.selectedQuote.id.length\r\n ) {\r\n this.props.onChange();\r\n }\r\n };\r\n\r\n /*\r\n * itemToFormValues - take the selectedQuote and convert it to formValues\r\n */\r\n itemToFormValues = (): IquoteFormValues => {\r\n const { status, createDate } = this.props.selectedQuote;\r\n\r\n const cleanedQuote = omit(this.props.selectedQuote, [\r\n 'leads',\r\n 'signature',\r\n 'salesUsers',\r\n 'facility'\r\n ]);\r\n const selectedQuoteStatus = {\r\n value: status,\r\n label: this.props.t(quoteStatusEnum[status])\r\n };\r\n let contactNames = '';\r\n forEach(this.props.selectedQuote.salesUsers, (user, index) => {\r\n contactNames = contactNames += ` ${index > 0 ? '|' : ''} ${\r\n user.first\r\n } ${user.last}`;\r\n });\r\n\r\n return {\r\n ...cleanedQuote,\r\n selectedQuoteStatus,\r\n createDate: moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormat),\r\n contactNames,\r\n facilityName: this.props.facility.name\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedQuote\r\n */\r\n formValuesToItem = (updatedValue?: { [key: string]: any }): Iquote => {\r\n let formValues = this.formGroup.value;\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n // const cleanedQuote = omit(this.props.selectedQuote);\r\n return {\r\n ...this.props.selectedQuote,\r\n ...FormUtil.getValues(formValues),\r\n poFile: this.state.poFile\r\n };\r\n };\r\n\r\n buildFieldConfig = (\r\n defaultValues: IquoteFormValues = this.itemToFormValues()\r\n ) => {\r\n const { t } = this.props;\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n $field_0: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_1: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_2: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_3: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_4: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_po_number: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n\r\n $field_download: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n \r\n this.props.getCloudDocument(\r\n this.props.t,\r\n {\r\n ...this.props.selectedQuote\r\n .cloudDocument,\r\n documentID: this.props.selectedQuote.id\r\n },\r\n true\r\n )\r\n }\r\n bsStyle={this.props.colorButton}\r\n >\r\n {' '}\r\n  \r\n {t('editCustomerQuoteForm.viewQuote')}\r\n \r\n \r\n )\r\n },\r\n $field_notes: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n {\r\n this.props.toggleQuotesDetailsModal();\r\n }}\r\n >\r\n {t('editCustomerQuoteForm.notes')}\r\n \r\n \r\n )\r\n },\r\n $field_comments: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n \r\n \r\n {t('common:comments')}\r\n \r\n \r\n \r\n \r\n )\r\n },\r\n status: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(quoteStatusEnum),\r\n label: 'common:status',\r\n colWidth: 12,\r\n placeholder: 'typeSearchPlaceholder',\r\n name: 'status',\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: defaultValues.selectedQuoteStatus,\r\n disabled: true\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n const acceptQuoteControls = {\r\n $field_pofile: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n \r\n this.props.getCloudDocument(\r\n this.props.t,\r\n this.props.selectedQuote.poCloudDocument,\r\n true\r\n )\r\n }\r\n bsStyle={this.props.colorButton}\r\n >\r\n {' '}\r\n  \r\n {t('editCustomerQuoteForm.viewPo')}\r\n \r\n \r\n )\r\n },\r\n\r\n $field_authorizedName: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n )\r\n },\r\n $field_signature: {\r\n isStatic: false,\r\n render: () => (\r\n \r\n \r\n \r\n )\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n let fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n const currentStatus = defaultValues.selectedQuoteStatus as IoptionNumberValue;\r\n if (currentStatus.value === quoteStatusEnum.accepted) {\r\n fieldConfig = {\r\n controls: { ...fieldConfigControls, ...acceptQuoteControls }\r\n };\r\n }\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n onFileChange = (key: string, poFile: File) => {\r\n this.setState({ poFile }, () => {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n // case 'status':{\r\n // this.setState({fieldConfig: this.buildFieldConfig(this.itemToFormValues({status: value})) })\r\n // }\r\n default:\r\n this.onChangeDebounced(this.formValuesToItem({ [key]: value }));\r\n break;\r\n }\r\n };\r\n\r\n onSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n const quote = this.formValuesToItem();\r\n if (quote.status === quoteStatusEnum.accepted) {\r\n if (!quote.tos) {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:tosUnchecked'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n } else {\r\n this.props.saveQuoteFiles(this.props.selectedQuote);\r\n }\r\n } else {\r\n this.props.onSubmit(this.formValuesToItem());\r\n }\r\n };\r\n\r\n setForm = (form: rFormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix Quote-form beacon-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:doneButton')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default QuoteForm;\r\n","import { Iquote, Itile, ItableFiltersReducer, Iuser } from '../../models';\r\nimport ReactTable, { RowInfo, Column, FinalState } from 'react-table';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport React from 'react';\r\nimport { constants } from '../../constants/constants';\r\nimport { debounce } from 'lodash';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport { Banner } from '../common/Banner';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n setTableFilter,\r\n getQuotes,\r\n toggleQuotesModal,\r\n getIsManageCustomerQuotesView,\r\n toggleSalesQuotesModal\r\n} from '../../actions/manageCustomerQuotesActions';\r\nimport queryString from 'query-string';\r\nimport { connect } from 'react-redux';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { quoteStatusEnum } from '../../models-enums';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport QuoteModal from './QuoteModal';\r\nimport QuoteDetailsModal from './QuoteDetailsModal';\r\nimport moment from 'moment';\r\n\r\nimport { addQuery } from '../common/OtherUtils';\r\nimport { selectQuotes } from '../../reducers/manageCustomerQuotesReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport QuoteSalesModal from './QuoteSalesModal';\r\nimport MobileQuoteModal from './mobile/MobileQuoteModal';\r\nimport MobileQuoteSalesModal from './mobile/MobileQuoteSalesModal';\r\nimport MobileQuoteDetailsModal from './mobile/MobileQuoteDetailsModal';\r\n\r\ninterface RowInfoQuote extends RowInfo {\r\n original: Iquote;\r\n}\r\n\r\nexport enum manageQuoteQueryParamsEnum {\r\n selectedQuoteID = 'selectedQuoteID'\r\n}\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n filterLength: number;\r\n}\r\n\r\ninterface IdispatchProps {\r\n tableData: Iquote[];\r\n tableFilters: ItableFiltersReducer;\r\n setTableFilter: typeof setTableFilter;\r\n getQuotes: typeof getQuotes;\r\n loading: boolean;\r\n toggleQuotesModal: typeof toggleQuotesModal;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n selectedFacilityID: string;\r\n totalPages: number;\r\n user: Iuser;\r\n toggleSalesQuotesModal: typeof toggleSalesQuotesModal;\r\n isMobile: boolean;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\nclass ManageQuotes extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public columns: any[];\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n searchFieldConfig: { controls: {} },\r\n filterLength: 0\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n\r\n if (this.props.isMobile) {\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'date',\r\n Header: 'date',\r\n accessor: ({ createDate }: Iquote) => {\r\n return moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormat);\r\n },\r\n Cell: props => (\r\n
    \r\n

    Date

    {' '}\r\n

    {props.value}

    \r\n
    \r\n ),\r\n minWidth: 90\r\n },\r\n {\r\n id: 'quoteNumber',\r\n Header: 'quoteNumber',\r\n accessor: 'quoteNumber',\r\n Cell: props => (\r\n
    \r\n

    Number

    {' '}\r\n

    {props.value}

    \r\n
    \r\n )\r\n },\r\n {\r\n id: 'facility',\r\n Header: 'facility',\r\n accessor: 'facility.name',\r\n minWidth: 200,\r\n Cell: props => (\r\n
    \r\n

    Facility

    {' '}\r\n

    {props.value}

    \r\n
    \r\n )\r\n },\r\n {\r\n id: 'status',\r\n Header: 'status',\r\n accessor: ({ status }) =>\r\n this.props.t(\r\n `${\r\n quoteStatusEnum[\r\n status as keyof typeof quoteStatusEnum\r\n ]\r\n }`\r\n ),\r\n minWidth: 130,\r\n Cell: props => (\r\n
    \r\n

    Status

    {' '}\r\n

    {props.value}

    \r\n
    \r\n )\r\n }\r\n ],\r\n this.props.t\r\n );\r\n } else {\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'date',\r\n Header: 'date',\r\n accessor: ({ createDate }: Iquote) => {\r\n return moment\r\n .utc(createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormat);\r\n },\r\n minWidth: 90\r\n },\r\n {\r\n id: 'quoteNumber',\r\n Header: 'quoteNumber',\r\n accessor: 'quoteNumber'\r\n },\r\n {\r\n id: 'facility',\r\n Header: 'facility',\r\n accessor: 'facility.name',\r\n minWidth: 200\r\n },\r\n {\r\n id: 'revision',\r\n Header: 'revision',\r\n accessor: 'revision',\r\n minWidth: 100\r\n },\r\n {\r\n id: 'status',\r\n Header: 'status',\r\n accessor: ({ status }) =>\r\n this.props.t(\r\n `${\r\n quoteStatusEnum[\r\n status as keyof typeof quoteStatusEnum\r\n ]\r\n }`\r\n ),\r\n minWidth: 130\r\n }\r\n ],\r\n this.props.t\r\n );\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n searchFieldConfig: this.buildSearchFieldConfig()\r\n });\r\n this.props.getQuotes();\r\n this.shouldShowSelected();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getQuotes();\r\n\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n if (this.props.selectedFacilityID !== prevProps.selectedFacilityID) {\r\n this.props.getQuotes();\r\n }\r\n }\r\n\r\n buildSearchFieldConfig = (): FieldConfig => {\r\n const { search, status } = this.props.tableFilters;\r\n const disabled = false;\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n type: 'text',\r\n placeholder: 'common:searchPlaceholder',\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: search,\r\n disabled\r\n }\r\n },\r\n status: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'status',\r\n options: FormUtil.convertEnumToOptions(quoteStatusEnum),\r\n colWidth: 4,\r\n colWidthLarge: 3,\r\n placeholder: 'common:selectPlaceholderFilter',\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: {\r\n value: status,\r\n disabled\r\n }\r\n }\r\n };\r\n this.setState({ filterLength: Object.keys(mainSearchControls).length });\r\n\r\n return { controls: { ...mainSearchControls } };\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n this.setTableFilterDebounced({ [key]: value, page: 1 });\r\n };\r\n\r\n isSalesMode = () => {\r\n return this.props.location.pathname === '/quotes_sales';\r\n };\r\n\r\n handleSelectQuote = (id: string) => {\r\n addQuery(\r\n manageQuoteQueryParamsEnum.selectedQuoteID,\r\n id,\r\n this.props.history\r\n );\r\n if (this.isSalesMode()) {\r\n this.props.toggleSalesQuotesModal();\r\n } else {\r\n this.props.toggleQuotesModal();\r\n }\r\n };\r\n\r\n shouldShowSelected = () => {\r\n const shouldShow = !!(\r\n this.props.queryParams.selectedQuoteID &&\r\n this.props.queryParams.selectedQuoteID.length > 0\r\n );\r\n if (this.isSalesMode()) {\r\n this.props.toggleSalesQuotesModal(shouldShow);\r\n } else {\r\n this.props.toggleQuotesModal(shouldShow);\r\n }\r\n };\r\n\r\n getTdProps = (\r\n state: FinalState,\r\n rowInfo: RowInfoQuote | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id !== 'actions') {\r\n return {\r\n onClick: () => {\r\n this.handleSelectQuote(rowInfo.original.id);\r\n this.setState({\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !this.state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n render() {\r\n const isManageCustomerQuotesView = getIsManageCustomerQuotesView(\r\n this.props.user\r\n );\r\n\r\n const { t } = this.props;\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n const tableClassName = this.props.tableFilters.showAdditionalFilters\r\n ? `beacon-table -highlight ${this.state.currentTile.color} additional-filters`\r\n : `beacon-table -highlight ${this.state.currentTile.color}`;\r\n return (\r\n \r\n \r\n {isManageCustomerQuotesView && (\r\n \r\n )}\r\n \r\n \r\n = 13\r\n ? this.props.tableData.length\r\n : 13\r\n }\r\n manual\r\n pages={this.props.totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n />\r\n\r\n {this.props.isMobile && (\r\n <>\r\n \r\n\r\n \r\n\r\n \r\n \r\n )}\r\n\r\n {this.props.isMobile === false && (\r\n <>\r\n \r\n \r\n \r\n \r\n )}\r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const queryParams = queryString.parse(ownProps.location.search);\r\n const tableData = selectQuotes(state);\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n tableData,\r\n tableFilters: state.manageCustomerQuotes.tableFilters,\r\n queryParams,\r\n selectedFacilityID: state.selectedFacilityID,\r\n totalPages: state.manageCustomerQuotes.totalPages,\r\n isMobile: state.config.isMobile\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = {\r\n setTableFilter,\r\n getQuotes,\r\n toggleQuotesModal,\r\n toggleSalesQuotesModal\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, mapDispatchToProps)(ManageQuotes)\r\n);\r\n","import { connect } from 'react-redux';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport QuoteSalesForm from './QuoteSalesForm';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Ihistory } from '../../models';\r\nimport { getSecurityUsers } from '../../actions/manageUserActions';\r\nimport { manageQuoteQueryParamsEnum } from './manageQuotes';\r\nimport {\r\n toggleSalesQuotesModal,\r\n updateSelectedQuote,\r\n saveQuoteFiles,\r\n updateQuoteStatus,\r\n toggleQuotesDetailsModal\r\n} from '../../actions/manageCustomerQuotesActions';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getCloudDocument } from '../../actions/manageDocumentActions';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showSalesQuoteModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.modalTitle'),\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleSalesQuotesModal,\r\n onHide: toggleSalesQuotesModal,\r\n toggleModal: toggleSalesQuotesModal,\r\n toggleQuotesDetailsModal,\r\n onChange: updateSelectedQuote,\r\n onSubmit: updateQuoteStatus,\r\n getSecurityUsers,\r\n saveQuoteFiles,\r\n getCloudDocument\r\n })(WithCommonModal(QuoteSalesForm))\r\n);\r\n","import { connect } from 'react-redux';\r\nimport QuoteForm from '../QuoteForm';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Ihistory } from '../../../models';\r\nimport { getSecurityUsers } from '../../../actions/manageUserActions';\r\nimport { manageQuoteQueryParamsEnum } from '../manageQuotes';\r\nimport {\r\n toggleQuotesModal,\r\n toggleQuotesDetailsModal,\r\n updateSelectedQuote,\r\n saveQuoteFiles,\r\n updateQuoteStatus\r\n} from '../../../actions/manageCustomerQuotesActions';\r\nimport { initialFacility } from '../../../reducers/initialState';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { getCloudDocument } from '../../../actions/manageDocumentActions';\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showEditQuoteModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.modalTitle'),\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleQuotesModal,\r\n onHide: toggleQuotesModal,\r\n toggleModal: toggleQuotesModal,\r\n onChange: updateSelectedQuote,\r\n onSubmit: updateQuoteStatus,\r\n toggleQuotesDetailsModal,\r\n getSecurityUsers,\r\n getCloudDocument,\r\n saveQuoteFiles\r\n })(WithCommonMobileModal(QuoteForm))\r\n);\r\n","import { connect } from 'react-redux';\r\n\r\nimport QuoteSalesForm from '../QuoteSalesForm';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Ihistory } from '../../../models';\r\nimport { getSecurityUsers } from '../../../actions/manageUserActions';\r\nimport { manageQuoteQueryParamsEnum } from '../manageQuotes';\r\nimport {\r\n toggleSalesQuotesModal,\r\n updateSelectedQuote,\r\n saveQuoteFiles,\r\n updateQuoteStatus,\r\n toggleQuotesDetailsModal\r\n} from '../../../actions/manageCustomerQuotesActions';\r\nimport { initialFacility } from '../../../reducers/initialState';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { getCloudDocument } from '../../../actions/manageDocumentActions';\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showSalesQuoteModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.modalTitle'),\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleSalesQuotesModal,\r\n onHide: toggleSalesQuotesModal,\r\n toggleModal: toggleSalesQuotesModal,\r\n toggleQuotesDetailsModal,\r\n onChange: updateSelectedQuote,\r\n onSubmit: updateQuoteStatus,\r\n getSecurityUsers,\r\n saveQuoteFiles,\r\n getCloudDocument\r\n })(WithCommonMobileModal(QuoteSalesForm))\r\n);\r\n","import { connect } from 'react-redux';\r\n\r\nimport QuoteDetailsForm from '../QuoteDetailsForm';\r\nimport { Ihistory } from '../../../models';\r\nimport { IinitialState } from '../../../reducers';\r\n\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { getSecurityUsers } from '../../../actions/manageUserActions';\r\nimport { initialFacility } from '../../../reducers/initialState';\r\nimport { manageQuoteQueryParamsEnum } from '../manageQuotes';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { toggleQuotesDetailsModal } from '../../../actions/manageCustomerQuotesActions';\r\nimport { WithCommonMobileModal } from '../../common/mobile/WithCommonMobileModal';\r\n\r\ntype Iprops = {\r\n colorButton: string;\r\n queryParams: typeof manageQuoteQueryParamsEnum;\r\n history: Ihistory;\r\n secondModal?: boolean;\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const { selectedQuote } = state.manageCustomerQuotes;\r\n const facility = selectedQuote.facilityID\r\n ? state.facilities[selectedQuote.facilityID]\r\n : initialFacility;\r\n\r\n return {\r\n show: state.manageCustomerQuotes.showQuoteDetailsModal,\r\n loading: selectIsLoading(state),\r\n selectedQuote,\r\n originalQuote:\r\n state.manageCustomerQuotes.quotesByID[\r\n ownProps.queryParams.selectedQuoteID\r\n ],\r\n className: 'facility-contact-edit',\r\n title: ownProps.t('editCustomerQuoteForm.notesTitle'),\r\n secondModal: ownProps.secondModal ? true : false,\r\n facility\r\n };\r\n};\r\n\r\nexport default withTranslation('manageQuotes')(\r\n connect(mapStateToProps, {\r\n onCancel: toggleQuotesDetailsModal,\r\n onHide: toggleQuotesDetailsModal,\r\n toggleModal: toggleQuotesDetailsModal,\r\n getSecurityUsers\r\n })(WithCommonMobileModal(QuoteDetailsForm))\r\n);\r\n","/*\r\n * Manage Location Form\r\n * Edit location items\r\n */\r\n\r\nimport { Col, Button, Breadcrumb, BreadcrumbItem } from 'react-bootstrap';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n FormGroup,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { forEach } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n Ibuilding,\r\n ItableFiltersReducer,\r\n Ifloor,\r\n Ilocation,\r\n Ifacility\r\n} from '../../models';\r\nimport {\r\n saveAnyLocation,\r\n updateAnyLocation\r\n} from '../../actions/manageLocationActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { TFunction } from 'i18next';\r\n\r\nconst buildFieldConfig = () => {\r\n const fieldConfigControls = {\r\n name: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.maxLength(250)\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'name',\r\n colWidth: 12,\r\n type: 'input',\r\n autoFocus: true,\r\n name: 'location-name'\r\n }\r\n }\r\n };\r\n return {\r\n controls: { ...fieldConfigControls }\r\n };\r\n};\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n selectedItem?: any;\r\n selectedType: 'Building' | 'Floor' | 'Location' | 'Room';\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n\r\n tableFilters: ItableFiltersReducer;\r\n saveAnyLocation: typeof saveAnyLocation;\r\n updateAnyLocation: typeof updateAnyLocation;\r\n facility: Ifacility;\r\n selectedFacilityID: string;\r\n selectedBuilding: Ibuilding;\r\n selectedFloor: Ifloor;\r\n selectedLocation: Ilocation;\r\n}\r\n\r\nclass ManageLocationForm extends React.Component {\r\n private form: FormGroup | any;\r\n public fieldConfig: FieldConfig;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.fieldConfig = FormUtil.translateForm(\r\n buildFieldConfig(),\r\n this.props.t\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n if (!this.props.selectedItem) {\r\n console.info(`adding a new ${this.props.selectedType}`);\r\n } else {\r\n // set values\r\n forEach(this.props.selectedItem, (value, key) => {\r\n if (typeof value === 'string' && key.split('ID').length === 1) {\r\n // it is a string and did Not find 'ID'\r\n this.form.patchValue({ [key]: value });\r\n }\r\n });\r\n }\r\n }\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.form.status === 'INVALID') {\r\n this.form.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.form.value);\r\n const { name } = this.form.value;\r\n if (\r\n this.props.selectedItem &&\r\n this.props.selectedItem.id &&\r\n this.props.selectedItem.id.length\r\n ) {\r\n const newItem = {\r\n ...this.props.selectedItem,\r\n name\r\n };\r\n // updating a location object\r\n this.props.updateAnyLocation(\r\n newItem,\r\n this.props.selectedFacilityID\r\n );\r\n } else {\r\n // creating a new location\r\n this.props.saveAnyLocation(name, this.props.selectedFacilityID);\r\n }\r\n };\r\n setForm = (form: AbstractControl) => {\r\n this.form = form;\r\n // this.form.\r\n this.form.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n // get breadcrumb path\r\n getBreadcrumbs = () => {\r\n return (\r\n \r\n {this.props.selectedBuilding.id ? (\r\n \r\n {this.props.selectedBuilding.name}\r\n \r\n ) : (\r\n ''\r\n )}\r\n {this.props.selectedFloor.id ? (\r\n \r\n {this.props.selectedFloor.name}\r\n \r\n ) : (\r\n ''\r\n )}\r\n {this.props.selectedLocation.id ? (\r\n \r\n {this.props.selectedLocation.name}\r\n \r\n ) : (\r\n ''\r\n )}\r\n \r\n );\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `beacon-form location-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n {this.getBreadcrumbs()}\r\n\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default ManageLocationForm;\r\n","/*\r\n * Manage Location Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n saveAnyLocation,\r\n updateAnyLocation,\r\n toggleEditLocationModal\r\n} from '../../actions/manageLocationActions';\r\nimport { updateQueueProduct } from '../../actions/manageProductQueueActions';\r\nimport EditLocationForm from './EditLocationForm';\r\nimport {\r\n initialLoc,\r\n initialFloor,\r\n initialBuilding\r\n} from '../../reducers/initialState';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport {\r\n selectSelectedFacilityID,\r\n selectSelectedFacilityWithBuildings\r\n} from '../../reducers/facilitiesReducer';\r\n\r\ninterface Iprops {\r\n selectedItem: any;\r\n selectedType: 'Building' | 'Floor' | 'Location' | 'Room';\r\n colorButton: any;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedFacilityID = selectSelectedFacilityID(state);\r\n const facility = selectSelectedFacilityWithBuildings(state);\r\n const selectedBuilding =\r\n facility.buildings.find(\r\n building =>\r\n building.id === state.manageLocation.tableFilters.buildingID\r\n ) || initialBuilding;\r\n const selectedFloor =\r\n selectedBuilding.floors.find(\r\n floor => floor.id === state.manageLocation.tableFilters.floorID\r\n ) || initialFloor;\r\n const selectedLocation =\r\n selectedFloor.locations.find(\r\n location =>\r\n location.id === state.manageLocation.tableFilters.locationID\r\n ) || initialLoc;\r\n const modalTitle =\r\n ownProps.selectedItem && ownProps.selectedItem.id\r\n ? ownProps.t(`manageLocation:edit${ownProps.selectedType}`)\r\n : ownProps.t(`manageLocation:new${ownProps.selectedType}`);\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageLocation.showEditLocationModal,\r\n tableFilters: state.manageLocation.tableFilters,\r\n facility,\r\n selectedFacilityID,\r\n selectedBuilding,\r\n selectedFloor,\r\n selectedLocation,\r\n className: 'user-edit',\r\n title: modalTitle\r\n };\r\n};\r\n\r\nexport default withTranslation('manageLocation')(\r\n connect(mapStateToProps, {\r\n saveAnyLocation,\r\n updateAnyLocation,\r\n toggleModal: toggleEditLocationModal,\r\n onHide: toggleEditLocationModal,\r\n onCancel: toggleEditLocationModal,\r\n updateQueueProduct\r\n })(WithCommonModal(EditLocationForm))\r\n);\r\n","import {\r\n ImanageLocationReducer,\r\n Ibuilding,\r\n Ifloor,\r\n Ilocation,\r\n Iroom\r\n} from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport * as types from '../actions/actionTypes';\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\n\r\nconst getVisibleLocations = (state: IinitialState) =>\r\n state.manageLocation.visibleLocations;\r\n\r\nexport const selectVisibleLocations = createSelector(\r\n [getVisibleLocations],\r\n locations => locations\r\n);\r\n\r\nfunction visibleLocations(\r\n state: Array = [],\r\n action: any\r\n): Array {\r\n switch (action.type) {\r\n case types.SET_VISIBLE_LOCATIONS:\r\n return action.locations || [];\r\n case types.USER_LOGOUT_SUCCESS:\r\n return [];\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction locationManageTotalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.LOCATION_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst locationManage = combineReducers({\r\n visibleLocations,\r\n totalPages: (state, action) => locationManageTotalPages(state, action),\r\n showEditLocationModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_LOCATION'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_LOCATION')\r\n});\r\n\r\nexport default locationManage;\r\n","import * as React from 'react';\r\n\r\nimport { Breadcrumb, BreadcrumbItem, Button, Col, Row } from 'react-bootstrap';\r\n// import { find } from 'lodash';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n Ibuilding,\r\n Ifacility,\r\n Ifloor,\r\n Ilocation,\r\n ImanageLocationReducer,\r\n Iroom,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport {\r\n closeAllModals,\r\n getFacilitiesByCountry\r\n} from '../../actions/commonActions';\r\nimport {\r\n deleteAnyLocation,\r\n filterLocations,\r\n saveAnyLocation,\r\n setTableFilter,\r\n toggleEditLocationModal,\r\n updateAnyLocation\r\n} from '../../actions/manageLocationActions';\r\nimport {\r\n emptyTile,\r\n initialBuilding,\r\n initialFacility,\r\n initialFloor,\r\n initialLoc\r\n} from '../../reducers/initialState';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport EditLocationModal from './EditLocationModal';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n/*\r\n * hopsital Managers manage their locations\r\n */\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectVisibleLocations } from '../../reducers/manageLocationReducer';\r\nimport { selectSelectedFacilityID } from '../../reducers/facilitiesReducer';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n showEditLocationModal: boolean;\r\n loading: boolean;\r\n userManage: ImanageLocationReducer;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleEditLocationModal: typeof toggleEditLocationModal;\r\n saveAnyLocation: typeof saveAnyLocation;\r\n updateAnyLocation: typeof updateAnyLocation;\r\n deleteAnyLocation: typeof deleteAnyLocation;\r\n closeAllModals: typeof closeAllModals;\r\n selectedFacilityID: string;\r\n user: Iuser;\r\n tableData: any[];\r\n selectedFacility: Ifacility;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n selectedBuilding: Ibuilding;\r\n selectedFloor: Ifloor;\r\n selectedLocation: Ilocation;\r\n filterLocations: typeof filterLocations;\r\n getFacilitiesByCountry: typeof getFacilitiesByCountry;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n selectedItem: any;\r\n}\r\n\r\nclass ManageLocation extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n // public searchFieldConfig: any;\r\n public searchFieldConfigBanner: any;\r\n public buttonInAction = false;\r\n public deleteAction = false;\r\n private setTableFilterTimeout: any;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n selectedItem: {}\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n\r\n this.props.filterLocations(this.props.selectedFacilityID);\r\n this.props.getFacilitiesByCountry({\r\n name: this.props.selectedFacility.name\r\n });\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.filterLocations(this.props.selectedFacilityID);\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n // update the table with new or edited locationObjets when the facility changes\r\n if (\r\n JSON.stringify(prevProps.selectedFacility) !==\r\n JSON.stringify(this.props.selectedFacility)\r\n ) {\r\n this.props.filterLocations(this.props.selectedFacilityID);\r\n }\r\n\r\n // if (prevProps.facility.id !== this.props.facility.id) {\r\n // this.props.setSelectedFacility(this.props.facility);\r\n // }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n handleEdit(selectedItem: any) {\r\n this.setState({ selectedItem });\r\n // console.info(\"EDIT:\", item);\r\n }\r\n\r\n handleDelete(deletedItem: Ilocation | Ibuilding | Ifloor | Iroom) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem,\r\n buildingID: this.props.selectedBuilding.id,\r\n floorID: this.props.selectedFloor.id,\r\n locationID: this.props.selectedLocation.id\r\n };\r\n this.props.deleteAnyLocation(\r\n deletedItem,\r\n this.props.selectedFacilityID\r\n );\r\n console.info('deleted', deletedItem);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n }\r\n\r\n /*\r\n * Reset the table filters (not used currently)\r\n */\r\n resetTableFilters = () => {\r\n this.props.setTableFilter({\r\n search: '',\r\n page: 1\r\n });\r\n };\r\n\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n minWidth: 300\r\n },\r\n {\r\n Header: '',\r\n Cell: row => (\r\n
    \r\n {\r\n this.buttonInAction = true;\r\n this.handleEdit(row.original);\r\n }}\r\n >\r\n \r\n \r\n {\r\n this.buttonInAction = true;\r\n this.deleteAction = true;\r\n this.handleDelete(row.original);\r\n }}\r\n >\r\n \r\n \r\n
    \r\n )\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n /*\r\n * Handle user clicking on a location row\r\n * set the selected location to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: (evt: React.MouseEvent) => {\r\n const locationObject = rowInfo.original as\r\n | Ilocation\r\n | Ibuilding\r\n | Ifloor\r\n | Iroom;\r\n if (this.buttonInAction && this.deleteAction === false) {\r\n this.props.toggleEditLocationModal();\r\n } else if (this.deleteAction === false) {\r\n if ('facilityID' in locationObject) {\r\n // BUILDING\r\n this.props.setTableFilter({\r\n buildingID: locationObject.id,\r\n locationID: undefined,\r\n floorID: undefined\r\n });\r\n } else if ('buildingID' in locationObject) {\r\n // FLOOR\r\n this.props.setTableFilter({\r\n locationID: undefined,\r\n floorID: locationObject.id\r\n });\r\n } else if ('floorID' in locationObject) {\r\n // LOCATION\r\n this.props.setTableFilter({\r\n locationID: locationObject.id\r\n });\r\n } else {\r\n // ROOM - we don't do anthything when they select a room...\r\n }\r\n }\r\n this.buttonInAction = false;\r\n this.deleteAction = false;\r\n },\r\n style: {\r\n background: this.state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n // get location type\r\n getLocationType = () => {\r\n if (this.props.selectedLocation.id.length) {\r\n return 'Room';\r\n } else if (this.props.selectedFloor.id.length) {\r\n return 'Location';\r\n } else if (this.props.selectedBuilding.id.length) {\r\n return 'Floor';\r\n } else {\r\n return 'Building';\r\n }\r\n };\r\n\r\n handleBCClick = (\r\n item: any,\r\n lType: string,\r\n e: React.MouseEvent\r\n ) => {\r\n e.preventDefault();\r\n switch (lType) {\r\n case 'Facility':\r\n this.props.setTableFilter({\r\n buildingID: undefined,\r\n locationID: undefined,\r\n floorID: undefined\r\n });\r\n break;\r\n case 'Building':\r\n this.props.setTableFilter({\r\n buildingID: item.id,\r\n locationID: undefined,\r\n floorID: undefined\r\n });\r\n break;\r\n case 'Floor':\r\n this.props.setTableFilter({\r\n locationID: undefined,\r\n floorID: item.id\r\n });\r\n break;\r\n case 'Location':\r\n this.props.setTableFilter({ locationID: item.id });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n // Ignoring this issue at the moment because it requires CSS\r\n makeSandwhich = (label: string, handler?: any) => {\r\n if (typeof handler !== 'undefined') {\r\n return (\r\n \r\n \r\n {label}\r\n \r\n \r\n );\r\n } else {\r\n return {label};\r\n }\r\n };\r\n\r\n // ^ Ignoring this issue at the moment because it requires CSS\r\n\r\n // get breadcrumb path\r\n getBreadcrumbs = () => {\r\n return (\r\n \r\n {this.props.tableFilters.buildingID ? (\r\n \r\n {/* es */}\r\n \r\n ) =>\r\n this.handleBCClick(\r\n initialBuilding,\r\n 'Facility',\r\n evt\r\n )\r\n }\r\n >\r\n Buildings\r\n \r\n \r\n ) : (\r\n ''\r\n )}\r\n {/* building crumbs */}\r\n {this.getLocationType() === 'Floor' &&\r\n this.props.tableFilters.buildingID\r\n ? this.makeSandwhich(this.props.selectedBuilding.name)\r\n : this.props.tableFilters.buildingID\r\n ? this.makeSandwhich(\r\n this.props.selectedBuilding.name,\r\n (evt: React.MouseEvent) =>\r\n this.handleBCClick(\r\n this.props.selectedBuilding,\r\n 'Building',\r\n evt\r\n )\r\n )\r\n : ''}\r\n {/* Floor crumbs */}\r\n {this.getLocationType() === 'Location' &&\r\n this.props.selectedFloor.id.length > 0\r\n ? this.makeSandwhich(this.props.selectedFloor.name)\r\n : this.props.selectedFloor.id\r\n ? this.makeSandwhich(\r\n this.props.selectedFloor.name,\r\n (evt: React.MouseEvent) =>\r\n this.handleBCClick(\r\n this.props.selectedFloor,\r\n 'Floor',\r\n evt\r\n )\r\n )\r\n : ''}\r\n {/* Location crumbs */}\r\n {this.getLocationType() === 'Room' &&\r\n this.props.selectedLocation.id.length > 0\r\n ? this.makeSandwhich(this.props.selectedLocation.name)\r\n : this.props.selectedLocation.id\r\n ? this.makeSandwhich(\r\n this.props.selectedLocation.name,\r\n (evt: React.MouseEvent) =>\r\n this.handleBCClick(\r\n this.props.selectedLocation,\r\n 'Location',\r\n evt\r\n )\r\n )\r\n : ''}\r\n \r\n );\r\n };\r\n\r\n // get the next or previous page of data. the table is 0 indexed but the API is not\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n render() {\r\n console.info('rendering locations table');\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {this.getBreadcrumbs()}\r\n \r\n {\r\n this.setState({ selectedItem: {} }, () => {\r\n this.props.toggleEditLocationModal();\r\n });\r\n }}\r\n >\r\n {t(`manageLocation:new${this.getLocationType()}`)}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const selectedFacilityID = selectSelectedFacilityID(state);\r\n const selectedFacility =\r\n state.facilities[selectedFacilityID] &&\r\n state.facilities[selectedFacilityID].buildings\r\n ? state.facilities[selectedFacilityID]\r\n : initialFacility;\r\n\r\n const selectedBuilding =\r\n selectedFacility.buildings.find(\r\n building =>\r\n building.id === state.manageLocation.tableFilters.buildingID\r\n ) || initialBuilding;\r\n const selectedFloor =\r\n selectedBuilding.floors.find(\r\n floor => floor.id === state.manageLocation.tableFilters.floorID\r\n ) || initialFloor;\r\n const selectedLocation =\r\n selectedFloor.locations.find(\r\n location =>\r\n location.id === state.manageLocation.tableFilters.locationID\r\n ) || initialLoc;\r\n return {\r\n selectedFacilityID,\r\n user: state.user,\r\n userManage: state.manageLocation,\r\n loading: selectIsLoading(state),\r\n showEditLocationModal: state.manageLocation.showEditLocationModal,\r\n tableData: selectVisibleLocations(state),\r\n selectedFacility,\r\n tableFilters: state.manageLocation.tableFilters,\r\n selectedBuilding,\r\n selectedFloor,\r\n selectedLocation\r\n };\r\n};\r\nexport default withTranslation('manageLocation')(\r\n connect(mapStateToProps, {\r\n saveAnyLocation,\r\n updateAnyLocation,\r\n deleteAnyLocation,\r\n toggleEditLocationModal,\r\n closeAllModals,\r\n setTableFilter,\r\n filterLocations,\r\n getFacilitiesByCountry\r\n })(ManageLocation)\r\n);\r\n","import * as React from 'react';\r\nimport { ImeasurementPoint, ImeasurementPointListTab } from '../../models';\r\nimport { ListGroup, ListGroupItem, Row, Col } from 'react-bootstrap';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n SortableContainer,\r\n SortableElement,\r\n SortableHandle\r\n} from 'react-sortable-hoc';\r\nimport arrayMove from 'array-move';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { filter, keyBy } from 'lodash';\r\nimport { updateMeasurementPointListTab } from '../../actions/manageMeasurementPointListsActions';\r\n\r\nconst DragHandle = SortableHandle(() => (\r\n \r\n \r\n \r\n));\r\n/*\r\n * List the Measurement Points\r\n */\r\n\r\nconst SortableItem = SortableElement(\r\n ({\r\n mp,\r\n disabled,\r\n setSelectedMeasurementPoint\r\n }: {\r\n mp: ImeasurementPoint;\r\n disabled: boolean;\r\n setSelectedMeasurementPoint: (mp: ImeasurementPoint) => void;\r\n }) => {\r\n return (\r\n
    \r\n {\r\n setSelectedMeasurementPoint(mp);\r\n }}\r\n key={mp.id}\r\n disabled={disabled}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n
    {mp.label}
    \r\n {constants.measurementPointTypesInverse[mp.type]}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n }\r\n);\r\n\r\nconst SortableList = SortableContainer(({ children }: any) => {\r\n return {children};\r\n});\r\n\r\n/*\r\n * Remove deleted measurementPoints and sort them\r\n */\r\nconst filterAndSortMeasurementPoints = (measurementPointsByID: {\r\n [key: string]: ImeasurementPoint;\r\n}) => {\r\n const filteredMPs = filter(\r\n measurementPointsByID,\r\n mp => mp.isDeleted === false\r\n );\r\n\r\n filteredMPs.sort((a: ImeasurementPoint, b: ImeasurementPoint) => {\r\n return a.order - b.order;\r\n });\r\n return filteredMPs;\r\n};\r\n\r\ninterface Iprops {\r\n selectedTab: ImeasurementPointListTab;\r\n setSelectedMeasurementPoint: (m: ImeasurementPoint) => void;\r\n deleteMeasurementPoint: (m: ImeasurementPoint) => void;\r\n updateMeasurementPointListTab: typeof updateMeasurementPointListTab;\r\n canEditGlobal: boolean;\r\n isCustomerView: boolean;\r\n}\r\ninterface Istate {\r\n measurementPoints: ImeasurementPoint[];\r\n}\r\n\r\n/*\r\n * Measurement Point List - used on customer MPS and Measurements\r\n * When in customer MPS view, global measurement points are greyed out and the forms are not editable. they Are still clickable but they are view only.\r\n */\r\nexport class MeasurementPointList extends React.Component {\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n measurementPoints: filterAndSortMeasurementPoints(\r\n this.props.selectedTab.measurementPoints\r\n )\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n JSON.stringify(prevProps.selectedTab.measurementPoints) !==\r\n JSON.stringify(this.props.selectedTab.measurementPoints)\r\n ) {\r\n this.setState({\r\n measurementPoints: filterAndSortMeasurementPoints(\r\n this.props.selectedTab.measurementPoints\r\n )\r\n });\r\n }\r\n }\r\n\r\n onSortEnd = ({\r\n oldIndex,\r\n newIndex\r\n }: {\r\n oldIndex: number;\r\n newIndex: number;\r\n }) => {\r\n const newMeasurementPoints = arrayMove(\r\n this.state.measurementPoints,\r\n oldIndex,\r\n newIndex\r\n );\r\n this.updateSort(newMeasurementPoints);\r\n };\r\n\r\n updateSort = (measurementPoints: ImeasurementPoint[]) => {\r\n const withOrderUpdated = measurementPoints.map(\r\n (measurementPoint, index) => ({ ...measurementPoint, order: index })\r\n );\r\n const keyedMeasurementPoints = keyBy(withOrderUpdated, 'id');\r\n this.props.updateMeasurementPointListTab({\r\n ...this.props.selectedTab,\r\n measurementPoints: keyedMeasurementPoints\r\n });\r\n };\r\n render() {\r\n if (this.state.measurementPoints.length === 0) {\r\n return null;\r\n }\r\n return (\r\n \r\n {this.state.measurementPoints.map((value, index) => (\r\n \r\n ))}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * EditMeasurementPointListForm\r\n * Edit measurement point lists\r\n */\r\n\r\nimport { Col, Button, Row } from 'react-bootstrap';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n GroupProps,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n ImeasurementPointList,\r\n ImeasurementPoint,\r\n Iuser,\r\n ImeasurementPointListTab,\r\n IproductInfo,\r\n Ioption\r\n} from '../../models';\r\nimport {\r\n toggleEditMeasurementPointModal,\r\n addGlobalMeasurementPointList,\r\n setSelectedTabID,\r\n updateMeasurementPoint,\r\n saveMeasurementPointToMeasurementPointList,\r\n toggleEditMeasurementPointTabModal,\r\n setSelectedMeasurementPointList,\r\n toggleEditMeasurementPointListTestProceduresModal,\r\n updateMeasurementPointListTab\r\n} from '../../actions/manageMeasurementPointListsActions';\r\nimport { constants, mainCategories } from '../../constants/constants';\r\nimport {\r\n initialMeasurementPoint,\r\n initialMeasurementPointTab,\r\n initialMeasurementPointList\r\n} from '../../reducers/initialState';\r\nimport { MeasurementPointList } from './MeasurementPointList';\r\nimport { TFunction } from 'i18next';\r\nimport {\r\n measurementPointListTypeEnum,\r\n measurementPointListTypeForJobEnum\r\n} from '../../models-enums';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops extends React.Props {\r\n user: Iuser;\r\n selectedMeasurementPointList: ImeasurementPointList;\r\n productInfo: IproductInfo;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n forJob: boolean;\r\n toggleModal: () => void;\r\n toggleEditMeasurementPointModal: typeof toggleEditMeasurementPointModal;\r\n addGlobalMeasurementPointList: typeof addGlobalMeasurementPointList;\r\n updateMeasurementPointList: (\r\n mpl: ImeasurementPointList,\r\n persistToAPI: boolean,\r\n isCustomer: boolean\r\n ) => Promise;\r\n selectedTab: ImeasurementPointListTab;\r\n setSelectedTabID: typeof setSelectedTabID;\r\n updateMeasurementPoint: typeof updateMeasurementPoint;\r\n saveMeasurementPointToMeasurementPointList: typeof saveMeasurementPointToMeasurementPointList;\r\n toggleEditMeasurementPointTabModal: typeof toggleEditMeasurementPointTabModal;\r\n setSelectedMeasurementPointList: typeof setSelectedMeasurementPointList;\r\n toggleEditMeasurementPointListTestProceduresModal: typeof toggleEditMeasurementPointListTestProceduresModal;\r\n\r\n updateMeasurementPointListTab: typeof updateMeasurementPointListTab;\r\n canEditGlobal: boolean;\r\n isCustomerView: boolean;\r\n listTabs: ImeasurementPointListTab[];\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n isCopying: boolean;\r\n preCopyValues?: {\r\n mainCategoryID: Ioption;\r\n type: Ioption;\r\n standardID: Ioption;\r\n };\r\n}\r\n\r\nclass EditMeasurementPointListForm extends React.Component {\r\n public formGroup: FormGroup | any;\r\n private subscription: any;\r\n // private persistTimeout: any; // all inputs are selects so we don't care about a debounce\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: FormUtil.translateForm(\r\n this.buildFieldConfig(false),\r\n this.props.t\r\n ),\r\n isCopying: false\r\n };\r\n }\r\n componentDidMount() {\r\n const { listTabs } = this.props;\r\n if (listTabs.length) {\r\n this.props.setSelectedTabID(listTabs[0].id);\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (!this.props.selectedMeasurementPointList) {\r\n console.error('missing selected measurement point');\r\n return;\r\n }\r\n if (\r\n JSON.stringify(prevProps.selectedTab) !==\r\n JSON.stringify(this.props.selectedTab) ||\r\n JSON.stringify(prevProps.selectedMeasurementPointList) !==\r\n JSON.stringify(this.props.selectedMeasurementPointList)\r\n ) {\r\n this.setState({\r\n fieldConfig: FormUtil.translateForm(\r\n this.buildFieldConfig(this.state.isCopying),\r\n this.props.t\r\n )\r\n });\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n buildFieldConfig = (isCopying: boolean) => {\r\n const { selectedMeasurementPointList, productInfo } = this.props;\r\n const {\r\n type,\r\n mainCategoryID,\r\n standardID\r\n } = selectedMeasurementPointList;\r\n\r\n const {\r\n // eslint-disable-next-line no-shadow\r\n mainCategories,\r\n standards,\r\n mainCategoryOptions,\r\n standardOptions\r\n } = productInfo;\r\n\r\n const tabOptions = FormUtil.convertToOptions(\r\n this.props.listTabs.filter(tab => tab.isDeleted !== true)\r\n );\r\n // const disabled = this.props.isCustomerView;\r\n\r\n let selectedType = null;\r\n let selectedMainCategory = null;\r\n let selectedStandard = null;\r\n let selectedTab = null;\r\n if (type !== 0) {\r\n selectedType = {\r\n label: this.props.t(\r\n measurementPointListTypeEnum[\r\n selectedMeasurementPointList.type\r\n ]\r\n ),\r\n value: selectedMeasurementPointList.type\r\n };\r\n }\r\n if (mainCategoryID.length) {\r\n selectedMainCategory = FormUtil.convertToSingleOption(\r\n mainCategories[mainCategoryID]\r\n );\r\n }\r\n if (standardID.length) {\r\n selectedStandard = FormUtil.convertToSingleOption(\r\n standards[standardID]\r\n );\r\n }\r\n\r\n const foundSelectedTab = tabOptions.find(\r\n tab => tab.value === this.props.selectedTab.id\r\n );\r\n if (this.props.selectedTab.id.length && foundSelectedTab) {\r\n selectedTab = foundSelectedTab;\r\n } else {\r\n // select the first one if none are selected\r\n selectedTab = tabOptions[0];\r\n }\r\n\r\n let fieldConfigControls = {};\r\n\r\n // If the measurement point list is not for a job, then allow the user to select the main category\r\n if (\r\n selectedMeasurementPointList.forJob === undefined ||\r\n selectedMeasurementPointList.forJob === false\r\n ) {\r\n fieldConfigControls = {\r\n mainCategoryID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: mainCategoryOptions.filter(\r\n (option: Ioption) => option.label !== 'Job'\r\n ),\r\n label: 'manageMeasurementPointLists:equipmentType',\r\n colWidth: 12,\r\n placeholder:\r\n 'manageMeasurementPointLists:equipmentTypePlaceholder'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: selectedMainCategory,\r\n disabled:\r\n !isCopying &&\r\n !this.props.selectedMeasurementPointList.temporary // do not allow users to change since it wil likely cause confusing issues\r\n }\r\n }\r\n };\r\n }\r\n\r\n // Field config to configure form\r\n fieldConfigControls = {\r\n ...fieldConfigControls,\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n this.props.forJob\r\n ? measurementPointListTypeForJobEnum\r\n : measurementPointListTypeEnum\r\n ),\r\n label: 'manageMeasurementPointLists:type',\r\n colWidth: 6,\r\n placeholder: 'manageMeasurementPointLists:typePlaceholder',\r\n shouldTranslate: true\r\n },\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n formState: {\r\n value: selectedType,\r\n disabled:\r\n !isCopying &&\r\n !this.props.selectedMeasurementPointList.temporary // do not allow users to change since it wil likely cause confusing issues\r\n }\r\n },\r\n standardID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: standardOptions,\r\n label: 'manageMeasurementPointLists:standard',\r\n colWidth: 6,\r\n placeholder:\r\n 'manageMeasurementPointLists:standardPlaceholder'\r\n },\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n formState: {\r\n value: selectedStandard,\r\n disabled:\r\n !isCopying &&\r\n !this.props.selectedMeasurementPointList.temporary // do not allow users to change since it wil likely cause confusing issues\r\n }\r\n },\r\n selectedTab: {\r\n render: this.props.isCustomerView\r\n ? FormUtil.Select\r\n : FormUtil.CreatableSelectWithButton,\r\n meta: {\r\n options: tabOptions,\r\n label: 'manageMeasurementPointLists:selectTabLabel',\r\n subLabel: this.props.t(' - Type to Create a Tab'),\r\n colWidth: 12,\r\n placeholder:\r\n 'manageMeasurementPointLists:selectTabPlaceholder',\r\n isMulti: false,\r\n handleCreate: this.handleCreateTab,\r\n buttonName: this.props.t('edit'),\r\n buttonAction: this.props.toggleEditMeasurementPointTabModal\r\n },\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n formState: { value: selectedTab, disabled: false }\r\n }\r\n } as { [key: string]: GroupProps };\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n return fieldConfig as FieldConfig;\r\n };\r\n\r\n /*\r\n Handle creating a new tab\r\n */\r\n handleCreateTab = (name: string) => {\r\n const newTab: ImeasurementPointListTab = {\r\n ...initialMeasurementPointTab,\r\n id: uuidv4(),\r\n name,\r\n order: this.props.listTabs.length + 1\r\n };\r\n\r\n this.props\r\n .updateMeasurementPointList(\r\n {\r\n ...this.props.selectedMeasurementPointList,\r\n measurementPointTabs: [...this.props.listTabs, newTab]\r\n },\r\n false,\r\n false\r\n )\r\n .then(() => {\r\n this.props.setSelectedTabID(newTab.id);\r\n })\r\n .catch((error: any) => console.error(error));\r\n };\r\n\r\n subscribeToValueChanges = () => {\r\n const controls = [\r\n 'selectedTab',\r\n 'type',\r\n 'mainCategoryID',\r\n 'standardID'\r\n ];\r\n controls.forEach((key: string) => {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n ?.valueChanges.subscribe((value: Ioption | null) => {\r\n this.handleValueChange(key, value);\r\n });\r\n });\r\n };\r\n\r\n handleValueChange = (key: string, value: null | Ioption) => {\r\n // clearTimeout(this.persistTimeout);\r\n // this.persistTimeout = setTimeout(() => {\r\n switch (key) {\r\n case 'selectedTab':\r\n if (value && value.value) {\r\n this.props.setSelectedTabID(value.value);\r\n }\r\n break;\r\n default:\r\n if (value && value.value) {\r\n this.props\r\n .updateMeasurementPointList(\r\n {\r\n ...this.props.selectedMeasurementPointList,\r\n [key]: value.value\r\n },\r\n false,\r\n false\r\n )\r\n .catch((error: any) => console.error(error));\r\n }\r\n break;\r\n }\r\n // }, 200);\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n this.subscribeToValueChanges();\r\n };\r\n\r\n /*\r\n set a single measurement point\r\n */\r\n setSelectedMeasurementPoint = (measurementPoint: ImeasurementPoint) => {\r\n this.props.updateMeasurementPoint(\r\n measurementPoint,\r\n this.props.selectedTab.id\r\n );\r\n this.props.toggleEditMeasurementPointModal();\r\n };\r\n\r\n deleteMeasurementPoint = (measurementPoint: ImeasurementPoint) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.saveMeasurementPointToMeasurementPointList(\r\n this.props.selectedMeasurementPointList.id,\r\n this.props.selectedTab.id,\r\n { ...measurementPoint, isDeleted: true }\r\n );\r\n console.info('deleted', measurementPoint);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteMeasurementPointOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirmMP'), toastrConfirmOptions);\r\n };\r\n\r\n createNewMeasurementPoint = (type: number): ImeasurementPoint => {\r\n return {\r\n ...initialMeasurementPoint,\r\n type,\r\n order: Object.keys(this.props.selectedTab.measurementPoints).length\r\n };\r\n };\r\n\r\n validInitialTab = () => {\r\n if (this.props.selectedTab.id.length) {\r\n return true;\r\n } else {\r\n toastr.warning(\r\n 'Warning',\r\n 'Must add a tab first.',\r\n constants.toastrWarning\r\n );\r\n return false;\r\n }\r\n };\r\n\r\n // create an empty guid\r\n\r\n /*\r\n * We will allways have a selectedMeasurmentPointList because either a temporary one was created, or we are editing one that we received from the API.\r\n * we are only updating the mainCategory, standard, and type on this form.\r\n */\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n let { type, mainCategoryID, standardID } = this.formGroup.value;\r\n\r\n let mainCategoryToSubmit;\r\n if (!mainCategoryID && this.props.selectedMeasurementPointList.forJob) {\r\n mainCategoryToSubmit = mainCategories.job;\r\n } else {\r\n mainCategoryToSubmit = mainCategoryID\r\n ? mainCategoryID.value\r\n : '00000000-0000-0000-0000-000000000000';\r\n }\r\n\r\n const baseMpl = {\r\n ...this.props.selectedMeasurementPointList,\r\n mainCategoryID: mainCategoryToSubmit,\r\n standardID: standardID ? standardID.value : '',\r\n type: type ? type.value : ''\r\n };\r\n\r\n const mpl = this.state.isCopying\r\n ? {\r\n ...baseMpl,\r\n temporary: true,\r\n createDate: undefined,\r\n creatorID: undefined,\r\n mainCategories: undefined,\r\n standard: undefined,\r\n updateDate: undefined,\r\n updaterID: undefined,\r\n mainCategory: undefined\r\n }\r\n : baseMpl;\r\n\r\n if (this.state.isCopying) {\r\n const mplID = uuidv4();\r\n\r\n mpl.id = mplID;\r\n mpl.measurementPointTabs = (mpl.measurementPointTabs as any).map(\r\n (mpt: any) => {\r\n const tabID = uuidv4();\r\n\r\n return {\r\n ...mpt,\r\n createDate: undefined,\r\n creatorID: undefined,\r\n updateDate: undefined,\r\n updaterID: undefined,\r\n id: tabID,\r\n measurementPointListID: mplID,\r\n measurementPoints: Object.values(\r\n mpt.measurementPoints\r\n ).map((mp: any) => ({\r\n ...mp,\r\n createDate: undefined,\r\n creatorID: undefined,\r\n updateDate: undefined,\r\n updaterID: undefined,\r\n id: uuidv4(),\r\n measurementPointListTabID: tabID\r\n }))\r\n };\r\n }\r\n );\r\n }\r\n\r\n if (mpl.temporary !== true) {\r\n this.props\r\n .updateMeasurementPointList(\r\n mpl,\r\n true,\r\n this.props.isCustomerView\r\n )\r\n .catch((error: any) => console.error(error));\r\n } else {\r\n this.props.addGlobalMeasurementPointList({\r\n ...mpl,\r\n temporary: false\r\n });\r\n }\r\n };\r\n\r\n handleAddQuestion = () => {\r\n if (!this.validInitialTab()) {\r\n return;\r\n }\r\n this.setSelectedMeasurementPoint(\r\n this.createNewMeasurementPoint(\r\n constants.measurementPointTypes.MEASUREMENT_POINT_PASSFAIL\r\n )\r\n );\r\n };\r\n handleAddGroup = () => {\r\n if (!this.validInitialTab()) {\r\n return;\r\n }\r\n this.setSelectedMeasurementPoint(\r\n this.createNewMeasurementPoint(\r\n constants.measurementPointTypes.GROUP\r\n )\r\n );\r\n };\r\n handleCancel = () => {\r\n this.props.toggleModal();\r\n this.props.setSelectedTabID('');\r\n this.props.setSelectedMeasurementPointList(initialMeasurementPointList);\r\n };\r\n\r\n canEditGlobal = () => {\r\n return constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageAllMeasurementPoints.id\r\n ]);\r\n };\r\n\r\n handleCopyClick = () => {\r\n this.setState(\r\n prev => ({\r\n isCopying: !prev.isCopying,\r\n fieldConfig: FormUtil.translateForm(\r\n this.buildFieldConfig(!prev.isCopying),\r\n this.props.t\r\n )\r\n }),\r\n () => {\r\n if (this.state.isCopying) {\r\n const {\r\n mainCategoryID,\r\n type,\r\n standardID\r\n } = this.formGroup.value;\r\n\r\n this.setState({\r\n preCopyValues: {\r\n mainCategoryID,\r\n type,\r\n standardID\r\n }\r\n });\r\n } else if (this.state.preCopyValues) {\r\n const {\r\n mainCategoryID,\r\n type,\r\n standardID\r\n } = this.state.preCopyValues;\r\n\r\n this.props.updateMeasurementPointList(\r\n {\r\n ...this.props.selectedMeasurementPointList,\r\n mainCategoryID: mainCategoryID.value,\r\n type: parseInt(type.value, 10),\r\n standardID: standardID.value\r\n },\r\n false,\r\n false\r\n );\r\n }\r\n }\r\n );\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const formClassName = `clearfix beacon-form ${this.props.colorButton}`;\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n {!this.props.selectedMeasurementPointList\r\n .temporary && (\r\n \r\n {this.state.isCopying\r\n ? 'Cancel Copy'\r\n : 'Copy'}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('editProcedureButton')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Add Group\r\n \r\n\r\n \r\n Add Question\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('cancel')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default EditMeasurementPointListForm;\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n ImanageMeasurementPointListsReducer,\r\n ImeasurementPoint,\r\n ImeasurementPointList,\r\n ImeasurementPointListTab\r\n} from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { forEach, keyBy, map, omit, filter } from 'lodash';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { createSelector } from 'reselect';\r\nimport { initialMeasurementPoint } from './initialState';\r\nimport { initialMeasurementPointList } from './initialState';\r\nimport { IinitialState } from '.';\r\n\r\n/*\r\n * Selector functions\r\n */\r\n\r\n// const selectMeasurementPointLists = (state: IinitialState) => state.manageMeasurementPointLists.measurementPointListsByID;\r\nconst selectSelectedMeasurementPointList = (state: IinitialState) =>\r\n state.manageMeasurementPointLists.selectedMeasurementPointList;\r\nexport const selectMeasurementPointListTabs = createSelector(\r\n [selectSelectedMeasurementPointList],\r\n selectedList => {\r\n return filter(selectedList.measurementPointTabs, { isDeleted: false });\r\n }\r\n);\r\n\r\n/*\r\n ***** Reducer Fuctions ****\r\n */\r\n\r\n/*\r\n * data - keyed by the measurementPointListID\r\n */\r\n\r\nconst keyMeasurementPoints = (\r\n measurementPointTabs: ImeasurementPointListTab[]\r\n) => {\r\n return map(measurementPointTabs, (tab: ImeasurementPointListTab) => {\r\n const measurementPointsKeyed = keyBy(\r\n tab.measurementPoints,\r\n (item: ImeasurementPoint) => item.id\r\n );\r\n return { ...tab, measurementPoints: measurementPointsKeyed };\r\n });\r\n};\r\n\r\nfunction measurementPointListsByID(\r\n state: { [key: string]: ImeasurementPointList } = {},\r\n action: any\r\n): { [key: string]: ImeasurementPointList } {\r\n switch (action.type) {\r\n case types.MANAGE_MEASUREMENT_POINT_LISTS_SUCCESS: {\r\n // return initialState.measurementPointLists.data;\r\n const measurementPointLists = action.measurementPointLists.map(\r\n (measurementPointList: ImeasurementPointList) => {\r\n const measurementPointTabs = keyMeasurementPoints(\r\n measurementPointList.measurementPointTabs\r\n );\r\n return { ...measurementPointList, measurementPointTabs };\r\n }\r\n );\r\n return keyBy(measurementPointLists, 'id');\r\n }\r\n case types.MANAGE_MEASUREMENT_POINT_LIST_ADD:\r\n return {\r\n ...state,\r\n [action.measurementPointList.id]: action.measurementPointList\r\n };\r\n case types.MANAGE_MEASUREMENT_POINT_LIST_UPDATE:\r\n if (action.persistToAPI === false) {\r\n return state;\r\n }\r\n return {\r\n ...state,\r\n [action.measurementPointList.id]: action.measurementPointList\r\n };\r\n case types.MEASUREMENT_POINT_LIST_SUCCESS: {\r\n const tabs: ImeasurementPointListTab[] =\r\n action.list.measurementPointTabs;\r\n return {\r\n ...state,\r\n [action.list.id]: {\r\n ...action.list,\r\n measurementPointTabs: keyMeasurementPoints(tabs)\r\n }\r\n };\r\n }\r\n case types.MANAGE_MEASUREMENT_POINT_LIST_DELETE_SUCCESS:\r\n return omit(state, action.MPlistID);\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst measurementPointsByID = (\r\n state: { [key: string]: ImeasurementPoint } = {},\r\n action: any\r\n): { [key: string]: ImeasurementPoint } => {\r\n switch (action.type) {\r\n case types.MANAGE_MEASUREMENT_POINT_LISTS_SUCCESS: {\r\n // const measurmentPointLists = initialState.measurementPointLists.data;\r\n const measurmentPointLists = action.allLists;\r\n let measurementPoints = {};\r\n forEach(measurmentPointLists, (list: ImeasurementPointList) => {\r\n forEach(\r\n list.measurementPointTabs,\r\n (tab: ImeasurementPointListTab) => {\r\n measurementPoints = {\r\n ...measurementPoints,\r\n ...keyBy(\r\n tab.measurementPoints,\r\n (mp: ImeasurementPoint) => mp.id\r\n )\r\n };\r\n }\r\n );\r\n });\r\n return { ...state, ...measurementPoints };\r\n }\r\n case types.MEASUREMENT_POINT_LIST_SUCCESS: {\r\n let measurementPointsB = {};\r\n forEach(\r\n action.list.measurementPointTabs,\r\n (tab: ImeasurementPointListTab) => {\r\n measurementPointsB = {\r\n ...measurementPointsB,\r\n ...keyBy(\r\n tab.measurementPoints,\r\n (mp: ImeasurementPoint) => mp.id\r\n )\r\n };\r\n }\r\n );\r\n return { ...state, ...measurementPointsB };\r\n }\r\n case types.DELETE_MEASUREMENT_POINT: {\r\n return omit(state, action.measurementPointID);\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nfunction selectedMeasurementPointList(\r\n state: ImeasurementPointList = initialMeasurementPointList,\r\n action: any\r\n): ImeasurementPointList {\r\n switch (action.type) {\r\n case types.SELECT_MEASUREMENT_POINT_LIST:\r\n return action.measurementPointList;\r\n case types.MANAGE_MEASUREMENT_POINT_SAVE_TO_LIST: {\r\n const selectedTab = state.measurementPointTabs.find(\r\n tab => tab.id === action.selectedTabID\r\n );\r\n if (selectedTab) {\r\n const newTabs = state.measurementPointTabs.map(tab => {\r\n if (tab.id === selectedTab.id) {\r\n return {\r\n ...tab,\r\n measurementPoints: {\r\n ...tab.measurementPoints,\r\n [action.measurementPoint.id]:\r\n action.measurementPoint\r\n }\r\n };\r\n } else {\r\n return tab;\r\n }\r\n });\r\n return { ...state, measurementPointTabs: newTabs };\r\n } else {\r\n console.error(\r\n 'unable to update measurement point, missing tab' +\r\n action.selectedTabID\r\n );\r\n return state;\r\n }\r\n }\r\n case types.MANAGE_MEASUREMENT_POINT_TAB_UPDATE: {\r\n const currentTab = state.measurementPointTabs.find(\r\n tab => tab.id === action.tab.id\r\n );\r\n if (currentTab) {\r\n const newTabs = state.measurementPointTabs.map(tab => {\r\n if (tab.id === currentTab.id) {\r\n return {\r\n ...action.tab\r\n };\r\n } else {\r\n return tab;\r\n }\r\n });\r\n return { ...state, measurementPointTabs: newTabs };\r\n } else {\r\n console.error(\r\n 'unable to update measurement point list tab, missing tab' +\r\n action.tab.id\r\n );\r\n return state;\r\n }\r\n }\r\n case types.REMOVE_MEASUREMENT_POINT_FROM_TAB:\r\n // omit the measurementPoint from the tab whose ID matches the selectedTabID\r\n const tabs: ImeasurementPointListTab[] = action.measurementPointList.measurementPointTabs.map(\r\n (tab: ImeasurementPointListTab) => {\r\n if (tab.id === action.selectedTabID) {\r\n return {\r\n ...tab,\r\n measurementPoints: omit(\r\n tab.measurementPoints,\r\n action.measurementPointID\r\n )\r\n };\r\n }\r\n return tab;\r\n }\r\n );\r\n\r\n return {\r\n ...action.measurementPointList,\r\n measurementPointTabs: tabs\r\n };\r\n case types.MANAGE_MEASUREMENT_POINT_LIST_UPDATE:\r\n return action.measurementPointList;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialMeasurementPointList;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.MANAGE_MEASUREMENT_POINT_LISTS_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\nconst selectedTabID = (state = '', action: any): string => {\r\n switch (action.type) {\r\n case types.MANAGE_MEASUREMENT_POINT_SET_SELECTED_TAB:\r\n return action.selectedTabID;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return '';\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst selectedMeasurementPoint = (\r\n state: ImeasurementPoint = initialMeasurementPoint,\r\n action: any\r\n): ImeasurementPoint => {\r\n switch (action.type) {\r\n case types.MANAGE_MEASUREMENT_POINT_UPDATE:\r\n return action.measurementPoint;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialMeasurementPoint;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst manageMeasurementPointLists = combineReducers<\r\n ImanageMeasurementPointListsReducer\r\n>({\r\n measurementPointListsByID,\r\n measurementPointsByID,\r\n totalPages,\r\n selectedTabID,\r\n selectedMeasurementPointList,\r\n selectedMeasurementPoint,\r\n showEditMeasurementPointListModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_MEASUREMENT_POINT_LISTS'),\r\n showEditMeasurementPointModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_MEASUREMENT_POINT'),\r\n showEditMeasurementPointTabModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_MEASUREMENT_POINT_TAB'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(\r\n state,\r\n action,\r\n 'MANAGE_MEASUREMENT_POINT_LISTS'\r\n ),\r\n showEditMeasurementPointListTestProceduresModal: (state, action) =>\r\n modalToggleWithName(\r\n state,\r\n action,\r\n 'EDIT_MEASUREMENT_POINT_LIST_TEST_PROCEDURES'\r\n )\r\n});\r\n\r\nexport default manageMeasurementPointLists;\r\n","import { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n addGlobalMeasurementPointList,\r\n saveMeasurementPointToMeasurementPointList,\r\n setSelectedMeasurementPointList,\r\n setSelectedTabID,\r\n toggleEditMeasurementPointListModal,\r\n toggleEditMeasurementPointListTestProceduresModal,\r\n toggleEditMeasurementPointModal,\r\n toggleEditMeasurementPointTabModal,\r\n updateMeasurementPoint,\r\n updateMeasurementPointList,\r\n updateMeasurementPointListTab\r\n} from '../../actions/manageMeasurementPointListsActions';\r\n\r\nimport EditMeasurementPointListForm from './EditMeasurementPointListForm';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { connect } from 'react-redux';\r\nimport { initialMeasurementPointTab } from '../../reducers/initialState';\r\nimport { selectMeasurementPointListTabs } from '../../reducers/manageMeasurementPointListsReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n canEditGlobal: boolean;\r\n isCustomerView: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const listTabs = selectMeasurementPointListTabs(state);\r\n let selectedTab = listTabs.find(\r\n tab => tab.id === state.manageMeasurementPointLists.selectedTabID\r\n );\r\n selectedTab = selectedTab || listTabs[0] || initialMeasurementPointTab;\r\n\r\n let title = ownProps.t('EditMeasurementPointListModalTitle');\r\n if (\r\n state.manageMeasurementPointLists.selectedMeasurementPointList.forJob &&\r\n state.manageMeasurementPointLists.selectedMeasurementPointList\r\n .forJob === true\r\n ) {\r\n title = ownProps.t('EditJobnMeasurementPointListModalTitle');\r\n }\r\n\r\n return {\r\n title: title,\r\n className: 'measurements-edit',\r\n user: state.user,\r\n userManage: state.manageUser,\r\n loading: selectIsLoading(state),\r\n show:\r\n state.manageMeasurementPointLists.showEditMeasurementPointListModal,\r\n showEditFacilityModal: state.showEditFacilityModal,\r\n productInfo: state.productInfo,\r\n selectedTab,\r\n listTabs,\r\n forJob:\r\n state.manageMeasurementPointLists.selectedMeasurementPointList\r\n .forJob === true,\r\n selectedMeasurementPointList:\r\n state.manageMeasurementPointLists.selectedMeasurementPointList\r\n };\r\n};\r\n\r\nexport default withTranslation('manageMeasurementPointLists')(\r\n connect(mapStateToProps, {\r\n onHide: toggleEditMeasurementPointListModal,\r\n toggleModal: toggleEditMeasurementPointListModal,\r\n toggleEditMeasurementPointModal,\r\n addGlobalMeasurementPointList,\r\n updateMeasurementPointList,\r\n setSelectedTabID,\r\n updateMeasurementPoint,\r\n saveMeasurementPointToMeasurementPointList,\r\n toggleEditMeasurementPointTabModal,\r\n setSelectedMeasurementPointList,\r\n toggleEditMeasurementPointListTestProceduresModal,\r\n updateMeasurementPointListTab\r\n })(WithCommonModal(EditMeasurementPointListForm))\r\n);\r\n","/*\r\n * Edit Measurement Point List Form\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n GroupProps,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { ImeasurementPointListTab, ImeasurementPointList } from '../../models';\r\nimport { updateMeasurementPointListTab } from '../../actions/manageMeasurementPointListsActions';\r\nimport { TFunction } from 'i18next';\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\n\r\nconst fieldConfig = (\r\n selectedTab: ImeasurementPointListTab,\r\n disabled: boolean\r\n) => {\r\n return {\r\n controls: {\r\n name: {\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'measurementPointTabLabel',\r\n colWidth: 12,\r\n name: 'measurement-point-tab'\r\n },\r\n formState: { value: selectedTab.name, disabled: false }\r\n }\r\n } as {\r\n [key: string]: GroupProps;\r\n }\r\n };\r\n};\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n loading: boolean;\r\n colorButton: string;\r\n selectedTab: ImeasurementPointListTab;\r\n selectedMeasurementPointList: ImeasurementPointList;\r\n updateMeasurementPointListTab: typeof updateMeasurementPointListTab;\r\n t: TFunction;\r\n isCustomerView: boolean;\r\n}\r\n\r\nexport class EditMeasurementPointListTabForm extends React.Component<\r\n Iprops,\r\n {}\r\n> {\r\n private userForm: FormGroup | any;\r\n private fieldConfig: FieldConfig;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.fieldConfig = FormUtil.translateForm(\r\n fieldConfig(this.props.selectedTab, this.props.isCustomerView),\r\n this.props.t\r\n );\r\n }\r\n // componentDidUpdate(prevProps: Iprops) {\r\n\r\n // }\r\n\r\n // componentDidMount() {\r\n\r\n // }\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.userForm.status === 'INVALID') {\r\n this.userForm.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n // console.info(this.userForm.value);\r\n const { name } = this.userForm.value;\r\n this.props.updateMeasurementPointListTab({\r\n ...this.props.selectedTab,\r\n name\r\n });\r\n this.props.toggleModal();\r\n };\r\n handleDelete = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.props.updateMeasurementPointListTab({\r\n ...this.props.selectedTab,\r\n isDeleted: true\r\n });\r\n this.props.toggleModal();\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteMeasurementPointTabOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirmMPLT'), toastrConfirmOptions);\r\n };\r\n setForm = (form: AbstractControl) => {\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:delete')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * Edit Management Point List Tab modal\r\n */\r\n\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n toggleEditMeasurementPointTabModal,\r\n updateMeasurementPointListTab\r\n} from '../../actions/manageMeasurementPointListsActions';\r\n\r\nimport { EditMeasurementPointListTabForm } from './EditMeasurementPointListTabForm';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { connect } from 'react-redux';\r\nimport { initialMeasurementPointTab } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n isCustomerView: boolean;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedTab =\r\n state.manageMeasurementPointLists.selectedMeasurementPointList.measurementPointTabs.find(\r\n tab => tab.id === state.manageMeasurementPointLists.selectedTabID\r\n ) || initialMeasurementPointTab;\r\n return {\r\n title: ownProps.t('editTab'),\r\n className: 'edit-tab',\r\n secondModal: true,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show:\r\n state.manageMeasurementPointLists.showEditMeasurementPointTabModal,\r\n selectedMeasurementPointList:\r\n state.manageMeasurementPointLists.selectedMeasurementPointList,\r\n selectedTab\r\n };\r\n};\r\n\r\nexport const EditMeasurementPointListTabModal = withTranslation(\r\n 'manageMeasurementPointLists'\r\n)(\r\n connect(mapStateToProps, {\r\n onHide: toggleEditMeasurementPointTabModal,\r\n toggleModal: toggleEditMeasurementPointTabModal,\r\n updateMeasurementPointListTab\r\n })(WithCommonModal(EditMeasurementPointListTabForm))\r\n);\r\n","/*\r\n * Edit Measurement Point List Test Procedures Form\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n GroupProps,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { ImeasurementPointList } from '../../models';\r\nimport { TFunction } from 'i18next';\r\n\r\nconst fieldConfig = (\r\n measurementPointList: ImeasurementPointList,\r\n disabled: boolean\r\n) => {\r\n const { testProcedures } = measurementPointList;\r\n const initialContent = testProcedures ? testProcedures : '';\r\n return {\r\n controls: {\r\n testProcedures: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'manageMeasurementPointLists:procedureLabel',\r\n colWidth: 12,\r\n initialContent\r\n },\r\n formState: { value: initialContent, disabled }\r\n }\r\n } as {\r\n [key: string]: GroupProps;\r\n }\r\n };\r\n};\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n loading: boolean;\r\n colorButton: string;\r\n selectedMeasurementPointList: ImeasurementPointList;\r\n t: TFunction;\r\n updateMeasurementPointList: (\r\n mpl: ImeasurementPointList,\r\n persistToAPI: boolean,\r\n isCustomer: boolean\r\n ) => Promise;\r\n isCustomerView: boolean;\r\n}\r\n\r\nexport class EditMeasurementPointListTestProceduresForm extends React.Component<\r\n Iprops,\r\n {}\r\n> {\r\n private userForm: FormGroup | any;\r\n private fieldConfig: FieldConfig;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.fieldConfig = FormUtil.translateForm(\r\n fieldConfig(\r\n this.props.selectedMeasurementPointList,\r\n this.props.isCustomerView\r\n ),\r\n this.props.t\r\n );\r\n }\r\n // componentDidUpdate(prevProps: Iprops) {\r\n\r\n // }\r\n\r\n // componentDidMount() {\r\n\r\n // }\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.userForm.status === 'INVALID') {\r\n this.userForm.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n console.info(this.userForm.value);\r\n const { testProcedures } = this.userForm.value;\r\n this.props\r\n .updateMeasurementPointList(\r\n {\r\n ...this.props.selectedMeasurementPointList,\r\n testProcedures\r\n },\r\n false,\r\n false\r\n )\r\n .catch((error: any) => console.error(error));\r\n this.props.toggleModal();\r\n };\r\n setForm = (form: AbstractControl) => {\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * Edit Management Point List Test Procedures Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n updateMeasurementPointList,\r\n toggleEditMeasurementPointListTestProceduresModal\r\n} from '../../actions/manageMeasurementPointListsActions';\r\nimport { initialMeasurementPointTab } from '../../reducers/initialState';\r\nimport { EditMeasurementPointListTestProceduresForm } from './EditMeasurementPointListTestProceduresForm';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedTab =\r\n state.manageMeasurementPointLists.selectedMeasurementPointList.measurementPointTabs.find(\r\n tab => tab.id === state.manageMeasurementPointLists.selectedTabID\r\n ) || initialMeasurementPointTab;\r\n return {\r\n title: ownProps.t('editTestProcedures'),\r\n className: 'edit-tab',\r\n secondModal: true,\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show:\r\n state.manageMeasurementPointLists\r\n .showEditMeasurementPointListTestProceduresModal,\r\n selectedMeasurementPointList:\r\n state.manageMeasurementPointLists.selectedMeasurementPointList,\r\n selectedTab\r\n };\r\n};\r\n\r\nexport const EditMeasurementPointListTestProceduresModal = withTranslation(\r\n 'manageMeasurementPointLists'\r\n)(\r\n connect(mapStateToProps, {\r\n onHide: toggleEditMeasurementPointListTestProceduresModal,\r\n toggleModal: toggleEditMeasurementPointListTestProceduresModal,\r\n updateMeasurementPointList\r\n })(WithCommonModal(EditMeasurementPointListTestProceduresForm))\r\n);\r\n","import * as React from 'react';\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n ControlLabel,\r\n Button,\r\n InputGroup,\r\n ListGroup,\r\n ListGroupItem,\r\n Col\r\n} from 'react-bootstrap';\r\nimport { map } from 'lodash';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { ImeasurementPointSelectOption } from '../../models';\r\nimport { FormUtil } from '../common/FormUtil';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n meta: any;\r\n handler: any;\r\n pristine: boolean;\r\n errors: any;\r\n submitted: boolean;\r\n}\r\n\r\ninterface Istate {\r\n value: string;\r\n}\r\n\r\nclass InputList extends React.Component {\r\n constructor(props: any) {\r\n super(props);\r\n this.state = {\r\n value: ''\r\n };\r\n }\r\n handleChange = (evt: any) => {\r\n this.setState({ value: evt.target.value });\r\n };\r\n addOption = () => {\r\n const newOption: ImeasurementPointSelectOption = {\r\n id: uuidv4(),\r\n label: this.state.value,\r\n value: this.state.value,\r\n isDeleted: false,\r\n isDefault: this.props.handler().value ? false : true // if it is the first one make it the default\r\n };\r\n if (this.props.handler().value) {\r\n this.props\r\n .handler()\r\n .onChange([...this.props.handler().value, newOption]);\r\n } else {\r\n this.props.handler().onChange([newOption]);\r\n }\r\n this.setState({ value: '' });\r\n };\r\n deleteOption = (mpo: ImeasurementPointSelectOption) => {\r\n const newSelectOptions = this.props\r\n .handler()\r\n .value.map((opt: ImeasurementPointSelectOption) => {\r\n if (opt.id === mpo.id) {\r\n return { ...opt, isDefault: false, isDeleted: true };\r\n }\r\n return opt;\r\n });\r\n this.props.handler().onChange(newSelectOptions);\r\n };\r\n makeDefault = (mpo: ImeasurementPointSelectOption) => {\r\n const newOptions = this.props\r\n .handler()\r\n .value.map((opt: ImeasurementPointSelectOption) => {\r\n if (opt.id === mpo.id) {\r\n return { ...opt, isDefault: true };\r\n } else {\r\n return { ...opt, isDefault: false };\r\n }\r\n });\r\n this.props.handler().onChange(newOptions);\r\n };\r\n render() {\r\n const { pristine, errors, submitted } = this.props;\r\n return (\r\n \r\n \r\n {this.props.meta.label}\r\n \r\n \r\n \r\n \r\n {this.props.meta.buttonLabel}\r\n \r\n \r\n \r\n \r\n {this.props.handler().value.length > 0 &&\r\n map(\r\n this.props.handler().value,\r\n (\r\n mp: ImeasurementPointSelectOption,\r\n index: number\r\n ) => {\r\n if (mp.isDeleted === true) {\r\n return '';\r\n }\r\n return (\r\n \r\n \r\n {\r\n this.deleteOption(mp);\r\n }}\r\n disabled={\r\n this.props.handler()\r\n .disabled\r\n }\r\n >\r\n \r\n \r\n \r\n {\r\n if (\r\n this.props.handler()\r\n .disabled\r\n ) {\r\n return;\r\n }\r\n this.makeDefault(mp);\r\n }}\r\n disabled={\r\n this.props.handler()\r\n .disabled\r\n }\r\n >\r\n {mp.isDefault === true && (\r\n
    \r\n {mp.label} (Default)\r\n
    \r\n )}\r\n {mp.isDefault === false && (\r\n
    {mp.label}
    \r\n )}\r\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 InputList;\r\n","/*\r\n * EditMeasurementPointForm\r\n * Edit measurement point\r\n */\r\n\r\nimport { find, map } from 'lodash';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport * as React from 'react';\r\nimport InputList from './InputList';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport {\r\n deleteMeasurementPoint,\r\n saveMeasurementPointToMeasurementPointList,\r\n toggleEditMeasurementPointListModal,\r\n updateMeasurementPoint\r\n} from '../../actions/manageMeasurementPointListsActions';\r\nimport { caStandards, constants, usStandards } from '../../constants/constants';\r\nimport {\r\n IdefaultReport,\r\n // ImeasurementPointSelectOption\r\n ImeasurementPoint,\r\n ImeasurementPointList,\r\n ImeasurementPointListTab,\r\n ImeasurementPointSelectOption,\r\n Ioption,\r\n IoptionNumberValue,\r\n IsmartlinkDataPoint\r\n} from '../../models';\r\nimport {\r\n jobDefaultTypeEnum,\r\n measurementPointListTypeEnum,\r\n measurementSystemEnum,\r\n reportTypeEnum\r\n} from '../../models-enums';\r\nimport { FormUtil } from '../common/FormUtil';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface IformSate {\r\n value: any;\r\n disabled: boolean;\r\n}\r\n\r\nconst InputListAbstract = (props: AbstractControl) => ;\r\n\r\nconst trueFalseOptions = [\r\n { label: 'Yes', value: 1 },\r\n { label: 'No', value: 0 }\r\n];\r\n\r\nconst getTrueFalseOption = (value: boolean | null | number) => {\r\n if (value === true || value === 1) {\r\n return { label: 'Yes', value: 1 };\r\n } else if (value === false || value === 0) {\r\n return { label: 'No', value: 0 };\r\n } else {\r\n return null;\r\n }\r\n};\r\n\r\nconst getSummaryPageDefaultText = (\r\n selectedMeasurementPointList: ImeasurementPointList,\r\n reportDefaults: { [key: string]: IdefaultReport }\r\n) => {\r\n let coverLetterDefault: string | null = null;\r\n\r\n // Annual Inspection\r\n if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.annual\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.annualInspection\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // Verification\r\n else if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.verification\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.verification\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // Touchpoint (repair, maintenance, warranty)\r\n else if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.touchpoint\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.visit\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // AGS Rebalancing\r\n else if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.agsRebalancing\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.agsRebalancing\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // Audit\r\n else if (\r\n selectedMeasurementPointList.type === measurementPointListTypeEnum.audit\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.audit\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // Commissioning\r\n else if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.Commissioning\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.commissioning\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n // Daily Rounds\r\n else if (\r\n selectedMeasurementPointList.type ===\r\n measurementPointListTypeEnum.dailyRounds\r\n ) {\r\n const coverLetter = Object.values(reportDefaults).find(\r\n (report: IdefaultReport) =>\r\n report.reportType === reportTypeEnum.dailyRounds\r\n );\r\n if (coverLetter) {\r\n coverLetterDefault = coverLetter.defaultCoverLetter;\r\n }\r\n }\r\n\r\n return coverLetterDefault;\r\n};\r\n\r\n/*\r\n * The default or main fields for a Measurement Point\r\n */\r\nconst buildMainMeasurementPointControls = (\r\n measurementPoint: ImeasurementPoint,\r\n disabled: boolean,\r\n forJob: boolean | undefined,\r\n isDailyRounds: boolean,\r\n dailyRoundOptions: Ioption[],\r\n reportDefaults: { [key: string]: IdefaultReport },\r\n selectedMeasurementPointList: ImeasurementPointList\r\n): { [key: string]: GroupProps } => {\r\n const {\r\n helpText = '',\r\n type,\r\n guideText = null,\r\n allowNotes = true,\r\n label,\r\n showInReport = true,\r\n //defaultText = null,\r\n dedicatedReportPage = false,\r\n smartlinkID = undefined,\r\n measurementSystem = undefined,\r\n generateLead = true\r\n } = measurementPoint;\r\n\r\n let { defaultText } = measurementPoint;\r\n\r\n const selectedType = type\r\n ? { label: constants.measurementPointTypeEnum[type], value: type }\r\n : null;\r\n // Long Text\r\n if (\r\n selectedType?.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_LONGTEXT\r\n ) {\r\n return {\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.measurementPointTypeOptions,\r\n label: 'type',\r\n colWidth: 12,\r\n placeholder: 'typePlaceholder',\r\n isClearable: false\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: { value: selectedType, disabled }\r\n },\r\n label: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.maxLength(150)\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'measurementPointText',\r\n colWidth: 12,\r\n type: 'text'\r\n },\r\n formState: { value: label, disabled }\r\n },\r\n dedicatedReportPage: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'dedicatedReportPage',\r\n colWidth: 12\r\n },\r\n formState: { value: dedicatedReportPage }\r\n },\r\n defaultText: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'measurementPointDefaultText',\r\n colWidth: 12,\r\n type: 'text',\r\n initialContent: defaultText ? defaultText : '',\r\n charLimit: 1000,\r\n toolbarConfig: {\r\n options: ['link', 'inline', 'list', 'fontSize'],\r\n inline: { options: ['bold', 'italic', 'underline'] },\r\n list: { options: ['unordered', 'ordered'] },\r\n fontSize: {\r\n options: [\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n 12,\r\n 14,\r\n 16,\r\n 18,\r\n 24,\r\n 30,\r\n 36,\r\n 48,\r\n 60,\r\n 72,\r\n 96\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n showInReport: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'showInReport',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(showInReport), disabled }\r\n },\r\n\r\n helpText: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'helpText',\r\n colWidth: 12,\r\n type: 'text',\r\n initialContent: helpText ? helpText : ''\r\n },\r\n formState: { value: helpText, disabled }\r\n }\r\n };\r\n }\r\n\r\n if (\r\n selectedType?.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_SUMMARYPAGE\r\n ) {\r\n // If we're creating a new MP, default the defaultText to the corresponding Report Default Cover Letter\r\n if (\r\n defaultText === '' ||\r\n defaultText === undefined ||\r\n defaultText === null\r\n ) {\r\n const newDefaultText = getSummaryPageDefaultText(\r\n selectedMeasurementPointList,\r\n reportDefaults\r\n );\r\n\r\n if (newDefaultText !== null) {\r\n defaultText = newDefaultText;\r\n }\r\n }\r\n\r\n return {\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.measurementPointTypeOptions, // if Summary page needs to be limited to only Job Data, might neet two different enums\r\n label: 'type',\r\n colWidth: 12,\r\n placeholder: 'typePlaceholder',\r\n isClearable: false\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: { value: selectedType, disabled }\r\n },\r\n label: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.maxLength(150)\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'measurementPointText',\r\n colWidth: 12,\r\n type: 'text'\r\n },\r\n formState: { value: label, disabled }\r\n },\r\n defaultText: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'measurementPointDefaultText',\r\n colWidth: 12,\r\n type: 'text',\r\n initialContent: defaultText ? defaultText : '',\r\n charLimit: 1000,\r\n toolbarConfig: {\r\n options: ['link', 'inline', 'list', 'fontSize'],\r\n inline: { options: ['bold', 'italic', 'underline'] },\r\n list: { options: ['unordered', 'ordered'] },\r\n fontSize: {\r\n options: [\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n 12,\r\n 14,\r\n 16,\r\n 18,\r\n 24,\r\n 30,\r\n 36,\r\n 48,\r\n 60,\r\n 72,\r\n 96\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n showInReport: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'showInReport',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(showInReport), disabled }\r\n }\r\n };\r\n }\r\n\r\n // Field config to configure form\r\n let commonControls = {\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.measurementPointTypeOptions,\r\n label: 'type',\r\n colWidth: 12,\r\n placeholder: 'typePlaceholder',\r\n isClearable: false\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: { value: selectedType, disabled }\r\n },\r\n label: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.maxLength(150)\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'measurementPointText',\r\n colWidth: 12,\r\n type: 'text'\r\n },\r\n formState: { value: label, disabled }\r\n },\r\n generateLead: {\r\n render:\r\n selectedType?.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_PASSFAIL\r\n ? FormUtil.Toggle\r\n : () => <>,\r\n meta: {\r\n label: 'generateLead',\r\n colWidth: 12\r\n },\r\n formState: { value: generateLead, disabled }\r\n },\r\n guideText: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'guideText',\r\n colWidth: 12,\r\n type: 'text'\r\n },\r\n formState: { value: guideText, disabled }\r\n },\r\n showInReport: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'showInReport',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(showInReport), disabled }\r\n },\r\n\r\n helpText: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'helpText',\r\n colWidth: 12,\r\n type: 'text',\r\n initialContent: helpText ? helpText : ''\r\n },\r\n formState: { value: helpText, disabled }\r\n }\r\n };\r\n\r\n if (isDailyRounds) {\r\n let smartLinkIdOption = undefined;\r\n if (smartlinkID !== undefined) {\r\n smartLinkIdOption = dailyRoundOptions.find(\r\n (option: Ioption) => option.value === smartlinkID\r\n );\r\n }\r\n\r\n let measurementSystemOption = undefined;\r\n if (measurementSystem !== undefined) {\r\n measurementSystemOption = {\r\n label: measurementSystemEnum[measurementSystem],\r\n value: measurementSystem\r\n };\r\n }\r\n\r\n return {\r\n ...commonControls,\r\n smartlinkID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'smartlinkId',\r\n colWidth: 12,\r\n options: dailyRoundOptions,\r\n placeholder: 'typePlaceholder',\r\n isClearable: false\r\n },\r\n formState: { value: smartLinkIdOption, disabled }\r\n },\r\n measurementSystem: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'measurementSystem',\r\n colWidth: 12,\r\n options: FormUtil.convertEnumToOptions(\r\n measurementSystemEnum\r\n ),\r\n placeholder: 'typePlaceholder',\r\n isClearable: false\r\n },\r\n formState: { value: measurementSystemOption, disabled }\r\n }\r\n };\r\n }\r\n\r\n if (!forJob) {\r\n return {\r\n ...commonControls,\r\n allowNotes: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'allowNotes',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(allowNotes), disabled }\r\n }\r\n };\r\n }\r\n return commonControls;\r\n};\r\n\r\nconst buildPassFailControl = (formState: IformSate) => {\r\n return {\r\n passFailDefault: {\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'passFailDefault',\r\n colWidth: 12,\r\n options: constants.measurementPointPassFailOptions,\r\n isClearable: false\r\n },\r\n formState\r\n } as GroupProps\r\n };\r\n};\r\n\r\nconst buildNumericControl = (\r\n selectedNumericMinValue: number | null,\r\n selectedNumericMaxValue: number | null,\r\n selectedNumericAllowDecimals: boolean | null,\r\n selectedjobDefaultTypeOption: IoptionNumberValue | null,\r\n disabled: boolean,\r\n standard: string\r\n) => {\r\n let constructedControls = {\r\n numericMinValue: {\r\n options: {},\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'numericMinValue',\r\n colWidth: 12,\r\n type: 'number',\r\n name: 'numericMinValue'\r\n },\r\n formState: { value: selectedNumericMinValue, disabled }\r\n },\r\n numericMaxValue: {\r\n options: {},\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'numericMaxValue',\r\n colWidth: 12,\r\n type: 'number',\r\n name: 'numericMaxValue'\r\n },\r\n formState: { value: selectedNumericMaxValue, disabled }\r\n },\r\n numericAllowDecimals: {\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'numericAllowDecimals',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: {\r\n value: getTrueFalseOption(selectedNumericAllowDecimals),\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n const stUpperCase = standard.toUpperCase();\r\n if (\r\n usStandards.includes(stUpperCase) ||\r\n caStandards.includes(stUpperCase)\r\n ) {\r\n constructedControls = {\r\n ...constructedControls,\r\n jobDefaultType: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'jobDefaultType',\r\n colWidth: 12,\r\n options: FormUtil.convertEnumToOptions(jobDefaultTypeEnum),\r\n shouldTranslate: true,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedjobDefaultTypeOption,\r\n disabled\r\n }\r\n }\r\n };\r\n }\r\n\r\n return constructedControls;\r\n};\r\n\r\nconst buildCommonNonPassFailControls = (\r\n measurementPoint: ImeasurementPoint,\r\n disabled: boolean,\r\n forJob: boolean | undefined\r\n): { [key: string]: GroupProps } => {\r\n const {\r\n selectRememberBetweenDevice = null,\r\n selectRememberBetweenInspection = null,\r\n isRequired = true\r\n } = measurementPoint;\r\n\r\n if (forJob && forJob === true) {\r\n return {\r\n isRequired: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'isRequired',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(isRequired), disabled }\r\n }\r\n };\r\n }\r\n\r\n return {\r\n selectRememberBetweenDevice: {\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'selectRememberBetweenDevice',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: {\r\n value: getTrueFalseOption(selectRememberBetweenDevice),\r\n disabled\r\n }\r\n },\r\n selectRememberBetweenInspection: {\r\n options: { validators: [FormUtil.validators.requiredWithTrim] },\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'selectRememberBetweenInspection',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: {\r\n value: getTrueFalseOption(selectRememberBetweenInspection),\r\n disabled\r\n }\r\n },\r\n isRequired: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'isRequired',\r\n colWidth: 12,\r\n options: trueFalseOptions,\r\n isClearable: false\r\n },\r\n formState: { value: getTrueFalseOption(isRequired), disabled }\r\n }\r\n };\r\n};\r\n\r\nconst buildGroupFieldConfig = (formState: IformSate) => {\r\n return {\r\n controls: {\r\n label: {\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n Validators.maxLength(150)\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'groupLabel',\r\n colWidth: 12,\r\n type: 'text',\r\n name: 'label'\r\n },\r\n formState\r\n }\r\n } as { [key: string]: GroupProps }\r\n };\r\n};\r\n\r\ninterface Iprops extends React.Props {\r\n selectedMeasurementPointList: ImeasurementPointList;\r\n selectedMeasurementPoint: ImeasurementPoint;\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n userCountryCode: string;\r\n toggleEditMeasurementPointListModal: typeof toggleEditMeasurementPointListModal;\r\n toggleModal: () => void;\r\n saveMeasurementPointToMeasurementPointList: typeof saveMeasurementPointToMeasurementPointList;\r\n selectedTab: ImeasurementPointListTab;\r\n updateMeasurementPoint: typeof updateMeasurementPoint;\r\n canEditGlobal: boolean;\r\n deleteMeasurementPoint: typeof deleteMeasurementPoint;\r\n isCustomerView: boolean;\r\n forJob: boolean | undefined;\r\n isDailyRounds: boolean;\r\n smartlinkDataPoints: IsmartlinkDataPoint[];\r\n reportDefaults: { [key: string]: IdefaultReport };\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\nclass EditMeasurementPointForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n private persistTimeout: any;\r\n\r\n dailyRoundOptions: Ioption[] = this.props.smartlinkDataPoints.map(\r\n (dp: IsmartlinkDataPoint) => {\r\n return {\r\n label: `${dp.number} - ${dp.description}`,\r\n value: `${dp.id}`\r\n } as Ioption;\r\n }\r\n );\r\n\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: FormUtil.translateForm(\r\n this.getFormConfig(this.props.selectedMeasurementPoint),\r\n this.props.t\r\n )\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (\r\n !this.props.selectedMeasurementPointList ||\r\n !this.props.selectedMeasurementPoint\r\n ) {\r\n console.error('missing measurementPoint List or MeasurementPoint');\r\n this.props.toggleModal();\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n /*\r\n * Subscribe to only some of the changes\r\n * \"type\" so that we can update the fieldConfig according to the type of measurement point\r\n * do not persist values that depend on the type of measurement point\r\n */\r\n\r\n subscribeToValueChanges = () => {\r\n let controls = [\r\n 'type',\r\n 'label',\r\n 'guideText',\r\n 'allowNotes',\r\n 'helpText',\r\n 'defaultText'\r\n ];\r\n if (\r\n this.props.selectedMeasurementPoint.type ===\r\n constants.measurementPointTypes.GROUP\r\n ) {\r\n controls = [];\r\n }\r\n controls.forEach((key: string) => {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n ?.valueChanges.subscribe((value: Ioption | null) => {\r\n this.handleValueChange(key, value);\r\n });\r\n });\r\n };\r\n\r\n handleValueChange = (key: string, value: null | Ioption) => {\r\n switch (key) {\r\n case 'type':\r\n if (value && value.value) {\r\n const controls = this.getFormConfig({\r\n ...this.props.selectedMeasurementPoint,\r\n type: parseInt(value.value, 10)\r\n });\r\n this.setState({\r\n fieldConfig: FormUtil.translateForm(\r\n controls,\r\n this.props.t\r\n )\r\n });\r\n }\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n clearTimeout(this.persistTimeout);\r\n this.persistTimeout = setTimeout(() => {\r\n const newValue =\r\n value !== null && typeof value === 'object'\r\n ? value.value\r\n : value;\r\n this.props.updateMeasurementPoint(\r\n {\r\n ...this.props.selectedMeasurementPoint,\r\n [key]: newValue\r\n },\r\n this.props.selectedTab.id\r\n );\r\n }, 200);\r\n break;\r\n }\r\n };\r\n /*\r\n * update which form controls based on the type of measurement point\r\n */\r\n getFormConfig = (measurementPoint: ImeasurementPoint) => {\r\n const {\r\n type,\r\n label,\r\n passFailDefault,\r\n numericMinValue = null,\r\n numericMaxValue = null,\r\n numericAllowDecimals = null,\r\n jobDefaultType\r\n } = measurementPoint;\r\n const { forJob, isDailyRounds } = this.props;\r\n\r\n let selectedPassFailDefault = null;\r\n if (passFailDefault) {\r\n selectedPassFailDefault =\r\n find(\r\n constants.measurementPointPassFailOptions,\r\n (tOpt: any) => tOpt.value === passFailDefault\r\n ) || null;\r\n }\r\n const mpTypes = constants.measurementPointTypes;\r\n const disabled = false;\r\n\r\n if (type === mpTypes.GROUP) {\r\n return buildGroupFieldConfig({ value: label, disabled });\r\n } else {\r\n let extraControls = {};\r\n if (type === mpTypes.MEASUREMENT_POINT_PASSFAIL) {\r\n extraControls = buildPassFailControl({\r\n value: selectedPassFailDefault,\r\n disabled\r\n });\r\n } else if (type === mpTypes.MEASUREMENT_POINT_NUMERIC) {\r\n const selectedJobDefaultTypeOption =\r\n jobDefaultType !== undefined\r\n ? {\r\n value: jobDefaultType,\r\n label: this.props.t(\r\n jobDefaultTypeEnum[jobDefaultType]\r\n )\r\n }\r\n : null;\r\n extraControls = buildNumericControl(\r\n numericMinValue,\r\n numericMaxValue,\r\n numericAllowDecimals,\r\n selectedJobDefaultTypeOption,\r\n disabled,\r\n this.props.selectedMeasurementPointList.standardID\r\n );\r\n } else if (type === mpTypes.MEASUREMENT_POINT_SELECT) {\r\n extraControls = this.selectFieldConfig(\r\n measurementPoint,\r\n disabled\r\n );\r\n }\r\n if (type !== mpTypes.MEASUREMENT_POINT_PASSFAIL) {\r\n // if this is not a pass fail then add the isRequired select\r\n extraControls = {\r\n ...extraControls,\r\n ...buildCommonNonPassFailControls(\r\n measurementPoint,\r\n disabled,\r\n forJob\r\n )\r\n };\r\n }\r\n\r\n const mainControls = buildMainMeasurementPointControls(\r\n measurementPoint,\r\n disabled,\r\n forJob,\r\n isDailyRounds,\r\n this.dailyRoundOptions,\r\n this.props.reportDefaults,\r\n this.props.selectedMeasurementPointList\r\n );\r\n const fieldConfig = {\r\n controls: { ...mainControls, ...extraControls }\r\n };\r\n return fieldConfig as FieldConfig;\r\n }\r\n };\r\n\r\n selectFieldConfig = (\r\n measurementPoint: ImeasurementPoint,\r\n disabled: boolean\r\n ) => {\r\n const { selectOptions, selectDefaultOptionID = '' } = measurementPoint;\r\n let selectOptionsDefault = null;\r\n if (selectOptions) {\r\n selectOptionsDefault = map(selectOptions, mpo => {\r\n return {\r\n ...mpo,\r\n isDefault: selectDefaultOptionID === mpo.id,\r\n isDeleted:\r\n typeof mpo.isDeleted !== 'undefined'\r\n ? mpo.isDeleted\r\n : false\r\n };\r\n });\r\n }\r\n\r\n return {\r\n selectOptions: {\r\n options: {\r\n validators: [\r\n ({ value }: AbstractControl) => {\r\n if (\r\n value &&\r\n value.filter(\r\n (val: ImeasurementPointSelectOption) =>\r\n val.isDeleted !== true\r\n ).length\r\n ) {\r\n return null;\r\n } else {\r\n return {\r\n noValidSelectOptions: {\r\n message:\r\n 'Please add at least one select option.'\r\n }\r\n };\r\n }\r\n }\r\n ]\r\n },\r\n render: InputListAbstract,\r\n meta: {\r\n label: 'selectOptions',\r\n buttonLabel: 'Add Option',\r\n colWidth: 12,\r\n placeholder: 'selectOptionsPlaceholder',\r\n colorButton: 'info',\r\n selectOptions: selectOptionsDefault\r\n },\r\n formState: { value: selectOptionsDefault, disabled }\r\n }\r\n } as { [key: string]: GroupProps };\r\n };\r\n\r\n formatSummaryText = (text: string) => {\r\n // Wrap each \"variable\" in a span with a style of blue text\r\n const defaultText = text.replace(\r\n /\\{\\{([^}]+)\\}\\}/g,\r\n (match: any, value: any) => {\r\n const placeholderSpan = `${match}`;\r\n const regex = new RegExp(\r\n `]*?style=\"color:rgb(41, 105, 176)\">${match}`,\r\n 'g'\r\n );\r\n\r\n // Check if the placeholder already has the specified style applied\r\n if (!text.match(regex)) {\r\n return placeholderSpan;\r\n } else {\r\n return match; // Placeholder already has the style, return original content\r\n }\r\n }\r\n );\r\n\r\n return defaultText;\r\n };\r\n\r\n handleSubmit = (evt: React.MouseEvent) => {\r\n evt.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n const {\r\n allowNotes,\r\n type,\r\n label,\r\n passFailDefault,\r\n numericAllowDecimals,\r\n selectOptions,\r\n selectRememberBetweenDevice,\r\n selectRememberBetweenInspection,\r\n guideText,\r\n helpText,\r\n numericMinValue,\r\n numericMaxValue,\r\n isRequired,\r\n showInReport,\r\n jobDefaultType,\r\n dedicatedReportPage,\r\n smartlinkID,\r\n measurementSystem,\r\n generateLead\r\n } = this.formGroup.value;\r\n\r\n let { defaultText } = this.formGroup.value;\r\n\r\n // If it's Summary Page, and we have default text\r\n if (\r\n type?.value &&\r\n type.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_SUMMARYPAGE &&\r\n defaultText\r\n ) {\r\n defaultText = this.formatSummaryText(defaultText);\r\n }\r\n // It's a summary page, but default text isn't showing up, check if there's a default text in the field config\r\n // This can happen if they are creating a new Summary page, and did not alter the default text\r\n else if (\r\n type?.value &&\r\n type.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_SUMMARYPAGE\r\n ) {\r\n const defaultTextIndex = Object.keys(\r\n this.state.fieldConfig.controls\r\n ).indexOf('defaultText');\r\n if (defaultTextIndex !== -1) {\r\n const defaultTextValue: any = Object.values(\r\n this.state.fieldConfig.controls\r\n )[defaultTextIndex];\r\n if (\r\n defaultTextValue &&\r\n defaultTextValue.meta &&\r\n defaultTextValue.meta.initialContent\r\n ) {\r\n defaultText = defaultTextValue.meta.initialContent;\r\n defaultText = this.formatSummaryText(defaultText);\r\n }\r\n }\r\n }\r\n\r\n let selectDefaultOptionID = '';\r\n if (selectOptions && selectOptions.length) {\r\n const defaultOption = selectOptions.find(\r\n (mpo: ImeasurementPointSelectOption) => {\r\n return mpo.isDefault === true;\r\n }\r\n );\r\n if (defaultOption) {\r\n selectDefaultOptionID = defaultOption.id;\r\n }\r\n }\r\n\r\n // Notes are not allowed for long text or standard text\r\n let allowNotesValue = allowNotes ? allowNotes.value : true;\r\n if (\r\n this.props.forJob ||\r\n type?.value ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_LONGTEXT\r\n ) {\r\n allowNotesValue = false;\r\n }\r\n let dedicatedReportPageFinal;\r\n // toggle has some weird behavior, sometimes an object, sometimes a boolean\r\n if (typeof dedicatedReportPage === 'boolean') {\r\n dedicatedReportPageFinal = dedicatedReportPage;\r\n } else {\r\n dedicatedReportPageFinal =\r\n dedicatedReportPage?.value !== undefined\r\n ? dedicatedReportPage?.value\r\n : false;\r\n }\r\n\r\n const selectedType = type\r\n ? type.value\r\n : this.props.selectedMeasurementPoint.type;\r\n\r\n const cleanedIsRequired =\r\n isRequired && isRequired.value === 1 ? true : false;\r\n const cleanedShowInReport =\r\n showInReport && showInReport.value === 1 ? true : false;\r\n const cleanedAllowNotes =\r\n allowNotesValue && allowNotesValue === 1 ? true : false;\r\n\r\n const newQ: ImeasurementPoint = {\r\n ...this.props.selectedMeasurementPoint, // id, order, isDeleted, customerID\r\n selectRememberBetweenDevice: selectRememberBetweenDevice\r\n ? !!selectRememberBetweenDevice.value\r\n : undefined,\r\n selectRememberBetweenInspection: selectRememberBetweenInspection\r\n ? !!selectRememberBetweenInspection.value\r\n : undefined,\r\n selectOptions:\r\n selectOptions && selectOptions.length ? selectOptions : [],\r\n numericAllowDecimals: numericAllowDecimals\r\n ? numericAllowDecimals.value\r\n : false,\r\n passFailDefault: passFailDefault\r\n ? passFailDefault.value\r\n : undefined,\r\n allowNotes: cleanedAllowNotes,\r\n type: selectedType,\r\n isRequired: cleanedIsRequired,\r\n showInReport: cleanedShowInReport,\r\n selectDefaultOptionID:\r\n selectDefaultOptionID !== undefined &&\r\n selectDefaultOptionID !== ''\r\n ? selectDefaultOptionID\r\n : undefined,\r\n label,\r\n guideText,\r\n helpText,\r\n numericMinValue,\r\n numericMaxValue,\r\n defaultText,\r\n dedicatedReportPage: dedicatedReportPageFinal,\r\n id: this.props.selectedMeasurementPoint.id || uuidv4(),\r\n jobDefaultType: jobDefaultType ? jobDefaultType.value : undefined,\r\n smartlinkID: smartlinkID ? smartlinkID.value : undefined,\r\n measurementSystem: measurementSystem\r\n ? measurementSystem.value\r\n : undefined,\r\n generateLead:\r\n selectedType ===\r\n constants.measurementPointTypes.MEASUREMENT_POINT_PASSFAIL\r\n ? generateLead\r\n : undefined\r\n };\r\n\r\n this.props.saveMeasurementPointToMeasurementPointList(\r\n this.props.selectedMeasurementPointList.id,\r\n this.props.selectedTab.id,\r\n newQ\r\n );\r\n this.props.toggleModal();\r\n };\r\n\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n this.subscribeToValueChanges();\r\n };\r\n\r\n deleteMP = () => {\r\n this.props.deleteMeasurementPoint(\r\n this.props.selectedMeasurementPoint.id,\r\n this.props.selectedMeasurementPointList.id,\r\n this.props.selectedTab.id,\r\n this.props.t\r\n );\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form ${this.props.colorButton}`;\r\n const deleteButtonStyle =\r\n this.props.selectedMeasurementPoint.id.length === 0\r\n ? { marginRight: '15px', display: 'none' }\r\n : { marginRight: '15px' };\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n \r\n {t('cancel')}\r\n \r\n \r\n {t('common:delete')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default EditMeasurementPointForm;\r\n","import { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n deleteMeasurementPoint,\r\n saveMeasurementPointToMeasurementPointList,\r\n toggleEditMeasurementPointListModal,\r\n toggleEditMeasurementPointModal,\r\n updateMeasurementPoint\r\n} from '../../actions/manageMeasurementPointListsActions';\r\n\r\nimport EditMeasurementPointForm from './EditMeasurementPointForm';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialMeasurementPointTab } from '../../reducers/initialState';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { IsmartlinkDataPoint } from '../../models';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n canEditGlobal: boolean;\r\n isCustomerView: boolean;\r\n smartlinkDataPoints: IsmartlinkDataPoint[];\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const {\r\n selectedMeasurementPoint,\r\n selectedMeasurementPointList\r\n } = state.manageMeasurementPointLists;\r\n const getTitle = () => {\r\n if (\r\n selectedMeasurementPoint.type ===\r\n constants.measurementPointTypes.GROUP\r\n ) {\r\n return ownProps.t('GroupModalTitle');\r\n } else {\r\n return ownProps.t('measurementPointModalTitle');\r\n }\r\n };\r\n\r\n const selectedTab =\r\n state.manageMeasurementPointLists.selectedMeasurementPointList.measurementPointTabs.find(\r\n tab => tab.id === state.manageMeasurementPointLists.selectedTabID\r\n ) || initialMeasurementPointTab;\r\n\r\n const isDailyRounds =\r\n state.manageMeasurementPointLists.selectedMeasurementPointList.type ===\r\n constants.measurementPointListTypeEnum.dailyRounds\r\n ? true\r\n : false;\r\n return {\r\n title: getTitle(),\r\n className: 'measurements-edit',\r\n secondModal: true,\r\n user: state.user,\r\n userCountryCode: state.user.countryID,\r\n loading: selectIsLoading(state),\r\n showEditMeasurementPointListModal:\r\n state.manageMeasurementPointLists.showEditMeasurementPointListModal,\r\n show: state.manageMeasurementPointLists.showEditMeasurementPointModal,\r\n selectedTab,\r\n selectedMeasurementPointList:\r\n state.manageMeasurementPointLists.selectedMeasurementPointList,\r\n selectedMeasurementPoint,\r\n forJob: selectedMeasurementPointList.forJob,\r\n isDailyRounds,\r\n smartlinkDataPoints: ownProps.smartlinkDataPoints,\r\n reportDefaults: state.manageReport.defaultReportsByID\r\n };\r\n};\r\n\r\nexport default withTranslation('manageMeasurementPointLists')(\r\n connect(mapStateToProps, {\r\n onHide: toggleEditMeasurementPointModal,\r\n toggleEditMeasurementPointListModal,\r\n toggleModal: toggleEditMeasurementPointModal,\r\n saveMeasurementPointToMeasurementPointList,\r\n updateMeasurementPoint,\r\n deleteMeasurementPoint\r\n })(WithCommonModal(EditMeasurementPointForm))\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n ImanageMeasurementPointListsReducer,\r\n ImeasurementPointList,\r\n Ioption,\r\n IsmartlinkDataPoint,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, {\r\n Column,\r\n FinalState,\r\n RowInfo,\r\n SortingRule\r\n} from 'react-table';\r\nimport {\r\n deleteGlobalMeasurementPointList,\r\n getAllMeasurementPointLists,\r\n setSelectedMeasurementPointList,\r\n setTableFilter,\r\n toggleEditMeasurementPointListModal,\r\n toggleEditMeasurementPointModal\r\n} from '../../actions/manageMeasurementPointListsActions';\r\nimport {\r\n emptyTile,\r\n initialMeasurementPointList\r\n} from '../../reducers/initialState';\r\nimport { filter, size, values } from 'lodash';\r\n\r\nimport { Banner } from '../common/Banner';\r\n// import CommonModal from '../common/CommonModal';\r\nimport EditMeasurementPointListModal from './EditMeasurementPointListModal';\r\nimport { EditMeasurementPointListTabModal } from './EditMeasurementPointListTabModal';\r\nimport { EditMeasurementPointListTestProceduresModal } from './EditMeasurementPointListTestProceduresModal';\r\nimport EditMeasurementPointModal from './EditMeasurementPointModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormUtil } from '../common/FormUtil';\r\n/*\r\n * Measurement Point Lists\r\n */\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants, mainCategories } from '../../constants/constants';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { measurementPointListTypeEnum } from '../../models-enums';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../../constants/apiEndpoints';\r\nimport { msalFetch } from '../auth/Auth-Utils';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface RowInfoMPL extends RowInfo {\r\n original: ImeasurementPointList;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n loading: boolean;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n user: Iuser;\r\n getAllMeasurementPointLists: typeof getAllMeasurementPointLists;\r\n toggleEditMeasurementPointListModal: typeof toggleEditMeasurementPointListModal;\r\n toggleEditMeasurementPointModal: typeof toggleEditMeasurementPointModal;\r\n setSelectedMeasurementPointList: typeof setSelectedMeasurementPointList;\r\n getProductInfo: typeof getProductInfo;\r\n mainCategoryOptions: Ioption[];\r\n standardOptions: Ioption[];\r\n closeAllModals: typeof closeAllModals;\r\n manageMeasurementPointLists: ImanageMeasurementPointListsReducer;\r\n showEditMeasurementPointListModal: boolean;\r\n showEditMeasurementPointModal: boolean;\r\n showEditProcedureModal: boolean;\r\n showEditGroupModal: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: ImeasurementPointList[];\r\n deleteGlobalMeasurementPointList: typeof deleteGlobalMeasurementPointList;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n smartlinkDataPoints: IsmartlinkDataPoint[];\r\n}\r\n\r\nclass ManageMeasurementPointList extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public searchFieldConfig: FieldConfig;\r\n public buttonInAction = false;\r\n public deleteAction = false;\r\n static defaultProps = {\r\n tableData: []\r\n };\r\n // private setTableFilterTimeout: any;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.getTrProps = this.getTrProps.bind(this);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile,\r\n columns: [],\r\n smartlinkDataPoints: []\r\n };\r\n this.searchFieldConfig = {\r\n controls: {\r\n type: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageMeasurementPointLists:type',\r\n options: FormUtil.convertEnumToOptions(\r\n measurementPointListTypeEnum\r\n ),\r\n colWidth: 3,\r\n type: 'select',\r\n placeholder: 'typePlaceholder',\r\n defaultValue: this.props.tableFilters.type,\r\n isClearable: true,\r\n shouldTranslate: true\r\n }\r\n },\r\n equipmentType: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageMeasurementPointLists:equipmentType',\r\n options: this.props.mainCategoryOptions,\r\n colWidth: 3,\r\n type: 'select',\r\n placeholder: 'equipmentTypePlaceholder',\r\n defaultValue: this.props.tableFilters.mainCategory,\r\n isClearable: true\r\n }\r\n },\r\n standard: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageMeasurementPointLists:standard',\r\n options: this.props.standardOptions,\r\n colWidth: 3,\r\n type: 'select',\r\n placeholder: 'standardPlaceholder',\r\n defaultValue: this.props.tableFilters.standard,\r\n isClearable: true\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n getSmartlinkDataPoints = async () => {\r\n try {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {}\r\n };\r\n\r\n const url = API.GET.smartlinkDataPoint.getAll;\r\n const response: AxiosResponse = await msalFetch(\r\n url,\r\n axiosOptions\r\n );\r\n\r\n if (!response.data) {\r\n constants.handleError(\r\n 'Failed to load smartlink data points',\r\n ''\r\n );\r\n console.error(response);\r\n } else {\r\n this.setState({ smartlinkDataPoints: response.data });\r\n }\r\n } catch (error) {\r\n constants.handleError(\r\n error,\r\n 'Failed to load smartlink data points'\r\n );\r\n console.error(error);\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n columns: this.setColumns()\r\n });\r\n // Get measurement point lists\r\n this.handleGetAllMeasurementPointLists();\r\n // Get product info when this component mounts\r\n this.props.getProductInfo();\r\n this.getSmartlinkDataPoints();\r\n // TODO: set initial filters from redux\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditMeasurementPointListModal !==\r\n this.props.showEditMeasurementPointListModal &&\r\n !this.props.showEditMeasurementPointListModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get measurement point lists every time a filter changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.handleGetAllMeasurementPointLists();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n if (this.props.match.path !== prevProps.match.path) {\r\n this.handleGetAllMeasurementPointLists();\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n /*\r\n * Set Columns sets columns to state\r\n * setting columns here\r\n */\r\n setColumns = () => {\r\n return TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'type',\r\n Header: 'Type',\r\n Cell: (row: any) => {\r\n const listType = this.props.t(\r\n measurementPointListTypeEnum[row.original.type]\r\n );\r\n if (listType) {\r\n return {listType};\r\n } else {\r\n return null;\r\n }\r\n }\r\n },\r\n {\r\n id: 'equipmentType',\r\n Header: 'equipment type',\r\n accessor: ({ mainCategoryID }: ImeasurementPointList) => {\r\n const item = this.props.mainCategoryOptions.filter(\r\n (opt: Ioption) => {\r\n return opt.value === mainCategoryID;\r\n }\r\n )[0];\r\n if (item) {\r\n return mainCategoryID ? item.label : '';\r\n } else {\r\n return null;\r\n }\r\n }\r\n },\r\n {\r\n id: 'standard',\r\n Header: 'standard',\r\n accessor: ({ standardID }: ImeasurementPointList) => {\r\n const item = this.props.standardOptions.filter(\r\n (opt: Ioption) => {\r\n return opt.value === standardID;\r\n }\r\n )[0];\r\n if (item) {\r\n return standardID ? item.label : '';\r\n } else {\r\n return null;\r\n }\r\n }\r\n },\r\n {\r\n id: 'numTests',\r\n Header: 'Tests',\r\n width: 60,\r\n accessor: ({\r\n measurementPointTabs\r\n }: ImeasurementPointList) => {\r\n let count = 0;\r\n measurementPointTabs.forEach(tab => {\r\n if (size(tab.measurementPoints)) {\r\n count += size(\r\n filter(\r\n tab.measurementPoints,\r\n mp => mp.isDeleted === false\r\n )\r\n );\r\n }\r\n });\r\n return count;\r\n }\r\n },\r\n {\r\n Header: '',\r\n id: 'edit',\r\n minWidth: 25,\r\n Cell: row => (\r\n
    \r\n \r\n
    \r\n )\r\n },\r\n {\r\n Header: '',\r\n id: 'delete',\r\n minWidth: 25,\r\n Cell: row => {\r\n const color = this.isAdmin()\r\n ? constants.colors.red\r\n : constants.colors.greyText;\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n ],\r\n this.props.t\r\n );\r\n };\r\n\r\n handleEdit(MPList: ImeasurementPointList) {\r\n if (MPList.mainCategoryID === mainCategories.job) {\r\n this.props.setSelectedMeasurementPointList({\r\n ...MPList,\r\n forJob: true\r\n });\r\n } else {\r\n this.props.setSelectedMeasurementPointList({\r\n ...MPList,\r\n forJob: false\r\n });\r\n }\r\n this.props.toggleEditMeasurementPointListModal();\r\n }\r\n\r\n handleDelete(deletedItem: ImeasurementPointList) {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n deletedItem = {\r\n ...deletedItem\r\n };\r\n this.props.deleteGlobalMeasurementPointList(deletedItem.id);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteMPLButton'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n }\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'type':\r\n this.props.setTableFilter({ type: value, page: 1 });\r\n break;\r\n case 'equipmentType':\r\n this.props.setTableFilter({ mainCategory: value, page: 1 });\r\n break;\r\n case 'standard':\r\n this.props.setTableFilter({ standard: value, page: 1 });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoMPL | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo && column && column.id && column.id === 'delete') {\r\n return {\r\n onClick: () => this.handleDelete(rowInfo.original)\r\n };\r\n } else if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.handleEdit(rowInfo.original);\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n handleNewJobMeasurementList = () => {\r\n this.props.setSelectedMeasurementPointList({\r\n ...initialMeasurementPointList,\r\n id: uuidv4(),\r\n measurementPointTabs: [],\r\n temporary: true,\r\n forJob: true\r\n });\r\n this.props.toggleEditMeasurementPointListModal();\r\n };\r\n handleNewMeasurementList = () => {\r\n this.props.setSelectedMeasurementPointList({\r\n ...initialMeasurementPointList,\r\n id: uuidv4(),\r\n measurementPointTabs: [],\r\n temporary: true,\r\n forJob: false\r\n });\r\n this.props.toggleEditMeasurementPointListModal();\r\n };\r\n isAdmin = () =>\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageAllMeasurementPoints.id\r\n ]);\r\n\r\n canEditGlobal = () => {\r\n return constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageAllMeasurementPoints.id\r\n ]);\r\n };\r\n\r\n // update if this is the customer view and get the measurement point lists\r\n handleGetAllMeasurementPointLists = () => {\r\n const isCustomerView =\r\n this.props.match.path === '/customermeasurements';\r\n this.props.getAllMeasurementPointLists(isCustomerView);\r\n };\r\n\r\n render() {\r\n if (this.props.mainCategoryOptions.length === 0) {\r\n return (\r\n \r\n

    loading...

    \r\n \r\n );\r\n }\r\n const isCustomerView =\r\n this.props.match.path === '/customermeasurements';\r\n\r\n const { t } = this.props;\r\n return (\r\n
    \r\n \r\n {isCustomerView && (\r\n \r\n )}\r\n \r\n \r\n {this.isAdmin() && (\r\n \r\n {t('manageMeasurementPointLists:newJobData')}\r\n \r\n )}\r\n {this.isAdmin() && (\r\n \r\n {t('manageMeasurementPointLists:newMeasurement')}\r\n \r\n )}\r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n page={this.props.tableFilters.page - 1}\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.manageMeasurementPointLists.totalPages}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n manageMeasurementPointLists: state.manageMeasurementPointLists,\r\n loading: selectIsLoading(state),\r\n showEditMeasurementPointListModal:\r\n state.manageMeasurementPointLists.showEditMeasurementPointListModal,\r\n showEditMeasurementPointModal:\r\n state.manageMeasurementPointLists.showEditMeasurementPointModal,\r\n tableData: values(\r\n state.manageMeasurementPointLists.measurementPointListsByID\r\n ),\r\n tableFilters: state.manageMeasurementPointLists.tableFilters,\r\n standardOptions: state.productInfo.standardOptions,\r\n mainCategoryOptions: state.productInfo.mainCategoryOptions\r\n };\r\n};\r\nexport default withTranslation('manageMeasurementPointLists')(\r\n connect(mapStateToProps, {\r\n getAllMeasurementPointLists,\r\n toggleEditMeasurementPointListModal,\r\n toggleEditMeasurementPointModal,\r\n setSelectedMeasurementPointList,\r\n closeAllModals,\r\n setTableFilter,\r\n getProductInfo,\r\n deleteGlobalMeasurementPointList\r\n })(ManageMeasurementPointList)\r\n);\r\n","import * as types from './actionTypes';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { ItableFiltersParams, ThunkResult } from '../models';\r\n\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport { replaceEmptyStringsWithNull } from '../helpers/cleanObjEmptyStrings';\r\n\r\nexport function getProducts(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n mainCategory,\r\n subCategory,\r\n brand,\r\n origin\r\n } = getState().manageProduct.tableFilters;\r\n\r\n const payload = replaceEmptyStringsWithNull({\r\n page,\r\n search,\r\n mainCategoryID: mainCategory ? mainCategory.value : '',\r\n subCategoryID: subCategory ? subCategory.value : '',\r\n brandID: brand ? brand.value : '',\r\n origin: origin ? origin.value : '',\r\n isApproved: true,\r\n standards: []\r\n });\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: payload\r\n };\r\n\r\n const url = API.GET.inventory.products;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_MANAGE_PRODUCT_SUCCESS,\r\n products: data.data.result\r\n });\r\n dispatch({\r\n type: types.PRODUCT_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_MANAGE_PRODUCT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get products');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_PRODUCT,\r\n filters\r\n});\r\n\r\nexport const toggleEditProductModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_PRODUCT\r\n});\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport {\r\n getProductInfo,\r\n mergeProduct\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n ImanageProductReducer,\r\n Ioption,\r\n Iproduct,\r\n IproductInfo,\r\n Isubcategory,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\n\r\nimport {\r\n getProducts,\r\n setTableFilter,\r\n toggleEditProductModal\r\n} from '../../actions/manageProductActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\n/*\r\n * hopsital Managers manage their products\r\n * Note: did minimal renaming from the ManageInventory component\r\n */\r\nimport { values } from 'lodash';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { connect } from 'react-redux';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { IinitialState } from '../../reducers';\r\nimport {\r\n selectIsLoading,\r\n selectProductInfoSubCategories\r\n} from '../../reducers/commonReducers';\r\nimport {\r\n emptyTile,\r\n initialProduct,\r\n initialProductQueueObject\r\n} from '../../reducers/initialState';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport EditProductModal from '../manageInventory/EditProductModal';\r\nimport SearchNewProductsModal from '../manageInventory/SearchNewProductsModal';\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n showApproveProductModal: boolean;\r\n loading: boolean;\r\n productManage: ImanageProductReducer;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleEditProductModal: typeof toggleEditProductModal;\r\n getProductInfo: typeof getProductInfo;\r\n toggleSecurityFunctionsModal: () => void;\r\n getProducts: typeof getProducts;\r\n closeAllModals: typeof closeAllModals;\r\n productInfo: IproductInfo;\r\n user: Iuser;\r\n tableData: Iproduct[];\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n mergeProduct: (sprod: string, dproduct: string) => Promise;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n selectedProduct: Iproduct;\r\n selectedMainCategoryId: string | null;\r\n}\r\n\r\nclass ManageProduct extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public columns: any[];\r\n public searchFieldConfigBanner: any;\r\n public buttonInAction = false;\r\n private setProductTableFilterTimeout: any;\r\n private searchFieldConfig: FieldConfig;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n selectedProduct: initialProduct,\r\n selectedMainCategoryId: null\r\n };\r\n this.searchFieldConfig = this.buildSearchControls();\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'sku',\r\n accessor: 'sku'\r\n },\r\n {\r\n Header: 'name',\r\n id: 'name',\r\n accessor: 'name',\r\n minWidth: 400\r\n }\r\n ],\r\n this.props.t\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.props.getProductInfo();\r\n this.props.getProducts();\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n // automatically get products every time a hitler changes\r\n\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getProducts();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n this.searchFieldConfig = this.buildSearchControls();\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n /*\r\n * Reset the table filters (not used currently)\r\n */\r\n resetProductTableFilters = () => {\r\n this.props.setTableFilter({\r\n search: '',\r\n page: 1\r\n });\r\n };\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const { tableFilters, productInfo, t } = this.props;\r\n const { selectedMainCategoryId } = this.state;\r\n const originOptions: Ioption[] = [\r\n { value: 'USN', label: 'USN' },\r\n { value: 'GBN', label: 'GBN' },\r\n { value: 'CAN', label: 'CAN' }\r\n ];\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: tableFilters.search\r\n }\r\n },\r\n mainCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:mainCategory',\r\n options: productInfo.mainCategoryOptions,\r\n colWidth: 2,\r\n type: 'select',\r\n placeholder: 'manageInventory:mainCategoryPlaceholder',\r\n defaultValue: tableFilters.mainCategory,\r\n isClearable: true\r\n }\r\n },\r\n subCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n placeholder: t('common:selectSubcategory'),\r\n meta: {\r\n label: 'common:subCategory',\r\n options: Object.values(productInfo.subcategories).reduce(\r\n (carry: Ioption[], subcategory: Isubcategory) => {\r\n if (!selectedMainCategoryId) {\r\n return carry;\r\n }\r\n\r\n if (\r\n subcategory.mainCategoryID !==\r\n selectedMainCategoryId\r\n ) {\r\n return carry;\r\n }\r\n\r\n const option: Ioption = {\r\n label: subcategory.name,\r\n value: subcategory.id\r\n };\r\n carry.push(option);\r\n return carry;\r\n },\r\n []\r\n ),\r\n colWidth: 2,\r\n type: 'select',\r\n defaultValue: tableFilters.subCategory,\r\n isClearable: true\r\n }\r\n },\r\n brand: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:brand',\r\n options: productInfo.brandOptions,\r\n colWidth: 2,\r\n type: 'select',\r\n defaultValue: tableFilters.brand,\r\n isClearable: true\r\n }\r\n }\r\n // origin: {\r\n // render: FormUtil.SelectWithoutValidation,\r\n // meta: {\r\n // label: 'common:origin',\r\n // options: originOptions,\r\n // colWidth: 2,\r\n // type: 'select',\r\n // defaultValue: tableFilters.origin,\r\n // isClearable: true\r\n // }\r\n // }\r\n };\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n /*\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedProduct: rowInfo.original\r\n });\r\n this.props.toggleEditProductModal();\r\n }\r\n },\r\n style: {\r\n background: this.state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n handleMergeProduct = (product: Iproduct) => {\r\n if (product.id === this.state.selectedProduct.id) {\r\n toastr.error('Error', this.props.t('mergeError'));\r\n return;\r\n }\r\n\r\n toastr.confirm(\r\n `${this.props.t('mergeConfirmPart_01')} \\n ${\r\n this.state.selectedProduct.name\r\n } ${this.props.t('mergeConfirmPart_02')} ${product.name}?`,\r\n {\r\n onOk: () => {\r\n this.props\r\n .mergeProduct(this.state.selectedProduct.id, product.id)\r\n .then(() => {\r\n this.props.getProducts();\r\n })\r\n .catch((error: any) => console.error(error));\r\n }\r\n }\r\n );\r\n };\r\n\r\n // get the next or previous page of data. the table is 0 indexed but the API is not\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setProductTableFilterTimeout);\r\n this.setProductTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({\r\n search: value,\r\n page: 1\r\n }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'mainCategory':\r\n this.props.setTableFilter({\r\n mainCategory: value,\r\n page: 0\r\n });\r\n this.props.setTableFilter({\r\n subCategory: undefined,\r\n page: 0\r\n });\r\n break;\r\n case 'subCategory':\r\n this.props.setTableFilter({\r\n subCategory: value,\r\n page: 0\r\n });\r\n break;\r\n case 'brand':\r\n this.props.setTableFilter({\r\n brand: value,\r\n page: 0\r\n });\r\n break;\r\n case 'origin':\r\n this.props.setTableFilter({\r\n origin: value,\r\n page: 0\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n render() {\r\n const tableClassName = this.props.tableFilters.showAdditionalFilters\r\n ? `beacon-table -highlight ${this.state.currentTile.color} additional-filters`\r\n : `beacon-table -highlight ${this.state.currentTile.color}`;\r\n\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n {\r\n if (key === 'mainCategory') {\r\n this.setState({\r\n selectedMainCategoryId: value?.value\r\n });\r\n }\r\n this.onSearchValueChanges(value, key);\r\n }}\r\n t={this.props.t}\r\n />\r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.productManage.totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={tableClassName}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n onSortedChange={this.onSortedChanged}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n expanded={this.state.selectedRow}\r\n />\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\n/*\r\n * AddCustomerModal will connect to redux, impliment CommonModal, as well as AddCustomerForm\r\n */\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n productManage: state.manageProduct,\r\n loading: selectIsLoading(state),\r\n productInfo: state.productInfo,\r\n subCategories: selectProductInfoSubCategories(state),\r\n tableData: values(state.manageProduct.productsByID),\r\n tableFilters: state.manageProduct.tableFilters\r\n };\r\n};\r\nexport default withTranslation('manageProductQueue')(\r\n connect(mapStateToProps, {\r\n getProducts,\r\n toggleEditProductModal,\r\n closeAllModals,\r\n getProductInfo,\r\n setTableFilter,\r\n mergeProduct\r\n })(ManageProduct)\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n ImanageProductQueueReducer,\r\n Ioption,\r\n Iproduct,\r\n IproductInfo,\r\n Isubcategory,\r\n IproductQueueObject,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport {\r\n getProductInfo,\r\n mergeProduct,\r\n toggleEditProductModal\r\n} from '../../actions/manageInventoryActions';\r\nimport {\r\n getProductQueue,\r\n setTableFilter\r\n} from '../../actions/manageProductQueueActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\n/*\r\n * hopsital Managers manage their products\r\n * Note: did minimal renaming from the ManageInventory component\r\n */\r\nimport { Col } from 'react-bootstrap';\r\nimport EditProductModal from '../manageInventory/EditProductModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchNewProductsModal from '../manageInventory/SearchNewProductsModal';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n emptyTile,\r\n initialProductQueueObject\r\n} from '../../reducers/initialState';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { values } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n showApproveProductModal: boolean;\r\n loading: boolean;\r\n userManage: ImanageProductQueueReducer;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleEditProductModal: typeof toggleEditProductModal;\r\n getProductInfo: typeof getProductInfo;\r\n toggleSecurityFunctionsModal: () => void;\r\n getProductQueue: typeof getProductQueue;\r\n closeAllModals: typeof closeAllModals;\r\n productInfo: IproductInfo;\r\n user: Iuser;\r\n tableData: IproductQueueObject[];\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n // mergeProduct: typeof mergeProduct;\r\n mergeProduct: (sprod: string, dproduct: string) => Promise;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any;\r\n selectedQueueObject: IproductQueueObject;\r\n selectedMainCategoryId: string | null;\r\n}\r\n\r\nclass ManageProductQueue extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n // public searchFieldConfig: any;\r\n public searchFieldConfigBanner: any;\r\n public buttonInAction = false;\r\n private setTableFilterTimeout: any;\r\n private searchFieldConfig: FieldConfig;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n selectedQueueObject: initialProductQueueObject,\r\n selectedMainCategoryId: null\r\n };\r\n this.searchFieldConfig = this.buildSearchControls();\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n this.props.getProductInfo();\r\n this.props.getProductQueue();\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showApproveProductModal !==\r\n this.props.showApproveProductModal &&\r\n !this.props.showApproveProductModal\r\n ) {\r\n this.setState({ selectedQueueObject: initialProductQueueObject });\r\n }\r\n\r\n // we only need to check the mainCategory options because both brands and mainCategory options are received in the same API response\r\n // and before they are received, there will not be any length.\r\n if (\r\n prevProps.productInfo.mainCategoryOptions.length !==\r\n this.props.productInfo.mainCategoryOptions.length ||\r\n prevProps.productInfo.brandOptions.length !==\r\n this.props.productInfo.brandOptions.length\r\n ) {\r\n this.setColumns();\r\n }\r\n\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getProductQueue();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n this.searchFieldConfig = this.buildSearchControls();\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n /*\r\n * Reset the table filters (not used currently)\r\n */\r\n resetTableFilters = () => {\r\n this.props.setTableFilter({\r\n search: '',\r\n page: 1\r\n });\r\n };\r\n\r\n /*\r\n * Set Columns sets columns to state\r\n * setting columns here in order to reset them if and after we receive mainCategory and manufacturer options\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'sku',\r\n accessor: 'product.sku'\r\n },\r\n {\r\n Header: 'name',\r\n accessor: 'product.name',\r\n minWidth: 400\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const { tableFilters, productInfo } = this.props;\r\n const { selectedMainCategoryId } = this.state;\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: tableFilters.search\r\n }\r\n },\r\n mainCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:mainCategory',\r\n options: productInfo.mainCategoryOptions,\r\n colWidth: 2,\r\n type: 'select',\r\n placeholder: 'manageInventory:mainCategoryPlaceholder',\r\n defaultValue: tableFilters.mainCategory,\r\n isClearable: true\r\n }\r\n },\r\n subCategory: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:subCategory',\r\n options: Object.values(productInfo.subcategories).reduce(\r\n (carry: Ioption[], subcategory: Isubcategory) => {\r\n if (!selectedMainCategoryId) {\r\n return carry;\r\n }\r\n\r\n if (\r\n subcategory.mainCategoryID !==\r\n selectedMainCategoryId\r\n ) {\r\n return carry;\r\n }\r\n\r\n const option: Ioption = {\r\n label: subcategory.name,\r\n value: subcategory.id\r\n };\r\n carry.push(option);\r\n return carry;\r\n },\r\n []\r\n ),\r\n colWidth: 2,\r\n type: 'select',\r\n defaultValue: tableFilters.subCategory,\r\n isClearable: true\r\n }\r\n },\r\n brand: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:brand',\r\n options: productInfo.brandOptions,\r\n colWidth: 2,\r\n type: 'select',\r\n defaultValue: tableFilters.brand,\r\n isClearable: true\r\n }\r\n }\r\n };\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n /*\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedQueueObject: rowInfo.original\r\n });\r\n this.props.toggleEditProductModal();\r\n }\r\n },\r\n style: {\r\n background: this.state.selectedRow[rowInfo.viewIndex]\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n // get the next or previous page of data. the table is 0 indexed but the API is not\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'mainCategory':\r\n this.props.setTableFilter({\r\n mainCategory: value,\r\n page: 0\r\n });\r\n this.props.setTableFilter({\r\n subCategory: undefined,\r\n page: 0\r\n });\r\n break;\r\n case 'subCategory':\r\n this.props.setTableFilter({\r\n subCategory: value,\r\n page: 0\r\n });\r\n break;\r\n case 'brand':\r\n this.props.setTableFilter({\r\n brand: value,\r\n page: 0\r\n });\r\n break;\r\n case 'origin':\r\n this.props.setTableFilter({\r\n origin: value,\r\n page: 0\r\n });\r\n default:\r\n break;\r\n }\r\n };\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n /*\r\n * Handle Merge Product\r\n */\r\n handleMergeProduct = (product: Iproduct) => {\r\n toastr.confirm(\r\n `${this.props.t('mergeConfirmPart_01')} \\n ${\r\n this.state.selectedQueueObject.product.name\r\n } ${this.props.t('mergeConfirmPart_02')} ${product.name}?`,\r\n {\r\n onOk: () => {\r\n this.props\r\n .mergeProduct(\r\n this.state.selectedQueueObject.product.id,\r\n product.id\r\n )\r\n .then(() => {\r\n this.props.getProductQueue();\r\n })\r\n .catch((error: any) => console.error(error));\r\n }\r\n }\r\n );\r\n };\r\n render() {\r\n if (this.props.productInfo.mainCategoryOptions.length === 0) {\r\n return (\r\n \r\n

    loading...

    \r\n \r\n );\r\n }\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n {\r\n if (key === 'mainCategory') {\r\n this.setState({\r\n selectedMainCategoryId: value?.value\r\n });\r\n }\r\n this.onSearchValueChanges(value, key);\r\n }}\r\n t={this.props.t}\r\n />\r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.userManage.totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n onSortedChange={this.onSortedChanged}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n expanded={this.state.selectedRow}\r\n />\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n userManage: state.manageProductQueue,\r\n loading: selectIsLoading(state),\r\n showApproveProductModal:\r\n state.manageProductQueue.showApproveProductModal,\r\n productInfo: state.productInfo,\r\n tableData: values(state.manageProductQueue.productQueueByID).filter(\r\n item => !item.isDeleted\r\n ),\r\n tableFilters: state.manageProductQueue.tableFilters\r\n };\r\n};\r\nexport default withTranslation('manageProductQueue')(\r\n connect(mapStateToProps, {\r\n getProductQueue,\r\n toggleEditProductModal,\r\n closeAllModals,\r\n getProductInfo,\r\n setTableFilter,\r\n mergeProduct\r\n })(ManageProductQueue)\r\n);\r\n","import { toastr } from 'react-redux-toastr';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport {\r\n ItableFiltersParams,\r\n Ireport,\r\n IdefaultReport,\r\n ThunkResult,\r\n IreportTemplate,\r\n IreportTemplateChapter,\r\n IreportExternalDocument\r\n} from '../models';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { reportTypeEnum } from '../models-enums';\r\nimport moment from 'moment';\r\n\r\nexport function getDefaultReports(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.report.defaults;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.REPORT_MANAGE_GET_DEFAULT_SUCCESS,\r\n reports: data.data\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.REPORT_MANAGE_GET_DEFAULT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get default reports');\r\n console.error(error);\r\n })\r\n .finally(() => dispatch(endAjaxCall()));\r\n };\r\n}\r\n\r\nexport function updateReport(\r\n selectedDefaultReport: IdefaultReport,\r\n formValues: any\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n // dispatch(beginAjaxCall());\r\n const { jobID, coverLetter, headerLogoPath = '' } = formValues;\r\n const report: Ireport = {\r\n jobID,\r\n reportType: selectedDefaultReport.reportType,\r\n coverLetter,\r\n headerLogoPath\r\n };\r\n dispatch({\r\n type: types.REPORT_UPDATE,\r\n report\r\n });\r\n // return axios\r\n // .post(`${API.POST.job.update}`, { job, users })\r\n // .then(data => {\r\n // if (!data.data) {\r\n // throw undefined;\r\n // } else {\r\n // dispatch({\r\n // type: types.REPORT_UPDATE_SUCCESS,\r\n // job: data.data\r\n // });\r\n\r\n // // toastr.success('Success', 'Saved job', constants.toastrSuccess);\r\n // return data;\r\n // }\r\n // })\r\n // .catch((error: any) => {\r\n // dispatch({ type: types.REPORT_UPDATE_FAILED, error, axiosOptions });\r\n // constants.handleError(error, 'update job');\r\n // console.error(error);\r\n // });\r\n };\r\n}\r\n\r\nexport function runDailyRoundsReport(\r\n formValues: any,\r\n facilityID: string,\r\n sendToExternal: boolean\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n params: {\r\n facilityID: facilityID,\r\n sendToExternal: sendToExternal,\r\n startDate: formValues.startDate\r\n ? moment.utc(formValues.startDate).toISOString()\r\n : '',\r\n endDate: formValues.endDate\r\n ? moment.utc(formValues.endDate).toISOString()\r\n : ''\r\n },\r\n data: {}\r\n };\r\n\r\n const url = API.POST.report.runDailyRounds;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.REPORT_ADD_SUCCESS\r\n });\r\n\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_REPORT });\r\n toastr.success(\r\n 'Success',\r\n 'Your report is being generated and will be emailed to you as soon as it is ready.',\r\n { ...constants.toastrSuccess, timeOut: 5000 }\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.REPORT_ADD_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'run report');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * run a new report\r\n */\r\nexport function runReport(\r\n reportTemplateID: string,\r\n jobID: string,\r\n sendToExternal: boolean,\r\n requestData: IreportExternalDocument[]\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { externalDocuments: requestData },\r\n params: {\r\n reportTemplateID,\r\n jobID,\r\n sendToExternal\r\n }\r\n };\r\n\r\n const url = API.POST.report.run;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.REPORT_ADD_SUCCESS\r\n });\r\n\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_REPORT });\r\n toastr.success(\r\n 'Success',\r\n 'Your report is being generated and will be emailed to you as soon as it is ready.',\r\n { ...constants.toastrSuccess, timeOut: 5000 }\r\n );\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.REPORT_ADD_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'run report');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function uploadExternalDocument(\r\n reportTemplateChapterID: string,\r\n selectedFile: any\r\n): Promise {\r\n const formData = new FormData();\r\n formData.append('file', selectedFile);\r\n\r\n const headers = { 'content-type': 'multipart/form-data' };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: formData,\r\n params: {\r\n reportTemplateChapterID\r\n },\r\n headers\r\n };\r\n\r\n const url = API.POST.report.uploadExternalDocument;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n console.log('data', data);\r\n\r\n return data.data;\r\n })\r\n .catch((error: any) => {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to upload external document.');\r\n });\r\n}\r\n\r\n// Get All Report Templates\r\nexport async function getAllReportTemplates(): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.report.templates;\r\n\r\n try {\r\n const data: AxiosResponse = await msalFetch(url, axiosOptions);\r\n return data.data; // Return the report templates directly\r\n } catch (error) {\r\n console.error('Error fetching report templates:', error);\r\n throw error; // Optionally rethrow the error\r\n }\r\n}\r\n\r\n// Create Report Template\r\nexport async function createReportTemplate(\r\n newTemplate: IreportTemplate\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: newTemplate\r\n };\r\n\r\n const url = API.POST.report.templates;\r\n\r\n try {\r\n // Attempt to create the report template\r\n const response: AxiosResponse = await msalFetch(url, axiosOptions);\r\n\r\n // Show success notification on creation\r\n toastr.success('Report template created successfully.', 'Success');\r\n\r\n // Return response data if successful\r\n return response.data;\r\n } catch (error) {\r\n // Cast error to `any` to access response details safely\r\n const err = error as any;\r\n\r\n // Check if the error is a 400 status code and display the specific message\r\n if (err.response?.status === 400) {\r\n toastr.error(\r\n 'A default report template with the same Brand and Job Type already exists.',\r\n 'Error'\r\n );\r\n } else {\r\n // Display a general error message if it's a different error\r\n const errorMessage =\r\n err.response?.data?.message ||\r\n 'Failed to create report template.';\r\n toastr.error(errorMessage, 'Error');\r\n }\r\n\r\n // Log error details for debugging\r\n console.error('Failed to create report template:', error);\r\n\r\n // Re-throw the error for additional handling if needed\r\n throw error;\r\n }\r\n}\r\n\r\n// Update Report Template\r\nexport async function updateReportTemplate(\r\n id: string, // Pass the template ID\r\n updatedTemplate: any // The updated template data\r\n): Promise {\r\n // Replace {id} placeholder with the actual id\r\n const url = API.PUT.report.templates.replace('{id}', id);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: updatedTemplate\r\n };\r\n\r\n try {\r\n // Pass the URL as the first argument and axiosOptions as the second\r\n const response: AxiosResponse = await msalFetch(url, axiosOptions);\r\n toastr.success('Success', 'Report template updated successfully.');\r\n return response.data;\r\n } catch (error) {\r\n // More detailed error handling for better user feedback\r\n let errorMessage = 'Failed to update report template.';\r\n\r\n // Check for BadRequest and specific error message\r\n if (error.response?.status === 400) {\r\n errorMessage =\r\n error.response?.data ||\r\n 'A default report template with the same Brand and Job Type already exists.';\r\n }\r\n\r\n toastr.error('Error', errorMessage);\r\n console.error(error);\r\n throw error;\r\n }\r\n}\r\n\r\n// Delete Report Template\r\nexport async function deleteReportTemplate(id: string): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n // Replace {id} in the URL with the actual id\r\n const url = API.DELETE.report.templates.replace('{id}', id);\r\n\r\n try {\r\n await msalFetch(url, axiosOptions);\r\n toastr.success('Success', 'Report template deleted successfully.');\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to delete report template.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Get All Chapters\r\nexport async function getAllChapters(): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.report.chapters;\r\n\r\n try {\r\n const data: AxiosResponse = await msalFetch(url, axiosOptions);\r\n return data.data;\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to fetch chapters.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Update Chapter\r\nexport async function updateChapter(\r\n id: string,\r\n updatedChapter: any\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: updatedChapter\r\n };\r\n\r\n const url = API.PUT.report.chapters;\r\n\r\n try {\r\n const data: AxiosResponse = await msalFetch(url, axiosOptions);\r\n toastr.success('Success', 'Chapter updated successfully.');\r\n return data.data;\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to update chapter.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Delete Chapter\r\nexport async function deleteChapter(id: string): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete'\r\n };\r\n\r\n const url = API.DELETE.report.chapters;\r\n\r\n try {\r\n await msalFetch(url, axiosOptions);\r\n toastr.success('Success', 'Chapter deleted successfully.');\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to delete chapter.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Get All Report Template Chapters\r\nexport async function getAllReportTemplateChapters(\r\n templateId: string\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.report.templateChapters}?templateId=${templateId}`;\r\n\r\n try {\r\n const data: AxiosResponse = await msalFetch(url, axiosOptions);\r\n\r\n if (data && data.data) {\r\n return data.data; // Return the fetched chapters\r\n } else {\r\n return []; // Return an empty array if no chapters\r\n }\r\n } catch (error) {\r\n if (error.response && error.response.status === 404) {\r\n // If it's a 404 error, return an empty array and do not show a toast\r\n return []; // No chapters found, just return an empty array\r\n }\r\n\r\n console.error(error);\r\n toastr.error('Error', 'Failed to fetch template chapters.');\r\n return []; // Return an empty array on error to prevent breaking the UI\r\n }\r\n}\r\n\r\n// Create Report Template Chapter\r\nexport async function createReportTemplateChapter(\r\n newTemplateChapter: IreportTemplateChapter // Expect an object of this type\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: newTemplateChapter // Send the data in the correct format\r\n };\r\n\r\n const url = API.POST.report.templateChapters; // API endpoint for creating the chapter\r\n\r\n try {\r\n // Make the API call using your msalFetch function\r\n const data: AxiosResponse = await msalFetch(url, axiosOptions);\r\n\r\n // Show a success message\r\n toastr.success('Success', 'Template chapter created successfully.');\r\n\r\n // Return the response data\r\n return data.data;\r\n } catch (error) {\r\n // Handle errors\r\n console.error(error);\r\n toastr.error('Error', 'Failed to create template chapter.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Update Report Template Chapters (bulk update)\r\nexport async function updateReportTemplateChapter(\r\n updatedTemplateChapters: IreportTemplateChapter[] // Accepting an array now\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'put',\r\n data: updatedTemplateChapters // Send array of updated chapters\r\n };\r\n\r\n const url = API.PUT.report.templateChapters; // Ensure this URL supports bulk update\r\n\r\n try {\r\n const response: AxiosResponse = await msalFetch(url, axiosOptions);\r\n toastr.success('Success', 'Template chapters updated successfully.');\r\n return response.data;\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to update template chapters.');\r\n throw error;\r\n }\r\n}\r\n\r\n// Delete Report Template Chapter\r\nexport async function deleteReportTemplateChapter(\r\n chapter: IreportTemplateChapter\r\n): Promise {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'delete',\r\n data: chapter // Pass the entire chapter object in the request body\r\n };\r\n\r\n const url = API.DELETE.report.templateChapters; // Use static URL\r\n\r\n try {\r\n await msalFetch(url, axiosOptions); // Call the API to delete the chapter\r\n toastr.success('Success', 'Template chapter deleted successfully.');\r\n } catch (error) {\r\n console.error(error);\r\n toastr.error('Error', 'Failed to delete template chapter.');\r\n throw error;\r\n }\r\n}\r\n\r\nexport const toggleEditReportModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_REPORT\r\n});\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_REPORT,\r\n filters\r\n});\r\n\r\nexport const setSelectedReport = (report: Ireport) => ({\r\n type: types.SET_SELECTED_REPORT,\r\n report\r\n});\r\n\r\nexport const setSelectedDefaultReport = (defaultReportID: string) => ({\r\n type: types.SET_SELECTED_DEFAULT_REPORT_ID,\r\n defaultReportID\r\n});\r\n","/*\r\n * Manage Report Modal and Container\r\n */\r\n\r\nimport { connect, useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n runDailyRoundsReport,\r\n runReport,\r\n uploadExternalDocument\r\n} from '../../actions/manageReportActions';\r\nimport { jobTypesIdEnumInverse, ReportChapterType } from '../../models-enums';\r\n\r\nimport { selectJobsByID } from '../../reducers/manageJobReducer';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectSelectedFacility } from '../../reducers/facilitiesReducer';\r\nimport { IreportExternalDocument, IreportTemplate } from '../../models';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { map, orderBy } from 'lodash';\r\nimport moment from 'moment';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup,\r\n GroupProps\r\n} from 'react-reactive-form';\r\nimport * as React from 'react';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport { constants } from '../../constants/constants';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { svgIcons } from '../../constants/svgIcons';\r\nimport { beginAjaxCall, endAjaxCall } from '../../actions/ajaxStatusActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\n\r\ninterface Iprops {\r\n selectedTemplate: IreportTemplate | undefined;\r\n forDailyRounds: boolean;\r\n\r\n closeModal: () => void;\r\n}\r\n\r\ninterface IdispatchProps {\r\n runReport: typeof runReport;\r\n runDailyRoundsReport: typeof runDailyRoundsReport;\r\n loading: boolean;\r\n}\r\n\r\nconst ManageReportModal: React.FC = props => {\r\n const { t, selectedTemplate } = props;\r\n const formGroupRef = React.useRef(null);\r\n const dispatch = useDispatch();\r\n let subscription: any;\r\n\r\n const inputRefs = React.useRef>({});\r\n const [externalDocs, setExternalDocs] = React.useState<\r\n IreportExternalDocument[]\r\n >([]);\r\n\r\n const selectedFacility = useSelector(selectSelectedFacility);\r\n const allJobs = useSelector(selectJobsByID);\r\n\r\n const jobOptions = React.useMemo(() => {\r\n const allJobsForFacility = Object.values(allJobs).filter(\r\n x => x.facilityID === selectedFacility.id\r\n );\r\n const filteredJobs = allJobsForFacility.filter(\r\n x => x.jobTypeID === selectedTemplate?.jobTypeID\r\n );\r\n const jobsWithName = map(filteredJobs, job => {\r\n const startDate = moment\r\n .utc(job.startDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n const jobType = t(\r\n `nsJob:${\r\n jobTypesIdEnumInverse[\r\n job.jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n }`\r\n );\r\n const name = `${startDate} ${jobType} ${job.jobNumber} (${job.status})`;\r\n\r\n return { ...job, name };\r\n });\r\n\r\n return FormUtil.convertToOptions(\r\n orderBy(\r\n jobsWithName,\r\n res => moment.utc(res.startDate).unix(),\r\n 'desc'\r\n )\r\n );\r\n }, [selectedFacility.id, selectedTemplate?.id]);\r\n\r\n const onFileChange = (event: React.ChangeEvent) => {\r\n const file = event.target.files?.[0];\r\n\r\n if (file && file.size < 100000000) {\r\n dispatch(beginAjaxCall());\r\n uploadExternalDocument(event?.target?.name, file)\r\n .then((result: IreportExternalDocument) => {\r\n setExternalDocs([\r\n ...externalDocs,\r\n {\r\n reportTemplateChapterID:\r\n result?.reportTemplateChapterID,\r\n mimeType: file.type,\r\n fileName: result.fileName\r\n }\r\n ]);\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n } else {\r\n toastr.error(\r\n props.t('manageDocument:fileSizeWarning'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n console.log('externalDocs', externalDocs);\r\n }, [externalDocs]);\r\n\r\n const buildFieldConfig = React.useMemo(() => {\r\n const disabled = false;\r\n const jobID = null;\r\n\r\n // Field config to configure form\r\n const jobSelectControl = {\r\n jobID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: jobOptions,\r\n label: 'common:job',\r\n colWidth: 12,\r\n placeholder: 'jobPlaceholder',\r\n name: 'job',\r\n disableSort: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n },\r\n formState: {\r\n value: jobID,\r\n disabled\r\n }\r\n }\r\n } as { [key: string]: GroupProps };\r\n\r\n if (props.forDailyRounds) {\r\n return {\r\n controls: {\r\n startDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'startDate',\r\n colWidth: 12,\r\n name: 'startDate'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: '',\r\n disabled\r\n }\r\n },\r\n endDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'endDate',\r\n colWidth: 12,\r\n name: 'endDate'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: '',\r\n disabled\r\n }\r\n }\r\n }\r\n };\r\n } else {\r\n return { controls: { ...jobSelectControl } };\r\n }\r\n }, [props.forDailyRounds, selectedTemplate, jobOptions, externalDocs]);\r\n\r\n const [fieldConfig, setFieldConfig] = React.useState(\r\n buildFieldConfig\r\n );\r\n\r\n React.useEffect(() => {\r\n setFieldConfig(FormUtil.translateForm(buildFieldConfig, props.t));\r\n\r\n return () => {\r\n if (subscription) {\r\n subscription.unsubscribe();\r\n }\r\n };\r\n }, []);\r\n\r\n const handleSubmit = (e: any) => {\r\n e.preventDefault();\r\n if (formGroupRef?.current?.status === 'INVALID') {\r\n formGroupRef?.current?.markAsSubmitted();\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (props.forDailyRounds) {\r\n props.runDailyRoundsReport(\r\n formGroupRef?.current?.value,\r\n selectedFacility?.id,\r\n false\r\n );\r\n } else {\r\n props.runReport(\r\n selectedTemplate?.id || '',\r\n formGroupRef?.current?.value.jobID.value,\r\n false,\r\n externalDocs\r\n );\r\n }\r\n\r\n props.closeModal();\r\n };\r\n\r\n const handleRunAndSendExternal = (e: any) => {\r\n e.preventDefault();\r\n if (formGroupRef?.current?.status === 'INVALID') {\r\n formGroupRef?.current?.markAsSubmitted();\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n if (props.forDailyRounds) {\r\n props.runDailyRoundsReport(\r\n formGroupRef?.current?.value,\r\n selectedFacility?.id,\r\n true\r\n );\r\n } else {\r\n props.runReport(\r\n selectedTemplate?.id || '',\r\n formGroupRef?.current?.value.jobID.value,\r\n true,\r\n externalDocs\r\n );\r\n }\r\n\r\n props.closeModal();\r\n };\r\n\r\n const setForm = (form: AbstractControl) => {\r\n formGroupRef.current = form as FormGroup;\r\n };\r\n\r\n const clearDocument = (reportTemplateChapterID: string) => {\r\n const updatedDocs = externalDocs.filter(\r\n x => x.reportTemplateChapterID !== reportTemplateChapterID\r\n );\r\n setExternalDocs(updatedDocs);\r\n\r\n if (inputRefs.current[reportTemplateChapterID]) {\r\n inputRefs.current[reportTemplateChapterID]!.value = ''; // Clear the value\r\n }\r\n };\r\n\r\n const formClassName = `clearfix job-form beacon-form`;\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n {selectedTemplate?.reportTemplateChapters.map(chapter => {\r\n if (\r\n chapter.reportChapter?.chapterType ===\r\n ReportChapterType.ExternalDocument\r\n ) {\r\n const externalDoc = externalDocs.find(\r\n x => x.reportTemplateChapterID === chapter.id\r\n );\r\n return (\r\n \r\n
    Add External Document
    \r\n\r\n
    \r\n \r\n (inputRefs.current[\r\n chapter?.id!\r\n ] = el)\r\n }\r\n accept=\"application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp\"\r\n onChange={onFileChange}\r\n />\r\n {externalDoc && (\r\n \r\n clearDocument(chapter?.id!)\r\n }\r\n >\r\n {svgIcons['closeMenu']}\r\n \r\n )}\r\n
    \r\n
    \r\n );\r\n }\r\n })}\r\n
    \r\n\r\n \r\n \r\n {t('cancel')}\r\n \r\n ) =>\r\n handleRunAndSendExternal(e)\r\n }\r\n >\r\n {t('runAndSendExternal')}\r\n \r\n ) => handleSubmit(e)}\r\n >\r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('manageReport')(\r\n connect(mapStateToProps, {\r\n runReport,\r\n runDailyRoundsReport\r\n })(WithCommonModal(ManageReportModal))\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport { Ifacility, IreportTemplate, Itile } from '../../models';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport { emptyTile, initialFacility } from '../../reducers/initialState';\r\nimport {\r\n getAllReportTemplates,\r\n getDefaultReports,\r\n setSelectedDefaultReport,\r\n setSelectedReport,\r\n setTableFilter,\r\n toggleEditReportModal\r\n} from '../../actions/manageReportActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\n/*\r\n * Manage Reports\r\n */\r\nimport ManageReportModal from './ManageReportModal';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect, useSelector } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { getJobsByFacility } from '../../actions/manageJobActions';\r\nimport { getCanAccessAllCustomers } from '../../reducers/userReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { jobTypesIdEnumInverse } from '../../models-enums';\r\nimport { getProductInfo } from '../../reducers/productInfoReducer';\r\n\r\ninterface RowInfoReport extends RowInfo {\r\n original: IreportTemplate;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n loading: boolean;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n setSelectedReport: typeof setSelectedReport;\r\n setSelectedDefaultReport: typeof setSelectedDefaultReport;\r\n getJobsByFacility: typeof getJobsByFacility;\r\n selectedFacility: Ifacility;\r\n canAccessAllCustomers: boolean;\r\n}\r\n\r\nconst ManageReport: React.FC = props => {\r\n const { t } = props;\r\n const [columns, setColumns] = React.useState([]);\r\n const [selectedRow, setSelectedRow] = React.useState(null);\r\n const [currentTile, setCurrentTile] = React.useState(emptyTile);\r\n const [selectedTemplate, setSelectedTemplate] = React.useState<\r\n IreportTemplate | undefined\r\n >(undefined);\r\n const productInfo = useSelector(getProductInfo);\r\n const [showManageReportModal, setShowManageReportModal] = React.useState<\r\n boolean\r\n >(false);\r\n\r\n const [reportTemplates, setReportTemplates] = React.useState<\r\n IreportTemplate[]\r\n >([]);\r\n\r\n // Function to fetch templates\r\n const fetchTemplates = async () => {\r\n const fetchedTemplates = await getAllReportTemplates();\r\n setReportTemplates(fetchedTemplates);\r\n };\r\n\r\n React.useEffect(() => {\r\n setCurrentTile(constants.getTileByURL(props.location.pathname));\r\n setColumns(\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'Template Name',\r\n accessor: 'templateName' // Ensure this matches the key in your data\r\n },\r\n {\r\n id: 'jobType',\r\n Header: 'Job Type',\r\n accessor: (row: IreportTemplate) => {\r\n return props.t(\r\n `nsJob:${\r\n jobTypesIdEnumInverse[\r\n row.jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n }`\r\n );\r\n }\r\n },\r\n {\r\n id: 'brand',\r\n Header: 'Brand',\r\n accessor: (row: IreportTemplate) => {\r\n return productInfo?.allBrands[row.brandID]?.name;\r\n }\r\n },\r\n {\r\n Header: 'Is Default',\r\n accessor: 'isDefault', // Ensure this matches the key in your data\r\n Cell: ({ value }: { value: boolean }) => (\r\n \r\n {value ? 'Yes' : 'No'}\r\n
    \r\n )\r\n }\r\n ],\r\n t\r\n )\r\n );\r\n\r\n fetchTemplates();\r\n props.getJobsByFacility();\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (!showManageReportModal) {\r\n setSelectedRow(null);\r\n }\r\n }, [showManageReportModal]);\r\n\r\n React.useEffect(() => {\r\n props.getJobsByFacility();\r\n }, [props.selectedFacility.id]);\r\n\r\n /*\r\n * (reusable)\r\n * set the row color after a user selects it\r\n */\r\n const getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === selectedRow\r\n ? constants.colors[\r\n `${currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n const onPageChange = (page: number) => {\r\n // const newPage = page + 1;\r\n // props.setTableFilter({ page: newPage });\r\n };\r\n\r\n const getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoReport | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n setSelectedRow(rowInfo.index);\r\n setSelectedTemplate(rowInfo.original);\r\n //props.setSelectedDefaultReport(rowInfo.original.id);\r\n setShowManageReportModal(true);\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n = 10 ? reportTemplates.length : 10\r\n }\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n getTdProps={getTdProps}\r\n />\r\n setShowManageReportModal(false)}\r\n onHide={() => setShowManageReportModal(false)}\r\n />\r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const selectedFacility =\r\n state.facilities[state.selectedFacilityID] || initialFacility;\r\n const canAccessAllCustomers = getCanAccessAllCustomers(state.user);\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n selectedFacility,\r\n canAccessAllCustomers\r\n };\r\n};\r\nexport default withTranslation('manageReport')(\r\n connect(mapStateToProps, {\r\n getDefaultReports,\r\n setTableFilter,\r\n setSelectedReport,\r\n setSelectedDefaultReport,\r\n getJobsByFacility\r\n })(ManageReport)\r\n);\r\n","import { toastr } from 'react-redux-toastr';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport { ItableFiltersParams, Iuser, ThunkResult } from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nexport function getUserManage(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { page, search } = getState().manageTeam.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { page, search }\r\n };\r\n\r\n const url = API.GET.user.getteamsearch;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.TEAM_MANAGE_SUCCESS,\r\n team: data.data.result\r\n });\r\n dispatch({\r\n type: types.TEAM_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.TEAM_MANAGE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get team members');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport function updateTeamUser(teamMember: Iuser): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_TEAM });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: teamMember\r\n };\r\n\r\n const url = API.POST.user.updateteam;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.TEAM_UPDATE_SUCCESS,\r\n user: response.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.TEAM_UPDATE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'update user');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * save (add) a new team member\r\n */\r\nexport function saveTeamUser(teamMember: Iuser): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: teamMember\r\n };\r\n\r\n const url = API.POST.user.saveteam;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.TEAM_SAVE_SUCCESS,\r\n user: response.data\r\n });\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_TEAM });\r\n toastr.success(\r\n 'Success',\r\n 'Team member has been submitted for approval.',\r\n constants.toastrSuccess\r\n );\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({ type: types.TEAM_SAVE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'save user');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * delete a team member\r\n */\r\nexport function deleteTeamUser(memberID: string): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.TOGGLE_MODAL_EDIT_TEAM });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { ID: memberID }\r\n };\r\n\r\n const url = API.POST.user.deleteTeamMember;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.TEAM_DELETE_SUCCESS,\r\n memberID\r\n });\r\n\r\n // toastr.success('Success', 'Deleted user', constants.toastrSuccess);\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.TEAM_DELETE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'delete user');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const toggleEditTeamUserModal = () => ({\r\n type: types.TOGGLE_MODAL_EDIT_TEAM\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_TEAM,\r\n filters\r\n});\r\n\r\nexport const setEditUserFormValues = (formValues: { [key: string]: any }) => ({\r\n type: types.SET_FORM_VALUES_MANAGE_TEAM_MEMBER,\r\n formValues\r\n});\r\n\r\nexport const updateEditUserFormValues = (formValues: {\r\n [key: string]: any;\r\n}) => ({\r\n type: types.UPDATE_FORM_VALUES_MANAGE_TEAM_MEMBER,\r\n formValues\r\n});\r\n\r\nexport const setSelectedTeamUserID = (id: string) => ({\r\n type: types.SET_SELECTED_MANAGE_TEAM,\r\n id\r\n});\r\n","/*\r\n * EditTeamMemberForm\r\n * Edit team members\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FormUtil,\r\n MultiValueLabel,\r\n MultiValueOption\r\n} from '../common/FormUtil';\r\nimport { IfacilityWithoutBuildings, Ioption, Iuser } from '../../models';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { debounce, differenceBy, filter, map } from 'lodash';\r\nimport {\r\n deleteTeamUser,\r\n saveTeamUser,\r\n updateTeamUser\r\n} from '../../actions/manageTeamActions';\r\n\r\nimport { IeditTeamMemberFormValues } from '../../modelsForms';\r\nimport { constants } from '../../constants/constants';\r\nimport { initialUser } from '../../reducers/initialState';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { userBaseConfigControls } from '../common/UserBaseConfigControls';\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\n\r\ninterface Iprops {\r\n updateTeamUser: typeof updateTeamUser;\r\n saveTeamUser: typeof saveTeamUser;\r\n toggleModal: () => void;\r\n selectedUser: Iuser;\r\n loading: boolean;\r\n colorButton: string;\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => Promise;\r\n facilityOptionsWithAddress: Ioption[];\r\n user: Iuser;\r\n deleteTeamUser: typeof deleteTeamUser;\r\n updateFormValues: (formValues: { [key: string]: any }) => void;\r\n setFormValues: (formValues: { [key: string]: any }) => void;\r\n formValues: IeditTeamMemberFormValues;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n}\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditTeamMemberForm extends React.Component<\r\n Iprops & WithTranslation,\r\n Istate\r\n> {\r\n public subscription: any;\r\n private formGroup: FormGroup | any;\r\n private updateFormValuesDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n static defaultProps = {\r\n selectedUser: initialUser\r\n };\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.updateFormValuesDebounced = debounce(\r\n this.props.updateFormValues,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (\r\n this.props.formValues.first === undefined ||\r\n this.props.formValues.email !== this.props.selectedUser.email\r\n ) {\r\n this.props.setFormValues(this.itemToFormValues());\r\n }\r\n /*\r\n * Tricky bit of code here. When we initially have the facility objects, they do not have the address.\r\n * We add them without the address initially so that the filtering works. Then once the full facility objects\r\n * return, we set the form values again, now with the address.\r\n */\r\n let getFacilitiesPromises: Promise[] = [];\r\n this.props.selectedUser.facilities.forEach(\r\n facility =>\r\n (getFacilitiesPromises = [\r\n ...getFacilitiesPromises,\r\n this.props.getFacilitiesByCountry({})\r\n ])\r\n );\r\n Promise.all(getFacilitiesPromises).then(() => {\r\n this.props.setFormValues(this.itemToFormValues());\r\n });\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n differenceBy(\r\n prevProps.facilityOptionsWithAddress,\r\n this.props.facilityOptionsWithAddress,\r\n 'value'\r\n ).length ||\r\n prevProps.facilityOptionsWithAddress.length !==\r\n this.props.facilityOptionsWithAddress.length\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n\r\n // only update the form if the facilities or customers changed because the cursor looses focus on text input fields\r\n if (\r\n this.props.formValues.facilities !== prevProps.formValues.facilities\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.setFormValues({});\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n itemToFormValues = (): IeditTeamMemberFormValues => {\r\n const { selectedUser } = this.props;\r\n\r\n const { facilities, countryID } = selectedUser;\r\n const selectedFacilities = map(\r\n facilities,\r\n fac =>\r\n this.props.facilityOptionsWithAddress.find(\r\n fw => fw.value === fac.id\r\n ) || {\r\n value: '',\r\n label: ''\r\n }\r\n );\r\n\r\n return {\r\n ...selectedUser,\r\n facilities: selectedFacilities,\r\n countryID: constants.countries[countryID]\r\n };\r\n };\r\n\r\n buildUserFromFormValues = (): Iuser => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n const facilities = this.formGroup.value.facilities.map(\r\n (option: { value: string; label: string }) => {\r\n return { id: option.value, name: option.label };\r\n }\r\n );\r\n\r\n return {\r\n ...this.props.selectedUser,\r\n ...formValues,\r\n facilities,\r\n email: this.props.selectedUser.email // have to add back the email because disabling the input removes it\r\n };\r\n };\r\n\r\n saveFacilities = (facilities: IfacilityWithoutBuildings[]) => {\r\n // console.log(facilities)\r\n };\r\n\r\n loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length >= 3) {\r\n this.props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n null,\r\n null,\r\n callback,\r\n this.saveFacilities\r\n );\r\n } else {\r\n callback([]);\r\n }\r\n }, 100);\r\n\r\n /*\r\n * build the field config with values passed in or the values from redux\r\n */\r\n buildFieldConfig = (\r\n defaultFormValues: IeditTeamMemberFormValues = this.props.formValues\r\n ) => {\r\n const disabled = false;\r\n const { facilities } = defaultFormValues;\r\n const { facilityOptionsWithAddress } = this.props;\r\n\r\n const filteredSelectedFacilities = filter(\r\n facilities,\r\n facilityOption =>\r\n !!facilityOptionsWithAddress.find(\r\n facility => facility.value === facilityOption.value\r\n )\r\n );\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n facilities: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'common:facility',\r\n loadOptions: (searchTerm: string, callback: any) => {\r\n this.loadOptions(searchTerm, callback);\r\n },\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n isMulti: true,\r\n multiValueLabel: MultiValueLabel,\r\n multiValueOption: MultiValueOption\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: filteredSelectedFacilities,\r\n disabled\r\n }\r\n }\r\n };\r\n const fieldConfig: FieldConfig = {\r\n controls: {\r\n ...userBaseConfigControls(defaultFormValues),\r\n ...fieldConfigControls\r\n }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n default:\r\n this.updateFormValuesDebounced({ [key]: value });\r\n break;\r\n }\r\n };\r\n\r\n handleSubmit = (evt: React.MouseEvent) => {\r\n evt.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n if (this.props.selectedUser.id.length) {\r\n this.props.updateTeamUser(this.buildUserFromFormValues());\r\n } else {\r\n this.props.saveTeamUser(this.buildUserFromFormValues());\r\n }\r\n };\r\n handleDelete = () => {\r\n if (this.props.selectedUser) {\r\n this.props.deleteTeamUser(this.props.selectedUser.id);\r\n } else {\r\n console.error('unable to delete, missing user');\r\n toastr.error(\r\n 'Error',\r\n 'Unable to delete, missing user',\r\n constants.toastrError\r\n );\r\n }\r\n };\r\n setForm = (form: AbstractControl) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n\r\n if (this.props.selectedUser.id.length) {\r\n const emailControl = this.formGroup.get('email');\r\n emailControl.disable();\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form team-member-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n {!!this.props.selectedUser.id.length && (\r\n \r\n {t('common:delete')}\r\n \r\n )}\r\n\r\n \r\n {t('save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default EditTeamMemberForm;\r\n","/*\r\n * The Manage Team user modal - Container\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n deleteTeamUser,\r\n saveTeamUser,\r\n toggleEditTeamUserModal,\r\n updateTeamUser,\r\n setEditUserFormValues,\r\n updateEditUserFormValues\r\n} from '../../actions/manageTeamActions';\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect\r\n} from '../../actions/commonActions';\r\nimport EditTeamMemberForm from './EditTeamMemberForm';\r\nimport { selectFacilityOptionsWithAddress } from '../../reducers/facilitiesReducer';\r\nimport { IeditTeamMemberFormValues } from '../../modelsForms';\r\nimport { initialUser } from '../../reducers/initialState';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n colorButton: any;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const formValues = state.manageTeam\r\n .editUserFormValues as IeditTeamMemberFormValues;\r\n const selectedUser =\r\n state.manageTeam.teamMembersByID[state.manageTeam.selectedUserID] ||\r\n initialUser;\r\n\r\n const modalTitle = selectedUser\r\n ? ownProps.t('manageTeam:editTeamModalTitle')\r\n : ownProps.t('manageTeam:saveTeamModalTitle');\r\n\r\n return {\r\n user: state.user,\r\n userManage: state.manageTeam,\r\n loading: selectIsLoading(state),\r\n facilityOptionsWithAddress: selectFacilityOptionsWithAddress(state),\r\n show: state.manageTeam.showEditTeamModal,\r\n formValues,\r\n selectedUser,\r\n className: 'user-edit',\r\n title: modalTitle\r\n };\r\n};\r\n\r\nexport default withTranslation('user')(\r\n connect(mapStateToProps, {\r\n updateTeamUser,\r\n saveTeamUser,\r\n toggleModal: toggleEditTeamUserModal,\r\n onHide: toggleEditTeamUserModal,\r\n onCancel: toggleEditTeamUserModal,\r\n getFacilitiesByCountry,\r\n deleteTeamUser,\r\n setFormValues: setEditUserFormValues,\r\n updateFormValues: updateEditUserFormValues,\r\n searchFacilitiesForAsyncSelect\r\n })(WithCommonModal(EditTeamMemberForm))\r\n);\r\n","import * as React from 'react';\r\nimport * as moment from 'moment';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n ImanageTeamReducer,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport {\r\n getUserManage,\r\n setTableFilter,\r\n toggleEditTeamUserModal,\r\n setSelectedTeamUserID\r\n} from '../../actions/manageTeamActions';\r\nimport { values } from 'lodash';\r\n\r\nimport { Banner } from '../common/Banner';\r\n/*\r\n * hopsital Managers manage their team\r\n * Note: did minimal renaming from the UserManage component\r\n */\r\nimport { Button } from 'react-bootstrap';\r\nimport EditTeamMemberModal from './EditTeamMemberModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n loading: boolean;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleEditTeamUserModal: typeof toggleEditTeamUserModal;\r\n getUserManage: typeof getUserManage;\r\n closeAllModals: typeof closeAllModals;\r\n userManage: ImanageTeamReducer;\r\n showEditUserModal: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: Iuser[];\r\n setSelectedTeamUserID: typeof setSelectedTeamUserID;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n}\r\n\r\nclass TeamManage extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public columns: any[];\r\n public searchFieldConfig: FieldConfig;\r\n public buttonInAction = false;\r\n private setTableFilterTimeout: any;\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile\r\n };\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'name',\r\n Header: 'user:name',\r\n // accessor: \"user\",\r\n Cell: (row: any) => (\r\n \r\n {row.original.first} {row.original.last}\r\n \r\n )\r\n },\r\n {\r\n Header: 'user:email',\r\n accessor: 'email'\r\n },\r\n {\r\n Header: 'manager',\r\n accessor: ({ hasTeamMembers }: Iuser) => {\r\n return hasTeamMembers ? 'Yes' : 'No';\r\n },\r\n id: 'manager'\r\n },\r\n {\r\n Header: 'common:login',\r\n accessor: ({ lastLoginDate }: Iuser) => {\r\n return lastLoginDate\r\n ? moment\r\n .utc(lastLoginDate)\r\n .local(true)\r\n .format('DD-MMM-YY LT')\r\n : 'n/a';\r\n },\r\n id: 'login'\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.searchFieldConfig = {\r\n controls: {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: this.props.tableFilters.search\r\n }\r\n }\r\n }\r\n };\r\n }\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n // refresh the userManage every time the component mounts\r\n this.props.getUserManage();\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditUserModal !== this.props.showEditUserModal &&\r\n !this.props.showEditUserModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getUserManage();\r\n this.setState({ selectedRow: null });\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n // console.info(\"ROWINFO\", rowInfo);\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.props.setSelectedTeamUserID(rowInfo.original.id);\r\n this.props.toggleEditTeamUserModal();\r\n }\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n {\r\n this.props.setSelectedTeamUserID('');\r\n this.props.toggleEditTeamUserModal();\r\n }}\r\n >\r\n {t('manageTeam:newTeamMember')}\r\n \r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.userManage.totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\n/*\r\n * AddCustomerModal will connect to redux, impliment CommonModal, as well as AddCustomerForm\r\n */\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user,\r\n userManage: state.manageTeam,\r\n loading: selectIsLoading(state),\r\n showEditUserModal: state.manageTeam.showEditTeamModal,\r\n tableData: values(state.manageTeam.teamMembersByID),\r\n tableFilters: state.manageTeam.tableFilters\r\n };\r\n};\r\nexport default withTranslation('manageTeam')(\r\n connect(mapStateToProps, {\r\n getUserManage,\r\n toggleEditTeamUserModal,\r\n closeAllModals,\r\n setTableFilter,\r\n setSelectedTeamUserID\r\n })(TeamManage)\r\n);\r\n","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport { ItableFiltersParams, ThunkResult } from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nexport async function savePendingTraining(\r\n trainingIDs: string[]\r\n): Promise> {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { trainingIDs }\r\n };\r\n const url = API.GET.training.savePendingTraining;\r\n return msalFetch(url, axiosOptions);\r\n}\r\n\r\nexport function getManageTraining(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n manageTraining: { tableFilters }\r\n } = getState();\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n ...tableFilters,\r\n isCourseCompleted: tableFilters.isCourseCompleted || null\r\n }\r\n };\r\n\r\n const url = API.GET.training.getAdminProgress;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.MANAGE_TRAINING_SUCCESS,\r\n trainingProgress: data.data.result\r\n });\r\n dispatch({\r\n type: types.MANAGE_TRAINING_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.MANAGE_TRAINING_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get user training progress');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_TRAINING,\r\n filters\r\n});\r\n","import React from 'react';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport moment from 'moment';\r\nimport { Col, Button } from 'react-bootstrap';\r\n\r\ninterface Iprops {\r\n show: boolean;\r\n onHide: () => void;\r\n userData: any;\r\n}\r\n\r\nconst TrainingDetailModal = (props: Iprops) => {\r\n const { show, onHide, userData } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n {userData && (\r\n \r\n \r\n \r\n {userData.certificateUrl ? (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n {t('manageTraining:viewCredential')}\r\n \r\n \r\n \r\n ) : (\r\n <>\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n {t('manageTraining:close')}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default TrainingDetailModal;\r\n","import * as types from './actionTypes';\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport {\r\n Iuser,\r\n GFLesson,\r\n LessonProgress,\r\n ThunkResult,\r\n IshoppingCartProduct,\r\n GFCourse\r\n} from '../models';\r\nimport { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';\r\nimport { find, sortBy } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { initialTrainingProgress } from '../reducers/initialState';\r\n\r\nexport function loadCourses(user: Iuser): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.trainingCurriculum.allCourses;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (response.status !== 200) {\r\n throw response;\r\n }\r\n // temporary hack to support On-Site and Webinar courses\r\n const courses = response.data.map((course: GFCourse) => {\r\n const foundOnSite = course.name.search('On-Site');\r\n const foundWebinar = course.name.search('Webinar');\r\n\r\n if (foundOnSite >= 0 || foundWebinar >= 0) {\r\n return { ...course, onSite: true };\r\n } else {\r\n return { ...course, onSite: false };\r\n }\r\n });\r\n dispatch({ type: types.LOAD_COURSES_SUCCESS, courses });\r\n return courses;\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error('error loading courses', error);\r\n dispatch({ type: types.LOAD_COURSES_FAILED, error });\r\n const message = 'load courses';\r\n constants.handleError({ response: error }, message);\r\n });\r\n };\r\n}\r\n\r\nexport function getLessonSuccess(lesson: GFLesson) {\r\n return { type: types.LOAD_LESSON, lesson };\r\n}\r\n\r\nexport function setLesson(lesson: GFLesson): ThunkResult {\r\n return dispatch => {\r\n dispatch(getLessonSuccess(lesson));\r\n };\r\n}\r\n\r\nexport function getLessonsByCourseID(\r\n courseID: string,\r\n user: Iuser\r\n): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.trainingCurriculum.lessonByCourseID}?courseID=${courseID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (response.status !== 200) {\r\n throw response;\r\n }\r\n const lessons = sortBy(response.data, (el: GFLesson) => {\r\n return el.courseLessons[0].order;\r\n });\r\n dispatch({ type: types.LOAD_LESSONS_SUCCESS, lessons });\r\n return lessons;\r\n })\r\n .catch((error: AxiosError) => {\r\n dispatch({ type: types.LOAD_LESSONS_FAILED, error });\r\n constants.handleError({ response: error }, 'load lessons');\r\n console.error('Error getting a course by ID', error);\r\n });\r\n };\r\n}\r\n\r\nexport function getAllLessons(user: Iuser): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.trainingCurriculum.allLessons;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (response.status !== 200) {\r\n throw response;\r\n }\r\n dispatch({\r\n type: types.LOAD_LESSONS_SUCCESS,\r\n lessons: response.data\r\n });\r\n return response.data;\r\n })\r\n .catch((error: AxiosError) => {\r\n dispatch({ type: types.LOAD_LESSONS_FAILED, error });\r\n constants.handleError({ response: error }, 'load lessons');\r\n console.error('Error getting all lessons', error);\r\n });\r\n };\r\n}\r\n\r\n// Get all lesson progress\r\nexport function getAllLessonProgress(): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.training.getalllessonprogress;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.GET_ALL_LESSON_PROGRESS_SUCCESS,\r\n progress: data.data\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error getting lesson progress', error);\r\n dispatch({\r\n type: types.GET_ALL_LESSON_PROGRESS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get all lesson progress');\r\n });\r\n };\r\n}\r\n\r\n// Get lesson progress\r\nexport function getProgressByLesson(lessonId: string): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.training.getprogressbylesson}/${lessonId}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.GET_LESSON_PROGRESS_SUCCESS,\r\n progress: data\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error getting lesson progress', error);\r\n dispatch({\r\n type: types.GET_LESSON_PROGRESS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get lesson progress');\r\n });\r\n };\r\n}\r\n\r\n// Save lesson progress\r\nexport function saveLessonProgress(\r\n playerData: any,\r\n lessonID: string,\r\n timeSpentM: number // in milliseconds\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n // dispatch(beginAjaxCall()); // don't show loading while saving progress every few seconds\r\n const { user, training } = getState();\r\n const { lessonProgress } = training;\r\n const selectedLessonProgress =\r\n lessonProgress[lessonID] || initialTrainingProgress;\r\n const secondsSpent = Math.round(timeSpentM * 0.001);\r\n const timeSpent =\r\n secondsSpent < playerData.duration\r\n ? secondsSpent\r\n : playerData.duration;\r\n console.info(\r\n 'saving: ',\r\n timeSpent,\r\n secondsSpent,\r\n selectedLessonProgress,\r\n playerData.duration\r\n );\r\n const progress: LessonProgress = {\r\n lessonID,\r\n currentTime: playerData.seconds,\r\n percentageComplete: playerData.percent * 100,\r\n totalTime: playerData.duration,\r\n timeSpent,\r\n userID: user.id,\r\n isComplete: selectedLessonProgress.isComplete || false\r\n };\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: progress\r\n };\r\n const url = API.POST.training.savelessonprogress;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.SAVE_LESSON_PROGRESS_SUCCESS,\r\n progress: { id: data.data, ...progress }\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error saving lesson progress', error);\r\n dispatch({ type: types.SAVE_LESSON_PROGRESS_FAILED, progress });\r\n constants.handleError(error, 'save lesson progress');\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * check to see if we already added this course\r\n * check to see if there are already any lessons in the cart\r\n */\r\nexport const addCourseToCart = (\r\n product: IshoppingCartProduct,\r\n cartName: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const { lessonsByID, cart } = getState().training;\r\n let foundLesson = false;\r\n cart.addedIDs.forEach(value => {\r\n foundLesson = !!find(lessonsByID, { id: value });\r\n });\r\n const foundCourse = cart.productsByID[product.id];\r\n if (foundLesson) {\r\n toastr.warning(\r\n 'Warning',\r\n 'Please remove all lessons before adding a course. You cannot purchase courses and lessons at the same time.',\r\n constants.toastrWarning\r\n );\r\n return;\r\n }\r\n if (foundCourse) {\r\n toastr.warning(\r\n 'Warning',\r\n 'Course already added to cart.',\r\n constants.toastrWarning\r\n );\r\n console.info('course already added');\r\n return;\r\n }\r\n dispatch({\r\n type: `ADD_TO_CART_TRAINING`,\r\n product\r\n });\r\n toastr.success('Success', 'Added to Cart.', constants.toastrSuccess);\r\n };\r\n};\r\n\r\n/*\r\n * check to see if we already added this course\r\n * check to see if there are already any lessons in the cart\r\n */\r\nexport const addLessonToCart = (\r\n product: IshoppingCartProduct,\r\n cartName: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const { coursesByID, cart } = getState().training;\r\n let foundCourse = false;\r\n cart.addedIDs.forEach(value => {\r\n foundCourse = !!find(coursesByID, { id: value });\r\n });\r\n\r\n const foundLesson = cart.productsByID[product.id];\r\n if (foundCourse) {\r\n toastr.warning(\r\n 'Warning',\r\n 'Please remove all courses before adding a lesson. You cannot purchase courses and lessons at the same time.'\r\n );\r\n return;\r\n }\r\n if (foundLesson) {\r\n toastr.warning(\r\n 'Warning',\r\n 'Lesson already added to cart.',\r\n constants.toastrWarning\r\n );\r\n console.info('lesson already added');\r\n return;\r\n }\r\n dispatch({\r\n type: `ADD_TO_CART_TRAINING`,\r\n product\r\n });\r\n toastr.success('Success', 'Added to Cart.', constants.toastrSuccess);\r\n };\r\n};\r\n\r\nconst getPurchasedTrainingHelper = (\r\n dispatch: any,\r\n getState: any,\r\n userId?: string\r\n) => {\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: userId ? { userId } : null\r\n };\r\n\r\n const url = API.GET.training.getPurchasedTraining;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.GET_PURCHASED_TRAINING_SUCCESS,\r\n products: data.data\r\n });\r\n // toastr.success(\"Success\", \"requested quote\", constants.toastrSuccess);\r\n })\r\n .catch((error: any) => {\r\n console.error('Error getting purchased training', error);\r\n dispatch({\r\n type: types.GET_PURCHASED_TRAINING_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get purchased training');\r\n });\r\n};\r\n\r\nexport const trainingCheckout = (\r\n transactionNumber: string\r\n): ThunkResult => {\r\n return (dispatch, getState) => {\r\n const products = getState().training.cart.addedIDs;\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n PurchasedTraining: products,\r\n UTATransactionNumber: parseInt(transactionNumber, 10)\r\n }\r\n };\r\n\r\n const url = API.POST.training.trainingCheckout;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.CHECKOUT_TRAINING_SUCCESS\r\n });\r\n getPurchasedTrainingHelper(dispatch, getState);\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.CHECKOUT_TRAINING_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'purchasing training');\r\n throw error; // intentionally rethrow\r\n });\r\n };\r\n};\r\n\r\nexport const getPurchasedTraining = (userId?: string): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n getPurchasedTrainingHelper(dispatch, getState, userId);\r\n };\r\n};\r\n\r\n/*\r\n * Get Quiz Results\r\n */\r\nexport function getQuizResults(): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.training.getQuizResults;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.GET_QUIZ_RESULTS_SUCCESS,\r\n results: data.data\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error getting quiz result', error);\r\n dispatch({\r\n type: types.GET_QUIZ_RESULTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get quiz results');\r\n });\r\n };\r\n}\r\n\r\n//Get ClassMarker link to start quiz\r\nexport function getQuizLink(courseId: string): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.training.getQuizLink(courseId);\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.GET_QUIZ_LINK_SUCCESS,\r\n link: data.data\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error getting quiz link ', error);\r\n dispatch({\r\n type: types.GET_QUIZ_LINK_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get quiz link');\r\n });\r\n };\r\n}\r\n","import * as React from 'react';\r\n\r\nimport {\r\n GFCourse,\r\n ImanageTrainingProgress,\r\n ImanageTrainingReducer,\r\n Ioption,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n getManageTraining,\r\n setTableFilter\r\n} from '../../actions/manageTrainingActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\n/*\r\n * The New User Manage\r\n */\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport { isEmpty } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nimport More from '../../images/icons/More.svg';\r\nimport Certificate from '../../images/icons/Certificate.svg';\r\nimport moment from 'moment';\r\nimport TrainingDetailModal from './TrainingDetailModal';\r\nimport { securityFunctions } from '../../constants/securityFunctions';\r\nimport { loadCourses } from '../../actions/trainingActions';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n user: Iuser;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: ImanageTrainingProgress[];\r\n manageTraining: ImanageTrainingReducer;\r\n loading: boolean;\r\n coursesByID: { [key: string]: GFCourse };\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n getManageTraining: typeof getManageTraining;\r\n setTableFilter: typeof setTableFilter;\r\n closeAllModals: typeof closeAllModals;\r\n loadCourses: typeof loadCourses;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n canManageTraining: boolean;\r\n courseOptions: Ioption[];\r\n expanded: { [key: string]: boolean };\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageTraining extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public buttonInAction = false;\r\n private setTableFilterTimeout: any;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile,\r\n columns: [],\r\n canManageTraining: false,\r\n courseOptions: [],\r\n expanded: {},\r\n searchFieldConfig: { controls: {} }\r\n };\r\n }\r\n\r\n handleSearchChangeViaQueryString = (search: string | null) => {\r\n if (\r\n !constants.hasSecurityFunction(this.props.user, [\r\n securityFunctions.ManageAllTraining.id\r\n ])\r\n )\r\n search = this.props.user.email;\r\n\r\n this.props.setTableFilter({\r\n search: search || '',\r\n courseID: '',\r\n isCourseCompleted: false,\r\n page: 1\r\n });\r\n\r\n this.props.history.replace('/manageTraining');\r\n };\r\n\r\n UNSAFE_componentWillMount(): void {\r\n let search = this.props?.location?.search.split('=')[1];\r\n this.handleSearchChangeViaQueryString(search);\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n columns: this.setColumns()\r\n });\r\n // refresh the ManageTraining every time the component mounts\r\n this.props.loadCourses(this.props.user);\r\n this.props.getManageTraining();\r\n this.setState({ searchFieldConfig: this.buildFieldConfig() });\r\n if (\r\n constants.hasSecurityFunction(\r\n this.props.user,\r\n [\r\n securityFunctions.ManageAllTraining.id,\r\n securityFunctions.ManageEmployeeTraining.id\r\n ],\r\n { matchAll: true }\r\n )\r\n )\r\n this.setState({ canManageTraining: true });\r\n\r\n if (this.props.coursesByID) {\r\n const courseOptions = this.convertCourseIDsToOptions(\r\n this.props.coursesByID\r\n );\r\n this.setState({\r\n courseOptions,\r\n searchFieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n // check for search url query change (would only happen if this is navigted to\r\n // from the profile linkage while already sitting on this page)\r\n const search = this.props?.location?.search.split('=')[1];\r\n if (search) {\r\n this.handleSearchChangeViaQueryString(search);\r\n return;\r\n }\r\n\r\n // automatically get data every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getManageTraining();\r\n this.setState({ searchFieldConfig: this.buildFieldConfig() });\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.coursesByID) !==\r\n JSON.stringify(this.props.coursesByID)\r\n ) {\r\n const courseOptions = this.convertCourseIDsToOptions(\r\n this.props.coursesByID\r\n );\r\n\r\n this.setState({\r\n courseOptions,\r\n searchFieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n\r\n const els = document.querySelectorAll('.non-expandable');\r\n\r\n els.forEach(el => {\r\n const element = el as HTMLDivElement;\r\n if (element.style.cursor === 'pointer')\r\n element.style.cursor = 'default';\r\n });\r\n\r\n if (\r\n prevProps.loading !== this.props.loading ||\r\n JSON.stringify(prevProps.tableData) !==\r\n JSON.stringify(this.props.tableData)\r\n ) {\r\n this.setState({ searchFieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n buildFieldConfig = () => {\r\n const { courseID, search } = this.props.tableFilters;\r\n const courseOption = this.state.courseOptions?.find(\r\n opt => opt.value === courseID\r\n );\r\n const disabled = this.props.loading;\r\n\r\n return {\r\n controls: {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: this.props.tableFilters.search\r\n },\r\n formState: {\r\n value: search || '',\r\n disabled\r\n }\r\n },\r\n courseID: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageTraining:courseName',\r\n options: this.state.courseOptions,\r\n colWidth: 4,\r\n type: 'select',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: courseOption,\r\n disabled\r\n }\r\n },\r\n isCourseCompleted: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'manageTraining:courseCompleted',\r\n colWidth: 2,\r\n innerStyle: {\r\n display: 'flex',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n height: '48px',\r\n paddingTop: '24px'\r\n }\r\n },\r\n formState: {\r\n value:\r\n this.props.tableFilters?.isCourseCompleted || false,\r\n disabled\r\n }\r\n }\r\n }\r\n };\r\n };\r\n\r\n convertCourseIDsToOptions = (coursesByID: {\r\n [key: string]: GFCourse;\r\n }): Ioption[] =>\r\n Object.values(coursesByID)\r\n .map(course => ({\r\n label: course.name,\r\n value: course.id\r\n }))\r\n .sort((a, b) => a.label.localeCompare(b.label));\r\n\r\n openDetailModal = (\r\n evt: React.MouseEvent,\r\n selectedRow: any\r\n ) => {\r\n evt.preventDefault();\r\n this.setState({ selectedRow });\r\n };\r\n\r\n /*\r\n * Set Columns sets columns to state\r\n * setting columns here in order to reset them if and after we receive customers\r\n */\r\n setColumns = () => {\r\n return TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: row =>\r\n row.original.expandable\r\n ? TableUtil.expanderToggle(row)\r\n : null,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n Header: 'userName',\r\n accessor: 'userName'\r\n },\r\n {\r\n Header: 'courseName',\r\n accessor: 'courseName'\r\n },\r\n {\r\n Header: 'progress',\r\n accessor: 'progress'\r\n },\r\n {\r\n Header: 'credentialValidFrom',\r\n Cell: ({ original: { credentialIssueDate } }) => (\r\n \r\n {credentialIssueDate\r\n ? moment(\r\n credentialIssueDate,\r\n 'YYYY-MM-DD'\r\n ).format('DD-MMM-YY')\r\n : '--'}\r\n \r\n )\r\n },\r\n {\r\n Header: 'credentialValidUntil',\r\n Cell: ({ original: { credentialValidUntil } }) => (\r\n \r\n {credentialValidUntil\r\n ? moment(\r\n credentialValidUntil,\r\n 'YYYY-MM-DD'\r\n ).format('DD-MMM-YY')\r\n : '--'}\r\n \r\n )\r\n },\r\n {\r\n Header: 'results',\r\n Cell: ({ original: { score } }) => (\r\n {score ? `${score}%` : '--'}\r\n ),\r\n width: 180\r\n },\r\n {\r\n Header: 'brand',\r\n Cell: ({ original }) => (\r\n {original?.brandName || ''}\r\n )\r\n },\r\n {\r\n Header: '',\r\n Cell: ({ original }) => (\r\n \r\n {original.certificateUrl && (\r\n \r\n \r\n \r\n )}\r\n \r\n this.openDetailModal(evt, original)\r\n }\r\n >\r\n \r\n \r\n \r\n ),\r\n width: 180\r\n }\r\n ],\r\n this.props.t\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'customer':\r\n this.props.setTableFilter({ page: 1 });\r\n break;\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'courseID':\r\n this.props.setTableFilter({ courseID: value?.value });\r\n break;\r\n case 'isCourseCompleted':\r\n this.props.setTableFilter({ isCourseCompleted: value });\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n getSubColumns = () => {\r\n const existingColumns = this.setColumns();\r\n existingColumns.shift();\r\n existingColumns.unshift({});\r\n return existingColumns;\r\n };\r\n\r\n onExpandedChange = (row: { [key: string]: Object }) => {\r\n const [index] = Object.keys(row);\r\n const { expanded } = this.state;\r\n\r\n expanded[index] = !expanded[index];\r\n this.setState({ expanded: { ...expanded } });\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n return (\r\n
    \r\n \r\n {this.state.canManageTraining && (\r\n \r\n )}\r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n page={this.props.tableFilters.page - 1}\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.manageTraining.totalPages}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n SubComponent={x =>\r\n x.original.expandable ? (\r\n \r\n ) : null\r\n }\r\n onExpandedChange={this.onExpandedChange}\r\n expanded={this.state.expanded}\r\n getTdProps={(_: FinalState, rowInfo: RowInfo | undefined) =>\r\n rowInfo?.original.expandable\r\n ? {}\r\n : { class: 'rt-td rt-expandable non-expandable' }\r\n }\r\n />\r\n this.setState({ selectedRow: {} })}\r\n userData={this.state.selectedRow}\r\n />\r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const {\r\n user,\r\n manageTraining,\r\n training: { coursesByID }\r\n } = state;\r\n\r\n const tableData: (ImanageTrainingProgress & {\r\n expandable?: boolean;\r\n subRows?: ImanageTrainingProgress[];\r\n })[] = [];\r\n\r\n if (manageTraining.trainingProgress)\r\n Object.values(manageTraining.trainingProgress).forEach(progress => {\r\n const foundRow = tableData.find(\r\n row =>\r\n row.courseID === progress.courseID &&\r\n row.userID === progress.userID\r\n );\r\n\r\n if (foundRow) {\r\n if (foundRow.subRows && foundRow.subRows.length)\r\n foundRow.subRows.push(progress);\r\n else {\r\n foundRow.expandable = true;\r\n foundRow.subRows = [progress];\r\n }\r\n } else tableData.push(progress);\r\n });\r\n\r\n tableData.sort((a, b) => a.userName.localeCompare(b.userName));\r\n\r\n return {\r\n user,\r\n coursesByID,\r\n manageTraining,\r\n loading: selectIsLoading(state),\r\n tableData,\r\n tableFilters: state.manageTraining.tableFilters\r\n };\r\n};\r\n\r\nexport default withTranslation('manageTraining')(\r\n connect(mapStateToProps, {\r\n getManageTraining,\r\n setTableFilter,\r\n closeAllModals,\r\n loadCourses\r\n })(ManageTraining)\r\n);\r\n","import React, { useEffect, useState } from 'react';\r\nimport { IUserTrainingDataProps } from './UserTrainingDataModal';\r\nimport { Button, Col, ListGroup, Row, Well } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { IPropsCommonModal } from './CommonModal';\r\nimport { isEmpty } from 'lodash';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport API from '../../constants/apiEndpoints';\r\nimport { msalFetch } from '../auth/Auth-Utils';\r\nimport { ITrainingItem } from '../../models';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst UserTrainingDataListView: React.FC = ({ onHide, userId, t }) => {\r\n const [tableData, setTableData] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n useEffect(() => {\r\n // Perform the API call\r\n const fetchData = async () => {\r\n try {\r\n const url = API.GET.training.classMarker(userId);\r\n const response = await msalFetch(url, {\r\n method: 'get'\r\n } as AxiosRequestConfig);\r\n const data = response.data;\r\n\r\n // Update the tableData state with the received data\r\n setTableData(data);\r\n } catch (error) {\r\n console.error('Error fetching data:', error);\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n fetchData();\r\n }, [userId]); // Run the effect whenever the userId prop changes\r\n\r\n const TrainingListItem = ({ entity }: { entity: ITrainingItem }) => {\r\n const className = 'list-group-item new-product-item';\r\n return (\r\n
  • \r\n

    \r\n \r\n {entity.testName}\r\n \r\n

    \r\n

    Score: {entity.score}

    \r\n

    \r\n Passed:{' '}\r\n \r\n

    \r\n
  • \r\n );\r\n };\r\n\r\n return (\r\n
    \r\n \r\n {t('trainingHistory')}\r\n

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n {tableData.map((entity: ITrainingItem) => (\r\n \r\n ))}\r\n \r\n {isEmpty(tableData) && (\r\n \r\n \r\n {t('noUserTrainingFound')}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n
    \r\n );\r\n};\r\n\r\nexport default UserTrainingDataListView;\r\n","/*\r\n * Edit Facility Modal\r\n * responsible for editing a facility\r\n * this modal is rendered inside the UserQueueForm component because we pass the selectedCustomer\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from './WithCommonModal';\r\nimport { IinitialState } from '../../reducers';\r\nimport UserTrainingDataListView from './UserTrainingDataListView';\r\n\r\nexport interface IUserTrainingDataProps {\r\n modalClass?: string;\r\n secondModal?: boolean;\r\n userId: string;\r\n}\r\n\r\nconst defaultProps = {\r\n className: 'edit-faciity',\r\n wideModal: true\r\n};\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: IUserTrainingDataProps & WithTranslation\r\n) => {\r\n let title = ownProps.t('trainingHistory');\r\n\r\n return {\r\n ...defaultProps,\r\n ...ownProps,\r\n title\r\n };\r\n};\r\n\r\nexport default withTranslation('user')(\r\n connect(mapStateToProps, {})(WithCommonModal(UserTrainingDataListView))\r\n);\r\n","import React, { useMemo } from 'react';\r\nimport { useEffect, useState } from 'react';\r\nimport CommonModal from '../common/CommonModal';\r\nimport { Row, Col, Button, ListGroup } from 'react-bootstrap';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n getPurchasedTraining,\r\n loadCourses\r\n} from '../../actions/trainingActions';\r\nimport { IinitialState } from '../../reducers';\r\nimport { Ioption, Iuser } from '../../models';\r\nimport { GFCourse } from '../../models';\r\nimport { AbstractControl, FormGenerator } from 'react-reactive-form';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport API from '../../constants/apiEndpoints';\r\nimport { msalFetch } from '../auth/Auth-Utils';\r\nimport { beginAjaxCall, endAjaxCall } from '../../actions/ajaxStatusActions';\r\nimport { _FAILED, _SUCCESS } from '../../actions/actionTypes';\r\nimport { constants } from '../../constants/constants';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\ninterface Iprops {\r\n show: boolean;\r\n selectedUser: Iuser | undefined;\r\n onHide: () => void;\r\n}\r\n\r\nconst EditUserTrainingForm = (props: Iprops) => {\r\n const { show, selectedUser, onHide } = props;\r\n const dispatch = useDispatch();\r\n const { t } = useTranslation();\r\n const { coursesByID, purchasedTraining } = useSelector(\r\n ({ training: { coursesByID, purchasedTraining } }: IinitialState) => ({\r\n coursesByID,\r\n purchasedTraining\r\n })\r\n );\r\n\r\n const [filteredCourses, setFilteredCourses] = useState([]);\r\n const [form, setForm] = useState();\r\n\r\n useEffect(() => {\r\n if (selectedUser?.id) {\r\n dispatch(getPurchasedTraining(selectedUser.id));\r\n dispatch(loadCourses(selectedUser));\r\n }\r\n }, [selectedUser]);\r\n\r\n useEffect(() => {\r\n setFilteredCourses(\r\n Object.values(coursesByID).filter(c =>\r\n purchasedTraining.includes(c.id)\r\n )\r\n );\r\n }, [coursesByID, purchasedTraining]);\r\n\r\n const fieldConfig = useMemo(() => {\r\n const courseOptions: Ioption[] = Object.values(coursesByID)\r\n .filter(c => !purchasedTraining.includes(c.id))\r\n .map(c => ({ value: c.id, label: c.name }));\r\n\r\n const formControls = {\r\n courseID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: courseOptions,\r\n label: t('user:availableCourses'),\r\n colWidth: 12,\r\n isMulti: false,\r\n name: 'courseID',\r\n isClearable: true\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n }\r\n },\r\n purchaseOrderNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('user:poNumber'),\r\n colWidth: 6,\r\n type: 'text',\r\n name: 'purchaseOrderNumber'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n }\r\n }\r\n };\r\n\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...formControls }\r\n },\r\n t\r\n );\r\n }, [selectedUser, filteredCourses, purchasedTraining, coursesByID]);\r\n\r\n const onMount = (form: AbstractControl) => {\r\n setForm(form);\r\n };\r\n\r\n const purchaseTraining = async (\r\n event: React.MouseEvent\r\n ) => {\r\n event.preventDefault();\r\n\r\n if (form && selectedUser) {\r\n if (form.status === 'VALID') {\r\n const {\r\n courseID: { value: courseID, label: courseName },\r\n purchaseOrderNumber: PONumber\r\n } = form.value;\r\n const { id: userID } = selectedUser;\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { userID, PONumber, courseID }\r\n };\r\n\r\n const url = API.POST.user.saveTrainingPO;\r\n\r\n try {\r\n dispatch(beginAjaxCall());\r\n await msalFetch(url, axiosOptions);\r\n dispatch(getPurchasedTraining(selectedUser.id));\r\n form.reset();\r\n dispatch(endAjaxCall());\r\n toastr.success(\r\n 'Course Purchased',\r\n `${courseName} purchased successfully`\r\n );\r\n } catch (err) {\r\n dispatch(endAjaxCall());\r\n constants.handleError(err, 'Purchase Training');\r\n }\r\n } else toastr.error(t('user:validationError'));\r\n }\r\n };\r\n\r\n return (\r\n \r\n
    \r\n \r\n
    \r\n

    {t('user:purchaseAdditionalCourses')}

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

    {t('user:ownedCourses')}

    \r\n \r\n {filteredCourses && filteredCourses.length ? (\r\n filteredCourses.map((c, index) => (\r\n \r\n

    {c.name}

    \r\n \r\n ))\r\n ) : (\r\n

    {t('user:noCoursesPurchased')}

    \r\n )}\r\n
    \r\n \r\n \r\n \r\n {t('user:cancel')}\r\n \r\n \r\n
    \r\n \r\n );\r\n};\r\n\r\nexport default EditUserTrainingForm;\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport {\r\n IfacilityWithoutBuildings,\r\n ImanageUserReducer,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport {\r\n getUserManage,\r\n setTableFilter,\r\n toggleSecurityFunctionsModal\r\n} from '../../actions/manageUserActions';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport { addQuery, hasQuery } from '../common/OtherUtils';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport CommonModal from '../common/CommonModal';\r\nimport EditUserModal from './EditUserModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport queryString from 'query-string';\r\n\r\n/*\r\n * The New User Manage\r\n */\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport SecurityFunctionsList from './SecurityFunctionsList';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { values } from 'lodash';\r\nimport { setSelectedUserID } from '../../actions/manageUserActions';\r\nimport moment from 'moment';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getAllBrands } from '../../actions/manageBrandActions';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { loadCountries } from '../../actions/countriesActions';\r\nimport { getUsersCountries } from '../../reducers/userReducer';\r\n\r\ninterface RowInfoEdited extends RowInfo {\r\n original: Iuser;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n loading: boolean;\r\n countries: any[];\r\n usersCountries: any[];\r\n dispatch: Function;\r\n}\r\n\r\nexport enum manageUserQueryParamsEnum {\r\n selectedUserID = 'selectedUserID'\r\n}\r\n\r\nexport enum UserType {\r\n Hospital = 1,\r\n Contractor,\r\n Plumber,\r\n Engineer,\r\n Internal,\r\n SurgeryCenter\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n toggleSecurityFunctionsModal: typeof toggleSecurityFunctionsModal;\r\n getUserManage: typeof getUserManage;\r\n closeAllModals: typeof closeAllModals;\r\n userManage: ImanageUserReducer;\r\n showEditUserModal: boolean;\r\n showEditFacilityModal: boolean;\r\n showSecurityFunctionsModal: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: Iuser[];\r\n setSelectedUserID: typeof setSelectedUserID;\r\n queryParams: typeof manageUserQueryParamsEnum;\r\n getAllBrands: any;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n}\r\n\r\nclass UserManageChild extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public searchFieldConfig: FieldConfig;\r\n public buttonInAction = false;\r\n private setTableFilterTimeout: any;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile,\r\n columns: []\r\n };\r\n this.searchFieldConfig = this.buildSearchControls();\r\n }\r\n componentDidMount() {\r\n const { countries } = this.props;\r\n loadCountries(this.props.dispatch, countries);\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname),\r\n columns: this.setColumns()\r\n });\r\n\r\n // refresh the userManage every time the component mounts\r\n this.props.getUserManage();\r\n this.props.getAllBrands();\r\n }\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditUserModal !== this.props.showEditUserModal &&\r\n !this.props.showEditUserModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n console.info(\r\n 'user manage filters changed',\r\n prevProps.tableFilters,\r\n this.props.tableFilters\r\n );\r\n this.props.getUserManage();\r\n this.setState({ selectedRow: null });\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n // if (\r\n // JSON.stringify(prevProps.customers) !==\r\n // JSON.stringify(this.props.customers)\r\n // ) {\r\n // this.setState({ columns: this.setColumns() });\r\n // }\r\n this.searchFieldConfig = this.buildSearchControls();\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n /*\r\n * Set Columns sets columns to state\r\n * setting columns here in order to reset them if and after we receive customers\r\n */\r\n setColumns = () => {\r\n return TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'name',\r\n Header: 'name',\r\n // accessor: \"user\",\r\n Cell: (row: any) => (\r\n \r\n {row.original.first} {row.original.last}\r\n \r\n )\r\n },\r\n {\r\n Header: 'email',\r\n accessor: 'email',\r\n minWidth: 190\r\n },\r\n {\r\n Header: 'manager',\r\n accessor: ({ hasTeamMembers }: Iuser) => {\r\n return hasTeamMembers ? 'Yes' : 'No';\r\n },\r\n id: 'manager',\r\n width: 100\r\n },\r\n {\r\n Header: 'login',\r\n accessor: ({ lastLoginDate }: Iuser) => {\r\n return lastLoginDate\r\n ? moment\r\n .utc(lastLoginDate)\r\n .local(true)\r\n .format('DD-MMM-YY LT')\r\n : 'n/a';\r\n },\r\n id: 'login'\r\n }\r\n ],\r\n this.props.t\r\n );\r\n };\r\n\r\n handleSelectUser = (id: string) => {\r\n addQuery(\r\n manageUserQueryParamsEnum.selectedUserID,\r\n id,\r\n this.props.history\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfoEdited | undefined) => {\r\n // console.info(\"ROWINFO\", rowInfo);\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.handleSelectUser(rowInfo.original.id);\r\n }\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : '',\r\n color: rowInfo.original.isActive\r\n ? ''\r\n : constants.colors.greyText\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'countryID':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({\r\n countryID: value ?? '',\r\n page: 1\r\n });\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'userType':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({\r\n userType: value ?? '',\r\n page: 1\r\n });\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n getFacilities = (tableData: Iuser[]) => {\r\n const data = tableData.reduce(\r\n (\r\n carry: { [key: string]: IfacilityWithoutBuildings },\r\n user: Iuser\r\n ) => {\r\n if (!user.facilities) {\r\n return carry;\r\n }\r\n\r\n const facilities: {\r\n [key: string]: IfacilityWithoutBuildings;\r\n } = user.facilities.reduce((\r\n // eslint-disable-next-line no-shadow\r\n carry: { [key: string]: IfacilityWithoutBuildings },\r\n facility: IfacilityWithoutBuildings\r\n ) => {\r\n return {\r\n ...carry,\r\n [facility.id]: facility\r\n };\r\n }, {});\r\n\r\n return {\r\n ...carry,\r\n ...facilities\r\n };\r\n },\r\n {}\r\n );\r\n\r\n return data;\r\n };\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const { countries, usersCountries } = this.props;\r\n\r\n const countriesOptions = countries\r\n .filter(c => usersCountries?.includes(c.id))\r\n .map(c => ({ label: c.name, value: c.id }));\r\n\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: this.props.tableFilters.search\r\n }\r\n },\r\n userType: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'manageUser:userType',\r\n options: FormUtil.convertEnumToOptions(UserType),\r\n colWidth: 2,\r\n type: 'select',\r\n placeholder: 'manageUser:userTypePlaceholder',\r\n defaultValue: this.props.tableFilters.userType,\r\n isClearable: true\r\n }\r\n },\r\n countryID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'manageUser:country',\r\n colWidth: 4,\r\n colWidthMedium: 4,\r\n colWidthLarge: 4,\r\n placeholder: 'manageUser:countryPlaceholder',\r\n name: 'country',\r\n defaultValue: this.props.tableFilters.countryID,\r\n isClearable: true\r\n }\r\n }\r\n };\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n render() {\r\n const { t, tableData } = this.props;\r\n const facilities = this.getFacilities(tableData);\r\n\r\n return (\r\n
    \r\n \r\n \r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n page={this.props.tableFilters.page - 1}\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.userManage.totalPages}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n \r\n\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\n/*\r\n * AddCustomerModal will connect to redux, impliment CommonModal, as well as AddCustomerForm\r\n */\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageUserQueryParamsEnum;\r\n\r\n return {\r\n user: state.user,\r\n userManage: state.manageUser,\r\n loading: selectIsLoading(state),\r\n showEditUserModal: hasQuery(\r\n manageUserQueryParamsEnum.selectedUserID,\r\n ownProps.history\r\n ),\r\n queryParams,\r\n showEditFacilityModal: state.showEditFacilityModal,\r\n showSecurityFunctionsModal: state.showSecurityFunctionsModal,\r\n tableData: values(state.manageUser.usersByID),\r\n tableFilters: state.manageUser.tableFilters,\r\n countries: getCountries(state),\r\n usersCountries: getUsersCountries(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('manageUser')(\r\n connect(mapStateToProps, {\r\n getUserManage,\r\n toggleSecurityFunctionsModal,\r\n closeAllModals,\r\n setTableFilter,\r\n setSelectedUserID,\r\n getAllBrands\r\n })(UserManageChild)\r\n);\r\n","import { TFunction } from 'i18next';\r\nimport { filter, includes, map } from 'lodash';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n Iuser,\r\n Ioption,\r\n IfacilityWithoutBuildings,\r\n IcountryBE\r\n} from '../../models';\r\nimport { userTypeEnum } from '../../models-enums';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\nimport { convertFacillitiesToOptionsWithAllProperties } from '../../reducers/facilitiesReducer';\r\nimport { FormUtil } from '../common/FormUtil';\r\n\r\n/*\r\n * formValuesToItem - convert the formValues to the shape of the selectedObjec\r\n * Currently taking this literally. Could potentially optimize this but have the user object is nice.\r\n */\r\nexport const editUserFormValuesToItem = ({\r\n updatedValue,\r\n formValues,\r\n facilitiesByID,\r\n selectedUser\r\n}: {\r\n updatedValue?: IgenericFormValues;\r\n formValues: any;\r\n facilitiesByID: { [key: string]: IfacilityWithoutBuildings };\r\n selectedUser: Iuser;\r\n}): Iuser => {\r\n if (updatedValue) {\r\n formValues = { ...formValues, ...updatedValue };\r\n }\r\n let userType;\r\n if (formValues.type) {\r\n userType = formValues.type.value;\r\n } else {\r\n userType = userTypeEnum.Hospital;\r\n }\r\n\r\n const facilities: IfacilityWithoutBuildings[] = Object.values(\r\n facilitiesByID\r\n );\r\n let postalCodes;\r\n if (formValues.postalCodes) {\r\n postalCodes = formValues.postalCodes.map((pCode: Ioption) => {\r\n return {\r\n userID: selectedUser.id,\r\n postalCode: pCode.value\r\n };\r\n });\r\n }\r\n\r\n const convertedFormValues = FormUtil.getValues(formValues);\r\n return {\r\n ...selectedUser,\r\n ...convertedFormValues,\r\n securityFunctions:\r\n (convertedFormValues.securityFunctions as string[]) || [],\r\n facilities,\r\n postalCodes,\r\n type: userType\r\n };\r\n};\r\n\r\n/*\r\n * itemToFormValues - take the selectedItem and convert it to formValues\r\n */\r\n\r\nexport const editUserItemToFormValues = (\r\n {\r\n user,\r\n securityOptions,\r\n salesManagerOptions,\r\n t\r\n }: {\r\n user: Iuser;\r\n securityOptions?: Ioption[];\r\n salesManagerOptions?: Ioption[];\r\n t: TFunction;\r\n },\r\n allCountries: IcountryBE[] = []\r\n): IgenericFormValues => {\r\n const {\r\n postalCodes,\r\n facilities,\r\n securityFunctions,\r\n countryID,\r\n salesManagerID,\r\n type,\r\n userCountries: countries\r\n } = user;\r\n\r\n const selectedUserType = {\r\n value: type,\r\n label: userTypeEnum[type]\r\n };\r\n const facilityOptionsWithAddress = convertFacillitiesToOptionsWithAllProperties(\r\n facilities\r\n );\r\n let selectedPostalCodes: any[] = [];\r\n if (postalCodes && postalCodes[0] !== null) {\r\n selectedPostalCodes = postalCodes.map(postalCode => ({\r\n value: postalCode.postalCode,\r\n label: postalCode.postalCode\r\n }));\r\n }\r\n let selectedSalesManager = { label: '', value: '' };\r\n if (salesManagerID && salesManagerOptions) {\r\n const foundManagerOption = salesManagerOptions.find(\r\n option => option.value === salesManagerID\r\n );\r\n if (foundManagerOption) {\r\n selectedSalesManager = {\r\n label: foundManagerOption.label,\r\n value: salesManagerID\r\n };\r\n }\r\n }\r\n const userSecurityFunctionsWithNames = filter(\r\n securityOptions,\r\n (sec: any) => {\r\n return includes(securityFunctions, sec.value);\r\n }\r\n );\r\n const securityfunctionsArrayTranslated = map(\r\n userSecurityFunctionsWithNames,\r\n option => ({\r\n value: option.value,\r\n label: t(option.label)\r\n })\r\n );\r\n\r\n const selectedCountries =\r\n !countries || countries.length === 0 ? [countryID] : countries;\r\n\r\n let countryOptions;\r\n if (allCountries.length) {\r\n countryOptions = selectedCountries.map(sc => {\r\n const fullCountry = allCountries.find(c => c.id === sc);\r\n return {\r\n label: fullCountry?.name || '',\r\n value: fullCountry?.id || ''\r\n };\r\n });\r\n } else {\r\n countryOptions = selectedCountries.map(c => constants.countries[c]); //todo: remove this else, everything should be using the countries from the BE, not the static json file\r\n }\r\n return {\r\n ...user,\r\n userCountries: countryOptions,\r\n type: selectedUserType,\r\n postalCodes: selectedPostalCodes,\r\n facilities: facilityOptionsWithAddress,\r\n securityFunctions: securityfunctionsArrayTranslated,\r\n countryID,\r\n salesManagerID: selectedSalesManager\r\n };\r\n};\r\n","import { debounce, omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport { loadCountries } from '../../actions/countriesActions';\r\nimport {\r\n getSecurityUsers,\r\n saveUser,\r\n toggleSecurityFunctionsModal,\r\n updateSelectedUser\r\n} from '../../actions/manageUserActions';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n Icountry,\r\n Ifacility,\r\n IfacilityWithoutBuildings,\r\n Ihistory,\r\n Ioption,\r\n IproductInfo,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n UserCurrency,\r\n UserFlowUnits,\r\n UserPowerUnits,\r\n UserVacuumUnits,\r\n userLanguageEnum,\r\n userPressureUnits,\r\n userTempUnits,\r\n userTypeEnum\r\n} from '../../models-enums';\r\nimport { IgenericFieldControls, IgenericFormValues } from '../../modelsForms';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { convertFacillitiesToOptionsWithCountryID } from '../../reducers/facilitiesReducer';\r\nimport EditFacilityModal from '../common/EditFacilityModal';\r\nimport {\r\n FormUtil,\r\n MultiValueLabel,\r\n MultiValueOption\r\n} from '../common/FormUtil';\r\nimport { userBaseConfigControls } from '../common/UserBaseConfigControls';\r\nimport UserTrainingDataModal from '../common/UserTrainingDataModal';\r\nimport EditUserTrainingForm from './EditUserTrainingForm';\r\nimport {\r\n editUserFormValuesToItem,\r\n editUserItemToFormValues\r\n} from './EditUserUtils';\r\nimport { manageUserQueryParamsEnum } from './ManageUserChild';\r\nimport { Link, useLocation } from 'react-router-dom';\r\n\r\ninterface Iprops {\r\n user: Iuser;\r\n selectedUser: Iuser;\r\n history: Ihistory;\r\n loading: boolean;\r\n colorButton: string;\r\n getSecurityUsers: typeof getSecurityUsers;\r\n salesManagerOptions: Ioption[];\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => Promise;\r\n toggleEditFacilityModal: typeof toggleEditFacilityModal;\r\n toggleSecurityFunctionsModal: typeof toggleSecurityFunctionsModal;\r\n queryParams: typeof manageUserQueryParamsEnum;\r\n onChange: typeof updateSelectedUser;\r\n facilitiesByID: { [key: string]: IfacilityWithoutBuildings };\r\n onSubmit: typeof saveUser;\r\n securityOptions: Ioption[];\r\n facilityOptionsWithAddress: Ioption[];\r\n closeModal: () => void;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n productInfo: IproductInfo;\r\n}\r\n\r\nconst engineerValidators = [\r\n Validators.pattern('^[0-9A-Za-z]+$'),\r\n Validators.minLength(1),\r\n Validators.maxLength(8)\r\n];\r\n\r\nconst EditUserForm = (props: Iprops & WithTranslation) => {\r\n const {\r\n securityOptions,\r\n selectedUser,\r\n salesManagerOptions,\r\n facilitiesByID,\r\n colorButton,\r\n loading,\r\n t\r\n } = props;\r\n const [form, setForm] = React.useState();\r\n const [showTrainingModal, setShowTrainingModal] = React.useState(\r\n false\r\n );\r\n const [showUserTrainingForm, setShowUserTrainingForm] = React.useState<\r\n boolean\r\n >(false);\r\n const allCountries = useSelector(getCountries);\r\n const dispatch = useDispatch();\r\n\r\n const itemToFormValues = React.useCallback(() => {\r\n return editUserItemToFormValues(\r\n {\r\n user: selectedUser,\r\n securityOptions,\r\n salesManagerOptions,\r\n t\r\n },\r\n allCountries\r\n );\r\n }, [selectedUser, allCountries]);\r\n\r\n const [formValues, setFormValues] = React.useState<\r\n IgenericFormValues\r\n >(itemToFormValues());\r\n\r\n const hasSalesManager = (securityFunctions: Array) => {\r\n const salesServiceId = constants.securityFunctions.SalesService.id;\r\n const salesPartsId = constants.securityFunctions.SalesParts.id;\r\n let salesManager = false;\r\n\r\n securityFunctions.forEach(sf => {\r\n if (sf === salesServiceId || sf === salesPartsId) {\r\n salesManager = true;\r\n }\r\n });\r\n\r\n return salesManager;\r\n };\r\n\r\n const canEditSAPValues = () => {\r\n const manageAllUsersId = constants.securityFunctions.ManageAllUsers.id;\r\n const currentUserSecurityFunctions = props.user.securityFunctions;\r\n\r\n const hasAllSecurityFunctions = [manageAllUsersId].every(id =>\r\n currentUserSecurityFunctions.includes(id)\r\n );\r\n\r\n return hasAllSecurityFunctions;\r\n };\r\n\r\n const loadFacilitiesOptions = debounce(\r\n (searchTerm: string, callback: any) => {\r\n if (searchTerm.length < 3) {\r\n const facilities = Object.values(facilitiesByID).reduce(\r\n (\r\n carry: IfacilityWithoutBuildings[],\r\n facility: IfacilityWithoutBuildings\r\n ) => {\r\n if (formValues.countryID === facility.countryID) {\r\n carry.push(facility);\r\n }\r\n\r\n return carry;\r\n },\r\n []\r\n );\r\n callback(convertFacillitiesToOptionsWithCountryID(facilities));\r\n return;\r\n }\r\n const usersCountries = (Array.isArray(formValues.userCountries)\r\n ? formValues.userCountries\r\n : []) as Ioption[];\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n usersCountries.map(c => (c.value ? c.value : '')),\r\n null,\r\n callback,\r\n () => {\r\n return;\r\n }\r\n );\r\n }\r\n );\r\n\r\n React.useEffect(() => {\r\n // Get Security users\r\n loadCountries(dispatch, allCountries);\r\n props.getSecurityUsers([constants.securityFunctions.SalesManager.id]);\r\n\r\n return () => {\r\n props.onChange();\r\n };\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (!form) {\r\n return;\r\n }\r\n\r\n const countryControl = form.get('countryID');\r\n const countriesControl = form.get('userCountries');\r\n\r\n countriesControl.valueChanges.subscribe(\r\n (usersCountries: Icountry[]) => {\r\n const usersCountry = form.get('countryID')?.value?.value;\r\n if (\r\n usersCountries === null ||\r\n !usersCountries.find(c => c.value === usersCountry)\r\n ) {\r\n countryControl.setValue('');\r\n }\r\n const facilitiesFrom = form.get('facilities');\r\n if (usersCountries === null) {\r\n facilitiesFrom.setValue([]);\r\n } else {\r\n const facilities: Ifacility[] = facilitiesFrom.value;\r\n const newFacilites = facilities.filter(\r\n f =>\r\n usersCountries.find(\r\n c => c.value === f.countryID\r\n ) !== undefined\r\n );\r\n facilitiesFrom.setValue(newFacilites);\r\n }\r\n }\r\n );\r\n form.valueChanges.subscribe((values: any) => {\r\n // not sure why we need to keep track of this, the values are already in the form object\r\n setFormValues({\r\n ...formValues,\r\n ...values,\r\n countryID: values?.countryID?.value\r\n });\r\n });\r\n\r\n return () => {\r\n countriesControl.valueChanges.unsubscribe(() => {\r\n return;\r\n });\r\n countryControl.valueChanges.unsubscribe(() => {\r\n return;\r\n });\r\n form.valueChanges.unsubscribe(() => {\r\n return;\r\n });\r\n };\r\n }, [form]);\r\n\r\n const fieldConfig = React.useMemo(() => {\r\n const {\r\n postalCodes,\r\n facilities,\r\n securityFunctions,\r\n isActive,\r\n engineerVanID,\r\n sapEngineerID,\r\n salesManagerID,\r\n type,\r\n countryID,\r\n brandID,\r\n userCountries,\r\n sapObjectID,\r\n sapPlant,\r\n sapNonProductiveWorkOrderNumber,\r\n currency,\r\n flowUnits,\r\n powerUnits,\r\n vacuumUnits,\r\n tempUnits,\r\n pressureUnits,\r\n comments\r\n } = formValues;\r\n\r\n const disabled = false;\r\n const languageOptions = FormUtil.convertEnumToOptions(userLanguageEnum);\r\n const activeCountryOption: Ioption = {\r\n value: countryID?.toString() || '',\r\n label: allCountries?.find(c => c.id === countryID)?.name || ''\r\n };\r\n\r\n let cleanBrandID = '';\r\n if (\r\n (brandID as Ioption)?.value !== null &&\r\n (brandID as Ioption)?.value !== undefined\r\n ) {\r\n cleanBrandID = (brandID as Ioption)?.value;\r\n } else {\r\n cleanBrandID = (brandID as string) || '';\r\n }\r\n\r\n let cleanSalesManager: string | Ioption = '';\r\n if (\r\n (salesManagerID as Ioption)?.value !== null &&\r\n (salesManagerID as Ioption)?.value !== undefined &&\r\n (salesManagerID as Ioption)?.value !== ''\r\n ) {\r\n cleanSalesManager = salesManagerID as Ioption;\r\n } else {\r\n cleanSalesManager = '';\r\n }\r\n\r\n const countriesOptions: Ioption[] = allCountries.map(c => ({\r\n label: c.name,\r\n value: c.id\r\n }));\r\n\r\n const tempOptions = FormUtil.convertEnumToOptions(userTempUnits);\r\n const pressureOptions = FormUtil.convertEnumToOptions(\r\n userPressureUnits\r\n );\r\n const vacuumOptions = FormUtil.convertEnumToOptions(UserVacuumUnits);\r\n const powerOptions = FormUtil.convertEnumToOptions(UserPowerUnits);\r\n const flowOptions = FormUtil.convertEnumToOptions(UserFlowUnits);\r\n const currencyOptions = FormUtil.convertEnumToOptions(UserCurrency);\r\n\r\n // User form, show Brands regardless if they are manufacturers or not\r\n const brandOptions = FormUtil.convertToOptions(\r\n props.productInfo.allBrands\r\n );\r\n\r\n // Values from formValues comes back as either an Ioption (object) or as a string | number (weird right?)\r\n let flow =\r\n typeof flowUnits === 'object'\r\n ? flowUnits\r\n : flowOptions.find(x => x.value === flowUnits);\r\n let temp =\r\n typeof tempUnits === 'object'\r\n ? tempUnits\r\n : tempOptions.find(x => x.value === tempUnits);\r\n let pressure =\r\n typeof pressureUnits === 'object'\r\n ? pressureUnits\r\n : pressureOptions.find(x => x.value === pressureUnits);\r\n let vacuum =\r\n typeof vacuumUnits === 'object'\r\n ? vacuumUnits\r\n : vacuumOptions.find(x => x.value === vacuumUnits);\r\n let power =\r\n typeof powerUnits === 'object'\r\n ? powerUnits\r\n : powerOptions.find(x => x.value === powerUnits);\r\n let currencyOption =\r\n typeof currency === 'object'\r\n ? currency\r\n : currencyOptions.find(x => x.value === currency);\r\n\r\n let fieldConfigControls: IgenericFieldControls = {\r\n brandID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: brandOptions,\r\n label: 'common:brand',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n name: 'brandID',\r\n isClearable: true\r\n },\r\n formState: {\r\n value: brandOptions.find(x => x.value === cleanBrandID),\r\n disabled\r\n }\r\n },\r\n userCountries: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n isMulti: true,\r\n options: countriesOptions,\r\n label: 'user:countries',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'countries'\r\n },\r\n formState: { value: userCountries, disabled }\r\n },\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: userCountries,\r\n label: 'user:primaryCountry',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: { value: activeCountryOption, disabled }\r\n },\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(userTypeEnum),\r\n label: 'manageUserQueue:userType',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n name: 'type',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: type === userTypeEnum.None ? '' : type,\r\n disabled\r\n }\r\n },\r\n engineerVanID: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:engineerVanID',\r\n colWidth: 6,\r\n name: 'engineerVanID',\r\n shouldTranslate: true,\r\n required: false\r\n },\r\n options: {\r\n validators: engineerValidators\r\n },\r\n formState: {\r\n value: engineerVanID,\r\n disabled\r\n }\r\n },\r\n sapEngineerID: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:sapEngineerID',\r\n colWidth: 6,\r\n name: 'sapEngineerID',\r\n shouldTranslate: true,\r\n required: false\r\n },\r\n options: {\r\n validators: FormUtil.validators.isLessTenDigitAlphaNumeric\r\n },\r\n formState: {\r\n value: sapEngineerID,\r\n disabled: !canEditSAPValues()\r\n }\r\n },\r\n sapObjectID: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:SAPobjectID',\r\n colWidth: 6,\r\n placeholder: 'manageUserQueue:SAPobjectIDSearchPlaceholder',\r\n name: 'sapObjectID',\r\n required: false\r\n },\r\n options: {\r\n validators: FormUtil.validators.isNumeric\r\n },\r\n formState: {\r\n value: sapObjectID,\r\n disabled: !canEditSAPValues()\r\n }\r\n },\r\n sapPlant: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:SAPPlantID',\r\n colWidth: 6,\r\n placeholder: 'manageUserQueue:SAPPlantIDSearchPlaceholder',\r\n name: 'sapPlant',\r\n required: false\r\n },\r\n options: {\r\n validators: FormUtil.validators.isLessTenDigitAlphaNumeric\r\n },\r\n formState: {\r\n value: sapPlant,\r\n disabled: !canEditSAPValues()\r\n }\r\n },\r\n sapNonProductiveWorkOrderNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:SAPNonProductiveWorkOrderNumber',\r\n colWidth: 12,\r\n placeholder:\r\n 'manageUserQueue:SAPNonProductiveWorkOrderNumberSearchPlaceholder',\r\n name: 'sapNonProductiveWorkOrderNumber',\r\n required: false\r\n },\r\n options: {\r\n validators: FormUtil.validators.isNumeric\r\n },\r\n formState: {\r\n value: sapNonProductiveWorkOrderNumber,\r\n disabled: !canEditSAPValues()\r\n }\r\n },\r\n facilities: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'Facilities',\r\n loadOptions: loadFacilitiesOptions,\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n buttonName: 'manageUserQueue:facilityButton',\r\n buttonAction: props.toggleEditFacilityModal,\r\n isMulti: true,\r\n multiValueLabel: MultiValueLabel,\r\n multiValueOption: MultiValueOption\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: facilities,\r\n disabled\r\n }\r\n },\r\n postalCodes: {\r\n render: FormUtil.CreatableMultiTextInput,\r\n meta: {\r\n label: 'manageUser:manageUserForm.territories',\r\n colWidth: 12,\r\n isMulti: true,\r\n isClearable: true,\r\n menuIsOpen: false,\r\n placeholder:\r\n 'manageUser:manageUserForm.territoryPlaceholder',\r\n initialContent: postalCodes,\r\n style: { fontSize: '120%' }\r\n },\r\n formState: {\r\n value: postalCodes,\r\n disabled\r\n }\r\n },\r\n salesManagerID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'manageUser:manageUserForm.managedBy',\r\n placeholder: 'common:searchPlaceholder',\r\n options: salesManagerOptions.filter(\r\n option => option.value !== selectedUser.id\r\n ),\r\n colWidth: 12,\r\n isMulti: false,\r\n isClearable: true,\r\n name: 'Managed By'\r\n },\r\n formState: {\r\n value: cleanSalesManager,\r\n disabled\r\n }\r\n },\r\n securityFunctions: {\r\n render: FormUtil.SelectWithButton,\r\n meta: {\r\n options: securityOptions,\r\n label: 'manageUser:securityLabel',\r\n colWidth: 12,\r\n placeholder: 'manageUser:securitySearchPlaceholder',\r\n buttonName: 'manageUser:securityButton',\r\n buttonAction: props.toggleSecurityFunctionsModal,\r\n isMulti: true,\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: securityFunctions,\r\n disabled\r\n }\r\n },\r\n isActive: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'user:active', colWidth: 12 },\r\n formState: { value: isActive, disabled }\r\n },\r\n language: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: languageOptions,\r\n label: 'common:language',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:facilitySearchPlaceholder',\r\n isMulti: false,\r\n name: 'language',\r\n last: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: selectedUser.language\r\n ? {\r\n value: selectedUser.language,\r\n label: userLanguageEnum[selectedUser.language]\r\n }\r\n : languageOptions[0], // default to english\r\n disabled: false\r\n }\r\n },\r\n tempUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: tempOptions,\r\n label: 'common:tempatureUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'tempUnits'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: temp, disabled }\r\n },\r\n pressureUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: pressureOptions,\r\n label: 'common:pressureUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'pressureUnits'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: pressure, disabled }\r\n },\r\n vacuumUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: vacuumOptions,\r\n label: 'user:vacuumUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'vacuumUnits'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: vacuum, disabled }\r\n },\r\n powerUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: powerOptions,\r\n label: 'user:powerUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'powerUnits'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: power, disabled }\r\n },\r\n flowUnits: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: flowOptions,\r\n label: 'user:flowUnits',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'flowUnits'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: flow, disabled }\r\n },\r\n currency: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: currencyOptions,\r\n label: 'user:currency',\r\n colWidth: 12,\r\n placeholder: 'common:searchPlaceholder',\r\n isMulti: false,\r\n name: 'currency'\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: { value: currencyOption, disabled }\r\n },\r\n optInGDPR: {\r\n render: FormUtil.Toggle,\r\n meta: { label: 'user:GDPR', colWidth: 12 },\r\n formState: { value: selectedUser.optInGDPR, disabled }\r\n },\r\n comments: {\r\n render: FormUtil.RichTextEditor,\r\n meta: {\r\n label: 'user:comments',\r\n colWidth: 12,\r\n // placeholder: 'user:comments',\r\n name: 'comments',\r\n required: false,\r\n initialContent: comments ? comments : ''\r\n },\r\n formState: {\r\n value: comments ? comments : '',\r\n disabled: disabled\r\n }\r\n }\r\n };\r\n\r\n // remove the postalCodes control when it is NOT a salesManager\r\n\r\n if (hasSalesManager(selectedUser.securityFunctions) === false) {\r\n fieldConfigControls = omit(fieldConfigControls, 'salesManagerID');\r\n fieldConfigControls = omit(fieldConfigControls, 'postalCodes');\r\n }\r\n\r\n const getBaseControls = () => {\r\n // needed because of requirement that countries comes before country\r\n const baseControls = omit(userBaseConfigControls(formValues), [\r\n 'countryID'\r\n ]);\r\n\r\n // user email is not editable on this page.\r\n if (\r\n baseControls &&\r\n baseControls.email &&\r\n baseControls.email.formState\r\n )\r\n baseControls.email.formState.disabled = true;\r\n\r\n return baseControls;\r\n };\r\n\r\n const config: FieldConfig = {\r\n controls: {\r\n ...getBaseControls(),\r\n ...fieldConfigControls\r\n }\r\n };\r\n\r\n return FormUtil.translateForm(config, t);\r\n }, [\r\n formValues.userCountries,\r\n formValues.countryID,\r\n allCountries,\r\n props.productInfo.brandOptions\r\n ]);\r\n\r\n const formValuesToItem = (): Iuser => {\r\n const updatedUser = editUserFormValuesToItem({\r\n updatedValue: form?.value,\r\n formValues,\r\n facilitiesByID: props.facilitiesByID,\r\n selectedUser: props.selectedUser\r\n });\r\n\r\n const facilities = form?.value?.facilities?.reduce(\r\n (carry: any, facilityOption: any) => {\r\n carry.push({\r\n id: facilityOption.value,\r\n name: facilityOption.label\r\n });\r\n return carry;\r\n },\r\n []\r\n );\r\n\r\n return {\r\n ...updatedUser,\r\n countryID: form?.value?.countryID?.value,\r\n facilities\r\n };\r\n };\r\n\r\n const handleSubmit = (\r\n e: React.MouseEvent,\r\n shouldApprove?: boolean\r\n ) => {\r\n e.preventDefault();\r\n\r\n if (form?.status === 'INVALID') {\r\n form?.markAsSubmitted();\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n // List of the facility objects tied to the user, can be a mixture of new and existing, the new ones that haven't been saved yet should have a minimum of valud (id) and countryID\r\n const facilities = form?.value?.facilities;\r\n let toSubmit = formValuesToItem();\r\n let anyError = false;\r\n\r\n (Object.keys(toSubmit) as (keyof Iuser)[]).forEach(key => {\r\n if (key.includes('ID') && toSubmit[key] == '') {\r\n toSubmit = {\r\n ...toSubmit,\r\n [key]: null\r\n };\r\n }\r\n });\r\n\r\n // Verify that each country has at least one facility\r\n toSubmit.userCountries.every((countryID: string) => {\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n const countryObject = allCountries.find(c => c.id === countryID)!;\r\n\r\n // Now loop through the assigned facilities, if we don't find one for this country, jump out and throw an error\r\n let foundFacility = false;\r\n facilities.every(\r\n (facility: { value: string; countryID: string }) => {\r\n if (facility.countryID === countryObject.id) {\r\n foundFacility = true;\r\n return false; // break out of the loop, we're good\r\n }\r\n\r\n return true; // keep looping\r\n }\r\n );\r\n\r\n // No facility found, throw an error\r\n if (!foundFacility) {\r\n anyError = true;\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n props.t(\r\n 'Please select at least 1 facility for ' +\r\n countryObject.name\r\n ),\r\n constants.toastrError\r\n );\r\n return false; // break out of the loop, and show error\r\n }\r\n\r\n return true; // keep looping\r\n });\r\n\r\n //There is no field to update userStandards in this form. So set userStandards to existing values, or an empty array.\r\n toSubmit.userStandards = props.user.userStandards || [];\r\n\r\n if (!anyError) {\r\n props.onSubmit(toSubmit, selectedUser);\r\n props.closeModal();\r\n }\r\n };\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n {\r\n setShowUserTrainingForm(true);\r\n }}\r\n bsStyle={colorButton}\r\n >\r\n {t('manageTraining')}\r\n \r\n \r\n \r\n \r\n {t('cancel')}\r\n \r\n \r\n {t('save')}\r\n \r\n \r\n \r\n {\r\n return;\r\n }}\r\n refreshTable={() => {\r\n return;\r\n }}\r\n />\r\n {\r\n setShowTrainingModal(false);\r\n return;\r\n }}\r\n />\r\n {\r\n setShowUserTrainingForm(false);\r\n }}\r\n />\r\n
    \r\n );\r\n};\r\n\r\nexport default EditUserForm;\r\n","/*\r\n * The HeaderMenu only displays if we have an authenticated user.\r\n * It is responsible for displaying the welcome message and the dropdown menu for logged in users\r\n * spinner is from : http://tobiasahlin.com/spinkit/\r\n */\r\n\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport {\r\n getSecurityUsers,\r\n saveUser,\r\n toggleSecurityFunctionsModal,\r\n updateSelectedUser\r\n} from '../../actions/manageUserActions';\r\n\r\nimport EditUserForm from './EditUserForm';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { selectSecurityUsers } from '../../reducers/manageUserReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { manageUserQueryParamsEnum } from './ManageUserChild';\r\nimport { IfacilityWithoutBuildings, Ihistory } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { hasQuery, removeQuery } from '../common/OtherUtils';\r\nimport { selectFacilityOptionsWithAddress } from '../../reducers/facilitiesReducer';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { initialUser } from '../../reducers/initialState';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n queryParams: typeof manageUserQueryParamsEnum;\r\n history: Ihistory;\r\n queryKey: string;\r\n facilitiesByID: { [key: string]: IfacilityWithoutBuildings };\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedUser =\r\n state.manageUser.usersByID[ownProps.queryParams.selectedUserID] ||\r\n initialUser;\r\n // define the closeModal function here in mapState so that we can pass it to both the main component and\r\n // to the onHide which is a WithCommonModal HOC prop\r\n // yes it is unusual to pass a function in mapState, but it is ok since it does not need dispatch\r\n const closeModal = () => {\r\n removeQuery(manageUserQueryParamsEnum.selectedUserID, ownProps.history);\r\n };\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n // these customers are filtered by country; request for it is made when modal is opened\r\n securityOptions: FormUtil.convertToOptions(constants.securityFunctions),\r\n salesManagerOptions: FormUtil.convertToOptions(\r\n selectSecurityUsers(state)\r\n ),\r\n show: hasQuery(\r\n manageUserQueryParamsEnum.selectedUserID,\r\n ownProps.history\r\n ),\r\n showEditFacilityModal: state.showEditFacilityModal,\r\n selectedUser,\r\n title: ownProps.t('editUserModalTitle'),\r\n className: 'user-edit',\r\n facilitiesByID: ownProps.facilitiesByID,\r\n facilityOptionsWithAddress: selectFacilityOptionsWithAddress(state),\r\n closeModal,\r\n onHide: closeModal,\r\n productInfo: state.productInfo\r\n };\r\n};\r\n\r\nexport default withTranslation('user')(\r\n connect(mapStateToProps, {\r\n getFacilitiesByCountry,\r\n toggleEditFacilityModal,\r\n toggleSecurityFunctionsModal,\r\n getSecurityUsers,\r\n onChange: updateSelectedUser,\r\n onSubmit: saveUser,\r\n searchFacilitiesForAsyncSelect\r\n })(WithCommonModal(EditUserForm))\r\n);\r\n","/*\r\n * list the security functions\r\n */\r\nimport * as React from 'react';\r\nimport { ListGroup, ListGroupItem, Col, Button } from 'react-bootstrap';\r\nimport { map } from 'lodash';\r\nimport { constants } from '../../constants/constants';\r\n\r\nconst SecurityFunctionsList = (props: any) => {\r\n return (\r\n
    \r\n \r\n {map(constants.securityFunctions, func => (\r\n \r\n {props.t(func.description)}\r\n \r\n ))}\r\n \r\n \r\n \r\n {props.t('common:cancel')}\r\n \r\n \r\n
    \r\n );\r\n};\r\n\r\nexport default SecurityFunctionsList;\r\n","import React from 'react';\r\nimport ManageUserChild from './ManageUserChild';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nconst ManageUser: React.FC = props => {\r\n const dispatch = useDispatch();\r\n\r\n return ;\r\n};\r\n\r\nexport default ManageUser;\r\n","// import { toastr } from 'react-redux-toastr';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport { ItableFiltersParams, Iuser, IuserQueue, ThunkResult } from '../models';\r\nimport { beginAjaxCall, endAjaxCall } from './ajaxStatusActions';\r\nimport API from '../constants/apiEndpoints';\r\nimport { constants } from '../constants/constants';\r\nimport * as types from './actionTypes';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { initialUserQueue } from '../reducers/initialState';\r\nimport { saveUser } from './manageUserActions';\r\n\r\ninterface IuserModified extends Omit {\r\n customers: Array<{ id: string; name: string }>;\r\n facilities: Array<{ id: string; name: string }>;\r\n}\r\n\r\nexport function getUserQueue(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n search,\r\n countryID\r\n } = getState().manageUserQueue.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page,\r\n search,\r\n countryID: countryID?.value || '',\r\n sort: 'createDate,desc'\r\n }\r\n };\r\n\r\n const url = API.GET.user.getuserqueue;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.USER_QUEUE_SUCCESS,\r\n queue: data.data.result\r\n });\r\n dispatch({\r\n type: types.USER_QUEUE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_QUEUE_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get user queue');\r\n });\r\n };\r\n}\r\n\r\nfunction handleApproveUser(userQueueID: string, dispatch: any) {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { id: userQueueID }\r\n };\r\n\r\n const url = API.POST.user.approve;\r\n return msalFetch(url, axiosOptions).then(\r\n (data: AxiosResponse) => {\r\n dispatch(endAjaxCall());\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({ type: types.USER_APPROVE_SUCCESS, userQueueID });\r\n return data;\r\n }\r\n },\r\n (error: any) => {\r\n dispatch(endAjaxCall());\r\n dispatch({ type: types.USER_APPROVE_FAILED, error, axiosOptions });\r\n constants.handleError(error, 'approve user');\r\n throw error;\r\n }\r\n );\r\n}\r\n\r\nexport function approveUser(userQueueID: string): any {\r\n return (dispatch: any, getState: any) => {\r\n // dispatch(beginAjaxCall());\r\n return handleApproveUser(userQueueID, dispatch);\r\n };\r\n}\r\n\r\n// export function anotherThunkAction(): ThunkResult> {\r\n// return (dispatch, getState) => {\r\n// return Promise.resolve(true);\r\n// }\r\n// }\r\nexport function rejectUser(userQueueID: string) {\r\n return (dispatch: any, getState: any) => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { id: userQueueID }\r\n };\r\n\r\n const url = API.POST.user.reject;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n dispatch({ type: types.USER_REJECT_SUCCESS, userQueueID });\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_REJECT_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'reject user');\r\n throw error; // throw again so we can handle it in manageUserQueue\r\n });\r\n };\r\n}\r\n\r\nexport const updateSelectedUserQueue = (userQueue = initialUserQueue) => ({\r\n type: types.USER_QUEUE_UPDATE_SELECTED,\r\n payload: userQueue\r\n});\r\n\r\nexport function saveQueueUser(\r\n userQueue: IuserQueue,\r\n shouldApprove: boolean\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const saveUserWithoutType = saveUser as any;\r\n const saveUserWithPromiseType = saveUserWithoutType as (\r\n user: Iuser\r\n ) => Promise;\r\n dispatch(saveUserWithPromiseType(userQueue.user))\r\n .then(() => {\r\n dispatch({\r\n type: types.USER_QUEUE_SAVE_SUCCESS,\r\n user: userQueue.user,\r\n queueID: userQueue.id\r\n });\r\n\r\n if (shouldApprove) {\r\n handleApproveUser(userQueue.id, dispatch); // don't return this because if we do, we will see two errors\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.USER_QUEUE_SAVE_FAILED,\r\n error\r\n });\r\n constants.handleError(error, 'update queue user');\r\n });\r\n };\r\n}\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_USER_QUEUE,\r\n filters\r\n});\r\n","import * as React from 'react';\r\nimport * as moment from 'moment';\r\n\r\nimport {\r\n ImanageUserQueueReducer,\r\n IuserQueue,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo, SortingRule } from 'react-table';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n approveUser,\r\n getUserQueue,\r\n rejectUser,\r\n setTableFilter\r\n} from '../../actions/manageUserQueueActions';\r\nimport { emptyTile } from '../../reducers/initialState';\r\nimport queryString from 'query-string';\r\n\r\nimport { Banner } from '../common/Banner';\r\n/*\r\n * The New User Queue\r\n */\r\nimport { Button } from 'react-bootstrap';\r\nimport EditQueueUserModal from './EditQueueUserModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { values } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { addQuery } from '../common/OtherUtils';\r\n\r\nexport enum manageUserQueueQueryParamsEnum {\r\n selectedUserQueueID = 'selectedUserQueueID'\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n // Add your regular properties here\r\n\r\n showEditQueueUserModal: boolean;\r\n showEditFacilityModal: boolean;\r\n loading: boolean;\r\n userQueue: ImanageUserQueueReducer;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n queryParams: typeof manageUserQueueQueryParamsEnum;\r\n setQueueSearch: (value: string) => Promise;\r\n approveUser: typeof approveUser;\r\n rejectUser: (value: string) => Promise;\r\n getUserQueue: typeof getUserQueue;\r\n closeAllModals: typeof closeAllModals;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n tableData: IuserQueue[];\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n}\r\n\r\nclass ManageUserQueue extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n public columns: any[];\r\n public buttonInAction = false;\r\n private setTableFilterTimeout: any;\r\n private searchFieldConfig: FieldConfig;\r\n\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: null,\r\n currentTile: emptyTile\r\n };\r\n this.columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'name',\r\n Header: 'name',\r\n accessor: 'user',\r\n Cell: (row: any) => (\r\n \r\n {row.value.first} {row.value.last}\r\n \r\n )\r\n },\r\n {\r\n Header: 'email',\r\n accessor: 'user.email',\r\n minWidth: 110\r\n },\r\n {\r\n Header: 'country',\r\n id: 'country',\r\n accessor: ({ user }: IuserQueue) => {\r\n if (user.countryID) {\r\n return (\r\n constants.countries[user.countryID].label || ''\r\n );\r\n } else {\r\n return '';\r\n }\r\n }\r\n },\r\n {\r\n Header: 'created',\r\n accessor: ({ user }: { user: Iuser }) => {\r\n return moment\r\n .utc(user.createDate)\r\n .local(true)\r\n .format('DD-MMM-YY LT');\r\n },\r\n id: 'created'\r\n },\r\n {\r\n Header: 'approve',\r\n accessor: 'id',\r\n Cell: this.ApproveCell,\r\n maxWidth: 90\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.searchFieldConfig = {\r\n controls: {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 4,\r\n type: 'text',\r\n placeholder: 'searchPlaceholder',\r\n defaultValue: this.props.tableFilters.search\r\n }\r\n },\r\n country: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n label: 'common:country',\r\n options: FormUtil.convertToOptions(\r\n Object.values(constants.countries)\r\n ),\r\n colWidth: 3,\r\n type: 'select',\r\n placeholder: 'countrySearchPlaceholder',\r\n defaultValue: this.props.tableFilters.countryID,\r\n isClearable: true\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.props.getUserQueue();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditQueueUserModal !==\r\n this.props.showEditQueueUserModal &&\r\n !this.props.showEditQueueUserModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getUserQueue();\r\n this.setState({ selectedRow: null });\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n\r\n // handleTableProps(state: any, rowInfo: any, column: any, instance: any) {\r\n\r\n // }\r\n ApproveCell = (row: any) => {\r\n return (\r\n
    \r\n ) => {\r\n this.buttonInAction = true;\r\n this.props\r\n .approveUser(row.value)\r\n .then((blah: any) => {\r\n this.buttonInAction = false;\r\n })\r\n .catch((err: any) => {\r\n this.buttonInAction = false;\r\n });\r\n }}\r\n >\r\n \r\n \r\n ) => {\r\n this.buttonInAction = true;\r\n this.props\r\n .rejectUser(row.value)\r\n .then((blah: any) => {\r\n this.buttonInAction = false;\r\n })\r\n .catch((err: any) => {\r\n this.buttonInAction = false;\r\n });\r\n }}\r\n >\r\n \r\n \r\n
    \r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n // console.info(\"ROWINFO\", rowInfo);\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (!this.buttonInAction) {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n addQuery(\r\n manageUserQueueQueryParamsEnum.selectedUserQueueID,\r\n rowInfo.original.id,\r\n this.props.history\r\n );\r\n }\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * get the next or previous page of data. the table is 0 indexed but the API is not\r\n */\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the table filters to redux on each value change\r\n */\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ search: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n break;\r\n case 'country':\r\n clearTimeout(this.setTableFilterTimeout);\r\n this.setTableFilterTimeout = setTimeout(() => {\r\n this.props.setTableFilter({ countryID: value, page: 1 }); // this causes performance issues so we use a rudamentary debounce\r\n }, constants.tableSearchDebounceTime);\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the sorted changes to redux\r\n */\r\n onSortedChanged = (\r\n newSorted: SortingRule[],\r\n column: any,\r\n shiftKey: boolean\r\n ) => {\r\n this.props.setTableFilter({ sorted: newSorted });\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n render(): JSX.Element {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n = 10\r\n ? this.props.tableData.length\r\n : 10\r\n }\r\n page={this.props.tableFilters.page - 1}\r\n manual // Forces table not to paginate or sort automatically, so we can handle it server-side\r\n pages={this.props.userQueue.totalPages}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n \r\n\r\n {/* the EditFacility Modal is rendered inside the UserQueueForm because we need to pass the selected customer */}\r\n
    \r\n );\r\n }\r\n}\r\n\r\n/*\r\n * AddCustomerModal will connect to redux, impliment CommonModal, as well as AddCustomerForm\r\n */\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageUserQueueQueryParamsEnum;\r\n\r\n return {\r\n user: state.user,\r\n userQueue: state.manageUserQueue,\r\n loading: selectIsLoading(state),\r\n showEditFacilityModal: state.showEditFacilityModal,\r\n tableData: values(state.manageUserQueue.userQueuesByID),\r\n tableFilters: state.manageUserQueue.tableFilters,\r\n queryParams\r\n };\r\n};\r\n\r\nexport default withTranslation('manageUserQueue')(\r\n connect(mapStateToProps, {\r\n getUserQueue,\r\n approveUser,\r\n rejectUser,\r\n closeAllModals,\r\n setTableFilter\r\n })(ManageUserQueue)\r\n);\r\n","import { debounce } from 'lodash';\r\nimport * as React from 'react';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n ValidatorFn,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\nimport {\r\n FacilitiesSearchParams,\r\n searchFacilitiesForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport {\r\n saveQueueUser,\r\n updateSelectedUserQueue\r\n} from '../../actions/manageUserQueueActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { Icountry, Ifacility, Ioption, Iuser, IuserQueue } from '../../models';\r\nimport { userTypeEnum } from '../../models-enums';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\nimport EditFacilityModal from '../common/EditFacilityModal';\r\nimport {\r\n FormUtil,\r\n MultiValueLabel,\r\n MultiValueOption\r\n} from '../common/FormUtil';\r\nimport { userBaseConfigControls } from '../common/UserBaseConfigControls';\r\nimport {\r\n editUserFormValuesToItem,\r\n editUserItemToFormValues\r\n} from '../manageUser/EditUserUtils';\r\nimport { manageUserQueueQueryParamsEnum } from './ManageUserQueue';\r\n\r\ninterface Iprops {\r\n loading: boolean;\r\n colorButton: string;\r\n getFacilitiesByCountry: (params: FacilitiesSearchParams) => Promise;\r\n facilityOptionsWithAddress: Ioption[];\r\n toggleEditFacilityModal: typeof toggleEditFacilityModal;\r\n onSubmit: typeof saveQueueUser;\r\n approveUser: (userQueueID: string) => void;\r\n selectedUserQueue: IuserQueue;\r\n facilitiesByID: { [key: string]: Ifacility };\r\n closeModal: () => void;\r\n onChange: typeof updateSelectedUserQueue;\r\n queryParams: typeof manageUserQueueQueryParamsEnum;\r\n originalUserQueue: IuserQueue;\r\n searchFacilitiesForAsyncSelect: typeof searchFacilitiesForAsyncSelect;\r\n}\r\n\r\nconst buildAddress = (user: Iuser) => {\r\n const { tempAddress, tempAddress2, tempZip, tempState, tempCity } = user;\r\n if (!tempAddress || (tempAddress && !tempAddress.length)) {\r\n return '';\r\n }\r\n if (tempAddress2) {\r\n return `${tempAddress} ${tempAddress2} ${tempCity} ${tempState} ${tempZip}`;\r\n }\r\n return `${tempAddress} ${tempCity} ${tempState} ${tempZip}`;\r\n};\r\n\r\nconst UserQueueForm = (props: Iprops & WithTranslation) => {\r\n const { t, selectedUserQueue } = props;\r\n const [form, setForm] = React.useState();\r\n\r\n const itemToFormValues = React.useCallback(() => {\r\n const { user } = selectedUserQueue;\r\n return editUserItemToFormValues({ user, t });\r\n }, []);\r\n\r\n const [formValues, setFormValues] = React.useState<\r\n IgenericFormValues\r\n >(itemToFormValues());\r\n const { facilities, engineerVanID, type, countryID } = formValues;\r\n\r\n React.useEffect(() => {\r\n if (!form) {\r\n return;\r\n }\r\n\r\n form.valueChanges.subscribe((values: any) => {\r\n // If the country changed, we need to remove all facilities.\r\n if (values?.countryID?.value !== countryID) {\r\n values.facilities = [];\r\n }\r\n\r\n setFormValues({\r\n ...values,\r\n countryID: values?.countryID?.value\r\n });\r\n });\r\n\r\n return () => {\r\n form.valueChanges.unsubscribe(() => {});\r\n };\r\n }, [form]);\r\n\r\n const getEngineerValidators = (value: any): ValidatorFn[] => {\r\n // For non US - 2 digit number\r\n // for US - 4 characters alphanumeric\r\n if (value?.value === constants.ukCountryID) {\r\n return [\r\n Validators.pattern('^[0-9]+$'),\r\n Validators.maxLength(3),\r\n Validators.minLength(3)\r\n ];\r\n } else if (value?.value !== constants.usCountryID) {\r\n return [\r\n Validators.pattern('^[0-9]+$'),\r\n Validators.maxLength(2),\r\n Validators.minLength(2)\r\n ];\r\n } else {\r\n return [\r\n Validators.pattern('^[0-9A-Za-z]+$'),\r\n Validators.maxLength(4),\r\n Validators.minLength(4)\r\n ];\r\n }\r\n };\r\n const loadOptions = debounce((searchTerm, callback) => {\r\n if (searchTerm.length < 3) {\r\n callback([]);\r\n return;\r\n }\r\n\r\n const countryID = formValues.countryID?.toString() || '';\r\n\r\n props.searchFacilitiesForAsyncSelect(\r\n searchTerm,\r\n countryID,\r\n null,\r\n callback,\r\n () => {}\r\n );\r\n }, 100);\r\n\r\n const fieldConfig = React.useMemo(() => {\r\n const disabled = false;\r\n const providedAddress = buildAddress(selectedUserQueue.user);\r\n const { tempCompany } = selectedUserQueue.user;\r\n // If the user has been saved and this modal is re-opened\r\n const selectedUserType = selectedUserQueue.user.type;\r\n // This allows placeholder to show up if userType has not been selected\r\n\r\n let typeU = type;\r\n if (selectedUserType) {\r\n typeU = {\r\n value: selectedUserType,\r\n label: userTypeEnum[selectedUserType]\r\n };\r\n } else {\r\n typeU = undefined;\r\n }\r\n\r\n const engineerValidation = getEngineerValidators(countryID);\r\n const selectedCountry: Icountry | null = countryID\r\n ? constants.countries[countryID.toString()]\r\n : null;\r\n\r\n // Field config to configure form\r\n const fieldConfigControls = {\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: constants.countries,\r\n label: 'user:country',\r\n colWidth: 12,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: { value: selectedCountry, disabled }\r\n },\r\n facilities: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'common:facility',\r\n loadOptions,\r\n colWidth: 12,\r\n placeholder: 'facilitySearchPlaceholder',\r\n buttonName: 'facilityButton',\r\n buttonAction: props.toggleEditFacilityModal,\r\n isMulti: true,\r\n multiValueLabel: MultiValueLabel,\r\n multiValueOption: MultiValueOption\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: facilities,\r\n disabled\r\n }\r\n },\r\n type: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(userTypeEnum),\r\n label: 'userType',\r\n colWidth: 12,\r\n placeholder: 'facilitySearchPlaceholder',\r\n name: 'type',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: typeU,\r\n disabled\r\n }\r\n },\r\n engineerVanID: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'manageUser:engineerVanID',\r\n colWidth: 6,\r\n name: 'engineerVanID',\r\n shouldTranslate: true,\r\n required: false\r\n },\r\n options: {\r\n validators: engineerValidation\r\n },\r\n formState: {\r\n value: engineerVanID,\r\n disabled\r\n }\r\n },\r\n providedCompany: {\r\n render: FormUtil.TextLabel,\r\n meta: { label: 'providedCompany', colWidth: 12 },\r\n formState: { value: tempCompany, disabled }\r\n },\r\n providedAddress: {\r\n render: FormUtil.TextLabel,\r\n meta: { label: 'providedAddress', colWidth: 12 },\r\n formState: { value: providedAddress, disabled }\r\n }\r\n };\r\n const fieldConf: FieldConfig = {\r\n controls: {\r\n ...userBaseConfigControls(itemToFormValues()),\r\n ...fieldConfigControls\r\n }\r\n };\r\n\r\n return FormUtil.translateForm(fieldConf, props.t);\r\n }, [\r\n props.facilityOptionsWithAddress,\r\n formValues.countryID,\r\n selectedUserQueue\r\n ]);\r\n\r\n const formValuesToItem = (\r\n updatedValue?: IgenericFormValues\r\n ): IuserQueue => {\r\n const updatedUser = editUserFormValuesToItem({\r\n updatedValue: form?.value,\r\n formValues,\r\n facilitiesByID: props.facilitiesByID,\r\n selectedUser: selectedUserQueue.user\r\n });\r\n\r\n const facilities = form?.value?.facilities?.reduce(\r\n (carry: any, facilityOption: any) => {\r\n carry.push({\r\n id: facilityOption.value,\r\n name: facilityOption.label\r\n });\r\n return carry;\r\n },\r\n []\r\n );\r\n return {\r\n ...selectedUserQueue,\r\n user: {\r\n ...updatedUser,\r\n countryID: form?.value?.countryID?.value,\r\n facilities\r\n }\r\n };\r\n };\r\n\r\n const handleSubmit = (\r\n e: React.MouseEvent,\r\n shouldApprove = false\r\n ) => {\r\n e.preventDefault();\r\n if (form?.status === 'INVALID') {\r\n form?.markAsSubmitted();\r\n toastr.error(\r\n props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n let toSubmit = formValuesToItem();\r\n\r\n (Object.keys(toSubmit.user) as (keyof Iuser)[]).forEach(key => {\r\n if (key.includes('ID') && toSubmit.user[key] == '') {\r\n toSubmit.user = {\r\n ...toSubmit.user,\r\n [key]: null\r\n };\r\n }\r\n });\r\n\r\n props.onSubmit(toSubmit, shouldApprove);\r\n props.closeModal();\r\n };\r\n\r\n const manager = selectedUserQueue.user.manager || {\r\n first: '',\r\n last: ''\r\n };\r\n\r\n const formClassName = `clearfix beacon-form queue-form ${props.colorButton}`;\r\n\r\n return (\r\n
    \r\n
    \r\n {selectedUserQueue && selectedUserQueue.user.managerID && (\r\n \r\n
    \r\n \r\n
    \r\n {manager.first} \r\n {manager.last}\r\n
    \r\n
    \r\n \r\n )}\r\n \r\n\r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n handleSubmit(e, true)}\r\n >\r\n {t('saveApprove')}\r\n \r\n \r\n \r\n {\r\n return;\r\n }}\r\n refreshTable={() => {\r\n return;\r\n }}\r\n />\r\n
    \r\n );\r\n};\r\n\r\nexport default UserQueueForm;\r\n","/*\r\n * The HeaderMenu only displays if we have an authenticated user.\r\n * It is responsible for displaying the welcome message and the dropdown menu for logged in users\r\n * spinner is from : http://tobiasahlin.com/spinkit/\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\n\r\nimport {\r\n getFacilitiesByCountry,\r\n searchFacilitiesForAsyncSelect,\r\n toggleEditFacilityModal\r\n} from '../../actions/commonActions';\r\nimport {\r\n saveQueueUser,\r\n approveUser,\r\n updateSelectedUserQueue\r\n} from '../../actions/manageUserQueueActions';\r\nimport EditQueueUserForm from './EditQueueUserForm';\r\nimport { selectFacilityOptionsWithAddress } from '../../reducers/facilitiesReducer';\r\nimport { initialUserQueue } from '../../reducers/initialState';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { Ihistory } from '../../models';\r\nimport { manageUserQueueQueryParamsEnum } from './ManageUserQueue';\r\nimport { hasQuery, removeQuery } from '../common/OtherUtils';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n queryParams: typeof manageUserQueueQueryParamsEnum;\r\n history: Ihistory;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const originalUserQueue =\r\n state.manageUserQueue.userQueuesByID[\r\n ownProps.queryParams.selectedUserQueueID\r\n ] || initialUserQueue;\r\n // define the closeModal function here in mapState so that we can pass it to both the main component and\r\n // to the onHide which is a WithCommonModal HOC prop\r\n // yes it is unusual to pass a function in mapState, but it is ok since it does not need dispatch\r\n const closeModal = () => {\r\n removeQuery(\r\n manageUserQueueQueryParamsEnum.selectedUserQueueID,\r\n ownProps.history\r\n );\r\n };\r\n\r\n const title = ownProps.t('newUserModalTitle');\r\n\r\n return {\r\n closeModal,\r\n loading: selectIsLoading(state),\r\n // these customers are filtered by country; request for it is made when modal is opened\r\n facilityOptionsWithAddress: selectFacilityOptionsWithAddress(state),\r\n title,\r\n show: hasQuery(\r\n manageUserQueueQueryParamsEnum.selectedUserQueueID,\r\n ownProps.history\r\n ),\r\n showEditFacilityModal: state.showEditFacilityModal,\r\n facilitiesByID: state.facilities,\r\n selectedUserQueue: originalUserQueue,\r\n originalUserQueue,\r\n className: 'user-edit',\r\n onHide: closeModal\r\n };\r\n};\r\n\r\nexport default withTranslation('manageUserQueue')(\r\n connect(mapStateToProps, {\r\n getFacilitiesByCountry,\r\n toggleEditFacilityModal,\r\n approveUser,\r\n onChange: updateSelectedUserQueue,\r\n onSubmit: saveQueueUser,\r\n searchFacilitiesForAsyncSelect\r\n })(WithCommonModal(EditQueueUserForm))\r\n);\r\n","import {\r\n IeditFacilityFormValues,\r\n IfacilityContractFormValues,\r\n IinstallFormValues,\r\n IpartFormValues,\r\n IsearchProductFormValues,\r\n IworkOrderFormValues\r\n} from './modelsForms';\r\n\r\nimport { PointOptionsObject } from 'highcharts';\r\nimport * as H from 'history';\r\nimport { SortingRule } from 'react-table';\r\nimport { Action } from 'redux';\r\nimport { ThunkAction } from 'redux-thunk';\r\nimport { svgIcons } from './constants/svgIcons';\r\nimport {\r\n DocumentGroups,\r\n ReportChapterStatus,\r\n ReportChapterType,\r\n dataFormatEnum,\r\n dataFormatTemperatureEnum,\r\n dataUnitEnum,\r\n facilitySiteSizeEnum,\r\n jobDefaultTypeEnum,\r\n jobTypesIdEnumInverse,\r\n measurementSystemEnum,\r\n productCommunicationMethodEnum,\r\n widgetsEnum\r\n} from './models-enums';\r\nimport { IinitialState } from './reducers';\r\n\r\n/* ***** Common between Mobile and Desktop ****** */\r\n\r\nexport type Ihistory = H.History;\r\n\r\nexport interface Iuser extends IbaseDataObject {\r\n countryID: string; // current active country\r\n country?: Icountry;\r\n userCountries: string[]; // all possible countries user may work in\r\n email: string;\r\n engineerVanID?: string;\r\n sapEngineerID?: string;\r\n facilities: IfacilityWithoutBuildings[];\r\n first: string;\r\n hasTeamMembers: boolean;\r\n isActive: boolean;\r\n last: string;\r\n lastLoginDate?: string;\r\n LastLoginDate?: string;\r\n manager?: any;\r\n managerID?: string;\r\n brandID?: string;\r\n phone: string;\r\n position: string;\r\n postalCodes?: IpostalCode[];\r\n salesManager?: any;\r\n salesManagerID: string;\r\n securityFunctions: string[];\r\n tempAddress?: string;\r\n tempAddress2?: string;\r\n tempCity?: string;\r\n tempCompany?: string;\r\n tempPassword?: string;\r\n tempState?: string;\r\n tempZip?: string;\r\n type: number;\r\n widgets: string;\r\n language?: number;\r\n tempUnits?: number;\r\n pressureUnits?: number;\r\n sapPlant?: string;\r\n sapNonProductiveWorkOrderNumber?: number;\r\n sapObjectID?: number;\r\n userStandards: string[];\r\n\r\n flowUnits?: number;\r\n vacuumUnits?: number;\r\n powerUnits?: number;\r\n phoneExtension?: string;\r\n phoneCountryCode?: string;\r\n mobilePhoneCountryCode?: string;\r\n mobilePhone?: string;\r\n comments?: string;\r\n currency?: string;\r\n optInGDPR: boolean;\r\n}\r\n\r\nexport interface IsensorData {\r\n time: Date;\r\n originator: string;\r\n eventName: string;\r\n value: string;\r\n}\r\n\r\nexport interface IpostalCode extends IbaseDataObject {\r\n userID: string;\r\n postalCode: string;\r\n}\r\n\r\nexport interface IsapJobMapping {\r\n sapBusinessIndicator: string;\r\n isVirtual: boolean;\r\n jobTypeID: string;\r\n serviceCenter: string;\r\n sapMaterialNumber: string;\r\n isDefault: boolean;\r\n}\r\n\r\nexport interface ItempUser {\r\n email: string;\r\n first: string;\r\n last: string;\r\n position: string;\r\n tempAddress: string;\r\n tempAddress2: string;\r\n tempCity: string;\r\n tempState: string;\r\n tempZip: string;\r\n countryID: string;\r\n phoneCountryCode?: string;\r\n}\r\n\r\nexport interface IsecurityFunction {\r\n id: string;\r\n name: string;\r\n description: string;\r\n}\r\n\r\nexport interface IbaseDataObject {\r\n id: string;\r\n createDate?: string;\r\n updateDate?: string;\r\n creatorID?: string;\r\n updaterID?: string;\r\n isDeleted: boolean;\r\n}\r\n\r\nexport interface ImainCategory extends IbaseDataObject {\r\n name: string;\r\n id: string;\r\n}\r\n\r\nexport interface Isubcategory extends IbaseDataObject {\r\n mainCategoryID: string;\r\n mainCategory: IbaseDataObject;\r\n name: string;\r\n}\r\n\r\nexport interface Istandard extends IbaseDataObject {\r\n name: string;\r\n}\r\n\r\nexport interface Ibrand extends IbaseDataObject {\r\n code: string;\r\n name: string;\r\n url?: string;\r\n comments?: string;\r\n address?: string;\r\n address2?: string;\r\n city?: string;\r\n state?: string;\r\n postalCode?: string;\r\n phoneNumber?: string;\r\n logo?: string;\r\n logoPath?: string;\r\n reportEmail?: string; // comma delimited list\r\n sendReportToCustomers?: boolean;\r\n replyToEmail?: string;\r\n countryID?: string;\r\n isManufacturer: boolean;\r\n}\r\n\r\nexport interface IproductType extends IbaseDataObject {\r\n code: string;\r\n mainCategoryIDs: string[];\r\n name: string;\r\n}\r\n\r\nexport interface Ipower extends IbaseDataObject {\r\n name: string;\r\n}\r\n\r\nexport interface IsystemSize extends IbaseDataObject {\r\n code: string;\r\n mainCategoryIDs: string[];\r\n name: string;\r\n}\r\n\r\nexport interface IinstallBase extends IbaseDataObject {\r\n productID: string;\r\n facilityID: string;\r\n nickname?: string;\r\n remarks?: string;\r\n serialNumber?: string;\r\n rfid?: string;\r\n installDate?: string;\r\n prodDate?: string;\r\n buildingID?: string;\r\n floorID?: string;\r\n locationID?: string;\r\n roomID?: string;\r\n quantity?: number;\r\n position?: string;\r\n system?: number;\r\n importedLocation?: string;\r\n workOrders?: IWorkOrder[];\r\n measurementPointListResultStatus: number;\r\n workOrderResultStatus: number;\r\n visibleStatus: number; // FE only - a combination of measurementPointListResultStatus and workOrderResultStatus\r\n latestWorkOrderID: string;\r\n latestWorkOrder?: IWorkOrder;\r\n latestMeasurementPointListResultID: string;\r\n latestMeasurementPointListResult?: ImeasurementPointResult;\r\n lastQuarterlyMaintenanceDate: string;\r\n lastSixMonthMaintenanceDate: string;\r\n lastYearlyMaintenanceDate: string;\r\n lastTwoYearMaintenanceDate: string;\r\n lastThreeYearMaintenanceDate: string;\r\n lastFiveYearMaintenanceDate: string;\r\n fullLocation?: string;\r\n mostRecentStatus?: number;\r\n sapEquipmentNumber?: string;\r\n}\r\n\r\nexport interface IinstallBasePopulated extends IinstallBase {\r\n product: Iproduct;\r\n productNameString: string; // front end only\r\n locationString: string; // FE only\r\n workOrders: IWorkOrder[];\r\n latestMeasurementPointListResult: ImeasurementPointResult;\r\n}\r\n\r\nexport interface IproductLink extends IbaseDataObject {\r\n productID: string;\r\n url: string;\r\n type: number;\r\n other: string;\r\n}\r\n\r\nexport interface ITrainingItem {\r\n certificateUrl: string;\r\n cmEmail: string;\r\n cmFirst: string;\r\n cmLast: string;\r\n cmUserID: string;\r\n createDate: string;\r\n finished: number;\r\n id: string;\r\n isDeleted: boolean;\r\n passed: boolean;\r\n score: number;\r\n started: number;\r\n testID: number;\r\n testName: string;\r\n updateDate: string | null;\r\n}\r\n\r\nexport interface Iproduct extends IbaseDataObject {\r\n name: string;\r\n sku: string;\r\n description: string;\r\n imagePath: string;\r\n subcategoryID: string;\r\n brandID: string;\r\n productTypeID: string;\r\n powerID: string;\r\n systemSizeID: string;\r\n subcategory?: Isubcategory;\r\n origin: string;\r\n notes: string;\r\n installBases?: IinstallBase[];\r\n quantity: number;\r\n isApproved: boolean;\r\n mergedProductID: string;\r\n isCompliant: boolean;\r\n hasSpares: boolean;\r\n isActive: boolean;\r\n communicationMethod: productCommunicationMethodEnum;\r\n installBasesCount?: number; // front end only\r\n links: IproductLink[];\r\n sapMaterialNumber?: string;\r\n isFinalProduct: boolean;\r\n productStandards: IproductStandard[];\r\n}\r\n\r\nexport interface IproductStandard extends IbaseDataObject {\r\n productID: string;\r\n standardID: string;\r\n}\r\n\r\n/*\r\n * Location Models\r\n */\r\nexport interface Ibuilding extends IbaseDataObject {\r\n name: string;\r\n floors: Ifloor[];\r\n facilityID: string;\r\n}\r\n\r\nexport interface Ifloor extends IbaseDataObject {\r\n name: string;\r\n locations: Ilocation[];\r\n buildingID: string;\r\n}\r\n\r\nexport interface Ilocation extends IbaseDataObject {\r\n name: string;\r\n rooms: Iroom[];\r\n floorID: string;\r\n}\r\n\r\nexport interface Iroom extends IbaseDataObject {\r\n name: string;\r\n locationID: string;\r\n}\r\n\r\nexport interface IproductInfo {\r\n brands: { [key: string]: Ibrand }; // Filtered brands (manufacturers only)\r\n allBrands: { [key: string]: Ibrand }; // New property for all brands\r\n productTypes: { [key: string]: IproductType };\r\n mainCategories: { [key: string]: ImainCategory };\r\n powers: { [key: string]: Ipower };\r\n standards: { [key: string]: Istandard };\r\n subcategories: { [key: string]: Isubcategory };\r\n systemSizes: { [key: string]: IsystemSize };\r\n brandOptions: Ioption[];\r\n allBrandOptions: Ioption[];\r\n originOptions: Ioption[];\r\n productTypeOptions: Ioption[];\r\n mainCategoryOptions: Ioption[];\r\n powerOptions: Ioption[];\r\n standardOptions: Ioption[];\r\n subcategoryOptions: Ioption[];\r\n systemSizeOptions: Ioption[];\r\n}\r\n\r\nexport interface IuserJob extends IbaseDataObject {\r\n userID: string;\r\n jobID: string;\r\n user?: Iuser;\r\n}\r\n\r\nexport interface IjobWorkOrder extends IbaseDataObject {\r\n job?: Ijob;\r\n jobID: string;\r\n workOrderID: string;\r\n workOrder?: IWorkOrder;\r\n}\r\n\r\nexport interface AssignedUser {\r\n first: string;\r\n last: string;\r\n email: string;\r\n language: number;\r\n tempUnits: number;\r\n pressureUnits: number;\r\n isApproved: boolean;\r\n isActive: boolean;\r\n widgets: string;\r\n tempPassword: string | null;\r\n tempCompany: string | null;\r\n tempAddress: string | null;\r\n tempAddress2: string | null;\r\n tempCity: string | null;\r\n tempState: string | null;\r\n tempZip: string | null;\r\n type: number;\r\n countryID: string;\r\n managerID: string | null;\r\n salesManagerID: string | null;\r\n engineerVanID: string;\r\n sapEngineerID: string;\r\n position: string;\r\n phone: string;\r\n lastLoginDate: string;\r\n country: string | null;\r\n securityFunctions: string | null;\r\n hasTeamMembers: boolean;\r\n facilities: string | null;\r\n postalCodes: string | null;\r\n importErrors: string | null;\r\n manager: string | null;\r\n salesManager: string | null;\r\n id: string;\r\n isDeleted: boolean;\r\n createDate: string;\r\n updateDate: string;\r\n}\r\n\r\nexport interface Ijob extends IbaseDataObject {\r\n facilityID: string;\r\n assignedUserID: string;\r\n assignedUser?: AssignedUser;\r\n jobTypeID: string;\r\n userJobs: IuserJob[];\r\n startDate: string;\r\n endDate: string;\r\n status: string;\r\n jobNumber: string;\r\n facility?: Ifacility;\r\n jobWorkOrders?: IjobWorkOrder[];\r\n fseNotes: string;\r\n}\r\n\r\nexport interface Iphoto extends IbaseDataObject {\r\n src: string;\r\n width: number;\r\n height: number;\r\n name: string;\r\n comments: string;\r\n file: string;\r\n fileType: number;\r\n id: string;\r\n installBaseID: string;\r\n isDeleted: boolean;\r\n isInReport: boolean;\r\n jobID: string;\r\n lightboxUrl: string;\r\n thumbnailUrl: string;\r\n createDate: string;\r\n updateDate: string;\r\n installBase: IinstallBase;\r\n product: Iproduct;\r\n productID: string;\r\n originalUrl?: string;\r\n isNew?: boolean; // FE only\r\n}\r\n\r\nexport interface IleadInstallBase extends IbaseDataObject {\r\n installBaseID: string;\r\n leadID: string;\r\n installBase?: IinstallBase;\r\n}\r\n\r\nexport interface IleadUser extends IbaseDataObject {\r\n assignedDueToMissingCoverage: boolean;\r\n userID: string;\r\n leadID: string;\r\n user?: Iuser;\r\n}\r\n\r\nexport interface IleadUserPopulated extends IleadUser {\r\n user: Iuser;\r\n}\r\n\r\nexport interface Ilead extends IbaseDataObject {\r\n contactID: string;\r\n contact?: IfacilityContact;\r\n facility?: Ifacility;\r\n facilityID: string;\r\n product?: Iproduct;\r\n productID: string;\r\n leadActivities: any;\r\n leadUsers?: IleadUser[];\r\n leadInstallBases?: IleadInstallBase[];\r\n leadNumber?: number;\r\n ranking: number;\r\n status: number;\r\n type: number;\r\n notes: string;\r\n quote?: Iquote;\r\n quoteID: string;\r\n partHtml: string;\r\n internalComments: string;\r\n}\r\n\r\nexport interface IquoteLead extends IbaseDataObject {\r\n leadID: string;\r\n quoteID: string;\r\n lead: Ilead;\r\n}\r\n\r\nexport interface IleadPopulated extends Ilead {\r\n leadUsers: IleadUserPopulated[];\r\n}\r\n\r\nexport interface IleadActivity extends IbaseDataObject {\r\n type: number;\r\n activityDate: string;\r\n otherType: string;\r\n notes: string;\r\n followUpNote: string;\r\n followUpScheduled: string;\r\n followUpSent: string;\r\n leadID: string;\r\n lead?: Ilead;\r\n userID: string;\r\n user: Iuser;\r\n}\r\n\r\nexport interface Iquote extends IbaseDataObject {\r\n comments: string;\r\n quoteNumber: string;\r\n revision: string;\r\n cloudDocumentID: string;\r\n cloudDocument?: IcloudDocument;\r\n poNumber: string;\r\n signatureUrl: string;\r\n authorizedName: string;\r\n status: number;\r\n leads: IquoteLead[];\r\n tos?: boolean;\r\n poCloudDocument?: IcloudDocument;\r\n signatureCloudDocument?: IcloudDocument;\r\n facility?: Ifacility; // FE only\r\n facilityID?: string; // FE only\r\n poFile?: any; // FE only\r\n signature?: Blob; // FE only\r\n salesUsers?: Iuser[]; // FE only\r\n}\r\n\r\nexport interface IcloudDocument extends IbaseDataObject {\r\n facilityID: string;\r\n filename: string;\r\n fileSize: number;\r\n mimeType: string;\r\n url: string;\r\n container: string;\r\n key: string;\r\n version: string;\r\n name: string;\r\n cloudDocumentTypeID: string;\r\n groupType?: DocumentGroups;\r\n otherGroup?: boolean;\r\n documentID: string;\r\n documentDate: string;\r\n versions?: IcloudDocument[];\r\n isPrimary?: boolean;\r\n countryID: string;\r\n isSystem: boolean;\r\n}\r\n\r\nexport interface IDocumentType {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport interface IAlert extends IbaseDataObject {\r\n title: string;\r\n text: string;\r\n type?: string;\r\n imageUrl: string;\r\n standards: { [key: string]: IbaseDataObject };\r\n expirationDate: string;\r\n isViewed: boolean;\r\n isActive: boolean;\r\n}\r\n\r\nexport interface Itile {\r\n svgKey?: string;\r\n title: string;\r\n src?: string;\r\n srcBanner?: string;\r\n color: 'blue' | 'green' | 'dark' | 'orange' | 'purple' | 'grey';\r\n width: number;\r\n height: number;\r\n url: string;\r\n securityFunctions: string[];\r\n description: string;\r\n shouldHideOnDashboard?: boolean;\r\n shouldHideOnMenu?: boolean;\r\n key?: string;\r\n parentKey: number;\r\n order: number;\r\n}\r\n\r\nexport interface IparentTile {\r\n svgKey?: keyof typeof svgIcons;\r\n imgIconActive?: string;\r\n title: string;\r\n url: string;\r\n key: number;\r\n tiles?: Itile[];\r\n order: number;\r\n}\r\n\r\nexport interface IfacilityWithoutBuildings extends IbaseDataObject {\r\n name: string;\r\n name2: string;\r\n address: string;\r\n address2: string;\r\n city: string;\r\n countryID: string;\r\n state: string;\r\n postalCode: string;\r\n standardID: string;\r\n sapFacilityNumber: string;\r\n preventativeMaintenanceEnabled: boolean;\r\n siteSize?: facilitySiteSizeEnum;\r\n managedByID: string;\r\n leadFSEID?: string;\r\n type?: string;\r\n mgpsSite: boolean;\r\n inspectionProviderID?: string;\r\n maintenanceProviderID?: string;\r\n agslevProviderID?: string;\r\n environmentalTestProviderID?: string;\r\n authorizedPerson: string;\r\n authorizedCompanyID?: string;\r\n website?: string;\r\n comments?: string;\r\n contract?: IfacilityContract;\r\n isApproved: boolean;\r\n}\r\n\r\nexport interface Ifacility extends IfacilityWithoutBuildings {\r\n buildings: Ibuilding[];\r\n}\r\n\r\nexport interface Ioption {\r\n [key: string]: any;\r\n value: string;\r\n label: string;\r\n}\r\n\r\nexport interface IoptionNumberValue {\r\n value: number; // technically this should be a string, but number works just fine\r\n label: string;\r\n}\r\n\r\n/*\r\n * Measurement Points\r\n */\r\nexport interface ImeasurementPointSelectOption extends IbaseDataObject {\r\n value: string;\r\n label: string;\r\n isDefault?: boolean;\r\n}\r\n\r\nexport interface ImeasurementPoint extends IbaseDataObject {\r\n type: number;\r\n label: string;\r\n order: number;\r\n isRequired: boolean;\r\n showInReport: boolean;\r\n guideText?: string;\r\n helpText?: string;\r\n allowNotes: boolean;\r\n passFailDefault?: number;\r\n numericMinValue?: number;\r\n numericMaxValue?: number;\r\n numericAllowDecimals?: boolean;\r\n selectDefaultOptionID?: string;\r\n selectRememberBetweenDevice?: boolean;\r\n selectRememberBetweenInspection?: boolean;\r\n selectOptions?: ImeasurementPointSelectOption[];\r\n jobDefaultType?: jobDefaultTypeEnum;\r\n defaultText: string;\r\n dedicatedReportPage?: boolean;\r\n smartlinkID?: string;\r\n measurementSystem?: measurementSystemEnum;\r\n generateLead?: boolean;\r\n}\r\n\r\nexport interface IsmartlinkDataPoint extends IbaseDataObject {\r\n description: string;\r\n number: number;\r\n stringValue: string;\r\n numericValue?: number;\r\n}\r\n\r\nexport interface ImeasurementPointListTab extends IbaseDataObject {\r\n name: string;\r\n order: number;\r\n measurementPoints: { [key: string]: ImeasurementPoint };\r\n}\r\n\r\nexport interface ImeasurementPointList extends IbaseDataObject {\r\n // measurementPointTabs: {[key: string]: ImeasurementPointListTab};\r\n measurementPointTabs: ImeasurementPointListTab[];\r\n mainCategoryID: string;\r\n testProcedures: string;\r\n standardID: string;\r\n type: number;\r\n temporary?: boolean;\r\n forJob?: boolean;\r\n}\r\n\r\nexport interface ImeasurementPointAnswer {\r\n measurementPointID: string;\r\n pass?: number;\r\n numericValue?: number;\r\n textValue?: string;\r\n notes?: string;\r\n measurementPointSelectOptionID?: string;\r\n dateValue?: string;\r\n}\r\n\r\nexport interface ImeasurementPointResult extends IbaseDataObject {\r\n jobID: string;\r\n status: number;\r\n notes: string;\r\n temporary?: boolean;\r\n measurementPointAnswers: ImeasurementPointAnswer[];\r\n installBaseID: string;\r\n measurementPointListID: string;\r\n compiledNotes: string;\r\n manualOverride: boolean;\r\n previousStatus?: number; // FE only\r\n installBaseHistory: IinstallBaseHistory[];\r\n}\r\n\r\nexport interface IinstallBaseHistory {\r\n id: string;\r\n date: Date;\r\n notes: string;\r\n jobType: string;\r\n status: number;\r\n workOrderId: string;\r\n}\r\n\r\nexport interface ImeasurementPointResultWithJobType\r\n extends ImeasurementPointResult {\r\n jobTypeID: string;\r\n}\r\n\r\nexport interface ImeasurementPointResultsReducer {\r\n measurementPointResultsByID: { [key: string]: ImeasurementPointResult };\r\n selectedResult: ImeasurementPointResult;\r\n previousResult: ImeasurementPointResult;\r\n historicalResultID: string;\r\n installBaseHistory: IinstallBaseHistory[];\r\n}\r\n\r\nexport interface IdefaultReport {\r\n id: string;\r\n reportType: number;\r\n defaultCoverLetter: string;\r\n name: string;\r\n}\r\n\r\nexport interface Ireport {\r\n jobID: string;\r\n reportType: number;\r\n coverLetter: string;\r\n headerLogoPath: string;\r\n}\r\n\r\n// these are copied from react-redux-toastr beacuse could not figure out any other way to make typescript happy\r\nexport type transitionInType = 'bounceIn' | 'bounceInDown' | 'fadeIn';\r\nexport type transitionOutType = 'bounceOut' | 'bounceOutUp' | 'fadeOut';\r\n\r\nexport type ThunkResult = ThunkAction;\r\n\r\nexport type AppThunk = ThunkAction<\r\n ReturnType,\r\n IinitialState,\r\n null,\r\n Action\r\n>;\r\n\r\n/* ********** Desktop Only ***********/\r\n\r\n/*\r\n * TRAINING MODELS\r\n */\r\n// export interface GFBadge {\r\n// id: string;\r\n// name: string;\r\n// description: boolean;\r\n// hook: string;\r\n// count: number;\r\n// imagePath: string;\r\n// }\r\nexport interface GFClass {\r\n id: string;\r\n name: string;\r\n code: string;\r\n classSize: number;\r\n createDate: string;\r\n}\r\n\r\nexport interface GFCourse {\r\n id: string;\r\n name: string;\r\n description: string;\r\n cost: number;\r\n onSite: boolean;\r\n}\r\n\r\nexport interface GFLesson {\r\n id: string;\r\n name: string;\r\n description: string;\r\n courseID: string;\r\n imagePath: string;\r\n order: number;\r\n primaryVideoPath: string;\r\n slideshowPath: string;\r\n courseLessons: Array<{ id: string; courseID: string; order: number }>;\r\n cost: number;\r\n score?: number;\r\n quizName?: string;\r\n isProtected: boolean;\r\n}\r\n\r\nexport interface GFQuizAnswer {\r\n questionID: string;\r\n answer: string;\r\n isCorrect: boolean;\r\n}\r\n\r\nexport interface GFLessons {\r\n [key: string]: GFLesson;\r\n}\r\n\r\nexport interface GFClassProgressRaw {\r\n [key: string]: GFStudentQuizResult[];\r\n}\r\n\r\nexport interface GFLessonsWithProgress {\r\n quiz01Results: GFStudentQuizResult[];\r\n quiz02Results: GFStudentQuizResult[];\r\n quiz03Results: GFStudentQuizResult[];\r\n quiz04Results: GFStudentQuizResult[];\r\n quiz05Results: GFStudentQuizResult[];\r\n lessonHasProgress: boolean;\r\n}\r\n\r\nexport interface GFStudentWithProgress {\r\n quiz01Results: GFStudentQuizResult[];\r\n quiz02Results: GFStudentQuizResult[];\r\n quiz03Results: GFStudentQuizResult[];\r\n quiz04Results: GFStudentQuizResult[];\r\n quiz05Results: GFStudentQuizResult[];\r\n}\r\n\r\nexport interface GFQuizQuestion {\r\n id: string;\r\n text: string;\r\n type: string;\r\n options: any[];\r\n correctAnswer: string;\r\n correctText: string;\r\n wrongText: string;\r\n order: number;\r\n userAnswer?: any;\r\n userCorrect?: boolean;\r\n}\r\n\r\nexport interface GFQuizItem {\r\n id: string;\r\n name: string;\r\n imagePath: string;\r\n isComplete: boolean;\r\n videoPath: string;\r\n instructions: string;\r\n lessonID: string;\r\n questions: GFQuizQuestion[];\r\n isTimed: boolean;\r\n createDate?: any;\r\n updateDate?: any;\r\n studentCanAccess?: any;\r\n score?: number;\r\n}\r\n\r\nexport interface GFStudentQuizResult {\r\n id?: string;\r\n studentID: string;\r\n lessonID: string;\r\n quizID: string;\r\n quiz: GFQuizItem;\r\n answers: any[];\r\n score: number;\r\n createDate: string;\r\n className: string;\r\n}\r\n\r\nexport interface LessonProgress {\r\n id?: string;\r\n lessonID: string;\r\n userID: string;\r\n currentTime: number; // the current time of the video as reported from vimeo\r\n percentageComplete: number; // the current percent complete as reported by vimeo\r\n totalTime: number; // the total time (or duration) in second of the video, from vimeo\r\n timeSpent: number;\r\n isComplete: boolean;\r\n}\r\n\r\nexport interface GFQuizViewReducer {\r\n quizComplete: boolean;\r\n inProgressQuizID: string;\r\n startTime: string;\r\n}\r\n\r\nexport interface GFQuizLinkReducer {\r\n link: string;\r\n failedToLoad?: boolean;\r\n}\r\n\r\nexport interface ItrainingReducer {\r\n coursesByID: { [key: string]: GFCourse };\r\n lessonsByID: GFLessons;\r\n lesson: GFLesson;\r\n quizzesByID: { [key: string]: GFQuizItem };\r\n quiz: GFQuizItem;\r\n lessonProgress: { [key: string]: LessonProgress };\r\n cart: IshoppingCart;\r\n showShoppingCartModal: boolean;\r\n purchasedTraining: string[];\r\n quizAnswers: GFQuizAnswer[];\r\n quizView: GFQuizViewReducer;\r\n quizLink: GFQuizLinkReducer;\r\n}\r\n\r\nexport interface Icountry {\r\n value: string;\r\n RegionID: string;\r\n label: string;\r\n Currency: string;\r\n}\r\n\r\n// this is the model that the backend uses for countries\r\nexport interface IcountryBE {\r\n sapCountryCode?: string;\r\n regionID: string;\r\n currency: string;\r\n region?: string;\r\n name: string;\r\n id: string;\r\n isDeleted: boolean;\r\n createDate: string;\r\n updateDate: string;\r\n}\r\n\r\nexport interface ItableFiltersReducer {\r\n search: string;\r\n page: number;\r\n company?: Ioption;\r\n country?: Ioption;\r\n type?: Ioption;\r\n startDate?: string;\r\n endDate?: string;\r\n dueDate?: string;\r\n dateRange?: Ioption;\r\n facility?: Ioption;\r\n mainCategory?: Ioption;\r\n subCategory?: Ioption;\r\n brand?: Ioption;\r\n origin?: Ioption;\r\n title?: Ioption;\r\n sorted?: SortingRule[];\r\n standard?: Ioption;\r\n facilityID?: string;\r\n buildingID?: string;\r\n floorID?: string;\r\n locationID?: string;\r\n name?: string;\r\n number?: string;\r\n ranking?: Ioption;\r\n rows?: number;\r\n status?: Ioption;\r\n assignedUser?: Ioption;\r\n vendor?: number;\r\n technicianToDo?: Ioption;\r\n workOrderType?: number;\r\n tabKey?: any;\r\n userID?: Ioption;\r\n createDate?: string;\r\n jobID?: Ioption;\r\n commentType?: Ioption;\r\n isResolved?: Ioption;\r\n installBaseID?: Ioption;\r\n facilityName?: string;\r\n showCompleted?: Ioption;\r\n showAdditionalFilters?: boolean;\r\n countryID?: Ioption;\r\n jobTypeID?: string;\r\n jobType?: Ioption;\r\n measurementBasedOnly?: boolean;\r\n open?: boolean;\r\n assetSearch?: string;\r\n jobSearch?: string;\r\n mainCategoryID?: string;\r\n partSearch?: string;\r\n productSearch?: string;\r\n productID?: string;\r\n isSystem?: Ioption;\r\n userType?: Ioption;\r\n statusFilter?: Ioption;\r\n isDeleted?: boolean;\r\n sapWorkOrder?: boolean;\r\n courseID?: string;\r\n isCourseCompleted?: boolean;\r\n hideVirtualToggle?: boolean;\r\n}\r\n\r\nexport interface ItableFiltersParams {\r\n search?: string;\r\n page?: number;\r\n name?: string;\r\n number?: string;\r\n company?: Ioption;\r\n type?: Ioption;\r\n startDate?: string;\r\n endDate?: string;\r\n dueDate?: string;\r\n dateRange?: Ioption;\r\n facility?: Ioption;\r\n mainCategory?: Ioption;\r\n subCategory?: Ioption;\r\n brand?: Ioption;\r\n title?: Ioption;\r\n sorted?: SortingRule[];\r\n standard?: Ioption;\r\n facilityID?: string;\r\n buildingID?: string;\r\n floorID?: string;\r\n locationID?: string;\r\n rows?: number;\r\n typeID?: string;\r\n status?: Ioption;\r\n assignedUser?: Ioption;\r\n vendor?: number;\r\n technicianToDo?: Ioption;\r\n workOrderType?: number;\r\n tabKey?: any;\r\n userID?: Ioption;\r\n createDate?: string;\r\n jobID?: Ioption;\r\n commentType?: Ioption;\r\n isResolved?: Ioption;\r\n installBaseID?: Ioption;\r\n facilityName?: string;\r\n showCompleted?: Ioption;\r\n showAdditionalFilters?: boolean;\r\n countryID?: Ioption;\r\n jobTypeID?: string;\r\n jobType?: Ioption;\r\n measurementBasedOnly?: boolean;\r\n open?: boolean;\r\n reportType?: number;\r\n assetSearch?: string;\r\n jobSearch?: string;\r\n mainCategoryID?: string;\r\n partSearch?: string;\r\n productSearch?: string;\r\n productID?: string;\r\n origin?: Ioption;\r\n isSystem?: Ioption;\r\n userType?: Ioption;\r\n statusFilter?: Ioption;\r\n isDeleted?: boolean;\r\n sapWorkOrder?: boolean;\r\n courseID?: string;\r\n isCourseCompleted?: boolean;\r\n country?: Ioption;\r\n hideVirtualToggle?: boolean;\r\n}\r\n\r\nexport interface IuserQueue {\r\n id: string;\r\n user: Iuser;\r\n}\r\n\r\nexport interface IshoppingCartProduct {\r\n name: string;\r\n quantity: number;\r\n id: string;\r\n cost: number;\r\n}\r\n\r\nexport interface IquoteItem {\r\n productID: string;\r\n quantity: number;\r\n}\r\n\r\nexport interface ImanageUserQueueReducer {\r\n userQueuesByID: { [key: string]: IuserQueue };\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n selectedUserQueue: IuserQueue;\r\n}\r\n\r\nexport interface ImanageUserReducer {\r\n usersByID: { [key: string]: Iuser };\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n selectedUser: Iuser;\r\n activeLocalCountry: string;\r\n}\r\n\r\nexport interface ImanageLocationReducer {\r\n visibleLocations: Array;\r\n totalPages: number;\r\n showEditLocationModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface ImanageBrandReducer {\r\n manageBrandsByID: { [key: string]: Ibrand };\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n selectedBrand: Ibrand;\r\n}\r\n\r\nexport interface ImanageDocumentTypeReducer {\r\n documentTypesByID: { [key: string]: IDocumentType };\r\n selectedDocumentTypeID: string;\r\n}\r\n\r\nexport interface ImanageManageDocumentReducer {\r\n documentsByID: { [key: string]: IcloudDocument };\r\n totalPages: number;\r\n showEditDocumentModal: boolean;\r\n showEditVersionModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n selectedParentID: string;\r\n selectedDocumentID: string;\r\n documentFormValues: { [key: string]: any };\r\n versionFormValues: { [key: string]: any };\r\n}\r\n\r\nexport interface ImanageAlertReducer {\r\n alertsByID: { [key: string]: IAlert };\r\n totalPages: number;\r\n showEditAlertModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n selectedAlertID: string;\r\n alertFormValues: { [key: string]: any };\r\n}\r\n\r\n// MANAGE WORK ORDERS\r\n\r\nexport interface Ipart extends IbaseDataObject {\r\n description: string;\r\n number: string;\r\n installationTime: number;\r\n isActive: boolean;\r\n measurement: string;\r\n origin: string;\r\n}\r\n\r\nexport interface IjobPart extends IbaseDataObject {\r\n jobID: string;\r\n partID: string;\r\n estimated: number;\r\n used: number;\r\n lot: string;\r\n}\r\n\r\nexport interface IjobPartPopulated extends IjobPart {\r\n part: Ipart;\r\n}\r\n\r\nexport enum WorkOrderSource {\r\n MyMedGas = 0,\r\n SAP = 1\r\n}\r\nexport interface IWorkOrder extends IbaseDataObject {\r\n number?: string;\r\n vendor: number;\r\n technician?: string;\r\n contactInfo?: string;\r\n dueDate?: string;\r\n priority: number;\r\n status: number;\r\n type: number;\r\n productName: string;\r\n installBaseLocation?: string;\r\n activityDescription?: string;\r\n partsDescription?: string;\r\n closingNotes?: string;\r\n notes?: string;\r\n installBaseID: string;\r\n file1?: any;\r\n file2?: any;\r\n file3?: any;\r\n preventativeMaintenanceChecklist?: IpreventativeMaintenanceChecklist;\r\n lastServicedDate?: string; // set by the backend\r\n attachmentUrl1?: string;\r\n attachmentUrl2?: string;\r\n attachmentUrl3?: string;\r\n jobWorkOrders?: IjobWorkOrder[];\r\n jobNumber?: string;\r\n assignedUser?: string;\r\n userID: string;\r\n facility?: Ifacility;\r\n parts: Ipart[];\r\n sapBusinessIndicator: string | undefined;\r\n source: WorkOrderSource;\r\n suggestedJobTypeID?: keyof typeof jobTypesIdEnumInverse;\r\n sapPlant?: string;\r\n product?: Iproduct;\r\n}\r\n\r\nexport interface IpreventativeMaintenanceChecklist extends IbaseDataObject {\r\n preventativeMaintenancePlanID: string;\r\n scheduleInterval: number;\r\n name: string;\r\n preventativeMaintenancePoints: IpreventativeMaintenancePoint[];\r\n}\r\n\r\nexport interface IpreventativeMaintenancePoint extends IbaseDataObject {\r\n preventativeMaintenanceChecklistID: string;\r\n answerType: number;\r\n order: number;\r\n label: string;\r\n trueFalseDefault: 1;\r\n isRequired: boolean;\r\n helpText: string;\r\n}\r\n\r\nexport interface ImanageWorkOrderReducer {\r\n workOrdersByID: { [key: string]: IWorkOrder };\r\n\r\n visibleWorkOrdersByID: { [key: string]: IWorkOrder };\r\n technicians: string[];\r\n totalPages: number;\r\n showEditWorkOrderModal: boolean;\r\n showEditPartModalForm: boolean;\r\n showWorkOrderCloseModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n selectedWorkOrderID: string;\r\n selectedPartID: string;\r\n workOrderFormValues: IworkOrderFormValues;\r\n preventativeMaintenanceChecklistsByID: {\r\n [key: string]: IpreventativeMaintenanceChecklist;\r\n };\r\n showConfirmSelectJobModal: boolean;\r\n selection: string[];\r\n partFormValues: IpartFormValues;\r\n selectedFacilityIDForConfirmSelectJob: string;\r\n fsesWithWorkOrders: Iuser[];\r\n}\r\n\r\nexport interface ImanageCodeReducer {\r\n deficiencyCodesByID: { [key: string]: IdeficiencyCode };\r\n totalPages: number;\r\n showEditCodeModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n selectedCodeID: string;\r\n codeFormValues: { [key: string]: any };\r\n}\r\n\r\nexport interface ImanageUserAlertReducer {\r\n data: { [key: string]: IAlert };\r\n showUserAlertModal: boolean;\r\n}\r\n\r\nexport interface ImanageJobReducer {\r\n jobsByID: { [key: string]: Ijob };\r\n openJobsForWorkOrdersByID: { [key: string]: Ijob };\r\n jobWorkOrdersByID: { [key: string]: IjobWorkOrder };\r\n fseUsersByID: { [key: string]: Iuser };\r\n totalPages: number;\r\n nextJobNumber: string;\r\n tableFilters: ItableFiltersReducer;\r\n selectedJob: Ijob;\r\n}\r\n\r\nexport interface ImanageLeadsReducer {\r\n leadsByID: { [key: string]: Ilead };\r\n leadUsersByID: { [key: string]: IleadUser };\r\n totalPages: number;\r\n showEditLeadModal: boolean;\r\n showLeadActivityModal: boolean;\r\n showEditLeadActivityModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n leadInstallBasesByID: { [key: string]: IleadInstallBase };\r\n selection: string[];\r\n selectedLead: Ilead;\r\n selectedLeadActivity: IleadActivity;\r\n leadActivitiesByID: { [key: string]: IleadActivity };\r\n}\r\n\r\nexport interface ImanageReportReducer {\r\n defaultReportsByID: { [key: string]: IdefaultReport };\r\n totalPages: number;\r\n showEditReportModal: boolean;\r\n selectedReport: Ireport;\r\n selectedDefaultReportID: string;\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface ImanageFacilityReducer {\r\n contacts: { [key: string]: IfacilityContact };\r\n selectedContactID: string;\r\n // usersMatchEmail: Array;\r\n foundUsersOrContactsByID: { [key: string]: Iuser | IfacilityContact };\r\n facilityFormValues: IeditFacilityFormValues;\r\n selectedContact: IfacilityContact;\r\n tableFilters: ItableFiltersReducer;\r\n selectedFacilityID: string;\r\n facilityContractFormValues: IfacilityContractFormValues;\r\n showFacilityContractModal: boolean;\r\n}\r\n\r\nexport interface ImanageQuotesReducer {\r\n quotesByID: { [key: string]: Iquote };\r\n tableFilters: ItableFiltersReducer;\r\n selectedQuote: Iquote;\r\n totalPages: number;\r\n showEditQuoteModal: boolean;\r\n showQuoteDetailsModal: boolean;\r\n showSalesQuoteModal: boolean;\r\n}\r\n\r\nexport interface IsideMenuReducer {\r\n selectedMenuItem: string;\r\n currentMenuItem: string;\r\n}\r\n\r\nexport interface ImanageTeamReducer {\r\n teamMembersByID: { [key: string]: Iuser };\r\n totalPages: number;\r\n showEditTeamModal: boolean;\r\n editUserFormValues: { [key: string]: any };\r\n tableFilters: ItableFiltersReducer;\r\n selectedUserID: string;\r\n}\r\n\r\nexport interface IshoppingCart {\r\n addedIDs: string[];\r\n productsByID: { [key: string]: IshoppingCartProduct };\r\n}\r\n\r\nexport interface IsearchNewProductInstallBatchMode {\r\n installBaseIDs: string[];\r\n isBatchMode: boolean;\r\n}\r\n\r\nexport interface ImanageInventoryReducer {\r\n productsByID: { [key: string]: Iproduct };\r\n installBasesByID: { [key: string]: IinstallBase };\r\n totalPages: number;\r\n cart: IshoppingCart;\r\n showEditProductModal: boolean;\r\n showEditInstallModal: boolean;\r\n showShoppingCartModal: boolean;\r\n showInstallContactModal: boolean;\r\n showSearchNewProductsModal: boolean;\r\n showImportInstallModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n searchNewProductsSelectedProduct: Iproduct;\r\n newProducts: { [key: string]: Iproduct };\r\n showMPResultModal: boolean;\r\n showMPResultHistoryModal: boolean;\r\n showMPResultNotesModal: boolean;\r\n selectedProductID: string;\r\n selectedInstallBaseID: string;\r\n productSearchFormValues: Partial;\r\n installFormValues: IinstallFormValues;\r\n searchNewProductInstallBatchMode: IsearchNewProductInstallBatchMode;\r\n}\r\n\r\nexport interface IsyncStatusReducer {\r\n fseUsersUpdated: number;\r\n allContactsUpdated: number;\r\n}\r\n\r\nexport interface IproductQueueObject extends IbaseDataObject {\r\n productID: string;\r\n creator: Iuser;\r\n product: Iproduct;\r\n}\r\n\r\nexport interface ImanageProductQueueReducer {\r\n productQueueByID: { [key: string]: IproductQueueObject };\r\n mergeableProductsByID: { [key: string]: IproductQueueObject };\r\n totalPages: number;\r\n showApproveProductModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface ImanageTrainingProgress {\r\n userName: string;\r\n courseName: string;\r\n progress: string;\r\n results: string;\r\n userID?: string;\r\n courseID?: string;\r\n}\r\n\r\nexport interface ImanageTrainingReducer {\r\n trainingProgress: { [key: string]: ImanageTrainingProgress };\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface Iredirect {\r\n redirectToReferrer: boolean;\r\n pathname: string;\r\n}\r\n\r\nexport interface ImanageMeasurementPointListsReducer {\r\n measurementPointListsByID: { [key: string]: ImeasurementPointList };\r\n measurementPointsByID: { [key: string]: ImeasurementPoint };\r\n totalPages: number;\r\n selectedMeasurementPointList: ImeasurementPointList;\r\n showEditMeasurementPointListModal: boolean;\r\n showEditMeasurementPointModal: boolean;\r\n showEditMeasurementPointTabModal: boolean;\r\n showEditMeasurementPointListTestProceduresModal: boolean;\r\n // selectedTab: ImeasurementPointListTab;\r\n tableFilters: ItableFiltersReducer;\r\n selectedTabID: string;\r\n selectedMeasurementPoint: ImeasurementPoint;\r\n}\r\n\r\nexport interface IdataFormatPreference {\r\n temperature: dataFormatTemperatureEnum;\r\n}\r\n\r\nexport interface IanalyticsSmartlinkLatestValue {\r\n date: string;\r\n pointNumber: string;\r\n unit: dataUnitEnum;\r\n label: string;\r\n value: string;\r\n format: dataFormatEnum;\r\n}\r\n\r\nexport interface ItaeManifold {\r\n guage01?: IchartGuage;\r\n guage02?: IchartGuage;\r\n guage03?: IchartGuage;\r\n guage04?: IchartGuage;\r\n bar01?: IchartBar;\r\n gasType?: string;\r\n isServiceDue?: boolean;\r\n runningHours?: number;\r\n loadedHours?: number;\r\n alarms?: string;\r\n}\r\n\r\nexport interface IchartGuage {\r\n data: Array;\r\n label: string;\r\n unit: dataUnitEnum;\r\n format: dataFormatEnum;\r\n max?: number;\r\n min?: number;\r\n medium?: number;\r\n high?: number;\r\n}\r\n\r\nexport interface IchartBar {\r\n data: (number | string)[][];\r\n label: string;\r\n unit: dataUnitEnum;\r\n format: dataFormatEnum;\r\n max?: number;\r\n min?: number;\r\n medium?: number;\r\n high?: number;\r\n}\r\n\r\nexport interface IlineChartData {\r\n data: number[];\r\n name: string;\r\n}\r\n\r\nexport interface IchartLine {\r\n data: IlineChartData | number[];\r\n label: string;\r\n unit: dataUnitEnum;\r\n format: dataFormatEnum;\r\n}\r\n\r\n// TODO finish this IsmartlinkAirSystem interface based on the mockAnalyticssmartlink\r\nexport interface IsmartlinkAirSystem {\r\n guage01?: IchartGuage;\r\n guage02?: IchartGuage;\r\n guage03?: IchartGuage;\r\n bar01?: IchartBar;\r\n line01?: IchartLine;\r\n nextService?: number;\r\n runningHours?: number;\r\n loadedHours?: number;\r\n alarms?: any;\r\n}\r\n\r\nexport interface IdashboardAnalyticsReducer {\r\n data: IdashboardAnalyticsData;\r\n}\r\n\r\nexport type Iwidgets = Partial;\r\n\r\nexport interface IjobComment extends IbaseDataObject {\r\n jobID: string;\r\n userID: string;\r\n isDeficiency: boolean;\r\n text: string;\r\n codeID: string;\r\n isResolved: boolean;\r\n}\r\n\r\nexport interface IdeficiencyCode extends IbaseDataObject {\r\n description: string;\r\n name: string;\r\n standardID: string;\r\n}\r\n\r\nexport interface ImanageJobCommentsReducer {\r\n jobCommentsByID: { [key: string]: IjobComment };\r\n selectedJobComment: IjobComment;\r\n showEditJobCommentModal: boolean;\r\n filteredJobComments: IjobComment[];\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\n// Manage TAE\r\nexport interface Itae extends IbaseDataObject {\r\n installBaseID: string;\r\n serialNumber: string;\r\n date: string;\r\n systemHours: number;\r\n unit1RunningHours: number;\r\n unit2RunningHours: number;\r\n lagAlarm: boolean;\r\n dewpointAlarm: boolean;\r\n coAlarm: boolean;\r\n dryer1Mode: string;\r\n dryer2Mode: string;\r\n dewpointValue: number;\r\n coValue: number;\r\n receiverPressure: number;\r\n leftBankPressureBar: number;\r\n rightBankPressureBar: number;\r\n deliveryPressureBar: number;\r\n reservePressureBar: number;\r\n leftBankPressurePSI: number;\r\n rightBankPressurePSI: number;\r\n deliveryPressurePSI: number;\r\n reservePressurePSI: number;\r\n leftBankPressureKPA: number;\r\n rightBankPressureKPA: number;\r\n deliveryPressureKPA: number;\r\n reservePressureKPA: number;\r\n leftBankEmpty: number;\r\n rightBankEmpty: number;\r\n leftBankSelectLatch: boolean;\r\n reserveInUseAlarm: boolean;\r\n reserveLowAlarm: boolean;\r\n secondaryLowAlarm: boolean;\r\n changeoverAlarm: boolean;\r\n gasType: string;\r\n timeOnCurrentBank: number;\r\n timeOnPreviousBank: number;\r\n}\r\n\r\nexport interface ImanageTaeReducer {\r\n taeByID: { [key: string]: Itae };\r\n selectedItemID: string;\r\n showEditModal: boolean;\r\n // filteredJobComments: IjobComment[];\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface IcontactFacility {\r\n facilityID: string;\r\n contactID?: string;\r\n}\r\n\r\nexport interface IfacilityContact extends IbaseDataObject {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n title: string;\r\n phone: string;\r\n mobile: string;\r\n enableNotifications: boolean;\r\n smartlinkNotifications: boolean;\r\n contactFacilities: IcontactFacility[];\r\n userID?: string;\r\n user?: Iuser;\r\n source: number;\r\n}\r\n\r\nexport interface IsuggestedPart extends IbaseDataObject {\r\n productID: string;\r\n partID: string;\r\n part: Ipart;\r\n product: Iproduct;\r\n productQuantity: number;\r\n adminComments: string;\r\n installBaseID: string;\r\n installBaseQuantity: number;\r\n}\r\n\r\nexport interface IfacilityContract extends IbaseDataObject {\r\n facilityID: string;\r\n myMedGasContract?: number; // enum\r\n myMedGasContractStart?: string;\r\n myMedGasContractEnd?: string;\r\n myMedGasContractComments?: string;\r\n inspectionContract?: number; // enum\r\n inspectionContractStart?: string;\r\n inspectionContractEnd?: string;\r\n inspectionContractComments?: string;\r\n maintenanceContract?: number;\r\n maintenanceContractStart?: string;\r\n maintenanceContractEnd?: string;\r\n maintenanceContractComments?: string;\r\n agslevContract?: number;\r\n agslevContractStart?: string;\r\n agslevContractEnd?: string;\r\n agslevContractComments?: string;\r\n environmentalContract?: number;\r\n environmentalContractStart?: string;\r\n environmentalContractEnd?: string;\r\n environmentalContractComments?: string;\r\n boomContract?: number;\r\n boomContractStart?: string;\r\n boomContractEnd?: string;\r\n boomContractComments?: string;\r\n leakTestingContract?: number;\r\n leakTestingContractStart?: string;\r\n leakTestingContractEnd?: string;\r\n leakTestingContractComments?: string;\r\n traceGasAnalysisContract?: number;\r\n traceGasAnalysisContractStart?: string;\r\n traceGasAnalysisContractEnd?: string;\r\n traceGasAnalysisContractComments?: string;\r\n otherContract?: number;\r\n otherContractStart?: string;\r\n otherContractEnd?: string;\r\n otherContractComments?: string;\r\n}\r\n\r\nexport interface ItutorialReducer {\r\n viewedTours: string[];\r\n run: boolean;\r\n}\r\n\r\nexport interface ImanageProductReducer {\r\n productsByID: { [key: string]: Iproduct };\r\n showEditProductModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n totalPages: number;\r\n}\r\n\r\n// export interface GroupPropsEdited extends Omit{\r\n// render?: (\r\n// control: FormArray | FormControl | FormGroup | JsxElement\r\n// ) => React.ReactElement | React.ReactElement[];\r\n// }\r\n\r\nexport interface ImanageAssetPhotosReducer {\r\n photos: { [key: string]: Iphoto };\r\n photosByProduct: { [key: string]: Iphoto[] };\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n}\r\n\r\nexport interface ImanagePartReducer {\r\n jobParts: { [key: string]: IjobPartPopulated };\r\n}\r\n\r\nexport interface ImanageSuggestedPartsReducer {\r\n suggestedParts: { [key: string]: IsuggestedPart };\r\n totalPages: number;\r\n showEditSuggestedPartModal: boolean;\r\n tableFilters: ItableFiltersReducer;\r\n selectedSuggestedPart: IsuggestedPart;\r\n}\r\n\r\n// Dashboard\r\nexport interface IanalyticsInspection {\r\n mainCategoryID: string;\r\n mainCategoryName: string;\r\n jobDate: string;\r\n total: number;\r\n data: any[];\r\n}\r\n\r\nexport interface IanalyticsPMP {\r\n totalWorkOrders: number;\r\n data: {\r\n open: PointOptionsObject[];\r\n closed: PointOptionsObject[];\r\n };\r\n}\r\n\r\nexport interface IanalyticsTAE {\r\n photoUrl: string;\r\n mainCategoryID: string;\r\n mainCategoryName: string;\r\n installBaseID: string;\r\n installBaseName: string;\r\n installBaseLocation: string;\r\n installBaseSerialNumber: string;\r\n systemRunHours: number;\r\n unit1Hours: number;\r\n unit2Hours: number;\r\n dewpoint: number;\r\n dryer1Mode: string;\r\n dryer2Mode: string;\r\n coLevel: number;\r\n receiverPressure?: number;\r\n dewpointAlarm: boolean;\r\n coAlarm: boolean;\r\n lagAlarm: boolean;\r\n leftBankPressureBar: number;\r\n rightBankPressureBar: number;\r\n deliveryPressureBar: number;\r\n reservePressureBar: number;\r\n reservePressurePSI: number;\r\n leftBankPressureKPA: number;\r\n rightBankPressureKPA: number;\r\n deliveryPressureKPA: number;\r\n reservePressureKPA: number;\r\n leftBankEmpty: number;\r\n rightBankEmpty: number;\r\n timeOnCurrentBank: number;\r\n timeOnPreviousBank: number;\r\n leftBankPressurePSI: number;\r\n rightBankPressurePSI: number;\r\n deliveryPressurePSI: number;\r\n leftBankSelectLatch: boolean;\r\n reserveInUseAlarm: boolean;\r\n reserveLowAlarm: boolean;\r\n secondaryLowAlarm: boolean;\r\n changeoverAlarm: boolean;\r\n gasType: string;\r\n date: string;\r\n device: ItaeManifold;\r\n}\r\n\r\nexport interface MaintenanceInterval {\r\n item: string;\r\n due: string;\r\n}\r\n\r\nexport interface BarChartData {\r\n item1: string;\r\n item2: number;\r\n}\r\n\r\nexport interface TAEDashboardData {\r\n data: number[];\r\n barChartData: BarChartData[] | null;\r\n label: string;\r\n pointNumber: string;\r\n unit: number;\r\n format: number;\r\n max: number;\r\n min: number;\r\n medium: number;\r\n high: number;\r\n graphType: number;\r\n graphSize: number;\r\n pumpRunStatus: number | null;\r\n compressorRunStatus: number | null;\r\n operatingMode: number | null;\r\n systemMaintenanceIntervals: MaintenanceInterval[] | null;\r\n maintenanceIntervals: MaintenanceInterval[] | null;\r\n}\r\n\r\nexport interface IanalyticsTAEDashboard {\r\n photoUrl: string;\r\n mainCategoryID: string;\r\n mainCategoryName: string;\r\n updateDate: string;\r\n installBaseID: string;\r\n installBaseName: string;\r\n installBaseLocation: string;\r\n installBaseSerialNumber: string;\r\n productID: string;\r\n device: null;\r\n primaryData: TAEDashboardData[];\r\n secondaryData: TAEDashboardData[];\r\n alarmCount: number;\r\n alarms: string[];\r\n}\r\n\r\nexport interface IanalyticsSmartlink {\r\n photoUrl: string;\r\n mainCategoryID: string;\r\n mainCategoryName: string;\r\n installBaseID: string;\r\n installBaseName: string;\r\n installBaseLocation: string;\r\n installBaseSerialNumber: string;\r\n latestValues: IanalyticsSmartlinkLatestValue[]; // TODO remove this and unitGraphs below when finishing dashboard redesign\r\n unit1Graph: Array;\r\n unit2Graph: Array;\r\n updateDate: string;\r\n device: IsmartlinkAirSystem;\r\n}\r\n\r\nexport interface IanalyticsQuote {\r\n total: number;\r\n new: number;\r\n approved: number;\r\n inProgress: number;\r\n rejected: number;\r\n unquotedLeads: number;\r\n}\r\n\r\nexport interface IdashboardAnalyticsData {\r\n inspection: IanalyticsInspection[];\r\n pmp: IanalyticsPMP;\r\n tae: IanalyticsTAE[];\r\n smartlinks: IanalyticsTAEDashboard[];\r\n quote: IanalyticsQuote;\r\n}\r\n\r\nexport interface Iconfig {\r\n isMobile: boolean;\r\n}\r\n\r\nexport interface IreportTemplate {\r\n id?: string;\r\n templateName: string;\r\n jobTypeID: string;\r\n jobName?: string;\r\n brandID: string;\r\n brandName?: string;\r\n isDefault: boolean;\r\n reportTemplateChapters: IreportTemplateChapter[]; // <-- Add this line to include chapters\r\n}\r\n\r\nexport interface IreportChapter {\r\n id?: string;\r\n chapterName: string;\r\n category: string;\r\n description: string;\r\n revision: number;\r\n reportRevision: string;\r\n pageSize: string;\r\n pageOrientation: string;\r\n status: ReportChapterStatus;\r\n templateFileName: string;\r\n chapterType: ReportChapterType;\r\n}\r\n\r\nexport interface IreportTemplateChapter {\r\n id?: string;\r\n reportChapterId?: string;\r\n order: number;\r\n reportTemplateID?: string;\r\n reportChapter?: IreportChapter;\r\n}\r\n\r\nexport interface IreportExternalDocument {\r\n reportTemplateChapterID: string;\r\n fileName: string;\r\n mimeType: string;\r\n}\r\n","/*\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { updateSelectedJob } from '../../actions/manageJobActions';\r\nimport { getWorkOrders } from '../../actions/manageWorkOrderActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { Ioption } from '../../models';\r\nimport { FormUtil } from '../common/FormUtil';\r\n\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n loading: boolean;\r\n colorButton: string;\r\n t: TFunction;\r\n jobOptions: Ioption[];\r\n toggleModal: () => void;\r\n addWorkOrdersToJob: (\r\n selection: string[],\r\n jobID: string,\r\n t: TFunction\r\n ) => Promise;\r\n selection: string[];\r\n getWorkOrders: typeof getWorkOrders;\r\n updateSelectedJob: typeof updateSelectedJob;\r\n // getAllOpenJobsForWorkOrders: typeof getAllOpenJobsForWorkOrders;\r\n history: any;\r\n showNewJobModal: () => void;\r\n}\r\n\r\ninterface State {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nexport class ConfirmSelectJobForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (!this.formGroup) {\r\n return;\r\n }\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n // this.props.getAllOpenJobsForWorkOrders();\r\n }\r\n\r\n buildFieldConfig = () => {\r\n const fieldConfigControls = {\r\n jobID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: this.props.jobOptions,\r\n label: 'common:job',\r\n colWidth: 12,\r\n placeholder: 'jobPlaceholder',\r\n name: 'job'\r\n },\r\n options: {\r\n validators: [FormUtil.validators.requiredWithTrim]\r\n }\r\n }\r\n };\r\n\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n this.props.t\r\n );\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n const { jobID } = this.formGroup.value;\r\n this.props.toggleModal();\r\n this.props\r\n .addWorkOrdersToJob(this.props.selection, jobID.value, this.props.t)\r\n .then(() => {\r\n this.props.getWorkOrders();\r\n });\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n cleanForm = () => {\r\n this.formGroup.reset();\r\n };\r\n\r\n newJob = () => {\r\n this.props.showNewJobModal();\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n {t('adding')} {this.props.selection.length}{' '}\r\n {t('addingMessage')}\r\n \r\n\r\n \r\n {this.props.jobOptions.length === 0 && (\r\n \r\n
    {t('toastMessage:noJobsFound')}
    \r\n \r\n )}\r\n \r\n \r\n {t('common:cancel')}\r\n \r\n\r\n {\r\n \r\n {t('nsJob:saveModalTitle')}\r\n \r\n }\r\n \r\n {t('addToJobButton')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import { TFunction } from \"i18next\";\r\nimport { constants, jobTypeOptions, sapBusinessIndicators } from \"../constants/constants\";\r\nimport { IWorkOrder, Ioption, IsapJobMapping, WorkOrderSource } from \"../models\";\r\nimport { jobTypesIdEnum } from \"../models-enums\";\r\n\r\nexport interface IjobTypeOptionsForWorkOrder\r\n{\r\n jobTypes: Ioption[];\r\n defaultSAPJobType: Ioption | undefined;\r\n}\r\n\r\nexport const getJobTypeOptionsForWorkOrder = (workOrder: IWorkOrder, sapJobMappings: { [key: string]: IsapJobMapping }, t: TFunction): IjobTypeOptionsForWorkOrder => {\r\n let jobTypes: Ioption[] = [];\r\n let defaultSAPJobType: Ioption | undefined = undefined;\r\n \r\n const jobTypeOptionsTranslated = jobTypeOptions.map(option => {\r\n return {\r\n ...option,\r\n label: t(`nsJob:${option.label}`)\r\n };\r\n });\r\n\r\n if(workOrder.source === WorkOrderSource.SAP){\r\n // Check if the selected work order(s) have a suggested job type, if so, then that's the only job type they are allowed to use\r\n if (workOrder.suggestedJobTypeID !== undefined && workOrder.suggestedJobTypeID !== null) {\r\n jobTypes = jobTypeOptionsTranslated.filter(t => t.value === workOrder.suggestedJobTypeID);\r\n if(jobTypes.length > 0){\r\n defaultSAPJobType = jobTypes[0];\r\n }\r\n \r\n } else {\r\n // There was no suggested job type set, so we need to check the business indicator on the work order\r\n const sapBusinessIndicator = workOrder?.sapBusinessIndicator;\r\n const product = workOrder?.product;\r\n const sapPlant = workOrder?.sapPlant;\r\n \r\n if (\r\n sapBusinessIndicator !== undefined &&\r\n sapBusinessIndicator !== null &&\r\n sapPlant !== undefined &&\r\n sapPlant !== null &&\r\n product !== undefined &&\r\n product !== null\r\n ) {\r\n const forVirtualProduct =\r\n product && product.subcategoryID === constants.virtualProductSubcategoryID ? true : false;\r\n let sapJobTypes: IsapJobMapping[] = [];\r\n const sapMaterialNumberExist =\r\n Object.values(sapJobMappings).filter(\r\n x =>\r\n x.sapBusinessIndicator === sapBusinessIndicator &&\r\n x.serviceCenter === sapPlant &&\r\n x.isVirtual === forVirtualProduct &&\r\n x.sapMaterialNumber === product.sapMaterialNumber\r\n ).length > 0;\r\n\r\n if (sapMaterialNumberExist) {\r\n sapJobTypes = Object.values(sapJobMappings).filter(\r\n x =>\r\n x.sapBusinessIndicator === sapBusinessIndicator &&\r\n x.serviceCenter === sapPlant &&\r\n x.isVirtual === forVirtualProduct &&\r\n x.sapMaterialNumber === product.sapMaterialNumber\r\n );\r\n } else {\r\n sapJobTypes = Object.values(sapJobMappings).filter(\r\n x =>\r\n x.sapBusinessIndicator === sapBusinessIndicator &&\r\n x.serviceCenter === sapPlant &&\r\n x.isVirtual === forVirtualProduct\r\n );\r\n }\r\n\r\n const jobTypeIDs = sapJobTypes.map(x => x.jobTypeID);\r\n\r\n // Filter the job types to show in the drop down\r\n jobTypes = jobTypeOptionsTranslated.filter(t => jobTypeIDs.includes(t.value));\r\n\r\n // Check if we need to default to a certain job type\r\n sapJobTypes.forEach(x => {\r\n if (x.isDefault) {\r\n defaultSAPJobType = jobTypeOptionsTranslated.find(t => t.value === x.jobTypeID);\r\n }\r\n });\r\n }\r\n }\r\n } else {\r\n // Non SAP\r\n jobTypes = jobTypeOptionsTranslated.filter(\r\n t =>\r\n t.value === jobTypesIdEnum.Maintenance ||\r\n t.value === jobTypesIdEnum.warrantyBM ||\r\n t.value === jobTypesIdEnum.Repair\r\n );\r\n }\r\n\r\n return {\r\n jobTypes,\r\n defaultSAPJobType\r\n } as IjobTypeOptionsForWorkOrder;\r\n};","/*\r\n *\r\n */\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { forEach } from 'lodash';\r\nimport {\r\n addWorkOrdersToJob,\r\n updateSelectedJob\r\n} from '../../actions/manageJobActions';\r\nimport {\r\n getWorkOrders,\r\n toggleConfirmSelectJobModal\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { Ifacility, Ijob } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport {\r\n prepJobsOpenRepairAndMaintenanceForOptions,\r\n selectOpenJobsForWorkOrders\r\n} from '../../reducers/manageJobReducer';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { ConfirmSelectJobForm } from './ConfirmSelectJobForm';\r\nimport { getJobTypeOptionsForWorkOrder } from '../../helpers/sapManager';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n history: any;\r\n showNewJobModal: () => void;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const filteredJobs = selectOpenJobsForWorkOrders(state);\r\n const workOrders = Object.values(state.manageWorkOrder.workOrdersByID);\r\n let filteredJobTypes: string[] = [];\r\n let facility: Ifacility | undefined = undefined;\r\n const sapJobMappings = state.sapJobMappings.sapJobMappingsByID;\r\n\r\n forEach(state.manageWorkOrder.selection, (id: string) => {\r\n const workOrderId = id.substring(7); // remove the select- prefix\r\n const wo = workOrders.find(wo => wo.id === workOrderId);\r\n if (wo) {\r\n if (wo.facility) {\r\n facility = wo.facility;\r\n }\r\n\r\n const jobTypeOptions = getJobTypeOptionsForWorkOrder(\r\n wo,\r\n sapJobMappings,\r\n ownProps.t\r\n );\r\n\r\n if (jobTypeOptions.jobTypes.length > 0) {\r\n filteredJobTypes = jobTypeOptions.jobTypes.map(j => j.value);\r\n }\r\n }\r\n });\r\n\r\n let filteredJobsBySAPBusinessIndicator: Ijob[] = [];\r\n\r\n // Filter open jobs by the selected job types\r\n filteredJobsBySAPBusinessIndicator = filteredJobs.filter(job =>\r\n filteredJobTypes.includes(job.jobTypeID)\r\n );\r\n\r\n // We should have a facility from the selected work orders (and it should be the same for all selected work orders)\r\n if (facility) {\r\n filteredJobsBySAPBusinessIndicator = filteredJobsBySAPBusinessIndicator.filter(\r\n job => job.facilityID.toLowerCase() === facility?.id.toLowerCase()\r\n );\r\n }\r\n\r\n const jobOptions = prepJobsOpenRepairAndMaintenanceForOptions(\r\n state,\r\n filteredJobsBySAPBusinessIndicator,\r\n ownProps.t\r\n );\r\n\r\n return {\r\n title: ownProps.t('selectJob'),\r\n className: 'confirm-select-modal',\r\n loading: selectIsLoading(state),\r\n show: state.manageWorkOrder.showConfirmSelectJobModal,\r\n jobOptions,\r\n selection: state.manageWorkOrder.selection,\r\n showNewJobModal: ownProps.showNewJobModal\r\n };\r\n};\r\n\r\nexport const ConfirmSelectJobContainer = withTranslation('manageWorkOrder')(\r\n connect(mapStateToProps, {\r\n onHide: toggleConfirmSelectJobModal,\r\n toggleModal: toggleConfirmSelectJobModal,\r\n addWorkOrdersToJob,\r\n getWorkOrders,\r\n updateSelectedJob\r\n })(WithCommonModal(ConfirmSelectJobForm))\r\n);\r\n","/*\r\n * An Action Button\r\n */\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n getWorkOrders,\r\n setSelectedFacilityIDForConfirmSelectJob,\r\n toggleConfirmSelectJobModal,\r\n unlinkWorkOrders\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { IWorkOrder } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { selectVisibleWorkOrdersByID } from '../../reducers/manageWorkOrderReducer';\r\nimport { WorkOrderBulkActionsButton } from './WorkOrderBulkActionsButton';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const tableData = selectVisibleWorkOrdersByID(state);\r\n const workOrdersByID: { [key: string]: IWorkOrder } =\r\n state.manageWorkOrder.workOrdersByID;\r\n tableData.forEach(wo => {\r\n workOrdersByID[wo.id] = {\r\n ...workOrdersByID[wo.id],\r\n jobWorkOrders: wo?.jobWorkOrders\r\n };\r\n });\r\n const jobWorkOrdersByID = state.manageJob.jobWorkOrdersByID;\r\n\r\n return {\r\n user: state.user,\r\n selection: state.manageWorkOrder.selection,\r\n workOrdersByID: state.manageWorkOrder.workOrdersByID,\r\n loading: selectIsLoading(state),\r\n jobWorkOrdersByID\r\n };\r\n};\r\n\r\nexport const WorkOrderBulkActionsButtonContainer = connect(mapStateToProps, {\r\n toggleConfirmSelectJobModal,\r\n setSelectedFacilityIDForConfirmSelectJob,\r\n unlinkWorkOrders,\r\n getWorkOrders\r\n})(WorkOrderBulkActionsButton);\r\n","import * as React from 'react';\r\n\r\nimport { Col, DropdownButton, MenuItem } from 'react-bootstrap';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { filter, forEach, map } from 'lodash';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport {\r\n getWorkOrders,\r\n setSelectedFacilityIDForConfirmSelectJob\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { IWorkOrder, IjobWorkOrder, Iuser } from '../../models';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n toggleConfirmSelectJobModal: () => void;\r\n user: Iuser;\r\n selection: string[];\r\n workOrdersByID: { [key: string]: IWorkOrder };\r\n setSelectedFacilityIDForConfirmSelectJob: typeof setSelectedFacilityIDForConfirmSelectJob;\r\n unlinkWorkOrders: (selection: IWorkOrder[], t: TFunction) => Promise;\r\n getWorkOrders: typeof getWorkOrders;\r\n jobWorkOrdersByID: { [key: string]: IjobWorkOrder };\r\n}\r\n\r\nexport const WorkOrderBulkActionsButton = (props: Iprops) => {\r\n const { t } = props;\r\n const showAddToJob = constants.hasSecurityFunction(props.user, [\r\n constants.securityFunctions.ManageJobs.id\r\n ]);\r\n\r\n const checkSelection = () => {\r\n let hasSameFacility = 1;\r\n let workOrderAlreadyAssigned = false;\r\n\r\n const selectedWorkOrders = map(props.selection, item => {\r\n const woID = item.split('select-')[1];\r\n return props.workOrdersByID[woID];\r\n });\r\n\r\n selectedWorkOrders.forEach(wo => {\r\n if (wo.jobWorkOrders && wo.jobWorkOrders?.length > 0) {\r\n workOrderAlreadyAssigned = true;\r\n } else {\r\n // Double check if there are any jobWorkOrders for this work order\r\n // This can happen when adding new work orders to a job, and the work order doesn't have the newly created jobWorkOrders attached yet, kinda hacky\r\n const jobWorkOrders = filter(\r\n props.jobWorkOrdersByID,\r\n jwo => jwo.workOrderID === wo.id && jwo.isDeleted === false\r\n );\r\n if (jobWorkOrders && jobWorkOrders.length > 0) {\r\n workOrderAlreadyAssigned = true;\r\n }\r\n }\r\n });\r\n\r\n if (workOrderAlreadyAssigned) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:addWorkOrderAlreadyAssignedWarning'),\r\n constants.toastrWarning\r\n );\r\n return Promise.reject();\r\n }\r\n\r\n const firstFacilityID = selectedWorkOrders[0].facility\r\n ? selectedWorkOrders[0].facility.id\r\n : '';\r\n forEach(selectedWorkOrders, wo => {\r\n if (wo.facility && wo.facility.id !== firstFacilityID) {\r\n hasSameFacility = 0;\r\n }\r\n });\r\n if (hasSameFacility === 0) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('toastMessage:addWorkOrderSameFacilityWarning'),\r\n constants.toastrWarning\r\n );\r\n return Promise.reject();\r\n } else {\r\n props.setSelectedFacilityIDForConfirmSelectJob(firstFacilityID);\r\n return Promise.resolve();\r\n }\r\n };\r\n\r\n const unlinkWorkOrders = () => {\r\n const selectedWorkOrders: IWorkOrder[] = map(props.selection, item => {\r\n const woID = item.split('select-')[1];\r\n return {\r\n ...props.workOrdersByID[woID],\r\n userID:\r\n props.workOrdersByID[woID].userID == ''\r\n ? null\r\n : props.workOrdersByID[woID].userID\r\n } as any;\r\n });\r\n\r\n if (\r\n selectedWorkOrders.findIndex(\r\n wo => !wo?.jobWorkOrders || wo.jobWorkOrders.length === 0\r\n ) !== -1\r\n ) {\r\n toastr.warning(\r\n t('toastMessage:warning'),\r\n t('manageWorkOrder:unlinkWorkOrdersValidation'),\r\n constants.toastrWarning\r\n );\r\n return;\r\n }\r\n\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n props.unlinkWorkOrders(selectedWorkOrders, props.t).then(() => {\r\n props.getWorkOrders();\r\n });\r\n },\r\n onCancel: () => console.info('CANCEL clicked'),\r\n okText: t('Ok'),\r\n cancelText: t('common:cancel')\r\n };\r\n toastr.confirm(\r\n t('manageWorkOrder:unlinkWorkOrdersConfirmTitle'),\r\n toastrConfirmOptions\r\n );\r\n };\r\n\r\n return (\r\n \r\n {\r\n switch (eventKey) {\r\n case 1:\r\n checkSelection()\r\n .then(() => {\r\n props.toggleConfirmSelectJobModal();\r\n })\r\n .catch(() =>\r\n console.info(\r\n 'did not select same facilities'\r\n )\r\n );\r\n break;\r\n case 2:\r\n unlinkWorkOrders();\r\n break;\r\n }\r\n }}\r\n >\r\n {showAddToJob && (\r\n {t('addToJobButton')}\r\n )}\r\n {t('unlinkWorkOrders')}\r\n {/* {showAddToJob === false &&\r\n {t('addToJob')}\r\n } */}\r\n \r\n \r\n );\r\n};\r\n","/*\r\n * Preventative Maintenance Table\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Col, Row } from 'react-bootstrap';\r\nimport ReactTable, { FinalState, RowInfo } from 'react-table';\r\nimport selectTableHOC, {\r\n SelectTableAdditionalProps\r\n} from 'react-table/lib/hoc/selectTable';\r\nimport {\r\n getWorkOrders,\r\n setSelectedWorkOrderID,\r\n setTableFilter,\r\n toggleEditWorkOrderModal,\r\n updateWorkOrderSelection\r\n} from '../../actions/manageWorkOrderActions';\r\nimport {\r\n IWorkOrder,\r\n IjobWorkOrder,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n jobTypesIdEnumInverse,\r\n workOrderStatusEnum,\r\n workOrderTabEnum,\r\n workOrderTypesEnum,\r\n workOrderVendorsEnum\r\n} from '../../models-enums';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { find } from 'lodash';\r\nimport moment from 'moment';\r\nimport { constants } from '../../constants/constants';\r\nimport PartsIcon from '../../images/icons/BM_Parts.svg';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { WorkOrderBulkActionsButtonContainer } from './WorkOrderBulkActionsButtonContainer';\r\n\r\nconst SelectTable = selectTableHOC(ReactTable);\r\nconst columns = (t: TFunction) =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'Activity',\r\n accessor: 'activityDescription',\r\n width: 220,\r\n Cell: (row: RowInfoWorkOrder) => {\r\n return (\r\n
    \r\n {row.original.activityDescription}\r\n
    \r\n );\r\n }\r\n },\r\n {\r\n Header: 'facility',\r\n accessor: 'facility.name'\r\n },\r\n {\r\n Header: 'productName',\r\n accessor: 'productName'\r\n },\r\n {\r\n Header: 'FSENameTableHeader',\r\n id: 'assignedUser',\r\n accessor: ({ assignedUser }: IWorkOrder) => assignedUser\r\n },\r\n {\r\n Header: 'jobNumberTableHeader',\r\n id: 'jobNumber',\r\n accessor: ({ jobNumber }: IWorkOrder) => jobNumber\r\n },\r\n {\r\n Header: 'jobType',\r\n id: 'jobType',\r\n accessor: ({ jobWorkOrders }: IWorkOrder) => {\r\n if (jobWorkOrders && jobWorkOrders.length > 0) {\r\n const jwo = jobWorkOrders[0];\r\n if (jwo && jwo.job) {\r\n return t(\r\n `nsJob:${\r\n jobTypesIdEnumInverse[\r\n jwo.job\r\n .jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n }`\r\n );\r\n }\r\n }\r\n\r\n return '';\r\n }\r\n },\r\n {\r\n Header: 'woNumber',\r\n id: 'workOrderNumber',\r\n Cell: props => {\r\n return (\r\n
    \r\n {props.row.workOrderNumber}\r\n {props.original?.parts?.length > 0 && (\r\n \r\n )}\r\n
    \r\n );\r\n },\r\n accessor: ({ number }: IWorkOrder) => number\r\n },\r\n {\r\n Header: 'businessIndicator',\r\n id: 'businessIndicator',\r\n accessor: ({ sapBusinessIndicator }: IWorkOrder) =>\r\n sapBusinessIndicator,\r\n minWidth: 120\r\n },\r\n {\r\n Header: 'status',\r\n id: 'status',\r\n accessor: ({ status }: IWorkOrder) =>\r\n t(workOrderStatusEnum[status]),\r\n width: 60\r\n },\r\n {\r\n Header: 'dueDate',\r\n id: 'dueDate',\r\n accessor: ({ dueDate }: IWorkOrder) => {\r\n return dueDate\r\n ? moment\r\n .utc(dueDate)\r\n .local(true)\r\n .format('DD-MMM-YY LT')\r\n : 'n/a';\r\n },\r\n width: 120\r\n }\r\n ],\r\n t\r\n );\r\n\r\ninterface Iprops {\r\n tableData: IWorkOrder[];\r\n t: TFunction;\r\n\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n currentTile: Itile;\r\n loading: boolean;\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n setTableFilter: typeof setTableFilter;\r\n overrideColumns?: any[];\r\n user: Iuser;\r\n updateWorkOrderSelection: typeof updateWorkOrderSelection;\r\n selection: string[];\r\n jobWorkOrdersByID: { [key: string]: IjobWorkOrder };\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n usersByID: { [key: string]: Iuser };\r\n}\r\ninterface Istate {\r\n selectedRow: any;\r\n columns: any[];\r\n selectAll: boolean;\r\n workOrdersSameSAPType: boolean;\r\n}\r\ninterface RowInfoWorkOrder extends RowInfo {\r\n original: IWorkOrder;\r\n}\r\n\r\nexport class WorkOrderBeaconTable extends React.PureComponent<\r\n Iprops & SelectTableAdditionalProps,\r\n Istate\r\n> {\r\n private checkboxTable: any;\r\n constructor(props: Iprops & SelectTableAdditionalProps) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n columns: columns(this.props.t),\r\n selectAll: false,\r\n workOrdersSameSAPType: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n // TODO do we need this eventLister anymore?\r\n // It seems yes, this is used to clear the selection when a work order is added to a job\r\n document.addEventListener(\r\n 'clearSelectedWorkOrders',\r\n this.handleClearSelectedWorkOrders,\r\n false\r\n );\r\n this.props.updateWorkOrderSelection([]);\r\n getWorkOrders();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n // scroll top every time a filter changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.selection) !==\r\n JSON.stringify(this.props.selection)\r\n ) {\r\n this.verifySAPWorkOrders();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\r\n 'clearSelectedWorkOrders',\r\n this.handleClearSelectedWorkOrders,\r\n false\r\n );\r\n }\r\n\r\n verifySAPWorkOrders = () => {\r\n // You cannot add multiple work orders to a job if they are of different SAP types\r\n let anyCommissioningWO = false;\r\n let anyReparWO = false;\r\n\r\n if (this.props.selection.length === 0) {\r\n this.setState({ workOrdersSameSAPType: false });\r\n } else if (this.props.selection.length === 1) {\r\n this.setState({ workOrdersSameSAPType: true });\r\n } else {\r\n this.props.selection.forEach((workOrderID: string) => {\r\n const id = workOrderID.substring(7);\r\n const wo = this.props.tableData.find(x => x.id === id);\r\n if (wo) {\r\n if (wo.sapBusinessIndicator === 'IC') {\r\n anyCommissioningWO = true;\r\n } else {\r\n anyReparWO = true;\r\n }\r\n }\r\n });\r\n\r\n if (anyCommissioningWO && anyReparWO) {\r\n this.setState({ workOrdersSameSAPType: false });\r\n } else {\r\n this.setState({ workOrdersSameSAPType: true });\r\n }\r\n }\r\n };\r\n\r\n handleClearSelectedWorkOrders = () => {\r\n this.props.updateWorkOrderSelection([]);\r\n };\r\n\r\n /*\r\n * Show the action button if the work order is new or reopened\r\n * hide the action button if on the Repair tab and the work order is assigned to Beacon. These should be closed on the beacon tab only\r\n * we will need to stop hiding the button when not on the Beacon tab once we add more actions. Might hide the close option from the dropdown in that case.d\r\n */\r\n shouldShowActionButton = (workOrder: IWorkOrder) => {\r\n return (\r\n (workOrder.status === workOrderStatusEnum.reopened ||\r\n workOrder.status === workOrderStatusEnum.new) &&\r\n (this.props.tableFilters.tabKey === workOrderTabEnum.repair &&\r\n workOrder.vendor === workOrderVendorsEnum.beacon) === false\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n /**\r\n * Toggle a single checkbox for select table\r\n */\r\n toggleSelection = (key: string, shift: boolean, row: any) => {\r\n // start off with the existing state\r\n let selection = [...this.props.selection];\r\n const keyIndex = selection.indexOf(key);\r\n\r\n // check to see if the key exists\r\n if (keyIndex >= 0) {\r\n // it does exist so we will remove it using destructing\r\n selection = [\r\n ...selection.slice(0, keyIndex),\r\n ...selection.slice(keyIndex + 1)\r\n ];\r\n } else {\r\n // it does not exist so add it\r\n selection.push(key);\r\n }\r\n // update the state\r\n this.props.updateWorkOrderSelection(selection);\r\n };\r\n\r\n /**\r\n * Toggle all checkboxes for select table\r\n */\r\n toggleAll = () => {\r\n const { keyField = 'id' } = this.props;\r\n const selectAll = !this.state.selectAll;\r\n const selection: string[] = [];\r\n\r\n if (selectAll && keyField !== undefined) {\r\n // we need to get at the internals of ReactTable\r\n const wrappedInstance = this.checkboxTable.getWrappedInstance();\r\n // the 'sortedData' property contains the currently accessible records based on the filter and sort\r\n const currentRecords: any[] = wrappedInstance.getResolvedState()\r\n .sortedData;\r\n // we just push all the IDs onto the selection array\r\n currentRecords.forEach(item => {\r\n selection.push(`select-${item._original[keyField]}`);\r\n });\r\n }\r\n this.setState({ selectAll });\r\n this.props.updateWorkOrderSelection(selection);\r\n };\r\n\r\n /**\r\n * Whether or not a row is selected for select table\r\n */\r\n isSelected = (key: string) => {\r\n return this.props.selection.includes(`select-${key}`);\r\n };\r\n\r\n getTrProps = (state: FinalState, rowInfo: RowInfoWorkOrder | undefined) => {\r\n // const { selection } = this.props;\r\n if (rowInfo) {\r\n const hasWorkOrder = find(this.props.jobWorkOrdersByID, {\r\n workOrderID: rowInfo.original.id\r\n });\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.props.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : '',\r\n color: hasWorkOrder ? constants.colors.blue : 'inherit'\r\n },\r\n onClick: () => {\r\n this.props.setSelectedWorkOrderID(rowInfo.original.id);\r\n if (rowInfo.original.type === workOrderTypesEnum.pmp) {\r\n this.setState({\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !this.state\r\n .selectedRow[rowInfo.viewIndex || 0]\r\n }\r\n });\r\n } else {\r\n this.props.toggleEditWorkOrderModal();\r\n }\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n\r\n render() {\r\n const { tableData, t, loading, totalPages } = this.props;\r\n const colorButton =\r\n constants.colors[\r\n `${this.props.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n const shouldShowCheckboxes = constants.hasSecurityFunction(\r\n this.props.user,\r\n [constants.securityFunctions.ManageJobs.id]\r\n );\r\n const tableClassName = shouldShowCheckboxes\r\n ? `beacon-table -highlight ${this.props.currentTile.color}`\r\n : `beacon-table -highlight ${this.props.currentTile.color} hide-checkboxes`;\r\n\r\n return (\r\n
    \r\n {this.props.selection.length !== 0 &&\r\n this.state.workOrdersSameSAPType && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={tableClassName}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n loading={loading}\r\n toggleSelection={this.toggleSelection}\r\n selectAll={this.state.selectAll}\r\n selectType=\"checkbox\"\r\n toggleAll={this.toggleAll}\r\n isSelected={this.isSelected}\r\n ref={ref => (this.checkboxTable = ref)}\r\n keyField=\"id\"\r\n />\r\n
    \r\n );\r\n }\r\n}\r\n","/*\r\n * Work Order Beacon Table Container\r\n */\r\n\r\nimport { Itile } from '../../models';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n setTableFilter,\r\n updateWorkOrderSelection\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { WorkOrderBeaconTable } from './WorkOrderBeaconTable';\r\nimport { selectJobWorkOrdersWithWorkOrders } from '../../reducers/manageJobReducer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectVisibleWorkOrdersByID } from '../../reducers/manageWorkOrderReducer';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n currentTile: Itile;\r\n overrideColumns?: any[];\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const { totalPages, tableFilters } = state.manageWorkOrder;\r\n const jobWorkOrdersByID = selectJobWorkOrdersWithWorkOrders(state);\r\n const tableData = selectVisibleWorkOrdersByID(state);\r\n const fseUsersByID = state.manageJob.fseUsersByID;\r\n\r\n tableData.forEach(td => {\r\n if (!td.assignedUser && td.userID) {\r\n const user = fseUsersByID[td.userID];\r\n td.assignedUser = user ? `${user.first} ${user.last}` : '';\r\n }\r\n });\r\n\r\n return {\r\n loading: selectIsLoading(state),\r\n tableData,\r\n totalPages,\r\n tableFilters,\r\n user: state.user,\r\n selection: state.manageWorkOrder.selection,\r\n jobWorkOrdersByID,\r\n usersByID: state.manageUser.usersByID\r\n };\r\n};\r\n\r\nexport const WorkOrderBeaconTableContainer = connect(mapStateToProps, {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n setTableFilter,\r\n updateWorkOrderSelection\r\n})(WorkOrderBeaconTable);\r\n","/*\r\n * EditJobForm\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { debounce } from 'lodash';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\n\r\nimport moment from 'moment';\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { getNextJobNumber } from '../../actions/manageJobActions';\r\nimport { constants } from '../../../constants/constants';\r\nimport {\r\n IWorkOrder,\r\n Ifacility,\r\n IfacilityWithoutBuildings,\r\n Ijob,\r\n IjobPart,\r\n Ioption,\r\n Iuser\r\n} from '../../../models';\r\nimport { IgenericFormValues } from '../../../modelsForms';\r\nimport { convertFacilityOptions } from '../../../reducers/facilitiesReducer';\r\nimport { initialJob } from '../../../reducers/initialState';\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { IjobTypeOptionsForWorkOrder } from '../../../helpers/sapManager';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../../../constants/apiEndpoints';\r\nimport { msalFetch } from '../../auth/Auth-Utils';\r\nimport { addWorkOrdersToJob } from '../../../actions/manageJobActions';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\ninterface Iprops {\r\n // reusable\r\n loading: boolean;\r\n show: boolean;\r\n nextJobNumber: string;\r\n onSubmit: (\r\n job: Ijob,\r\n jobParts: IjobPart[],\r\n isEditMode: boolean,\r\n activeCountryID: string\r\n ) => Promise;\r\n user: Iuser;\r\n closeModal: (closeAll: boolean) => void;\r\n facility: Ifacility;\r\n colorButton: string;\r\n getNextJobNumber: typeof getNextJobNumber;\r\n jobTypeOptions: IjobTypeOptionsForWorkOrder;\r\n workOrdersForNewJob: IWorkOrder[];\r\n fseUsersByID: { [key: string]: Iuser };\r\n addWorkOrdersToJob: typeof addWorkOrdersToJob;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass NewJobForm extends React.Component {\r\n private formGroup: FormGroup | any;\r\n private subscription: any;\r\n\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n\r\n this.state = {\r\n fieldConfig: this.buildFieldConfig()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.props.getNextJobNumber();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & WithTranslation) {\r\n if (this.props.nextJobNumber !== prevProps.nextJobNumber) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.closeModal(false);\r\n }\r\n\r\n /*\r\n * itemToFormValues - take the selectedObject and convert it to formValues\r\n */\r\n itemToFormValues = (): IgenericFormValues => {\r\n const selectedFacility = FormUtil.convertToSingleOption(\r\n this.props.facility\r\n );\r\n const loadJobNumber = this.props.nextJobNumber;\r\n const startDate = moment.utc().format(constants.momentDisplayFormat);\r\n const endDate = moment.utc().format(constants.momentDisplayFormat);\r\n\r\n return {\r\n jobNumber: loadJobNumber,\r\n facilityID: selectedFacility,\r\n jobTypeID: undefined,\r\n startDate,\r\n endDate\r\n };\r\n };\r\n\r\n /*\r\n * formValuesToItem - convert the formValues to the shape of the selectedObject\r\n */\r\n formValuesToItem = (): Ijob => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n const { facilityID: formFacilityID } = formValues;\r\n const facilityID = (Array.isArray(formFacilityID)\r\n ? formFacilityID[0]\r\n : formFacilityID) as string;\r\n\r\n return {\r\n ...initialJob,\r\n ...formValues,\r\n id: uuidv4(),\r\n facilityID,\r\n userJobs: []\r\n };\r\n };\r\n\r\n loadOptions = debounce(async (search, callback) => {\r\n if (search && search.length >= 3) {\r\n const page = 1;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n page,\r\n search,\r\n countryID: this.props.facility.countryID\r\n }\r\n };\r\n\r\n const url = API.GET.user.getusersearch;\r\n await msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n const users: Iuser[] = response?.data.result;\r\n const userOptions: Ioption[] = users.map(user => ({\r\n label: `${user.first} ${user.last}`,\r\n value: user.id\r\n }));\r\n callback(userOptions);\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n constants.handleError(err, 'get users');\r\n });\r\n return;\r\n }\r\n\r\n callback();\r\n }, 200);\r\n\r\n buildFieldConfig = (defaultValues = this.itemToFormValues()) => {\r\n const { t, facility, jobTypeOptions } = this.props;\r\n const disabled = false;\r\n const { startDate, endDate } = defaultValues;\r\n const facilityOption = convertFacilityOptions([\r\n facility as IfacilityWithoutBuildings\r\n ]);\r\n\r\n // Field config to configure form\r\n let fieldConfigControls: { [key: string]: any } = {\r\n facilityID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n label: 'jobForm.facility',\r\n colWidth: 12,\r\n placeholder: 'jobForm.facilitySearchPlaceholder',\r\n name: 'facility',\r\n options: facilityOption\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: facilityOption,\r\n disabled: true\r\n }\r\n },\r\n jobNumber: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'jobForm.jobNumber',\r\n colWidth: 12,\r\n type: 'input',\r\n name: 'jobnumber',\r\n required: false\r\n },\r\n formState: { value: defaultValues.jobNumber, disabled }\r\n },\r\n jobTypeID: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: jobTypeOptions.jobTypes,\r\n label: 'jobForm.type',\r\n colWidth: 12,\r\n placeholder: 'jobForm.typeSearchPlaceholder',\r\n name: 'job-type',\r\n shouldTranslate: true\r\n },\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n formState: {\r\n value: jobTypeOptions.defaultSAPJobType\r\n ? jobTypeOptions.defaultSAPJobType\r\n : undefined,\r\n disabled\r\n }\r\n },\r\n assignedUserID: {\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n loadOptions: (search: string, callback: any) => {\r\n this.loadOptions(search, callback);\r\n },\r\n label: 'jobForm.fseLead',\r\n colWidth: 12,\r\n placeholder: 'jobForm.fseLeadSearchPlaceholder',\r\n name: 'assigned-lead-user',\r\n type: 'select'\r\n },\r\n\r\n formState: {\r\n value: defaultValues.assignedUserID,\r\n disabled\r\n }\r\n },\r\n startDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'jobForm.startDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'start-date',\r\n placeholder: 'jobForm.startDatePlaceholder'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: startDate,\r\n disabled\r\n }\r\n },\r\n endDate: {\r\n render: FormUtil.Datetime,\r\n meta: {\r\n label: 'jobForm.endDate',\r\n colWidth: 12,\r\n showTime: false,\r\n name: 'end-date',\r\n placeholder: 'jobForm.endDatePlaceholder'\r\n },\r\n options: {\r\n validators: [\r\n FormUtil.validators.requiredWithTrim,\r\n FormUtil.validators.isValidMoment\r\n ]\r\n },\r\n formState: {\r\n value: endDate,\r\n disabled\r\n }\r\n }\r\n };\r\n\r\n const fieldConfig = {\r\n controls: { ...fieldConfigControls }\r\n };\r\n return FormUtil.translateForm(fieldConfig, this.props.t);\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes after a short delay that allows the initial form values to load\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'startDate': {\r\n this.checkIfStartDateBeforeEndDate({ startDate: value });\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n }\r\n case 'endDate': {\r\n this.checkIfStartDateBeforeEndDate({ endDate: value });\r\n if (moment.isMoment(value)) {\r\n value = value.format(constants.momentSQLFormat);\r\n }\r\n }\r\n default:\r\n //this.onChangeDebounced(this.formValuesToItem());\r\n break;\r\n }\r\n };\r\n\r\n /*\r\n * Check if the date is in the past or if the start is before the end date\r\n */\r\n checkIfStartDateBeforeEndDate = ({ startDate, endDate }: any) => {\r\n if (\r\n startDate &&\r\n moment.isMoment(startDate) &&\r\n this.formGroup.value.endDate\r\n ) {\r\n if (startDate.isAfter(this.formGroup.value.endDate)) {\r\n toastr.warning(\r\n this.props.t('jobForm.startDateWarning'),\r\n '',\r\n constants.toastrWarning\r\n );\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors({ beforeStart: true });\r\n } else if (startDate.isBefore(moment(), 'day')) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.pastDateWarning'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors(null);\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors(null);\r\n }\r\n } else if (endDate && moment.isMoment(endDate)) {\r\n if (endDate.isBefore(this.formGroup.value.startDate)) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.startDateWarning'),\r\n constants.toastrWarning\r\n );\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors({ beforeStart: true });\r\n } else if (endDate.isBefore(moment(), 'day')) {\r\n toastr.warning(\r\n this.props.t('common:warning'),\r\n this.props.t('jobForm.pastDateWarning'),\r\n constants.toastrWarning\r\n );\r\n } else {\r\n const endDateControl = this.formGroup.get('endDate');\r\n endDateControl.setErrors(null);\r\n const startDateControl = this.formGroup.get('startDate');\r\n startDateControl.setErrors(null);\r\n }\r\n } else {\r\n console.error('missing start and end date');\r\n }\r\n };\r\n\r\n onSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n this.props\r\n .onSubmit(this.formValuesToItem(), [], false, '')\r\n .then(response => {\r\n if (response?.value) {\r\n const {\r\n closeModal,\r\n workOrdersForNewJob,\r\n t,\r\n addWorkOrdersToJob\r\n } = this.props;\r\n const { id } = response.value;\r\n const selection = workOrdersForNewJob.map(\r\n wo => `select-${wo.id}`\r\n );\r\n\r\n // Job has been created, now add the work orders to the job\r\n addWorkOrdersToJob(selection, id, t, true);\r\n\r\n // Now that we're done, tell the parent component to close the 1st modal as well\r\n closeModal(true);\r\n }\r\n });\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix job-form beacon-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n \r\n \r\n this.props.closeModal(false)}\r\n >\r\n {t('jobForm.cancel')}\r\n \r\n\r\n \r\n {t('jobForm.save')}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport default NewJobForm;\r\n","/*\r\n * Edit Job Redux Connector\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport {\r\n addWorkOrdersToJob,\r\n getNextJobNumber,\r\n saveJob\r\n} from '../../../actions/manageJobActions';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport {\r\n selectActiveFseUsersByID,\r\n selectNextJobNumber\r\n} from '../../../reducers/manageJobReducer';\r\n\r\nimport NewJobForm from './NewJobForm';\r\nimport { initialFacility } from '../../../reducers/initialState';\r\nimport { forEach } from 'lodash';\r\nimport {\r\n IjobTypeOptionsForWorkOrder,\r\n getJobTypeOptionsForWorkOrder\r\n} from '../../../helpers/sapManager';\r\nimport { WithCommonModal } from '../../common/WithCommonModal';\r\nimport { IWorkOrder } from '../../../models';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n showModal: boolean;\r\n closeModal: (closeAll: boolean) => void;\r\n onHide: () => void;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const nextJobNumber = selectNextJobNumber(state);\r\n let modalTitle = ownProps.t('nsJob:saveModalTitle');\r\n let facility = initialFacility;\r\n const workOrders = Object.values(state.manageWorkOrder.workOrdersByID);\r\n let jobTypeOptions: IjobTypeOptionsForWorkOrder = {\r\n jobTypes: [],\r\n defaultSAPJobType: undefined\r\n };\r\n let workOrdersForNewJob: IWorkOrder[] = [];\r\n const sapJobMappings = state.sapJobMappings.sapJobMappingsByID;\r\n\r\n forEach(state.manageWorkOrder.selection, (id: string) => {\r\n const workOrderId = id.substring(7); // remove the select- prefix\r\n const wo = workOrders.find(wo => wo.id === workOrderId);\r\n if (wo) {\r\n if (wo.facility && wo.facility.id && wo.facility.id.length > 0) {\r\n facility = wo.facility;\r\n }\r\n\r\n workOrdersForNewJob.push(wo);\r\n\r\n jobTypeOptions = getJobTypeOptionsForWorkOrder(\r\n wo,\r\n sapJobMappings,\r\n ownProps.t\r\n );\r\n }\r\n });\r\n\r\n return {\r\n // reusable\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: ownProps.showModal,\r\n className: 'job-edit',\r\n title: modalTitle,\r\n nextJobNumber,\r\n closeModal: ownProps.closeModal,\r\n facility: facility,\r\n jobTypeOptions,\r\n workOrdersForNewJob,\r\n fseUsersByID: selectActiveFseUsersByID(state)\r\n };\r\n};\r\n\r\nexport default withTranslation('nsJob')(\r\n connect(mapStateToProps, {\r\n // reusable\r\n onSubmit: saveJob,\r\n getNextJobNumber,\r\n addWorkOrdersToJob\r\n })(WithCommonModal(NewJobForm))\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport {\r\n clearSelectedWorkOrderID,\r\n deleteWorkOrder,\r\n getFSEsWithWorkOrder,\r\n getWorkOrderCsv,\r\n getWorkOrders,\r\n setSelectedWorkOrderID,\r\n setTableFilter,\r\n toggleEditWorkOrderModal,\r\n updateWorkOrderSelection\r\n} from '../../actions/manageWorkOrderActions';\r\nimport {\r\n IcountryBE,\r\n Ioption,\r\n ItableFiltersReducer,\r\n Itile,\r\n Iuser,\r\n IWorkOrder\r\n} from '../../models';\r\n\r\nimport { debounce } from 'lodash';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { connect } from 'react-redux';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n workOrderDateRangeUnumForFilter,\r\n workOrderStatusEnum,\r\n workOrderStatusEnumForFilter,\r\n workOrderTabEnum,\r\n workOrderTypesEnum,\r\n workOrderVendorsEnum\r\n} from '../../models-enums';\r\nimport { IinitialState } from '../../reducers';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { getCountries } from '../../reducers/countriesReducer';\r\nimport { emptyTile, initialWorkOrder } from '../../reducers/initialState';\r\nimport { selectVisibleWorkOrdersByID } from '../../reducers/manageWorkOrderReducer';\r\nimport { Banner } from '../common/Banner';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { ConfirmSelectJobContainer } from './ConfirmSelectJobContainer';\r\nimport { EditWorkOrderModal } from './EditWorkOrderModal';\r\nimport { WorkOrderBeaconTableContainer } from './WorkOrderBeaconTableContainer';\r\nimport { WorkOrderCloseModal } from './WorkOrderCloseModal';\r\nimport NewJobModal from './modals/NewJobModal';\r\nimport { getAllOpenJobsForWorkOrders } from '../../actions/manageJobActions';\r\nimport { getSAPJobMapping } from '../../actions/commonActions';\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n tableData: IWorkOrder[];\r\n totalPages: number;\r\n showEditWorkOrderModal: boolean;\r\n getWorkOrders: typeof getWorkOrders;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n deleteWorkOrder: typeof deleteWorkOrder;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n clearSelectedWorkOrderID: typeof clearSelectedWorkOrderID;\r\n getWorkOrderCsv: typeof getWorkOrderCsv;\r\n selectedFacilityID: string;\r\n selectedWorkOrderID: string;\r\n selectedWorkOrder: IWorkOrder;\r\n manageWorkOrderAdmin: boolean;\r\n manageWorkOrderPMP: boolean;\r\n manageCustomerWorkOrders: boolean;\r\n user: Iuser;\r\n userOptions: Ioption[];\r\n selection: string[];\r\n closeAllModals: typeof closeAllModals;\r\n updateWorkOrderSelection: typeof updateWorkOrderSelection;\r\n getFSEsWithWorkOrder: typeof getFSEsWithWorkOrder;\r\n allCountries: IcountryBE[];\r\n getAllOpenJobsForWorkOrders: typeof getAllOpenJobsForWorkOrders;\r\n getSAPJobMapping: typeof getSAPJobMapping;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n searchFieldConfig: FieldConfig;\r\n showCloseNoteModal: boolean;\r\n showNewJobModal: boolean;\r\n}\r\n\r\nclass ManageWorkOrder extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n static defaultProps = {\r\n selection: []\r\n };\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n searchFieldConfig: this.buildSearchControls(),\r\n showCloseNoteModal: false,\r\n showNewJobModal: false\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n\r\n const defaultStatus = FormUtil.convertToSingleOption({\r\n id: workOrderStatusEnumForFilter.New.toString(),\r\n label: this.props.t('new')\r\n });\r\n\r\n const activeCountryOption: Ioption = {\r\n value: this.props.user.countryID || '',\r\n label:\r\n this.props.allCountries?.find(\r\n c => c.id === this.props.user.countryID\r\n )?.name || ''\r\n };\r\n\r\n this.props.setTableFilter({\r\n workOrderType: workOrderTypesEnum.repair,\r\n vendor: workOrderVendorsEnum.beacon,\r\n tabKey: workOrderTabEnum.beacon,\r\n page: 1,\r\n statusFilter: defaultStatus,\r\n isDeleted: false,\r\n sapWorkOrder: true,\r\n countryID: activeCountryOption\r\n });\r\n\r\n document.addEventListener(\r\n 'updatedWorkOrders',\r\n this.handleUpdatedData,\r\n false\r\n );\r\n this.props.getFSEsWithWorkOrder();\r\n this.props.getAllOpenJobsForWorkOrders();\r\n this.props.getSAPJobMapping();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditWorkOrderModal !==\r\n this.props.showEditWorkOrderModal &&\r\n !this.props.showEditWorkOrderModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n\r\n // check to see if tableFilters are exactly the same, tiggers even when the values are the same\r\n if (prevProps.tableFilters !== this.props.tableFilters) {\r\n this.props.getWorkOrders();\r\n\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n\r\n if (prevProps.userOptions.length !== this.props.userOptions.length) {\r\n this.setState({ searchFieldConfig: this.buildSearchControls() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\r\n 'updatedWorkOrders',\r\n this.handleUpdatedData,\r\n false\r\n );\r\n this.props.closeAllModals();\r\n this.props.setTableFilter({\r\n vendor: undefined,\r\n page: 1,\r\n assignedUser: undefined\r\n });\r\n }\r\n\r\n handleUpdatedData = () => {\r\n this.props.getWorkOrders();\r\n this.setState({ selectedRow: {} });\r\n };\r\n\r\n /*\r\n * Note that technicianToDo is not an actual filter. it is only used to select which To Do List to download\r\n */\r\n buildSearchControls = (): FieldConfig => {\r\n const disabled = false;\r\n\r\n const activeCountryOption: Ioption = {\r\n value: this.props.user.countryID || '',\r\n label:\r\n this.props.allCountries?.find(\r\n c => c.id === this.props.user.countryID\r\n )?.name || ''\r\n };\r\n const countriesOptions: Ioption[] = this.props.allCountries.map(c => ({\r\n label: c.name,\r\n value: c.id\r\n }));\r\n\r\n const defaultStatus = FormUtil.convertToSingleOption({\r\n id: workOrderStatusEnumForFilter.New.toString(),\r\n label: this.props.t('new')\r\n });\r\n const {\r\n search,\r\n statusFilter = defaultStatus,\r\n dateRange,\r\n tabKey,\r\n assignedUser\r\n } = this.props.tableFilters;\r\n\r\n const searchPlaceholder =\r\n this.state && tabKey === 'beacon'\r\n ? 'searchNumberPlaceholderBeacon'\r\n : 'searchNumberPlaceholder';\r\n\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: searchPlaceholder,\r\n isClearable: true\r\n },\r\n formState: { value: search, disabled }\r\n },\r\n countryID: {\r\n options: {\r\n validators: FormUtil.validators.requiredWithTrim\r\n },\r\n render: FormUtil.Select,\r\n meta: {\r\n options: countriesOptions,\r\n label: 'user:primaryCountry',\r\n colWidth: 2,\r\n placeholder: 'manageUserQueue:countrySearchPlaceholder',\r\n name: 'country'\r\n },\r\n formState: { value: activeCountryOption, disabled }\r\n },\r\n statusFilter: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n workOrderStatusEnumForFilter\r\n ),\r\n label: 'status',\r\n colWidth: 2,\r\n isClearable: false,\r\n shouldTranslate: true\r\n },\r\n formState: { value: statusFilter, disabled }\r\n },\r\n dateRange: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n workOrderDateRangeUnumForFilter\r\n ),\r\n label: 'dateRange',\r\n colWidth: 2,\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: { value: dateRange, disabled }\r\n },\r\n fseUser: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: this.props.userOptions,\r\n label: 'FSENameTableHeader',\r\n colWidth: 3,\r\n isClearable: true,\r\n shouldTranslate: true,\r\n dataType: 'fseUser'\r\n },\r\n formState: { value: assignedUser || '', disabled }\r\n },\r\n sapWorkOrder: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'sapWorkOrder',\r\n colWidth: 2,\r\n innerStyle: {\r\n display: 'flex',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center'\r\n }\r\n },\r\n formState: {\r\n value: true,\r\n disabled\r\n }\r\n },\r\n isDeleted: {\r\n render: FormUtil.Toggle,\r\n meta: {\r\n label: 'showDeleted',\r\n colWidth: 2,\r\n innerStyle: {\r\n display: 'flex',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center'\r\n }\r\n },\r\n formState: {\r\n value: false,\r\n disabled\r\n }\r\n },\r\n seperator: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n colWidth: 1\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n downloadCsv(tech: Ioption | null) {\r\n const { t } = this.props;\r\n if (tech && tech.value) {\r\n this.props.getWorkOrderCsv(tech.value);\r\n } else {\r\n toastr.warning(\r\n t('common:warning'),\r\n t('Please select a technician.'),\r\n constants.toastrWarning\r\n );\r\n }\r\n }\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n this.setTableFilterDebounced({ search: value, page: 1 });\r\n break;\r\n case 'statusFilter':\r\n this.setTableFilterDebounced({\r\n statusFilter: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'countryID':\r\n this.setTableFilterDebounced({\r\n countryID: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'isDeleted':\r\n this.setTableFilterDebounced({\r\n isDeleted: value,\r\n page: 1\r\n });\r\n break;\r\n case 'sapWorkOrder':\r\n this.setTableFilterDebounced({\r\n sapWorkOrder: value,\r\n page: 1\r\n });\r\n break;\r\n case 'dateRange':\r\n this.setTableFilterDebounced({\r\n dateRange: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'fseUser':\r\n this.setTableFilterDebounced({\r\n assignedUser: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'technicianToDo':\r\n this.downloadCsv(value);\r\n this.setState({\r\n searchFieldConfig: this.buildSearchControls()\r\n }); // this clears the select\r\n // this.setTableFilterDebounced({ technicianToDo: value, page: 1 });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n handleEdit(row: any) {\r\n this.setState({ selectedRow: row.index });\r\n this.props.toggleEditWorkOrderModal();\r\n this.props.setSelectedWorkOrderID(row.original.id);\r\n }\r\n\r\n /*\r\n * Show the action button if the work order is new or reopened\r\n * hide the action button if on the Repair tab and the work order is assigned to Beacon. These should be closed on the beacon tab only\r\n * we will need to stop hiding the button when not on the Beacon tab once we add more actions. Might hide the close option from the dropdown in that case.d\r\n */\r\n shouldShowActionButton = (workOrder: IWorkOrder) => {\r\n return (\r\n (workOrder.status === workOrderStatusEnum.reopened ||\r\n workOrder.status === workOrderStatusEnum.new) &&\r\n (this.props.tableFilters.tabKey === workOrderTabEnum.repair &&\r\n workOrder.vendor === workOrderVendorsEnum.beacon) === false &&\r\n workOrder.vendor !== workOrderVendorsEnum.beacon // TODO temporarily prevent closing beacon work orders\r\n );\r\n };\r\n\r\n // disabled on the PMP tab and hide the delete and save buttons.\r\n shouldEnableWorkOrderForm = () => {\r\n return this.props.tableFilters.tabKey === workOrderTabEnum.preventative;\r\n };\r\n\r\n render() {\r\n const { t, tableFilters } = this.props;\r\n const { tabKey = workOrderTabEnum.repair } = tableFilters;\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n return (\r\n
    \r\n \r\n {tabKey !== workOrderTabEnum.beacon && (\r\n \r\n )}\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n this.setState({ showNewJobModal: true })\r\n }\r\n />\r\n\r\n {\r\n this.setState({ showNewJobModal: false });\r\n if (closeAll) {\r\n this.props.closeAllModals();\r\n }\r\n }}\r\n onHide={() => this.setState({ showNewJobModal: false })}\r\n />\r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n const tableData = selectVisibleWorkOrdersByID(state);\r\n const userOptions = state.manageWorkOrder.fsesWithWorkOrders?.map(user => {\r\n const name = `${user.first} ${user.last}`;\r\n return { label: name, value: user.id };\r\n });\r\n\r\n const manageWorkOrderAdmin = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageWorkOrderAdmin.id\r\n ]);\r\n const manageWorkOrderPMP = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageWorkOrderPMP.id\r\n ]);\r\n const manageCustomerWorkOrders = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageCustomerWorkOrders.id\r\n ]);\r\n\r\n const selectedWorkOrder =\r\n state.manageWorkOrder.workOrdersByID[\r\n state.manageWorkOrder.selectedWorkOrderID\r\n ] || initialWorkOrder;\r\n\r\n const allCountries = getCountries(state);\r\n\r\n return {\r\n tableData,\r\n manageWorkOrderAdmin,\r\n manageWorkOrderPMP,\r\n manageCustomerWorkOrders,\r\n totalPages: state.manageWorkOrder.totalPages,\r\n showEditWorkOrderModal: state.manageWorkOrder.showEditWorkOrderModal,\r\n tableFilters: state.manageWorkOrder.tableFilters,\r\n selectedFacilityID: state.selectedFacilityID,\r\n selectedWorkOrderID: state.manageWorkOrder.selectedWorkOrderID,\r\n loading: selectIsLoading(state),\r\n selectedWorkOrder,\r\n user: state.user,\r\n userOptions,\r\n allCountries\r\n };\r\n};\r\n\r\nexport default withTranslation('manageWorkOrder')(\r\n connect(mapStateToProps, {\r\n getWorkOrders,\r\n toggleEditWorkOrderModal,\r\n deleteWorkOrder,\r\n setTableFilter,\r\n setSelectedWorkOrderID,\r\n clearSelectedWorkOrderID,\r\n getWorkOrderCsv,\r\n closeAllModals,\r\n updateWorkOrderSelection,\r\n getFSEsWithWorkOrder,\r\n getAllOpenJobsForWorkOrders,\r\n getSAPJobMapping\r\n })(ManageWorkOrder)\r\n);\r\n","import { beginAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\n\r\nimport * as types from './actionTypes';\r\nimport { constants } from '../constants/constants';\r\nimport { IsuggestedPart, ItableFiltersParams, ThunkResult } from '../models';\r\nimport { initialSuggestedPart } from '../reducers/initialState';\r\nimport { omit, map } from 'lodash';\r\nconst uuidv4 = require('uuid/v4');\r\n\r\nexport const searchSuggestedParts = (): ThunkResult => {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const {\r\n page,\r\n partSearch,\r\n productSearch,\r\n productID\r\n } = getState().manageSuggestedParts.tableFilters;\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: { page, partSearch, productSearch, productID }\r\n };\r\n const url = API.suggestedParts.search;\r\n return msalFetch(url, axiosOptions)\r\n .then(data => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.SEARCH_SUGGESTED_PARTS_SUCCESS,\r\n payload: data.data\r\n });\r\n dispatch({\r\n type: types.SUGGESTED_PARTS_MANAGE_TOTAL_PAGES,\r\n pages: data.data.pages\r\n });\r\n return data;\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.SEARCH_SUGGESTED_PARTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'searchSuggestedParts');\r\n console.error(error);\r\n });\r\n };\r\n};\r\n\r\nexport function saveSuggestedPart(\r\n suggestedParts: IsuggestedPart[]\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n dispatch({ type: types.CLOSE_ALL_MODALS });\r\n\r\n const suggestedPartsForAPI = map(suggestedParts, part => {\r\n const cleanedSuggestedPart = omit(part, [\r\n 'part',\r\n 'product',\r\n 'installBaseID',\r\n 'installBaseQuantity',\r\n 'createDate',\r\n 'updateDate'\r\n ]);\r\n return {\r\n ...cleanedSuggestedPart,\r\n id: part.id || uuidv4()\r\n };\r\n });\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: suggestedPartsForAPI\r\n };\r\n\r\n const url = API.suggestedParts.save;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n }\r\n dispatch({\r\n type: types.SAVE_SUGGESTED_PARTS_SUCCESS,\r\n part: suggestedParts[0]\r\n });\r\n dispatch(searchSuggestedParts());\r\n return data;\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.SAVE_SUGGESTED_PARTS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get brands');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * updateSelectedSuggestedPart\r\n * update the selected suggestedPart\r\n */\r\nexport const updateSelectedSuggestedPart = (\r\n suggestedPart = initialSuggestedPart\r\n) => ({\r\n type: types.UPDATE_SELECTED_SUGGESTED_PART,\r\n payload: suggestedPart\r\n});\r\n\r\nexport const toggleEditSuggestedPartModal = (show?: boolean) => ({\r\n type: types.TOGGLE_MODAL_EDIT_SUGGESTED_PART,\r\n show\r\n});\r\n\r\nexport const setTableFilter = (filters: ItableFiltersParams) => ({\r\n type: types.SET_TABLE_FILTER_MANAGE_SUGGESTED_PARTS,\r\n filters\r\n});\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport {\r\n ItableFiltersReducer,\r\n Itile,\r\n Iproduct,\r\n ImanageInventoryReducer,\r\n IsuggestedPart\r\n} from '../../models';\r\nimport ReactTable, { FinalState, RowInfo } from 'react-table';\r\nimport {\r\n toggleEditSuggestedPartModal,\r\n searchSuggestedParts,\r\n setTableFilter\r\n} from '../../actions/manageSuggestedPartsActions';\r\nimport {\r\n toggleSearchNewProductsModal,\r\n setSearchNewProductsSelectedProduct\r\n} from '../../actions/manageInventoryActions';\r\nimport { debounce, orderBy } from 'lodash';\r\nimport queryString from 'query-string';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport EditSuggestedPartModal from './EditSuggestedPartModal';\r\nimport SearchNewProductsModal from '../manageInventory/SearchNewProductsModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile, initialProduct } from '../../reducers/initialState';\r\nimport { closeAllModals } from '../../actions/commonActions';\r\nimport { IinitialState } from '../../reducers';\r\nimport { addQuery, removeQuery } from '../common/OtherUtils';\r\nimport { Iuser } from '../../models';\r\n\r\ninterface RowInfoSuggestedPart extends RowInfo {\r\n original: IsuggestedPart;\r\n}\r\nexport enum manageSuggestedPartsQueryParamsEnum {\r\n productID = 'productID',\r\n suggestedPartID = 'suggestedPartID'\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n manageInventory: ImanageInventoryReducer;\r\n tableData: any[];\r\n totalPages: number;\r\n showEditSuggestedPartModal: boolean;\r\n searchSuggestedParts: typeof searchSuggestedParts;\r\n toggleEditSuggestedPartModal: typeof toggleEditSuggestedPartModal;\r\n toggleSearchNewProductsModal: typeof toggleSearchNewProductsModal;\r\n setSearchNewProductsSelectedProduct: typeof setSearchNewProductsSelectedProduct;\r\n productFromQueryParam: Iproduct;\r\n searchNewProductsSelectedProduct: Iproduct;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n closeAllModals: typeof closeAllModals;\r\n queryParams: typeof manageSuggestedPartsQueryParamsEnum;\r\n user: Iuser;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageSuggestedParts extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n searchFieldConfig: this.buildSearchControls()\r\n };\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n this.checkForProductIdQueryParam();\r\n this.props.searchSuggestedParts();\r\n this.shouldShowSelected();\r\n }\r\n /*\r\n * shouldShowSelected\r\n * if there is a selected item in the query param\r\n * show the edit modal for that item\r\n */\r\n shouldShowSelected = () => {\r\n const shouldShow = !!(\r\n this.props.queryParams.suggestedPartID &&\r\n this.props.queryParams.suggestedPartID.length > 0\r\n );\r\n this.props.toggleEditSuggestedPartModal(shouldShow);\r\n };\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditSuggestedPartModal !==\r\n this.props.showEditSuggestedPartModal &&\r\n !this.props.showEditSuggestedPartModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n // automatically get inventory every time a fitler changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.searchSuggestedParts();\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.props.closeAllModals();\r\n }\r\n checkForProductIdQueryParam = () => {\r\n if (this.props.queryParams.productID) {\r\n this.props.setTableFilter({\r\n page: 1,\r\n partSearch: '',\r\n productSearch: '',\r\n productID: this.props.queryParams.productID\r\n });\r\n }\r\n };\r\n\r\n canManageSuggestedParts = () => {\r\n return constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageSuggestedParts.id\r\n ]);\r\n };\r\n\r\n buildSearchControls = (): FieldConfig => {\r\n const mainSearchControls = {\r\n partSearch: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'searchPart',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: 'Search...',\r\n defaultValue: this.props.tableFilters.partSearch,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: this.props.tableFilters.partSearch,\r\n disabled: false\r\n }\r\n },\r\n productSearch: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'searchProduct',\r\n colWidth: 5,\r\n type: 'text',\r\n placeholder: 'Search...',\r\n defaultValue: this.props.tableFilters.productSearch,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: this.props.tableFilters.productSearch,\r\n disabled: false\r\n }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n this.setTableFilterDebounced({ [key]: value, page: 1 });\r\n };\r\n\r\n handleEdit(row: any) {\r\n this.setState({ selectedRow: row.index });\r\n this.props.toggleEditSuggestedPartModal();\r\n addQuery(\r\n manageSuggestedPartsQueryParamsEnum.suggestedPartID,\r\n row.original.id,\r\n this.props.history\r\n );\r\n }\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n setColumns = () => {\r\n const columns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Header: 'part',\r\n id: 'part',\r\n accessor: ({ part }: IsuggestedPart) =>\r\n `${part.number} - ${part.description}`,\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'product',\r\n accessor: 'product.name',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'times used',\r\n accessor: 'productQuantity',\r\n width: 150\r\n },\r\n {\r\n Header: 'comments',\r\n accessor: 'adminComments',\r\n minWidth: 200\r\n },\r\n {\r\n Header: 'service time',\r\n accessor: 'part.installationTime',\r\n width: 150\r\n }\r\n ],\r\n this.props.t\r\n );\r\n this.setState({ columns });\r\n };\r\n\r\n /*\r\n * Handle user clicking on a location row\r\n * set the selected location to state and open the modal\r\n */\r\n getTrProps = (\r\n state: FinalState,\r\n rowInfo: RowInfoSuggestedPart | undefined\r\n ) => {\r\n if (rowInfo) {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n this.handleEdit(rowInfo);\r\n },\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n /*\r\n * Handle Product Select from the search new products modal\r\n */\r\n handleSearchNewProductSelect = (product: Iproduct) => {\r\n this.props.toggleEditSuggestedPartModal();\r\n this.props.setSearchNewProductsSelectedProduct(product);\r\n };\r\n handleClear = () => {\r\n removeQuery(\r\n manageSuggestedPartsQueryParamsEnum.productID,\r\n this.props.history\r\n );\r\n this.props.setTableFilter({\r\n page: 1,\r\n partSearch: '',\r\n productSearch: '',\r\n productID: ''\r\n });\r\n };\r\n\r\n handleAddSuggestedPart = () => {\r\n this.setState({ selectedRow: null }, () => {\r\n removeQuery(\r\n manageSuggestedPartsQueryParamsEnum.suggestedPartID,\r\n this.props.history\r\n );\r\n if (this.props.queryParams.productID?.length) {\r\n this.props.toggleEditSuggestedPartModal();\r\n } else {\r\n this.props.toggleSearchNewProductsModal();\r\n }\r\n });\r\n };\r\n\r\n render() {\r\n const { t, tableData = [], totalPages, manageInventory } = this.props;\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n const selectedProductForEditInstall = manageInventory.showSearchNewProductsModal\r\n ? this.props.searchNewProductsSelectedProduct\r\n : this.props.productFromQueryParam;\r\n return (\r\n
    \r\n \r\n {this.props.queryParams.productID?.length > 0 === false && (\r\n \r\n )}\r\n {this.props.queryParams.productID?.length > 0 && (\r\n \r\n \r\n

    \r\n {this.props.productFromQueryParam.name}\r\n

    \r\n \r\n {t('clear')}\r\n \r\n \r\n
    \r\n )}\r\n
    \r\n \r\n {t(`manageSuggestedParts:newSuggestedParts`)}\r\n \r\n
    \r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.state.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n />\r\n\r\n \r\n\r\n \r\n console.info('---handleMergeProduct---')\r\n }\r\n secondModal={false}\r\n enableMergeProductMode={false}\r\n wideModal={true}\r\n isApproved={true}\r\n disableCreateNew={true}\r\n />\r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & RouteComponentProps<{}>\r\n) => {\r\n const {\r\n productsByID,\r\n searchNewProductsSelectedProduct\r\n } = state.manageInventory;\r\n const {\r\n suggestedParts,\r\n showEditSuggestedPartModal,\r\n totalPages,\r\n tableFilters\r\n } = state.manageSuggestedParts;\r\n const queryParams = queryString.parse(\r\n ownProps.location.search\r\n ) as typeof manageSuggestedPartsQueryParamsEnum;\r\n const productFromQueryParam =\r\n productsByID[queryParams.productID] ||\r\n state.manageProduct.productsByID[queryParams.productID] ||\r\n initialProduct;\r\n const tableData = orderBy(suggestedParts, res => res.part.number, 'asc');\r\n return {\r\n productFromQueryParam,\r\n searchNewProductsSelectedProduct,\r\n tableData,\r\n totalPages,\r\n showEditSuggestedPartModal,\r\n tableFilters,\r\n manageInventory: state.manageInventory,\r\n queryParams,\r\n user: state.user\r\n };\r\n};\r\n\r\nexport default withTranslation('manageSuggestedParts')(\r\n connect(mapStateToProps, {\r\n toggleEditSuggestedPartModal,\r\n toggleSearchNewProductsModal,\r\n setSearchNewProductsSelectedProduct,\r\n searchSuggestedParts,\r\n setTableFilter,\r\n closeAllModals\r\n })(ManageSuggestedParts)\r\n);\r\n","/*\r\n * Manage Suggested Part Form\r\n */\r\n\r\nimport { Col, Button } from 'react-bootstrap';\r\nimport {\r\n FieldConfig,\r\n FormArray,\r\n FormGenerator,\r\n FormGroup,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { TFunction } from 'i18next';\r\nimport { debounce } from 'lodash';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { ItableFiltersReducer, Iproduct, IsuggestedPart } from '../../models';\r\nimport { IgenericFormValues } from '../../modelsForms';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n saveSuggestedPart,\r\n updateSelectedSuggestedPart\r\n} from '../../actions/manageSuggestedPartsActions';\r\nimport { searchPartsForAsyncSelect } from '../../actions/managePartActions';\r\nimport { manageSuggestedPartsQueryParamsEnum } from './ManageSuggestedParts';\r\nimport { Iuser } from '../../models';\r\n\r\ninterface Iprops {\r\n toggleModal: () => void;\r\n selectedSuggestedPart?: any;\r\n originalSuggestedPart?: any;\r\n selectedProduct: Iproduct;\r\n loading: boolean;\r\n colorButton: string;\r\n queryParams: typeof manageSuggestedPartsQueryParamsEnum;\r\n t: TFunction;\r\n tableFilters: ItableFiltersReducer;\r\n saveSuggestedPart: typeof saveSuggestedPart;\r\n onChange: typeof updateSelectedSuggestedPart;\r\n user: Iuser;\r\n}\r\n\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass ManageSuggestedPartForm extends React.Component {\r\n public formGroup: FormGroup | any;\r\n private subscription: any;\r\n private onChangeDebounced: (part?: IsuggestedPart) => void;\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.onChangeDebounced = debounce(\r\n this.props.onChange,\r\n constants.formDebounceTime\r\n );\r\n this.state = {\r\n fieldConfig: { controls: {} }\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.initSelected();\r\n this.setState({\r\n fieldConfig: this.buildFieldConfig()\r\n });\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n this.props.selectedSuggestedPart.id !==\r\n prevProps.selectedSuggestedPart.id\r\n ) {\r\n this.setState({ fieldConfig: this.buildFieldConfig() });\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n this.props.onChange();\r\n }\r\n\r\n /*\r\n * initSelected\r\n * if there is a query param, make sure it matches what is active in redux\r\n * if no query param and there is a selectedJob.id, then reset what is in redux\r\n */\r\n initSelected = () => {\r\n if (\r\n this.props.queryParams.suggestedPartID &&\r\n this.props.queryParams.suggestedPartID !==\r\n this.props.selectedSuggestedPart.id\r\n ) {\r\n // set the original job to the selectedJob\r\n this.props.onChange(this.props.originalSuggestedPart);\r\n } else if (\r\n this.props.queryParams.suggestedPartID === undefined &&\r\n this.props.selectedSuggestedPart.id.length\r\n ) {\r\n // set the selectedJob to a blank job\r\n this.props.onChange();\r\n }\r\n };\r\n\r\n loadOptions = debounce((searchTerm, callback) => {\r\n searchPartsForAsyncSelect(searchTerm).then(results =>\r\n callback(results)\r\n );\r\n }, 1000);\r\n\r\n itemToFormValues = (): IgenericFormValues => {\r\n const { selectedSuggestedPart } = this.props;\r\n const {\r\n partID,\r\n productQuantity,\r\n adminComments\r\n } = selectedSuggestedPart;\r\n return {\r\n partID,\r\n productQuantity,\r\n adminComments\r\n };\r\n };\r\n\r\n formValuesToItem = (): any => {\r\n const formValues = FormUtil.getValues(this.formGroup.value);\r\n const { selectedSuggestedPart, selectedProduct } = this.props;\r\n\r\n // const { partID, productQuantity, adminComments } = this.formGroup.value;\r\n // const suggestedPart = {\r\n // id: selectedSuggestedPart.id || uuidv4(),\r\n // productID: selectedProduct.id,\r\n // partID,\r\n // productQuantity: Number(productQuantity),\r\n // adminComments,\r\n // isDeleted: false\r\n // };\r\n return {\r\n ...selectedSuggestedPart,\r\n ...formValues,\r\n productID: selectedProduct.id\r\n };\r\n };\r\n\r\n buildFieldConfig = (defaultValues = this.itemToFormValues()) => {\r\n const { productQuantity, adminComments } = defaultValues;\r\n const { t, selectedSuggestedPart, selectedProduct } = this.props;\r\n\r\n const partOption = {\r\n value: selectedSuggestedPart.part.id,\r\n label: selectedSuggestedPart.part.number\r\n };\r\n\r\n const fieldConfigControls = {\r\n $field_0: {\r\n isStatic: false, // ensures a key is added\r\n render: () => (\r\n
    \r\n \r\n
    \r\n )\r\n },\r\n partID: {\r\n options: {\r\n validators: [Validators.required]\r\n },\r\n render: FormUtil.AsyncSelect,\r\n meta: {\r\n label: 'part',\r\n colWidth: 12,\r\n rows: 2,\r\n loadOptions: this.loadOptions,\r\n name: 'partID',\r\n required: true,\r\n isMulti: false\r\n },\r\n formState: {\r\n value: partOption,\r\n disabled: selectedSuggestedPart.id\r\n }\r\n },\r\n productQuantity: {\r\n options: {\r\n validators: [\r\n Validators.min(1),\r\n Validators.max(1000),\r\n Validators.pattern('[0-9]+'),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'timesUsed',\r\n type: 'number',\r\n colWidth: 6,\r\n required: true,\r\n name: 'productQuantity'\r\n },\r\n formState: {\r\n value: productQuantity,\r\n disabled: !this.canManageSuggestedParts()\r\n }\r\n },\r\n adminComments: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'adminComments',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 5,\r\n name: 'adminComments',\r\n required: true\r\n },\r\n options: {\r\n validators: [Validators.maxLength(1000)]\r\n },\r\n formState: {\r\n value: adminComments,\r\n disabled: !this.canManageSuggestedParts()\r\n }\r\n },\r\n serverTimeLabel: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n label: 'serverTimeLabel',\r\n colWidth: 12\r\n }\r\n }\r\n };\r\n return FormUtil.translateForm(\r\n {\r\n controls: { ...fieldConfigControls }\r\n },\r\n t\r\n );\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * subscribe to the formGroup changes after a short delay that allows the initial form values to load\r\n */\r\n subscribeToChanges = () => {\r\n for (const key in this.formGroup.controls) {\r\n if (this.formGroup.controls.hasOwnProperty(key)) {\r\n this.subscription = this.formGroup\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.onValueChanges(value, key);\r\n });\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * set the values to redux on each value change\r\n */\r\n onValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n default:\r\n this.onChangeDebounced(this.formValuesToItem());\r\n break;\r\n }\r\n };\r\n\r\n handleSubmit = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (this.formGroup.status === 'INVALID') {\r\n this.formGroup.markAsSubmitted();\r\n toastr.error(\r\n this.props.t('toastMessage:invalidFormSubmission'),\r\n '',\r\n constants.toastrError\r\n );\r\n return;\r\n }\r\n\r\n this.props.saveSuggestedPart([this.formValuesToItem()]);\r\n };\r\n handleDelete = () => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n const suggestedPart = {\r\n ...this.props.selectedSuggestedPart,\r\n isDeleted: true\r\n };\r\n this.props.saveSuggestedPart([suggestedPart]);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: this.props.t('deleteOk'),\r\n cancelText: this.props.t('common:cancel')\r\n };\r\n toastr.confirm(this.props.t('deleteConfirm'), toastrConfirmOptions);\r\n };\r\n\r\n setForm = (form: FormGroup | FormArray) => {\r\n this.formGroup = form;\r\n this.formGroup.meta = {\r\n loading: this.props.loading\r\n };\r\n if (!this.subscription) {\r\n setTimeout(() => {\r\n this.subscribeToChanges();\r\n }, 300);\r\n }\r\n };\r\n\r\n canManageSuggestedParts = () => {\r\n return constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageSuggestedParts.id\r\n ]);\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const deleteButtonStyle =\r\n this.props.selectedSuggestedPart.id.length === 0\r\n ? { marginRight: '15px', display: 'none' }\r\n : { marginRight: '15px' };\r\n\r\n const formClassName = `beacon-form location-form ${this.props.colorButton}`;\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n \r\n {t('common:cancel')}\r\n \r\n \r\n {t('common:delete')}\r\n \r\n \r\n {t('common:save')}\r\n \r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nexport default ManageSuggestedPartForm;\r\n","/*\r\n * Manage Suggested Part Modal\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { Iproduct } from '../../models';\r\nimport EditSuggestedPartForm from './EditSuggestedPartForm';\r\nimport { initialProduct } from '../../reducers/initialState';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { WithCommonModal } from '../common/WithCommonModal';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport {\r\n saveSuggestedPart,\r\n toggleEditSuggestedPartModal,\r\n updateSelectedSuggestedPart\r\n} from '../../actions/manageSuggestedPartsActions';\r\nimport { manageSuggestedPartsQueryParamsEnum } from './ManageSuggestedParts';\r\n\r\ninterface Iprops {\r\n colorButton: string;\r\n selectedProduct: Iproduct;\r\n queryParams: typeof manageSuggestedPartsQueryParamsEnum;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & WithTranslation\r\n) => {\r\n const selectedSuggestedPart =\r\n state.manageSuggestedParts.selectedSuggestedPart;\r\n\r\n const { showSearchNewProductsModal } = state.manageInventory;\r\n let selectedProduct = ownProps.selectedProduct || initialProduct;\r\n\r\n let title;\r\n if (selectedSuggestedPart && selectedSuggestedPart.id) {\r\n title = ownProps.t(`manageSuggestedParts:editSuggestedPart`);\r\n selectedProduct = selectedSuggestedPart.product;\r\n } else {\r\n title = ownProps.t(`manageSuggestedParts:newSuggestedPart`);\r\n }\r\n\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n show: state.manageSuggestedParts.showEditSuggestedPartModal,\r\n secondWideModal: showSearchNewProductsModal,\r\n tableFilters: state.manageSuggestedParts.tableFilters,\r\n selectedSuggestedPart,\r\n originalSuggestedPart:\r\n state.manageSuggestedParts.suggestedParts[\r\n ownProps.queryParams.suggestedPartID\r\n ],\r\n selectedProduct,\r\n title,\r\n className: 'suggested-part-edit'\r\n };\r\n};\r\n\r\nexport default withTranslation('manageSuggestedParts')(\r\n connect(mapStateToProps, {\r\n saveSuggestedPart,\r\n toggleModal: toggleEditSuggestedPartModal,\r\n onHide: toggleEditSuggestedPartModal,\r\n onChange: updateSelectedSuggestedPart\r\n })(WithCommonModal(EditSuggestedPartForm))\r\n);\r\n","/*\r\n * Preventative Maintenance Expander Container connects the PreventativeMaintenancePointExpander to redux\r\n */\r\n\r\nimport { IWorkOrder } from '../../models';\r\n\r\nimport { PreventativeMaintenancePointExpander } from './PreventativeMaintenancePointExpander';\r\nimport { RowInfo } from 'react-table';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n toggleWorkOrderCloseModal,\r\n getPreventativeMaintenancePointCSV\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops extends RowInfo {\r\n original: IWorkOrder;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport const PreventativeMaintenanceExpanderContainer = connect(\r\n mapStateToProps,\r\n {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n toggleWorkOrderCloseModal,\r\n getPreventativeMaintenancePointCSV\r\n }\r\n)(PreventativeMaintenancePointExpander);\r\n","/*\r\n * The Preventative Maintenance Checklist Expander\r\n */\r\nimport * as React from 'react';\r\n\r\nimport ReactTable, { Column, RowInfo, RowRenderProps } from 'react-table';\r\nimport { Button } from 'react-bootstrap';\r\nimport { TFunction } from 'i18next';\r\nimport { orderBy } from 'lodash';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nimport { IWorkOrder } from '../../models';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n toggleWorkOrderCloseModal,\r\n getPreventativeMaintenancePointCSV\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { workOrderStatusEnum } from '../../models-enums';\r\n\r\ninterface ExpanderProps extends RowInfo {\r\n t: TFunction;\r\n original: IWorkOrder;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n toggleWorkOrderCloseModal: typeof toggleWorkOrderCloseModal;\r\n getPreventativeMaintenancePointCSV: typeof getPreventativeMaintenancePointCSV;\r\n}\r\n\r\ninterface IlocationState {\r\n readOnly: boolean;\r\n}\r\n\r\nexport const PreventativeMaintenancePointExpander: React.SFC = (\r\n props: ExpanderProps\r\n) => {\r\n const { state } = useLocation();\r\n const sortedData = props.original.preventativeMaintenanceChecklist\r\n ? orderBy(\r\n props.original.preventativeMaintenanceChecklist\r\n .preventativeMaintenancePoints,\r\n 'label'\r\n )\r\n : [];\r\n const ExpanderButtonBar = (eProps: RowRenderProps) => {\r\n return (\r\n \r\n {\r\n if (props.original.preventativeMaintenanceChecklist) {\r\n props.getPreventativeMaintenancePointCSV(\r\n props.original\r\n );\r\n } else {\r\n console.error(\r\n 'missing checklist, unable to download pmp checklist csv'\r\n );\r\n }\r\n }}\r\n >\r\n {props.t('downloadTasks')}\r\n \r\n {\r\n props.setSelectedWorkOrderID(props.original.id);\r\n props.toggleEditWorkOrderModal();\r\n }}\r\n >\r\n {props.t('viewWorkOrder')}\r\n \r\n {props.original.status !== workOrderStatusEnum.complete && (\r\n {\r\n props.setSelectedWorkOrderID(props.original.id);\r\n props.toggleWorkOrderCloseModal();\r\n }}\r\n >\r\n {props.t('closeWorkOrder')}\r\n \r\n )}\r\n \r\n );\r\n };\r\n const expanderColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n Footer: ExpanderButtonBar,\r\n minWidth: 20,\r\n id: 'indent-column-button-bar'\r\n },\r\n {\r\n Header: 'manageWorkOrder:task',\r\n accessor: 'label'\r\n }\r\n ],\r\n props.t\r\n ) as Column[];\r\n\r\n return (\r\n
    \r\n = 10 : false}\r\n />\r\n
    \r\n );\r\n};\r\n","/*\r\n * Preventative Maintenance Table\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { TFunction } from 'i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport ReactTable, { FinalState, RowInfo } from 'react-table';\r\nimport { IWorkOrder, Itile, ItableFiltersReducer } from '../../models';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport {\r\n setSelectedWorkOrderID,\r\n setTableFilter\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { PreventativeMaintenanceExpanderContainer } from './PreventativeMaintenanceExpanderContainer';\r\n\r\nconst columns = (t: TFunction) =>\r\n TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n Header: 'Activity',\r\n accessor: 'activityDescription',\r\n width: 220\r\n },\r\n {\r\n Header: 'productName',\r\n accessor: 'productName'\r\n },\r\n {\r\n Header: 'Location',\r\n accessor: 'installBaseLocation'\r\n }\r\n ],\r\n t\r\n );\r\n\r\ninterface Iprops {\r\n tableData: IWorkOrder[];\r\n t: TFunction;\r\n\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n currentTile: Itile;\r\n loading: boolean;\r\n totalPages: number;\r\n tableFilters: ItableFiltersReducer;\r\n setTableFilter: typeof setTableFilter;\r\n overrideColumns?: any[];\r\n}\r\ninterface Istate {\r\n selectedRow: any;\r\n columns: any[];\r\n}\r\ninterface RowInfoWorkOrder extends RowInfo {\r\n original: IWorkOrder;\r\n}\r\n\r\nexport class PreventativeMaintenanceTable extends React.PureComponent<\r\n Iprops,\r\n Istate\r\n> {\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n columns: columns(this.props.t)\r\n };\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n // scroll top every time a filter changes\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.props.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n },\r\n onClick: () => {\r\n this.props.setSelectedWorkOrderID(rowInfo.original.id);\r\n this.setState({\r\n selectedRow: {\r\n [rowInfo.viewIndex || 0]: !this.state.selectedRow[\r\n rowInfo.viewIndex || 0\r\n ]\r\n }\r\n });\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n render() {\r\n const { tableData, t, loading, totalPages } = this.props;\r\n return (\r\n = 10 ? tableData.length : 10}\r\n manual\r\n pages={totalPages}\r\n page={this.props.tableFilters.page - 1}\r\n showPageSizeOptions={false}\r\n className={`beacon-table -highlight ${this.props.currentTile.color}`}\r\n previousText={t('common:previous')}\r\n nextText={t('common:next')}\r\n onPageChange={this.onPageChange}\r\n sortable={false}\r\n multiSort={false}\r\n noDataText={t('common:noDataText')}\r\n resizable={false}\r\n loading={loading}\r\n SubComponent={(rowInfo: RowInfo) => {\r\n return (\r\n \r\n );\r\n }}\r\n expanded={this.state.selectedRow}\r\n />\r\n );\r\n }\r\n}\r\n\r\n// export const DashboardAnalytics = withTranslation('dashboardAnalytics')(\r\n// DashboardAnalyticsFunc\r\n// );\r\n","/*\r\n * Preventative Maintenance Table Container\r\n */\r\n\r\nimport { Itile } from '../../models';\r\n\r\nimport { PreventativeMaintenanceTable } from './PreventativeMaintenanceTable';\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n setTableFilter\r\n} from '../../actions/manageWorkOrderActions';\r\nimport { orderBy } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n colorButton: string;\r\n currentTile: Itile;\r\n overrideColumns?: any[];\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const {\r\n visibleWorkOrdersByID,\r\n totalPages,\r\n tableFilters\r\n } = state.manageWorkOrder;\r\n\r\n return {\r\n loading: selectIsLoading(state),\r\n tableData: orderBy(visibleWorkOrdersByID, res => res),\r\n totalPages,\r\n tableFilters\r\n };\r\n};\r\n\r\nexport const PreventativeMaintenanceTableContainer = connect(mapStateToProps, {\r\n toggleEditWorkOrderModal,\r\n setSelectedWorkOrderID,\r\n setTableFilter\r\n})(PreventativeMaintenanceTable);\r\n","import * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { IWorkOrder, ItableFiltersReducer, Itile, Ioption } from '../../models';\r\nimport { Column, FinalState, RowInfo } from 'react-table';\r\nimport {\r\n clearSelectedWorkOrderID,\r\n deleteWorkOrder,\r\n getTechnicians,\r\n getWorkOrderCsv,\r\n getWorkOrders,\r\n setSelectedWorkOrderID,\r\n setTableFilter,\r\n toggleWorkOrderCloseModal,\r\n toggleEditWorkOrderModal\r\n} from '../../actions/manageWorkOrderActions';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { EditWorkOrderModal } from '../manageWorkOrder/EditWorkOrderModal';\r\nimport { FieldConfig } from 'react-reactive-form';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport SearchTableForm from '../common/SearchTableForm';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { TableUtil } from '../common/TableUtil';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { emptyTile, initialWorkOrder } from '../../reducers/initialState';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions';\r\nimport moment from 'moment';\r\nimport { debounce, orderBy } from 'lodash';\r\nimport {\r\n workOrderStatusEnum,\r\n workOrderTypesEnum,\r\n workOrderDateRangeUnumForFilter\r\n} from '../../models-enums';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { PreventativeMaintenanceTableContainer } from '../manageWorkOrder/PreventativeMaintenanceTableContainer';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RowInfoWorkOrder extends RowInfo {\r\n original: IWorkOrder;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface IdispatchProps {\r\n tableData: IWorkOrder[];\r\n totalPages: number;\r\n showEditWorkOrderModal: boolean;\r\n getWorkOrders: typeof getWorkOrders;\r\n toggleEditWorkOrderModal: typeof toggleEditWorkOrderModal;\r\n toggleWorkOrderCloseModal: typeof toggleWorkOrderCloseModal;\r\n getTechnicians: typeof getTechnicians;\r\n deleteWorkOrder: typeof deleteWorkOrder;\r\n setTableFilter: typeof setTableFilter;\r\n tableFilters: ItableFiltersReducer;\r\n loading: boolean;\r\n setSelectedWorkOrderID: typeof setSelectedWorkOrderID;\r\n clearSelectedWorkOrderID: typeof clearSelectedWorkOrderID;\r\n getProductInfo: typeof getProductInfo;\r\n isAdmin: boolean;\r\n technicians: any[];\r\n getWorkOrderCsv: typeof getWorkOrderCsv;\r\n selectedFacilityID: string;\r\n selectedWorkOrderID: string;\r\n selectedWorkOrder: IWorkOrder;\r\n}\r\n\r\ninterface Istate {\r\n selectedRow: any;\r\n currentTile: Itile;\r\n columns: any[];\r\n searchFieldConfig: FieldConfig;\r\n showCloseNoteModal: boolean;\r\n}\r\n\r\nclass ManageWorkOrder extends React.Component<\r\n Iprops & IdispatchProps & WithTranslation,\r\n Istate\r\n> {\r\n private setTableFilterDebounced: (formValues: {\r\n [key: string]: any;\r\n }) => void;\r\n constructor(props: Iprops & IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n selectedRow: {},\r\n currentTile: emptyTile,\r\n columns: [],\r\n searchFieldConfig: this.buildSearchControls(),\r\n showCloseNoteModal: false\r\n };\r\n this.setTableFilterDebounced = debounce(\r\n this.props.setTableFilter,\r\n constants.formDebounceTime\r\n );\r\n }\r\n\r\n componentDidMount(): void {\r\n this.setState({\r\n currentTile: constants.getTileByURL(this.props.location.pathname)\r\n });\r\n this.setColumns();\r\n\r\n // set the table filter for type 2\r\n this.props.setTableFilter({\r\n workOrderType: workOrderTypesEnum.pmp,\r\n page: 1\r\n });\r\n this.props.getWorkOrders(); // this is necessary for when the setTable does not change anything and fails to retrieve the correct work orders\r\n this.props.getProductInfo();\r\n this.props.getTechnicians();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops & IdispatchProps) {\r\n if (\r\n prevProps.showEditWorkOrderModal !==\r\n this.props.showEditWorkOrderModal &&\r\n !this.props.showEditWorkOrderModal\r\n ) {\r\n this.setState({ selectedRow: null });\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.tableFilters) !==\r\n JSON.stringify(this.props.tableFilters)\r\n ) {\r\n this.props.getWorkOrders();\r\n this.props.getTechnicians();\r\n this.setState({ searchFieldConfig: this.buildSearchControls() });\r\n // scroll top every time a filter changes\r\n const tableDiv = document.getElementsByClassName('rt-tbody');\r\n if (tableDiv && tableDiv.length) {\r\n tableDiv[0].scrollTop = 0;\r\n }\r\n }\r\n if (prevProps.selectedFacilityID !== this.props.selectedFacilityID) {\r\n this.props.getWorkOrders();\r\n this.props.getTechnicians();\r\n }\r\n\r\n if (\r\n JSON.stringify(prevProps.technicians) !==\r\n JSON.stringify(this.props.technicians)\r\n ) {\r\n this.setState({ searchFieldConfig: this.buildSearchControls() });\r\n }\r\n }\r\n\r\n /*\r\n * Note that technicianToDo is not an actual filter. it is only used to select which To Do List to download\r\n */\r\n buildSearchControls = (): FieldConfig => {\r\n const disabled = false;\r\n\r\n const defaultStatus = {\r\n value: workOrderStatusEnum.open,\r\n label: this.props.t('open')\r\n };\r\n const {\r\n search,\r\n status = defaultStatus,\r\n dateRange,\r\n tabKey\r\n } = this.props.tableFilters;\r\n const searchPlaceholder =\r\n this.state && tabKey === 'beacon'\r\n ? 'searchNumberPlaceholderBeacon'\r\n : 'searchNumberPlaceholder';\r\n const statusOptions = FormUtil.convertEnumToOptions(\r\n workOrderStatusEnum\r\n );\r\n const mainSearchControls = {\r\n search: {\r\n render: FormUtil.TextInputWithoutValidation,\r\n meta: {\r\n label: 'common:search',\r\n colWidth: 3,\r\n type: 'text',\r\n placeholder: searchPlaceholder,\r\n isClearable: true\r\n },\r\n formState: { value: search, disabled }\r\n },\r\n status: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: statusOptions,\r\n label: 'status',\r\n colWidth: 2,\r\n shouldTranslate: true\r\n },\r\n formState: { value: status, disabled }\r\n },\r\n dateRange: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: FormUtil.convertEnumToOptions(\r\n workOrderDateRangeUnumForFilter\r\n ),\r\n label: 'dateRange',\r\n colWidth: 3,\r\n isClearable: true,\r\n shouldTranslate: true\r\n },\r\n formState: { value: dateRange, disabled }\r\n },\r\n seperator: {\r\n render: FormUtil.TextLabel,\r\n meta: {\r\n colWidth: 1\r\n }\r\n },\r\n technicianToDo: {\r\n render: FormUtil.SelectWithoutValidation,\r\n meta: {\r\n options: this.props.technicians\r\n ? this.props.technicians.map(tech => ({\r\n value: tech,\r\n label: tech\r\n }))\r\n : null,\r\n label: 'labelToDoList',\r\n colWidth: 3,\r\n isClearable: true,\r\n style: tabKey === 'preventative' ? { display: 'none' } : {}\r\n },\r\n formState: { value: null, disabled }\r\n }\r\n };\r\n\r\n const searchFieldConfig = {\r\n controls: { ...mainSearchControls }\r\n } as FieldConfig;\r\n return searchFieldConfig;\r\n };\r\n\r\n downloadCsv(tech: Ioption | null) {\r\n const { t } = this.props;\r\n if (tech && tech.value) {\r\n this.props.getWorkOrderCsv(tech.value);\r\n } else {\r\n toastr.warning(\r\n t('common:warning'),\r\n t('Please select a technician.'),\r\n constants.toastrWarning\r\n );\r\n }\r\n }\r\n\r\n onSearchValueChanges = (value: any, key: string) => {\r\n switch (key) {\r\n case 'search':\r\n this.setTableFilterDebounced({ search: value, page: 1 });\r\n break;\r\n case 'status':\r\n this.setTableFilterDebounced({\r\n status: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'dateRange':\r\n this.setTableFilterDebounced({\r\n dateRange: value ? value : null,\r\n page: 1\r\n });\r\n break;\r\n case 'technicianToDo':\r\n this.downloadCsv(value);\r\n this.setState({\r\n searchFieldConfig: this.buildSearchControls()\r\n }); // this clears the select\r\n // this.setTableFilterDebounced({ technicianToDo: value, page: 1 });\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n handleEdit(row: any) {\r\n this.setState({ selectedRow: row.index });\r\n this.props.toggleEditWorkOrderModal();\r\n this.props.setSelectedWorkOrderID(row.original.id);\r\n }\r\n\r\n onPageChange = (page: number) => {\r\n const newPage = page + 1;\r\n this.props.setTableFilter({ page: newPage });\r\n };\r\n /*\r\n * Set Columns sets columns to state\r\n */\r\n\r\n setColumns = () => {\r\n const columns: Column[] = [\r\n {\r\n id: 'expander-toggle',\r\n expander: true,\r\n Expander: TableUtil.expanderToggle,\r\n style: {\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n userSelect: 'none'\r\n }\r\n },\r\n {\r\n Header: 'name',\r\n accessor: 'name',\r\n width: 120\r\n },\r\n {\r\n Header: 'lastServiced',\r\n id: 'interval',\r\n accessor: (workOrder: IWorkOrder) => {\r\n if (\r\n workOrder.lastServicedDate &&\r\n workOrder.lastServicedDate.length\r\n ) {\r\n return moment\r\n .utc(workOrder.lastServicedDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n } else {\r\n return 'Never';\r\n }\r\n },\r\n width: 110\r\n },\r\n {\r\n Header: 'productName',\r\n accessor: 'productName'\r\n },\r\n {\r\n Header: 'location',\r\n accessor: 'installBaseLocation'\r\n },\r\n {\r\n Header: 'dueDate',\r\n id: 'dueDate',\r\n accessor: (workOrder: IWorkOrder) => {\r\n if (workOrder.dueDate) {\r\n return moment\r\n .utc(workOrder.dueDate)\r\n .local(true)\r\n .format('DD-MMM-YY');\r\n } else {\r\n return 'missing due date';\r\n }\r\n },\r\n width: 110\r\n },\r\n {\r\n Header: 'Status',\r\n id: 'status',\r\n accessor: (workOrder: IWorkOrder) => {\r\n return this.props.t(workOrderStatusEnum[workOrder.status]);\r\n },\r\n width: 90\r\n }\r\n ];\r\n\r\n this.setState({\r\n columns: TableUtil.translateHeaders(columns, this.props.t)\r\n });\r\n };\r\n\r\n /*\r\n * (reusable)\r\n * Handle user clicking on a product row\r\n * set the selected product to state and open the modal\r\n */\r\n getTrProps = (state: FinalState, rowInfo: RowInfo | undefined) => {\r\n if (rowInfo) {\r\n return {\r\n style: {\r\n background:\r\n rowInfo.index === this.state.selectedRow\r\n ? constants.colors[\r\n `${this.state.currentTile.color}Tr` as keyof typeof constants.colors\r\n ]\r\n : ''\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n getTdProps = (\r\n fState: FinalState,\r\n rowInfo: RowInfoWorkOrder | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n if (\r\n rowInfo &&\r\n column &&\r\n column.id &&\r\n column.id === 'status-update' &&\r\n rowInfo.original.status === workOrderStatusEnum.new\r\n ) {\r\n return {\r\n onClick: () => {\r\n this.setState({ selectedRow: rowInfo.index });\r\n this.props.toggleWorkOrderCloseModal();\r\n this.props.setSelectedWorkOrderID(rowInfo.original.id);\r\n }\r\n };\r\n } else if (rowInfo) {\r\n return {\r\n onClick: () => {\r\n this.setState({\r\n selectedRow: rowInfo.index\r\n });\r\n this.handleEdit(rowInfo);\r\n }\r\n };\r\n } else {\r\n return {};\r\n }\r\n };\r\n\r\n // disabled on the PMP tab and hide the delete and save buttons.\r\n shouldEnableWorkOrderForm = () => {\r\n return false;\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n const colorButton =\r\n constants.colors[\r\n `${this.state.currentTile.color}Button` as keyof typeof constants.colors\r\n ];\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n const tableData = orderBy(state.manageWorkOrder.workOrdersByID, res => res);\r\n let isAdmin = constants.hasSecurityFunction(state.user, [\r\n constants.securityFunctions.ManageWorkOrderAdmin.id\r\n ]);\r\n isAdmin = true;\r\n\r\n const selectedWorkOrder =\r\n state.manageWorkOrder.workOrdersByID[\r\n state.manageWorkOrder.selectedWorkOrderID\r\n ] || initialWorkOrder;\r\n return {\r\n tableData,\r\n isAdmin,\r\n totalPages: state.manageWorkOrder.totalPages,\r\n showEditWorkOrderModal: state.manageWorkOrder.showEditWorkOrderModal,\r\n tableFilters: state.manageWorkOrder.tableFilters,\r\n technicians: state.manageWorkOrder.technicians,\r\n selectedFacilityID: state.selectedFacilityID,\r\n selectedWorkOrderID: state.manageWorkOrder.selectedWorkOrderID,\r\n loading: selectIsLoading(state),\r\n selectedWorkOrder\r\n };\r\n};\r\n\r\nexport const PMPAnalyticsTableLayout = withTranslation('manageWorkOrder')(\r\n connect(mapStateToProps, {\r\n getWorkOrders,\r\n toggleEditWorkOrderModal,\r\n toggleWorkOrderCloseModal,\r\n deleteWorkOrder,\r\n setTableFilter,\r\n setSelectedWorkOrderID,\r\n clearSelectedWorkOrderID,\r\n getTechnicians,\r\n getProductInfo,\r\n getWorkOrderCsv\r\n })(ManageWorkOrder)\r\n);\r\n","import { RouteComponentProps, withRouter } from 'react-router-dom';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Item } from './SideMenu.tsx';\r\nimport { Itile } from '../../models';\r\nimport { ListGroupItem } from 'react-bootstrap';\r\nimport React from 'react';\r\nimport { TFunction } from 'i18next';\r\nimport { map, orderBy } from 'lodash';\r\nimport { svgIcons } from '../../constants/svgIcons';\r\n\r\ninterface ItemClassProps extends RouteComponentProps {\r\n tiles: Itile[];\r\n t: TFunction;\r\n url: string;\r\n title: string;\r\n svgKey?: string;\r\n collapsed?: boolean;\r\n}\r\n\r\nclass ParentItem extends React.Component {\r\n constructor(props: ItemClassProps) {\r\n super(props);\r\n if (!props.collapsed) {\r\n this.state = { isOpen: false };\r\n } else if (\r\n this.props.tiles.find(\r\n tile => tile.url === this.props.location.pathname\r\n )\r\n ) {\r\n this.state = { isOpen: true };\r\n } else {\r\n this.state = { isOpen: false };\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: ItemClassProps) {\r\n const active = this.props.tiles.find(\r\n tile => tile.url === this.props.location.pathname\r\n );\r\n if (this.props.location.pathname !== prevProps.location.pathname) {\r\n if (active) {\r\n this.setState({ isOpen: true });\r\n } else {\r\n this.setState({ isOpen: false });\r\n }\r\n }\r\n if (this.props.collapsed !== prevProps.collapsed) {\r\n this.setState({\r\n isOpen: this.props.collapsed\r\n ? Boolean(active)\r\n : Boolean(this.props.collapsed)\r\n });\r\n }\r\n }\r\n\r\n handleClick = () => {\r\n this.setState({ isOpen: !this.state.isOpen });\r\n };\r\n\r\n isParentOfSelectedChild = (childTiles: Itile[]): boolean => {\r\n let isParentOfSelectedChild = false;\r\n childTiles.forEach(childTile => {\r\n if (childTile.url === this.props.location.pathname) {\r\n isParentOfSelectedChild = true;\r\n }\r\n });\r\n return isParentOfSelectedChild;\r\n };\r\n render() {\r\n const { title, svgKey, t, tiles } = this.props;\r\n const childTiles = orderBy(tiles, ['order', 'title'], ['asc', 'asc']);\r\n\r\n let iconStyle = {\r\n transform: 'rotate(0)',\r\n fontSize: '15px',\r\n color: 'white'\r\n };\r\n if (this.state.isOpen) {\r\n iconStyle = {\r\n ...iconStyle,\r\n transform: 'rotate(90deg)'\r\n // color: constants.colors.darkerBlue\r\n };\r\n }\r\n let parentItemStyle = { height: '40px' };\r\n const listGroupStyle = {};\r\n let parentItemClassName = 'parent-item-container';\r\n if (this.state.isOpen) {\r\n parentItemStyle = { height: `${tiles.length * 40 + 40}px` };\r\n // listGroupStyle = { backgroundColor: constants.colors.teal };\r\n parentItemClassName += ' open';\r\n }\r\n if (!this.state.isOpen) {\r\n if (this.isParentOfSelectedChild(childTiles)) {\r\n parentItemClassName += ' open';\r\n }\r\n }\r\n return (\r\n \r\n \r\n \r\n {svgKey !== undefined &&\r\n svgIcons[svgKey as keyof typeof svgIcons]}\r\n \r\n {t(title)}\r\n \r\n \r\n {map(childTiles, cTile => {\r\n return (\r\n \r\n );\r\n })}\r\n
    \r\n );\r\n }\r\n}\r\n\r\nexport default withRouter(ParentItem);\r\n","import { IparentTile, Itile, Iuser } from '../../models';\r\n\r\nimport { constants } from '../../constants/constants';\r\nimport { find, orderBy } from 'lodash';\r\nimport { menuParentKeysEnum } from '../../models-enums';\r\n\r\n// Constructs the top-level navItem using the menuParentKeysEnum\r\nconst buildParentContainer = (menuSkeleton: any[], tile: Itile) => {\r\n const parentContainer = find(menuSkeleton, { key: tile.parentKey });\r\n if (parentContainer === undefined) {\r\n const parentItem = find(constants.menuItemsWithChildren, {\r\n key: tile.parentKey\r\n });\r\n if (parentItem) {\r\n const newParentContainer: IparentTile = {\r\n ...parentItem,\r\n tiles: [tile]\r\n };\r\n return menuSkeleton.push(newParentContainer);\r\n }\r\n } else {\r\n parentContainer.tiles.push(tile);\r\n }\r\n};\r\n\r\n// Constructs the top-level item,\r\n// then adds corresponding tiles to that top-level item\r\n\r\nexport const NavSkeleton = (user: Iuser) => {\r\n const availableTiles = constants.tiles.filter(tile =>\r\n constants.hasSecurityFunction(user, tile.securityFunctions, {\r\n matchAll: ['/assetStatus'].includes(tile.url)\r\n })\r\n );\r\n let menuSkeleton = [] as any[];\r\n availableTiles.forEach(tile =>\r\n tile.parentKey === menuParentKeysEnum.default\r\n ? menuSkeleton.push(tile)\r\n : buildParentContainer(menuSkeleton, tile)\r\n );\r\n menuSkeleton = orderBy(menuSkeleton, ['order', 'title'], ['asc', 'asc']);\r\n return menuSkeleton;\r\n};\r\n","import * as React from 'react';\r\n\r\nimport { Button, ListGroup, ListGroupItem } from 'react-bootstrap';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\n\r\nimport ParentItem from './ParentItem';\r\nimport { IinitialState } from '../../reducers';\r\nimport { Itile, Iuser } from '../../models';\r\nimport { NavSkeleton } from './NavSkeleton';\r\nimport { TFunction } from 'i18next';\r\nimport { svgIcons } from '../../constants/svgIcons';\r\nimport { toggleSideMenu } from '../../actions/commonActions';\r\n\r\ninterface ItemProps extends Omit {\r\n t: TFunction;\r\n tiles?: Itile[];\r\n isChild?: boolean;\r\n parentKey?: number;\r\n collapse?: boolean;\r\n}\r\n\r\nexport const Item = (props: ItemProps) => {\r\n const [collapsed, setCollapsed] = React.useState(false);\r\n\r\n const { url, title, t, tiles, isChild, svgKey } = props;\r\n let classNames = 'kerning';\r\n\r\n if (isChild) {\r\n classNames += ' child-item';\r\n }\r\n\r\n React.useEffect(() => {\r\n setCollapsed(Boolean(props.collapse));\r\n }, [props.collapse]);\r\n\r\n if (!tiles) {\r\n return (\r\n \r\n \r\n \r\n {svgKey !== undefined &&\r\n svgIcons[svgKey as keyof typeof svgIcons]}\r\n \r\n {t(title)}\r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\ninterface Iprops extends RouteComponentProps<{}> {\r\n user: Iuser;\r\n showSideMenu: boolean;\r\n toggleSideMenu: typeof toggleSideMenu;\r\n}\r\n\r\nclass SideMenu extends React.Component {\r\n render() {\r\n const t = this.props.t;\r\n const menuClass = this.props.showSideMenu ? 'open' : 'closed';\r\n const Items = NavSkeleton(this.props.user);\r\n\r\n return (\r\n
    \r\n {\r\n this.props.toggleSideMenu();\r\n }}\r\n >\r\n \r\n \r\n \r\n {Items.map(item => (\r\n \r\n ))}\r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n user: state.user\r\n };\r\n};\r\n\r\nexport default withTranslation('tiles')(connect(mapStateToProps, {})(SideMenu));\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { ListGroup, ListGroupItem, Media, Col, Row } from 'react-bootstrap';\r\nimport { initialCourse } from '../../reducers/initialState';\r\nimport { GFCourse, GFLesson, Iuser, LessonProgress } from '../../models';\r\nimport { filter, sortBy } from 'lodash';\r\nimport {\r\n addLessonToCart,\r\n getLessonsByCourseID,\r\n getAllLessonProgress\r\n} from '../../actions/trainingActions';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst ProgressColumn = ({ progress }: { progress: number }) => (\r\n \r\n \r\n {`${progress}% Complete`}\r\n \r\n \r\n);\r\nconst QuizResultColumn = ({\r\n score,\r\n quizName\r\n}: {\r\n score: number;\r\n quizName: string;\r\n}) => (\r\n \r\n \r\n {`${quizName} ${score}%`}\r\n \r\n \r\n);\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ninterface Props extends RouteComponentProps {\r\n user: Iuser;\r\n filteredLessons: GFLesson[];\r\n getLessonsByCourseID: typeof getLessonsByCourseID;\r\n loading: boolean;\r\n selectedCourse: GFCourse;\r\n lessonProgress: { [key: string]: LessonProgress };\r\n addLessonToCart: typeof addLessonToCart;\r\n purchasedTraining: string[];\r\n getAllLessonProgress: typeof getAllLessonProgress;\r\n}\r\n/*\r\n * printLesonsList prints the list of lessons. Each lesson is conditionaly displayed if it is not protected or it is protected and all the previous\r\n * lessons are complete. Each lesson item conditionaly displays a buy button and prevents viewing or progress\r\n */\r\n\r\nclass CourseLessonsClass extends React.Component {\r\n componentDidMount() {\r\n // if we have a courseID then display the lessons in that course\r\n const { courseID } = this.props.match.params;\r\n this.props.getAllLessonProgress();\r\n if (!courseID) {\r\n console.warn('missing courseID when trying to view courseLessons');\r\n this.props.history.push('/training');\r\n return;\r\n }\r\n\r\n if (!this.props.filteredLessons.length) {\r\n this.props.getLessonsByCourseID(courseID, this.props.user);\r\n }\r\n }\r\n handleLessonClick = (gfLesson: GFLesson) => {\r\n if (!this.hasLessonBeenPurchased(gfLesson)) {\r\n toastr.warning(\r\n 'Warning',\r\n 'Please purchase this lesson.',\r\n constants.toastrWarning\r\n );\r\n return;\r\n }\r\n this.props.history.push(`${this.props.match.url}/${gfLesson.id}`);\r\n };\r\n\r\n hasLessonBeenPurchased = (lesson: GFLesson) => {\r\n const lessonPurchased =\r\n this.props.purchasedTraining.indexOf(lesson.id) !== -1;\r\n let coursePurchased = false;\r\n lesson.courseLessons.forEach(cl => {\r\n if (this.props.purchasedTraining.indexOf(cl.courseID) !== -1) {\r\n coursePurchased = true;\r\n }\r\n });\r\n\r\n return lessonPurchased || coursePurchased;\r\n };\r\n\r\n render() {\r\n // allLessonsComplete keeps track of all the previously complete lessons\r\n let allLessonsComplete = true;\r\n return (\r\n
    \r\n \r\n \r\n

    {this.props.selectedCourse.description}

    \r\n \r\n
    \r\n
    \r\n \r\n {this.props.filteredLessons.map((gfLesson, index) => {\r\n if (gfLesson.isProtected && !allLessonsComplete) {\r\n return null;\r\n }\r\n let imagePath = gfLesson.imagePath;\r\n if (imagePath === null || imagePath === '') {\r\n imagePath = require('../../images/Azure.png');\r\n }\r\n const lp = this.props.lessonProgress[gfLesson.id];\r\n let progress = 0;\r\n if (lp) {\r\n progress = lp.isComplete\r\n ? 100\r\n : Math.round(\r\n (lp.timeSpent / lp.totalTime) * 99\r\n ); // multiplying by 99 because we do not want to display 100% here. display 100% only if .isComplete is true.\r\n if (!lp.isComplete && !gfLesson.isProtected) {\r\n allLessonsComplete = false;\r\n }\r\n } else if (!gfLesson.isProtected) {\r\n allLessonsComplete = false;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n this.handleLessonClick(gfLesson)\r\n }\r\n >\r\n \r\n \r\n {gfLesson.name}\r\n \r\n \r\n {gfLesson.score &&\r\n gfLesson.quizName && (\r\n \r\n )}\r\n {this.hasLessonBeenPurchased(\r\n gfLesson\r\n ) &&\r\n gfLesson.primaryVideoPath.length >\r\n 0 && (\r\n \r\n )}\r\n \r\n \r\n );\r\n })}\r\n \r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Props) => {\r\n const selectedCourse =\r\n state.training.coursesByID[ownProps.match.params.courseID] ||\r\n initialCourse;\r\n let filteredLessons = filter(state.training.lessonsByID, lesson => {\r\n const courseLesson = filter(lesson.courseLessons, {\r\n courseID: ownProps.match.params.courseID\r\n });\r\n return courseLesson.length ? true : false;\r\n });\r\n filteredLessons = filteredLessons.map(l => ({\r\n ...l,\r\n courseLessons: l.courseLessons.filter(\r\n cl => cl.courseID === ownProps.match.params.courseID\r\n )\r\n }));\r\n filteredLessons = sortBy(filteredLessons, (el: GFLesson) => {\r\n return el.courseLessons[0].order;\r\n });\r\n return {\r\n user: state.user,\r\n filteredLessons,\r\n selectedCourse,\r\n lessonProgress: state.training.lessonProgress,\r\n purchasedTraining: state.training.purchasedTraining,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, {\r\n getLessonsByCourseID,\r\n addLessonToCart,\r\n getAllLessonProgress\r\n})(CourseLessonsClass);\r\n","import * as types from './actionTypes';\r\nimport { GFQuizItem, ThunkResult, Iuser, GFQuizAnswer } from '../models';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';\r\nimport API from '../constants/apiEndpoints';\r\n\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { sortBy, forEach } from 'lodash';\r\nimport { constants } from '../constants/constants';\r\n\r\n/*\r\n * Quizzes with the questions for a particular lesson\r\n */\r\nexport function getQuizzesByLessonID(\r\n lessonID: string,\r\n user: Iuser\r\n): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = `${API.GET.trainingCurriculum.quizzesByLessonID}?lessonID=${lessonID}`;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (response.status !== 200) {\r\n throw response;\r\n }\r\n const parsedQuizzes = response.data.map((quiz: GFQuizItem) => {\r\n const parsedQuestions = quiz.questions.map(\r\n (question: any) => {\r\n if (question.options) {\r\n const parsedOptions = question.options\r\n .split('*||*')\r\n .map((option: any) => {\r\n return JSON.parse(option);\r\n });\r\n return { ...question, options: parsedOptions };\r\n } else {\r\n return question;\r\n }\r\n }\r\n );\r\n return { ...quiz, questions: parsedQuestions };\r\n });\r\n\r\n const quizzes = sortBy(parsedQuizzes, (el: any) => {\r\n return el.order;\r\n });\r\n\r\n dispatch({\r\n type: types.LOAD_QUIZZES_BY_LESSON_SUCCESS,\r\n quizzes\r\n });\r\n return quizzes;\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error('Error when trying to get all quizzes', error);\r\n dispatch({ type: types.LOAD_QUIZZES_BY_LESSON_FAILED, error });\r\n constants.handleError(\r\n { response: error },\r\n 'loading all quizzes'\r\n );\r\n });\r\n };\r\n}\r\n\r\n/*\r\n * Complete list of quizzes without the questions\r\n */\r\nexport function getAllQuizzes(user: Iuser): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get'\r\n };\r\n\r\n const url = API.GET.trainingCurriculum.allQuizzes;\r\n return msalFetch(url, axiosOptions)\r\n .then((response: AxiosResponse) => {\r\n if (response.status !== 200) {\r\n throw response;\r\n }\r\n dispatch({\r\n type: types.LOAD_QUIZZES_SUCCESS,\r\n quizzes: response.data\r\n });\r\n return response.data;\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error('Error when trying to get all quizzes', error);\r\n dispatch({ type: types.LOAD_QUIZZES_FAILED, error });\r\n constants.handleError(\r\n { response: error },\r\n 'loading all quizzes'\r\n );\r\n });\r\n };\r\n}\r\n\r\nexport const calculateScore = (quizAnswers: GFQuizAnswer[]) => {\r\n let numCorrect = 0;\r\n const tot = quizAnswers.length;\r\n forEach(quizAnswers, answer => {\r\n if (answer.isCorrect) {\r\n numCorrect++;\r\n }\r\n });\r\n return { score: Math.round((numCorrect / tot) * 100), numCorrect, tot };\r\n};\r\n\r\n/*\r\n Save quiz results\r\n */\r\nexport function saveQuizResult(\r\n quizID: string,\r\n quizName: string\r\n): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { quizAnswers } = getState().training;\r\n const { score } = calculateScore(quizAnswers);\r\n\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: {\r\n Answers: quizAnswers,\r\n quizID,\r\n Score: score\r\n }\r\n };\r\n\r\n const url = API.POST.training.savequiz;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.SAVE_QUIZ_ANSWERS_SUCCESS,\r\n progress: data.data\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error saving quiz', error);\r\n dispatch({\r\n type: types.SAVE_QUIZ_ANSWERS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'save quiz');\r\n throw error; // throw here because we have a .then in the quiz component\r\n });\r\n };\r\n}\r\n\r\n// Save quiz start\r\nexport function startQuiz(quizID: string): ThunkResult {\r\n return dispatch => {\r\n dispatch(beginAjaxCall());\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'post',\r\n data: { quizID }\r\n };\r\n const url = API.POST.training.startQuiz;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n dispatch({\r\n type: types.START_QUIZ_SUCCESS,\r\n startTime: data.data.startTime\r\n });\r\n })\r\n .catch((error: any) => {\r\n console.error('Error starting timed quiz', error);\r\n dispatch({\r\n type: types.START_QUIZ_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'start quiz');\r\n throw error; // intentionally re-throw\r\n });\r\n };\r\n}\r\n\r\nexport const addAnswer = (answer: GFQuizAnswer) => ({\r\n type: types.ADD_ANSWER,\r\n answer\r\n});\r\n\r\nexport const resetAnswers = () => ({\r\n type: types.RESET_ANSWERS\r\n});\r\n\r\nexport const setInProgressQuizID = (quizID: string) => ({\r\n type: types.SET_SELECTED_IN_PROGRESS_QUIZ,\r\n id: quizID\r\n});\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { filter, isEmpty } from 'lodash';\r\nimport {\r\n GFQuizItem,\r\n GFLesson,\r\n GFCourse,\r\n LessonProgress,\r\n Iuser\r\n} from '../../models';\r\n\r\nimport { saveLessonProgress } from '../../actions/trainingActions';\r\n\r\nimport {\r\n ListGroup,\r\n ListGroupItem,\r\n Media,\r\n Row,\r\n Col\r\n // Breadcrumb\r\n} from 'react-bootstrap';\r\n// const FontAwesome = require(\"react-fontawesome\");\r\n// const mixpanel = require(\"mixpanel-browser\");\r\n\r\nimport { RouteComponentProps } from 'react-router';\r\nimport Player, { Options } from '@vimeo/player';\r\nimport * as moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport { getQuizzesByLessonID } from '../../actions/trainingQuizActions';\r\nimport { getQuizLink } from '../../actions/trainingActions';\r\nimport { initialLesson } from '../../reducers/initialState';\r\nimport { throttle } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ninterface IdispatchProps {\r\n user: Iuser;\r\n courses: { [key: string]: GFCourse };\r\n lesson: GFLesson;\r\n lessons: { [key: string]: GFLesson };\r\n lessonQuizzes: GFQuizItem[];\r\n saveLessonProgress: typeof saveLessonProgress;\r\n getQuizzesByLessonID: typeof getQuizzesByLessonID;\r\n getQuizLink: typeof getQuizLink;\r\n loading: boolean;\r\n progress: LessonProgress;\r\n quizLink: { link: string; failedToLoad?: boolean };\r\n}\r\n\r\ntype Props = RouteComponentProps;\r\n\r\ninterface State {\r\n primaryVideo: string;\r\n waitingCount: number;\r\n}\r\n\r\nclass Lesson extends React.Component {\r\n private player: Player | undefined;\r\n private pElem: HTMLDivElement | null;\r\n private timeSpent: number;\r\n private lastUpdate: number;\r\n private handlePlayerTimeUpdateThrottled: any;\r\n constructor(props: Props & IdispatchProps) {\r\n super(props);\r\n this.state = {\r\n primaryVideo: `https://player.vimeo.com/video/${this.props.lesson.primaryVideoPath}`,\r\n waitingCount: 0\r\n };\r\n this.timeSpent = constants.trainingVideoProgressSaveDelay; // set to the delay milliseconds for saving\r\n this.player = undefined;\r\n this.pElem = null;\r\n this.lastUpdate = 0;\r\n this.handlePlayerTimeUpdateThrottled = throttle(\r\n this.handlePlayerTimeUpdate,\r\n constants.trainingVideoProgressSaveDelay\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n if (\r\n !this.props.match.params.lessonID ||\r\n !this.props.match.params.courseID\r\n ) {\r\n // no lesson id and no coursID is not allowed\r\n console.info('no lesson id or no coursID');\r\n this.props.history.replace(`/training`);\r\n return;\r\n }\r\n\r\n // Check to make sure we have already loaded courses, lessons and quizzes in redux\r\n if (isEmpty(this.props.courses) || isEmpty(this.props.lessons)) {\r\n console.info('have not loaded courses, lessons');\r\n this.props.history.push(`/training`);\r\n return;\r\n }\r\n this.props.getQuizzesByLessonID(\r\n this.props.match.params.lessonID,\r\n this.props.user\r\n );\r\n\r\n if (\r\n this.props?.lesson?.description\r\n ?.toLocaleLowerCase()\r\n .includes('{{test_link}}')\r\n )\r\n this.props.getQuizLink(this.props.match.params.courseID);\r\n\r\n if (this.props.lesson.primaryVideoPath.length > 0) {\r\n this.setUpPlayer();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (typeof this.player !== 'undefined') {\r\n this.player.off('play');\r\n this.player.off('pause');\r\n this.player.off('timeupdate');\r\n this.player.off('seeked');\r\n }\r\n }\r\n\r\n showTimedQuizMessage = (quiz: GFQuizItem) => {\r\n const toastrConfirmOptions = {\r\n onOk: () => {\r\n this.startQuiz(quiz, true);\r\n },\r\n onCancel: () => console.info('CANCEL: clicked'),\r\n okText: 'start test',\r\n cancelText: 'cancel'\r\n };\r\n toastr.confirm(\r\n 'This is a timed test. You have total of 3 attempts during 2 hours to complete/retake the test. Navigating away after starting the test counts as an attempt.',\r\n toastrConfirmOptions\r\n );\r\n };\r\n\r\n setUpPlayer = () => {\r\n if (this.pElem === null) {\r\n throw new Error('missing pElem');\r\n }\r\n const options: Options = {\r\n id: parseInt(this.props.lesson.primaryVideoPath, 10),\r\n width: this.pElem.offsetWidth, // > 723 ? this.pElem.offsetWidth : 723,\r\n loop: false\r\n };\r\n\r\n this.player = new Player('lessonPlayer', options);\r\n // this.player = new Player(\"lessonPlayer\");\r\n this.player\r\n .ready()\r\n .then(() => {\r\n if (this.player === undefined) {\r\n throw new Error('missing vimeo player DOM element');\r\n }\r\n // set up event listeners\r\n this.player.on('play', data => {\r\n // console.info('PLAY:', data);\r\n this.lastUpdate = 0;\r\n this.handlePlayerTimeUpdate(data);\r\n });\r\n this.player.on('pause', data => {\r\n // console.info('PAUSE:', data);\r\n this.handlePlayerTimeUpdate(data);\r\n this.lastUpdate = 0;\r\n });\r\n this.player.on('ended', data => {\r\n this.handlePlayerEnded(data);\r\n });\r\n this.player.on('timeupdate', data => {\r\n this.handlePlayerTimeUpdateThrottled(data);\r\n });\r\n\r\n if (\r\n this.props.progress &&\r\n this.props.progress.timeSpent &&\r\n this.props.progress.currentTime\r\n ) {\r\n console.info(this.props.progress);\r\n // set timeSpent from previous progress\r\n this.timeSpent = this.props.progress.timeSpent * 1000;\r\n // seek to last played time\r\n this.player.setCurrentTime(this.props.progress.currentTime);\r\n }\r\n })\r\n .catch(error => {\r\n console.error('Vimeo player failed to initialize.', error);\r\n toastr.error(\r\n 'Error',\r\n 'Video failed to load. Please try again or contact support.',\r\n constants.toastrError\r\n );\r\n });\r\n };\r\n\r\n /*\r\n * start a quiz\r\n */\r\n startQuiz = (gfQuiz: GFQuizItem, skipTimedCheck = false) => {\r\n // set the current active quiz item\r\n // mixpanel.track(\"Practice Exercise started\", {\r\n // quiz: gfQuiz.id,\r\n // name: gfQuiz.name\r\n // });\r\n\r\n if (gfQuiz.isTimed && !skipTimedCheck) {\r\n this.showTimedQuizMessage(gfQuiz);\r\n return;\r\n }\r\n\r\n const path = `/training/${this.props.match.params.courseID}/${this.props.match.params.lessonID}/${gfQuiz.id}`;\r\n this.props.history.push(path);\r\n };\r\n\r\n handlePlayerTimeUpdate = (data: any) => {\r\n console.info(\r\n 'player time update received: ',\r\n this.lastUpdate,\r\n this.timeSpent\r\n );\r\n // increment our TimeSpent variable on each timeupdate event.\r\n // this will track total time spent playing the video, regardless of seeks, etc\r\n const now = moment.now();\r\n if (this.lastUpdate === 0) {\r\n this.lastUpdate = now;\r\n } else {\r\n this.timeSpent += now - this.lastUpdate;\r\n this.lastUpdate = now;\r\n }\r\n\r\n console.info(\r\n 'saving progress: ',\r\n this.timeSpent * 0.001,\r\n this.lastUpdate\r\n );\r\n this.props.saveLessonProgress(\r\n data,\r\n this.props.match.params.lessonID,\r\n this.timeSpent\r\n );\r\n };\r\n\r\n handlePlayerEnded = (data: any) => {\r\n const now = moment.now();\r\n this.lastUpdate = now;\r\n this.props.saveLessonProgress(\r\n data,\r\n this.props.match.params.lessonID,\r\n this.timeSpent\r\n );\r\n };\r\n\r\n createLinkElement = () => {\r\n const { description } = this.props.lesson;\r\n const { link, failedToLoad } = this.props.quizLink;\r\n let replacementText = 'Loading link to quiz...';\r\n\r\n if (link)\r\n replacementText = `Click here to take your exam`;\r\n else if (!link && failedToLoad)\r\n replacementText = 'Your quiz failed to load.';\r\n\r\n return description.replace('{{test_link}}', replacementText);\r\n };\r\n\r\n render() {\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n (this.pElem = ref)}\r\n />\r\n \r\n \r\n \r\n {this.props.lessonQuizzes.map((gfQuiz, index) => {\r\n let gfImage = gfQuiz.imagePath;\r\n if (\r\n gfQuiz.imagePath === null ||\r\n gfQuiz.imagePath === ''\r\n ) {\r\n gfImage = require('../../images/Azure.png');\r\n }\r\n return (\r\n {\r\n this.startQuiz(gfQuiz);\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {gfQuiz.name}\r\n \r\n \r\n {gfQuiz.isComplete === 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\nconst mapStateToProps = (state: IinitialState, ownProps: Props) => {\r\n const lesson =\r\n state.training.lessonsByID[ownProps.match.params.lessonID] ||\r\n initialLesson;\r\n const lessonQuizzes =\r\n filter(state.training.quizzesByID, {\r\n lessonID: ownProps.match.params.lessonID\r\n }) || [];\r\n\r\n return {\r\n user: state.user,\r\n lessons: state.training.lessonsByID,\r\n courses: state.training.coursesByID,\r\n lesson,\r\n lessonQuizzes,\r\n progress: state.training.lessonProgress[ownProps.match.params.lessonID],\r\n loading: selectIsLoading(state),\r\n quizLink: state.training.quizLink\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, {\r\n saveLessonProgress,\r\n getQuizzesByLessonID,\r\n getQuizLink\r\n})(Lesson);\r\n","import * as React from 'react';\r\n\r\nimport { Col, FormGroup, FormControl } from 'react-bootstrap';\r\nimport { GFQuizQuestion, GFQuizAnswer } from '../../models';\r\n\r\ninterface Props extends React.Props {\r\n curQ: GFQuizQuestion;\r\n showCorrectAnswer: boolean;\r\n selectedAnswer: GFQuizAnswer;\r\n textAnswer: string;\r\n handleChange: (answer: GFQuizAnswer) => void;\r\n}\r\n\r\nclass Question extends React.Component {\r\n // constructor(props: Props) {\r\n // super(props);\r\n // }\r\n\r\n buildOption(\r\n index: number,\r\n textHighlight: string,\r\n option: { option: string; isAnswer: boolean },\r\n rightOrWrong: string\r\n ) {\r\n let radioCheckBox;\r\n if (\r\n this.props.selectedAnswer.answer === option.option &&\r\n rightOrWrong === 'fa fa-check right-or-wrong check-mark'\r\n ) {\r\n radioCheckBox = 'check-box-correct text-center';\r\n } else if (\r\n this.props.selectedAnswer.answer === option.option &&\r\n rightOrWrong === 'fa fa-times checkmark right-or-wrong times-mark'\r\n ) {\r\n radioCheckBox = 'check-box-wrong text-center';\r\n } else {\r\n radioCheckBox = 'check-box text-center';\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 render() {\r\n const quizClassName = 'text-question';\r\n const teacherViewing = 'options';\r\n const textInputPlaceholder = 'Your answer...';\r\n\r\n const curQ = this.props.curQ;\r\n return (\r\n
    \r\n {curQ.type === 'blank' && (\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n {\r\n const val = e.target.value;\r\n this.props.handleChange({\r\n answer: val,\r\n questionID: this.props.curQ.id,\r\n isCorrect:\r\n curQ.correctAnswer\r\n .toLowerCase()\r\n .trim() ===\r\n val.toLowerCase().trim()\r\n });\r\n }}\r\n />\r\n \r\n \r\n \r\n {this.props.showCorrectAnswer &&\r\n !this.props.selectedAnswer.isCorrect && (\r\n
    \r\n )}\r\n {this.props.showCorrectAnswer &&\r\n this.props.selectedAnswer.isCorrect && (\r\n
    \r\n )}\r\n \r\n \r\n {this.props.showCorrectAnswer &&\r\n !this.props.selectedAnswer.isCorrect && (\r\n
    \r\n

    \r\n Correct Answer: {curQ.correctAnswer}\r\n

    \r\n
    \r\n )}\r\n \r\n
    \r\n )}\r\n {curQ.type === 'choice' && (\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n {curQ.options.map((option, index) => {\r\n let textHighlight = '';\r\n let rightOrWrong = '';\r\n if (this.props.showCorrectAnswer === true) {\r\n if (\r\n this.props.selectedAnswer.isCorrect !==\r\n true &&\r\n this.props.selectedAnswer.answer ===\r\n option.option\r\n ) {\r\n // answer was selected and is wrong\r\n textHighlight = 'wrong-answer';\r\n // If you change this string on line 115 and line 118, make sure to make appropriate\r\n // change to line 25 and 27 in buildOption\r\n rightOrWrong =\r\n 'fa fa-times checkmark right-or-wrong times-mark';\r\n } else if (option.isAnswer === true) {\r\n textHighlight = 'right-answer';\r\n rightOrWrong =\r\n 'fa fa-check right-or-wrong check-mark';\r\n }\r\n }\r\n // TODO, I think I need to pass in the answer if I have it\r\n // if(textHighlight === 'right-answer' || textHighlight === 'wrong-answer') {\r\n // selectingForm = true;\r\n // }\r\n return this.buildOption(\r\n index,\r\n textHighlight,\r\n option,\r\n rightOrWrong\r\n );\r\n })}\r\n \r\n
    \r\n )}\r\n
    \r\n );\r\n }\r\n}\r\n\r\nexport default Question;\r\n","/*\r\n * QuizButton - decide which button to show and handle the disabled state.\r\n * Check - show if we are showing correctAnswers and the question is unanswered\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Button } from 'react-bootstrap';\r\n\r\ninterface Iprops {\r\n showCorrectAnswer: boolean;\r\n showCorrectAnswersEnabled: boolean;\r\n isLastQuestion: boolean;\r\n answer: string;\r\n loading: boolean;\r\n}\r\n\r\nexport const QuizButton = (props: Iprops) => {\r\n const {\r\n isLastQuestion,\r\n showCorrectAnswer,\r\n answer,\r\n showCorrectAnswersEnabled\r\n } = props;\r\n\r\n if (!showCorrectAnswer && showCorrectAnswersEnabled) {\r\n return (\r\n \r\n Check\r\n \r\n );\r\n } else if (\r\n (showCorrectAnswer || !showCorrectAnswersEnabled) &&\r\n !isLastQuestion\r\n ) {\r\n return (\r\n \r\n Next\r\n \r\n );\r\n } else if (\r\n (showCorrectAnswer || !showCorrectAnswersEnabled) &&\r\n isLastQuestion\r\n ) {\r\n return (\r\n \r\n Finish Exercise\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\n","import * as React from 'react';\r\nimport { Row, Col, Button } from 'react-bootstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { GFQuizAnswer } from '../../models';\r\nimport { calculateScore } from '../../actions/trainingQuizActions';\r\n\r\nconst getScoreString = (score: number, isTimed: boolean) => {\r\n let grade;\r\n let message;\r\n if (isTimed) {\r\n if (score >= 70 && score <= 100) {\r\n message =\r\n 'Congratulations! It looks like you have a solid understanding of the material.';\r\n grade = 'a';\r\n } else if (score >= 0 && score <= 69) {\r\n message =\r\n 'Sorry, a score of 70 or greater is needed to show mastery.';\r\n grade = 'c';\r\n }\r\n } else {\r\n if (score >= 70 && score <= 100) {\r\n message =\r\n 'Nice job! It looks like you have a solid understanding of the material.';\r\n grade = 'a';\r\n } else if (score >= 0 && score <= 69) {\r\n message =\r\n \"It looks like you're still learning the material - don't give up. Please review the lessons and try again.\";\r\n grade = 'c';\r\n }\r\n }\r\n return { grade, message };\r\n};\r\n\r\nconst QuizScore = ({\r\n quizAnswers,\r\n isTimed\r\n}: {\r\n quizAnswers: GFQuizAnswer[];\r\n isTimed: boolean;\r\n}) => {\r\n const { score, numCorrect, tot } = calculateScore(quizAnswers);\r\n const { grade, message } = getScoreString(score, isTimed);\r\n\r\n return (\r\n
    \r\n \r\n \r\n

    {message}

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

    \r\n {score.toFixed(0) + '%'}\r\n

    \r\n

    \r\n {numCorrect} / {tot} correct.\r\n

    \r\n
    \r\n
    \r\n );\r\n};\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\ninterface Iprops extends RouteComponentProps {\r\n retakeQuiz: () => void;\r\n quizAnswers: GFQuizAnswer[];\r\n isTimed: boolean;\r\n}\r\n\r\nexport const QuizComplete = (props: Iprops) => {\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Retake Exercise\r\n \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 {\r\n initialQuiz,\r\n initialLesson,\r\n intialQuizAnswer\r\n} from '../../reducers/initialState';\r\n\r\nimport { connect } from 'react-redux';\r\nimport {\r\n GFQuizItem,\r\n GFLesson,\r\n GFCourse,\r\n Iuser,\r\n GFQuizAnswer\r\n} from '../../models';\r\nimport { getLessonsByCourseID } from '../../actions/trainingActions';\r\nimport Question from './Question';\r\n\r\nimport { Row, Col, Alert } from 'react-bootstrap';\r\n\r\nimport { RouteComponentProps } from 'react-router';\r\nimport moment from 'moment';\r\nimport { toastr } from 'react-redux-toastr';\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n resetAnswers,\r\n saveQuizResult,\r\n getQuizzesByLessonID,\r\n addAnswer,\r\n setInProgressQuizID,\r\n startQuiz\r\n} from '../../actions/trainingQuizActions';\r\nimport { QuizButton } from './QuizButton';\r\nimport { QuizComplete } from './QuizComplete';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst TimeLeftBanner = ({ timeLeft }: { timeLeft?: number }) => {\r\n if (!timeLeft) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n {timeLeft} minutes remaining\r\n \r\n \r\n );\r\n};\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ninterface IdispatchProps {\r\n // Add your dispatcher properties here\r\n user: Iuser;\r\n quiz: GFQuizItem;\r\n courses: { [key: string]: GFCourse };\r\n lesson: GFLesson;\r\n quizzes: { [key: string]: GFQuizItem };\r\n getLessonsByCourseID: typeof getLessonsByCourseID;\r\n getQuizzesByLessonID: typeof getQuizzesByLessonID;\r\n saveQuizResult: any;\r\n loading: boolean;\r\n startQuiz: (id: string) => Promise;\r\n resetAnswers: typeof resetAnswers;\r\n quizAnswers: GFQuizAnswer[];\r\n addAnswer: typeof addAnswer;\r\n quizComplete: boolean;\r\n setInProgressQuizID: typeof setInProgressQuizID;\r\n inProgressQuizID: string;\r\n startTime: string;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\ninterface State {\r\n questionIndex: number;\r\n selectedAnswer: GFQuizAnswer;\r\n showCorrectAnswer: boolean;\r\n textAnswer: string;\r\n timeLeft: number;\r\n timeoutWarningShown: boolean;\r\n}\r\n\r\nclass Quiz extends React.Component {\r\n quizLoading: boolean;\r\n quizLoadingTimeout: any;\r\n quizTimer: any;\r\n\r\n constructor(props: Iprops & IdispatchProps) {\r\n super(props);\r\n this.state = {\r\n questionIndex: 0,\r\n selectedAnswer: intialQuizAnswer,\r\n textAnswer: '',\r\n timeLeft: 0,\r\n timeoutWarningShown: false,\r\n showCorrectAnswer: false\r\n };\r\n\r\n this.quizLoading = false;\r\n }\r\n\r\n /*\r\n * When the component mounts we want to check for a quizID, if there is not one then we can not load a quiz,\r\n * so send them back to the courses page\r\n * we need the lesson in order to show the breadcrumbs\r\n * then get the quiz\r\n */\r\n componentDidMount() {\r\n if (\r\n !this.props.match.params.quizID ||\r\n !this.props.match.params.lessonID\r\n ) {\r\n console.error('missing quizid or lessonid');\r\n this.props.history.replace(`/training`);\r\n return;\r\n }\r\n\r\n this.checkQuiz();\r\n this.checkLesson();\r\n\r\n // if we have answers and it is the same quizID, then reload\r\n // otherwise set the new quizID\r\n if (\r\n this.props.quizAnswers.length &&\r\n this.props.inProgressQuizID === this.props.match.params.quizID\r\n ) {\r\n this.reloadExistingQuiz();\r\n } else {\r\n this.props.resetAnswers();\r\n this.props.setInProgressQuizID(this.props.match.params.quizID);\r\n }\r\n /*\r\n * Handle Timed Quizzes\r\n */\r\n if (this.props.quiz.isTimed) {\r\n this.handleTimedQuiz();\r\n }\r\n }\r\n componentDidUpdate(prevProps: IdispatchProps) {\r\n if (this.props.quizAnswers !== prevProps.quizAnswers) {\r\n this.handleNewAnswer();\r\n }\r\n }\r\n componentWillUnmount() {\r\n clearInterval(this.quizTimer);\r\n this.props.resetAnswers(); // if the user intentionally navigates away, we reset the answers\r\n clearTimeout(this.quizLoadingTimeout);\r\n }\r\n\r\n /*\r\n if the quiz with questions has not been loaded, then retrieve it.\r\n (this will happen when handling a direct link)\r\n We do not have an endpoint to get the quiz by ID, so in order to get the quiz by ID\r\n we have to use the endpoint that gets all the quizzes for the lesson.\r\n */\r\n checkQuiz = () => {\r\n if (!this.props.quiz.questions.length) {\r\n this.props.getQuizzesByLessonID(\r\n this.props.match.params.lessonID,\r\n this.props.user\r\n );\r\n }\r\n };\r\n checkLesson = () => {\r\n if (!this.props.lesson.id.length) {\r\n console.info(\r\n 'did not find lesson in Redux, loading lessons from API'\r\n );\r\n this.props.getLessonsByCourseID(\r\n this.props.match.params.courseID,\r\n this.props.user\r\n );\r\n }\r\n };\r\n\r\n shouldShowCorrectAnswers = () => {\r\n if (this.props.quiz.isTimed) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n };\r\n\r\n /*\r\n * User answered a question. if show correct answers is Not enabled, then go to the next question\r\n if last question, then finish it\r\n */\r\n handleNewAnswer = () => {\r\n if (!this.shouldShowCorrectAnswers()) {\r\n if (\r\n this.props.quiz.questions.length ===\r\n this.props.quizAnswers.length\r\n ) {\r\n this.finishQuiz();\r\n } else {\r\n this.nextQuestion();\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * If timed, call the API to a) notify that the Quiz has started. b) can we start\r\n */\r\n handleTimedQuiz = () => {\r\n this.props\r\n .startQuiz(this.props.quiz.id)\r\n .then(() => {\r\n this.calculateTimeLeft(); // call it once in order to show the time left immediately\r\n this.quizTimer = setInterval(this.calculateTimeLeft, 3000);\r\n })\r\n .catch(() => {\r\n this.props.history.push(\r\n `/training/${this.props.match.params.courseID}/${this.props.match.params.lessonID}`\r\n );\r\n });\r\n };\r\n calculateTimeLeft = () => {\r\n const timeLeft = moment\r\n .utc(this.props.startTime)\r\n .add(constants.timedQuizHours, 'h')\r\n .diff(moment(), 'minutes');\r\n\r\n this.setState({ timeLeft });\r\n\r\n if (timeLeft <= 5 && !this.state.timeoutWarningShown) {\r\n toastr.warning(\r\n 'Almost out of time, please submit test as soon as possible.',\r\n '',\r\n constants.toastrWarning\r\n );\r\n this.setState({ timeoutWarningShown: true });\r\n }\r\n\r\n if (timeLeft <= 0) {\r\n toastr.error(\r\n 'Out Of Time',\r\n 'You have run out of time and are no longer able to submit this quiz',\r\n { ...constants.toastrError, timeOut: 0 }\r\n );\r\n this.props.history.push(\r\n `/training/${this.props.match.params.courseID}/${this.props.match.params.lessonID}`\r\n );\r\n }\r\n };\r\n\r\n /*\r\n * There is a quiz in progress, so lets reload it\r\n */\r\n reloadExistingQuiz = () => {\r\n window.scrollTo(0, 0);\r\n const howManyAnswered = this.props.quizAnswers.length;\r\n if (howManyAnswered >= this.props.quiz.questions.length) {\r\n const lastAnswer = this.props.quizAnswers[howManyAnswered - 1];\r\n this.setState({\r\n questionIndex: howManyAnswered - 1,\r\n textAnswer: lastAnswer.answer,\r\n selectedAnswer: lastAnswer,\r\n showCorrectAnswer: true\r\n });\r\n } else {\r\n this.setState({\r\n questionIndex: howManyAnswered\r\n });\r\n }\r\n };\r\n\r\n handleChange = (selectedAnswer: GFQuizAnswer) => {\r\n this.setState({ selectedAnswer });\r\n };\r\n\r\n retakeQuiz = () => {\r\n if (this.props.quiz.isTimed) {\r\n this.handleTimedQuiz();\r\n }\r\n this.props.resetAnswers();\r\n\r\n // mixpanel.track('Retake Practice Exercise was clicked', {\r\n // quizID: this.props.quiz.id,\r\n // quizName: this.props.quiz.name\r\n // });\r\n this.setState({\r\n questionIndex: 0,\r\n selectedAnswer: intialQuizAnswer,\r\n showCorrectAnswer: false\r\n });\r\n };\r\n\r\n nextQuestion() {\r\n // prevent double tap\r\n if (this.isQuizLoading()) {\r\n return;\r\n }\r\n const newIndex = this.props.quizAnswers.length;\r\n this.setState({\r\n questionIndex: newIndex,\r\n selectedAnswer: intialQuizAnswer,\r\n showCorrectAnswer: false,\r\n textAnswer: ''\r\n });\r\n }\r\n\r\n isQuizLoading = () => {\r\n if (this.quizLoading) {\r\n return true;\r\n }\r\n this.quizLoading = true;\r\n this.quizLoadingTimeout = setTimeout(() => {\r\n this.quizLoading = false;\r\n }, 200);\r\n return false;\r\n };\r\n\r\n /*\r\n * The button on the question is a form submit in order to capture keyboard return key on the fill in the blank type questions\r\n * prevent double click\r\n * if we are taking a quiz that has showing correct answers enabled, then show the correct anser after each question\r\n * otherwise show the next question.\r\n */\r\n\r\n handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n e.currentTarget.reset();\r\n\r\n if (this.shouldShowCorrectAnswers()) {\r\n if (this.state.showCorrectAnswer) {\r\n if (\r\n this.props.quiz.questions.length ===\r\n this.props.quizAnswers.length\r\n ) {\r\n this.finishQuiz();\r\n } else {\r\n this.nextQuestion();\r\n }\r\n } else {\r\n this.saveQuizAnswer();\r\n this.showCorrectAnswer();\r\n }\r\n } else {\r\n if (\r\n this.props.quiz.questions.length ===\r\n this.props.quizAnswers.length\r\n ) {\r\n // this happens if the previous finishQuiz failed for some reason\r\n this.finishQuiz();\r\n } else {\r\n this.saveQuizAnswer();\r\n }\r\n }\r\n };\r\n\r\n showCorrectAnswer = () => {\r\n if (this.isQuizLoading()) {\r\n return;\r\n }\r\n this.setState({ showCorrectAnswer: true });\r\n };\r\n\r\n saveQuizAnswer = () => {\r\n const answer: GFQuizAnswer = {\r\n questionID: this.props.quiz.questions[this.props.quizAnswers.length]\r\n .id,\r\n answer: this.state.selectedAnswer.answer,\r\n isCorrect: this.state.selectedAnswer.isCorrect\r\n };\r\n this.props.addAnswer(answer);\r\n };\r\n\r\n finishQuiz = () => {\r\n // prevent double tap\r\n if (this.isQuizLoading()) {\r\n return;\r\n }\r\n\r\n this.props\r\n .saveQuizResult(this.props.quiz.id, this.props.quiz.name)\r\n .then(() => {\r\n this.setState({\r\n selectedAnswer: intialQuizAnswer,\r\n showCorrectAnswer: false,\r\n textAnswer: '',\r\n questionIndex: 0\r\n });\r\n });\r\n };\r\n\r\n render() {\r\n const { questionIndex } = this.state;\r\n let questions;\r\n let totQ;\r\n let curQ;\r\n if (this.props.quiz && this.props.quiz.id) {\r\n questions = this.props.quiz.questions;\r\n totQ = this.props.quiz.questions.length;\r\n curQ = questions[questionIndex];\r\n }\r\n const isLastQuestion =\r\n this.state.questionIndex + 1 === this.props.quiz.questions.length;\r\n\r\n return (\r\n
    \r\n
    \r\n {/*\r\n * Display the Quiz Question and buttons\r\n */}\r\n {!this.props.quizComplete && typeof curQ !== 'undefined' && (\r\n
    \r\n
    \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n {questionIndex + 1} of {totQ}\r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n )}\r\n {/*\r\n * Display the Completed Quiz Score\r\n */}\r\n {this.props.quizComplete && (\r\n \r\n )}\r\n
    \r\n {/*\r\n * Display right or wrong\r\n */}\r\n {this.state.showCorrectAnswer && !this.props.quizComplete && (\r\n
    \r\n {/* style={bubble} */}\r\n {this.state.selectedAnswer.isCorrect && (\r\n

    \r\n {(curQ && curQ.correctText) || 'correct'}\r\n

    \r\n )}\r\n {!this.state.selectedAnswer.isCorrect && (\r\n

    \r\n {(curQ && curQ.wrongText) || 'wrong'}\r\n

    \r\n )}\r\n
    \r\n )}\r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const quiz =\r\n state.training.quizzesByID[ownProps.match.params.quizID] || initialQuiz;\r\n const lesson =\r\n state.training.lessonsByID[ownProps.match.params.lessonID] ||\r\n initialLesson;\r\n return {\r\n user: state.user,\r\n courses: state.training.coursesByID,\r\n quiz,\r\n lesson,\r\n quizzes: state.training.quizzesByID,\r\n quizAnswers: state.training.quizAnswers,\r\n loading: selectIsLoading(state),\r\n quizComplete: state.training.quizView.quizComplete,\r\n inProgressQuizID: state.training.quizView.inProgressQuizID,\r\n startTime: state.training.quizView.startTime\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, {\r\n getLessonsByCourseID,\r\n getQuizzesByLessonID,\r\n resetAnswers,\r\n saveQuizResult,\r\n startQuiz,\r\n addAnswer,\r\n setInProgressQuizID\r\n})(Quiz);\r\n","/*\r\n * Training Banner Container\r\n */\r\n\r\nimport { RouteComponentProps, withRouter } from 'react-router';\r\nimport {\r\n initialCourse,\r\n initialLesson,\r\n initialQuiz\r\n} from '../../reducers/initialState';\r\n\r\nimport { Banner } from '../common/Banner';\r\nimport { connect } from 'react-redux';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n img: any;\r\n color: string;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const quiz =\r\n state.training.quizzesByID[ownProps.match.params.quizID] || initialQuiz;\r\n const lesson =\r\n state.training.lessonsByID[ownProps.match.params.lessonID] ||\r\n initialLesson;\r\n const selectedCourse =\r\n state.training.coursesByID[ownProps.match.params.courseID] ||\r\n initialCourse;\r\n const title = (): string => {\r\n if (quiz.name.length) {\r\n return quiz.name;\r\n }\r\n if (lesson.name?.length) {\r\n return lesson.name;\r\n }\r\n if (selectedCourse.name.length) {\r\n return selectedCourse.name;\r\n }\r\n return 'Training';\r\n };\r\n return {\r\n title: title()\r\n };\r\n};\r\n\r\nexport const TrainingBannerContainer = withRouter(\r\n connect(mapStateToProps, {})(Banner)\r\n);\r\n","/*\r\n * Training Breadcumb Container\r\n */\r\n\r\nimport { RouteComponentProps, withRouter } from 'react-router';\r\nimport {\r\n initialCourse,\r\n initialLesson,\r\n initialQuiz\r\n} from '../../reducers/initialState';\r\n\r\nimport { TrainingBreadcrumb } from './TrainingBreadcrumb';\r\nimport { connect } from 'react-redux';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ntype Iprops = RouteComponentProps;\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const quiz =\r\n state.training.quizzesByID[ownProps.match.params.quizID] || initialQuiz;\r\n const lesson =\r\n state.training.lessonsByID[ownProps.match.params.lessonID] ||\r\n initialLesson;\r\n const selectedCourse =\r\n state.training.coursesByID[ownProps.match.params.courseID] ||\r\n initialCourse;\r\n\r\n return {\r\n quiz,\r\n lesson,\r\n selectedCourse,\r\n loading: selectIsLoading(state)\r\n };\r\n};\r\n\r\nexport const TrainingBreadcrumbContainer = withRouter(\r\n connect(mapStateToProps, {})(TrainingBreadcrumb)\r\n);\r\n","/* eslint-disable no-extra-boolean-cast */\r\nimport * as React from 'react';\r\nimport { Breadcrumb, BreadcrumbItem } from 'react-bootstrap';\r\n\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { GFQuizItem, GFCourse, GFLesson } from '../../models';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\n\r\ninterface RouterParams {\r\n courseID: string;\r\n lessonID: string;\r\n quizID: string;\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n quiz: GFQuizItem;\r\n selectedCourse: GFCourse;\r\n lesson: GFLesson;\r\n}\r\n\r\nexport const TrainingBreadcrumb = ({\r\n quiz,\r\n selectedCourse,\r\n lesson,\r\n history,\r\n match\r\n}: Iprops) => {\r\n if (!!match.params.quizID) {\r\n return (\r\n \r\n \r\n \r\n Training\r\n \r\n \r\n \r\n \r\n {selectedCourse.name}\r\n \r\n \r\n \r\n \r\n {lesson.name}\r\n \r\n \r\n {quiz.name}\r\n \r\n );\r\n }\r\n\r\n if (!!match.params.lessonID) {\r\n return (\r\n \r\n \r\n \r\n Training\r\n \r\n \r\n \r\n \r\n {selectedCourse.name}\r\n \r\n \r\n {lesson.name}\r\n \r\n );\r\n }\r\n\r\n if (!!match.params.courseID) {\r\n return (\r\n \r\n \r\n \r\n Training\r\n \r\n \r\n \r\n {selectedCourse.name}\r\n \r\n \r\n );\r\n }\r\n\r\n return null;\r\n};\r\n","/*\r\n * Edit Training Checkout Form\r\n */\r\n\r\nimport {\r\n Col,\r\n Button,\r\n FormGroup,\r\n ControlLabel,\r\n FormControl,\r\n Badge\r\n} from 'react-bootstrap';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport {\r\n FormGenerator,\r\n AbstractControl,\r\n FieldConfig,\r\n Validators\r\n} from 'react-reactive-form';\r\nimport { mapValues, forEach } from 'lodash';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n Ioption,\r\n IshoppingCartProduct,\r\n IproductInfo,\r\n IshoppingCart,\r\n ItableFiltersReducer,\r\n Iuser\r\n} from '../../models';\r\nimport {\r\n toggleShoppingCartModal,\r\n updateQuantityCart,\r\n deleteFromCart\r\n} from '../../actions/shoppingCartActions';\r\nimport { requestQuote } from '../../actions/manageInventoryActions';\r\nimport Select, { components } from 'react-select';\r\nimport NumberFormat from 'react-number-format';\r\nimport { savePendingTraining } from '../../actions/manageTrainingActions';\r\nimport { constants } from '../../constants/constants';\r\n\r\n// add the bootstrap form-control class to the react-select select component\r\nconst ControlComponent = (props: any) => (\r\n
    \r\n \r\n
    \r\n);\r\n\r\n/*\r\n * Input row with a button to delete the cart item\r\n */\r\nconst NumberInputWithButton = ({\r\n handler,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n}: AbstractControl) => (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n meta.buttonAction(meta.id)}\r\n >\r\n \r\n \r\n \r\n \r\n);\r\n\r\n/*\r\n * Card product with a button to delete it\r\n */\r\nconst CartProduct = ({\r\n handler,\r\n touched,\r\n hasError,\r\n meta,\r\n pristine,\r\n errors,\r\n submitted\r\n}: AbstractControl) => (\r\n \r\n \r\n {meta.label}\r\n \r\n \r\n \r\n \r\n \r\n meta.buttonAction(meta.id)}\r\n >\r\n \r\n \r\n \r\n \r\n);\r\n\r\nconst buildFieldConfig = (\r\n products: { [key: string]: IshoppingCartProduct },\r\n deleteFromCartCB: typeof deleteFromCart,\r\n cartName: string,\r\n showCost = false\r\n) => {\r\n const productControls = mapValues(products, prod => {\r\n return {\r\n render: showCost ? CartProduct : NumberInputWithButton,\r\n options: {\r\n validators: [\r\n Validators.min(1),\r\n Validators.max(1000),\r\n FormUtil.validators.requiredWithTrim\r\n ]\r\n },\r\n meta: {\r\n label: prod.name,\r\n defaultValue: prod.quantity,\r\n buttonAction: (id: string) => deleteFromCartCB(id, cartName),\r\n id: prod.id,\r\n cost: prod.cost,\r\n name: prod.id\r\n }\r\n };\r\n });\r\n const fieldConfigControls = {\r\n memo: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: 'memo',\r\n colWidth: 12,\r\n componentClass: 'textarea',\r\n rows: 6,\r\n name: 'memo',\r\n required: false\r\n }\r\n }\r\n };\r\n return {\r\n controls: { ...productControls, ...fieldConfigControls }\r\n };\r\n};\r\n\r\ninterface Iprops {\r\n checkout: typeof requestQuote;\r\n toggleShoppingCartModal: typeof toggleShoppingCartModal;\r\n loading: boolean;\r\n colorButton: string;\r\n productInfo: IproductInfo;\r\n facilityOptions: Ioption[];\r\n cart: IshoppingCart;\r\n tableFilters: ItableFiltersReducer;\r\n updateQuantityCart: typeof updateQuantityCart;\r\n deleteFromCart: typeof deleteFromCart;\r\n cartName: string;\r\n showCost?: boolean;\r\n user: Iuser;\r\n}\r\ninterface Istate {\r\n fieldConfig: FieldConfig;\r\n}\r\n\r\nclass EditQuoteForm extends React.Component {\r\n private userForm: FormGroup | any;\r\n private subscription: any;\r\n private formRef: React.RefObject;\r\n constructor(props: Iprops & WithTranslation) {\r\n super(props);\r\n this.formRef = React.createRef();\r\n this.state = {\r\n fieldConfig: { controls: {} }\r\n };\r\n }\r\n // TODO keep the message somewhere, patch the value\r\n componentDidMount() {\r\n this.setFormConfig();\r\n }\r\n componentWillUnmount() {\r\n if (this.subscription) {\r\n this.subscription.unsubscribe();\r\n }\r\n }\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (\r\n prevProps.cart.addedIDs.length !== this.props.cart.addedIDs.length\r\n ) {\r\n console.info('products changed');\r\n this.setFormConfig();\r\n }\r\n }\r\n setFormConfig = () => {\r\n this.setState(\r\n {\r\n fieldConfig: FormUtil.translateForm(\r\n buildFieldConfig(\r\n this.props.cart.productsByID,\r\n this.props.deleteFromCart,\r\n this.props.cartName,\r\n this.props.showCost\r\n ),\r\n this.props.t\r\n )\r\n },\r\n () => {\r\n forEach(this.state.fieldConfig.controls, (input: any, key) => {\r\n if (\r\n this.userForm &&\r\n input.meta &&\r\n input.meta.defaultValue\r\n ) {\r\n this.userForm.patchValue({\r\n [key]: input.meta.defaultValue\r\n });\r\n }\r\n if (\r\n this.userForm &&\r\n this.props.cart.addedIDs.length &&\r\n key !== 'message'\r\n ) {\r\n this.subscription = this.userForm\r\n .get(key)\r\n .valueChanges.subscribe((value: any) => {\r\n this.props.updateQuantityCart(\r\n parseInt(value, 10),\r\n key,\r\n this.props.cartName\r\n );\r\n });\r\n }\r\n });\r\n }\r\n );\r\n };\r\n setForm = (form: AbstractControl) => {\r\n console.info('setting form');\r\n this.userForm = form;\r\n this.userForm.meta = {\r\n loading: this.props.loading\r\n };\r\n };\r\n\r\n calculateSubtotal = () => {\r\n let subtotal = 0;\r\n forEach(this.props.cart.productsByID, product => {\r\n if (product.cost) {\r\n // TODO why is memo in the array of productsByID???\r\n subtotal += product.cost;\r\n }\r\n });\r\n return subtotal;\r\n };\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n const formClassName = `clearfix beacon-form checkout-form ${this.props.colorButton}`;\r\n if (this.props.cart.addedIDs.length === 0) {\r\n return (\r\n
    \r\n

    \r\n {this.props.t('emptyMessage')}\r\n

    \r\n \r\n \r\n this.props.toggleShoppingCartModal(\r\n this.props.cartName\r\n )\r\n }\r\n >\r\n {t('common:cancel')}\r\n \r\n \r\n
    \r\n );\r\n }\r\n return (\r\n ) => {\r\n event.preventDefault();\r\n\r\n try {\r\n const response = await savePendingTraining(\r\n this.props.cart.addedIDs\r\n );\r\n\r\n if (response.status !== 200)\r\n throw 'Error saving pending purchases';\r\n\r\n if (this.formRef.current) this.formRef.current.submit();\r\n } catch (err) {\r\n constants.handleError(\r\n err,\r\n 'Error saving pending purchases'\r\n );\r\n }\r\n // Call savePendingTraining, if it fails, do not submit the form\r\n }}\r\n >\r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n","/*\r\n * Install Base Analytics Container\r\n */\r\n\r\nimport InstallBaseAnalytics from './InstallBaseAnalytics';\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport {\r\n getProductInfo,\r\n setTableFilter\r\n} from '../../actions/manageInventoryActions';\r\nimport queryString from 'query-string';\r\nimport { RouteComponentProps, withRouter } from 'react-router';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { IanalyticsInspection } from '../../models';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n inspection: IanalyticsInspection[];\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & RouteComponentProps<{}>\r\n) => {\r\n const { selectedFacilityID, user, productInfo } = state;\r\n const { securityFunctions } = user;\r\n const query = queryString.parse(ownProps.location.search);\r\n const selectedFacility =\r\n state.facilities[selectedFacilityID] || initialFacility;\r\n return {\r\n selectedFacility,\r\n securityFunctions,\r\n loading: selectIsLoading(state),\r\n mainCategories: productInfo.mainCategories,\r\n mainCategoryOptions: productInfo.mainCategoryOptions,\r\n isDemoMode: query.demo === 'true',\r\n user\r\n };\r\n};\r\n\r\nexport const InstallBaseAnalyticsContainer = withRouter(\r\n connect(mapStateToProps, { getProductInfo, setTableFilter })(\r\n InstallBaseAnalytics\r\n )\r\n);\r\n","import * as Highcharts from 'highcharts';\r\nimport * as React from 'react';\r\n\r\nimport { IanalyticsPMP, Ifacility } from '../../models';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport HighchartsReact from 'highcharts-react-official';\r\nimport { Link, RouteComponentProps } from 'react-router-dom';\r\nimport { TFunction } from 'i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport { setTableFilter } from '../../actions/manageWorkOrderActions';\r\nimport { workOrderStatusEnum } from '../../models-enums';\r\nimport { mockAnalyticsPMP } from './mockAnalytics';\r\nimport highchartsMore from 'highcharts/highcharts-more.js';\r\nimport solidGauge from 'highcharts/modules/solid-gauge.js';\r\nimport { CountUp } from 'countup.js';\r\n\r\nhighchartsMore(Highcharts);\r\nsolidGauge(Highcharts);\r\ninterface Iprops {\r\n t: TFunction;\r\n pmp: IanalyticsPMP;\r\n loading: boolean;\r\n isDemoMode: boolean;\r\n setTableFilter: typeof setTableFilter;\r\n selectedFacility: Ifacility;\r\n}\r\n\r\ninterface Istate {\r\n chartOptions: Partial;\r\n}\r\nexport default class PMPAnalytics extends React.PureComponent<\r\n Iprops & RouteComponentProps<{}>,\r\n Istate\r\n> {\r\n private totalRef = React.createRef();\r\n\r\n constructor(props: Iprops & RouteComponentProps<{}>) {\r\n super(props);\r\n this.state = {\r\n chartOptions: this.loadOptions()\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.startCountUp();\r\n this.handleUpdatedData();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (JSON.stringify(prevProps.pmp) !== JSON.stringify(this.props.pmp)) {\r\n this.startCountUp();\r\n this.handleUpdatedData();\r\n }\r\n }\r\n\r\n startCountUp = () => {\r\n if (this.totalRef.current) {\r\n const selectedData = this.getPMPData();\r\n const options = {\r\n useEasing: true\r\n };\r\n const totalCountUp = new CountUp(\r\n this.totalRef.current,\r\n selectedData?.totalWorkOrders,\r\n options\r\n );\r\n\r\n setTimeout(() => {\r\n totalCountUp.start();\r\n }, 750);\r\n }\r\n };\r\n\r\n handleUpdatedData = () => {\r\n const PMPData = this.getPMPData();\r\n\r\n if (PMPData) {\r\n this.setState({\r\n chartOptions: {\r\n series: [\r\n {\r\n name: this.props.t('open'),\r\n data: PMPData?.data.open,\r\n type: 'solidgauge'\r\n },\r\n {\r\n name: this.props.t('closed'),\r\n data: PMPData?.data.closed,\r\n type: 'solidgauge'\r\n }\r\n ]\r\n }\r\n });\r\n }\r\n };\r\n\r\n getPMPData = () => {\r\n const { pmp, isDemoMode } = this.props;\r\n\r\n if (isDemoMode) {\r\n return mockAnalyticsPMP;\r\n }\r\n\r\n return pmp;\r\n };\r\n\r\n // for US show one version, for UK show a different version\r\n getTitle = () => {\r\n if (\r\n this.props.selectedFacility.standardID ===\r\n constants.defaultStandardUS\r\n ) {\r\n return this.props.t('PMPAnalyticsTitle');\r\n } else return this.props.t('PMPAnalyticsTitleUK');\r\n };\r\n\r\n loadOptions = (): Highcharts.Options => ({\r\n title: {\r\n text: undefined\r\n },\r\n tooltip: {\r\n borderWidth: 0,\r\n backgroundColor: 'none',\r\n shadow: false,\r\n style: {\r\n fontSize: '12px'\r\n },\r\n valueSuffix: '%',\r\n pointFormat:\r\n '{series.name}
    {point.y}',\r\n positioner(labelWidth) {\r\n return {\r\n x: (this.chart.chartWidth - labelWidth) / 2,\r\n y: this.chart.plotHeight / 2 - 20\r\n };\r\n }\r\n },\r\n pane: {\r\n startAngle: 0,\r\n endAngle: 360,\r\n background: [\r\n {\r\n // Track for Outer\r\n outerRadius: '100%',\r\n innerRadius: '70%',\r\n backgroundColor: Highcharts.color(\r\n constants.colors.lightTeal\r\n )\r\n .setOpacity(0.3)\r\n .get(),\r\n borderWidth: 0\r\n },\r\n {\r\n // Track for Inner\r\n outerRadius: '70%',\r\n innerRadius: '40%',\r\n backgroundColor: Highcharts.color(constants.colors.textBlue)\r\n .setOpacity(0.3)\r\n .get(),\r\n borderWidth: 0\r\n }\r\n ]\r\n },\r\n yAxis: {\r\n min: 0,\r\n max: 100,\r\n lineWidth: 0,\r\n tickPositions: []\r\n // title: { text: this.props.t('numberOfPMPs'), align: 'high' },\r\n // labels: { overflow: 'justify' }\r\n },\r\n colors: [constants.colors.textBlue, constants.colors.lightTeal],\r\n chart: {\r\n type: 'solidgauge',\r\n backgroundColor: 'transparent',\r\n height: 235,\r\n width: 235\r\n },\r\n plotOptions: {\r\n solidgauge: {\r\n dataLabels: {\r\n enabled: false\r\n },\r\n linecap: 'round',\r\n stickyTracking: false,\r\n rounded: true\r\n }\r\n },\r\n credits: {\r\n enabled: false\r\n },\r\n series: [\r\n {\r\n name: this.props.t('open'),\r\n data: this.getPMPData()?.data.open,\r\n type: 'solidgauge',\r\n cursor: 'pointer',\r\n events: {\r\n click: event => {\r\n this.props.setTableFilter({\r\n status: {\r\n value: `${workOrderStatusEnum.open}`,\r\n label: this.props.t('open')\r\n }\r\n });\r\n this.props.history.push('/pmp');\r\n }\r\n }\r\n },\r\n {\r\n name: this.props.t('closed'),\r\n data: this.getPMPData()?.data.closed,\r\n type: 'solidgauge',\r\n cursor: 'pointer',\r\n events: {\r\n click: event => {\r\n this.props.setTableFilter({\r\n status: {\r\n value: `${workOrderStatusEnum.complete}`,\r\n label: this.props.t('completed')\r\n }\r\n });\r\n this.props.history.push('/pmp');\r\n }\r\n }\r\n }\r\n ]\r\n });\r\n\r\n render() {\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n {this.getTitle()}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n {t('pmp.totalWorkOrders')}\r\n \r\n \r\n \r\n ({t('pmp.last90Days')})\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n

    Status Key

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

      Open

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

      Closed

      \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n
    \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * PMP Analytics Container\r\n */\r\n\r\nimport PMPAnalytics from './PMPAnalytics';\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\nimport queryString from 'query-string';\r\nimport { setTableFilter } from '../../actions/manageWorkOrderActions';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { IanalyticsPMP } from '../../models';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n pmp: IanalyticsPMP;\r\n}\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: Iprops & RouteComponentProps<{}>\r\n) => {\r\n const query = queryString.parse(ownProps.location.search);\r\n const selectedFacility =\r\n state.facilities[state.selectedFacilityID] || initialFacility;\r\n return {\r\n loading: selectIsLoading(state),\r\n isDemoMode: query.demo === 'true',\r\n selectedFacility\r\n };\r\n};\r\n\r\nexport const PMPAnalyticsContainer = withRouter(\r\n connect(mapStateToProps, { setTableFilter })(PMPAnalytics)\r\n);\r\n","import * as React from 'react';\r\n\r\nimport { IanalyticsQuote, Iuser } from '../../models';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Link } from 'react-router-dom';\r\nimport { TFunction } from 'i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport { CountUp } from 'countup.js';\r\nimport { mockAnalyticsQuote } from './mockAnalytics';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n quote: IanalyticsQuote;\r\n isDemoMode: boolean;\r\n showUnquotedLeads: boolean;\r\n user: Iuser;\r\n}\r\n\r\nexport default class QuoteAnalytics extends React.PureComponent {\r\n private totalRef = React.createRef();\r\n private unquotedRef = React.createRef();\r\n\r\n constructor(props: Iprops) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n this.startCountUp();\r\n }\r\n\r\n getSelected = (): IanalyticsQuote => {\r\n const { quote, isDemoMode } = this.props;\r\n if (isDemoMode) {\r\n return mockAnalyticsQuote;\r\n }\r\n return quote;\r\n };\r\n\r\n startCountUp = () => {\r\n if (this.totalRef.current && this.unquotedRef.current) {\r\n const selectedAnalyticsQuote = this.getSelected();\r\n const options = {\r\n useEasing: true\r\n };\r\n const totalCountUp = new CountUp(\r\n this.totalRef.current,\r\n selectedAnalyticsQuote.total,\r\n options\r\n );\r\n const unquotedCountUp = new CountUp(\r\n this.unquotedRef.current,\r\n selectedAnalyticsQuote.unquotedLeads,\r\n options\r\n );\r\n setTimeout(() => {\r\n totalCountUp.start();\r\n unquotedCountUp.start();\r\n }, 750);\r\n }\r\n };\r\n\r\n // link to dashboard quotes if has customer quote SF. If not then sales quotes\r\n getQuotesLink = () => {\r\n if (\r\n constants.hasSecurityFunction(this.props.user, [\r\n constants.securityFunctions.ManageCustomerQuotes.id\r\n ])\r\n ) {\r\n return '/quotes';\r\n } else {\r\n return '/quotes_sales';\r\n }\r\n };\r\n render() {\r\n const { t } = this.props;\r\n const selectedAnalyticsQuote = this.getSelected();\r\n return (\r\n
    \r\n \r\n \r\n \r\n {this.props.t('analyticsWidget.title')}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n {t('analyticsWidget.totalQuotes')}\r\n \r\n

    \r\n
    \r\n \r\n \r\n {t('analyticsWidget.totalUnquotedLeads')}\r\n \r\n

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

    {t('analyticsWidget.new')}

    \r\n {selectedAnalyticsQuote.new}\r\n
    \r\n
    \r\n

    {t('analyticsWidget.approved')}

    \r\n {selectedAnalyticsQuote.approved}\r\n
    \r\n \r\n

    {t('analyticsWidget.inProgress')}

    \r\n {selectedAnalyticsQuote.inProgress}\r\n
    \r\n
    \r\n

    {t('analyticsWidget.rejected')}

    \r\n {selectedAnalyticsQuote.rejected}\r\n
    \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * Quote Analytics Container\r\n */\r\n\r\nimport QuoteAnalytics from './QuoteAnalytics';\r\nimport { connect } from 'react-redux';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\nimport queryString from 'query-string';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { constants } from '../../constants/constants';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: RouteComponentProps<{}> & WithTranslation\r\n) => {\r\n const { user } = state;\r\n const query = queryString.parse(ownProps.location.search);\r\n\r\n const showUnquotedLeads = constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.SalesAdmin.id,\r\n constants.securityFunctions.SalesInstallation.id,\r\n constants.securityFunctions.SalesManager.id,\r\n constants.securityFunctions.SalesParts.id,\r\n constants.securityFunctions.SalesService.id\r\n ]);\r\n return {\r\n loading: selectIsLoading(state),\r\n isDemoMode: query.demo === 'true',\r\n showUnquotedLeads,\r\n user: state.user\r\n };\r\n};\r\n\r\nexport const QuoteAnalyticsContainer = withTranslation('manageQuotes')(\r\n withRouter(connect(mapStateToProps, {})(QuoteAnalytics))\r\n);\r\n","import * as React from 'react';\r\n\r\ninterface Iprops {\r\n label: string;\r\n value: string;\r\n unitMeasurement: string;\r\n slim?: boolean;\r\n}\r\n\r\nconst HourCard = ({ label, value, unitMeasurement, slim = false }: Iprops) => (\r\n
    \r\n
    \r\n

    {label}

    \r\n

    {unitMeasurement}

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

    {Number(value).toLocaleString('en-US')}

    \r\n

    {unitMeasurement}

    \r\n
    \r\n
    \r\n);\r\n\r\nexport default HourCard;\r\n","import * as React from 'react';\r\n\r\ninterface Iprops {\r\n color: string;\r\n backgroundColor: string;\r\n label: string;\r\n value: string;\r\n unitMeasurement: string;\r\n}\r\n\r\nconst UnitCard = ({\r\n color,\r\n backgroundColor,\r\n label,\r\n value,\r\n unitMeasurement\r\n}: Iprops) => (\r\n \r\n
    \r\n

    \r\n {label}\r\n

    \r\n
    \r\n

    {`${value} ${unitMeasurement}`}

    \r\n \r\n);\r\n\r\nexport default UnitCard;\r\n","import { CSSObject } from 'highcharts';\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\n\r\nimport {\r\n IchartBar,\r\n IchartGuage,\r\n IchartLine,\r\n IdataFormatPreference\r\n} from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { dataUnitEnum } from '../../models-enums';\r\nimport { floatTrim } from './Analytics/AnalyticsCard';\r\nimport { initialChart } from '../../reducers/initialState';\r\n\r\nconst barLineLabelStyle: CSSObject = {\r\n color: '#a1acb3',\r\n fill: '#a1acb3'\r\n};\r\n\r\nexport const trimmedData = (\r\n data: (number | [string | number, number | null] | null)[]\r\n) =>\r\n data.map(value => {\r\n if (Array.isArray(value)) {\r\n return value.map(val =>\r\n typeof val === 'number' ? floatTrim(val) : value\r\n );\r\n }\r\n\r\n return value ? floatTrim(value) : value;\r\n });\r\n\r\nexport const getLastWeekDays = (data: Date) => {\r\n const lastWeekDays = [];\r\n const lastWeek = moment(data).subtract(7, 'days');\r\n\r\n for (let i = 0; i < 7; i++) {\r\n lastWeekDays.push(lastWeek.add(1, 'days').format('ddd'));\r\n }\r\n\r\n return lastWeekDays;\r\n};\r\n\r\n/**\r\n *\r\n ********************** GET UPDATED CHART DATA\r\n * used for setting chart options that will change based on chart data\r\n */\r\n\r\nexport const getBarChartOptions = (\r\n t: TFunction,\r\n dataFormatPreference: IdataFormatPreference,\r\n chart: IchartBar = initialChart,\r\n categories: string[] = []\r\n): Highcharts.Options => {\r\n const { data, unit } = chart;\r\n\r\n return {\r\n series: [{ data, type: 'column', name: '1' }],\r\n title: {\r\n text: ''\r\n },\r\n yAxis: {\r\n labels: {\r\n style: barLineLabelStyle\r\n },\r\n title: {\r\n text: `Temperature in ${t(`units:${dataUnitEnum[unit]}`)}`,\r\n style: barLineLabelStyle\r\n }\r\n },\r\n xAxis: {\r\n categories\r\n }\r\n };\r\n};\r\n\r\nexport const getLineChartOptions = (\r\n t: TFunction,\r\n dataFormatPreference: IdataFormatPreference,\r\n chart: IchartLine = initialChart\r\n): Highcharts.Options => {\r\n const { data, unit } = chart;\r\n const date = new Date();\r\n const categories = getLastWeekDays(date);\r\n const fmtData = (data as number[]).map((value, index) => [\r\n categories[index],\r\n value\r\n ]);\r\n\r\n return {\r\n series: [{ data: fmtData, type: 'spline' }],\r\n title: {\r\n text: ''\r\n },\r\n tooltip: {\r\n formatter() {\r\n return `${this.point.y}`;\r\n }\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n yAxis: {\r\n labels: {\r\n style: barLineLabelStyle\r\n },\r\n title: {\r\n text: `Temperature in ${t(`units:${dataUnitEnum[unit]}`)}`,\r\n style: barLineLabelStyle\r\n }\r\n },\r\n xAxis: {\r\n categories\r\n }\r\n };\r\n};\r\n\r\nexport const getGuageChartOptions = (\r\n t: TFunction,\r\n dataFormatPreference: IdataFormatPreference,\r\n guage: IchartGuage | undefined = initialChart\r\n): Highcharts.Options => {\r\n const { data, unit } = guage;\r\n const label = t(\r\n `dashboardAnalytics:unitsMeasurement:${dataUnitEnum[unit]}`\r\n );\r\n const isDegree =\r\n unit === dataUnitEnum.Celsius || unit === dataUnitEnum.Fahrenheit;\r\n const degree = isDegree ? '°' : '';\r\n\r\n return {\r\n series: [\r\n {\r\n data: trimmedData(\r\n unit === dataUnitEnum.PPM\r\n ? data.map((value: any) => value * 1000000)\r\n : data\r\n ),\r\n type: 'solidgauge',\r\n dataLabels: {\r\n formatter() {\r\n return `\r\n
    \r\n ${this.y}${degree}\r\n ${label}\r\n
    \r\n `;\r\n }\r\n }\r\n }\r\n ],\r\n yAxis: {\r\n min: floatTrim(guage.min!),\r\n max: floatTrim(guage.max!),\r\n labels: {\r\n style: {\r\n color: 'rgba(0, 0, 0, 0.6)',\r\n fill: 'rgba(0, 0, 0, 0.6)',\r\n fontSize: '12px',\r\n fontWeight: 'bold',\r\n opacity: 0.6\r\n },\r\n y: 0\r\n }\r\n },\r\n title: {\r\n text: guage.label\r\n }\r\n };\r\n};\r\n\r\n/**\r\n *\r\n ********************* GET DEFAULT CHART DATA\r\n * Used for setting chart options that will not change\r\n */\r\n\r\nexport const getBarChartOptionsDefault = ({\r\n t,\r\n fill = '#7cb5ec'\r\n}: {\r\n t: TFunction;\r\n fill?: string;\r\n}): Highcharts.Options => {\r\n return {\r\n title: {\r\n text: 'Running Hrs',\r\n align: 'left',\r\n style: {\r\n fontWeight: '700',\r\n textTransform: 'uppercase',\r\n fontSize: '14px'\r\n }\r\n },\r\n xAxis: {\r\n labels: {\r\n style: barLineLabelStyle\r\n }\r\n },\r\n yAxis: {\r\n min: 0,\r\n labels: {\r\n overflow: 'justify'\r\n },\r\n title: {\r\n align: 'high'\r\n }\r\n },\r\n tooltip: {\r\n formatter() {\r\n return `${this.point.y}`;\r\n }\r\n },\r\n chart: {\r\n type: 'column',\r\n backgroundColor: '',\r\n height: '300px'\r\n },\r\n credits: {\r\n enabled: false\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n series: [\r\n {\r\n type: 'column',\r\n dataLabels: { enabled: false },\r\n maxPointWidth: 24,\r\n data: [] // pass an empty array initially because we use component state in order to build the data\r\n }\r\n ]\r\n };\r\n};\r\n\r\nexport const getLineChartOptionsDefault = ({\r\n t\r\n}: {\r\n t: TFunction;\r\n}): Highcharts.Options => {\r\n return {\r\n title: {\r\n text: '',\r\n style: {\r\n fontWeight: '700',\r\n textTransform: 'uppercase',\r\n fontSize: '14px'\r\n }\r\n },\r\n subtitle: {\r\n text: '',\r\n style: {\r\n color: constants.colors.grey\r\n }\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n dateTimeLabelFormats: {\r\n day: '%b %e'\r\n },\r\n labels: {\r\n style: barLineLabelStyle\r\n }\r\n },\r\n yAxis: {\r\n min: 0,\r\n title: { align: 'high' },\r\n labels: {\r\n overflow: 'justify'\r\n }\r\n },\r\n tooltip: {\r\n formatter() {\r\n return `${this.point.y} on ${moment(this.x, 'x').format(\r\n 'DD-MMM-YY'\r\n )}`;\r\n }\r\n },\r\n chart: {\r\n type: 'spline',\r\n backgroundColor: '',\r\n height: '250px'\r\n },\r\n credits: {\r\n enabled: false\r\n },\r\n legend: {\r\n itemStyle: {\r\n color: constants.colors.darkGreyText,\r\n fontSize: '.9em'\r\n }\r\n },\r\n series: [\r\n {\r\n type: 'spline',\r\n dataLabels: { enabled: false },\r\n color: constants.colors.orange,\r\n data: [] // pass an empty array initially because we use component state in order to build the data\r\n }\r\n ],\r\n plotOptions: {\r\n // series: {\r\n // marker: {\r\n // radius: 4,\r\n // enabled: true\r\n // }\r\n // }\r\n spline: {\r\n marker: {\r\n radius: 4,\r\n // lineColor: constants.colors.orange,\r\n lineWidth: 1\r\n }\r\n }\r\n }\r\n };\r\n};\r\n\r\nexport const getGuageChartOptionsDefault = ({\r\n t,\r\n fill = '#7cb5ec'\r\n}: {\r\n t: TFunction;\r\n fill?: string;\r\n}): Highcharts.Options => {\r\n return {\r\n colors: [fill],\r\n title: {\r\n text: '',\r\n align: 'left',\r\n style: {\r\n fontWeight: '700',\r\n textTransform: 'uppercase',\r\n fontSize: '12px'\r\n }\r\n },\r\n chart: {\r\n type: 'solidgauge',\r\n height: '170px'\r\n },\r\n pane: {\r\n center: ['50%', '50%'],\r\n size: '100%',\r\n startAngle: -90,\r\n endAngle: 90,\r\n background: [\r\n {\r\n backgroundColor: '#EEE',\r\n innerRadius: '60%',\r\n outerRadius: '100%',\r\n shape: 'arc'\r\n }\r\n ]\r\n },\r\n exporting: {\r\n enabled: false\r\n },\r\n tooltip: {\r\n enabled: false\r\n },\r\n // the value axis\r\n yAxis: {\r\n lineWidth: 0,\r\n min: 0,\r\n max: 100,\r\n tickWidth: 0,\r\n minorTickInterval: null,\r\n tickAmount: 2,\r\n labels: {\r\n distance: '80%',\r\n y: 16\r\n }\r\n },\r\n plotOptions: {\r\n solidgauge: {\r\n color: fill,\r\n dataLabels: {\r\n y: 0,\r\n borderWidth: 0,\r\n useHTML: true\r\n }\r\n }\r\n },\r\n credits: {\r\n enabled: false\r\n },\r\n series: [\r\n {\r\n type: 'solidgauge',\r\n data: []\r\n }\r\n ]\r\n };\r\n};\r\n","/**\r\n * Checks if the given string value is a float.\r\n * @function\r\n *\r\n * @param val - possible float\r\n * @returns {boolean} - true if value is float\r\n */\r\nexport const isStrFloat = (val: string): boolean => {\r\n let newVal: any = val;\r\n newVal = parseFloat(val);\r\n\r\n return !isNaN(newVal);\r\n};\r\n\r\n/**\r\n * Checks if the given value is a float or integer.\r\n * @function\r\n *\r\n * @param val - possible float\r\n * @returns {boolean} - true if value is float\r\n */\r\nexport const isFloat = (num: number) => Number(num) === num && num % 1 !== 0;\r\n","// create a react functional component with typescript to use for toggling between two states\r\nimport React from 'react';\r\n\r\ninterface Props {\r\n isToggled: boolean;\r\n onToggle: () => void;\r\n}\r\n\r\nexport const AnalyticsToggle = ({ isToggled, onToggle }: Props) => (\r\n \r\n Open Modal\r\n \r\n \r\n \r\n \r\n);\r\n","import * as React from 'react';\r\nimport * as Highcharts from 'highcharts';\r\n\r\nimport HighchartsReact from 'highcharts-react-official';\r\nimport moment from 'moment';\r\nimport { Button } from 'react-bootstrap';\r\nimport { Link, match } from 'react-router-dom';\r\nimport { TFunction } from 'i18next';\r\n\r\nimport Alert from '../../../images/alert.svg';\r\nimport HourCard from './HourCard';\r\nimport UnitCard from './UnitCard';\r\nimport { IanalyticsTAEDashboard, IdataFormatPreference } from '../../../models';\r\nimport {\r\n dataUnitEnum,\r\n GraphType,\r\n OperatingMode,\r\n RunStatus\r\n} from '../../../models-enums';\r\nimport {\r\n getGuageChartOptions,\r\n getGuageChartOptionsDefault\r\n} from '../Utilities';\r\nimport { isFloat } from '../../../helpers/isFloat';\r\nimport { roundTo } from '../../../helpers/roundTo';\r\nimport { AnalyticsToggle } from './AnalyticsToggle';\r\nimport AssetImage from '../../common/AssetImage';\r\nimport { constants } from '../../../constants/constants';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n data: IanalyticsTAEDashboard;\r\n dataFormatPreference: IdataFormatPreference;\r\n isDemoMode: boolean;\r\n match: match;\r\n}\r\n\r\nexport const floatTrim = (value: number) =>\r\n isFloat(value) ? roundTo(value, 2) : value;\r\n\r\nexport const dataThreshold = (\r\n data: number,\r\n limits: { [key: string]: number },\r\n dataPoint: string\r\n): string => {\r\n if (dataPoint === '509') {\r\n switch (true) {\r\n case data <= limits.min:\r\n return '#007BC3';\r\n case data > limits.min && data < limits.high:\r\n return '#D20404';\r\n default:\r\n return '#7FC467';\r\n }\r\n } else {\r\n switch (true) {\r\n case data <= limits.min:\r\n return '#007BC3';\r\n case data > limits.min && data <= limits.high:\r\n return '#7FC467';\r\n default:\r\n return '#D20404';\r\n }\r\n }\r\n};\r\n\r\nconst AnalyticsCard = (props: Iprops) => {\r\n const { data, dataFormatPreference, isDemoMode, t } = props;\r\n const guages = data.primaryData.filter(\r\n guage => guage.graphType === GraphType.Guague\r\n );\r\n const units = data.primaryData.filter(\r\n guage => guage.graphType === GraphType.UnitPrimary\r\n );\r\n const hours = data.primaryData.filter(\r\n guage => guage.graphType === GraphType.Numeric\r\n );\r\n const [toggleState, setToggleState] = React.useState(false);\r\n const toggleCallback = React.useCallback(() => {\r\n setToggleState(!toggleState);\r\n }, [toggleState]);\r\n\r\n if (!data) {\r\n return null;\r\n }\r\n\r\n return (\r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n {`${t('updated')}: ${moment(\r\n data.updateDate || new Date()\r\n ).format('hh:mm a, DD-MMM-YY')}`}\r\n

    \r\n {data.alarmCount > 0 ? (\r\n
    \r\n \r\n

    {`${data.alarmCount} ${\r\n data.alarmCount > 1\r\n ? t('alarms')\r\n : t('alarm')\r\n }`}

    \r\n
    \r\n ) : null}\r\n
    \r\n
    \r\n

    {data.installBaseName}

    \r\n

    {data.installBaseSerialNumber}

    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n {guages.map(chartData => {\r\n const fill = dataThreshold(\r\n chartData.data[0],\r\n {\r\n min: chartData.min,\r\n medium: chartData.medium,\r\n high: chartData.high\r\n },\r\n chartData.pointNumber\r\n );\r\n\r\n return (\r\n \r\n \r\n
    \r\n

    \r\n {floatTrim(chartData.min)}\r\n

    \r\n

    \r\n {floatTrim(chartData.max)}\r\n

    \r\n
    \r\n
    \r\n );\r\n })}\r\n
    \r\n
    \r\n {units.map(unitItem => {\r\n const currentOperatingMode =\r\n unitItem.operatingMode;\r\n let color = constants.colors.smartLinkYellow;\r\n let backgroundColor =\r\n constants.colors.smartLinkYellowLight;\r\n if (\r\n currentOperatingMode === OperatingMode.Off\r\n ) {\r\n color = constants.colors.smartLinkRed;\r\n backgroundColor =\r\n constants.colors.smartLinkRedLight;\r\n } else if (\r\n currentOperatingMode ===\r\n OperatingMode.Automatic\r\n ) {\r\n color = constants.colors.smartLinkBlue;\r\n backgroundColor =\r\n constants.colors.smartLinkBlueLight;\r\n }\r\n\r\n const label = unitItem.label.replace(\r\n /.*\\s([0-9]+)$/g,\r\n 'Unit $1'\r\n );\r\n\r\n return (\r\n \r\n );\r\n })}\r\n
    \r\n
    \r\n {hours.map((hourItem, index) => (\r\n \r\n ))}\r\n
    \r\n
    \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AnalyticsCard;\r\n","/**\r\n * Safe number rounding. toFixed alternative, which will round up or down for you depending on the values beyond 2 decimals.\r\n * @function\r\n *\r\n * @param {number} num number to trim\r\n * @param {number} dig amount of digits trimmed to\r\n *\r\n * @return {number} trimmed value\r\n */\r\nexport const roundTo = (num: number, dig: number): number => {\r\n let negative = false;\r\n let number: number | string = num;\r\n let digits: number = dig;\r\n\r\n if (dig === undefined) {\r\n digits = 0;\r\n }\r\n\r\n if (num < 0) {\r\n negative = true;\r\n number *= -1;\r\n }\r\n\r\n const multiplicator: number = 10 ** digits;\r\n number = parseFloat((number * multiplicator).toFixed(11));\r\n number = (Math.round(number) / multiplicator).toFixed(digits);\r\n\r\n if (negative) {\r\n number = (((number as unknown) as number) * -1).toFixed(digits);\r\n }\r\n\r\n return parseFloat(number);\r\n};\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport {\r\n IdashboardAnalyticsData,\r\n IdashboardAnalyticsReducer,\r\n IanalyticsTAE,\r\n Ioption,\r\n IanalyticsSmartlink,\r\n IdataFormatPreference\r\n} from '../models';\r\n\r\nimport initialState, {\r\n initialAnalyticsSmartlink,\r\n initialAnalyticsTAE\r\n} from './initialState';\r\nimport { find, pickBy } from 'lodash';\r\nimport { createSelector } from 'reselect';\r\nimport { IinitialState } from '.';\r\nimport { dataFormatTemperatureEnum } from '../models-enums';\r\nimport { constants } from '../constants/constants';\r\n\r\nconst cleanDashboardAnalyticsData = (\r\n dashboardAnalyticsData: any\r\n): IdashboardAnalyticsData => {\r\n return {\r\n ...initialState.dashboardAnalytics.data,\r\n ...pickBy(dashboardAnalyticsData, property => property !== null)\r\n } as IdashboardAnalyticsData;\r\n};\r\n\r\n/** ** SELECTORS */\r\n\r\nconst getCurrentUser = (state: IinitialState) => state.user;\r\nconst getDashboardAnalyticsData = (state: IinitialState) =>\r\n state.dashboardAnalytics.data;\r\nconst getIsDemoModeProp = (\r\n state: IinitialState,\r\n props: { isDemoMode: boolean }\r\n) => props.isDemoMode;\r\n\r\nconst getInstallBaseIdProp = (\r\n state: IinitialState,\r\n props: { installBaseID: string }\r\n) => props.installBaseID;\r\n\r\nexport const selectDashboardAnalytics = createSelector(\r\n [getDashboardAnalyticsData, getCurrentUser, getIsDemoModeProp],\r\n (dashboardAnalyticsData, user, isDemoMode): IdashboardAnalyticsData => {\r\n const updatedDashboardAnalyticsData: IdashboardAnalyticsData = dashboardAnalyticsData;\r\n\r\n return {\r\n ...updatedDashboardAnalyticsData,\r\n // the value for gas type comes back with surrounding spaces, cleaning up before handing off to the component\r\n tae: dashboardAnalyticsData.tae.map(taeItem => ({\r\n ...taeItem,\r\n gasType: taeItem.gasType?.replace(/^\\s([a-zA-Z0-9]+)\\s$/g, '$1')\r\n }))\r\n };\r\n }\r\n);\r\n\r\n// export const selectAnalyticsDetailsForInstall = createSelector(\r\n// [selectDashboardAnalytics, getInstallBaseIdProp],\r\n// (\r\n// dashboardAnalytics,\r\n// installBaseID\r\n// ): IanalyticsTAE | IanalyticsSmartlink => {\r\n// const allSmartAnalytics = [\r\n// ...dashboardAnalytics.smartlinks,\r\n// ...dashboardAnalytics.tae\r\n// ];\r\n// return (\r\n// find(allSmartAnalytics, { installBaseID }) ||\r\n// initialAnalyticsSmartlink\r\n// ); // it is safe to assume there will only be 1\r\n// }\r\n// );\r\n\r\nexport const selectAnalyticsDetailsSmartlinkForInstall = createSelector(\r\n [selectDashboardAnalytics, getInstallBaseIdProp],\r\n (dashboardAnalytics, installBaseID) => {\r\n return (\r\n find(dashboardAnalytics.smartlinks, { installBaseID }) ||\r\n initialAnalyticsSmartlink\r\n ); // it is safe to assume there will only be 1\r\n }\r\n);\r\n\r\nexport const selectAnalyticsDetailsTaeForInstall = createSelector(\r\n [selectDashboardAnalytics, getInstallBaseIdProp],\r\n (dashboardAnalytics, installBaseID): IanalyticsTAE => {\r\n return (\r\n find(dashboardAnalytics.tae, { installBaseID }) ||\r\n initialAnalyticsTAE\r\n ); // it is safe to assume there will only be 1\r\n }\r\n);\r\n\r\nexport const selectDataFormatPreference = createSelector(\r\n [getCurrentUser],\r\n (user): IdataFormatPreference => {\r\n const isUSA = constants.usCountryID === user.countryID;\r\n return {\r\n temperature: isUSA\r\n ? dataFormatTemperatureEnum.fahrenheit\r\n : dataFormatTemperatureEnum.celcius\r\n };\r\n }\r\n);\r\n\r\n/** ** REDUCERS */\r\n\r\nfunction dashboardData(\r\n state: IdashboardAnalyticsData = initialState.dashboardAnalytics.data,\r\n action: any\r\n): IdashboardAnalyticsData {\r\n switch (action.type) {\r\n case types.GET_DASHBOARD_ANALYTICS_SUCCESS:\r\n return cleanDashboardAnalyticsData(action.payload);\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.dashboardAnalytics.data;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport default function dashboardAnalyticsReducer(\r\n state: IdashboardAnalyticsReducer = initialState.dashboardAnalytics,\r\n action: any\r\n) {\r\n return {\r\n data: dashboardData(state.data, action)\r\n\r\n // tableFilters: createTableFiltersWithName(\r\n // state.tableFilters,\r\n // action,\r\n // 'MANAGE_JOB'\r\n // )\r\n };\r\n}\r\n/*\r\n * SELECTORS\r\n */\r\n\r\n// build the install base options from the TAE's\r\nexport const getTaeInstallBaseOptions = (state: IdashboardAnalyticsReducer) => {\r\n const analyticsTae = state.data.tae;\r\n let installBaseOptions: Ioption[] = [];\r\n if (analyticsTae.length) {\r\n analyticsTae.forEach(item => {\r\n installBaseOptions = [\r\n ...installBaseOptions,\r\n { value: item.installBaseID, label: item.installBaseName }\r\n ];\r\n });\r\n }\r\n return installBaseOptions;\r\n};\r\n\r\nexport const getTaeInstallBasesFrom = (state: IdashboardAnalyticsReducer) => {\r\n const analyticsTae = state.data.tae;\r\n let installBases: Partial[] = [];\r\n if (analyticsTae.length) {\r\n analyticsTae.forEach(item => {\r\n installBases = [\r\n ...installBases,\r\n {\r\n installBaseID: item.installBaseID,\r\n installBaseLocation: item.installBaseLocation,\r\n installBaseName: item.installBaseName\r\n }\r\n ];\r\n });\r\n }\r\n return installBases;\r\n};\r\nexport const getSmartlinkInstallBaseOptions = (\r\n state: IdashboardAnalyticsReducer\r\n) => {\r\n const analytics = state.data.smartlinks;\r\n let installBaseOptions: Ioption[] = [];\r\n if (analytics.length) {\r\n analytics.forEach(item => {\r\n installBaseOptions = [\r\n ...installBaseOptions,\r\n {\r\n value: item.installBaseID,\r\n label: `${item.installBaseName}: ${item.installBaseSerialNumber}`\r\n }\r\n ];\r\n });\r\n }\r\n return installBaseOptions;\r\n};\r\n\r\nexport const getSmartlinkInstallBases = (state: IdashboardAnalyticsReducer) => {\r\n const analytics = state.data.smartlinks;\r\n let installBases: Partial[] = [];\r\n if (analytics.length) {\r\n analytics.forEach(item => {\r\n installBases = [\r\n ...installBases,\r\n {\r\n installBaseID: item.installBaseID,\r\n installBaseLocation: item.installBaseLocation,\r\n installBaseName: item.installBaseName\r\n }\r\n ];\r\n });\r\n }\r\n return installBases;\r\n};\r\n","/*\r\n * Analytics Card Container\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\nimport queryString from 'query-string';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport { IinitialState } from '../../../reducers';\r\nimport AnalyticsCard from './AnalyticsCard';\r\nimport { selectDataFormatPreference } from '../../../reducers/dashboardAnalyticsReducer';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: RouteComponentProps<{}> & WithTranslation\r\n) => {\r\n const { selectedFacilityID, user } = state;\r\n const { securityFunctions } = user;\r\n const query = queryString.parse(ownProps.location.search);\r\n const dataFormatPreference = selectDataFormatPreference(state);\r\n\r\n return {\r\n selectedFacilityID,\r\n securityFunctions,\r\n loading: selectIsLoading(state),\r\n isDemoMode: query.demo === 'true',\r\n dataFormatPreference\r\n };\r\n};\r\n\r\nexport const AnalyticsCardContainer = withTranslation('dashboardAnalytics')(\r\n withRouter(connect(mapStateToProps, {})(AnalyticsCard))\r\n);\r\n","/*\r\n * Dashboard Analytics\r\n * Loop over the user's security functions and find which analytics modules they have access to\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport { IdashboardAnalyticsData, Ifacility, Iuser } from '../../models';\r\nimport { InstallBaseAnalyticsContainer } from './InstallBaseAnalyticsContainer';\r\nimport { PMPAnalyticsContainer } from './PMPAnalyticsContainer';\r\nimport { QuoteAnalyticsContainer } from './QuoteAnalyticsContainer';\r\nimport { constants } from '../../constants/constants';\r\nimport { initInventory } from '../../actions/manageInventoryActions';\r\nimport { AnalyticsCardContainer } from './Analytics/AnalyticsCardContainer';\r\n\r\ninterface Iprops {\r\n dashboardAnalytics: IdashboardAnalyticsData;\r\n selectedFacilityID: string;\r\n selectedFacility: Ifacility;\r\n user: Iuser;\r\n initInventory: typeof initInventory;\r\n}\r\n\r\nconst DashboardAnalyticsFunc = (props: Iprops & WithTranslation) => {\r\n const prevProps = React.useRef<(Iprops & WithTranslation) | undefined>();\r\n const { dashboardAnalytics, selectedFacilityID, t, user } = props;\r\n\r\n React.useEffect(() => {\r\n // assign the ref's current value to the props object\r\n prevProps.current = props;\r\n }, [props]);\r\n\r\n const shouldShowInstallBaseAnalytics = () => {\r\n return constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.DashboardInspection.id\r\n ]);\r\n };\r\n\r\n const shouldShowPMPAnalytics = () => {\r\n return constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.DashboardPMP.id\r\n ]);\r\n };\r\n\r\n const shouldShowTAEAnalytics = () => {\r\n const isUsFacility =\r\n props.selectedFacility.standardID === constants.defaultStandardUS;\r\n const hasDashboardTAESecurity = constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.DashboardTAE.id\r\n ]);\r\n\r\n return isUsFacility && hasDashboardTAESecurity;\r\n };\r\n\r\n const shouldShowQuoteAnalytics = () => {\r\n return constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.DashboardQuote.id\r\n ]);\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const shouldShowsmartlinksAnalytics = () => {\r\n const hasDashboardsmartlinkSecurity = constants.hasSecurityFunction(\r\n user,\r\n [constants.securityFunctions.DashboardSmartlinks.id]\r\n );\r\n\r\n return hasDashboardsmartlinkSecurity;\r\n };\r\n\r\n const shouldShowDashboardAnalytics = () => {\r\n return (\r\n shouldShowInstallBaseAnalytics() ||\r\n shouldShowPMPAnalytics() ||\r\n shouldShowTAEAnalytics() ||\r\n shouldShowQuoteAnalytics()\r\n );\r\n };\r\n\r\n React.useEffect(() => {\r\n if (\r\n prevProps?.current?.selectedFacilityID !== selectedFacilityID &&\r\n selectedFacilityID &&\r\n shouldShowDashboardAnalytics()\r\n ) {\r\n // Needed for TAEDetail\r\n props.initInventory(selectedFacilityID, () => {\r\n return;\r\n });\r\n }\r\n }, [selectedFacilityID]);\r\n\r\n if (shouldShowDashboardAnalytics() === false) {\r\n return null;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {shouldShowInstallBaseAnalytics() && (\r\n \r\n )}\r\n {shouldShowPMPAnalytics() && (\r\n \r\n )}\r\n {shouldShowQuoteAnalytics() && (\r\n \r\n )}\r\n \r\n \r\n {dashboardAnalytics?.smartlinks?.map((smartlink, index) => (\r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\n\r\nexport const DashboardAnalyticsLayout = withTranslation('dashboardAnalytics')(\r\n DashboardAnalyticsFunc\r\n);\r\n","/*\r\n * Dashboard Analytics Container\r\n */\r\n\r\nimport { DashboardAnalyticsLayout } from './DashboardAnalyticsLayout';\r\nimport { TFunction } from 'i18next';\r\nimport { connect } from 'react-redux';\r\nimport { initialFacility } from '../../reducers/initialState';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport queryString from 'query-string';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { initInventory } from '../../actions/manageInventoryActions';\r\nimport { IdashboardAnalyticsData } from '../../models';\r\n\r\ninterface Iprops extends RouteComponentProps<{}> {\r\n t: TFunction;\r\n dashboardAnalytics: IdashboardAnalyticsData;\r\n showAnalytics?: boolean;\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const { selectedFacilityID, user, productInfo, facilities } = state;\r\n const query = queryString.parse(ownProps.location.search);\r\n\r\n return {\r\n selectedFacilityID,\r\n user,\r\n loading: selectIsLoading(state),\r\n mainCategories: productInfo.mainCategories,\r\n mainCategoryOptions: productInfo.mainCategoryOptions,\r\n selectedFacility: facilities[selectedFacilityID] || initialFacility,\r\n isDemoMode: query.demo === 'true'\r\n };\r\n};\r\n\r\nexport const DashboardAnalyticsContainer = connect(mapStateToProps, {\r\n initInventory\r\n})(DashboardAnalyticsLayout);\r\n","import { pickBy, map } from 'lodash';\r\n\r\nimport { Ireport, ImanageReportReducer, IdefaultReport } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { initialReport } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { keyBy } from 'lodash';\r\nimport { reportTypeEnum } from '../models-enums';\r\nimport { combineReducers } from 'redux';\r\n\r\n/*\r\n * defaultReports are received from the API and never updated client side\r\n */\r\n\r\nconst cleanDefaultReportObject = (defaultReport: IdefaultReport) => {\r\n return {\r\n ...pickBy(defaultReport, (property, key) => property !== null)\r\n } as IdefaultReport;\r\n};\r\n\r\nfunction defaultReportsByID(\r\n state: { [key: string]: IdefaultReport } = {},\r\n action: any\r\n): { [key: string]: IdefaultReport } {\r\n switch (action.type) {\r\n case types.REPORT_MANAGE_GET_DEFAULT_SUCCESS: {\r\n const newData = map(\r\n action.reports,\r\n (defaultReport: IdefaultReport) => {\r\n return cleanDefaultReportObject(defaultReport);\r\n }\r\n );\r\n return keyBy(newData, 'id');\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n * use this reducer if and when we do CRUD for reports\r\n * when we do, don't forget to update the selectedReport with what is received\r\n */\r\n// function manageDataReducer(\r\n// state: { [key: string]: Ireport } = {},\r\n// action: any\r\n// ): { [key: string]: Ireport } {\r\n// switch (action.type) {\r\n// case types.REPORT_MANAGE_SUCCESS:\r\n// const newData = map(action.reports, (report: Ireport) => {\r\n// return cleanDefaultReportObject(report);\r\n// });\r\n// return keyBy(newData, 'id');\r\n\r\n// case types.REPORT_ADD_SUCCESS:\r\n// return { ...state, [action.report.id]: action.report };\r\n// case types.REPORT_UPDATE_SUCCESS:\r\n// return { ...state, [action.report.id]: cleanDefaultReportObject(action.report) };\r\n// case types.USER_LOGOUT_SUCCESS:\r\n// return {};\r\n// default:\r\n// return state;\r\n// }\r\n// }\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.REPORT_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction selectedReport(\r\n state: Ireport = initialReport,\r\n action: any\r\n): Ireport | any {\r\n switch (action.type) {\r\n case types.SET_SELECTED_REPORT:\r\n return action.job as Ireport;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/*\r\n * selected default report id reducer\r\n * TODO refactor this and historicalResultIDReducer into a common reducer that simply stores a string\r\n */\r\nconst selectedDefaultReportID = (state = '', action: any): string => {\r\n switch (action.type) {\r\n case types.SET_SELECTED_DEFAULT_REPORT_ID:\r\n return action.defaultReportID;\r\n case types.CLEAR_SELECTED_DEFAULT_REPORT_ID:\r\n return '';\r\n case types.USER_LOGOUT_SUCCESS:\r\n return '';\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport const manageReportReducer = combineReducers({\r\n defaultReportsByID,\r\n totalPages,\r\n showEditReportModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_REPORT'),\r\n selectedReport,\r\n selectedDefaultReportID,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_REPORT')\r\n});\r\n\r\n/*\r\n * SELECTORS\r\n */\r\n\r\n/*\r\n * is it a MeasurementPoint Based report or a Work order based report?\r\n */\r\nexport const isMeasurementPointBasedReport = (report: IdefaultReport) => {\r\n const { reportType } = report;\r\n if (\r\n reportType === reportTypeEnum.annualInspection ||\r\n reportType === reportTypeEnum.HTM ||\r\n reportType === reportTypeEnum.jobNotes ||\r\n reportType === reportTypeEnum.audit ||\r\n reportType === reportTypeEnum.verification\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nexport const getDefaultReportsReducer = (state: ImanageReportReducer) => {\r\n return state.defaultReportsByID;\r\n};\r\n","import * as React from 'react';\r\nimport { Link, RouteComponentProps } from 'react-router-dom';\r\nimport { TrackJS } from 'trackjs';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect, useSelector } from 'react-redux';\r\nimport { useQuery } from 'react-query';\r\nimport Masonry, { MasonryOptions } from 'react-masonry-component';\r\nimport queryString from 'query-string';\r\nimport { Oval } from 'react-loader-spinner';\r\n\r\nimport API from '../../constants/apiEndpoints';\r\nimport { Banner } from '../common/Banner';\r\nimport { DashboardAnalyticsContainer } from './DashboardAnalyticsContainer';\r\nimport { IdashboardAnalyticsData, Iuser } from '../../models';\r\nimport { IinitialState } from '../../reducers';\r\nimport { SelectFacilityContainer } from '../common/SelectFacilityContainer';\r\nimport { beginAjaxCall, endAjaxCall } from '../../actions/ajaxStatusActions';\r\nimport { constants } from '../../constants/constants';\r\nimport { filterDashboardAnalytics } from '../../helpers/reactQuery';\r\nimport { langOption } from '../../i18n';\r\nimport { msalFetch } from '../auth/Auth-Utils';\r\nimport { svgIcons } from '../../constants/svgIcons';\r\nimport { initInventory } from '../../actions/manageInventoryActions';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport { getDefaultReports } from '../../actions/manageReportActions';\r\nimport { use } from 'chai';\r\nimport { getDefaultReportsReducer } from '../../reducers/manageReportReducer';\r\n\r\nconst masonryOptions: MasonryOptions = {\r\n transitionDuration: 0\r\n};\r\nconst { tiles } = constants;\r\n\r\ninterface Iprops extends RouteComponentProps<{}> {\r\n user: Iuser;\r\n selectedFacilityID: string;\r\n isDemoMode: boolean;\r\n beginAjaxCall: typeof beginAjaxCall;\r\n endAjaxCall: typeof endAjaxCall;\r\n initInventory: typeof initInventory;\r\n getDefaultReports: typeof getDefaultReports;\r\n}\r\n\r\nconst Dashboard = (props: Iprops & WithTranslation) => {\r\n const isMobile = useSelector(getIsMobile);\r\n const reportDefaults = useSelector(getDefaultReportsReducer);\r\n const getDashboardAnalytics = async () => {\r\n // Facility ID is required for this API call\r\n if (\r\n props.selectedFacilityID === '' ||\r\n props.selectedFacilityID === undefined\r\n ) {\r\n return null;\r\n }\r\n\r\n props.beginAjaxCall();\r\n\r\n try {\r\n const response = await msalFetch(API.update.dashboard, {\r\n method: 'get',\r\n params: {\r\n facilityID: props.selectedFacilityID\r\n }\r\n });\r\n\r\n if (!response.data) {\r\n throw new Error('missing data');\r\n } else {\r\n return response.data as IdashboardAnalyticsData;\r\n }\r\n } catch (error) {\r\n console.error('[Dashboard - getDashboardAnalytics]', error);\r\n // throw error;\r\n return null;\r\n } finally {\r\n props.endAjaxCall();\r\n }\r\n };\r\n const { data, error, isLoading, isError, refetch } = useQuery(\r\n ['analytics', props.selectedFacilityID],\r\n getDashboardAnalytics,\r\n {\r\n refetchOnWindowFocus: false\r\n }\r\n );\r\n const [dashboardAnalytics, setDashboardAnalytics] = React.useState<\r\n IdashboardAnalyticsData | undefined\r\n >(data || undefined);\r\n const availableTiles = tiles.filter(\r\n tile =>\r\n constants.hasSecurityFunction(props.user, tile.securityFunctions) &&\r\n tile.shouldHideOnDashboard !== true\r\n );\r\n const tileElements = availableTiles.map(tile => {\r\n const { width, height, title, url, color, src, svgKey } = tile;\r\n const styles = {\r\n width,\r\n height\r\n };\r\n\r\n if (isMobile) {\r\n return (\r\n \r\n \r\n
    \r\n \"\"\r\n \r\n {svgKey !== undefined &&\r\n svgIcons[svgKey as keyof typeof svgIcons]}\r\n {props.t(title)}\r\n \r\n
    \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n
    \r\n \r\n
    \r\n \"\"\r\n \r\n {svgKey !== undefined &&\r\n svgIcons[svgKey as keyof typeof svgIcons]}\r\n {props.t(title)}\r\n \r\n
    \r\n \r\n
    \r\n );\r\n }\r\n });\r\n\r\n React.useEffect(() => {\r\n if (props.user.language !== undefined) {\r\n const userLang = langOption(props.user.language);\r\n\r\n if (userLang !== props.i18n.language) {\r\n props.i18n.changeLanguage(userLang);\r\n }\r\n }\r\n }, [props.user]);\r\n\r\n React.useEffect(() => {\r\n refetch();\r\n }, [props.user.tempUnits, props.user.pressureUnits]);\r\n\r\n React.useEffect(() => {\r\n if (\r\n data &&\r\n constants.hasSecurityFunction(props.user, [\r\n constants.securityFunctions.ViewInventory.id\r\n ])\r\n ) {\r\n props.initInventory('', () => {\r\n return;\r\n });\r\n const filteredData = filterDashboardAnalytics(\r\n data,\r\n props.user,\r\n props.isDemoMode\r\n );\r\n\r\n setDashboardAnalytics(filteredData);\r\n }\r\n }, [data]);\r\n\r\n React.useEffect(() => {\r\n // If there are no report defaults, then the Run Daily Reports button inside the AnalyticsExpandedCard will not work correctly\r\n if (\r\n reportDefaults === null ||\r\n reportDefaults === undefined ||\r\n Object.keys(reportDefaults).length === 0\r\n ) {\r\n props.getDefaultReports();\r\n }\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (isError) {\r\n constants.handleError(error, 'get dashboard analytics');\r\n TrackJS.track(error as Error);\r\n }\r\n }, [isError, error]);\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n {isLoading ? (\r\n \r\n \r\n
    \r\n ) : dashboardAnalytics ? (\r\n \r\n ) : null}\r\n\r\n {isMobile === false &&\r\n (!dashboardAnalytics?.smartlinks ||\r\n dashboardAnalytics?.smartlinks?.length === 0) &&\r\n !isLoading && (\r\n \r\n {tileElements}\r\n \r\n )}\r\n
    \r\n
    \r\n );\r\n};\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n const query = queryString.parse(ownProps.location.search);\r\n\r\n return {\r\n user: state.user,\r\n selectedFacilityID: state.selectedFacilityID,\r\n isDemoMode: query.demo === 'true'\r\n };\r\n};\r\n\r\nexport default withTranslation('tiles')(\r\n connect(mapStateToProps, {\r\n beginAjaxCall,\r\n endAjaxCall,\r\n initInventory,\r\n getDefaultReports\r\n })(Dashboard)\r\n);\r\n","import { IdashboardAnalyticsData, Iuser } from '../models';\r\n\r\nexport const filterDashboardAnalytics = (\r\n dashboardAnalyticsData: IdashboardAnalyticsData,\r\n user: Iuser,\r\n isDemoMode: boolean\r\n): IdashboardAnalyticsData => {\r\n const updatedDashboardAnalyticsData: IdashboardAnalyticsData = dashboardAnalyticsData;\r\n\r\n return {\r\n ...updatedDashboardAnalyticsData,\r\n // the value for gas type comes back with surrounding spaces, cleaning up before handing off to the component\r\n tae: dashboardAnalyticsData?.tae?.map(taeItem => ({\r\n ...taeItem,\r\n gasType: taeItem.gasType?.replace(/^\\s([a-zA-Z0-9]+)\\s$/g, '$1')\r\n }))\r\n };\r\n};\r\n","import * as types from './actionTypes';\r\n\r\nimport { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\nimport API from '../constants/apiEndpoints';\r\nimport { beginAjaxCall } from './ajaxStatusActions';\r\nimport { constants } from '../constants/constants';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport { ThunkResult } from '../models';\r\nimport { toastr } from 'react-redux-toastr';\r\n\r\n/*\r\n * get the analytics data for the dashboard\r\n */\r\nexport function getDashboardAnalytics(): ThunkResult {\r\n return (dispatch, getState) => {\r\n dispatch(beginAjaxCall());\r\n const { selectedFacilityID } = getState();\r\n if (selectedFacilityID.length === 0) {\r\n console.error('[getDashboardAnalytics]:', {\r\n selectedFacilityID,\r\n state: getState()\r\n });\r\n toastr.warning(\r\n 'Warning',\r\n 'Selected customer has 0 facilities.',\r\n constants.toastrWarning\r\n );\r\n }\r\n const axiosOptions: AxiosRequestConfig = {\r\n method: 'get',\r\n params: {\r\n facilityID: selectedFacilityID\r\n }\r\n };\r\n\r\n const url = API.update.dashboard;\r\n return msalFetch(url, axiosOptions)\r\n .then((data: AxiosResponse) => {\r\n if (!data.data) {\r\n throw new Error('missing data');\r\n } else {\r\n dispatch({\r\n type: types.GET_DASHBOARD_ANALYTICS_SUCCESS,\r\n payload: data.data\r\n });\r\n }\r\n })\r\n .catch((error: any) => {\r\n dispatch({\r\n type: types.GET_DASHBOARD_ANALYTICS_FAILED,\r\n error,\r\n axiosOptions\r\n });\r\n constants.handleError(error, 'get dashboard analytics');\r\n console.error(error);\r\n });\r\n };\r\n}\r\n","import Highcharts from 'highcharts';\r\nimport HighchartsReact from 'highcharts-react-official';\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\nimport React, { Component } from 'react';\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport { Link, match } from 'react-router-dom';\r\nimport { constants } from '../../constants/constants';\r\nimport { IdataFormatPreference, IinstallBase } from '../../models';\r\nimport { dataFormatEnum } from '../../models-enums';\r\nimport { Banner } from '../common/Banner';\r\nimport { mockAnalyticsSmartlinkAirSystem } from './mockAnalytics';\r\nimport {\r\n getBarChartOptionsDefault,\r\n getBarChartOptions,\r\n getGuageChartOptions,\r\n getLineChartOptions,\r\n getLineChartOptionsDefault,\r\n getGuageChartOptionsDefault\r\n} from './Utilities';\r\nimport {\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../actions/manageInventoryActions';\r\nimport InstallContactModal from '../manageInventory/InstallContactModal';\r\nimport Placeholder from '../../images/Photo_Placeholder.png';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n match: match;\r\n // this type (IanalyticsSmartLink | IanalyticsTAE) isn't working as\r\n // IanalyticsTAE doesn't have a device object\r\n smartlink: any;\r\n installBase: IinstallBase;\r\n isDemoMode: boolean;\r\n dataFormatPreference: IdataFormatPreference;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n}\r\ninterface Istate {\r\n chartOptions: Partial;\r\n chartLineOptions: Partial;\r\n chartPressureOptions: Partial;\r\n chartPressureSecondOptions: Partial;\r\n chartTemperatureOptions: Partial;\r\n}\r\nexport default class SmartLinkDetails extends Component {\r\n static defaultProps = {\r\n smartlink: mockAnalyticsSmartlinkAirSystem\r\n };\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n chartOptions: getBarChartOptionsDefault({ t: this.props.t }),\r\n chartLineOptions: getLineChartOptionsDefault({ t: this.props.t }),\r\n chartPressureOptions: getGuageChartOptionsDefault({\r\n t: this.props.t\r\n }),\r\n chartPressureSecondOptions: getGuageChartOptionsDefault({\r\n t: this.props.t\r\n }),\r\n chartTemperatureOptions: getGuageChartOptionsDefault({\r\n t: this.props.t\r\n })\r\n };\r\n }\r\n componentDidMount() {\r\n this.handleUpdateDataDetails();\r\n }\r\n handleUpdateDataDetails = () => {\r\n const { smartlink, t, dataFormatPreference } = this.props;\r\n this.setState({\r\n chartOptions: getBarChartOptions(\r\n t,\r\n dataFormatPreference,\r\n smartlink.device?.bar01\r\n ),\r\n chartPressureOptions: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n smartlink.device?.guage01\r\n ),\r\n chartLineOptions: getLineChartOptions(\r\n t,\r\n dataFormatPreference,\r\n smartlink.device?.line01\r\n ),\r\n chartPressureSecondOptions: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n smartlink.device?.guage02\r\n ),\r\n // series: secondPressureData?.series,\r\n // yAxis: secondPressureData?.yAxis,\r\n // subtitle: secondPressureData?.subtitle,\r\n // title: secondPressureData?.title\r\n chartTemperatureOptions: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n smartlink.device?.guage03\r\n )\r\n });\r\n };\r\n render() {\r\n const colorButton = 'primary';\r\n const {\r\n device,\r\n installBaseName,\r\n photoUrl,\r\n installBaseSerialNumber,\r\n installBaseLocation\r\n } = this.props.smartlink;\r\n const { t } = this.props;\r\n const getAlarms = device?.alarms?.split(',') || [];\r\n const productID = this.props.installBase?.productID;\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n

    \r\n {installBaseName}\r\n

    \r\n \r\n
    \r\n \r\n \r\n {`Updated: ${moment(new Date()).format(\r\n 'hh:mm a, MM/DD/YYYY'\r\n )}`}\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {`Serial Number: ${installBaseSerialNumber}`}

    \r\n {`Location Main: ${installBaseLocation}`}

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n this.props.toggleInstallContactModal();\r\n this.props.setSelectedProductID(\r\n productID\r\n );\r\n }}\r\n >\r\n Request Service\r\n \r\n {getAlarms.map(\r\n (item: string, index: number) => {\r\n if (item) {\r\n return (\r\n \r\n {`Alarms: ${item}`}\r\n
    \r\n );\r\n }\r\n\r\n return null;\r\n }\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n

    Loaded Hours:

    \r\n

    \r\n {t(\r\n `common:format.${\r\n dataFormatEnum[\r\n dataFormatEnum\r\n .numberTruncate\r\n ]\r\n }`,\r\n {\r\n numberString:\r\n device?.loadedHours\r\n }\r\n )}\r\n

    \r\n

    hours

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

    \r\n Current Runtime:\r\n

    \r\n

    \r\n {t(\r\n `common:format.${\r\n dataFormatEnum[\r\n dataFormatEnum\r\n .numberTruncate\r\n ]\r\n }`,\r\n {\r\n numberString:\r\n device?.runningHours\r\n }\r\n )}\r\n

    \r\n

    hours

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

    Next Service:

    \r\n

    \r\n {t(\r\n `common:format.${\r\n dataFormatEnum[\r\n dataFormatEnum\r\n .numberTruncate\r\n ]\r\n }`,\r\n {\r\n numberString:\r\n device?.nextService\r\n }\r\n )}\r\n

    \r\n

    hours

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * Analytics Detail Container\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport queryString from 'query-string';\r\n\r\nimport { getDashboardAnalytics } from '../../actions/dashboardAnalyticsActions';\r\nimport SmartlinkDetails from './SmartLinkDetails';\r\nimport {\r\n selectAnalyticsDetailsSmartlinkForInstall,\r\n selectDataFormatPreference\r\n} from '../../reducers/dashboardAnalyticsReducer';\r\nimport {\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../actions/manageInventoryActions';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: WithTranslation & RouteComponentProps<{ installID: string }>\r\n) => {\r\n const query = queryString.parse(ownProps.location.search);\r\n const isDemoMode = query.demo === 'true';\r\n const smartlink = selectAnalyticsDetailsSmartlinkForInstall(state, {\r\n installBaseID: ownProps.match.params.installID,\r\n isDemoMode\r\n });\r\n const dataFormatPreference = selectDataFormatPreference(state);\r\n const installBase =\r\n state.manageInventory.installBasesByID[smartlink.installBaseID];\r\n\r\n return {\r\n smartlink,\r\n installBase,\r\n loading: selectIsLoading(state),\r\n isDemoMode,\r\n dataFormatPreference\r\n };\r\n};\r\n\r\nexport const AnalyticsDetailContainer = withRouter(\r\n withTranslation('manageTae')(\r\n connect(mapStateToProps, {\r\n getDashboardAnalytics,\r\n toggleInstallContactModal,\r\n setSelectedProductID\r\n })(SmartlinkDetails)\r\n )\r\n);\r\n","import Highcharts from 'highcharts';\r\nimport HighchartsReact from 'highcharts-react-official';\r\nimport { TFunction } from 'i18next';\r\nimport moment from 'moment';\r\nimport React, { Component } from 'react';\r\nimport { Button, Col, Row } from 'react-bootstrap';\r\nimport { Link } from 'react-router-dom';\r\n\r\nimport { constants } from '../../constants/constants';\r\nimport {\r\n IanalyticsTAE,\r\n IinstallBase,\r\n IdataFormatPreference\r\n} from '../../models';\r\nimport { dataFormatEnum } from '../../models-enums';\r\nimport { Banner } from '../common/Banner';\r\nimport { mockAnalyticsTaeManifold } from './mockAnalytics';\r\nimport {\r\n getBarChartOptionsDefault,\r\n getBarChartOptions,\r\n getGuageChartOptions,\r\n getGuageChartOptionsDefault\r\n} from './Utilities';\r\nimport {\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../actions/manageInventoryActions';\r\nimport InstallContactModal from '../manageInventory/InstallContactModal';\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n analyticTAE: IanalyticsTAE;\r\n installBase: IinstallBase;\r\n isDemo: boolean;\r\n dataFormatPreference: IdataFormatPreference;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n}\r\ninterface Istate {\r\n chartOption1: Partial;\r\n chartOption2: Partial;\r\n chartOption3: Partial;\r\n chartOption4: Partial;\r\n chartOption5: Partial;\r\n}\r\nexport default class TaeDetails extends Component {\r\n static defaultProps = {\r\n analyticTAE: mockAnalyticsTaeManifold\r\n };\r\n constructor(props: Iprops) {\r\n super(props);\r\n this.state = {\r\n chartOption1: getGuageChartOptionsDefault({ t: this.props.t }),\r\n chartOption2: getGuageChartOptionsDefault({ t: this.props.t }),\r\n chartOption3: getGuageChartOptionsDefault({ t: this.props.t }),\r\n chartOption4: getGuageChartOptionsDefault({ t: this.props.t }),\r\n chartOption5: getBarChartOptionsDefault({ t: this.props.t })\r\n };\r\n }\r\n componentDidMount() {\r\n this.handleUpdateDataDetails();\r\n }\r\n handleUpdateDataDetails = () => {\r\n const { analyticTAE, t, dataFormatPreference } = this.props;\r\n console.info('i ahve a dream', analyticTAE);\r\n this.setState({\r\n chartOption1: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n analyticTAE.device?.guage01\r\n ),\r\n chartOption2: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n analyticTAE.device?.guage02\r\n ),\r\n chartOption3: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n analyticTAE.device?.guage03\r\n ),\r\n chartOption4: getGuageChartOptions(\r\n t,\r\n dataFormatPreference,\r\n analyticTAE.device?.guage04\r\n ),\r\n chartOption5: getBarChartOptions(\r\n t,\r\n dataFormatPreference,\r\n analyticTAE.device?.bar01\r\n )\r\n });\r\n };\r\n render() {\r\n const colorButton = 'primary';\r\n const {\r\n device,\r\n installBaseName,\r\n photoUrl,\r\n installBaseSerialNumber,\r\n installBaseLocation,\r\n gasType,\r\n date\r\n } = this.props.analyticTAE;\r\n const getGasType = gasType?.split('');\r\n const productID = this.props.installBase?.productID;\r\n const getAlarms = device?.alarms?.split(',') || [];\r\n const { t } = this.props;\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n

    \r\n {installBaseName}\r\n

    \r\n \r\n
    \r\n \r\n \r\n {`Updated: ${moment(date || new Date()).format(\r\n 'hh:mm a, MM/DD/YYYY'\r\n )}`}\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {`Serial Number: ${installBaseSerialNumber}`}

    \r\n {`Location Main: ${installBaseLocation}`}

    \r\n \r\n \r\n \r\n \r\n {device?.guage01 && (\r\n \r\n \r\n \r\n )}\r\n {device?.guage02 && (\r\n \r\n \r\n \r\n )}\r\n
    \r\n \r\n {device?.guage03 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {device?.guage04 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n {getGasType && (\r\n <>\r\n

    Gas Type

    \r\n
    \r\n

    \r\n {getGasType[0]}\r\n

    \r\n \r\n {getGasType[1]}\r\n

    \r\n
    \r\n \r\n )}\r\n {device?.bar01 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {\r\n this.props.toggleInstallContactModal();\r\n this.props.setSelectedProductID(\r\n productID\r\n );\r\n }}\r\n >\r\n Request Service\r\n \r\n {getAlarms.map(\r\n (item: string, index: number) => {\r\n if (item) {\r\n return (\r\n \r\n {`Alarms: ${item}`}\r\n
    \r\n );\r\n }\r\n\r\n return null;\r\n }\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n

    System Hours:

    \r\n

    \r\n {t(\r\n `common:format.${\r\n dataFormatEnum[\r\n dataFormatEnum\r\n .numberTruncate\r\n ]\r\n }`,\r\n {\r\n numberString:\r\n device?.loadedHours\r\n }\r\n )}\r\n

    \r\n

    hours

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\n * Analytics Detail Container TAE\r\n */\r\n\r\nimport { connect } from 'react-redux';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport queryString from 'query-string';\r\n\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { getDashboardAnalytics } from '../../actions/dashboardAnalyticsActions';\r\nimport {\r\n selectAnalyticsDetailsTaeForInstall,\r\n selectDataFormatPreference\r\n} from '../../reducers/dashboardAnalyticsReducer';\r\nimport TaeDetails from './TaeDetails';\r\nimport {\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../actions/manageInventoryActions';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: WithTranslation & RouteComponentProps<{ installID: string }>\r\n) => {\r\n const query = queryString.parse(ownProps.location.search);\r\n const isDemoMode = query.demo === 'true';\r\n const analyticTAE = selectAnalyticsDetailsTaeForInstall(state, {\r\n installBaseID: ownProps.match.params.installID,\r\n isDemoMode\r\n });\r\n const dataFormatPreference = selectDataFormatPreference(state);\r\n const installBase =\r\n state.manageInventory.installBasesByID[analyticTAE.installBaseID];\r\n\r\n return {\r\n analyticTAE,\r\n installBase,\r\n loading: selectIsLoading(state),\r\n isDemoMode,\r\n dataFormatPreference\r\n };\r\n};\r\n\r\nexport const AnalyticsDetailTaeContainer = withRouter(\r\n withTranslation('manageTae')(\r\n connect(mapStateToProps, {\r\n getDashboardAnalytics,\r\n toggleInstallContactModal,\r\n setSelectedProductID\r\n })(TaeDetails)\r\n )\r\n);\r\n","import * as React from 'react';\r\nimport * as Highcharts from 'highcharts';\r\n\r\nimport HighchartsReact from 'highcharts-react-official';\r\nimport moment from 'moment';\r\nimport { Button } from 'react-bootstrap';\r\nimport { Link, match, useHistory } from 'react-router-dom';\r\nimport { TFunction } from 'i18next';\r\nimport styled from 'styled-components';\r\n\r\nimport Alert from '../../../images/alert.svg';\r\nimport HourCard from './HourCard';\r\nimport Placeholder from '../../../images/Photo_Placeholder.png';\r\nimport { Banner } from '../../common/Banner';\r\nimport {\r\n BarChartData,\r\n IanalyticsTAEDashboard,\r\n IdataFormatPreference,\r\n IsensorData,\r\n TAEDashboardData\r\n} from '../../../models';\r\nimport {\r\n constants,\r\n productPlaceholderImages\r\n} from '../../../constants/constants';\r\nimport { dataUnitEnum, GraphType, OperatingMode } from '../../../models-enums';\r\nimport { dataThreshold, floatTrim } from './AnalyticsCard';\r\nimport {\r\n getBarChartOptionsDefault,\r\n getBarChartOptions,\r\n getGuageChartOptions,\r\n getLineChartOptions,\r\n getLineChartOptionsDefault,\r\n getGuageChartOptionsDefault\r\n} from '../Utilities';\r\nimport {\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../../actions/manageInventoryActions';\r\nimport InstallContactModal from '../../manageInventory/InstallContactModal';\r\nimport { isStrFloat } from '../../../helpers/isFloat';\r\nimport { AnalyticsToggle } from './AnalyticsToggle';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport {\r\n runReport,\r\n setSelectedDefaultReport,\r\n toggleEditReportModal\r\n} from '../../../actions/manageReportActions';\r\nimport { msalFetch } from '../../auth/Auth-Utils';\r\nimport API from '../../../constants/apiEndpoints';\r\nimport { beginAjaxCall, endAjaxCall } from '../../../actions/ajaxStatusActions';\r\nimport ReactTable from 'react-table';\r\nimport { TableUtil } from '../../common/TableUtil';\r\nimport ManageReportModal from '../../manageReport/ManageReportModal';\r\nimport { useSelector } from 'react-redux';\r\nimport { getUser } from '../../../reducers/manageUserReducer';\r\n\r\nconst UnitLabelStatus = styled.div`\r\n background-color: ${(props: { color: string }) => props.color};\r\n border-radius: 100%;\r\n height: 10px;\r\n margin-right: 8px;\r\n max-height: 10px;\r\n min-height: 10px;\r\n width: 10px;\r\n`;\r\n\r\nconst UnitFooter = styled.div`\r\n color: #fff;\r\n background-color: ${(props: { bgColor: string }) => props.bgColor};\r\n border-radius: 6px;\r\n margin-top: 8px;\r\n padding: 0 8px;\r\n width: 100%;\r\n\r\n display: flex;\r\n justify-content: space-between;\r\n flex-direction: row;\r\n\r\n font-size: 12px;\r\n line-height: 23px;\r\n`;\r\n\r\nconst UnitFooterMode = styled.div`\r\n font-weight: bold;\r\n text-transform: uppercase;\r\n`;\r\n\r\ninterface Iprops {\r\n t: TFunction;\r\n data: IanalyticsTAEDashboard;\r\n dataFormatPreference: IdataFormatPreference;\r\n isDemoMode: boolean;\r\n match: match;\r\n setSelectedProductID: typeof setSelectedProductID;\r\n toggleInstallContactModal: typeof toggleInstallContactModal;\r\n setSelectedInstallBaseID: typeof setSelectedInstallBaseID;\r\n runReport: typeof runReport;\r\n beginAjaxCall: typeof beginAjaxCall;\r\n endAjaxCall: typeof endAjaxCall;\r\n setSelectedDefaultReport: typeof setSelectedDefaultReport;\r\n // toggleEditReportModal: typeof toggleEditReportModal;\r\n}\r\n\r\ninterface Istate {\r\n [key: string]: boolean;\r\n}\r\n\r\nexport const hoursMinHeight = (length: number) =>\r\n (91.5 + 16) * (length < 4 ? length : 4) + 16;\r\n\r\nconst unitsSorted = (a: TAEDashboardData, b: TAEDashboardData) => {\r\n const labelA = a.label.toUpperCase();\r\n const labelB = b.label.toUpperCase();\r\n\r\n switch (true) {\r\n case labelA < labelB:\r\n return -1;\r\n case labelA > labelB:\r\n return 1;\r\n default:\r\n return 0;\r\n }\r\n};\r\n\r\nconst AnalyticsCard = (props: Iprops) => {\r\n const { data, dataFormatPreference, t } = props;\r\n const history = useHistory();\r\n const user = useSelector(getUser);\r\n const [showEditReportModal, setShowEditReportModal] = React.useState(false);\r\n const hourWrap = React.useRef(null);\r\n const [cardHeight, setCardHeight] = React.useState();\r\n const [toggleState, setToggleState] = React.useState({\r\n alarms: false,\r\n runningStatus: false,\r\n dryerGraph: false,\r\n systemMaintenance: false,\r\n unitMaintenance: false,\r\n temperatureWeek: false,\r\n elementOutletTemperature: false,\r\n eventLogs: false\r\n });\r\n\r\n const [eventLogs, setEventLogs] = React.useState([]);\r\n\r\n const toggleCallback = React.useCallback(\r\n (section: string) => {\r\n setToggleState(state => ({\r\n ...state,\r\n [section]: !state[section]\r\n }));\r\n },\r\n [toggleState]\r\n );\r\n\r\n const canRunDailyRoundReport = () => {\r\n return constants.hasSecurityFunction(user, [\r\n constants.securityFunctions.RunReports.id\r\n ]);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (!data) {\r\n history.push('/dashboard');\r\n }\r\n\r\n setSelectedProductID(data.productID);\r\n props.setSelectedInstallBaseID(data.installBaseID);\r\n }, [data]);\r\n\r\n React.useEffect(() => {\r\n if (hourWrap.current) {\r\n setCardHeight(hourWrap.current.clientHeight);\r\n }\r\n }, [hourWrap]);\r\n\r\n const splitEventsWithMultipleOriginators = (\r\n sensorData: IsensorData[]\r\n ): IsensorData[] => {\r\n const newData: IsensorData[] = [];\r\n\r\n sensorData.forEach(row => {\r\n if (row.originator.includes('\\n')) {\r\n row.originator.split('\\n').forEach(originator => {\r\n newData.push({\r\n ...row,\r\n originator\r\n });\r\n });\r\n } else newData.push(row);\r\n });\r\n\r\n return newData;\r\n };\r\n\r\n const getEventLogs = async () => {\r\n if (!data) {\r\n console.error('Data has not been initialized yet.');\r\n return null;\r\n }\r\n\r\n props.beginAjaxCall();\r\n\r\n try {\r\n const url = `${API.alert.alertsForInstallBase}?installBaseId=${data.installBaseID}`;\r\n const response = await msalFetch(url, {\r\n method: 'get'\r\n });\r\n\r\n if (!response.data) {\r\n console.error('Failed to get event logs for install base.');\r\n } else {\r\n const newData = splitEventsWithMultipleOriginators(\r\n response.data as IsensorData[]\r\n );\r\n setEventLogs(newData);\r\n }\r\n } catch (error) {\r\n console.error('[Dashboard - getEventLogs]', error);\r\n // throw error;\r\n return null;\r\n } finally {\r\n props.endAjaxCall();\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n getEventLogs();\r\n }, []);\r\n\r\n if (!data) {\r\n return null;\r\n }\r\n\r\n const eventLogColumns = TableUtil.translateHeaders(\r\n [\r\n {\r\n id: 'time',\r\n Header: 'time',\r\n accessor: (sensor: IsensorData) => {\r\n return moment(sensor.time).format('DD-MMM-YY HH:mm');\r\n },\r\n minWidth: 100\r\n },\r\n {\r\n Header: 'eventName',\r\n accessor: 'eventName',\r\n minWidth: 150\r\n },\r\n {\r\n Header: 'originator',\r\n accessor: 'originator',\r\n minWidth: 150\r\n }\r\n ],\r\n t\r\n );\r\n\r\n const runDailyRoundsReport = () => {\r\n props.setSelectedDefaultReport('0ff13067-d224-4ba7-883b-9cc07788b55a'); // pass in Id for daily rounds report\r\n setShowEditReportModal(true);\r\n };\r\n const colorButton = 'primary';\r\n const hours = data.secondaryData.filter(\r\n guage => guage.graphType === GraphType.Numeric\r\n );\r\n const units = data.secondaryData\r\n .filter(unit => unit.graphType === GraphType.UnitSecondary)\r\n .sort(unitsSorted);\r\n const unitMaintenance = data.secondaryData\r\n .filter(main => main.graphType === GraphType.MaintenanceInterval)\r\n .sort(unitsSorted);\r\n\r\n const systemMaintenance = data.secondaryData\r\n .filter(main => main.graphType === GraphType.SystemMaintenanceInterval)\r\n .sort(unitsSorted);\r\n\r\n const elementOutlet = data.secondaryData.filter(\r\n elem => elem.graphType === GraphType.Bar\r\n );\r\n const guages = data.secondaryData.filter(\r\n guage => guage.graphType === GraphType.Guague\r\n );\r\n const temperatures = data.secondaryData.filter(\r\n temp => temp.graphType === GraphType.Line\r\n );\r\n\r\n const dryers = data.secondaryData.filter(\r\n guage => guage.graphType === GraphType.Dryer\r\n );\r\n\r\n const placeholder = productPlaceholderImages.find(\r\n img => img.categoryId.toLocaleLowerCase() === data.mainCategoryID\r\n ) || { src: 'Azure.png' };\r\n let imgPath = require(`../../../images/products/${placeholder.src}`);\r\n if (\r\n data.photoUrl !== '' &&\r\n data.photoUrl !== null &&\r\n data.photoUrl !== undefined\r\n ) {\r\n imgPath = data.photoUrl;\r\n }\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n
    \r\n

    {t('assetDetails')}

    \r\n \r\n ×\r\n {t('common:cancel')}\r\n \r\n
    \r\n
    \r\n
    \r\n {/* Device Name */}\r\n

    {data.installBaseName}

    \r\n {/* Last Updated Label */}\r\n
    \r\n

    {`${t('updated')}:`}

    \r\n

    \r\n {`${moment(\r\n data.updateDate || new Date()\r\n ).format('hh:mm a, DD-MMM-YY')}`}\r\n

    \r\n
    \r\n {/* Device Image */}\r\n \r\n {/* Serial Number */}\r\n
    \r\n

    {`${t(\r\n 'serialNumber'\r\n )}:`}

    \r\n

    \r\n {data.installBaseSerialNumber}\r\n

    \r\n
    \r\n {/* Location */}\r\n {data.installBaseLocation ? (\r\n
    \r\n

    {`${t(\r\n 'location'\r\n )}:`}

    \r\n

    \r\n {data.installBaseLocation}\r\n

    \r\n
    \r\n ) : null}\r\n {/* Running Hours - Vertical Scroll List */}\r\n
    \r\n {cardHeight ? (\r\n \r\n {hours.map((hourItem, index) => (\r\n \r\n ))}\r\n
    \r\n ) : null}\r\n
    \r\n {/* Request Service Button */}\r\n {\r\n props.setSelectedProductID(data.productID);\r\n props.toggleInstallContactModal();\r\n }}\r\n >\r\n {t('requestService')}\r\n \r\n {/* Run Daily Rounds Report */}\r\n {canRunDailyRoundReport() && (\r\n {\r\n runDailyRoundsReport();\r\n }}\r\n >\r\n {t('runDailyRoundsReport')}\r\n \r\n )}\r\n {/* View Reports */}\r\n \r\n \r\n \r\n
    \r\n
    \r\n \r\n \r\n

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

    \r\n \r\n toggleCallback('runningStatus')\r\n }\r\n />\r\n
    \r\n \r\n {units.map((unitItem, index) => {\r\n const operatingMode =\r\n unitItem.operatingMode;\r\n let color =\r\n constants.colors.smartLinkYellow;\r\n if (operatingMode === OperatingMode.Off) {\r\n color = constants.colors.smartLinkRed;\r\n } else if (\r\n operatingMode ===\r\n OperatingMode.Automatic\r\n ) {\r\n color = constants.colors.smartLinkBlue;\r\n }\r\n\r\n return (\r\n \r\n

    \r\n {unitItem.label}\r\n

    \r\n \r\n

    \r\n {`${floatTrim(\r\n unitItem.data[0]\r\n ).toLocaleString('en-US')}`}\r\n

    \r\n

    \r\n {\r\n dataUnitEnum[\r\n unitItem.unit\r\n ]\r\n }\r\n

    \r\n
    \r\n \r\n {unitItem.pumpRunStatus !==\r\n null && (\r\n
    \r\n

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

    \r\n
    \r\n )}\r\n {unitItem.compressorRunStatus !==\r\n null && (\r\n
    \r\n

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

    \r\n
    \r\n )}\r\n
    \r\n \r\n
    \r\n {`${t('operatingMode')}:`}\r\n
    \r\n \r\n {\r\n OperatingMode[\r\n unitItem.operatingMode ??\r\n 0\r\n ]\r\n }\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n \r\n

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

    \r\n \r\n toggleCallback('dryerGraph')\r\n }\r\n />\r\n \r\n \r\n {dryers.map((dryerItem, index) => {\r\n const operatingStatus =\r\n dryerItem.operatingMode;\r\n let color = constants.colors.smartLinkBlue;\r\n if (operatingStatus === OperatingMode.Off) {\r\n color = constants.colors.smartLinkRed;\r\n } else if (\r\n operatingStatus === OperatingMode.Manual\r\n ) {\r\n color =\r\n constants.colors.smartLinkYellow;\r\n }\r\n\r\n return (\r\n \r\n

    \r\n {dryerItem.label}\r\n

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

    \r\n {floatTrim(\r\n dryerItem.data[0]\r\n ).toLocaleString(\r\n 'en-US'\r\n )}\r\n

    \r\n

    \r\n {\r\n dataUnitEnum[\r\n dryerItem.unit\r\n ]\r\n }\r\n

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

    \r\n {`${t('operatingMode')}:`}\r\n

    \r\n

    \r\n {\r\n OperatingMode[\r\n dryerItem.operatingMode ??\r\n 0\r\n ]\r\n }\r\n

    \r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n
    \r\n

    {t('eventLogs')}

    \r\n \r\n
    \r\n \r\n {/* Unit Maintenance */}\r\n \r\n \r\n

    Unit Maintenance

    \r\n \r\n toggleCallback('unitMaintenance')\r\n }\r\n />\r\n \r\n \r\n {unitMaintenance.map(\r\n (maintenanceItem, index) => (\r\n \r\n

    \r\n {maintenanceItem.label}\r\n

    \r\n
    \r\n

    {t('serviceItem')}

    \r\n

    {t('dueIn')}

    \r\n
    \r\n
      \r\n {maintenanceItem.maintenanceIntervals?.map(\r\n ({ item, due }) => {\r\n const dueIn =\r\n due?.replace(\r\n /([0-9.]+)\\s(.*)/g,\r\n (\r\n // eslint-disable-next-line no-shadow\r\n match,\r\n number,\r\n unit\r\n ) => {\r\n const ifNumFloat = isStrFloat(\r\n number\r\n );\r\n const value = ifNumFloat\r\n ? floatTrim(\r\n parseFloat(\r\n number\r\n )\r\n )\r\n : number;\r\n\r\n return `${value} ${unit}`;\r\n }\r\n ) ?? '';\r\n\r\n return (\r\n \r\n

      {item}

      \r\n

      {dueIn}

      \r\n \r\n );\r\n }\r\n )}\r\n
    \r\n \r\n )\r\n )}\r\n \r\n \r\n {/* System Maintenance */}\r\n \r\n \r\n

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

    \r\n \r\n toggleCallback('systemMaintenance')\r\n }\r\n />\r\n \r\n \r\n {systemMaintenance.map(\r\n (maintenanceItem, index) => (\r\n \r\n

    \r\n {maintenanceItem.label}\r\n

    \r\n
    \r\n

    {t('serviceItem')}

    \r\n

    {t('dueIn')}

    \r\n
    \r\n
      \r\n {maintenanceItem.systemMaintenanceIntervals?.map(\r\n ({ item, due }) => {\r\n const dueIn =\r\n due?.replace(\r\n /([0-9.]+)\\s(.*)/g,\r\n (\r\n // eslint-disable-next-line no-shadow\r\n match,\r\n number,\r\n unit\r\n ) => {\r\n const ifNumFloat = isStrFloat(\r\n number\r\n );\r\n const value = ifNumFloat\r\n ? floatTrim(\r\n parseFloat(\r\n number\r\n )\r\n )\r\n : number;\r\n\r\n return `${value} ${unit}`;\r\n }\r\n ) ?? '';\r\n\r\n return (\r\n \r\n

      {item}

      \r\n

      {dueIn}

      \r\n \r\n );\r\n }\r\n )}\r\n
    \r\n \r\n )\r\n )}\r\n \r\n \r\n \r\n {temperatures.map((temperatureData, index) => {\r\n return (\r\n <>\r\n \r\n \r\n {temperatureData.label ===\r\n 'Dew Point' &&\r\n 'Dew Point (Last 7 Days)'}\r\n {temperatureData.label !==\r\n 'Dew Point' &&\r\n t('temperatureWeek')}\r\n

    \r\n \r\n toggleCallback(\r\n 'temperatureWeek'\r\n )\r\n }\r\n />\r\n \r\n \r\n \r\n

    \r\n {temperatureData.label}\r\n

    \r\n \r\n \r\n );\r\n })}\r\n \r\n 0)}\r\n data-hidden={\r\n elementOutlet.length === 0 &&\r\n guages.length === 0\r\n }\r\n data-flip=\"false\"\r\n data-open={toggleState.elementOutletTemperature}\r\n >\r\n \r\n

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

    \r\n \r\n toggleCallback(\r\n 'elementOutletTemperature'\r\n )\r\n }\r\n />\r\n \r\n {elementOutlet.length > 0 ? (\r\n \r\n {/* use this label instead of chart generated for better styling control */}\r\n

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

    \r\n {elementOutlet.map(\r\n (elementOutletData, index) => {\r\n const rawData = elementOutletData.barChartData as BarChartData[];\r\n const barData = rawData.map(\r\n barChartData => [\r\n barChartData.item1,\r\n barChartData.item2\r\n ]\r\n );\r\n const categories = rawData.map(\r\n barChartData =>\r\n barChartData.item1\r\n );\r\n\r\n return (\r\n \r\n \r\n

    \r\n {\r\n elementOutletData.label\r\n }\r\n

    \r\n \r\n );\r\n }\r\n )}\r\n \r\n ) : null}\r\n \r\n {guages.map(guageData => {\r\n const fill = dataThreshold(\r\n guageData.data[0],\r\n {\r\n min: guageData.min,\r\n medium: guageData.medium,\r\n high: guageData.high\r\n },\r\n guageData.pointNumber\r\n );\r\n\r\n return (\r\n \r\n {/* use this label instead of chart generated for better styling control */}\r\n

    \r\n {guageData.label}\r\n

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

    \r\n {floatTrim(\r\n guageData.min\r\n )}\r\n

    \r\n

    \r\n {floatTrim(\r\n guageData.max\r\n )}\r\n

    \r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n {/* Alarms */}\r\n \r\n \r\n

    \r\n {t('activeAlarms')} - {data.alarmCount}\r\n

    \r\n {data.alarmCount > 0 && (\r\n \r\n )}\r\n toggleCallback('alarms')}\r\n />\r\n \r\n \r\n {data.alarmCount === 0 &&

    No alarms

    }\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n\r\n setShowEditReportModal(false)}\r\n onHide={() => setShowEditReportModal(false)}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default AnalyticsCard;\r\n","/*\r\n * Analytics Card Container\r\n */\r\n\r\nimport queryString from 'query-string';\r\nimport { connect } from 'react-redux';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\nimport AnalyticsExpandedCard from './AnalyticsExpandedCard';\r\nimport { IanalyticsTAEDashboard } from '../../../models';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { selectDataFormatPreference } from '../../../reducers/dashboardAnalyticsReducer';\r\nimport { selectIsLoading } from '../../../reducers/commonReducers';\r\nimport {\r\n setSelectedInstallBaseID,\r\n setSelectedProductID,\r\n toggleInstallContactModal\r\n} from '../../../actions/manageInventoryActions';\r\nimport {\r\n runReport,\r\n setSelectedDefaultReport,\r\n toggleEditReportModal\r\n} from '../../../actions/manageReportActions';\r\nimport { beginAjaxCall, endAjaxCall } from '../../../actions/ajaxStatusActions';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: RouteComponentProps<{}> & WithTranslation\r\n) => {\r\n const location = ownProps.location;\r\n const { selectedFacilityID, user } = state;\r\n const { securityFunctions } = user;\r\n const query = queryString.parse(location.search);\r\n const dataFormatPreference = selectDataFormatPreference(state);\r\n const locationState = location?.state as {\r\n data: IanalyticsTAEDashboard;\r\n };\r\n\r\n return {\r\n data: locationState?.data,\r\n selectedFacilityID,\r\n securityFunctions,\r\n loading: selectIsLoading(state),\r\n isDemoMode: query.demo === 'true',\r\n dataFormatPreference\r\n };\r\n};\r\n\r\nexport const AnalyticsExpandedCardContainer = withTranslation(\r\n 'dashboardAnalytics'\r\n)(\r\n withRouter(\r\n connect(mapStateToProps, {\r\n setSelectedProductID,\r\n runReport,\r\n setSelectedInstallBaseID,\r\n toggleInstallContactModal,\r\n beginAjaxCall,\r\n endAjaxCall,\r\n setSelectedDefaultReport,\r\n toggleEditReportModal\r\n })(AnalyticsExpandedCard)\r\n )\r\n);\r\n","import React, { useEffect, useMemo, useState } from 'react';\r\nimport ReactTable, { Column, FinalState, RowInfo } from 'react-table';\r\nimport 'react-table/react-table.css'; // Ensure to import the CSS for styling\r\nimport { IreportTemplate } from '../../models';\r\nimport { jobTypesIdEnumInverse } from '../../models-enums';\r\nimport { useSelector } from 'react-redux';\r\nimport { getProductInfo } from '../../reducers/productInfoReducer';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\n\r\ninterface IReportTemplateGridProps {\r\n tableData: IreportTemplate[];\r\n rowClickHandler: (template: IreportTemplate) => void;\r\n filterValues: {\r\n brand: string | null;\r\n jobType: string | null;\r\n default: boolean | null;\r\n }; // Added filterValues prop\r\n}\r\n\r\ninterface RowInfoReport extends RowInfo {\r\n original: IreportTemplate;\r\n}\r\n\r\nconst ManageReportTemplateGrid: React.FC = ({\r\n t,\r\n rowClickHandler,\r\n filterValues, // Use the passed filterValues prop\r\n tableData\r\n}) => {\r\n const [pages, setPages] = useState(0);\r\n const [pageSize] = useState(10); // Number of rows per page\r\n const [currentPage, setCurrentPage] = useState(0);\r\n const productInfo = useSelector(getProductInfo);\r\n\r\n const handlePageChange = (pageIndex: number) => {\r\n setCurrentPage(pageIndex); // Update current page\r\n };\r\n\r\n // Filter templates based on filterValues\r\n const filteredTemplates = useMemo(() => {\r\n return tableData?.filter(template => {\r\n const matchesBrand =\r\n !filterValues.brand || template.brandID === filterValues.brand;\r\n const matchesJobType =\r\n !filterValues.jobType ||\r\n template.jobTypeID === filterValues.jobType;\r\n const matchesIsDefault =\r\n filterValues.default === null ||\r\n template.isDefault === filterValues.default;\r\n\r\n return matchesBrand && matchesJobType && matchesIsDefault;\r\n });\r\n }, [tableData, filterValues]);\r\n\r\n const getTdProps = (\r\n finalState: FinalState,\r\n rowInfo: RowInfoReport | undefined,\r\n column: Column | undefined,\r\n instance: any\r\n ) => {\r\n return {\r\n onClick: (e: React.MouseEvent) => {\r\n if (rowInfo) {\r\n rowClickHandler(rowInfo.original);\r\n }\r\n }\r\n };\r\n };\r\n\r\n const columns = [\r\n {\r\n Header: t('HeaderTemplateName'),\r\n accessor: 'templateName'\r\n },\r\n {\r\n id: 'jobType',\r\n Header: t('HeaderJobType'),\r\n accessor: (row: IreportTemplate) => {\r\n return t(\r\n `nsJob:${\r\n jobTypesIdEnumInverse[\r\n row.jobTypeID as keyof typeof jobTypesIdEnumInverse\r\n ]\r\n }`\r\n );\r\n }\r\n },\r\n {\r\n id: 'brand',\r\n Header: t('HeaderBrand'),\r\n accessor: (row: IreportTemplate) => {\r\n return productInfo?.allBrands[row.brandID]?.name;\r\n }\r\n },\r\n {\r\n Header: t('HeaderIsDefault'),\r\n accessor: 'isDefault', // Ensure this matches the key in your data\r\n Cell: ({ value }: { value: boolean }) => (\r\n
    \r\n {value ? 'Yes' : 'No'}\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\nexport default withTranslation('manageReportBuilder')(ManageReportTemplateGrid);\r\n","import React, { useMemo } from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect, useDispatch } from 'react-redux';\r\nimport { IinitialState } from '../../../reducers';\r\nimport {\r\n AbstractControl,\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup\r\n} from 'react-reactive-form';\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { WithCommonModal } from '../../common/WithCommonModal';\r\nimport { Button, Col, ListGroup, ListGroupItem, Row } from 'react-bootstrap';\r\nimport {\r\n Ioption,\r\n IproductInfo,\r\n IreportTemplate,\r\n IreportTemplateChapter\r\n} from '../../../models';\r\nimport { jobTypeOptions } from '../../../constants/constants';\r\nimport {\r\n SortableContainer,\r\n SortableElement,\r\n SortableHandle\r\n} from 'react-sortable-hoc';\r\nimport arrayMove from 'array-move';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport {\r\n getAllReportTemplateChapters,\r\n createReportTemplate,\r\n updateReportTemplate,\r\n deleteReportTemplate,\r\n updateReportTemplateChapter\r\n} from '../../../actions/manageReportActions';\r\nimport { toastr } from 'react-redux-toastr'; // For confirmation dialogs\r\nimport { beginAjaxCall, endAjaxCall } from '../../../actions/ajaxStatusActions';\r\n\r\ninterface Iprops {\r\n closeModal: () => void;\r\n template: IreportTemplate | undefined;\r\n openAddChapter: (isAdd: boolean, chapter?: IreportTemplateChapter) => void; // Pass flag to differentiate add/edit and optional chapter\r\n isAdd: boolean;\r\n templateId?: string;\r\n updateTemplate: (template: IreportTemplate) => void;\r\n refetchTemplates: () => void;\r\n}\r\n\r\ninterface IdispatchProps {\r\n productInfo: IproductInfo;\r\n}\r\n\r\nconst ManageReportTemplateModal: React.FC = props => {\r\n const { t, productInfo, template } = props;\r\n const disabled = false;\r\n const formGroupRef = React.useRef(null);\r\n const dispatch = useDispatch();\r\n\r\n const fieldConfig = useMemo((): FieldConfig => {\r\n let selectedBrand: Ioption | undefined = undefined;\r\n let selectedJobType: Ioption | undefined = undefined;\r\n let selectedDefault = false;\r\n let templateName = ''; // Variable for template name\r\n\r\n const translatedJobTypeOptions = jobTypeOptions.map(option => ({\r\n ...option,\r\n label: t(`nsJob:${option.label}`)\r\n }));\r\n\r\n if (template) {\r\n selectedBrand = productInfo.allBrandOptions.find(\r\n (option: Ioption) => option.value === template.brandID\r\n );\r\n\r\n selectedJobType = translatedJobTypeOptions.find(\r\n (option: Ioption) => option.value === template.jobTypeID\r\n );\r\n\r\n selectedDefault = template.isDefault;\r\n templateName = template.templateName; // Get template name if template exists\r\n }\r\n\r\n return {\r\n controls: {\r\n // Template Name field\r\n templateName: {\r\n render: FormUtil.TextInput,\r\n meta: {\r\n label: t('FilterTemplateName'),\r\n colWidth: 12,\r\n placeholder: 'Enter template name',\r\n name: 'templateName'\r\n },\r\n formState: {\r\n value: templateName,\r\n disabled // Disable if needed, based on the \"disabled\" variable\r\n },\r\n required: true\r\n },\r\n brand: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: [\r\n ...productInfo.allBrandOptions // Just the options, no placeholder inside\r\n ],\r\n label: t('FilterBrand'),\r\n colWidth: 12,\r\n placeholder: 'Choose a brand', // Placeholder text here\r\n name: 'brand',\r\n defaultValue: undefined,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedBrand,\r\n disabled\r\n },\r\n required: true\r\n },\r\n jobType: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: [\r\n ...translatedJobTypeOptions // Just the options, no placeholder inside\r\n ],\r\n label: t('FilterJobType'),\r\n colWidth: 12,\r\n placeholder: 'Choose a job type', // Placeholder text here\r\n name: 'jobType',\r\n defaultValue: undefined,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: selectedJobType,\r\n disabled\r\n },\r\n required: true\r\n },\r\n default: {\r\n render: (props: any) => (\r\n
    \r\n \r\n
    \r\n ),\r\n meta: {\r\n label: t('FilterDefault'),\r\n colWidth: 12,\r\n name: 'default',\r\n defaultValue: false // Set the default value\r\n },\r\n formState: {\r\n value: selectedDefault,\r\n disabled\r\n }\r\n }\r\n }\r\n };\r\n }, [template, productInfo, jobTypeOptions]);\r\n\r\n const [loading, setLoading] = React.useState(true);\r\n\r\n const setForm = (form: AbstractControl) => {\r\n formGroupRef.current = form as FormGroup;\r\n };\r\n\r\n const fetchChapters = async () => {\r\n try {\r\n // Ensure template exists before trying to access templateId\r\n if (!template || !template.id) {\r\n console.info('Template is undefined or missing templateID.'); // technically not an error if we are creating a new template\r\n return;\r\n }\r\n\r\n const data = await getAllReportTemplateChapters(template.id);\r\n props.updateTemplate({ ...template, reportTemplateChapters: data }); // Update the template with fetched chapters\r\n } catch (error) {\r\n console.error('No Chapters Available for this Template');\r\n } finally {\r\n setLoading(false);\r\n }\r\n };\r\n\r\n // Handle the reordering of chapters\r\n const onSortEndHandler = async ({\r\n oldIndex,\r\n newIndex\r\n }: {\r\n oldIndex: number;\r\n newIndex: number;\r\n }) => {\r\n if (template?.reportTemplateChapters) {\r\n const newItems = arrayMove(\r\n template?.reportTemplateChapters,\r\n oldIndex,\r\n newIndex\r\n );\r\n const updatedChapters = newItems.map((item, index) => ({\r\n ...item,\r\n order: index + 1\r\n }));\r\n\r\n try {\r\n if (template?.id) {\r\n dispatch(beginAjaxCall());\r\n\r\n await updateReportTemplateChapter(updatedChapters)\r\n .then(async () => {\r\n const data = await getAllReportTemplateChapters(\r\n template?.id || ''\r\n );\r\n\r\n props.updateTemplate({\r\n ...template,\r\n reportTemplateChapters: data\r\n }); // Update the template with fetched chapters\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall());\r\n });\r\n }\r\n } catch (error) {\r\n console.error('Failed to update chapter order:', error);\r\n }\r\n }\r\n };\r\n\r\n // Drag handle icon component\r\n const DragHandle = SortableHandle(() => (\r\n \r\n \r\n \r\n ));\r\n\r\n // Open add or edit chapter modal\r\n const handleChapterClick = (chapter: IreportTemplateChapter) => {\r\n // Open the Edit Chapter modal by passing the chapter object and set isAdd to false\r\n props.openAddChapter(false, chapter); // Editing mode\r\n };\r\n\r\n // Sortable item component, displaying ChapterName only\r\n const SortableItem = SortableElement(\r\n ({ item }: { item: IreportTemplateChapter }) => (\r\n handleChapterClick(item)}>\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n {`${item?.reportChapter?.chapterName} - ${item?.reportChapter?.reportRevision}`}\r\n
    \r\n \r\n
    \r\n
    \r\n )\r\n );\r\n\r\n // Sortable list of chapters\r\n const SortableList = SortableContainer(\r\n ({ items }: { items: IreportTemplateChapter[] }) => {\r\n if (items && items.length > 0 && Array.isArray(items)) {\r\n return (\r\n \r\n {items.map((value, index) => (\r\n \r\n ))}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n );\r\n\r\n React.useEffect(() => {\r\n fetchChapters(); // Call the fetch function on component mount\r\n }, []);\r\n\r\n // Open add chapter modal\r\n const handleAddChapterClick = () => {\r\n // Call the openAddChapter function to open the add chapter modal, pass `true` for \"Add Chapter\"\r\n props.openAddChapter(true); // Adding mode\r\n };\r\n\r\n const handleDelete = () => {\r\n if (!template?.id) {\r\n console.error('Template ID is missing');\r\n return;\r\n }\r\n\r\n toastr.confirm('Are you sure you want to delete this template?', {\r\n onOk: async () => {\r\n try {\r\n await deleteReportTemplate(template.id as string); // Safely cast to string here\r\n props.refetchTemplates(); // Refresh the grid after deletion\r\n props.closeModal(); // Close modal after deletion\r\n } catch (error) {\r\n console.error('Failed to delete report template:', error);\r\n }\r\n },\r\n onCancel: () => {\r\n console.log('Deletion canceled');\r\n }\r\n });\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n if (!formGroupRef.current) {\r\n console.error('Form group is not initialized');\r\n return;\r\n }\r\n\r\n const formValues = formGroupRef.current.value;\r\n\r\n // Validation checks for required fields\r\n if (!formValues.templateName || formValues.templateName.trim() === '') {\r\n toastr.error('Error', 'Template name cannot be empty.');\r\n return; // Stop execution if validation fails\r\n }\r\n if (!formValues.brand) {\r\n toastr.error('Error', 'Please select a brand.');\r\n return; // Stop execution if validation fails\r\n }\r\n if (!formValues.jobType) {\r\n toastr.error('Error', 'Please select a job type.');\r\n return; // Stop execution if validation fails\r\n }\r\n\r\n const formData: IreportTemplate = {\r\n templateName: formValues.templateName,\r\n jobTypeID: formValues.jobType ? formValues.jobType.value : '',\r\n brandID: formValues.brand ? formValues.brand.value : '',\r\n isDefault: formValues.default || false,\r\n reportTemplateChapters: template?.reportTemplateChapters || [] // Include chapters if applicable\r\n };\r\n\r\n try {\r\n if (props.isAdd === false && template?.id) {\r\n // Editing mode\r\n const response = await updateReportTemplate(\r\n template.id,\r\n formData\r\n );\r\n\r\n if (response) {\r\n props.refetchTemplates();\r\n props.closeModal();\r\n }\r\n } else {\r\n // Adding mode\r\n const response = await createReportTemplate(formData);\r\n\r\n if (response) {\r\n props.refetchTemplates();\r\n props.closeModal();\r\n }\r\n }\r\n } catch (error) {\r\n console.error('Failed to save report template:', error);\r\n toastr.error('Error', 'Failed to save report template.');\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 {t('cancel')}\r\n \r\n\r\n {!props.isAdd && (\r\n \r\n {t('Delete')}\r\n \r\n )}\r\n\r\n \r\n Save\r\n \r\n \r\n\r\n {!props.isAdd && (\r\n \r\n )}\r\n\r\n
    \r\n {loading ? (\r\n
    Loading...
    // Loading state while fetching data\r\n ) : template?.reportTemplateChapters.length === 0 ? ( // Check if chapters are empty\r\n
    // Message when no chapters\r\n ) : (\r\n \r\n )}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: Iprops) => {\r\n return {\r\n productInfo: state.productInfo\r\n };\r\n};\r\n\r\nexport default withTranslation('manageReportBuilder')(\r\n connect(mapStateToProps, {})(WithCommonModal(ManageReportTemplateModal))\r\n);\r\n","import * as React from 'react';\r\nimport { FormUtil } from '../common/FormUtil';\r\nimport {\r\n FieldConfig,\r\n FormGenerator,\r\n FormGroup,\r\n AbstractControl\r\n} from 'react-reactive-form';\r\nimport { jobTypeOptionsTranslated } from '../../constants/constants';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { Ioption, IproductInfo } from '../../models';\r\n\r\n// Define the type for form values\r\ninterface FormValues {\r\n brand?: Ioption | null;\r\n jobType?: Ioption | null;\r\n default?: Ioption | null;\r\n}\r\n\r\ninterface IReportFilterFormProps {\r\n productInfo: IproductInfo;\r\n setFormGroup: (formValues: FormValues) => void; // Expect form values to be passed here\r\n}\r\n\r\nconst ManageReportFilter: React.FC = ({ t, productInfo, setFormGroup }) => {\r\n const formGroupRef = React.useRef(null); // Reference for FormGroup\r\n\r\n // Configure the search fields for the filter form\r\n const searchFieldConfig = (): FieldConfig => {\r\n return {\r\n controls: {\r\n brand: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: productInfo.allBrandOptions,\r\n label: t('FilterBrand'),\r\n colWidth: 2,\r\n placeholder: t('common:searchPlaceholder'),\r\n name: t('FilterBrand'),\r\n defaultValue: undefined,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: formGroupRef.current?.value?.brand,\r\n disabled: false\r\n }\r\n },\r\n jobType: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: jobTypeOptionsTranslated(t),\r\n label: t('FilterJobType'),\r\n colWidth: 2,\r\n placeholder: t('common:searchPlaceholder'),\r\n name: t('FilterJobType'),\r\n defaultValue: undefined,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: formGroupRef.current?.value?.jobType,\r\n disabled: false\r\n }\r\n },\r\n default: {\r\n render: FormUtil.Select,\r\n meta: {\r\n options: [\r\n { value: true, label: 'True' },\r\n { value: false, label: 'False' }\r\n ],\r\n label: t('FilterDefault'),\r\n colWidth: 2,\r\n name: 'default',\r\n defaultValue: null,\r\n isClearable: true\r\n },\r\n formState: {\r\n value: formGroupRef.current?.value?.default,\r\n disabled: false\r\n }\r\n }\r\n }\r\n };\r\n };\r\n\r\n // Function to handle when the form is mounted and track value changes\r\n const handleFormMount = (form: AbstractControl) => {\r\n formGroupRef.current = form as FormGroup;\r\n\r\n // Subscribe to value changes in the form and explicitly type `values`\r\n formGroupRef.current?.valueChanges.subscribe((values: FormValues) => {\r\n setFormGroup(values); // Pass the form values to the parent component\r\n });\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default withTranslation('manageReportBuilder')(ManageReportFilter);\r\n","import * as React from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect, useDispatch } from 'react-redux';\r\nimport { IinitialState } from '../../../reducers';\r\nimport { FormGenerator, FormGroup } from 'react-reactive-form';\r\nimport { FormUtil } from '../../common/FormUtil';\r\nimport { WithCommonModal } from '../../common/WithCommonModal';\r\nimport { Button, Col } from 'react-bootstrap';\r\nimport {\r\n IproductInfo,\r\n IreportChapter,\r\n IreportTemplateChapter,\r\n IreportTemplate\r\n} from '../../../models';\r\nimport {\r\n getAllChapters,\r\n createReportTemplateChapter,\r\n deleteReportTemplateChapter,\r\n getAllReportTemplateChapters\r\n} from '../../../actions/manageReportActions';\r\nimport { toastr } from 'react-redux-toastr'; // For confirmation dialogs\r\nimport { AbstractControl } from 'react-reactive-form';\r\nimport { beginAjaxCall, endAjaxCall } from '../../../actions/ajaxStatusActions';\r\n\r\ninterface Iprops {\r\n closeModal: () => void;\r\n show: boolean;\r\n template: IreportTemplate | undefined;\r\n selectedChapter?: IreportTemplateChapter; // New prop for the selected chapter\r\n isAddingChapter: boolean; // Flag to determine add/edit mode\r\n updateTemplate: (template: IreportTemplate) => void;\r\n}\r\n\r\ninterface IdispatchProps {\r\n productInfo: IproductInfo;\r\n}\r\n\r\nconst ManageReportAddChapterModal: React.FC = props => {\r\n const {\r\n t,\r\n show,\r\n closeModal,\r\n template,\r\n selectedChapter,\r\n isAddingChapter\r\n } = props;\r\n const formGroupRef = React.useRef(null); // Reference for FormGroup\r\n\r\n const [chapters, setChapters] = React.useState([]);\r\n const [\r\n currentChapter,\r\n setCurrentChapter\r\n ] = React.useState();\r\n const [loading, setLoading] = React.useState(true);\r\n const dispatch = useDispatch();\r\n\r\n // Form configuration\r\n const chapterFieldConfig = React.useMemo(\r\n () => ({\r\n controls: {\r\n chapter: {\r\n render: isAddingChapter\r\n ? FormUtil.Select\r\n : FormUtil.TextInput,\r\n meta: isAddingChapter\r\n ? {\r\n options: chapters.map(chapter => ({\r\n value: chapter.id,\r\n label: `${chapter.chapterName} - ${chapter.reportRevision}`\r\n })),\r\n label: 'Chapter Name',\r\n colWidth: 12,\r\n placeholder: 'Select a chapter',\r\n name: 'chapter',\r\n isClearable: true\r\n }\r\n : {\r\n label: 'Chapter Name',\r\n colWidth: 12,\r\n placeholder: 'Chapter Name',\r\n name: 'chapter',\r\n readOnly: true // Make the text input read-only in edit mode\r\n },\r\n formState: {\r\n value: isAddingChapter\r\n ? undefined\r\n : `${selectedChapter?.reportChapter?.chapterName} - ${selectedChapter?.reportChapter?.reportRevision}`, // Display the chapter name in edit mode\r\n disabled: !isAddingChapter // Keep it disabled in edit mode for the dropdown\r\n }\r\n }\r\n }\r\n }),\r\n [isAddingChapter, chapters, selectedChapter]\r\n );\r\n\r\n const setForm = (form: AbstractControl) => {\r\n formGroupRef.current = form as FormGroup;\r\n\r\n // Subscribe to value changes in the form and explicitly type `values`\r\n formGroupRef.current?.valueChanges.subscribe((values: any) => {\r\n if (values.chapter) {\r\n setCurrentChapter(\r\n chapters.find(\r\n chapter => chapter.id === values?.chapter?.value\r\n )\r\n );\r\n }\r\n });\r\n };\r\n\r\n const fetchChapters = async () => {\r\n try {\r\n const data = await getAllChapters();\r\n setChapters(data); // Set fetched chapters to state\r\n } catch (error) {\r\n console.error('Failed to fetch chapters:', error);\r\n } finally {\r\n setLoading(false);\r\n }\r\n };\r\n\r\n // Handle form submission (used in Add mode)\r\n const handleFormSubmit = async () => {\r\n if (!formGroupRef.current) {\r\n console.error('Form group is not initialized');\r\n return;\r\n }\r\n\r\n const chapterData: IreportTemplateChapter = {\r\n reportTemplateID: template?.id || '',\r\n reportChapterId: currentChapter?.id || '',\r\n order: 0\r\n };\r\n\r\n dispatch(beginAjaxCall()); // Dispatch an action to show a loader\r\n\r\n await createReportTemplateChapter(chapterData)\r\n .then(async () => {\r\n // get updated chapters\r\n let chapters: IreportTemplateChapter[] = await getAllReportTemplateChapters(\r\n template?.id || ''\r\n );\r\n // Update the template with the new chapters\r\n props.updateTemplate({\r\n ...template!,\r\n reportTemplateChapters: chapters\r\n });\r\n\r\n props.closeModal();\r\n })\r\n .finally(() => {\r\n dispatch(endAjaxCall()); // Dispatch an action to hide the loader\r\n });\r\n };\r\n\r\n // Show confirmation dialog using toastr\r\n const handleDeleteClick = () => {\r\n toastr.confirm('Are you sure you want to delete this chapter?', {\r\n onOk: async () => {\r\n try {\r\n // Call the delete function when the user confirms\r\n if (selectedChapter && template) {\r\n const reportTemplateChapter: IreportTemplateChapter = {\r\n reportChapterId: selectedChapter?.reportChapter?.id,\r\n order: 0,\r\n reportTemplateID: template.id // Using the template object to get reportTemplateID\r\n };\r\n\r\n // Pass the full IreportTemplateChapter object with the template info\r\n await deleteReportTemplateChapter(\r\n reportTemplateChapter\r\n );\r\n\r\n const data = await getAllReportTemplateChapters(\r\n template?.id || ''\r\n );\r\n\r\n props.updateTemplate({\r\n ...template,\r\n reportTemplateChapters: data\r\n }); // Update the template with fetched chapters\r\n\r\n props.closeModal(); // Close the modal after successful deletion\r\n }\r\n } catch (error) {\r\n console.error('Error while deleting the chapter:', error);\r\n }\r\n },\r\n onCancel: () => {\r\n console.log('Delete cancelled');\r\n },\r\n okText: t('Ok'),\r\n cancelText: t('Cancel')\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n fetchChapters(); // Fetch chapters on component mount\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n console.log('selectedChapter:', props.selectedChapter);\r\n if (props.selectedChapter) {\r\n setCurrentChapter(props.selectedChapter.reportChapter);\r\n }\r\n }, [props.selectedChapter]);\r\n\r\n if (!show) {\r\n return null; // Return null if the modal is not displayed\r\n }\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n\r\n {currentChapter && (\r\n
    \r\n

    \r\n Report #:{' '}\r\n {currentChapter.reportRevision}\r\n

    \r\n

    \r\n Chapter Description:{' '}\r\n {currentChapter.description}\r\n

    \r\n

    \r\n Category: {currentChapter.category}\r\n

    \r\n

    \r\n File Path:{' '}\r\n {currentChapter.templateFileName}\r\n

    \r\n

    \r\n Revision: {currentChapter.revision}\r\n

    \r\n
    \r\n )}\r\n
    \r\n\r\n \r\n \r\n {t('cancel')}\r\n \r\n\r\n {isAddingChapter ? (\r\n // Show Save button in Add mode\r\n \r\n {t('Save')}\r\n \r\n ) : (\r\n // Show Delete button in Edit mode\r\n \r\n {t('Delete')}\r\n \r\n )}\r\n \r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n return {\r\n productInfo: state.productInfo\r\n };\r\n};\r\n\r\nexport default withTranslation('manageReport')(\r\n connect(mapStateToProps, {})(WithCommonModal(ManageReportAddChapterModal))\r\n);\r\n","import React, { useEffect } from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\nimport { IinitialState } from '../../reducers';\r\nimport { Banner } from '../common/Banner';\r\nimport {\r\n Ioption,\r\n IproductInfo,\r\n IreportTemplateChapter,\r\n Itile\r\n} from '../../models';\r\nimport { IreportTemplate } from '../../models';\r\nimport { constants } from '../../constants/constants';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport ManageReportTemplateGrid from './ManageReportTemplateGrid';\r\nimport { Button } from 'react-bootstrap';\r\nimport ManageReportTemplateModal from './modals/ManageReportTemplateModal';\r\nimport ManageReportFilter from './ManageReportFilter';\r\nimport ManageReportAddChapterModal from './modals/ManageReportAddChapterModal';\r\nimport { getAllReportTemplates } from '../../actions/manageReportActions';\r\nimport { getProductInfo } from '../../actions/manageInventoryActions'; // import getProductInfo action\r\n\r\ntype Iprops = RouteComponentProps & IdispatchProps & WithTranslation;\r\n\r\ninterface IdispatchProps {\r\n productInfo: IproductInfo;\r\n getProductInfo: typeof getProductInfo; // add getProductInfo to props\r\n}\r\n\r\nconst ManageReportBuilder: React.FC = props => {\r\n const { t, productInfo } = props;\r\n const currentTile: Itile = constants.getTileByURL(props.location.pathname);\r\n\r\n const [reportTemplates, setReportTemplates] = React.useState<\r\n IreportTemplate[]\r\n >([]);\r\n\r\n // Function to fetch templates\r\n const fetchTemplates = async () => {\r\n const fetchedTemplates = await getAllReportTemplates();\r\n setReportTemplates(fetchedTemplates);\r\n };\r\n\r\n // Fetch product info on mount\r\n useEffect(() => {\r\n props.getProductInfo(); // Fetch product info when the component mounts\r\n fetchTemplates();\r\n }, []);\r\n\r\n const [selectedTemplate, setSelectedTemplate] = React.useState<\r\n IreportTemplate | undefined\r\n >(undefined);\r\n const [\r\n showManageTemplateModal,\r\n setShowManageTemplateModal\r\n ] = React.useState(false);\r\n const [isAddingTemplate, setIsAddingTemplate] = React.useState(\r\n false\r\n );\r\n const [showAddChapterModal, setShowAddChapterModal] = React.useState<\r\n boolean\r\n >(false);\r\n const [isAddingChapter, setIsAddingChapter] = React.useState(\r\n false\r\n );\r\n const [selectedChapter, setSelectedChapter] = React.useState<\r\n IreportTemplateChapter | undefined\r\n >(undefined);\r\n\r\n // Filter values state\r\n const [filterValues, setFilterValues] = React.useState<{\r\n brand: string | null;\r\n jobType: string | null;\r\n default: boolean | null;\r\n }>({\r\n brand: null,\r\n jobType: null,\r\n default: null\r\n });\r\n\r\n // Filter change handler\r\n const handleFilterChange = (formValues: {\r\n brand?: Ioption | null;\r\n jobType?: Ioption | null;\r\n default?: Ioption | null;\r\n }) => {\r\n let convertedDefault: boolean | null = null;\r\n if (\r\n formValues.default?.value !== null &&\r\n formValues.default?.value !== undefined\r\n ) {\r\n convertedDefault = formValues.default.value as any;\r\n }\r\n\r\n setFilterValues({\r\n brand: formValues.brand?.value || null,\r\n jobType: formValues.jobType?.value || null,\r\n default: convertedDefault // this will technically only be a boolean or null, even though Ioption.value is defined as a string...\r\n });\r\n };\r\n\r\n // Handle row click event to open modal\r\n const handleRowClick = (selectedTemplate: IreportTemplate) => {\r\n setSelectedTemplate(selectedTemplate);\r\n setIsAddingTemplate(false);\r\n setShowManageTemplateModal(true);\r\n };\r\n\r\n // Open add template modal\r\n const handleAddTemplateClick = () => {\r\n setSelectedTemplate(undefined);\r\n setIsAddingTemplate(true);\r\n setShowManageTemplateModal(true);\r\n };\r\n\r\n // Open add or edit chapter modal\r\n const openAddChapterModal = (\r\n isAdd: boolean,\r\n chapter?: IreportTemplateChapter\r\n ) => {\r\n setIsAddingChapter(isAdd); // Track if it's \"Add\" or \"Edit\" for chapter modal\r\n setSelectedChapter(chapter); // Track the selected chapter if editing\r\n setShowAddChapterModal(true);\r\n };\r\n\r\n return (\r\n
    \r\n \r\n\r\n \r\n\r\n
    \r\n \r\n \r\n {t('AddTemplate')}\r\n \r\n
    \r\n\r\n setShowManageTemplateModal(false)}\r\n className=\"first-modal\"\r\n closeModal={() => setShowManageTemplateModal(false)}\r\n template={selectedTemplate}\r\n openAddChapter={(isAdd, chapter) =>\r\n openAddChapterModal(isAdd, chapter)\r\n } // Pass isAdd and chapter to track add/edit for chapters\r\n isAdd={isAddingTemplate}\r\n updateTemplate={(template: IreportTemplate) =>\r\n setSelectedTemplate(template)\r\n }\r\n refetchTemplates={fetchTemplates}\r\n />\r\n\r\n setShowAddChapterModal(false)}\r\n title={\r\n isAddingChapter\r\n ? t('IsAddChapterTitle')\r\n : t('IsEditChapterTitle')\r\n } // Dynamic title based on isAddingChapter\r\n className=\"second-modal\"\r\n closeModal={() => setShowAddChapterModal(false)}\r\n template={selectedTemplate}\r\n selectedChapter={selectedChapter} // Pass the selected chapter\r\n isAddingChapter={isAddingChapter} // Pass if it's adding or editing\r\n updateTemplate={(template: IreportTemplate) =>\r\n setSelectedTemplate(template)\r\n }\r\n />\r\n
    \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n return { productInfo: state.productInfo };\r\n};\r\n\r\nexport default withTranslation('manageReportBuilder')(\r\n connect(mapStateToProps, { getProductInfo })(ManageReportBuilder)\r\n);\r\n","/*\r\n * TwoPaneLayout verifies that the user has access to this feature, then either shows the component or lets them know they do not have access\r\n */\r\n\r\nimport 'react-table/react-table.css';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Col, Grid, Row } from 'react-bootstrap';\r\nimport { Iuser } from '../../models';\r\nimport { Route, RouteComponentProps, Switch } from 'react-router-dom';\r\n\r\nimport { InstallBaseAnalyticsTableContainer } from '../dashboard/InstallBaseAnalyticsTableContainer';\r\nimport ManageAlert from '../manageAlert/ManageAlert';\r\nimport ManageBrand from '../manageBrand/ManageBrand';\r\nimport ManageCode from '../manageCode/ManageCode';\r\nimport ManageFacility from '../manageFacility/manageFacility';\r\nimport ManangeFacilityQueue from '../manageFacilityQueue/manageFacilityQueue';\r\nimport ManageDocumentLibrary from '../manageDocumentLibrary/ManageDocumentLibrary';\r\nimport ManageAssetPhotos from '../manageAssetPhotos/ManageAssetPhotos';\r\nimport { ManageInventoryContainer } from '../manageInventory/ManageInventoryContainer';\r\nimport ManageJob from '../manageJob/ManageJob';\r\nimport ManageJobComment from '../manageJobComment/ManageJobComment';\r\nimport ManageLeads from '../manageLeads/ManageLeads';\r\nimport ManageQuotes from '../manageQuotes/manageQuotes';\r\nimport ManageLocation from '../manageLocation/ManageLocation';\r\nimport ManageMeasurementPointList from '../manageMeasurementPointLists/ManageMeasurementPointLists';\r\nimport ManageProduct from '../manageProduct/ManageProduct';\r\nimport ManageProductQueue from '../manageProductQueue/ManageProductQueue';\r\nimport ManageReport from '../manageReport/ManageReport';\r\nimport ManageTeam from '../manageTeam/ManageTeam';\r\nimport ManageTraining from '../manageTraining/ManageTraining';\r\nimport ManageUser from '../manageUser/ManageUser';\r\nimport ManageUserQueue from '../manageUserQueue/ManageUserQueue';\r\nimport ManageWorkOrder from '../manageWorkOrder/manageWorkOrder';\r\nimport ManageSuggestedParts from '../manageSuggestedParts/ManageSuggestedParts';\r\nimport { PMPAnalyticsTableLayout } from '../dashboard/PMPAnalyticsTableLayout';\r\nimport SideMenu from '../sideMenu/SideMenu';\r\nimport Training from '../training/Training';\r\nimport { connect, useSelector } from 'react-redux';\r\nimport { constants } from '../../constants/constants';\r\nimport { IinitialState } from '../../reducers';\r\nimport Mixpanel from '../../helpers/Mixpanel';\r\nimport { toggleSideMenu } from '../../actions/commonActions';\r\nimport Dashboard from '../dashboard/Dashboard';\r\nimport { AnalyticsDetailContainer } from '../dashboard/AnalyticsDetailContainer';\r\nimport { AnalyticsDetailTaeContainer } from '../dashboard/AnalyticsDetailTaeContainer';\r\nimport { AnalyticsExpandedCardContainer } from '../dashboard/Analytics/AnalyticsExpandedCardContainer';\r\nimport { getIsMobile } from '../../reducers/configReducer';\r\nimport ManageInventoryDetails from '../manageInventory/mobile/ManageInventoryDetails';\r\nimport ManageReportBuilder from '../manageReportBuilder/ManageReportBuilder';\r\n\r\n// const testme = () => {\r\n// return

    Your test is a success

    ;\r\n// };\r\n\r\ninterface Iprops {\r\n user: Iuser;\r\n showSideMenu: boolean;\r\n toggleSideMenu: typeof toggleSideMenu;\r\n}\r\n\r\nconst TwoPaneLayout = (props: Iprops & RouteComponentProps<{}>) => {\r\n const isMobile = useSelector(getIsMobile);\r\n const tile = constants.getTileByURL(props.location.pathname);\r\n const hasAccess = constants.hasSecurityFunction(\r\n props.user,\r\n tile.securityFunctions\r\n );\r\n const menuClass = props.showSideMenu ? 'open' : 'closed';\r\n\r\n Mixpanel.track(`Viewed ${tile.title}`, { hasAccess });\r\n Mixpanel.identify(props.user.id);\r\n Mixpanel.people.set({\r\n $email: props.user.email,\r\n USER_ID: props.user.id\r\n });\r\n\r\n if (!isMobile && !hasAccess) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
    \r\n

    \r\n No access to {tile.title}. Please contact\r\n support and request access.\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 {!isMobile && (\r\n \r\n \r\n \r\n )}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n (\r\n \r\n )}\r\n />\r\n (\r\n \r\n )}\r\n />\r\n {/* new-route: asset_photos */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: any) => {\r\n return {\r\n user: state.user,\r\n showSideMenu: state.showSideMenu\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, { toggleSideMenu })(TwoPaneLayout);\r\n","import { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { connect } from 'react-redux';\r\nimport * as React from 'react';\r\nimport ReactHtmlParser from 'react-html-parser';\r\n\r\nimport { IAlert } from '../../models';\r\nimport {\r\n markAlertAsRead,\r\n markAllAlertAsRead,\r\n toggleUserAlertModal,\r\n getUserAlerts\r\n} from '../../actions/manageUserAlertActions';\r\nimport { Modal, Panel, PanelGroup, Col, Button } from 'react-bootstrap';\r\nimport moment from 'moment';\r\nimport { constant, orderBy } from 'lodash';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { constants } from '../../constants/constants';\r\n\r\ninterface IdispatchProps {\r\n loading: boolean;\r\n showUserAlertModal: boolean;\r\n ajaxCallsInProgress: number;\r\n toggleUserAlertModal: typeof toggleUserAlertModal;\r\n userAlerts: any;\r\n markAlertAsRead: typeof markAlertAsRead;\r\n markAllAlertAsRead: typeof markAllAlertAsRead;\r\n getUserAlerts: typeof getUserAlerts;\r\n}\r\n\r\ninterface State {\r\n classNameAnimation: string;\r\n alertsWereCleared: boolean;\r\n}\r\n\r\nconst alert_icon_white = require('../../images/icons/alert_white.png');\r\nconst alert_icon_gold = require('../../images/icons/alert_gold.png');\r\n\r\nclass UserAlertModal extends React.Component<\r\n IdispatchProps & WithTranslation,\r\n State\r\n> {\r\n constructor(props: IdispatchProps & WithTranslation) {\r\n super(props);\r\n this.state = {\r\n classNameAnimation: '',\r\n alertsWereCleared: false\r\n };\r\n }\r\n\r\n componentDidUpdate(\r\n prevProps: Readonly\r\n ): void {\r\n if (\r\n this.state.alertsWereCleared &&\r\n prevProps.ajaxCallsInProgress > this.props.ajaxCallsInProgress\r\n ) {\r\n this.props.getUserAlerts();\r\n this.setState({ alertsWereCleared: false });\r\n }\r\n }\r\n\r\n renderHeader() {\r\n const alertCounts = Object.keys(this.props.userAlerts).length;\r\n\r\n return (\r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n {`${alertCounts} ${this.props.t(\r\n 'alertNotification'\r\n )}`}\r\n \r\n
    \r\n
    \r\n
    \r\n \"icon\"\r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n renderAlertHead(alert: IAlert) {\r\n if (alert.type === 'alert') {\r\n return (\r\n \r\n \r\n
    \r\n \r\n {this.props.t('alert')}\r\n
    \r\n
    \r\n \r\n {alert.title}\r\n \r\n
    \r\n
    \r\n \r\n {moment\r\n .utc(alert.createDate)\r\n .local(true)\r\n .format(\r\n constants.momentDisplayFormatWithTimeAndSeconds\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 {this.props.t(`notice`)}\r\n
    \r\n
    \r\n \r\n {alert.title}\r\n \r\n
    \r\n
    \r\n \r\n {moment\r\n .utc(alert.createDate)\r\n .local(true)\r\n .format(constants.momentDisplayFormatWithTime)}\r\n \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n renderBackgroundDiv(\r\n url: string,\r\n height: number | null,\r\n width: number | null\r\n ) {\r\n if (url) {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n\r\n renderAlertContent(title: string, text: string) {\r\n return (\r\n \r\n
    \r\n {title}\r\n
    \r\n
    \r\n
    \r\n {ReactHtmlParser(text)}\r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n handleToggle(alert: IAlert) {\r\n if (alert.isViewed) {\r\n return;\r\n }\r\n this.props.markAlertAsRead(alert);\r\n }\r\n\r\n renderAlert(alert: IAlert) {\r\n return (\r\n {\r\n this.handleToggle(alert);\r\n }}\r\n eventKey={alert.id}\r\n key={alert.id}\r\n className={\r\n alert.type === 'alert'\r\n ? 'alerts-notification'\r\n : 'alerts-notification information'\r\n }\r\n >\r\n {this.renderAlertHead(alert)}\r\n {this.renderBackgroundDiv(alert.imageUrl, 200, null)}\r\n {this.renderAlertContent(alert.title, alert.text)}\r\n \r\n );\r\n }\r\n\r\n renderBody() {\r\n const body: any = [];\r\n for (const key in this.props.userAlerts) {\r\n body.push(this.renderAlert(this.props.userAlerts[key]));\r\n }\r\n\r\n if (body.length > 0) {\r\n return {body};\r\n }\r\n\r\n return
    {this.props.t('noContent')}
    ;\r\n }\r\n\r\n submit = () => {\r\n this.setState({ alertsWereCleared: true }, () => {\r\n this.props.markAllAlertAsRead();\r\n this.props.toggleUserAlertModal();\r\n });\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n {this.renderHeader()}\r\n \r\n {this.renderBody()}\r\n \r\n \r\n {this.props.t(`close`)}\r\n \r\n \r\n {this.props.t(`markAll`)}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState) => {\r\n const sortedAlerts = orderBy(\r\n state.alertsByID,\r\n res => moment.utc(res.createDate).unix(),\r\n 'desc'\r\n );\r\n\r\n return {\r\n userAlerts: sortedAlerts,\r\n loading: selectIsLoading(state),\r\n showUserAlertModal: state.showAlertModal,\r\n ajaxCallsInProgress: state.ajaxCallsInProgress\r\n };\r\n};\r\n\r\nexport default withTranslation('manageUserAlert')(\r\n connect(mapStateToProps, {\r\n toggleUserAlertModal,\r\n markAlertAsRead,\r\n markAllAlertAsRead,\r\n getUserAlerts\r\n })(UserAlertModal)\r\n);\r\n","import * as React from 'react';\r\n\r\ninterface LinkProps {\r\n id: string;\r\n}\r\n\r\nexport const SkipNavLink = ({ id }: LinkProps) => {\r\n return (\r\n \r\n Skip to content\r\n \r\n );\r\n};\r\n\r\ninterface ContentProps {\r\n id: string;\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const SkipNavContent = ({ id, children }: ContentProps) => {\r\n return
    {children}
    ;\r\n};\r\n","import { TFunction } from 'i18next';\r\nimport { map } from 'lodash';\r\nimport React, { Component } from 'react';\r\nimport Joyride, { CallBackProps, STATUS, Step } from 'react-joyride';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport {\r\n addView,\r\n setIsTutorialOpen,\r\n toggleTutorial\r\n} from '../../actions/tutorialActions';\r\nimport { constants } from '../../constants/constants';\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n t: TFunction;\r\n run: boolean;\r\n setIsTutorialOpen: typeof setIsTutorialOpen;\r\n toggleTutorial: typeof toggleTutorial;\r\n viewedTours: string[];\r\n steps: Step[];\r\n addView: typeof addView;\r\n}\r\n\r\nexport default class Tutorial extends Component {\r\n public translateTitles = (steps: Step[], t: TFunction) => {\r\n return map(steps, step => {\r\n if (step.title && typeof step.title === 'string') {\r\n return { ...step, title: t(step.title) };\r\n }\r\n return step;\r\n });\r\n };\r\n\r\n private handleJoyrideCallback = (data: CallBackProps) => {\r\n const { status } = data;\r\n\r\n if (([STATUS.FINISHED, STATUS.SKIPPED] as string[]).includes(status)) {\r\n this.props.setIsTutorialOpen(false);\r\n }\r\n if (([STATUS.RUNNING] as string[]).includes(status)) {\r\n const view = this.props.location.pathname.slice(1);\r\n this.props.addView(view);\r\n }\r\n };\r\n\r\n public render() {\r\n const { steps } = this.props;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","import { connect } from 'react-redux';\r\nimport { IinitialState } from '../../reducers';\r\nimport { withRouter, RouteComponentProps } from 'react-router';\r\n\r\nimport Tutorial from './Tutorial';\r\nimport {\r\n addView,\r\n setIsTutorialOpen,\r\n toggleTutorial\r\n} from '../../actions/tutorialActions';\r\n\r\nimport { constants } from '../../constants/constants';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: RouteComponentProps<{}> & WithTranslation\r\n) => {\r\n const { tutorial } = constants;\r\n let selectedSteps = tutorial.inventory.steps; // Just initially setting it up\r\n\r\n const { pathname } = ownProps.location;\r\n const modifiedPathname = pathname.slice(1); // Removes slash\r\n\r\n if (tutorial.hasOwnProperty(modifiedPathname)) {\r\n selectedSteps =\r\n tutorial[modifiedPathname as keyof typeof tutorial].steps;\r\n }\r\n return {\r\n viewedTours: state.tutorial.viewedTours,\r\n run: state.tutorial.run,\r\n steps: selectedSteps\r\n };\r\n};\r\n\r\nexport default withRouter(\r\n withTranslation('nsTutorial')(\r\n connect(mapStateToProps, {\r\n setIsTutorialOpen,\r\n toggleTutorial,\r\n addView\r\n })(Tutorial)\r\n )\r\n);\r\n","import React from 'react';\r\nimport { HubConnection, HubConnectionBuilder } from '@microsoft/signalr';\r\nimport API from '../../constants/apiEndpoints';\r\nimport { IAlert, Iuser } from '../../models';\r\nimport { addUserAlert } from '../../actions/manageUserAlertActions';\r\nimport { setSelectedFacilityID } from '../../actions/commonActions';\r\nimport { getDashboardAnalytics } from '../../actions/dashboardAnalyticsActions';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { debounce } from 'lodash';\r\n\r\ninterface Istate {\r\n connections: HubConnection[];\r\n}\r\n\r\ninterface Iprops extends RouteComponentProps {\r\n userID: string;\r\n securityFunctions: any[];\r\n online: boolean;\r\n loading: boolean;\r\n user: Iuser;\r\n addUserAlert: typeof addUserAlert;\r\n setSelectedFacilityID: typeof setSelectedFacilityID;\r\n getDashboardAnalytics: typeof getDashboardAnalytics;\r\n}\r\n\r\nexport default class Smartlink extends React.Component {\r\n debouncedConnect: () => void;\r\n constructor(props: Iprops) {\r\n super(props);\r\n // Cautiously prevent an infinite loop for some unknown reason\r\n this.debouncedConnect = debounce(this.connect, 10000);\r\n }\r\n\r\n componentDidMount() {\r\n this.setConnection();\r\n }\r\n\r\n componentDidUpdate(prevProps: Iprops) {\r\n if (this.state.connections && this.props.online) {\r\n this.debouncedConnect();\r\n }\r\n }\r\n\r\n setConnection() {\r\n const { user } = this.props;\r\n let connectionsToSave: HubConnection[] = [];\r\n\r\n if (user && user.facilities && user.facilities.length > 0) {\r\n user.facilities.forEach(facility => {\r\n // Check if connection already exists and if it's connected\r\n let existingConnection: HubConnection | undefined = undefined;\r\n\r\n if (\r\n this.state &&\r\n this.state.connections &&\r\n this.state.connections.length > 0\r\n ) {\r\n existingConnection = this.state.connections.find(\r\n connection => connection.baseUrl.includes(facility.id)\r\n );\r\n }\r\n\r\n if (\r\n existingConnection &&\r\n existingConnection.state === 'Connected'\r\n ) {\r\n connectionsToSave.push(existingConnection);\r\n } else {\r\n // Create new connection\r\n const newConnection = new HubConnectionBuilder()\r\n .withUrl(\r\n `${API.smartlink.alert}?facilityID=${facility.id}`\r\n )\r\n .withAutomaticReconnect()\r\n // .configureLogging(LogLevel.Critical)\r\n .build();\r\n\r\n connectionsToSave.push(newConnection);\r\n }\r\n });\r\n }\r\n\r\n this.setState({ connections: connectionsToSave });\r\n }\r\n\r\n connect() {\r\n const { connections } = this.state;\r\n connections.forEach(connection => {\r\n if (connection.state !== 'Connected') {\r\n connection\r\n .start()\r\n .then(_ => {\r\n console.info('Connected!');\r\n this.listenForMessages();\r\n })\r\n .catch(err => console.error(err));\r\n }\r\n });\r\n }\r\n showSmartlinkFlag() {\r\n if (this.props.location.pathname === '/dashboard') {\r\n // this.props.getDashboardAnalytics();\r\n }\r\n }\r\n\r\n listenForMessages() {\r\n const { connections } = this.state;\r\n\r\n connections.forEach(connection => {\r\n connection.on('dashboardSmartLinkAlarm', _ => {\r\n this.showSmartlinkFlag();\r\n });\r\n\r\n connection.on('alertMessage', (alert: IAlert) => {\r\n // Call action dispatch alert to store\r\n this.props.addUserAlert(alert);\r\n console.info('alert received!');\r\n });\r\n\r\n connection.on('clearAlertMessage', (alert: IAlert) => {\r\n this.props.addUserAlert(alert);\r\n console.info('clear alert received!');\r\n });\r\n });\r\n\r\n console.info('listening for alert message');\r\n }\r\n\r\n render() {\r\n return <>;\r\n }\r\n}\r\n","/*\r\n * smartlink Analytics Container\r\n */\r\n\r\nimport Smartlink from './SmartLink';\r\nimport { connect } from 'react-redux';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { selectIsLoading } from '../../reducers/commonReducers';\r\nimport { IinitialState } from '../../reducers';\r\nimport { addUserAlert } from '../../actions/manageUserAlertActions';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport { setSelectedFacilityID } from '../../actions/commonActions';\r\nimport { getDashboardAnalytics } from '../../actions/dashboardAnalyticsActions';\r\nimport { selectDataFormatPreference } from '../../reducers/dashboardAnalyticsReducer';\r\n\r\nconst mapStateToProps = (\r\n state: IinitialState,\r\n ownProps: WithTranslation & RouteComponentProps\r\n) => {\r\n const { user } = state;\r\n const { securityFunctions, id } = user;\r\n const dataFormatPreference = selectDataFormatPreference(state);\r\n return {\r\n securityFunctions,\r\n loading: selectIsLoading(state),\r\n userID: id,\r\n online: state.offline.online,\r\n dataFormatPreference,\r\n user\r\n };\r\n};\r\n\r\nexport const SmartlinkContainer = withRouter(\r\n withTranslation('manageTae')(\r\n connect(mapStateToProps, {\r\n addUserAlert,\r\n setSelectedFacilityID,\r\n getDashboardAnalytics\r\n })(Smartlink)\r\n )\r\n);\r\n","import React, { useEffect, useState } from 'react';\r\nimport { setIsMobile } from '../../actions/configActions';\r\nimport { useDispatch } from 'react-redux';\r\nimport { debounce } from 'lodash';\r\n\r\nexport default () => {\r\n const [width, setWidth] = useState(window.innerWidth);\r\n const disaptch = useDispatch();\r\n\r\n const handleWindowSizeChange = debounce(() => {\r\n setWidth(window.innerWidth);\r\n }, 200);\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', handleWindowSizeChange);\r\n return () => {\r\n window.removeEventListener('resize', handleWindowSizeChange);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n disaptch(setIsMobile(width <= 1024));\r\n }, [width]);\r\n\r\n return null;\r\n};\r\n","import * as types from './actionTypes';\r\n\r\nexport const setIsMobile = (value: boolean) => ({\r\n type: types.SET_IS_MOBILE,\r\n value\r\n});\r\n\r\nexport default {}; // Typescript yells and won't compile without this...\r\n","import { Col, Grid, Row } from 'react-bootstrap';\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\n\r\nconst AccountPending: React.FC = ({ t }) => {\r\n return (\r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n Thank you for visiting MyMedGas, your account is\r\n pending verification and activation from our\r\n team. Typically this should take a day or two.\r\n However, if you have any questions please don't\r\n hesitate to email us at{' '}\r\n \r\n mymedgas.support@beaconmedaes.com\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n );\r\n};\r\n\r\nexport default withTranslation('auth')(AccountPending);\r\n","import * as React from 'react';\r\n\r\n// MSAL imports\r\nimport { withMsal, WithMsalProps } from '@azure/msal-react';\r\nimport { PublicClientApplication } from '@azure/msal-browser';\r\nimport { debugMSAL } from './components/auth/Auth-Utils';\r\nimport { QueryClient, QueryClientProvider } from 'react-query';\r\nimport { ReactQueryDevtools } from 'react-query/devtools';\r\nimport { Iuser } from './models';\r\nimport {\r\n Redirect,\r\n Route,\r\n BrowserRouter as Router,\r\n Switch\r\n} from 'react-router-dom';\r\nimport ReduxToastr, { toastr } from 'react-redux-toastr';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\n\r\nimport Header from './components/header/Header';\r\nimport Login from './components/auth/Login';\r\nimport SignUpDirect from './components/auth/SignUpDirect';\r\nimport { ToastrState } from './typings/react-redux-toastr';\r\nimport { TrackJS } from 'trackjs';\r\nimport TwoPaneLayout from './components/common/TwoPaneLayout';\r\nimport UserAlertModal from './components/userAlertModal/userAlertModal';\r\nimport { closeAllModals } from './actions/commonActions';\r\nimport { connect } from 'react-redux';\r\nimport { constants } from './constants/constants';\r\nimport initialState from './reducers/initialState';\r\nimport moment from 'moment';\r\nimport { setRedirectPathname } from './actions/redirectToReferrerAction';\r\nimport { throttle } from 'lodash';\r\nimport { userLogout, userLogoutSessionOnly } from './actions/userActions';\r\nimport { getUserAlerts } from './actions/manageUserAlertActions';\r\nimport { selectIsLoading } from './reducers/commonReducers';\r\nimport { IinitialState } from './reducers';\r\nimport { SkipNavContent, SkipNavLink } from './components/skipNav/SkipNav';\r\nimport TutorialContainer from './components/tutorial/TutorialContainer';\r\nimport Mixpanel from './helpers/Mixpanel';\r\nimport { SmartlinkContainer } from './components/dashboard/SmartLinkContainer';\r\nimport MobileProvider from './components/common/MobileProvider';\r\nimport msalInstance from './components/auth/MsalInstance';\r\nimport AccountPending from './components/auth/AccountPending';\r\nwindow.addEventListener('beforeinstallprompt', (evt: any) => {\r\n console.info('install prompt triggered');\r\n // Prevent Chrome 67 and earlier from automatically showing the prompt\r\n // e.preventDefault();\r\n // // Stash the event so it can be triggered later.\r\n // deferredPrompt = e;\r\n});\r\nconst queryClient = new QueryClient();\r\n// moment.locale('de')\r\n\r\n// const ErrorPage = (error: any) =>

    Error: {error}

    ;\r\nconst NoMatch = ({ location }: any) => {\r\n console.error(`no match for route: ${location.pathname}`);\r\n return (\r\n

    \r\n {location.pathname} does not exist\r\n

    \r\n );\r\n};\r\n\r\ninterface Props extends React.Props {\r\n user: Iuser;\r\n setRedirectPathname: (pathname: string, setRedirect?: boolean) => void;\r\n toastr: ToastrState;\r\n userLogout: typeof userLogout;\r\n online: boolean;\r\n closeAllModals: typeof closeAllModals;\r\n getUserAlerts: typeof getUserAlerts;\r\n userLogoutSessionOnly: typeof userLogoutSessionOnly;\r\n pca: PublicClientApplication;\r\n}\r\ninterface State {\r\n fullScreenLoading: boolean;\r\n redirectToSocialSignup: boolean;\r\n}\r\n\r\nclass App extends React.Component<\r\n Props & WithTranslation & WithMsalProps,\r\n State\r\n> {\r\n constructor(props: Props & WithTranslation & WithMsalProps) {\r\n super(props);\r\n this.state = {\r\n fullScreenLoading: false,\r\n redirectToSocialSignup: false\r\n };\r\n this.handleSetRedirect = throttle(this.handleSetRedirect, 5000);\r\n debugMSAL(this.props.msalContext.instance.getAllAccounts());\r\n\r\n // Set the instance in Auth-Utilis\r\n debugMSAL(this.props.msalContext.instance);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.msalContext.instance.getAllAccounts().length > 0) {\r\n if (this.props.msalContext.instance.getAllAccounts().length > 1) {\r\n console.info(\r\n 'multiple msal accounts not supported, logging out'\r\n );\r\n this.props.userLogoutSessionOnly();\r\n\r\n return;\r\n }\r\n this.props.msalContext.instance.setActiveAccount(\r\n this.props.msalContext.instance.getAllAccounts()[0]\r\n );\r\n }\r\n\r\n this.doubleCheckOfflineStatus();\r\n\r\n document.addEventListener(\r\n 'missingUser',\r\n this.handleRedirectToSignup,\r\n false\r\n );\r\n document.addEventListener(\r\n 'newVersionAvailable',\r\n this.handleNewVersion,\r\n false\r\n );\r\n document.addEventListener('startUserLogout', this.handleLogout, false);\r\n document.addEventListener(\r\n 'startUserLogoutSessionOnly',\r\n this.props.userLogoutSessionOnly,\r\n false\r\n );\r\n\r\n if (this.props.user.email.length) {\r\n TrackJS.configure({\r\n userId: this.props.user.email,\r\n version: process.env.REACT_APP_VERSION\r\n });\r\n\r\n Mixpanel.track('User Launched App');\r\n Mixpanel.identify(this.props.user.id);\r\n Mixpanel.people.set({\r\n $email: this.props.user.email,\r\n USER_ID: this.props.user.id\r\n });\r\n // const idTokenClaims = msalApp.getAccount().idTokenClaims as any;\r\n // const authTimeLeft = (idTokenClaims.exp - idTokenClaims.auth_time) / 60\r\n // console.info('app is loaded and authenticated', `${authTimeLeft} min`);\r\n // console.info('app is loaded and authenticated', this.props.i18n.language);\r\n }\r\n\r\n moment.locale(this.props.i18n.language);\r\n\r\n console.info(\r\n 'language: ' + this.props.i18n.language,\r\n 'moment locale: ' + moment.locale(this.props.i18n.language)\r\n );\r\n\r\n console.log('msalApp', msalInstance.msalApp);\r\n console.log(\r\n 'msalApp?.getAllAccounts()',\r\n msalInstance.msalApp?.getAllAccounts()\r\n );\r\n if (msalInstance.msalApp?.getAllAccounts().length > 0) {\r\n setTimeout(() => {\r\n this.appLaunchSync();\r\n }, 1000);\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\r\n 'missingUser',\r\n this.handleRedirectToSignup,\r\n false\r\n );\r\n document.removeEventListener(\r\n 'newVersionAvailable',\r\n this.handleNewVersion,\r\n false\r\n );\r\n document.removeEventListener(\r\n 'startUserLogout',\r\n this.handleLogout,\r\n false\r\n );\r\n document.removeEventListener(\r\n 'startUserLogoutSessionOnly',\r\n this.props.userLogoutSessionOnly,\r\n false\r\n );\r\n }\r\n\r\n doubleCheckOfflineStatus = () => {\r\n console.info('browser online: ', navigator.onLine);\r\n console.info('redux-offline online:', this.props.online);\r\n if (window.navigator.onLine) {\r\n window.dispatchEvent(new Event('online'));\r\n } else {\r\n window.dispatchEvent(new Event('offline'));\r\n }\r\n };\r\n\r\n /*\r\n * appLaunchSync\r\n * retrieve any potentially stale data\r\n */\r\n appLaunchSync = () => {\r\n console.log('appLaunchSync');\r\n this.props.getUserAlerts();\r\n };\r\n\r\n handleLogout = () => {\r\n this.props.userLogout(this.props.t);\r\n };\r\n handleSetRedirect = () => {\r\n const { pathname, search } = window.location;\r\n this.props.setRedirectPathname(`${pathname}${search}`, true);\r\n };\r\n handleRedirectToSignup = () => {\r\n this.setState({ redirectToSocialSignup: true }, () => {\r\n this.setState({ redirectToSocialSignup: false });\r\n });\r\n };\r\n\r\n PrivateRoute = ({ component: Component, ...rest }: any) => {\r\n const { user } = this.props;\r\n const authenticated =\r\n // msalApp.getAccount() && user.isAuthenticated && user.id.length > 0;\r\n user.id.length > 0; // do not check validity of token here because we do not handle renewing the token when simply navigating to a new route\r\n if (authenticated) {\r\n this.handleSetRedirect();\r\n }\r\n return (\r\n \r\n authenticated ? (\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n />\r\n );\r\n };\r\n\r\n handleNewVersion = () => {\r\n toastr.warning('Installing Update', 'Please wait...', {\r\n ...constants.toastrWarning,\r\n timeOut: 8000\r\n });\r\n setTimeout(() => {\r\n window.location.reload();\r\n }, 6000);\r\n };\r\n\r\n render() {\r\n const { PrivateRoute } = this;\r\n if (this.state.redirectToSocialSignup) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n return (\r\n \r\n
    \r\n {/* */}\r\n {/* TODO? Replace route pathnames with constants. */}\r\n \r\n \r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* TODO Waiting on Signal R to finish their stuff */}\r\n {this.props.user.id && }\r\n \r\n \r\n \r\n this.props.toastr || initialState.toastr\r\n }\r\n />\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state: IinitialState, ownProps: any) => {\r\n return {\r\n user: state.user,\r\n loading: selectIsLoading(state),\r\n toastr: state.toastr,\r\n online: state.offline.online\r\n };\r\n};\r\n\r\nexport default withTranslation('')(\r\n withMsal(\r\n connect(mapStateToProps, {\r\n setRedirectPathname,\r\n closeAllModals,\r\n userLogout,\r\n getUserAlerts,\r\n userLogoutSessionOnly\r\n })(App)\r\n )\r\n);\r\n","import { TrackJS } from 'trackjs';\r\n\r\nconst TrackJSLogger = (store: any) => (next: any) => (action: any) => {\r\n try {\r\n // log every action so they appear in the TrackJS telemetry timeline\r\n TrackJS.console.info(action);\r\n return next(action);\r\n } catch (err) {\r\n // Something bad happened, lets log out the entire state so we can see it in the timeline\r\n console.warn(store.getState());\r\n\r\n // NOTE: this assumes TrackJS was initialized previously, at app startup.\r\n TrackJS.track(err);\r\n }\r\n};\r\n\r\nexport default TrackJSLogger;\r\n","import { MigrationManifest } from 'redux-persist';\r\nimport initialState from '../reducers/initialState';\r\nimport { IinitialState } from '../reducers';\r\n\r\n/*\r\n * Migration 1 runs when upgrading from 0 to 1\r\n * 0.0.1 = 1 and 0.2.2 = 22\r\n */\r\n\r\nconst typedMigrations = {\r\n 180: state => {\r\n console.info('running migration 180');\r\n const { productInfo } = initialState;\r\n return {\r\n ...state,\r\n productInfo\r\n };\r\n },\r\n 192: state => {\r\n console.info('running migration 192');\r\n const { tutorial } = initialState;\r\n return {\r\n ...state,\r\n tutorial\r\n };\r\n },\r\n 193: state => {\r\n console.info('running migration 193');\r\n const { manageProductQueue } = initialState;\r\n return {\r\n ...state,\r\n manageProductQueue\r\n };\r\n },\r\n 211: state => {\r\n console.info('running migration 211');\r\n const { manageJob } = initialState;\r\n return {\r\n ...state,\r\n manageJob\r\n };\r\n },\r\n 222: state => {\r\n console.info('running migration 222');\r\n const { manageUser, manageUserQueue } = initialState;\r\n return {\r\n ...state,\r\n manageUser,\r\n manageUserQueue\r\n };\r\n },\r\n 223: state => {\r\n console.info('running migration 223');\r\n const { customersWithFacilities } = initialState;\r\n return {\r\n ...state,\r\n customersWithFacilities\r\n };\r\n }\r\n} as { [key: string]: (state: IinitialState) => IinitialState };\r\n\r\nconst untypedMigrations = typedMigrations as any;\r\nexport const migrations = untypedMigrations as MigrationManifest;\r\n","import * as types from '../actions/actionTypes';\r\nimport initialState from './initialState';\r\n\r\nfunction actionTypeEndsInSuccess(type: string) {\r\n return type.substring(type.length - 8) === '_SUCCESS';\r\n}\r\n\r\nfunction actionTypeEndsInFailed(type: string) {\r\n return type.substring(type.length - 7) === '_FAILED';\r\n}\r\n\r\nexport default function ajaxStatusReducer(\r\n state: number = initialState.ajaxCallsInProgress,\r\n action: any\r\n) {\r\n if (action.type === types.BEGIN_AJAX_CALL) {\r\n return state + 1;\r\n } else if (\r\n state >= 1 &&\r\n (actionTypeEndsInSuccess(action.type) ||\r\n actionTypeEndsInFailed(action.type))\r\n ) {\r\n return state - 1;\r\n } else if (state >= 1 && action.type === types.END_AJAX_CALL) {\r\n return state - 1;\r\n }\r\n\r\n return state;\r\n}\r\n","import { initialDocument } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { IcloudDocument, ImanageManageDocumentReducer } from '../models';\r\nimport {\r\n createFormValuesWithName,\r\n createSelectedIDWithName,\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { pickBy, map, keyBy, orderBy, filter } from 'lodash';\r\nimport * as moment from 'moment';\r\nimport { combineReducers } from 'redux';\r\nimport { documentTypeMapping } from '../constants/constants';\r\nimport { DocumentGroups } from '../models-enums';\r\n\r\nconst cleanDocumentObject = (document: IcloudDocument) => {\r\n return {\r\n ...initialDocument,\r\n ...pickBy(document, property => property !== null)\r\n } as IcloudDocument;\r\n};\r\n\r\nconst groupDocumentObjects = (document: IcloudDocument): IcloudDocument => {\r\n let groupType =\r\n documentTypeMapping[document.cloudDocumentTypeID.toUpperCase()];\r\n let otherGroup = false;\r\n if (groupType === undefined) {\r\n otherGroup = true;\r\n groupType = DocumentGroups.reports;\r\n }\r\n return {\r\n ...document,\r\n otherGroup,\r\n groupType\r\n };\r\n};\r\n\r\nexport const processDocumentData = (results: IcloudDocument[]) => {\r\n return map(results, (documents: IcloudDocument[]) => {\r\n const orderedDocuments = orderBy(\r\n documents,\r\n res => moment.utc(res.createDate).unix(),\r\n 'asc'\r\n );\r\n if (orderedDocuments.length > 1) {\r\n orderedDocuments[0].isPrimary = true;\r\n }\r\n return { ...orderedDocuments[0], versions: orderedDocuments };\r\n }) as any;\r\n};\r\n\r\nexport function documentsByID(\r\n state: { [key: string]: IcloudDocument } = {},\r\n action: any\r\n): { [key: string]: IcloudDocument } {\r\n switch (action.type) {\r\n case types.LOAD_DOCUMENTS_SUCCESS: {\r\n let newDocuments = map(\r\n action.payload.result,\r\n (document: IcloudDocument) => {\r\n return groupDocumentObjects(cleanDocumentObject(document));\r\n }\r\n ) as IcloudDocument[];\r\n return keyBy(newDocuments, 'id');\r\n }\r\n case types.ADD_DOCUMENT_SUCCESS:\r\n const doc = groupDocumentObjects(action.payload);\r\n return {\r\n ...state,\r\n [action.payload.id]: {\r\n ...doc,\r\n versions: [doc]\r\n }\r\n };\r\n case types.ADD_DOCUMENT_VERSION_SUCCESS: {\r\n const doc = groupDocumentObjects(action.payload);\r\n const parentDoc = { ...state[action.parentId] };\r\n parentDoc.versions = [...(parentDoc.versions || []), doc];\r\n return { ...state, [action.parentId]: parentDoc };\r\n }\r\n case types.EDIT_DOCUMENT_SUCCESS: {\r\n const doc = groupDocumentObjects(action.payload);\r\n const parentDocument = { ...state[action.parentId] };\r\n const versionDocuments = parentDocument.versions;\r\n // it is primary if it's id is the same as the parent.\r\n if (\r\n action.payload.id !== action.parentId &&\r\n versionDocuments &&\r\n versionDocuments.length > 0\r\n ) {\r\n // editing a version\r\n let versionIndex = -1;\r\n for (let i = 0; i < versionDocuments.length; i++) {\r\n if (versionDocuments[i].id === action.payload.id) {\r\n versionIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n [action.parentId]: {\r\n ...state[action.parentId],\r\n versions: (\r\n state[action.parentId].versions || []\r\n ).map((version, i) =>\r\n i === versionIndex ? doc : version\r\n )\r\n }\r\n };\r\n } else {\r\n // Editing the Primary doc\r\n const versions = state[action.parentId].versions;\r\n\r\n return {\r\n ...state,\r\n [action.parentId]: {\r\n ...doc,\r\n versions: (versions || []).map((version, i) =>\r\n i === 0 ? { ...doc, isPrimary: true } : version\r\n )\r\n }\r\n };\r\n }\r\n }\r\n case types.REMOVE_DOCUMENT_SUCCESS: {\r\n const doc = { ...state[action.parentId] };\r\n doc.versions = filter(\r\n doc.versions,\r\n version => version.id !== action.payload.id\r\n );\r\n if (doc.versions.length === 0) {\r\n const data = { ...state };\r\n delete data[action.parentId];\r\n return data;\r\n }\r\n\r\n return { ...state, [action.parentId]: doc };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.DOCUMENT_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\nconst documentManage = combineReducers({\r\n documentsByID,\r\n totalPages,\r\n documentFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_DOCUMENT'),\r\n versionFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_DOCUMENT_VERSION'),\r\n selectedParentID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'PARENT_ID'),\r\n selectedDocumentID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'DOCUMENT_ID'),\r\n showEditDocumentModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_DOCUMENT'),\r\n showEditVersionModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_DOCUMENT_VERSION'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_DOCUMENT')\r\n});\r\n\r\nexport default documentManage;\r\n","import * as types from '../actions/actionTypes';\r\nimport { IAlert, ImanageAlertReducer } from '../models';\r\nimport {\r\n createSelectedIDWithName,\r\n createTableFiltersWithName,\r\n modalToggleWithName,\r\n createFormValuesWithName\r\n} from './commonReducers';\r\nimport { combineReducers } from 'redux';\r\nimport { pickBy, map, keyBy } from 'lodash';\r\n\r\nconst cleanAlertObject = (alert: IAlert) => {\r\n return {\r\n ...pickBy(alert, property => property !== null)\r\n } as IAlert;\r\n};\r\n\r\nexport function alertsByID(state: { [key: string]: IAlert } = {}, action: any) {\r\n switch (action.type) {\r\n case types.LOAD_ALERTS_SUCCESS: {\r\n const newAlerts = map(action.payload, (alert: IAlert) => {\r\n return cleanAlertObject(alert);\r\n });\r\n return keyBy(newAlerts, 'id');\r\n }\r\n case types.ADD_ALERT_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.EDIT_ALERT_SUCCESS:\r\n return { ...state, [action.payload.id]: action.payload };\r\n case types.REMOVE_ALERT_SUCCESS: {\r\n const data = { ...state };\r\n delete data[action.payload.id];\r\n return data;\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.ALERT_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageAlert = combineReducers({\r\n alertsByID,\r\n totalPages,\r\n selectedAlertID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'ALERT_ID'),\r\n showEditAlertModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_ALERT'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_ALERT'),\r\n alertFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_ALERT')\r\n});\r\n\r\nexport default manageAlert;\r\n","import { pickBy, map, keyBy } from 'lodash';\r\n\r\nimport { IjobComment, ImanageJobCommentsReducer } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { initialJobComment } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { combineReducers } from 'redux';\r\n\r\nconst cleanJobCommentObject = (jobComment: any): IjobComment => {\r\n return {\r\n ...initialJobComment,\r\n ...pickBy(jobComment, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nfunction jobCommentsByID(\r\n state: { [key: string]: IjobComment } = {},\r\n action: any\r\n): { [key: string]: IjobComment } {\r\n switch (action.type) {\r\n case types.MANAGE_JOB_COMMENTS_SUCCESS: {\r\n const newData = map(action.jobComments, item => {\r\n return cleanJobCommentObject(item);\r\n });\r\n return { ...state, ...keyBy(newData, 'id') };\r\n }\r\n case types.MANAGE_JOB_COMMENTS_ADD:\r\n return { ...state, [action.jobComment.id]: action.jobComment };\r\n case types.MANAGE_JOB_COMMENTS_UPDATE:\r\n return {\r\n ...state,\r\n [action.jobComment.id]: cleanJobCommentObject(action.jobComment)\r\n }; // clean it here beacuase we receive updated comments from /latest\r\n\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n// function codesReducer(\r\n// state: { [key: string]: IdeficiencyCode } = {},\r\n// action: any\r\n// ): { [key: string]: IdeficiencyCode } {\r\n// switch (action.type) {\r\n// case types.MANAGE_JOB_COMMENT_CODES_SUCCESS:\r\n// const newData = map(action.codes, item => {\r\n// return cleanJobCommentCodeObject(item);\r\n// });\r\n// return { ...state, ...keyBy(newData, 'id') };\r\n// case types.USER_LOGOUT_SUCCESS:\r\n// return {};\r\n// default:\r\n// return state;\r\n// }\r\n// }\r\n\r\nfunction selectedJobComment(\r\n state: IjobComment = initialJobComment,\r\n action: any\r\n): IjobComment {\r\n switch (action.type) {\r\n case types.MANAGE_JOB_COMMENTS_SELECT:\r\n return action.jobComment;\r\n case types.MANAGE_JOB_COMMENTS_ADD:\r\n return action.jobComment;\r\n case types.MANAGE_JOB_COMMENTS_UPDATE: {\r\n // this helps update the job /latest\r\n const foundJobComment = action.jobComment.id === state.id;\r\n if (foundJobComment) {\r\n return cleanJobCommentObject(action.jobComment);\r\n } else {\r\n return state;\r\n }\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialJobComment;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction filteredJobComments(\r\n state: IjobComment[] = [],\r\n action: any\r\n): IjobComment[] {\r\n switch (action.type) {\r\n case types.MANAGE_JOB_COMMENTS_FILTER_VISIBLE:\r\n return action.filteredJobComments;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return [];\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageJobCommentsReducer = combineReducers({\r\n jobCommentsByID,\r\n selectedJobComment,\r\n showEditJobCommentModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_JOB_COMMENT'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_JOB_COMMENTS'),\r\n filteredJobComments\r\n});\r\n\r\nexport default manageJobCommentsReducer;\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport { IinstallBase, Iproduct } from '../models';\r\nimport initialState, { initialProduct } from './initialState';\r\nimport { keyBy, map, pickBy } from 'lodash';\r\n\r\n/*\r\n * the product object is returned with all the installBases nested inside of it\r\n * the filtered installBases are beside it. We repalce the installBases nested inside becuase those are the install bases we care about\r\n * at some point the API can be updated to not send all the installBases since this is not used.\r\n * for now we are replacing state. eventually we can change this to update state with the new products. we just need to filter by facilityID in the views\r\n */\r\nexport const cleanAndFilterProductObject = (product: Iproduct): Iproduct => {\r\n return {\r\n ...initialProduct,\r\n ...(pickBy(product, (property, key) => property !== null) as Iproduct),\r\n installBasesCount: product.installBases\r\n ? product.installBases.length\r\n : 0,\r\n installBases: undefined\r\n };\r\n};\r\n\r\nexport const productsReducer = (\r\n state: { [key: string]: Iproduct } = initialState.manageInventory\r\n .productsByID,\r\n action: any\r\n): { [key: string]: Iproduct } => {\r\n switch (action.type) {\r\n case types.GET_INVENTORY_SUCCESS: {\r\n const newProducts = keyBy(\r\n map(\r\n action.inventory,\r\n ({\r\n product,\r\n installBases\r\n }: {\r\n product: Iproduct;\r\n installBases: IinstallBase[];\r\n }) => {\r\n return cleanAndFilterProductObject(product);\r\n }\r\n ),\r\n 'id'\r\n );\r\n return { ...state, ...newProducts };\r\n //return newProducts;\r\n }\r\n case types.PRODUCT_UPDATE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.product.id]: cleanAndFilterProductObject(action.product)\r\n };\r\n\r\n case types.PRODUCT_ADD_SUCCESS:\r\n // TODO not showing added product until we build the queue\r\n // return map(state, pr => {\r\n // if (pr.id === action.product.id){\r\n // return pickBy(action.product, (property, key) => property !== null) as Iproduct\r\n // } else {\r\n // return pr;\r\n // }\r\n // })\r\n\r\n return state;\r\n case types.DELETE_PHOTO_SUCCESS: {\r\n if (action.productID && state[action.productID]) {\r\n const productWithoutPhoto: Iproduct = {\r\n ...state[action.productID],\r\n imagePath: ''\r\n };\r\n return {\r\n ...state,\r\n [productWithoutPhoto.id]: productWithoutPhoto\r\n };\r\n }\r\n }\r\n case types.UPLOAD_PRODUCT_PHOTO_SUCCESS: {\r\n if (action.productID && state[action.productID]) {\r\n const productWithPhoto: Iproduct = {\r\n ...state[action.productID],\r\n imagePath: action.photo.lightboxUrl\r\n };\r\n return { ...state, [productWithPhoto.id]: productWithPhoto };\r\n }\r\n }\r\n case types.INSTALL_ADD_SUCCESS: {\r\n // if this is ther first install for this product, we are adding the product as well\r\n const newInstallsCount = action.installs.length;\r\n const product = action.product;\r\n const newCount = product.installBasesCount\r\n ? product.installBasesCount + newInstallsCount\r\n : newInstallsCount;\r\n return {\r\n ...state,\r\n [product.id]: { ...product, installBasesCount: newCount }\r\n };\r\n }\r\n\r\n // we could handle get_products_success here if we were keeping all the products and doing front end filtering of the manage inventory table\r\n // case types.GET_PRODUCTS_SUCCESS:\r\n // if (action.products) {\r\n // const newProducts = map(action.products, (prod: Iproduct) => {\r\n // return cleanAndFilterProductObject({\r\n // ...prod,\r\n // installBases: state[prod.id] ? state[prod.id].installBases : []\r\n // });\r\n // });\r\n // return { ...state, ...keyBy(newProducts, 'id') };\r\n // } else {\r\n // return state;\r\n // }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageInventory.productsByID;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\n/*\r\n * ensure the product at least has the expected attributes, ignore any null attributes\r\n */\r\n","import { pickBy, map, keyBy, omit } from 'lodash';\r\n\r\nimport { IproductQueueObject, ImanageProductQueueReducer } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport initialState, { initialProductQueueObject } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\n\r\nimport { combineReducers } from 'redux';\r\nimport { cleanAndFilterProductObject } from './productsReducer';\r\n\r\nexport const cleanProductQueueObject = (\r\n productQueueObject: IproductQueueObject\r\n) => {\r\n return {\r\n ...initialProductQueueObject,\r\n ...pickBy(productQueueObject, (property, key) => property !== null),\r\n product: cleanAndFilterProductObject(productQueueObject.product)\r\n } as IproductQueueObject;\r\n};\r\n\r\nfunction productQueueByID(\r\n state: { [key: string]: IproductQueueObject } = initialState\r\n .manageProductQueue.productQueueByID,\r\n action: any\r\n): { [key: string]: IproductQueueObject } {\r\n switch (action.type) {\r\n case types.PRODUCT_QUEUE_SUCCESS: {\r\n const newProductQueueObjects = map(\r\n action.payload.productQueueObjects,\r\n (productQueueObject: IproductQueueObject) => {\r\n return cleanProductQueueObject(productQueueObject);\r\n }\r\n );\r\n return keyBy(newProductQueueObjects, 'id');\r\n }\r\n case types.PRODUCT_QUEUE_PRODUCT_UPDATE_SUCCESS: {\r\n const updatedProductQueueProduct = {\r\n ...state[action.payload.queueID],\r\n product: action.payload.product\r\n };\r\n return {\r\n ...state,\r\n [action.payload.queueID]: cleanProductQueueObject(\r\n updatedProductQueueProduct\r\n )\r\n };\r\n }\r\n case types.PRODUCT_APPROVE_SUCCESS:\r\n return omit(state, action.payload.queueID);\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageProductQueue.productQueueByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.PRODUCT_QUEUE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction mergeableProductsByID(\r\n state: { [key: string]: IproductQueueObject } = initialState\r\n .manageProductQueue.productQueueByID,\r\n action: any\r\n): { [key: string]: IproductQueueObject } {\r\n switch (action.type) {\r\n case types.MERGEABLE_PRODUCTS_SUCCESS: {\r\n const newProductQueueObjects = map(\r\n action.payload.productQueueObjects,\r\n (productQueueObject: IproductQueueObject) => {\r\n return cleanProductQueueObject(productQueueObject);\r\n }\r\n );\r\n return keyBy(newProductQueueObjects, 'id');\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageProductQueue.mergeableProductsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageProductQueue = combineReducers({\r\n productQueueByID,\r\n mergeableProductsByID,\r\n totalPages,\r\n showApproveProductModal: (state, action) =>\r\n modalToggleWithName(state, action, 'APPROVE_PRODUCT'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_PRODUCT_QUEUE')\r\n // quoteRequestItems: (state, action) => quoteRequestReducer(state, action)\r\n});\r\n\r\nexport default manageProductQueue;\r\n","import { pickBy, map, keyBy, filter, orderBy } from 'lodash';\r\n\r\nimport { ImanageTaeReducer, Itae } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName,\r\n createSelectedIDWithName\r\n} from './commonReducers';\r\nimport initialState, { initialTae } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { combineReducers } from 'redux';\r\nimport moment from 'moment';\r\n\r\nexport const cleanTaeObject = (item: any) => {\r\n return {\r\n ...initialTae,\r\n ...pickBy(item, (property, key) => property !== null)\r\n } as Itae;\r\n};\r\n\r\nfunction taeByIDReducer(\r\n state: { [key: string]: Itae } = initialState.manageTae.taeByID,\r\n action: any\r\n): { [key: string]: Itae } {\r\n switch (action.type) {\r\n case types.MANAGE_TAE_SUCCESS:\r\n return keyBy(\r\n map(action.taes, (tae: any) => {\r\n return cleanTaeObject(tae);\r\n }),\r\n 'id'\r\n );\r\n // case types.JOB_SAVE_SUCCESS:\r\n // return { ...state, [action.job.id]: action.job };\r\n // case types.JOB_UPDATE_SUCCESS:\r\n // return { ...state, [action.job.id]: cleanJobObject(action.job) };\r\n // case types.JOB_DELETE_SUCCESS:\r\n // // TODO switch to FE filtering\r\n // // return {...state, [action.payload]: {...state[action.payload], isDeleted: true}}\r\n // return omit(state, action.payload);\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageTae.taeByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n// function jobManageTotalPages(state: number = 1, action: any): number {\r\n// switch (action.type) {\r\n// case types.JOB_MANAGE_TOTAL_PAGES:\r\n// if (action.pages && action.pages > 0) {\r\n// return action.pages;\r\n// }\r\n// return state;\r\n// case types.USER_LOGOUT_SUCCESS:\r\n// return 1;\r\n// default:\r\n// return state;\r\n// }\r\n// }\r\n\r\nconst manageTaeReducer = combineReducers({\r\n taeByID: taeByIDReducer,\r\n selectedItemID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'MANAGE_TAE'),\r\n showEditModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_TAE'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_TAE')\r\n});\r\n\r\nexport default manageTaeReducer;\r\n\r\n/*\r\n * SELECTORS\r\n */\r\nexport const selectVisibleTaes = (state: ImanageTaeReducer) => {\r\n const { taeByID, tableFilters } = state;\r\n const filteredItems = filter(taeByID, item => {\r\n let shouldInclude = true;\r\n if (\r\n tableFilters.installBaseID &&\r\n tableFilters.installBaseID.value &&\r\n item.installBaseID !== tableFilters.installBaseID.value\r\n ) {\r\n shouldInclude = false;\r\n }\r\n return shouldInclude;\r\n });\r\n\r\n return orderBy(\r\n filteredItems,\r\n res => moment.utc(res.createDate).unix(),\r\n 'desc'\r\n );\r\n};\r\n","import { omit, map, keyBy } from 'lodash';\r\n\r\nimport { ImanageTeamReducer, Iuser } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName,\r\n createFormValuesWithName,\r\n createSelectedIDWithName\r\n} from './commonReducers';\r\nimport initialState from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { cleanUser } from './manageUserReducer';\r\nimport { combineReducers } from 'redux';\r\n\r\nfunction teamMembersByID(\r\n state: { [key: string]: Iuser } = initialState.manageTeam.teamMembersByID,\r\n action: any\r\n): { [key: string]: Iuser } {\r\n switch (action.type) {\r\n case types.TEAM_MANAGE_SUCCESS: {\r\n const newUsers = map(action.team, user => {\r\n return cleanUser(user);\r\n });\r\n return keyBy(newUsers, 'id');\r\n }\r\n case types.TEAM_UPDATE_SUCCESS:\r\n return { ...state, [action.user.id]: cleanUser(action.user) };\r\n\r\n case types.TEAM_SAVE_SUCCESS:\r\n // const securityFunct = map(action.user.securityFunctions, securityF => {\r\n // return securityF.toUpperCase();\r\n // });\r\n // const updatedTeamMember = {\r\n // ...pickBy(action.user, (property, key) => property !== null),\r\n // securityFunctions: securityFunct\r\n // };\r\n\r\n // return [...state, updatedTeamMember] as Iuser[];\r\n\r\n // TODO not adding them for now until after they are approved\r\n return state;\r\n case types.TEAM_DELETE_SUCCESS:\r\n return omit(state, action.memberID);\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageTeam.teamMembersByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.TEAM_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst userManage = combineReducers({\r\n teamMembersByID,\r\n totalPages,\r\n showEditTeamModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_TEAM'),\r\n editUserFormValues: (state, action) =>\r\n createFormValuesWithName(state, action, 'MANAGE_TEAM_MEMBER'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_TEAM'),\r\n selectedUserID: (state, action) =>\r\n createSelectedIDWithName(state, action, 'MANAGE_TEAM')\r\n});\r\n\r\nexport default userManage;\r\n","import { ImanageTrainingProgress, ImanageTrainingReducer } from '../models';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport initialState from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { combineReducers } from 'redux';\r\n\r\nfunction trainingProgress(\r\n state: { [key: string]: ImanageTrainingProgress } = initialState\r\n .manageTraining.trainingProgress,\r\n action: any\r\n): { [key: string]: ImanageTrainingProgress } {\r\n switch (action.type) {\r\n case types.MANAGE_TRAINING_SUCCESS:\r\n return action.trainingProgress;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.MANAGE_TRAINING_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageTraining = combineReducers({\r\n trainingProgress,\r\n totalPages,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_TRAINING')\r\n});\r\n\r\nexport default manageTraining;\r\n","import initialState from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { IAlert } from '../models';\r\nimport { pickBy, map, keyBy } from 'lodash';\r\n\r\nconst cleanAlertObject = (alert: IAlert) => {\r\n return {\r\n ...pickBy(alert, property => property !== null)\r\n } as IAlert;\r\n};\r\n\r\nexport function manageUserAlertReducer(\r\n state: { [key: string]: IAlert } = initialState.alertsByID,\r\n action: any\r\n): { [key: string]: IAlert } {\r\n switch (action.type) {\r\n case types.ADD_USER_ALERT: {\r\n const alert = action.payload;\r\n const cleanedAlert = cleanAlertObject(alert);\r\n return { ...state, [alert.id]: cleanedAlert };\r\n }\r\n case types.LOAD_USER_ALERTS_SUCCESS: {\r\n const newAlerts = map(action.payload, (alert: IAlert) => {\r\n return cleanAlertObject(alert);\r\n });\r\n return keyBy(newAlerts, 'id');\r\n }\r\n case types.READ_USER_ALERT_SUCCESS: {\r\n const updatedAlert = { ...state[action.payload], isViewed: true };\r\n return { ...state, [action.payload]: updatedAlert };\r\n }\r\n case types.READ_ALL_USER_ALERTS_SUCCESS: {\r\n const alerts = map(state, (alert: IAlert) => {\r\n return { ...alert, isViewed: true };\r\n });\r\n return keyBy(alerts, 'id');\r\n }\r\n case types.REMOVE_ALERT_SUCCESS: {\r\n const data = { ...state };\r\n delete data[action.payload.id];\r\n return data;\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.alertsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { map, omit, keyBy } from 'lodash';\r\n\r\nimport { IuserQueue, ImanageUserQueueReducer } from '../models';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport initialState, { initialUserQueue } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { cleanUser } from './manageUserReducer';\r\nimport { combineReducers } from 'redux';\r\n\r\n/*\r\n *********** SELECTORS\r\n */\r\n\r\n/*\r\n ************ REDUCERS\r\n */\r\n\r\n/*\r\n * stores the user currently being edited\r\n */\r\nconst selectedUserQueuReducer = (\r\n state = initialUserQueue,\r\n action: any\r\n): IuserQueue => {\r\n switch (action.type) {\r\n case types.USER_QUEUE_UPDATE_SELECTED: {\r\n return action.payload;\r\n }\r\n case types.USER_QUEUE_SAVE_SUCCESS: {\r\n return initialUserQueue;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nfunction userQueuesByID(\r\n state: { [key: string]: IuserQueue } = initialState.manageUserQueue\r\n .userQueuesByID,\r\n action: any\r\n): { [key: string]: IuserQueue } {\r\n switch (action.type) {\r\n case types.USER_QUEUE_SUCCESS: {\r\n const newQueue = map(action.queue, queueObject => {\r\n return {\r\n id: queueObject.id,\r\n user: cleanUser(queueObject.user)\r\n };\r\n });\r\n return keyBy(newQueue, 'id');\r\n }\r\n case types.USER_QUEUE_SAVE_SUCCESS: {\r\n const newQueueObject = {\r\n id: action.queueID,\r\n user: cleanUser(action.user)\r\n };\r\n\r\n return { ...state, [action.queueID]: newQueueObject };\r\n }\r\n case types.USER_APPROVE_SUCCESS:\r\n return omit(state, action.userQueueID);\r\n case types.USER_REJECT_SUCCESS:\r\n return omit(state, action.userQueueID);\r\n\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageUserQueue.userQueuesByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.USER_QUEUE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst userQueue = combineReducers({\r\n userQueuesByID,\r\n totalPages,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_USER_QUEUE'),\r\n selectedUserQueue: selectedUserQueuReducer\r\n});\r\n\r\nexport default userQueue;\r\n","import * as types from '../actions/actionTypes';\r\nimport initialState, { initialLesson, initialQuiz } from './initialState';\r\nimport { keyBy, mapValues, find, map, pickBy } from 'lodash';\r\nimport {\r\n GFLesson,\r\n GFLessons,\r\n ItrainingReducer,\r\n GFQuizItem,\r\n GFCourse,\r\n LessonProgress,\r\n GFQuizAnswer,\r\n GFQuizViewReducer,\r\n GFQuizLinkReducer\r\n} from '../models';\r\nimport { cartReducerWithName, getQuantity } from './cartReducer';\r\nimport {\r\n modalToggleWithName,\r\n createSelectedIDWithName\r\n} from './commonReducers';\r\nimport { combineReducers } from 'redux';\r\n\r\nconst cleanQuizObject = (quiz: GFQuizItem) => {\r\n return {\r\n ...initialQuiz,\r\n ...pickBy(quiz, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nfunction coursesByID(\r\n state: { [key: string]: GFCourse } = initialState.training.coursesByID,\r\n action: any\r\n): { [key: string]: GFCourse } {\r\n switch (action.type) {\r\n case types.LOAD_COURSES_SUCCESS: {\r\n const courses = keyBy(action.courses, 'id');\r\n return { ...state, ...courses };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.training.coursesByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction lessonReducer(state: GFLesson = initialLesson, action: any): GFLesson {\r\n switch (action.type) {\r\n case types.LOAD_LESSON:\r\n return action.lesson;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialLesson;\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction lessonsByID(\r\n state: GFLessons | any = {},\r\n action: any\r\n): GFLessons | any {\r\n switch (action.type) {\r\n case types.LOAD_LESSONS_SUCCESS:\r\n return Object.assign(\r\n {},\r\n state,\r\n keyBy(action.lessons, (lesson: GFLesson) => lesson.id)\r\n );\r\n case types.GET_QUIZ_RESULTS_SUCCESS:\r\n return mapValues(state, (lesson: GFLesson) => {\r\n const quizResult = find(action.results, {\r\n lessonID: lesson.id\r\n }) as any;\r\n if (quizResult && quizResult.score) {\r\n return {\r\n ...lesson,\r\n score: quizResult.score,\r\n quizName: quizResult.quizName\r\n };\r\n }\r\n return lesson;\r\n });\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction quizzesByID(\r\n state: { [key: string]: GFQuizItem } = {},\r\n action: any\r\n): { [key: string]: GFQuizItem } {\r\n switch (action.type) {\r\n /*\r\n * When loading all quizzes, the objects do not have instructions or questions. If we already have them, do not erase them.\r\n */\r\n case types.LOAD_QUIZZES_SUCCESS:\r\n return keyBy(\r\n map(action.quizzes, quiz => {\r\n const existingQuiz = state[quiz.id];\r\n if (existingQuiz) {\r\n return {\r\n ...cleanQuizObject(quiz),\r\n questions: existingQuiz.questions,\r\n instructions: existingQuiz.instructions\r\n };\r\n } else {\r\n return cleanQuizObject(quiz);\r\n }\r\n }),\r\n 'id'\r\n );\r\n\r\n case types.LOAD_QUIZZES_BY_LESSON_SUCCESS:\r\n return Object.assign(\r\n {},\r\n state,\r\n keyBy(\r\n map(action.quizzes, quiz => cleanQuizObject(quiz)),\r\n 'id'\r\n )\r\n );\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\nfunction quizReducer(state: GFQuizItem = initialQuiz, action: any): GFQuizItem {\r\n switch (action.type) {\r\n case types.LOAD_QUIZ:\r\n return action.quiz;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialQuiz;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction lessonProgressByID(\r\n state: { [key: string]: LessonProgress } = {},\r\n action: any\r\n): { [key: string]: LessonProgress } {\r\n switch (action.type) {\r\n case types.GET_ALL_LESSON_PROGRESS_SUCCESS:\r\n return Object.assign(\r\n {},\r\n state,\r\n keyBy(action.progress, (prog: any) => prog.lessonID)\r\n );\r\n case types.SAVE_LESSON_PROGRESS_SUCCESS:\r\n return Object.assign(\r\n {},\r\n state,\r\n keyBy([action.progress], (prog: any) => prog.lessonID)\r\n );\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction purchasedTraining(state: string[] = [], action: any): string[] {\r\n switch (action.type) {\r\n case types.GET_PURCHASED_TRAINING_SUCCESS:\r\n return action.products;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return [];\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport function quizAnswers(\r\n state: GFQuizAnswer[] = initialState.training.quizAnswers,\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.ADD_ANSWER:\r\n return [...state, action.answer];\r\n case types.RESET_ANSWERS:\r\n console.info('resetting answers');\r\n return initialState.training.quizAnswers;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.training.quizAnswers;\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst booleanReducer = (state = false, action: any): boolean => {\r\n switch (action.type) {\r\n case types.SAVE_QUIZ_ANSWERS_SUCCESS:\r\n return true;\r\n case types.RESET_ANSWERS:\r\n return false;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return false;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst startTimeReducer = (\r\n state: string = initialState.training.quizView.startTime,\r\n action: any\r\n): string => {\r\n switch (action.type) {\r\n case types.START_QUIZ_SUCCESS:\r\n return action.startTime;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.training.quizView.startTime;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport function quizView(\r\n state: GFQuizViewReducer = initialState.training.quizView,\r\n action: any\r\n) {\r\n return {\r\n quizComplete: booleanReducer(state.quizComplete, action),\r\n inProgressQuizID: createSelectedIDWithName(\r\n state.inProgressQuizID,\r\n action,\r\n 'IN_PROGRESS_QUIZ'\r\n ),\r\n startTime: startTimeReducer(state.startTime, action)\r\n };\r\n}\r\n\r\nconst quizLink = (state: GFQuizLinkReducer = { link: '' }, action: any) => {\r\n switch (action.type) {\r\n case types.GET_QUIZ_LINK_SUCCESS:\r\n return { link: action.link };\r\n case types.GET_QUIZ_LINK_FAILED:\r\n return { link: '', failedToLoad: true };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst trainingReducer = combineReducers({\r\n coursesByID,\r\n lessonsByID,\r\n lesson: lessonReducer,\r\n quizzesByID,\r\n quiz: quizReducer,\r\n lessonProgress: (state, action) => lessonProgressByID(state, action),\r\n cart: (state, action) => cartReducerWithName(state, action, 'TRAINING'),\r\n purchasedTraining: (state, action) => purchasedTraining(state, action),\r\n showShoppingCartModal: (state, action) =>\r\n modalToggleWithName(state, action, 'SHOPPING_CART_TRAINING'),\r\n quizAnswers,\r\n quizView,\r\n quizLink\r\n});\r\n\r\nexport default trainingReducer;\r\n\r\n// getters for shopping cart\r\n\r\nexport const getTotal = (state: ItrainingReducer) =>\r\n state.cart.addedIDs.reduce(\r\n (total, id) => total + getQuantity(state.cart, id),\r\n 0\r\n );\r\n","import { combineReducers } from 'redux';\r\nimport { ItutorialReducer } from '../models';\r\nimport * as types from '../actions/actionTypes';\r\n\r\nfunction viewedTours(state = [] as string[], action: any): string[] {\r\n switch (action.type) {\r\n case types.ADD_VIEWED_TOUR:\r\n if (!state.includes(action.payload)) {\r\n return [...state, action.payload];\r\n } else return state;\r\n case types.RESET_VIEWED:\r\n return [];\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction run(state = false, action: any): boolean {\r\n switch (action.type) {\r\n case types.SET_IS_TUTORIAL_OPEN:\r\n return action.payload;\r\n case types.TOGGLE_TUTORIAL:\r\n return !state;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst tutorialReducer = combineReducers({\r\n viewedTours,\r\n run\r\n});\r\n\r\nexport default tutorialReducer;\r\n","import { combineReducers } from 'redux';\r\nimport { ImanageProductReducer, Iproduct } from '../models';\r\nimport * as types from '../actions/actionTypes';\r\nimport initialState, { initialProduct } from './initialState';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { keyBy, map, pickBy } from 'lodash';\r\n\r\nconst cleanAndFilterProductObject = (product: Iproduct): Iproduct => {\r\n return {\r\n ...initialProduct,\r\n ...(pickBy(product, (property, key) => property !== null) as Iproduct)\r\n };\r\n};\r\nfunction productsByIDReducer(\r\n state: { [key: string]: Iproduct } = initialState.manageProduct\r\n .productsByID,\r\n action: any\r\n): { [key: string]: Iproduct } {\r\n switch (action.type) {\r\n case types.GET_MANAGE_PRODUCT_SUCCESS: {\r\n const newProducts = keyBy(\r\n map(action.products, (product: Iproduct) => {\r\n return cleanAndFilterProductObject(product);\r\n }),\r\n 'id'\r\n );\r\n return newProducts;\r\n }\r\n case types.PRODUCT_UPDATE_SUCCESS:\r\n return {\r\n ...state,\r\n [action.product.id]: cleanAndFilterProductObject(action.product)\r\n };\r\n case types.PRODUCT_ADD_SUCCESS:\r\n return {\r\n ...state,\r\n [action.product.id]: cleanAndFilterProductObject(action.product)\r\n };\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.manageInventory.productsByID;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.PRODUCT_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst ManageProduct = combineReducers({\r\n productsByID: productsByIDReducer,\r\n showEditProductModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_PRODUCT'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_PRODUCT'),\r\n totalPages\r\n});\r\n\r\nexport default ManageProduct;\r\n","import { ImanageAssetPhotosReducer, Iphoto } from '../models';\r\nimport { createTableFiltersWithName } from './commonReducers';\r\nimport initialState, { initialPhoto } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { combineReducers } from 'redux';\r\nimport { pickBy } from 'lodash';\r\n\r\nexport const cleanPhotoObject = (photo: any): Iphoto => {\r\n return {\r\n ...initialPhoto,\r\n ...pickBy(photo, (property, key) => property !== null)\r\n };\r\n};\r\n\r\nfunction photos(\r\n state: { [key: string]: Iphoto } = initialState.manageAssetPhotos.photos,\r\n action: any\r\n): { [key: string]: Iphoto } {\r\n switch (action.type) {\r\n case types.ASSET_PHOTOS_MANAGE_SUCCESS:\r\n return action.photos;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction photosByProduct(\r\n state: { [key: string]: Iphoto[] } = initialState.manageAssetPhotos\r\n .photosByProduct,\r\n action: any\r\n): { [key: string]: Iphoto[] } {\r\n switch (action.type) {\r\n case types.PHOTOS_BY_PRODUCT_SUCCESS:\r\n return action.photos;\r\n case types.DELETE_PHOTO_SUCCESS: {\r\n return Object.keys(state).reduce((newState, productID) => {\r\n if (productID !== action.productID) {\r\n return { ...newState, [productID]: state[productID] };\r\n }\r\n return newState;\r\n }, {});\r\n }\r\n case types.UPLOAD_PRODUCT_PHOTO_SUCCESS: {\r\n const newPhoto = cleanPhotoObject(action.photo);\r\n return {\r\n [newPhoto.productID]: [...state[newPhoto.productID], newPhoto]\r\n };\r\n }\r\n case types.USER_LOGOUT_SUCCESS:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.ASSET_PHOTOS_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageAssetPhotos = combineReducers({\r\n photos,\r\n photosByProduct,\r\n totalPages,\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_ASSET_PHOTOS')\r\n});\r\n\r\nexport default manageAssetPhotos;\r\n","import initialState, { initialSuggestedPart } from './initialState';\r\nimport * as types from '../actions/actionTypes';\r\nimport { ImanageSuggestedPartsReducer, IsuggestedPart } from '../models';\r\nimport {\r\n createTableFiltersWithName,\r\n modalToggleWithName\r\n} from './commonReducers';\r\nimport { pickBy, map, keyBy } from 'lodash';\r\nimport { combineReducers } from 'redux';\r\n\r\nconst cleanSuggestedPart = (suggestedPart: any): IsuggestedPart => {\r\n return {\r\n ...initialSuggestedPart,\r\n ...pickBy(suggestedPart, property => property !== null)\r\n };\r\n};\r\n\r\nexport function suggestedParts(\r\n state: { [key: string]: IsuggestedPart } = initialState.manageSuggestedParts\r\n .suggestedParts,\r\n action: any\r\n): { [key: string]: IsuggestedPart } {\r\n switch (action.type) {\r\n case types.SEARCH_SUGGESTED_PARTS_SUCCESS: {\r\n if (Array.isArray(action?.payload?.result)) {\r\n const newParts = map(action.payload.result, cleanSuggestedPart);\r\n return keyBy(newParts, 'id');\r\n }\r\n }\r\n case types.SAVE_SUGGESTED_PARTS_SUCCESS:\r\n return {\r\n ...state,\r\n [action.part.id]: cleanSuggestedPart(action.part)\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst selectedSuggestedPartReducer = (\r\n state = initialSuggestedPart,\r\n action: any\r\n): IsuggestedPart => {\r\n switch (action.type) {\r\n case types.UPDATE_SELECTED_SUGGESTED_PART: {\r\n return action.payload;\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nfunction totalPages(state = 1, action: any): number {\r\n switch (action.type) {\r\n case types.SUGGESTED_PARTS_MANAGE_TOTAL_PAGES:\r\n if (action.pages && action.pages > 0) {\r\n return action.pages;\r\n }\r\n return state;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return 1;\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst manageSuggestedParts = combineReducers({\r\n suggestedParts,\r\n totalPages,\r\n selectedSuggestedPart: selectedSuggestedPartReducer,\r\n showEditSuggestedPartModal: (state, action) =>\r\n modalToggleWithName(state, action, 'EDIT_SUGGESTED_PART'),\r\n tableFilters: (state, action) =>\r\n createTableFiltersWithName(state, action, 'MANAGE_SUGGESTED_PARTS')\r\n});\r\n\r\nexport default manageSuggestedParts;\r\n","import { combineReducers } from 'redux';\r\nimport { IinitialState } from '.';\r\nimport * as types from '../actions/actionTypes';\r\nimport initialState from './initialState';\r\nimport { IsapJobMapping } from '../models';\r\nimport { keyBy } from 'lodash';\r\n\r\nexport const selectSAPJobMappingsByID = (state: IinitialState) =>\r\n state.sapJobMappings.sapJobMappingsByID;\r\n\r\nfunction sapJobMappingsByID(\r\n state: { [key: string]: IsapJobMapping } = {},\r\n action: any\r\n): { [key: string]: IsapJobMapping } {\r\n switch (action.type) {\r\n case types.SET_SAP_JOB_MAPPING:\r\n return keyBy(action.data, 'id');\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst sapJobMappingReducer = combineReducers({\r\n sapJobMappingsByID\r\n});\r\n\r\nexport default sapJobMappingReducer;\r\n","import { Reducer, combineReducers } from 'redux';\r\nimport {\r\n createSelectedIDWithNameRoot,\r\n createShowModalWithNamedType,\r\n rawUsersByID,\r\n securityUsersByID\r\n} from './commonReducers';\r\n\r\nimport SyncStatusReducer from './syncStatusReducer';\r\nimport { ToastrState } from '../typings/react-redux-toastr';\r\nimport ajaxCallsInProgress from './ajaxStatusReducer';\r\nimport brandManage from './manageBrandReducer';\r\nimport dashboardAnalyticsReducer from './dashboardAnalyticsReducer';\r\nimport documentManage from './manageDocumentReducer';\r\nimport documentTypeManage from './documentTypeReducer';\r\nimport facilities from './facilitiesReducer';\r\nimport leadsManage from './manageLeadsReducers';\r\nimport manageAlert from './manageAlertReducer';\r\nimport manageCode from './manageCodeReducer';\r\nimport manageFacility from './manageCustomerAndFacilityReducer';\r\nimport manageInventory from './manageInventoryReducer';\r\nimport manageJob from './manageJobReducer';\r\nimport manageJobComment from './manageJobCommentsReducer';\r\nimport manageLocation from './manageLocationReducer';\r\nimport manageMeasurementPointLists from './manageMeasurementPointListsReducer';\r\nimport manageProductQueue from './manageProductQueueReducer';\r\nimport manageQuotes from './manageCustomerQuotesReducer';\r\nimport { manageReportReducer } from './manageReportReducer';\r\nimport manageTae from './manageTaeReducer';\r\nimport manageTeam from './manageTeamReducer';\r\nimport manageTraining from './manageTrainingReducer';\r\nimport manageUser from './manageUserReducer';\r\nimport { manageUserAlertReducer } from './manageUserAlertReducer';\r\nimport manageUserQueue from './manageUserQueueReducer';\r\nimport manageWorkOrder from './manageWorkOrderReducer';\r\nimport measurementPointResults from './measurementPointResultsReducer';\r\nimport { productInfoReducer } from './productInfoReducer';\r\nimport redirect from './redirectToReferrerReducer';\r\nimport { reducer as toastrReducer } from 'react-redux-toastr';\r\nimport training from './trainingReducer';\r\nimport user from './userReducer';\r\nimport { AppState } from '@redux-offline/redux-offline/lib/types';\r\nimport tutorial from './tutorialReducer';\r\nimport manageProduct from './manageProductReducer';\r\nimport manageAssetPhotos from './manageAssetPhotosReducer';\r\nimport managePart from './managePartReducer';\r\nimport manageSuggestedParts from './manageSuggestedPartsReducer';\r\nimport configReducer from './configReducer';\r\nimport countriesReducer from './countriesReducer';\r\nimport sapJobMappingReducer from './sapJobMappingReducer';\r\n\r\nconst rootReducer = combineReducers({\r\n ajaxCallsInProgress,\r\n countries: countriesReducer,\r\n dashboardAnalytics: dashboardAnalyticsReducer,\r\n config: configReducer,\r\n facilities,\r\n manageAlert,\r\n manageBrand: brandManage,\r\n manageCode,\r\n manageFacility,\r\n manageDocument: documentManage,\r\n manageDocumentType: documentTypeManage,\r\n manageInventory,\r\n manageJob,\r\n manageJobComment,\r\n manageLocation,\r\n manageMeasurementPointLists,\r\n manageProduct,\r\n manageProductQueue,\r\n manageReport: manageReportReducer,\r\n manageTae,\r\n manageTeam,\r\n manageTraining,\r\n manageLeads: leadsManage,\r\n manageCustomerQuotes: manageQuotes,\r\n manageUser,\r\n manageUserQueue,\r\n manageWorkOrder,\r\n measurementPointResults,\r\n productInfo: productInfoReducer,\r\n redirect,\r\n rawUsersByID,\r\n securityUsersByID,\r\n selectedFacilityID: createSelectedIDWithNameRoot('FACILITY_ID'),\r\n showSideMenu: createShowModalWithNamedType('SIDE_MENU'),\r\n showEditFacilityModal: createShowModalWithNamedType('EDIT_FACILITY'),\r\n showEditProfileModal: createShowModalWithNamedType('EDIT_PROFILE'),\r\n showFacilityContactModal: createShowModalWithNamedType('FACILITY_CONTACT'),\r\n showFacilityContractModal: createShowModalWithNamedType(\r\n 'FACILITY_CONTRACT'\r\n ),\r\n showSecurityFunctionsModal: createShowModalWithNamedType(\r\n 'SECURITY_FUNCTIONS'\r\n ),\r\n showAlertModal: createShowModalWithNamedType('USER_ALERT'),\r\n alertsByID: manageUserAlertReducer,\r\n syncStatus: SyncStatusReducer,\r\n toastr: toastrReducer as Reducer,\r\n training,\r\n user,\r\n tutorial,\r\n manageAssetPhotos,\r\n managePart,\r\n manageSuggestedParts,\r\n sapJobMappings: sapJobMappingReducer\r\n});\r\n\r\n// TODO refactor to this IinitialState interface for coolness points. This depends on typing the individual reducers\r\nexport type IinitialState = ReturnType &\r\n AppState & { toastr: ToastrState };\r\n\r\nexport default rootReducer;\r\n","import * as types from '../actions/actionTypes';\r\nimport initialState from './initialState';\r\nimport { Iredirect } from '../models';\r\n\r\nexport default function redirect(\r\n state: Iredirect = initialState.redirect,\r\n action: any\r\n) {\r\n switch (action.type) {\r\n case types.SET_REDIRECT_REFERRER:\r\n return { ...state, redirectToReferrer: true } as Iredirect;\r\n // return initialState.redirect;\r\n case types.REMOVE_REDIRECT_REFERRER:\r\n return { ...state, redirectToReferrer: false } as Iredirect;\r\n case types.SET_REDIRECT_PATHNAME:\r\n return {\r\n ...state,\r\n pathname: action.pathname,\r\n redirectToReferrer:\r\n action.setRedirect !== undefined\r\n ? action.setRedirect\r\n : state.redirectToReferrer\r\n } as Iredirect;\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.redirect;\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n","import * as types from '../actions/actionTypes';\r\n\r\nimport initialState from './initialState';\r\nimport { IsyncStatusReducer } from '../models';\r\n\r\nexport default function SyncStatusReducer(\r\n state: IsyncStatusReducer = initialState.syncStatus,\r\n action: any\r\n): IsyncStatusReducer {\r\n switch (action.type) {\r\n case types.GET_FSE_SUCCESS:\r\n return { ...state, fseUsersUpdated: action.updateDate };\r\n case types.USER_LOGOUT_SUCCESS:\r\n return initialState.syncStatus;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import * as localForage from 'localforage';\r\n\r\nimport {\r\n AnyAction,\r\n Middleware,\r\n Reducer,\r\n Store,\r\n StoreEnhancer,\r\n applyMiddleware,\r\n compose,\r\n createStore\r\n} from 'redux';\r\nimport { AxiosError, AxiosRequestConfig } from 'axios';\r\nimport {\r\n PersistConfig,\r\n Transform,\r\n createMigrate,\r\n createTransform,\r\n persistReducer,\r\n persistStore\r\n} from 'redux-persist';\r\nimport thunk, { ThunkMiddleware } from 'redux-thunk';\r\n\r\nimport TrackJSLogger from './TrackJSLogger';\r\nimport { constants } from '../constants/constants';\r\nimport { createOffline } from '@redux-offline/redux-offline';\r\nimport hardSet from 'redux-persist/lib/stateReconciler/hardSet';\r\nimport initialState from '../reducers/initialState';\r\nimport { migrations } from './migrations';\r\nimport { msalFetch } from '../components/auth/Auth-Utils';\r\nimport offlineConfig from '@redux-offline/redux-offline/lib/defaults/index';\r\nimport rootReducer, { IinitialState } from '../reducers';\r\n\r\n/*\r\n * handle persisisting date objects\r\n */\r\nconst replacer = (key: string, value: any) =>\r\n value instanceof Date ? value.toISOString() : value;\r\n\r\nconst reviver = (key: string, value: any) =>\r\n // typeof value === 'string' &&\r\n // value.match(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/)\r\n // ? new Date(value)\r\n // : value;\r\n value; // return the string because we do not want to create a date object here because it adds the timezone offset.\r\n\r\nexport const encode = (toDeshydrate: Transform) =>\r\n JSON.stringify(toDeshydrate, replacer);\r\n\r\nexport const decode = (toRehydrate: string) => JSON.parse(toRehydrate, reviver);\r\n\r\nconst effect = (\r\n {\r\n axiosOptions,\r\n message\r\n }: { axiosOptions: AxiosRequestConfig; message: string },\r\n action: any\r\n) => {\r\n const url = axiosOptions.url || ''; // if this is an empty string, it will generate a 404 response and be discarded.\r\n\r\n return msalFetch(url, axiosOptions).catch(err => {\r\n console.error(message, err);\r\n constants.handleError(err, message);\r\n throw err;\r\n });\r\n};\r\n\r\n// if discard returns true, then it will try again\r\nconst discard = (error: AxiosError, action: any, retries: number) => {\r\n const { request, response } = error;\r\n if (!request) {\r\n throw error;\r\n } // There was an error creating the request\r\n if (!response) {\r\n return false;\r\n } // There was no response\r\n return response.status >= 400 && response.status <= 500; // if it is a 400 error then discard, TODO temporarily set this to include 500 exactly because I am not sure how to handle this better...\r\n // if retryScheduled true and online true, we chould show a banner with a button to discard the request.\r\n};\r\n\r\nconst persistConfig: PersistConfig = {\r\n key: 'state-core-care-web',\r\n throttle: 100,\r\n // throttle: 5000,\r\n storage: localForage,\r\n version: parseInt(\r\n (process.env.REACT_APP_VERSION || '0.0.0').replace(/\\./g, ''),\r\n 10\r\n ),\r\n migrate: createMigrate(migrations, { debug: false }),\r\n blacklist: [\r\n 'showEditProfileModal',\r\n 'ajaxCallsInProgress',\r\n 'showSideMenu',\r\n 'showEditFacilityModal',\r\n 'showFacilityContactModal',\r\n 'showFacilityContractModal',\r\n 'showLeadsModal',\r\n 'showSecurityFunctionsModal',\r\n 'toastr',\r\n 'showAlertModal'\r\n ],\r\n stateReconciler: hardSet,\r\n transforms: [createTransform(encode, decode)]\r\n};\r\n// see https://github.com/diegoddox/react-redux-toastr/issues/249 about blacklisting toastr\r\n\r\nconst offlineEnhancer = createOffline({\r\n ...offlineConfig,\r\n persist: false,\r\n effect,\r\n discard\r\n});\r\n\r\nconst persistedReducer: Reducer = persistReducer(\r\n persistConfig,\r\n offlineEnhancer.enhanceReducer(rootReducer)\r\n);\r\n\r\nexport default function configureStore() {\r\n // if (process.env.NODE_ENV !== 'production') {\r\n // eslint-disable-next-line no-constant-condition\r\n if (false) {\r\n const composeEnhancers = require('redux-devtools-extension').composeWithDevTools(\r\n {\r\n autoPause: true,\r\n // shouldStartLocked: true,\r\n latency: 3000,\r\n // shouldRecordChanges: false,\r\n maxAge: 30,\r\n shouldHotReload: false,\r\n trace: true,\r\n stateSanitizer: (state: IinitialState) => ({\r\n ...state,\r\n manageUser: '<>',\r\n manageInventory: '<>',\r\n facilities: '<>',\r\n measurementPointResults: '<>',\r\n manageFacility: '<>',\r\n productInfo: '<>',\r\n manageTraining: '<>',\r\n manageJob: '<>',\r\n manageAlert: '<>',\r\n manageCode: '<>',\r\n manageUserQueue: '<>',\r\n training: '<>',\r\n manageUserAlert: '<>',\r\n manageBrand: '<>',\r\n dashboardAnalytics: '<>',\r\n manageDocument: '<>',\r\n manageDocumentType: '<>',\r\n manageJobComment: '<>',\r\n manageLocation: '<>'\r\n })\r\n }\r\n );\r\n const store: Store = createStore(\r\n persistedReducer,\r\n initialState,\r\n composeEnhancers(\r\n offlineEnhancer.enhanceStore,\r\n applyMiddleware(\r\n thunk as ThunkMiddleware,\r\n require('redux-immutable-state-invariant').default(),\r\n offlineEnhancer.middleware as Middleware<\r\n any,\r\n IinitialState,\r\n any\r\n >\r\n )\r\n )\r\n );\r\n const persistor = persistStore(store);\r\n return { persistor, store };\r\n } else {\r\n const store: Store = createStore(\r\n persistedReducer,\r\n initialState,\r\n compose(\r\n offlineEnhancer.enhanceStore as StoreEnhancer,\r\n applyMiddleware(\r\n thunk as ThunkMiddleware,\r\n offlineEnhancer.middleware as Middleware<\r\n any,\r\n IinitialState,\r\n any\r\n >,\r\n TrackJSLogger\r\n )\r\n )\r\n );\r\n const persistor = persistStore(store);\r\n return { persistor, store };\r\n }\r\n}\r\n","/*\r\n * Index is the entry point for the app.\r\n * Initial routes are here and secondary routes are in TwoPanelLayout\r\n */\r\nimport 'custom-event-polyfill';\r\nimport 'react-app-polyfill/stable';\r\n// import project css\r\nimport 'bootstrap/dist/css/bootstrap.css';\r\nimport 'react-datetime/css/react-datetime.css';\r\nimport 'react-redux-toastr/lib/css/react-redux-toastr.min.css';\r\nimport 'react-toggle/style.css';\r\n// import 'draft-js/dist/Draft.css';\r\nimport 'moment/min/locales'; // can improve performance by importing the specific locales we want to support\r\nimport 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';\r\nimport './i18n';\r\nimport './index.css';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport * as serviceWorker from './registerServiceWorker';\r\n\r\n// MSAL imports\r\nimport msalInstance from './components/auth/MsalInstance';\r\n\r\nimport {\r\n faCaretRight,\r\n faChevronCircleDown,\r\n faChevronCircleRight,\r\n faChevronDown,\r\n faChevronLeft,\r\n faChevronRight,\r\n faQuestionCircle,\r\n faSearch,\r\n faShoppingCart,\r\n faUser,\r\n faUsers\r\n} from '@fortawesome/free-solid-svg-icons';\r\nimport {\r\n faAngleDoubleDown,\r\n faAngleDoubleRight,\r\n faBars,\r\n faCalendarCheck,\r\n faCheck,\r\n faClipboard,\r\n faClipboardList,\r\n faClock,\r\n faCog,\r\n faDownload,\r\n faEdit,\r\n faFilePdf,\r\n faHistory,\r\n faHospital,\r\n faInfoCircle,\r\n faListAlt,\r\n faMinus,\r\n faPaste,\r\n faPlus,\r\n faSignOut,\r\n faSortAmountDown,\r\n faSortAmountUp,\r\n faTh,\r\n faTimes,\r\n faWrench\r\n} from '@fortawesome/pro-regular-svg-icons';\r\n\r\nimport { MsalProvider } from '@azure/msal-react';\r\nimport { library } from '@fortawesome/fontawesome-svg-core';\r\nimport axios from 'axios';\r\nimport { Provider } from 'react-redux';\r\nimport { PersistGate } from 'redux-persist/integration/react';\r\nimport { TrackJS } from 'trackjs';\r\nimport App from './App';\r\nimport { constants } from './constants/constants';\r\nimport configureStore from './store/configureStore';\r\n\r\nlibrary.add(\r\n faAngleDoubleDown,\r\n faAngleDoubleRight,\r\n faBars,\r\n faCalendarCheck,\r\n faCaretRight,\r\n faCheck,\r\n faChevronCircleDown,\r\n faChevronCircleRight,\r\n faChevronDown,\r\n faChevronLeft,\r\n faChevronRight,\r\n faClipboard,\r\n faClipboardList,\r\n faClock,\r\n faCog,\r\n faDownload,\r\n faEdit,\r\n faFilePdf,\r\n faHistory,\r\n faHospital,\r\n faInfoCircle,\r\n faListAlt,\r\n faMinus,\r\n faPaste,\r\n faPlus,\r\n faQuestionCircle,\r\n faSearch,\r\n faShoppingCart,\r\n faSignOut,\r\n faSortAmountDown,\r\n faSortAmountUp,\r\n faTh,\r\n faTimes,\r\n faUser,\r\n faUsers,\r\n faWrench\r\n);\r\n\r\n// const msalInstance = new PublicClientApplication(msalConfig);\r\n\r\n/*\r\n * MSAL loads the app in an iFrame in order to refresh auth tokens silently\r\n * The issue is that this causes a complete reload of the app.\r\n * in 1.2.0 they added support for a unique redirecturi that can be outside the SPA:\r\n * https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-JS-1.2.0\r\n * however, in order to support this we will need to modify the web.config to redirect everything to root except this auth.html\r\n * for now we prefer the solution below which prevents the javascript from running. This still causes the app to load,\r\n * but most assets are cached by the browser or by the service worker.\r\n */\r\nif (!(window !== window.parent && !window.opener)) {\r\n const { store, persistor } = configureStore();\r\n\r\n // set Axios default header for accepting JSON\r\n axios.defaults.headers.common['Accept'] = 'application/json';\r\n axios.defaults.headers.common['Content-Type'] = 'application/json';\r\n axios.defaults.timeout = constants.httpTimeout;\r\n\r\n // Trackjs\r\n\r\n TrackJS.install({\r\n token: '7acefdd92da44ad595db60cb7c09af8c',\r\n application: 'mymedgas',\r\n version: process.env.REACT_APP_VERSION,\r\n enabled: !(window.location.host.indexOf('localhost') >= 0)\r\n // for more configuration options, see https://docs.trackjs.com\r\n });\r\n\r\n // set the window name for UTA transaction window\r\n window.name = 'MyMedGas';\r\n\r\n /*\r\n* flush writes the current state to storage - this will be right after USER_LOGOUT_SUCCESS is triggered\r\nin userActions. then we pause the persistor in order to prevent anything else from being persisted while we logout.\r\n*/\r\n const handleLogout = () => {\r\n persistor.flush().then(() => {\r\n persistor.pause();\r\n // msalApp.logout();\r\n });\r\n };\r\n document.addEventListener('userLogout', handleLogout, false);\r\n\r\n ReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root') as HTMLElement\r\n );\r\n\r\n console.info('registering service worker');\r\n serviceWorker.register({\r\n onUpdate: registration => {\r\n document.dispatchEvent(new CustomEvent('newVersionAvailable'));\r\n if (registration && registration.waiting) {\r\n registration.waiting.postMessage({ type: 'SKIP_WAITING' });\r\n }\r\n }\r\n });\r\n} else {\r\n console.info('loading silent refresh in iFrame');\r\n}\r\n","module.exports = __webpack_public_path__ + \"static/media/beaconManageUsersHeader.05ad49b2.jpg\";","module.exports = __webpack_public_path__ + \"static/media/alert.d44ea897.svg\";","module.exports = __webpack_public_path__ + \"static/media/trainingProgressTile.af6bea18.jpg\";","module.exports = __webpack_public_path__ + \"static/media/trainingProgressHeader.bd256cfe.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageTeam.ef71753c.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageTeamHeader.720db700.jpg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAABsCAYAAABtuky0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAA6hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6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pcBdlhSwRNp0gyNLhLsoKWSJsOkGQpcNdlBWyRNh0giBLh7soK2SJsOkEQZYOd1HWIMtfiiIRtHECxZ/Phx/qrPE/Uo+Zq7EfOeLs2BO5grm/8aqQsJVAEUfvT99f3xNdhz8P4ljzen7lXK+oRuRLX//m/Ch0ZFkwVUTsmutwslYCjawXs5y+v7trkzgNio9nGNK4T5wfBKFVQVwSUzm9BC8dEFhO1oJEybMpBvOX7l3cVvuZd3F69ZydhI4M3cihK3GsQqATWS8lfPj27jJ0ZX0MJj+TH3GdjNMr1skETsvp2mW15GyGknWyGUtPJtOrz92QH6q4TqZ/v2vnM09rsXjztdAh86fJOrnl06t5WW3/wOL0mq6T9XXWtyFbKatNYDNmeBuye7Iaa+0n6Tr51rYhkNXurHVUexsCWa1aVh+M6+Q6tyGQtboXUUQ6vcZtyKpf10GWCH23QXF6nfm6rmUbAlndcu/83eL0Wm9D/gEqiRMdAZyjCAAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/quotesTile.f6e71823.jpg\";","module.exports = __webpack_public_path__ + \"static/media/quotesHeader.66effb47.png\";","module.exports = __webpack_public_path__ + \"static/media/beaconTraining.7b8c28a6.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconTrainingHeader.cd12ab6e.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageInventory.f9c85314.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageInventoryHeader.788c6af4.jpg\";","module.exports = __webpack_public_path__ + \"static/media/reportTile.9db77f7f.jpg\";","module.exports = __webpack_public_path__ + \"static/media/workOrderHeader.9a13ced2.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageProductQueue.6c43a450.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageProductQueueHeader.9ef81e49.jpg\";","module.exports = __webpack_public_path__ + \"static/media/BM_HelpManual.f6287368.svg\";","module.exports = __webpack_public_path__ + \"static/media/folder.a5d6f43a.svg\";","module.exports = \"data:image/png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UPjNq/XgR8gfJOwskLuV6jUM+mR6DLi3mOcJKQ0w+GatgGAm0S8wPCmYSUF3IbBqFezoMAapGdM2wXPCMcQWwFsucZANWyPQRMYqIgdx49elS/VNreLb09ONRjITA9AuZ4/B/4q+G8zrrHKQAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/add.03795c38.svg\";","module.exports = __webpack_public_path__ + \"static/media/BM_Parts.82c88e48.svg\";","module.exports = __webpack_public_path__ + \"static/media/Certificate.2ae8fb4f.svg\";","module.exports = __webpack_public_path__ + \"static/media/More.889974f2.svg\";","module.exports = __webpack_public_path__ + \"static/media/Preview.da96fc78.svg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageUsers.cd64e76a.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconQueue.6c43a450.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconQueueHeader.9ef81e49.jpg\";","module.exports = __webpack_public_path__ + \"static/media/documentTile.4fe2419d.jpg\";","module.exports = __webpack_public_path__ + \"static/media/documentHeader.f908d316.jpg\";","module.exports = __webpack_public_path__ + \"static/media/customerTile.667faed6.jpg\";","module.exports = __webpack_public_path__ + \"static/media/customerHeader.12b32881.jpg\";","module.exports = __webpack_public_path__ + \"static/media/LocationTile.a87562ca.jpg\";","module.exports = __webpack_public_path__ + \"static/media/locationHeader.816ec2c2.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageJobs.ad7e1b4d.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageJobsHeader.62e21ac5.jpg\";","module.exports = __webpack_public_path__ + \"static/media/alertTile.85b7c1c4.jpg\";","module.exports = __webpack_public_path__ + \"static/media/alertHeader.84b352e3.jpg\";","module.exports = __webpack_public_path__ + \"static/media/codeTile.f2236dc2.jpg\";","module.exports = __webpack_public_path__ + \"static/media/codeHeader.227575c4.jpg\";","module.exports = __webpack_public_path__ + \"static/media/workOrderTile.e7cf5b99.jpg\";","module.exports = __webpack_public_path__ + \"static/media/beaconManageProducts.cdf797da.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/measurementTile.8bad15ec.jpg\";","module.exports = __webpack_public_path__ + \"static/media/jobCommentsTile.2b8d3d11.jpg\";","module.exports = __webpack_public_path__ + \"static/media/jobCommentsHeader.33345e6f.jpg\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAABHNCSVQICAgIfAhkiAAABKRJREFUaIHtmbFWIkkUhv9bjabLhBst+wYtyYbThnOEMxBuNJgLlk8g8wT2iLkYbYge4BiK4SbSvoFGk2K6QP0bNGDTdNO0IOfMOf5h1a2qr25X1a26LUgpW7eyMDtfFVmCSIlEj9aw7LnlQWLbarciYs4AGQhxbSy58twDLy2DrA57m1Pj8TGFFYFkg3XGcN+7KPaS+tirtnsi8jlYRqJHQdM7L1ytypJJhm1lldk9phlpiGQlPE/iBZnM0yqDicAD8DlU5gjg7NU6moYnq0x+qafto7YjSi4FyIXrSDwL4Bpr2FxlaYT6rAhRguC3BQOiaazhybI+Y6HztbYLyPFin7iiEvctazEoW7eyGO+WBKyL4I/QGE9UUo4bYwHa1q2sjHdaInDmOiLvaWUqnvvl6dW2a6sxjwnkSP7wLorXcYBqvHNGIEdBE2p4E/RkvtrRAOpBzxMckOrEaxw0l0LbupUVs3MngB2Y9ouB6GBj/xTgaXDZEBz0z4ufoqDz1Y6G4GyukGgay/o+dcJk7KYAX4NmhnIYBlfLgEk+Gsuyp41s3bX3qp07JVxc58RjFLA/MBc/s6AiZtTP17qnAOC55UH/vFAylMM5QOGlXe1WIqEns5wDpjVyZp6odivKsL+4bPAM8DutUSkO2rso9ozhPoGbeW7JAqzv1Tp9W7eyAOA1DpqR4Lprv7YDkK+164CcBoDvaY1K03W3V+s0Bfg2D8tHEjp8RPmeYx2I3lD+EZrRwfF8Ww6o1P7U1j5qO0rJ3Xz96E/PLQ9koZJ4pjW0Y4GJFwD1h0bBDXs0PPnwYMFyW9/mZDxqBoPNAni1W1HCywBbr98o7CsRmVvktGTm4Xy1o4PAJJ6NJU4UsD+ofAuXCSSL8e7C0vHcL0/9RtEB+CNoK8bcBZcKgVmkFIHjTwSYhWRDOZzNUt/m5nY88eJ/gfjzOSoIAYASE1kOAA/nRQ3iZB58Z+YUqqEmOdvkCswqQ5ZI3oOIPBOnwMYSJ03kS6OHRsENejQozy0PaI0cAjcErow1bCaGcaXgGKWul3l4epmCQEfVE/AIuOGgEtYkyCDparDyLS8a1o90EFSSrSeniX8pioycq+rN0Lbu2mLMXfiaupKI5kOjcJhsGK03Qa8FPNUa4FbaBn64l/5awAAgsH//62/5+e8/iffnsFSySaiBydTXBp5JTm19G3scxjKkMfYHWLxjryMx43raNqmglRlFHmnrSIBv0wi4MkcaY2L+UboxjTJOstGrUkHPPQ42KKXS9Zt6I76T3md52EftVJ8wjchf09Op9AG9LX1Ab0sf0NvSB/S2tPxh678BT6Oy/+8hAt4qifWlnlbjzCUEehvAgH8hU0rugnm7SK64Clu3shCJTSq+p5QxS1/3Szy9m/oZtCkRsnTsWGjPPfD8NO72JcTb1zQtKU2ypFsTyfu4BOdUiXkPW9/mMDbOsiTipmQMeqv8kvsltVYub6q433dhGTX8tInM60YioqFK/qdIvGwqVbyZMG79d524YYVLN1cabWR5AJNctsh11K9jAjf988LGAtXGLkzeRbFnLMsmcDX1OslHECebBAaA/wH8KWKWyiBS6wAAAABJRU5ErkJggg==\"","module.exports = __webpack_public_path__ + \"static/media/alert_animated.5e67f041.gif\";","module.exports = __webpack_public_path__ + \"static/media/BeaconLogo@2x.06b59cc1.png\";","module.exports = __webpack_public_path__ + \"static/media/MMG Import Template.d581ee7b.xlsx\";","module.exports = __webpack_public_path__ + \"static/media/MMG SAP Import Template.3a9f63f5.xlsx\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAkCAYAAADsHujfAAAABHNCSVQICAgIfAhkiAAAAz9JREFUWIXtmDt+2loQh78RLi400Q7CXUFgBVZWECgNRWRwb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CAAAAABJRU5ErkJggg==\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABQCAYAAABRX4iyAAAABHNCSVQICAgIfAhkiAAABXxJREFUeJztnD+IXFUUxs+VRAT/TSwUkeho0sRChgixUNzRImATI2ihhUawEEFMYZMiumAjNtlOBGG3UWwk2xqELFoINjsBUbBwx0ZU0BlQ1AXDz+LdgdnZd++75855+2bX98E2mbnfOefLueeed+e+K1IjgB5wCdiiwCrQMeJeBkb+bxV42oJ3TwF0vfMjyrFmYONcgHsiXN8iltoA9IHLgSB2wMDWRoKZTeAli9jM4EW6miKSx8DA5prC3lbjolFMt6RMmsIYgynibY+Vtq9a2M5x9rzS0YEf0zX0oeM515W+XMJokalysEv6lBtSrFhmAkX86lAU/UGib1vUmWXemdAKN40N4FxtjlT72Sc9296uw4HlBMND4GwFTwdYApbm8KXnOaJTyYuWsmra9H4+uKoiPgbOJwQ423ttap1k9yp4mYpm1Is2rIhB7cuskY4niWGDSE2iKMBbkfFRkWe4zkZ4RkQKt49lpRbBEoUKBuoDi4k0QXI3T1opGBGpQxRZFms59IIRX1WCvRLFdNM0qMkLgedORXC18zyx+NIFI94dDwhMO/S913KqUFM2zqFrRlcDPB3iK2a1YBUBD8oIvOHVROcnzWmottxOMVX6wNEK0VLbg2DgxBOjVOjJwFgBDQnVpbq24Z3qRWzfBLwF/DEz7gPgzsi4LkUtq8q2Ucg+ccF2Zz9FdoQaziHlQvUiYybYCDk5xXMz8H1FoA9UcHQrgp6gtA8k3o/1Zr8cSulxWbBUr5ZjEos38GFCkF8kcvWJF+/SDPPxhMZtMUkW4tNv14pCtVCDMocCwR2N8MwiqeununiHBOsRns4rky+FutvS1Yp4yq6j6FOAM1F5duLNVF7PHevLSos+8cTpSOCD0g06wtu5kLFdDDwblWcn3s3gV/tLuPb1yz4srVOeKJRV69pAPJ9GrPcybYQeczYD3++we7YNpz9c8yINiOzzUN6HlbYViYHULpa3U5Ytwf9givo1qXvrJNbgWZL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9x3XoBCBoeohoODIMEdxvega3c/SbT2o/TnrFOKsU8k0PESWfCH4EoK/pQa6Xo8KYeK/3BdNDRKNbQpL/tT+evUfEOWFwU0JaDIO0GAZpxfx7jD1/L63s3CVQIsAJ07NEq6GhLrLrnd+/A8GpUyc+/ND0PEREREREREREREREREQUhf8BMv7qyrXDYEYAAAAASUVORK5CYII=\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAB7CAYAAABUx/9/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAHudJREFUeJztnWdcFNfXx39ndgHLolJEBbsREQEVuxgsqKixJPYasRtjbERjw4LGiIr9TyyxxRijYmKJEcUauwgaC4oaVBBUBAGxAbtznhegDyyzKMsskGS/r/Zz69k5M7eecy9gxIgRI0aMGDFixIgRI0aMGDFixIgRI0aM/LegwhbAUKhU5eE981CJElawEgAVKVAKIswgwIREEAMaEqBmEa9JwAuIeB5+IyR+w7LhaYUtu6H4xyvbtrKDwrVpx2oE1OkzYqlTcTM4glEbQHUQSlFe/iODASQwcAeM8IQYhO/fM+m6yLhx5VxQTEzMTYP9j4LgH6js0lCZC6YzZj2zqNkIXgJhFAhVYcD/whkvwWUWsdp7mMuehKcPX7xISUw3VH2G4h+l7MkL9tZQoM24Rm6qjwE4EsGsoGVgIBkiwkPO7vvjjYjvl8/sllDQMuhLkVd2gxY9VKaK7c2+9jUZA0JXAoTClukdjNciY+uS2T033b0Zcjk+Liq1sEXKjSKr7FIWNli1/e9uJYurvifAhgiKwpZJB8wMTXram/DLF4MH+M3oer2wBdJFkVS279Iz3es0aD6JgCYgKAtbnjzwRmQEH/x19XcbVnx1rrCF0abIKNvaujKcGraxHztt01KB8Elhy5MvGBpmrFrtN3Th8YObnhS2OG8pMsresidhpsrCciIIFnmaLhVROGMi9+jBnevek4Y7/1LY8gBFYLAzYvpWx90nOUh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bFgoJ5ZiCS9D3CXBRmVq/S3o2LVvWyFxZtPOl4e0racyXjNWjRYmr4NCd0Xp6xtrW1LzJ01S/ruQzdS7/6hGLZdUF6amloSX4uudJz/e+u+h2tTT4vjnZ+kpwo93IKNwXaeeA5t875pBI2aOFjSIpfjjRM+9ap0t+dvQf9CkHmIpVWxQT0s2xJ3fpm+g+SYteE1K3zQJvS7kRm6Iu7BU45VqgGaxa5OArq4h7Dte2FvfgFwBqBidKSp6cW36SLNe6q5r1oKtAWMmLdnGcZwhAACl9O60Ea26lBQXtsh/FdGsAlmZjyPPhPTq4xFKCHm9Y4ZcDsvXBA86J0e4euMHqdIzKnp6BqRL9384+QRs6tzdpV+VNbDXrkpOf7zYQ+sz/KrSbAMpMH5KyIBpgZun6Yigyv7liChHgAvXr0ov3rrxnRwRy6DiH5wBIcQAAGDClFBHJPAuR0iV+VBKafb+7enbTh/1i3tVWKDSFi3NhWYfyD/pCPaOhj36DZjg6DNn7QGO48yULYmIlFJIXurvsgERbtzLvf6XCB6DwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYtfM/j7BRTsNjGWoAAAAASUVORK5CYII=\"","module.exports = __webpack_public_path__ + \"static/media/Medical Air-01.8105d07c.png\";","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHoAAAB6CAYAAABwWUfkAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAABodJREFUeJzt3WlMVFcYBuDvu8zIjgsKWJuIlQYjsWgD1tYFsBVZ4gpBy9Ko1IpLaLULlba0USp1K6ZogcQlKlYRhyqGKBSsMzWNWkRRa6q4UWNqUxGQfZl7+sM0GSnLDNyZe5nzPQl/DmfOvMObM9x7ZwYACCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBidih3AKnllrYdV6vV86RYizHWFBEgOEqxltwEuQ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mzKmpAJZ/7p5pYDx8YQW6cD+7Mz//5+vmE0a2TnY4QnljeXYZWxRNEToYhnQXkdp4ppPK2dO8NO2xrg/s27c+QHf8Z5ZvVENtBvMQQs69phTJI+6tdePxI/uOBTK3SxHwOs64p9d2adaq66OG0Ar5/SFeCvJRpOA5L7zuhevG+b0wRUEGEI/8YcK4wlSwz8zhgwUvj5j20aoX/jSFIZDUbdg2buyTK96NLl2mPYBSuA/8svPxKaM6Pns241TQbkIecOOERURJhUqJsZFRcQmTZn3S0TC4BWgGlPG1e11BAYrdStick5GxZtKo9rtxcfTAge8CMunJGzPm76xfs06DzQilTTfbl86f2WH5kjFBZfA/EnDjFMV11/1F+j3wTDmbjWplyyc0ji1TYbbIpSddudy8tn/PtndMxWEyODB+XEv/r8S/AqbN25pos9E4Jzd7zROPtC/xeUJXSlAa50LuHTYjoWffsT+JXPwsSqUwP3x/wZBXZw1d5L/M/rcJeAegN47vcx0xXeqIF1n6L7s3J/sjH42HoDfOZ59NUGdzM0egSL+YJj31xMZDybtLfFKW5jeC3jgAjw9t8mmumzEUcViFUqw/uefQsF9//uayD7LQ+E7Q13HOUb36zdw1eELT8EgGArUVZClYNX/msOUnjv6SG+j8NBqNRqPRaDQajUaj0Wg0Go1Go9FoNBqNRqPRaDQajcZX/h/HXwQ9zEQazAAAAABJRU5ErkJggg==\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIcAAACHCAYAAAA850oKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAADJlJREFUeJzt3Xd0FPUWB/DvnQVCjQFCAGkhpFASSugICUVRmkBWukBAODxeUGlSRDoElCpIVFCD4OFRElSe5IFSDE2IQKRKjzSlBBASpGXnvj9gwgIpm+zu7C65n3P2nJ3y+/1uJndnfjvz2xlACCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEE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15kdMmR9XAJk1sVRcRGWxZX17htMlhizENROT+qC4GkGJ1UHakxepMnDY5jKGKVT/2Mf+tLIA71tZnb84wfuNpDk+Oz9ecNXuGChtc6AaH9sEcFhuvaj+gcugXBt0bL1ex6hOPxiAiN7NXemZ07z+tlt6xOYYnJs3dNFybejjSLX175NfmB9Vt1de9eBldI9M1OfyrNyq3YPlRi5621DV83G99B89paO+YHG1M5BdLatZrle3tMBWF2nz17Z/bi73gqduuVdfkiPx0166cdLw69hi+257xONpHSxLLN2jacYCl6ysKNZ08f/MkO4b0ZHt6NVS2vJ+3QlQxp+U+Wrz3mV+DPS98A2rneGyGd5WaE+wRS0Z0S44Fy05UzU05H/+6AbaORVhGt+QgBXVzVS6DWy0Kfei24UcOqLMmN+WSTiXKc9kcRLfkSLmZfDE35U4c2dfe1rE4C5UfX563uIzKut0CU7fkuHb1wu2EHetG5KQMM+9cPHfg5ezXdE09Wxftk9MnVr7Tu1qmT5+wNd1PR05ftCO2WtBLYdmtx8x/dGlZwFc1pVk0HM7do1SppeuuXLE0Dmd5lkrrnh+UGDRoSrL5CcCMMDN/t3J2s+WfjtLt6rLunb1xEU2NyVculFXT+GpGN59n5junj5wbaQxVKluaGK7sxxXTrhtDFSX58vmD2j1HzDEzX7t64YIxVFH0TAzAwRcymr38eeHqtfhNIqrLzKdVE329ZP6gXB1GChYqVjQ8YrbFD975bPYgp3vWm5eXHzr3HlmTCAMBKMz87Ya1n249m3Tguf+QCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQjip/wMACYyj66ebWgAAAABJRU5ErkJggg==\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAACICAYAAAA8uqNSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAACrhJREFUeJzt3XtUVVUeB/Dv715AwHiIiJqSiG8tnFRG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